DLS::Region Class Reference

Defines Region information of an Instrument. More...

`#include <DLS.h>`

Inheritance diagram for DLS::Region:

## Public Member Functions

Sample * | GetSample ()
void | SetSample (Sample *pSample)
| Assign another sample to this Region.
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.
virtual void | UpdateChunks (progress_t *pProgress)
| Apply Region settings to the respective RIFF chunks.
virtual void | DeleteChunks ()
| Remove all RIFF chunks associated with this Region object.
virtual void | CopyAssign (const Region *orig)
| Make a (semi) deep copy of the Region object given by orig and assign it to this object.
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.
Articulation * | GetArticulation (size_t pos)
| Returns Articulation at supplied pos position within the articulation list.
Articulation * | GetFirstArticulation ()
| Returns the first Articulation in the list of articulations.
Articulation * | GetNextArticulation ()
| Returns the next Articulation from the list of articulations.
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.
void | DeleteSampleLoop (sample_loop_t *pLoopDef)
| Deletes an existing sample loop.
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.

## Static Public Member Functions

static void | GenerateDLSID (dlsid_t *pDLSID)

## 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
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.
uint8_t | UnityNote
int16_t | FineTune
int32_t | Gain
bool | NoSampleDepthTruncation
bool | NoSampleCompression
uint32_t | SampleLoops
| Reflects the number of sample loops.
sample_loop_t * | pSampleLoops
| Points to the beginning of a sample loop array, or is NULL if there are no loops defined.

## Protected Types

typedef std::vector< Articulation * > | ArticulationList

## Protected Member Functions

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

## Protected Attributes

RIFF::List * | pCkRegion
uint32_t | WavePoolTableIndex
Sample * | pSample
uint16_t | FormatOptionFlags
uint16_t | WaveLinkOptionFlags
Resource * | pParent
RIFF::List * | pResourceList
RIFF::List * | pParentList
ArticulationList * | pArticulations
ArticulationList::iterator | ArticulationsIterator
RIFF::List * | pParentList
uint32_t | uiHeaderSize
uint32_t | SamplerOptions

## Detailed Description

Defines Region information of an Instrument.

Definition at line 493 of file DLS.h.

## Member Typedef Documentation

## ArticulationList

typedef std::vector<Articulation*> DLS::Articulator::ArticulationList

protected inherited

Definition at line 353 of file DLS.h.

## Constructor & Destructor Documentation

## Region()

DLS::Region::Region | ( | Instrument * | pInstrument,
|  | RIFF::List * | rgnList )

protected

Definition at line 1141 of file DLS.cpp.

## ~Region()

DLS::Region::~Region | ( |  | ) |

protected virtual

Destructor.

Intended to free up all memory occupied by this Region object. ATM this destructor implementation does nothing though.

Reimplemented in gig::Region.

Definition at line 1194 of file DLS.cpp.

## 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 759 of file DLS.cpp.

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

## CopyAssign() [1/4]

void DLS::Articulator::CopyAssign | ( | const Articulator * | orig | ) |

virtual inherited

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 306 of file DLS.cpp.

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

## CopyAssign() [2/4]

void DLS::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

Definition at line 1342 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(), and gig::Region::CopyAssign().

## CopyAssign() [3/4]

void Resource::CopyAssign | ( | const Resource * | orig | ) |

virtual inherited

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 654 of file DLS.cpp.

References pInfo, and Resource().

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

## CopyAssign() [4/4]

void DLS::Sampler::CopyAssign | ( | const Sampler * | orig | ) |

virtual inherited

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 805 of file DLS.cpp.

References Gain, pSampleLoops, and SampleLoops.

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

## DeleteChunks()

void DLS::Region::DeleteChunks | ( |  | ) |

virtual

Remove all RIFF chunks associated with this Region object.

See Storage::DeleteChunks() for details.

Reimplemented from DLS::Resource.

Definition at line 1201 of file DLS.cpp.

References DLS::Articulator::DeleteChunks(), DLS::Resource::DeleteChunks(), DLS::Sampler::DeleteChunks(), RIFF::List::DeleteSubChunk(), and RIFF::Chunk::GetParent().

