RIFF::File Class Reference

Parses arbitrary RIFF files and provides together with it's base classes convenient methods to walk through the RIFF tree. More...

#include <RIFF.h>

Inheritance diagram for RIFF::File:

RIFF::List RIFF::Chunk List of all members.

Public Member Functions

 File (const String &path)
virtual ~File ()
String GetListTypeString ()
 Returns string representation of the lists's id.
uint32_t GetListType ()
 Returns unsigned integer representation of the list's ID.
ChunkGetSubChunk (uint32_t ChunkID)
 Returns subchunk with chunk ID ChunkID within this chunk list.
ListGetSubList (uint32_t ListType)
 Returns sublist chunk with list type ListType within this chunk list.
ChunkGetFirstSubChunk ()
 Returns the first subchunk within the list.
ChunkGetNextSubChunk ()
 Returns the next subchunk within the list.
ListGetFirstSubList ()
 Returns the first sublist within the list (that is a subchunk with chunk ID "LIST").
ListGetNextSubList ()
 Returns the next sublist (that is a subchunk with chunk ID "LIST") within the list.
unsigned int CountSubChunks ()
 Returns number of subchunks within the list.
unsigned int CountSubChunks (uint32_t ChunkID)
 Returns number of subchunks within the list with chunk ID ChunkId.
unsigned int CountSubLists ()
 Returns number of sublists within the list.
unsigned int CountSubLists (uint32_t ListType)
 Returns number of sublists within the list with list type ListType.
String GetChunkIDString ()
 Returns the String representation of the chunk's ID (e.g.
uint32_t GetChunkID ()
ListGetParent ()
 Chunk ID in unsigned integer representation.
unsigned long GetSize ()
 Returns pointer to the chunk's parent list chunk.
unsigned long GetPos ()
 Chunk size in bytes (without header, thus the chunk data body).
unsigned long GetFilePos ()
 Position within the chunk data body.
unsigned long SetPos (unsigned long Where, stream_whence_t Whence=stream_start)
 Sets the position within the chunk body, thus within the data portion of the chunk (in bytes).
unsigned long RemainingBytes ()
 Returns the number of bytes left to read in the chunk body.
stream_state_t GetState ()
 Returns the current state of the chunk object.
unsigned long Read (void *pData, unsigned long WordCount, unsigned long WordSize)
 Reads WordCount number of data words with given WordSize and copies it into a buffer pointed by pData.
unsigned long ReadInt8 (int8_t *pData, unsigned long WordCount=1)
 Reads WordCount number of 8 Bit signed integer words and copies it into the buffer pointed by pData.
int8_t ReadInt8 ()
 Reads one 8 Bit signed integer word and increments the position within the chunk.
unsigned long ReadUint8 (uint8_t *pData, unsigned long WordCount=1)
 Reads WordCount number of 8 Bit unsigned integer words and copies it into the buffer pointed by pData.
uint8_t ReadUint8 ()
 Reads one 8 Bit unsigned integer word and increments the position within the chunk.
unsigned long ReadInt16 (int16_t *pData, unsigned long WordCount=1)
 Reads WordCount number of 16 Bit signed integer words and copies it into the buffer pointed by pData.
int16_t ReadInt16 ()
 Reads one 16 Bit signed integer word and increments the position within the chunk.
unsigned long ReadUint16 (uint16_t *pData, unsigned long WordCount=1)
 Reads WordCount number of 16 Bit unsigned integer words and copies it into the buffer pointed by pData.
uint16_t ReadUint16 ()
 Reads one 16 Bit unsigned integer word and increments the position within the chunk.
unsigned long ReadInt32 (int32_t *pData, unsigned long WordCount=1)
 Reads WordCount number of 32 Bit signed integer words and copies it into the buffer pointed by pData.
int32_t ReadInt32 ()
 Reads one 32 Bit signed integer word and increments the position within the chunk.
