WildMIDI decoder.
More...
#include <DecoderWildmidi.h>
|
static auto | init (const std::string &configFile, int rate, bool hqResampling, bool reverb) -> bool |
| Initialize the WildMIDI library. More...
|
|
static void | quit () |
| Shut down the WildMIDI library. More...
|
|
template<class... Decoders> |
static auto | decoderFor (const std::string &filename) -> std::unique_ptr< Decoder > |
| Find and return an instance of the first decoder that can open the specified file. More...
|
|
template<class... Decoders> |
static auto | decoderFor (SDL_RWops *rwops) -> std::unique_ptr< Decoder > |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
|
|
static auto | decoderFor (const std::string &filename) -> std::unique_ptr< Decoder > |
| Find and return an instance of the first decoder that can open the specified file. More...
|
|
static auto | decoderFor (SDL_RWops *rwops) -> std::unique_ptr< Decoder > |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
|
|
|
auto | doDecoding (float buf[], int len, bool &callAgain) -> int override |
|
void | setIsOpen (bool f) |
|
virtual auto | doDecoding (float buf[], int len, bool &callAgain) -> int=0 |
|
WildMIDI decoder.
- Note
- Before creating any instances of this class, you need to initialize the WildMIDI library by calling the DecoderWildmidi::init() function once.
◆ DecoderWildmidi()
Aulib::DecoderWildmidi::DecoderWildmidi |
( |
| ) |
|
◆ ~DecoderWildmidi()
Aulib::DecoderWildmidi::~DecoderWildmidi |
( |
| ) |
|
|
override |
◆ doDecoding()
auto Aulib::DecoderWildmidi::doDecoding |
( |
float |
buf[], |
|
|
int |
len, |
|
|
bool & |
callAgain |
|
) |
| -> int |
|
overrideprotectedvirtual |
◆ duration()
auto Aulib::DecoderWildmidi::duration |
( |
| ) |
const -> std::chrono::microseconds |
|
overridevirtual |
◆ getChannels()
auto Aulib::DecoderWildmidi::getChannels |
( |
| ) |
const -> int |
|
overridevirtual |
◆ getRate()
auto Aulib::DecoderWildmidi::getRate |
( |
| ) |
const -> int |
|
overridevirtual |
◆ init()
static auto Aulib::DecoderWildmidi::init |
( |
const std::string & |
configFile, |
|
|
int |
rate, |
|
|
bool |
hqResampling, |
|
|
bool |
reverb |
|
) |
| -> bool |
|
static |
Initialize the WildMIDI library.
This needs to be called before creating any instances of this decoder.
- Parameters
-
configFile | Path to the wildmidi.cfg or timidity.cfg configuration file with which to initialize WildMIDI with. |
rate | Internal WildMIDI sampling rate in Hz. Must be between 11025 and 65000. |
hqResampling | Pass the WM_MO_ENHANCED_RESAMPLING flag to WildMIDI. By default libWildMidi uses linear interpolation for the resampling of the sound samples. Setting this option enables the library to use a resampling method that attempts to fill in the gaps giving richer sound. |
reverb | Pass the WM_MO_REVERB flag to WildMIDI. libWildMidi has an 8 reflection reverb engine. Use this option to give more depth to the output. |
- Returns
- Return values
-
true | WildMIDI was initialized sucessfully. |
false | WildMIDI could not be initialized. |
◆ open()
auto Aulib::DecoderWildmidi::open |
( |
SDL_RWops * |
rwops | ) |
-> bool |
|
overridevirtual |
◆ quit()
static void Aulib::DecoderWildmidi::quit |
( |
| ) |
|
|
static |
Shut down the WildMIDI library.
Shuts down the wildmidi library, resetting data and freeing up memory used by the library.
Once this is called, the library is no longer initialized and DecoderWildmidi::init() will need to be called again.
◆ rewind()
auto Aulib::DecoderWildmidi::rewind |
( |
| ) |
-> bool |
|
overridevirtual |
◆ seekToTime()
auto Aulib::DecoderWildmidi::seekToTime |
( |
std::chrono::microseconds |
pos | ) |
-> bool |
|
overridevirtual |