libgig  3.3.0
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

Classes

struct  midi_locale_t
 

Public Member Functions

RegionGetFirstRegion ()
 
RegionGetNextRegion ()
 
RegionAddRegion ()
 
void DeleteRegion (Region *pRegion)
 
virtual void UpdateChunks ()
 Apply Instrument with all its Regions to the respective RIFF chunks. More...
 
ResourceGetParent ()
 
void GenerateDLSID ()
 Generates a new DLSID for the resource. More...
 
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. 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...
 
InfopInfo
 Points (in any case) to an Info object, providing additional, optional infos and comments. More...
 
dlsid_tpDLSID
 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...
 
virtual void LoadRegions ()
 
virtual ~Instrument ()
 Destructor. More...
 
void LoadArticulations ()
 

Protected Attributes

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

Friends

class File
 
class Region
 

Detailed Description

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

Definition at line 447 of file DLS.h.

Member Typedef Documentation

typedef std::list<Articulation*> DLS::Articulator::ArticulationList
protectedinherited

Definition at line 290 of file DLS.h.

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

Definition at line 462 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 1049 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 ( )
protectedvirtual

Destructor.

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

Reimplemented in gig::Instrument.

Definition at line 1167 of file DLS.cpp.

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

Member Function Documentation

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

Definition at line 1120 of file DLS.cpp.

References pRegions, and Regions.

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

void DLS::Resource::GenerateDLSID ( )
inherited

Generates a new DLSID for the resource.

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

Articulation * DLS::Articulator::GetFirstArticulation ( )
inherited
Region * DLS::Instrument::GetFirstRegion ( )

Definition at line 1072 of file DLS.cpp.

References LoadRegions(), pRegions, and RegionsIterator.

Articulation * DLS::Articulator::GetNextArticulation ( )
inherited
Region * DLS::Instrument::GetNextRegion ( )

Definition at line 1079 of file DLS.cpp.

References pRegions, and RegionsIterator.

void DLS::Instrument::UpdateChunks ( )
virtual

Friends And Related Function Documentation

friend class File
friend

Definition at line 475 of file DLS.h.

friend class Region
friend

Definition at line 476 of file DLS.h.

Referenced by AddRegion(), and LoadRegions().

Member Data Documentation

ArticulationList::iterator DLS::Articulator::ArticulationsIterator
protectedinherited
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 449 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 450 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 451 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 452 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 453 of file DLS.h.

Referenced by Instrument(), and UpdateChunks().

RIFF::List* DLS::Instrument::pCkInstrument
protected
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 342 of file DLS.h.

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

Info* DLS::Resource::pInfo
inherited

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

Definition at line 341 of file DLS.h.

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

Resource* DLS::Resource::pParent
protectedinherited
RIFF::List* DLS::Articulator::pParentList
protectedinherited
RIFF::List* DLS::Resource::pResourceList
protectedinherited

Definition at line 349 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 454 of file DLS.h.

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

RegionList::iterator DLS::Instrument::RegionsIterator
protected

The documentation for this class was generated from the following files: