- mutable off_t _peak_byte_max; // modified in do_build_peaks()
-
- virtual nframes_t read_unlocked (Sample *dst, nframes_t start, nframes_t cnt) const = 0;
- virtual nframes_t write_unlocked (Sample *dst, nframes_t cnt) = 0;
- virtual string peak_path(string audio_path) = 0;
- virtual string old_peak_path(string audio_path) = 0;
-
- static pthread_t peak_thread;
- static bool have_peak_thread;
- static void* peak_thread_work(void*);
-
- static int peak_request_pipe[2];
-
- struct PeakRequest {
- enum Type {
- Build,
- Quit
- };
- };
-
- static vector<boost::shared_ptr<AudioSource> > pending_peak_sources;
- static Glib::Mutex* pending_peak_sources_lock;
-
- static void queue_for_peaks (boost::shared_ptr<AudioSource>, bool notify=true);
- static void clear_queue_for_peaks ();
-
- struct PeakBuildRecord {
- nframes_t frame;
- nframes_t cnt;
-
- PeakBuildRecord (nframes_t f, nframes_t c)
- : frame (f), cnt (c) {}
- PeakBuildRecord (const PeakBuildRecord& other) {
- frame = other.frame;
- cnt = other.cnt;
- }
- };
-
- list<AudioSource::PeakBuildRecord *> pending_peak_builds;
+ mutable off_t _peak_byte_max; // modified in compute_and_write_peak()
+
+ virtual framecnt_t read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const = 0;
+ virtual framecnt_t write_unlocked (Sample *dst, framecnt_t cnt) = 0;
+ virtual std::string peak_path(std::string audio_path) = 0;
+ virtual std::string find_broken_peakfile (std::string /* missing_peak_path */,
+ std::string audio_path) { return peak_path (audio_path); }
+
+ virtual int read_peaks_with_fpp (PeakData *peaks,
+ framecnt_t npeaks, framepos_t start, framecnt_t cnt,
+ double samples_per_visual_peak, framecnt_t fpp) const;
+
+ int compute_and_write_peaks (Sample* buf, framecnt_t first_frame, framecnt_t cnt,
+ bool force, bool intermediate_peaks_ready_signal,
+ framecnt_t frames_per_peak);