SoundFontInfoLib  2.21.6
Library for parsing and rendering SF2 files
SF2::Render::PresetZone Class Reference

A specialization of a Zone for a Preset. More...

#include <PresetZone.hpp>

Inherits SF2::Render::Zone.

Public Member Functions

 PresetZone (const IO::File &file, const Entity::Bag &bag, const Render::InstrumentCollection &instruments)
 Construct new zone from entity in file. More...
 
void refine (Voice::State &state) const
 Apply the zone generator values to the given voice state. More...
 
const Render::Instrumentinstrument () const
 
- Public Member Functions inherited from SF2::Render::Zone
const MIDIRangekeyRange () const
 
const MIDIRangevelocityRange () const
 
const GeneratorCollectiongenerators () const
 
const ModulatorCollectionmodulators () const
 
bool isGlobal () const
 
bool appliesTo (int key, int velocity) const
 Determines if this zone applies to a given MIDI key/velocity pair. More...
 

Additional Inherited Members

- Public Types inherited from SF2::Render::Zone
using GeneratorCollection = IO::ChunkItems< Entity::Generator::Generator >::ItemRefCollection
 
using ModulatorCollection = IO::ChunkItems< Entity::Modulator::Modulator >::ItemRefCollection
 
- Static Public Attributes inherited from SF2::Render::Zone
static MIDIRange const all = MIDIRange(0, 255)
 A range that always returns true for any MIDI value. More...
 
- Protected Member Functions inherited from SF2::Render::Zone
 Zone (GeneratorCollection &&gens, ModulatorCollection &&mods, Entity::Generator::Index terminal)
 Constructor. More...
 
uint16_t resourceLink () const
 Obtain the link to the resource used by this zone. More...
 
void apply (Voice::State &state) const
 Apply the instrument zone to the given voice state. More...
 
void refine (Voice::State &state) const
 Apply the zone to the given voice state by adjusting the value using the generator in the zone. More...
 

Detailed Description

A specialization of a Zone for a Preset.

Non-global Preset zones refer to an Instrument.

Constructor & Destructor Documentation

◆ PresetZone()

SF2::Render::PresetZone::PresetZone ( const IO::File file,
const Entity::Bag bag,
const Render::InstrumentCollection instruments 
)
inline

Construct new zone from entity in file.

Parameters
filethe file to work with
instrumentsto collection of instruments found in the file
bagthe zone definition

Member Function Documentation

◆ instrument()

const Render::Instrument& SF2::Render::PresetZone::instrument ( ) const
inline
Returns
the Instrument configured for this zone

◆ refine()

void SF2::Render::PresetZone::refine ( Voice::State state) const
inline

Apply the zone generator values to the given voice state.

Unlike instrument zones, those of a Preset only refine existing values.

Parameters
statethe state to update

References SF2::Render::Zone::refine().

Referenced by SF2::Render::Voice::Setup::apply().


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