libgig  4.3.0
DLS::Sampler Class Reference

Abstract base class which provides mandatory informations about sample players in general. More...

#include <DLS.h>

Inheritance diagram for DLS::Sampler:
DLS::Storage DLS::Region gig::DimensionRegion gig::Region

Public Member Functions

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 UpdateChunks (progress_t *pProgress)
 Apply all sample player options to the respective RIFF chunk. More...
 
virtual void DeleteChunks ()
 Remove all RIFF chunks associated with this Sampler object. More...
 
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

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 Member Functions

 Sampler (RIFF::List *ParentList)
 

Protected Attributes

RIFF::ListpParentList
 
uint32_t uiHeaderSize
 
uint32_t SamplerOptions
 

Detailed Description

Abstract base class which provides mandatory informations about sample players in general.

Definition at line 424 of file DLS.h.

Member Function Documentation

◆ AddSampleLoop()

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

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

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

◆ CopyAssign()

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

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

References Gain, pSampleLoops, and SampleLoops.

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

◆ DeleteChunks()

void DLS::Sampler::DeleteChunks ( )
virtual

Remove all RIFF chunks associated with this Sampler object.

At the moment Sampler::DeleteChunks() does nothing. It is recommended to call this method explicitly though from deriving classes's own overridden implementation of this method to avoid potential future compatiblity issues.

See Storage::DeleteChunks() for details.

Implements DLS::Storage.

Reimplemented in DLS::Region.

Definition at line 698 of file DLS.cpp.

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

◆ DeleteSampleLoop()

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

Deletes an existing sample loop.

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

Definition at line 728 of file DLS.cpp.

References pSampleLoops, and SampleLoops.

◆ UpdateChunks()

void DLS::Sampler::UpdateChunks ( progress_t pProgress)
virtual

Apply all sample player options to the respective RIFF chunk.

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

Parameters
pProgress- callback function for progress notification

Implements DLS::Storage.

Reimplemented in gig::Region, gig::DimensionRegion, and DLS::Region.

Definition at line 657 of file DLS.cpp.

References RIFF::List::AddSubChunk(), Gain, RIFF::Chunk::GetSize(), RIFF::List::GetSubChunk(), RIFF::Chunk::LoadChunkData(), pSampleLoops, RIFF::Chunk::Resize(), and SampleLoops.

Referenced by DLS::Region::UpdateChunks(), and gig::DimensionRegion::UpdateChunks().

Member Data Documentation

◆ Gain

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

Definition at line 428 of file DLS.h.

Referenced by CopyAssign(), gig::DimensionRegion::SetGain(), and UpdateChunks().


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