From bd9ec0c336ddc6fe0779c90b4d87381ad44428c0 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 29 Jan 2025 18:20:04 -0600 Subject: [PATCH] Add action for click-on-rec preferences This is intended to be used as option for extended transport buttons in the application bar. --- gtk2_ardour/ardour_ui.h | 1 + gtk2_ardour/ardour_ui_ed.cc | 3 +++ gtk2_ardour/ardour_ui_options.cc | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 8b39d10680..49039fac0d 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -439,6 +439,7 @@ protected: void reenable_hide_loop_punch_ruler_if_appropriate (); void toggle_auto_return (); void toggle_click (); + void toggle_click_on_rec (); void toggle_session_auto_loop (); void toggle_rc_options_window (); void toggle_session_options_window (); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 0fb48decc9..e82f0b6901 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -490,6 +490,9 @@ ARDOUR_UI::install_actions () act = ActionManager::register_toggle_action (transport_actions, X_("ToggleClick"), _("Click"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_click)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::transport_sensitive_actions.push_back (act); + act = ActionManager::register_toggle_action (transport_actions, X_("ToggleClickOnRec"), _("Click when Recording"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_click_on_rec)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::transport_sensitive_actions.push_back (act); act = ActionManager::register_toggle_action (transport_actions, X_("ToggleAutoInput"), _("Auto Input"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_auto_input)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::transport_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index 10743ad14f..4e4196eb2b 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -144,6 +144,12 @@ ARDOUR_UI::toggle_click () ActionManager::toggle_config_state ("Transport", "ToggleClick", &RCConfiguration::set_clicking, &RCConfiguration::get_clicking); } +void +ARDOUR_UI::toggle_click_on_rec () +{ + ActionManager::toggle_config_state ("Transport", "ToggleClickOnRec", &RCConfiguration::set_click_record_only, &RCConfiguration::get_click_record_only); +} + void ARDOUR_UI::toggle_session_monitoring_in () {