#include <DLS.h>
Inheritance diagram for DLS::Sample:
Public Member Functions | |
void * | LoadSampleData () |
Load sample data into RAM. Returns a pointer to the data in RAM on success, NULL otherwise. | |
void | ReleaseSampleData () |
Release the samples once you used them if you don't want to be bothered to. | |
unsigned long | SetPos (unsigned long SampleCount, RIFF::stream_whence_t Whence=RIFF::stream_start) |
Sets the position within the sample (in sample points, not in bytes). | |
unsigned long | Read (void *pBuffer, unsigned long SampleCount) |
Reads SampleCount number of sample points from the current position into the buffer pointed by pBuffer and increments the position within the sample. | |
Resource * | GetParent () |
Public Attributes | |
uint16_t | FormatTag |
Format ID of the waveform data (should be WAVE_FORMAT_PCM for DLS1 compliant files). | |
uint16_t | Channels |
Number of channels represented in the waveform data, e.g. 1 for mono, 2 for stereo (). | |
uint32_t | SamplesPerSecond |
Sampling rate at which each channel should be played. | |
uint32_t | AverageBytesPerSecond |
The average number of bytes per second at which the waveform data should be transferred (Playback software can estimate the buffer size using this value). | |
uint16_t | BlockAlign |
The block alignment (in bytes) of the waveform data. Playback software needs to process a multiple of BlockAlign bytes of data at a time, so the value of BlockAlign can be used for buffer alignment. | |
uint16_t | BitDepth |
Size of each sample per channel (only if known sample data format is used, 0 otherwise). | |
unsigned long | SamplesTotal |
Reflects total number of samples (only if known sample data format is used, 0 otherwise). | |
uint | FrameSize |
Reflects the size (in bytes) of one single sample (only if known sample data format is used, 0 otherwise). | |
Info * | pInfo |
Points (in any case) to an Info object, providing additional, optional infos and comments. | |
dlsid_t * | pDLSID |
Points to a dlsid_t structure if the file provided a DLS ID else is NULL. | |
Protected Member Functions | |
Sample (File *pFile, RIFF::List *waveList, unsigned long WavePoolOffset) | |
Protected Attributes | |
RIFF::Chunk * | pCkData |
RIFF::Chunk * | pCkFormat |
unsigned long | ulWavePoolOffset |
Resource * | pParent |
Friends | |
class | File |
class | Region |
Definition at line 375 of file DLS.h.
|
Definition at line 218 of file DLS.cpp. References AverageBytesPerSecond, BitDepth, BlockAlign, Channels, CHUNK_ID_DATA, CHUNK_ID_FMT, FormatTag, FrameSize, RIFF::Chunk::GetSize(), RIFF::List::GetSubChunk(), LIST_HEADER_SIZE, pCkData, pCkFormat, RIFF::Chunk::ReadUint16(), RIFF::Chunk::ReadUint32(), SamplesPerSecond, SamplesTotal, ulWavePoolOffset, and WAVE_FORMAT_PCM. |
|
Definition at line 350 of file DLS.h. Referenced by DLS::Region::GetSample(), and gig::Region::GetSampleFromWavePool(). |
|
Load sample data into RAM. Returns a pointer to the data in RAM on success, NULL otherwise.
Reimplemented in gig::Sample. Definition at line 246 of file DLS.cpp. References RIFF::Chunk::LoadChunkData(), and pCkData. |
|
Reads SampleCount number of sample points from the current position into the buffer pointed by pBuffer and increments the position within the sample. Use this method and SetPos() if you don't want to load the sample into RAM, thus for disk streaming.
Definition at line 279 of file DLS.cpp. References FormatTag, FrameSize, pCkData, RIFF::Chunk::Read(), and WAVE_FORMAT_PCM. |
|
Release the samples once you used them if you don't want to be bothered to.
Reimplemented in gig::Sample. Definition at line 250 of file DLS.cpp. References pCkData, and RIFF::Chunk::ReleaseChunkData(). |
|
Sets the position within the sample (in sample points, not in bytes). Use this method and Read() if you don't want to load the sample into RAM, thus for disk streaming.
Reimplemented in gig::Sample. Definition at line 262 of file DLS.cpp. References FormatTag, FrameSize, pCkData, RIFF::Chunk::SetPos(), and WAVE_FORMAT_PCM. |
|
Reimplemented in gig::Sample. |
|
Reimplemented in gig::Sample. |
|
The average number of bytes per second at which the waveform data should be transferred (Playback software can estimate the buffer size using this value).
Definition at line 380 of file DLS.h. Referenced by Sample(). |
|
Size of each sample per channel (only if known sample data format is used, 0 otherwise).
Definition at line 382 of file DLS.h. Referenced by ExtractSamples(), gig::Sample::Read(), gig::Sample::Sample(), and Sample(). |
|
The block alignment (in bytes) of the waveform data. Playback software needs to process a multiple of BlockAlign bytes of data at a time, so the value of BlockAlign can be used for buffer alignment.
Definition at line 381 of file DLS.h. Referenced by Sample(). |
|
Number of channels represented in the waveform data, e.g. 1 for mono, 2 for stereo ().
Definition at line 378 of file DLS.h. Referenced by ExtractSamples(), PrintSamples(), gig::Sample::Sample(), and Sample(). |
|
Format ID of the waveform data (should be WAVE_FORMAT_PCM for DLS1 compliant files).
|
|
Reflects the size (in bytes) of one single sample (only if known sample data format is used, 0 otherwise).
Definition at line 384 of file DLS.h. Referenced by ExtractSamples(), gig::Sample::GetPos(), gig::Sample::LoadSampleDataWithNullSamplesExtension(), Read(), Sample(), gig::Sample::SetPos(), and SetPos(). |
|
Definition at line 391 of file DLS.h. Referenced by gig::Sample::GetPos(), LoadSampleData(), gig::Sample::Read(), Read(), ReleaseSampleData(), Sample(), gig::Sample::SetPos(), and SetPos(). |
|
Definition at line 392 of file DLS.h. Referenced by Sample(). |
|
Points to a dlsid_t structure if the file provided a DLS ID else is NULL.
Definition at line 348 of file DLS.h. Referenced by DLS::Resource::Resource(), and DLS::Resource::~Resource(). |
|
Points (in any case) to an Info object, providing additional, optional infos and comments.
Definition at line 347 of file DLS.h. Referenced by ExtractSamples(), main(), PrintDimensionRegions(), PrintInstruments(), PrintRegions(), PrintSamples(), DLS::Resource::Resource(), and DLS::Resource::~Resource(). |
|
Definition at line 350 of file DLS.h. Referenced by DLS::Resource::Resource(). |
|
Sampling rate at which each channel should be played.
Definition at line 379 of file DLS.h. Referenced by ExtractSamples(), PrintDimensionRegions(), PrintRegions(), PrintSamples(), and Sample(). |
|
Reflects total number of samples (only if known sample data format is used, 0 otherwise).
Definition at line 383 of file DLS.h. Referenced by ExtractSamples(), gig::Sample::LoadSampleDataWithNullSamplesExtension(), PrintSamples(), Sample(), and gig::Sample::SetPos(). |
|
Definition at line 393 of file DLS.h. Referenced by DLS::Region::GetSample(), gig::Region::GetSampleFromWavePool(), and Sample(). |