mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
check for multiple tempo/meter marks at the same location, which somehow ardour2 allowed. don't handle it but at least report the error
git-svn-id: svn://localhost/ardour2/branches/3.0@13082 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ce17c5727c
commit
b18fbc8c68
1 changed files with 23 additions and 0 deletions
|
|
@ -1012,6 +1012,7 @@ TempoMap::_extend_map (TempoSection* tempo, MeterSection* meter,
|
|||
*/
|
||||
goto set_metrics;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1645,6 +1646,28 @@ TempoMap::set_state (const XMLNode& node, int /*version*/)
|
|||
metrics.sort (cmp);
|
||||
}
|
||||
|
||||
/* check for multiple tempo/meters at the same location, which
|
||||
ardour2 somehow allowed.
|
||||
*/
|
||||
|
||||
Metrics::iterator prev = metrics.end();
|
||||
for (Metrics::iterator i = metrics.begin(); i != metrics.end(); ++i) {
|
||||
if (prev != metrics.end()) {
|
||||
if (dynamic_cast<MeterSection*>(*prev) && dynamic_cast<MeterSection*>(*i)) {
|
||||
if ((*prev)->start() == (*i)->start()) {
|
||||
error << string_compose (_("Multiple meter definitions found at %1"), (*prev)->start()) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
} else if (dynamic_cast<TempoSection*>(*prev) && dynamic_cast<TempoSection*>(*i)) {
|
||||
if ((*prev)->start() == (*i)->start()) {
|
||||
error << string_compose (_("Multiple tempo definitions found at %1"), (*prev)->start()) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
prev = i;
|
||||
}
|
||||
|
||||
recompute_map (true, -1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue