Async 1.8.0
Async::AudioDecoder Class Referenceabstract

Base class for an audio decoder. More...

#include <AsyncAudioDecoder.h>

Inheritance diagram for Async::AudioDecoder:
Async::AudioSource

Public Member Functions

 AudioDecoder (void)
 Default constuctor.
 
virtual ~AudioDecoder (void)
 Destructor.
 
virtual const char * name (void) const =0
 Get the name of the codec.
 
virtual void setOption (const std::string &name, const std::string &value)
 Set an option for the decoder.
 
virtual void printCodecParams (void) const
 Print codec parameter settings.
 
virtual void writeEncodedSamples (void *buf, int size)=0
 Write encoded samples into the decoder.
 
virtual void flushEncodedSamples (void)
 Call this function when all encoded samples have been received.
 
virtual void resumeOutput (void)
 Resume audio output to the sink.
 
- 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.
 

Static Public Member Functions

static bool isAvailable (const std::string &name)
 Check if a specific decoder is available.
 
static AudioDecodercreate (const std::string &name)
 Create a new decoder of the specified type.
 

Public Attributes

sigc::signal< void > allEncodedSamplesFlushed
 This signal is emitted when all encoded samples have been flushed.
 

Protected Member Functions

virtual void allSamplesFlushed (void)
 The registered sink has flushed all samples.
 
- 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

Base class for an audio decoder.

Author
Tobias Blomberg / SM0SVX
Date
2008-10-06

This is the base class for an audio decoder.

Definition at line 113 of file AsyncAudioDecoder.h.

Constructor & Destructor Documentation

◆ AudioDecoder()

Async::AudioDecoder::AudioDecoder ( void )
inline

Default constuctor.

Definition at line 131 of file AsyncAudioDecoder.h.

◆ ~AudioDecoder()

virtual Async::AudioDecoder::~AudioDecoder ( void )
inlinevirtual

Destructor.

Definition at line 136 of file AsyncAudioDecoder.h.

Member Function Documentation

◆ allSamplesFlushed()

virtual void Async::AudioDecoder::allSamplesFlushed ( void )
inlineprotectedvirtual

The registered sink has flushed all samples.

This function will be called when all samples have been flushed in the registered sink. This function is normally only called from a connected sink object.

Reimplemented from Async::AudioSource.

Definition at line 191 of file AsyncAudioDecoder.h.

References allEncodedSamplesFlushed.

◆ create()

static AudioDecoder * Async::AudioDecoder::create ( const std::string & name)
static

Create a new decoder of the specified type.

Parameters
nameThe name of the decoder to create

◆ flushEncodedSamples()

virtual void Async::AudioDecoder::flushEncodedSamples ( void )
inlinevirtual

Call this function when all encoded samples have been received.

Definition at line 166 of file AsyncAudioDecoder.h.

References Async::AudioSource::sinkFlushSamples().

◆ isAvailable()

static bool Async::AudioDecoder::isAvailable ( const std::string & name)
static

Check if a specific decoder is available.

Parameters
nameThe name of the decoder to look for

◆ name()

virtual const char * Async::AudioDecoder::name ( void ) const
pure virtual

Get the name of the codec.

Returns
Return the name of the codec

◆ printCodecParams()

virtual void Async::AudioDecoder::printCodecParams ( void ) const
inlinevirtual

Print codec parameter settings.

Definition at line 154 of file AsyncAudioDecoder.h.

◆ resumeOutput()

virtual void Async::AudioDecoder::resumeOutput ( void )
inlinevirtual

Resume audio output to the sink.

This function will be called when the registered audio sink is ready to accept more samples. This function is normally only called from a connected sink object.

Reimplemented from Async::AudioSource.

Definition at line 175 of file AsyncAudioDecoder.h.

◆ setOption()

virtual void Async::AudioDecoder::setOption ( const std::string & name,
const std::string & value )
inlinevirtual

Set an option for the decoder.

Parameters
nameThe name of the option
valueThe value of the option

Definition at line 149 of file AsyncAudioDecoder.h.

◆ writeEncodedSamples()

virtual void Async::AudioDecoder::writeEncodedSamples ( void * buf,
int size )
pure virtual

Write encoded samples into the decoder.

Parameters
bufBuffer containing encoded samples
sizeThe size of the buffer

Member Data Documentation

◆ allEncodedSamplesFlushed

sigc::signal<void> Async::AudioDecoder::allEncodedSamplesFlushed

This signal is emitted when all encoded samples have been flushed.

Definition at line 180 of file AsyncAudioDecoder.h.

Referenced by allSamplesFlushed().


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