MCP: more button tracing, more config stuff
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 13 Apr 2012 17:58:36 +0000 (17:58 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 13 Apr 2012 17:58:36 +0000 (17:58 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11962 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/gui.cc
libs/surfaces/mackie/gui.h
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/strip.cc

index b710f8076f1d9ab8ee68bfd6bea2a38f6569a68e..7fb93db687640d5998f86552f365a4ca55217d14 100644 (file)
@@ -69,8 +69,8 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
        Gtk::Table* table = Gtk::manage (new Gtk::Table (2, 2));
        table->set_spacings (4);
        
-       table->attach (*manage (new Gtk::Label (_("Surface type:"))), 0, 1, 0, 1);
-       table->attach (_surface_combo, 1, 2, 0, 1);
+       table->attach (*manage (new Gtk::Label (_("Surface type:"))), 0, 1, 0, 1, AttachOptions(FILL|EXPAND), AttachOptions(0));
+       table->attach (_surface_combo, 1, 2, 0, 1, AttachOptions(FILL|EXPAND), AttachOptions(0));
 
        vector<string> surfaces;
        
@@ -123,12 +123,51 @@ MackieControlProtocolGUI::rebuild_function_key_editor ()
 
        function_key_editor.append_column (_("Key"), function_key_columns.name);
 
-       CellRendererCombo* plain_renderer = manage (new CellRendererCombo);
-       plain_renderer->property_model() = available_action_model;
-       plain_renderer->property_editable() = true;
-       plain_renderer->property_text_column() = 1;
-       TreeViewColumn* plain_column = manage (new TreeViewColumn (_("plain"), *plain_renderer));
+       CellRendererCombo* action_renderer = manage (new CellRendererCombo);
+       action_renderer->property_model() = available_action_model;
+       action_renderer->property_editable() = true;
+       action_renderer->property_text_column() = 0;
+
+       TreeViewColumn* plain_column = manage (new TreeViewColumn (_("Plain"), *action_renderer));
        function_key_editor.append_column (*plain_column);
+       
+       TreeViewColumn* shift_column = manage (new TreeViewColumn (_("Shift"), *action_renderer));
+       function_key_editor.append_column (*shift_column);
+
+       TreeViewColumn* control_column = manage (new TreeViewColumn (_("Control"), *action_renderer));
+       function_key_editor.append_column (*control_column);
+
+       TreeViewColumn* option_column = manage (new TreeViewColumn (_("Option"), *action_renderer));
+       function_key_editor.append_column (*option_column);
+
+       TreeViewColumn* cmdalt_column = manage (new TreeViewColumn (_("Cmd/Alt"), *action_renderer));
+       function_key_editor.append_column (*cmdalt_column);
+
+       TreeViewColumn* shiftcontrol_column = manage (new TreeViewColumn (_("Shift+Control"), *action_renderer));
+       function_key_editor.append_column (*shiftcontrol_column);
+
+       /* now fill with data */
+
+       function_key_model = ListStore::create (function_key_columns);
+
+       r = *(function_key_model->append());
+       r[function_key_columns.name] = "F1";
+       r = *(function_key_model->append());
+       r[function_key_columns.name] = "F2";
+       r = *(function_key_model->append());
+       r[function_key_columns.name] = "F3";
+       r = *(function_key_model->append());
+       r[function_key_columns.name] = "F4";
+       r = *(function_key_model->append());
+       r[function_key_columns.name] = "F5";
+       r = *(function_key_model->append());
+       r[function_key_columns.name] = "F6";
+       r = *(function_key_model->append());
+       r[function_key_columns.name] = "F7";
+       r = *(function_key_model->append());
+       r[function_key_columns.name] = "F8";
+
+       function_key_editor.set_model (function_key_model);
 }
 
 void
index a20429a60ac85edeb61a4687f78a3d63bf86429a..fd36d69cfdf54d4003efb2a6a2869be6ee9e908d 100644 (file)
@@ -52,7 +52,7 @@ class MackieControlProtocolGUI : public Gtk::Notebook
     struct FunctionKeyColumns : public Gtk::TreeModel::ColumnRecord {
        FunctionKeyColumns() {
                add (name);
-               add (unmodified);
+               add (plain);
                add (shift);
                add (control);
                add (option);
@@ -60,7 +60,7 @@ class MackieControlProtocolGUI : public Gtk::Notebook
                add (shiftcontrol);
        };
        Gtk::TreeModelColumn<std::string> name;
-       Gtk::TreeModelColumn<std::string> unmodified;
+       Gtk::TreeModelColumn<std::string> plain;
        Gtk::TreeModelColumn<std::string> shift;
        Gtk::TreeModelColumn<std::string> control;
        Gtk::TreeModelColumn<std::string> option;
index 2b9cda74799f3df938325536dbdc9d71c4cebbfd..e03a146d2ea2c8201ed0d5f619b8672657c6f7e4 100644 (file)
@@ -1208,6 +1208,8 @@ MackieControlProtocol::select_range ()
 
        pull_route_range (_down_select_buttons, routes);
 
+       DEBUG_TRACE (DEBUG::MackieControl, string_compose ("select range: found %1 routes\n", routes.size()));
+
        if (!routes.empty()) {
                for (RouteList::iterator r = routes.begin(); r != routes.end(); ++r) {
                        if (r == routes.begin()) {
index eaeb94e72c18d8e2a2327fcbc3387c6b5a9096a1..cc897c44867af1180c8d9f019101f8fb0cd3d9b5 100644 (file)
@@ -415,10 +415,13 @@ Strip::handle_button (Button& button, ButtonState bs)
                                return;
                        }
                        
+                       DEBUG_TRACE (DEBUG::MackieControl, "add select button on press\n");
                        _surface->mcp().add_down_select_button (_surface->number(), _index);                    
+
                        _surface->mcp().select_range ();
 
                } else {
+                       DEBUG_TRACE (DEBUG::MackieControl, "remove select button on release\n");
                        _surface->mcp().remove_down_select_button (_surface->number(), _index);                 
                }
 
@@ -448,6 +451,7 @@ Strip::handle_button (Button& button, ButtonState bs)
        if (control) {
 
                if (bs == press) {
+                       DEBUG_TRACE (DEBUG::MackieControl, "add button on release\n");
                        _surface->mcp().add_down_button ((AutomationType) control->parameter().type(), _surface->number(), _index);
                        
                        float new_value;
@@ -467,6 +471,9 @@ Strip::handle_button (Button& button, ButtonState bs)
                        MackieControlProtocol::ControlList controls = _surface->mcp().down_controls ((AutomationType) control->parameter().type());
                        
                        
+                       DEBUG_TRACE (DEBUG::MackieControl, string_compose ("there are %1 buttons down for control type %2, new value = %3\n",
+                                                                           controls.size(), control->parameter().type(), new_value));
+
                        /* apply change */
 
                        for (MackieControlProtocol::ControlList::iterator c = controls.begin(); c != controls.end(); ++c) {
@@ -474,6 +481,7 @@ Strip::handle_button (Button& button, ButtonState bs)
                        }
 
                } else {
+                       DEBUG_TRACE (DEBUG::MackieControl, "remove button on release\n");
                        _surface->mcp().remove_down_button ((AutomationType) control->parameter().type(), _surface->number(), _index);
                }