svapp
1.9
|
AudioCallbackPlaySource manages audio data supply to callback-based audio APIs such as JACK or CoreAudio. More...
#include <AudioCallbackPlaySource.h>
Classes | |
class | FillThread |
class | RingBufferVector |
Public Slots | |
void | audioProcessingOverload () |
Signals | |
void | modelReplaced () |
void | playStatusChanged (bool isPlaying) |
void | sampleRateMismatch (int requested, int available, bool willResample) |
void | audioOverloadPluginDisabled () |
void | audioTimeStretchMultiChannelDisabled () |
void | activity (QString) |
Public Member Functions | |
AudioCallbackPlaySource (ViewManagerBase *, QString clientName) | |
virtual | ~AudioCallbackPlaySource () |
virtual void | addModel (Model *model) |
Add a data model to be played from. | |
virtual void | removeModel (Model *model) |
Remove a model. | |
virtual void | clearModels () |
Remove all models. | |
virtual void | play (int startFrame) |
Start making data available in the ring buffers for playback, from the given frame. | |
virtual void | stop () |
Stop playback and ensure that no more data is returned. | |
virtual bool | isPlaying () const |
Return whether playback is currently supposed to be happening. | |
virtual int | getCurrentPlayingFrame () |
Return the frame number that is currently expected to be coming out of the speakers. | |
virtual int | getCurrentBufferedFrame () |
Return the last frame that would come out of the speakers if we stopped playback right now. | |
virtual int | getPlayEndFrame () |
Return the frame at which playback is expected to end (if not looping). | |
void | setTarget (AudioCallbackPlayTarget *, int blockSize) |
Set the target and the block size of the target audio device. | |
int | getTargetBlockSize () const |
Get the block size of the target audio device. | |
void | setTargetPlayLatency (int) |
Set the playback latency of the target audio device, in frames at the target sample rate. | |
int | getTargetPlayLatency () const |
Get the playback latency of the target audio device. | |
void | setTargetSampleRate (int) |
Specify that the target audio device has a fixed sample rate (i.e. | |
virtual int | getTargetSampleRate () const |
Return the sample rate set by the target audio device (or the source sample rate if the target hasn't set one). | |
void | setOutputLevels (float left, float right) |
Set the current output levels for metering (for call from the target) | |
virtual bool | getOutputLevels (float &left, float &right) |
Return the current (or thereabouts) output levels in the range 0.0 -> 1.0, for metering purposes. | |
int | getSourceChannelCount () const |
Get the number of channels of audio that in the source models. | |
int | getTargetChannelCount () const |
Get the number of channels of audio that will be provided to the play target. | |
virtual int | getSourceSampleRate () const |
Get the actual sample rate of the source material. | |
int | getSourceSamples (int count, float **buffer) |
Get "count" samples (at the target sample rate) of the mixed audio data, in all channels. | |
void | setTimeStretch (float factor) |
Set the time stretcher factor (i.e. | |
void | setResampleQuality (int q) |
Set the resampler quality, 0 - 2 where 0 is fastest and 2 is highest quality. | |
void | setAuditioningEffect (Auditionable *plugin) |
Set a single real-time plugin as a processing effect for auditioning during playback. | |
void | setSoloModelSet (std::set< Model * >s) |
Specify that only the given set of models should be played. | |
void | clearSoloModelSet () |
Specify that all models should be played as normal (if not muted). | |
QString | getClientName () const |
Protected Slots | |
void | selectionChanged () |
void | playLoopModeChanged () |
void | playSelectionModeChanged () |
void | playParametersChanged (PlayParameters *) |
void | preferenceChanged (PropertyContainer::PropertyName) |
void | modelChangedWithin (int startFrame, int endFrame) |
Protected Member Functions | |
RingBuffer< float > * | getWriteRingBuffer (int c) |
RingBuffer< float > * | getReadRingBuffer (int c) |
void | clearRingBuffers (bool haveLock=false, int count=0) |
void | unifyRingBuffers () |
bool | fillBuffers () |
int | mixModels (int &frame, int count, float **buffers) |
void | applyAuditioningEffect (int count, float **buffers) |
void | rebuildRangeLists () |
int | getCurrentFrame (RealTime outputLatency) |
void | initialiseConverter () |
Protected Attributes | |
ViewManagerBase * | m_viewManager |
AudioGenerator * | m_audioGenerator |
QString | m_clientName |
std::set< Model * > | m_models |
RingBufferVector * | m_readBuffers |
RingBufferVector * | m_writeBuffers |
int | m_readBufferFill |
int | m_writeBufferFill |
Scavenger< RingBufferVector > | m_bufferScavenger |
int | m_sourceChannelCount |
int | m_blockSize |
int | m_sourceSampleRate |
int | m_targetSampleRate |
int | m_playLatency |
AudioCallbackPlayTarget * | m_target |
double | m_lastRetrievalTimestamp |
int | m_lastRetrievedBlockSize |
bool | m_trustworthyTimestamps |
int | m_lastCurrentFrame |
bool | m_playing |
bool | m_exiting |
int | m_lastModelEndFrame |
int | m_ringBufferSize |
float | m_outputLeft |
float | m_outputRight |
RealTimePluginInstance * | m_auditioningPlugin |
bool | m_auditioningPluginBypassed |
Scavenger< RealTimePluginInstance > | m_pluginScavenger |
int | m_playStartFrame |
bool | m_playStartFramePassed |
RealTime | m_playStartedAt |
RubberBand::RubberBandStretcher * | m_timeStretcher |
RubberBand::RubberBandStretcher * | m_monoStretcher |
float | m_stretchRatio |
bool | m_stretchMono |
int | m_stretcherInputCount |
float ** | m_stretcherInputs |
int * | m_stretcherInputSizes |
std::vector< RealTime > | m_rangeStarts |
std::vector< RealTime > | m_rangeDurations |
QMutex | m_mutex |
QWaitCondition | m_condition |
FillThread * | m_fillThread |
SRC_STATE * | m_converter |
SRC_STATE * | m_crapConverter |
int | m_resampleQuality |
AudioCallbackPlaySource manages audio data supply to callback-based audio APIs such as JACK or CoreAudio.
It maintains one ring buffer per channel, filled during playback by a non-realtime thread, and provides a method for a realtime thread to pick up the latest available sample data from these buffers.
Definition at line 54 of file AudioCallbackPlaySource.h.
AudioCallbackPlaySource::AudioCallbackPlaySource | ( | ViewManagerBase * | manager, |
QString | clientName | ||
) |
Definition at line 42 of file AudioCallbackPlaySource.cpp.
References m_viewManager, playLoopModeChanged(), playParametersChanged(), playSelectionModeChanged(), playStatusChanged(), preferenceChanged(), and selectionChanged().
AudioCallbackPlaySource::~AudioCallbackPlaySource | ( | ) | [virtual] |
Definition at line 105 of file AudioCallbackPlaySource.cpp.
References clearModels(), m_audioGenerator, m_bufferScavenger, m_condition, m_exiting, m_fillThread, m_monoStretcher, m_pluginScavenger, m_readBuffers, m_stretcherInputCount, m_stretcherInputs, m_stretcherInputSizes, m_timeStretcher, and m_writeBuffers.
void AudioCallbackPlaySource::addModel | ( | Model * | model | ) | [virtual] |
Add a data model to be played from.
The source can mix playback from a number of sources including dense and sparse models. The models must match in sample rate, but they don't have to have identical numbers of channels.
Definition at line 148 of file AudioCallbackPlaySource.cpp.
References AudioGenerator::addModel(), clearRingBuffers(), getTargetChannelCount(), m_audioGenerator, m_condition, m_converter, m_crapConverter, m_fillThread, m_lastModelEndFrame, m_models, m_mutex, m_sourceChannelCount, m_sourceSampleRate, m_writeBuffers, modelChangedWithin(), modelReplaced(), rebuildRangeLists(), sampleRateMismatch(), and AudioGenerator::setTargetChannelCount().
Referenced by MainWindowBase::layerInAView(), and MainWindowBase::modelAdded().
void AudioCallbackPlaySource::removeModel | ( | Model * | model | ) | [virtual] |
Remove a model.
Definition at line 286 of file AudioCallbackPlaySource.cpp.
References clearRingBuffers(), m_audioGenerator, m_converter, m_crapConverter, m_lastModelEndFrame, m_models, m_mutex, m_sourceSampleRate, modelChangedWithin(), and AudioGenerator::removeModel().
Referenced by MainWindowBase::layerInAView(), MainWindowBase::modelAboutToBeDeleted(), and MainWindowBase::openAudio().
void AudioCallbackPlaySource::clearModels | ( | ) | [virtual] |
Remove all models.
(Silence will ensue.)
Definition at line 332 of file AudioCallbackPlaySource.cpp.
References AudioGenerator::clearModels(), clearRingBuffers(), m_audioGenerator, m_converter, m_crapConverter, m_lastModelEndFrame, m_models, m_mutex, and m_sourceSampleRate.
Referenced by ~AudioCallbackPlaySource().
void AudioCallbackPlaySource::play | ( | int | startFrame | ) | [virtual] |
Start making data available in the ring buffers for playback, from the given frame.
If playback is already under way, reseek to the given frame and continue.
Definition at line 400 of file AudioCallbackPlaySource.cpp.
References activity(), AudioCallbackPlayTarget::getCurrentTime(), getReadRingBuffer(), getTargetChannelCount(), m_audioGenerator, m_condition, m_converter, m_crapConverter, m_lastCurrentFrame, m_lastModelEndFrame, m_lastRetrievalTimestamp, m_monoStretcher, m_mutex, m_playing, m_playStartedAt, m_playStartFrame, m_playStartFramePassed, m_readBufferFill, m_readBuffers, m_sourceSampleRate, m_target, m_timeStretcher, m_viewManager, m_writeBufferFill, playStatusChanged(), and AudioGenerator::reset().
Referenced by MainWindowBase::currentPaneChanged(), and MainWindowBase::play().
void AudioCallbackPlaySource::stop | ( | ) | [virtual] |
Stop playback and ensure that no more data is returned.
Definition at line 489 of file AudioCallbackPlaySource.cpp.
References activity(), m_condition, m_lastCurrentFrame, m_lastRetrievalTimestamp, m_playing, m_sourceSampleRate, and playStatusChanged().
Referenced by getCurrentFrame(), and MainWindowBase::stop().
virtual bool AudioCallbackPlaySource::isPlaying | ( | ) | const [inline, virtual] |
Return whether playback is currently supposed to be happening.
Definition at line 96 of file AudioCallbackPlaySource.h.
References m_playing.
Referenced by MainWindowBase::currentPaneChanged(), MainWindowBase::ffwd(), MainWindowBase::ffwdEnd(), MainWindowBase::ffwdSimilar(), MainWindowBase::getFrame(), MainWindowBase::globalCentreFrameChanged(), MainWindowBase::play(), MainWindowBase::playbackFrameChanged(), MainWindowBase::rewind(), MainWindowBase::viewCentreFrameChanged(), and MainWindowBase::viewZoomLevelChanged().
int AudioCallbackPlaySource::getCurrentPlayingFrame | ( | ) | [virtual] |
Return the frame number that is currently expected to be coming out of the speakers.
(i.e. compensating for playback latency.)
Definition at line 612 of file AudioCallbackPlaySource.cpp.
References getCurrentFrame(), getTargetSampleRate(), and m_playLatency.
Referenced by clearRingBuffers(), and MainWindowBase::getFrame().
int AudioCallbackPlaySource::getCurrentBufferedFrame | ( | ) | [virtual] |
Return the last frame that would come out of the speakers if we stopped playback right now.
Definition at line 629 of file AudioCallbackPlaySource.cpp.
References getCurrentFrame().
Referenced by clearRingBuffers(), and MainWindowBase::currentPaneChanged().
virtual int AudioCallbackPlaySource::getPlayEndFrame | ( | ) | [inline, virtual] |
Return the frame at which playback is expected to end (if not looping).
Definition at line 113 of file AudioCallbackPlaySource.h.
References m_lastModelEndFrame.
Referenced by MainWindowBase::playbackFrameChanged(), and MainWindowBase::zoomToFit().
void AudioCallbackPlaySource::setTarget | ( | AudioCallbackPlayTarget * | target, |
int | blockSize | ||
) |
Set the target and the block size of the target audio device.
This should be called by the target class.
Definition at line 573 of file AudioCallbackPlaySource.cpp.
References clearRingBuffers(), m_blockSize, m_ringBufferSize, m_target, and m_writeBuffers.
Referenced by AudioJACKTarget::sourceModelReplaced(), and AudioJACKTarget::~AudioJACKTarget().
int AudioCallbackPlaySource::getTargetBlockSize | ( | ) | const |
Get the block size of the target audio device.
This may be an estimate or upper bound, if the target has a variable block size; the source should behave itself even if this value turns out to be inaccurate.
Definition at line 593 of file AudioCallbackPlaySource.cpp.
References m_blockSize.
Referenced by getCurrentFrame().
void AudioCallbackPlaySource::setTargetPlayLatency | ( | int | latency | ) |
Set the playback latency of the target audio device, in frames at the target sample rate.
This is the difference between the frame currently "leaving the speakers" and the last frame (or highest last frame across all channels) requested via getSamples(). The default is zero.
Definition at line 600 of file AudioCallbackPlaySource.cpp.
References m_playLatency.
Referenced by AudioJACKTarget::sourceModelReplaced().
int AudioCallbackPlaySource::getTargetPlayLatency | ( | ) | const |
Get the playback latency of the target audio device.
Definition at line 606 of file AudioCallbackPlaySource.cpp.
References m_playLatency.
void AudioCallbackPlaySource::setTargetSampleRate | ( | int | sr | ) |
Specify that the target audio device has a fixed sample rate (i.e.
cannot accommodate arbitrary sample rates based on the source). If the target sets this to something other than the source sample rate, this class will resample automatically to fit.
Definition at line 919 of file AudioCallbackPlaySource.cpp.
References initialiseConverter(), m_stretchRatio, m_targetSampleRate, and setTimeStretch().
Referenced by AudioJACKTarget::sourceModelReplaced().
int AudioCallbackPlaySource::getTargetSampleRate | ( | ) | const [virtual] |
Return the sample rate set by the target audio device (or the source sample rate if the target hasn't set one).
Definition at line 1037 of file AudioCallbackPlaySource.cpp.
References getSourceSampleRate(), and m_targetSampleRate.
Referenced by fillBuffers(), getCurrentFrame(), getCurrentPlayingFrame(), initialiseConverter(), and setTimeStretch().
void AudioCallbackPlaySource::setOutputLevels | ( | float | left, |
float | right | ||
) |
Set the current output levels for metering (for call from the target)
Definition at line 904 of file AudioCallbackPlaySource.cpp.
References m_outputLeft, and m_outputRight.
Referenced by AudioJACKTarget::process().
bool AudioCallbackPlaySource::getOutputLevels | ( | float & | left, |
float & | right | ||
) | [virtual] |
Return the current (or thereabouts) output levels in the range 0.0 -> 1.0, for metering purposes.
Definition at line 911 of file AudioCallbackPlaySource.cpp.
References m_outputLeft, and m_outputRight.
int AudioCallbackPlaySource::getSourceChannelCount | ( | ) | const |
Get the number of channels of audio that in the source models.
This may safely be called from a realtime thread. Returns 0 if there is no source yet available.
Definition at line 1044 of file AudioCallbackPlaySource.cpp.
References m_sourceChannelCount.
Referenced by AudioJACKTarget::sourceModelReplaced().
int AudioCallbackPlaySource::getTargetChannelCount | ( | ) | const |
Get the number of channels of audio that will be provided to the play target.
This may be more than the source channel count: for example, a mono source will provide 2 channels after pan. This may safely be called from a realtime thread. Returns 0 if there is no source yet available.
Definition at line 1050 of file AudioCallbackPlaySource.cpp.
References m_sourceChannelCount.
Referenced by addModel(), applyAuditioningEffect(), fillBuffers(), getCurrentFrame(), getSourceSamples(), initialiseConverter(), mixModels(), play(), AudioCallbackPlaySource::FillThread::run(), setTimeStretch(), and unifyRingBuffers().
int AudioCallbackPlaySource::getSourceSampleRate | ( | ) | const [virtual] |
Get the actual sample rate of the source material.
This may safely be called from a realtime thread. Returns 0 if there is no source yet available.
Definition at line 1057 of file AudioCallbackPlaySource.cpp.
References m_sourceSampleRate.
Referenced by fillBuffers(), getCurrentFrame(), getTargetSampleRate(), initialiseConverter(), MainWindowBase::openAudio(), MainWindowBase::openLayersFromRDF(), rebuildRangeLists(), and AudioCallbackPlaySource::FillThread::run().
int AudioCallbackPlaySource::getSourceSamples | ( | int | count, |
float ** | buffer | ||
) |
Get "count" samples (at the target sample rate) of the mixed audio data, in all channels.
This may safely be called from a realtime thread.
Definition at line 1097 of file AudioCallbackPlaySource.cpp.
References applyAuditioningEffect(), AudioCallbackPlayTarget::getCurrentTime(), getReadRingBuffer(), getTargetChannelCount(), m_condition, m_lastRetrievalTimestamp, m_lastRetrievedBlockSize, m_monoStretcher, m_playing, m_stretcherInputCount, m_stretcherInputs, m_stretcherInputSizes, m_stretchMono, m_stretchRatio, m_target, and m_timeStretcher.
Referenced by AudioJACKTarget::process().
void AudioCallbackPlaySource::setTimeStretch | ( | float | factor | ) |
Set the time stretcher factor (i.e.
playback speed).
Definition at line 1063 of file AudioCallbackPlaySource.cpp.
References activity(), getTargetChannelCount(), getTargetSampleRate(), m_monoStretcher, m_stretcherInputCount, m_stretcherInputs, m_stretcherInputSizes, m_stretchRatio, and m_timeStretcher.
Referenced by setTargetSampleRate().
void AudioCallbackPlaySource::setResampleQuality | ( | int | q | ) |
Set the resampler quality, 0 - 2 where 0 is fastest and 2 is highest quality.
Definition at line 995 of file AudioCallbackPlaySource.cpp.
References initialiseConverter(), and m_resampleQuality.
Referenced by preferenceChanged().
void AudioCallbackPlaySource::setAuditioningEffect | ( | Auditionable * | plugin | ) |
Set a single real-time plugin as a processing effect for auditioning during playback.
The plugin must have been initialised with getTargetChannelCount() channels and a getTargetBlockSize() sample frame processing block size.
This playback source takes ownership of the plugin, which will be deleted at some point after the following call to setAuditioningEffect (depending on real-time constraints).
Pass a null pointer to remove the current auditioning plugin, if any.
Definition at line 1009 of file AudioCallbackPlaySource.cpp.
References m_auditioningPlugin, m_auditioningPluginBypassed, and m_mutex.
void AudioCallbackPlaySource::setSoloModelSet | ( | std::set< Model * > | s | ) |
Specify that only the given set of models should be played.
Definition at line 1023 of file AudioCallbackPlaySource.cpp.
References clearRingBuffers(), m_audioGenerator, and AudioGenerator::setSoloModelSet().
Referenced by MainWindowBase::currentPaneChanged().
Specify that all models should be played as normal (if not muted).
Definition at line 1030 of file AudioCallbackPlaySource.cpp.
References clearRingBuffers(), AudioGenerator::clearSoloModelSet(), and m_audioGenerator.
Referenced by MainWindowBase::playSoloToggled().
QString AudioCallbackPlaySource::getClientName | ( | ) | const [inline] |
Definition at line 240 of file AudioCallbackPlaySource.h.
References m_clientName.
Referenced by AudioJACKTarget::AudioJACKTarget().
void AudioCallbackPlaySource::modelReplaced | ( | ) | [signal] |
Referenced by addModel().
void AudioCallbackPlaySource::playStatusChanged | ( | bool | isPlaying | ) | [signal] |
Referenced by AudioCallbackPlaySource(), play(), and stop().
void AudioCallbackPlaySource::sampleRateMismatch | ( | int | requested, |
int | available, | ||
bool | willResample | ||
) | [signal] |
Referenced by addModel(), and initialiseConverter().
void AudioCallbackPlaySource::audioOverloadPluginDisabled | ( | ) | [signal] |
Referenced by audioProcessingOverload().
void AudioCallbackPlaySource::audioTimeStretchMultiChannelDisabled | ( | ) | [signal] |
Referenced by audioProcessingOverload().
void AudioCallbackPlaySource::activity | ( | QString | ) | [signal] |
Referenced by play(), setTimeStretch(), and stop().
void AudioCallbackPlaySource::audioProcessingOverload | ( | ) | [slot] |
Definition at line 549 of file AudioCallbackPlaySource.cpp.
References audioOverloadPluginDisabled(), audioTimeStretchMultiChannelDisabled(), m_auditioningPlugin, m_auditioningPluginBypassed, m_monoStretcher, m_playing, m_stretcherInputCount, m_stretchMono, and m_timeStretcher.
Referenced by AudioJACKTarget::xrun().
void AudioCallbackPlaySource::selectionChanged | ( | ) | [protected, slot] |
Definition at line 513 of file AudioCallbackPlaySource.cpp.
References clearRingBuffers(), and m_viewManager.
Referenced by AudioCallbackPlaySource().
void AudioCallbackPlaySource::playLoopModeChanged | ( | ) | [protected, slot] |
Definition at line 521 of file AudioCallbackPlaySource.cpp.
References clearRingBuffers().
Referenced by AudioCallbackPlaySource().
void AudioCallbackPlaySource::playSelectionModeChanged | ( | ) | [protected, slot] |
Definition at line 527 of file AudioCallbackPlaySource.cpp.
References clearRingBuffers(), and m_viewManager.
Referenced by AudioCallbackPlaySource().
void AudioCallbackPlaySource::playParametersChanged | ( | PlayParameters * | ) | [protected, slot] |
Definition at line 535 of file AudioCallbackPlaySource.cpp.
References clearRingBuffers().
Referenced by AudioCallbackPlaySource().
void AudioCallbackPlaySource::preferenceChanged | ( | PropertyContainer::PropertyName | n | ) | [protected, slot] |
Definition at line 541 of file AudioCallbackPlaySource.cpp.
References setResampleQuality().
Referenced by AudioCallbackPlaySource().
void AudioCallbackPlaySource::modelChangedWithin | ( | int | startFrame, |
int | endFrame | ||
) | [protected, slot] |
Definition at line 270 of file AudioCallbackPlaySource.cpp.
References m_lastModelEndFrame, and rebuildRangeLists().
Referenced by addModel(), and removeModel().
RingBuffer<float>* AudioCallbackPlaySource::getWriteRingBuffer | ( | int | c | ) | [inline, protected] |
Definition at line 309 of file AudioCallbackPlaySource.h.
References m_writeBuffers.
Referenced by fillBuffers(), and unifyRingBuffers().
RingBuffer<float>* AudioCallbackPlaySource::getReadRingBuffer | ( | int | c | ) | [inline, protected] |
Definition at line 317 of file AudioCallbackPlaySource.h.
References m_readBuffers.
Referenced by getCurrentFrame(), getSourceSamples(), play(), AudioCallbackPlaySource::FillThread::run(), and unifyRingBuffers().
void AudioCallbackPlaySource::clearRingBuffers | ( | bool | haveLock = false , |
int | count = 0 |
||
) | [protected] |
Definition at line 361 of file AudioCallbackPlaySource.cpp.
References getCurrentBufferedFrame(), getCurrentPlayingFrame(), m_mutex, m_readBuffers, m_ringBufferSize, m_writeBufferFill, m_writeBuffers, and rebuildRangeLists().
Referenced by addModel(), clearModels(), clearSoloModelSet(), playLoopModeChanged(), playParametersChanged(), playSelectionModeChanged(), removeModel(), selectionChanged(), setSoloModelSet(), and setTarget().
void AudioCallbackPlaySource::unifyRingBuffers | ( | ) | [protected] |
!! incorrect when in non-contiguous selection, see comments elsewhere
Definition at line 1741 of file AudioCallbackPlaySource.cpp.
References getReadRingBuffer(), getTargetChannelCount(), getWriteRingBuffer(), m_blockSize, m_bufferScavenger, m_lastModelEndFrame, m_readBufferFill, m_readBuffers, m_writeBufferFill, and m_writeBuffers.
Referenced by AudioCallbackPlaySource::FillThread::run().
bool AudioCallbackPlaySource::fillBuffers | ( | ) | [protected] |
!! Then what?
!! how do we know when ended? need to mark up a fully-buffered flag and check this if we find the buffers empty in getSourceSamples
Definition at line 1357 of file AudioCallbackPlaySource.cpp.
References AudioGenerator::getBlockSize(), getSourceSampleRate(), getTargetChannelCount(), getTargetSampleRate(), getWriteRingBuffer(), m_audioGenerator, m_converter, m_crapConverter, m_readBufferFill, m_readBuffers, m_timeStretcher, m_writeBufferFill, m_writeBuffers, and mixModels().
Referenced by AudioCallbackPlaySource::FillThread::run().
int AudioCallbackPlaySource::mixModels | ( | int & | frame, |
int | count, | ||
float ** | buffers | ||
) | [protected] |
Definition at line 1584 of file AudioCallbackPlaySource.cpp.
References getTargetChannelCount(), m_audioGenerator, m_lastModelEndFrame, m_models, m_viewManager, and AudioGenerator::mixModel().
Referenced by fillBuffers().
void AudioCallbackPlaySource::applyAuditioningEffect | ( | int | count, |
float ** | buffers | ||
) | [protected] |
Definition at line 1312 of file AudioCallbackPlaySource.cpp.
References getTargetChannelCount(), m_auditioningPlugin, and m_auditioningPluginBypassed.
Referenced by getSourceSamples().
void AudioCallbackPlaySource::rebuildRangeLists | ( | ) | [protected] |
Definition at line 850 of file AudioCallbackPlaySource.cpp.
References getSourceSampleRate(), m_lastModelEndFrame, m_rangeDurations, m_rangeStarts, and m_viewManager.
Referenced by addModel(), clearRingBuffers(), getCurrentFrame(), and modelChangedWithin().
int AudioCallbackPlaySource::getCurrentFrame | ( | RealTime | outputLatency | ) | [protected] |
!! sincerequest_t > RealTime::zeroTime &&
Definition at line 635 of file AudioCallbackPlaySource.cpp.
References AudioCallbackPlayTarget::getCurrentTime(), getReadRingBuffer(), getSourceSampleRate(), getTargetBlockSize(), getTargetChannelCount(), getTargetSampleRate(), m_lastCurrentFrame, m_lastRetrievalTimestamp, m_lastRetrievedBlockSize, m_playStartedAt, m_playStartFrame, m_playStartFramePassed, m_rangeDurations, m_rangeStarts, m_readBufferFill, m_target, m_timeStretcher, m_trustworthyTimestamps, m_viewManager, rebuildRangeLists(), and stop().
Referenced by getCurrentBufferedFrame(), and getCurrentPlayingFrame().
void AudioCallbackPlaySource::initialiseConverter | ( | ) | [protected] |
Definition at line 934 of file AudioCallbackPlaySource.cpp.
References getSourceSampleRate(), getTargetChannelCount(), getTargetSampleRate(), m_converter, m_crapConverter, m_mutex, m_resampleQuality, and sampleRateMismatch().
Referenced by setResampleQuality(), and setTargetSampleRate().
ViewManagerBase* AudioCallbackPlaySource::m_viewManager [protected] |
Definition at line 266 of file AudioCallbackPlaySource.h.
Referenced by AudioCallbackPlaySource(), getCurrentFrame(), mixModels(), play(), playSelectionModeChanged(), rebuildRangeLists(), and selectionChanged().
AudioGenerator* AudioCallbackPlaySource::m_audioGenerator [protected] |
Definition at line 267 of file AudioCallbackPlaySource.h.
Referenced by addModel(), clearModels(), clearSoloModelSet(), fillBuffers(), mixModels(), play(), removeModel(), setSoloModelSet(), and ~AudioCallbackPlaySource().
QString AudioCallbackPlaySource::m_clientName [protected] |
Definition at line 268 of file AudioCallbackPlaySource.h.
Referenced by getClientName().
std::set<Model *> AudioCallbackPlaySource::m_models [protected] |
Definition at line 280 of file AudioCallbackPlaySource.h.
Referenced by addModel(), clearModels(), mixModels(), and removeModel().
RingBufferVector* AudioCallbackPlaySource::m_readBuffers [protected] |
Definition at line 281 of file AudioCallbackPlaySource.h.
Referenced by clearRingBuffers(), fillBuffers(), getReadRingBuffer(), play(), unifyRingBuffers(), and ~AudioCallbackPlaySource().
RingBufferVector* AudioCallbackPlaySource::m_writeBuffers [protected] |
Definition at line 282 of file AudioCallbackPlaySource.h.
Referenced by addModel(), clearRingBuffers(), fillBuffers(), getWriteRingBuffer(), setTarget(), unifyRingBuffers(), and ~AudioCallbackPlaySource().
int AudioCallbackPlaySource::m_readBufferFill [protected] |
Definition at line 283 of file AudioCallbackPlaySource.h.
Referenced by fillBuffers(), getCurrentFrame(), play(), and unifyRingBuffers().
int AudioCallbackPlaySource::m_writeBufferFill [protected] |
Definition at line 284 of file AudioCallbackPlaySource.h.
Referenced by clearRingBuffers(), fillBuffers(), play(), and unifyRingBuffers().
Scavenger<RingBufferVector> AudioCallbackPlaySource::m_bufferScavenger [protected] |
Definition at line 285 of file AudioCallbackPlaySource.h.
Referenced by AudioCallbackPlaySource::FillThread::run(), unifyRingBuffers(), and ~AudioCallbackPlaySource().
int AudioCallbackPlaySource::m_sourceChannelCount [protected] |
Definition at line 286 of file AudioCallbackPlaySource.h.
Referenced by addModel(), getSourceChannelCount(), and getTargetChannelCount().
int AudioCallbackPlaySource::m_blockSize [protected] |
Definition at line 287 of file AudioCallbackPlaySource.h.
Referenced by getTargetBlockSize(), setTarget(), and unifyRingBuffers().
int AudioCallbackPlaySource::m_sourceSampleRate [protected] |
Definition at line 288 of file AudioCallbackPlaySource.h.
Referenced by addModel(), clearModels(), getSourceSampleRate(), play(), removeModel(), and stop().
int AudioCallbackPlaySource::m_targetSampleRate [protected] |
Definition at line 289 of file AudioCallbackPlaySource.h.
Referenced by getTargetSampleRate(), and setTargetSampleRate().
int AudioCallbackPlaySource::m_playLatency [protected] |
Definition at line 290 of file AudioCallbackPlaySource.h.
Referenced by getCurrentPlayingFrame(), getTargetPlayLatency(), and setTargetPlayLatency().
AudioCallbackPlayTarget* AudioCallbackPlaySource::m_target [protected] |
Definition at line 291 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), getSourceSamples(), play(), and setTarget().
double AudioCallbackPlaySource::m_lastRetrievalTimestamp [protected] |
Definition at line 292 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), getSourceSamples(), play(), and stop().
int AudioCallbackPlaySource::m_lastRetrievedBlockSize [protected] |
Definition at line 293 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), and getSourceSamples().
bool AudioCallbackPlaySource::m_trustworthyTimestamps [protected] |
Definition at line 294 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame().
int AudioCallbackPlaySource::m_lastCurrentFrame [protected] |
Definition at line 295 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), play(), and stop().
bool AudioCallbackPlaySource::m_playing [protected] |
Definition at line 296 of file AudioCallbackPlaySource.h.
Referenced by audioProcessingOverload(), getSourceSamples(), isPlaying(), play(), AudioCallbackPlaySource::FillThread::run(), and stop().
bool AudioCallbackPlaySource::m_exiting [protected] |
Definition at line 297 of file AudioCallbackPlaySource.h.
Referenced by AudioCallbackPlaySource::FillThread::run(), and ~AudioCallbackPlaySource().
int AudioCallbackPlaySource::m_lastModelEndFrame [protected] |
Definition at line 298 of file AudioCallbackPlaySource.h.
Referenced by addModel(), clearModels(), getPlayEndFrame(), mixModels(), modelChangedWithin(), play(), rebuildRangeLists(), removeModel(), and unifyRingBuffers().
int AudioCallbackPlaySource::m_ringBufferSize [protected] |
Definition at line 299 of file AudioCallbackPlaySource.h.
Referenced by clearRingBuffers(), AudioCallbackPlaySource::FillThread::run(), and setTarget().
float AudioCallbackPlaySource::m_outputLeft [protected] |
Definition at line 300 of file AudioCallbackPlaySource.h.
Referenced by getOutputLevels(), and setOutputLevels().
float AudioCallbackPlaySource::m_outputRight [protected] |
Definition at line 301 of file AudioCallbackPlaySource.h.
Referenced by getOutputLevels(), and setOutputLevels().
RealTimePluginInstance* AudioCallbackPlaySource::m_auditioningPlugin [protected] |
Definition at line 302 of file AudioCallbackPlaySource.h.
Referenced by applyAuditioningEffect(), audioProcessingOverload(), and setAuditioningEffect().
bool AudioCallbackPlaySource::m_auditioningPluginBypassed [protected] |
Definition at line 303 of file AudioCallbackPlaySource.h.
Referenced by applyAuditioningEffect(), audioProcessingOverload(), and setAuditioningEffect().
Scavenger<RealTimePluginInstance> AudioCallbackPlaySource::m_pluginScavenger [protected] |
Definition at line 304 of file AudioCallbackPlaySource.h.
Referenced by AudioCallbackPlaySource::FillThread::run(), and ~AudioCallbackPlaySource().
int AudioCallbackPlaySource::m_playStartFrame [protected] |
Definition at line 305 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), and play().
bool AudioCallbackPlaySource::m_playStartFramePassed [protected] |
Definition at line 306 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), and play().
RealTime AudioCallbackPlaySource::m_playStartedAt [protected] |
Definition at line 307 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), and play().
RubberBand::RubberBandStretcher* AudioCallbackPlaySource::m_timeStretcher [protected] |
Definition at line 329 of file AudioCallbackPlaySource.h.
Referenced by audioProcessingOverload(), fillBuffers(), getCurrentFrame(), getSourceSamples(), play(), setTimeStretch(), and ~AudioCallbackPlaySource().
RubberBand::RubberBandStretcher* AudioCallbackPlaySource::m_monoStretcher [protected] |
Definition at line 330 of file AudioCallbackPlaySource.h.
Referenced by audioProcessingOverload(), getSourceSamples(), play(), setTimeStretch(), and ~AudioCallbackPlaySource().
float AudioCallbackPlaySource::m_stretchRatio [protected] |
Definition at line 331 of file AudioCallbackPlaySource.h.
Referenced by getSourceSamples(), setTargetSampleRate(), and setTimeStretch().
bool AudioCallbackPlaySource::m_stretchMono [protected] |
Definition at line 332 of file AudioCallbackPlaySource.h.
Referenced by audioProcessingOverload(), and getSourceSamples().
int AudioCallbackPlaySource::m_stretcherInputCount [protected] |
Definition at line 334 of file AudioCallbackPlaySource.h.
Referenced by audioProcessingOverload(), getSourceSamples(), setTimeStretch(), and ~AudioCallbackPlaySource().
float** AudioCallbackPlaySource::m_stretcherInputs [protected] |
Definition at line 335 of file AudioCallbackPlaySource.h.
Referenced by getSourceSamples(), setTimeStretch(), and ~AudioCallbackPlaySource().
int* AudioCallbackPlaySource::m_stretcherInputSizes [protected] |
Definition at line 336 of file AudioCallbackPlaySource.h.
Referenced by getSourceSamples(), setTimeStretch(), and ~AudioCallbackPlaySource().
std::vector<RealTime> AudioCallbackPlaySource::m_rangeStarts [protected] |
Definition at line 352 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), and rebuildRangeLists().
std::vector<RealTime> AudioCallbackPlaySource::m_rangeDurations [protected] |
Definition at line 353 of file AudioCallbackPlaySource.h.
Referenced by getCurrentFrame(), and rebuildRangeLists().
QMutex AudioCallbackPlaySource::m_mutex [protected] |
Definition at line 371 of file AudioCallbackPlaySource.h.
Referenced by addModel(), clearModels(), clearRingBuffers(), initialiseConverter(), play(), removeModel(), AudioCallbackPlaySource::FillThread::run(), and setAuditioningEffect().
QWaitCondition AudioCallbackPlaySource::m_condition [protected] |
Definition at line 372 of file AudioCallbackPlaySource.h.
Referenced by addModel(), getSourceSamples(), play(), AudioCallbackPlaySource::FillThread::run(), stop(), and ~AudioCallbackPlaySource().
FillThread* AudioCallbackPlaySource::m_fillThread [protected] |
Definition at line 373 of file AudioCallbackPlaySource.h.
Referenced by addModel(), and ~AudioCallbackPlaySource().
SRC_STATE* AudioCallbackPlaySource::m_converter [protected] |
Definition at line 374 of file AudioCallbackPlaySource.h.
Referenced by addModel(), clearModels(), fillBuffers(), initialiseConverter(), play(), and removeModel().
SRC_STATE* AudioCallbackPlaySource::m_crapConverter [protected] |
Definition at line 375 of file AudioCallbackPlaySource.h.
Referenced by addModel(), clearModels(), fillBuffers(), initialiseConverter(), play(), and removeModel().
int AudioCallbackPlaySource::m_resampleQuality [protected] |
Definition at line 376 of file AudioCallbackPlaySource.h.
Referenced by initialiseConverter(), and setResampleQuality().