Mercurial > hg > svapp
comparison audioio/AudioCallbackPlaySource.h @ 13:89bb89894ad6
* As previous commit
author | Chris Cannam |
---|---|
date | Fri, 17 Feb 2006 18:11:08 +0000 |
parents | 29b38a641d43 |
children | 9149ecec02fc |
comparison
equal
deleted
inserted
replaced
12:29b38a641d43 | 13:89bb89894ad6 |
---|---|
138 * 0.0 -> 1.0, for metering purposes. | 138 * 0.0 -> 1.0, for metering purposes. |
139 */ | 139 */ |
140 virtual bool getOutputLevels(float &left, float &right); | 140 virtual bool getOutputLevels(float &left, float &right); |
141 | 141 |
142 /** | 142 /** |
143 * Get the number of channels of audio that will be available. | 143 * Get the number of channels of audio that in the source models. |
144 * This may safely be called from a realtime thread. Returns 0 if | 144 * This may safely be called from a realtime thread. Returns 0 if |
145 * there is no source yet available. | 145 * there is no source yet available. |
146 */ | 146 */ |
147 size_t getSourceChannelCount() const; | 147 size_t getSourceChannelCount() const; |
148 | |
149 /** | |
150 * Get the number of channels of audio that will be provided | |
151 * to the play target. This may be more than the source channel | |
152 * count: for example, a mono source will provide 2 channels | |
153 * after pan. | |
154 * This may safely be called from a realtime thread. Returns 0 if | |
155 * there is no source yet available. | |
156 */ | |
157 size_t getTargetChannelCount() const; | |
148 | 158 |
149 /** | 159 /** |
150 * Get the actual sample rate of the source material. This may | 160 * Get the actual sample rate of the source material. This may |
151 * safely be called from a realtime thread. Returns 0 if there is | 161 * safely be called from a realtime thread. Returns 0 if there is |
152 * no source yet available. | 162 * no source yet available. |
191 }; | 201 }; |
192 | 202 |
193 std::set<Model *> m_models; | 203 std::set<Model *> m_models; |
194 RingBufferVector *m_readBuffers; | 204 RingBufferVector *m_readBuffers; |
195 RingBufferVector *m_writeBuffers; | 205 RingBufferVector *m_writeBuffers; |
206 size_t m_readBufferFill; | |
207 size_t m_writeBufferFill; | |
196 Scavenger<RingBufferVector> m_bufferScavenger; | 208 Scavenger<RingBufferVector> m_bufferScavenger; |
197 size_t m_sourceChannelCount; | 209 size_t m_sourceChannelCount; |
198 size_t m_blockSize; | 210 size_t m_blockSize; |
199 size_t m_sourceSampleRate; | 211 size_t m_sourceSampleRate; |
200 size_t m_targetSampleRate; | 212 size_t m_targetSampleRate; |
201 size_t m_playLatency; | 213 size_t m_playLatency; |
202 bool m_playing; | 214 bool m_playing; |
203 bool m_exiting; | 215 bool m_exiting; |
204 size_t m_bufferedToFrame; | |
205 size_t m_lastModelEndFrame; | 216 size_t m_lastModelEndFrame; |
206 static const size_t m_ringBufferSize; | 217 static const size_t m_ringBufferSize; |
207 float m_outputLeft; | 218 float m_outputLeft; |
208 float m_outputRight; | 219 float m_outputRight; |
209 | 220 |
223 return 0; | 234 return 0; |
224 } | 235 } |
225 } | 236 } |
226 | 237 |
227 void clearRingBuffers(bool haveLock = false, size_t count = 0); | 238 void clearRingBuffers(bool haveLock = false, size_t count = 0); |
239 void unifyRingBuffers(); | |
228 | 240 |
229 class TimeStretcherData | 241 class TimeStretcherData |
230 { | 242 { |
231 public: | 243 public: |
232 TimeStretcherData(size_t channels, size_t factor, size_t blockSize); | 244 TimeStretcherData(size_t channels, size_t factor, size_t blockSize); |