13
0

Fix Multi Duplicate for a Range Selections

As mentioned in the previous commit
This commit is contained in:
Tim Mayberry 2016-11-30 19:45:56 +10:00
parent a7d19f8fe5
commit b7bee5c903

View File

@ -1327,7 +1327,7 @@ Playlist::duplicate_range (AudioRange& range, float times)
}
void
Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float /* times */)
Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float times)
{
if (ranges.empty()) {
return;
@ -1345,9 +1345,14 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float /* times */)
framecnt_t offset = max_pos - min_pos;
int count = 1;
int itimes = (int) floor (times);
while (itimes--) {
for (list<AudioRange>::iterator i = ranges.begin (); i != ranges.end (); ++i) {
boost::shared_ptr<Playlist> pl = copy ((*i).start, (*i).length (), true);
paste (pl, (*i).start + offset, 1.0f, 0); // times ??
paste (pl, (*i).start + (offset * count), 1.0f, 0);
}
++count;
}
}