From a71ab327a33edf582866da0fc5e562111479c845 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 24 Dec 2021 15:34:30 -0700 Subject: [PATCH] triggerbox UI: set ruler metric --- gtk2_ardour/audio_clip_editor.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gtk2_ardour/audio_clip_editor.cc b/gtk2_ardour/audio_clip_editor.cc index 4f7b9621d5..791da941d5 100644 --- a/gtk2_ardour/audio_clip_editor.cc +++ b/gtk2_ardour/audio_clip_editor.cc @@ -402,8 +402,17 @@ AudioClipEditor::set_region (boost::shared_ptr r, TriggerReference drop_waves (); audio_region = r; + + /* Ruler has to reflect tempo of the region, so we have to recreate it + * every time. Note that we retain ownership of the metric, and that + * because the GUI is single-threaded, we can set it and delete it + * safely here (there will be no calls to use it from within the + * ruler). + */ + delete clip_metric; clip_metric = new ClipBBTMetric (tr); + ruler->set_metric (clip_metric); uint32_t n_chans = r->n_channels (); samplecnt_t len;