diff data/model/WritableWaveFileModel.h @ 188:f86b74d1b143

* Simplify maker names in plugin menu * Make sure derived models have a name (based on the transform) * Don't start deriving a model from a derived model until the derived model is ready * Tidy up completion management in writable wave file model * Make writable models save/reload correctly from session file (i.e. regenerating from the original transform) * Same for dense 3d models -- don't save the data, just the transform details * Add a comment describing the SV file format
author Chris Cannam
date Fri, 13 Oct 2006 12:51:05 +0000
parents 0ed2b2e26b44
children 91fdc752e540
line wrap: on
line diff
--- a/data/model/WritableWaveFileModel.h	Thu Oct 12 16:10:49 2006 +0000
+++ b/data/model/WritableWaveFileModel.h	Fri Oct 13 12:51:05 2006 +0000
@@ -29,12 +29,20 @@
     WritableWaveFileModel(size_t sampleRate, size_t channels, QString path = "");
     ~WritableWaveFileModel();
 
+    /**
+     * Call addSamples to append a block of samples to the end of the
+     * file.  Caller should also call setCompletion to update the
+     * progress of this file, if it has a known end point, and should
+     * call setCompletion(100) when the file has been written.
+     */
     virtual bool addSamples(float **samples, size_t count);
-    virtual void sync();
     
     bool isOK() const;
     bool isReady(int *) const;
 
+    virtual void setCompletion(int completion); // percentage
+    virtual int getCompletion() const { return m_completion; }
+
     const ZoomConstraint *getZoomConstraint() const {
         static PowerOfSqrtTwoZoomConstraint zc;
         return &zc;
@@ -77,6 +85,7 @@
     size_t m_sampleRate;
     size_t m_channels;
     size_t m_frameCount;
+    int m_completion;
 };
 
 #endif