From 7337ba42f5e0e892f5db957a0ce7f34b7bea2f4e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 23 Oct 2022 22:25:57 -0600 Subject: [PATCH] fix region duplicate Missing equivalent code from 6.9 that sets position. Also renamed scoped *_sample vars as *_time --- gtk2_ardour/editor_ops.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index eca8c1641f..03b6e914fa 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -5237,9 +5237,9 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times) RegionSelection sel = regions; // clear (below) may clear the argument list if its the current region selection RegionSelection foo; - timepos_t const start_sample = regions.start_time (); - timepos_t const end_sample = regions.end_time (); - timecnt_t const span = start_sample.distance (end_sample); + timepos_t const start_time = regions.start_time (); + timepos_t const end_time = regions.end_time (); + timecnt_t const span = start_time.distance (end_time); begin_reversible_command (Operations::duplicate_region); @@ -5264,7 +5264,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times) } for (set >::iterator p = playlists.begin(); p != playlists.end(); ++p) { - do_ripple ((*p), start_sample, span.scale (times), &exclude, false); + do_ripple ((*p), start_time, span.scale (times), &exclude, false); } } @@ -5277,7 +5277,9 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times) latest_regionviews.clear (); sigc::connection c = rtv->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view)); - timepos_t position = end_sample; + timepos_t position = end_time + (start_time.distance (r->position())); + position.increment (); + playlist = (*i)->region()->playlist(); if (!should_ripple()) {