CUGL 2.1
Cornell University Game Library
|
#include <CUWAVDecoder.h>
Public Member Functions | |
ADPCMDecoder () | |
virtual | ~ADPCMDecoder () |
virtual bool | init (WaveFMT *format) |
Uint64 | getFrames (Uint64 bytes) const |
Uint32 | getBlockSize () const |
virtual Sint32 | read (SDL_RWops *source, Uint8 *buffer)=0 |
Protected Attributes | |
WaveFMT | _wavefmt |
Uint8 * | _blkbuffer |
Uint16 | _blocksize |
This class represents an internal decoder for ADPCM encoded WAV files.
This decoder is a proxy decoder for ADPCM files, which are compressed. This is the abstract base class for either MS or IMA decoding. This class is for internal use and should never be instantiated by the user.
|
inline |
Creates an initialized decoder proxy
NEVER USE A CONSTRUCTOR WITH NEW. If you want to allocate an asset on the heap, use one of the static constructors instead.
|
virtual |
Deletes this decoder proxy, disposing of all resources.
|
inline |
Returns the block size of a single page
This is the size of buffer for the read methd.
|
inline |
Returns the number of frames to decompress from the given number of bytes
ADPCM decoding expands the number of frames that a group of bytes can produce. This method allows the main decoder to align with the proxy.
bytes | The number of bytes to convert |
|
virtual |
Initializes a new decoder proxy from the given WAV header.
This is an abstract method that depends on the specific ADPCM encoding. This method will fail if the header is not compatible with the appropriate encoding.
format | The WAV header |
|
pure virtual |
Reads a single page from the given file.
The buffer should be able to store block size * channels * 2 bytes of data (the latter 2 representing sizeof(Sint16) ). If the read fails, this method returns -1.
source | The source file |
buffer | The buffer to store the decoded data |
|
protected |
The buffer size for AD PCM decoding
|
protected |
The internal buffer for AD PCM decoding
|
protected |
The RIFF header