SoundFontInfoLib  2.21.6
Library for parsing and rendering SF2 files
SF2::Entity::Entity Struct Reference

Base class that offers common functionality for working with entities that are part of a collection. More...

#include <Entity.hpp>

Inherited by SF2::Entity::Bag [private], SF2::Entity::Instrument [private], and SF2::Entity::Preset [private].

Static Public Member Functions

static uint16_t calculateSize (uint16_t next, uint16_t current)
 Calculate the number of bag elements between to items. More...
 
template<typename T >
static const T & next (const T *obj)
 Obtain reference to the next item in a collection. More...
 

Detailed Description

Base class that offers common functionality for working with entities that are part of a collection.

Member Function Documentation

◆ calculateSize()

static uint16_t SF2::Entity::Entity::calculateSize ( uint16_t  next,
uint16_t  current 
)
inlinestatic

Calculate the number of bag elements between to items.

Parameters
nextthe bag index from the following item in the collection
currentthe bag index from the current item in the collection

References next().

Referenced by SF2::Entity::Bag::generatorCount(), SF2::Entity::Bag::modulatorCount(), SF2::Entity::Instrument::zoneCount(), and SF2::Entity::Preset::zoneCount().

◆ next()

template<typename T >
static const T& SF2::Entity::Entity::next ( const T *  obj)
inlinestatic

Obtain reference to the next item in a collection.

For a valid SF2 file, this is OK to do because all collections contain a sentinel value to mark the end of the collection.

Parameters
objthe object address to calculate with
Returns
reference to next object

Referenced by calculateSize(), SF2::Entity::Bag::generatorCount(), SF2::Entity::Bag::modulatorCount(), SF2::Entity::Instrument::zoneCount(), and SF2::Entity::Preset::zoneCount().


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