Mercurial > hg > svcore
diff data/fileio/WavFileWriter.h @ 174:f8cf055dbf34
* Restructure WavFileWriter a bit to permit writing from raw data as well as
from an existing model
author | Chris Cannam |
---|---|
date | Tue, 03 Oct 2006 10:06:37 +0000 |
parents | 1a42221a1522 |
children | b0f4555b625e |
line wrap: on
line diff
--- a/data/fileio/WavFileWriter.h Wed Sep 27 20:52:48 2006 +0000 +++ b/data/fileio/WavFileWriter.h Tue Oct 03 10:06:37 2006 +0000 @@ -18,28 +18,33 @@ #include <QString> +#include <sndfile.h> + class DenseTimeValueModel; class MultiSelection; class WavFileWriter { public: - WavFileWriter(QString path, size_t sampleRate, - DenseTimeValueModel *source, - MultiSelection *selection); + WavFileWriter(QString path, size_t sampleRate, size_t channels); virtual ~WavFileWriter(); bool isOK() const; virtual QString getError() const; - void write(); + bool writeModel(DenseTimeValueModel *source, + MultiSelection *selection = 0); + + bool writeSamples(float **samples, size_t count); // count per channel + + bool close(); protected: QString m_path; size_t m_sampleRate; - DenseTimeValueModel *m_model; - MultiSelection *m_selection; + size_t m_channels; + SNDFILE *m_file; QString m_error; };