From 7762dde95e8a39858eb3529512fe21ee9aa5237a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 7 Jan 2021 20:07:59 -0700 Subject: [PATCH] remove another NUTEMPO warning by connecting AudioClock to static MapChanged signal --- gtk2_ardour/audio_clock.cc | 6 +++--- gtk2_ardour/audio_clock.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 6154ad19f5..d7da7ae6a2 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -136,6 +136,8 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string& UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &AudioClock::set_colors)); UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &AudioClock::dpi_reset)); + + TempoMap::MapChanged.connect (tempo_map_connection, invalidator (*this), boost::bind (&AudioClock::tempo_map_changed, this), gui_context()); } AudioClock::~AudioClock () @@ -802,7 +804,7 @@ AudioClock::end_edit_relative (bool add) } void -AudioClock::session_property_changed (const PropertyChange&) +AudioClock::tempo_map_changed () { AudioClock::set (last_when, true); } @@ -1332,8 +1334,6 @@ AudioClock::set_session (Session *s) Config->ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_configuration_changed, this, _1), gui_context()); _session->config.ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_configuration_changed, this, _1), gui_context()); -#warning NUTEMPO probably need a static signal here, map object will change address etc - // TempoMap::use()->Changed.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_property_changed, this), gui_context()); XMLNode* node = _session->extra_xml (X_("ClockModes")); diff --git a/gtk2_ardour/audio_clock.h b/gtk2_ardour/audio_clock.h index 233f4e0ac0..7e0485540c 100644 --- a/gtk2_ardour/audio_clock.h +++ b/gtk2_ardour/audio_clock.h @@ -244,7 +244,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr samplepos_t samples_from_audiosamples_string (const std::string&) const; void session_configuration_changed (std::string); - void session_property_changed (const PBD::PropertyChange&); + void tempo_map_changed (); Field index_to_field () const; @@ -273,6 +273,8 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr double xscale; double yscale; + + PBD::ScopedConnection tempo_map_connection; }; #endif /* __audio_clock_h__ */