DLS::Instrument Class Reference

Provides all neccessary information for the synthesis of a DLS Instrument. More...

#include <DLS.h>

Inheritance diagram for DLS::Instrument:

DLS::Resource DLS::Articulator gig::Instrument

List of all members.

Public Member Functions

RegionGetFirstRegion ()
RegionGetNextRegion ()
RegionAddRegion ()
void MoveRegion (Region *pSrc, Region *pDst)
void DeleteRegion (Region *pRegion)
virtual void UpdateChunks ()
 Apply Instrument with all its Regions to the respective RIFF chunks.
ResourceGetParent ()
ArticulationGetFirstArticulation ()
ArticulationGetNextArticulation ()

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.
InfopInfo
 Points (in any case) to an Info object, providing additional, optional infos and comments.
dlsid_tpDLSID
 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)
virtual void LoadRegions ()
virtual ~Instrument ()
void LoadArticulations ()

Protected Attributes

RIFF::ListpCkInstrument
RegionListpRegions
RegionList::iterator RegionsIterator
ResourcepParent
RIFF::ListpResourceList
RIFF::ListpParentList
ArticulationListpArticulations
ArticulationList::iterator ArticulationsIterator

Friends

class File

Classes

struct  midi_locale_t


Detailed Description

Provides all neccessary information for the synthesis of a DLS Instrument.

Definition at line 435 of file DLS.h.


Member Typedef Documentation

typedef std::list<Region*> DLS::Instrument::RegionList [protected]

Definition at line 451 of file DLS.h.

typedef std::list<Articulation*> DLS::Articulator::ArticulationList [protected, inherited]

Definition at line 290 of file DLS.h.


Constructor & Destructor Documentation

