From e14acfc07d4c89daa60d5c1952ec7fc27f2ec8ae Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 21 Jan 2022 10:55:28 -0700 Subject: [PATCH] prevent multiple cue markers at the same location --- libs/ardour/location.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index 0d1eda11b7..e6313d3ebb 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -980,6 +980,18 @@ Locations::add (Location *loc, bool make_current) { Glib::Threads::RWLock::WriterLock lm (_lock); + + /* Do not allow multiple cue markers in the same location */ + + if (loc->is_cue_marker()) { + for (LocationList::iterator i = locations.begin(); i != locations.end(); ++i) { + if ((*i)->is_cue_marker() && (*i)->start() == loc->start()) { + locations.erase (i); + break; + } + } + } + locations.push_back (loc); if (make_current) {