merge fix
[ardour.git] / libs / ardour / ardour / audiosource.h
index 910e03170d37832b5550d8e75de39f5238c52bc3..c02310ea288b3fdb7273998ca2fa5e6b56ee52b9 100644 (file)
 
 #include <glibmm/threads.h>
 #include <boost/function.hpp>
+#include <boost/scoped_array.hpp>
 
 #include "ardour/source.h"
 #include "ardour/ardour.h"
 #include "ardour/readable.h"
-#include "pbd/file_manager.h"
 #include "pbd/stateful.h"
 #include "pbd/xml++.h"
 
@@ -61,7 +61,7 @@ class LIBARDOUR_API AudioSource : virtual public Source,
 
        virtual float sample_rate () const = 0;
 
-       virtual void mark_streaming_write_completed ();
+       virtual void mark_streaming_write_completed (const Lock& lock);
 
        virtual bool can_truncate_peaks() const { return true; }
 
@@ -109,8 +109,6 @@ class LIBARDOUR_API AudioSource : virtual public Source,
        static bool _build_missing_peakfiles;
        static bool _build_peakfiles;
 
-       static size_t _working_buffers_size;
-
        /* these collections of working buffers for supporting
           playlist's reading from potentially nested/recursive
           sources assume SINGLE THREADED reads by the butler
@@ -160,12 +158,17 @@ class LIBARDOUR_API AudioSource : virtual public Source,
         */
         mutable Glib::Threads::Mutex _peaks_ready_lock;
 
-       PBD::FdFileDescriptor* _peakfile_descriptor;
        int        _peakfile_fd;
        framecnt_t peak_leftover_cnt;
        framecnt_t peak_leftover_size;
        Sample*    peak_leftovers;
        framepos_t peak_leftover_frame;
+
+       mutable bool _first_run;
+       mutable double _last_scale;
+       mutable off_t _last_map_off;
+       mutable size_t  _last_raw_map_length;
+       mutable boost::scoped_array<PeakData> peak_cache;
 };
 
 }