libgig  4.1.0.svn8
DLS::Region Class Reference

Defines Region information of an Instrument. More...

#include <DLS.h>

Inheritance diagram for DLS::Region:
DLS::Resource DLS::Articulator DLS::Sampler

Public Member Functions

SampleGetSample ()
 
void SetSample (Sample *pSample)
 Assign another sample to this Region. More...
 
virtual void SetKeyRange (uint16_t Low, uint16_t High)
 Modifies the key range of this Region and makes sure the respective chunks are in correct order. More...
 
virtual void UpdateChunks (progress_t *pProgress)
 Apply Region settings to the respective RIFF chunks. More...
 
virtual void CopyAssign (const Region *orig)
 Make a (semi) deep copy of the Region object given by orig and assign it to this object. More...
 
ResourceGetParent ()
 
const ResourceGetParent () 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...
 
ArticulationGetFirstArticulation ()
 
ArticulationGetNextArticulation ()
 
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.
 
void AddSampleLoop (sample_loop_t *pLoopDef)
 Adds a new sample loop with the provided loop definition. More...
 
void DeleteSampleLoop (sample_loop_t *pLoopDef)
 Deletes an existing sample loop. More...
 
virtual void SetGain (int32_t gain)
 
virtual void CopyAssign (const Sampler *orig)
 Make a deep copy of the Sampler object given by orig and assign it to this object. More...
 

Public Attributes

range_t KeyRange
 
range_t VelocityRange
 
uint16_t KeyGroup
 
uint16_t Layer
 
bool SelfNonExclusive
 
bool PhaseMaster
 
uint16_t PhaseGroup
 
bool MultiChannel
 
uint32_t Channel
 
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.
 
uint8_t UnityNote
 
int16_t FineTune
 
int32_t Gain
 
bool NoSampleDepthTruncation
 
bool NoSampleCompression
 
uint32_t SampleLoops
 Reflects the number of sample loops.
 
sample_loop_tpSampleLoops
 Points to the beginning of a sample loop array, or is NULL if there are no loops defined.
 

Protected Types

typedef std::list< Articulation * > ArticulationList
 

Protected Member Functions

 Region (Instrument *pInstrument, RIFF::List *rgnList)
 
virtual ~Region ()
 Destructor. More...
 
void LoadArticulations ()
 

Protected Attributes

RIFF::ListpCkRegion
 
uint32_t WavePoolTableIndex
 
SamplepSample
 
uint16_t FormatOptionFlags
 
uint16_t WaveLinkOptionFlags
 
ResourcepParent
 
RIFF::ListpResourceList
 
RIFF::ListpParentList
 
ArticulationList * pArticulations
 
ArticulationList::iterator ArticulationsIterator
 
RIFF::ListpParentList
 
uint32_t uiHeaderSize
 
uint32_t SamplerOptions
 

Detailed Description

Defines Region information of an Instrument.

Definition at line 431 of file DLS.h.

Constructor & Destructor Documentation

◆ ~Region()

gig::Region::~Region ( )
protectedvirtual

Destructor.

Removes RIFF chunks associated with this Region.

Definition at line 1044 of file DLS.cpp.

References RIFF::List::DeleteSubChunk(), and RIFF::Chunk::GetParent().

Member Function Documentation

◆ AddSampleLoop()

void DLS::Sampler::AddSampleLoop ( sample_loop_t pLoopDef)
inherited

Adds a new sample loop with the provided loop definition.

Parameters
pLoopDef- points to a loop definition that is to be copied

Definition at line 633 of file DLS.cpp.

References DLS::Sampler::pSampleLoops, DLS::Sampler::SampleLoops, and DLS::sample_loop_t::Size.

◆ CopyAssign() [1/3]

void Resource::CopyAssign ( const Resource orig)
virtualinherited

Make a deep copy of the Resource object given by orig and assign it to this object.

Parameters
orig- original Resource object to be copied from

Definition at line 542 of file DLS.cpp.

