From 6bc881086bff3150f98c0b7d064f2426bd714f6c Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Sat, 12 Feb 2022 09:04:00 -0600 Subject: [PATCH] Fix a bug where the spinner skipped values because it was always rounding down Until we have a trimmer, the clip length spinner sets integer beats (beatcnt) This allows the user some minimal ability to fix a clip of the wrong bpm. We assumed that 'clips' are already be pre-trimmed to a beat length. Our internal heuristic always forced tempo to match an integer beatcnt However: when bouncing a Range to a Trigger Clip, you can know the tempo, and also have a non-integer beat length. In those cases, the clip-length spinner could behave oddly. While it's arguably wrong to show integer beats when the internal value is something else, we still want to show the spinner in integer beats, so it remains usable for its main purpose --- gtk2_ardour/audio_trigger_properties_box.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/audio_trigger_properties_box.cc b/gtk2_ardour/audio_trigger_properties_box.cc index 7048a4abcf..737a9ca7a8 100644 --- a/gtk2_ardour/audio_trigger_properties_box.cc +++ b/gtk2_ardour/audio_trigger_properties_box.cc @@ -224,7 +224,7 @@ AudioTriggerPropertiesBox::on_trigger_changed (const PBD::PropertyChange& pc) ArdourWidgets::set_tooltip (_abpm_label, string_compose ("Clip Tempo, used for stretching. Estimated tempo (from file) was: %1", trigger->estimated_tempo ())); - int beats = at->segment_beatcnt(); + int beats = round(at->segment_beatcnt()); _beat_adjustment.set_value(beats);