diff options
-rw-r--r-- | gtk2_ardour/editor.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/audio_track.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 2 | ||||
-rw-r--r-- | libs/ardour/audio_track.cc | 15 | ||||
-rw-r--r-- | libs/ardour/session.cc | 4 |
8 files changed, 21 insertions, 19 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index eee60e033b..105558d964 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2077,8 +2077,10 @@ 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 (_("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 (_("Consolidate range"), bind (mem_fun(*this, &Editor::bounce_range_selection), true, false))); + items.push_back (MenuElem (_("Consolidate range with processing"), bind (mem_fun(*this, &Editor::bounce_range_selection), true, true))); + items.push_back (MenuElem (_("Bounce range to region list"), bind (mem_fun(*this, &Editor::bounce_range_selection), false, false))); + items.push_back (MenuElem (_("Bounce range to region list with processing"), bind (mem_fun(*this, &Editor::bounce_range_selection), false, true))); 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 983f39d170..8e356c86da 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1919,7 +1919,7 @@ public: bool write_region (string path, boost::shared_ptr<ARDOUR::AudioRegion>); void export_region (); void bounce_region_selection (); - void bounce_range_selection (bool replace); + void bounce_range_selection (bool replace, bool enable_processing = true); void external_edit_region (); int write_audio_selection (TimeSelection&); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index bc934ead1d..ff521c91c6 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -3666,7 +3666,7 @@ Editor::freeze_route () } void -Editor::bounce_range_selection (bool replace) +Editor::bounce_range_selection (bool replace, bool enable_processing) { if (selection->time.empty()) { return; @@ -3701,7 +3701,7 @@ Editor::bounce_range_selection (bool replace) itt.progress = false; XMLNode &before = playlist->get_state(); - boost::shared_ptr<Region> r = atv->audio_track()->bounce_range (start, start+cnt, itt); + boost::shared_ptr<Region> r = atv->audio_track()->bounce_range (start, start+cnt, itt, enable_processing); if (replace) { list<AudioRange> ranges; diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index 63fa2945e0..b9722637f4 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -54,13 +54,13 @@ class AudioTrack : public Track int use_diskstream (const PBD::ID& id); void use_new_diskstream (); - int export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t nframes, nframes_t end_frame); + int export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t nframes, nframes_t end_frame, bool enable_processing = true); void freeze (InterThreadInfo&); void unfreeze (); boost::shared_ptr<Region> bounce (InterThreadInfo&); - boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&); + boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing); int set_state(const XMLNode& node); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 6c97349c50..8ca3714666 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -711,8 +711,7 @@ class Session : public PBD::StatefulDestructible /* flattening stuff */ - boost::shared_ptr<Region> write_one_audio_track (AudioTrack&, nframes_t start, nframes_t end, bool overwrite, vector<boost::shared_ptr<AudioSource> >&, - InterThreadInfo& wot); + boost::shared_ptr<Region> write_one_audio_track (AudioTrack&, nframes_t start, nframes_t end, bool overwrite, vector<boost::shared_ptr<AudioSource> >&, InterThreadInfo& wot, bool enable_processing = true); int freeze (InterThreadInfo&); /* session-wide solo/mute/rec-enable */ diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index e756b10699..6a1a4e2e7e 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -77,7 +77,7 @@ class Track : public Route virtual void unfreeze () = 0; virtual boost::shared_ptr<Region> bounce (InterThreadInfo&) = 0; - virtual boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&) = 0; + virtual boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing = true) = 0; XMLNode& get_state(); XMLNode& get_template(); diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 920367ae94..7f411be413 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -37,6 +37,7 @@ #include <ardour/playlist_factory.h> #include <ardour/panner.h> #include <ardour/utils.h> +#include <ardour/mix.h> #include "i18n.h" @@ -740,7 +741,7 @@ AudioTrack::silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end } int -AudioTrack::export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t start, nframes_t nframes) +AudioTrack::export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t start, nframes_t nframes, bool enable_processing) { gain_t gain_automation[nframes]; gain_t gain_buffer[nframes]; @@ -778,6 +779,9 @@ AudioTrack::export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t st } } + // If no processing is required, there's no need to go any further. + if (!enable_processing) + return 0; /* note: only run inserts during export. other layers in the machinery will already have checked that there are no external port inserts. @@ -812,10 +816,7 @@ AudioTrack::export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t st } else { for (bi = buffers.begin(); bi != buffers.end(); ++bi) { - Sample *b = *bi; - for (nframes_t n = 0; n < nframes; ++n) { - b[n] *= this_gain; - } + apply_gain_to_buffer(*bi, nframes, this_gain); } } @@ -849,10 +850,10 @@ AudioTrack::bounce (InterThreadInfo& itt) boost::shared_ptr<Region> -AudioTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt) +AudioTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt, bool enable_processing) { vector<boost::shared_ptr<AudioSource> > srcs; - return _session.write_one_audio_track (*this, start, end, false, srcs, itt); + return _session.write_one_audio_track (*this, start, end, false, srcs, itt, enable_processing); } void diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 52f799695c..7ca817147e 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4109,7 +4109,7 @@ Session::freeze (InterThreadInfo& itt) boost::shared_ptr<Region> Session::write_one_audio_track (AudioTrack& track, nframes_t start, nframes_t end, - bool overwrite, vector<boost::shared_ptr<AudioSource> >& srcs, InterThreadInfo& itt) + bool overwrite, vector<boost::shared_ptr<AudioSource> >& srcs, InterThreadInfo& itt, bool enable_processing) { boost::shared_ptr<Region> result; boost::shared_ptr<Playlist> playlist; @@ -4202,7 +4202,7 @@ Session::write_one_audio_track (AudioTrack& track, nframes_t start, nframes_t en this_chunk = min (to_do, chunk_size); - if (track.export_stuff (buffers, nchans, start, this_chunk)) { + if (track.export_stuff (buffers, nchans, start, this_chunk, enable_processing)) { goto out; } |