Only show user-presets in favorite sidebar
[ardour.git] / libs / ardour / session_transport.cc
index 95daf7495bfe22332b19f1791938ac7a81616de7..49354dad60e873b68470ce66b76bb430cbda9149 100644 (file)
@@ -92,6 +92,11 @@ Session::should_ignore_transport_request (TransportRequestSource src, TransportR
        return false;
 }
 
+bool
+Session::synced_to_engine() const {
+       return config.get_external_sync() && TransportMasterManager::instance().current()->type() == Engine;
+}
+
 void
 Session::request_sync_source (boost::shared_ptr<TransportMaster> tm)
 {
@@ -487,6 +492,9 @@ Session::butler_transport_work ()
        }
 
        if (ptw & PostTransportAdjustCaptureBuffering) {
+               /* need to prevent concurrency with ARDOUR::DiskWriter::run(),
+                * DiskWriter::adjust_buffering() re-allocates the ringbuffer */
+               Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
                for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
                        boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
                        if (tr) {
@@ -920,7 +928,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
           because there will be no process callbacks to deliver stuff from
        */
 
-       if (_engine.connected() && !_engine.freewheeling()) {
+       if (_engine.running() && !_engine.freewheeling()) {
                // need to queue this in the next RT cycle
                _send_timecode_update = true;
 
@@ -995,6 +1003,7 @@ Session::unset_play_loop ()
                        add_post_transport_work (PostTransportLocate);
                        _butler->schedule_transport_work ();
                }
+               TransportStateChange (); /* EMIT SIGNAL */
        }
 }
 
@@ -1119,8 +1128,9 @@ Session::start_locate (samplepos_t target_sample, bool with_roll, bool with_flus
 
                double sp;
                samplepos_t pos;
+               samplepos_t ignore1, ignore2;
 
-               transport_master()->speed_and_position (sp, pos, 0);
+               transport_master()->speed_and_position (sp, pos, ignore1, ignore2, 0);
 
                if (target_sample != pos) {