use right-side buttons to goto_nth_marker()
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 17 Jun 2016 05:59:01 +0000 (01:59 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2016 19:59:29 +0000 (14:59 -0500)
libs/surfaces/push2/buttons.cc
libs/surfaces/push2/push2.cc
libs/surfaces/push2/push2.h

index b009b148ff15911711be17ae6da6f41e1a88e003..a8aa6d015005eaa37d0d32e298dd8a577a33fbe1 100644 (file)
@@ -165,3 +165,70 @@ Push2::button_lower (uint32_t n)
                mc->set_value (!mc->get_value(), PBD::Controllable::UseGroup);
        }
 }
+
+void
+Push2::button_undo ()
+{
+       if (modifier_state & ModShift) {
+               ControlProtocol::Redo ();
+       } else {
+               ControlProtocol::Undo ();
+       }
+}
+
+void
+Push2::button_fwd32t ()
+{
+       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);
+}
+
+void
+Push2::button_fwd16t ()
+{
+       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);
+}
+
+void
+Push2::button_fwd8t ()
+{
+       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);
+}
+
+void
+Push2::button_fwd4t ()
+{
+       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);
+}
+
index 38415e35caac3b404499fe26064f2c6257668b1b..369af80f9e9a1ad7ddc68ff233ab10142d9213a4 100644 (file)
@@ -684,14 +684,14 @@ Push2::build_maps ()
        MAKE_COLOR_BUTTON (Mute, 60);
        MAKE_COLOR_BUTTON_PRESS (Solo, 61, &Push2::button_solo);
        MAKE_COLOR_BUTTON (Stop, 29);
-       MAKE_COLOR_BUTTON (Fwd32ndT, 43);
-       MAKE_COLOR_BUTTON (Fwd32nd,42 );
-       MAKE_COLOR_BUTTON (Fwd16thT, 41);
-       MAKE_COLOR_BUTTON (Fwd16th, 40);
-       MAKE_COLOR_BUTTON (Fwd8thT, 39 );
-       MAKE_COLOR_BUTTON (Fwd8th, 38);
-       MAKE_COLOR_BUTTON (Fwd4trT, 37);
-       MAKE_COLOR_BUTTON (Fwd4tr, 36);
+       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);
+       MAKE_COLOR_BUTTON_PRESS (Fwd16th, 40, &Push2::button_fwd16);
+       MAKE_COLOR_BUTTON_PRESS (Fwd8thT, 39 , &Push2::button_fwd8t);
+       MAKE_COLOR_BUTTON_PRESS (Fwd8th, 38, &Push2::button_fwd8);
+       MAKE_COLOR_BUTTON_PRESS (Fwd4trT, 37, &Push2::button_fwd4t);
+       MAKE_COLOR_BUTTON_PRESS (Fwd4tr, 36, &Push2::button_fwd4);
        MAKE_COLOR_BUTTON (Automate, 89);
        MAKE_COLOR_BUTTON_PRESS (RecordEnable, 86, &Push2::button_recenable);
        MAKE_COLOR_BUTTON_PRESS (Play, 85, &Push2::button_play);
@@ -717,7 +717,7 @@ Push2::build_maps ()
        MAKE_WHITE_BUTTON (AddDevice, 52);
        MAKE_WHITE_BUTTON (Device, 110);
        MAKE_WHITE_BUTTON (Mix, 112);
-       MAKE_WHITE_BUTTON (Undo, 119);
+       MAKE_WHITE_BUTTON_PRESS (Undo, 119, &Push2::button_undo);
        MAKE_WHITE_BUTTON (AddTrack, 53);
        MAKE_WHITE_BUTTON_PRESS (Browse, 111, &Push2::button_browse);
        MAKE_WHITE_BUTTON_PRESS (Clip, 113, &Push2::button_clip);
index 60bfa2b07fc9b7294dbc1dc208fc2755391d41db..0ddfad2f15a098be92da537aedacdf12177957d9 100644 (file)
@@ -366,6 +366,15 @@ class Push2 : public ARDOUR::ControlProtocol
        void button_lower_6 () { button_lower (5); }
        void button_lower_7 () { button_lower (6); }
        void button_lower_8 () { button_lower (7); }
+       void button_undo ();
+       void button_fwd32t ();
+       void button_fwd32 ();
+       void button_fwd16t ();
+       void button_fwd16 ();
+       void button_fwd8t ();
+       void button_fwd8 ();
+       void button_fwd4t ();
+       void button_fwd4 ();
 
        /* widgets */