libgig
3.3.0.svn4
|
Provides all neccessary information for the synthesis of a DLS Instrument. More...
#include <DLS.h>
Classes | |
struct | midi_locale_t |
Public Member Functions | |
Region * | GetFirstRegion () |
Region * | GetNextRegion () |
Region * | AddRegion () |
void | DeleteRegion (Region *pRegion) |
virtual void | UpdateChunks () |
Apply Instrument with all its Regions to the respective RIFF chunks. 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 () |
void | GenerateDLSID () |
Generates a new DLSID for the resource. More... | |
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. More... | |
Public Attributes | |
bool | IsDrum |
Indicates if the Instrument is a drum type, as they differ in the synthesis model of DLS from melodic instruments. More... | |
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). More... | |
uint8_t | MIDIBankCoarse |
Reflects the MIDI Bank number for MIDI Control Change 0 (bank 1 - 128). More... | |
uint8_t | MIDIBankFine |
Reflects the MIDI Bank number for MIDI Control Change 32 (bank 1 - 128). More... | |
uint32_t | MIDIProgram |
Specifies the MIDI Program Change Number this Instrument should be assigned to. More... | |
uint32_t | Regions |
Reflects the number of Region defintions this Instrument has. More... | |
Info * | pInfo |
Points (in any case) to an Info object, providing additional, optional infos and comments. More... | |
dlsid_t * | pDLSID |
Points to a dlsid_t structure if the file provided a DLS ID else is NULL. More... | |
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 |
Friends | |
class | File |
class | Region |
Provides all neccessary information for the synthesis of a DLS Instrument.
|
protectedinherited |
|
protected |
|
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 1150 of file DLS.cpp.
References DLS::Instrument::midi_locale_t::bank, CHUNK_ID_INSH, DRUM_TYPE_MASK, RIFF::List::GetSubChunk(), DLS::Instrument::midi_locale_t::instrument, IsDrum, MIDI_BANK_COARSE, MIDI_BANK_FINE, MIDI_BANK_MERGE, MIDIBank, MIDIBankCoarse, MIDIBankFine, MIDIProgram, pCkInstrument, pRegions, RIFF::Chunk::Read(), RIFF::Chunk::ReadUint32(), and Regions.
|
protectedvirtual |
Destructor.
Removes RIFF chunks associated with this Instrument and frees all memory occupied by this instrument.
Reimplemented in gig::Instrument.
Definition at line 1268 of file DLS.cpp.
References RIFF::List::DeleteSubChunk(), RIFF::Chunk::GetParent(), pCkInstrument, DLS::Resource::pParent, and pRegions.
Region * DLS::Instrument::AddRegion | ( | ) |
Definition at line 1201 of file DLS.cpp.
References RIFF::List::AddSubList(), RIFF::List::GetSubList(), LIST_TYPE_LRGN, LIST_TYPE_RGN, LoadRegions(), pCkInstrument, pRegions, Region, and Regions.
Referenced by CopyAssign().
|
virtualinherited |
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.
Definition at line 236 of file DLS.cpp.
Referenced by DLS::Region::CopyAssign(), and CopyAssignCore().
|
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 534 of file DLS.cpp.
References DLS::Info::CopyAssign(), and DLS::Resource::pInfo.
Referenced by DLS::Region::CopyAssign(), and CopyAssignCore().
|
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 1305 of file DLS.cpp.
References AddRegion(), DLS::Region::CopyAssign(), CopyAssignCore(), DeleteRegion(), GetFirstRegion(), pRegions, and Regions.
|
protected |
Definition at line 1283 of file DLS.cpp.
References DLS::Articulator::CopyAssign(), DLS::Resource::CopyAssign(), IsDrum, MIDIBank, MIDIBankCoarse, MIDIBankFine, and MIDIProgram.
Referenced by CopyAssign(), and gig::Instrument::CopyAssign().
void DLS::Instrument::DeleteRegion | ( | Region * | pRegion | ) |
Definition at line 1221 of file DLS.cpp.
References pRegions, and Regions.
Referenced by CopyAssign(), and gig::Instrument::DeleteRegion().
|
inherited |
Generates a new DLSID for the resource.
Definition at line 487 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 gig::File::AddInstrument(), and gig::File::File().
|
inherited |
Definition at line 174 of file DLS.cpp.
References DLS::Articulator::ArticulationsIterator, DLS::Articulator::LoadArticulations(), and DLS::Articulator::pArticulations.
Region * DLS::Instrument::GetFirstRegion | ( | ) |
Definition at line 1173 of file DLS.cpp.
References LoadRegions(), pRegions, and RegionsIterator.
Referenced by CopyAssign().
|
inherited |
Definition at line 181 of file DLS.cpp.
References DLS::Articulator::ArticulationsIterator, and DLS::Articulator::pArticulations.
Region * DLS::Instrument::GetNextRegion | ( | ) |
Definition at line 1180 of file DLS.cpp.
References pRegions, and RegionsIterator.
|
inlineinherited |
Definition at line 330 of file DLS.h.
References DLS::Resource::pParent.
Referenced by gig::Region::AddDimension(), DLS::Region::GetSample(), gig::Region::GetSampleFromWavePool(), gig::Region::Region(), DLS::Region::SetKeyRange(), gig::Region::SetKeyRange(), DLS::Region::UpdateChunks(), gig::DimensionRegion::UpdateChunks(), gig::Region::UpdateChunks(), gig::Instrument::UpdateChunks(), and gig::Sample::Write().
|
protectedinherited |
Definition at line 187 of file DLS.cpp.
References CHUNK_ID_ART2, CHUNK_ID_ARTL, RIFF::Chunk::GetChunkID(), RIFF::List::GetFirstSubChunk(), RIFF::List::GetListType(), RIFF::List::GetNextSubChunk(), RIFF::List::GetSubList(), LIST_TYPE_LAR2, LIST_TYPE_LART, DLS::Articulator::pArticulations, and DLS::Articulator::pParentList.
Referenced by DLS::Articulator::GetFirstArticulation().
|
protectedvirtual |
Definition at line 1186 of file DLS.cpp.
References RIFF::List::GetFirstSubList(), RIFF::List::GetListType(), RIFF::List::GetNextSubList(), RIFF::List::GetSubList(), LIST_TYPE_LRGN, LIST_TYPE_RGN, LIST_TYPE_RGN2, pCkInstrument, pRegions, and Region.
Referenced by AddRegion(), GetFirstRegion(), and DLS::Region::SetKeyRange().
|
virtual |
Apply Instrument with all its Regions to the respective RIFF chunks.
You have to call File::Save() to make changes persistent.
Exception | - on errors |
Reimplemented from DLS::Articulator.
Reimplemented in gig::Instrument.
Definition at line 1236 of file DLS.cpp.
References RIFF::List::AddSubChunk(), DLS::Instrument::midi_locale_t::bank, CHUNK_ID_INSH, DRUM_TYPE_MASK, RIFF::List::GetSubChunk(), DLS::Instrument::midi_locale_t::instrument, IsDrum, RIFF::Chunk::LoadChunkData(), MIDI_BANK_ENCODE, MIDI_BANK_MERGE, MIDIBank, MIDIBankCoarse, MIDIBankFine, MIDIProgram, pCkInstrument, pRegions, Regions, DLS::Articulator::UpdateChunks(), and DLS::Resource::UpdateChunks().
Referenced by gig::Instrument::UpdateChunks().
|
friend |
Definition at line 467 of file DLS.h.
Referenced by AddRegion(), and LoadRegions().
|
protectedinherited |
Definition at line 278 of file DLS.h.
Referenced by DLS::Articulator::GetFirstArticulation(), and DLS::Articulator::GetNextArticulation().
bool DLS::Instrument::IsDrum |
Indicates if the Instrument is a drum type, as they differ in the synthesis model of DLS from melodic instruments.
Definition at line 438 of file DLS.h.
Referenced by CopyAssignCore(), Instrument(), and UpdateChunks().
uint16_t DLS::Instrument::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).
Definition at line 439 of file DLS.h.
Referenced by CopyAssignCore(), Instrument(), and UpdateChunks().
uint8_t DLS::Instrument::MIDIBankCoarse |
Reflects the MIDI Bank number for MIDI Control Change 0 (bank 1 - 128).
Definition at line 440 of file DLS.h.
Referenced by CopyAssignCore(), Instrument(), and UpdateChunks().
uint8_t DLS::Instrument::MIDIBankFine |
Reflects the MIDI Bank number for MIDI Control Change 32 (bank 1 - 128).
Definition at line 441 of file DLS.h.
Referenced by CopyAssignCore(), Instrument(), and UpdateChunks().
uint32_t DLS::Instrument::MIDIProgram |
Specifies the MIDI Program Change Number this Instrument should be assigned to.
Definition at line 442 of file DLS.h.
Referenced by CopyAssignCore(), Instrument(), and UpdateChunks().
|
protectedinherited |
Definition at line 277 of file DLS.h.
Referenced by DLS::Articulator::Articulator(), DLS::Articulator::GetFirstArticulation(), DLS::Articulator::GetNextArticulation(), DLS::Articulator::LoadArticulations(), DLS::Articulator::UpdateChunks(), and DLS::Articulator::~Articulator().
|
protected |
Definition at line 458 of file DLS.h.
Referenced by AddRegion(), gig::Instrument::AddRegion(), Instrument(), LoadRegions(), UpdateChunks(), gig::Instrument::UpdateChunks(), and ~Instrument().
|
inherited |
Points to a dlsid_t structure if the file provided a DLS ID else is NULL.
Definition at line 328 of file DLS.h.
Referenced by DLS::Resource::GenerateDLSID(), DLS::Resource::Resource(), DLS::Resource::UpdateChunks(), and DLS::Resource::~Resource().
|
inherited |
Points (in any case) to an Info object, providing additional, optional infos and comments.
Definition at line 327 of file DLS.h.
Referenced by gig::File::AddInstrument(), DLS::Resource::CopyAssign(), gig::File::File(), gig::Instrument::Instrument(), DLS::Resource::Resource(), gig::Sample::Sample(), DLS::Resource::UpdateChunks(), and DLS::Resource::~Resource().
|
protectedinherited |
Definition at line 335 of file DLS.h.
Referenced by DLS::Resource::GetParent(), DLS::Resource::Resource(), gig::Sample::UpdateChunks(), ~Instrument(), DLS::Region::~Region(), and DLS::Sample::~Sample().
|
protectedinherited |
Definition at line 276 of file DLS.h.
Referenced by DLS::Articulator::Articulator(), gig::Region::DeleteDimension(), and DLS::Articulator::LoadArticulations().
|
protected |
Definition at line 459 of file DLS.h.
Referenced by AddRegion(), gig::Instrument::AddRegion(), CopyAssign(), gig::Instrument::CopyAssign(), DeleteRegion(), gig::Instrument::DeleteRegion(), GetFirstRegion(), gig::Instrument::GetFirstRegion(), GetNextRegion(), gig::Instrument::GetNextRegion(), gig::Instrument::GetRegion(), Instrument(), gig::Instrument::Instrument(), LoadRegions(), DLS::Region::SetKeyRange(), UpdateChunks(), gig::Instrument::UpdateChunks(), gig::Instrument::UpdateRegionKeyTable(), and ~Instrument().
|
protectedinherited |
Definition at line 336 of file DLS.h.
Referenced by DLS::Resource::Resource(), and DLS::Resource::UpdateChunks().
uint32_t DLS::Instrument::Regions |
Reflects the number of Region defintions this Instrument has.
Definition at line 443 of file DLS.h.
Referenced by AddRegion(), gig::Instrument::AddRegion(), CopyAssign(), gig::Instrument::CopyAssign(), DeleteRegion(), Instrument(), gig::Instrument::Instrument(), and UpdateChunks().
|
protected |
Definition at line 460 of file DLS.h.
Referenced by GetFirstRegion(), gig::Instrument::GetFirstRegion(), GetNextRegion(), and gig::Instrument::GetNextRegion().