unsigned long ReadUint32 (uint32_t *pData, unsigned long WordCount=1)
 Reads WordCount number of 32 Bit unsigned integer words and copies it into the buffer pointed by pData.
uint32_t ReadUint32 ()
 Reads one 32 Bit unsigned integer word and increments the position within the chunk.
void * LoadChunkData ()
 Load the whole chunk body in memory (on success returns a pointer to the data in RAM, else NULL).
void ReleaseChunkData ()
 Free loaded chunk body data from memory (RAM).

Public Attributes

const String Filename

Protected Types

typedef std::map< uint32_t,
RIFF::Chunk * > 
ChunkMap
typedef std::list< Chunk * > ChunkList

Protected Member Functions

void ReadHeader (unsigned long fPos)
void LoadSubChunks ()
unsigned long ReadSceptical (void *pData, unsigned long WordCount, unsigned long WordSize)
 Just an internal wrapper for the main Read() method with additional Exception throwing on errors.
void swapBytes_16 (void *Word)
void swapBytes_32 (void *Word)
void swapBytes (void *Word, unsigned long WordSize)
String convertToString (uint32_t word)

Protected Attributes

uint32_t ListType
ChunkListpSubChunks
ChunkMappSubChunksMap
ChunkList::iterator ChunksIterator
ChunkList::iterator ListIterator
uint32_t ChunkID
uint32_t ChunkSize
ListpParent
int hFile
unsigned long ulStartPos
unsigned long ulPos
bool bEndianNative
uint8_t * pChunkData

Detailed Description

Parses arbitrary RIFF files and provides together with it's base classes convenient methods to walk through the RIFF tree.

Definition at line 213 of file RIFF.h.


Member Typedef Documentation

typedef std::list<Chunk*> RIFF::List::ChunkList [protected, inherited]
 

Definition at line 199 of file RIFF.h.

typedef std::map<uint32_t, RIFF::Chunk*> RIFF::List::ChunkMap [protected, inherited]
 

Definition at line 198 of file RIFF.h.


Constructor & Destructor Documentation

RIFF::File::File const String path  ) 
 

Definition at line 761 of file RIFF.cpp.

References RIFF::Chunk::bEndianNative, CHUNK_ID_RIFF, RIFF::List::ReadHeader(), RIFF_HEADER_SIZE, and RIFF::Chunk::ulStartPos.

RIFF::File::~File  )  [virtual]
 

Definition at line 783 of file RIFF.cpp.


Member Function Documentation

String RIFF::Chunk::convertToString uint32_t  word  )  [inline, protected, inherited]
 

Definition at line 165 of file RIFF.h.

Referenced by RIFF::Chunk::GetChunkIDString(), RIFF::List::GetListTypeString(), RIFF::List::LoadSubChunks(), RIFF::List::ReadHeader(), and RIFF::Chunk::ReadHeader().

unsigned int RIFF::List::CountSubChunks uint32_t  ChunkID  )  [inherited]
 

Returns number of subchunks within the list with chunk ID ChunkId.

Definition at line 656 of file RIFF.cpp.

References RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunks.

unsigned int RIFF::List::CountSubChunks  )  [inherited]
 

Returns number of subchunks within the list.

Definition at line 647 of file RIFF.cpp.

References RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunks.

Referenced by RIFF::List::CountSubLists().

unsigned int RIFF::List::CountSubLists uint32_t  ListType  )  [inherited]
 

Returns number of sublists within the list with list type ListType.

Definition at line 681 of file RIFF.cpp.

References CHUNK_ID_LIST, RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunks.

unsigned int RIFF::List::CountSubLists  )  [inherited]
 

Returns number of sublists within the list.

Definition at line 673 of file RIFF.cpp.

References CHUNK_ID_LIST, and RIFF::List::CountSubChunks().

uint32_t RIFF::Chunk::GetChunkID  )  [inline, inherited]
 

Definition at line 102 of file RIFF.h.

