summaryrefslogtreecommitdiff
path: root/libs/ardour/tempo.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-05-01 23:35:04 +0000
committerCarl Hetherington <carl@carlh.net>2010-05-01 23:35:04 +0000
commit78da07607d8094ac5a48e90d79e2f71318246574 (patch)
treeff99f4e85f5ba0f52a370594f044f7c790f58b96 /libs/ardour/tempo.cc
parent576cdb08b5eab456eea91263fac1709dd7931a9d (diff)
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
Diffstat (limited to 'libs/ardour/tempo.cc')
-rw-r--r--libs/ardour/tempo.cc4
1 files 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);