summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie/surface.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-10-07 15:12:09 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-10-07 15:13:03 -0400
commitc9658134cebe307f7628fc2631f4d9528c5bbb99 (patch)
treea9b73771f1ea990fb99481976a870427b3b3628c /libs/surfaces/mackie/surface.cc
parent5762ee114d085c25043887b490bccc803a90d59b (diff)
add button time and explicit bank switching to MCP support
Diffstat (limited to 'libs/surfaces/mackie/surface.cc')
-rw-r--r--libs/surfaces/mackie/surface.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc
index 65bb25e01c..8ace15a7ad 100644
--- a/libs/surfaces/mackie/surface.cc
+++ b/libs/surfaces/mackie/surface.cc
@@ -532,6 +532,11 @@ Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
Button* button = buttons[ev->note_number];
if (button) {
+
+ if (ev->velocity > 64) {
+ button->pressed ();
+ }
+
Strip* strip = dynamic_cast<Strip*> (&button->group());
if (strip) {
@@ -543,9 +548,16 @@ Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("global button %1\n", button->id()));
_mcp.handle_button_event (*this, *button, ev->velocity > 64 ? press : release);
}
+
+ if (ev->velocity <= 64) {
+ button->released ();
+ }
+
} else {
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("no button found for %1\n", (int) ev->note_number));
}
+
+ /* button release should reset timer AFTER handler(s) have run */
}
void