diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index fb1a81db13..db77a0b003 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2173,8 +2173,10 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items) edit_items.push_back (MenuElem (_("Duplicate range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false))); edit_items.push_back (MenuElem (_("Create chunk from range"), mem_fun(*this, &Editor::create_named_selection))); edit_items.push_back (SeparatorElem()); - edit_items.push_back (MenuElem (_("Consolidate range"), bind (mem_fun(*this, &Editor::bounce_range_selection), true))); - edit_items.push_back (MenuElem (_("Bounce range to region list"), bind (mem_fun(*this, &Editor::bounce_range_selection), false))); + edit_items.push_back (MenuElem (_("Consolidate range"), bind (mem_fun(*this, &Editor::bounce_range_selection), true, false))); + edit_items.push_back (MenuElem (_("Consolidate range with processing"), bind (mem_fun(*this, &Editor::bounce_range_selection), true, true))); + edit_items.push_back (MenuElem (_("Bounce range to region list"), bind (mem_fun(*this, &Editor::bounce_range_selection), false, false))); + edit_items.push_back (MenuElem (_("Bounce range to region list with processing"), bind (mem_fun(*this, &Editor::bounce_range_selection), false, true))); edit_items.push_back (MenuElem (_("Export range"), mem_fun(*this, &Editor::export_range))); } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 3a04ab1dbf..f41d031730 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2067,7 +2067,7 @@ public: int write_region_selection(RegionSelection&); bool write_region (string path, boost::shared_ptr); void bounce_region_selection (); - void bounce_range_selection (bool replace); + void bounce_range_selection (bool replace, bool enable_processing); void external_edit_region (); int write_audio_selection (TimeSelection&); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 47ffd952d2..cbda900255 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -3688,7 +3688,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; @@ -3723,7 +3723,7 @@ Editor::bounce_range_selection (bool replace) itt.progress = false; XMLNode &before = playlist->get_state(); - boost::shared_ptr r = rtv->track()->bounce_range (start, start+cnt, itt); + boost::shared_ptr r = rtv->track()->bounce_range (start, start+cnt, itt, enable_processing); if (replace) { list ranges; diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index 2654b40142..bea763a176 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -53,13 +53,13 @@ class AudioTrack : public Track int use_diskstream (string name); int use_diskstream (const PBD::ID& id); - int export_stuff (BufferSet& bufs, nframes_t nframes, nframes_t end_frame); + int export_stuff (BufferSet& bufs, nframes_t nframes, nframes_t end_frame, bool enable_processing = true); void freeze (InterThreadInfo&); void unfreeze (); boost::shared_ptr bounce (InterThreadInfo&); - boost::shared_ptr bounce_range (nframes_t start, nframes_t end, InterThreadInfo&); + boost::shared_ptr bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing); int set_state(const XMLNode& node); diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index d9cf7989cf..174ad87823 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -66,7 +66,8 @@ public: void unfreeze (); boost::shared_ptr bounce (InterThreadInfo&); - boost::shared_ptr bounce_range (nframes_t start, nframes_t end, InterThreadInfo&); + boost::shared_ptr 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 082e05a9bd..6114cf8062 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -725,7 +725,8 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable /* flattening stuff */ boost::shared_ptr write_one_track (AudioTrack&, nframes_t start, nframes_t end, - bool overwrite, vector >&, InterThreadInfo& wot); + bool overwrite, vector >&, 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 581e5fbcac..42e992c220 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -78,7 +78,7 @@ class Track : public Route virtual void unfreeze () = 0; virtual boost::shared_ptr bounce (InterThreadInfo&) = 0; - virtual boost::shared_ptr bounce_range (nframes_t start, nframes_t end, InterThreadInfo&) = 0; + virtual boost::shared_ptr 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 330e2ba1b7..8f37ea2239 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -722,7 +722,7 @@ AudioTrack::silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end } int -AudioTrack::export_stuff (BufferSet& buffers, nframes_t start, nframes_t nframes) +AudioTrack::export_stuff (BufferSet& buffers, nframes_t start, nframes_t nframes, bool enable_processing) { gain_t gain_automation[nframes]; gain_t gain_buffer[nframes]; @@ -761,6 +761,9 @@ AudioTrack::export_stuff (BufferSet& buffers, nframes_t start, nframes_t nframes } } + // If no processing is required, there's no need to go any further. + if (!enable_processing) + return 0; /* note: only run processors during export. other layers in the machinery will already have checked that there are no external port processors. @@ -830,10 +833,10 @@ AudioTrack::bounce (InterThreadInfo& itt) } boost::shared_ptr -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 > srcs; - return _session.write_one_track (*this, start, end, false, srcs, itt); + return _session.write_one_track (*this, start, end, false, srcs, itt, enable_processing); } void diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 281bce658f..3d50f10c5e 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -635,7 +635,7 @@ MidiTrack::bounce (InterThreadInfo& itt) boost::shared_ptr -MidiTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt) +MidiTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt, bool enable_processing) { throw; //vector srcs; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 97672976ce..25cf610189 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4055,7 +4055,8 @@ Session::freeze (InterThreadInfo& itt) boost::shared_ptr Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end, - bool overwrite, vector >& srcs, InterThreadInfo& itt) + bool overwrite, vector >& srcs, + InterThreadInfo& itt, bool enable_processing) { boost::shared_ptr result; boost::shared_ptr playlist; @@ -4140,7 +4141,7 @@ Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end, this_chunk = min (to_do, chunk_size); - if (track.export_stuff (buffers, start, this_chunk)) { + if (track.export_stuff (buffers, start, this_chunk, enable_processing)) { goto out; }