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

Memory layout of 'phdr' entry in sound font. More...

#include <Preset.hpp>

Inherits SF2::Entity::Entity.

Public Member Functions

 Preset (IO::Pos &pos)
 Construct from contents of file. More...
 
char const * name () const
 
uint16_t preset () const
 
uint16_t bank () const
 
uint16_t firstZoneIndex () const
 
uint16_t zoneCount () const
 
void dump (const std::string &indent, int index) const
 

Static Public Attributes

constexpr static size_t size = 38
 

Detailed Description

Memory layout of 'phdr' entry in sound font.

The size of this is defined to be 38 bytes, but due to alignment/padding the struct below is 40 bytes.

Constructor & Destructor Documentation

◆ Preset()

SF2::Entity::Preset::Preset ( IO::Pos pos)
inlineexplicit

Construct from contents of file.

Parameters
poslocation to read from

References SF2::IO::Pos::readInto(), size, and SF2::IO::trim_property().

Member Function Documentation

◆ bank()

uint16_t SF2::Entity::Preset::bank ( ) const
inline
Returns
bank number for the patch

Referenced by dump(), and SF2::IO::Parser::parse().

◆ dump()

void Preset::dump ( const std::string &  indent,
int  index 
) const

◆ firstZoneIndex()

uint16_t SF2::Entity::Preset::firstZoneIndex ( ) const
inline
Returns
the index of the first zone of the preset

Referenced by dump(), SF2::Render::Preset::Preset(), and zoneCount().

◆ name()

char const* SF2::Entity::Preset::name ( ) const
inline
Returns
name of the preset

Referenced by dump(), and SF2::IO::Parser::parse().

◆ preset()

uint16_t SF2::Entity::Preset::preset ( ) const
inline
Returns
preset number for this patch

Referenced by dump(), and SF2::IO::Parser::parse().

◆ zoneCount()

uint16_t SF2::Entity::Preset::zoneCount ( ) const
inline
Returns
the number of preset zones

References SF2::Entity::Entity::calculateSize(), firstZoneIndex(), and SF2::Entity::Entity::next().

Referenced by dump(), and SF2::Render::Preset::Preset().

Member Data Documentation

◆ size

constexpr static size_t SF2::Entity::Preset::size = 38
staticconstexpr

Referenced by Preset().


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