faderport: add some "curated" actions for mix, proj and trns; make new bindings use...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Nov 2015 20:05:30 +0000 (15:05 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Nov 2015 20:05:30 +0000 (15:05 -0500)
libs/surfaces/faderport/faderport.cc
libs/surfaces/faderport/gui.cc
libs/surfaces/faderport/gui.h

index 4ecc71f74a8bfc6b4d4245ea41f7d8aca96f09ba..acad7f4358ea8ebc401d352fc881ed382750a786 100644 (file)
@@ -727,10 +727,12 @@ FaderPort::Button::invoke (FaderPort::ButtonState bs, bool press)
 
        if (press) {
                if ((x = on_press.find (bs)) == on_press.end()) {
+                       DEBUG_TRACE (DEBUG::FaderPort, string_compose ("no press action for button %1 state %2%3\%4\n", id, hex, bs, dec));
                        return;
                }
        } else {
-               if ((x = on_press.find (bs)) == on_release.end()) {
+               if ((x = on_release.find (bs)) == on_release.end()) {
+                       DEBUG_TRACE (DEBUG::FaderPort, string_compose ("no release action for button %1 state %2%3\%4\n", id, hex, bs, dec));
                        return;
                }
        }
@@ -780,6 +782,7 @@ FaderPort::Button::set_action (string const& name, bool when_pressed, FaderPort:
                if (name.empty()) {
                        on_press.erase (bs);
                } else {
+                       cerr << "Set button press " << id << " to action " << name << " state " << hex << bs << dec << endl;
                        todo.action_name = name;
                        on_press[bs] = todo;
                }
@@ -787,6 +790,7 @@ FaderPort::Button::set_action (string const& name, bool when_pressed, FaderPort:
                if (name.empty()) {
                        on_release.erase (bs);
                } else {
+                       cerr << "Set button rel " << id << " to action " << name << " state " << hex << bs << dec << endl;
                        todo.action_name = name;
                        on_release[bs] = todo;
                }
index e6be281c1a7eb2ebe15429e41929a4c336d7fc31..76ea18d7789959c79b888754b7cd6a75a16f89ea 100644 (file)
@@ -412,12 +412,14 @@ FPGUI::build_available_action_menu ()
 }
 
 void
-FPGUI::action_changed (Gtk::ComboBox* cb, FaderPort::ButtonID id)
+FPGUI::action_changed (Gtk::ComboBox* cb, FaderPort::ButtonID id, FaderPort::ButtonState bs)
 {
        TreeModel::const_iterator row = cb->get_active ();
        string action_path = (*row)[action_columns.path];
 
-       fp.set_action (id, action_path, true);
+       /* release binding */
+       cerr << "Reset release for " << id << " to " << action_path << " bs = " << hex << bs << dec << endl;
+       fp.set_action (id, action_path, false, bs);
 }
 
 void
@@ -457,7 +459,7 @@ FPGUI::build_action_combo (Gtk::ComboBox& cb, vector<pair<string,string> > const
                cb.set_active (active_row);
        }
 
-       cb.signal_changed().connect (sigc::bind (sigc::mem_fun (*this, &FPGUI::action_changed), &cb, id));
+       cb.signal_changed().connect (sigc::bind (sigc::mem_fun (*this, &FPGUI::action_changed), &cb, id, bs));
 }
 
 void
@@ -477,6 +479,11 @@ FPGUI::build_proj_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs)
        vector<pair<string,string> > actions;
 
        actions.push_back (make_pair (string("Toggle Meterbridge"), string(X_("Common/toggle-meterbridge"))));
+       actions.push_back (make_pair (string("Toggle Summary"), string(X_("Editor/ToggleSummary"))));
+       actions.push_back (make_pair (string("Toggle Editor Lists"), string(X_("Editor/show-editor-list"))));
+       actions.push_back (make_pair (string (_("Zoom to Session")), string (X_("Editor/zoom-to-session"))));
+       actions.push_back (make_pair (string (_("Zoom In")), string (X_("Editor/temporal-zoom-in"))));
+       actions.push_back (make_pair (string (_("Zoom Out")), string (X_("Editor/temporal-zoom-out"))));
 
        build_action_combo (cb, actions, FaderPort::Proj, bs);
 }
@@ -487,6 +494,9 @@ FPGUI::build_trns_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs)
        vector<pair<string,string> > actions;
 
        actions.push_back (make_pair (string("Toggle Locations"), string(X_("Window/toggle-locations"))));
+       actions.push_back (make_pair (string("Toggle Metronome"), string(X_("Transport/ToggleClick"))));
+       actions.push_back (make_pair (string("Toggle Sync"), string(X_("Transport/ToggleExternalSync"))));
+       actions.push_back (make_pair (string("Set Playhead @pointer"), string(X_("Editor/set-playhead"))));
 
        build_action_combo (cb, actions, FaderPort::Trns, bs);
 }
index 5c2ce4334ebe0c42bedb73e2eb8fb48bab5fff8d..a3e02141c8d63a99cfe453076b403067eb729675 100644 (file)
@@ -98,7 +98,7 @@ private:
        void build_trns_action_combo (Gtk::ComboBox&, FaderPort::ButtonState);
 
        void build_available_action_menu ();
-       void action_changed (Gtk::ComboBox*, FaderPort::ButtonID);
+       void action_changed (Gtk::ComboBox*, FaderPort::ButtonID, FaderPort::ButtonState);
 };
 
 }