From 0db261cf64e87e319c0c323e477b01aed72f98e3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 5 Feb 2022 19:03:22 +0100 Subject: [PATCH] Merge Overwrite request for the track Previously events with different reasons where treated as two separate events. Processing an Overwrite request causes post-transport-work to set. Since ::non_realtime_work_pending() is true, process_event() is not called, and no further immediate events are evaluated in the same cycle. So Overwrite requests were repeated over multiple cycles. --- libs/ardour/session_events.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc index a0c880282b..d52c88e2bc 100644 --- a/libs/ardour/session_events.cc +++ b/libs/ardour/session_events.cc @@ -254,11 +254,11 @@ SessionEventManager::_replace_event (SessionEvent* ev) Events& e (ev->action_sample == SessionEvent::Immediate ? immediate_events : events); for (i = e.begin(); i != e.end(); ++i) { - if ((*i)->type == ev->type && ev->type == SessionEvent::Overwrite && (*i)->track.lock() == ev->track.lock() && (*i)->overwrite == ev->overwrite) { + if ((*i)->type == ev->type && ev->type == SessionEvent::Overwrite && (*i)->track.lock() == ev->track.lock()) { assert (ev->action_sample == SessionEvent::Immediate); - ret = true; + (*i)->overwrite = ARDOUR::OverwriteReason ((*i)->overwrite | ev->overwrite); delete ev; - break; + return true; } else if ((*i)->type == ev->type && ev->type != SessionEvent::Overwrite) { assert (ev->action_sample != SessionEvent::Immediate);