comparison 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
comparison
equal deleted inserted replaced
187:89b05b679dc3 188:f86b74d1b143
27 27
28 public: 28 public:
29 WritableWaveFileModel(size_t sampleRate, size_t channels, QString path = ""); 29 WritableWaveFileModel(size_t sampleRate, size_t channels, QString path = "");
30 ~WritableWaveFileModel(); 30 ~WritableWaveFileModel();
31 31
32 /**
33 * Call addSamples to append a block of samples to the end of the
34 * file. Caller should also call setCompletion to update the
35 * progress of this file, if it has a known end point, and should
36 * call setCompletion(100) when the file has been written.
37 */
32 virtual bool addSamples(float **samples, size_t count); 38 virtual bool addSamples(float **samples, size_t count);
33 virtual void sync();
34 39
35 bool isOK() const; 40 bool isOK() const;
36 bool isReady(int *) const; 41 bool isReady(int *) const;
42
43 virtual void setCompletion(int completion); // percentage
44 virtual int getCompletion() const { return m_completion; }
37 45
38 const ZoomConstraint *getZoomConstraint() const { 46 const ZoomConstraint *getZoomConstraint() const {
39 static PowerOfSqrtTwoZoomConstraint zc; 47 static PowerOfSqrtTwoZoomConstraint zc;
40 return &zc; 48 return &zc;
41 } 49 }
75 WavFileWriter *m_writer; 83 WavFileWriter *m_writer;
76 WavFileReader *m_reader; 84 WavFileReader *m_reader;
77 size_t m_sampleRate; 85 size_t m_sampleRate;
78 size_t m_channels; 86 size_t m_channels;
79 size_t m_frameCount; 87 size_t m_frameCount;
88 int m_completion;
80 }; 89 };
81 90
82 #endif 91 #endif
83 92