summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-11-30 15:05:30 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-11-30 15:05:30 -0500
commitf1dd53e37a1b4cb127bc962f473e34ede1d0c04f (patch)
tree30ee372eaa678d78745cb1ebbb752971e3e3d6cd
parentb8ed62453f1ee992ceaabe6bc1388143c0dcc3e0 (diff)
faderport: add some "curated" actions for mix, proj and trns; make new bindings use release, not press
-rw-r--r--libs/surfaces/faderport/faderport.cc6
-rw-r--r--libs/surfaces/faderport/gui.cc16
-rw-r--r--libs/surfaces/faderport/gui.h2
3 files changed, 19 insertions, 5 deletions
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc
index 4ecc71f74a..acad7f4358 100644
--- a/libs/surfaces/faderport/faderport.cc
+++ b/libs/surfaces/faderport/faderport.cc
@@ -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;
}
diff --git a/libs/surfaces/faderport/gui.cc b/libs/surfaces/faderport/gui.cc
index e6be281c1a..76ea18d778 100644
--- a/libs/surfaces/faderport/gui.cc
+++ b/libs/surfaces/faderport/gui.cc
@@ -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);
}
diff --git a/libs/surfaces/faderport/gui.h b/libs/surfaces/faderport/gui.h
index 5c2ce4334e..a3e02141c8 100644
--- a/libs/surfaces/faderport/gui.h
+++ b/libs/surfaces/faderport/gui.h
@@ -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);
};
}