Merged with trunk (painfully)
[ardour.git] / libs / ardour / session_export.cc
index a17dde6979d658e952de0fa0f48b46e1a8bdc716..183b6df2373a023fc9578c26cf059a81796913e8 100644 (file)
@@ -37,7 +37,7 @@
 #include <sigc++/bind.h>
 
 #include <pbd/error.h>
-#include <pbd/lockmonitor.h>
+#include <glibmm/thread.h>
 
 #include <ardour/gdither.h>
 #include <ardour/timestamps.h>
@@ -201,7 +201,7 @@ AudioExportSpecification::prepare (jack_nframes_t blocksize, jack_nframes_t frat
        
        if ((out = sf_open (path.c_str(), SFM_WRITE, &sfinfo)) == 0) {
                sf_error_str (0, errbuf, sizeof (errbuf) - 1);
-               error << compose(_("Export: cannot open output file \"%1\" (%2)"), path, errbuf) << endmsg;
+               error << string_compose(_("Export: cannot open output file \"%1\" (%2)"), path, errbuf) << endmsg;
                return -1;
        }
 
@@ -211,7 +211,7 @@ AudioExportSpecification::prepare (jack_nframes_t blocksize, jack_nframes_t frat
                int err;
 
                if ((src_state = src_new (src_quality, channels, &err)) == 0) {
-                       error << compose (_("cannot initialize sample rate conversion: %1"), src_strerror (err)) << endmsg;
+                       error << string_compose (_("cannot initialize sample rate conversion: %1"), src_strerror (err)) << endmsg;
                        return -1;
                }
                
@@ -313,7 +313,7 @@ AudioExportSpecification::process (jack_nframes_t nframes)
                        ++cnt;
 
                        if ((err = src_process (src_state, &src_data)) != 0) {
-                               error << compose (_("an error occured during sample rate conversion: %1"),
+                               error << string_compose (_("an error occured during sample rate conversion: %1"),
                                                  src_strerror (err))
                                      << endmsg;
                                return -1;
@@ -415,7 +415,7 @@ AudioExportSpecification::process (jack_nframes_t nframes)
        
                if ((jack_nframes_t) written != to_write) {
                        sf_error_str (out, errbuf, sizeof (errbuf) - 1);
-                       error << compose(_("Export: could not write data to output file (%1)"), errbuf) << endmsg;
+                       error << string_compose(_("Export: could not write data to output file (%1)"), errbuf) << endmsg;
                        return -1;
                }
 
@@ -485,7 +485,7 @@ Session::prepare_to_export (AudioExportSpecification& spec)
        /* take everyone out of awrite to avoid disasters */
 
        {
-               LockMonitor lm (route_lock, __LINE__, __FILE__);
+               Glib::RWLock::ReaderLock lm (route_lock);
                for (RouteList::iterator i = routes.begin(); i != routes.end(); ++i) {
                        (*i)->protect_automation ();
                }
@@ -494,10 +494,10 @@ Session::prepare_to_export (AudioExportSpecification& spec)
        /* get everyone to the right position */
 
        {
-               LockMonitor lm (diskstream_lock, __LINE__, __FILE__);
+               Glib::RWLock::ReaderLock lm (diskstream_lock);
                for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
                        if ((*i)-> seek (spec.start_frame, true)) {
-                               error << compose (_("%1: cannot seek to %2 for export"),
+                               error << string_compose (_("%1: cannot seek to %2 for export"),
                                                  (*i)->name(), spec.start_frame)
                                      << endmsg;
                                goto out;
@@ -508,7 +508,7 @@ Session::prepare_to_export (AudioExportSpecification& spec)
        /* make sure we are actually rolling */
 
        if (get_record_enabled()) {
-               disable_record ();
+               disable_record (false);
        }
 
        _exporting = true;
@@ -524,7 +524,7 @@ Session::prepare_to_export (AudioExportSpecification& spec)
 
        set_transport_speed (1.0, false);
        butler_transport_work ();
-       atomic_set (&butler_should_do_transport_work, 0);
+       g_atomic_int_set (&butler_should_do_transport_work, 0);
        post_transport ();
 
        /* we are ready to go ... */