Mercurial > hg > svapp
comparison audio/AudioCallbackPlaySource.h @ 682:161063152ddd by-id
Overhaul audio generator for ModelById
author | Chris Cannam |
---|---|
date | Tue, 02 Jul 2019 21:10:25 +0100 |
parents | 163573a73ebe |
children | e0b0f3e163ca |
comparison
equal
deleted
inserted
replaced
681:c7406ebcd51c | 682:161063152ddd |
---|---|
27 #include <QMutex> | 27 #include <QMutex> |
28 #include <QWaitCondition> | 28 #include <QWaitCondition> |
29 | 29 |
30 #include "base/Thread.h" | 30 #include "base/Thread.h" |
31 #include "base/RealTime.h" | 31 #include "base/RealTime.h" |
32 #include "data/model/Model.h" | |
32 | 33 |
33 #include <samplerate.h> | 34 #include <samplerate.h> |
34 | 35 |
35 #include <set> | 36 #include <set> |
36 #include <map> | 37 #include <map> |
71 * Add a data model to be played from. The source can mix | 72 * Add a data model to be played from. The source can mix |
72 * playback from a number of sources including dense and sparse | 73 * playback from a number of sources including dense and sparse |
73 * models. The models must match in sample rate, but they don't | 74 * models. The models must match in sample rate, but they don't |
74 * have to have identical numbers of channels. | 75 * have to have identical numbers of channels. |
75 */ | 76 */ |
76 virtual void addModel(Model *model); | 77 virtual void addModel(ModelId model); |
77 | 78 |
78 /** | 79 /** |
79 * Remove a model. | 80 * Remove a model. |
80 */ | 81 */ |
81 virtual void removeModel(Model *model); | 82 virtual void removeModel(ModelId model); |
82 | 83 |
83 /** | 84 /** |
84 * Remove all models. (Silence will ensue.) | 85 * Remove all models. (Silence will ensue.) |
85 */ | 86 */ |
86 virtual void clearModels(); | 87 virtual void clearModels(); |
290 virtual void setAuditioningEffect(Auditionable *plugin) override; | 291 virtual void setAuditioningEffect(Auditionable *plugin) override; |
291 | 292 |
292 /** | 293 /** |
293 * Specify that only the given set of models should be played. | 294 * Specify that only the given set of models should be played. |
294 */ | 295 */ |
295 void setSoloModelSet(std::set<Model *>s); | 296 void setSoloModelSet(std::set<ModelId>s); |
296 | 297 |
297 /** | 298 /** |
298 * Specify that all models should be played as normal (if not | 299 * Specify that all models should be played as normal (if not |
299 * muted). | 300 * muted). |
300 */ | 301 */ |
342 erase(begin()); | 343 erase(begin()); |
343 } | 344 } |
344 } | 345 } |
345 }; | 346 }; |
346 | 347 |
347 std::set<Model *> m_models; | 348 std::set<ModelId> m_models; |
348 RingBufferVector *m_readBuffers; | 349 RingBufferVector *m_readBuffers; |
349 RingBufferVector *m_writeBuffers; | 350 RingBufferVector *m_writeBuffers; |
350 sv_frame_t m_readBufferFill; | 351 sv_frame_t m_readBufferFill; |
351 sv_frame_t m_writeBufferFill; | 352 sv_frame_t m_writeBufferFill; |
352 Scavenger<RingBufferVector> m_bufferScavenger; | 353 Scavenger<RingBufferVector> m_bufferScavenger; |