#include <RIFF.h>
Inheritance diagram for RIFF::Chunk:
Public Member Functions | |
Chunk (int hFile, unsigned long StartPos, bool EndianNative, List *Parent) | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
int8_t | ReadInt8 () |
Reads one 8 Bit signed integer word and increments the position within the chunk. | |
uint8_t | ReadUint8 () |
Reads one 8 Bit unsigned integer word and increments the position within the chunk. | |
int16_t | ReadInt16 () |
Reads one 16 Bit signed integer word and increments the position within the chunk. | |
uint16_t | ReadUint16 () |
Reads one 16 Bit unsigned integer word and increments the position within the chunk. | |
int32_t | ReadInt32 () |
Reads one 32 Bit signed integer word and increments the position within the chunk. | |
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). | |
virtual | ~Chunk () |
Protected Member Functions | |
Chunk () | |
void | ReadHeader (unsigned long fPos) |
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 | ChunkID |
uint32_t | ChunkSize |
List * | pParent |
int | hFile |
unsigned long | ulStartPos |
unsigned long | ulPos |
bool | bEndianNative |
uint8_t * | pChunkData |
Definition at line 94 of file RIFF.h.
|
Definition at line 41 of file RIFF.cpp. References bEndianNative, Chunk(), CHUNK_HEADER_SIZE, hFile, pChunkData, pParent, ReadHeader(), ulPos, and ulStartPos. |
|
Definition at line 57 of file RIFF.cpp. References pChunkData. |
|
Definition at line 31 of file RIFF.cpp. References pChunkData, pParent, and ulPos. Referenced by Chunk(). |
|
Definition at line 165 of file RIFF.h. Referenced by GetChunkIDString(), RIFF::List::GetListTypeString(), RIFF::List::LoadSubChunks(), RIFF::List::ReadHeader(), and ReadHeader(). |
|
Definition at line 102 of file RIFF.h. References 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 ChunkID, and convertToString(). Referenced by PrintChunkList(). |
|
Position within the chunk data body.
Definition at line 106 of file RIFF.h. References ulPos, and ulStartPos. Referenced by gig::File::LoadSamples(), and DLS::File::LoadSamples(). |
|
Chunk ID in unsigned integer representation.
Definition at line 103 of file RIFF.h. References pParent. Referenced by PrintChunkList(). |
|
Chunk size in bytes (without header, thus the chunk data body).
Definition at line 105 of file RIFF.h. References 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 ChunkSize. Referenced by DLS::File::File(), 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 ChunkSize, RIFF::stream_closed, RIFF::stream_end_reached, RIFF::stream_ready, and ulPos. |
|
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 GetSize(), pChunkData, and 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 bEndianNative, ChunkSize, SetPos(), RIFF::stream_curpos, swapBytes(), swapBytes_16(), swapBytes_32(), ulPos, and ulStartPos. Referenced by DLS::Articulation::Articulation(), DLS::File::File(), DLS::Instrument::Instrument(), RIFF::List::LoadSubChunks(), gig::Sample::Read(), DLS::Sample::Read(), ReadSceptical(), DLS::Region::Region(), DLS::Resource::Resource(), gig::Sample::Sample(), and DLS::Sampler::Sampler(). |
|
Reimplemented in RIFF::List. Definition at line 61 of file RIFF.cpp. References bEndianNative, CHUNK_ID_RIFF, CHUNK_ID_RIFX, ChunkID, ChunkSize, convertToString(), and swapBytes_32(). Referenced by Chunk(), and RIFF::List::ReadHeader(). |
|
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 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 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 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 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 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 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 Read(). Referenced by ReadInt16(), ReadInt32(), ReadInt8(), ReadUint16(), ReadUint32(), and 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 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 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 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 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 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 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 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 ChunkSize, and 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 ChunkSize, RIFF::stream_backward, RIFF::stream_curpos, RIFF::stream_end, RIFF::stream_start, and ulPos. Referenced by DLS::Articulation::Articulation(), DLS::File::File(), RIFF::List::LoadSubChunks(), 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 Read(). |
|
Definition at line 143 of file RIFF.h. Referenced by Read(). |
|
Definition at line 148 of file RIFF.h. Referenced by Read(), and ReadHeader(). |
|
Definition at line 137 of file RIFF.h. Referenced by Chunk(), RIFF::File::File(), RIFF::List::LoadSubChunks(), Read(), RIFF::List::ReadHeader(), and ReadHeader(). |
|
Definition at line 127 of file RIFF.h. Referenced by RIFF::File::File(), GetChunkID(), GetChunkIDString(), and ReadHeader(). |
|
Definition at line 128 of file RIFF.h. Referenced by GetSize(), GetState(), Read(), RIFF::List::ReadHeader(), ReadHeader(), RemainingBytes(), and SetPos(). |
|
Definition at line 131 of file RIFF.h. Referenced by Chunk(). |
|
Definition at line 138 of file RIFF.h. Referenced by Chunk(), LoadChunkData(), ReleaseChunkData(), and ~Chunk(). |
|
Definition at line 129 of file RIFF.h. Referenced by Chunk(), and GetParent(). |
|
Definition at line 136 of file RIFF.h. Referenced by Chunk(), GetFilePos(), GetPos(), GetState(), RIFF::List::LoadSubChunks(), Read(), RemainingBytes(), and SetPos(). |
|
Definition at line 135 of file RIFF.h. Referenced by Chunk(), RIFF::File::File(), GetFilePos(), LoadChunkData(), RIFF::List::LoadSubChunks(), and Read(). |