13
0

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
This commit is contained in:
Carl Hetherington 2010-05-01 23:35:04 +00:00
parent 576cdb08b5
commit 78da07607d

View File

@ -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);