13
0

provide Main/cancel-solo as an action and make rude solo button(s) use it

This commit is contained in:
Paul Davis 2015-10-02 07:32:49 -04:00
parent 5c63ed589c
commit eebbf64484
5 changed files with 23 additions and 29 deletions

View File

@ -4957,3 +4957,15 @@ ARDOUR_UI::hide_application ()
{
Application::instance ()-> hide ();
}
void
ARDOUR_UI::cancel_solo ()
{
if (_session) {
if (_session->soloing()) {
_session->set_solo (_session->get_routes(), false);
} else if (_session->listening()) {
_session->set_listen (_session->get_routes(), false);
}
}
}

View File

@ -480,6 +480,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void blink_handler (bool);
sigc::connection blink_connection;
void cancel_solo ();
void solo_blink (bool);
void sync_blink (bool);
void audition_blink (bool);

View File

@ -324,7 +324,8 @@ ARDOUR_UI::setup_transport ()
/* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
solo_alert_button.set_name ("rude solo");
solo_alert_button.signal_button_press_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::solo_alert_press), false);
act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
solo_alert_button.set_related_action (act);
auditioning_alert_button.set_name ("rude audition");
auditioning_alert_button.signal_button_press_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_press), false);
feedback_alert_button.set_name ("feedback alert");
@ -527,19 +528,6 @@ ARDOUR_UI::audition_alert_press (GdkEventButton*)
return true;
}
bool
ARDOUR_UI::solo_alert_press (GdkEventButton*)
{
if (_session) {
if (_session->soloing()) {
_session->set_solo (_session->get_routes(), false);
} else if (_session->listening()) {
_session->set_listen (_session->get_routes(), false);
}
}
return true;
}
bool
ARDOUR_UI::feedback_alert_press (GdkEventButton *)
{

View File

@ -132,6 +132,12 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
act = ActionManager::register_action (main_actions, X_("cancel-solo"), _("Cancel Solo"), sigc::mem_fun(*this, &ARDOUR_UI::cancel_solo));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
act = ActionManager::register_action (main_actions, X_("OpenVideo"), _("Open Video"),
sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::add_video), (Gtk::Window*) 0));
ActionManager::session_sensitive_actions.push_back (act);

View File

@ -115,7 +115,8 @@ MonitorSection::MonitorSection (Session* s)
Timers::blink_connect (sigc::mem_fun (*this, &MonitorSection::do_blink));
rude_solo_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_solo), false);
act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
rude_solo_button.set_related_action (act);
UI::instance()->set_tip (rude_solo_button, _("When active, something is soloed.\nClick to de-solo everything"));
rude_iso_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::cancel_isolate), false);
@ -1079,20 +1080,6 @@ MonitorSection::solo_blink (bool onoff)
}
}
bool
MonitorSection::cancel_solo (GdkEventButton*)
{
if (_session) {
if (_session->soloing()) {
_session->set_solo (_session->get_routes(), false);
} else if (_session->listening()) {
_session->set_listen (_session->get_routes(), false);
}
}
return true;
}
bool
MonitorSection::cancel_isolate (GdkEventButton*)
{