From a899136caecd1c9b1e282d2947ce76c293b92c2a Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Fri, 13 May 2022 12:03:49 -0500 Subject: [PATCH] Fix egregious playlist copy+paste thinko * when you copy a Range into a playlist, the playlist's 'timeline' should begin at the start of the selected Range. Regions should retain the offset they had from the Range's start. --- libs/ardour/playlist.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index c1c5262bb1..15ae115bcd 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -237,13 +237,13 @@ Playlist::Playlist (boost::shared_ptr other, timepos_t const & s case Temporal::OverlapInternal: offset = region->position().distance (start); - position = timepos_t (start.time_domain()); + position = timepos_t(start.time_domain()); len = timecnt_t (cnt); break; case Temporal::OverlapStart: offset = timecnt_t (start.time_domain()); - position = region->source_position(); + position = start.distance(region->position()); len = region->position().distance (end); break; @@ -255,7 +255,7 @@ Playlist::Playlist (boost::shared_ptr other, timepos_t const & s case Temporal::OverlapExternal: offset = timecnt_t (start.time_domain()); - position = region->source_position(); + position = start.distance(region->position()); len = region->length(); break; }