From 56281ba906843c8ba5728694eadd3ebbbac418e5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 18 Apr 2012 12:20:28 +0000 Subject: [PATCH] MCP: gui changes; more debugging for button bnding lookup git-svn-id: svn://localhost/ardour2/branches/3.0@12002 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/surfaces/mackie/gui.cc | 24 ++++++++++++++----- .../mackie/mackie_control_protocol.cc | 4 ++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc index 7bcd7681e1..6321495c59 100644 --- a/libs/surfaces/mackie/gui.cc +++ b/libs/surfaces/mackie/gui.cc @@ -74,9 +74,6 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) table->attach (*manage (new Gtk::Label (_("Device Type:"))), 0, 1, 0, 1, AttachOptions(FILL|EXPAND), AttachOptions(0)); table->attach (_surface_combo, 1, 2, 0, 1, AttachOptions(FILL|EXPAND), AttachOptions(0)); - table->attach (*manage (new Gtk::Label (_("Profile/Settings:"))), 0, 1, 1, 2, AttachOptions(FILL|EXPAND), AttachOptions(0)); - table->attach (_profile_combo, 1, 2, 1, 2, AttachOptions(FILL|EXPAND), AttachOptions(0)); - vector surfaces; for (std::map::iterator i = DeviceInfo::device_info.begin(); i != DeviceInfo::device_info.end(); ++i) { @@ -97,18 +94,33 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p) _profile_combo.set_active_text (p.device_profile().name()); _profile_combo.signal_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::profile_combo_changed)); - append_page (*table, _("Device Selection")); + append_page (*table, _("Device Setup")); table->show_all(); /* function key editor */ - append_page (function_key_scroller, _("Function Keys")); + VBox* fkey_packer = manage (new VBox); + HBox* profile_packer = manage (new HBox); + + + Label* l = manage (new Gtk::Label (_("Profile/Settings:"))); + profile_packer->pack_start (*l, false, false); + profile_packer->pack_start (_profile_combo, true, true); + profile_packer->set_spacing (12); + profile_packer->set_border_width (12); + + fkey_packer->pack_start (*profile_packer, false, false); + fkey_packer->pack_start (function_key_scroller, true, true); + fkey_packer->set_spacing (12); + function_key_scroller.set_size_request (700,700); + function_key_scroller.property_shadow_type() = Gtk::SHADOW_NONE; function_key_scroller.add (function_key_editor); + append_page (*fkey_packer, _("Function Keys")); build_available_action_menu (); build_function_key_editor (); refresh_function_key_editor (); - function_key_scroller.show_all(); + fkey_packer->show_all(); } CellRendererCombo* diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index e75d1824e2..d1416d6e9f 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -1041,6 +1041,9 @@ MackieControlProtocol::handle_button_event (Surface& surface, Button& button, Bu string action = _device_profile.get_button_action (button.bid(), _modifier_state); + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Looked up action for button %1 with modifier %2, got [%3]\n", + button.bid(), _modifier_state, action)); + if (!action.empty()) { /* if there is a bound action for this button, and this is a press event, carry out the action. If its a release event, do nothing since we @@ -1048,6 +1051,7 @@ MackieControlProtocol::handle_button_event (Surface& surface, Button& button, Bu occur either. */ if (bs == press) { + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("executing action %1\n", action)); access_action (action); } return; -- 2.30.2