SF2cute
0.1
Modern C++ Library for SoundFont 2
|
The SoundFont class represents a SoundFont file. More...
#include <file.hpp>
Public Member Functions | |
SoundFont () | |
Constructs a new empty SoundFont. | |
SoundFont (const SoundFont &origin) | |
Constructs a new copy of specified SoundFont. More... | |
SoundFont & | operator= (const SoundFont &origin) |
Copy-assigns a new value to the SoundFont, replacing its current contents. More... | |
SoundFont (SoundFont &&origin) noexcept | |
Acquires the contents of specified SoundFont. More... | |
SoundFont & | operator= (SoundFont &&origin) noexcept |
Move-assigns a new value to the SoundFont, replacing its current contents. More... | |
~SoundFont ()=default | |
Destructs the SoundFont. | |
const std::vector< std::shared_ptr< SFPreset > > & | presets () const noexcept |
Returns the list of presets. More... | |
template<typename... Args> | |
std::shared_ptr< SFPreset > | NewPreset (Args &&...args) |
Adds a new preset to the SoundFont. More... | |
void | AddPreset (std::shared_ptr< SFPreset > preset) |
Adds a preset to the SoundFont. More... | |
void | RemovePreset (std::vector< std::shared_ptr< SFPreset >>::const_iterator position) |
Removes a preset from the SoundFont. More... | |
void | RemovePreset (std::vector< std::shared_ptr< SFPreset >>::const_iterator first, std::vector< std::shared_ptr< SFPreset >>::const_iterator last) |
Removes presets from the SoundFont. More... | |
void | RemovePresetIf (std::function< bool(const std::shared_ptr< SFPreset > &)> predicate) |
Removes presets from the SoundFont. More... | |
void | ClearPresets () noexcept |
Removes all of the presets. | |
const std::vector< std::shared_ptr< SFInstrument > > & | instruments () const noexcept |
Returns the list of instruments. More... | |
template<typename... Args> | |
std::shared_ptr< SFInstrument > | NewInstrument (Args &&...args) |
Adds a new instrument to the SoundFont. More... | |
void | AddInstrument (std::shared_ptr< SFInstrument > instrument) |
Adds an instrument to the SoundFont. More... | |
void | RemoveInstrument (std::vector< std::shared_ptr< SFInstrument >>::const_iterator position) |
Removes an instrument from the SoundFont. More... | |
void | RemoveInstrument (std::vector< std::shared_ptr< SFInstrument >>::const_iterator first, std::vector< std::shared_ptr< SFInstrument >>::const_iterator last) |
Removes instruments from the SoundFont. More... | |
void | RemoveInstrumentIf (std::function< bool(const std::shared_ptr< SFInstrument > &)> predicate) |
Removes instruments from the SoundFont. More... | |
void | ClearInstruments () noexcept |
Removes all of the instruments. | |
const std::vector< std::shared_ptr< SFSample > > & | samples () const noexcept |
Returns the list of samples. More... | |
template<typename... Args> | |
std::shared_ptr< SFSample > | NewSample (Args &&...args) |
Adds a new sample to the SoundFont. More... | |
void | AddSample (std::shared_ptr< SFSample > sample) |
Adds a sample to the SoundFont. More... | |
void | RemoveSample (std::vector< std::shared_ptr< SFSample >>::const_iterator position) |
Removes a sample from the SoundFont. More... | |
void | RemoveSample (std::vector< std::shared_ptr< SFSample >>::const_iterator first, std::vector< std::shared_ptr< SFSample >>::const_iterator last) |
Removes samples from the SoundFont. More... | |
void | RemoveSampleIf (std::function< bool(const std::shared_ptr< SFSample > &)> predicate) |
Removes samples from the SoundFont. More... | |
void | ClearSamples () noexcept |
Removes all of the samples. | |
const std::string & | sound_engine () const noexcept |
Returns the target sound engine. More... | |
void | set_sound_engine (std::string sound_engine) |
Sets the target sound engine. More... | |
const std::string & | bank_name () const noexcept |
Returns the SoundFont bank name. More... | |
void | set_bank_name (std::string bank_name) |
Sets the SoundFont bank name. More... | |
bool | has_rom_name () const noexcept |
Returns true if the SoundFont has a Sound ROM name. More... | |
const std::string & | rom_name () const noexcept |
Returns the Sound ROM name. More... | |
void | set_rom_name (std::string rom_name) |
Sets the Sound ROM name. More... | |
void | reset_rom_name () noexcept |
Resets the Sound ROM name. | |
bool | has_rom_version () const noexcept |
Returns true if the SoundFont has a Sound ROM version. More... | |
SFVersionTag | rom_version () const noexcept |
Returns the Sound ROM version. More... | |
void | set_rom_version (SFVersionTag rom_version) |
Sets the Sound ROM version. More... | |
void | reset_rom_version () noexcept |
Resets the Sound ROM version. | |
bool | has_creation_date () const noexcept |
Returns true if the SoundFont has a date of creation of the bank. More... | |
const std::string & | creation_date () const noexcept |
Returns the date of creation of the bank. More... | |
void | set_creation_date (std::string creation_date) |
Sets the date of creation of the bank. More... | |
void | reset_creation_date () noexcept |
Resets the date of creation of the bank. | |
bool | has_engineers () const noexcept |
Returns true if the SoundFont has the sound designers and engineers information for the bank. More... | |
const std::string & | engineers () const noexcept |
Returns the sound designers and engineers for the bank. More... | |
void | set_engineers (std::string engineers) |
Sets the sound designers and engineers for the bank. More... | |
void | reset_engineers () noexcept |
Resets the sound designers and engineers for the bank. | |
bool | has_product () const noexcept |
Returns true if the SoundFont has a product name for which the bank was intended. More... | |
const std::string & | product () const noexcept |
Returns the product name for which the bank was intended. More... | |
void | set_product (std::string product) |
Sets the product name for which the bank was intended. More... | |
void | reset_product () noexcept |
Resets the product name for which the bank was intended. | |
bool | has_copyright () const noexcept |
Returns true if the SoundFont has any copyright message. More... | |
const std::string & | copyright () const noexcept |
Returns the copyright message. More... | |
void | set_copyright (std::string copyright) |
Sets the copyright message. More... | |
void | reset_copyright () noexcept |
Resets the copyright message. | |
bool | has_comment () const noexcept |
Returns true if the SoundFont has any comments on the bank. More... | |
const std::string & | comment () const noexcept |
Returns the comments on the bank. More... | |
void | set_comment (std::string comment) |
Sets the comments on the bank. More... | |
void | reset_comment () noexcept |
Resets the comments on the bank. | |
bool | has_software () const noexcept |
Returns true if the SoundFont the information of SoundFont tools used to create and alter the bank. More... | |
const std::string & | software () const noexcept |
Returns the SoundFont tools used to create and alter the bank. More... | |
void | set_software (std::string software) |
Sets the SoundFont tools used to create and alter the bank. More... | |
void | reset_software () noexcept |
Resets the SoundFont tools used to create and alter the bank. | |
void | Write (const std::string &filename) |
Writes the SoundFont to a file. More... | |
void | Write (std::ostream &out) |
Writes the SoundFont to an output stream. More... | |
void | Write (std::ostream &&out) |
Writes the SoundFont to an output stream. More... | |
Static Public Attributes | |
static constexpr std::string::size_type | kInfoTextMaxLength = 256 - 1 |
Maximum length of text fields of INFO chunk (excluding the terminator byte), in terms of bytes. | |
sf2cute::SoundFont::SoundFont | ( | const SoundFont & | origin | ) |
|
noexcept |
void sf2cute::SoundFont::AddInstrument | ( | std::shared_ptr< SFInstrument > | instrument | ) |
void sf2cute::SoundFont::AddPreset | ( | std::shared_ptr< SFPreset > | preset | ) |
void sf2cute::SoundFont::AddSample | ( | std::shared_ptr< SFSample > | sample | ) |
|
noexcept |
|
noexcept |
Returns the comments on the bank.
|
noexcept |
Returns the copyright message.
|
noexcept |
Returns the date of creation of the bank.
|
noexcept |
Returns the sound designers and engineers for the bank.
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
Returns the list of instruments.
|
inline |
Adds a new instrument to the SoundFont.
args | the arguments for the SFInstrument constructor. |
std::invalid_argument | Instrument has already been owned by another file. |
|
inline |
|
inline |
|
noexcept |
Returns the list of presets.
|
noexcept |
Returns the product name for which the bank was intended.
void sf2cute::SoundFont::RemoveInstrument | ( | std::vector< std::shared_ptr< SFInstrument >>::const_iterator | position | ) |
Removes an instrument from the SoundFont.
position | the instrument to remove. |
void sf2cute::SoundFont::RemoveInstrument | ( | std::vector< std::shared_ptr< SFInstrument >>::const_iterator | first, |
std::vector< std::shared_ptr< SFInstrument >>::const_iterator | last | ||
) |
Removes instruments from the SoundFont.
first | the first instrument to remove. |
last | the last instrument to remove. |
void sf2cute::SoundFont::RemoveInstrumentIf | ( | std::function< bool(const std::shared_ptr< SFInstrument > &)> | predicate | ) |
Removes instruments from the SoundFont.
predicate | unary predicate which returns true if the instrument should be removed. |
void sf2cute::SoundFont::RemovePreset | ( | std::vector< std::shared_ptr< SFPreset >>::const_iterator | position | ) |
Removes a preset from the SoundFont.
position | the preset to remove. |
void sf2cute::SoundFont::RemovePreset | ( | std::vector< std::shared_ptr< SFPreset >>::const_iterator | first, |
std::vector< std::shared_ptr< SFPreset >>::const_iterator | last | ||
) |
Removes presets from the SoundFont.
first | the first preset to remove. |
last | the last preset to remove. |
void sf2cute::SoundFont::RemovePresetIf | ( | std::function< bool(const std::shared_ptr< SFPreset > &)> | predicate | ) |
Removes presets from the SoundFont.
predicate | unary predicate which returns true if the preset should be removed. |
void sf2cute::SoundFont::RemoveSample | ( | std::vector< std::shared_ptr< SFSample >>::const_iterator | position | ) |
Removes a sample from the SoundFont.
position | the sample to remove. |
void sf2cute::SoundFont::RemoveSample | ( | std::vector< std::shared_ptr< SFSample >>::const_iterator | first, |
std::vector< std::shared_ptr< SFSample >>::const_iterator | last | ||
) |
Removes samples from the SoundFont.
first | the first sample to remove. |
last | the last sample to remove. |
void sf2cute::SoundFont::RemoveSampleIf | ( | std::function< bool(const std::shared_ptr< SFSample > &)> | predicate | ) |
Removes samples from the SoundFont.
predicate | unary predicate which returns true if the sample should be removed. |
|
noexcept |
Returns the Sound ROM name.
|
noexcept |
Returns the Sound ROM version.
|
noexcept |
Returns the list of samples.
void sf2cute::SoundFont::set_bank_name | ( | std::string | bank_name | ) |
void sf2cute::SoundFont::set_comment | ( | std::string | comment | ) |
Sets the comments on the bank.
comment | the comments on the bank. |
void sf2cute::SoundFont::set_copyright | ( | std::string | copyright | ) |
Sets the copyright message.
copyright | the copyright message. |
void sf2cute::SoundFont::set_creation_date | ( | std::string | creation_date | ) |
Sets the date of creation of the bank.
creation_date | the date of creation of the bank. |
void sf2cute::SoundFont::set_engineers | ( | std::string | engineers | ) |
Sets the sound designers and engineers for the bank.
engineers | the sound designers and engineers for the bank. |
void sf2cute::SoundFont::set_product | ( | std::string | product | ) |
Sets the product name for which the bank was intended.
product | the product name for which the bank was intended. |
void sf2cute::SoundFont::set_rom_name | ( | std::string | rom_name | ) |
Sets the Sound ROM name.
rom_name | the Sound ROM name. |
void sf2cute::SoundFont::set_rom_version | ( | SFVersionTag | rom_version | ) |
Sets the Sound ROM version.
rom_version | the Sound ROM version. |
void sf2cute::SoundFont::set_software | ( | std::string | software | ) |
void sf2cute::SoundFont::set_sound_engine | ( | std::string | sound_engine | ) |
Sets the target sound engine.
sound_engine | the target sound engine name. |
|
noexcept |
|
noexcept |
Returns the target sound engine.
void sf2cute::SoundFont::Write | ( | const std::string & | filename | ) |
void sf2cute::SoundFont::Write | ( | std::ostream & | out | ) |
Writes the SoundFont to an output stream.
out | the output stream to write to. |
void sf2cute::SoundFont::Write | ( | std::ostream && | out | ) |
Writes the SoundFont to an output stream.
out | the output stream to write to. |