comparison audioio/AudioCallbackPlaySource.h @ 436:72c662fe7ea3 cxx11

Further dedicated-types fixes
author Chris Cannam
date Tue, 10 Mar 2015 17:02:52 +0000
parents 618d5816b04d
children
comparison
equal deleted inserted replaced
435:618d5816b04d 436:72c662fe7ea3
199 sv_frame_t getSourceSamples(sv_frame_t count, float **buffer); 199 sv_frame_t getSourceSamples(sv_frame_t count, float **buffer);
200 200
201 /** 201 /**
202 * Set the time stretcher factor (i.e. playback speed). 202 * Set the time stretcher factor (i.e. playback speed).
203 */ 203 */
204 void setTimeStretch(float factor); 204 void setTimeStretch(double factor);
205 205
206 /** 206 /**
207 * Set the resampler quality, 0 - 2 where 0 is fastest and 2 is 207 * Set the resampler quality, 0 - 2 where 0 is fastest and 2 is
208 * highest quality. 208 * highest quality.
209 */ 209 */
242 signals: 242 signals:
243 void modelReplaced(); 243 void modelReplaced();
244 244
245 void playStatusChanged(bool isPlaying); 245 void playStatusChanged(bool isPlaying);
246 246
247 void sampleRateMismatch(int requested, int available, bool willResample); 247 void sampleRateMismatch(sv_samplerate_t requested,
248 sv_samplerate_t available,
249 bool willResample);
248 250
249 void audioOverloadPluginDisabled(); 251 void audioOverloadPluginDisabled();
250 void audioTimeStretchMultiChannelDisabled(); 252 void audioTimeStretchMultiChannelDisabled();
251 253
252 void activity(QString); 254 void activity(QString);
278 }; 280 };
279 281
280 std::set<Model *> m_models; 282 std::set<Model *> m_models;
281 RingBufferVector *m_readBuffers; 283 RingBufferVector *m_readBuffers;
282 RingBufferVector *m_writeBuffers; 284 RingBufferVector *m_writeBuffers;
283 int m_readBufferFill; 285 sv_frame_t m_readBufferFill;
284 int m_writeBufferFill; 286 sv_frame_t m_writeBufferFill;
285 Scavenger<RingBufferVector> m_bufferScavenger; 287 Scavenger<RingBufferVector> m_bufferScavenger;
286 int m_sourceChannelCount; 288 int m_sourceChannelCount;
287 int m_blockSize; 289 sv_frame_t m_blockSize;
288 sv_samplerate_t m_sourceSampleRate; 290 sv_samplerate_t m_sourceSampleRate;
289 sv_samplerate_t m_targetSampleRate; 291 sv_samplerate_t m_targetSampleRate;
290 int m_playLatency; 292 sv_frame_t m_playLatency;
291 AudioCallbackPlayTarget *m_target; 293 AudioCallbackPlayTarget *m_target;
292 double m_lastRetrievalTimestamp; 294 double m_lastRetrievalTimestamp;
293 int m_lastRetrievedBlockSize; 295 sv_frame_t m_lastRetrievedBlockSize;
294 bool m_trustworthyTimestamps; 296 bool m_trustworthyTimestamps;
295 sv_frame_t m_lastCurrentFrame; 297 sv_frame_t m_lastCurrentFrame;
296 bool m_playing; 298 bool m_playing;
297 bool m_exiting; 299 bool m_exiting;
298 sv_frame_t m_lastModelEndFrame; 300 sv_frame_t m_lastModelEndFrame;
326 void clearRingBuffers(bool haveLock = false, int count = 0); 328 void clearRingBuffers(bool haveLock = false, int count = 0);
327 void unifyRingBuffers(); 329 void unifyRingBuffers();
328 330
329 RubberBand::RubberBandStretcher *m_timeStretcher; 331 RubberBand::RubberBandStretcher *m_timeStretcher;
330 RubberBand::RubberBandStretcher *m_monoStretcher; 332 RubberBand::RubberBandStretcher *m_monoStretcher;
331 float m_stretchRatio; 333 double m_stretchRatio;
332 bool m_stretchMono; 334 bool m_stretchMono;
333 335
334 int m_stretcherInputCount; 336 int m_stretcherInputCount;
335 float **m_stretcherInputs; 337 float **m_stretcherInputs;
336 int *m_stretcherInputSizes; 338 sv_frame_t *m_stretcherInputSizes;
337 339
338 // Called from fill thread, m_playing true, mutex held 340 // Called from fill thread, m_playing true, mutex held
339 // Return true if work done 341 // Return true if work done
340 bool fillBuffers(); 342 bool fillBuffers();
341 343