mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-03-02 07:21:58 +00:00
Load default soundfont if midi files specified but no soundfont
It makes little sense to play midi files without a soundfont, so try to load the default one in that use case.
This commit is contained in:
parent
fda26d6b24
commit
36e8257065
1 changed files with 10 additions and 0 deletions
|
@ -705,6 +705,16 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
if (player != NULL) {
|
||||
|
||||
if (fluid_synth_get_sfont(synth, 0) == NULL) {
|
||||
/* Try to load the default soundfont if no soundfont specified */
|
||||
char *s;
|
||||
if (fluid_settings_getstr(settings, "synth.default-soundfont", &s) <= 0)
|
||||
s = NULL;
|
||||
if ((s != NULL) && (s[0] != '\0'))
|
||||
fluid_synth_sfload(synth, s, 1);
|
||||
}
|
||||
|
||||
fluid_player_play(player);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue