13
0

Do not accumulate SessionEvent::Overwrite events #8576

This commit is contained in:
Robin Gareus 2021-03-22 02:54:42 +01:00
parent 86a594fe90
commit a75c239c0c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 8 additions and 2 deletions

View File

@ -81,7 +81,7 @@ void
Session::request_overwrite_buffer (boost::shared_ptr<Track> t, OverwriteReason why)
{
assert (t);
SessionEvent *ev = new SessionEvent (SessionEvent::Overwrite, SessionEvent::Add, SessionEvent::Immediate, 0, 0, 0.0);
SessionEvent *ev = new SessionEvent (SessionEvent::Overwrite, SessionEvent::Replace, SessionEvent::Immediate, 0, 0, 0.0);
ev->set_track (t);
ev->overwrite = why;
queue_event (ev);

View File

@ -253,7 +253,13 @@ SessionEventManager::_replace_event (SessionEvent* ev)
/* private, used only for events that can only exist once in the queue */
for (i = events.begin(); i != events.end(); ++i) {
if ((*i)->type == ev->type) {
if ((*i)->type == ev->type && ev->type == SessionEvent::Overwrite && (*i)->track.lock() == ev->track.lock()) {
ret = true;
delete ev;
break;
}
else if ((*i)->type == ev->type && ev->type != SessionEvent::Overwrite) {
assert (ev->type == SessionEvent::PunchIn || ev->type == SessionEvent::PunchOut || ev->type == SessionEvent::AutoLoop);
(*i)->action_sample = ev->action_sample;
(*i)->target_sample = ev->target_sample;
if ((*i) == ev) {