References RIFF::Chunk::ChunkID.

Referenced by PrintChunkList().

String RIFF::Chunk::GetChunkIDString  )  [inherited]
 

Returns the String representation of the chunk's ID (e.g.

"RIFF", "LIST").

Definition at line 100 of file RIFF.cpp.

References RIFF::Chunk::ChunkID, and RIFF::Chunk::convertToString().

Referenced by PrintChunkList().

unsigned long RIFF::Chunk::GetFilePos  )  [inline, inherited]
 

Position within the chunk data body.

Definition at line 106 of file RIFF.h.

References RIFF::Chunk::ulPos, and RIFF::Chunk::ulStartPos.

Referenced by gig::File::LoadSamples(), and DLS::File::LoadSamples().

Chunk * RIFF::List::GetFirstSubChunk  )  [inherited]
 

Returns the first subchunk within the list.

You have to call this method before you can call GetNextSubChunk(). Recall it when you want to start from the beginning of the list again.

Returns:
pointer to the first subchunk within the list, NULL otherwise

Definition at line 573 of file RIFF.cpp.

References RIFF::List::ChunksIterator, RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunks.

Referenced by PrintChunkList().

List * RIFF::List::GetFirstSubList  )  [inherited]
 

Returns the first sublist within the list (that is a subchunk with chunk ID "LIST").

You have to call this method before you can call GetNextSubList(). Recall it when you want to start from the beginning of the list again.

Returns:
pointer to the first sublist within the list, NULL otherwise

Definition at line 607 of file RIFF.cpp.

References CHUNK_ID_LIST, RIFF::List::ListIterator, RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunks.

Referenced by gig::Instrument::Instrument(), DLS::Articulator::LoadArticulations(), gig::Region::LoadDimensionRegions(), gig::File::LoadInstruments(), DLS::File::LoadInstruments(), DLS::Instrument::LoadRegions(), gig::File::LoadSamples(), and DLS::File::LoadSamples().

uint32_t RIFF::List::GetListType  )  [inline, inherited]
 

Returns unsigned integer representation of the list's ID.

Definition at line 185 of file RIFF.h.

Referenced by DLS::Articulation::Articulation(), gig::Instrument::Instrument(), DLS::Articulator::LoadArticulations(), gig::Region::LoadDimensionRegions(), gig::File::LoadInstruments(), DLS::File::LoadInstruments(), gig::File::LoadSamples(), and DLS::File::LoadSamples().

String RIFF::List::GetListTypeString  )  [inherited]
 

Returns string representation of the lists's id.

Definition at line 752 of file RIFF.cpp.

References RIFF::Chunk::convertToString().

Referenced by main().

Chunk * RIFF::List::GetNextSubChunk  )  [inherited]
 

Returns the next subchunk within the list.

You have to call GetFirstSubChunk() before you can use this method!

Returns:
pointer to the next subchunk within the list or NULL if end of list is reached

Definition at line 589 of file RIFF.cpp.

References RIFF::List::ChunksIterator, and RIFF::List::pSubChunks.

List * RIFF::List::GetNextSubList  )  [inherited]
 

Returns the next sublist (that is a subchunk with chunk ID "LIST") within the list.

You have to call GetFirstSubList() before you can use this method!

Returns:
pointer to the next sublist within the list, NULL if end of list is reached

Definition at line 629 of file RIFF.cpp.

References CHUNK_ID_LIST, RIFF::List::ListIterator, and RIFF::List::pSubChunks.

Referenced by gig::Instrument::Instrument(), DLS::Articulator::LoadArticulations(), gig::Region::LoadDimensionRegions(), gig::File::LoadInstruments(), DLS::File::LoadInstruments(), DLS::Instrument::LoadRegions(), gig::File::LoadSamples(), and DLS::File::LoadSamples().

List* RIFF::Chunk::GetParent  )  [inline, inherited]
 

Chunk ID in unsigned integer representation.

