From: Paul Davis Date: Fri, 17 Jun 2016 03:31:51 +0000 (-0400) Subject: light solo button, and do cancel_all_solo() when it is pressed X-Git-Tag: 5.4~201 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=eadf9bbef17a1405096ad6ce6966e4265d566cca;p=ardour.git light solo button, and do cancel_all_solo() when it is pressed --- diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h index cc6e5044ce..6355c2d7ca 100644 --- a/libs/ardour/ardour/utils.h +++ b/libs/ardour/ardour/utils.h @@ -198,6 +198,17 @@ template boost::shared_ptr stripable_list_to_control_li return cl; } +template boost::shared_ptr stripable_list_to_control_list (StripableList& sl, boost::shared_ptr (Stripable::*get_control)() const) { + boost::shared_ptr cl (new ControlList); + for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) { + boost::shared_ptr ac = ((*s).get()->*get_control)(); + if (ac) { + cl->push_back (ac); + } + } + return cl; +} + #if __APPLE__ LIBARDOUR_API std::string CFStringRefToStdString(CFStringRef stringRef); #endif // __APPLE__ diff --git a/libs/surfaces/push2/buttons.cc b/libs/surfaces/push2/buttons.cc index 84a6aee389..803f1e5ed9 100644 --- a/libs/surfaces/push2/buttons.cc +++ b/libs/surfaces/push2/buttons.cc @@ -55,3 +55,9 @@ Push2::button_metronome () { toggle_click (); } + +void +Push2::button_solo () +{ + cancel_all_solo (); +} diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index 4628d26cbe..b866dcbb9e 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -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); } diff --git a/libs/surfaces/push2/push2.h b/libs/surfaces/push2/push2.h index 8f7c5e9aba..c50452fc65 100644 --- a/libs/surfaces/push2/push2.h +++ b/libs/surfaces/push2/push2.h @@ -331,6 +331,7 @@ class Push2 : public ARDOUR::ControlProtocol void button_left (); void button_metronome (); void button_repeat (); + void button_solo (); /* widgets */