more MTC debugging
[ardour.git] / libs / ardour / audiosource.cc
index f9864d69b3e77f42673b5f2ef00837bd5fa07db4..0c820eed4d29b9c923fb0a14150b2c978b52b305 100644 (file)
@@ -85,7 +85,7 @@ AudioSource::AudioSource (Session& s, const XMLNode& node)
        peak_leftover_size = 0;
        peak_leftovers = 0;
 
-       if (set_state (node)) {
+       if (set_state (node, Stateful::loading_state_version)) {
                throw failed_constructor();
        }
 }
@@ -118,7 +118,7 @@ AudioSource::get_state ()
 }
 
 int
-AudioSource::set_state (const XMLNode& node)
+AudioSource::set_state (const XMLNode& node, int /*version*/)
 {
        const XMLProperty* prop;
 
@@ -149,7 +149,7 @@ AudioSource::update_length (sframes_t pos, sframes_t cnt)
  ***********************************************************************/
 
 bool
-AudioSource::peaks_ready (sigc::slot<void> the_slot, sigc::connection& conn) const
+AudioSource::peaks_ready (boost::function<void()> doThisWhenReady, Connection& connect_here_if_not, EventLoop* event_loop) const
 {
        bool ret;
        Glib::Mutex::Lock lm (_peaks_ready_lock);
@@ -159,7 +159,7 @@ AudioSource::peaks_ready (sigc::slot<void> the_slot, sigc::connection& conn) con
        */
 
        if (!(ret = _peaks_built)) {
-               conn = PeaksReady.connect (the_slot);
+               PeaksReady.connect (connect_here_if_not, doThisWhenReady, event_loop);
        }
 
        return ret;
@@ -276,6 +276,8 @@ nframes_t
 AudioSource::write (Sample *dst, nframes_t cnt)
 {
        Glib::Mutex::Lock lm (_lock);
+       /* any write makes the fill not removable */
+       _flags = Flag (_flags & ~Removable);
        return write_unlocked (dst, cnt);
 }
 
@@ -900,22 +902,6 @@ AudioSource::truncate_peakfile ()
        }
 }
 
-bool
-AudioSource::file_changed (ustring path)
-{
-       struct stat stat_file;
-       struct stat stat_peak;
-
-       int e1 = stat (path.c_str(), &stat_file);
-       int e2 = stat (peak_path(path).c_str(), &stat_peak);
-
-       if (!e1 && !e2 && stat_file.st_mtime > stat_peak.st_mtime){
-               return true;
-       } else {
-               return false;
-       }
-}
-
 nframes_t
 AudioSource::available_peaks (double zoom_factor) const
 {