svapp  1.9
AudioGenerator Class Reference

#include <AudioGenerator.h>

List of all members.

Classes

struct  NoteOff

Public Member Functions

 AudioGenerator ()
virtual ~AudioGenerator ()
virtual bool addModel (Model *model)
 Add a data model to be played from and initialise any necessary audio generation code.
virtual void removeModel (Model *model)
 Remove a model.
virtual void clearModels ()
 Remove all models.
virtual void reset ()
 Reset playback, clearing buffers and the like.
virtual void setTargetChannelCount (int channelCount)
 Set the target channel count.
virtual int getBlockSize () const
 Return the internal processing block size.
virtual int mixModel (Model *model, int startFrame, int frameCount, float **buffer, int fadeIn=0, int fadeOut=0)
 Mix a single model into an output buffer.
virtual void setSoloModelSet (std::set< Model * >s)
 Specify that only the given set of models should be played.
virtual void clearSoloModelSet ()
 Specify that all models should be played as normal (if not muted).

Protected Types

typedef std::map< const Model
*, ClipMixer * > 
ClipMixerMap
typedef std::multiset< NoteOff,
NoteOff::Comparator
NoteOffSet
typedef std::map< const Model
*, NoteOffSet
NoteOffMap
typedef std::map< const Model
*, ContinuousSynth * > 
ContinuousSynthMap

Protected Slots

void playClipIdChanged (const Playable *, QString)

Protected Member Functions

bool usesClipMixer (const Model *)
bool wantsQuieterClips (const Model *)
bool usesContinuousSynth (const Model *)
ClipMixermakeClipMixerFor (const Model *model)
ContinuousSynthmakeSynthFor (const Model *model)
virtual int mixDenseTimeValueModel (DenseTimeValueModel *model, int startFrame, int frameCount, float **buffer, float gain, float pan, int fadeIn, int fadeOut)
virtual int mixClipModel (Model *model, int startFrame, int frameCount, float **buffer, float gain, float pan)
virtual int mixContinuousSynthModel (Model *model, int startFrame, int frameCount, float **buffer, float gain, float pan)

Static Protected Member Functions

static void initialiseSampleDir ()

Protected Attributes

int m_sourceSampleRate
int m_targetChannelCount
int m_waveType
bool m_soloing
std::set< Model * > m_soloModelSet
QMutex m_mutex
ClipMixerMap m_clipMixerMap
NoteOffMap m_noteOffs
ContinuousSynthMap m_continuousSynthMap
float ** m_channelBuffer
int m_channelBufSiz
int m_channelBufCount

Static Protected Attributes

static QString m_sampleDir = ""
static const int m_processingBlockSize = 1024

Detailed Description

Definition at line 35 of file AudioGenerator.h.


Member Typedef Documentation

typedef std::map<const Model *, ClipMixer *> AudioGenerator::ClipMixerMap [protected]

Definition at line 122 of file AudioGenerator.h.

typedef std::multiset<NoteOff, NoteOff::Comparator> AudioGenerator::NoteOffSet [protected]

Definition at line 124 of file AudioGenerator.h.

typedef std::map<const Model *, NoteOffSet> AudioGenerator::NoteOffMap [protected]

Definition at line 125 of file AudioGenerator.h.

typedef std::map<const Model *, ContinuousSynth *> AudioGenerator::ContinuousSynthMap [protected]

Definition at line 127 of file AudioGenerator.h.


Constructor & Destructor Documentation

Definition at line 65 of file AudioGenerator.cpp.


Member Function Documentation

bool AudioGenerator::addModel ( Model *  model) [virtual]

Add a data model to be played from and initialise any necessary audio generation code.

Returns true if the model will be played. The model will be added regardless of the return value.

Definition at line 110 of file AudioGenerator.cpp.

References m_clipMixerMap, m_continuousSynthMap, m_mutex, m_sourceSampleRate, makeClipMixerFor(), makeSynthFor(), usesClipMixer(), and usesContinuousSynth().

Referenced by AudioCallbackPlaySource::addModel().

void AudioGenerator::removeModel ( Model *  model) [virtual]

Remove a model.

Definition at line 255 of file AudioGenerator.cpp.

References m_clipMixerMap, and m_mutex.

Referenced by AudioCallbackPlaySource::removeModel().

void AudioGenerator::clearModels ( ) [virtual]

Remove all models.

Definition at line 271 of file AudioGenerator.cpp.

References m_clipMixerMap, and m_mutex.

Referenced by AudioCallbackPlaySource::clearModels().

void AudioGenerator::reset ( ) [virtual]

Reset playback, clearing buffers and the like.

Definition at line 283 of file AudioGenerator.cpp.

References m_clipMixerMap, m_mutex, and m_noteOffs.

Referenced by AudioCallbackPlaySource::play().

void AudioGenerator::setTargetChannelCount ( int  channelCount) [virtual]

Set the target channel count.

The buffer parameter to mixModel must always point to at least this number of arrays.

