comparison audio/AudioCallbackPlaySource.h @ 548:baa11365ebdd bqaudioio

Merge from branch bqresample
author Chris Cannam
date Wed, 07 Dec 2016 11:51:42 +0000
parents c4391f6c7484
children c732251237b1
comparison
equal deleted inserted replaced
547:82d7e5cf7517 548:baa11365ebdd
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _AUDIO_CALLBACK_PLAY_SOURCE_H_ 16 #ifndef AUDIO_CALLBACK_PLAY_SOURCE_H
17 #define _AUDIO_CALLBACK_PLAY_SOURCE_H_ 17 #define AUDIO_CALLBACK_PLAY_SOURCE_H
18 18
19 #include "base/RingBuffer.h" 19 #include "base/RingBuffer.h"
20 #include "base/AudioPlaySource.h" 20 #include "base/AudioPlaySource.h"
21 #include "base/PropertyContainer.h" 21 #include "base/PropertyContainer.h"
22 #include "base/Scavenger.h" 22 #include "base/Scavenger.h"
35 #include <set> 35 #include <set>
36 #include <map> 36 #include <map>
37 37
38 namespace RubberBand { 38 namespace RubberBand {
39 class RubberBandStretcher; 39 class RubberBandStretcher;
40 }
41
42 namespace breakfastquay {
43 class Resampler;
40 } 44 }
41 45
42 class Model; 46 class Model;
43 class ViewManagerBase; 47 class ViewManagerBase;
44 class AudioGenerator; 48 class AudioGenerator;
114 * Return the frame at which playback is expected to end (if not looping). 118 * Return the frame at which playback is expected to end (if not looping).
115 */ 119 */
116 virtual sv_frame_t getPlayEndFrame() { return m_lastModelEndFrame; } 120 virtual sv_frame_t getPlayEndFrame() { return m_lastModelEndFrame; }
117 121
118 /** 122 /**
119 * Set the playback target. This should be called by the target 123 * Set the playback target.
120 * class.
121 */ 124 */
122 virtual void setSystemPlaybackTarget(breakfastquay::SystemPlaybackTarget *); 125 virtual void setSystemPlaybackTarget(breakfastquay::SystemPlaybackTarget *);
123 126
124 /** 127 /**
125 * Set the block size of the target audio device. This should be 128 * Set the block size of the target audio device. This should be
223 226
224 /** 227 /**
225 * Set the time stretcher factor (i.e. playback speed). 228 * Set the time stretcher factor (i.e. playback speed).
226 */ 229 */
227 void setTimeStretch(double factor); 230 void setTimeStretch(double factor);
228
229 /**
230 * Set the resampler quality, 0 - 2 where 0 is fastest and 2 is
231 * highest quality.
232 */
233 void setResampleQuality(int q);
234 231
235 /** 232 /**
236 * Set a single real-time plugin as a processing effect for 233 * Set a single real-time plugin as a processing effect for
237 * auditioning during playback. 234 * auditioning during playback.
238 * 235 *
394 }; 391 };
395 392
396 QMutex m_mutex; 393 QMutex m_mutex;
397 QWaitCondition m_condition; 394 QWaitCondition m_condition;
398 FillThread *m_fillThread; 395 FillThread *m_fillThread;
399 SRC_STATE *m_converter; 396 breakfastquay::Resampler *m_resampler;
400 SRC_STATE *m_crapConverter; // for use when playing very fast 397 void initialiseResampler();
401 int m_resampleQuality;
402 void initialiseConverter();
403 }; 398 };
404 399
405 #endif 400 #endif
406 401
407 402