DLS::Instrument::Instrument ( File pFile,
RIFF::List insList 
) [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.

Parameters:
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 883 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.

DLS::Instrument::~Instrument (  )  [protected, virtual]

Destructor.

Removes RIFF chunks associated with this Instrument and frees all memory occupied by this instrument.

Reimplemented in gig::Instrument.

Definition at line 1000 of file DLS.cpp.

References RIFF::List::DeleteSubChunk(), RIFF::Chunk::GetParent(), pCkInstrument, DLS::Resource::pParent, and pRegions.


Member Function Documentation

Region * DLS::Instrument::GetFirstRegion (  ) 

Reimplemented in gig::Instrument.

Definition at line 906 of file DLS.cpp.

References LoadRegions(), pRegions, and RegionsIterator.

Region * DLS::Instrument::GetNextRegion (  ) 

Reimplemented in gig::Instrument.

Definition at line 913 of file DLS.cpp.

References pRegions, and RegionsIterator.

Region * DLS::Instrument::AddRegion (  ) 

Reimplemented in gig::Instrument.

Definition at line 934 of file DLS.cpp.

References RIFF::List::AddSubList(), RIFF::List::GetSubList(), LIST_TYPE_LRGN, LIST_TYPE_RGN, LoadRegions(), pCkInstrument, pRegions, and Regions.

void DLS::Instrument::MoveRegion ( Region pSrc,
Region pDst 
)

Definition at line 945 of file DLS.cpp.

References RIFF::List::GetSubList(), LIST_TYPE_LRGN, RIFF::List::MoveSubChunk(), pCkInstrument, DLS::Region::pCkRegion, and pRegions.

void DLS::Instrument::DeleteRegion ( Region pRegion  ) 

Definition at line 954 of file DLS.cpp.

References pRegions, and Regions.

Referenced by gig::Instrument::DeleteRegion().

void DLS::Instrument::UpdateChunks (  )  [virtual]

Apply Instrument with all its Regions to the respective RIFF chunks.

You have to call File::Save() to make changes persistent.

Exceptions:
Exception - on errors

Reimplemented from DLS::Articulator.

Reimplemented in gig::Instrument.

Definition at line 969 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().

void DLS::Instrument::LoadRegions (  )  [protected, virtual]

Definition at line 919 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, and pRegions.

Referenced by AddRegion(), and GetFirstRegion().

Resource* DLS::Resource::GetParent (  )  [inline, inherited]

Definition at line 337 of file DLS.h.

References DLS::Resource::pParent.

Referenced by gig::Region::AddDimension(), DLS::Region::GetSample(), gig::Region::GetSampleFromWavePool(), gig::Region::Region(), gig::Region::UpdateChunks(), and DLS::Region::UpdateChunks().

Articulation * DLS::Articulator::GetFirstArticulation (  )  [inherited]

Definition at line 167 of file DLS.cpp.

References DLS::Articulator::ArticulationsIterator, DLS::Articulator::LoadArticulations(), and DLS::Articulator::pArticulations.

Articulation * DLS::Articulator::GetNextArticulation (  )  [inherited]

Definition at line 174 of file DLS.cpp.

References DLS::Articulator::ArticulationsIterator, and DLS::Articulator::pArticulations.

void DLS::Articulator::LoadArticulations (  )  [protected, inherited]

Definition at line 180 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().


Friends And Related Function Documentation

friend class File [friend]

Reimplemented in gig::Instrument.

Definition at line 464 of file DLS.h.


Member Data Documentation

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 437 of file DLS.h.

Referenced by 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 438 of file DLS.h.

Referenced by Instrument(), and UpdateChunks().

uint8_t DLS::Instrument::MIDIBankCoarse

Reflects the MIDI Bank number for MIDI Control Change 0 (bank 1 - 128).

Definition at line 439 of file DLS.h.

Referenced by Instrument(), and UpdateChunks().

uint8_t DLS::Instrument::MIDIBankFine

Reflects the MIDI Bank number for MIDI Control Change 32 (bank 1 - 128).

Definition at line 440 of file DLS.h.

Referenced by Instrument(), and UpdateChunks().

uint32_t DLS::Instrument::MIDIProgram

Specifies the MIDI Program Change Number this Instrument should be assigned to.

Definition at line 441 of file DLS.h.

Referenced by Instrument(), and UpdateChunks().

uint32_t DLS::Instrument::Regions

Reflects the number of Region defintions this Instrument has.

Definition at line 442 of file DLS.h.

Referenced by gig::Instrument::AddRegion(), AddRegion(), DeleteRegion(), gig::Instrument::Instrument(), Instrument(), and UpdateChunks().

RIFF::List* DLS::Instrument::pCkInstrument [protected]

Definition at line 457 of file DLS.h.

Referenced by gig::Instrument::AddRegion(), AddRegion(), Instrument(), LoadRegions(), MoveRegion(), gig::Instrument::UpdateChunks(), UpdateChunks(), and ~Instrument().

RegionList* DLS::Instrument::pRegions [protected]

Definition at line 458 of file DLS.h.

Referenced by gig::Instrument::AddRegion(), AddRegion(), gig::Instrument::DeleteRegion(), DeleteRegion(), gig::Instrument::GetFirstRegion(), GetFirstRegion(), gig::Instrument::GetNextRegion(), GetNextRegion(), gig::Instrument::GetRegion(), gig::Instrument::Instrument(), Instrument(), LoadRegions(), MoveRegion(), gig::Instrument::UpdateChunks(), UpdateChunks(), gig::Instrument::UpdateRegionKeyTable(), and ~Instrument().

RegionList::iterator DLS::Instrument::RegionsIterator [protected]

Definition at line 459 of file DLS.h.

Referenced by gig::Instrument::GetFirstRegion(), GetFirstRegion(), gig::Instrument::GetNextRegion(), and GetNextRegion().

Info* DLS::Resource::pInfo [inherited]

Points (in any case) to an Info object, providing additional, optional infos and comments.

Definition at line 334 of file DLS.h.

Referenced by gig::File::File(), gig::Instrument::Instrument(), gig::Region::Region(), DLS::Resource::Resource(), gig::Sample::Sample(), DLS::Resource::UpdateChunks(), and DLS::Resource::~Resource().

dlsid_t* DLS::Resource::pDLSID [inherited]

Points to a dlsid_t structure if the file provided a DLS ID else is NULL.

Definition at line 335 of file DLS.h.

Referenced by DLS::Resource::Resource(), and DLS::Resource::~Resource().

Resource* DLS::Resource::pParent [protected, inherited]

Definition at line 340 of file DLS.h.

Referenced by DLS::Resource::GetParent(), DLS::Resource::Resource(), gig::Sample::UpdateChunks(), ~Instrument(), DLS::Region::~Region(), and DLS::Sample::~Sample().

RIFF::List* DLS::Resource::pResourceList [protected, inherited]

Definition at line 341 of file DLS.h.

Referenced by DLS::Resource::Resource().

RIFF::List* DLS::Articulator::pParentList [protected, inherited]

Definition at line 291 of file DLS.h.

Referenced by DLS::Articulator::Articulator(), and DLS::Articulator::LoadArticulations().

ArticulationList* DLS::Articulator::pArticulations [protected, inherited]

Definition at line 292 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().

ArticulationList::iterator DLS::Articulator::ArticulationsIterator [protected, inherited]

Definition at line 293 of file DLS.h.

Referenced by DLS::Articulator::GetFirstArticulation(), and DLS::Articulator::GetNextArticulation().


The documentation for this class was generated from the following files:
Generated on Thu Aug 16 07:21:39 2007 for libgig by  doxygen 1.5.3