SoundFontInfoLib
2.21.6
Library for parsing and rendering SF2 files
|
Templated collection of zones. More...
#include <ZoneCollection.hpp>
Public Types | |
using | Matches = typename std::vector< std::reference_wrapper< Kind const > > |
Public Member Functions | |
ZoneCollection (size_t zoneCount) | |
Construct a new collection that expects to hold the given number of elements. More... | |
size_t | size () const |
Matches | filter (int key, int velocity) const |
Locate the zone(s) that match the given key/velocity pair. More... | |
bool | hasGlobal () const |
const Kind * | global () const |
template<class... Args> | |
void | add (const IO::File &file, const Entity::Bag &bag, Args &&... values) |
Add a zone with the given args. More... | |
Templated collection of zones.
A non-global zone defines a range of MIDI keys and/or velocities over which it operates. The first zone can be a global
zone. The global zone defines the configuration settings that apply to all other zones.
using SF2::Render::ZoneCollection< Kind >::Matches = typename std::vector<std::reference_wrapper<Kind const> > |
|
inlineexplicit |
Construct a new collection that expects to hold the given number of elements.
zoneCount | the number of zones that the collection will hold |
|
inline |
Add a zone with the given args.
Note that empty zones (no generators and no modulators) are dropped, as are any global zones that are not the first zone.
file | the SF2 file with the entities to use |
bag | the definition for the Zone |
values | additional arguments for the Zone construction |
References SF2::Entity::Bag::generatorCount(), SF2::Entity::Bag::modulatorCount(), and values.
Referenced by SF2::Render::Instrument::Instrument(), and SF2::Render::Preset::Preset().
|
inline |
Locate the zone(s) that match the given key/velocity pair.
key | the MIDI key to filter on |
velocity | the MIDI velocity to filter on |
References SF2::Render::ZoneCollection< Kind >::hasGlobal().
Referenced by SF2::Render::Instrument::filter(), and SF2::Render::Preset::find().
|
inline |
References SF2::Render::ZoneCollection< Kind >::hasGlobal().
Referenced by SF2::Render::WithZones< T, E >::globalZone().
|
inline |
Referenced by SF2::Render::ZoneCollection< Kind >::filter(), SF2::Render::ZoneCollection< Kind >::global(), and SF2::Render::WithZones< T, E >::hasGlobalZone().
|
inline |