framepos_t pos = position;
if (times == 1 && auto_partition){
- partition(pos - 1, (pos + region->length()), true);
+ RegionList thawlist;
+ partition_internal (pos - 1, (pos + region->length()), true, thawlist);
+ for (RegionList::iterator i = thawlist.begin(); i != thawlist.end(); ++i) {
+ (*i)->resume_property_changes ();
+ }
}
if (itimes >= 1) {
Playlist::partition (framepos_t start, framepos_t end, bool cut)
{
RegionList thawlist;
-
- partition_internal (start, end, cut, thawlist);
+ {
+ RegionWriteLock lock(this);
+ partition_internal (start, end, cut, thawlist);
+ }
for (RegionList::iterator i = thawlist.begin(); i != thawlist.end(); ++i) {
(*i)->resume_property_changes ();
RegionList new_regions;
{
- RegionWriteLock rlock (this);
boost::shared_ptr<Region> region;
boost::shared_ptr<Region> current;
//keep track of any dead space at end (for pasting into Ripple or Splice mode)
framepos_t wanted_length = end-start;
- _end_space = wanted_length - get_extent().second-get_extent().first;
+ _end_space = wanted_length - _get_extent().second - _get_extent().first;
}
boost::shared_ptr<Playlist>
return boost::shared_ptr<Playlist>();
}
- partition_internal (start, start+cnt-1, true, thawlist);
+ {
+ RegionWriteLock rlock (this);
+ partition_internal (start, start+cnt-1, true, thawlist);
+ }
for (RegionList::iterator i = thawlist.begin(); i != thawlist.end(); ++i) {
(*i)->resume_property_changes();
}
void
-Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float /* times */)
+Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float times)
{
if (ranges.empty()) {
return;
framecnt_t offset = max_pos - min_pos;
- 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 ??
+ 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 * count), 1.0f, 0);
+ }
+ ++count;
}
}