From 256e22344f4c6dad4d894e51c79f08e5d6ed2ba9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 3 Aug 2021 11:42:39 -0600 Subject: [PATCH] ensure that region cue markers that get "trimmed off the edge" of a region actually vanish --- gtk2_ardour/region_view.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 321f2d7d38..69c42a04e0 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -574,12 +574,7 @@ RegionView::update_cue_markers () * timestamps and some of them may be outside the Region. */ - for (CueMarkers::const_iterator c = model_markers.begin(); c != model_markers.end(); ++c) { - - if (c->position() < start || c->position() >= end) { - /* not withing this region */ - continue; - } + for (CueMarkers::iterator c = model_markers.begin(); c != model_markers.end(); c++) { ViewCueMarkers::iterator existing = _cue_markers.end(); @@ -592,6 +587,11 @@ RegionView::update_cue_markers () if (existing == _cue_markers.end()) { + if (c->position() < start || c->position() >= end) { + /* not withing this region */ + continue; + } + /* Create a new ViewCueMarker */ ArdourMarker* mark = new ArdourMarker (trackview.editor(), *group, color , c->text(), ArdourMarker::RegionCue, c->position() - start, true, this); @@ -613,6 +613,13 @@ RegionView::update_cue_markers () } else { + if (c->position() < start || c->position() >= end) { + /* not withing this region */ + delete (*existing); + _cue_markers.erase (existing); + continue; + } + /* Move and control visibility for an existing ViewCueMarker */ if (show_cue_markers) {