summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-06-18 22:28:16 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-06-18 22:28:16 +0000
commit0622d3c06ac7aa885e8c20274885282af453c64c (patch)
tree42348703e36031e2c824dd65a14808de2b5fd6d5 /gtk2_ardour/editor_ops.cc
parent35b0a000c3f662b2743a6314117b0b34a7c3a540 (diff)
make bounce range and bounce region work properly (wrong boundaries before); add "Consolidate Range" which writes a new audio file and uses it to replace whatever was in the playlist within the range
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3478 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 6ae78ff1cb..50980e4d09 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -3614,7 +3614,7 @@ Editor::freeze_route ()
}
void
-Editor::bounce_range_selection ()
+Editor::bounce_range_selection (bool replace)
{
if (selection->time.empty()) {
return;
@@ -3649,7 +3649,15 @@ Editor::bounce_range_selection ()
itt.progress = false;
XMLNode &before = playlist->get_state();
- atv->audio_track()->bounce_range (start, cnt, itt);
+ boost::shared_ptr<Region> r = atv->audio_track()->bounce_range (start, start+cnt, itt);
+
+ if (replace) {
+ list<AudioRange> ranges;
+ ranges.push_back (AudioRange (start, start+cnt, 0));
+ playlist->cut (ranges); // discard result
+ playlist->add_region (r, start);
+ }
+
XMLNode &after = playlist->get_state();
session->add_command (new MementoCommand<Playlist> (*playlist, &before, &after));
}