From 8da27200d18fe4c471a759dde8e10d85ff29d277 Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Sun, 27 Dec 2009 22:09:40 +0000 Subject: - Fix process callbakc handling during export - Fix filename handling when exporting multiple files - Some updates to audiographer git-svn-id: svn://localhost/ardour2/branches/3.0@6402 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_export.cc | 63 +++++++++++++------------------------------ 1 file changed, 18 insertions(+), 45 deletions(-) (limited to 'libs/ardour/session_export.cc') diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 86a6250ffd..9a277f5655 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -123,8 +123,6 @@ Session::start_audio_export (nframes_t position, bool realtime) */ _transport_frame = position; - - _exporting_realtime = realtime; export_status->stop = false; /* get transport ready. note how this is calling butler functions @@ -144,39 +142,30 @@ Session::start_audio_export (nframes_t position, bool realtime) return -1; } - if (realtime) { - last_process_function = process_function; - process_function = &Session::process_export; - } else { - _engine.Freewheel.connect_same_thread (export_freewheel_connection, boost::bind (&Session::process_export_fw, this, _1)); - return _engine.freewheel (true); - } - - return 0; + _engine.Freewheel.connect_same_thread (export_freewheel_connection, boost::bind (&Session::process_export_fw, this, _1)); + _export_rolling = true; + return _engine.freewheel (true); } void Session::process_export (nframes_t nframes) { - try { - - if (export_status->stop) { - stop_audio_export (); - return; - } - - if (!_exporting_realtime) { - /* make sure we've caught up with disk i/o, since - we're running faster than realtime c/o JACK. - */ + if (_export_rolling && export_status->stop) { + stop_audio_export (); + } - _butler->wait_until_finished (); - } + if (_export_rolling) { + /* 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 */ process_without_events (nframes); - + } + + try { /* handle export - XXX what about error handling? */ ProcessExport (nframes); @@ -197,23 +186,16 @@ Session::process_export_fw (nframes_t nframes) int Session::stop_audio_export () { - if (_exporting_realtime) { - process_function = last_process_function; - } else { - export_freewheel_connection.disconnect(); - } - /* can't use stop_transport() here because we need an immediate halt and don't require all the declick stuff that stop_transport() implements. */ realtime_stop (true, true); + _export_rolling = false; _butler->schedule_transport_work (); - if (!export_status->aborted()) { - ExportReadFinished (); - } else { + if (export_status->aborted()) { finalize_audio_export (); } @@ -225,20 +207,11 @@ void Session::finalize_audio_export () { _exporting = false; - export_status->running = false; - - if (!_exporting_realtime) { - _engine.freewheel (false); - _exporting_realtime = false; - } + _export_rolling = false; /* Clean up */ - /* BOOST SIGNAL are these necessary? - ProcessExport.clear(); - ExportReadFinished.clear(); - */ - + _engine.freewheel (false); export_freewheel_connection.disconnect(); export_handler.reset(); export_status.reset(); -- cgit v1.2.3