From 9502fa261da714fcddfd7c27983be3541e1da659 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 13 Apr 2012 19:17:28 +0000 Subject: [PATCH] MCP: more button tracing, more config stuff git-svn-id: svn://localhost/ardour2/branches/3.0@11963 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/surfaces/mackie/gui.cc | 35 ++++++++++++------- .../mackie/mackie_control_protocol.cc | 13 +++++-- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc index 7fb93db687..bcc74ee99c 100644 --- a/libs/surfaces/mackie/gui.cc +++ b/libs/surfaces/mackie/gui.cc @@ -126,25 +126,34 @@ MackieControlProtocolGUI::rebuild_function_key_editor () CellRendererCombo* action_renderer = manage (new CellRendererCombo); action_renderer->property_model() = available_action_model; action_renderer->property_editable() = true; - action_renderer->property_text_column() = 0; + action_renderer->property_text_column() = 1; + action_renderer->property_has_entry() = false; - TreeViewColumn* plain_column = manage (new TreeViewColumn (_("Plain"), *action_renderer)); - function_key_editor.append_column (*plain_column); + TreeViewColumn* col; + + col = manage (new TreeViewColumn (_("Plain"), *action_renderer)); + col->add_attribute (action_renderer->property_text(), function_key_columns.plain); + function_key_editor.append_column (*col); - TreeViewColumn* shift_column = manage (new TreeViewColumn (_("Shift"), *action_renderer)); - function_key_editor.append_column (*shift_column); + col = manage (new TreeViewColumn (_("Shift"), *action_renderer)); + col->add_attribute (action_renderer->property_text(), function_key_columns.shift); + function_key_editor.append_column (*col); - TreeViewColumn* control_column = manage (new TreeViewColumn (_("Control"), *action_renderer)); - function_key_editor.append_column (*control_column); + col = manage (new TreeViewColumn (_("Control"), *action_renderer)); + col->add_attribute (action_renderer->property_text(), function_key_columns.control); + function_key_editor.append_column (*col); - TreeViewColumn* option_column = manage (new TreeViewColumn (_("Option"), *action_renderer)); - function_key_editor.append_column (*option_column); + col = manage (new TreeViewColumn (_("Option"), *action_renderer)); + col->add_attribute (action_renderer->property_text(), function_key_columns.option); + function_key_editor.append_column (*col); - TreeViewColumn* cmdalt_column = manage (new TreeViewColumn (_("Cmd/Alt"), *action_renderer)); - function_key_editor.append_column (*cmdalt_column); + col = manage (new TreeViewColumn (_("Cmd/Alt"), *action_renderer)); + col->add_attribute (action_renderer->property_text(), function_key_columns.cmdalt); + function_key_editor.append_column (*col); - TreeViewColumn* shiftcontrol_column = manage (new TreeViewColumn (_("Shift+Control"), *action_renderer)); - function_key_editor.append_column (*shiftcontrol_column); + col = manage (new TreeViewColumn (_("Shift+Control"), *action_renderer)); + col->add_attribute (action_renderer->property_text(), function_key_columns.shiftcontrol); + function_key_editor.append_column (*col); /* now fill with data */ diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index e03a146d2e..8100989597 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -1262,6 +1262,9 @@ MackieControlProtocol::down_controls (AutomationType p) return controls; } + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("looking for down buttons for %1, got %2\n", + p, m->second.size())); + pull_route_range (m->second, routes); switch (p) { @@ -1311,10 +1314,13 @@ MackieControlProtocol::pull_route_range (list& down, RouteList& select uint32_t last = down.back (); uint32_t first_surface = first>>8; - uint32_t first_strip = first&0x8; + uint32_t first_strip = first&0xf; uint32_t last_surface = last>>8; - uint32_t last_strip = last&0x8; + uint32_t last_strip = last&0xf; + + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("PRR %5 in list %1.%2 - %3.%4\n", first_surface, first_strip, last_surface, last_strip, + down.size())); for (Surfaces::const_iterator s = surfaces.begin(); s != surfaces.end(); ++s) { @@ -1335,6 +1341,9 @@ MackieControlProtocol::pull_route_range (list& down, RouteList& select ls = (*s)->n_strips (); } + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("adding strips for surface %1 (%2 .. %3)\n", + (*s)->number(), fs, ls)); + for (uint32_t n = fs; n < ls; ++n) { boost::shared_ptr r = (*s)->nth_strip (n)->route(); if (r) {