Referenced by gig::Region::DeleteDimensionZone(), and gig::Region::SplitDimensionZone().

## 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 781 of file DLS.cpp.

References pSampleLoops, and SampleLoops.

## GenerateDLSID() [1/2]

void Resource::GenerateDLSID | ( |  | ) |

inherited

Generates a new DLSID for the resource.

Definition at line 604 of file DLS.cpp.

References GenerateDLSID(), and pDLSID.

Referenced by gig::File::AddInstrument(), GenerateDLSID(), gig::Script::GenerateUuid(), and DLS::File::UpdateChunks().

## GenerateDLSID() [2/2]

void Resource::GenerateDLSID | ( | dlsid_t * | pDLSID | ) |

static inherited

Definition at line 611 of file DLS.cpp.

## GetArticulation()

Articulation * DLS::Articulator::GetArticulation | ( | size_t | pos | ) |

inherited

Returns Articulation at supplied pos position within the articulation list.

If supplied pos is out of bounds then `NULL` is returned.

Parameters

  pos | - position of sought Articulation in articulation list

Returns
  pointer address to requested articulation or `NULL` if pos is out of bounds

Definition at line 200 of file DLS.cpp.

## GetFirstArticulation()

Articulation * DLS::Articulator::GetFirstArticulation | ( |  | ) |

inherited

Returns the first Articulation in the list of articulations.

You have to call this method once before you can use GetNextArticulation().

Returns
  pointer address to first Articulation or NULL if there is none

See also
  GetNextArticulation()

Deprecated
  This method is not reentrant-safe, use GetArticulation() instead.

Definition at line 216 of file DLS.cpp.

## GetNextArticulation()

Articulation * DLS::Articulator::GetNextArticulation | ( |  | ) |

inherited

Returns the next Articulation from the list of articulations.

You have to call GetFirstArticulation() once before you can use this method. By calling this method multiple times it iterates through the available articulations.

Returns
  pointer address to the next Articulation or NULL if end reached

See also
  GetFirstArticulation()

Deprecated
  This method is not reentrant-safe, use GetArticulation() instead.

Definition at line 234 of file DLS.cpp.

## GetParent() [1/2]

Resource * DLS::Resource::GetParent | ( |  | ) |

inline inherited

Definition at line 409 of file DLS.h.

## GetParent() [2/2]

const Resource * DLS::Resource::GetParent | ( |  | ) | const

inline inherited

Definition at line 410 of file DLS.h.

## GetSample()

Sample * DLS::Region::GetSample | ( |  | ) |

Definition at line 1215 of file DLS.cpp.

## LoadArticulations()

void DLS::Articulator::LoadArticulations | ( |  | ) |

protected inherited

Definition at line 240 of file DLS.cpp.

## SetGain()

void DLS::Sampler::SetGain | ( | int32_t | gain | ) |

virtual inherited

Reimplemented in gig::DimensionRegion.

Definition at line 700 of file DLS.cpp.

## SetKeyRange()

void DLS::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

Reimplemented in gig::Region.

Definition at line 1245 of file DLS.cpp.

References KeyRange.

Referenced by CopyAssign(), and gig::Region::SetKeyRange().

## SetSample()

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

Assign another sample to this Region.

Parameters

  pSample | - sample to be assigned

Definition at line 1233 of file DLS.cpp.

## UpdateChunks()

void DLS::Region::UpdateChunks | ( | progress_t * | pProgress | ) |

virtual

Apply Region settings 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

Reimplemented from DLS::Resource.

Reimplemented in gig::Region.

Definition at line 1280 of file DLS.cpp.

References RIFF::Chunk::GetSize(), KeyRange, RIFF::Chunk::LoadChunkData(), DLS::Articulator::UpdateChunks(), and DLS::Sampler::UpdateChunks().

Referenced by gig::Region::UpdateChunks().

## Member Data Documentation

## ArticulationsIterator

ArticulationList::iterator DLS::Articulator::ArticulationsIterator

protected inherited

Definition at line 356 of file DLS.h.

## Channel

uint32_t DLS::Region::Channel

Definition at line 503 of file DLS.h.

## FineTune

