diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-06-18 22:28:16 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-06-18 22:28:16 +0000 |
commit | 0622d3c06ac7aa885e8c20274885282af453c64c (patch) | |
tree | 42348703e36031e2c824dd65a14808de2b5fd6d5 /gtk2_ardour | |
parent | 35b0a000c3f662b2743a6314117b0b34a7c3a540 (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')
-rw-r--r-- | gtk2_ardour/editor.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_export_audio.cc | 7 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 12 |
4 files changed, 19 insertions, 5 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index cbb9756d86..1952fd8fdc 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2021,7 +2021,8 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& items) items.push_back (MenuElem (_("Duplicate range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false))); items.push_back (MenuElem (_("Create chunk from range"), mem_fun(*this, &Editor::create_named_selection))); items.push_back (SeparatorElem()); - items.push_back (MenuElem (_("Bounce range"), mem_fun(*this, &Editor::bounce_range_selection))); + items.push_back (MenuElem (_("Consolidate range"), bind (mem_fun(*this, &Editor::bounce_range_selection), true))); + items.push_back (MenuElem (_("Bounce range to region list"), bind (mem_fun(*this, &Editor::bounce_range_selection), false))); items.push_back (MenuElem (_("Export range"), mem_fun(*this, &Editor::export_selection))); } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index be86ba4baf..7f7ce96465 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1858,7 +1858,7 @@ public: bool write_region (string path, boost::shared_ptr<ARDOUR::AudioRegion>); void export_region (); void bounce_region_selection (); - void bounce_range_selection (); + void bounce_range_selection (bool replace); void external_edit_region (); int write_audio_selection (TimeSelection&); diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc index 8ee0ac1f90..7768321436 100644 --- a/gtk2_ardour/editor_export_audio.cc +++ b/gtk2_ardour/editor_export_audio.cc @@ -149,7 +149,12 @@ Editor::bounce_region_selection () itt.cancel = false; itt.progress = 0.0f; - track->bounce_range (region->position(), region->position() + region->length(), itt); + boost::shared_ptr<Region> r = track->bounce_range (region->position(), region->position() + region->length(), itt); + cerr << "Result of bounce of " + << region->name() << " len = " << region->length() + << " was " + << r->name() << " len = " << r->length() + << endl; } } 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)); } |