mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 12:45:45 +01:00
avoid duplicate BBT points in grid
This commit is contained in:
parent
1cf6886775
commit
d0fb7ae18a
1 changed files with 11 additions and 5 deletions
|
|
@ -2146,14 +2146,20 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u
|
|||
do {
|
||||
const Temporal::Beats beats = metric.quarters_at_superclock (start);
|
||||
|
||||
if (bar_mod != 0) {
|
||||
if (bbt.is_bar() && (bar_mod == 1 || ((bbt.bars % bar_mod == 0)))) {
|
||||
/* It is possible we already added the current BBT
|
||||
* point, so check to avoid doubling up
|
||||
*/
|
||||
|
||||
if (ret.back().bbt() != bbt) {
|
||||
if (bar_mod != 0) {
|
||||
if (bbt.is_bar() && (bar_mod == 1 || ((bbt.bars % bar_mod == 0)))) {
|
||||
ret.push_back (TempoMapPoint (*this, metric, start, beats, bbt));
|
||||
DEBUG_TRACE (DEBUG::Grid, string_compose ("Gend %1\t %2\n", metric, ret.back()));
|
||||
}
|
||||
} else {
|
||||
ret.push_back (TempoMapPoint (*this, metric, start, beats, bbt));
|
||||
DEBUG_TRACE (DEBUG::Grid, string_compose ("Gend %1\t %2\n", metric, ret.back()));
|
||||
}
|
||||
} else {
|
||||
ret.push_back (TempoMapPoint (*this, metric, start, beats, bbt));
|
||||
DEBUG_TRACE (DEBUG::Grid, string_compose ("Gend %1\t %2\n", metric, ret.back()));
|
||||
}
|
||||
|
||||
start += step;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue