light solo button, and do cancel_all_solo() when it is pressed
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 17 Jun 2016 03:31:51 +0000 (23:31 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2016 19:59:29 +0000 (14:59 -0500)
libs/ardour/ardour/utils.h
libs/surfaces/push2/buttons.cc
libs/surfaces/push2/push2.cc
libs/surfaces/push2/push2.h

index cc6e5044cef0e017bc740f7c5a2752c9a6575cfc..6355c2d7ca3519b145977b500f7481e3e9c40ee9 100644 (file)
@@ -198,6 +198,17 @@ template<typename T> boost::shared_ptr<ControlList> stripable_list_to_control_li
        return cl;
 }
 
+template<typename T> boost::shared_ptr<ControlList> stripable_list_to_control_list (StripableList& sl, boost::shared_ptr<T> (Stripable::*get_control)() const) {
+       boost::shared_ptr<ControlList> cl (new ControlList);
+       for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) {
+               boost::shared_ptr<AutomationControl> ac = ((*s).get()->*get_control)();
+               if (ac) {
+                       cl->push_back (ac);
+               }
+       }
+       return cl;
+}
+
 #if __APPLE__
 LIBARDOUR_API std::string CFStringRefToStdString(CFStringRef stringRef);
 #endif // __APPLE__
index 84a6aee389df7ca60c38a34a99679d39928feb4a..803f1e5ed992abcff7555fc47326d2a1d8840ee5 100644 (file)
@@ -55,3 +55,9 @@ Push2::button_metronome ()
 {
        toggle_click ();
 }
+
+void
+Push2::button_solo ()
+{
+       cancel_all_solo ();
+}
index 4628d26cbe0b2feec0039c03b24c9c05c3be463e..b866dcbb9e5fa9e2d1e7af9be1a56830da9909e6 100644 (file)
@@ -636,7 +636,7 @@ Push2::build_maps ()
        MAKE_COLOR_BUTTON (Lower6, 26);
        MAKE_COLOR_BUTTON (Lower7, 27);
        MAKE_COLOR_BUTTON (Mute, 60);
-       MAKE_COLOR_BUTTON (Solo, 61);
+       MAKE_COLOR_BUTTON_PRESS (Solo, 61, &Push2::button_solo);
        MAKE_COLOR_BUTTON (Stop, 29);
        MAKE_COLOR_BUTTON (Fwd32ndT, 43);
        MAKE_COLOR_BUTTON (Fwd32nd,42 );
@@ -767,7 +767,7 @@ Push2::notify_transport_state_changed ()
 
        if (session->transport_rolling()) {
                b->second->set_state (LED::OneShot24th);
-               b->second->set_color (LED::Blue);
+               b->second->set_color (LED::Green);
        } else {
                b->second->set_state (LED::Off);
        }
@@ -790,7 +790,7 @@ Push2::notify_parameter_changed (std::string param)
                        return;
                }
                if (Config->get_clicking()) {
-                       b->second->set_state (LED::Pulsing4th);
+                       b->second->set_state (LED::Blinking4th);
                        b->second->set_color (LED::White);
                } else {
                        b->second->set_state (LED::Off);
@@ -802,15 +802,18 @@ Push2::notify_parameter_changed (std::string param)
 void
 Push2::notify_solo_active_changed (bool yn)
 {
-       IDButtonMap::iterator b = id_button_map.find (Solo);
+       IDButtonMap::iterator b = id_button_map.find (Solo);
 
        if (b == id_button_map.end()) {
                return;
        }
 
        if (yn) {
-               b->second->set_state (LED::Blinking24th);
+               cerr << "soloing\n";
+               b->second->set_state (LED::Blinking4th);
+               b->second->set_color (LED::Red);
        } else {
+               cerr << "NOT soloing\n";
                b->second->set_state (LED::Off);
        }
 
index 8f7c5e9abaf74272df351c02948301cadc15b499..c50452fc6545fcda5c08c212dea2be8904533082 100644 (file)
@@ -331,6 +331,7 @@ class Push2 : public ARDOUR::ControlProtocol
        void button_left ();
        void button_metronome ();
        void button_repeat ();
+       void button_solo ();
 
        /* widgets */