From 51e93399ba5f794ae4c3cfab6b9d74b0aa652640 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 4 Feb 2023 03:21:27 +0100 Subject: [PATCH] Update vari-speed availability, depending on port-resampler --- gtk2_ardour/shuttle_control.cc | 4 +++- gtk2_ardour/shuttle_control.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/shuttle_control.cc b/gtk2_ardour/shuttle_control.cc index e714edb24f..192774c82a 100644 --- a/gtk2_ardour/shuttle_control.cc +++ b/gtk2_ardour/shuttle_control.cc @@ -186,6 +186,8 @@ ShuttleControl::ShuttleControl () } Config->ParameterChanged.connect (parameter_connection, MISSING_INVALIDATOR, boost::bind (&ShuttleControl::parameter_changed, this, _1), gui_context ()); + Port::ResamplerQualityChanged.connect (port_connection, MISSING_INVALIDATOR, boost::bind (&ShuttleControl::parameter_changed, this, "external-sync"), gui_context ()); + UIConfiguration::instance ().ColorsChanged.connect (sigc::mem_fun (*this, &ShuttleControl::set_colors)); Timers::blink_connect (sigc::mem_fun (*this, &ShuttleControl::do_blink)); @@ -768,7 +770,7 @@ ShuttleControl::parameter_changed (std::string p) delete shuttle_context_menu; shuttle_context_menu = 0; } else if (p == "external-sync") { - if (_session->config.get_external_sync() || !Port::can_varispeed ()) { + if (!_session || _session->config.get_external_sync() || !Port::can_varispeed ()) { _vari_dialog.hide (); _vari_button.set_sensitive (false); if (shuttle_grabbed) { diff --git a/gtk2_ardour/shuttle_control.h b/gtk2_ardour/shuttle_control.h index 7545f1c6af..d5c2344357 100644 --- a/gtk2_ardour/shuttle_control.h +++ b/gtk2_ardour/shuttle_control.h @@ -120,6 +120,7 @@ protected: cairo_pattern_t* shine_pattern; PBD::microseconds_t last_shuttle_request; PBD::ScopedConnection parameter_connection; + PBD::ScopedConnection port_connection; ShuttleInfoButton _info_button; Gtk::Menu* shuttle_context_menu; ArdourWidgets::BindingProxy binding_proxy;