diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-01 11:20:09 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-01 11:20:09 -0500 |
commit | 03a4926790b04d4f3929e88240fcddca76f24fd4 (patch) | |
tree | 841cf7ec35d3f0fc3c6c34941d214c333c95a326 /libs/surfaces/faderport/gui.cc | |
parent | 0e629cd162ab369c941f072f5b054d2aef0e3fb5 (diff) |
faderport: allow User button to be bound to ANY possible action.
This does involve nagivating some really gnarly menus, which is unfortunate, but we don't have a good general
solution for this yet (it is fundamentally the same problem that affects the key binding editor and Mackie support
Diffstat (limited to 'libs/surfaces/faderport/gui.cc')
-rw-r--r-- | libs/surfaces/faderport/gui.cc | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/libs/surfaces/faderport/gui.cc b/libs/surfaces/faderport/gui.cc index accf30e2ad..78f7ec5bc0 100644 --- a/libs/surfaces/faderport/gui.cc +++ b/libs/surfaces/faderport/gui.cc @@ -136,6 +136,12 @@ FPGUI::FPGUI (FaderPort& p) build_trns_action_combo (trns_combo[1], FaderPort::ShiftDown); build_trns_action_combo (trns_combo[2], FaderPort::LongPress); + build_available_action_menu (); + + build_user_action_combo (user_combo[0], FaderPort::ButtonState(0)); + build_user_action_combo (user_combo[1], FaderPort::ShiftDown); + build_user_action_combo (user_combo[2], FaderPort::LongPress); + action_table.set_row_spacings (4); action_table.set_col_spacings (6); action_table.set_border_width (12); @@ -211,6 +217,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 ("<span weight=\"bold\">%1</span>", _("User"))); + 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 (user_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 (user_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 (user_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++; @@ -406,7 +430,13 @@ FPGUI::build_available_action_menu () action_map[*l] = *p; } - row[action_columns.path] = (*p); + string path = (*p); + /* ControlProtocol::access_action() is not interested in the + legacy "<Actions>/" prefix part of a path. + */ + path = path.substr (strlen ("<Actions>/")); + + row[action_columns.path] = path; } } @@ -499,6 +529,14 @@ FPGUI::build_trns_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs) build_action_combo (cb, actions, FaderPort::Trns, bs); } +void +FPGUI::build_user_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs) +{ + cb.set_model (available_action_model); + cb.pack_start (action_columns.name); + cb.signal_changed().connect (sigc::bind (sigc::mem_fun (*this, &FPGUI::action_changed), &cb, FaderPort::User, bs)); +} + Glib::RefPtr<Gtk::ListStore> FPGUI::build_midi_port_list (vector<string> const & ports, bool for_input) { |