mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
Fix grid when tempo marker is not on a mod_bar/beat_div
Previously the current iterator bbt was moved to p->bbt(). From then on, no grid line is reached if the point p is not on a bar and mod_bar != 0 or the point is not on an expected beat_div. e.g. when using bbt += mod_bar, and a tempo-change is at 5|2|0. iterations continues 6|2|0 7|2|0 is_bar() is always false and no more grid-lines were added. Rather than trying bbt = round-up-to-next-grid-mod-div and then finding the metric for that position, this approach only does the latter using the already incremented BBT position.
This commit is contained in:
parent
b0a679a1af
commit
34e12a5d78
1 changed files with 10 additions and 5 deletions
|
|
@ -2107,11 +2107,14 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u
|
||||||
|
|
||||||
if (reset) {
|
if (reset) {
|
||||||
|
|
||||||
/* reset our sense of "now" to be wherever the point is */
|
/* bbt is position for the next grid-line.
|
||||||
|
* It is already increameted above depending on mod_bar and beat_div
|
||||||
|
* and must not be changed here.
|
||||||
|
*
|
||||||
|
* Skip metrics until p->bbt() is at or after up to next grid mod div.
|
||||||
|
*/
|
||||||
|
|
||||||
start = p->sclock();
|
assert (p->bbt() <= bbt);
|
||||||
bbt = p->bbt();
|
|
||||||
beats = p->beats();
|
|
||||||
|
|
||||||
/* If we just arrived at a point (indicated by bbt ==
|
/* If we just arrived at a point (indicated by bbt ==
|
||||||
* p->bbt()), use all points at the same location to
|
* p->bbt()), use all points at the same location to
|
||||||
|
|
@ -2122,7 +2125,7 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u
|
||||||
|
|
||||||
bool rebuild_metric = false;
|
bool rebuild_metric = false;
|
||||||
|
|
||||||
while (p->bbt() == bbt) {
|
while (p != _points.end() && p->bbt() <= bbt) {
|
||||||
|
|
||||||
TempoPoint const * tpp;
|
TempoPoint const * tpp;
|
||||||
MeterPoint const * mpp;
|
MeterPoint const * mpp;
|
||||||
|
|
@ -2147,6 +2150,8 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u
|
||||||
DEBUG_TRACE (DEBUG::Grid, string_compose ("second| with start = %1 aka %2 rebuilt metric from points, now %3\n", start, bbt, metric));
|
DEBUG_TRACE (DEBUG::Grid, string_compose ("second| with start = %1 aka %2 rebuilt metric from points, now %3\n", start, bbt, metric));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* this is potentially ambiguous */
|
||||||
|
start = metric.superclock_at (bbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the quarter-note time value to match the BBT and
|
/* Update the quarter-note time value to match the BBT and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue