mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
Added check for patch set existence before loading in FluidSynth
This helps to avoid flooding of output with the following messages on every MIDI song change: fluidsynth: error: Unable to open file "/usr/share/sounds/sf2/FluidR3_GS.sf2" fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont "/usr/share/sounds/sf2/FluidR3_GS.sf2" fluidsynth: error: Unable to open file "/usr/share/sounds/sf2/FluidR3_GM.sf2" fluidsynth: error: Couldn't load soundfont file fluidsynth: error: Failed to load SoundFont "/usr/share/sounds/sf2/FluidR3_GM.sf2"
This commit is contained in:
parent
1cd7297cd8
commit
f0d40d6a8a
1 changed files with 11 additions and 4 deletions
|
@ -526,6 +526,8 @@ int FluidSynthMIDIDevice::LoadPatchSets(const char *patches)
|
|||
{
|
||||
path = NicePath(tok);
|
||||
}
|
||||
if (FileExists(path))
|
||||
{
|
||||
if (FLUID_FAILED != fluid_synth_sfload(FluidSynth, path, count == 0))
|
||||
{
|
||||
DPrintf(DMSG_NOTIFY, "Loaded patch set %s.\n", tok);
|
||||
|
@ -535,6 +537,11 @@ int FluidSynthMIDIDevice::LoadPatchSets(const char *patches)
|
|||
{
|
||||
DPrintf(DMSG_ERROR, "Failed to load patch set %s.\n", tok);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DPrintf(DMSG_ERROR, "Could not find patch set %s.\n", tok);
|
||||
}
|
||||
tok = strtok(NULL, delim);
|
||||
}
|
||||
free(wpatches);
|
||||
|
|
Loading…
Reference in a new issue