update processor in-place mode when pin-mapping changes
[ardour.git] / libs / ardour / playlist.cc
index a4860eba992095cf15ef84e309a33850c08fe5ac..b571a9eb5fd618698264c4ccc93b93be4fe9fc74 100644 (file)
@@ -1316,6 +1316,39 @@ Playlist::duplicate_until (boost::shared_ptr<Region> region, framepos_t position
         }
 }
 
+void
+Playlist::duplicate_range (AudioRange& range, float times)
+{
+       boost::shared_ptr<Playlist> pl = copy (range.start, range.length(), true);
+       framecnt_t offset = range.end - range.start;
+       paste (pl, range.start + offset, times);
+}
+
+void
+Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float /* times */)
+{
+       if (ranges.empty()) {
+               return;
+       }
+
+       framepos_t min_pos = max_framepos;
+       framepos_t max_pos = 0;
+
+       for (std::list<AudioRange>::const_iterator i = ranges.begin();
+            i != ranges.end();
+            ++i) {
+               min_pos = min (min_pos, (*i).start);
+               max_pos = max (max_pos, (*i).end);
+       }
+
+       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); // times ??
+       }
+}
+
  void
  Playlist::shift (framepos_t at, frameoffset_t distance, bool move_intersected, bool ignore_music_glue)
  {
@@ -1408,7 +1441,6 @@ Playlist::duplicate_until (boost::shared_ptr<Region> region, framepos_t position
         {
                 PropertyList plist;
 
-                plist.add (Properties::position, region->position ());
                 plist.add (Properties::length, before);
                 plist.add (Properties::name, before_name);
                 plist.add (Properties::left_of_split, true);
@@ -1427,7 +1459,6 @@ Playlist::duplicate_until (boost::shared_ptr<Region> region, framepos_t position
         {
                 PropertyList plist;
 
-                plist.add (Properties::position, region->position() + before);
                 plist.add (Properties::length, after);
                 plist.add (Properties::name, after_name);
                 plist.add (Properties::right_of_split, true);
@@ -3142,7 +3173,7 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
                }
 
                /* check to see how the original region (in the
-                * playlist before compounding occured) overlaps
+                * playlist before compounding occurred) overlaps
                 * with the new state of the compound region.
                 */