FLUIDSYNTH: Prefer in-memory SoundFont data over global setting
When an engine provides in-memory SoundFont data, use that unless a SoundFont has been explicitly configured on the current game. Otherwise a global SoundFont setting will always override it. Even overriding the MIDI settings for the game and leaving the SoundFont setting blank did not work for me.
This commit is contained in:
parent
82f35b81ea
commit
b2a76b189b
1 changed files with 4 additions and 2 deletions
|
@ -167,7 +167,9 @@ int MidiDriver_FluidSynth::open() {
|
||||||
return MERR_ALREADY_OPEN;
|
return MERR_ALREADY_OPEN;
|
||||||
|
|
||||||
#if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
|
#if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
|
||||||
bool isUsingInMemorySoundFontData = _engineSoundFontData && !ConfMan.hasKey("soundfont");
|
// When provided with in-memory SoundFont data, only use the configured
|
||||||
|
// SoundFont instead if it's explicitly configured on the current game.
|
||||||
|
bool isUsingInMemorySoundFontData = _engineSoundFontData && !ConfMan.getActiveDomain()->contains("soundfont");
|
||||||
#else
|
#else
|
||||||
bool isUsingInMemorySoundFontData = false;
|
bool isUsingInMemorySoundFontData = false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -241,7 +243,7 @@ int MidiDriver_FluidSynth::open() {
|
||||||
|
|
||||||
fluid_synth_set_interp_method(_synth, -1, interpMethod);
|
fluid_synth_set_interp_method(_synth, -1, interpMethod);
|
||||||
|
|
||||||
const char *soundfont = ConfMan.hasKey("soundfont") ?
|
const char *soundfont = !isUsingInMemorySoundFontData ?
|
||||||
ConfMan.get("soundfont").c_str() : Common::String::format("&%p", (void *)_engineSoundFontData).c_str();
|
ConfMan.get("soundfont").c_str() : Common::String::format("&%p", (void *)_engineSoundFontData).c_str();
|
||||||
|
|
||||||
#if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
|
#if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue