- 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( wadsrc )
add_subdirectory( src )
if( NOT WIN32 )
add_subdirectory( output_sdl )
endif( NOT WIN32 )

View file

@ -1,4 +1,10 @@
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
on Linux.
- 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)
{ "OSS", "OSS" },
{ "ALSA", "ALSA" },
{ "SDL", "SDL" },
{ "ESD", "ESD" },
#elif defined(__APPLE__)
{ "Sound Manager", "Sound Manager" },

View file

@ -54,6 +54,7 @@ extern HWND Window;
#include "v_text.h"
#include "v_video.h"
#include "v_palette.h"
#include "cmdlib.h"
// MACROS ------------------------------------------------------------------
@ -159,6 +160,7 @@ static const FEnumList OutputNames[] =
{ "OSS", FMOD_OUTPUTTYPE_OSS },
{ "ALSA", FMOD_OUTPUTTYPE_ALSA },
{ "ESD", FMOD_OUTPUTTYPE_ESD },
{ "SDL", 666 },
// Mac
{ "Sound Manager", FMOD_OUTPUTTYPE_SOUNDMANAGER },
@ -612,6 +614,7 @@ bool FMODSoundRenderer::Init()
ChannelGroupTargetUnit = NULL;
SfxReverbHooked = false;
SfxReverbPlaceholder = NULL;
OutputPlugin = 0;
Printf("I_InitSound: Initializing FMOD\n");
@ -692,11 +695,28 @@ bool FMODSoundRenderer::Init()
}
#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.
eval = Enum_NumForName(OutputNames, snd_output);
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)
{
Printf(TEXTCOLOR_BLUE"Setting output type '%s' failed. Using default instead. (Error %d)\n", *snd_output, result);
@ -704,7 +724,7 @@ bool FMODSoundRenderer::Init()
Sys->setOutput(FMOD_OUTPUTTYPE_AUTODETECT);
}
}
result = Sys->getNumDrivers(&driver);
#ifdef unix
if (result == FMOD_OK)
@ -1083,6 +1103,11 @@ void FMODSoundRenderer::Shutdown()
}
Sys->close();
if (OutputPlugin != 0)
{
Sys->unloadPlugin(OutputPlugin);
OutputPlugin = 0;
}
Sys->release();
Sys = NULL;
}

View file

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