mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +00:00
- Backported FMOD Ex 4.34 fixes from gzdoom-macosx. (With changes to continue to allow compilation with 4.22-4.28.)
SVN r3278 (trunk)
This commit is contained in:
parent
ba4630f0df
commit
f42358ad08
3 changed files with 23 additions and 3 deletions
|
@ -1,3 +1,3 @@
|
||||||
This version of ZDoom must be compiled with any version between 4.22 and 4.28 inclusive.
|
This version of ZDoom must be compiled with any version between 4.22 and 4.28 inclusive or 4.34.
|
||||||
Use of the latest 4.26 is recommended though due to technical issues with 4.28.
|
Use of the latest 4.26 is recommended though due to technical issues with 4.28.
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,10 @@ extern HWND Window;
|
||||||
|
|
||||||
#define SPECTRUM_SIZE 256
|
#define SPECTRUM_SIZE 256
|
||||||
|
|
||||||
|
#if FMOD_VERSION < 0x43400
|
||||||
|
#define FMOD_OPENSTATE_PLAYING FMOD_OPENSTATE_STREAMING
|
||||||
|
#endif
|
||||||
|
|
||||||
// TYPES -------------------------------------------------------------------
|
// TYPES -------------------------------------------------------------------
|
||||||
|
|
||||||
struct FEnumList
|
struct FEnumList
|
||||||
|
@ -157,7 +161,9 @@ static const FEnumList OutputNames[] =
|
||||||
{ "Windows Multimedia", FMOD_OUTPUTTYPE_WINMM },
|
{ "Windows Multimedia", FMOD_OUTPUTTYPE_WINMM },
|
||||||
{ "WinMM", FMOD_OUTPUTTYPE_WINMM },
|
{ "WinMM", FMOD_OUTPUTTYPE_WINMM },
|
||||||
{ "WaveOut", FMOD_OUTPUTTYPE_WINMM },
|
{ "WaveOut", FMOD_OUTPUTTYPE_WINMM },
|
||||||
|
#if FMOD_VERSION < 0x43400
|
||||||
{ "OpenAL", FMOD_OUTPUTTYPE_OPENAL },
|
{ "OpenAL", FMOD_OUTPUTTYPE_OPENAL },
|
||||||
|
#endif
|
||||||
{ "WASAPI", FMOD_OUTPUTTYPE_WASAPI },
|
{ "WASAPI", FMOD_OUTPUTTYPE_WASAPI },
|
||||||
{ "ASIO", FMOD_OUTPUTTYPE_ASIO },
|
{ "ASIO", FMOD_OUTPUTTYPE_ASIO },
|
||||||
|
|
||||||
|
@ -165,6 +171,9 @@ 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 },
|
||||||
|
#if FMOD_VERSION >= 0x43400
|
||||||
|
{ "PulseAudio", FMOD_OUTPUTTYPE_PULSEAUDIO },
|
||||||
|
#endif
|
||||||
{ "SDL", 666 },
|
{ "SDL", 666 },
|
||||||
|
|
||||||
// Mac
|
// Mac
|
||||||
|
@ -388,12 +397,17 @@ public:
|
||||||
bool is;
|
bool is;
|
||||||
FMOD_OPENSTATE openstate = FMOD_OPENSTATE_MAX;
|
FMOD_OPENSTATE openstate = FMOD_OPENSTATE_MAX;
|
||||||
bool starving;
|
bool starving;
|
||||||
|
bool diskbusy;
|
||||||
|
|
||||||
if (Stream == NULL)
|
if (Stream == NULL)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#if FMOD_VERSION < 0x43400
|
||||||
if (FMOD_OK != Stream->getOpenState(&openstate, NULL, &starving))
|
if (FMOD_OK != Stream->getOpenState(&openstate, NULL, &starving))
|
||||||
|
#else
|
||||||
|
if (FMOD_OK != Stream->getOpenState(&openstate, NULL, &starving, &diskbusy))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
openstate = FMOD_OPENSTATE_ERROR;
|
openstate = FMOD_OPENSTATE_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -436,7 +450,7 @@ public:
|
||||||
Owner->Sys->setStreamBufferSize(16*1024, FMOD_TIMEUNIT_RAWBYTES);
|
Owner->Sys->setStreamBufferSize(16*1024, FMOD_TIMEUNIT_RAWBYTES);
|
||||||
return result != FMOD_OK;
|
return result != FMOD_OK;
|
||||||
}
|
}
|
||||||
if (JustStarted && openstate == FMOD_OPENSTATE_STREAMING)
|
if (JustStarted && openstate == FMOD_OPENSTATE_PLAYING)
|
||||||
{
|
{
|
||||||
JustStarted = false;
|
JustStarted = false;
|
||||||
}
|
}
|
||||||
|
@ -480,14 +494,19 @@ public:
|
||||||
unsigned int percentbuffered;
|
unsigned int percentbuffered;
|
||||||
unsigned int position;
|
unsigned int position;
|
||||||
bool starving;
|
bool starving;
|
||||||
|
bool diskbusy;
|
||||||
float volume;
|
float volume;
|
||||||
float frequency;
|
float frequency;
|
||||||
bool paused;
|
bool paused;
|
||||||
bool isplaying;
|
bool isplaying;
|
||||||
|
|
||||||
|
#if FMOD_VERSION < 0x43400
|
||||||
if (FMOD_OK == Stream->getOpenState(&openstate, &percentbuffered, &starving))
|
if (FMOD_OK == Stream->getOpenState(&openstate, &percentbuffered, &starving))
|
||||||
|
#else
|
||||||
|
if (FMOD_OK == Stream->getOpenState(&openstate, &percentbuffered, &starving, &diskbusy))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
stats = (openstate <= FMOD_OPENSTATE_STREAMING ? OpenStateNames[openstate] : "Unknown state");
|
stats = (openstate <= FMOD_OPENSTATE_PLAYING ? OpenStateNames[openstate] : "Unknown state");
|
||||||
stats.AppendFormat(",%3d%% buffered, %s", percentbuffered, starving ? "Starving" : "Well-fed");
|
stats.AppendFormat(",%3d%% buffered, %s", percentbuffered, starving ? "Starving" : "Well-fed");
|
||||||
}
|
}
|
||||||
if (Channel == NULL)
|
if (Channel == NULL)
|
||||||
|
|
|
@ -1266,6 +1266,7 @@ OptionString SoundOutputsUnix
|
||||||
"ALSA", "ALSA"
|
"ALSA", "ALSA"
|
||||||
"SDL", "SDL"
|
"SDL", "SDL"
|
||||||
"ESD", "ESD"
|
"ESD", "ESD"
|
||||||
|
"PulseAudio", "PulseAudio"
|
||||||
"No sound", "No sound"
|
"No sound", "No sound"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue