fix duplicating multiple selected regions - fixes #6202
[ardour.git] / libs / ardour / playlist.cc
index 8862c633ab62fbe6578b5d5b3ed36605a174101a..868be8da193d898f44565d77873175bfab8ca7b4 100644 (file)
@@ -1244,6 +1244,13 @@ Playlist::flush_notifications (bool from_undo)
 
  void
  Playlist::duplicate (boost::shared_ptr<Region> region, framepos_t position, float times)
+ {
+        duplicate(region, position, region->length(), times);
+ }
+
+/** @param gap from the beginning of the region to the next beginning */
+ void
+ Playlist::duplicate (boost::shared_ptr<Region> region, framepos_t position, framecnt_t gap, float times)
  {
         times = fabs (times);
 
@@ -1255,7 +1262,7 @@ Playlist::flush_notifications (bool from_undo)
                 boost::shared_ptr<Region> copy = RegionFactory::create (region, true);
                 add_region_internal (copy, pos);
                 set_layer (copy, DBL_MAX);
-                pos += region->length();
+                pos += gap;
         }
 
         if (floor (times) != times) {