Definition at line 103 of file RIFF.h.

References RIFF::Chunk::pParent.

Referenced by PrintChunkList().

unsigned long RIFF::Chunk::GetPos  )  [inline, inherited]
 

Chunk size in bytes (without header, thus the chunk data body).

Definition at line 105 of file RIFF.h.

References RIFF::Chunk::ulPos.

Referenced by gig::Sample::GetPos(), and RIFF::List::LoadSubChunks().

unsigned long RIFF::Chunk::GetSize  )  [inline, inherited]
 

Returns pointer to the chunk's parent list chunk.

Definition at line 104 of file RIFF.h.

References RIFF::Chunk::ChunkSize.

Referenced by DLS::File::File(), RIFF::Chunk::LoadChunkData(), RIFF::List::LoadSubChunks(), main(), PrintChunkList(), and DLS::Sample::Sample().

stream_state_t RIFF::Chunk::GetState  )  [inherited]
 

Returns the current state of the chunk object.

Following values are possible:

Definition at line 163 of file RIFF.cpp.

References RIFF::Chunk::ChunkSize, RIFF::stream_closed, RIFF::stream_end_reached, RIFF::stream_ready, and RIFF::Chunk::ulPos.

Chunk * RIFF::List::GetSubChunk uint32_t  ChunkID  )  [inherited]
 

Returns subchunk with chunk ID ChunkID within this chunk list.

Use this method if you expect only one subchunk of that type in the list. It there are more than one, it's undetermined which one of them will be returned! If there are no subchunks with that desired chunk ID, NULL will be returned.

Parameters:
ChunkID - chunk ID of the sought subchunk
Returns:
pointer to the subchunk or NULL if there is none of that ID

Definition at line 529 of file RIFF.cpp.

References RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunksMap.

Referenced by gig::DimensionRegion::DimensionRegion(), DLS::File::File(), gig::Instrument::Instrument(), DLS::Instrument::Instrument(), gig::Region::Region(), DLS::Region::Region(), DLS::Resource::Resource(), gig::Sample::Sample(), DLS::Sample::Sample(), and DLS::Sampler::Sampler().

List * RIFF::List::GetSubList uint32_t  ListType  )  [inherited]
 

Returns sublist chunk with list type ListType within this chunk list.

Use this method if you expect only one sublist chunk of that type in the list. It there are more than one, it's undetermined which one of them will be returned! If there are no sublists with that desired list type, NULL will be returned.

Parameters:
ListType - list type of the sought sublist
Returns:
pointer to the sublist or NULL if there is none of that type

Definition at line 548 of file RIFF.cpp.

References CHUNK_ID_LIST, RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunks.

Referenced by DLS::Info::Info(), gig::Instrument::Instrument(), DLS::Articulator::LoadArticulations(), gig::Region::LoadDimensionRegions(), gig::File::LoadInstruments(), DLS::File::LoadInstruments(), DLS::Instrument::LoadRegions(), gig::File::LoadSamples(), and DLS::File::LoadSamples().

void * RIFF::Chunk::LoadChunkData  )  [inherited]
 

Load the whole chunk body in memory (on success returns a pointer to the data in RAM, else NULL).

Definition at line 446 of file RIFF.cpp.

References RIFF::Chunk::GetSize(), RIFF::Chunk::pChunkData, and RIFF::Chunk::ulStartPos.

Referenced by DLS::Sample::LoadSampleData().

void RIFF::List::LoadSubChunks  )  [protected, inherited]
 

Definition at line 717 of file RIFF.cpp.

References RIFF::Chunk::bEndianNative, CHUNK_HEADER_SIZE, CHUNK_ID_LIST, RIFF::Chunk::convertToString(), RIFF::Chunk::GetPos(), RIFF::Chunk::GetSize(), LIST_HEADER_SIZE, RIFF::List::pSubChunks, RIFF::List::pSubChunksMap, RIFF::Chunk::Read(), RIFF::Chunk::RemainingBytes(), RIFF::Chunk::SetPos(), RIFF::stream_curpos, RIFF::Chunk::ulPos, and RIFF::Chunk::ulStartPos.

