From 1ecdeb25a7a8774e0bfd31c1782f555013ec3417 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 26 Aug 2022 19:23:43 -0600 Subject: [PATCH] push2: an ever-growing array of cue-related support --- libs/surfaces/push2/buttons.cc | 131 ++++++++++++++++++++++++--------- libs/surfaces/push2/cues.cc | 91 +++++++++++++++++++---- libs/surfaces/push2/cues.h | 14 ++-- libs/surfaces/push2/layout.h | 8 ++ libs/surfaces/push2/push2.cc | 6 +- libs/surfaces/push2/push2.h | 9 ++- 6 files changed, 200 insertions(+), 59 deletions(-) diff --git a/libs/surfaces/push2/buttons.cc b/libs/surfaces/push2/buttons.cc index b7b0b98591..a9d802ca46 100644 --- a/libs/surfaces/push2/buttons.cc +++ b/libs/surfaces/push2/buttons.cc @@ -145,7 +145,7 @@ Push2::build_maps () MAKE_COLOR_BUTTON_PRESS (Master, 28, &Push2::button_master); MAKE_COLOR_BUTTON_PRESS (Mute, 60, &Push2::button_mute); MAKE_COLOR_BUTTON_PRESS_RELEASE_LONG (Solo, 61, &Push2::relax, &Push2::button_solo, &Push2::button_solo_long_press); - MAKE_COLOR_BUTTON_PRESS (Stop, 29, &Push2::button_stop); + MAKE_COLOR_BUTTON_PRESS_RELEASE_LONG (Stop, 29, &Push2::button_stop_press, &Push2::button_stop_release, &Push2::button_stop_long_press); MAKE_COLOR_BUTTON_PRESS (Fwd32ndT, 43, &Push2::button_fwd32t); MAKE_COLOR_BUTTON_PRESS (Fwd32nd,42 , &Push2::button_fwd32); MAKE_COLOR_BUTTON_PRESS (Fwd16thT, 41, &Push2::button_fwd16t); @@ -407,13 +407,15 @@ Push2::button_down () void Push2::button_page_right () { - ScrollTimeline (0.75); + _current_layout->button_page_right(); + // ScrollTimeline (0.75); } void Push2::button_page_left () { - ScrollTimeline (-0.75); + _current_layout->button_page_left(); + // ScrollTimeline (-0.75); } void @@ -538,57 +540,89 @@ Push2::button_undo () void Push2::button_fwd32t () { - const int n = (_modifier_state & ModShift) ? 8 : 0; - goto_nth_marker (0+n); + if (_current_layout == _cue_layout) { + _cue_layout->button_rhs (0); + } else { + const int n = (_modifier_state & ModShift) ? 8 : 0; + goto_nth_marker (0+n); + } } void Push2::button_fwd32 () { - const int n = (_modifier_state & ModShift) ? 8 : 0; - goto_nth_marker (1+n); + if (_current_layout == _cue_layout) { + _cue_layout->button_rhs (1); + } else { + const int n = (_modifier_state & ModShift) ? 8 : 0; + goto_nth_marker (1+n); + } } void Push2::button_fwd16t () { - const int n = (_modifier_state & ModShift) ? 8 : 0; - goto_nth_marker (2+n); + if (_current_layout == _cue_layout) { + _cue_layout->button_rhs (2); + } else { + const int n = (_modifier_state & ModShift) ? 8 : 0; + goto_nth_marker (2+n); + } } void Push2::button_fwd16 () { - const int n = (_modifier_state & ModShift) ? 8 : 0; - goto_nth_marker (3+n); + if (_current_layout == _cue_layout) { + _cue_layout->button_rhs (3); + } else { + const int n = (_modifier_state & ModShift) ? 8 : 0; + goto_nth_marker (3+n); + } } void Push2::button_fwd8t () { - const int n = (_modifier_state & ModShift) ? 8 : 0; - goto_nth_marker (4+n); + if (_current_layout == _cue_layout) { + _cue_layout->button_rhs (4); + } else { + const int n = (_modifier_state & ModShift) ? 8 : 0; + goto_nth_marker (4+n); + } } void Push2::button_fwd8 () { - const int n = (_modifier_state & ModShift) ? 8 : 0; - goto_nth_marker (5+n); + if (_current_layout == _cue_layout) { + _cue_layout->button_rhs (5); + } else { + const int n = (_modifier_state & ModShift) ? 8 : 0; + goto_nth_marker (5+n); + } } void Push2::button_fwd4t () { - const int n = (_modifier_state & ModShift) ? 8 : 0; - goto_nth_marker (6+n); + if (_current_layout == _cue_layout) { + _cue_layout->button_rhs (6); + } else { + const int n = (_modifier_state & ModShift) ? 8 : 0; + goto_nth_marker (6+n); + } } void Push2::button_fwd4 () { - const int n = (_modifier_state & ModShift) ? 8 : 0; - goto_nth_marker (7+n); + if (_current_layout == _cue_layout) { + _cue_layout->button_rhs (7); + } else { + const int n = (_modifier_state & ModShift) ? 8 : 0; + goto_nth_marker (7+n); + } } void @@ -598,10 +632,29 @@ Push2::button_add_track () } void -Push2::button_stop () +Push2::button_stop_press () { + _stop_down = true; + _current_layout->button_stop_press (); + /* XXX this needs a better binding */ /* close current window */ - access_action ("Main/close-current-dialog"); + // access_action ("Main/close-current-dialog"); +} + +void +Push2::button_stop_release () +{ + _stop_down = false; + _current_layout->button_stop_release (); +} + +void +Push2::button_stop_long_press () +{ + _current_layout->button_stop_long_press (); + /* XXX this needs a better binding */ + /* close current window */ + // access_action ("Main/close-current-dialog"); } void @@ -687,28 +740,36 @@ Push2::start_press_timeout (boost::shared_ptr