Re-integrate export-optimization branch.
[ardour.git] / libs / ardour / session_export.cc
index 8b56271e42587c93152a916624ec715d21b11900..86a6250ffd61205371d04bf1d115b04e215ea12d 100644 (file)
 #include "ardour/audioengine.h"
 #include "ardour/butler.h"
 #include "ardour/export_failed.h"
-#include "ardour/export_file_io.h"
 #include "ardour/export_handler.h"
 #include "ardour/export_status.h"
-#include "ardour/export_utilities.h"
 #include "ardour/route.h"
 #include "ardour/session.h"
 
@@ -91,8 +89,8 @@ Session::pre_export ()
 
        _exporting = true;
        export_status->running = true;
-       scoped_connect (export_status->Aborting, boost::bind (&Session::stop_audio_export, this));
-       scoped_connect (export_status->Finished, boost::bind (&Session::finalize_audio_export, this));
+       export_status->Aborting.connect_same_thread (*this, boost::bind (&Session::stop_audio_export, this));
+       export_status->Finished.connect_same_thread (*this, boost::bind (&Session::finalize_audio_export, this));
 
        return 0;
 }
@@ -150,7 +148,7 @@ Session::start_audio_export (nframes_t position, bool realtime)
                last_process_function = process_function;
                process_function = &Session::process_export;
        } else {
-               export_freewheel_connection = _engine.Freewheel.connect (boost::bind (&Session::process_export_fw, this, _1));
+               _engine.Freewheel.connect_same_thread (export_freewheel_connection, boost::bind (&Session::process_export_fw, this, _1));
                return _engine.freewheel (true);
        }
 
@@ -183,7 +181,8 @@ Session::process_export (nframes_t nframes)
 
                ProcessExport (nframes);
 
-       } catch (ExportFailed e) {
+       } catch (std::exception & e) {
+               std::cout << e.what() << std::endl;
                export_status->abort (true);
        }
 }