Async 1.8.0
Async::AudioEncoder Class Referenceabstract

Base class for an audio encoder. More...

#include <AsyncAudioEncoder.h>

Inheritance diagram for Async::AudioEncoder:
Async::AudioSink

Public Member Functions

 AudioEncoder (void)
 Default constuctor.
 
 ~AudioEncoder (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 encoder.
 
virtual void printCodecParams (void)
 Print codec parameter settings.
 
void allEncodedSamplesFlushed (void)
 Call this function when all encoded samples have been flushed.
 
virtual void flushSamples (void)
 Tell the sink to flush the previously written samples.
 
- 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.
 
virtual int writeSamples (const float *samples, int count)
 Write samples into this audio sink.
 

Static Public Member Functions

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

Public Attributes

sigc::signal< void, const void *, int > writeEncodedSamples
 A signal emitted when encoded samples are available.
 
sigc::signal< void > flushEncodedSamples
 This signal is emitted when the source calls flushSamples.
 

Additional Inherited Members

- 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
 

Detailed Description

Base class for an audio encoder.

Author
Tobias Blomberg / SM0SVX
Date
2008-10-06

This is the base class for implementing an audio encoder.

Definition at line 113 of file AsyncAudioEncoder.h.

Constructor & Destructor Documentation

◆ AudioEncoder()

Async::AudioEncoder::AudioEncoder ( void )
inline

Default constuctor.

Definition at line 131 of file AsyncAudioEncoder.h.

◆ ~AudioEncoder()

Async::AudioEncoder::~AudioEncoder ( void )
inline

Destructor.

Definition at line 136 of file AsyncAudioEncoder.h.

Member Function Documentation

◆ allEncodedSamplesFlushed()

void Async::AudioEncoder::allEncodedSamplesFlushed ( void )
inline

Call this function when all encoded samples have been flushed.

Definition at line 159 of file AsyncAudioEncoder.h.

References Async::AudioSink::sourceAllSamplesFlushed().

◆ create()

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

Create a new encoder of the specified type.

Parameters
nameThe name of the encoder to create

◆ flushSamples()

virtual void Async::AudioEncoder::flushSamples ( void )
inlinevirtual

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 from Async::AudioSink.

Definition at line 169 of file AsyncAudioEncoder.h.

References flushEncodedSamples.

◆ isAvailable()

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

Check if a specific encoder is available.

Parameters
nameThe name of the encoder to look for

◆ name()

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

Get the name of the codec.

Returns
Return the name of the codec

◆ printCodecParams()

virtual void Async::AudioEncoder::printCodecParams ( void )
inlinevirtual

Print codec parameter settings.

Definition at line 154 of file AsyncAudioEncoder.h.

◆ setOption()

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

Set an option for the encoder.

Parameters
nameThe name of the option
valueThe value of the option

Definition at line 149 of file AsyncAudioEncoder.h.

Member Data Documentation

◆ flushEncodedSamples

sigc::signal<void> Async::AudioEncoder::flushEncodedSamples

This signal is emitted when the source calls flushSamples.

Definition at line 181 of file AsyncAudioEncoder.h.

Referenced by flushSamples().

◆ writeEncodedSamples

sigc::signal<void,const void *,int> Async::AudioEncoder::writeEncodedSamples

A signal emitted when encoded samples are available.

Parameters
bufBuffer containing encoded samples
sizeThe size of the buffer

Definition at line 176 of file AsyncAudioEncoder.h.


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