debug instrumentation for locate time
[ardour.git] / libs / ardour / session.cc
index a46a63dce900d1e3f28377025c1c25e8c18712d7..a880ff0a097855c08d622a1f3b4dfd10c3e69fbe 100644 (file)
@@ -51,7 +51,6 @@
 #include "ardour/analyser.h"
 #include "ardour/async_midi_port.h"
 #include "ardour/audio_buffer.h"
-#include "ardour/audio_diskstream.h"
 #include "ardour/audio_port.h"
 #include "ardour/audio_track.h"
 #include "ardour/audioengine.h"
@@ -66,6 +65,7 @@
 #include "ardour/control_protocol_manager.h"
 #include "ardour/data_type.h"
 #include "ardour/debug.h"
+#include "ardour/disk_reader.h"
 #include "ardour/directory_names.h"
 #ifdef USE_TRACKS_CODE_FEATURES
 #include "ardour/engine_state_controller.h"
@@ -328,6 +328,7 @@ Session::Session (AudioEngine &eng,
        , _mmc (0)
        , _vca_manager (new VCAManager (*this))
        , _selection (new CoreSelection (*this))
+       , _global_locate_pending (false)
 {
        uint32_t sr = 0;
 
@@ -739,6 +740,7 @@ Session::destroy ()
 
        /* need to remove auditioner before monitoring section
         * otherwise it is re-connected */
+       auditioner->drop_references ();
        auditioner.reset ();
 
        /* drop references to routes held by the monitoring section
@@ -750,7 +752,7 @@ Session::destroy ()
        routes.flush ();
        _bundles.flush ();
 
-       AudioDiskstream::free_working_buffers();
+       DiskReader::free_working_buffers();
 
        /* tell everyone who is still standing that we're about to die */
        drop_references ();
@@ -1698,7 +1700,7 @@ Session::auto_loop_changed (Location* location)
                }
                else if (Config->get_seamless_loop() && !loop_changing) {
 
-                       // schedule a locate-roll to refill the diskstreams at the
+                       // schedule a locate-roll to refill the disk readers at the
                        // previous loop end
                        loop_changing = true;
 
@@ -2639,8 +2641,6 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, bool s
                                }
                        }
 
-                       track->non_realtime_input_change();
-
                        if (route_group) {
                                route_group->add (track);
                        }
@@ -3244,8 +3244,6 @@ Session::new_audio_track (int input_channels, int output_channels, RouteGroup* r
                                route_group->add (track);
                        }
 
-                       track->non_realtime_input_change();
-
                        new_routes.push_back (track);
                        ret.push_back (track);
                }
@@ -5724,12 +5722,6 @@ Session::graph_reordered ()
                return;
        }
 
-       /* every track/bus asked for this to be handled but it was deferred because
-          we were connecting. do it now.
-       */
-
-       request_input_change_handling ();
-
        resort_routes ();
 
        /* force all diskstreams to update their capture offset values to
@@ -5740,7 +5732,7 @@ Session::graph_reordered ()
        for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
                boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
                if (tr) {
-                       tr->set_capture_offset ();
+                       tr->update_latency_information ();
                }
        }
 }
@@ -6939,7 +6931,7 @@ Session::post_capture_latency ()
        for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
                boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
                if (tr) {
-                       tr->set_capture_offset ();
+                       tr->update_latency_information ();
                }
        }
 }
@@ -7048,7 +7040,7 @@ Session::update_latency_compensation (bool force_whole_graph)
                if (!tr) {
                        continue;
                }
-               tr->set_capture_offset ();
+               tr->update_latency_information ();
        }
 }
 
@@ -7381,8 +7373,8 @@ Session::auto_connect_thread_run ()
                        /* this is only used for updating plugin latencies, the
                         * graph does not change. so it's safe in general.
                         * BUT..
-                        * .. update_latency_compensation () entails set_capture_offset()
-                        * which calls Diskstream::set_capture_offset () which
+                        * .. update_latency_compensation () entails Track::update_latency_information()
+                        * which calls DiskWriter::set_capture_offset () which
                         * modifies the capture offset... which can be a proplem
                         * in "prepare_to_stop"
                         */