ensure that region cue markers that get "trimmed off the edge" of a region actually vanish

This commit is contained in:
Paul Davis 2021-08-03 11:42:39 -06:00
parent b8bb5e6bd1
commit 256e22344f
1 changed files with 13 additions and 6 deletions

View File

@ -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) {