Skip to content

Commit

Permalink
Audio: SF2 soundfonts with FMOD using FluidSynth
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
skyjake committed Jul 14, 2012
1 parent feebfbc commit f9fe6a0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion doomsday/engine/portable/src/audiodriver.c
Expand Up @@ -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
Expand Down Expand Up @@ -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++)
Expand Down

0 comments on commit f9fe6a0

Please sign in to comment.