The organization here is now the same as for the Timidity++ device, i.e. it is the device owning the instruments to give better control over their lifecycle.
* use std::string instead of FString
* replaced the single use of clamp with std::min/std::max.
* copied MAKE_ID macro into the source.
* use snprintf instead of mysnprintf
* use std::runtime_error instead of I_Error to abort on failed memory allocations.
The idea here is to decouple the actual reader creation from the code using them so that, for example, the Open function can decide if it wants to open the file regularly or memory mapped and return different readers as deemed useful. For that to work the exposed object needs to be an abstract wrapper so that this can be done without having to use pointers and all the drawbacks coming from that.
So far put to use in a few parts of the music code so the general functionality could be tested.
- implemented a fallback both for sound font lookup and for MIDI device selection so that if some non-working combination is set up, the player will fall back to something that works.
In file included from /usr/include/c++/6/math.h:36:0,
from src/vectors.h:43,
from src/sound/i_soundinternal.h:7,
from src/sound/i_sound.h:39,
from src/sound/i_musicinterns.h:5,
from src/sound/timidity/timidity.cpp:36:
/usr/include/c++/6/cmath:407:11: error: ‘::pow’ has not been declared
- allow the GUS to change sound fonts at run time.
- implemented sound font manager support in the GUS synth. This works but also made me realize that the SF2 support of this synth has been rather broken, apparently forever.
- added the missing handler for reading Timidity configs from the lump directory.
- fixed incomplete init of the GUS synth when no soundfont can be located.
- fixed bad initialization of WildMidi sampling frequency. It would default to 11.025 kHz if no valid rate was set. Now it will use the sound device's native frequency.
- added arrays to the config to hold entries for the softsynths' config files. This is not active yet, but will later be used to give the user a list of config options instead of having to type it by hand.