diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-01 16:19:16 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-01 16:19:16 -0500 |
commit | cb965cba1648f92654a991a91e211821335b37bb (patch) | |
tree | c62a24f6be56b1512949d45bb38a77ade1bf4969 /libs/surfaces/faderport/faderport.cc | |
parent | 37961a6bbe1b5be2df66844a71890ca1d50757dd (diff) |
start tweaks to make Shift sticky; remove Shift-press combobox from gui since we don't allow that to be bound (next-marker)
Diffstat (limited to 'libs/surfaces/faderport/faderport.cc')
-rw-r--r-- | libs/surfaces/faderport/faderport.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index b0effd2227..9227da1ab3 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -308,18 +308,20 @@ FaderPort::button_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb) button.timeout_connection.disconnect (); } + ButtonState bs (ButtonState (0)); + switch (id) { case Shift: - button_state = (tb->value ? ButtonState (button_state|ShiftDown) : ButtonState (button_state&~ShiftDown)); + bs = ShiftDown; break; case Stop: - button_state = (tb->value ? ButtonState (button_state|StopDown) : ButtonState (button_state&~StopDown)); + bs = StopDown; break; case Rewind: - button_state = (tb->value ? ButtonState (button_state|RewindDown) : ButtonState (button_state&~RewindDown)); + bs = RewindDown; break; case User: - button_state = (tb->value ? ButtonState (button_state|UserDown) : ButtonState (button_state&~UserDown)); + bs = UserDown; break; case FaderTouch: fader_is_touched = tb->value; @@ -342,6 +344,10 @@ FaderPort::button_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb) break; } + if (bs) { + button_state = (tb->value ? ButtonState (button_state|bs) : ButtonState (button_state&~bs)); + } + if (button.uses_flash()) { button.set_led_state (_output_port, (int)tb->value); } |