SoundFontInfoLib  2.21.6
Library for parsing and rendering SF2 files
SF2::IO::File Class Reference

Represents an SF2 file. More...

#include <File.hpp>

Public Member Functions

 File (int fd, size_t size)
 Constructor. More...
 
const std::string & embeddedName () const
 
const std::string & embeddedAuthor () const
 
const std::string & embeddedComment () const
 
const std::string & embeddedCopyright () const
 
const ChunkItems< Entity::Preset > & presets () const
 
const ChunkItems< Entity::Bag > & presetZones () const
 
const ChunkItems< Entity::Generator::Generator > & presetZoneGenerators () const
 
const ChunkItems< Entity::Modulator::Modulator > & presetZoneModulators () const
 
const ChunkItems< Entity::Instrument > & instruments () const
 
const ChunkItems< Entity::Bag > & instrumentZones () const
 
const ChunkItems< Entity::Generator::Generator > & instrumentZoneGenerators () const
 
const ChunkItems< Entity::Modulator::Modulator > & instrumentZoneModulators () const
 
const ChunkItems< Entity::SampleHeader > & sampleHeaders () const
 
const Render::Sample::CanonicalBuffersampleBuffer (uint16_t index) const
 Obtain a SampleBuffer at the given sample header index. More...
 
void dumpThreaded () const
 
void dump () const
 

Detailed Description

Represents an SF2 file.

The constructor will process the entire file to validate its integrity and record the locations of the nine entities that define an SF2 file. It also extracts certain meta data items from various chunks such as the embedded name, author, and copyright statement.

Constructor & Destructor Documentation

◆ File()

File::File ( int  fd,
size_t  size 
)

Member Function Documentation

◆ dump()

◆ dumpThreaded()

◆ embeddedAuthor()

const std::string& SF2::IO::File::embeddedAuthor ( ) const
inline
Returns
the embedded author name in the file

◆ embeddedComment()

const std::string& SF2::IO::File::embeddedComment ( ) const
inline
Returns
any embedded comment in the file

◆ embeddedCopyright()

const std::string& SF2::IO::File::embeddedCopyright ( ) const
inline
Returns
any embedded copyright notice in the file

◆ embeddedName()

const std::string& SF2::IO::File::embeddedName ( ) const
inline
Returns
the embedded name in the file

◆ instruments()

const ChunkItems<Entity::Instrument>& SF2::IO::File::instruments ( ) const
inline
Returns
reference to instrument definitions found in the file

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

◆ instrumentZoneGenerators()

const ChunkItems<Entity::Generator::Generator>& SF2::IO::File::instrumentZoneGenerators ( ) const
inline
Returns
reference to instrument zone generator definitions

Referenced by dump().

◆ instrumentZoneModulators()

const ChunkItems<Entity::Modulator::Modulator>& SF2::IO::File::instrumentZoneModulators ( ) const
inline
Returns
reference to instrument zone modulator definitions

Referenced by dump().

◆ instrumentZones()

const ChunkItems<Entity::Bag>& SF2::IO::File::instrumentZones ( ) const
inline
Returns
reference to instrument zone definitions

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

◆ presets()

const ChunkItems<Entity::Preset>& SF2::IO::File::presets ( ) const
inline
Returns
reference to preset definitions found in the file

Referenced by dump().

◆ presetZoneGenerators()

const ChunkItems<Entity::Generator::Generator>& SF2::IO::File::presetZoneGenerators ( ) const
inline
Returns
reference to preset zone generator definitions

Referenced by dump().

◆ presetZoneModulators()

const ChunkItems<Entity::Modulator::Modulator>& SF2::IO::File::presetZoneModulators ( ) const
inline
Returns
reference to preset zone modulator definitions

Referenced by dump().

◆ presetZones()

const ChunkItems<Entity::Bag>& SF2::IO::File::presetZones ( ) const
inline
Returns
reference to preset zone definitions

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

◆ sampleBuffer()

const Render::Sample::CanonicalBuffer& SF2::IO::File::sampleBuffer ( uint16_t  index) const
inline

Obtain a SampleBuffer at the given sample header index.

Parameters
indexthe index of the buffer to obtain
Returns
SampleBuffer reference

◆ sampleHeaders()

const ChunkItems<Entity::SampleHeader>& SF2::IO::File::sampleHeaders ( ) const
inline
Returns
reference to samples definitions

Referenced by dump().


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