From 3482d6db4e3923433b039a48f88eb461e3ef880c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 16 Jun 2022 22:07:21 -0600 Subject: [PATCH] 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. --- gtk2_ardour/editor_tempodisplay.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index e7947455e6..ec96466293 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -125,7 +125,7 @@ Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::M IS-A TempoPoint */ } else if ((tp = dynamic_cast(*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(*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(*m)) != 0) { - if (bm->point() == *mtp) { + if (bm->point().sclock() == mtp->sclock()) { bm->reset_point (*mtp); break; }