summaryrefslogtreecommitdiff
path: root/libs/ardour/session_export.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-29 13:50:56 +0100
committerRobin Gareus <robin@gareus.org>2016-02-29 13:50:56 +0100
commit33545e552be1a92fc1f8a13bc9eb06da700110aa (patch)
treeade0a3acf77a8964bf7551f588920f440fa02641 /libs/ardour/session_export.cc
parent56c32a1e77822a9cd1bf4c858004d95b60ce4488 (diff)
pre-process (silence) before export to flush reverb tails etc.
Diffstat (limited to 'libs/ardour/session_export.cc')
-rw-r--r--libs/ardour/session_export.cc28
1 files changed, 22 insertions, 6 deletions
diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc
index 8908716965..6b54db3826 100644
--- a/libs/ardour/session_export.cc
+++ b/libs/ardour/session_export.cc
@@ -73,12 +73,16 @@ Session::pre_export ()
}
}
- /* make sure we are actually rolling */
+ /* prepare transport */
+
+ realtime_stop (true, true);
if (get_record_enabled()) {
disable_record (false);
}
+ unset_play_loop ();
+
/* no slaving */
post_export_sync = config.get_external_sync ();
@@ -105,7 +109,8 @@ Session::start_audio_export (framepos_t position)
if (!_exporting) {
pre_export ();
}
- _export_started = false;
+
+ _export_preroll = 10.0 * nominal_frame_rate (); // TODO make configurable
/* 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
@@ -190,8 +195,19 @@ Session::process_export (pframes_t nframes)
int
Session::process_export_fw (pframes_t nframes)
{
- if (!_export_started) {
- _export_started = true;
+ if (_export_preroll > 0) {
+
+ _engine.main_thread()->get_buffers ();
+ fail_roll (nframes);
+ _engine.main_thread()->drop_buffers ();
+
+ _export_preroll -= std::min ((framepos_t)nframes, _export_preroll);
+
+ if (_export_preroll > 0) {
+ // clear out buffers (reverb tails etc).
+ return 0;
+ }
+
set_transport_speed (1.0, 0, false);
butler_transport_work ();
g_atomic_int_set (&_butler->should_do_transport_work, 0);
@@ -199,9 +215,9 @@ Session::process_export_fw (pframes_t nframes)
return 0;
}
- _engine.main_thread()->get_buffers ();
+ _engine.main_thread()->get_buffers ();
process_export (nframes);
- _engine.main_thread()->drop_buffers ();
+ _engine.main_thread()->drop_buffers ();
return 0;
}