Referenced by RIFF::List::CountSubChunks(), RIFF::List::CountSubLists(), RIFF::List::GetFirstSubChunk(), RIFF::List::GetFirstSubList(), RIFF::List::GetSubChunk(), and RIFF::List::GetSubList().

unsigned long RIFF::Chunk::Read void *  pData,
unsigned long  WordCount,
unsigned long  WordSize
[inherited]
 

Reads WordCount number of data words with given WordSize and copies it into a buffer pointed by pData.

The buffer has to be allocated and be sure to provide the correct WordSize, as this will be important and taken into account for eventual endian correction (swapping of bytes due to different native byte order of a system). The position within the chunk will automatically be incremented.

Parameters:
pData destination buffer
WordCount number of data words to read
WordSize size of each data word to read
Returns:
number of successfully read data words or 0 if end of file reached or error occured

Definition at line 191 of file RIFF.cpp.

References RIFF::Chunk::bEndianNative, RIFF::Chunk::ChunkSize, POSIX, RIFF::Chunk::SetPos(), RIFF::stream_curpos, RIFF::Chunk::swapBytes(), RIFF::Chunk::swapBytes_16(), RIFF::Chunk::swapBytes_32(), RIFF::Chunk::ulPos, and RIFF::Chunk::ulStartPos.

Referenced by DLS::File::File(), DLS::Instrument::Instrument(), RIFF::List::LoadSubChunks(), gig::Sample::Read(), DLS::Sample::Read(), RIFF::Chunk::ReadSceptical(), DLS::Region::Region(), DLS::Resource::Resource(), gig::Sample::Sample(), and DLS::Sampler::Sampler().

void RIFF::List::ReadHeader unsigned long  fPos  )  [protected, inherited]
 

Reimplemented from RIFF::Chunk.

Definition at line 696 of file RIFF.cpp.

References RIFF::Chunk::bEndianNative, CHUNK_HEADER_SIZE, RIFF::Chunk::ChunkSize, RIFF::Chunk::convertToString(), and RIFF::Chunk::ReadHeader().

Referenced by File().

int16_t RIFF::Chunk::ReadInt16  )  [inherited]
 

Reads one 16 Bit signed integer word and increments the position within the chunk.

Endian correction will automatically be done if needed.

Returns:
read integer word
Exceptions:
RIFF::Exception if an error occured

Definition at line 386 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

unsigned long RIFF::Chunk::ReadInt16 int16_t *  pData,
unsigned long  WordCount = 1
[inherited]
 

Reads WordCount number of 16 Bit signed integer words and copies it into the buffer pointed by pData.

The buffer has to be allocated. Endian correction will automatically be done if needed. The position within the chunk will automatically be incremented.

Parameters:
pData destination buffer
WordCount number of 16 Bit signed integers to read
Returns:
number of read integers
Exceptions:
RIFF::Exception if an error occured or less than WordCount integers could be read!

Definition at line 282 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

Referenced by gig::DimensionRegion::DimensionRegion(), gig::Instrument::Instrument(), gig::Sample::Sample(), and DLS::Sampler::Sampler().

int32_t RIFF::Chunk::ReadInt32  )  [inherited]
 

Reads one 32 Bit signed integer word and increments the position within the chunk.

Endian correction will automatically be done if needed.

Returns:
read integer word
Exceptions:
RIFF::Exception if an error occured

Definition at line 420 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

unsigned long RIFF::Chunk::ReadInt32 int32_t *  pData,
unsigned long  WordCount = 1
[inherited]
 

Reads WordCount number of 32 Bit signed integer words and copies it into the buffer pointed by pData.

The buffer has to be allocated. Endian correction will automatically be done if needed. The position within the chunk will automatically be incremented.

