libgig
4.3.0
|
Provides all neccessary information for the synthesis of a DLS Instrument. More...
#include <DLS.h>
Public Member Functions | |
Region * | GetFirstRegion () |
Region * | GetNextRegion () |
Region * | AddRegion () |
void | DeleteRegion (Region *pRegion) |
virtual void | UpdateChunks (progress_t *pProgress) |
Apply Instrument with all its Regions to the respective RIFF chunks. More... | |
virtual void | DeleteChunks () |
Remove all RIFF chunks associated with this Instrument object. More... | |
virtual void | CopyAssign (const Instrument *orig) |
Make a (semi) deep copy of the Instrument object given by orig and assign it to this object. More... | |
Resource * | GetParent () |
const Resource * | GetParent () const |
void | GenerateDLSID () |
Generates a new DLSID for the resource. | |
virtual void | CopyAssign (const Resource *orig) |
Make a deep copy of the Resource object given by orig and assign it to this object. More... | |
Articulation * | GetFirstArticulation () |
Articulation * | GetNextArticulation () |
virtual void | CopyAssign (const Articulator *orig) |
Not yet implemented in this version, since the .gig format does not need to copy DLS articulators and so far nobody used pure DLS instrument AFAIK. | |
Static Public Member Functions | |
static void | GenerateDLSID (dlsid_t *pDLSID) |
Public Attributes | |
bool | IsDrum |
Indicates if the Instrument is a drum type, as they differ in the synthesis model of DLS from melodic instruments. | |
uint16_t | MIDIBank |
Reflects combination of MIDIBankCoarse and MIDIBankFine (bank 1 - bank 16384). Do not change this value, it will not be saved! Change MIDIBankCoarse and MIDIBankFine instead (we might change that in future). | |
uint8_t | MIDIBankCoarse |
Reflects the MIDI Bank number for MIDI Control Change 0 (bank 1 - 128). | |
uint8_t | MIDIBankFine |
Reflects the MIDI Bank number for MIDI Control Change 32 (bank 1 - 128). | |
uint32_t | MIDIProgram |
Specifies the MIDI Program Change Number this Instrument should be assigned to. | |
uint32_t | Regions |
Reflects the number of Region defintions this Instrument has. | |
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 Types | |
typedef std::list< Region * > | RegionList |
typedef std::list< Articulation * > | ArticulationList |
Protected Member Functions | |
Instrument (File *pFile, RIFF::List *insList) | |
Constructor. More... | |
void | CopyAssignCore (const Instrument *orig) |
virtual void | LoadRegions () |
virtual | ~Instrument () |
Destructor. More... | |
void | LoadArticulations () |
Protected Attributes | |
RIFF::List * | pCkInstrument |
RegionList * | pRegions |
RegionList::iterator | RegionsIterator |
Resource * | pParent |
RIFF::List * | pResourceList |
RIFF::List * | pParentList |
ArticulationList * | pArticulations |
ArticulationList::iterator | ArticulationsIterator |
Provides all neccessary information for the synthesis of a DLS Instrument.
|
protected |
Constructor.
Load an existing instrument definition or create a new one. An 'ins' list chunk must be given to this constructor. In case this 'ins' list chunk contains a 'insh' chunk, the instrument data fields will be loaded from there, otherwise default values will be used and the 'insh' chunk will be created once File::Save() was called.
pFile | - pointer to DLS::File where this instrument is located (or will be located) |
insList | - pointer to 'ins' list chunk which is (or will be) associated with this instrument |
Definition at line 1335 of file DLS.cpp.
References RIFF::List::GetSubChunk(), IsDrum, MIDIBank, MIDIBankCoarse, MIDIBankFine, MIDIProgram, RIFF::Chunk::Read(), RIFF::Chunk::ReadUint32(), Regions, and RIFF::Chunk::SetPos().
|
protectedvirtual |
|
virtual |
Make a (semi) deep copy of the Instrument object given by orig and assign it to this object.
Note that all sample pointers referenced by orig are simply copied as memory address. Thus the respective samples are shared, not duplicated!
orig | - original Instrument object to be copied from |
Definition at line 1524 of file DLS.cpp.
References DLS::Region::CopyAssign(), and Regions.
|
virtualinherited |
Make a deep copy of the Resource object given by orig and assign it to this object.
orig | - original Resource object to be copied from |
Definition at line 601 of file DLS.cpp.
References DLS::Info::CopyAssign(), and DLS::Resource::pInfo.
Referenced by DLS::Region::CopyAssign(), and DLS::Sample::CopyAssignCore().
|
virtual |
Remove all RIFF chunks associated with this Instrument object.
See Storage::DeleteChunks() for details.
Reimplemented from DLS::Articulator.
Definition at line 1481 of file DLS.cpp.
References DLS::Articulator::DeleteChunks(), DLS::Resource::DeleteChunks(), RIFF::List::DeleteSubChunk(), and RIFF::Chunk::GetParent().
Referenced by DLS::File::DeleteInstrument(), and gig::File::DeleteInstrument().
|
virtual |
Apply Instrument with all its Regions to the respective RIFF chunks.
You have to call File::Save() to make changes persistent.
pProgress | - callback function for progress notification |
Exception | - on errors |
Reimplemented from DLS::Articulator.
Reimplemented in gig::Instrument.
Definition at line 1425 of file DLS.cpp.
References RIFF::List::AddSubChunk(), RIFF::List::GetSubChunk(), IsDrum, RIFF::Chunk::LoadChunkData(), MIDIBank, MIDIBankCoarse, MIDIBankFine, MIDIProgram, Regions, DLS::Articulator::UpdateChunks(), and DLS::Resource::UpdateChunks().
Referenced by gig::Instrument::UpdateChunks().