comparison data/fileio/CodedAudioFileReader.h @ 1326:54af1e21705c 3.0-integration

Update to use bqvec allocator for float vectors
author Chris Cannam
date Tue, 13 Dec 2016 15:23:21 +0000
parents 983667969a82
children 1c9bbbb6116a
comparison
equal deleted inserted replaced
1325:3aea4f7617bb 1326:54af1e21705c
44 enum DecodeMode { 44 enum DecodeMode {
45 DecodeAtOnce, // decode the file on construction, with progress 45 DecodeAtOnce, // decode the file on construction, with progress
46 DecodeThreaded // decode in a background thread after construction 46 DecodeThreaded // decode in a background thread after construction
47 }; 47 };
48 48
49 virtual std::vector<float> getInterleavedFrames(sv_frame_t start, sv_frame_t count) const; 49 virtual floatvec_t getInterleavedFrames(sv_frame_t start, sv_frame_t count) const;
50 50
51 virtual sv_samplerate_t getNativeRate() const { return m_fileRate; } 51 virtual sv_samplerate_t getNativeRate() const { return m_fileRate; }
52 52
53 virtual QString getLocalFilename() const { return m_cacheFileName; } 53 virtual QString getLocalFilename() const { return m_cacheFileName; }
54 54
69 void setFramesToTrim(sv_frame_t fromStart, sv_frame_t fromEnd); 69 void setFramesToTrim(sv_frame_t fromStart, sv_frame_t fromEnd);
70 70
71 // may throw InsufficientDiscSpace: 71 // may throw InsufficientDiscSpace:
72 void addSamplesToDecodeCache(float **samples, sv_frame_t nframes); 72 void addSamplesToDecodeCache(float **samples, sv_frame_t nframes);
73 void addSamplesToDecodeCache(float *samplesInterleaved, sv_frame_t nframes); 73 void addSamplesToDecodeCache(float *samplesInterleaved, sv_frame_t nframes);
74 void addSamplesToDecodeCache(const std::vector<float> &interleaved); 74 void addSamplesToDecodeCache(const floatvec_t &interleaved);
75 75
76 // may throw InsufficientDiscSpace: 76 // may throw InsufficientDiscSpace:
77 void finishDecodeCache(); 77 void finishDecodeCache();
78 78
79 bool isDecodeCacheInitialised() const { return m_initialised; } 79 bool isDecodeCacheInitialised() const { return m_initialised; }
93 void pushBufferNonResampling(float *interleaved, sv_frame_t sz); 93 void pushBufferNonResampling(float *interleaved, sv_frame_t sz);
94 94
95 protected: 95 protected:
96 QMutex m_cacheMutex; 96 QMutex m_cacheMutex;
97 CacheMode m_cacheMode; 97 CacheMode m_cacheMode;
98 std::vector<float> m_data; 98 floatvec_t m_data;
99 mutable QMutex m_dataLock; 99 mutable QMutex m_dataLock;
100 bool m_initialised; 100 bool m_initialised;
101 Serialiser *m_serialiser; 101 Serialiser *m_serialiser;
102 sv_samplerate_t m_fileRate; 102 sv_samplerate_t m_fileRate;
103 103