- Added an SDL output plugin, so FMOD can produce sound using SDL's audio

support instead of its own OSS/ALSA/ESD support. This is selectable by
  setting snd_output to "sdl".



SVN r1473 (trunk)
This commit is contained in:
Randy Heit 2009-03-11 04:56:43 +00:00
parent 47abeec7d9
commit aee99c2bd0
5 changed files with 39 additions and 2 deletions

View file

@ -90,3 +90,7 @@ add_subdirectory( dumb )
add_subdirectory( gdtoa ) add_subdirectory( gdtoa )
add_subdirectory( wadsrc ) add_subdirectory( wadsrc )
add_subdirectory( src ) add_subdirectory( src )
if( NOT WIN32 )
add_subdirectory( output_sdl )
endif( NOT WIN32 )

View file

@ -1,4 +1,10 @@
March 10, 2009 March 10, 2009
- Added an SDL output plugin, so FMOD can produce sound using SDL's audio
support instead of its own OSS/ALSA/ESD support. This is selectable by
setting snd_output to "sdl".
- Fixed: On Linux systems with ALSA but no OSS support, trying to start
the sound system with snd_output "default" would fail instead of trying
to use ALSA.
- Added sdl_nokeyrepeat to disable key repeating in the menus and console - Added sdl_nokeyrepeat to disable key repeating in the menus and console
on Linux. on Linux.
- Added support for zip/pk3 files with LZMA and bzip2 compression to ZDoom. - Added support for zip/pk3 files with LZMA and bzip2 compression to ZDoom.

View file

@ -1218,6 +1218,7 @@ static valueenum_t Outputs[] =
#elif defined(unix) #elif defined(unix)
{ "OSS", "OSS" }, { "OSS", "OSS" },
{ "ALSA", "ALSA" }, { "ALSA", "ALSA" },
{ "SDL", "SDL" },
{ "ESD", "ESD" }, { "ESD", "ESD" },
#elif defined(__APPLE__) #elif defined(__APPLE__)
{ "Sound Manager", "Sound Manager" }, { "Sound Manager", "Sound Manager" },

View file

@ -54,6 +54,7 @@ extern HWND Window;
#include "v_text.h" #include "v_text.h"
#include "v_video.h" #include "v_video.h"
#include "v_palette.h" #include "v_palette.h"
#include "cmdlib.h"
// MACROS ------------------------------------------------------------------ // MACROS ------------------------------------------------------------------
@ -159,6 +160,7 @@ static const FEnumList OutputNames[] =
{ "OSS", FMOD_OUTPUTTYPE_OSS }, { "OSS", FMOD_OUTPUTTYPE_OSS },
{ "ALSA", FMOD_OUTPUTTYPE_ALSA }, { "ALSA", FMOD_OUTPUTTYPE_ALSA },
{ "ESD", FMOD_OUTPUTTYPE_ESD }, { "ESD", FMOD_OUTPUTTYPE_ESD },
{ "SDL", 666 },
// Mac // Mac
{ "Sound Manager", FMOD_OUTPUTTYPE_SOUNDMANAGER }, { "Sound Manager", FMOD_OUTPUTTYPE_SOUNDMANAGER },
@ -612,6 +614,7 @@ bool FMODSoundRenderer::Init()
ChannelGroupTargetUnit = NULL; ChannelGroupTargetUnit = NULL;
SfxReverbHooked = false; SfxReverbHooked = false;
SfxReverbPlaceholder = NULL; SfxReverbPlaceholder = NULL;
OutputPlugin = 0;
Printf("I_InitSound: Initializing FMOD\n"); Printf("I_InitSound: Initializing FMOD\n");
@ -692,11 +695,28 @@ bool FMODSoundRenderer::Init()
} }
#endif #endif
#ifndef _WIN32
// Try to load SDL output plugin
result = Sys->setPluginPath(progdir); // Should we really look for it in the program directory?
result = Sys->loadPlugin("liboutput_sdl.so", &OutputPlugin);
if (result != FMOD_OK)
{
OutputPlugin = 0;
}
#endif
// Set the user specified output mode. // Set the user specified output mode.
eval = Enum_NumForName(OutputNames, snd_output); eval = Enum_NumForName(OutputNames, snd_output);
if (eval >= 0) if (eval >= 0)
{ {
result = Sys->setOutput(FMOD_OUTPUTTYPE(eval)); if (eval == 666 && OutputPlugin != 0)
{
result = Sys->setOutputByPlugin(OutputPlugin);
}
else
{
result = Sys->setOutput(FMOD_OUTPUTTYPE(eval));
}
if (result != FMOD_OK) if (result != FMOD_OK)
{ {
Printf(TEXTCOLOR_BLUE"Setting output type '%s' failed. Using default instead. (Error %d)\n", *snd_output, result); Printf(TEXTCOLOR_BLUE"Setting output type '%s' failed. Using default instead. (Error %d)\n", *snd_output, result);
@ -1083,6 +1103,11 @@ void FMODSoundRenderer::Shutdown()
} }
Sys->close(); Sys->close();
if (OutputPlugin != 0)
{
Sys->unloadPlugin(OutputPlugin);
OutputPlugin = 0;
}
Sys->release(); Sys->release();
Sys = NULL; Sys = NULL;
} }

View file

@ -98,6 +98,7 @@ private:
FMOD::DSP *SfxReverbPlaceholder; FMOD::DSP *SfxReverbPlaceholder;
bool SfxReverbHooked; bool SfxReverbHooked;
float LastWaterLP; float LastWaterLP;
unsigned int OutputPlugin;
// Just for snd_status display // Just for snd_status display
int Driver_MinFrequency; int Driver_MinFrequency;