Tidy.
[ardour.git] / libs / ardour / ardour / audiosource.h
index f02b28d9f594ff1f7a7e8460b5b5f874cdb4b60f..d11b8296948436341048a4477af9cbcb7681eb1b 100644 (file)
@@ -43,19 +43,27 @@ using std::vector;
 
 namespace ARDOUR {
 
-const nframes_t frames_per_peak = 256;
-
- class AudioSource : public Source, public boost::enable_shared_from_this<ARDOUR::AudioSource>
+class AudioSource : public Source, public boost::enable_shared_from_this<ARDOUR::AudioSource>
 {
   public:
        AudioSource (Session&, Glib::ustring name);
        AudioSource (Session&, const XMLNode&);
        virtual ~AudioSource ();
 
-       /* returns the number of items in this `audio_source' */
+       nframes64_t readable_length() const { return _length; }
+       uint32_t    n_channels() const { return 1; }
 
        virtual nframes_t available_peaks (double zoom) const;
 
+       /* stopgap until nframes_t becomes nframes64_t. this function is needed by the Readable interface */
+
+       virtual nframes64_t read (Sample *dst, nframes64_t start, nframes64_t cnt, int channel) const {
+               /* XXX currently ignores channel, assuming that source is always mono, which
+                  historically has been true.
+               */
+               return read (dst, (nframes_t) start, (nframes_t) cnt);
+       }
+
        virtual nframes_t read (Sample *dst, nframes_t start, nframes_t cnt) const;
        virtual nframes_t write (Sample *src, nframes_t cnt);
 
@@ -72,7 +80,8 @@ const nframes_t frames_per_peak = 256;
        uint32_t read_data_count() const { return _read_data_count; }
        uint32_t write_data_count() const { return _write_data_count; }
 
-       virtual int read_peaks (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, double samples_per_unit) const;
+       int read_peaks (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, double samples_per_visual_peak) const;
+
        int  build_peaks ();
        bool peaks_ready (sigc::slot<void>, sigc::connection&) const;
 
@@ -129,6 +138,12 @@ const nframes_t frames_per_peak = 256;
        
        void update_length (nframes_t pos, nframes_t cnt);
 
+       virtual int read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, 
+                                        double samples_per_visual_peak, nframes_t fpp) const;
+
+       int compute_and_write_peaks (Sample* buf, nframes_t first_frame, nframes_t cnt, bool force, 
+                                    bool intermediate_peaks_ready_signal, nframes_t frames_per_peak);  
+
   private:
        int peakfile;
        nframes_t peak_leftover_cnt;