From b02b6cc3cd3033c681feaa63f0d5292bce78f68d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 25 Jan 2016 14:48:21 -0500 Subject: [PATCH] faderport: add footswitch combos to GUI to allow user control over what the switch does --- libs/surfaces/faderport/gui.cc | 38 +++++++++++++++++++++++++++++++++- libs/surfaces/faderport/gui.h | 2 ++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/libs/surfaces/faderport/gui.cc b/libs/surfaces/faderport/gui.cc index 702ba26dc6..acd4d3ee5d 100644 --- a/libs/surfaces/faderport/gui.cc +++ b/libs/surfaces/faderport/gui.cc @@ -80,7 +80,7 @@ FaderPort::build_gui () FPGUI::FPGUI (FaderPort& p) : fp (p) , table (2, 5) - , action_table (4, 4) + , action_table (5, 4) , ignore_active_change (false) { set_border_width (12); @@ -138,6 +138,10 @@ FPGUI::FPGUI (FaderPort& p) build_available_action_menu (); + build_foot_action_combo (foot_combo[0], FaderPort::ButtonState(0)); + build_foot_action_combo (foot_combo[1], FaderPort::ShiftDown); + build_foot_action_combo (foot_combo[2], FaderPort::LongPress); + /* No shift-press combo for User because that is labelled as "next" * (marker) */ @@ -235,6 +239,24 @@ FPGUI::FPGUI (FaderPort& p) action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); action_row++; + l = manage (new Gtk::Label); + l->set_markup (string_compose ("%1", _("Footswitch"))); + l->set_alignment (1.0, 0.5); + action_table.attach (*l, 0, 1, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); + align = manage (new Alignment); + align->set (0.0, 0.5); + align->add (foot_combo[0]); + action_table.attach (*align, 1, 2, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); + align = manage (new Alignment); + align->set (0.0, 0.5); + align->add (foot_combo[1]); + action_table.attach (*align, 2, 3, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); + align = manage (new Alignment); + align->set (0.0, 0.5); + align->add (foot_combo[2]); + action_table.attach (*align, 3, 4, action_row, action_row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); + action_row++; + table.attach (action_table, 0, 5, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0)); row++; @@ -536,6 +558,20 @@ FPGUI::build_trns_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs) build_action_combo (cb, actions, FaderPort::Trns, bs); } +void +FPGUI::build_foot_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs) +{ + vector > actions; + + actions.push_back (make_pair (string("Toggle Roll"), string(X_("Transport/ToggleRoll")))); + actions.push_back (make_pair (string("Toggle Rec-Enable"), string(X_("Transport/Record")))); + +// 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); +} + bool FPGUI::find_action_in_model (const TreeModel::iterator& iter, std::string const & action_path, TreeModel::iterator* found) { diff --git a/libs/surfaces/faderport/gui.h b/libs/surfaces/faderport/gui.h index 907da73839..2a7a782910 100644 --- a/libs/surfaces/faderport/gui.h +++ b/libs/surfaces/faderport/gui.h @@ -62,6 +62,7 @@ private: Gtk::ComboBox proj_combo[3]; Gtk::ComboBox trns_combo[3]; Gtk::ComboBox user_combo[2]; + Gtk::ComboBox foot_combo[3]; void update_port_combos (); PBD::ScopedConnection connection_change_connection; @@ -100,6 +101,7 @@ private: void build_proj_action_combo (Gtk::ComboBox&, FaderPort::ButtonState); void build_trns_action_combo (Gtk::ComboBox&, FaderPort::ButtonState); void build_user_action_combo (Gtk::ComboBox&, FaderPort::ButtonState); + void build_foot_action_combo (Gtk::ComboBox&, FaderPort::ButtonState); void build_available_action_menu (); void action_changed (Gtk::ComboBox*, FaderPort::ButtonID, FaderPort::ButtonState);