AudioCallbackPlaySource Class Reference

#include <AudioCallbackPlaySource.h>

Inherits AudioPlaySource.

Inheritance diagram for AudioCallbackPlaySource:

Inheritance graph
[legend]
Collaboration diagram for AudioCallbackPlaySource:

Collaboration graph
[legend]
List of all members.

Detailed Description

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.

Public Slots

void audioProcessingOverload ()

Signals

void modelReplaced ()
void playStatusChanged (bool isPlaying)
void sampleRateMismatch (size_t requested, size_t available, bool willResample)
void audioOverloadPluginDisabled ()

Public Member Functions

 AudioCallbackPlaySource (ViewManager *, 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 (size_t 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 size_t getCurrentPlayingFrame ()
 Return the frame number that is currently expected to be coming out of the speakers.
virtual size_t getCurrentBufferedFrame ()
 Return the last frame that would come out of the speakers if we stopped playback right now.
virtual size_t getPlayEndFrame ()
 Return the frame at which playback is expected to end (if not looping).
void setTarget (AudioCallbackPlayTarget *, size_t blockSize)
 Set the target and the block size of the target audio device.
size_t getTargetBlockSize () const
 Get the block size of the target audio device.
void setTargetPlayLatency (size_t)
 Set the playback latency of the target audio device, in frames at the target sample rate.
size_t getTargetPlayLatency () const
 Get the playback latency of the target audio device.
void setTargetSampleRate (size_t)
 Specify that the target audio device has a fixed sample rate (i.e.
virtual size_t 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.
size_t getSourceChannelCount () const
 Get the number of channels of audio that in the source models.
size_t getTargetChannelCount () const
 Get the number of channels of audio that will be provided to the play target.
virtual size_t getSourceSampleRate () const
 Get the actual sample rate of the source material.
size_t getSourceSamples (size_t 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 setAuditioningPlugin (RealTimePluginInstance *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 modelChanged (size_t startFrame, size_t endFrame)

Protected Member Functions

RingBuffer< float > * getWriteRingBuffer (size_t c)
RingBuffer< float > * getReadRingBuffer (size_t c)
void clearRingBuffers (bool haveLock=false, size_t count=0)
void unifyRingBuffers ()
bool fillBuffers ()
size_t mixModels (size_t &frame, size_t count, float **buffers)
void applyAuditioningEffect (size_t count, float **buffers)
void rebuildRangeLists ()
size_t getCurrentFrame (RealTime outputLatency)
void initialiseConverter ()

Protected Attributes

ViewManagerm_viewManager
AudioGeneratorm_audioGenerator
QString m_clientName
std::set< Model * > m_models
RingBufferVectorm_readBuffers
RingBufferVectorm_writeBuffers
size_t m_readBufferFill
size_t m_writeBufferFill
Scavenger< RingBufferVectorm_bufferScavenger
size_t m_sourceChannelCount
size_t m_blockSize
size_t m_sourceSampleRate
size_t m_targetSampleRate
size_t m_playLatency
AudioCallbackPlayTargetm_target
double m_lastRetrievalTimestamp
size_t m_lastRetrievedBlockSize
bool m_playing
bool m_exiting
size_t m_lastModelEndFrame
float m_outputLeft
float m_outputRight
RealTimePluginInstancem_auditioningPlugin
bool m_auditioningPluginBypassed
Scavenger< RealTimePluginInstancem_pluginScavenger
size_t m_playStartFrame
bool m_playStartFramePassed
RealTime m_playStartedAt
RubberBand::RubberBandStretcher * m_timeStretcher
float m_stretchRatio
size_t m_stretcherInputCount
float ** m_stretcherInputs
size_t * m_stretcherInputSizes
std::vector< RealTimem_rangeStarts
std::vector< RealTimem_rangeDurations
QMutex m_mutex
QWaitCondition m_condition
FillThreadm_fillThread
SRC_STATE * m_converter
SRC_STATE * m_crapConverter
int m_resampleQuality

Static Protected Attributes

static const size_t m_ringBufferSize

Classes

class  FillThread
class  RingBufferVector


Constructor & Destructor Documentation

AudioCallbackPlaySource::AudioCallbackPlaySource ( ViewManager ,
QString  clientName 
)

Definition at line 42 of file AudioCallbackPlaySource.cpp.

References Preferences::getInstance(), PlayParameterRepository::getInstance(), m_viewManager, playLoopModeChanged(), playParametersChanged(), playSelectionModeChanged(), preferenceChanged(), selectionChanged(), and ViewManager::setAudioPlaySource().

AudioCallbackPlaySource::~AudioCallbackPlaySource (  )  [virtual]

Definition at line 97 of file AudioCallbackPlaySource.cpp.

References clearModels(), m_audioGenerator, m_bufferScavenger, m_condition, m_exiting, m_fillThread, m_pluginScavenger, m_readBuffers, m_stretcherInputCount, m_stretcherInputs, m_stretcherInputSizes, m_writeBuffers, and Scavenger< T >::scavenge().


Member Function Documentation

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 128 of file AudioCallbackPlaySource.cpp.

References AudioGenerator::addModel(), clearRingBuffers(), DenseTimeValueModel::getChannelCount(), Model::getEndFrame(), Model::getSampleRate(), getTargetChannelCount(), m_audioGenerator, m_condition, m_converter, m_crapConverter, m_fillThread, m_lastModelEndFrame, m_models, m_mutex, m_sourceChannelCount, m_sourceSampleRate, m_writeBuffers, modelChanged(), modelReplaced(), sampleRateMismatch(), AudioGenerator::setTargetChannelCount(), and Thread::start().

Referenced by MainWindowBase::layerInAView(), and MainWindowBase::modelAdded().

void AudioCallbackPlaySource::removeModel ( Model model  )  [virtual]

Remove a model.

Definition at line 256 of file AudioCallbackPlaySource.cpp.

References clearRingBuffers(), m_audioGenerator, m_converter, m_crapConverter, m_lastModelEndFrame, m_models, m_mutex, m_sourceSampleRate, modelChanged(), 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 296 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 ( size_t  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.

Implements AudioPlaySource.

Definition at line 356 of file AudioCallbackPlaySource.cpp.

References ViewManager::alignReferenceToPlaybackFrame(), ViewManager::constrainFrameToSelection(), RealTime::fromSeconds(), AudioCallbackPlayTarget::getCurrentTime(), ViewManager::getPlaySelectionMode(), getReadRingBuffer(), ViewManager::getSelections(), getTargetChannelCount(), m_audioGenerator, m_condition, m_converter, m_crapConverter, m_lastModelEndFrame, m_lastRetrievalTimestamp, m_mutex, m_playing, m_playStartedAt, m_playStartFrame, m_playStartFramePassed, m_readBufferFill, m_readBuffers, m_target, m_timeStretcher, m_viewManager, m_writeBufferFill, playStatusChanged(), AudioGenerator::reset(), and RealTime::zeroTime.

Referenced by MainWindowBase::currentPaneChanged(), MainWindow::handleOSCMessage(), and MainWindowBase::play().

void AudioCallbackPlaySource::stop (  )  [virtual]

Stop playback and ensure that no more data is returned.

Implements AudioPlaySource.

Definition at line 423 of file AudioCallbackPlaySource.cpp.

References m_condition, m_lastRetrievalTimestamp, m_playing, and playStatusChanged().

Referenced by getCurrentFrame(), MainWindow::handleOSCMessage(), and MainWindowBase::stop().

virtual bool AudioCallbackPlaySource::isPlaying (  )  const [inline, virtual]

Return whether playback is currently supposed to be happening.

Implements AudioPlaySource.

Definition at line 96 of file AudioCallbackPlaySource.h.

References m_playing.

Referenced by MainWindowBase::currentPaneChanged(), MainWindowBase::globalCentreFrameChanged(), MainWindow::handleOSCMessage(), MainWindowBase::play(), MainWindowBase::playbackFrameChanged(), MainWindowBase::rewind(), MainWindowBase::viewCentreFrameChanged(), and MainWindowBase::viewZoomLevelChanged().

size_t AudioCallbackPlaySource::getCurrentPlayingFrame (  )  [virtual]

Return the frame number that is currently expected to be coming out of the speakers.

(i.e. compensating for playback latency.)

Implements AudioPlaySource.

Definition at line 507 of file AudioCallbackPlaySource.cpp.

References RealTime::frame2RealTime(), getCurrentFrame(), getTargetSampleRate(), and m_playLatency.

size_t AudioCallbackPlaySource::getCurrentBufferedFrame (  )  [virtual]

Return the last frame that would come out of the speakers if we stopped playback right now.

Definition at line 520 of file AudioCallbackPlaySource.cpp.

References getCurrentFrame(), and RealTime::zeroTime.

Referenced by clearRingBuffers(), and MainWindowBase::currentPaneChanged().

virtual size_t 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 ,
size_t  blockSize 
)

Set the target and the block size of the target audio device.

This should be called by the target class.

Definition at line 479 of file AudioCallbackPlaySource.cpp.

References m_blockSize, m_ringBufferSize, and m_target.

Referenced by AudioPortAudioTarget::AudioPortAudioTarget(), AudioJACKTarget::sourceModelReplaced(), AudioJACKTarget::~AudioJACKTarget(), and AudioPortAudioTarget::~AudioPortAudioTarget().

size_t 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 488 of file AudioCallbackPlaySource.cpp.

References m_blockSize.

Referenced by ModelTransformerFactory::getConfigurationForTransform(), and getCurrentFrame().

void AudioCallbackPlaySource::setTargetPlayLatency ( size_t   ) 

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 495 of file AudioCallbackPlaySource.cpp.

References m_playLatency.

Referenced by AudioPortAudioTarget::AudioPortAudioTarget(), and AudioJACKTarget::sourceModelReplaced().

size_t AudioCallbackPlaySource::getTargetPlayLatency (  )  const

Get the playback latency of the target audio device.

Definition at line 501 of file AudioCallbackPlaySource.cpp.

References m_playLatency.

void AudioCallbackPlaySource::setTargetSampleRate ( size_t   ) 

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 794 of file AudioCallbackPlaySource.cpp.

References initialiseConverter(), and m_targetSampleRate.

Referenced by AudioPortAudioTarget::AudioPortAudioTarget(), AudioPortAudioTarget::sourceModelReplaced(), and AudioJACKTarget::sourceModelReplaced().

size_t 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).

Implements AudioPlaySource.

Definition at line 899 of file AudioCallbackPlaySource.cpp.

References getSourceSampleRate(), and m_targetSampleRate.

Referenced by fillBuffers(), ModelTransformerFactory::getConfigurationForTransform(), getCurrentFrame(), getCurrentPlayingFrame(), initialiseConverter(), setTimeStretch(), and MainWindow::updateDescriptionLabel().

void AudioCallbackPlaySource::setOutputLevels ( float  left,
float  right 
)

Set the current output levels for metering (for call from the target).

Definition at line 779 of file AudioCallbackPlaySource.cpp.

References m_outputLeft, and m_outputRight.

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.

Implements AudioPlaySource.

Definition at line 786 of file AudioCallbackPlaySource.cpp.

References m_outputLeft, and m_outputRight.

size_t 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 906 of file AudioCallbackPlaySource.cpp.

References m_sourceChannelCount.

Referenced by AudioJACKTarget::sourceModelReplaced().

size_t 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 912 of file AudioCallbackPlaySource.cpp.

References m_sourceChannelCount.

Referenced by addModel(), applyAuditioningEffect(), fillBuffers(), ModelTransformerFactory::getConfigurationForTransform(), getCurrentFrame(), getSourceSamples(), initialiseConverter(), mixModels(), play(), AudioCallbackPlaySource::FillThread::run(), setTimeStretch(), and unifyRingBuffers().

size_t 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.

Implements AudioPlaySource.

Definition at line 919 of file AudioCallbackPlaySource.cpp.

References m_sourceSampleRate.

Referenced by AudioPortAudioTarget::AudioPortAudioTarget(), fillBuffers(), getCurrentFrame(), getTargetSampleRate(), initialiseConverter(), MainWindowBase::openAudio(), rebuildRangeLists(), and AudioCallbackPlaySource::FillThread::run().

size_t AudioCallbackPlaySource::getSourceSamples ( size_t  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 951 of file AudioCallbackPlaySource.cpp.

References applyAuditioningEffect(), AudioCallbackPlayTarget::getCurrentTime(), getReadRingBuffer(), RingBuffer< T, N >::getReadSpace(), getTargetChannelCount(), m_condition, m_lastRetrievalTimestamp, m_lastRetrievedBlockSize, m_playing, m_stretcherInputCount, m_stretcherInputs, m_stretcherInputSizes, m_stretchRatio, m_target, m_timeStretcher, and RingBuffer< T, N >::read().

Referenced by AudioJACKTarget::process().

void AudioCallbackPlaySource::setTimeStretch ( float  factor  ) 

Set the time stretcher factor (i.e.

playback speed).

Definition at line 925 of file AudioCallbackPlaySource.cpp.

References getTargetChannelCount(), getTargetSampleRate(), m_stretcherInputCount, m_stretcherInputs, m_stretcherInputSizes, m_stretchRatio, and m_timeStretcher.

Referenced by MainWindow::playSpeedChanged().

void AudioCallbackPlaySource::setResampleQuality ( int  q  ) 

Set the resampler quality, 0 - 2 where 0 is fastest and 2 is highest quality.

Definition at line 862 of file AudioCallbackPlaySource.cpp.

References initialiseConverter(), and m_resampleQuality.

Referenced by preferenceChanged().

void AudioCallbackPlaySource::setAuditioningPlugin ( RealTimePluginInstance 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 setAuditioningPlugin (depending on real-time constraints).

Pass a null pointer to remove the current auditioning plugin, if any.

Definition at line 876 of file AudioCallbackPlaySource.cpp.

References Scavenger< T >::claim(), m_auditioningPlugin, m_auditioningPluginBypassed, and m_pluginScavenger.

Referenced by ModelTransformerFactory::getConfigurationForTransform().

void AudioCallbackPlaySource::setSoloModelSet ( std::set< Model * >  s  ) 

Specify that only the given set of models should be played.

Definition at line 885 of file AudioCallbackPlaySource.cpp.

References clearRingBuffers(), m_audioGenerator, and AudioGenerator::setSoloModelSet().

Referenced by MainWindowBase::currentPaneChanged().

void AudioCallbackPlaySource::clearSoloModelSet (  ) 

Specify that all models should be played as normal (if not muted).

Definition at line 892 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 play(), and stop().

void AudioCallbackPlaySource::sampleRateMismatch ( size_t  requested,
size_t  available,
bool  willResample 
) [signal]

Referenced by addModel(), and initialiseConverter().

void AudioCallbackPlaySource::audioOverloadPluginDisabled (  )  [signal]

Referenced by audioProcessingOverload().

void AudioCallbackPlaySource::audioProcessingOverload (  )  [slot]

Definition at line 469 of file AudioCallbackPlaySource.cpp.

References audioOverloadPluginDisabled(), m_auditioningPlugin, m_auditioningPluginBypassed, and m_playing.

Referenced by AudioJACKTarget::xrun().

void AudioCallbackPlaySource::selectionChanged (  )  [protected, slot]

Definition at line 433 of file AudioCallbackPlaySource.cpp.

References clearRingBuffers(), ViewManager::getPlaySelectionMode(), and m_viewManager.

Referenced by AudioCallbackPlaySource().

void AudioCallbackPlaySource::playLoopModeChanged (  )  [protected, slot]

Definition at line 441 of file AudioCallbackPlaySource.cpp.

References clearRingBuffers().

Referenced by AudioCallbackPlaySource().

void AudioCallbackPlaySource::playSelectionModeChanged (  )  [protected, slot]

Definition at line 447 of file AudioCallbackPlaySource.cpp.

References clearRingBuffers(), ViewManager::getSelections(), and m_viewManager.

Referenced by AudioCallbackPlaySource().

void AudioCallbackPlaySource::playParametersChanged ( PlayParameters  )  [protected, slot]

Definition at line 455 of file AudioCallbackPlaySource.cpp.

References clearRingBuffers().

Referenced by AudioCallbackPlaySource().

void AudioCallbackPlaySource::preferenceChanged ( PropertyContainer::PropertyName   )  [protected, slot]

Definition at line 461 of file AudioCallbackPlaySource.cpp.

References Preferences::getInstance(), and setResampleQuality().

Referenced by AudioCallbackPlaySource().

void AudioCallbackPlaySource::modelChanged ( size_t  startFrame,
size_t  endFrame 
) [protected, slot]

Definition at line 244 of file AudioCallbackPlaySource.cpp.

References m_lastModelEndFrame, and rebuildRangeLists().

Referenced by addModel(), and removeModel().

RingBuffer<float>* AudioCallbackPlaySource::getWriteRingBuffer ( size_t  c  )  [inline, protected]

Definition at line 304 of file AudioCallbackPlaySource.h.

References m_writeBuffers.

Referenced by fillBuffers(), and unifyRingBuffers().

RingBuffer<float>* AudioCallbackPlaySource::getReadRingBuffer ( size_t  c  )  [inline, protected]

Definition at line 312 of file AudioCallbackPlaySource.h.

References m_readBuffers.

Referenced by getCurrentFrame(), getSourceSamples(), play(), AudioCallbackPlaySource::FillThread::run(), and unifyRingBuffers().

void AudioCallbackPlaySource::clearRingBuffers ( bool  haveLock = false,
size_t  count = 0 
) [protected]

Definition at line 325 of file AudioCallbackPlaySource.cpp.

References getCurrentBufferedFrame(), m_mutex, m_readBuffers, m_ringBufferSize, m_writeBufferFill, m_writeBuffers, and rebuildRangeLists().

Referenced by addModel(), clearModels(), clearSoloModelSet(), playLoopModeChanged(), playParametersChanged(), playSelectionModeChanged(), removeModel(), selectionChanged(), and setSoloModelSet().

void AudioCallbackPlaySource::unifyRingBuffers (  )  [protected]

Definition at line 1539 of file AudioCallbackPlaySource.cpp.

References getReadRingBuffer(), RingBuffer< T, N >::getReadSpace(), 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]

Definition at line 1167 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, mixModels(), and RingBuffer< T, N >::write().

Referenced by AudioCallbackPlaySource::FillThread::run().

size_t AudioCallbackPlaySource::mixModels ( size_t &  frame,
size_t  count,
float **  buffers 
) [protected]

Definition at line 1380 of file AudioCallbackPlaySource.cpp.

References ViewManager::alignPlaybackFrameToReference(), ViewManager::alignReferenceToPlaybackFrame(), ViewManager::getContainingSelection(), Selection::getEndFrame(), ViewManager::getPlayLoopMode(), ViewManager::getPlaySelectionMode(), ViewManager::getSelections(), Selection::getStartFrame(), getTargetChannelCount(), Selection::isEmpty(), m_audioGenerator, m_lastModelEndFrame, m_models, m_viewManager, and AudioGenerator::mixModel().

Referenced by fillBuffers().

void AudioCallbackPlaySource::applyAuditioningEffect ( size_t  count,
float **  buffers 
) [protected]

Definition at line 1122 of file AudioCallbackPlaySource.cpp.

References RealTimePluginInstance::getAudioInputBuffers(), RealTimePluginInstance::getAudioInputCount(), RealTimePluginInstance::getAudioOutputBuffers(), RealTimePluginInstance::getAudioOutputCount(), RealTimePluginInstance::getBufferSize(), getTargetChannelCount(), m_auditioningPlugin, m_auditioningPluginBypassed, and RealTimePluginInstance::run().

Referenced by getSourceSamples().

void AudioCallbackPlaySource::rebuildRangeLists (  )  [protected]

Definition at line 725 of file AudioCallbackPlaySource.cpp.

References ViewManager::alignReferenceToPlaybackFrame(), RealTime::frame2RealTime(), ViewManager::getPlaySelectionMode(), ViewManager::getSelections(), getSourceSampleRate(), m_lastModelEndFrame, m_rangeDurations, m_rangeStarts, m_viewManager, and RealTime::zeroTime.

Referenced by clearRingBuffers(), getCurrentFrame(), and modelChanged().

size_t AudioCallbackPlaySource::getCurrentFrame ( RealTime  outputLatency  )  [protected]

Definition at line 526 of file AudioCallbackPlaySource.cpp.

References ViewManager::alignPlaybackFrameToReference(), RealTime::frame2RealTime(), RealTime::fromSeconds(), AudioCallbackPlayTarget::getCurrentTime(), ViewManager::getPlayLoopMode(), getReadRingBuffer(), getSourceSampleRate(), getTargetBlockSize(), getTargetChannelCount(), getTargetSampleRate(), m_lastModelEndFrame, m_lastRetrievalTimestamp, m_lastRetrievedBlockSize, m_playStartedAt, m_playStartFrame, m_playStartFramePassed, m_rangeDurations, m_rangeStarts, m_readBufferFill, m_target, m_timeStretcher, m_viewManager, RealTime::realTime2Frame(), rebuildRangeLists(), stop(), and RealTime::zeroTime.

Referenced by getCurrentBufferedFrame(), and getCurrentPlayingFrame().

void AudioCallbackPlaySource::initialiseConverter (  )  [protected]

Definition at line 801 of file AudioCallbackPlaySource.cpp.

References getSourceSampleRate(), getTargetChannelCount(), getTargetSampleRate(), m_converter, m_crapConverter, m_mutex, m_resampleQuality, and sampleRateMismatch().

Referenced by setResampleQuality(), and setTargetSampleRate().


Member Data Documentation

ViewManager* AudioCallbackPlaySource::m_viewManager [protected]

Definition at line 263 of file AudioCallbackPlaySource.h.

Referenced by AudioCallbackPlaySource(), getCurrentFrame(), mixModels(), play(), playSelectionModeChanged(), rebuildRangeLists(), and selectionChanged().

AudioGenerator* AudioCallbackPlaySource::m_audioGenerator [protected]

Definition at line 264 of file AudioCallbackPlaySource.h.

Referenced by addModel(), clearModels(), clearSoloModelSet(), fillBuffers(), mixModels(), play(), removeModel(), setSoloModelSet(), and ~AudioCallbackPlaySource().

QString AudioCallbackPlaySource::m_clientName [protected]

Definition at line 265 of file AudioCallbackPlaySource.h.

Referenced by getClientName().

std::set<Model *> AudioCallbackPlaySource::m_models [protected]

Definition at line 277 of file AudioCallbackPlaySource.h.

Referenced by addModel(), clearModels(), mixModels(), and removeModel().

RingBufferVector* AudioCallbackPlaySource::m_readBuffers [protected]

Definition at line 278 of file AudioCallbackPlaySource.h.

Referenced by clearRingBuffers(), fillBuffers(), getReadRingBuffer(), play(), unifyRingBuffers(), and ~AudioCallbackPlaySource().

RingBufferVector* AudioCallbackPlaySource::m_writeBuffers [protected]

Definition at line 279 of file AudioCallbackPlaySource.h.

Referenced by addModel(), clearRingBuffers(), fillBuffers(), getWriteRingBuffer(), unifyRingBuffers(), and ~AudioCallbackPlaySource().

size_t AudioCallbackPlaySource::m_readBufferFill [protected]

Definition at line 280 of file AudioCallbackPlaySource.h.

Referenced by f