comparison data/fileio/WavFileReader.h @ 176:570794f6f6a7

* Some fixes to updating of writable wave file models
author Chris Cannam
date Tue, 03 Oct 2006 15:01:50 +0000
parents b0f4555b625e
children e08f486e8d8c
comparison
equal deleted inserted replaced
175:b0f4555b625e 176:570794f6f6a7
24 #include <set> 24 #include <set>
25 25
26 class WavFileReader : public AudioFileReader 26 class WavFileReader : public AudioFileReader
27 { 27 {
28 public: 28 public:
29 WavFileReader(QString path); 29 WavFileReader(QString path, bool fileUpdating = false);
30 virtual ~WavFileReader(); 30 virtual ~WavFileReader();
31 31
32 virtual QString getError() const { return m_error; } 32 virtual QString getError() const { return m_error; }
33 33
34 /** 34 /**
38 virtual void getInterleavedFrames(size_t start, size_t count, 38 virtual void getInterleavedFrames(size_t start, size_t count,
39 SampleBlock &frames) const; 39 SampleBlock &frames) const;
40 40
41 static void getSupportedExtensions(std::set<QString> &extensions); 41 static void getSupportedExtensions(std::set<QString> &extensions);
42 42
43 bool isUpdating() const { return m_updating; }
44
43 void updateFrameCount(); 45 void updateFrameCount();
46 void updateDone();
44 47
45 protected: 48 protected:
46 SF_INFO m_fileInfo; 49 SF_INFO m_fileInfo;
47 SNDFILE *m_file; 50 SNDFILE *m_file;
48 51
52 mutable QMutex m_mutex; 55 mutable QMutex m_mutex;
53 mutable float *m_buffer; 56 mutable float *m_buffer;
54 mutable size_t m_bufsiz; 57 mutable size_t m_bufsiz;
55 mutable size_t m_lastStart; 58 mutable size_t m_lastStart;
56 mutable size_t m_lastCount; 59 mutable size_t m_lastCount;
60
61 bool m_updating;
57 }; 62 };
58 63
59 #endif 64 #endif