References DLS::Info::CopyAssign(), and DLS::Resource::pInfo.

Referenced by CopyAssign(), and DLS::Sample::CopyAssignCore().

◆ CopyAssign() [2/3]

void DLS::Sampler::CopyAssign ( const Sampler orig)
virtualinherited

Make a deep copy of the Sampler object given by orig and assign it to this object.

Parameters
orig- original Sampler object to be copied from

Definition at line 679 of file DLS.cpp.

References DLS::Sampler::Gain, DLS::Sampler::pSampleLoops, and DLS::Sampler::SampleLoops.

Referenced by CopyAssign().

◆ CopyAssign() [3/3]

void gig::Region::CopyAssign ( const Region orig)
virtual

Make a (semi) deep copy of the Region object given by orig and assign it to this object.

Note that the sample pointer referenced by orig is simply copied as memory address. Thus the respective sample is shared, not duplicated!

Parameters
orig- original Region object to be copied from

Note that all sample pointers referenced by orig are simply copied as memory address. Thus the respective samples are shared, not duplicated!

Parameters
orig- original Region object to be copied from
mSamples- crosslink map between the foreign file's samples and this file's samples

Definition at line 1175 of file DLS.cpp.

References DLS::Articulator::CopyAssign(), DLS::Resource::CopyAssign(), DLS::Sampler::CopyAssign(), DLS::range_t::high, KeyRange, DLS::range_t::low, and SetKeyRange().

Referenced by DLS::Instrument::CopyAssign().

◆ DeleteSampleLoop()

void DLS::Sampler::DeleteSampleLoop ( sample_loop_t pLoopDef)
inherited

Deletes an existing sample loop.

Parameters
pLoopDef- pointer to existing loop definition
Exceptions
Exception- if given loop definition does not exist

Definition at line 655 of file DLS.cpp.

References DLS::Sampler::pSampleLoops, and DLS::Sampler::SampleLoops.

◆ SetKeyRange()

void gig::Region::SetKeyRange ( uint16_t  Low,
uint16_t  High 
)
virtual

Modifies the key range of this Region and makes sure the respective chunks are in correct order.

Parameters
Low- lower end of key range
High- upper end of key range

Definition at line 1078 of file DLS.cpp.

References DLS::range_t::high, KeyRange, and DLS::range_t::low.

Referenced by CopyAssign().

◆ SetSample()

void DLS::Region::SetSample ( Sample pSample)

Assign another sample to this Region.

Parameters
pSample- sample to be assigned

Definition at line 1066 of file DLS.cpp.

◆ UpdateChunks()

void gig::Region::UpdateChunks ( progress_t pProgress)
virtual

Apply Region settings to the respective RIFF chunks.

Apply Region settings and all its DimensionRegions to the respective RIFF chunks.

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

Parameters
pProgress- callback function for progress notification
Exceptions
Exception- if the Region's sample could not be found

You have to call File::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.

Parameters
pProgress- callback function for progress notification
Exceptions
gig::Exceptionif samples cannot be dereferenced

Reimplemented from DLS::Articulator.

Definition at line 1113 of file DLS.cpp.

References RIFF::List::AddSubChunk(), RIFF::Chunk::GetSize(), RIFF::List::GetSubChunk(), DLS::range_t::high, KeyRange, RIFF::Chunk::LoadChunkData(), DLS::range_t::low, DLS::Articulator::UpdateChunks(), and DLS::Sampler::UpdateChunks().

Member Data Documentation

◆ Gain

int32_t DLS::Sampler::Gain
inherited
Deprecated:
Don't alter directly, use SetGain() instead!

Definition at line 369 of file DLS.h.

Referenced by DLS::Sampler::CopyAssign(), and DLS::Sampler::UpdateChunks().

◆ KeyRange

range_t DLS::Region::KeyRange
Deprecated:
Only read, don't write! Use SetKeyRange() instead.

Definition at line 433 of file DLS.h.

Referenced by CopyAssign(), SetKeyRange(), and UpdateChunks().


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