13
0

light solo button, and do cancel_all_solo() when it is pressed

This commit is contained in:
Paul Davis 2016-06-16 23:31:51 -04:00
parent 0e5ac13a04
commit eadf9bbef1
4 changed files with 26 additions and 5 deletions

View 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__

View File

@ -55,3 +55,9 @@ Push2::button_metronome ()
{
toggle_click ();
}
void
Push2::button_solo ()
{
cancel_all_solo ();
}

View 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);
}

View File

@ -331,6 +331,7 @@ class Push2 : public ARDOUR::ControlProtocol
void button_left ();
void button_metronome ();
void button_repeat ();
void button_solo ();
/* widgets */