Parameters:
pData destination buffer
WordCount number of 32 Bit signed integers to read
Returns:
number of read integers
Exceptions:
RIFF::Exception if an error occured or less than WordCount integers could be read!

Definition at line 320 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

Referenced by gig::DimensionRegion::DimensionRegion(), gig::Instrument::Instrument(), gig::Sample::Sample(), and DLS::Sampler::Sampler().

int8_t RIFF::Chunk::ReadInt8  )  [inherited]
 

Reads one 8 Bit signed integer word and increments the position within the chunk.

Returns:
read integer word
Exceptions:
RIFF::Exception if an error occured

Definition at line 353 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

unsigned long RIFF::Chunk::ReadInt8 int8_t *  pData,
unsigned long  WordCount = 1
[inherited]
 

Reads WordCount number of 8 Bit signed integer words and copies it into the buffer pointed by pData.

The buffer has to be allocated. The position within the chunk will automatically be incremented.

Parameters:
pData destination buffer
WordCount number of 8 Bit signed integers to read
Returns:
number of read integers
Exceptions:
RIFF::Exception if an error occured or less than WordCount integers could be read!

Definition at line 244 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

Referenced by gig::DimensionRegion::DimensionRegion().

unsigned long RIFF::Chunk::ReadSceptical void *  pData,
unsigned long  WordCount,
unsigned long  WordSize
[protected, inherited]
 

Just an internal wrapper for the main Read() method with additional Exception throwing on errors.

Definition at line 227 of file RIFF.cpp.

References RIFF::Chunk::Read().

Referenced by RIFF::Chunk::ReadInt16(), RIFF::Chunk::ReadInt32(), RIFF::Chunk::ReadInt8(), RIFF::Chunk::ReadUint16(), RIFF::Chunk::ReadUint32(), and RIFF::Chunk::ReadUint8().

uint16_t RIFF::Chunk::ReadUint16  )  [inherited]
 

Reads one 16 Bit unsigned integer word and increments the position within the chunk.

Endian correction will automatically be done if needed.

Returns:
read integer word
Exceptions:
RIFF::Exception if an error occured

Definition at line 403 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

unsigned long RIFF::Chunk::ReadUint16 uint16_t *  pData,
unsigned long  WordCount = 1
[inherited]
 

Reads WordCount number of 16 Bit unsigned integer words and copies it into the buffer pointed by pData.

The buffer has to be allocated. Endian correction will automatically be done if needed. The position within the chunk will automatically be incremented.

Parameters:
pData destination buffer
WordCount number of 8 Bit unsigned integers to read
Returns:
number of read integers
Exceptions:
RIFF::Exception if an error occured or less than WordCount integers could be read!

Definition at line 301 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

Referenced by gig::DimensionRegion::DimensionRegion(), gig::Instrument::Instrument(), DLS::Region::Region(), DLS::Sample::Sample(), and DLS::Sampler::Sampler().

uint32_t RIFF::Chunk::ReadUint32  )  [inherited]
 

Reads one 32 Bit unsigned integer word and increments the position within the chunk.

Endian correction will automatically be done if needed.

Returns:
read integer word
Exceptions:
RIFF::Exception if an error occured

Definition at line 437 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

unsigned long RIFF::Chunk::ReadUint32 uint32_t *  pData,
unsigned long  WordCount = 1
[inherited]
 

Reads WordCount number of 32 Bit unsigned integer words and copies it into the buffer pointed by pData.

The buffer has to be allocated. Endian correction will automatically be done if needed. The position within the chunk will automatically be incremented.

Parameters:
pData destination buffer
WordCount number of 32 Bit unsigned integers to read
Returns:
number of read integers
Exceptions:
RIFF::Exception if an error occured or less than WordCount integers could be read!

Definition at line 339 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

