From f67e731a7fadc5a7c52fe3832d51fa9686d47f87 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 30 Jun 2022 00:35:22 +0200 Subject: [PATCH] Prevent session-range changes to create invalid loop ranges When a session-range coincides with a loop-range location, moving the session-range also updates the loop-range. Keeping session and loop-range in sync can be useful if the whole session is looped. However markers are treated individually, so we need prevent invalid ranges. If session-start and loop-start coincide, but loop-end is before the end-marker, it is possible to move session-start beyond the loop-end. --- libs/ardour/session.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index ed0b6c2dfd..52060e0244 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -6523,7 +6523,7 @@ Session::start_time_changed (samplepos_t old) Location* l = _locations->auto_loop_location (); - if (l && l->start() == old) { + if (l && l->start() == old && l->end() > s->start()) { l->set_start (s->start(), true); } set_dirty (); @@ -6543,7 +6543,7 @@ Session::end_time_changed (samplepos_t old) Location* l = _locations->auto_loop_location (); - if (l && l->end() == old) { + if (l && l->end() == old && l->start () < s->end()) { l->set_end (s->end(), true); } set_dirty ();