#include <gig.h>
Inheritance diagram for gig::File:
Public Member Functions | |
File () | |
Constructor. | |
File (RIFF::File *pRIFF) | |
Constructor. | |
Sample * | GetFirstSample (progress_t *pProgress=NULL) |
Returns a pointer to the first Sample object of the file, NULL otherwise. | |
Sample * | GetNextSample () |
Returns a pointer to the next Sample object of the file, NULL otherwise. | |
Sample * | AddSample () |
Add a new sample. | |
void | DeleteSample (Sample *pSample) |
Delete a sample. | |
Instrument * | GetFirstInstrument () |
Returns a pointer to the first Instrument object of the file, NULL otherwise. | |
Instrument * | GetNextInstrument () |
Returns a pointer to the next Instrument object of the file, NULL otherwise. | |
Instrument * | GetInstrument (uint index, progress_t *pProgress=NULL) |
Returns the instrument with the given index. | |
Instrument * | AddInstrument () |
Add a new instrument definition. | |
void | DeleteInstrument (Instrument *pInstrument) |
Delete an instrument. | |
Group * | GetFirstGroup () |
Returns a pointer to the first Group object of the file, NULL otherwise. | |
Group * | GetNextGroup () |
Returns a pointer to the next Group object of the file, NULL otherwise. | |
Group * | GetGroup (uint index) |
Returns the group with the given index. | |
Group * | AddGroup () |
void | DeleteGroup (Group *pGroup) |
Delete a group and its samples. | |
void | DeleteGroupOnly (Group *pGroup) |
Delete a group. | |
virtual | ~File () |
virtual void | UpdateChunks () |
Apply all the gig file's current instruments, samples, groups and settings to the respective RIFF chunks. | |
Static Public Attributes | |
static const DLS::version_t | VERSION_2 |
Reflects Gigasampler file format version 2.0 (1998-06-28). | |
static const DLS::version_t | VERSION_3 |
Reflects Gigasampler file format version 3.0 (2003-03-31). | |
Protected Types | |
typedef std::list< Sample * > | SampleList |
typedef std::list< Instrument * > | InstrumentList |
Protected Member Functions | |
virtual void | LoadSamples () |
virtual void | LoadInstruments () |
virtual void | LoadGroups () |
virtual void | LoadSamples (progress_t *pProgress) |
virtual void | LoadInstruments (progress_t *pProgress) |
void | SetSampleChecksum (Sample *pSample, uint32_t crc) |
Updates the 3crc chunk with the checksum of a sample. | |
Sample * | GetFirstSample () |
Returns a pointer to the first Sample object of the file, NULL otherwise. | |
void | DeleteSample (Sample *pSample) |
Delete a sample. | |
void | DeleteInstrument (Instrument *pInstrument) |
Delete an instrument. | |
virtual void | Save (const String &Path) |
Save changes to another file. | |
virtual void | Save () |
Save changes to same file. | |
void | __ensureMandatoryChunksExist () |
Checks if all (for DLS) mandatory chunks exist, if not they will be created. | |
Resource * | GetParent () |
void | GenerateDLSID () |
Generates a new DLSID for the resource. | |
Protected Attributes | |
version_t * | pVersion |
Points to a version_t structure if the file provided a version number else is set to NULL. | |
uint32_t | Instruments |
Reflects the number of available Instrument objects. | |
RIFF::File * | pRIFF |
std::list< RIFF::File * > | ExtensionFiles |
SampleList * | pSamples |
SampleList::iterator | SamplesIterator |
InstrumentList * | pInstruments |
InstrumentList::iterator | InstrumentsIterator |
uint32_t | WavePoolHeaderSize |
uint32_t | WavePoolCount |
uint32_t * | pWavePoolTable |
uint32_t * | pWavePoolTableHi |
bool | b64BitWavePoolOffsets |
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. | |
Resource * | pParent |
RIFF::List * | pResourceList |
Friends | |
class | Region |
class | Sample |
class | Group |
Definition at line 718 of file gig.h.
|
|
|
|
|
Constructor. Default constructor, use this to create an empty DLS file. You have to add samples, instruments and finally call Save() to actually write a DLS file. Reimplemented from DLS::File. Definition at line 3261 of file gig.cpp. References RIFF::List::AddSubChunk(), CHUNK_ID_COLH, CHUNK_ID_DLID, CHUNK_ID_VERS, DLS::Resource::GenerateDLSID(), DLS::Resource::pInfo, DLS::File::pRIFF, DLS::File::pVersion, and VERSION_3. |
|
Constructor. Load an existing DLS file.
Reimplemented from DLS::File. Definition at line 3276 of file gig.cpp. References DLS::Resource::pInfo. |
|
Reimplemented from DLS::File. |
|
Checks if all (for DLS) mandatory chunks exist, if not they will be created. Note that those chunks will not be made persistent until Save() was called. Definition at line 1532 of file DLS.cpp. References RIFF::List::AddSubChunk(), RIFF::List::AddSubList(), DLS::File::b64BitWavePoolOffsets, CHUNK_ID_PTBL, RIFF::List::GetSubChunk(), RIFF::List::GetSubList(), LIST_TYPE_LINS, LIST_TYPE_WVPL, DLS::File::pRIFF, and DLS::File::WavePoolHeaderSize. Referenced by AddGroup(), AddInstrument(), DLS::File::AddInstrument(), AddSample(), and DLS::File::AddSample(). |
|
Definition at line 3601 of file gig.cpp. References DLS::File::__ensureMandatoryChunksExist(), Group, and LoadGroups(). |
|
Add a new instrument definition. This will create a new Instrument object for the gig file. You have to call Save() to make this persistent to the file.
Reimplemented from DLS::File. Definition at line 3478 of file gig.cpp. References DLS::File::__ensureMandatoryChunksExist(), RIFF::List::AddSubChunk(), RIFF::List::AddSubList(), CHUNK_ID_DLID, CHUNK_ID_INSH, DLS::Resource::GenerateDLSID(), RIFF::List::GetSubList(), LIST_TYPE_INFO, LIST_TYPE_INS, LIST_TYPE_LINS, LoadInstruments(), DLS::Resource::pInfo, DLS::File::pInstruments, and DLS::File::pRIFF. |
|
Add a new sample. This will create a new Sample object for the gig file. You have to call Save() to make this persistent to the file.
Reimplemented from DLS::File. Definition at line 3313 of file gig.cpp. References DLS::File::__ensureMandatoryChunksExist(), RIFF::List::AddSubChunk(), RIFF::List::AddSubList(), CHUNK_ID_FMT, RIFF::List::GetSubList(), LIST_TYPE_INFO, LIST_TYPE_WAVE, LIST_TYPE_WVPL, LoadSamples(), DLS::File::pRIFF, DLS::File::pSamples, and Sample. |
|
Delete a group and its samples. This will delete the given Group object and all the samples that belong to this group from the gig file. You have to call Save() to make this persistent to the file.
Definition at line 3619 of file gig.cpp. References DeleteSample(), gig::Group::GetFirstSample(), gig::Group::GetNextSample(), and LoadGroups(). |
|
Delete a group. This will delete the given Group object from the gig file. All the samples that belong to this group will not be deleted, but instead be moved to another group. You have to call Save() to make this persistent to the file.
Definition at line 3643 of file gig.cpp. References LoadGroups(), and gig::Group::MoveAll(). |
|
Delete an instrument. This will delete the given Instrument object from the DLS file. You have to call Save() to make this persistent to the file.
Definition at line 1424 of file DLS.cpp. References DLS::File::pInstruments. |
|
Delete an instrument. This will delete the given Instrument object from the gig file. You have to call Save() to make this persistent to the file.
Definition at line 3508 of file gig.cpp. References DLS::File::pInstruments. |
|
Delete a sample. This will delete the given Sample object from the DLS file. You have to call Save() to make this persistent to the file.
Definition at line 1365 of file DLS.cpp. References DLS::File::pSamples. |
|
Delete a sample. This will delete the given Sample object from the gig file. Any references to this sample from Regions and DimensionRegions will be removed. You have to call Save() to make this persistent to the file.
Definition at line 3338 of file gig.cpp. References GetFirstInstrument(), GetNextInstrument(), DLS::File::pSamples, and DLS::File::SamplesIterator. Referenced by DeleteGroup(). |
|
Generates a new DLSID for the resource.
Definition at line 449 of file DLS.cpp. References DLS::dlsid_t::abData, DLS::Resource::pDLSID, DLS::dlsid_t::ulData1, DLS::dlsid_t::usData2, and DLS::dlsid_t::usData3. Referenced by AddInstrument(), and File(). |
|
Returns a pointer to the first Group object of the file, NULL otherwise.
Definition at line 3572 of file gig.cpp. References LoadGroups(). Referenced by gig::Group::MoveAll(). |
|
Returns a pointer to the first Instrument object of the file, NULL otherwise.
Reimplemented from DLS::File. Definition at line 3422 of file gig.cpp. References DLS::File::InstrumentsIterator, LoadInstruments(), and DLS::File::pInstruments. Referenced by DeleteSample(). |
|
Returns a pointer to the first Sample object of the file, NULL otherwise.
Definition at line 1297 of file DLS.cpp. References DLS::File::LoadSamples(), DLS::File::pSamples, and DLS::File::SamplesIterator. Referenced by GetInstrument(), and DLS::Region::GetSample(). |
|
Returns a pointer to the first Sample object of the file, NULL otherwise.
Definition at line 3293 of file gig.cpp. References LoadSamples(), DLS::File::pSamples, and DLS::File::SamplesIterator. Referenced by gig::Group::GetFirstSample(), and gig::Region::GetSampleFromWavePool(). |
|
Returns the group with the given index.
Definition at line 3591 of file gig.cpp. References LoadGroups(). Referenced by gig::Sample::Sample(). |
|
Returns the instrument with the given index.
Definition at line 3442 of file gig.cpp. References gig::progress_t::__range_max, gig::progress_t::__range_min, gig::progress_t::callback, DLS::File::GetFirstSample(), DLS::File::InstrumentsIterator, LoadInstruments(), and DLS::File::pInstruments. |
|
Returns a pointer to the next Group object of the file, NULL otherwise.
Definition at line 3579 of file gig.cpp. Referenced by gig::Group::MoveAll(). |
|
Returns a pointer to the next Instrument object of the file, NULL otherwise.
Reimplemented from DLS::File. Definition at line 3429 of file gig.cpp. References DLS::File::InstrumentsIterator, and DLS::File::pInstruments. Referenced by DeleteSample(). |
|
Returns a pointer to the next Sample object of the file, NULL otherwise.
Reimplemented from DLS::File. Definition at line 3300 of file gig.cpp. References DLS::File::pSamples, and DLS::File::SamplesIterator. Referenced by gig::Group::GetFirstSample(), gig::Group::GetNextSample(), and gig::Region::GetSampleFromWavePool(). |
|
Definition at line 344 of file DLS.h. References DLS::Resource::pParent. Referenced by gig::Region::AddDimension(), DLS::Region::GetSample(), gig::Region::GetSampleFromWavePool(), gig::Region::SetKeyRange(), DLS::Region::SetKeyRange(), gig::Instrument::UpdateChunks(), gig::DimensionRegion::UpdateChunks(), and DLS::Region::UpdateChunks(). |
|
Definition at line 3654 of file gig.cpp. References CHUNK_ID_3GNM, RIFF::Chunk::GetChunkID(), RIFF::List::GetFirstSubChunk(), RIFF::List::GetNextSubChunk(), RIFF::List::GetSubList(), Group, LIST_TYPE_3GNL, LIST_TYPE_3GRI, RIFF::Chunk::LoadChunkData(), DLS::File::pRIFF, and DLS::File::pVersion. Referenced by AddGroup(), DeleteGroup(), DeleteGroupOnly(), GetFirstGroup(), GetGroup(), and LoadSamples(). |
|
Definition at line 3520 of file gig.cpp. References RIFF::List::GetFirstSubList(), RIFF::List::GetListType(), RIFF::List::GetNextSubList(), RIFF::List::GetSubList(), DLS::File::Instruments, LIST_TYPE_INS, LIST_TYPE_LINS, DLS::File::pInstruments, and DLS::File::pRIFF. |
|
Reimplemented from DLS::File. Definition at line 3516 of file gig.cpp. Referenced by AddInstrument(), GetFirstInstrument(), and GetInstrument(). |
|
Definition at line 3366 of file gig.cpp. References LoadGroups(), DLS::File::pRIFF, DLS::File::pSamples, DLS::File::pWavePoolTableHi, and DLS::File::WavePoolCount. |
|
Reimplemented from DLS::File. Definition at line 3362 of file gig.cpp. Referenced by AddSample(), and GetFirstSample(). |
|
Save changes to same file. Make all changes persistent by writing them to the actual (same) file. The file might temporarily grow to a higher size than it will have at the end of the saving process.
Definition at line 1521 of file DLS.cpp. References DLS::File::pRIFF, RIFF::File::Save(), and DLS::File::UpdateChunks(). |
|
Save changes to another file. Make all changes persistent by writing them to another file. Caution: this method is optimized for writing to another file, do not use it to save the changes to the same file! Use Save() (without path argument) in that case instead! Ignoring this might result in a corrupted file! After calling this method, this File object will be associated with the new file (given by Path) afterwards.
Definition at line 1506 of file DLS.cpp. References DLS::File::pRIFF, RIFF::File::Save(), and DLS::File::UpdateChunks(). |
|
Updates the 3crc chunk with the checksum of a sample. The update is done directly to disk, as this method is called after File::Save() Definition at line 3549 of file gig.cpp. References CHUNK_ID_3CRC, RIFF::List::GetSubChunk(), DLS::File::pRIFF, and DLS::File::pSamples. |
|
Apply all the gig file's current instruments, samples, groups and settings to the respective RIFF chunks. You have to call Save() to make changes persistent. Usually there is absolutely no need to call this method explicitly. It will be called automatically when File::Save() was called.
Reimplemented from DLS::File. Definition at line 3691 of file gig.cpp. References DLS::File::b64BitWavePoolOffsets, CHUNK_ID_3GNM, RIFF::List::GetFirstSubChunk(), RIFF::List::GetNextSubChunk(), RIFF::List::GetSubList(), LIST_TYPE_3GNL, LIST_TYPE_3GRI, LIST_TYPE_INFO, RIFF::List::MoveSubChunk(), DLS::File::pRIFF, DLS::File::pVersion, and DLS::File::UpdateChunks(). |
|
Definition at line 765 of file gig.h. Referenced by AddGroup(), and LoadGroups(). |
|
Reimplemented from DLS::File. |
|
Definition at line 764 of file gig.h. Referenced by AddSample(). |
|
Definition at line 515 of file DLS.h. Referenced by DLS::File::__ensureMandatoryChunksExist(), DLS::File::File(), and UpdateChunks(). |
|
Definition at line 506 of file DLS.h. Referenced by DLS::File::~File(). |
|
Reflects the number of available Instrument objects.
Definition at line 485 of file DLS.h. Referenced by DLS::File::File(), LoadInstruments(), and DLS::File::UpdateChunks(). |
|
Definition at line 510 of file DLS.h. Referenced by GetFirstInstrument(), DLS::File::GetFirstInstrument(), GetInstrument(), GetNextInstrument(), and DLS::File::GetNextInstrument(). |
|
Points to a dlsid_t structure if the file provided a DLS ID else is NULL.
Definition at line 342 of file DLS.h. Referenced by DLS::Resource::GenerateDLSID(), DLS::Resource::Resource(), DLS::Resource::UpdateChunks(), and DLS::Resource::~Resource(). |
|
Points (in any case) to an Info object, providing additional, optional infos and comments.
Definition at line 341 of file DLS.h. Referenced by AddInstrument(), File(), gig::Instrument::Instrument(), DLS::Resource::Resource(), gig::Sample::Sample(), DLS::Resource::UpdateChunks(), and DLS::Resource::~Resource(). |
|
|
Definition at line 348 of file DLS.h. Referenced by DLS::Resource::GetParent(), DLS::Resource::Resource(), gig::Sample::UpdateChunks(), DLS::Instrument::~Instrument(), DLS::Region::~Region(), and DLS::Sample::~Sample(). |
|
Definition at line 349 of file DLS.h. Referenced by DLS::Resource::Resource(), and DLS::Resource::UpdateChunks(). |
|
|
Definition at line 507 of file DLS.h. Referenced by AddSample(), DLS::File::AddSample(), DeleteSample(), DLS::File::DeleteSample(), DLS::File::File(), GetFirstSample(), DLS::File::GetFirstSample(), GetNextSample(), DLS::File::GetNextSample(), LoadSamples(), DLS::File::LoadSamples(), SetSampleChecksum(), DLS::Region::UpdateChunks(), and DLS::File::~File(). |
|
Points to a version_t structure if the file provided a version number else is set to NULL.
Definition at line 484 of file DLS.h. Referenced by gig::Region::AddDimension(), File(), DLS::File::File(), LoadGroups(), UpdateChunks(), gig::Group::UpdateChunks(), gig::Instrument::UpdateChunks(), gig::DimensionRegion::UpdateChunks(), DLS::File::UpdateChunks(), and DLS::File::~File(). |
|
Definition at line 513 of file DLS.h. Referenced by DLS::File::File(), DLS::Region::GetSample(), gig::Region::GetSampleFromWavePool(), and DLS::File::~File(). |
|
Definition at line 514 of file DLS.h. Referenced by DLS::File::File(), gig::Region::GetSampleFromWavePool(), LoadSamples(), and DLS::File::~File(). |
|
Definition at line 508 of file DLS.h. Referenced by DeleteSample(), GetFirstSample(), DLS::File::GetFirstSample(), GetNextSample(), and DLS::File::GetNextSample(). |
|
Initial value: { 0, 2, 19980628 & 0xffff, 19980628 >> 16 }
|
|
Initial value: { 0, 3, 20030331 & 0xffff, 20030331 >> 16 }
Definition at line 721 of file gig.h. Referenced by File(). |
|
Definition at line 512 of file DLS.h. Referenced by DLS::File::File(), and LoadSamples(). |
|
Definition at line 511 of file DLS.h. Referenced by DLS::File::__ensureMandatoryChunksExist(), and DLS::File::File(). |