Async 1.8.0
Async::AudioProcessor Class Referenceabstract

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

#include <AsyncAudioProcessor.h>

Inheritance diagram for Async::AudioProcessor:
Async::AudioSink Async::AudioSource Async::AudioAmp Async::AudioClipper Async::AudioCompressor Async::AudioDecimator Async::AudioFilter Async::AudioFsf Async::AudioInterpolator Async::AudioLADSPAPlugin Async::AudioNoiseAdder

Public Member Functions

 AudioProcessor (void)
 Default constuctor.
 
virtual ~AudioProcessor (void)
 Destructor.
 
int writeSamples (const float *samples, int len)
 Write audio to the filter.
 
void flushSamples (void)
 Order a flush of all samples.
 
void resumeOutput (void)
 Resume output to the sink if previously stopped.
 
void allSamplesFlushed (void)
 All samples have been flushed by the sink.
 
- Public Member Functions inherited from Async::AudioSink
 AudioSink (void)
 Default constuctor.
 
virtual ~AudioSink (void)
 Destructor.
 
bool registerSource (AudioSource *source)
 Register an audio source to provide samples to this sink.
 
void unregisterSource (void)
 Unregister the previously registered audio source.
 
bool isRegistered (void) const
 Check if an audio source has been registered.
 
AudioSourcesource (void) const
 Get the registered audio source.
 
- Public Member Functions inherited from Async::AudioSource
 AudioSource (void)
 Default constuctor.
 
virtual ~AudioSource (void)
 Destructor.
 
bool registerSink (AudioSink *sink, bool managed=false)
 Register an audio sink to provide samples to.
 
void unregisterSink (void)
 Unregister the previously registered audio sink.
 
bool isRegistered (void) const
 Check if an audio sink has been registered.
 
AudioSinksink (void) const
 Get the registered audio sink.
 
bool sinkManaged (void) const
 Check if the sink is managed or not.
 
void handleAllSamplesFlushed (void)
 The registered sink has flushed all samples.
 

Protected Member Functions

void setInputOutputSampleRate (int input_rate, int output_rate)
 Set the input and output sample rates.
 
virtual void processSamples (float *dest, const float *src, int count)=0
 Process incoming samples and put them into the output buffer.
 
- Protected Member Functions inherited from Async::AudioSink
void sourceResumeOutput (void)
 Tell the source that we are ready to accept more samples.
 
void sourceAllSamplesFlushed (void)
 Tell the source that all samples have been flushed.
 
bool setHandler (AudioSink *handler)
 Setup another sink to handle the incoming audio.
 
void clearHandler (void)
 Clear a handler that was previously setup with setHandler.
 
AudioSinkhandler (void) const
 
- Protected Member Functions inherited from Async::AudioSource
int sinkWriteSamples (const float *samples, int len)
 
void sinkFlushSamples (void)
 
bool setHandler (AudioSource *handler)
 Setup another source to handle the outgoing audio.
 
AudioSourcehandler (void) const
 
void clearHandler (void)
 Clear a handler that was previously setup with setHandler.
 

Detailed Description

The base class for an audio processor.

Author
Tobias Blomberg / SM0SVX
Date
2006-04-23

This class is the base class for an audio processor. An audio processor is a class that is both an audio sink and source. It receives samples, process them in some way and send them further down the chain.

Definition at line 118 of file AsyncAudioProcessor.h.

Constructor & Destructor Documentation

◆ AudioProcessor()

Async::AudioProcessor::AudioProcessor ( void )

Default constuctor.

◆ ~AudioProcessor()

virtual Async::AudioProcessor::~AudioProcessor ( void )
virtual

Destructor.

Member Function Documentation

◆ allSamplesFlushed()

void Async::AudioProcessor::allSamplesFlushed ( void )
virtual

All samples have been flushed by the sink.

Reimplemented from Async::AudioSource.

◆ flushSamples()

void Async::AudioProcessor::flushSamples ( void )
virtual

Order a flush of all samples.

Reimplemented from Async::AudioSink.

◆ processSamples()

virtual void Async::AudioProcessor::processSamples ( float * dest,
const float * src,
int count )
protectedpure virtual

Process incoming samples and put them into the output buffer.

Parameters
destDestination buffer
srcSource buffer
countNumber of samples in the source buffer

This function should be reimplemented by the inheriting class to do the actual processing of the incoming samples. All samples must be processed, otherwise they are lost and the output buffer will contain garbage.

Implemented in Async::AudioAmp, Async::AudioClipper, Async::AudioCompressor, Async::AudioDecimator, Async::AudioFilter, Async::AudioFsf, Async::AudioInterpolator, Async::AudioLADSPAPlugin, and Async::AudioNoiseAdder.

◆ resumeOutput()

void Async::AudioProcessor::resumeOutput ( void )
virtual

Resume output to the sink if previously stopped.

Reimplemented from Async::AudioSource.

◆ setInputOutputSampleRate()

void Async::AudioProcessor::setInputOutputSampleRate ( int input_rate,
int output_rate )
protected

Set the input and output sample rates.

Parameters
input_rateThe input sample rate
output_rateThe output sample rate

◆ writeSamples()

int Async::AudioProcessor::writeSamples ( const float * samples,
int len )
virtual

Write audio to the filter.

Parameters
samplesThe buffer containing the samples
lenThe number of samples in the buffer
Returns
Return the number of samples processed

Reimplemented from Async::AudioSink.


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