Mercurial > hg > svcore
comparison data/fileio/CodedAudioFileReader.h @ 1038:cc27f35aa75c cxx11
Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author | Chris Cannam |
---|---|
date | Tue, 03 Mar 2015 15:18:24 +0000 |
parents | 36f79bc5c3d7 |
children | a1cd5abcb38b |
comparison
equal
deleted
inserted
replaced
1037:bf0e5944289b | 1038:cc27f35aa75c |
---|---|
36 enum CacheMode { | 36 enum CacheMode { |
37 CacheInTemporaryFile, | 37 CacheInTemporaryFile, |
38 CacheInMemory | 38 CacheInMemory |
39 }; | 39 }; |
40 | 40 |
41 virtual void getInterleavedFrames(int start, int 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 int getNativeRate() const { return m_fileRate; } |
45 | 45 |
46 virtual QString getLocalFilename() const { return m_cacheFileName; } | 46 virtual QString getLocalFilename() const { return m_cacheFileName; } |
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: |
62 void addSamplesToDecodeCache(float **samples, int nframes); | 62 void addSamplesToDecodeCache(float **samples, sv_frame_t nframes); |
63 void addSamplesToDecodeCache(float *samplesInterleaved, int nframes); | 63 void addSamplesToDecodeCache(float *samplesInterleaved, sv_frame_t nframes); |
64 void addSamplesToDecodeCache(const SampleBlock &interleaved); | 64 void addSamplesToDecodeCache(const SampleBlock &interleaved); |
65 | 65 |
66 // may throw InsufficientDiscSpace: | 66 // may throw InsufficientDiscSpace: |
67 void finishDecodeCache(); | 67 void finishDecodeCache(); |
68 | 68 |
70 | 70 |
71 void startSerialised(QString id); | 71 void startSerialised(QString id); |
72 void endSerialised(); | 72 void endSerialised(); |
73 | 73 |
74 private: | 74 private: |
75 void pushBuffer(float *interleaved, int sz, bool final); | 75 void pushBuffer(float *interleaved, sv_frame_t sz, bool final); |
76 void pushBufferResampling(float *interleaved, int sz, float ratio, bool final); | 76 void pushBufferResampling(float *interleaved, sv_frame_t sz, double ratio, bool final); |
77 void pushBufferNonResampling(float *interleaved, int sz); | 77 void pushBufferNonResampling(float *interleaved, sv_frame_t sz); |
78 | 78 |
79 protected: | 79 protected: |
80 QMutex m_cacheMutex; | 80 QMutex m_cacheMutex; |
81 CacheMode m_cacheMode; | 81 CacheMode m_cacheMode; |
82 SampleBlock m_data; | 82 SampleBlock m_data; |
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; |
92 int m_cacheWriteBufferIndex; | 92 sv_frame_t m_cacheWriteBufferIndex; |
93 int m_cacheWriteBufferSize; // frames | 93 sv_frame_t m_cacheWriteBufferSize; // frames |
94 | 94 |
95 Resampler *m_resampler; | 95 Resampler *m_resampler; |
96 float *m_resampleBuffer; | 96 float *m_resampleBuffer; |
97 int m_fileFrameCount; | 97 sv_frame_t m_fileFrameCount; |
98 | 98 |
99 bool m_normalised; | 99 bool m_normalised; |
100 float m_max; | 100 float m_max; |
101 float m_gain; | 101 float m_gain; |
102 }; | 102 }; |