summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-12-01 23:56:29 +0000
committerCarl Hetherington <carl@carlh.net>2009-12-01 23:56:29 +0000
commit57699743df6dcc7a37b64c49394c3062229e39cc (patch)
tree3ef8b87c12cec53bbac749812f48afae5d351df1 /gtk2_ardour/editor_ops.cc
parent8b9b4308e0d25bf72f1e9fd28e91e3453b46518c (diff)
Patch from lincoln to fix #1601: strange behaviour when duplicating multiple regions.
git-svn-id: svn://localhost/ardour2/branches/3.0@6262 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 0cb50d246a..fe003d231c 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -4348,6 +4348,9 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
RegionSelection sel = regions; // clear (below) may clear the argument list if its the current region selection
RegionSelection foo;
+ nframes_t const start_frame = regions.start ();
+ nframes_t const end_frame = regions.end_frame ();
+
begin_reversible_command (_("duplicate region"));
selection->clear_regions ();
@@ -4363,7 +4366,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
playlist = (*i)->region()->playlist();
XMLNode &before = playlist->get_state();
- playlist->duplicate (r, r->last_frame(), times);
+ playlist->duplicate (r, end_frame + (r->first_frame() - start_frame) + 1, times);
session->add_command(new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
c.disconnect ();