int16_t DLS::Sampler::FineTune

inherited

Definition at line 428 of file DLS.h.

## FormatOptionFlags

uint16_t DLS::Region::FormatOptionFlags

protected

Definition at line 515 of file DLS.h.

## Gain

int32_t DLS::Sampler::Gain

inherited

Deprecated
  Don't alter directly, use SetGain() instead!

Definition at line 429 of file DLS.h.

Referenced by CopyAssign(), and UpdateChunks().

## KeyGroup

uint16_t DLS::Region::KeyGroup

Definition at line 497 of file DLS.h.

## KeyRange

range_t DLS::Region::KeyRange

Deprecated
  Only read, don't write! Use SetKeyRange() instead.

Definition at line 495 of file DLS.h.

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

## Layer

uint16_t DLS::Region::Layer

Definition at line 498 of file DLS.h.

## MultiChannel

bool DLS::Region::MultiChannel

Definition at line 502 of file DLS.h.

## NoSampleCompression

bool DLS::Sampler::NoSampleCompression

inherited

Definition at line 431 of file DLS.h.

## NoSampleDepthTruncation

bool DLS::Sampler::NoSampleDepthTruncation

inherited

Definition at line 430 of file DLS.h.

## pArticulations

ArticulationList* DLS::Articulator::pArticulations

protected inherited

Definition at line 355 of file DLS.h.

## pCkRegion

RIFF::List* DLS::Region::pCkRegion

protected

Definition at line 512 of file DLS.h.

## pDLSID

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

Referenced by GenerateDLSID(), and Resource().

## PhaseGroup

uint16_t DLS::Region::PhaseGroup

Definition at line 501 of file DLS.h.

## PhaseMaster

bool DLS::Region::PhaseMaster

Definition at line 500 of file DLS.h.

## pInfo

Info* DLS::Resource::pInfo

inherited

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

Definition at line 406 of file DLS.h.

Referenced by CopyAssign(), Resource(), gig::Sample::Sample(), and UpdateChunks().

## pParent

Resource* DLS::Resource::pParent

protected inherited

Definition at line 417 of file DLS.h.

## pParentList [1/2]

RIFF::List* DLS::Articulator::pParentList

protected inherited

Definition at line 354 of file DLS.h.

## pParentList [2/2]

RIFF::List* DLS::Sampler::pParentList

protected inherited

Definition at line 442 of file DLS.h.

## pResourceList

RIFF::List* DLS::Resource::pResourceList

protected inherited

Definition at line 418 of file DLS.h.

## pSample

Sample* DLS::Region::pSample

protected

Definition at line 514 of file DLS.h.

## pSampleLoops

sample_loop_t* DLS::Sampler::pSampleLoops

inherited

Points to the beginning of a sample loop array, or is NULL if there are no loops defined.

Definition at line 433 of file DLS.h.

Referenced by AddSampleLoop(), CopyAssign(), DeleteSampleLoop(), and UpdateChunks().

## SampleLoops

uint32_t DLS::Sampler::SampleLoops

inherited

Reflects the number of sample loops.

Definition at line 432 of file DLS.h.

Referenced by AddSampleLoop(), CopyAssign(), DeleteSampleLoop(), and UpdateChunks().

## SamplerOptions

uint32_t DLS::Sampler::SamplerOptions

protected inherited

Definition at line 444 of file DLS.h.

## SelfNonExclusive

bool DLS::Region::SelfNonExclusive

Definition at line 499 of file DLS.h.

## uiHeaderSize

uint32_t DLS::Sampler::uiHeaderSize

protected inherited

Definition at line 443 of file DLS.h.

## UnityNote

uint8_t DLS::Sampler::UnityNote

inherited

Definition at line 427 of file DLS.h.

## VelocityRange

range_t DLS::Region::VelocityRange

Definition at line 496 of file DLS.h.

## WaveLinkOptionFlags

uint16_t DLS::Region::WaveLinkOptionFlags

protected

Definition at line 516 of file DLS.h.

## WavePoolTableIndex

uint32_t DLS::Region::WavePoolTableIndex

protected

Definition at line 513 of file DLS.h.

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

- DLS.h
- DLS.cpp