Cinder  0.9.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cinder::audio::VoiceCallbackProcessor Class Reference

#include <Voice.h>

Inherits cinder::audio::Voice.

Public Member Functions

NodeRef getInputNode () const override
 
virtual void start ()
 
virtual void stop ()
 
virtual void pause ()
 
virtual bool isPlaying () const
 
virtual NodeRef getOutputNode () const
 
void setVolume (float volume)
 
void setPan (float pos)
 
float getVolume () const
 
float getPan () const
 

Static Public Member Functions

static VoiceSamplePlayerNodeRef create (const SourceFileRef &sourceFile, const Options &options=Options())
 
static VoiceRef create (const CallbackProcessorFn &callbackFn, const Options &options=Options())
 
static void clearBufferCache ()
 

Protected Member Functions

 VoiceCallbackProcessor (const CallbackProcessorFn &callbackFn, const Options &options)
 

Protected Attributes

CallbackProcessorNodeRef mNode
 

Friends

class Voice
 

Detailed Description

Concrete Voice for processing audio with a callback function.

See also
CallbackProcessorFn

Constructor & Destructor Documentation

cinder::audio::VoiceCallbackProcessor::VoiceCallbackProcessor ( const CallbackProcessorFn callbackFn,
const Options options 
)
protected

Member Function Documentation

NodeRef cinder::audio::VoiceCallbackProcessor::getInputNode ( ) const
overridevirtual

Returns the Node that is the source of this Voice's audio production. The Node type is determined by the Voice subclassed.

Implements cinder::audio::Voice.

VoiceSamplePlayerNodeRef cinder::audio::Voice::create ( const SourceFileRef sourceFile,
const Options options = Options() 
)
staticinherited

Creates a Voice that manages sample playback of an audio file pointed at with sourceFile.

VoiceRef cinder::audio::Voice::create ( const CallbackProcessorFn callbackFn,
const Options options = Options() 
)
staticinherited

Creates a Voice that continuously calls callbackFn to process a Buffer of samples.

void cinder::audio::Voice::clearBufferCache ( )
staticinherited

Clears all audio file buffers that that are cached in the Mixer.

void cinder::audio::Voice::start ( )
virtualinherited

Starts the Voice. Does nothing if currently playing.

Note
In the case of a VoiceSamplePlayerNode and the sample has reached EOF, start() will start from the beginning.

Reimplemented in cinder::audio::VoiceSamplePlayerNode.

void cinder::audio::Voice::stop ( )
virtualinherited

Stops the Voice, resetting its state to the same as when it was created.

Reimplemented in cinder::audio::VoiceSamplePlayerNode.

void cinder::audio::Voice::pause ( )
virtualinherited

Pauses the Voice inits current state. start() will resume from here.

bool cinder::audio::Voice::isPlaying ( ) const
virtualinherited

Returns whether the Voice is currently playing or not.

NodeRef cinder::audio::Voice::getOutputNode ( ) const
virtualinherited

Returns the Node that is used for connected the Voice to the greater audio graph (by default, it is connected to Context::master()).

void cinder::audio::Voice::setVolume ( float  volume)
inherited
void cinder::audio::Voice::setPan ( float  pos)
inherited
float cinder::audio::Voice::getVolume ( ) const
inherited
float cinder::audio::Voice::getPan ( ) const
inherited

Friends And Related Function Documentation

friend class Voice
friend

Member Data Documentation

CallbackProcessorNodeRef cinder::audio::VoiceCallbackProcessor::mNode
protected

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