comparison data/fileio/WavFileReader.h @ 316:3a6725f285d6

* Make RemoteFile far more pervasive, and use it for local files as well so that we can handle both transparently. Make it shallow copy with reference counting, so it can be used by value without having to worry about the cache file lifetime. Use RemoteFile for MainWindow file-open functions, etc
author Chris Cannam
date Thu, 18 Oct 2007 15:31:20 +0000
parents 92e8dbde73cd
children c324d410b096
comparison
equal deleted inserted replaced
315:96ef9746c560 316:3a6725f285d6
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, bool fileUpdating = false); 29 WavFileReader(RemoteFile source, 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 /**
37 */ 37 */
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 static bool supportsExtension(QString ext);
43 static bool supportsContentType(QString type);
44 static bool supports(RemoteFile &source);
42 45
43 virtual int getDecodeCompletion() const { return 100; } 46 virtual int getDecodeCompletion() const { return 100; }
44 47
45 bool isUpdating() const { return m_updating; } 48 bool isUpdating() const { return m_updating; }
46 49
49 52
50 protected: 53 protected:
51 SF_INFO m_fileInfo; 54 SF_INFO m_fileInfo;
52 SNDFILE *m_file; 55 SNDFILE *m_file;
53 56
57 RemoteFile m_source;
54 QString m_path; 58 QString m_path;
55 QString m_error; 59 QString m_error;
56 60
57 mutable QMutex m_mutex; 61 mutable QMutex m_mutex;
58 mutable float *m_buffer; 62 mutable float *m_buffer;