From 3efb488629818fbe5bd438e85bc01885b1b5798d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 25 Oct 2022 10:59:22 -0600 Subject: [PATCH] when moving tempo markers, do nothing unless the marker is moved at least 1 beat Since tempo markers are always on-beat, this enforces a minumum distance of 1 beat while remaining on-beat. --- libs/temporal/tempo.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index 4771df6223..b91b8bd0e0 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -1400,6 +1400,12 @@ TempoMap::move_tempo (TempoPoint const & tp, timepos_t const & when, bool push) beats = when.beats (); + const Beats delta ((beats - tp.beats()).abs()); + + if (delta < Beats (1,0)) { + return false; + } + /* Do not allow moving a tempo marker to the same position as * an existing one. */