summaryrefslogtreecommitdiff
path: root/libs/surfaces/faderport
diff options
context:
space:
mode:
authorJohannes Mueller <github@johannes-mueller.org>2019-04-19 20:35:40 +0200
committerJohannes Mueller <github@johannes-mueller.org>2019-04-20 00:15:20 +0200
commit8cbbd3dd00af150ac6b4f2f33771fa12b4a36f21 (patch)
tree99d7288eaf3e2c8aa0618f32d62fe5c0357d2e7c /libs/surfaces/faderport
parent23b196952b0ecc3d755230873d386e4915914a20 (diff)
Fadeport: Fix User button state save and restore
Since we (since ddfc37e4) set the UserDown flag for the User button actions, we need to set it also when we lookup actions when saving the state. Furthermore, we need also look for the UserDown flag, when we set the state of the configuration combos for the User button.
Diffstat (limited to 'libs/surfaces/faderport')
-rw-r--r--libs/surfaces/faderport/faderport.cc7
-rw-r--r--libs/surfaces/faderport/gui.cc3
2 files changed, 9 insertions, 1 deletions
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc
index da2792dbd5..e828b5773f 100644
--- a/libs/surfaces/faderport/faderport.cc
+++ b/libs/surfaces/faderport/faderport.cc
@@ -925,7 +925,7 @@ FaderPort::connected ()
_output_port->write (buf, 6, 0);
}
-bool
+bool
FaderPort::Button::invoke (FaderPort::ButtonState bs, bool press)
{
DEBUG_TRACE (DEBUG::FaderPort, string_compose ("invoke button %1 for %2 state %3%4%5\n", id, (press ? "press":"release"), hex, bs, dec));
@@ -1102,6 +1102,11 @@ FaderPort::Button::get_state () const
state_pairs.push_back (make_pair (string ("shift"), ShiftDown));
state_pairs.push_back (make_pair (string ("long"), LongPress));
+#ifndef MIXBUS
+ state_pairs.push_back (make_pair (string ("plain"), UserDown));
+ state_pairs.push_back (make_pair (string ("long"), ButtonState (LongPress | UserDown)));
+#endif
+
for (vector<state_pair_t>::const_iterator sp = state_pairs.begin(); sp != state_pairs.end(); ++sp) {
if ((x = on_press.find (sp->second)) != on_press.end()) {
if (x->second.type == NamedAction) {
diff --git a/libs/surfaces/faderport/gui.cc b/libs/surfaces/faderport/gui.cc
index e428da44f0..5040b925cb 100644
--- a/libs/surfaces/faderport/gui.cc
+++ b/libs/surfaces/faderport/gui.cc
@@ -589,6 +589,9 @@ FPGUI::find_action_in_model (const TreeModel::iterator& iter, std::string const
void
FPGUI::build_user_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs)
{
+#ifndef MIXBUS
+ bs = FaderPort::ButtonState (bs|FaderPort::UserDown);
+#endif
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));