comparison data/fileio/CodedAudioFileReader.h @ 1040:a1cd5abcb38b cxx11

Introduce and use a samplerate type
author Chris Cannam
date Wed, 04 Mar 2015 12:01:04 +0000
parents cc27f35aa75c
children 843f67be0ed9
comparison
equal deleted inserted replaced
1039:b14064bd1f97 1040:a1cd5abcb38b
39 }; 39 };
40 40
41 virtual void getInterleavedFrames(sv_frame_t start, sv_frame_t count, 41 virtual void getInterleavedFrames(sv_frame_t start, sv_frame_t count,
42 SampleBlock &frames) const; 42 SampleBlock &frames) const;
43 43
44 virtual int getNativeRate() const { return m_fileRate; } 44 virtual sv_samplerate_t getNativeRate() const { return m_fileRate; }
45 45
46 virtual QString getLocalFilename() const { return m_cacheFileName; } 46 virtual QString getLocalFilename() const { return m_cacheFileName; }
47 47
48 /// Intermediate cache means all CodedAudioFileReaders are quickly seekable 48 /// Intermediate cache means all CodedAudioFileReaders are quickly seekable
49 virtual bool isQuicklySeekable() const { return true; } 49 virtual bool isQuicklySeekable() const { return true; }
51 signals: 51 signals:
52 void progress(int); 52 void progress(int);
53 53
54 protected: 54 protected:
55 CodedAudioFileReader(CacheMode cacheMode, 55 CodedAudioFileReader(CacheMode cacheMode,
56 int targetRate, 56 sv_samplerate_t targetRate,
57 bool normalised); 57 bool normalised);
58 58
59 void initialiseDecodeCache(); // samplerate, channels must have been set 59 void initialiseDecodeCache(); // samplerate, channels must have been set
60 60
61 // may throw InsufficientDiscSpace: 61 // may throw InsufficientDiscSpace:
81 CacheMode m_cacheMode; 81 CacheMode m_cacheMode;
82 SampleBlock m_data; 82 SampleBlock m_data;
83 mutable QReadWriteLock m_dataLock; 83 mutable QReadWriteLock m_dataLock;
84 bool m_initialised; 84 bool m_initialised;
85 Serialiser *m_serialiser; 85 Serialiser *m_serialiser;
86 int m_fileRate; 86 sv_samplerate_t m_fileRate;
87 87
88 QString m_cacheFileName; 88 QString m_cacheFileName;
89 SNDFILE *m_cacheFileWritePtr; 89 SNDFILE *m_cacheFileWritePtr;
90 WavFileReader *m_cacheFileReader; 90 WavFileReader *m_cacheFileReader;
91 float *m_cacheWriteBuffer; 91 float *m_cacheWriteBuffer;