From b7bee5c90398c3836b3ce747c18ba34e52f205d8 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Wed, 30 Nov 2016 19:45:56 +1000 Subject: [PATCH] Fix Multi Duplicate for a Range Selections As mentioned in the previous commit --- libs/ardour/playlist.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index fcf24795db..c520f10b99 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -1327,7 +1327,7 @@ Playlist::duplicate_range (AudioRange& range, float times) } void -Playlist::duplicate_ranges (std::list& ranges, float /* times */) +Playlist::duplicate_ranges (std::list& ranges, float times) { if (ranges.empty()) { return; @@ -1345,9 +1345,14 @@ Playlist::duplicate_ranges (std::list& ranges, float /* times */) framecnt_t offset = max_pos - min_pos; - for (list::iterator i = ranges.begin(); i != ranges.end(); ++i) { - boost::shared_ptr pl = copy ((*i).start, (*i).length(), true); - paste (pl, (*i).start + offset, 1.0f, 0); // times ?? + int count = 1; + int itimes = (int) floor (times); + while (itimes--) { + for (list::iterator i = ranges.begin (); i != ranges.end (); ++i) { + boost::shared_ptr pl = copy ((*i).start, (*i).length (), true); + paste (pl, (*i).start + (offset * count), 1.0f, 0); + } + ++count; } }