From efbb222277d87774970a42102e6a843661894acd Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 25 Sep 2024 07:50:59 -0500 Subject: [PATCH] Transfer from ardour_ui (follow, auto return) --- gtk2_ardour/application_bar.cc | 23 +++++++++++++++++++++++ gtk2_ardour/application_bar.h | 2 ++ gtk2_ardour/ardour_ui.cc | 2 -- gtk2_ardour/ardour_ui.h | 3 --- gtk2_ardour/ardour_ui2.cc | 22 ---------------------- 5 files changed, 25 insertions(+), 27 deletions(-) diff --git a/gtk2_ardour/application_bar.cc b/gtk2_ardour/application_bar.cc index 2459f32361..e2068b669f 100644 --- a/gtk2_ardour/application_bar.cc +++ b/gtk2_ardour/application_bar.cc @@ -115,6 +115,8 @@ ApplicationBar::ApplicationBar () : _have_layout (false) , _basic_ui (0) , _latency_disable_button (ArdourButton::led_default_elements) + , _auto_return_button (ArdourButton::led_default_elements) + , _follow_edits_button (ArdourButton::led_default_elements) { _record_mode_strings = I18N (_record_mode_strings_); } @@ -171,6 +173,14 @@ ApplicationBar::on_parent_changed (Gtk::Widget*) set_size_request_to_display_given_text (_route_latency_value, "1000 spl", 0, 0); set_size_request_to_display_given_text (_io_latency_value, "888.88 ms", 0, 0); + act = ActionManager::get_action ("Transport", "ToggleAutoReturn"); + _auto_return_button.set_related_action (act); + act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits")); + _follow_edits_button.set_related_action (act); + + _auto_return_button.set_text(_("Auto Return")); + _follow_edits_button.set_text(_("Follow Range")); + int vpadding = 1; int hpadding = 2; int col = 0; @@ -209,6 +219,13 @@ ApplicationBar::on_parent_changed (Gtk::Widget*) _table.attach (_latency_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0); ++col; + _table.attach (_follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding); + _table.attach (_auto_return_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding); + ++col; + + _table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0); + ++col; + _table.set_spacings (0); _table.set_row_spacings (4); _table.set_border_width (1); @@ -224,6 +241,8 @@ ApplicationBar::on_parent_changed (Gtk::Widget*) button_height_size_group->add_widget (_punch_out_button); button_height_size_group->add_widget (_record_mode_selector); button_height_size_group->add_widget (_latency_disable_button); + button_height_size_group->add_widget (_follow_edits_button); + button_height_size_group->add_widget (_auto_return_button); Glib::RefPtr punch_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL); punch_button_size_group->add_widget (_punch_in_button); @@ -234,6 +253,8 @@ ApplicationBar::on_parent_changed (Gtk::Widget*) Gtkmm2ext::UI::instance()->set_tip (_punch_out_button, _("Stop recording at auto-punch end")); Gtkmm2ext::UI::instance()->set_tip (_record_mode_selector, _("Layered, new recordings will be added as regions on a layer atop existing regions.\nSoundOnSound, behaves like Layered, except underlying regions will be audible.\nNon Layered, the underlying region will be spliced and replaced with the newly recorded region.")); Gtkmm2ext::UI::instance()->set_tip (_latency_disable_button, _("Disable all Plugin Delay Compensation. This results in the shortest delay from live input to output, but any paths with delay-causing plugins will sound later than those without.")); + Gtkmm2ext::UI::instance()->set_tip (_auto_return_button, _("Return to last playback start when stopped")); + Gtkmm2ext::UI::instance()->set_tip (_follow_edits_button, _("Playhead follows Range tool clicks, and Range selections")); /* theming */ _sync_button.set_name ("transport active option button"); @@ -241,6 +262,8 @@ ApplicationBar::on_parent_changed (Gtk::Widget*) _punch_out_button.set_name ("punch button"); _record_mode_selector.set_name ("record mode button"); _latency_disable_button.set_name ("latency button"); + _auto_return_button.set_name ("transport option button"); + _follow_edits_button.set_name ("transport option button"); /* indicate global latency compensation en/disable */ ARDOUR::Latent::DisableSwitchChanged.connect (_forever_connections, MISSING_INVALIDATOR, std::bind (&ApplicationBar::latency_switch_changed, this), gui_context ()); diff --git a/gtk2_ardour/application_bar.h b/gtk2_ardour/application_bar.h index 9fa76264b4..9d2511b84a 100644 --- a/gtk2_ardour/application_bar.h +++ b/gtk2_ardour/application_bar.h @@ -100,6 +100,8 @@ private: Gtk::Label _route_latency_value; Gtk::Label _io_latency_label; Gtk::Label _io_latency_value; + ArdourWidgets::ArdourButton _auto_return_button; + ArdourWidgets::ArdourButton _follow_edits_button; std::vector _record_mode_strings; diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index f2e39c8c12..304714c837 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -302,8 +302,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) , _cue_rec_enable (_("Rec Cues"), ArdourButton::led_default_elements) , _cue_play_enable (_("Play Cues"), ArdourButton::led_default_elements) , time_info_box (0) - , auto_return_button (ArdourButton::led_default_elements) - , follow_edits_button (ArdourButton::led_default_elements) , auditioning_alert_button (_("Audition")) , solo_alert_button (_("Solo")) , feedback_alert_button (_("Feedback")) diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 446c12e46b..406c7b0298 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -552,9 +552,6 @@ private: ArdourWidgets::ArdourVSpacer meterbox_spacer; Gtk::HBox meterbox_spacer2; - ArdourWidgets::ArdourButton auto_return_button; - ArdourWidgets::ArdourButton follow_edits_button; - ArdourWidgets::ArdourButton auditioning_alert_button; ArdourWidgets::ArdourButton solo_alert_button; ArdourWidgets::ArdourButton feedback_alert_button; diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index aca3e3600a..fd18fba43e 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -91,8 +91,6 @@ ARDOUR_UI::setup_tooltips () { ArdourCanvas::Canvas::set_tooltip_timeout (Gtk::Settings::get_default()->property_gtk_tooltip_timeout ()); - set_tip (auto_return_button, _("Return to last playback start when stopped")); - set_tip (follow_edits_button, _("Playhead follows Range tool clicks, and Range selections")); parameter_changed("click-gain"); set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything")); set_tip (auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition")); @@ -237,11 +235,6 @@ ARDOUR_UI::setup_transport () recorder_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-recorder-visibility"))); trigger_page_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-trigger-visibility"))); - act = ActionManager::get_action ("Transport", "ToggleAutoReturn"); - auto_return_button.set_related_action (act); - act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits")); - follow_edits_button.set_related_action (act); - act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-dim-all")); monitor_dim_button.set_related_action (act); act = ActionManager::get_action (X_("Monitor Section"), X_("monitor-mono")); @@ -281,9 +274,6 @@ ARDOUR_UI::setup_transport () /* setup widget style/name */ - auto_return_button.set_name ("transport option button"); - follow_edits_button.set_name ("transport option button"); - solo_alert_button.set_name ("rude solo"); auditioning_alert_button.set_name ("rude audition"); feedback_alert_button.set_name ("feedback alert"); @@ -318,8 +308,6 @@ ARDOUR_UI::setup_transport () monitor_mute_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text)); /* and widget text */ - auto_return_button.set_text(_("Auto Return")); - follow_edits_button.set_text(_("Follow Range")); monitor_dim_button.set_text (_("Dim All")); monitor_mono_button.set_text (_("Mono")); @@ -401,14 +389,11 @@ ARDOUR_UI::setup_transport () monitor_box->pack_start (monitor_mute_button, true, true); /* clock button size groups */ - button_height_size_group->add_widget (follow_edits_button); button_height_size_group->add_widget (*primary_clock->left_btn()); button_height_size_group->add_widget (*primary_clock->right_btn()); button_height_size_group->add_widget (*secondary_clock->left_btn()); button_height_size_group->add_widget (*secondary_clock->right_btn()); - button_height_size_group->add_widget (auto_return_button); - //tab selections button_height_size_group->add_widget (trigger_page_visibility_button); button_height_size_group->add_widget (recorder_visibility_button); @@ -437,13 +422,6 @@ ARDOUR_UI::setup_transport () transport_table.attach (*application_bar, TCOL, 0, 2 , EXPAND|FILL, EXPAND|FILL, 3, 0); ++col; - transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding); - transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding); - ++col; - - transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0); - ++col; - transport_table.attach (*primary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0); transport_table.attach (*primary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0); transport_table.attach (*primary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);