Referenced by DLS::File::File(), DLS::Instrument::Instrument(), gig::Region::Region(), DLS::Region::Region(), DLS::Sample::Sample(), and DLS::Sampler::Sampler().

uint8_t RIFF::Chunk::ReadUint8  )  [inherited]
 

Reads one 8 Bit unsigned integer word and increments the position within the chunk.

Returns:
read integer word
Exceptions:
RIFF::Exception if an error occured

Definition at line 369 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

unsigned long RIFF::Chunk::ReadUint8 uint8_t *  pData,
unsigned long  WordCount = 1
[inherited]
 

Reads WordCount number of 8 Bit unsigned integer words and copies it into the buffer pointed by pData.

The buffer has to be allocated. The position within the chunk will automatically be incremented.

Parameters:
pData destination buffer
WordCount number of 8 Bit unsigned integers to read
Returns:
number of read integers
Exceptions:
RIFF::Exception if an error occured or less than WordCount integers could be read!

Definition at line 263 of file RIFF.cpp.

References RIFF::Chunk::ReadSceptical().

Referenced by gig::DimensionRegion::DimensionRegion(), gig::Instrument::Instrument(), and gig::Region::Region().

void RIFF::Chunk::ReleaseChunkData  )  [inherited]
 

Free loaded chunk body data from memory (RAM).

Definition at line 467 of file RIFF.cpp.

References RIFF::Chunk::pChunkData.

Referenced by DLS::Sample::ReleaseSampleData().

unsigned long RIFF::Chunk::RemainingBytes  )  [inherited]
 

Returns the number of bytes left to read in the chunk body.

When reading data from the chunk using the Read*() Methods, the position within the chunk data (that is the chunk body) will be incremented by the number of read bytes and RemainingBytes() returns how much data is left to read from the current position to the end of the chunk data.

Returns:
number of bytes left to read

Definition at line 145 of file RIFF.cpp.

References RIFF::Chunk::ChunkSize, and RIFF::Chunk::ulPos.

Referenced by RIFF::List::LoadSubChunks(), gig::Sample::Read(), and DLS::Region::Region().

unsigned long RIFF::Chunk::SetPos unsigned long  Where,
stream_whence_t  Whence = stream_start
[inherited]
 

Sets the position within the chunk body, thus within the data portion of the chunk (in bytes).

Parameters:
Where - position offset (in bytes)
Whence - optional: defines to what Where relates to, if omitted Where relates to beginning of the chunk data

Definition at line 113 of file RIFF.cpp.

References RIFF::Chunk::ChunkSize, RIFF::stream_backward, RIFF::stream_curpos, RIFF::stream_end, RIFF::stream_start, and RIFF::Chunk::ulPos.

Referenced by DLS::File::File(), RIFF::List::LoadSubChunks(), RIFF::Chunk::Read(), gig::Sample::Read(), gig::Region::Region(), gig::Sample::Sample(), DLS::Sampler::Sampler(), gig::Sample::SetPos(), and DLS::Sample::SetPos().

void RIFF::Chunk::swapBytes void *  Word,
unsigned long  WordSize
[inline, protected, inherited]
 

Definition at line 156 of file RIFF.h.

Referenced by RIFF::Chunk::Read().

void RIFF::Chunk::swapBytes_16 void *  Word  )  [inline, protected, inherited]
 

Definition at line 143 of file RIFF.h.

Referenced by RIFF::Chunk::Read().

void RIFF::Chunk::swapBytes_32 void *  Word  )  [inline, protected, inherited]
 

Definition at line 148 of file RIFF.h.

Referenced by RIFF::Chunk::Read(), and RIFF::Chunk::ReadHeader().


Member Data Documentation

bool RIFF::Chunk::bEndianNative [protected, inherited]
 

Definition at line 137 of file RIFF.h.

Referenced by RIFF::Chunk::Chunk(), File(), RIFF::List::LoadSubChunks(), RIFF::Chunk::Read(), RIFF::List::ReadHeader(), and RIFF::Chunk::ReadHeader().

