Mercurial > hg > svcore
comparison data/fileio/AudioFileReader.h @ 1041:843f67be0ed9 cxx11
Replace the get*Frames calls in AudioFileReader with less stupid API
author | Chris Cannam |
---|---|
date | Wed, 04 Mar 2015 12:30:41 +0000 |
parents | a1cd5abcb38b |
children | 4d9816ba0ebe |
comparison
equal
deleted
inserted
replaced
1040:a1cd5abcb38b | 1041:843f67be0ed9 |
---|---|
92 * | 92 * |
93 * The subclass implementations of this function must be | 93 * The subclass implementations of this function must be |
94 * thread-safe -- that is, safe to call from multiple threads with | 94 * thread-safe -- that is, safe to call from multiple threads with |
95 * different arguments on the same object at the same time. | 95 * different arguments on the same object at the same time. |
96 */ | 96 */ |
97 virtual void getInterleavedFrames(sv_frame_t start, sv_frame_t count, | 97 virtual SampleBlock getInterleavedFrames(sv_frame_t start, sv_frame_t count) const = 0; |
98 SampleBlock &frames) const = 0; | |
99 | 98 |
100 /** | 99 /** |
101 * Return de-interleaved samples for count frames from index | 100 * Return de-interleaved samples for count frames from index |
102 * start. Implemented in this class (it calls | 101 * start. Implemented in this class (it calls |
103 * getInterleavedFrames and de-interleaves). The resulting vector | 102 * getInterleavedFrames and de-interleaves). The resulting vector |
104 * will contain getChannelCount() sample blocks of count samples | 103 * will contain getChannelCount() sample blocks of count samples |
105 * each (or fewer if end of file is reached). | 104 * each (or fewer if end of file is reached). |
106 */ | 105 */ |
107 virtual void getDeInterleavedFrames(sv_frame_t start, sv_frame_t count, | 106 virtual std::vector<SampleBlock> getDeInterleavedFrames(sv_frame_t start, sv_frame_t count) const; |
108 std::vector<SampleBlock> &frames) const; | |
109 | 107 |
110 // only subclasses that do not know exactly how long the audio | 108 // only subclasses that do not know exactly how long the audio |
111 // file is until it's been completely decoded should implement this | 109 // file is until it's been completely decoded should implement this |
112 virtual int getDecodeCompletion() const { return 100; } // % | 110 virtual int getDecodeCompletion() const { return 100; } // % |
113 | 111 |