13
0

tempo display: when reassociating markers, use sclock equivalence

Since we're reconnecting visible marker objects with a new map, there's a good
chance that the map will contain map points that don't correspond to the map
points currently referenced by those markers. Thus, tests for address
equivalence will often fail.

Instead, repeat what has been done elsewhere and use the heuristic that we only
allow one point of a given type at the same superclock position.
This commit is contained in:
Paul Davis 2022-06-16 22:07:21 -06:00
parent 8f7a267900
commit 3482d6db4e

View File

@ -125,7 +125,7 @@ Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::M
IS-A TempoPoint
*/
} else if ((tp = dynamic_cast<Temporal::TempoPoint const *>(*m)) != 0) {
if (tm->tempo() == *tp) {
if (tm->tempo().sclock() == tp->sclock()) {
tm->reset_tempo (*tp);
tm->curve().reset_point (*tp);
break;
@ -141,7 +141,7 @@ Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::M
*/
} else if ((mp = dynamic_cast<Temporal::MeterPoint const *>(*m)) != 0) {
if (mm->meter() == *mp) {
if (mm->meter().sclock() == mp->sclock()) {
mm->reset_meter (*mp);
break;
}
@ -152,7 +152,7 @@ Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::M
for (TempoMap::Metrics::iterator m = metrics.begin(); m != metrics.end(); ++m) {
if ((mtp = dynamic_cast<Temporal::MusicTimePoint const *>(*m)) != 0) {
if (bm->point() == *mtp) {
if (bm->point().sclock() == mtp->sclock()) {
bm->reset_point (*mtp);
break;
}