diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-10-01 20:55:10 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-10-01 20:55:10 +0000 |
commit | a63d01e24a41b232612e6c272af3c6ecdae1a02b (patch) | |
tree | b7d04908bcb3025cf0bcd7352f89b3eb322ebaea /libs/ardour/tempo.cc | |
parent | 02a98547f153b63ee17eab9c6bf6c71fc026652e (diff) |
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
Diffstat (limited to 'libs/ardour/tempo.cc')
-rw-r--r-- | libs/ardour/tempo.cc | 14 |
1 files changed, 4 insertions, 10 deletions
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 |