uint32_t RIFF::Chunk::ChunkID [protected, inherited]
 

Definition at line 127 of file RIFF.h.

Referenced by RIFF::Chunk::GetChunkID(), RIFF::Chunk::GetChunkIDString(), and RIFF::Chunk::ReadHeader().

ChunkList::iterator RIFF::List::ChunksIterator [protected, inherited]
 

Definition at line 204 of file RIFF.h.

Referenced by RIFF::List::GetFirstSubChunk(), and RIFF::List::GetNextSubChunk().

uint32_t RIFF::Chunk::ChunkSize [protected, inherited]
 

Definition at line 128 of file RIFF.h.

Referenced by RIFF::Chunk::GetSize(), RIFF::Chunk::GetState(), RIFF::Chunk::Read(), RIFF::List::ReadHeader(), RIFF::Chunk::ReadHeader(), RIFF::Chunk::RemainingBytes(), and RIFF::Chunk::SetPos().

const String RIFF::File::Filename
 

Definition at line 217 of file RIFF.h.

Referenced by gig::File::LoadSamples().

int RIFF::Chunk::hFile [protected, inherited]
 

Definition at line 131 of file RIFF.h.

Referenced by RIFF::Chunk::Chunk().

ChunkList::iterator RIFF::List::ListIterator [protected, inherited]
 

Definition at line 205 of file RIFF.h.

Referenced by RIFF::List::GetFirstSubList(), and RIFF::List::GetNextSubList().

uint32_t RIFF::List::ListType [protected, inherited]
 

Definition at line 201 of file RIFF.h.

uint8_t* RIFF::Chunk::pChunkData [protected, inherited]
 

Definition at line 138 of file RIFF.h.

Referenced by RIFF::Chunk::Chunk(), RIFF::Chunk::LoadChunkData(), RIFF::Chunk::ReleaseChunkData(), and RIFF::Chunk::~Chunk().

List* RIFF::Chunk::pParent [protected, inherited]
 

Definition at line 129 of file RIFF.h.

Referenced by RIFF::Chunk::Chunk(), and RIFF::Chunk::GetParent().

ChunkList* RIFF::List::pSubChunks [protected, inherited]
 

Definition at line 202 of file RIFF.h.

Referenced by RIFF::List::CountSubChunks(), RIFF::List::CountSubLists(), RIFF::List::GetFirstSubChunk(), RIFF::List::GetFirstSubList(), RIFF::List::GetNextSubChunk(), RIFF::List::GetNextSubList(), RIFF::List::GetSubList(), RIFF::List::List(), RIFF::List::LoadSubChunks(), and RIFF::List::~List().

ChunkMap* RIFF::List::pSubChunksMap [protected, inherited]
 

Definition at line 203 of file RIFF.h.

Referenced by RIFF::List::GetSubChunk(), RIFF::List::List(), RIFF::List::LoadSubChunks(), and RIFF::List::~List().

unsigned long RIFF::Chunk::ulPos [protected, inherited]
 

Definition at line 136 of file RIFF.h.

Referenced by RIFF::Chunk::Chunk(), RIFF::Chunk::GetFilePos(), RIFF::Chunk::GetPos(), RIFF::Chunk::GetState(), RIFF::List::LoadSubChunks(), RIFF::Chunk::Read(), RIFF::Chunk::RemainingBytes(), and RIFF::Chunk::SetPos().

unsigned long RIFF::Chunk::ulStartPos [protected, inherited]
 

Definition at line 135 of file RIFF.h.

Referenced by RIFF::Chunk::Chunk(), File(), RIFF::Chunk::GetFilePos(), RIFF::Chunk::LoadChunkData(), RIFF::List::LoadSubChunks(), and RIFF::Chunk::Read().


The documentation for this class was generated from the following files:
Generated on Wed Nov 23 12:09:14 2005 for libgig by  doxygen 1.4.5