AudioCodec Class Reference

The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded "sample" buffer.process codec interface. More...

#include <audio.h>

Inheritance diagram for AudioCodec:

Audio List of all members.

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 AudioCodecgetCodec (Encoding encoding, const char *name=NULL)
static bool load (const char *name)

Protected Attributes

AudioCodecnext
Encoding encoding
const char * name

Static Protected Attributes

static Mutex lock
static AudioCodecfirst

Detailed Description

The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded "sample" buffer.process codec interface.

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.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

AudioCodec::AudioCodec ( const char *  n,
Encoding  e 
)

virtual AudioCodec::~AudioCodec (  )  [inline, virtual]


Member Function Documentation

virtual unsigned AudioCodec::decode ( Linear  buffer,
void *  source,
unsigned  lsamples 
) [pure virtual]

Decode the sample frame into linear samples.

Returns:
number of bytes scanned.
Parameters:
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.

Parameters:
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]


Member Data Documentation

Encoding AudioCodec::encoding [protected]

AudioCodec* AudioCodec::first [static, protected]

Mutex AudioCodec::lock [static, protected]

const char* AudioCodec::name [protected]

AudioCodec* AudioCodec::next [protected]


The documentation for this class was generated from the following file:
Generated on Mon Oct 23 00:09:36 2006 for ccAudio by  doxygen 1.4.7