Async::AudioSink Class Reference

The base class for an audio sink. More...

#include <AsyncAudioSink.h>

Inheritance diagram for Async::AudioSink:
Async::AudioDebugger Async::AudioDelayLine Async::AudioEncoder Async::AudioFifo Async::AudioIO Async::AudioPacer Async::AudioPassthrough Async::AudioProcessor Async::AudioReader Async::AudioRecorder Async::AudioSplitter Async::AudioValve

List of all members.

Public Member Functions

Protected Member Functions


Detailed Description

The base class for an audio sink.

Author:
Tobias Blomberg
Date:
2005-04-17

This is the base class for an audio sink. An audio sink is a class that can consume audio.

Examples:

AsyncAudioIO_demo.cpp.

Definition at line 115 of file AsyncAudioSink.h.


Constructor & Destructor Documentation

Async::AudioSink::AudioSink ( void   )  [inline]

Default constuctor.

Definition at line 121 of file AsyncAudioSink.h.

virtual Async::AudioSink::~AudioSink ( void   )  [virtual]

Destructor.


Member Function Documentation

void Async::AudioSink::clearHandler ( void   )  [protected]

Clear a handler that was previously setup with setHandler.

virtual void Async::AudioSink::flushSamples ( void   )  [inline, virtual]

Tell the sink to flush the previously written samples.

This function is used to tell the sink to flush previously written samples. When done flushing, the sink should call the sourceAllSamplesFlushed function. This function is normally only called from a connected source object.

Reimplemented in Async::AudioDebugger, Async::AudioDelayLine, Async::AudioEncoder, Async::AudioFifo, Async::AudioPacer, Async::AudioPassthrough, Async::AudioProcessor, Async::AudioReader, Async::AudioRecorder, Async::AudioSplitter, Async::AudioStreamStateDetector, and Async::AudioValve.

Examples:
AsyncAudioIO_demo.cpp.

Definition at line 178 of file AsyncAudioSink.h.

References flushSamples().

Referenced by flushSamples().

AudioSink* Async::AudioSink::handler ( void   )  const [inline, protected]

Definition at line 222 of file AsyncAudioSink.h.

bool Async::AudioSink::isRegistered ( void   )  const [inline]

Check if an audio source has been registered.

Returns:
Returns true if there is an audio source registerd

Definition at line 144 of file AsyncAudioSink.h.

bool Async::AudioSink::registerSource ( AudioSource source  ) 

Register an audio source to provide samples to this sink.

Parameters:
source The audio source to use
Returns:
Returns true on success or else false
Examples:
AsyncAudioIO_demo.cpp.

Referenced by Async::AudioDebugger::AudioDebugger().

bool Async::AudioSink::setHandler ( AudioSink handler  )  [protected]

Setup another sink to handle the incoming audio.

Parameters:
handler The sink to handle the audio
Returns:
Returns true on success or else false

This function will setup another sink to handle incoming audio. This can be used when an internal object should handle the audio for this object.

AudioSource* Async::AudioSink::source ( void   )  const [inline]

Get the registered audio source.

Returns:
Returns the registered audio source if any registered or else returns 0.

Definition at line 151 of file AsyncAudioSink.h.

void Async::AudioSink::sourceAllSamplesFlushed ( void   )  [protected]

Tell the source that all samples have been flushed.

This function is called by the inheriting class to indicate that all samples have been flushed. It may only be called after a flushSamples call has been received and no more samples has been written to the sink.

Examples:
AsyncAudioIO_demo.cpp.

Referenced by Async::AudioEncoder::allEncodedSamplesFlushed(), Async::AudioValve::allSamplesFlushed(), Async::AudioPassthrough::allSamplesFlushed(), Async::AudioDebugger::allSamplesFlushed(), Async::AudioValve::flushSamples(), and Async::AudioValve::setOpen().

void Async::AudioSink::sourceResumeOutput ( void   )  [protected]
void Async::AudioSink::unregisterSource ( void   ) 

Unregister the previously registered audio source.

virtual int Async::AudioSink::writeSamples ( const float *  samples,
int  count 
) [inline, virtual]

Write samples into this audio sink.

Parameters:
samples The buffer containing the samples
count The number of samples in the buffer
Returns:
Returns the number of samples that has been taken care of

This function is used to write audio into this audio sink. If it returns 0, no more samples should be written until the resumeOutput function in the source have been called. This function is normally only called from a connected source object.

Reimplemented in Async::AudioDebugger, Async::AudioDelayLine, Async::AudioFifo, Async::AudioPacer, Async::AudioPassthrough, Async::AudioProcessor, Async::AudioReader, Async::AudioRecorder, Async::AudioSplitter, Async::AudioStreamStateDetector, and Async::AudioValve.

Examples:
AsyncAudioIO_demo.cpp.

Definition at line 164 of file AsyncAudioSink.h.

References writeSamples().

Referenced by writeSamples().


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208