#include <audio.h>
Inheritance diagram for AudioCodec:
Public Member Functions | |
AudioCodec (const char *n, Encoding e) | |
virtual | ~AudioCodec () |
virtual unsigned | encode (Linear buffer, void *dest, unsigned lsamples)=0 |
Encode a linear sample frame into the codec sample buffer. | |
virtual unsigned | decode (Linear buffer, void *source, unsigned lsamples)=0 |
Decode the sample frame into linear samples. | |
Static Public Member Functions | |
static AudioCodec * | getCodec (Encoding encoding, const char *name=NULL) |
static bool | load (const char *name) |
Protected Attributes | |
AudioCodec * | next |
Encoding | encoding |
const char * | name |
Static Protected Attributes | |
static Mutex | lock |
static AudioCodec * | first |
This class is only abstract and describes the core interface for loadable codec modules. This class is normally merged with AudioSample. A derived AudioCodecXXX will typically include a AudioRegisterXXX static class to automatically initialize and register the codec with the codec registry.
AudioCodec::AudioCodec | ( | const char * | n, | |
Encoding | e | |||
) |
virtual AudioCodec::~AudioCodec | ( | ) | [inline, virtual] |
virtual unsigned AudioCodec::decode | ( | Linear | buffer, | |
void * | source, | |||
unsigned | lsamples | |||
) | [pure virtual] |
Decode the sample frame into linear samples.
buffer | sample buffer to save linear samples into. | |
source | for encoded data. | |
number | of samples to extract. |
virtual unsigned AudioCodec::encode | ( | Linear | buffer, | |
void * | dest, | |||
unsigned | lsamples | |||
) | [pure virtual] |
Encode a linear sample frame into the codec sample buffer.
number | of bytes written. | |
buffer | linear sample buffer to use. | |
dest | buffer to store encoded results. | |
lsamples | The number of linear samples. |
static AudioCodec* AudioCodec::getCodec | ( | Encoding | encoding, | |
const char * | name = NULL | |||
) | [static] |
static bool AudioCodec::load | ( | const char * | name | ) | [static] |
Encoding AudioCodec::encoding [protected] |
AudioCodec* AudioCodec::first [static, protected] |
Mutex AudioCodec::lock [static, protected] |
const char* AudioCodec::name [protected] |
AudioCodec* AudioCodec::next [protected] |