Definition at line 299 of file AudioGenerator.cpp.

References m_clipMixerMap, m_mutex, and m_targetChannelCount.

Referenced by AudioCallbackPlaySource::addModel().

int AudioGenerator::getBlockSize ( ) const [virtual]

Return the internal processing block size.

The frameCount argument to all mixModel calls must be a multiple of this value.

Definition at line 314 of file AudioGenerator.cpp.

References m_processingBlockSize.

Referenced by AudioCallbackPlaySource::fillBuffers().

int AudioGenerator::mixModel ( Model *  model,
int  startFrame,
int  frameCount,
float **  buffer,
int  fadeIn = 0,
int  fadeOut = 0 
) [virtual]
void AudioGenerator::setSoloModelSet ( std::set< Model * >  s) [virtual]

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

Definition at line 320 of file AudioGenerator.cpp.

References m_mutex, m_soloing, and m_soloModelSet.

Referenced by AudioCallbackPlaySource::setSoloModelSet().

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

Definition at line 329 of file AudioGenerator.cpp.

References m_mutex, m_soloing, and m_soloModelSet.

Referenced by AudioCallbackPlaySource::clearSoloModelSet().

void AudioGenerator::playClipIdChanged ( const Playable *  playable,
QString   
) [protected, slot]

Definition at line 149 of file AudioGenerator.cpp.

References m_clipMixerMap, m_mutex, and makeClipMixerFor().

Referenced by AudioGenerator().

bool AudioGenerator::usesClipMixer ( const Model *  model) [protected]

Definition at line 169 of file AudioGenerator.cpp.

Referenced by addModel(), and mixModel().

bool AudioGenerator::wantsQuieterClips ( const Model *  model) [protected]

Definition at line 179 of file AudioGenerator.cpp.

Referenced by makeClipMixerFor().

bool AudioGenerator::usesContinuousSynth ( const Model *  model) [protected]

Definition at line 191 of file AudioGenerator.cpp.

Referenced by addModel(), and mixModel().

ContinuousSynth * AudioGenerator::makeSynthFor ( const Model *  model) [protected]

Definition at line 239 of file AudioGenerator.cpp.

References m_processingBlockSize, m_sourceSampleRate, m_targetChannelCount, and m_waveType.

Referenced by addModel().

void AudioGenerator::initialiseSampleDir ( ) [static, protected]

Definition at line 73 of file AudioGenerator.cpp.

References m_sampleDir.

Referenced by AudioGenerator().

int AudioGenerator::mixDenseTimeValueModel ( DenseTimeValueModel *  model,
int  startFrame,
int  frameCount,
float **  buffer,
float  gain,
float  pan,
int  fadeIn,
int  fadeOut 
) [protected, virtual]

Definition at line 397 of file AudioGenerator.cpp.

References m_channelBufCount, m_channelBuffer, m_channelBufSiz, and m_targetChannelCount.

Referenced by mixModel().

int AudioGenerator::mixClipModel ( Model *  model,
int  startFrame,
int  frameCount,
float **  buffer,
float  gain,
float  pan 
) [protected, virtual]
int AudioGenerator::mixContinuousSynthModel ( Model *  model,
int  startFrame,
int  frameCount,
float **  buffer,
float  gain,
float  pan 
) [protected, virtual]

!! todo: see comment in mixClipModel

Definition at line 613 of file AudioGenerator.cpp.

References m_continuousSynthMap, m_processingBlockSize, m_targetChannelCount, and ContinuousSynth::mix().

Referenced by mixModel().


Member Data Documentation

Definition at line 100 of file AudioGenerator.h.

Referenced by addModel(), makeClipMixerFor(), makeSynthFor(), and mixModel().

int AudioGenerator::m_waveType [protected]

Definition at line 102 of file AudioGenerator.h.

Referenced by makeSynthFor().

bool AudioGenerator::m_soloing [protected]

Definition at line 104 of file AudioGenerator.h.

Referenced by clearSoloModelSet(), mixModel(), and setSoloModelSet().

std::set<Model *> AudioGenerator::m_soloModelSet [protected]

Definition at line 105 of file AudioGenerator.h.

Referenced by clearSoloModelSet(), mixModel(), and setSoloModelSet().

Definition at line 132 of file AudioGenerator.h.

Referenced by mixClipModel(), and reset().

QString AudioGenerator::m_sampleDir = "" [static, protected]

Definition at line 133 of file AudioGenerator.h.

Referenced by initialiseSampleDir(), and makeClipMixerFor().

const int AudioGenerator::m_processingBlockSize = 1024 [static, protected]
float** AudioGenerator::m_channelBuffer [protected]

Definition at line 160 of file AudioGenerator.h.

Referenced by mixDenseTimeValueModel().

Definition at line 161 of file AudioGenerator.h.

Referenced by mixDenseTimeValueModel().

Definition at line 162 of file AudioGenerator.h.

Referenced by mixDenseTimeValueModel().


The documentation for this class was generated from the following files: