13
0

tempo ramps - fix dumb iterator error. thanks robin.

This commit is contained in:
nick_m 2015-12-20 06:41:20 +11:00
parent 6cb752dc15
commit 0d0e458dde

View File

@ -1029,12 +1029,14 @@ TempoMap::_extend_map (TempoSection* tempo, MeterSection* meter,
uint32_t first_tick_in_new_meter = 0; uint32_t first_tick_in_new_meter = 0;
Metrics::const_iterator i; Metrics::const_iterator i;
Metrics::const_iterator mi;
TempoSection* prev_ts = tempo; TempoSection* prev_ts = tempo;
for (i = metrics.begin(); i != metrics.end(); ++i) { for (mi = metrics.begin(); mi != metrics.end(); ++mi) {
MeterSection* m = 0; MeterSection* m = 0;
if ((m = dynamic_cast<MeterSection*> (*i)) != 0) { if ((m = dynamic_cast<MeterSection*> (*mi)) != 0) {
if (m->start() >= prev_ts->start()) { if (m->start() >= prev_ts->start()) {
first_tick_in_new_meter = ((((m->start().bars - 1) * meter->divisions_per_bar()) + (m->start().beats - 1)) * BBT_Time::ticks_per_beat) + m->start().ticks; // expressed in ticks from the previous meter first_tick_in_new_meter = ((((m->start().bars - 1) * meter->divisions_per_bar()) + (m->start().beats - 1)) * BBT_Time::ticks_per_beat) + m->start().ticks; // expressed in ticks from the previous meter