summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie/mcp_buttons.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-01-31 11:01:41 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-01-31 11:01:41 -0500
commitaf1028bd90785dda5f5067a0f63523cb2760eb56 (patch)
tree2faaa87e426776ac0fe6f24b0761f6604e17962a /libs/surfaces/mackie/mcp_buttons.cc
parent2b56dc17e3bc387c52bcd656e3487164ea8f6e06 (diff)
mackie: make marker button work as Mackie intends it (as a modifier for rewind/ffwd)
Diffstat (limited to 'libs/surfaces/mackie/mcp_buttons.cc')
-rw-r--r--libs/surfaces/mackie/mcp_buttons.cc32
1 files changed, 23 insertions, 9 deletions
diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc
index 2e87117920..0ead9edca1 100644
--- a/libs/surfaces/mackie/mcp_buttons.cc
+++ b/libs/surfaces/mackie/mcp_buttons.cc
@@ -414,13 +414,29 @@ MackieControlProtocol::timecode_beats_release (Button &)
LedState
MackieControlProtocol::marker_press (Button &)
{
+ _modifier_state |= MODIFIER_MARKER;
+ marker_modifier_consumed_by_button = false;
+ return on;
+}
+
+LedState
+MackieControlProtocol::marker_release (Button &)
+{
+ if (marker_modifier_consumed_by_button) {
+ /* marker was used a modifier for some other button(s), so do
+ nothing
+ */
+ return off;
+ }
+
string markername;
+ _modifier_state &= ~MODIFIER_MARKER;
+
/* Don't add another mark if one exists within 1/100th of a second of
* the current position and we're not rolling.
*/
-
framepos_t where = session->audible_frame();
if (session->transport_stopped() && session->locations()->mark_at (where, session->frame_rate() / 100.0)) {
@@ -430,12 +446,6 @@ MackieControlProtocol::marker_press (Button &)
session->locations()->next_available_name (markername,"marker");
add_marker (markername);
- return on;
-}
-
-LedState
-MackieControlProtocol::marker_release (Button &)
-{
return off;
}
@@ -494,7 +504,9 @@ MackieControlProtocol::record_release (Button &)
LedState
MackieControlProtocol::rewind_press (Button &)
{
- if (main_modifier_state() == MODIFIER_CONTROL) {
+ if (modifier_state() & MODIFIER_MARKER) {
+ prev_marker ();
+ } else if (main_modifier_state() == MODIFIER_SHIFT) {
goto_start ();
} else {
rewind ();
@@ -511,7 +523,9 @@ MackieControlProtocol::rewind_release (Button &)
LedState
MackieControlProtocol::ffwd_press (Button &)
{
- if (main_modifier_state() == MODIFIER_CONTROL) {
+ if (modifier_state() & MODIFIER_MARKER) {
+ next_marker ();
+ } else if (main_modifier_state() == MODIFIER_SHIFT) {
goto_end();
} else {
ffwd ();