diff data/model/WaveFileModel.h @ 175:b0f4555b625e

* Introduce WritableWaveFileModel, and use it as an output model for audio real-time plugin transforms. Updates aren't working correctly yet.
author Chris Cannam
date Tue, 03 Oct 2006 14:17:37 +0000
parents 4148ad087959
children 0ed2b2e26b44
line wrap: on
line diff
--- a/data/model/WaveFileModel.h	Tue Oct 03 10:06:37 2006 +0000
+++ b/data/model/WaveFileModel.h	Tue Oct 03 14:17:37 2006 +0000
@@ -34,6 +34,7 @@
 
 public:
     WaveFileModel(QString path);
+    WaveFileModel(QString path, AudioFileReader *reader);
     ~WaveFileModel();
 
     bool isOK() const;
@@ -71,6 +72,7 @@
 
 protected slots:
     void fillTimerTimedOut();
+    void frameCountChanged();
     void cacheFilled();
     
 protected:
@@ -80,20 +82,24 @@
     {
     public:
         RangeCacheFillThread(WaveFileModel &model) :
-	    m_model(model), m_fillExtent(0) { }
+	    m_model(model), m_fillExtent(0),
+            m_frameCount(model.getFrameCount()) { }
     
 	size_t getFillExtent() const { return m_fillExtent; }
+        void frameCountChanged();
         virtual void run();
 
     protected:
         WaveFileModel &m_model;
 	size_t m_fillExtent;
+        size_t m_frameCount;
     };
          
     void fillCache();
     
     QString m_path;
     AudioFileReader *m_reader;
+    bool m_myReader;
 
     RangeBlock m_cache[2]; // interleaved at two base resolutions
     mutable QMutex m_mutex;