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);
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 &)
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);
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;
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 */
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();
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]);
}
}
- bounce_process (buffers, start, nframes, endpoint, include_endpoint, for_export);
+ bounce_process (buffers, start, nframes, endpoint, include_endpoint, for_export, for_freeze);
return 0;
}
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
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;
}
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));
_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 ();
}
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");
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;
}
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) {
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.
}
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) {
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 ();
}
}
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;
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();
}
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;
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;
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) {
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;
}
}
/* 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) {