13
0

move arm-all/arm-none actions from RecorderUI to ARDOUR_UI and add toggle-arm-all

This commit is contained in:
Paul Davis 2024-05-07 11:06:05 -06:00
parent 9bbb94ab8d
commit 03ececf178
5 changed files with 40 additions and 25 deletions

View File

@ -3295,3 +3295,27 @@ ARDOUR_UI::open_media_folder ()
PBD::open_folder (_session->session_directory().sound_path());
}
void
ARDOUR_UI::arm_all ()
{
if (_session) {
_session->set_all_tracks_record_enabled (true);
}
}
void
ARDOUR_UI::arm_all_toggle ()
{
if (_session) {
_session->toggle_all_tracks_record_enabled ();
}
}
void
ARDOUR_UI::arm_none ()
{
if (_session) {
_session->set_all_tracks_record_enabled (false);
}
}

View File

@ -418,6 +418,10 @@ public:
void livetrax_toggle_visibility (LiveTraxVisibility);
void arm_all ();
void arm_all_toggle ();
void arm_none ();
protected:
friend class PublicEditor;

View File

@ -276,6 +276,14 @@ ARDOUR_UI::install_actions ()
ActionManager::write_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (main_actions, "arm-all", _("Record Arm All Tracks"), sigc::mem_fun (*this, &ARDOUR_UI::arm_all));
ActionManager::write_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (main_actions, "arm-none", _("Disable Record Arm of All Tracks"), sigc::mem_fun (*this, &ARDOUR_UI::arm_none));
ActionManager::write_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (main_actions, "toggle-arm-all", _("Toggle Record Arm of All Tracks"), sigc::mem_fun (*this, &ARDOUR_UI::arm_all_toggle));
/* these actions are intended to be shared across all windows */
common_actions = ActionManager::create_action_group (global_bindings, X_("Common"));

View File

@ -119,10 +119,10 @@ RecorderUI::RecorderUI ()
/* rec all/none */
_recs_label.set_text(_("Arm Tracks:"));
_btn_rec_all.set_name ("generic button");
_btn_rec_all.set_related_action (ActionManager::get_action (X_("Recorder"), X_("arm-all")));
_btn_rec_all.set_related_action (ActionManager::get_action (X_("Main"), X_("arm-all")));
_btn_rec_none.set_name ("generic button");
_btn_rec_none.set_related_action (ActionManager::get_action (X_("Recorder"), X_("arm-none")));
_btn_rec_none.set_related_action (ActionManager::get_action (X_("Main"), X_("arm-none")));
_btn_rec_forget.set_name ("generic button");
_btn_rec_forget.set_related_action (ActionManager::get_action (X_("Editor"), X_("remove-last-capture")));
@ -391,8 +391,6 @@ RecorderUI::register_actions ()
{
Glib::RefPtr<ActionGroup> group = ActionManager::create_action_group (bindings, X_("Recorder"));
ActionManager::register_action (group, "reset-input-peak-hold", _("Reset Input Peak Hold"), sigc::mem_fun (*this, &RecorderUI::peak_reset));
ActionManager::register_action (group, "arm-all", _("Record Arm All Tracks"), sigc::mem_fun (*this, &RecorderUI::arm_all));
ActionManager::register_action (group, "arm-none", _("Disable Record Arm of All Tracks"), sigc::mem_fun (*this, &RecorderUI::arm_none));
ActionManager::register_action (group, "rec-undo", _("Undo"), sigc::mem_fun (*this, &RecorderUI::rec_undo));
ActionManager::register_action (group, "rec-redo", _("Redo"), sigc::mem_fun (*this, &RecorderUI::rec_redo));
ActionManager::register_action (group, "alternate-rec-redo", _("Redo"), sigc::mem_fun (*this, &RecorderUI::rec_redo));
@ -491,8 +489,8 @@ RecorderUI::update_sensitivity ()
const bool en = _session ? true : false;
const bool have_ms = Config->get_use_monitor_bus();
ActionManager::get_action (X_("Recorder"), X_("arm-all"))->set_sensitive (en);
ActionManager::get_action (X_("Recorder"), X_("arm-none"))->set_sensitive (en);
ActionManager::get_action (X_("Main"), X_("arm-all"))->set_sensitive (en);
ActionManager::get_action (X_("Main"), X_("arm-none"))->set_sensitive (en);
for (InputPortMap::const_iterator i = _input_ports.begin (); i != _input_ports.end (); ++i) {
i->second->allow_monitoring (have_ms && en);
@ -1334,22 +1332,6 @@ RecorderUI::new_track_for_port (DataType dt, string const& port_name)
}
}
void
RecorderUI::arm_all ()
{
if (_session) {
_session->set_all_tracks_record_enabled (true);
}
}
void
RecorderUI::arm_none ()
{
if (_session) {
_session->set_all_tracks_record_enabled (false);
}
}
void
RecorderUI::rec_undo ()
{

View File

@ -112,9 +112,6 @@ private:
bool scroller_button_event (GdkEventButton*);
void arm_all ();
void arm_none ();
void rec_undo ();
void rec_redo ();