add ActionManager::rec_sensitive_actions and put "add track/bus" in this group, which is disabled during active recording

This commit is contained in:
Paul Davis 2016-09-06 16:56:46 -04:00
parent 73fe0e4b97
commit 835b874e1e
4 changed files with 13 additions and 5 deletions

View File

@ -62,6 +62,7 @@ RelatedActions ActionManager::engine_sensitive_actions;
RelatedActions ActionManager::engine_opposite_sensitive_actions;
RelatedActions ActionManager::transport_sensitive_actions;
RelatedActions ActionManager::edit_point_in_region_sensitive_actions;
RelatedActions ActionManager::rec_sensitive_actions;
void
ActionManager::init ()

View File

@ -51,6 +51,7 @@ namespace ActionManager {
extern std::vector<Glib::RefPtr<Gtk::Action> > engine_sensitive_actions;
extern std::vector<Glib::RefPtr<Gtk::Action> > engine_opposite_sensitive_actions;
extern std::vector<Glib::RefPtr<Gtk::Action> > edit_point_in_region_sensitive_actions;
extern std::vector<Glib::RefPtr<Gtk::Action> > rec_sensitive_actions;
extern void map_some_state (const char* group, const char* action, bool (ARDOUR::RCConfiguration::*get)() const);
extern void map_some_state (const char* group, const char* action, bool (UIConfiguration::*get)() const);

View File

@ -4982,16 +4982,21 @@ ARDOUR_UI::record_state_changed ()
{
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::record_state_changed);
if (!_session || !big_clock_window) {
if (!_session) {
/* why bother - the clock isn't visible */
return;
}
if (_session->record_status () == Session::Recording && _session->have_rec_enabled_track ()) {
big_clock->set_active (true);
} else {
big_clock->set_active (false);
ActionManager::set_sensitive (ActionManager::rec_sensitive_actions, !_session->actively_recording());
if (big_clock_window) {
if (_session->record_status () == Session::Recording && _session->have_rec_enabled_track ()) {
big_clock->set_active (true);
} else {
big_clock->set_active (false);
}
}
}
bool

View File

@ -159,6 +159,7 @@ ARDOUR_UI::install_actions ()
act = global_actions.register_action (main_actions, X_("AddTrackBus"), _("Add Track or Bus..."), sigc::mem_fun(*this, &ARDOUR_UI::add_route));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
ActionManager::rec_sensitive_actions.push_back (act);
act = global_actions.register_action (main_actions, X_("duplicate-routes"), _("Duplicate Tracks/Busses..."),
sigc::mem_fun(*this, &ARDOUR_UI::start_duplicate_routes));