push2: master button now does something useful
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 22 Sep 2016 19:41:49 +0000 (14:41 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2016 19:59:31 +0000 (14:59 -0500)
libs/surfaces/push2/buttons.cc
libs/surfaces/push2/push2.h

index cc153c22d01a6a86dee1afbdaacb4f3b49abb05e..035d7b2e5f0eca16f0e4f2d1ccfd09fc066bf8f0 100644 (file)
@@ -141,7 +141,7 @@ Push2::build_maps ()
        MAKE_COLOR_BUTTON_PRESS (Lower6, 25, &Push2::button_lower_6);
        MAKE_COLOR_BUTTON_PRESS (Lower7, 26, &Push2::button_lower_7);
        MAKE_COLOR_BUTTON_PRESS (Lower8, 27, &Push2::button_lower_8);
-       MAKE_COLOR_BUTTON (Master, 28);
+       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);
@@ -583,6 +583,22 @@ Push2::button_mix_press ()
        }
 }
 
+void
+Push2::button_master ()
+{
+       boost::shared_ptr<Stripable> master = session->master_out();
+
+       if (!master) {
+               return;
+       }
+
+       ControlProtocol::SetStripableSelection (master);
+
+       if (_current_layout != track_mix_layout) {
+               set_current_layout (track_mix_layout);
+       }
+}
+
 std::string
 Push2::button_name_by_id (ButtonID id)
 {
index 88ecd52e93e848d93a7ac6dfc37063b1e2de1a6f..e2da7e7ff21d78e915a6e4ac74282804fbbf3013 100644 (file)
@@ -469,6 +469,7 @@ class Push2 : public ARDOUR::ControlProtocol
        void button_fwd4 ();
        void button_add_track ();
        void button_stop ();
+       void button_master ();
        void button_shift_press ();
        void button_shift_release ();
        void button_shift_long_press ();