diff options
-rw-r--r-- | libs/ardour/ardour/audio_track.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/auditioner.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_track.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 6 | ||||
-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 | 22 | ||||
-rw-r--r-- | libs/ardour/export_channel.cc | 2 | ||||
-rw-r--r-- | libs/ardour/midi_track.cc | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 18 | ||||
-rw-r--r-- | libs/ardour/session.cc | 13 |
11 files changed, 47 insertions, 28 deletions
diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index 1ecec88f89..0bc8be81f4 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -58,7 +58,7 @@ class LIBARDOUR_API AudioTrack : public Track boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, boost::shared_ptr<Processor> endpoint, bool include_endpoint); int export_stuff (BufferSet& bufs, framepos_t start_frame, framecnt_t nframes, - boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export); + boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze); int set_state (const XMLNode&, int version); diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h index 6aeda90eb8..452f7eb246 100644 --- a/libs/ardour/ardour/auditioner.h +++ b/libs/ardour/ardour/auditioner.h @@ -97,7 +97,7 @@ class LIBARDOUR_API Auditioner : public Track boost::shared_ptr<Region> bounce_range (framepos_t, framepos_t, InterThreadInfo&, boost::shared_ptr<Processor>, bool) { return boost::shared_ptr<Region> (); } - int export_stuff (BufferSet&, framepos_t, framecnt_t, boost::shared_ptr<Processor>, bool, bool) + int export_stuff (BufferSet&, framepos_t, framecnt_t, boost::shared_ptr<Processor>, bool, bool, bool) { return -1; } boost::shared_ptr<Diskstream> diskstream_factory (XMLNode const &) diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h index cf6d3f7b64..1acec0346e 100644 --- a/libs/ardour/ardour/midi_track.h +++ b/libs/ardour/ardour/midi_track.h @@ -72,7 +72,8 @@ public: framecnt_t end_frame, boost::shared_ptr<Processor> endpoint, bool include_endpoint, - bool for_export); + bool for_export, + bool for_freeze); int set_state (const XMLNode&, int version); diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 9235ed32b6..7eb115490d 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -473,10 +473,10 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou virtual void bounce_process (BufferSet& bufs, framepos_t start_frame, framecnt_t nframes, boost::shared_ptr<Processor> endpoint, bool include_endpoint, - bool for_export); + bool for_export, bool for_freeze); - framecnt_t bounce_get_latency (boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export) const; - ChanCount bounce_get_output_streams (ChanCount &cc, boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export) const; + framecnt_t bounce_get_latency (boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) const; + ChanCount bounce_get_output_streams (ChanCount &cc, boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) const; boost::shared_ptr<IO> _input; boost::shared_ptr<IO> _output; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 89c33f23ec..08d0ec1e4e 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -608,7 +608,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop boost::shared_ptr<Region> write_one_track (AudioTrack&, framepos_t start, framepos_t end, bool overwrite, std::vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot, - boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export); + boost::shared_ptr<Processor> endpoint, + bool include_endpoint, bool for_export, bool for_freeze); int freeze_all (InterThreadInfo&); /* session-wide solo/mute/rec-enable */ diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index ee74fee46e..736ca8c6dd 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -96,7 +96,7 @@ class LIBARDOUR_API Track : public Route, public PublicDiskstream virtual boost::shared_ptr<Region> bounce_range (framepos_t start, framepos_t end, InterThreadInfo&, boost::shared_ptr<Processor> endpoint, bool include_endpoint) = 0; virtual int export_stuff (BufferSet& bufs, framepos_t start_frame, framecnt_t nframes, - boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export) = 0; + boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) = 0; XMLNode& get_state(); XMLNode& get_template(); diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 61b6e56bb6..13d5c43dda 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -383,7 +383,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram int AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nframes, - boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export) + boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) { boost::scoped_array<gain_t> gain_buffer (new gain_t[nframes]); boost::scoped_array<Sample> mix_buffer (new Sample[nframes]); @@ -417,7 +417,7 @@ AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nfram } } - bounce_process (buffers, start, nframes, endpoint, include_endpoint, for_export); + bounce_process (buffers, start, nframes, endpoint, include_endpoint, for_export, for_freeze); return 0; } @@ -490,7 +490,7 @@ AudioTrack::bounce_range (framepos_t start, framepos_t end, InterThreadInfo& itt boost::shared_ptr<Processor> endpoint, bool include_endpoint) { vector<boost::shared_ptr<Source> > srcs; - return _session.write_one_track (*this, start, end, false, srcs, itt, endpoint, include_endpoint, false); + return _session.write_one_track (*this, start, end, false, srcs, itt, endpoint, include_endpoint, false, false); } void @@ -533,8 +533,8 @@ AudioTrack::freeze_me (InterThreadInfo& itt) boost::shared_ptr<Region> res; - if ((res = _session.write_one_track (*this, _session.current_start_frame(), _session.current_end_frame(), true, srcs, itt, - main_outs(), false, false)) == 0) { + if ((res = _session.write_one_track (*this, _session.current_start_frame(), _session.current_end_frame(), + true, srcs, itt, main_outs(), false, false, true)) == 0) { return; } @@ -545,7 +545,10 @@ AudioTrack::freeze_me (InterThreadInfo& itt) for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); ++r) { - if (!(*r)->does_routing() && !boost::dynamic_pointer_cast<PeakMeter>(*r)) { + if ((*r)->does_routing() && (*r)->active()) { + break; + } + if (!boost::dynamic_pointer_cast<PeakMeter>(*r)) { FreezeRecordProcessorInfo* frii = new FreezeRecordProcessorInfo ((*r)->get_state(), (*r)); @@ -553,9 +556,10 @@ AudioTrack::freeze_me (InterThreadInfo& itt) _freeze_record.processor_info.push_back (frii); - /* now deactivate the processor */ - - (*r)->deactivate (); + /* now deactivate the processor, */ + if (!boost::dynamic_pointer_cast<Amp>(*r)) { + (*r)->deactivate (); + } } _session.set_dirty (); diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc index 8ea01f3ec3..9362171738 100644 --- a/libs/ardour/export_channel.cc +++ b/libs/ardour/export_channel.cc @@ -192,7 +192,7 @@ RegionExportChannelFactory::update_buffers (framecnt_t frames) } break; case Processed: - track.export_stuff (buffers, position, frames, track.main_outs(), true, true); + track.export_stuff (buffers, position, frames, track.main_outs(), true, true, false); break; default: throw ExportFailed ("Unhandled type in ExportChannelFactory::update_buffers"); diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index b820c001e1..638ed05706 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -547,7 +547,7 @@ MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framep int MidiTrack::export_stuff (BufferSet& /*bufs*/, framepos_t /*start_frame*/, framecnt_t /*nframes*/, - boost::shared_ptr<Processor> /*endpoint*/, bool /*include_endpoint*/, bool /*forexport*/) + boost::shared_ptr<Processor> /*endpoint*/, bool /*include_endpoint*/, bool /*for_export*/, bool /*for_freeze*/) { return -1; } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 4b899197d2..11f8ac2595 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -538,7 +538,8 @@ Route::process_output_buffers (BufferSet& bufs, void Route::bounce_process (BufferSet& buffers, framepos_t start, framecnt_t nframes, - boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export) + boost::shared_ptr<Processor> endpoint, + bool include_endpoint, bool for_export, bool for_freeze) { /* If no processing is required, there's no need to go any further. */ if (!endpoint && !include_endpoint) { @@ -558,6 +559,9 @@ Route::bounce_process (BufferSet& buffers, framepos_t start, framecnt_t nframes, if (!for_export && boost::dynamic_pointer_cast<PortInsert>(*i)) { break; } + if (!for_export && for_freeze && (*i)->does_routing() && (*i)->active()) { + break; + } /* don't run any processors that does routing. * oh, and don't bother with the peak meter either. @@ -574,7 +578,8 @@ Route::bounce_process (BufferSet& buffers, framepos_t start, framecnt_t nframes, } framecnt_t -Route::bounce_get_latency (boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export) const +Route::bounce_get_latency (boost::shared_ptr<Processor> endpoint, + bool include_endpoint, bool for_export, bool for_freeze) const { framecnt_t latency = 0; if (!endpoint && !include_endpoint) { @@ -588,6 +593,9 @@ Route::bounce_get_latency (boost::shared_ptr<Processor> endpoint, bool include_e if (!for_export && boost::dynamic_pointer_cast<PortInsert>(*i)) { break; } + if (!for_export && for_freeze && (*i)->does_routing() && (*i)->active()) { + break; + } if (!(*i)->does_routing() && !boost::dynamic_pointer_cast<PeakMeter>(*i)) { latency += (*i)->signal_latency (); } @@ -599,7 +607,8 @@ Route::bounce_get_latency (boost::shared_ptr<Processor> endpoint, bool include_e } ChanCount -Route::bounce_get_output_streams (ChanCount &cc, boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export) const +Route::bounce_get_output_streams (ChanCount &cc, boost::shared_ptr<Processor> endpoint, + bool include_endpoint, bool for_export, bool for_freeze) const { if (!endpoint && !include_endpoint) { return cc; @@ -612,6 +621,9 @@ Route::bounce_get_output_streams (ChanCount &cc, boost::shared_ptr<Processor> en if (!for_export && boost::dynamic_pointer_cast<PortInsert>(*i)) { break; } + if (!for_export && for_freeze && (*i)->does_routing() && (*i)->active()) { + break; + } if (!(*i)->does_routing() && !boost::dynamic_pointer_cast<PeakMeter>(*i)) { cc = (*i)->output_streams(); } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 0f0eb5b8f1..fbde7edf60 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4124,7 +4124,7 @@ Session::write_one_track (AudioTrack& track, framepos_t start, framepos_t end, bool /*overwrite*/, vector<boost::shared_ptr<Source> >& srcs, InterThreadInfo& itt, boost::shared_ptr<Processor> endpoint, bool include_endpoint, - bool for_export) + bool for_export, bool for_freeze) { boost::shared_ptr<Region> result; boost::shared_ptr<Playlist> playlist; @@ -4150,7 +4150,8 @@ Session::write_one_track (AudioTrack& track, framepos_t start, framepos_t end, return result; } - diskstream_channels = track.bounce_get_output_streams (diskstream_channels, endpoint, include_endpoint, for_export); + diskstream_channels = track.bounce_get_output_streams (diskstream_channels, endpoint, + include_endpoint, for_export, for_freeze); if (diskstream_channels.n_audio() < 1) { error << _("Cannot write a range with no audio.") << endmsg; @@ -4217,7 +4218,7 @@ Session::write_one_track (AudioTrack& track, framepos_t start, framepos_t end, position = start; to_do = len; - latency_skip = track.bounce_get_latency (endpoint, include_endpoint, for_export); + latency_skip = track.bounce_get_latency (endpoint, include_endpoint, for_export, for_freeze); /* create a set of reasonably-sized buffers */ for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { @@ -4235,7 +4236,7 @@ Session::write_one_track (AudioTrack& track, framepos_t start, framepos_t end, this_chunk = min (to_do, bounce_chunk_size); - if (track.export_stuff (buffers, start, this_chunk, endpoint, include_endpoint, for_export)) { + if (track.export_stuff (buffers, start, this_chunk, endpoint, include_endpoint, for_export, for_freeze)) { goto out; } @@ -4264,14 +4265,14 @@ Session::write_one_track (AudioTrack& track, framepos_t start, framepos_t end, } /* post-roll, pick up delayed processor output */ - latency_skip = track.bounce_get_latency (endpoint, include_endpoint, for_export); + latency_skip = track.bounce_get_latency (endpoint, include_endpoint, for_export, for_freeze); while (latency_skip && !itt.cancel) { this_chunk = min (latency_skip, bounce_chunk_size); latency_skip -= this_chunk; buffers.silence (this_chunk, 0); - track.bounce_process (buffers, start, this_chunk, endpoint, include_endpoint, for_export); + track.bounce_process (buffers, start, this_chunk, endpoint, include_endpoint, for_export, for_freeze); uint32_t n = 0; for (vector<boost::shared_ptr<Source> >::iterator src=srcs.begin(); src != srcs.end(); ++src, ++n) { |