From a63d01e24a41b232612e6c272af3c6ecdae1a02b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 1 Oct 2012 20:55:10 +0000 Subject: do not add in ticks in the "at" position when computing BBT duration somewhere on the timeline (fixes issues with nudging etc. git-svn-id: svn://localhost/ardour2/branches/3.0@13201 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/tempo.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'libs/ardour/tempo.cc') diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index a5016073bb..0a90acec46 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -1203,16 +1203,9 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i /* round back to the previous precise beat */ BBTPointList::const_iterator wi = bbt_before_or_at (BBT_Time (when.bars, when.beats, 0)); BBTPointList::const_iterator start (wi); - double tick_frames = 0; assert (wi != _map.end()); - /* compute how much rounding we did because of non-zero ticks */ - - if (when.ticks != 0) { - tick_frames = (*wi).tempo->frames_per_beat (_frame_rate) * (when.ticks/BBT_Time::ticks_per_beat); - } - uint32_t bars = 0; uint32_t beats = 0; @@ -1233,10 +1226,11 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i /* add any additional frames related to ticks in the added value */ if (bbt.ticks != 0) { - tick_frames += (*wi).tempo->frames_per_beat (_frame_rate) * (bbt.ticks/BBT_Time::ticks_per_beat); + return ((*wi).frame - (*start).frame) + + (*wi).tempo->frames_per_beat (_frame_rate) * (bbt.ticks/BBT_Time::ticks_per_beat); + } else { + return ((*wi).frame - (*start).frame); } - - return ((*wi).frame - (*start).frame) + llrint (tick_frames); } framepos_t -- cgit v1.2.3