boost::shared_ptr<ExportHandler> get_export_handler ();
boost::shared_ptr<ExportStatus> get_export_status ();
- int start_audio_export (framepos_t position, bool realtime = false);
+ int start_audio_export (framepos_t position, bool realtime = false, bool region_export = false);
PBD::Signal1<int, framecnt_t> ProcessExport;
static PBD::Signal2<void,std::string, std::string> Exported;
bool _exporting;
bool _export_rolling;
bool _realtime_export;
+ bool _region_export;
framepos_t _export_preroll;
framepos_t _export_latency;
graph_builder->set_current_timespan (current_timespan);
handle_duplicate_format_extensions();
bool realtime = current_timespan->realtime ();
+ bool region_export = true;
for (ConfigMap::iterator it = timespan_bounds.first; it != timespan_bounds.second; ++it) {
// Filenames can be shared across timespans
FileSpec & spec = it->second;
spec.filename->set_timespan (it->first);
+ switch (spec.channel_config->region_processing_type ()) {
+ case RegionExportChannelFactory::None:
+ case RegionExportChannelFactory::Processed:
+ region_export = false;
+ break;
+ default:
+ break;
+ }
graph_builder->add_config (spec, realtime);
}
+ // ExportDialog::update_realtime_selection does not allow this
+ assert (!region_export || !realtime);
+
/* start export */
post_processing = false;
session.ProcessExport.connect_same_thread (process_connection, boost::bind (&ExportHandler::process, this, _1));
process_position = current_timespan->get_start();
- session.start_audio_export (process_position, realtime);
+ // TODO check if it's a RegionExport.. set flag to skip process_without_events()
+ session.start_audio_export (process_position, realtime, region_export);
}
void
, _exporting (false)
, _export_rolling (false)
, _realtime_export (false)
+ , _region_export (false)
, _export_preroll (0)
, _export_latency (0)
, _pre_export_mmc_enabled (false)
/** Called for each range that is being exported */
int
-Session::start_audio_export (framepos_t position, bool realtime)
+Session::start_audio_export (framepos_t position, bool realtime, bool region_export)
{
if (!_exporting) {
pre_export ();
}
_realtime_export = realtime;
+ _region_export = region_export;
- if (realtime) {
+ if (region_export) {
+ _export_preroll = 0;
+ }
+ else if (realtime) {
_export_preroll = nominal_frame_rate ();
} else {
_export_preroll = Config->get_export_preroll() * nominal_frame_rate ();
*/
_export_latency = worst_track_latency ();
+ if (region_export) {
+ _export_latency = 0;
+ }
+
/* We're about to call Track::seek, so the butler must have finished everything
up otherwise it could be doing do_refill in its thread while we are doing
it here.
stop_audio_export ();
}
- if (_export_rolling) {
- if (!_realtime_export) {
- /* make sure we've caught up with disk i/o, since
- * we're running faster than realtime c/o JACK.
- */
- _butler->wait_until_finished ();
- }
+ /* for Region Raw or Fades, we can skip this
+ * RegionExportChannelFactory::update_buffers() does not care
+ * about anything done here
+ */
+ if (!_region_export) {
+ if (_export_rolling) {
+ if (!_realtime_export) {
+ /* make sure we've caught up with disk i/o, since
+ * we're running faster than realtime c/o JACK.
+ */
+ _butler->wait_until_finished ();
+ }
- /* do the usual stuff */
+ /* do the usual stuff */
- process_without_events (nframes);
- } else if (_realtime_export) {
- fail_roll (nframes); // somehow we need to silence _ALL_ output buffers
+ process_without_events (nframes);
+
+ } else if (_realtime_export) {
+ fail_roll (nframes); // somehow we need to silence _ALL_ output buffers
+ }
}
try {