From bbb0b78a5080df0a0948ef659df628fe2309b983 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 20 Jun 2022 14:25:32 -0600 Subject: [PATCH] fetch thread local tempo map in potential peak-building threads --- libs/ardour/source_factory.cc | 3 +++ libs/waveview/wave_view.cc | 4 ++++ libs/waveview/wscript | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index 629e934ced..2fad260c0b 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -27,6 +27,8 @@ #include "pbd/convert.h" #include "pbd/error.h" +#include "temporal/tempo.h" + #include "ardour/audio_playlist_source.h" #include "ardour/audioplaylist.h" #include "ardour/boost_debug.h" @@ -71,6 +73,7 @@ peak_thread_work () wait: if (SourceFactory::files_with_peaks.empty () && SourceFactory::peak_thread_run) { SourceFactory::PeaksToBuild.wait (SourceFactory::peak_building_lock); + (void) Temporal::TempoMap::fetch(); } if (!SourceFactory::peak_thread_run) { diff --git a/libs/waveview/wave_view.cc b/libs/waveview/wave_view.cc index 89262ccb65..f5cc1a2789 100644 --- a/libs/waveview/wave_view.cc +++ b/libs/waveview/wave_view.cc @@ -32,6 +32,8 @@ #include "pbd/convert.h" #include "pbd/signals.h" +#include "temporal/tempo.h" + #include "ardour/types.h" #include "ardour/dB.h" #include "ardour/lmath.h" @@ -884,6 +886,8 @@ WaveView::process_draw_request (boost::shared_ptr req) return; } + (void) Temporal::TempoMap::fetch(); + WaveViewProperties const& props = req->image->props; const int n_peaks = props.get_width_pixels (); diff --git a/libs/waveview/wscript b/libs/waveview/wscript index f3d28404f5..e49be62f6f 100644 --- a/libs/waveview/wscript +++ b/libs/waveview/wscript @@ -50,8 +50,8 @@ def build(bld): obj.export_includes = ['.'] obj.includes = ['.'] - obj.uselib = 'SIGCPP CAIROMM GTKMM BOOST XML' - obj.use = [ 'libpbd', 'libcanvas', 'libardour', 'libgtkmm2ext' ] + obj.uselib = 'SIGCPP CAIROMM GTKMM BOOST XML TEMPORAL' + obj.use = [ 'libpbd', 'libcanvas', 'libardour', 'libgtkmm2ext', 'libtemporal' ] obj.name = 'libwaveview' obj.target = 'waveview' obj.vnum = WAVEVIEW_LIB_VERSION