SoundFontInfoLib
2.21.6
Library for parsing and rendering SF2 files
|
Define the audio samples to be used for playing a specific sound. More...
#include <SampleHeader.hpp>
Public Types | |
enum | Type { monoSample = 1 , rightSample = 2 , leftSample = 4 , linkedSample = 8 , rom = 0x8000 } |
Public Member Functions | |
SampleHeader (IO::Pos &pos) | |
Construct new instance from SF2 file. More... | |
SampleHeader (uint32_t start, uint32_t end, uint32_t loopBegin, uint32_t loopEnd, uint32_t sampleRate, uint8_t key, int8_t adjustment) | |
Construct instance for unit tests. More... | |
bool | isMono () const |
bool | isRight () const |
bool | isLeft () const |
bool | isROM () const |
size_t | startIndex () const |
size_t | endIndex () const |
size_t | startLoopIndex () const |
size_t | endLoopIndex () const |
size_t | sampleRate () const |
short | originalMIDIKey () const |
short | pitchCorrection () const |
void | dump (const std::string &indent, int index) const |
Static Public Attributes | |
constexpr static size_t | size = 46 |
Define the audio samples to be used for playing a specific sound.
Memory layout of a 'shdr' entry. The size of this is defined to be 46 bytes, but due to alignment/padding the struct below is 48 bytes.
The offsets (begin, end, loopBegin, and loopEnd) are indices into a big array of 16-bit integer sample values.
|
inlineexplicit |
Construct new instance from SF2 file.
References SF2::IO::Pos::readInto(), size, and SF2::IO::trim_property().
|
inline |
Construct instance for unit tests.
void SampleHeader::dump | ( | const std::string & | indent, |
int | index | ||
) | const |
|
inline |
Referenced by SF2::Render::Sample::Bounds::Bounds().
|
inline |
Referenced by SF2::Render::Sample::Bounds::Bounds().
|
inline |
References leftSample.
|
inline |
References monoSample.
|
inline |
References rightSample.
|
inline |
References rom.
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by SF2::Render::Sample::Bounds::Bounds().
|
inline |
Referenced by SF2::Render::Sample::Bounds::Bounds().
|
staticconstexpr |
Referenced by SampleHeader().