From a5ac6e097ea0f0ca6207b7e5185b6f3bd7e76b7a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 10 Nov 2023 15:50:44 -0700 Subject: [PATCH] switch no-strobe from cmdline to UI config preference --- gtk2_ardour/ardour_ui.cc | 15 +++++++-------- gtk2_ardour/ardour_ui_options.cc | 3 +++ gtk2_ardour/configuration_metadata.h | 1 - gtk2_ardour/editor.cc | 4 ++-- gtk2_ardour/mixer_ui.cc | 2 +- gtk2_ardour/opts.cc | 8 +------- gtk2_ardour/opts.h | 1 - gtk2_ardour/rc_option_editor.cc | 2 +- gtk2_ardour/route_ui.cc | 2 +- gtk2_ardour/transport_control_ui.cc | 2 +- 10 files changed, 17 insertions(+), 23 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 4652fbfbf0..54ed79ea83 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1203,7 +1203,7 @@ ARDOUR_UI::every_point_zero_something_seconds () _editor_meter_peaked = false; } - if (!ARDOUR_COMMAND_LINE::no_strobe) { + if (!UIConfiguration::instance().get_no_strobe()) { const float mpeak = editor_meter->update_meters(); const bool peaking = mpeak > UIConfiguration::instance().get_meter_peak(); @@ -2184,7 +2184,7 @@ ARDOUR_UI::blink_handler (bool blink_on) { sync_blink (blink_on); - if (ARDOUR_COMMAND_LINE::no_strobe || !UIConfiguration::instance().get_blink_alert_indicators()) { + if (UIConfiguration::instance().get_no_strobe() || !UIConfiguration::instance().get_blink_alert_indicators()) { blink_on = true; } error_blink (blink_on); @@ -2206,7 +2206,9 @@ ARDOUR_UI::update_clocks () void ARDOUR_UI::start_clocking () { - if (ARDOUR_COMMAND_LINE::no_strobe) { + std::cerr << "start clocking\n"; + + if (UIConfiguration::instance().get_no_strobe()) { if (!_session) { return; } @@ -2225,11 +2227,8 @@ ARDOUR_UI::start_clocking () void ARDOUR_UI::stop_clocking () { - if (ARDOUR_COMMAND_LINE::no_strobe) { - clock_state_connection.drop_connections (); - } else { - clock_signal_connection.disconnect (); - } + clock_state_connection.drop_connections (); + clock_signal_connection.disconnect (); } void diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc index d9a34df328..d08b3a0fec 100644 --- a/gtk2_ardour/ardour_ui_options.cc +++ b/gtk2_ardour/ardour_ui_options.cc @@ -498,6 +498,9 @@ ARDOUR_UI::parameter_changed (std::string p) if (UIConfiguration::instance().get_clock_display_limit() > limit) { UIConfiguration::instance().set_clock_display_limit (limit); } + } else if (p == "no-strobe") { + stop_clocking (); + start_clocking (); } } diff --git a/gtk2_ardour/configuration_metadata.h b/gtk2_ardour/configuration_metadata.h index c9b5eddfd9..cce9bf59aa 100644 --- a/gtk2_ardour/configuration_metadata.h +++ b/gtk2_ardour/configuration_metadata.h @@ -13,7 +13,6 @@ UIConfiguration::build_metadata () VAR_META (X_("autoscroll-editor"), _("scroll"), _("editor"), NULL); VAR_META (X_("blink-alert-indicators"), _("blink"), _("alert"), _("indicators"), NULL); VAR_META (X_("blink-rec-arm"), _("appearance"), _("blink"), _("record"), _("rec"), _("enable"), _("rec-enable"), _("record-enable"), NULL); - VAR_META (X_("no-strobe"), _("appearance"), _("blink"), _("flash"), _("strobe"), NULL); VAR_META (X_("boxy-buttons"), _("appearance"), _("style"), _("boxy"), _("buttons"), _("theme"), NULL); VAR_META (X_("buggy-gradients"), _("appearance"), _("bugs"), _("tweaks"), _("kwirks"), NULL); VAR_META (X_("check-announcements"), _("check"), _("announcements"), _("phone"), _("home"), NULL); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 1bf2a3eb23..3e3021eaf1 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -6441,7 +6441,7 @@ Editor::super_rapid_screen_update () /* METERING / MIXER STRIPS */ /* update track meters, if required */ - if (!ARDOUR_COMMAND_LINE::no_strobe && contents().get_mapped() && meters_running) { + if (!UIConfiguration::instance().get_no_strobe() && contents().get_mapped() && meters_running) { RouteTimeAxisView* rtv; for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { if ((rtv = dynamic_cast(*i)) != 0) { @@ -6451,7 +6451,7 @@ Editor::super_rapid_screen_update () } /* and any current mixer strip */ - if (!ARDOUR_COMMAND_LINE::no_strobe && current_mixer_strip) { + if (!UIConfiguration::instance().get_no_strobe() && current_mixer_strip) { current_mixer_strip->fast_update (); } diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index d767fe5abf..f732269947 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1439,7 +1439,7 @@ Mixer_UI::stop_updating () void Mixer_UI::fast_update_strips () { - if (!ARDOUR_COMMAND_LINE::no_strobe && _content.get_mapped () && _session) { + if (!UIConfiguration::instance().get_no_strobe() && _content.get_mapped () && _session) { for (auto & s : strips) { s->fast_update (); } diff --git a/gtk2_ardour/opts.cc b/gtk2_ardour/opts.cc index 7a6021bef3..dbcd0655f9 100644 --- a/gtk2_ardour/opts.cc +++ b/gtk2_ardour/opts.cc @@ -54,7 +54,6 @@ std::string ARDOUR_COMMAND_LINE::menus_file = "ardour.menus"; bool ARDOUR_COMMAND_LINE::finder_invoked_ardour = false; string ARDOUR_COMMAND_LINE::load_template; bool ARDOUR_COMMAND_LINE::check_announcements = true; -bool ARDOUR_COMMAND_LINE::no_strobe = false; using namespace ARDOUR_COMMAND_LINE; @@ -99,7 +98,7 @@ print_help (const char *execname) int ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) { - const char *optstring = "aAbBc:C:dD:hHk:E:m:N:nOp:PsST:U:v"; + const char *optstring = "aAbBc:C:dD:hHk:E:m:N:nOp:PST:U:v"; const char *execname = strrchr (argv[0], '/'); if (execname == 0) { @@ -125,7 +124,6 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) { "sync", 0, 0, 'S' }, { "template", 1, 0, 'T' }, { "no-connect-ports", 0, 0, 'P' }, - { "no-strobe", 0, 0, 's' }, { 0, 0, 0, 0 } }; @@ -197,10 +195,6 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) finder_invoked_ardour = true; break; - case 's': - no_strobe = true; - break; - case 'S': // ; just pass this through to gtk it will figure it out break; diff --git a/gtk2_ardour/opts.h b/gtk2_ardour/opts.h index 452aef3c30..aa47b30b23 100644 --- a/gtk2_ardour/opts.h +++ b/gtk2_ardour/opts.h @@ -40,7 +40,6 @@ extern std::string menus_file; extern bool finder_invoked_ardour; extern std::string load_template; extern bool check_announcements; -extern bool no_strobe; extern int32_t parse_opts (int argc, char *argv[]); diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 449e09e80b..c60c7f81b5 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -2614,7 +2614,7 @@ RCOptionEditor::RCOptionEditor () sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_no_strobe) ); - Gtkmm2ext::UI::instance()->set_tip (strobe->tip_widget(), _("If enabled, disables meters in editor & mixer, running clock updates and most blinking")); + Gtkmm2ext::UI::instance()->set_tip (strobe->tip_widget(), _("If enabled, disables meters in editor & mixer, running clock updates and most blinking.")); add_option (_("Appearance"), strobe); add_option (_("Appearance/Recorder"), new OptionEditorHeading (_("Input Meter Layout"))); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 093dc50a31..e7714a17f5 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -1394,7 +1394,7 @@ RouteUI::blink_rec_display (bool blinkOn) case Session::Disabled: case Session::Enabled: - if (!ARDOUR_COMMAND_LINE::no_strobe && UIConfiguration::instance().get_blink_rec_arm()) { + if (!UIConfiguration::instance().get_no_strobe() && UIConfiguration::instance().get_blink_rec_arm()) { rec_enable_button->set_active_state ( blinkOn ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off ); } else { rec_enable_button->set_active_state ( ImplicitActive ); diff --git a/gtk2_ardour/transport_control_ui.cc b/gtk2_ardour/transport_control_ui.cc index eddad8578b..574228836d 100644 --- a/gtk2_ardour/transport_control_ui.cc +++ b/gtk2_ardour/transport_control_ui.cc @@ -309,7 +309,7 @@ TransportControlUI::blink_rec_enable (bool onoff) Session::RecordState const r = _session->record_status (); bool const h = _session->have_rec_enabled_track (); - if (ARDOUR_COMMAND_LINE::no_strobe) { + if (UIConfiguration::instance().get_no_strobe()) { onoff = true; }