X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fsurfaces%2Fmackie%2Fgui.cc;h=d9d473728fc8c9133aee80656ccb84a6ce87e73d;hb=53c47e0ccd663ee2118f988c0dde140b7aee4173;hp=16f2d52bddaedde7b599173cdf25cf5efad23213;hpb=4129b8865c6cc57ad922130c3784b0337df9d507;p=ardour.git diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc index 16f2d52bdd..d9d473728f 100644 --- a/libs/surfaces/mackie/gui.cc +++ b/libs/surfaces/mackie/gui.cc @@ -111,6 +111,12 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) RadioButtonGroup rb_group = absolute_touch_mode_button.get_group(); touch_move_mode_button.set_group (rb_group); + recalibrate_fader_button.signal_clicked().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::recalibrate_faders)); + backlight_button.signal_clicked().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::toggle_backlight)); + + touch_sensitivity_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::touch_sensitive_change)); + touch_sensitivity_scale.set_update_policy (Gtk::UPDATE_DISCONTINUOUS); + l = manage (new Gtk::Label (_("Button click"))); l->set_alignment (1.0, 0.5); table->attach (*l, 0, 1, 1, 2, AttachOptions(FILL|EXPAND), AttachOptions (0)); @@ -154,7 +160,6 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) ipmidi_base_port_spinner.set_sensitive (_cp.device_info().uses_ipmidi()); ipmidi_base_port_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::ipmidi_spinner_changed)); - table->attach (discover_button, 1, 2, 8, 9, AttachOptions(FILL|EXPAND), AttachOptions (0)); discover_button.signal_clicked().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::discover_clicked)); @@ -251,6 +256,22 @@ MackieControlProtocolGUI::build_available_action_menu () parent = *(rowp); parent[available_action_columns.name] = _("Remove Binding"); + /* Key aliasing */ + + rowp = available_action_model->append(); + parent = *(rowp); + parent[available_action_columns.name] = _("Shift"); + rowp = available_action_model->append(); + parent = *(rowp); + parent[available_action_columns.name] = _("Control"); + rowp = available_action_model->append(); + parent = *(rowp); + parent[available_action_columns.name] = _("Option"); + rowp = available_action_model->append(); + parent = *(rowp); + parent[available_action_columns.name] = _("CmdAlt"); + + for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) { TreeModel::Row row; @@ -385,11 +406,17 @@ MackieControlProtocolGUI::refresh_function_key_editor () if (action.empty()) { row[function_key_columns.plain] = defstring; } else { - act = ActionManager::get_action (action.c_str()); - if (act) { - row[function_key_columns.plain] = act->get_label(); + if (action.find ('/') == string::npos) { + /* Probably a key alias */ + row[function_key_columns.plain] = action; } else { - row[function_key_columns.plain] = defstring; + + act = ActionManager::get_action (action.c_str()); + if (act) { + row[function_key_columns.plain] = act->get_label(); + } else { + row[function_key_columns.plain] = defstring; + } } } @@ -397,11 +424,16 @@ MackieControlProtocolGUI::refresh_function_key_editor () if (action.empty()) { row[function_key_columns.control] = defstring; } else { - act = ActionManager::get_action (action.c_str()); - if (act) { - row[function_key_columns.control] = act->get_label(); + if (action.find ('/') == string::npos) { + /* Probably a key alias */ + row[function_key_columns.control] = action; } else { - row[function_key_columns.control] = defstring; + act = ActionManager::get_action (action.c_str()); + if (act) { + row[function_key_columns.control] = act->get_label(); + } else { + row[function_key_columns.control] = defstring; + } } } @@ -409,11 +441,16 @@ MackieControlProtocolGUI::refresh_function_key_editor () if (action.empty()) { row[function_key_columns.shift] = defstring; } else { - act = ActionManager::get_action (action.c_str()); - if (act) { - row[function_key_columns.shift] = act->get_label(); + if (action.find ('/') == string::npos) { + /* Probably a key alias */ + row[function_key_columns.shift] = action; } else { - row[function_key_columns.shift] = defstring; + act = ActionManager::get_action (action.c_str()); + if (act) { + row[function_key_columns.shift] = act->get_label(); + } else { + row[function_key_columns.shift] = defstring; + } } } @@ -421,11 +458,16 @@ MackieControlProtocolGUI::refresh_function_key_editor () if (action.empty()) { row[function_key_columns.option] = defstring; } else { - act = ActionManager::get_action (action.c_str()); - if (act) { - row[function_key_columns.option] = act->get_label(); + if (action.find ('/') == string::npos) { + /* Probably a key alias */ + row[function_key_columns.option] = action; } else { - row[function_key_columns.option] = defstring; + act = ActionManager::get_action (action.c_str()); + if (act) { + row[function_key_columns.option] = act->get_label(); + } else { + row[function_key_columns.option] = defstring; + } } } @@ -433,11 +475,16 @@ MackieControlProtocolGUI::refresh_function_key_editor () if (action.empty()) { row[function_key_columns.cmdalt] = defstring; } else { - act = ActionManager::get_action (action.c_str()); - if (act) { - row[function_key_columns.cmdalt] = act->get_label(); + if (action.find ('/') == string::npos) { + /* Probably a key alias */ + row[function_key_columns.cmdalt] = action; } else { - row[function_key_columns.cmdalt] = defstring; + act = ActionManager::get_action (action.c_str()); + if (act) { + row[function_key_columns.cmdalt] = act->get_label(); + } else { + row[function_key_columns.cmdalt] = defstring; + } } } @@ -562,3 +609,22 @@ MackieControlProtocolGUI::discover_clicked () /* this should help to get things started */ _cp.midi_connectivity_established (); } + +void +MackieControlProtocolGUI::recalibrate_faders () +{ + _cp.recalibrate_faders (); +} + +void +MackieControlProtocolGUI::toggle_backlight () +{ + _cp.toggle_backlight (); +} + +void +MackieControlProtocolGUI::touch_sensitive_change () +{ + int sensitivity = (int) touch_sensitivity_adjustment.get_value (); + _cp.set_touch_sensitivity (sensitivity); +}