From 78da07607d8094ac5a48e90d79e2f71318246574 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 1 May 2010 23:35:04 +0000 Subject: [PATCH] Fix snap to bars to account for the fact that the beats are counted from 1 rather than 0. git-svn-id: svn://localhost/ardour2/branches/3.0@7034 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/tempo.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 93470e369b..127c0a10e4 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -1204,7 +1204,7 @@ TempoMap::round_to_type (nframes64_t frame, int dir, BBTPointType type) switch (type) { case Bar: - DEBUG_TRACE(DEBUG::SnapBBT, string_compose ("round from %1 (%3) to bars in direction %2\n", frame, (dir < 0 ? "back" : "forward"), bbt)); + DEBUG_TRACE(DEBUG::SnapBBT, string_compose ("round from %1 (%3) to bars in direction %2\n", frame, dir, bbt)); if (dir < 0) { @@ -1237,7 +1237,7 @@ TempoMap::round_to_type (nframes64_t frame, int dir, BBTPointType type) float midbar_beats; float midbar_ticks; - midbar_beats = metric.meter().beats_per_bar() / 2; + midbar_beats = metric.meter().beats_per_bar() / 2 + 1; midbar_ticks = Meter::ticks_per_beat * fmod (midbar_beats, 1.0f); midbar_beats = floor (midbar_beats);