From f9fe6a08a79595b7ceabe09b82d96685133f9bf0 Mon Sep 17 00:00:00 2001 From: skyjake Date: Sat, 14 Jul 2012 10:44:29 +0300 Subject: [PATCH] Audio: SF2 soundfonts with FMOD using FluidSynth When using dsFMOD, FluidSynth is automatically loaded in addition to FMOD's music interface for playing back MIDI using SF2 soundfonts. Todo for later: dsFluidSynth can always be loaded by default when the other SFX interfaces support streaming samples, too. --- doomsday/engine/portable/src/audiodriver.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doomsday/engine/portable/src/audiodriver.c b/doomsday/engine/portable/src/audiodriver.c index 84783b3aed..065380516f 100644 --- a/doomsday/engine/portable/src/audiodriver.c +++ b/doomsday/engine/portable/src/audiodriver.c @@ -157,7 +157,7 @@ static const char* getDriverName(audiodriverid_t id) /* AUDIOD_DUMMY */ "Dummy", /* AUDIOD_SDL_MIXER */ "SDLMixer", /* AUDIOD_OPENAL */ "OpenAL", - /* AUDIOD_FMOD */ "FMOD Ex", + /* AUDIOD_FMOD */ "FMOD", /* AUDIOD_FLUIDSYNTH */ "FluidSynth", /* AUDIOD_DSOUND */ "DirectSound", // Win32 only /* AUDIOD_WINMM */ "Windows Multimedia" // Win32 only @@ -348,6 +348,18 @@ static void selectInterfaces(audiodriverid_t defaultDriverId) appendInterface(&pos, AUDIO_IMUSIC, &audiodQuickTimeMusic); } #endif + + // At the moment, dsFMOD supports streaming samples so we can + // automatically load dsFluidSynth for MIDI music. + if(defaultDriverId == AUDIOD_FMOD) + { + initDriverIfNeeded("fluidsynth"); + if(isDriverInited(AUDIOD_FLUIDSYNTH)) + { + appendInterface(&pos, AUDIO_IMUSIC, &drivers[AUDIOD_FLUIDSYNTH].music); + } + } + if(defaultDriver->cd.gen.Init) appendInterface(&pos, AUDIO_ICD, &defaultDriver->cd); for(p = 1; p < CommandLine_Count() - 1 && pos < activeInterfaces + MAX_AUDIO_INTERFACES; p++)