diff --git a/libs/surfaces/console1/c1_gui.cc b/libs/surfaces/console1/c1_gui.cc index 9214b0ba3c..2b7810b244 100644 --- a/libs/surfaces/console1/c1_gui.cc +++ b/libs/surfaces/console1/c1_gui.cc @@ -177,55 +177,28 @@ C1GUI::C1GUI (Console1& p) // Create the page for plugin mappings p.load_mappings (); - VBox* plugconfig_packer = manage (new VBox); - HBox* plugselect_packer = manage (new HBox); + VBox* plugconfig_packer = build_plugin_assignment_page(); - l = manage (new Gtk::Label (_("Select Plugin"))); - plugselect_packer->pack_start (*l, false, false); + append_page (*plugconfig_packer, _ ("Plugin Mappings")); + plugconfig_packer->show_all (); - plugconfig_packer->pack_start (*plugselect_packer, false, false); - - Glib::RefPtr plugin_store_model = ListStore::create (plugin_columns); - TreeModel::Row plugin_combo_row; - for( const auto &pm : c1.getPluginMappingMap() ){ - plugin_combo_row = *(plugin_store_model->append ()); - plugin_combo_row[plugin_columns.plugin_name] = pm.second.name; - plugin_combo_row[plugin_columns.plugin_id] = pm.first; - DEBUG_TRACE (DEBUG::Console1, string_compose ("Add Plugin: name %1 / %2\n", pm.second.name, pm.first)); - } - plugins_combo.pack_start (plugin_columns.plugin_name); - plugins_combo.signal_changed ().connect ( - sigc::bind (sigc::mem_fun (*this, &C1GUI::active_plugin_changed), &plugins_combo)); - plugins_combo.set_model (plugin_store_model); + /* update the port connection combos */ - plugselect_packer->pack_start (plugins_combo, true, true); - plugin_mapping_scroller.property_shadow_type() = Gtk::SHADOW_NONE; - plugin_mapping_scroller.set_policy(Gtk::PolicyType::POLICY_AUTOMATIC, Gtk::PolicyType::POLICY_AUTOMATIC); + update_port_combos (); - plugin_mapping_scroller.add (plugin_assignment_editor); - plugconfig_packer->pack_start (plugin_mapping_scroller, true, true, 20); + /* catch future changes to connection state */ - build_plugin_assignment_editor (); - - append_page (*plugconfig_packer, _ ("Plugin Mappings")); - plugconfig_packer->show_all (); - - /* update the port connection combos */ - - update_port_combos (); - - /* catch future changes to connection state */ - - ARDOUR::AudioEngine::instance ()->PortRegisteredOrUnregistered.connect ( - _port_connections, invalidator (*this), std::bind (&C1GUI::connection_handler, this), gui_context ()); - ARDOUR::AudioEngine::instance ()->PortPrettyNameChanged.connect ( - _port_connections, invalidator (*this), std::bind (&C1GUI::connection_handler, this), gui_context ()); - c1.ConnectionChange.connect ( - _port_connections, invalidator (*this), std::bind (&C1GUI::connection_handler, this), gui_context ()); + ARDOUR::AudioEngine::instance ()->PortRegisteredOrUnregistered.connect ( + _port_connections, invalidator (*this), std::bind (&C1GUI::connection_handler, this), gui_context ()); + ARDOUR::AudioEngine::instance ()->PortPrettyNameChanged.connect ( + _port_connections, invalidator (*this), std::bind (&C1GUI::connection_handler, this), gui_context ()); + c1.ConnectionChange.connect ( + _port_connections, invalidator (*this), std::bind (&C1GUI::connection_handler, this), gui_context ()); } C1GUI::~C1GUI () { - write_plugin_assignment(); + DEBUG_TRACE (DEBUG::Console1, "1GUI::~C1GUI ()\n"); + c1.midi_assign_mode = false; } void @@ -375,120 +348,5 @@ C1GUI::active_port_changed (Gtk::ComboBox* combo, bool for_input) } } -void -C1GUI::change_controller (const Glib::ustring &sPath, const TreeModel::iterator &iter) -{ - Gtk::TreePath path(sPath); - Gtk::TreeModel::iterator row = plugin_assignment_store->get_iter(path); - int index = *path.begin (); - if (row) { - - string controllerName = (*iter)[c1.plugin_controller_columns.controllerName]; - int controllerId = (*iter)[c1.plugin_controller_columns.controllerId]; - pc.parameters[index].controllerId = Console1::ControllerID (controllerId); - (*row).set_value (plugin_assignment_editor_columns.controllerName, controllerName); - DEBUG_TRACE (DEBUG::Console1, - string_compose ("Column Name: Controller, index %1, name %2 \n", index, controllerName)); - assignement_changed = true; - } -} - -void C1GUI::toggle_shift( const Glib::ustring& s){ - int index = atoi (s.c_str()); - Gtk::TreeModel::iterator row = plugin_assignment_store->get_iter (s); - if( row ) - { - bool value = !pc.parameters[index].shift; - pc.parameters[index].shift = value; - (*row).set_value (plugin_assignment_editor_columns.shift, value); - DEBUG_TRACE (DEBUG::Console1, string_compose ("Column Name: Shift, value %1\n", value)); - assignement_changed = true; - } -} - -CellRendererCombo* -C1GUI::make_action_renderer (Glib::RefPtr model, Gtk::TreeModelColumnBase column) -{ - CellRendererCombo* renderer = manage (new CellRendererCombo); - renderer->property_model() = model; - renderer->property_editable() = true; - renderer->property_text_column () = 0; - renderer->property_has_entry () = false; - renderer->signal_changed().connect (sigc::mem_fun(*this, &C1GUI::change_controller)); - - return renderer; -} - -void -C1GUI::build_plugin_assignment_editor () -{ - plugin_assignment_editor.append_column (_("Key"), plugin_assignment_editor_columns.index); - plugin_assignment_editor.append_column (_("Name"), plugin_assignment_editor_columns.name); - plugin_assignment_editor.append_column (_("Switch"), plugin_assignment_editor_columns.is_switch); - - TreeViewColumn* col; - CellRendererCombo* renderer; - - CellRendererToggle* boolRenderer = manage (new CellRendererToggle); - boolRenderer->set_active (); - boolRenderer->property_activatable() = true; - col = manage (new TreeViewColumn (_ ("Shift"), *boolRenderer)); - col->add_attribute (boolRenderer->property_active (), plugin_assignment_editor_columns.shift); - boolRenderer->signal_toggled().connect (sigc::mem_fun(*this, &C1GUI::toggle_shift)); - plugin_assignment_editor.append_column (*col); - - - renderer = make_action_renderer (c1.getPluginControllerModel(), plugin_assignment_editor_columns.controllerName); - col = manage (new TreeViewColumn (_("Control"), *renderer)); - col->add_attribute (renderer->property_text(), plugin_assignment_editor_columns.controllerName); - plugin_assignment_editor.append_column (*col); - - plugin_assignment_store = ListStore::create (plugin_assignment_editor_columns); - plugin_assignment_editor.set_model (plugin_assignment_store); -} - - -void -C1GUI::active_plugin_changed(Gtk::ComboBox* combo ){ - DEBUG_TRACE (DEBUG::Console1, "C1GUI active_plugin_changed\n"); - - write_plugin_assignment (); - - plugin_assignment_editor.set_model (Glib::RefPtr()); - plugin_assignment_store->clear (); - - TreeModel::iterator active = combo->get_active (); - TreeModel::Row plugin_assignment_row; - - string new_plugin_name = (*active)[plugin_columns.plugin_name]; - string new_plugin_id = (*active)[plugin_columns.plugin_id]; - DEBUG_TRACE (DEBUG::Console1, string_compose ("Plugin: selected %1 / %2\n", new_plugin_name, new_plugin_id)); - pc = c1.getPluginMappingMap ()[new_plugin_id]; - - for( auto &parm : pc.parameters ){ - plugin_assignment_row = *(plugin_assignment_store->append ()); - plugin_assignment_row[plugin_assignment_editor_columns.index] = parm.first; - plugin_assignment_row[plugin_assignment_editor_columns.name] = parm.second.name; - plugin_assignment_row[plugin_assignment_editor_columns.controllerName] = c1.findControllerNameById(parm.second.controllerId); - plugin_assignment_row[plugin_assignment_editor_columns.is_switch] = parm.second.is_switch; - plugin_assignment_row[plugin_assignment_editor_columns.shift] = parm.second.shift; - - DEBUG_TRACE (DEBUG::Console1, string_compose ("Parameter Name %1 \n", parm.second.name)); - DEBUG_TRACE (DEBUG::Console1, string_compose ("Parameter Index: %1 - index %2 \n", parm.first, parm.second.paramIndex)); - DEBUG_TRACE (DEBUG::Console1, string_compose ("ControllerId: %1 \n", parm.second.controllerId)); - DEBUG_TRACE (DEBUG::Console1, string_compose ("is switch? %1 \n", parm.second.is_switch)); - DEBUG_TRACE (DEBUG::Console1, string_compose ("is shift? %1 \n", parm.second.shift)); - } - plugin_assignment_editor.set_model (plugin_assignment_store); - -} - -void C1GUI::write_plugin_assignment(){ - DEBUG_TRACE (DEBUG::Console1, "write_plugin_assignment\n"); - if( !assignement_changed ) - return; - c1.write_plugin_mapping (pc); - assignement_changed = false; -} } // namespace Console1 \ No newline at end of file diff --git a/libs/surfaces/console1/c1_gui.h b/libs/surfaces/console1/c1_gui.h index 3594d6a7a6..47ad79f093 100644 --- a/libs/surfaces/console1/c1_gui.h +++ b/libs/surfaces/console1/c1_gui.h @@ -56,22 +56,23 @@ public: private: Console1& c1; PBD::ScopedConnectionList lcxl_connections; - Gtk::VBox hpacker; - Gtk::Table table; - Gtk::ComboBox input_combo; - Gtk::ComboBox output_combo; - Gtk::ComboBox plugins_combo; - Gtk::ScrolledWindow plugin_mapping_scroller; - Gtk::Image image; + Gtk::VBox hpacker; + Gtk::Table table; + Gtk::ComboBox input_combo; + Gtk::ComboBox output_combo; + + Gtk::Image image; Gtk::CheckButton swap_solo_mute_cb; Gtk::CheckButton band_q_as_send_cb; Gtk::CheckButton create_plugin_stubs_btn; - Gtk::TreeView plugin_assignment_editor; + Gtk::ScrolledWindow plugin_mapping_scroller; + Gtk::ComboBox plugins_combo; + Gtk::TreeView plugin_assignment_editor; + Gtk::ToggleButton* midi_assign_button; + Gtk::VBox plugin_packer; - Gtk::VBox plugin_packer; - - bool assignement_changed = false; + sigc::signal plugin_assignment_changed; void update_port_combos (); PBD::ScopedConnection connection_change_connection; @@ -120,17 +121,20 @@ private: Glib::RefPtr build_midi_port_list (std::vector const & ports, bool for_input); + Console1::PluginMapping pc; + Gtk::VBox* build_plugin_assignment_page (); Gtk::CellRendererCombo* make_action_renderer (Glib::RefPtr model, Gtk::TreeModelColumnBase column); - void build_plugin_assignment_editor (); - - void change_controller (const Glib::ustring &, const Gtk::TreeIter&); - void toggle_shift ( const Glib::ustring& ); - - void active_port_changed (Gtk::ComboBox*, bool for_input); + void build_plugin_assignment_editor (); + void plugin_assignment_editor_selection_changed (); + void change_controller_number (int controllerNumber, bool shiftState); + void midi_assign_button_toggled (Gtk::ToggleButton* b); + void change_controller (const Glib::ustring&, const Gtk::TreeIter&); + void toggle_shift (const Glib::ustring&); + void active_port_changed (Gtk::ComboBox*, bool for_input); void set_swap_solo_mute (); - void set_band_q_as_send(); + void set_band_q_as_send (); void set_create_mapping_stubs (); void active_plugin_changed (Gtk::ComboBox* combo); void write_plugin_assignment (); diff --git a/libs/surfaces/console1/c1_plugin_control_assignment.cc b/libs/surfaces/console1/c1_plugin_control_assignment.cc new file mode 100644 index 0000000000..268dbcc8bb --- /dev/null +++ b/libs/surfaces/console1/c1_plugin_control_assignment.cc @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2023 Holger Dehnhardt + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "c1_gui.h" + +#include "ardour/debug.h" +#include "console1.h" + +#include "pbd/i18n.h" + +using namespace PBD; +using namespace Gtk; +using namespace std; + + +namespace Console1 +{ + +VBox* +C1GUI::build_plugin_assignment_page () +{ + VBox* plugconfig_packer = manage (new VBox); + HBox* plugselect_packer = manage (new HBox); + + Gtk::Label* l; + l = manage (new Gtk::Label (_ ("Select Plugin"))); + plugselect_packer->pack_start (*l, false, false); + + plugconfig_packer->pack_start (*plugselect_packer, false, false); + + Glib::RefPtr plugin_store_model = ListStore::create (plugin_columns); + TreeModel::Row plugin_combo_row; + for (const auto& pm : c1.getPluginMappingMap ()) { + plugin_combo_row = *(plugin_store_model->append ()); + plugin_combo_row[plugin_columns.plugin_name] = pm.second.name; + plugin_combo_row[plugin_columns.plugin_id] = pm.first; + DEBUG_TRACE (DEBUG::Console1, string_compose ("Add Plugin: name %1 / %2\n", pm.second.name, pm.first)); + } + plugins_combo.pack_start (plugin_columns.plugin_name); + plugins_combo.signal_changed ().connect ( + sigc::bind (sigc::mem_fun (*this, &C1GUI::active_plugin_changed), &plugins_combo)); + plugins_combo.set_model (plugin_store_model); + + plugselect_packer->pack_start (plugins_combo, true, true); + plugin_mapping_scroller.property_shadow_type () = Gtk::SHADOW_NONE; + plugin_mapping_scroller.set_policy (Gtk::PolicyType::POLICY_AUTOMATIC, Gtk::PolicyType::POLICY_AUTOMATIC); + + plugin_mapping_scroller.add (plugin_assignment_editor); + plugconfig_packer->pack_start (plugin_mapping_scroller, true, true, 20); + + build_plugin_assignment_editor (); + + midi_assign_button = manage (new ToggleButton (_ ("assign Control per MIDI"))); + midi_assign_button->set_sensitive (false); + midi_assign_button->set_active (false); + midi_assign_button->signal_toggled ().connect (sigc::bind (sigc::mem_fun (*this, &C1GUI::midi_assign_button_toggled), midi_assign_button)); + plugconfig_packer->pack_start (*midi_assign_button, false, false); + plugin_assignment_changed.connect (sigc::mem_fun (*this, &C1GUI::write_plugin_assignment)); + return plugconfig_packer; +} + +void +C1GUI::build_plugin_assignment_editor () +{ + plugin_assignment_editor.append_column (_ ("Key"), plugin_assignment_editor_columns.index); + plugin_assignment_editor.append_column (_ ("Name"), plugin_assignment_editor_columns.name); + plugin_assignment_editor.append_column (_ ("Switch"), plugin_assignment_editor_columns.is_switch); + + TreeViewColumn* col; + CellRendererCombo* controlRenderer; + + CellRendererToggle* boolRenderer = manage (new CellRendererToggle); + boolRenderer->set_active (); + boolRenderer->property_activatable () = true; + col = manage (new TreeViewColumn (_ ("Shift"), *boolRenderer)); + col->add_attribute (boolRenderer->property_active (), plugin_assignment_editor_columns.shift); + boolRenderer->signal_toggled ().connect (sigc::mem_fun (*this, &C1GUI::toggle_shift)); + plugin_assignment_editor.append_column (*col); + + controlRenderer = make_action_renderer (c1.getPluginControllerModel (), plugin_assignment_editor_columns.controllerName); + col = manage (new TreeViewColumn (_ ("Control"), *controlRenderer)); + col->add_attribute (controlRenderer->property_text (), plugin_assignment_editor_columns.controllerName); + plugin_assignment_editor.append_column (*col); + + plugin_assignment_store = ListStore::create (plugin_assignment_editor_columns); + plugin_assignment_editor.set_model (plugin_assignment_store); +} + +void +C1GUI::active_plugin_changed (Gtk::ComboBox* combo) +{ + DEBUG_TRACE (DEBUG::Console1, "C1GUI active_plugin_changed\n"); + + write_plugin_assignment (); + + plugin_assignment_editor.set_model (Glib::RefPtr ()); + plugin_assignment_store->clear (); + + TreeModel::iterator active = combo->get_active (); + TreeModel::Row plugin_assignment_row; + + string new_plugin_name = (*active)[plugin_columns.plugin_name]; + string new_plugin_id = (*active)[plugin_columns.plugin_id]; + DEBUG_TRACE (DEBUG::Console1, string_compose ("Plugin: selected %1 / %2\n", new_plugin_name, new_plugin_id)); + pc = c1.getPluginMappingMap ()[new_plugin_id]; + + for (auto& parm : pc.parameters) { + plugin_assignment_row = *(plugin_assignment_store->append ()); + plugin_assignment_row[plugin_assignment_editor_columns.index] = parm.first; + plugin_assignment_row[plugin_assignment_editor_columns.name] = parm.second.name; + plugin_assignment_row[plugin_assignment_editor_columns.controllerName] = c1.findControllerNameById (parm.second.controllerId); + plugin_assignment_row[plugin_assignment_editor_columns.is_switch] = parm.second.is_switch; + plugin_assignment_row[plugin_assignment_editor_columns.shift] = parm.second.shift; + + DEBUG_TRACE (DEBUG::Console1, string_compose ("Parameter Name %1 \n", parm.second.name)); + DEBUG_TRACE (DEBUG::Console1, string_compose ("Parameter Index: %1 - index %2 \n", parm.first, parm.second.paramIndex)); + DEBUG_TRACE (DEBUG::Console1, string_compose ("ControllerId: %1 \n", parm.second.controllerId)); + DEBUG_TRACE (DEBUG::Console1, string_compose ("is switch? %1 \n", parm.second.is_switch)); + DEBUG_TRACE (DEBUG::Console1, string_compose ("is shift? %1 \n", parm.second.shift)); + } + plugin_assignment_editor.set_model (plugin_assignment_store); + plugin_assignment_editor.get_selection ()->set_mode (SELECTION_SINGLE); + plugin_assignment_editor.get_selection ()->signal_changed ().connect (sigc::mem_fun (*this, &C1GUI::plugin_assignment_editor_selection_changed)); + midi_assign_button->set_sensitive (false); + midi_assign_button->set_active (false); +} + +CellRendererCombo* +C1GUI::make_action_renderer (Glib::RefPtr model, Gtk::TreeModelColumnBase column) +{ + CellRendererCombo* renderer = manage (new CellRendererCombo); + renderer->property_model () = model; + renderer->property_editable () = true; + renderer->property_text_column () = 0; + renderer->property_has_entry () = false; + renderer->signal_changed ().connect (sigc::mem_fun (*this, &C1GUI::change_controller)); + + return renderer; +} + +void +C1GUI::change_controller (const Glib::ustring& sPath, const TreeModel::iterator& iter) +{ + Gtk::TreePath path (sPath); + Gtk::TreeModel::iterator row = plugin_assignment_store->get_iter (path); + int index = *path.begin (); + if (row) { + string controllerName = (*iter)[c1.plugin_controller_columns.controllerName]; + int controllerId = (*iter)[c1.plugin_controller_columns.controllerId]; + pc.parameters[index].controllerId = Console1::ControllerID (controllerId); + (*row).set_value (plugin_assignment_editor_columns.controllerName, controllerName); + DEBUG_TRACE (DEBUG::Console1, + string_compose ("Column Name: Controller, index %1, name %2 \n", index, controllerName)); + plugin_assignment_changed (); + } +} + +void +C1GUI::plugin_assignment_editor_selection_changed () +{ + if (plugin_assignment_editor.get_selection ()->count_selected_rows () != 1) { + midi_assign_button->set_sensitive (false); + } + midi_assign_button->set_sensitive (true); +} + +void +C1GUI::write_plugin_assignment () +{ + DEBUG_TRACE (DEBUG::Console1, "write_plugin_assignment\n"); + c1.write_plugin_mapping (pc); +} + +void +C1GUI::change_controller_number( int controllerNumber, bool shiftState ){ + DEBUG_TRACE (DEBUG::Console1, string_compose ("C1GUI::change_controller_number: received %1\n", controllerNumber)); + Gtk::TreeModel::iterator row = plugin_assignment_editor.get_selection ()->get_selected (); + + if (row) { + string name = c1.findControllerNameById (Console1::ControllerID(controllerNumber)); + (*row).set_value (plugin_assignment_editor_columns.controllerName, name); + (*row).set_value (plugin_assignment_editor_columns.shift, shiftState); + int index = (*row).get_value (plugin_assignment_editor_columns.index); + pc.parameters[index].controllerId = Console1::ControllerID (controllerNumber); + pc.parameters[index].shift = shiftState ? 1 : 0; + plugin_assignment_changed (); + } + midi_assign_button->set_active (false); + midi_assign_button->set_sensitive (false); +} + +void +C1GUI::midi_assign_button_toggled (Gtk::ToggleButton* b) +{ + DEBUG_TRACE (DEBUG::Console1, "C1GUI::midi_assign_button_changed() \n"); + bool en = b->get_active (); + c1.midi_assign_mode = en; + if( en ) + c1.SendControllerNumber.connect (std::bind ( &C1GUI::change_controller_number, this, _1, _2)); +} + +void +C1GUI::toggle_shift (const Glib::ustring& s) +{ + int index = atoi (s.c_str ()); + Gtk::TreeModel::iterator row = plugin_assignment_store->get_iter (s); + if (row) { + bool value = !pc.parameters[index].shift; + pc.parameters[index].shift = value; + (*row).set_value (plugin_assignment_editor_columns.shift, value); + DEBUG_TRACE (DEBUG::Console1, string_compose ("Column Name: Shift, value %1\n", value)); + plugin_assignment_changed (); + } +} + +} \ No newline at end of file diff --git a/libs/surfaces/console1/c1_plugin_operations.cc b/libs/surfaces/console1/c1_plugin_operations.cc index 83333ad5e2..bfb7ec8449 100644 --- a/libs/surfaces/console1/c1_plugin_operations.cc +++ b/libs/surfaces/console1/c1_plugin_operations.cc @@ -204,7 +204,7 @@ Console1::write_plugin_mapping (PluginMapping &mapping) node.set_property ("NAME", mapping.name); for (const auto& plugin_param : mapping.parameters ) { - DEBUG_TRACE (DEBUG::Console1, string_compose ("write_plugin_mapping: Plugin parameter %1: %2\n",plugin_param.first ,plugin_param.second.name)); + DEBUG_TRACE (DEBUG::Console1, string_compose ("write_plugin_mapping: Plugin parameter %1: %2 - shift: %3\n", plugin_param.first, plugin_param.second.name, plugin_param.second.shift)); XMLNode param = XMLNode ("param-mapping"); param.set_property ("id", plugin_param.second.paramIndex); XMLNode name = XMLNode ("name"); diff --git a/libs/surfaces/console1/console1.cc b/libs/surfaces/console1/console1.cc index 023a65027d..974391a3be 100644 --- a/libs/surfaces/console1/console1.cc +++ b/libs/surfaces/console1/console1.cc @@ -439,11 +439,17 @@ Console1::handle_midi_controller_message (MIDI::Parser&, MIDI::EventTwoBytes* tb { uint32_t controller_number = static_cast (tb->controller_number); uint32_t value = static_cast (tb->value); - DEBUG_TRACE (DEBUG::Console1, + + DEBUG_TRACE (DEBUG::Console1, string_compose ("handle_midi_controller_message cn: '%1' val: '%2'\n", controller_number, value)); DEBUG_TRACE (DEBUG::Console1, string_compose ("handle_midi_controller_message shift state: '%1' plugin state: '%2'\n", shift_state, in_plugin_state)); + if (midi_assign_mode && (controller_number != ControllerID::PRESET)) { + SendControllerNumber (controller_number, shift_state); + return; + } + try { Controller* controller = controllerMap[ControllerID (controller_number)]; if (controller ) { diff --git a/libs/surfaces/console1/console1.h b/libs/surfaces/console1/console1.h index c7bb5626c8..66884248b2 100644 --- a/libs/surfaces/console1/console1.h +++ b/libs/surfaces/console1/console1.h @@ -23,6 +23,8 @@ #include #include +#include + #include #include @@ -128,6 +130,8 @@ public: bool create_mapping_stubs; bool switch_eq_q_dials = true; + bool midi_assign_mode = false; + bool in_use(){ return _in_use; } @@ -135,90 +139,91 @@ public: PBD::Signal ConnectionChange; /* Timer Events */ - PBD::Signal BlinkIt; - PBD::Signal Periodic; + PBD::Signal BlinkIt; + PBD::Signal Periodic; - /* Local Signals */ - PBD::Signal BankChange; - PBD::Signal ShiftChange; - PBD::Signal PluginStateChange; - PBD::Signal EQBandQBindingChange; + /* Local Signals */ + PBD::Signal BankChange; + PBD::Signal ShiftChange; + PBD::Signal PluginStateChange; + PBD::Signal EQBandQBindingChange; + sigc::signal2 SendControllerNumber; - enum ControllerID { - CONTROLLER_NONE = 0, - VOLUME = 7, - PAN = 10, - MUTE = 12, - SOLO = 13, - ORDER = 14, - DRIVE = 15, - EXTERNAL_SIDECHAIN = 17, - CHARACTER = 18, - FOCUS1 = 21, - FOCUS2, - FOCUS3, - FOCUS4, - FOCUS5, - FOCUS6, - FOCUS7, - FOCUS8, - FOCUS9, - FOCUS10, - FOCUS11, - FOCUS12, - FOCUS13, - FOCUS14, - FOCUS15, - FOCUS16, - FOCUS17, - FOCUS18, - FOCUS19, - FOCUS20 = 40, - COMP = 46, - COMP_THRESH = 47, - COMP_RELEASE = 48, - COMP_RATIO = 49, - COMP_PAR = 50, - COMP_ATTACK = 51, - SHAPE = 53, - SHAPE_GATE = 54, - SHAPE_SUSTAIN = 55, - SHAPE_RELEASE = 56, - SHAPE_PUNCH = 57, - PRESET = 58, - HARD_GATE = 59, - FILTER_TO_COMPRESSORS = 61, - HIGH_SHAPE = 65, - EQ = 80, - HIGH_GAIN = 82, - HIGH_FREQ = 83, - HIGH_MID_GAIN = 85, - HIGH_MID_FREQ = 86, - HIGH_MID_SHAPE = 87, - LOW_MID_GAIN = 88, - LOW_MID_FREQ = 89, - LOW_MID_SHAPE = 90, - LOW_GAIN = 91, - LOW_FREQ = 92, - LOW_SHAPE = 93, - PAGE_UP = 96, - PAGE_DOWN = 97, - DISPLAY_ON = 102, - LOW_CUT = 103, - MODE = 104, - HIGH_CUT = 105, - GAIN = 107, - PHASE_INV = 108, - INPUT_METER_L = 110, - INPUT_METER_R = 111, - OUTPUT_METER_L = 112, - OUTPUT_METER_R = 113, - SHAPE_METER = 114, - COMP_METER = 115, - TRACK_COPY = 120, - TRACK_GROUP = 123, + enum ControllerID { + CONTROLLER_NONE = 0, + VOLUME = 7, + PAN = 10, + MUTE = 12, + SOLO = 13, + ORDER = 14, + DRIVE = 15, + EXTERNAL_SIDECHAIN = 17, + CHARACTER = 18, + FOCUS1 = 21, + FOCUS2, + FOCUS3, + FOCUS4, + FOCUS5, + FOCUS6, + FOCUS7, + FOCUS8, + FOCUS9, + FOCUS10, + FOCUS11, + FOCUS12, + FOCUS13, + FOCUS14, + FOCUS15, + FOCUS16, + FOCUS17, + FOCUS18, + FOCUS19, + FOCUS20 = 40, + COMP = 46, + COMP_THRESH = 47, + COMP_RELEASE = 48, + COMP_RATIO = 49, + COMP_PAR = 50, + COMP_ATTACK = 51, + SHAPE = 53, + SHAPE_GATE = 54, + SHAPE_SUSTAIN = 55, + SHAPE_RELEASE = 56, + SHAPE_PUNCH = 57, + PRESET = 58, + HARD_GATE = 59, + FILTER_TO_COMPRESSORS = 61, + HIGH_SHAPE = 65, + EQ = 80, + HIGH_GAIN = 82, + HIGH_FREQ = 83, + HIGH_MID_GAIN = 85, + HIGH_MID_FREQ = 86, + HIGH_MID_SHAPE = 87, + LOW_MID_GAIN = 88, + LOW_MID_FREQ = 89, + LOW_MID_SHAPE = 90, + LOW_GAIN = 91, + LOW_FREQ = 92, + LOW_SHAPE = 93, + PAGE_UP = 96, + PAGE_DOWN = 97, + DISPLAY_ON = 102, + LOW_CUT = 103, + MODE = 104, + HIGH_CUT = 105, + GAIN = 107, + PHASE_INV = 108, + INPUT_METER_L = 110, + INPUT_METER_R = 111, + OUTPUT_METER_L = 112, + OUTPUT_METER_R = 113, + SHAPE_METER = 114, + COMP_METER = 115, + TRACK_COPY = 120, + TRACK_GROUP = 123, - }; + }; enum EQ_MODE { EQM_UNDEFINED = -1, diff --git a/libs/surfaces/console1/wscript b/libs/surfaces/console1/wscript index ac26bf386f..b9af2156ca 100644 --- a/libs/surfaces/console1/wscript +++ b/libs/surfaces/console1/wscript @@ -15,6 +15,7 @@ def build(bld): console1.cc c1_operations.cc c1_plugin_operations.cc + c1_plugin_control_assignment.cc c1_gui.cc ''' obj.defines = [ 'PACKAGE="ardour_console1"' ]