#include <RIFF.h>
Inheritance diagram for RIFF::File:
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. | |
Chunk * | GetSubChunk (uint32_t ChunkID) |
Returns subchunk with chunk ID ChunkID within this chunk list. | |
List * | GetSubList (uint32_t ListType) |
Returns sublist chunk with list type ListType within this chunk list. | |
Chunk * | GetFirstSubChunk () |
Returns the first subchunk within the list. | |
Chunk * | GetNextSubChunk () |
Returns the next subchunk within the list. | |
List * | GetFirstSubList () |
Returns the first sublist within the list (that is a subchunk with chunk ID "LIST"). | |
List * | GetNextSubList () |
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 () |
List * | GetParent () |
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). | |
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 |
ChunkList * | pSubChunks |
ChunkMap * | pSubChunksMap |
ChunkList::iterator | ChunksIterator |
ChunkList::iterator | ListIterator |
uint32_t | ChunkID |
uint32_t | ChunkSize |
List * | pParent |
int | hFile |
unsigned long | ulStartPos |
unsigned long | ulPos |
bool | bEndianNative |
uint8_t * | pChunkData |
Definition at line 213 of file RIFF.h.
|
|
|
|
|
Definition at line 761 of file RIFF.cpp. References RIFF::Chunk::bEndianNative, CHUNK_ID_RIFF, RIFF::Chunk::ChunkID, RIFF::List::ReadHeader(), RIFF_HEADER_SIZE, and RIFF::Chunk::ulStartPos. |
|
|
|
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(). |
|
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. |
|
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(). |
|
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::GetListType(), RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunks. |
|
Returns number of sublists within the list.
Definition at line 673 of file RIFF.cpp. References CHUNK_ID_LIST, and RIFF::List::CountSubChunks(). Referenced by gig::File::LoadSamples(). |
|
Definition at line 102 of file RIFF.h. References RIFF::Chunk::ChunkID. Referenced by PrintChunkList(). |
|
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(). |
|
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(). |
|
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.
Definition at line 573 of file RIFF.cpp. References RIFF::List::ChunksIterator, RIFF::List::LoadSubChunks(), and RIFF::List::pSubChunks. Referenced by PrintChunkList(). |
|
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.
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(). |
|
Returns unsigned integer representation of the list's ID.
Definition at line 185 of file RIFF.h. References RIFF::List::ListType. Referenced by DLS::Articulation::Articulation(), RIFF::List::CountSubLists(), RIFF::List::GetSubList(), 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(). |
|
Returns string representation of the lists's id.
Definition at line 752 of file RIFF.cpp. References RIFF::Chunk::convertToString(), and RIFF::List::ListType. Referenced by main(), and PrintChunkList(). |
|
Returns the next subchunk within the list. You have to call GetFirstSubChunk() before you can use this method!
Definition at line 589 of file RIFF.cpp. References RIFF::List::ChunksIterator, and RIFF::List::pSubChunks. Referenced by PrintChunkList(). |
|
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!
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(). |
|
Chunk ID in unsigned integer representation.
Definition at line 103 of file RIFF.h. References RIFF::Chunk::pParent. Referenced by PrintChunkList(). |
|
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(). |
|
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(). |
|
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. |
|
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.
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(). |
|
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.
Definition at line 548 of file RIFF.cpp. References CHUNK_ID_LIST, RIFF::List::GetListType(), 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(). |
|
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(). |
|
|
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.
Definition at line 191 of file RIFF.cpp. References RIFF::Chunk::bEndianNative, RIFF::Chunk::ChunkSize, 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::Articulation::Articulation(), 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(). |
|
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(), RIFF::List::ListType, and RIFF::Chunk::ReadHeader(). Referenced by File(). |
|
Reads one 16 Bit signed integer word and increments the position within the chunk. Endian correction will automatically be done if needed.
Definition at line 386 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). |
|
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.
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(). |
|
Reads one 32 Bit signed integer word and increments the position within the chunk. Endian correction will automatically be done if needed.
Definition at line 420 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). |
|
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.
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(). |
|
Reads one 8 Bit signed integer word and increments the position within the chunk.
Definition at line 353 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). |
|
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.
Definition at line 244 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). Referenced by gig::DimensionRegion::DimensionRegion(). |
|
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(). |
|
Reads one 16 Bit unsigned integer word and increments the position within the chunk. Endian correction will automatically be done if needed.
Definition at line 403 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). |
|
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.
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(). |
|
Reads one 32 Bit unsigned integer word and increments the position within the chunk. Endian correction will automatically be done if needed.
Definition at line 437 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). |
|
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.
Definition at line 339 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). Referenced by DLS::Articulation::Articulation(), DLS::File::File(), DLS::Instrument::Instrument(), gig::Region::Region(), DLS::Region::Region(), DLS::Sample::Sample(), and DLS::Sampler::Sampler(). |
|
Reads one 8 Bit unsigned integer word and increments the position within the chunk.
Definition at line 369 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). |
|
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.
Definition at line 263 of file RIFF.cpp. References RIFF::Chunk::ReadSceptical(). Referenced by gig::DimensionRegion::DimensionRegion(), gig::Instrument::Instrument(), and gig::Region::Region(). |
|
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(). |
|
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.
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(). |
|
Sets the position within the chunk body, thus within the data portion of the chunk (in bytes).
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::Articulation::Articulation(), 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(). |
|
Definition at line 156 of file RIFF.h. Referenced by RIFF::Chunk::Read(). |
|
Definition at line 143 of file RIFF.h. Referenced by RIFF::Chunk::Read(). |
|
Definition at line 148 of file RIFF.h. Referenced by RIFF::Chunk::Read(), and RIFF::Chunk::ReadHeader(). |
|
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(). |
|
Definition at line 127 of file RIFF.h. Referenced by File(), RIFF::Chunk::GetChunkID(), RIFF::Chunk::GetChunkIDString(), and RIFF::Chunk::ReadHeader(). |
|
Definition at line 204 of file RIFF.h. Referenced by RIFF::List::GetFirstSubChunk(), and RIFF::List::GetNextSubChunk(). |
|
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(). |
|
Definition at line 131 of file RIFF.h. Referenced by RIFF::Chunk::Chunk(). |
|
Definition at line 205 of file RIFF.h. Referenced by RIFF::List::GetFirstSubList(), and RIFF::List::GetNextSubList(). |
|
Definition at line 201 of file RIFF.h. Referenced by RIFF::List::GetListType(), RIFF::List::GetListTypeString(), and RIFF::List::ReadHeader(). |
|
Definition at line 138 of file RIFF.h. Referenced by RIFF::Chunk::Chunk(), RIFF::Chunk::LoadChunkData(), RIFF::Chunk::ReleaseChunkData(), and RIFF::Chunk::~Chunk(). |
|
Definition at line 129 of file RIFF.h. Referenced by RIFF::Chunk::Chunk(), and RIFF::Chunk::GetParent(). |
|
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(). |
|
Definition at line 203 of file RIFF.h. Referenced by RIFF::List::GetSubChunk(), RIFF::List::List(), RIFF::List::LoadSubChunks(), and RIFF::List::~List(). |
|
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(). |
|
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(). |