Browse Source

Upgraded FMOD to version 2.00.16 (Core libraries only) and included 64-bit Windows libraries. Updated API's where necessary and removed all of the CD audio stuff as FMOD doesn't seem to support this anymore, and we're not interested in it anyway.

console
Nico de Poel 5 years ago
parent
commit
75f0382070
  1. 8
      Assets/Plugins.meta
  2. 8
      Assets/Plugins/windows.meta
  3. 8
      Assets/Plugins/windows/x86.meta
  4. BIN
      Assets/Plugins/windows/x86/fmod.dll
  5. 63
      Assets/Plugins/windows/x86/fmod.dll.meta
  6. BIN
      Assets/Plugins/windows/x86/fmodL.dll
  7. 63
      Assets/Plugins/windows/x86/fmodL.dll.meta
  8. BIN
      Assets/Plugins/windows/x86/fmodexL.dll
  9. 8
      Assets/Plugins/windows/x86_64.meta
  10. BIN
      Assets/Plugins/windows/x86_64/fmod.dll
  11. 63
      Assets/Plugins/windows/x86_64/fmod.dll.meta
  12. BIN
      Assets/Plugins/windows/x86_64/fmodL.dll
  13. 63
      Assets/Plugins/windows/x86_64/fmodL.dll.meta
  14. 362
      engine/code/snd_fmod.c
  15. BIN
      engine/fmod-4/fmodex.dll
  16. BIN
      engine/fmod-4/fmodexL.dll
  17. 2473
      engine/fmod-4/inc/fmod.h
  18. 609
      engine/fmod-4/inc/fmod.hpp
  19. 159
      engine/fmod-4/inc/fmod_codec.h
  20. 746
      engine/fmod-4/inc/fmod_dsp.h
  21. 123
      engine/fmod-4/inc/fmod_errors.h
  22. 201
      engine/fmod-4/inc/fmod_memoryinfo.h
  23. 93
      engine/fmod-4/inc/fmod_output.h
  24. BIN
      engine/fmod-4/lib/fmodexL_vc.lib
  25. BIN
      engine/fmod-4/lib/fmodex_vc.lib
  26. 3794
      engine/fmodcore/inc/fmod.cs
  27. 665
      engine/fmodcore/inc/fmod.h
  28. 604
      engine/fmodcore/inc/fmod.hpp
  29. 97
      engine/fmodcore/inc/fmod_codec.h
  30. 752
      engine/fmodcore/inc/fmod_common.h
  31. 846
      engine/fmodcore/inc/fmod_dsp.cs
  32. 414
      engine/fmodcore/inc/fmod_dsp.h
  33. 537
      engine/fmodcore/inc/fmod_dsp_effects.h
  34. 106
      engine/fmodcore/inc/fmod_errors.cs
  35. 110
      engine/fmodcore/inc/fmod_errors.h
  36. 129
      engine/fmodcore/inc/fmod_output.h
  37. BIN
      engine/fmodcore/lib/x64/fmod.dll
  38. BIN
      engine/fmodcore/lib/x64/fmodL.dll
  39. BIN
      engine/fmodcore/lib/x64/fmodL_vc.lib
  40. BIN
      engine/fmodcore/lib/x64/fmod_vc.lib
  41. BIN
      engine/fmodcore/lib/x86/fmod.dll
  42. BIN
      engine/fmodcore/lib/x86/fmodL.dll
  43. BIN
      engine/fmodcore/lib/x86/fmodL_vc.lib
  44. BIN
      engine/fmodcore/lib/x86/fmod_vc.lib
  45. BIN
      engine/fmodcore/lib/x86/libfmod.a
  46. BIN
      engine/fmodcore/lib/x86/libfmodL.a
  47. 31
      engine/projects/uniquake/uniquake.vcxproj
  48. 17
      engine/projects/uniquake/uniquake.vcxproj.filters

8
Assets/Plugins.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2f75d9b0e1e0bfd4b81fa19b8be85a9a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Plugins/windows.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 378b097398362b44dae0a37403bdc820
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Plugins/windows/x86.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ea67d716aa17bb342b15c1d70882426b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Plugins/windows/x86/fmod.dll

63
Assets/Plugins/windows/x86/fmod.dll.meta

@ -0,0 +1,63 @@
fileFormatVersion: 2
guid: 61df32c5ab12ced408137c18515cf2f1
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 1
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Plugins/windows/x86/fmodL.dll

63
Assets/Plugins/windows/x86/fmodL.dll.meta

@ -0,0 +1,63 @@
fileFormatVersion: 2
guid: 15f996c566c90024bb9065e9abcb5bde
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 1
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Plugins/windows/x86/fmodexL.dll

8
Assets/Plugins/windows/x86_64.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 21c46b3a62fc45b4a88a5762eb3f8056
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Plugins/windows/x86_64/fmod.dll

63
Assets/Plugins/windows/x86_64/fmod.dll.meta

@ -0,0 +1,63 @@
fileFormatVersion: 2
guid: 139704f7a6971e3429296dfb37e8023b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 1
Exclude Win64: 0
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Plugins/windows/x86_64/fmodL.dll

63
Assets/Plugins/windows/x86_64/fmodL.dll.meta

@ -0,0 +1,63 @@
fileFormatVersion: 2
guid: 76c1d601b8733b844b4629c00d02d39b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 1
Exclude Win64: 0
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

362
engine/code/snd_fmod.c

@ -31,15 +31,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "winquake.h" #include "winquake.h"
#endif #endif
#ifndef UQE_FMOD_CDAUDIO
#include "cdaudio.h"
#endif
#ifdef UQE_FMOD #ifdef UQE_FMOD
#include "../fmod-4/inc/fmod.h"
#include "../fmod-4/inc/fmod_errors.h"
#include "fmod.h"
#include "fmod_errors.h"
extern int sound_started; extern int sound_started;
@ -178,91 +173,6 @@ void FMOD_ERROR(FMOD_RESULT result, qboolean notify, qboolean syserror)
} }
} }
/*
===================
CDA_Startup
===================
*/
void CDA_Startup (qboolean notify)
{
#ifdef UQE_FMOD_CDAUDIO
int i;
int numdrives;
int numtracks;
if (SND_InitialisedCD == true)
return;
if (fmod_compactdisc)
return;
// bump up the file buffer size a bit from the 16k default for CDDA, because it is a slower medium.
fmod_result = FMOD_System_SetStreamBufferSize(fmod_system, 64*1024, FMOD_TIMEUNIT_RAWBYTES);
FMOD_ERROR(fmod_result, notify, false);
fmod_result = FMOD_System_GetNumCDROMDrives(fmod_system, &numdrives);
FMOD_ERROR(fmod_result, notify, false);
for (i = 0; i < numdrives; i++)
{
char drivename[MAX_QPATH];
char scsiname[MAX_QPATH];
char devicename[MAX_QPATH];
fmod_result = FMOD_System_GetCDROMDriveName(fmod_system, i, drivename, MAX_QPATH, scsiname, MAX_QPATH, devicename, MAX_QPATH);
FMOD_ERROR(fmod_result, notify, false);
if (fmod_result == FMOD_OK)
{
fmod_result = FMOD_System_CreateStream(fmod_system, drivename, FMOD_OPENONLY, 0, &fmod_compactdisc);
if (fmod_result == FMOD_OK)
{
fmod_result = FMOD_Sound_GetNumSubSounds(fmod_compactdisc, &numtracks);
FMOD_ERROR(fmod_result, notify, false);
if (fmod_result == FMOD_OK)
{
Con_Printf("CD Audio Initialized (%s)\n", drivename);
SND_InitialisedCD = true;
break;
}
}
}
}
FMOD_ERROR(fmod_result, notify, false);
#else
CDAudio_Init();
#endif
}
/*
===================
CDA_Shutdown
===================
*/
void CDA_Shutdown (void)
{
#ifdef UQE_FMOD_CDAUDIO
if (SND_InitialisedCD == false)
return;
if (fmod_compactdisc)
{
fmod_result = FMOD_Sound_Release(fmod_compactdisc);
FMOD_ERROR(fmod_result, true, false);
fmod_compactdisc = NULL;
}
SND_InitialisedCD = false;
#else
CDAudio_Shutdown ();
#endif
}
/* /*
=================== ===================
FMOD_Startup FMOD_Startup
@ -270,15 +180,12 @@ FMOD_Startup
*/ */
void FMOD_Startup (void) void FMOD_Startup (void)
{ {
FMOD_CAPS caps;
FMOD_SPEAKERMODE speakermode; FMOD_SPEAKERMODE speakermode;
FMOD_OUTPUTTYPE fmod_output; FMOD_OUTPUTTYPE fmod_output;
unsigned int version; unsigned int version;
int numdrivers; int numdrivers;
char name[256]; char name[256];
int SND_SoftwareChannels; int SND_SoftwareChannels;
int SND_HardwareChannels;
int SND_Bits;
int SND_Rate; int SND_Rate;
fmod_result = FMOD_System_Create(&fmod_system); fmod_result = FMOD_System_Create(&fmod_system);
@ -306,63 +213,48 @@ void FMOD_Startup (void)
fmod_result = FMOD_System_SetOutput(fmod_system, FMOD_OUTPUTTYPE_AUTODETECT); fmod_result = FMOD_System_SetOutput(fmod_system, FMOD_OUTPUTTYPE_AUTODETECT);
FMOD_ERROR(fmod_result, true, false); FMOD_ERROR(fmod_result, true, false);
fmod_result = FMOD_System_GetDriverCaps(fmod_system, 0, &caps, NULL, &speakermode);
FMOD_ERROR(fmod_result, true, false);
// set the user selected speaker mode // set the user selected speaker mode
fmod_result = FMOD_System_SetSpeakerMode(fmod_system, FMOD_SPEAKERMODE_STEREO /*speakermode*/);
FMOD_ERROR(fmod_result, true, false);
if (caps & FMOD_CAPS_HARDWARE_EMULATED)
{
// the user has the 'Acceleration' slider set to off. this is really bad for latency!
fmod_result = FMOD_System_SetDSPBufferSize(fmod_system, 1024, 10);
FMOD_ERROR(fmod_result, true, false);
//fmod_result = FMOD_System_SetSpeakerMode(fmod_system, FMOD_SPEAKERMODE_STEREO /*speakermode*/);
//FMOD_ERROR(fmod_result, true, false);
Con_Printf("\nHardware Acceleration is turned off!\n");
}
fmod_result = FMOD_System_GetDriverInfo(fmod_system, 0, name, 256, NULL);
FMOD_ERROR(fmod_result, true, false);
if (strstr(name, "SigmaTel"))
{
// Sigmatel sound devices crackle for some reason if the format is PCM 16bit.
// PCM floating point output seems to solve it.
fmod_result = FMOD_System_SetSoftwareFormat(fmod_system, 48000, FMOD_SOUND_FORMAT_PCMFLOAT, 0, 0, FMOD_DSP_RESAMPLER_LINEAR);
FMOD_ERROR(fmod_result, true, false);
}
//fmod_result = FMOD_System_GetDriverInfo(fmod_system, 0, name, 256, NULL, NULL, NULL, NULL);
//FMOD_ERROR(fmod_result, true, false);
//
//if (strstr(name, "SigmaTel"))
//{
// // Sigmatel sound devices crackle for some reason if the format is PCM 16bit.
// // PCM floating point output seems to solve it.
// fmod_result = FMOD_System_SetSoftwareFormat(fmod_system, 48000, FMOD_SOUND_FORMAT_PCMFLOAT, 0);
// FMOD_ERROR(fmod_result, true, false);
//}
} }
fmod_result = FMOD_System_GetSoftwareChannels(fmod_system, &SND_SoftwareChannels); fmod_result = FMOD_System_GetSoftwareChannels(fmod_system, &SND_SoftwareChannels);
FMOD_ERROR(fmod_result, true, false); FMOD_ERROR(fmod_result, true, false);
fmod_result = FMOD_System_GetSoftwareFormat(fmod_system, &SND_Rate, NULL, NULL, NULL, NULL, &SND_Bits);
fmod_result = FMOD_System_GetSoftwareFormat(fmod_system, &SND_Rate, &speakermode, NULL);
FMOD_ERROR(fmod_result, true, false); FMOD_ERROR(fmod_result, true, false);
fmod_result = FMOD_System_Init(fmod_system, MAX_CHANNELS, FMOD_INIT_NORMAL, NULL); fmod_result = FMOD_System_Init(fmod_system, MAX_CHANNELS, FMOD_INIT_NORMAL, NULL);
FMOD_ERROR(fmod_result, true, false); FMOD_ERROR(fmod_result, true, false);
if (fmod_result == FMOD_ERR_OUTPUT_CREATEBUFFER)
{
// the speaker mode selected isn't supported by this soundcard. Switch it back to stereo...
fmod_result = FMOD_System_SetSpeakerMode(fmod_system, FMOD_SPEAKERMODE_STEREO);
FMOD_ERROR(fmod_result, true, false);
//if (fmod_result == FMOD_ERR_OUTPUT_CREATEBUFFER)
//{
// // the speaker mode selected isn't supported by this soundcard. Switch it back to stereo...
// fmod_result = FMOD_System_SetSpeakerMode(fmod_system, FMOD_SPEAKERMODE_STEREO);
// FMOD_ERROR(fmod_result, true, false);
// ... and re-init.
fmod_result = FMOD_System_Init(fmod_system, MAX_CHANNELS, FMOD_INIT_NORMAL, NULL);
FMOD_ERROR(fmod_result, true, false);
}
// // ... and re-init.
// fmod_result = FMOD_System_Init(fmod_system, MAX_CHANNELS, FMOD_INIT_NORMAL, NULL);
// FMOD_ERROR(fmod_result, true, false);
//}
fmod_result = FMOD_System_GetSpeakerMode(fmod_system, &speakermode);
FMOD_ERROR(fmod_result, true, false);
//fmod_result = FMOD_System_GetSpeakerMode(fmod_system, &speakermode);
//FMOD_ERROR(fmod_result, true, false);
fmod_result = FMOD_System_GetOutput(fmod_system, &fmod_output); fmod_result = FMOD_System_GetOutput(fmod_system, &fmod_output);
FMOD_ERROR(fmod_result, true, false); FMOD_ERROR(fmod_result, true, false);
fmod_result = FMOD_System_GetHardwareChannels(fmod_system, &SND_HardwareChannels);
FMOD_ERROR(fmod_result, true, false);
// print all the sound information to the console // print all the sound information to the console
Con_Printf("\nFMOD version %01x.%02x.%02x\n", (FMOD_VERSION >> 16) & 0xff, (FMOD_VERSION >> 8) & 0xff, FMOD_VERSION & 0xff); Con_Printf("\nFMOD version %01x.%02x.%02x\n", (FMOD_VERSION >> 16) & 0xff, (FMOD_VERSION >> 8) & 0xff, FMOD_VERSION & 0xff);
@ -373,14 +265,6 @@ void FMOD_Startup (void)
Con_Printf("using No Sound\n"); Con_Printf("using No Sound\n");
break; break;
case FMOD_OUTPUTTYPE_DSOUND:
Con_Printf("using Microsoft DirectSound\n");
break;
case FMOD_OUTPUTTYPE_WINMM:
Con_Printf("using Windows Multimedia\n");
break;
case FMOD_OUTPUTTYPE_WASAPI: case FMOD_OUTPUTTYPE_WASAPI:
Con_Printf("using Windows Audio Session API\n"); Con_Printf("using Windows Audio Session API\n");
break; break;
@ -391,8 +275,6 @@ void FMOD_Startup (void)
} }
Con_Printf(" software channels: %i\n", SND_SoftwareChannels); Con_Printf(" software channels: %i\n", SND_SoftwareChannels);
Con_Printf(" hardware channels: %i\n", SND_HardwareChannels);
Con_Printf(" %i bits/sample\n", SND_Bits);
Con_Printf(" %i bytes/sec\n", SND_Rate); Con_Printf(" %i bytes/sec\n", SND_Rate);
switch (speakermode) switch (speakermode)
@ -425,14 +307,6 @@ void FMOD_Startup (void)
Con_Printf("Speaker Output: 7.1\n"); Con_Printf("Speaker Output: 7.1\n");
break; break;
case FMOD_SPEAKERMODE_SRS5_1_MATRIX:
Con_Printf("Speaker Output: Stereo compatible\n");
break;
case FMOD_SPEAKERMODE_MYEARS:
Con_Printf("Speaker Output: Headphones\n");
break;
default: default:
Con_Printf("Speaker Output: Unknown\n"); Con_Printf("Speaker Output: Unknown\n");
} }
@ -441,7 +315,6 @@ void FMOD_Startup (void)
oldbgmvolume = bgmvolume.value; oldbgmvolume = bgmvolume.value;
SND_FClose(); SND_FClose();
CDA_Startup(true);
SND_Initialised = true; SND_Initialised = true;
@ -471,7 +344,6 @@ void FMOD_Shutdown(void)
} }
FMOD_MusicStop(); FMOD_MusicStop();
CDA_Shutdown();
if (fmod_system) if (fmod_system)
{ {
@ -583,7 +455,11 @@ FMOD_ChannelStart
*/ */
void FMOD_ChannelStart (FMOD_SOUND *sound, qboolean loop, qboolean paused) void FMOD_ChannelStart (FMOD_SOUND *sound, qboolean loop, qboolean paused)
{ {
fmod_result = FMOD_System_PlaySound(fmod_system, FMOD_CHANNEL_FREE, sound, (FMOD_BOOL)paused, &SND_MusicChannel.channel);
FMOD_CHANNELGROUP *channelGroup;
fmod_result = FMOD_System_GetMasterChannelGroup(fmod_system, &channelGroup);
FMOD_ERROR(fmod_result, true, false);
fmod_result = FMOD_System_PlaySound(fmod_system, sound, channelGroup, (FMOD_BOOL)paused, &SND_MusicChannel.channel);
FMOD_ERROR(fmod_result, true, false); FMOD_ERROR(fmod_result, true, false);
if ((SND_MusicChannel.looping = loop) == true) if ((SND_MusicChannel.looping = loop) == true)
@ -603,164 +479,6 @@ void FMOD_ChannelStart (FMOD_SOUND *sound, qboolean loop, qboolean paused)
SND_MusicChannel.inuse = true; SND_MusicChannel.inuse = true;
} }
// ===================================================================================
//
// CD AUDIO CONTROL ROUTINES
//
// ===================================================================================
/*
===================
CDA_Start
===================
*/
void CDA_Start(int track, qboolean loop, qboolean notify)
{
#ifdef UQE_FMOD_CDAUDIO
int numtracks;
if (SND_InitialisedCD == false)
return;
if (SND_MusicChannel.inuse == true)
FMOD_MusicStop();
if (track <= 0)
return;
fmod_result = FMOD_Sound_GetNumSubSounds(fmod_compactdisc, &numtracks);
FMOD_ERROR(fmod_result, notify, false);
if (track > numtracks)
return;
// fmod track numbers starts at zero
fmod_result = FMOD_Sound_GetSubSound(fmod_compactdisc, track - 1, &fmod_sound);
FMOD_ERROR(fmod_result, notify, false);
if (fmod_result == FMOD_OK)
FMOD_ChannelStart(fmod_sound, loop, false);
#else
CDAudio_Play(track, loop);
#endif
}
/*
===================
CDA_Stop
===================
*/
void CDA_Stop (void)
{
#ifdef UQE_FMOD_CDAUDIO
if (SND_InitialisedCD == false)
return;
if (SND_MusicChannel.inuse == false)
return;
if (SND_MusicChannel.channel)
{
fmod_result = FMOD_Channel_Stop(SND_MusicChannel.channel);
FMOD_ERROR(fmod_result, true, false);
}
SND_MusicChannel.inuse = false;
SND_MusicChannel.looping = false;
SND_MusicChannel.loopcount = 0;
SND_MusicChannel.paused = false;
#else
CDAudio_Stop();
#endif
}
/*
===================
CDA_Pause
===================
*/
void CDA_Pause (void)
{
#ifdef UQE_FMOD_CDAUDIO
if (SND_InitialisedCD == false)
return;
if (SND_MusicChannel.inuse == false)
return;
if (SND_MusicChannel.paused == false)
{
fmod_result = FMOD_Channel_SetPaused(SND_MusicChannel.channel, true);
FMOD_ERROR(fmod_result, true, false);
SND_MusicChannel.paused = true;
}
#else
CDAudio_Pause();
#endif
}
/*
===================
CDA_Resume
===================
*/
void CDA_Resume (qboolean force)
{
#ifdef UQE_FMOD_CDAUDIO
if (SND_InitialisedCD == false)
return;
if (SND_MusicChannel.inuse == false)
return;
if (SND_MusicChannel.paused == true && SND_MusicChannel.volume != 0.0f && (oldbgmvolume == 0.0f | force == true))
{
fmod_result = FMOD_Channel_SetPaused(SND_MusicChannel.channel, false);
FMOD_ERROR(fmod_result, true, false);
SND_MusicChannel.paused = false;
}
#else
CDAudio_Resume();
#endif
}
/*
===================
CDA_Update
===================
*/
void CDA_Update (void)
{
#ifdef UQE_FMOD_CDAUDIO
if (SND_Initialised == false || SND_MusicChannel.inuse == false)
return;
FMOD_System_Update(fmod_system);
SND_MusicChannel.volume = bgmvolume.value;
if (SND_MusicChannel.volume < 0.0f)
SND_MusicChannel.volume = 0.0f;
if (SND_MusicChannel.volume > 1.0f)
SND_MusicChannel.volume = 1.0f;
FMOD_Channel_SetVolume(SND_MusicChannel.channel, SND_MusicChannel.volume);
if (SND_MusicChannel.volume == 0.0f)
CDA_Pause();
else
CDA_Resume(false);
#else
CDAudio_Update();
#endif
}
// =================================================================================== // ===================================================================================
// //
// MOD AUDIO CONTROL ROUTINES (OGG / MP3 / WAV) // MOD AUDIO CONTROL ROUTINES (OGG / MP3 / WAV)
@ -792,7 +510,7 @@ void MOD_Start (char *name, qboolean loop, qboolean notify)
exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO); exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.length = SND_File.length; exinfo.length = SND_File.length;
fmod_result = FMOD_System_CreateSound(fmod_system, (const char *)SND_File.data, FMOD_HARDWARE | FMOD_OPENMEMORY | FMOD_2D, &exinfo, &fmod_sound);
fmod_result = FMOD_System_CreateSound(fmod_system, (const char *)SND_File.data, FMOD_OPENMEMORY | FMOD_2D, &exinfo, &fmod_sound);
FMOD_ERROR(fmod_result, true, false); FMOD_ERROR(fmod_result, true, false);
strcpy(file, SND_File.filename); strcpy(file, SND_File.filename);
@ -992,9 +710,6 @@ void FMOD_MusicStart (char *name, qboolean loop, qboolean notify)
FMOD_MusicUpdate("cd"); FMOD_MusicUpdate("cd");
} }
if (strcmpi(bgmtype, "cd") == 0)
CDA_Start(SND_MusicChannel.track, loop, notify);
if (strcmpi(bgmtype, "mod") == 0) if (strcmpi(bgmtype, "mod") == 0)
MOD_Start(SND_MusicChannel.trackname, loop, notify); MOD_Start(SND_MusicChannel.trackname, loop, notify);
} }
@ -1033,7 +748,6 @@ FMOD_MusicStop
*/ */
void FMOD_MusicStop (void) void FMOD_MusicStop (void)
{ {
CDA_Stop();
MOD_Stop(); MOD_Stop();
} }
@ -1044,9 +758,6 @@ FMOD_MusicPause
*/ */
void FMOD_MusicPause (void) void FMOD_MusicPause (void)
{ {
if (strcmpi(bgmtype, "cd") == 0)
CDA_Pause();
if (strcmpi(bgmtype, "mod") == 0) if (strcmpi(bgmtype, "mod") == 0)
MOD_Pause(); MOD_Pause();
} }
@ -1058,9 +769,6 @@ FMOD_MusicResume
*/ */
void FMOD_MusicResume (void) void FMOD_MusicResume (void)
{ {
if (strcmpi(bgmtype, "cd") == 0)
CDA_Resume(true);
if (strcmpi(bgmtype, "mod") == 0) if (strcmpi(bgmtype, "mod") == 0)
MOD_Resume(true); MOD_Resume(true);
} }
@ -1074,18 +782,12 @@ void FMOD_MusicUpdate (char *newbgmtype)
{ {
if (SND_MusicChannel.track != oldtrack) if (SND_MusicChannel.track != oldtrack)
{ {
if (strcmpi(bgmtype, "cd") == 0)
CDA_Stop();
if (strcmpi(bgmtype, "mod") == 0) if (strcmpi(bgmtype, "mod") == 0)
MOD_Stop(); MOD_Stop();
oldtrack = SND_MusicChannel.track; oldtrack = SND_MusicChannel.track;
} }
if (strcmpi(bgmtype, "cd") == 0)
CDA_Update();
if (strcmpi(bgmtype, "mod") == 0) if (strcmpi(bgmtype, "mod") == 0)
MOD_Update(); MOD_Update();

BIN
engine/fmod-4/fmodex.dll

BIN
engine/fmod-4/fmodexL.dll

2473
engine/fmod-4/inc/fmod.h
File diff suppressed because it is too large
View File

609
engine/fmod-4/inc/fmod.hpp

@ -1,609 +0,0 @@
/* ========================================================================================== */
/* FMOD Ex - C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* */
/* Use this header in conjunction with fmod.h (which contains all the constants / callbacks) */
/* to develop using C++ classes. */
/* ========================================================================================== */
#ifndef _FMOD_HPP
#define _FMOD_HPP
#include "fmod.h"
/*
Constant and defines
*/
/*
FMOD Namespace
*/
namespace FMOD
{
class System;
class Sound;
class Channel;
class ChannelGroup;
class SoundGroup;
class Reverb;
class DSP;
class DSPConnection;
class Geometry;
/*
FMOD global system functions (optional).
*/
inline FMOD_RESULT Memory_Initialize(void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = FMOD_MEMORY_ALL) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }
inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced, bool blocking = true) { return FMOD_Memory_GetStats(currentalloced, maxalloced, blocking); }
inline FMOD_RESULT Debug_SetLevel(FMOD_DEBUGLEVEL level) { return FMOD_Debug_SetLevel(level); }
inline FMOD_RESULT Debug_GetLevel(FMOD_DEBUGLEVEL *level) { return FMOD_Debug_GetLevel(level); }
inline FMOD_RESULT File_SetDiskBusy(int busy) { return FMOD_File_SetDiskBusy(busy); }
inline FMOD_RESULT File_GetDiskBusy(int *busy) { return FMOD_File_GetDiskBusy(busy); }
/*
FMOD System factory functions.
*/
inline FMOD_RESULT System_Create(System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }
/*
'System' API
*/
class System
{
private:
System(); /* Constructor made private so user cannot statically instance a System class.
System_Create must be used. */
public:
FMOD_RESULT F_API release ();
// Pre-init functions.
FMOD_RESULT F_API setOutput (FMOD_OUTPUTTYPE output);
FMOD_RESULT F_API getOutput (FMOD_OUTPUTTYPE *output);
FMOD_RESULT F_API getNumDrivers (int *numdrivers);
FMOD_RESULT F_API getDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid);
FMOD_RESULT F_API getDriverInfoW (int id, short *name, int namelen, FMOD_GUID *guid);
FMOD_RESULT F_API getDriverCaps (int id, FMOD_CAPS *caps, int *controlpaneloutputrate, FMOD_SPEAKERMODE *controlpanelspeakermode);
FMOD_RESULT F_API setDriver (int driver);
FMOD_RESULT F_API getDriver (int *driver);
FMOD_RESULT F_API setHardwareChannels (int numhardwarechannels);
FMOD_RESULT F_API setSoftwareChannels (int numsoftwarechannels);
FMOD_RESULT F_API getSoftwareChannels (int *numsoftwarechannels);
FMOD_RESULT F_API setSoftwareFormat (int samplerate, FMOD_SOUND_FORMAT format, int numoutputchannels, int maxinputchannels, FMOD_DSP_RESAMPLER resamplemethod);
FMOD_RESULT F_API getSoftwareFormat (int *samplerate, FMOD_SOUND_FORMAT *format, int *numoutputchannels, int *maxinputchannels, FMOD_DSP_RESAMPLER *resamplemethod, int *bits);
FMOD_RESULT F_API setDSPBufferSize (unsigned int bufferlength, int numbuffers);
FMOD_RESULT F_API getDSPBufferSize (unsigned int *bufferlength, int *numbuffers);
FMOD_RESULT F_API setFileSystem (FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek, FMOD_FILE_ASYNCREADCALLBACK userasyncread, FMOD_FILE_ASYNCCANCELCALLBACK userasynccancel, int blockalign);
FMOD_RESULT F_API attachFileSystem (FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek);
FMOD_RESULT F_API setAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
FMOD_RESULT F_API getAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
FMOD_RESULT F_API setSpeakerMode (FMOD_SPEAKERMODE speakermode);
FMOD_RESULT F_API getSpeakerMode (FMOD_SPEAKERMODE *speakermode);
FMOD_RESULT F_API setCallback (FMOD_SYSTEM_CALLBACK callback);
// Plug-in support
FMOD_RESULT F_API setPluginPath (const char *path);
FMOD_RESULT F_API loadPlugin (const char *filename, unsigned int *handle, unsigned int priority = 0);
FMOD_RESULT F_API unloadPlugin (unsigned int handle);
FMOD_RESULT F_API getNumPlugins (FMOD_PLUGINTYPE plugintype, int *numplugins);
FMOD_RESULT F_API getPluginHandle (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
FMOD_RESULT F_API getPluginInfo (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
FMOD_RESULT F_API setOutputByPlugin (unsigned int handle);
FMOD_RESULT F_API getOutputByPlugin (unsigned int *handle);
FMOD_RESULT F_API createDSPByPlugin (unsigned int handle, DSP **dsp);
FMOD_RESULT F_API registerCodec (FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority = 0);
FMOD_RESULT F_API registerDSP (FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
// Init/Close
FMOD_RESULT F_API init (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
FMOD_RESULT F_API close ();
// General post-init system functions
FMOD_RESULT F_API update (); /* IMPORTANT! CALL THIS ONCE PER FRAME! */
FMOD_RESULT F_API set3DSettings (float dopplerscale, float distancefactor, float rolloffscale);
FMOD_RESULT F_API get3DSettings (float *dopplerscale, float *distancefactor, float *rolloffscale);
FMOD_RESULT F_API set3DNumListeners (int numlisteners);
FMOD_RESULT F_API get3DNumListeners (int *numlisteners);
FMOD_RESULT F_API set3DListenerAttributes(int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
FMOD_RESULT F_API get3DListenerAttributes(int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
FMOD_RESULT F_API set3DRolloffCallback (FMOD_3D_ROLLOFFCALLBACK callback);
FMOD_RESULT F_API set3DSpeakerPosition (FMOD_SPEAKER speaker, float x, float y, bool active);
FMOD_RESULT F_API get3DSpeakerPosition (FMOD_SPEAKER speaker, float *x, float *y, bool *active);
FMOD_RESULT F_API setStreamBufferSize (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
FMOD_RESULT F_API getStreamBufferSize (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
// System information functions.
FMOD_RESULT F_API getVersion (unsigned int *version);
FMOD_RESULT F_API getOutputHandle (void **handle);
FMOD_RESULT F_API getChannelsPlaying (int *channels);
FMOD_RESULT F_API getHardwareChannels (int *numhardwarechannels);
FMOD_RESULT F_API getCPUUsage (float *dsp, float *stream, float *geometry, float *update, float *total);
FMOD_RESULT F_API getSoundRAM (int *currentalloced, int *maxalloced, int *total);
FMOD_RESULT F_API getNumCDROMDrives (int *numdrives);
FMOD_RESULT F_API getCDROMDriveName (int drive, char *drivename, int drivenamelen, char *scsiname, int scsinamelen, char *devicename, int devicenamelen);
FMOD_RESULT F_API getSpectrum (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);
FMOD_RESULT F_API getWaveData (float *wavearray, int numvalues, int channeloffset);
// Sound/DSP/Channel/FX creation and retrieval.
FMOD_RESULT F_API createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
FMOD_RESULT F_API createStream (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
FMOD_RESULT F_API createDSP (FMOD_DSP_DESCRIPTION *description, DSP **dsp);
FMOD_RESULT F_API createDSPByType (FMOD_DSP_TYPE type, DSP **dsp);
FMOD_RESULT F_API createChannelGroup (const char *name, ChannelGroup **channelgroup);
FMOD_RESULT F_API createSoundGroup (const char *name, SoundGroup **soundgroup);
FMOD_RESULT F_API createReverb (Reverb **reverb);
FMOD_RESULT F_API playSound (FMOD_CHANNELINDEX channelid, Sound *sound, bool paused, Channel **channel);
FMOD_RESULT F_API playDSP (FMOD_CHANNELINDEX channelid, DSP *dsp, bool paused, Channel **channel);
FMOD_RESULT F_API getChannel (int channelid, Channel **channel);
FMOD_RESULT F_API getMasterChannelGroup (ChannelGroup **channelgroup);
FMOD_RESULT F_API getMasterSoundGroup (SoundGroup **soundgroup);
// Reverb API
FMOD_RESULT F_API setReverbProperties (const FMOD_REVERB_PROPERTIES *prop);
FMOD_RESULT F_API getReverbProperties (FMOD_REVERB_PROPERTIES *prop);
FMOD_RESULT F_API setReverbAmbientProperties(FMOD_REVERB_PROPERTIES *prop);
FMOD_RESULT F_API getReverbAmbientProperties(FMOD_REVERB_PROPERTIES *prop);
// System level DSP access.
FMOD_RESULT F_API getDSPHead (DSP **dsp);
FMOD_RESULT F_API addDSP (DSP *dsp, DSPConnection **connection);
FMOD_RESULT F_API lockDSP ();
FMOD_RESULT F_API unlockDSP ();
FMOD_RESULT F_API getDSPClock (unsigned int *hi, unsigned int *lo);
// Recording API.
FMOD_RESULT F_API getRecordNumDrivers (int *numdrivers);
FMOD_RESULT F_API getRecordDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid);
FMOD_RESULT F_API getRecordDriverInfoW (int id, short *name, int namelen, FMOD_GUID *guid);
FMOD_RESULT F_API getRecordDriverCaps (int id, FMOD_CAPS *caps, int *minfrequency, int *maxfrequency);
FMOD_RESULT F_API getRecordPosition (int id, unsigned int *position);
FMOD_RESULT F_API recordStart (int id, Sound *sound, bool loop);
FMOD_RESULT F_API recordStop (int id);
FMOD_RESULT F_API isRecording (int id, bool *recording);
// Geometry API.
FMOD_RESULT F_API createGeometry (int maxpolygons, int maxvertices, Geometry **geometry);
FMOD_RESULT F_API setGeometrySettings (float maxworldsize);
FMOD_RESULT F_API getGeometrySettings (float *maxworldsize);
FMOD_RESULT F_API loadGeometry (const void *data, int datasize, Geometry **geometry);
FMOD_RESULT F_API getGeometryOcclusion (const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
// Network functions.
FMOD_RESULT F_API setNetworkProxy (const char *proxy);
FMOD_RESULT F_API getNetworkProxy (char *proxy, int proxylen);
FMOD_RESULT F_API setNetworkTimeout (int timeout);
FMOD_RESULT F_API getNetworkTimeout (int *timeout);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
/*
'Sound' API
*/
class Sound
{
private:
Sound(); /* Constructor made private so user cannot statically instance a Sound class.
Appropriate Sound creation or retrieval function must be used. */
public:
FMOD_RESULT F_API release ();
FMOD_RESULT F_API getSystemObject (System **system);
// Standard sound manipulation functions.
FMOD_RESULT F_API lock (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
FMOD_RESULT F_API unlock (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
FMOD_RESULT F_API setDefaults (float frequency, float volume, float pan, int priority);
FMOD_RESULT F_API getDefaults (float *frequency, float *volume, float *pan, int *priority);
FMOD_RESULT F_API setVariations (float frequencyvar, float volumevar, float panvar);
FMOD_RESULT F_API getVariations (float *frequencyvar, float *volumevar, float *panvar);
FMOD_RESULT F_API set3DMinMaxDistance (float min, float max);
FMOD_RESULT F_API get3DMinMaxDistance (float *min, float *max);
FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
FMOD_RESULT F_API setSubSound (int index, Sound *subsound);
FMOD_RESULT F_API getSubSound (int index, Sound **subsound);
FMOD_RESULT F_API getSubSoundParent (Sound **parentsound);
FMOD_RESULT F_API setSubSoundSentence (int *subsoundlist, int numsubsounds);
FMOD_RESULT F_API getName (char *name, int namelen);
FMOD_RESULT F_API getLength (unsigned int *length, FMOD_TIMEUNIT lengthtype);
FMOD_RESULT F_API getFormat (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
FMOD_RESULT F_API getNumSubSounds (int *numsubsounds);
FMOD_RESULT F_API getNumTags (int *numtags, int *numtagsupdated);
FMOD_RESULT F_API getTag (const char *name, int index, FMOD_TAG *tag);
FMOD_RESULT F_API getOpenState (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy);
FMOD_RESULT F_API readData (void *buffer, unsigned int lenbytes, unsigned int *read);
FMOD_RESULT F_API seekData (unsigned int pcm);
FMOD_RESULT F_API setSoundGroup (SoundGroup *soundgroup);
FMOD_RESULT F_API getSoundGroup (SoundGroup **soundgroup);
// Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
FMOD_RESULT F_API getNumSyncPoints (int *numsyncpoints);
FMOD_RESULT F_API getSyncPoint (int index, FMOD_SYNCPOINT **point);
FMOD_RESULT F_API getSyncPointInfo (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
FMOD_RESULT F_API addSyncPoint (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
FMOD_RESULT F_API deleteSyncPoint (FMOD_SYNCPOINT *point);
// Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
FMOD_RESULT F_API setMode (FMOD_MODE mode);
FMOD_RESULT F_API getMode (FMOD_MODE *mode);
FMOD_RESULT F_API setLoopCount (int loopcount);
FMOD_RESULT F_API getLoopCount (int *loopcount);
FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
// For MOD/S3M/XM/IT/MID sequenced formats only.
FMOD_RESULT F_API getMusicNumChannels (int *numchannels);
FMOD_RESULT F_API setMusicChannelVolume (int channel, float volume);
FMOD_RESULT F_API getMusicChannelVolume (int channel, float *volume);
FMOD_RESULT F_API setMusicSpeed (float speed);
FMOD_RESULT F_API getMusicSpeed (float *speed);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
/*
'Channel' API.
*/
class Channel
{
private:
Channel(); /* Constructor made private so user cannot statically instance a Channel class.
Appropriate Channel creation or retrieval function must be used. */
public:
FMOD_RESULT F_API getSystemObject (System **system);
FMOD_RESULT F_API stop ();
FMOD_RESULT F_API setPaused (bool paused);
FMOD_RESULT F_API getPaused (bool *paused);
FMOD_RESULT F_API setVolume (float volume);
FMOD_RESULT F_API getVolume (float *volume);
FMOD_RESULT F_API setFrequency (float frequency);
FMOD_RESULT F_API getFrequency (float *frequency);
FMOD_RESULT F_API setPan (float pan);
FMOD_RESULT F_API getPan (float *pan);
FMOD_RESULT F_API setDelay (FMOD_DELAYTYPE delaytype, unsigned int delayhi, unsigned int delaylo);
FMOD_RESULT F_API getDelay (FMOD_DELAYTYPE delaytype, unsigned int *delayhi, unsigned int *delaylo);
FMOD_RESULT F_API setSpeakerMix (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);
FMOD_RESULT F_API getSpeakerMix (float *frontleft, float *frontright, float *center, float *lfe, float *backleft, float *backright, float *sideleft, float *sideright);
FMOD_RESULT F_API setSpeakerLevels (FMOD_SPEAKER speaker, float *levels, int numlevels);
FMOD_RESULT F_API getSpeakerLevels (FMOD_SPEAKER speaker, float *levels, int numlevels);
FMOD_RESULT F_API setInputChannelMix (float *levels, int numlevels);
FMOD_RESULT F_API getInputChannelMix (float *levels, int numlevels);
FMOD_RESULT F_API setMute (bool mute);
FMOD_RESULT F_API getMute (bool *mute);
FMOD_RESULT F_API setPriority (int priority);
FMOD_RESULT F_API getPriority (int *priority);
FMOD_RESULT F_API setPosition (unsigned int position, FMOD_TIMEUNIT postype);
FMOD_RESULT F_API getPosition (unsigned int *position, FMOD_TIMEUNIT postype);
FMOD_RESULT F_API setReverbProperties (const FMOD_REVERB_CHANNELPROPERTIES *prop);
FMOD_RESULT F_API getReverbProperties (FMOD_REVERB_CHANNELPROPERTIES *prop);
FMOD_RESULT F_API setLowPassGain (float gain);
FMOD_RESULT F_API getLowPassGain (float *gain);
FMOD_RESULT F_API setChannelGroup (ChannelGroup *channelgroup);
FMOD_RESULT F_API getChannelGroup (ChannelGroup **channelgroup);
FMOD_RESULT F_API setCallback (FMOD_CHANNEL_CALLBACK callback);
// 3D functionality.
FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);
FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel);
FMOD_RESULT F_API set3DMinMaxDistance (float mindistance, float maxdistance);
FMOD_RESULT F_API get3DMinMaxDistance (float *mindistance, float *maxdistance);
FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
FMOD_RESULT F_API set3DConeOrientation (FMOD_VECTOR *orientation);
FMOD_RESULT F_API get3DConeOrientation (FMOD_VECTOR *orientation);
FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
FMOD_RESULT F_API set3DOcclusion (float directocclusion, float reverbocclusion);
FMOD_RESULT F_API get3DOcclusion (float *directocclusion, float *reverbocclusion);
FMOD_RESULT F_API set3DSpread (float angle);
FMOD_RESULT F_API get3DSpread (float *angle);
FMOD_RESULT F_API set3DPanLevel (float level);
FMOD_RESULT F_API get3DPanLevel (float *level);
FMOD_RESULT F_API set3DDopplerLevel (float level);
FMOD_RESULT F_API get3DDopplerLevel (float *level);
FMOD_RESULT F_API set3DDistanceFilter (bool custom, float customLevel, float centerFreq);
FMOD_RESULT F_API get3DDistanceFilter (bool *custom, float *customLevel, float *centerFreq);
// DSP functionality only for channels playing sounds created with FMOD_SOFTWARE.
FMOD_RESULT F_API getDSPHead (DSP **dsp);
FMOD_RESULT F_API addDSP (DSP *dsp, DSPConnection **connection);
// Information only functions.
FMOD_RESULT F_API isPlaying (bool *isplaying);
FMOD_RESULT F_API isVirtual (bool *isvirtual);
FMOD_RESULT F_API getAudibility (float *audibility);
FMOD_RESULT F_API getCurrentSound (Sound **sound);
FMOD_RESULT F_API getSpectrum (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);
FMOD_RESULT F_API getWaveData (float *wavearray, int numvalues, int channeloffset);
FMOD_RESULT F_API getIndex (int *index);
// Functions also found in Sound class but here they can be set per channel.
FMOD_RESULT F_API setMode (FMOD_MODE mode);
FMOD_RESULT F_API getMode (FMOD_MODE *mode);
FMOD_RESULT F_API setLoopCount (int loopcount);
FMOD_RESULT F_API getLoopCount (int *loopcount);
FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
/*
'ChannelGroup' API
*/
class ChannelGroup
{
private:
ChannelGroup(); /* Constructor made private so user cannot statically instance a ChannelGroup class.
Appropriate ChannelGroup creation or retrieval function must be used. */
public:
FMOD_RESULT F_API release ();
FMOD_RESULT F_API getSystemObject (System **system);
// Channelgroup scale values. (changes attributes relative to the channels, doesn't overwrite them)
FMOD_RESULT F_API setVolume (float volume);
FMOD_RESULT F_API getVolume (float *volume);
FMOD_RESULT F_API setPitch (float pitch);
FMOD_RESULT F_API getPitch (float *pitch);
FMOD_RESULT F_API set3DOcclusion (float directocclusion, float reverbocclusion);
FMOD_RESULT F_API get3DOcclusion (float *directocclusion, float *reverbocclusion);
FMOD_RESULT F_API setPaused (bool paused);
FMOD_RESULT F_API getPaused (bool *paused);
FMOD_RESULT F_API setMute (bool mute);
FMOD_RESULT F_API getMute (bool *mute);
// Channelgroup override values. (recursively overwrites whatever settings the channels had)
FMOD_RESULT F_API stop ();
FMOD_RESULT F_API overrideVolume (float volume);
FMOD_RESULT F_API overrideFrequency (float frequency);
FMOD_RESULT F_API overridePan (float pan);
FMOD_RESULT F_API overrideReverbProperties(const FMOD_REVERB_CHANNELPROPERTIES *prop);
FMOD_RESULT F_API override3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);
FMOD_RESULT F_API overrideSpeakerMix (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);
// Nested channel groups.
FMOD_RESULT F_API addGroup (ChannelGroup *group);
FMOD_RESULT F_API getNumGroups (int *numgroups);
FMOD_RESULT F_API getGroup (int index, ChannelGroup **group);
FMOD_RESULT F_API getParentGroup (ChannelGroup **group);
// DSP functionality only for channel groups playing sounds created with FMOD_SOFTWARE.
FMOD_RESULT F_API getDSPHead (DSP **dsp);
FMOD_RESULT F_API addDSP (DSP *dsp, DSPConnection **connection);
// Information only functions.
FMOD_RESULT F_API getName (char *name, int namelen);
FMOD_RESULT F_API getNumChannels (int *numchannels);
FMOD_RESULT F_API getChannel (int index, Channel **channel);
FMOD_RESULT F_API getSpectrum (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);
FMOD_RESULT F_API getWaveData (float *wavearray, int numvalues, int channeloffset);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
/*
'SoundGroup' API
*/
class SoundGroup
{
private:
SoundGroup(); /* Constructor made private so user cannot statically instance a SoundGroup class.
Appropriate SoundGroup creation or retrieval function must be used. */
public:
FMOD_RESULT F_API release ();
FMOD_RESULT F_API getSystemObject (System **system);
// SoundGroup control functions.
FMOD_RESULT F_API setMaxAudible (int maxaudible);
FMOD_RESULT F_API getMaxAudible (int *maxaudible);
FMOD_RESULT F_API setMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR behavior);
FMOD_RESULT F_API getMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR *behavior);
FMOD_RESULT F_API setMuteFadeSpeed (float speed);
FMOD_RESULT F_API getMuteFadeSpeed (float *speed);
FMOD_RESULT F_API setVolume (float volume);
FMOD_RESULT F_API getVolume (float *volume);
FMOD_RESULT F_API stop ();
// Information only functions.
FMOD_RESULT F_API getName (char *name, int namelen);
FMOD_RESULT F_API getNumSounds (int *numsounds);
FMOD_RESULT F_API getSound (int index, Sound **sound);
FMOD_RESULT F_API getNumPlaying (int *numplaying);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
/*
'DSP' API
*/
class DSP
{
private:
DSP(); /* Constructor made private so user cannot statically instance a DSP class.
Appropriate DSP creation or retrieval function must be used. */
public:
FMOD_RESULT F_API release ();
FMOD_RESULT F_API getSystemObject (System **system);
// Connection / disconnection / input and output enumeration.
FMOD_RESULT F_API addInput (DSP *target, DSPConnection **connection);
FMOD_RESULT F_API disconnectFrom (DSP *target);
FMOD_RESULT F_API disconnectAll (bool inputs, bool outputs);
FMOD_RESULT F_API remove ();
FMOD_RESULT F_API getNumInputs (int *numinputs);
FMOD_RESULT F_API getNumOutputs (int *numoutputs);
FMOD_RESULT F_API getInput (int index, DSP **input, DSPConnection **inputconnection);
FMOD_RESULT F_API getOutput (int index, DSP **output, DSPConnection **outputconnection);
// DSP unit control.
FMOD_RESULT F_API setActive (bool active);
FMOD_RESULT F_API getActive (bool *active);
FMOD_RESULT F_API setBypass (bool bypass);
FMOD_RESULT F_API getBypass (bool *bypass);
FMOD_RESULT F_API setSpeakerActive (FMOD_SPEAKER speaker, bool active);
FMOD_RESULT F_API getSpeakerActive (FMOD_SPEAKER speaker, bool *active);
FMOD_RESULT F_API reset ();
// DSP parameter control.
FMOD_RESULT F_API setParameter (int index, float value);
FMOD_RESULT F_API getParameter (int index, float *value, char *valuestr, int valuestrlen);
FMOD_RESULT F_API getNumParameters (int *numparams);
FMOD_RESULT F_API getParameterInfo (int index, char *name, char *label, char *description, int descriptionlen, float *min, float *max);
FMOD_RESULT F_API showConfigDialog (void *hwnd, bool show);
// DSP attributes.
FMOD_RESULT F_API getInfo (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
FMOD_RESULT F_API getType (FMOD_DSP_TYPE *type);
FMOD_RESULT F_API setDefaults (float frequency, float volume, float pan, int priority);
FMOD_RESULT F_API getDefaults (float *frequency, float *volume, float *pan, int *priority);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
/*
'DSPConnection' API
*/
class DSPConnection
{
private:
DSPConnection(); /* Constructor made private so user cannot statically instance a DSPConnection class.
Appropriate DSPConnection creation or retrieval function must be used. */
public:
FMOD_RESULT F_API getInput (DSP **input);
FMOD_RESULT F_API getOutput (DSP **output);
FMOD_RESULT F_API setMix (float volume);
FMOD_RESULT F_API getMix (float *volume);
FMOD_RESULT F_API setLevels (FMOD_SPEAKER speaker, float *levels, int numlevels);
FMOD_RESULT F_API getLevels (FMOD_SPEAKER speaker, float *levels, int numlevels);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
/*
'Geometry' API
*/
class Geometry
{
private:
Geometry(); /* Constructor made private so user cannot statically instance a Geometry class.
Appropriate Geometry creation or retrieval function must be used. */
public:
FMOD_RESULT F_API release ();
// Polygon manipulation.
FMOD_RESULT F_API addPolygon (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
FMOD_RESULT F_API getNumPolygons (int *numpolygons);
FMOD_RESULT F_API getMaxPolygons (int *maxpolygons, int *maxvertices);
FMOD_RESULT F_API getPolygonNumVertices (int index, int *numvertices);
FMOD_RESULT F_API setPolygonVertex (int index, int vertexindex, const FMOD_VECTOR *vertex);
FMOD_RESULT F_API getPolygonVertex (int index, int vertexindex, FMOD_VECTOR *vertex);
FMOD_RESULT F_API setPolygonAttributes (int index, float directocclusion, float reverbocclusion, bool doublesided);
FMOD_RESULT F_API getPolygonAttributes (int index, float *directocclusion, float *reverbocclusion, bool *doublesided);
// Object manipulation.
FMOD_RESULT F_API setActive (bool active);
FMOD_RESULT F_API getActive (bool *active);
FMOD_RESULT F_API setRotation (const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
FMOD_RESULT F_API getRotation (FMOD_VECTOR *forward, FMOD_VECTOR *up);
FMOD_RESULT F_API setPosition (const FMOD_VECTOR *position);
FMOD_RESULT F_API getPosition (FMOD_VECTOR *position);
FMOD_RESULT F_API setScale (const FMOD_VECTOR *scale);
FMOD_RESULT F_API getScale (FMOD_VECTOR *scale);
FMOD_RESULT F_API save (void *data, int *datasize);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
/*
'Reverb' API
*/
class Reverb
{
private:
Reverb(); /* Constructor made private so user cannot statically instance a Reverb class.
Appropriate Reverb creation or retrieval function must be used. */
public:
FMOD_RESULT F_API release ();
// Reverb manipulation.
FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *position, float mindistance, float maxdistance);
FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *position, float *mindistance,float *maxdistance);
FMOD_RESULT F_API setProperties (const FMOD_REVERB_PROPERTIES *properties);
FMOD_RESULT F_API getProperties (FMOD_REVERB_PROPERTIES *properties);
FMOD_RESULT F_API setActive (bool active);
FMOD_RESULT F_API getActive (bool *active);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
FMOD_RESULT F_API getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);
};
}
#endif

159
engine/fmod-4/inc/fmod_codec.h

@ -1,159 +0,0 @@
/* ==================================================================================================== */
/* FMOD Ex - codec development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* */
/* Use this header if you are wanting to develop your own file format plugin to use with */
/* FMOD's codec system. With this header you can make your own fileformat plugin that FMOD */
/* can register and use. See the documentation and examples on how to make a working plugin. */
/* */
/* ==================================================================================================== */
#ifndef _FMOD_CODEC_H
#define _FMOD_CODEC_H
typedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE;
typedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;
/*
Codec callbacks
*/
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPENCALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSECALLBACK) (FMOD_CODEC_STATE *codec_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READCALLBACK) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int sizebytes, unsigned int *bytesread);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTHCALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITIONCALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITIONCALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATECALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_METADATACALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_TAGTYPE tagtype, char *name, void *data, unsigned int datalen, FMOD_TAGDATATYPE datatype, int unique);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT) (FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);
/*
[STRUCTURE]
[
[DESCRIPTION]
When creating a codec, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_CODEC_STATE
]
*/
typedef struct FMOD_CODEC_DESCRIPTION
{
const char *name; /* [in] Name of the codec. */
unsigned int version; /* [in] Plugin writer's version number. */
int defaultasstream; /* [in] Tells FMOD to open the file as a stream when calling System::createSound, and not a static sample. Should normally be 0 (FALSE), because generally the user wants to decode the file into memory when using System::createSound. Mainly used for formats that decode for a very long time, or could use large amounts of memory when decoded. Usually sequenced formats such as mod/s3m/xm/it/midi fall into this category. It is mainly to stop users that don't know what they're doing from getting FMOD_ERR_MEMORY returned from createSound when they should have in fact called System::createStream or used FMOD_CREATESTREAM in System::createSound. */
FMOD_TIMEUNIT timeunits; /* [in] When setposition codec is called, only these time formats will be passed to the codec. Use bitwise OR to accumulate different types. */
FMOD_CODEC_OPENCALLBACK open; /* [in] Open callback for the codec for when FMOD tries to open a sound using this codec. */
FMOD_CODEC_CLOSECALLBACK close; /* [in] Close callback for the codec for when FMOD tries to close a sound using this codec. */
FMOD_CODEC_READCALLBACK read; /* [in] Read callback for the codec for when FMOD tries to read some data from the file to the destination format (specified in the open callback). */
FMOD_CODEC_GETLENGTHCALLBACK getlength; /* [in] Callback to return the length of the song in whatever format required when Sound::getLength is called. */
FMOD_CODEC_SETPOSITIONCALLBACK setposition; /* [in] Seek callback for the codec for when FMOD tries to seek within the file with Channel::setPosition. */
FMOD_CODEC_GETPOSITIONCALLBACK getposition; /* [in] Tell callback for the codec for when FMOD tries to get the current position within the with Channel::getPosition. */
FMOD_CODEC_SOUNDCREATECALLBACK soundcreate; /* [in] Sound creation callback for the codec when FMOD finishes creating the sound. (So the codec can set more parameters for the related created sound, ie loop points/mode or 3D attributes etc). */
FMOD_CODEC_GETWAVEFORMAT getwaveformat; /* [in] Callback to tell FMOD about the waveformat of a particular subsound. This is to save memory, rather than saving 1000 FMOD_CODEC_WAVEFORMAT structures in the codec, the codec might have a more optimal way of storing this information. */
} FMOD_CODEC_DESCRIPTION;
/*
[STRUCTURE]
[
[DESCRIPTION]
Set these values marked 'in' to tell fmod what sort of sound to create.
The format, channels and frequency tell FMOD what sort of hardware buffer to create when you initialize your code. So if you wrote an MP3 codec that decoded to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2.
Members marked as 'out' are set by fmod. Do not modify these. Simply specify 0 for these values when declaring the structure, FMOD will fill in the values for you after creation with the correct function pointers.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
An FMOD file might be from disk, memory or network, however the file may be opened by the user.
'numsubsounds' should be 0 if the file is a normal single sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.
'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself. Examples of these types would be CDDA (multiple CD tracks), FSB (contains multiple sounds), MIDI/MOD/S3M/XM/IT (contain instruments).
The arrays of format, channel, frequency, length and blockalign should point to arrays of information based on how many subsounds are in the format. If the number of subsounds is 0 then it should point to 1 of each attribute, the same as if the number of subsounds was 1. If subsounds was 100 for example, each pointer should point to an array of 100 of each attribute.
When a sound has 1 or more subsounds, you must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_SOUND_FORMAT
FMOD_FILE_READCALLBACK
FMOD_FILE_SEEKCALLBACK
FMOD_CODEC_METADATACALLBACK
Sound::getSubSound
Sound::getNumSubSounds
]
*/
struct FMOD_CODEC_WAVEFORMAT
{
char name[256]; /* [in] Name of sound.*/
FMOD_SOUND_FORMAT format; /* [in] Format for (decompressed) codec output, ie FMOD_SOUND_FORMAT_PCM8, FMOD_SOUND_FORMAT_PCM16.*/
int channels; /* [in] Number of channels used by codec, ie mono = 1, stereo = 2. */
int frequency; /* [in] Default frequency in hz of the codec, ie 44100. */
unsigned int lengthbytes; /* [in] Length in bytes of the source data. */
unsigned int lengthpcm; /* [in] Length in decompressed, PCM samples of the file, ie length in seconds * frequency. Used for Sound::getLength and for memory allocation of static decompressed sample data. */
int blockalign; /* [in] Blockalign in decompressed, PCM samples of the optimal decode chunk size for this format. The codec read callback will be called in multiples of this value. */
int loopstart; /* [in] Loopstart in decompressed, PCM samples of file. */
int loopend; /* [in] Loopend in decompressed, PCM samples of file. */
FMOD_MODE mode; /* [in] Mode to determine whether the sound should by default load as looping, non looping, 2d or 3d. */
unsigned int channelmask; /* [in] Microsoft speaker channel mask, as defined for WAVEFORMATEXTENSIBLE and is found in ksmedia.h. Leave at 0 to play in natural speaker order. */
};
/*
[STRUCTURE]
[
[DESCRIPTION]
Codec plugin structure that is passed into each callback.
Set these numsubsounds and waveformat members when called in FMOD_CODEC_OPENCALLBACK to tell fmod what sort of sound to create.
The format, channels and frequency tell FMOD what sort of hardware buffer to create when you initialize your code. So if you wrote an MP3 codec that decoded to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
An FMOD file might be from disk, memory or internet, however the file may be opened by the user.
'numsubsounds' should be 0 if the file is a normal single sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.
'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself. Examples of these types would be CDDA (multiple CD tracks), FSB (contains multiple sounds), DLS (contain instruments).
The arrays of format, channel, frequency, length and blockalign should point to arrays of information based on how many subsounds are in the format. If the number of subsounds is 0 then it should point to 1 of each attribute, the same as if the number of subsounds was 1. If subsounds was 100 for example, each pointer should point to an array of 100 of each attribute.
When a sound has 1 or more subsounds, you must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_SOUND_FORMAT
FMOD_FILE_READCALLBACK
FMOD_FILE_SEEKCALLBACK
FMOD_CODEC_METADATACALLBACK
Sound::getSubSound
Sound::getNumSubSounds
]
*/
struct FMOD_CODEC_STATE
{
int numsubsounds; /* [in] Number of 'subsounds' in this sound. Anything other than 0 makes it a 'container' format (ie CDDA/DLS/FSB etc which contain 1 or more su bsounds). For most normal, single sound codec such as WAV/AIFF/MP3, this should be 0 as they are not a container for subsounds, they are the sound by itself. */
FMOD_CODEC_WAVEFORMAT *waveformat; /* [in] Pointer to an array of format structures containing information about each sample. Can be 0 or NULL if FMOD_CODEC_GETWAVEFORMAT callback is preferred. The number of entries here must equal the number of subsounds defined in the subsound parameter. If numsubsounds = 0 then there should be 1 instance of this structure. */
void *plugindata; /* [in] Plugin writer created data the codec author wants to attach to this object. */
void *filehandle; /* [out] This will return an internal FMOD file handle to use with the callbacks provided. */
unsigned int filesize; /* [out] This will contain the size of the file in bytes. */
FMOD_FILE_READCALLBACK fileread; /* [out] This will return a callable FMOD file function to use from codec. */
FMOD_FILE_SEEKCALLBACK fileseek; /* [out] This will return a callable FMOD file function to use from codec. */
FMOD_CODEC_METADATACALLBACK metadata; /* [out] This will return a callable FMOD metadata function to use from codec. */
};
#endif

746
engine/fmod-4/inc/fmod_dsp.h

@ -1,746 +0,0 @@
/* ========================================================================================== */
/* FMOD Ex - DSP header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* */
/* Use this header if you are interested in delving deeper into the FMOD software mixing / */
/* DSP engine. In this header you can find parameter structures for FMOD system reigstered */
/* DSP effects and generators. */
/* Also use this header if you are wanting to develop your own DSP plugin to use with FMOD's */
/* dsp system. With this header you can make your own DSP plugin that FMOD can */
/* register and use. See the documentation and examples on how to make a working plugin. */
/* */
/* ========================================================================================== */
#ifndef _FMOD_DSP_H
#define _FMOD_DSP_H
typedef struct FMOD_DSP_STATE FMOD_DSP_STATE;
/*
DSP callbacks
*/
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_CREATECALLBACK) (FMOD_DSP_STATE *dsp_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RELEASECALLBACK) (FMOD_DSP_STATE *dsp_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RESETCALLBACK) (FMOD_DSP_STATE *dsp_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_READCALLBACK) (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels);
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPOSITIONCALLBACK)(FMOD_DSP_STATE *dsp_state, unsigned int pos);
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAMCALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float value);
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAMCALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_DIALOGCALLBACK) (FMOD_DSP_STATE *dsp_state, void *hwnd, int show);
/*
[ENUM]
[
[DESCRIPTION]
These definitions can be used for creating FMOD defined special effects or DSP units.
[REMARKS]
To get them to be active, first create the unit, then add it somewhere into the DSP network, either at the front of the network near the soundcard unit to affect the global output (by using System::getDSPHead), or on a single channel (using Channel::getDSPHead).
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
System::createDSPByType
]
*/
typedef enum
{
FMOD_DSP_TYPE_UNKNOWN, /* This unit was created via a non FMOD plugin so has an unknown purpose. */
FMOD_DSP_TYPE_MIXER, /* This unit does nothing but take inputs and mix them together then feed the result to the soundcard unit. */
FMOD_DSP_TYPE_OSCILLATOR, /* This unit generates sine/square/saw/triangle or noise tones. */
FMOD_DSP_TYPE_LOWPASS, /* This unit filters sound using a high quality, resonant lowpass filter algorithm but consumes more CPU time. */
FMOD_DSP_TYPE_ITLOWPASS, /* This unit filters sound using a resonant lowpass filter algorithm that is used in Impulse Tracker, but with limited cutoff range (0 to 8060hz). */
FMOD_DSP_TYPE_HIGHPASS, /* This unit filters sound using a resonant highpass filter algorithm. */
FMOD_DSP_TYPE_ECHO, /* This unit produces an echo on the sound and fades out at the desired rate. */
FMOD_DSP_TYPE_FLANGE, /* This unit produces a flange effect on the sound. */
FMOD_DSP_TYPE_DISTORTION, /* This unit distorts the sound. */
FMOD_DSP_TYPE_NORMALIZE, /* This unit normalizes or amplifies the sound to a certain level. */
FMOD_DSP_TYPE_PARAMEQ, /* This unit attenuates or amplifies a selected frequency range. */
FMOD_DSP_TYPE_PITCHSHIFT, /* This unit bends the pitch of a sound without changing the speed of playback. */
FMOD_DSP_TYPE_CHORUS, /* This unit produces a chorus effect on the sound. */
FMOD_DSP_TYPE_VSTPLUGIN, /* This unit allows the use of Steinberg VST plugins */
FMOD_DSP_TYPE_WINAMPPLUGIN, /* This unit allows the use of Nullsoft Winamp plugins */
FMOD_DSP_TYPE_ITECHO, /* This unit produces an echo on the sound and fades out at the desired rate as is used in Impulse Tracker. */
FMOD_DSP_TYPE_COMPRESSOR, /* This unit implements dynamic compression (linked multichannel, wideband) */
FMOD_DSP_TYPE_SFXREVERB, /* This unit implements SFX reverb */
FMOD_DSP_TYPE_LOWPASS_SIMPLE, /* This unit filters sound using a simple lowpass with no resonance, but has flexible cutoff and is fast. */
FMOD_DSP_TYPE_DELAY, /* This unit produces different delays on individual channels of the sound. */
FMOD_DSP_TYPE_TREMOLO, /* This unit produces a tremolo / chopper effect on the sound. */
FMOD_DSP_TYPE_LADSPAPLUGIN, /* This unit allows the use of LADSPA standard plugins. */
FMOD_DSP_TYPE_HIGHPASS_SIMPLE, /* This unit filters sound using a simple highpass with no resonance, but has flexible cutoff and is fast. */
FMOD_DSP_TYPE_HARDWARE = 1000, /* Offset that platform specific FMOD_HARDWARE DSPs will start at. */
FMOD_DSP_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
} FMOD_DSP_TYPE;
/*
[STRUCTURE]
[
[DESCRIPTION]
Structure to define a parameter for a DSP unit.
[REMARKS]
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
Members marked with [w] mean the variable can be written to. The user can set the value.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
System::createDSP
DSP::setParameter
]
*/
typedef struct FMOD_DSP_PARAMETERDESC
{
float min; /* [w] Minimum value of the parameter (ie 100.0). */
float max; /* [w] Maximum value of the parameter (ie 22050.0). */
float defaultval; /* [w] Default value of parameter. */
char name[16]; /* [w] Name of the parameter to be displayed (ie "Cutoff frequency"). */
char label[16]; /* [w] Short string to be put next to value to denote the unit type (ie "hz"). */
const char *description; /* [w] Description of the parameter to be displayed as a help item / tooltip for this parameter. */
} FMOD_DSP_PARAMETERDESC;
/*
[STRUCTURE]
[
[DESCRIPTION]
When creating a DSP unit, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses a DSP unit of this type.
[REMARKS]
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
Members marked with [w] mean the variable can be written to. The user can set the value.
IMPORTANT: The 'paramdesc' member should point to static memory, as FMOD references the data internally using the pointer provided. Do not store these parameter description structures on the stack, or in heap memory that is freed while FMOD is using it.
There are 2 different ways to change a parameter in this architecture.
One is to use DSP::setParameter / DSP::getParameter. This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.
The other is to use DSP::showConfigDialog. This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
System::createDSP
FMOD_DSP_STATE
]
*/
typedef struct FMOD_DSP_DESCRIPTION
{
char name[32]; /* [w] Name of the unit to be displayed in the network. */
unsigned int version; /* [w] Plugin writer's version number. */
int channels; /* [w] Number of channels. Use 0 to process whatever number of channels is currently in the network. >0 would be mostly used if the unit is a unit that only generates sound. */
FMOD_DSP_CREATECALLBACK create; /* [w] Create callback. This is called when DSP unit is created. Can be null. */
FMOD_DSP_RELEASECALLBACK release; /* [w] Release callback. This is called just before the unit is freed so the user can do any cleanup needed for the unit. Can be null. */
FMOD_DSP_RESETCALLBACK reset; /* [w] Reset callback. This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state. Use to avoid clicks or artifacts. */
FMOD_DSP_READCALLBACK read; /* [w] Read callback. Processing is done here. Can be null. */
FMOD_DSP_SETPOSITIONCALLBACK setposition; /* [w] Set position callback. This is called if the unit wants to update its position info but not process data, or reset a cursor position internally if it is reading data from a certain source. Can be null. */
int numparameters; /* [w] Number of parameters used in this filter. The user finds this with DSP::getNumParameters */
FMOD_DSP_PARAMETERDESC *paramdesc; /* [w] Variable number of parameter structures. */
FMOD_DSP_SETPARAMCALLBACK setparameter; /* [w] This is called when the user calls DSP::setParameter. Can be null. */
FMOD_DSP_GETPARAMCALLBACK getparameter; /* [w] This is called when the user calls DSP::getParameter. Can be null. */
FMOD_DSP_DIALOGCALLBACK config; /* [w] This is called when the user calls DSP::showConfigDialog. Can be used to display a dialog to configure the filter. Can be null. */
int configwidth; /* [w] Width of config dialog graphic if there is one. 0 otherwise.*/
int configheight; /* [w] Height of config dialog graphic if there is one. 0 otherwise.*/
void *userdata; /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation. Access via DSP::getUserData. */
} FMOD_DSP_DESCRIPTION;
/*
[STRUCTURE]
[
[DESCRIPTION]
DSP plugin structure that is passed into each callback.
[REMARKS]
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
Members marked with [w] mean the variable can be written to. The user can set the value.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_DSP_DESCRIPTION
]
*/
struct FMOD_DSP_STATE
{
FMOD_DSP *instance; /* [r] Handle to the DSP hand the user created. Not to be modified. C++ users cast to FMOD::DSP to use. */
void *plugindata; /* [w] Plugin writer created data the output author wants to attach to this object. */
unsigned short speakermask; /* [w] Specifies which speakers the DSP effect is active on */
};
/*
===================================================================================================
FMOD built in effect parameters.
Use DSP::setParameter with these enums for the 'index' parameter.
===================================================================================================
*/
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_OSCILLATOR filter.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_OSCILLATOR_TYPE, /* Waveform type. 0 = sine. 1 = square. 2 = sawup. 3 = sawdown. 4 = triangle. 5 = noise. */
FMOD_DSP_OSCILLATOR_RATE /* Frequency of the sinewave in hz. 1.0 to 22000.0. Default = 220.0. */
} FMOD_DSP_OSCILLATOR;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_LOWPASS filter.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_LOWPASS_CUTOFF, /* Lowpass cutoff frequency in hz. 10.0 to 22000.0. Default = 5000.0. */
FMOD_DSP_LOWPASS_RESONANCE /* Lowpass resonance Q value. 1.0 to 10.0. Default = 1.0. */
} FMOD_DSP_LOWPASS;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_ITLOWPASS filter.
This is different to the default FMOD_DSP_TYPE_ITLOWPASS filter in that it uses a different quality algorithm and is
the filter used to produce the correct sounding playback in .IT files.
FMOD Ex's .IT playback uses this filter.
[REMARKS]
Note! This filter actually has a limited cutoff frequency below the specified maximum, due to its limited design,
so for a more open range filter use FMOD_DSP_LOWPASS or if you don't mind not having resonance,
FMOD_DSP_LOWPASS_SIMPLE.
The effective maximum cutoff is about 8060hz.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_ITLOWPASS_CUTOFF, /* Lowpass cutoff frequency in hz. 1.0 to 22000.0. Default = 5000.0/ */
FMOD_DSP_ITLOWPASS_RESONANCE /* Lowpass resonance Q value. 0.0 to 127.0. Default = 1.0. */
} FMOD_DSP_ITLOWPASS;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_HIGHPASS filter.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_HIGHPASS_CUTOFF, /* Highpass cutoff frequency in hz. 1.0 to output 22000.0. Default = 5000.0. */
FMOD_DSP_HIGHPASS_RESONANCE /* Highpass resonance Q value. 1.0 to 10.0. Default = 1.0. */
} FMOD_DSP_HIGHPASS;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_ECHO filter.
[REMARKS]
Note. Every time the delay is changed, the plugin re-allocates the echo buffer. This means the echo will dissapear at that time while it refills its new buffer.
Larger echo delays result in larger amounts of memory allocated.
'<i>maxchannels</i>' also dictates the amount of memory allocated. By default, the maxchannels value is 0. If FMOD is set to stereo, the echo unit will allocate enough memory for 2 channels. If it is 5.1, it will allocate enough memory for a 6 channel echo, etc.
If the echo effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.
When the echo is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly. It is only in this case where you might want to increase the channel count above the output's channel count.
If a channel echo is set to a lower number than the sound's channel count that is coming in, it will not echo the sound.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_ECHO_DELAY, /* Echo delay in ms. 10 to 5000. Default = 500. */
FMOD_DSP_ECHO_DECAYRATIO, /* Echo decay per delay. 0 to 1. 1.0 = No decay, 0.0 = total decay (ie simple 1 line delay). Default = 0.5. */
FMOD_DSP_ECHO_MAXCHANNELS, /* Maximum channels supported. 0 to 16. 0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc. See remarks for more. Default = 0. It is suggested to leave at 0! */
FMOD_DSP_ECHO_DRYMIX, /* Volume of original signal to pass to output. 0.0 to 1.0. Default = 1.0. */
FMOD_DSP_ECHO_WETMIX /* Volume of echo signal to pass to output. 0.0 to 1.0. Default = 1.0. */
} FMOD_DSP_ECHO;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_DELAY filter.
[REMARKS]
Note. Every time MaxDelay is changed, the plugin re-allocates the delay buffer. This means the delay will dissapear at that time while it refills its new buffer.
A larger MaxDelay results in larger amounts of memory allocated.
Channel delays above MaxDelay will be clipped to MaxDelay and the delay buffer will not be resized.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_DELAY_CH0, /* Channel #0 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH1, /* Channel #1 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH2, /* Channel #2 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH3, /* Channel #3 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH4, /* Channel #4 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH5, /* Channel #5 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH6, /* Channel #6 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH7, /* Channel #7 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH8, /* Channel #8 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH9, /* Channel #9 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH10, /* Channel #10 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH11, /* Channel #11 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH12, /* Channel #12 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH13, /* Channel #13 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH14, /* Channel #14 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_CH15, /* Channel #15 Delay in ms. 0 to 10000. Default = 0. */
FMOD_DSP_DELAY_MAXDELAY /* Maximum delay in ms. 0 to 10000. Default = 10. */
} FMOD_DSP_DELAY;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_FLANGE filter.
[REMARKS]
Flange is an effect where the signal is played twice at the same time, and one copy slides back and forth creating a whooshing or flanging effect.
As there are 2 copies of the same signal, by default each signal is given 50% mix, so that the total is not louder than the original unaffected signal.
Flange depth is a percentage of a 10ms shift from the original signal. Anything above 10ms is not considered flange because to the ear it begins to 'echo' so 10ms is the highest value possible.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_FLANGE_DRYMIX, /* Volume of original signal to pass to output. 0.0 to 1.0. Default = 0.45. */
FMOD_DSP_FLANGE_WETMIX, /* Volume of flange signal to pass to output. 0.0 to 1.0. Default = 0.55. */
FMOD_DSP_FLANGE_DEPTH, /* Flange depth (percentage of 40ms delay). 0.01 to 1.0. Default = 1.0. */
FMOD_DSP_FLANGE_RATE /* Flange speed in hz. 0.0 to 20.0. Default = 0.1. */
} FMOD_DSP_FLANGE;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_TREMOLO filter.
[REMARKS]
The tremolo effect varies the amplitude of a sound. Depending on the settings, this unit can produce a tremolo, chopper or auto-pan effect.
The shape of the LFO (low freq. oscillator) can morphed between sine, triangle and sawtooth waves using the FMOD_DSP_TREMOLO_SHAPE and FMOD_DSP_TREMOLO_SKEW parameters.
FMOD_DSP_TREMOLO_DUTY and FMOD_DSP_TREMOLO_SQUARE are useful for a chopper-type effect where the first controls the on-time duration and second controls the flatness of the envelope.
FMOD_DSP_TREMOLO_SPREAD varies the LFO phase between channels to get an auto-pan effect. This works best with a sine shape LFO.
The LFO can be synchronized using the FMOD_DSP_TREMOLO_PHASE parameter which sets its instantaneous phase.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_TREMOLO_FREQUENCY, /* LFO frequency in Hz. 0.1 to 20. Default = 4. */
FMOD_DSP_TREMOLO_DEPTH, /* Tremolo depth. 0 to 1. Default = 0. */
FMOD_DSP_TREMOLO_SHAPE, /* LFO shape morph between triangle and sine. 0 to 1. Default = 0. */
FMOD_DSP_TREMOLO_SKEW, /* Time-skewing of LFO cycle. -1 to 1. Default = 0. */
FMOD_DSP_TREMOLO_DUTY, /* LFO on-time. 0 to 1. Default = 0.5. */
FMOD_DSP_TREMOLO_SQUARE, /* Flatness of the LFO shape. 0 to 1. Default = 0. */
FMOD_DSP_TREMOLO_PHASE, /* Instantaneous LFO phase. 0 to 1. Default = 0. */
FMOD_DSP_TREMOLO_SPREAD /* Rotation / auto-pan effect. -1 to 1. Default = 0. */
} FMOD_DSP_TREMOLO;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_DISTORTION filter.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_DISTORTION_LEVEL /* Distortion value. 0.0 to 1.0. Default = 0.5. */
} FMOD_DSP_DISTORTION;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_NORMALIZE filter.
[REMARKS]
Normalize amplifies the sound based on the maximum peaks within the signal.
For example if the maximum peaks in the signal were 50% of the bandwidth, it would scale the whole sound by 2.
The lower threshold value makes the normalizer ignores peaks below a certain point, to avoid over-amplification if a loud signal suddenly came in, and also to avoid amplifying to maximum things like background hiss.
Because FMOD is a realtime audio processor, it doesn't have the luxury of knowing the peak for the whole sound (ie it can't see into the future), so it has to process data as it comes in.
To avoid very sudden changes in volume level based on small samples of new data, fmod fades towards the desired amplification which makes for smooth gain control. The fadetime parameter can control this.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_NORMALIZE_FADETIME, /* Time to ramp the silence to full in ms. 0.0 to 20000.0. Default = 5000.0. */
FMOD_DSP_NORMALIZE_THRESHHOLD, /* Lower volume range threshold to ignore. 0.0 to 1.0. Default = 0.1. Raise higher to stop amplification of very quiet signals. */
FMOD_DSP_NORMALIZE_MAXAMP /* Maximum amplification allowed. 1.0 to 100000.0. Default = 20.0. 1.0 = no amplifaction, higher values allow more boost. */
} FMOD_DSP_NORMALIZE;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_PARAMEQ filter.
[REMARKS]
Parametric EQ is a bandpass filter that attenuates or amplifies a selected frequency and its neighbouring frequencies.
To create a multi-band EQ create multiple FMOD_DSP_TYPE_PARAMEQ units and set each unit to different frequencies, for example 1000hz, 2000hz, 4000hz, 8000hz, 16000hz with a range of 1 octave each.
When a frequency has its gain set to 1.0, the sound will be unaffected and represents the original signal exactly.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_PARAMEQ_CENTER, /* Frequency center. 20.0 to 22000.0. Default = 8000.0. */
FMOD_DSP_PARAMEQ_BANDWIDTH, /* Octave range around the center frequency to filter. 0.2 to 5.0. Default = 1.0. */
FMOD_DSP_PARAMEQ_GAIN /* Frequency Gain. 0.05 to 3.0. Default = 1.0. */
} FMOD_DSP_PARAMEQ;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_PITCHSHIFT filter.
[REMARKS]
This pitch shifting unit can be used to change the pitch of a sound without speeding it up or slowing it down.
It can also be used for time stretching or scaling, for example if the pitch was doubled, and the frequency of the sound was halved, the pitch of the sound would sound correct but it would be twice as slow.
<b>Warning!</b> This filter is very computationally expensive! Similar to a vocoder, it requires several overlapping FFT and IFFT's to produce smooth output, and can require around 440mhz for 1 stereo 48khz signal using the default settings.
Reducing the signal to mono will half the cpu usage.
Reducing this will lower audio quality, but what settings to use are largely dependant on the sound being played. A noisy polyphonic signal will need higher fft size compared to a speaking voice for example.
This pitch shifter is based on the pitch shifter code at http://www.dspdimension.com, written by Stephan M. Bernsee.
The original code is COPYRIGHT 1999-2003 Stephan M. Bernsee <smb@dspdimension.com>.
'<i>maxchannels</i>' dictates the amount of memory allocated. By default, the maxchannels value is 0. If FMOD is set to stereo, the pitch shift unit will allocate enough memory for 2 channels. If it is 5.1, it will allocate enough memory for a 6 channel pitch shift, etc.
If the pitch shift effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.
When the pitch shift is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly. It is only in this case where you might want to increase the channel count above the output's channel count.
If a channel pitch shift is set to a lower number than the sound's channel count that is coming in, it will not pitch shift the sound.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_PITCHSHIFT_PITCH, /* Pitch value. 0.5 to 2.0. Default = 1.0. 0.5 = one octave down, 2.0 = one octave up. 1.0 does not change the pitch. */
FMOD_DSP_PITCHSHIFT_FFTSIZE, /* FFT window size. 256, 512, 1024, 2048, 4096. Default = 1024. Increase this to reduce 'smearing'. This effect is a warbling sound similar to when an mp3 is encoded at very low bitrates. */
FMOD_DSP_PITCHSHIFT_OVERLAP, /* Removed. Do not use. FMOD now uses 4 overlaps and cannot be changed. */
FMOD_DSP_PITCHSHIFT_MAXCHANNELS /* Maximum channels supported. 0 to 16. 0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc. See remarks for more. Default = 0. It is suggested to leave at 0! */
} FMOD_DSP_PITCHSHIFT;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_CHORUS filter.
[REMARKS]
Chrous is an effect where the sound is more 'spacious' due to 1 to 3 versions of the sound being played along side the original signal but with the pitch of each copy modulating on a sine wave.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_CHORUS_DRYMIX, /* Volume of original signal to pass to output. 0.0 to 1.0. Default = 0.5. */
FMOD_DSP_CHORUS_WETMIX1, /* Volume of 1st chorus tap. 0.0 to 1.0. Default = 0.5. */
FMOD_DSP_CHORUS_WETMIX2, /* Volume of 2nd chorus tap. This tap is 90 degrees out of phase of the first tap. 0.0 to 1.0. Default = 0.5. */
FMOD_DSP_CHORUS_WETMIX3, /* Volume of 3rd chorus tap. This tap is 90 degrees out of phase of the second tap. 0.0 to 1.0. Default = 0.5. */
FMOD_DSP_CHORUS_DELAY, /* Chorus delay in ms. 0.1 to 100.0. Default = 40.0 ms. */
FMOD_DSP_CHORUS_RATE, /* Chorus modulation rate in hz. 0.0 to 20.0. Default = 0.8 hz. */
FMOD_DSP_CHORUS_DEPTH /* Chorus modulation depth. 0.0 to 1.0. Default = 0.03. */
} FMOD_DSP_CHORUS;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_ITECHO filter.
This is effectively a software based echo filter that emulates the DirectX DMO echo effect. Impulse tracker files can support this, and FMOD will produce the effect on ANY platform, not just those that support DirectX effects!
[REMARKS]
Note. Every time the delay is changed, the plugin re-allocates the echo buffer. This means the echo will dissapear at that time while it refills its new buffer.
Larger echo delays result in larger amounts of memory allocated.
As this is a stereo filter made mainly for IT playback, it is targeted for stereo signals.
With mono signals only the FMOD_DSP_ITECHO_LEFTDELAY is used.
For multichannel signals (>2) there will be no echo on those channels.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::SetParameter
DSP::GetParameter
FMOD_DSP_TYPE
System::addDSP
]
*/
typedef enum
{
FMOD_DSP_ITECHO_WETDRYMIX, /* Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0.0 through 100.0 (all wet). The default value is 50. */
FMOD_DSP_ITECHO_FEEDBACK, /* Percentage of output fed back into input, in the range from 0.0 through 100.0. The default value is 50. */
FMOD_DSP_ITECHO_LEFTDELAY, /* Delay for left channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */
FMOD_DSP_ITECHO_RIGHTDELAY, /* Delay for right channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */
FMOD_DSP_ITECHO_PANDELAY /* Value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. Possible values are defined as 0.0 (equivalent to FALSE) and 1.0 (equivalent to TRUE). CURRENTLY NOT SUPPORTED. */
} FMOD_DSP_ITECHO;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_COMPRESSOR unit.
This is a simple linked multichannel software limiter that is uniform across the whole spectrum.
[REMARKS]
The limiter is not guaranteed to catch every peak above the threshold level,
because it cannot apply gain reduction instantaneously - the time delay is
determined by the attack time. However setting the attack time too short will
distort the sound, so it is a compromise. High level peaks can be avoided by
using a short attack time - but not too short, and setting the threshold a few
decibels below the critical level.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::SetParameter
DSP::GetParameter
FMOD_DSP_TYPE
System::addDSP
]
*/
typedef enum
{
FMOD_DSP_COMPRESSOR_THRESHOLD, /* Threshold level (dB) in the range from -60 through 0. The default value is 0. */
FMOD_DSP_COMPRESSOR_ATTACK, /* Gain reduction attack time (milliseconds), in the range from 10 through 200. The default value is 50. */
FMOD_DSP_COMPRESSOR_RELEASE, /* Gain reduction release time (milliseconds), in the range from 20 through 1000. The default value is 50. */
FMOD_DSP_COMPRESSOR_GAINMAKEUP /* Make-up gain (dB) applied after limiting, in the range from 0 through 30. The default value is 0. */
} FMOD_DSP_COMPRESSOR;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_SFXREVERB unit.
[REMARKS]
This is a high quality I3DL2 based reverb.
On top of the I3DL2 property set, "Dry Level" is also included to allow the dry mix to be changed.
These properties can be set with presets in FMOD_REVERB_PRESETS.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::SetParameter
DSP::GetParameter
FMOD_DSP_TYPE
System::addDSP
FMOD_REVERB_PRESETS
]
*/
typedef enum
{
FMOD_DSP_SFXREVERB_DRYLEVEL, /* Dry Level : Mix level of dry signal in output in mB. Ranges from -10000.0 to 0.0. Default is 0. */
FMOD_DSP_SFXREVERB_ROOM, /* Room : Room effect level at low frequencies in mB. Ranges from -10000.0 to 0.0. Default is -10000.0. */
FMOD_DSP_SFXREVERB_ROOMHF, /* Room HF : Room effect high-frequency level re. low frequency level in mB. Ranges from -10000.0 to 0.0. Default is 0.0. */
FMOD_DSP_SFXREVERB_DECAYTIME, /* Decay Time : Reverberation decay time at low-frequencies in seconds. Ranges from 0.1 to 20.0. Default is 1.0. */
FMOD_DSP_SFXREVERB_DECAYHFRATIO, /* Decay HF Ratio : High-frequency to low-frequency decay time ratio. Ranges from 0.1 to 2.0. Default is 0.5. */
FMOD_DSP_SFXREVERB_REFLECTIONSLEVEL, /* Reflections : Early reflections level relative to room effect in mB. Ranges from -10000.0 to 1000.0. Default is -10000.0. */
FMOD_DSP_SFXREVERB_REFLECTIONSDELAY, /* Reflect Delay : Delay time of first reflection in seconds. Ranges from 0.0 to 0.3. Default is 0.02. */
FMOD_DSP_SFXREVERB_REVERBLEVEL, /* Reverb : Late reverberation level relative to room effect in mB. Ranges from -10000.0 to 2000.0. Default is 0.0. */
FMOD_DSP_SFXREVERB_REVERBDELAY, /* Reverb Delay : Late reverberation delay time relative to first reflection in seconds. Ranges from 0.0 to 0.1. Default is 0.04. */
FMOD_DSP_SFXREVERB_DIFFUSION, /* Diffusion : Reverberation diffusion (echo density) in percent. Ranges from 0.0 to 100.0. Default is 100.0. */
FMOD_DSP_SFXREVERB_DENSITY, /* Density : Reverberation density (modal density) in percent. Ranges from 0.0 to 100.0. Default is 100.0. */
FMOD_DSP_SFXREVERB_HFREFERENCE, /* HF Reference : Reference high frequency in Hz. Ranges from 20.0 to 20000.0. Default is 5000.0. */
FMOD_DSP_SFXREVERB_ROOMLF, /* Room LF : Room effect low-frequency level in mB. Ranges from -10000.0 to 0.0. Default is 0.0. */
FMOD_DSP_SFXREVERB_LFREFERENCE /* LF Reference : Reference low-frequency in Hz. Ranges from 20.0 to 1000.0. Default is 250.0. */
} FMOD_DSP_SFXREVERB;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_LOWPASS_SIMPLE filter.
This is a very simple low pass filter, based on two single-pole RC time-constant modules.
The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_LOWPASS_SIMPLE_CUTOFF /* Lowpass cutoff frequency in hz. 10.0 to 22000.0. Default = 5000.0 */
} FMOD_DSP_LOWPASS_SIMPLE;
/*
[ENUM]
[
[DESCRIPTION]
Parameter types for the FMOD_DSP_TYPE_HIGHPASS_SIMPLE filter.
This is a very simple single-order high pass filter.
The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.
[REMARKS]
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
DSP::setParameter
DSP::getParameter
FMOD_DSP_TYPE
]
*/
typedef enum
{
FMOD_DSP_HIGHPASS_SIMPLE_CUTOFF /* Highpass cutoff frequency in hz. 10.0 to 22000.0. Default = 1000.0 */
} FMOD_DSP_HIGHPASS_SIMPLE;
#endif

123
engine/fmod-4/inc/fmod_errors.h

@ -1,123 +0,0 @@
/* ============================================================================================== */
/* FMOD Ex - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* */
/* Use this header if you want to store or display a string version / english explanation of */
/* the FMOD error codes. */
/* */
/* ============================================================================================== */
#ifndef _FMOD_ERRORS_H
#define _FMOD_ERRORS_H
#include "fmod.h"
#ifdef __GNUC__
static const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused));
#endif
static const char *FMOD_ErrorString(FMOD_RESULT errcode)
{
switch (errcode)
{
case FMOD_ERR_ALREADYLOCKED: return "Tried to call lock a second time before unlock was called. ";
case FMOD_ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). ";
case FMOD_ERR_CDDA_DRIVERS: return "Neither NTSCSI nor ASPI could be initialised. ";
case FMOD_ERR_CDDA_INIT: return "An error occurred while initialising the CDDA subsystem. ";
case FMOD_ERR_CDDA_INVALID_DEVICE: return "Couldn't find the specified device. ";
case FMOD_ERR_CDDA_NOAUDIO: return "No audio tracks on the specified disc. ";
case FMOD_ERR_CDDA_NODEVICES: return "No CD/DVD devices were found. ";
case FMOD_ERR_CDDA_NODISC: return "No disc present in the specified drive. ";
case FMOD_ERR_CDDA_READ: return "A CDDA read error occurred. ";
case FMOD_ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel. ";
case FMOD_ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound. ";
case FMOD_ERR_COM: return "A Win32 COM related error occured. COM failed to initialize or a QueryInterface failed meaning a Windows codec or driver was not installed properly. ";
case FMOD_ERR_DMA: return "DMA Failure. See debug output for more information. ";
case FMOD_ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependancy. Or tried to connect a tree too many units deep (more than 128). ";
case FMOD_ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format. ";
case FMOD_ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified. ";
case FMOD_ERR_DSP_RUNNING: return "DSP error. Cannot perform this operation while the network is in the middle of running. This will most likely happen if a connection or disconnection is attempted in a DSP callback. ";
case FMOD_ERR_DSP_TOOMANYCONNECTIONS: return "DSP connection error. The unit being connected to or disconnected should only have 1 input or output. ";
case FMOD_ERR_EVENT_ALREADY_LOADED: return "The specified project or bank has already been loaded. Having multiple copies of the same project loaded simultaneously is forbidden. ";
case FMOD_ERR_EVENT_FAILED: return "An Event failed to be retrieved, most likely due to 'just fail' being specified as the max playbacks behavior. ";
case FMOD_ERR_EVENT_GUIDCONFLICT: return "An event with the same GUID already exists. ";
case FMOD_ERR_EVENT_INFOONLY: return "Can't execute this command on an EVENT_INFOONLY event. ";
case FMOD_ERR_EVENT_INTERNAL: return "An error occured that wasn't supposed to. See debug log for reason. ";
case FMOD_ERR_EVENT_MAXSTREAMS: return "Event failed because 'Max streams' was hit when FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS was specified. ";
case FMOD_ERR_EVENT_MISMATCH: return "FSB mismatches the FEV it was compiled with, the stream/sample mode it was meant to be created with was different, or the FEV was built for a different platform. ";
case FMOD_ERR_EVENT_NAMECONFLICT: return "A category with the same name already exists. ";
case FMOD_ERR_EVENT_NEEDSSIMPLE: return "Tried to call a function on a complex event that's only supported by simple events. ";
case FMOD_ERR_EVENT_NOTFOUND: return "The requested event, event group, event category or event property could not be found. ";
case FMOD_ERR_FILE_BAD: return "Error loading file. ";
case FMOD_ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format. ";
case FMOD_ERR_FILE_DISKEJECTED: return "Media was ejected while reading. ";
case FMOD_ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated data?). ";
case FMOD_ERR_FILE_NOTFOUND: return "File not found. ";
case FMOD_ERR_FILE_UNWANTED: return "Unwanted file access occured. ";
case FMOD_ERR_FORMAT: return "Unsupported file or audio format. ";
case FMOD_ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. ";
case FMOD_ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden. ";
case FMOD_ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource. ";
case FMOD_ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred. ";
case FMOD_ERR_HTTP_TIMEOUT: return "The HTTP request timed out. ";
case FMOD_ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function. ";
case FMOD_ERR_INITIALIZED: return "Cannot call this command after System::init. ";
case FMOD_ERR_INTERNAL: return "An error occured that wasn't supposed to. Contact support. ";
case FMOD_ERR_INVALID_ADDRESS: return "On Xbox 360, this memory address passed to FMOD must be physical, (ie allocated with XPhysicalAlloc.) ";
case FMOD_ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float. ";
case FMOD_ERR_INVALID_HANDLE: return "An invalid object handle was used. ";
case FMOD_ERR_INVALID_PARAM: return "An invalid parameter was passed to this function. ";
case FMOD_ERR_INVALID_POSITION: return "An invalid seek position was passed to this function. ";
case FMOD_ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode. ";
case FMOD_ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle. ";
case FMOD_ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular. ";
case FMOD_ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup. ";
case FMOD_ERR_MEMORY: return "Not enough memory or resources. ";
case FMOD_ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. ";
case FMOD_ERR_MEMORY_SRAM: return "Not enough memory or resources on console sound ram. ";
case FMOD_ERR_MUSIC_NOCALLBACK: return "The music callback is required, but it has not been set. ";
case FMOD_ERR_MUSIC_NOTFOUND: return "The requested music entity could not be found. ";
case FMOD_ERR_MUSIC_UNINITIALIZED: return "Music system is not initialized probably because no music data is loaded. ";
case FMOD_ERR_NEEDS2D: return "Tried to call a command on a 3d sound when the command was meant for 2d sound. ";
case FMOD_ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound. ";
case FMOD_ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support. (ie trying to play a GCADPCM compressed sound in software on Wii). ";
case FMOD_ERR_NEEDSSOFTWARE: return "Tried to use a feature that requires the software engine. Software engine has either been turned off, or command was executed on a hardware channel which does not support this feature. ";
case FMOD_ERR_NET_CONNECT: return "Couldn't connect to the specified host. ";
case FMOD_ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere. ";
case FMOD_ERR_NET_URL: return "The specified URL couldn't be resolved. ";
case FMOD_ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately. ";
case FMOD_ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready. ";
case FMOD_ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused. ";
case FMOD_ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer. ";
case FMOD_ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. ";
case FMOD_ERR_OUTPUT_ENUMERATION: return "Error enumerating the available driver list. List may be inconsistent due to a recent device addition or removal. ";
case FMOD_ERR_OUTPUT_FORMAT: return "Soundcard does not support the minimum features needed for this soundsystem (16bit stereo output). ";
case FMOD_ERR_OUTPUT_INIT: return "Error initializing output device. ";
case FMOD_ERR_OUTPUT_NOHARDWARE: return "FMOD_HARDWARE was specified but the sound card does not have the resources necessary to play it. ";
case FMOD_ERR_OUTPUT_NOSOFTWARE: return "Attempted to create a software sound but no software channels were specified in System::init. ";
case FMOD_ERR_PAN: return "Panning only works with mono or stereo sound sources. ";
case FMOD_ERR_PLUGIN: return "An unspecified error has been returned from a 3rd party plugin. ";
case FMOD_ERR_PLUGIN_INSTANCES: return "The number of allowed instances of a plugin has been exceeded. ";
case FMOD_ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available. ";
case FMOD_ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback or other DLLs that it needs to load) ";
case FMOD_ERR_PRELOADED: return "The specified sound is still in use by the event system, call EventSystem::unloadFSB before trying to release it. ";
case FMOD_ERR_PROGRAMMERSOUND: return "The specified sound is still in use by the event system, wait for the event which is using it finish with it. ";
case FMOD_ERR_RECORD: return "An error occured trying to initialize the recording device. ";
case FMOD_ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesnt exist. ";
case FMOD_ERR_SUBSOUNDS: return "The error occured because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound, or a parent sound was played without setting up a sentence first. ";
case FMOD_ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first. ";
case FMOD_ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file. ";
case FMOD_ERR_SUBSOUND_MODE: return "The subsound's mode bits do not match with the parent sound's mode bits. See documentation for function that it was called with. ";
case FMOD_ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags. ";
case FMOD_ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the maxinputchannels parameter in System::setSoftwareFormat. ";
case FMOD_ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support! ";
case FMOD_ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called. ";
case FMOD_ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified. ";
case FMOD_ERR_UPDATE: return "An error caused by System::update occured. ";
case FMOD_ERR_VERSION: return "The version number of this file format is not supported. ";
case FMOD_OK: return "No errors.";
default : return "Unknown error.";
};
}
#endif

201
engine/fmod-4/inc/fmod_memoryinfo.h

@ -1,201 +0,0 @@
/* ============================================================================================= */
/* FMOD Ex - Memory info header file. Copyright (c), Firelight Technologies Pty, Ltd. 2008-2016. */
/* */
/* Use this header if you are interested in getting detailed information on FMOD's memory */
/* usage. See the documentation for more details. */
/* */
/* ============================================================================================= */
#ifndef _FMOD_MEMORYINFO_H
#define _FMOD_MEMORYINFO_H
/*
[STRUCTURE]
[
[DESCRIPTION]
Structure to be filled with detailed memory usage information of an FMOD object
[REMARKS]
Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
On return from getMemoryInfo, each member of this structure will hold the amount of memory used for its type in bytes.
Members marked with [in] mean the user sets the value before passing it to the function.
Members marked with [out] mean FMOD sets the value to be used after the function exits.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
System::getMemoryInfo
EventSystem::getMemoryInfo
FMOD_MEMBITS
FMOD_EVENT_MEMBITS
]
*/
typedef struct FMOD_MEMORY_USAGE_DETAILS
{
unsigned int other; /* [out] Memory not accounted for by other types */
unsigned int string; /* [out] String data */
unsigned int system; /* [out] System object and various internals */
unsigned int plugins; /* [out] Plugin objects and internals */
unsigned int output; /* [out] Output module object and internals */
unsigned int channel; /* [out] Channel related memory */
unsigned int channelgroup; /* [out] ChannelGroup objects and internals */
unsigned int codec; /* [out] Codecs allocated for streaming */
unsigned int file; /* [out] File buffers and structures */
unsigned int sound; /* [out] Sound objects and internals */
unsigned int secondaryram; /* [out] Sound data stored in secondary RAM */
unsigned int soundgroup; /* [out] SoundGroup objects and internals */
unsigned int streambuffer; /* [out] Stream buffer memory */
unsigned int dspconnection; /* [out] DSPConnection objects and internals */
unsigned int dsp; /* [out] DSP implementation objects */
unsigned int dspcodec; /* [out] Realtime file format decoding DSP objects */
unsigned int profile; /* [out] Profiler memory footprint. */
unsigned int recordbuffer; /* [out] Buffer used to store recorded data from microphone */
unsigned int reverb; /* [out] Reverb implementation objects */
unsigned int reverbchannelprops; /* [out] Reverb channel properties structs */
unsigned int geometry; /* [out] Geometry objects and internals */
unsigned int syncpoint; /* [out] Sync point memory. */
unsigned int eventsystem; /* [out] EventSystem and various internals */
unsigned int musicsystem; /* [out] MusicSystem and various internals */
unsigned int fev; /* [out] Definition of objects contained in all loaded projects e.g. events, groups, categories */
unsigned int memoryfsb; /* [out] Data loaded with preloadFSB */
unsigned int eventproject; /* [out] EventProject objects and internals */
unsigned int eventgroupi; /* [out] EventGroup objects and internals */
unsigned int soundbankclass; /* [out] Objects used to manage wave banks */
unsigned int soundbanklist; /* [out] Data used to manage lists of wave bank usage */
unsigned int streaminstance; /* [out] Stream objects and internals */
unsigned int sounddefclass; /* [out] Sound definition objects */
unsigned int sounddefdefclass; /* [out] Sound definition static data objects */
unsigned int sounddefpool; /* [out] Sound definition pool data */
unsigned int reverbdef; /* [out] Reverb definition objects */
unsigned int eventreverb; /* [out] Reverb objects */
unsigned int userproperty; /* [out] User property objects */
unsigned int eventinstance; /* [out] Event instance base objects */
unsigned int eventinstance_complex; /* [out] Complex event instance objects */
unsigned int eventinstance_simple; /* [out] Simple event instance objects */
unsigned int eventinstance_layer; /* [out] Event layer instance objects */
unsigned int eventinstance_sound; /* [out] Event sound instance objects */
unsigned int eventenvelope; /* [out] Event envelope objects */
unsigned int eventenvelopedef; /* [out] Event envelope definition objects */
unsigned int eventparameter; /* [out] Event parameter objects */
unsigned int eventcategory; /* [out] Event category objects */
unsigned int eventenvelopepoint; /* [out] Event envelope point objects */
unsigned int eventinstancepool; /* [out] Event instance pool memory */
} FMOD_MEMORY_USAGE_DETAILS;
/*
[DEFINE]
[
[NAME]
FMOD_MEMBITS
[DESCRIPTION]
Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Ex class.
Use with the "memorybits" parameter of getMemoryInfo to get information on FMOD Ex memory usage.
[REMARKS]
Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
The FMOD_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See System::getMemoryInfo for an example.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_EVENT_MEMBITS
System::getMemoryInfo
]
*/
#define FMOD_MEMBITS_OTHER 0x00000001 /* Memory not accounted for by other types */
#define FMOD_MEMBITS_STRING 0x00000002 /* String data */
#define FMOD_MEMBITS_SYSTEM 0x00000004 /* System object and various internals */
#define FMOD_MEMBITS_PLUGINS 0x00000008 /* Plugin objects and internals */
#define FMOD_MEMBITS_OUTPUT 0x00000010 /* Output module object and internals */
#define FMOD_MEMBITS_CHANNEL 0x00000020 /* Channel related memory */
#define FMOD_MEMBITS_CHANNELGROUP 0x00000040 /* ChannelGroup objects and internals */
#define FMOD_MEMBITS_CODEC 0x00000080 /* Codecs allocated for streaming */
#define FMOD_MEMBITS_FILE 0x00000100 /* Codecs allocated for streaming */
#define FMOD_MEMBITS_SOUND 0x00000200 /* Sound objects and internals */
#define FMOD_MEMBITS_SOUND_SECONDARYRAM 0x00000400 /* Sound data stored in secondary RAM */
#define FMOD_MEMBITS_SOUNDGROUP 0x00000800 /* SoundGroup objects and internals */
#define FMOD_MEMBITS_STREAMBUFFER 0x00001000 /* Stream buffer memory */
#define FMOD_MEMBITS_DSPCONNECTION 0x00002000 /* DSPConnection objects and internals */
#define FMOD_MEMBITS_DSP 0x00004000 /* DSP implementation objects */
#define FMOD_MEMBITS_DSPCODEC 0x00008000 /* Realtime file format decoding DSP objects */
#define FMOD_MEMBITS_PROFILE 0x00010000 /* Profiler memory footprint. */
#define FMOD_MEMBITS_RECORDBUFFER 0x00020000 /* Buffer used to store recorded data from microphone */
#define FMOD_MEMBITS_REVERB 0x00040000 /* Reverb implementation objects */
#define FMOD_MEMBITS_REVERBCHANNELPROPS 0x00080000 /* Reverb channel properties structs */
#define FMOD_MEMBITS_GEOMETRY 0x00100000 /* Geometry objects and internals */
#define FMOD_MEMBITS_SYNCPOINT 0x00200000 /* Sync point memory. */
#define FMOD_MEMBITS_ALL 0xffffffff /* All memory used by FMOD Ex */
/* [DEFINE_END] */
/*
[DEFINE]
[
[NAME]
FMOD_EVENT_MEMBITS
[DESCRIPTION]
Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Event System class.
Use with the "event_memorybits" parameter of getMemoryInfo to get information on FMOD Event System memory usage.
[REMARKS]
Every public FMOD Event System class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
The FMOD_EVENT_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See EventSystem::getMemoryInfo for an example.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_MEMBITS
System::getMemoryInfo
]
*/
#define FMOD_EVENT_MEMBITS_EVENTSYSTEM 0x00000001 /* EventSystem and various internals */
#define FMOD_EVENT_MEMBITS_MUSICSYSTEM 0x00000002 /* MusicSystem and various internals */
#define FMOD_EVENT_MEMBITS_FEV 0x00000004 /* Definition of objects contained in all loaded projects e.g. events, groups, categories */
#define FMOD_EVENT_MEMBITS_MEMORYFSB 0x00000008 /* Data loaded with preloadFSB */
#define FMOD_EVENT_MEMBITS_EVENTPROJECT 0x00000010 /* EventProject objects and internals */
#define FMOD_EVENT_MEMBITS_EVENTGROUPI 0x00000020 /* EventGroup objects and internals */
#define FMOD_EVENT_MEMBITS_SOUNDBANKCLASS 0x00000040 /* Objects used to manage wave banks */
#define FMOD_EVENT_MEMBITS_SOUNDBANKLIST 0x00000080 /* Data used to manage lists of wave bank usage */
#define FMOD_EVENT_MEMBITS_STREAMINSTANCE 0x00000100 /* Stream objects and internals */
#define FMOD_EVENT_MEMBITS_SOUNDDEFCLASS 0x00000200 /* Sound definition objects */
#define FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS 0x00000400 /* Sound definition static data objects */
#define FMOD_EVENT_MEMBITS_SOUNDDEFPOOL 0x00000800 /* Sound definition pool data */
#define FMOD_EVENT_MEMBITS_REVERBDEF 0x00001000 /* Reverb definition objects */
#define FMOD_EVENT_MEMBITS_EVENTREVERB 0x00002000 /* Reverb objects */
#define FMOD_EVENT_MEMBITS_USERPROPERTY 0x00004000 /* User property objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE 0x00008000 /* Event instance base objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX 0x00010000 /* Complex event instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE 0x00020000 /* Simple event instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER 0x00040000 /* Event layer instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND 0x00080000 /* Event sound instance objects */
#define FMOD_EVENT_MEMBITS_EVENTENVELOPE 0x00100000 /* Event envelope objects */
#define FMOD_EVENT_MEMBITS_EVENTENVELOPEDEF 0x00200000 /* Event envelope definition objects */
#define FMOD_EVENT_MEMBITS_EVENTPARAMETER 0x00400000 /* Event parameter objects */
#define FMOD_EVENT_MEMBITS_EVENTCATEGORY 0x00800000 /* Event category objects */
#define FMOD_EVENT_MEMBITS_EVENTENVELOPEPOINT 0x01000000 /* Event envelope point object+s */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCEPOOL 0x02000000 /* Event instance pool data */
#define FMOD_EVENT_MEMBITS_ALL 0xffffffff /* All memory used by FMOD Event System */
/* All event instance memory */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_GROUP (FMOD_EVENT_MEMBITS_EVENTINSTANCE | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND)
/* All sound definition memory */
#define FMOD_EVENT_MEMBITS_SOUNDDEF_GROUP (FMOD_EVENT_MEMBITS_SOUNDDEFCLASS | \
FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS | \
FMOD_EVENT_MEMBITS_SOUNDDEFPOOL)
/* [DEFINE_END] */
#endif

93
engine/fmod-4/inc/fmod_output.h

@ -1,93 +0,0 @@
/* ==================================================================================================== */
/* FMOD Ex - output development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* */
/* Use this header if you are wanting to develop your own output plugin to use with */
/* FMOD's output system. With this header you can make your own output plugin that FMOD */
/* can register and use. See the documentation and examples on how to make a working plugin. */
/* */
/* ==================================================================================================== */
#ifndef _FMOD_OUTPUT_H
#define _FMOD_OUTPUT_H
#include "fmod.h"
typedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE;
/*
Output callbacks
*/
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETNUMDRIVERSCALLBACK)(FMOD_OUTPUT_STATE *output_state, int *numdrivers);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERNAMECALLBACK)(FMOD_OUTPUT_STATE *output_state, int id, char *name, int namelen);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERCAPSCALLBACK)(FMOD_OUTPUT_STATE *output_state, int id, FMOD_CAPS *caps);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_INITCALLBACK) (FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, int outputchannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_CLOSECALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UPDATECALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETHANDLECALLBACK) (FMOD_OUTPUT_STATE *output_state, void **handle);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETPOSITIONCALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_LOCKCALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UNLOCKCALLBACK) (FMOD_OUTPUT_STATE *output_state, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_READFROMMIXER) (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length);
/*
[STRUCTURE]
[
[DESCRIPTION]
When creating an output, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file of this type.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_OUTPUT_STATE
]
*/
typedef struct FMOD_OUTPUT_DESCRIPTION
{
const char *name; /* [in] Name of the output. */
unsigned int version; /* [in] Plugin writer's version number. */
int polling; /* [in] If TRUE (non zero), this tells FMOD to start a thread and call getposition / lock / unlock for feeding data. If 0, the output is probably callback based, so all the plugin needs to do is call readfrommixer to the appropriate pointer. */
FMOD_OUTPUT_GETNUMDRIVERSCALLBACK getnumdrivers; /* [in] For sound device enumeration. This callback is to give System::getNumDrivers somthing to return. */
FMOD_OUTPUT_GETDRIVERNAMECALLBACK getdrivername; /* [in] For sound device enumeration. This callback is to give System::getDriverName somthing to return. */
FMOD_OUTPUT_GETDRIVERCAPSCALLBACK getdrivercaps; /* [in] For sound device enumeration. This callback is to give System::getDriverCaps somthing to return. */
FMOD_OUTPUT_INITCALLBACK init; /* [in] Initialization function for the output device. This is called from System::init. */
FMOD_OUTPUT_CLOSECALLBACK close; /* [in] Cleanup / close down function for the output device. This is called from System::close. */
FMOD_OUTPUT_UPDATECALLBACK update; /* [in] Update function that is called once a frame by the user. This is called from System::update. */
FMOD_OUTPUT_GETHANDLECALLBACK gethandle; /* [in] This is called from System::getOutputHandle. This is just to return a pointer to the internal system device object that the system may be using.*/
FMOD_OUTPUT_GETPOSITIONCALLBACK getposition; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This returns a position value in samples so that FMOD knows where and when to fill its buffer. */
FMOD_OUTPUT_LOCKCALLBACK lock; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This function provides a pointer to data that FMOD can write to when software mixing. */
FMOD_OUTPUT_UNLOCKCALLBACK unlock; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This optional function accepts the data that has been mixed and copies it or does whatever it needs to before sending it to the hardware. */
} FMOD_OUTPUT_DESCRIPTION;
/*
[STRUCTURE]
[
[DESCRIPTION]
Output plugin structure that is passed into each callback.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_OUTPUT_DESCRIPTION
]
*/
struct FMOD_OUTPUT_STATE
{
void *plugindata; /* [in] Plugin writer created data the output author wants to attach to this object. */
FMOD_OUTPUT_READFROMMIXER readfrommixer; /* [out] Function to update mixer and write the result to the provided pointer. Used from callback based output only. Polling based output uses lock/unlock/getposition. */
};
#endif

BIN
engine/fmod-4/lib/fmodexL_vc.lib

BIN
engine/fmod-4/lib/fmodex_vc.lib

3794
engine/fmodcore/inc/fmod.cs
File diff suppressed because it is too large
View File

665
engine/fmodcore/inc/fmod.h

@ -0,0 +1,665 @@
/* ======================================================================================== */
/* FMOD Core API - C header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header in conjunction with fmod_common.h (which contains all the constants / */
/* callbacks) to develop using the C interface */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */
/* ======================================================================================== */
#ifndef _FMOD_H
#define _FMOD_H
#include "fmod_common.h"
#ifdef __cplusplus
extern "C"
{
#endif
/*
FMOD global system functions (optional).
*/
FMOD_RESULT F_API FMOD_Memory_Initialize (void *poolmem, int poollen, FMOD_MEMORY_ALLOC_CALLBACK useralloc, FMOD_MEMORY_REALLOC_CALLBACK userrealloc, FMOD_MEMORY_FREE_CALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags);
FMOD_RESULT F_API FMOD_Memory_GetStats (int *currentalloced, int *maxalloced, FMOD_BOOL blocking);
FMOD_RESULT F_API FMOD_Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode, FMOD_DEBUG_CALLBACK callback, const char *filename);
FMOD_RESULT F_API FMOD_File_SetDiskBusy (int busy);
FMOD_RESULT F_API FMOD_File_GetDiskBusy (int *busy);
/*
FMOD System factory functions. Use this to create an FMOD System Instance. below you will see FMOD_System_Init/Close to get started.
*/
FMOD_RESULT F_API FMOD_System_Create (FMOD_SYSTEM **system);
FMOD_RESULT F_API FMOD_System_Release (FMOD_SYSTEM *system);
/*
'System' API
*/
/* Setup functions. */
FMOD_RESULT F_API FMOD_System_SetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE output);
FMOD_RESULT F_API FMOD_System_GetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE *output);
FMOD_RESULT F_API FMOD_System_GetNumDrivers (FMOD_SYSTEM *system, int *numdrivers);
FMOD_RESULT F_API FMOD_System_GetDriverInfo (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
FMOD_RESULT F_API FMOD_System_SetDriver (FMOD_SYSTEM *system, int driver);
FMOD_RESULT F_API FMOD_System_GetDriver (FMOD_SYSTEM *system, int *driver);
FMOD_RESULT F_API FMOD_System_SetSoftwareChannels (FMOD_SYSTEM *system, int numsoftwarechannels);
FMOD_RESULT F_API FMOD_System_GetSoftwareChannels (FMOD_SYSTEM *system, int *numsoftwarechannels);
FMOD_RESULT F_API FMOD_System_SetSoftwareFormat (FMOD_SYSTEM *system, int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers);
FMOD_RESULT F_API FMOD_System_GetSoftwareFormat (FMOD_SYSTEM *system, int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers);
FMOD_RESULT F_API FMOD_System_SetDSPBufferSize (FMOD_SYSTEM *system, unsigned int bufferlength, int numbuffers);
FMOD_RESULT F_API FMOD_System_GetDSPBufferSize (FMOD_SYSTEM *system, unsigned int *bufferlength, int *numbuffers);
FMOD_RESULT F_API FMOD_System_SetFileSystem (FMOD_SYSTEM *system, FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek, FMOD_FILE_ASYNCREAD_CALLBACK userasyncread, FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign);
FMOD_RESULT F_API FMOD_System_AttachFileSystem (FMOD_SYSTEM *system, FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek);
FMOD_RESULT F_API FMOD_System_SetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);
FMOD_RESULT F_API FMOD_System_GetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);
FMOD_RESULT F_API FMOD_System_SetCallback (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask);
/* Plug-in support. */
FMOD_RESULT F_API FMOD_System_SetPluginPath (FMOD_SYSTEM *system, const char *path);
FMOD_RESULT F_API FMOD_System_LoadPlugin (FMOD_SYSTEM *system, const char *filename, unsigned int *handle, unsigned int priority);
FMOD_RESULT F_API FMOD_System_UnloadPlugin (FMOD_SYSTEM *system, unsigned int handle);
FMOD_RESULT F_API FMOD_System_GetNumNestedPlugins (FMOD_SYSTEM *system, unsigned int handle, int *count);
FMOD_RESULT F_API FMOD_System_GetNestedPlugin (FMOD_SYSTEM *system, unsigned int handle, int index, unsigned int *nestedhandle);
FMOD_RESULT F_API FMOD_System_GetNumPlugins (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int *numplugins);
FMOD_RESULT F_API FMOD_System_GetPluginHandle (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
FMOD_RESULT F_API FMOD_System_GetPluginInfo (FMOD_SYSTEM *system, unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
FMOD_RESULT F_API FMOD_System_SetOutputByPlugin (FMOD_SYSTEM *system, unsigned int handle);
FMOD_RESULT F_API FMOD_System_GetOutputByPlugin (FMOD_SYSTEM *system, unsigned int *handle);
FMOD_RESULT F_API FMOD_System_CreateDSPByPlugin (FMOD_SYSTEM *system, unsigned int handle, FMOD_DSP **dsp);
FMOD_RESULT F_API FMOD_System_GetDSPInfoByPlugin (FMOD_SYSTEM *system, unsigned int handle, const FMOD_DSP_DESCRIPTION **description);
FMOD_RESULT F_API FMOD_System_RegisterCodec (FMOD_SYSTEM *system, FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority);
FMOD_RESULT F_API FMOD_System_RegisterDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
FMOD_RESULT F_API FMOD_System_RegisterOutput (FMOD_SYSTEM *system, const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle);
/* Init/Close. */
FMOD_RESULT F_API FMOD_System_Init (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
FMOD_RESULT F_API FMOD_System_Close (FMOD_SYSTEM *system);
/* General post-init system functions. */
FMOD_RESULT F_API FMOD_System_Update (FMOD_SYSTEM *system);
FMOD_RESULT F_API FMOD_System_SetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float x, float y, FMOD_BOOL active);
FMOD_RESULT F_API FMOD_System_GetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float *x, float *y, FMOD_BOOL *active);
FMOD_RESULT F_API FMOD_System_SetStreamBufferSize (FMOD_SYSTEM *system, unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
FMOD_RESULT F_API FMOD_System_GetStreamBufferSize (FMOD_SYSTEM *system, unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
FMOD_RESULT F_API FMOD_System_Set3DSettings (FMOD_SYSTEM *system, float dopplerscale, float distancefactor, float rolloffscale);
FMOD_RESULT F_API FMOD_System_Get3DSettings (FMOD_SYSTEM *system, float *dopplerscale, float *distancefactor, float *rolloffscale);
FMOD_RESULT F_API FMOD_System_Set3DNumListeners (FMOD_SYSTEM *system, int numlisteners);
FMOD_RESULT F_API FMOD_System_Get3DNumListeners (FMOD_SYSTEM *system, int *numlisteners);
FMOD_RESULT F_API FMOD_System_Set3DListenerAttributes (FMOD_SYSTEM *system, int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
FMOD_RESULT F_API FMOD_System_Get3DListenerAttributes (FMOD_SYSTEM *system, int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
FMOD_RESULT F_API FMOD_System_Set3DRolloffCallback (FMOD_SYSTEM *system, FMOD_3D_ROLLOFF_CALLBACK callback);
FMOD_RESULT F_API FMOD_System_MixerSuspend (FMOD_SYSTEM *system);
FMOD_RESULT F_API FMOD_System_MixerResume (FMOD_SYSTEM *system);
FMOD_RESULT F_API FMOD_System_GetDefaultMixMatrix (FMOD_SYSTEM *system, FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop);
FMOD_RESULT F_API FMOD_System_GetSpeakerModeChannels (FMOD_SYSTEM *system, FMOD_SPEAKERMODE mode, int *channels);
/* System information functions. */
FMOD_RESULT F_API FMOD_System_GetVersion (FMOD_SYSTEM *system, unsigned int *version);
FMOD_RESULT F_API FMOD_System_GetOutputHandle (FMOD_SYSTEM *system, void **handle);
FMOD_RESULT F_API FMOD_System_GetChannelsPlaying (FMOD_SYSTEM *system, int *channels, int *realchannels);
FMOD_RESULT F_API FMOD_System_GetCPUUsage (FMOD_SYSTEM *system, float *dsp, float *stream, float *geometry, float *update, float *total);
FMOD_RESULT F_API FMOD_System_GetFileUsage (FMOD_SYSTEM *system, long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead);
/* Sound/DSP/Channel/FX creation and retrieval. */
FMOD_RESULT F_API FMOD_System_CreateSound (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);
FMOD_RESULT F_API FMOD_System_CreateStream (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);
FMOD_RESULT F_API FMOD_System_CreateDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, FMOD_DSP **dsp);
FMOD_RESULT F_API FMOD_System_CreateDSPByType (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, FMOD_DSP **dsp);
FMOD_RESULT F_API FMOD_System_CreateChannelGroup (FMOD_SYSTEM *system, const char *name, FMOD_CHANNELGROUP **channelgroup);
FMOD_RESULT F_API FMOD_System_CreateSoundGroup (FMOD_SYSTEM *system, const char *name, FMOD_SOUNDGROUP **soundgroup);
FMOD_RESULT F_API FMOD_System_CreateReverb3D (FMOD_SYSTEM *system, FMOD_REVERB3D **reverb);
FMOD_RESULT F_API FMOD_System_PlaySound (FMOD_SYSTEM *system, FMOD_SOUND *sound, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel);
FMOD_RESULT F_API FMOD_System_PlayDSP (FMOD_SYSTEM *system, FMOD_DSP *dsp, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel);
FMOD_RESULT F_API FMOD_System_GetChannel (FMOD_SYSTEM *system, int channelid, FMOD_CHANNEL **channel);
FMOD_RESULT F_API FMOD_System_GetMasterChannelGroup (FMOD_SYSTEM *system, FMOD_CHANNELGROUP **channelgroup);
FMOD_RESULT F_API FMOD_System_GetMasterSoundGroup (FMOD_SYSTEM *system, FMOD_SOUNDGROUP **soundgroup);
/* Routing to ports. */
FMOD_RESULT F_API FMOD_System_AttachChannelGroupToPort (FMOD_SYSTEM *system, FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL passThru);
FMOD_RESULT F_API FMOD_System_DetachChannelGroupFromPort(FMOD_SYSTEM *system, FMOD_CHANNELGROUP *channelgroup);
/* Reverb API. */
FMOD_RESULT F_API FMOD_System_SetReverbProperties (FMOD_SYSTEM *system, int instance, const FMOD_REVERB_PROPERTIES *prop);
FMOD_RESULT F_API FMOD_System_GetReverbProperties (FMOD_SYSTEM *system, int instance, FMOD_REVERB_PROPERTIES *prop);
/* System level DSP functionality. */
FMOD_RESULT F_API FMOD_System_LockDSP (FMOD_SYSTEM *system);
FMOD_RESULT F_API FMOD_System_UnlockDSP (FMOD_SYSTEM *system);
/* Recording API. */
FMOD_RESULT F_API FMOD_System_GetRecordNumDrivers (FMOD_SYSTEM *system, int *numdrivers, int *numconnected);
FMOD_RESULT F_API FMOD_System_GetRecordDriverInfo (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_DRIVER_STATE *state);
FMOD_RESULT F_API FMOD_System_GetRecordPosition (FMOD_SYSTEM *system, int id, unsigned int *position);
FMOD_RESULT F_API FMOD_System_RecordStart (FMOD_SYSTEM *system, int id, FMOD_SOUND *sound, FMOD_BOOL loop);
FMOD_RESULT F_API FMOD_System_RecordStop (FMOD_SYSTEM *system, int id);
FMOD_RESULT F_API FMOD_System_IsRecording (FMOD_SYSTEM *system, int id, FMOD_BOOL *recording);
/* Geometry API. */
FMOD_RESULT F_API FMOD_System_CreateGeometry (FMOD_SYSTEM *system, int maxpolygons, int maxvertices, FMOD_GEOMETRY **geometry);
FMOD_RESULT F_API FMOD_System_SetGeometrySettings (FMOD_SYSTEM *system, float maxworldsize);
FMOD_RESULT F_API FMOD_System_GetGeometrySettings (FMOD_SYSTEM *system, float *maxworldsize);
FMOD_RESULT F_API FMOD_System_LoadGeometry (FMOD_SYSTEM *system, const void *data, int datasize, FMOD_GEOMETRY **geometry);
FMOD_RESULT F_API FMOD_System_GetGeometryOcclusion (FMOD_SYSTEM *system, const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
/* Network functions. */
FMOD_RESULT F_API FMOD_System_SetNetworkProxy (FMOD_SYSTEM *system, const char *proxy);
FMOD_RESULT F_API FMOD_System_GetNetworkProxy (FMOD_SYSTEM *system, char *proxy, int proxylen);
FMOD_RESULT F_API FMOD_System_SetNetworkTimeout (FMOD_SYSTEM *system, int timeout);
FMOD_RESULT F_API FMOD_System_GetNetworkTimeout (FMOD_SYSTEM *system, int *timeout);
/* Userdata set/get. */
FMOD_RESULT F_API FMOD_System_SetUserData (FMOD_SYSTEM *system, void *userdata);
FMOD_RESULT F_API FMOD_System_GetUserData (FMOD_SYSTEM *system, void **userdata);
/* Sound API
*/
FMOD_RESULT F_API FMOD_Sound_Release (FMOD_SOUND *sound);
FMOD_RESULT F_API FMOD_Sound_GetSystemObject (FMOD_SOUND *sound, FMOD_SYSTEM **system);
/*
Standard sound manipulation functions.
*/
FMOD_RESULT F_API FMOD_Sound_Lock (FMOD_SOUND *sound, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
FMOD_RESULT F_API FMOD_Sound_Unlock (FMOD_SOUND *sound, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
FMOD_RESULT F_API FMOD_Sound_SetDefaults (FMOD_SOUND *sound, float frequency, int priority);
FMOD_RESULT F_API FMOD_Sound_GetDefaults (FMOD_SOUND *sound, float *frequency, int *priority);
FMOD_RESULT F_API FMOD_Sound_Set3DMinMaxDistance (FMOD_SOUND *sound, float min, float max);
FMOD_RESULT F_API FMOD_Sound_Get3DMinMaxDistance (FMOD_SOUND *sound, float *min, float *max);
FMOD_RESULT F_API FMOD_Sound_Set3DConeSettings (FMOD_SOUND *sound, float insideconeangle, float outsideconeangle, float outsidevolume);
FMOD_RESULT F_API FMOD_Sound_Get3DConeSettings (FMOD_SOUND *sound, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
FMOD_RESULT F_API FMOD_Sound_Set3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR *points, int numpoints);
FMOD_RESULT F_API FMOD_Sound_Get3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR **points, int *numpoints);
FMOD_RESULT F_API FMOD_Sound_GetSubSound (FMOD_SOUND *sound, int index, FMOD_SOUND **subsound);
FMOD_RESULT F_API FMOD_Sound_GetSubSoundParent (FMOD_SOUND *sound, FMOD_SOUND **parentsound);
FMOD_RESULT F_API FMOD_Sound_GetName (FMOD_SOUND *sound, char *name, int namelen);
FMOD_RESULT F_API FMOD_Sound_GetLength (FMOD_SOUND *sound, unsigned int *length, FMOD_TIMEUNIT lengthtype);
FMOD_RESULT F_API FMOD_Sound_GetFormat (FMOD_SOUND *sound, FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
FMOD_RESULT F_API FMOD_Sound_GetNumSubSounds (FMOD_SOUND *sound, int *numsubsounds);
FMOD_RESULT F_API FMOD_Sound_GetNumTags (FMOD_SOUND *sound, int *numtags, int *numtagsupdated);
FMOD_RESULT F_API FMOD_Sound_GetTag (FMOD_SOUND *sound, const char *name, int index, FMOD_TAG *tag);
FMOD_RESULT F_API FMOD_Sound_GetOpenState (FMOD_SOUND *sound, FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, FMOD_BOOL *starving, FMOD_BOOL *diskbusy);
FMOD_RESULT F_API FMOD_Sound_ReadData (FMOD_SOUND *sound, void *buffer, unsigned int length, unsigned int *read);
FMOD_RESULT F_API FMOD_Sound_SeekData (FMOD_SOUND *sound, unsigned int pcm);
FMOD_RESULT F_API FMOD_Sound_SetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP *soundgroup);
FMOD_RESULT F_API FMOD_Sound_GetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP **soundgroup);
/*
Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
*/
FMOD_RESULT F_API FMOD_Sound_GetNumSyncPoints (FMOD_SOUND *sound, int *numsyncpoints);
FMOD_RESULT F_API FMOD_Sound_GetSyncPoint (FMOD_SOUND *sound, int index, FMOD_SYNCPOINT **point);
FMOD_RESULT F_API FMOD_Sound_GetSyncPointInfo (FMOD_SOUND *sound, FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
FMOD_RESULT F_API FMOD_Sound_AddSyncPoint (FMOD_SOUND *sound, unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
FMOD_RESULT F_API FMOD_Sound_DeleteSyncPoint (FMOD_SOUND *sound, FMOD_SYNCPOINT *point);
/*
Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
*/
FMOD_RESULT F_API FMOD_Sound_SetMode (FMOD_SOUND *sound, FMOD_MODE mode);
FMOD_RESULT F_API FMOD_Sound_GetMode (FMOD_SOUND *sound, FMOD_MODE *mode);
FMOD_RESULT F_API FMOD_Sound_SetLoopCount (FMOD_SOUND *sound, int loopcount);
FMOD_RESULT F_API FMOD_Sound_GetLoopCount (FMOD_SOUND *sound, int *loopcount);
FMOD_RESULT F_API FMOD_Sound_SetLoopPoints (FMOD_SOUND *sound, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
FMOD_RESULT F_API FMOD_Sound_GetLoopPoints (FMOD_SOUND *sound, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
/*
For MOD/S3M/XM/IT/MID sequenced formats only.
*/
FMOD_RESULT F_API FMOD_Sound_GetMusicNumChannels (FMOD_SOUND *sound, int *numchannels);
FMOD_RESULT F_API FMOD_Sound_SetMusicChannelVolume (FMOD_SOUND *sound, int channel, float volume);
FMOD_RESULT F_API FMOD_Sound_GetMusicChannelVolume (FMOD_SOUND *sound, int channel, float *volume);
FMOD_RESULT F_API FMOD_Sound_SetMusicSpeed (FMOD_SOUND *sound, float speed);
FMOD_RESULT F_API FMOD_Sound_GetMusicSpeed (FMOD_SOUND *sound, float *speed);
/*
Userdata set/get.
*/
FMOD_RESULT F_API FMOD_Sound_SetUserData (FMOD_SOUND *sound, void *userdata);
FMOD_RESULT F_API FMOD_Sound_GetUserData (FMOD_SOUND *sound, void **userdata);
/*
'Channel' API
*/
FMOD_RESULT F_API FMOD_Channel_GetSystemObject (FMOD_CHANNEL *channel, FMOD_SYSTEM **system);
/*
General control functionality for Channels and ChannelGroups.
*/
FMOD_RESULT F_API FMOD_Channel_Stop (FMOD_CHANNEL *channel);
FMOD_RESULT F_API FMOD_Channel_SetPaused (FMOD_CHANNEL *channel, FMOD_BOOL paused);
FMOD_RESULT F_API FMOD_Channel_GetPaused (FMOD_CHANNEL *channel, FMOD_BOOL *paused);
FMOD_RESULT F_API FMOD_Channel_SetVolume (FMOD_CHANNEL *channel, float volume);
FMOD_RESULT F_API FMOD_Channel_GetVolume (FMOD_CHANNEL *channel, float *volume);
FMOD_RESULT F_API FMOD_Channel_SetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL ramp);
FMOD_RESULT F_API FMOD_Channel_GetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL *ramp);
FMOD_RESULT F_API FMOD_Channel_GetAudibility (FMOD_CHANNEL *channel, float *audibility);
FMOD_RESULT F_API FMOD_Channel_SetPitch (FMOD_CHANNEL *channel, float pitch);
FMOD_RESULT F_API FMOD_Channel_GetPitch (FMOD_CHANNEL *channel, float *pitch);
FMOD_RESULT F_API FMOD_Channel_SetMute (FMOD_CHANNEL *channel, FMOD_BOOL mute);
FMOD_RESULT F_API FMOD_Channel_GetMute (FMOD_CHANNEL *channel, FMOD_BOOL *mute);
FMOD_RESULT F_API FMOD_Channel_SetReverbProperties (FMOD_CHANNEL *channel, int instance, float wet);
FMOD_RESULT F_API FMOD_Channel_GetReverbProperties (FMOD_CHANNEL *channel, int instance, float *wet);
FMOD_RESULT F_API FMOD_Channel_SetLowPassGain (FMOD_CHANNEL *channel, float gain);
FMOD_RESULT F_API FMOD_Channel_GetLowPassGain (FMOD_CHANNEL *channel, float *gain);
FMOD_RESULT F_API FMOD_Channel_SetMode (FMOD_CHANNEL *channel, FMOD_MODE mode);
FMOD_RESULT F_API FMOD_Channel_GetMode (FMOD_CHANNEL *channel, FMOD_MODE *mode);
FMOD_RESULT F_API FMOD_Channel_SetCallback (FMOD_CHANNEL *channel, FMOD_CHANNELCONTROL_CALLBACK callback);
FMOD_RESULT F_API FMOD_Channel_IsPlaying (FMOD_CHANNEL *channel, FMOD_BOOL *isplaying);
/*
Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
*/
FMOD_RESULT F_API FMOD_Channel_SetPan (FMOD_CHANNEL *channel, float pan);
FMOD_RESULT F_API FMOD_Channel_SetMixLevelsOutput (FMOD_CHANNEL *channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
FMOD_RESULT F_API FMOD_Channel_SetMixLevelsInput (FMOD_CHANNEL *channel, float *levels, int numlevels);
FMOD_RESULT F_API FMOD_Channel_SetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int outchannels, int inchannels, int inchannel_hop);
FMOD_RESULT F_API FMOD_Channel_GetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
/*
Clock based functionality.
*/
FMOD_RESULT F_API FMOD_Channel_GetDSPClock (FMOD_CHANNEL *channel, unsigned long long *dspclock, unsigned long long *parentclock);
FMOD_RESULT F_API FMOD_Channel_SetDelay (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels);
FMOD_RESULT F_API FMOD_Channel_GetDelay (FMOD_CHANNEL *channel, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels);
FMOD_RESULT F_API FMOD_Channel_AddFadePoint (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume);
FMOD_RESULT F_API FMOD_Channel_SetFadePointRamp (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume);
FMOD_RESULT F_API FMOD_Channel_RemoveFadePoints (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end);
FMOD_RESULT F_API FMOD_Channel_GetFadePoints (FMOD_CHANNEL *channel, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
/*
DSP effects.
*/
FMOD_RESULT F_API FMOD_Channel_GetDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP **dsp);
FMOD_RESULT F_API FMOD_Channel_AddDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP *dsp);
FMOD_RESULT F_API FMOD_Channel_RemoveDSP (FMOD_CHANNEL *channel, FMOD_DSP *dsp);
FMOD_RESULT F_API FMOD_Channel_GetNumDSPs (FMOD_CHANNEL *channel, int *numdsps);
FMOD_RESULT F_API FMOD_Channel_SetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int index);
FMOD_RESULT F_API FMOD_Channel_GetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int *index);
/*
3D functionality.
*/
FMOD_RESULT F_API FMOD_Channel_Set3DAttributes (FMOD_CHANNEL *channel, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);
FMOD_RESULT F_API FMOD_Channel_Get3DAttributes (FMOD_CHANNEL *channel, FMOD_VECTOR *pos, FMOD_VECTOR *vel);
FMOD_RESULT F_API FMOD_Channel_Set3DMinMaxDistance (FMOD_CHANNEL *channel, float mindistance, float maxdistance);
FMOD_RESULT F_API FMOD_Channel_Get3DMinMaxDistance (FMOD_CHANNEL *channel, float *mindistance, float *maxdistance);
FMOD_RESULT F_API FMOD_Channel_Set3DConeSettings (FMOD_CHANNEL *channel, float insideconeangle, float outsideconeangle, float outsidevolume);
FMOD_RESULT F_API FMOD_Channel_Get3DConeSettings (FMOD_CHANNEL *channel, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
FMOD_RESULT F_API FMOD_Channel_Set3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);
FMOD_RESULT F_API FMOD_Channel_Get3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);
FMOD_RESULT F_API FMOD_Channel_Set3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR *points, int numpoints);
FMOD_RESULT F_API FMOD_Channel_Get3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR **points, int *numpoints);
FMOD_RESULT F_API FMOD_Channel_Set3DOcclusion (FMOD_CHANNEL *channel, float directocclusion, float reverbocclusion);
FMOD_RESULT F_API FMOD_Channel_Get3DOcclusion (FMOD_CHANNEL *channel, float *directocclusion, float *reverbocclusion);
FMOD_RESULT F_API FMOD_Channel_Set3DSpread (FMOD_CHANNEL *channel, float angle);
FMOD_RESULT F_API FMOD_Channel_Get3DSpread (FMOD_CHANNEL *channel, float *angle);
FMOD_RESULT F_API FMOD_Channel_Set3DLevel (FMOD_CHANNEL *channel, float level);
FMOD_RESULT F_API FMOD_Channel_Get3DLevel (FMOD_CHANNEL *channel, float *level);
FMOD_RESULT F_API FMOD_Channel_Set3DDopplerLevel (FMOD_CHANNEL *channel, float level);
FMOD_RESULT F_API FMOD_Channel_Get3DDopplerLevel (FMOD_CHANNEL *channel, float *level);
FMOD_RESULT F_API FMOD_Channel_Set3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL custom, float customLevel, float centerFreq);
FMOD_RESULT F_API FMOD_Channel_Get3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL *custom, float *customLevel, float *centerFreq);
/*
Userdata set/get.
*/
FMOD_RESULT F_API FMOD_Channel_SetUserData (FMOD_CHANNEL *channel, void *userdata);
FMOD_RESULT F_API FMOD_Channel_GetUserData (FMOD_CHANNEL *channel, void **userdata);
/*
Channel specific control functionality.
*/
FMOD_RESULT F_API FMOD_Channel_SetFrequency (FMOD_CHANNEL *channel, float frequency);
FMOD_RESULT F_API FMOD_Channel_GetFrequency (FMOD_CHANNEL *channel, float *frequency);
FMOD_RESULT F_API FMOD_Channel_SetPriority (FMOD_CHANNEL *channel, int priority);
FMOD_RESULT F_API FMOD_Channel_GetPriority (FMOD_CHANNEL *channel, int *priority);
FMOD_RESULT F_API FMOD_Channel_SetPosition (FMOD_CHANNEL *channel, unsigned int position, FMOD_TIMEUNIT postype);
FMOD_RESULT F_API FMOD_Channel_GetPosition (FMOD_CHANNEL *channel, unsigned int *position, FMOD_TIMEUNIT postype);
FMOD_RESULT F_API FMOD_Channel_SetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP *channelgroup);
FMOD_RESULT F_API FMOD_Channel_GetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP **channelgroup);
FMOD_RESULT F_API FMOD_Channel_SetLoopCount (FMOD_CHANNEL *channel, int loopcount);
FMOD_RESULT F_API FMOD_Channel_GetLoopCount (FMOD_CHANNEL *channel, int *loopcount);
FMOD_RESULT F_API FMOD_Channel_SetLoopPoints (FMOD_CHANNEL *channel, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
FMOD_RESULT F_API FMOD_Channel_GetLoopPoints (FMOD_CHANNEL *channel, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
/*
Information only functions.
*/
FMOD_RESULT F_API FMOD_Channel_IsVirtual (FMOD_CHANNEL *channel, FMOD_BOOL *isvirtual);
FMOD_RESULT F_API FMOD_Channel_GetCurrentSound (FMOD_CHANNEL *channel, FMOD_SOUND **sound);
FMOD_RESULT F_API FMOD_Channel_GetIndex (FMOD_CHANNEL *channel, int *index);
/*
'ChannelGroup' API
*/
FMOD_RESULT F_API FMOD_ChannelGroup_GetSystemObject (FMOD_CHANNELGROUP *channelgroup, FMOD_SYSTEM **system);
/*
General control functionality for Channels and ChannelGroups.
*/
FMOD_RESULT F_API FMOD_ChannelGroup_Stop (FMOD_CHANNELGROUP *channelgroup);
FMOD_RESULT F_API FMOD_ChannelGroup_SetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused);
FMOD_RESULT F_API FMOD_ChannelGroup_GetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *paused);
FMOD_RESULT F_API FMOD_ChannelGroup_SetVolume (FMOD_CHANNELGROUP *channelgroup, float volume);
FMOD_RESULT F_API FMOD_ChannelGroup_GetVolume (FMOD_CHANNELGROUP *channelgroup, float *volume);
FMOD_RESULT F_API FMOD_ChannelGroup_SetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL ramp);
FMOD_RESULT F_API FMOD_ChannelGroup_GetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *ramp);
FMOD_RESULT F_API FMOD_ChannelGroup_GetAudibility (FMOD_CHANNELGROUP *channelgroup, float *audibility);
FMOD_RESULT F_API FMOD_ChannelGroup_SetPitch (FMOD_CHANNELGROUP *channelgroup, float pitch);
FMOD_RESULT F_API FMOD_ChannelGroup_GetPitch (FMOD_CHANNELGROUP *channelgroup, float *pitch);
FMOD_RESULT F_API FMOD_ChannelGroup_SetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL mute);
FMOD_RESULT F_API FMOD_ChannelGroup_GetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *mute);
FMOD_RESULT F_API FMOD_ChannelGroup_SetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float wet);
FMOD_RESULT F_API FMOD_ChannelGroup_GetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float *wet);
FMOD_RESULT F_API FMOD_ChannelGroup_SetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float gain);
FMOD_RESULT F_API FMOD_ChannelGroup_GetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float *gain);
FMOD_RESULT F_API FMOD_ChannelGroup_SetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE mode);
FMOD_RESULT F_API FMOD_ChannelGroup_GetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE *mode);
FMOD_RESULT F_API FMOD_ChannelGroup_SetCallback (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELCONTROL_CALLBACK callback);
FMOD_RESULT F_API FMOD_ChannelGroup_IsPlaying (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *isplaying);
/*
Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
*/
FMOD_RESULT F_API FMOD_ChannelGroup_SetPan (FMOD_CHANNELGROUP *channelgroup, float pan);
FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsOutput (FMOD_CHANNELGROUP *channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsInput (FMOD_CHANNELGROUP *channelgroup, float *levels, int numlevels);
FMOD_RESULT F_API FMOD_ChannelGroup_SetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int outchannels, int inchannels, int inchannel_hop);
FMOD_RESULT F_API FMOD_ChannelGroup_GetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
/*
Clock based functionality.
*/
FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPClock (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock, unsigned long long *parentclock);
FMOD_RESULT F_API FMOD_ChannelGroup_SetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels);
FMOD_RESULT F_API FMOD_ChannelGroup_GetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels);
FMOD_RESULT F_API FMOD_ChannelGroup_AddFadePoint (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume);
FMOD_RESULT F_API FMOD_ChannelGroup_SetFadePointRamp (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume);
FMOD_RESULT F_API FMOD_ChannelGroup_RemoveFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end);
FMOD_RESULT F_API FMOD_ChannelGroup_GetFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
/*
DSP effects.
*/
FMOD_RESULT F_API FMOD_ChannelGroup_GetDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP **dsp);
FMOD_RESULT F_API FMOD_ChannelGroup_AddDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP *dsp);
FMOD_RESULT F_API FMOD_ChannelGroup_RemoveDSP (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp);
FMOD_RESULT F_API FMOD_ChannelGroup_GetNumDSPs (FMOD_CHANNELGROUP *channelgroup, int *numdsps);
FMOD_RESULT F_API FMOD_ChannelGroup_SetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int index);
FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int *index);
/*
3D functionality.
*/
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DAttributes (FMOD_CHANNELGROUP *channelgroup, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DAttributes (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *pos, FMOD_VECTOR *vel);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float mindistance, float maxdistance);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float *mindistance, float *maxdistance);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *points, int numpoints);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR **points, int *numpoints);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float directocclusion, float reverbocclusion);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float *directocclusion, float *reverbocclusion);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DSpread (FMOD_CHANNELGROUP *channelgroup, float angle);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DSpread (FMOD_CHANNELGROUP *channelgroup, float *angle);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DLevel (FMOD_CHANNELGROUP *channelgroup, float level);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DLevel (FMOD_CHANNELGROUP *channelgroup, float *level);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float level);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float *level);
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL custom, float customLevel, float centerFreq);
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *custom, float *customLevel, float *centerFreq);
/*
Userdata set/get.
*/
FMOD_RESULT F_API FMOD_ChannelGroup_SetUserData (FMOD_CHANNELGROUP *channelgroup, void *userdata);
FMOD_RESULT F_API FMOD_ChannelGroup_GetUserData (FMOD_CHANNELGROUP *channelgroup, void **userdata);
FMOD_RESULT F_API FMOD_ChannelGroup_Release (FMOD_CHANNELGROUP *channelgroup);
/*
Nested channel groups.
*/
FMOD_RESULT F_API FMOD_ChannelGroup_AddGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP *group, FMOD_BOOL propagatedspclock, FMOD_DSPCONNECTION **connection);
FMOD_RESULT F_API FMOD_ChannelGroup_GetNumGroups (FMOD_CHANNELGROUP *channelgroup, int *numgroups);
FMOD_RESULT F_API FMOD_ChannelGroup_GetGroup (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNELGROUP **group);
FMOD_RESULT F_API FMOD_ChannelGroup_GetParentGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP **group);
/*
Information only functions.
*/
FMOD_RESULT F_API FMOD_ChannelGroup_GetName (FMOD_CHANNELGROUP *channelgroup, char *name, int namelen);
FMOD_RESULT F_API FMOD_ChannelGroup_GetNumChannels (FMOD_CHANNELGROUP *channelgroup, int *numchannels);
FMOD_RESULT F_API FMOD_ChannelGroup_GetChannel (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNEL **channel);
/*
'SoundGroup' API
*/
FMOD_RESULT F_API FMOD_SoundGroup_Release (FMOD_SOUNDGROUP *soundgroup);
FMOD_RESULT F_API FMOD_SoundGroup_GetSystemObject (FMOD_SOUNDGROUP *soundgroup, FMOD_SYSTEM **system);
/*
SoundGroup control functions.
*/
FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int maxaudible);
FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int *maxaudible);
FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR behavior);
FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior);
FMOD_RESULT F_API FMOD_SoundGroup_SetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float speed);
FMOD_RESULT F_API FMOD_SoundGroup_GetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float *speed);
FMOD_RESULT F_API FMOD_SoundGroup_SetVolume (FMOD_SOUNDGROUP *soundgroup, float volume);
FMOD_RESULT F_API FMOD_SoundGroup_GetVolume (FMOD_SOUNDGROUP *soundgroup, float *volume);
FMOD_RESULT F_API FMOD_SoundGroup_Stop (FMOD_SOUNDGROUP *soundgroup);
/*
Information only functions.
*/
FMOD_RESULT F_API FMOD_SoundGroup_GetName (FMOD_SOUNDGROUP *soundgroup, char *name, int namelen);
FMOD_RESULT F_API FMOD_SoundGroup_GetNumSounds (FMOD_SOUNDGROUP *soundgroup, int *numsounds);
FMOD_RESULT F_API FMOD_SoundGroup_GetSound (FMOD_SOUNDGROUP *soundgroup, int index, FMOD_SOUND **sound);
FMOD_RESULT F_API FMOD_SoundGroup_GetNumPlaying (FMOD_SOUNDGROUP *soundgroup, int *numplaying);
/*
Userdata set/get.
*/
FMOD_RESULT F_API FMOD_SoundGroup_SetUserData (FMOD_SOUNDGROUP *soundgroup, void *userdata);
FMOD_RESULT F_API FMOD_SoundGroup_GetUserData (FMOD_SOUNDGROUP *soundgroup, void **userdata);
/*
'DSP' API
*/
FMOD_RESULT F_API FMOD_DSP_Release (FMOD_DSP *dsp);
FMOD_RESULT F_API FMOD_DSP_GetSystemObject (FMOD_DSP *dsp, FMOD_SYSTEM **system);
/*
Connection / disconnection / input and output enumeration.
*/
FMOD_RESULT F_API FMOD_DSP_AddInput (FMOD_DSP *dsp, FMOD_DSP *input, FMOD_DSPCONNECTION **connection, FMOD_DSPCONNECTION_TYPE type);
FMOD_RESULT F_API FMOD_DSP_DisconnectFrom (FMOD_DSP *dsp, FMOD_DSP *target, FMOD_DSPCONNECTION *connection);
FMOD_RESULT F_API FMOD_DSP_DisconnectAll (FMOD_DSP *dsp, FMOD_BOOL inputs, FMOD_BOOL outputs);
FMOD_RESULT F_API FMOD_DSP_GetNumInputs (FMOD_DSP *dsp, int *numinputs);
FMOD_RESULT F_API FMOD_DSP_GetNumOutputs (FMOD_DSP *dsp, int *numoutputs);
FMOD_RESULT F_API FMOD_DSP_GetInput (FMOD_DSP *dsp, int index, FMOD_DSP **input, FMOD_DSPCONNECTION **inputconnection);
FMOD_RESULT F_API FMOD_DSP_GetOutput (FMOD_DSP *dsp, int index, FMOD_DSP **output, FMOD_DSPCONNECTION **outputconnection);
/*
DSP unit control.
*/
FMOD_RESULT F_API FMOD_DSP_SetActive (FMOD_DSP *dsp, FMOD_BOOL active);
FMOD_RESULT F_API FMOD_DSP_GetActive (FMOD_DSP *dsp, FMOD_BOOL *active);
FMOD_RESULT F_API FMOD_DSP_SetBypass (FMOD_DSP *dsp, FMOD_BOOL bypass);
FMOD_RESULT F_API FMOD_DSP_GetBypass (FMOD_DSP *dsp, FMOD_BOOL *bypass);
FMOD_RESULT F_API FMOD_DSP_SetWetDryMix (FMOD_DSP *dsp, float prewet, float postwet, float dry);
FMOD_RESULT F_API FMOD_DSP_GetWetDryMix (FMOD_DSP *dsp, float *prewet, float *postwet, float *dry);
FMOD_RESULT F_API FMOD_DSP_SetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode);
FMOD_RESULT F_API FMOD_DSP_GetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode);
FMOD_RESULT F_API FMOD_DSP_GetOutputChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode);
FMOD_RESULT F_API FMOD_DSP_Reset (FMOD_DSP *dsp);
/*
DSP parameter control.
*/
FMOD_RESULT F_API FMOD_DSP_SetParameterFloat (FMOD_DSP *dsp, int index, float value);
FMOD_RESULT F_API FMOD_DSP_SetParameterInt (FMOD_DSP *dsp, int index, int value);
FMOD_RESULT F_API FMOD_DSP_SetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL value);
FMOD_RESULT F_API FMOD_DSP_SetParameterData (FMOD_DSP *dsp, int index, void *data, unsigned int length);
FMOD_RESULT F_API FMOD_DSP_GetParameterFloat (FMOD_DSP *dsp, int index, float *value, char *valuestr, int valuestrlen);
FMOD_RESULT F_API FMOD_DSP_GetParameterInt (FMOD_DSP *dsp, int index, int *value, char *valuestr, int valuestrlen);
FMOD_RESULT F_API FMOD_DSP_GetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL *value, char *valuestr, int valuestrlen);
FMOD_RESULT F_API FMOD_DSP_GetParameterData (FMOD_DSP *dsp, int index, void **data, unsigned int *length, char *valuestr, int valuestrlen);
FMOD_RESULT F_API FMOD_DSP_GetNumParameters (FMOD_DSP *dsp, int *numparams);
FMOD_RESULT F_API FMOD_DSP_GetParameterInfo (FMOD_DSP *dsp, int index, FMOD_DSP_PARAMETER_DESC **desc);
FMOD_RESULT F_API FMOD_DSP_GetDataParameterIndex (FMOD_DSP *dsp, int datatype, int *index);
FMOD_RESULT F_API FMOD_DSP_ShowConfigDialog (FMOD_DSP *dsp, void *hwnd, FMOD_BOOL show);
/*
DSP attributes.
*/
FMOD_RESULT F_API FMOD_DSP_GetInfo (FMOD_DSP *dsp, char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
FMOD_RESULT F_API FMOD_DSP_GetType (FMOD_DSP *dsp, FMOD_DSP_TYPE *type);
FMOD_RESULT F_API FMOD_DSP_GetIdle (FMOD_DSP *dsp, FMOD_BOOL *idle);
/*
Userdata set/get.
*/
FMOD_RESULT F_API FMOD_DSP_SetUserData (FMOD_DSP *dsp, void *userdata);
FMOD_RESULT F_API FMOD_DSP_GetUserData (FMOD_DSP *dsp, void **userdata);
/*
Metering.
*/
FMOD_RESULT F_API FMOD_DSP_SetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL inputEnabled, FMOD_BOOL outputEnabled);
FMOD_RESULT F_API FMOD_DSP_GetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL *inputEnabled, FMOD_BOOL *outputEnabled);
FMOD_RESULT F_API FMOD_DSP_GetMeteringInfo (FMOD_DSP *dsp, FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
FMOD_RESULT F_API FMOD_DSP_GetCPUUsage (FMOD_DSP *dsp, unsigned int *exclusive, unsigned int *inclusive);
/*
'DSPConnection' API
*/
FMOD_RESULT F_API FMOD_DSPConnection_GetInput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **input);
FMOD_RESULT F_API FMOD_DSPConnection_GetOutput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **output);
FMOD_RESULT F_API FMOD_DSPConnection_SetMix (FMOD_DSPCONNECTION *dspconnection, float volume);
FMOD_RESULT F_API FMOD_DSPConnection_GetMix (FMOD_DSPCONNECTION *dspconnection, float *volume);
FMOD_RESULT F_API FMOD_DSPConnection_SetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int outchannels, int inchannels, int inchannel_hop);
FMOD_RESULT F_API FMOD_DSPConnection_GetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
FMOD_RESULT F_API FMOD_DSPConnection_GetType (FMOD_DSPCONNECTION *dspconnection, FMOD_DSPCONNECTION_TYPE *type);
/*
Userdata set/get.
*/
FMOD_RESULT F_API FMOD_DSPConnection_SetUserData (FMOD_DSPCONNECTION *dspconnection, void *userdata);
FMOD_RESULT F_API FMOD_DSPConnection_GetUserData (FMOD_DSPCONNECTION *dspconnection, void **userdata);
/*
'Geometry' API
*/
FMOD_RESULT F_API FMOD_Geometry_Release (FMOD_GEOMETRY *geometry);
/*
Polygon manipulation.
*/
FMOD_RESULT F_API FMOD_Geometry_AddPolygon (FMOD_GEOMETRY *geometry, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
FMOD_RESULT F_API FMOD_Geometry_GetNumPolygons (FMOD_GEOMETRY *geometry, int *numpolygons);
FMOD_RESULT F_API FMOD_Geometry_GetMaxPolygons (FMOD_GEOMETRY *geometry, int *maxpolygons, int *maxvertices);
FMOD_RESULT F_API FMOD_Geometry_GetPolygonNumVertices (FMOD_GEOMETRY *geometry, int index, int *numvertices);
FMOD_RESULT F_API FMOD_Geometry_SetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, const FMOD_VECTOR *vertex);
FMOD_RESULT F_API FMOD_Geometry_GetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, FMOD_VECTOR *vertex);
FMOD_RESULT F_API FMOD_Geometry_SetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided);
FMOD_RESULT F_API FMOD_Geometry_GetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float *directocclusion, float *reverbocclusion, FMOD_BOOL *doublesided);
/*
Object manipulation.
*/
FMOD_RESULT F_API FMOD_Geometry_SetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL active);
FMOD_RESULT F_API FMOD_Geometry_GetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL *active);
FMOD_RESULT F_API FMOD_Geometry_SetRotation (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
FMOD_RESULT F_API FMOD_Geometry_GetRotation (FMOD_GEOMETRY *geometry, FMOD_VECTOR *forward, FMOD_VECTOR *up);
FMOD_RESULT F_API FMOD_Geometry_SetPosition (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *position);
FMOD_RESULT F_API FMOD_Geometry_GetPosition (FMOD_GEOMETRY *geometry, FMOD_VECTOR *position);
FMOD_RESULT F_API FMOD_Geometry_SetScale (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *scale);
FMOD_RESULT F_API FMOD_Geometry_GetScale (FMOD_GEOMETRY *geometry, FMOD_VECTOR *scale);
FMOD_RESULT F_API FMOD_Geometry_Save (FMOD_GEOMETRY *geometry, void *data, int *datasize);
/*
Userdata set/get.
*/
FMOD_RESULT F_API FMOD_Geometry_SetUserData (FMOD_GEOMETRY *geometry, void *userdata);
FMOD_RESULT F_API FMOD_Geometry_GetUserData (FMOD_GEOMETRY *geometry, void **userdata);
/*
'Reverb3D' API
*/
FMOD_RESULT F_API FMOD_Reverb3D_Release (FMOD_REVERB3D *reverb3d);
/*
Reverb manipulation.
*/
FMOD_RESULT F_API FMOD_Reverb3D_Set3DAttributes (FMOD_REVERB3D *reverb3d, const FMOD_VECTOR *position, float mindistance, float maxdistance);
FMOD_RESULT F_API FMOD_Reverb3D_Get3DAttributes (FMOD_REVERB3D *reverb3d, FMOD_VECTOR *position, float *mindistance, float *maxdistance);
FMOD_RESULT F_API FMOD_Reverb3D_SetProperties (FMOD_REVERB3D *reverb3d, const FMOD_REVERB_PROPERTIES *properties);
FMOD_RESULT F_API FMOD_Reverb3D_GetProperties (FMOD_REVERB3D *reverb3d, FMOD_REVERB_PROPERTIES *properties);
FMOD_RESULT F_API FMOD_Reverb3D_SetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL active);
FMOD_RESULT F_API FMOD_Reverb3D_GetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL *active);
/*
Userdata set/get.
*/
FMOD_RESULT F_API FMOD_Reverb3D_SetUserData (FMOD_REVERB3D *reverb3d, void *userdata);
FMOD_RESULT F_API FMOD_Reverb3D_GetUserData (FMOD_REVERB3D *reverb3d, void **userdata);
#ifdef __cplusplus
}
#endif
#endif /* _FMOD_H */

604
engine/fmodcore/inc/fmod.hpp

@ -0,0 +1,604 @@
/* ======================================================================================== */
/* FMOD Core API - C++ header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header in conjunction with fmod_common.h (which contains all the constants / */
/* callbacks) to develop using the C++ language. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */
/* ======================================================================================== */
#ifndef _FMOD_HPP
#define _FMOD_HPP
#include "fmod_common.h"
#include "fmod.h"
/*
FMOD Namespace
*/
namespace FMOD
{
class System;
class Sound;
class ChannelControl;
class Channel;
class ChannelGroup;
class SoundGroup;
class DSP;
class DSPConnection;
class Geometry;
class Reverb3D;
/*
FMOD global system functions (optional).
*/
inline FMOD_RESULT Memory_Initialize (void *poolmem, int poollen, FMOD_MEMORY_ALLOC_CALLBACK useralloc, FMOD_MEMORY_REALLOC_CALLBACK userrealloc, FMOD_MEMORY_FREE_CALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = FMOD_MEMORY_ALL) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }
inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced, bool blocking = true) { return FMOD_Memory_GetStats(currentalloced, maxalloced, blocking); }
inline FMOD_RESULT Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode = FMOD_DEBUG_MODE_TTY, FMOD_DEBUG_CALLBACK callback = 0, const char *filename = 0) { return FMOD_Debug_Initialize(flags, mode, callback, filename); }
inline FMOD_RESULT File_SetDiskBusy (int busy) { return FMOD_File_SetDiskBusy(busy); }
inline FMOD_RESULT File_GetDiskBusy (int *busy) { return FMOD_File_GetDiskBusy(busy); }
/*
FMOD System factory functions.
*/
inline FMOD_RESULT System_Create (System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }
/*
'System' API
*/
class System
{
private:
// Constructor made private so user cannot statically instance a System class. System_Create must be used.
System();
System(const System &);
public:
FMOD_RESULT F_API release ();
// Setup functions.
FMOD_RESULT F_API setOutput (FMOD_OUTPUTTYPE output);
FMOD_RESULT F_API getOutput (FMOD_OUTPUTTYPE *output);
FMOD_RESULT F_API getNumDrivers (int *numdrivers);
FMOD_RESULT F_API getDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
FMOD_RESULT F_API setDriver (int driver);
FMOD_RESULT F_API getDriver (int *driver);
FMOD_RESULT F_API setSoftwareChannels (int numsoftwarechannels);
FMOD_RESULT F_API getSoftwareChannels (int *numsoftwarechannels);
FMOD_RESULT F_API setSoftwareFormat (int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers);
FMOD_RESULT F_API getSoftwareFormat (int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers);
FMOD_RESULT F_API setDSPBufferSize (unsigned int bufferlength, int numbuffers);
FMOD_RESULT F_API getDSPBufferSize (unsigned int *bufferlength, int *numbuffers);
FMOD_RESULT F_API setFileSystem (FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek, FMOD_FILE_ASYNCREAD_CALLBACK userasyncread, FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign);
FMOD_RESULT F_API attachFileSystem (FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek);
FMOD_RESULT F_API setAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
FMOD_RESULT F_API getAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
FMOD_RESULT F_API setCallback (FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_SYSTEM_CALLBACK_ALL);
// Plug-in support.
FMOD_RESULT F_API setPluginPath (const char *path);
FMOD_RESULT F_API loadPlugin (const char *filename, unsigned int *handle, unsigned int priority = 0);
FMOD_RESULT F_API unloadPlugin (unsigned int handle);
FMOD_RESULT F_API getNumNestedPlugins (unsigned int handle, int *count);
FMOD_RESULT F_API getNestedPlugin (unsigned int handle, int index, unsigned int *nestedhandle);
FMOD_RESULT F_API getNumPlugins (FMOD_PLUGINTYPE plugintype, int *numplugins);
FMOD_RESULT F_API getPluginHandle (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
FMOD_RESULT F_API getPluginInfo (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
FMOD_RESULT F_API setOutputByPlugin (unsigned int handle);
FMOD_RESULT F_API getOutputByPlugin (unsigned int *handle);
FMOD_RESULT F_API createDSPByPlugin (unsigned int handle, DSP **dsp);
FMOD_RESULT F_API getDSPInfoByPlugin (unsigned int handle, const FMOD_DSP_DESCRIPTION **description);
FMOD_RESULT F_API registerCodec (FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority = 0);
FMOD_RESULT F_API registerDSP (const FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
FMOD_RESULT F_API registerOutput (const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle);
// Init/Close.
FMOD_RESULT F_API init (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
FMOD_RESULT F_API close ();
// General post-init system functions.
FMOD_RESULT F_API update (); /* IMPORTANT! CALL THIS ONCE PER FRAME! */
FMOD_RESULT F_API setSpeakerPosition (FMOD_SPEAKER speaker, float x, float y, bool active);
FMOD_RESULT F_API getSpeakerPosition (FMOD_SPEAKER speaker, float *x, float *y, bool *active);
FMOD_RESULT F_API setStreamBufferSize (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
FMOD_RESULT F_API getStreamBufferSize (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
FMOD_RESULT F_API set3DSettings (float dopplerscale, float distancefactor, float rolloffscale);
FMOD_RESULT F_API get3DSettings (float *dopplerscale, float *distancefactor, float *rolloffscale);
FMOD_RESULT F_API set3DNumListeners (int numlisteners);
FMOD_RESULT F_API get3DNumListeners (int *numlisteners);
FMOD_RESULT F_API set3DListenerAttributes (int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
FMOD_RESULT F_API get3DListenerAttributes (int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
FMOD_RESULT F_API set3DRolloffCallback (FMOD_3D_ROLLOFF_CALLBACK callback);
FMOD_RESULT F_API mixerSuspend ();
FMOD_RESULT F_API mixerResume ();
FMOD_RESULT F_API getDefaultMixMatrix (FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop);
FMOD_RESULT F_API getSpeakerModeChannels (FMOD_SPEAKERMODE mode, int *channels);
// System information functions.
FMOD_RESULT F_API getVersion (unsigned int *version);
FMOD_RESULT F_API getOutputHandle (void **handle);
FMOD_RESULT F_API getChannelsPlaying (int *channels, int *realchannels = 0);
FMOD_RESULT F_API getCPUUsage (float *dsp, float *stream, float *geometry, float *update, float *total);
FMOD_RESULT F_API getFileUsage (long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead);
// Sound/DSP/Channel/FX creation and retrieval.
FMOD_RESULT F_API createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
FMOD_RESULT F_API createStream (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
FMOD_RESULT F_API createDSP (const FMOD_DSP_DESCRIPTION *description, DSP **dsp);
FMOD_RESULT F_API createDSPByType (FMOD_DSP_TYPE type, DSP **dsp);
FMOD_RESULT F_API createChannelGroup (const char *name, ChannelGroup **channelgroup);
FMOD_RESULT F_API createSoundGroup (const char *name, SoundGroup **soundgroup);
FMOD_RESULT F_API createReverb3D (Reverb3D **reverb);
FMOD_RESULT F_API playSound (Sound *sound, ChannelGroup *channelgroup, bool paused, Channel **channel);
FMOD_RESULT F_API playDSP (DSP *dsp, ChannelGroup *channelgroup, bool paused, Channel **channel);
FMOD_RESULT F_API getChannel (int channelid, Channel **channel);
FMOD_RESULT F_API getMasterChannelGroup (ChannelGroup **channelgroup);
FMOD_RESULT F_API getMasterSoundGroup (SoundGroup **soundgroup);
// Routing to ports.
FMOD_RESULT F_API attachChannelGroupToPort (FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, ChannelGroup *channelgroup, bool passThru = false);
FMOD_RESULT F_API detachChannelGroupFromPort (ChannelGroup *channelgroup);
// Reverb API.
FMOD_RESULT F_API setReverbProperties (int instance, const FMOD_REVERB_PROPERTIES *prop);
FMOD_RESULT F_API getReverbProperties (int instance, FMOD_REVERB_PROPERTIES *prop);
// System level DSP functionality.
FMOD_RESULT F_API lockDSP ();
FMOD_RESULT F_API unlockDSP ();
// Recording API.
FMOD_RESULT F_API getRecordNumDrivers (int *numdrivers, int *numconnected);
FMOD_RESULT F_API getRecordDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_DRIVER_STATE *state);
FMOD_RESULT F_API getRecordPosition (int id, unsigned int *position);
FMOD_RESULT F_API recordStart (int id, Sound *sound, bool loop);
FMOD_RESULT F_API recordStop (int id);
FMOD_RESULT F_API isRecording (int id, bool *recording);
// Geometry API.
FMOD_RESULT F_API createGeometry (int maxpolygons, int maxvertices, Geometry **geometry);
FMOD_RESULT F_API setGeometrySettings (float maxworldsize);
FMOD_RESULT F_API getGeometrySettings (float *maxworldsize);
FMOD_RESULT F_API loadGeometry (const void *data, int datasize, Geometry **geometry);
FMOD_RESULT F_API getGeometryOcclusion (const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
// Network functions.
FMOD_RESULT F_API setNetworkProxy (const char *proxy);
FMOD_RESULT F_API getNetworkProxy (char *proxy, int proxylen);
FMOD_RESULT F_API setNetworkTimeout (int timeout);
FMOD_RESULT F_API getNetworkTimeout (int *timeout);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
};
/*
'Sound' API
*/
class Sound
{
private:
// Constructor made private so user cannot statically instance a Sound class. Appropriate Sound creation or retrieval function must be used.
Sound();
Sound(const Sound &);
public:
FMOD_RESULT F_API release ();
FMOD_RESULT F_API getSystemObject (System **system);
// Standard sound manipulation functions.
FMOD_RESULT F_API lock (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
FMOD_RESULT F_API unlock (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
FMOD_RESULT F_API setDefaults (float frequency, int priority);
FMOD_RESULT F_API getDefaults (float *frequency, int *priority);
FMOD_RESULT F_API set3DMinMaxDistance (float min, float max);
FMOD_RESULT F_API get3DMinMaxDistance (float *min, float *max);
FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
FMOD_RESULT F_API getSubSound (int index, Sound **subsound);
FMOD_RESULT F_API getSubSoundParent (Sound **parentsound);
FMOD_RESULT F_API getName (char *name, int namelen);
FMOD_RESULT F_API getLength (unsigned int *length, FMOD_TIMEUNIT lengthtype);
FMOD_RESULT F_API getFormat (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
FMOD_RESULT F_API getNumSubSounds (int *numsubsounds);
FMOD_RESULT F_API getNumTags (int *numtags, int *numtagsupdated);
FMOD_RESULT F_API getTag (const char *name, int index, FMOD_TAG *tag);
FMOD_RESULT F_API getOpenState (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy);
FMOD_RESULT F_API readData (void *buffer, unsigned int length, unsigned int *read);
FMOD_RESULT F_API seekData (unsigned int pcm);
FMOD_RESULT F_API setSoundGroup (SoundGroup *soundgroup);
FMOD_RESULT F_API getSoundGroup (SoundGroup **soundgroup);
// Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
FMOD_RESULT F_API getNumSyncPoints (int *numsyncpoints);
FMOD_RESULT F_API getSyncPoint (int index, FMOD_SYNCPOINT **point);
FMOD_RESULT F_API getSyncPointInfo (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
FMOD_RESULT F_API addSyncPoint (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
FMOD_RESULT F_API deleteSyncPoint (FMOD_SYNCPOINT *point);
// Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
FMOD_RESULT F_API setMode (FMOD_MODE mode);
FMOD_RESULT F_API getMode (FMOD_MODE *mode);
FMOD_RESULT F_API setLoopCount (int loopcount);
FMOD_RESULT F_API getLoopCount (int *loopcount);
FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
// For MOD/S3M/XM/IT/MID sequenced formats only.
FMOD_RESULT F_API getMusicNumChannels (int *numchannels);
FMOD_RESULT F_API setMusicChannelVolume (int channel, float volume);
FMOD_RESULT F_API getMusicChannelVolume (int channel, float *volume);
FMOD_RESULT F_API setMusicSpeed (float speed);
FMOD_RESULT F_API getMusicSpeed (float *speed);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
};
/*
'ChannelControl API'. This is a base class for Channel and ChannelGroup so they can share the same functionality. This cannot be used or instansiated explicitly.
*/
class ChannelControl
{
private:
// Constructor made private so user cannot statically instance a Control class.
ChannelControl();
ChannelControl(const ChannelControl &);
public:
FMOD_RESULT F_API getSystemObject (System **system);
// General control functionality for Channels and ChannelGroups.
FMOD_RESULT F_API stop ();
FMOD_RESULT F_API setPaused (bool paused);
FMOD_RESULT F_API getPaused (bool *paused);
FMOD_RESULT F_API setVolume (float volume);
FMOD_RESULT F_API getVolume (float *volume);
FMOD_RESULT F_API setVolumeRamp (bool ramp);
FMOD_RESULT F_API getVolumeRamp (bool *ramp);
FMOD_RESULT F_API getAudibility (float *audibility);
FMOD_RESULT F_API setPitch (float pitch);
FMOD_RESULT F_API getPitch (float *pitch);
FMOD_RESULT F_API setMute (bool mute);
FMOD_RESULT F_API getMute (bool *mute);
FMOD_RESULT F_API setReverbProperties (int instance, float wet);
FMOD_RESULT F_API getReverbProperties (int instance, float *wet);
FMOD_RESULT F_API setLowPassGain (float gain);
FMOD_RESULT F_API getLowPassGain (float *gain);
FMOD_RESULT F_API setMode (FMOD_MODE mode);
FMOD_RESULT F_API getMode (FMOD_MODE *mode);
FMOD_RESULT F_API setCallback (FMOD_CHANNELCONTROL_CALLBACK callback);
FMOD_RESULT F_API isPlaying (bool *isplaying);
// Panning and level adjustment.
// Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
FMOD_RESULT F_API setPan (float pan);
FMOD_RESULT F_API setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
FMOD_RESULT F_API setMixLevelsInput (float *levels, int numlevels);
FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0);
FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0);
// Clock based functionality.
FMOD_RESULT F_API getDSPClock (unsigned long long *dspclock, unsigned long long *parentclock);
FMOD_RESULT F_API setDelay (unsigned long long dspclock_start, unsigned long long dspclock_end, bool stopchannels = true);
FMOD_RESULT F_API getDelay (unsigned long long *dspclock_start, unsigned long long *dspclock_end, bool *stopchannels = 0);
FMOD_RESULT F_API addFadePoint (unsigned long long dspclock, float volume);
FMOD_RESULT F_API setFadePointRamp (unsigned long long dspclock, float volume);
FMOD_RESULT F_API removeFadePoints (unsigned long long dspclock_start, unsigned long long dspclock_end);
FMOD_RESULT F_API getFadePoints (unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
// DSP effects.
FMOD_RESULT F_API getDSP (int index, DSP **dsp);
FMOD_RESULT F_API addDSP (int index, DSP *dsp);
FMOD_RESULT F_API removeDSP (DSP *dsp);
FMOD_RESULT F_API getNumDSPs (int *numdsps);
FMOD_RESULT F_API setDSPIndex (DSP *dsp, int index);
FMOD_RESULT F_API getDSPIndex (DSP *dsp, int *index);
// 3D functionality.
FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);
FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel);
FMOD_RESULT F_API set3DMinMaxDistance (float mindistance, float maxdistance);
FMOD_RESULT F_API get3DMinMaxDistance (float *mindistance, float *maxdistance);
FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
FMOD_RESULT F_API set3DConeOrientation (FMOD_VECTOR *orientation);
FMOD_RESULT F_API get3DConeOrientation (FMOD_VECTOR *orientation);
FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
FMOD_RESULT F_API set3DOcclusion (float directocclusion, float reverbocclusion);
FMOD_RESULT F_API get3DOcclusion (float *directocclusion, float *reverbocclusion);
FMOD_RESULT F_API set3DSpread (float angle);
FMOD_RESULT F_API get3DSpread (float *angle);
FMOD_RESULT F_API set3DLevel (float level);
FMOD_RESULT F_API get3DLevel (float *level);
FMOD_RESULT F_API set3DDopplerLevel (float level);
FMOD_RESULT F_API get3DDopplerLevel (float *level);
FMOD_RESULT F_API set3DDistanceFilter (bool custom, float customLevel, float centerFreq);
FMOD_RESULT F_API get3DDistanceFilter (bool *custom, float *customLevel, float *centerFreq);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
};
/*
'Channel' API.
*/
class Channel : public ChannelControl
{
private:
// Constructor made private so user cannot statically instance a Channel class. Appropriate Channel creation or retrieval function must be used.
Channel();
Channel(const Channel &);
public:
// Channel specific control functionality.
FMOD_RESULT F_API setFrequency (float frequency);
FMOD_RESULT F_API getFrequency (float *frequency);
FMOD_RESULT F_API setPriority (int priority);
FMOD_RESULT F_API getPriority (int *priority);
FMOD_RESULT F_API setPosition (unsigned int position, FMOD_TIMEUNIT postype);
FMOD_RESULT F_API getPosition (unsigned int *position, FMOD_TIMEUNIT postype);
FMOD_RESULT F_API setChannelGroup (ChannelGroup *channelgroup);
FMOD_RESULT F_API getChannelGroup (ChannelGroup **channelgroup);
FMOD_RESULT F_API setLoopCount (int loopcount);
FMOD_RESULT F_API getLoopCount (int *loopcount);
FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
// Information only functions.
FMOD_RESULT F_API isVirtual (bool *isvirtual);
FMOD_RESULT F_API getCurrentSound (Sound **sound);
FMOD_RESULT F_API getIndex (int *index);
};
/*
'ChannelGroup' API
*/
class ChannelGroup : public ChannelControl
{
private:
// Constructor made private so user cannot statically instance a ChannelGroup class. Appropriate ChannelGroup creation or retrieval function must be used.
ChannelGroup();
ChannelGroup(const ChannelGroup &);
public:
FMOD_RESULT F_API release ();
// Nested channel groups.
FMOD_RESULT F_API addGroup (ChannelGroup *group, bool propagatedspclock = true, DSPConnection **connection = 0);
FMOD_RESULT F_API getNumGroups (int *numgroups);
FMOD_RESULT F_API getGroup (int index, ChannelGroup **group);
FMOD_RESULT F_API getParentGroup (ChannelGroup **group);
// Information only functions.
FMOD_RESULT F_API getName (char *name, int namelen);
FMOD_RESULT F_API getNumChannels (int *numchannels);
FMOD_RESULT F_API getChannel (int index, Channel **channel);
};
/*
'SoundGroup' API
*/
class SoundGroup
{
private:
// Constructor made private so user cannot statically instance a SoundGroup class. Appropriate SoundGroup creation or retrieval function must be used.
SoundGroup();
SoundGroup(const SoundGroup &);
public:
FMOD_RESULT F_API release ();
FMOD_RESULT F_API getSystemObject (System **system);
// SoundGroup control functions.
FMOD_RESULT F_API setMaxAudible (int maxaudible);
FMOD_RESULT F_API getMaxAudible (int *maxaudible);
FMOD_RESULT F_API setMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR behavior);
FMOD_RESULT F_API getMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR *behavior);
FMOD_RESULT F_API setMuteFadeSpeed (float speed);
FMOD_RESULT F_API getMuteFadeSpeed (float *speed);
FMOD_RESULT F_API setVolume (float volume);
FMOD_RESULT F_API getVolume (float *volume);
FMOD_RESULT F_API stop ();
// Information only functions.
FMOD_RESULT F_API getName (char *name, int namelen);
FMOD_RESULT F_API getNumSounds (int *numsounds);
FMOD_RESULT F_API getSound (int index, Sound **sound);
FMOD_RESULT F_API getNumPlaying (int *numplaying);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
};
/*
'DSP' API
*/
class DSP
{
private:
// Constructor made private so user cannot statically instance a DSP class. Appropriate DSP creation or retrieval function must be used.
DSP();
DSP(const DSP &);
public:
FMOD_RESULT F_API release ();
FMOD_RESULT F_API getSystemObject (System **system);
// Connection / disconnection / input and output enumeration.
FMOD_RESULT F_API addInput (DSP *input, DSPConnection **connection = 0, FMOD_DSPCONNECTION_TYPE type = FMOD_DSPCONNECTION_TYPE_STANDARD);
FMOD_RESULT F_API disconnectFrom (DSP *target, DSPConnection *connection = 0);
FMOD_RESULT F_API disconnectAll (bool inputs, bool outputs);
FMOD_RESULT F_API getNumInputs (int *numinputs);
FMOD_RESULT F_API getNumOutputs (int *numoutputs);
FMOD_RESULT F_API getInput (int index, DSP **input, DSPConnection **inputconnection);
FMOD_RESULT F_API getOutput (int index, DSP **output, DSPConnection **outputconnection);
// DSP unit control.
FMOD_RESULT F_API setActive (bool active);
FMOD_RESULT F_API getActive (bool *active);
FMOD_RESULT F_API setBypass (bool bypass);
FMOD_RESULT F_API getBypass (bool *bypass);
FMOD_RESULT F_API setWetDryMix (float prewet, float postwet, float dry);
FMOD_RESULT F_API getWetDryMix (float *prewet, float *postwet, float *dry);
FMOD_RESULT F_API setChannelFormat (FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode);
FMOD_RESULT F_API getChannelFormat (FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode);
FMOD_RESULT F_API getOutputChannelFormat (FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode);
FMOD_RESULT F_API reset ();
// DSP parameter control.
FMOD_RESULT F_API setParameterFloat (int index, float value);
FMOD_RESULT F_API setParameterInt (int index, int value);
FMOD_RESULT F_API setParameterBool (int index, bool value);
FMOD_RESULT F_API setParameterData (int index, void *data, unsigned int length);
FMOD_RESULT F_API getParameterFloat (int index, float *value, char *valuestr, int valuestrlen);
FMOD_RESULT F_API getParameterInt (int index, int *value, char *valuestr, int valuestrlen);
FMOD_RESULT F_API getParameterBool (int index, bool *value, char *valuestr, int valuestrlen);
FMOD_RESULT F_API getParameterData (int index, void **data, unsigned int *length, char *valuestr, int valuestrlen);
FMOD_RESULT F_API getNumParameters (int *numparams);
FMOD_RESULT F_API getParameterInfo (int index, FMOD_DSP_PARAMETER_DESC **desc);
FMOD_RESULT F_API getDataParameterIndex (int datatype, int *index);
FMOD_RESULT F_API showConfigDialog (void *hwnd, bool show);
// DSP attributes.
FMOD_RESULT F_API getInfo (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
FMOD_RESULT F_API getType (FMOD_DSP_TYPE *type);
FMOD_RESULT F_API getIdle (bool *idle);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
// Metering.
FMOD_RESULT F_API setMeteringEnabled (bool inputEnabled, bool outputEnabled);
FMOD_RESULT F_API getMeteringEnabled (bool *inputEnabled, bool *outputEnabled);
FMOD_RESULT F_API getMeteringInfo (FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
FMOD_RESULT F_API getCPUUsage (unsigned int *exclusive, unsigned int *inclusive);
};
/*
'DSPConnection' API
*/
class DSPConnection
{
private:
// Constructor made private so user cannot statically instance a DSPConnection class. Appropriate DSPConnection creation or retrieval function must be used.
DSPConnection();
DSPConnection(const DSPConnection &);
public:
FMOD_RESULT F_API getInput (DSP **input);
FMOD_RESULT F_API getOutput (DSP **output);
FMOD_RESULT F_API setMix (float volume);
FMOD_RESULT F_API getMix (float *volume);
FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0);
FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0);
FMOD_RESULT F_API getType (FMOD_DSPCONNECTION_TYPE *type);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
};
/*
'Geometry' API
*/
class Geometry
{
private:
// Constructor made private so user cannot statically instance a Geometry class. Appropriate Geometry creation or retrieval function must be used.
Geometry();
Geometry(const Geometry &);
public:
FMOD_RESULT F_API release ();
// Polygon manipulation.
FMOD_RESULT F_API addPolygon (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
FMOD_RESULT F_API getNumPolygons (int *numpolygons);
FMOD_RESULT F_API getMaxPolygons (int *maxpolygons, int *maxvertices);
FMOD_RESULT F_API getPolygonNumVertices (int index, int *numvertices);
FMOD_RESULT F_API setPolygonVertex (int index, int vertexindex, const FMOD_VECTOR *vertex);
FMOD_RESULT F_API getPolygonVertex (int index, int vertexindex, FMOD_VECTOR *vertex);
FMOD_RESULT F_API setPolygonAttributes (int index, float directocclusion, float reverbocclusion, bool doublesided);
FMOD_RESULT F_API getPolygonAttributes (int index, float *directocclusion, float *reverbocclusion, bool *doublesided);
// Object manipulation.
FMOD_RESULT F_API setActive (bool active);
FMOD_RESULT F_API getActive (bool *active);
FMOD_RESULT F_API setRotation (const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
FMOD_RESULT F_API getRotation (FMOD_VECTOR *forward, FMOD_VECTOR *up);
FMOD_RESULT F_API setPosition (const FMOD_VECTOR *position);
FMOD_RESULT F_API getPosition (FMOD_VECTOR *position);
FMOD_RESULT F_API setScale (const FMOD_VECTOR *scale);
FMOD_RESULT F_API getScale (FMOD_VECTOR *scale);
FMOD_RESULT F_API save (void *data, int *datasize);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
};
/*
'Reverb' API
*/
class Reverb3D
{
private:
// Constructor made private so user cannot statically instance a Reverb3D class. Appropriate Reverb creation or retrieval function must be used.
Reverb3D();
Reverb3D(const Reverb3D &);
public:
FMOD_RESULT F_API release ();
// Reverb manipulation.
FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *position, float mindistance, float maxdistance);
FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *position, float *mindistance,float *maxdistance);
FMOD_RESULT F_API setProperties (const FMOD_REVERB_PROPERTIES *properties);
FMOD_RESULT F_API getProperties (FMOD_REVERB_PROPERTIES *properties);
FMOD_RESULT F_API setActive (bool active);
FMOD_RESULT F_API getActive (bool *active);
// Userdata set/get.
FMOD_RESULT F_API setUserData (void *userdata);
FMOD_RESULT F_API getUserData (void **userdata);
};
}
#endif

97
engine/fmodcore/inc/fmod_codec.h

@ -0,0 +1,97 @@
/* ======================================================================================== */
/* FMOD Core API - Codec development header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header if you are wanting to develop your own file format plugin to use with */
/* FMOD's codec system. With this header you can make your own fileformat plugin that FMOD */
/* can register and use. See the documentation and examples on how to make a working */
/* plugin. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */
/* ======================================================================================== */
#ifndef _FMOD_CODEC_H
#define _FMOD_CODEC_H
/*
Codec types
*/
typedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE;
typedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;
/*
Codec constants
*/
#define FMOD_CODEC_WAVEFORMAT_VERSION 3
/*
Codec callbacks
*/
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPEN_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSE_CALLBACK) (FMOD_CODEC_STATE *codec_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READ_CALLBACK) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int samples_in, unsigned int *samples_out);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTH_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATE_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT_CALLBACK)(FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);
/*
Codec functions
*/
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_METADATA_FUNC) (FMOD_CODEC_STATE *codec_state, FMOD_TAGTYPE tagtype, char *name, void *data, unsigned int datalen, FMOD_TAGDATATYPE datatype, int unique);
/*
Codec structures
*/
typedef struct FMOD_CODEC_DESCRIPTION
{
const char *name;
unsigned int version;
int defaultasstream;
FMOD_TIMEUNIT timeunits;
FMOD_CODEC_OPEN_CALLBACK open;
FMOD_CODEC_CLOSE_CALLBACK close;
FMOD_CODEC_READ_CALLBACK read;
FMOD_CODEC_GETLENGTH_CALLBACK getlength;
FMOD_CODEC_SETPOSITION_CALLBACK setposition;
FMOD_CODEC_GETPOSITION_CALLBACK getposition;
FMOD_CODEC_SOUNDCREATE_CALLBACK soundcreate;
FMOD_CODEC_GETWAVEFORMAT_CALLBACK getwaveformat;
} FMOD_CODEC_DESCRIPTION;
struct FMOD_CODEC_WAVEFORMAT
{
const char* name;
FMOD_SOUND_FORMAT format;
int channels;
int frequency;
unsigned int lengthbytes;
unsigned int lengthpcm;
unsigned int pcmblocksize;
int loopstart;
int loopend;
FMOD_MODE mode;
FMOD_CHANNELMASK channelmask;
FMOD_CHANNELORDER channelorder;
float peakvolume;
};
struct FMOD_CODEC_STATE
{
int numsubsounds;
FMOD_CODEC_WAVEFORMAT *waveformat;
void *plugindata;
void *filehandle;
unsigned int filesize;
FMOD_FILE_READ_CALLBACK fileread;
FMOD_FILE_SEEK_CALLBACK fileseek;
FMOD_CODEC_METADATA_FUNC metadata;
int waveformatversion;
};
#endif

752
engine/fmodcore/inc/fmod_common.h

@ -0,0 +1,752 @@
/* ======================================================================================== */
/* FMOD Core API - Common C/C++ header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* This header is included by fmod.hpp (C++ interface) and fmod.h (C interface) */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html */
/* ======================================================================================== */
#ifndef _FMOD_COMMON_H
#define _FMOD_COMMON_H
/*
Library import helpers
*/
#if defined(_WIN32) || defined(__CYGWIN__)
#define F_CALL __stdcall
#else
#define F_CALL
#endif
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__ORBIS__) || defined(F_USE_DECLSPEC)
#define F_EXPORT __declspec(dllexport)
#elif defined(__APPLE__) || defined(__ANDROID__) || defined(__linux__) || defined(F_USE_ATTRIBUTE)
#define F_EXPORT __attribute__((visibility("default")))
#else
#define F_EXPORT
#endif
#ifdef DLL_EXPORTS
#define F_API F_EXPORT F_CALL
#else
#define F_API F_CALL
#endif
#define F_CALLBACK F_CALL
/*
FMOD core types
*/
typedef int FMOD_BOOL;
typedef struct FMOD_SYSTEM FMOD_SYSTEM;
typedef struct FMOD_SOUND FMOD_SOUND;
typedef struct FMOD_CHANNELCONTROL FMOD_CHANNELCONTROL;
typedef struct FMOD_CHANNEL FMOD_CHANNEL;
typedef struct FMOD_CHANNELGROUP FMOD_CHANNELGROUP;
typedef struct FMOD_SOUNDGROUP FMOD_SOUNDGROUP;
typedef struct FMOD_REVERB3D FMOD_REVERB3D;
typedef struct FMOD_DSP FMOD_DSP;
typedef struct FMOD_DSPCONNECTION FMOD_DSPCONNECTION;
typedef struct FMOD_POLYGON FMOD_POLYGON;
typedef struct FMOD_GEOMETRY FMOD_GEOMETRY;
typedef struct FMOD_SYNCPOINT FMOD_SYNCPOINT;
typedef struct FMOD_ASYNCREADINFO FMOD_ASYNCREADINFO;
typedef unsigned int FMOD_PORT_TYPE;
typedef unsigned long long FMOD_PORT_INDEX;
/*
FMOD constants
*/
#define FMOD_VERSION 0x00020016 /* 0xaaaabbcc -> aaaa = product version, bb = major version, cc = minor version.*/
typedef unsigned int FMOD_DEBUG_FLAGS;
#define FMOD_DEBUG_LEVEL_NONE 0x00000000
#define FMOD_DEBUG_LEVEL_ERROR 0x00000001
#define FMOD_DEBUG_LEVEL_WARNING 0x00000002
#define FMOD_DEBUG_LEVEL_LOG 0x00000004
#define FMOD_DEBUG_TYPE_MEMORY 0x00000100
#define FMOD_DEBUG_TYPE_FILE 0x00000200
#define FMOD_DEBUG_TYPE_CODEC 0x00000400
#define FMOD_DEBUG_TYPE_TRACE 0x00000800
#define FMOD_DEBUG_DISPLAY_TIMESTAMPS 0x00010000
#define FMOD_DEBUG_DISPLAY_LINENUMBERS 0x00020000
#define FMOD_DEBUG_DISPLAY_THREAD 0x00040000
typedef unsigned int FMOD_MEMORY_TYPE;
#define FMOD_MEMORY_NORMAL 0x00000000
#define FMOD_MEMORY_STREAM_FILE 0x00000001
#define FMOD_MEMORY_STREAM_DECODE 0x00000002
#define FMOD_MEMORY_SAMPLEDATA 0x00000004
#define FMOD_MEMORY_DSP_BUFFER 0x00000008
#define FMOD_MEMORY_PLUGIN 0x00000010
#define FMOD_MEMORY_PERSISTENT 0x00200000
#define FMOD_MEMORY_ALL 0xFFFFFFFF
typedef unsigned int FMOD_INITFLAGS;
#define FMOD_INIT_NORMAL 0x00000000
#define FMOD_INIT_STREAM_FROM_UPDATE 0x00000001
#define FMOD_INIT_MIX_FROM_UPDATE 0x00000002
#define FMOD_INIT_3D_RIGHTHANDED 0x00000004
#define FMOD_INIT_CHANNEL_LOWPASS 0x00000100
#define FMOD_INIT_CHANNEL_DISTANCEFILTER 0x00000200
#define FMOD_INIT_PROFILE_ENABLE 0x00010000
#define FMOD_INIT_VOL0_BECOMES_VIRTUAL 0x00020000
#define FMOD_INIT_GEOMETRY_USECLOSEST 0x00040000
#define FMOD_INIT_PREFER_DOLBY_DOWNMIX 0x00080000
#define FMOD_INIT_THREAD_UNSAFE 0x00100000
#define FMOD_INIT_PROFILE_METER_ALL 0x00200000
#define FMOD_INIT_MEMORY_TRACKING 0x00400000
typedef unsigned int FMOD_DRIVER_STATE;
#define FMOD_DRIVER_STATE_CONNECTED 0x00000001
#define FMOD_DRIVER_STATE_DEFAULT 0x00000002
typedef unsigned int FMOD_TIMEUNIT;
#define FMOD_TIMEUNIT_MS 0x00000001
#define FMOD_TIMEUNIT_PCM 0x00000002
#define FMOD_TIMEUNIT_PCMBYTES 0x00000004
#define FMOD_TIMEUNIT_RAWBYTES 0x00000008
#define FMOD_TIMEUNIT_PCMFRACTION 0x00000010
#define FMOD_TIMEUNIT_MODORDER 0x00000100
#define FMOD_TIMEUNIT_MODROW 0x00000200
#define FMOD_TIMEUNIT_MODPATTERN 0x00000400
typedef unsigned int FMOD_SYSTEM_CALLBACK_TYPE;
#define FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED 0x00000001
#define FMOD_SYSTEM_CALLBACK_DEVICELOST 0x00000002
#define FMOD_SYSTEM_CALLBACK_MEMORYALLOCATIONFAILED 0x00000004
#define FMOD_SYSTEM_CALLBACK_THREADCREATED 0x00000008
#define FMOD_SYSTEM_CALLBACK_BADDSPCONNECTION 0x00000010
#define FMOD_SYSTEM_CALLBACK_PREMIX 0x00000020
#define FMOD_SYSTEM_CALLBACK_POSTMIX 0x00000040
#define FMOD_SYSTEM_CALLBACK_ERROR 0x00000080
#define FMOD_SYSTEM_CALLBACK_MIDMIX 0x00000100
#define FMOD_SYSTEM_CALLBACK_THREADDESTROYED 0x00000200
#define FMOD_SYSTEM_CALLBACK_PREUPDATE 0x00000400
#define FMOD_SYSTEM_CALLBACK_POSTUPDATE 0x00000800
#define FMOD_SYSTEM_CALLBACK_RECORDLISTCHANGED 0x00001000
#define FMOD_SYSTEM_CALLBACK_ALL 0xFFFFFFFF
typedef unsigned int FMOD_MODE;
#define FMOD_DEFAULT 0x00000000
#define FMOD_LOOP_OFF 0x00000001
#define FMOD_LOOP_NORMAL 0x00000002
#define FMOD_LOOP_BIDI 0x00000004
#define FMOD_2D 0x00000008
#define FMOD_3D 0x00000010
#define FMOD_CREATESTREAM 0x00000080
#define FMOD_CREATESAMPLE 0x00000100
#define FMOD_CREATECOMPRESSEDSAMPLE 0x00000200
#define FMOD_OPENUSER 0x00000400
#define FMOD_OPENMEMORY 0x00000800
#define FMOD_OPENMEMORY_POINT 0x10000000
#define FMOD_OPENRAW 0x00001000
#define FMOD_OPENONLY 0x00002000
#define FMOD_ACCURATETIME 0x00004000
#define FMOD_MPEGSEARCH 0x00008000
#define FMOD_NONBLOCKING 0x00010000
#define FMOD_UNIQUE 0x00020000
#define FMOD_3D_HEADRELATIVE 0x00040000
#define FMOD_3D_WORLDRELATIVE 0x00080000
#define FMOD_3D_INVERSEROLLOFF 0x00100000
#define FMOD_3D_LINEARROLLOFF 0x00200000
#define FMOD_3D_LINEARSQUAREROLLOFF 0x00400000
#define FMOD_3D_INVERSETAPEREDROLLOFF 0x00800000
#define FMOD_3D_CUSTOMROLLOFF 0x04000000
#define FMOD_3D_IGNOREGEOMETRY 0x40000000
#define FMOD_IGNORETAGS 0x02000000
#define FMOD_LOWMEM 0x08000000
#define FMOD_VIRTUAL_PLAYFROMSTART 0x80000000
typedef unsigned int FMOD_CHANNELMASK;
#define FMOD_CHANNELMASK_FRONT_LEFT 0x00000001
#define FMOD_CHANNELMASK_FRONT_RIGHT 0x00000002
#define FMOD_CHANNELMASK_FRONT_CENTER 0x00000004
#define FMOD_CHANNELMASK_LOW_FREQUENCY 0x00000008
#define FMOD_CHANNELMASK_SURROUND_LEFT 0x00000010
#define FMOD_CHANNELMASK_SURROUND_RIGHT 0x00000020
#define FMOD_CHANNELMASK_BACK_LEFT 0x00000040
#define FMOD_CHANNELMASK_BACK_RIGHT 0x00000080
#define FMOD_CHANNELMASK_BACK_CENTER 0x00000100
#define FMOD_CHANNELMASK_MONO (FMOD_CHANNELMASK_FRONT_LEFT)
#define FMOD_CHANNELMASK_STEREO (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT)
#define FMOD_CHANNELMASK_LRC (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER)
#define FMOD_CHANNELMASK_QUAD (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
#define FMOD_CHANNELMASK_SURROUND (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
#define FMOD_CHANNELMASK_5POINT1 (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT)
#define FMOD_CHANNELMASK_5POINT1_REARS (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
#define FMOD_CHANNELMASK_7POINT0 (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
#define FMOD_CHANNELMASK_7POINT1 (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_LOW_FREQUENCY | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT | FMOD_CHANNELMASK_BACK_LEFT | FMOD_CHANNELMASK_BACK_RIGHT)
/* Preset for FMOD_REVERB_PROPERTIES */
#define FMOD_PRESET_OFF { 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f }
#define FMOD_PRESET_GENERIC { 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f }
#define FMOD_PRESET_PADDEDCELL { 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f }
#define FMOD_PRESET_ROOM { 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f }
#define FMOD_PRESET_BATHROOM { 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f }
#define FMOD_PRESET_LIVINGROOM { 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f }
#define FMOD_PRESET_STONEROOM { 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f }
#define FMOD_PRESET_AUDITORIUM { 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f }
#define FMOD_PRESET_CONCERTHALL { 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f }
#define FMOD_PRESET_CAVE { 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f }
#define FMOD_PRESET_ARENA { 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f }
#define FMOD_PRESET_HANGAR { 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f }
#define FMOD_PRESET_CARPETTEDHALLWAY { 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f }
#define FMOD_PRESET_HALLWAY { 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f }
#define FMOD_PRESET_STONECORRIDOR { 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f }
#define FMOD_PRESET_ALLEY { 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f }
#define FMOD_PRESET_FOREST { 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f }
#define FMOD_PRESET_CITY { 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f }
#define FMOD_PRESET_MOUNTAINS { 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f }
#define FMOD_PRESET_QUARRY { 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f }
#define FMOD_PRESET_PLAIN { 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f }
#define FMOD_PRESET_PARKINGLOT { 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f }
#define FMOD_PRESET_SEWERPIPE { 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f }
#define FMOD_PRESET_UNDERWATER { 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f }
#define FMOD_MAX_CHANNEL_WIDTH 32
#define FMOD_MAX_SYSTEMS 8
#define FMOD_MAX_LISTENERS 8
#define FMOD_REVERB_MAXINSTANCES 4
#define FMOD_PORT_INDEX_NONE 0xFFFFFFFFFFFFFFFF
typedef enum FMOD_RESULT
{
FMOD_OK,
FMOD_ERR_BADCOMMAND,
FMOD_ERR_CHANNEL_ALLOC,
FMOD_ERR_CHANNEL_STOLEN,
FMOD_ERR_DMA,
FMOD_ERR_DSP_CONNECTION,
FMOD_ERR_DSP_DONTPROCESS,
FMOD_ERR_DSP_FORMAT,
FMOD_ERR_DSP_INUSE,
FMOD_ERR_DSP_NOTFOUND,
FMOD_ERR_DSP_RESERVED,
FMOD_ERR_DSP_SILENCE,
FMOD_ERR_DSP_TYPE,
FMOD_ERR_FILE_BAD,
FMOD_ERR_FILE_COULDNOTSEEK,
FMOD_ERR_FILE_DISKEJECTED,
FMOD_ERR_FILE_EOF,
FMOD_ERR_FILE_ENDOFDATA,
FMOD_ERR_FILE_NOTFOUND,
FMOD_ERR_FORMAT,
FMOD_ERR_HEADER_MISMATCH,
FMOD_ERR_HTTP,
FMOD_ERR_HTTP_ACCESS,
FMOD_ERR_HTTP_PROXY_AUTH,
FMOD_ERR_HTTP_SERVER_ERROR,
FMOD_ERR_HTTP_TIMEOUT,
FMOD_ERR_INITIALIZATION,
FMOD_ERR_INITIALIZED,
FMOD_ERR_INTERNAL,
FMOD_ERR_INVALID_FLOAT,
FMOD_ERR_INVALID_HANDLE,
FMOD_ERR_INVALID_PARAM,
FMOD_ERR_INVALID_POSITION,
FMOD_ERR_INVALID_SPEAKER,
FMOD_ERR_INVALID_SYNCPOINT,
FMOD_ERR_INVALID_THREAD,
FMOD_ERR_INVALID_VECTOR,
FMOD_ERR_MAXAUDIBLE,
FMOD_ERR_MEMORY,
FMOD_ERR_MEMORY_CANTPOINT,
FMOD_ERR_NEEDS3D,
FMOD_ERR_NEEDSHARDWARE,
FMOD_ERR_NET_CONNECT,
FMOD_ERR_NET_SOCKET_ERROR,
FMOD_ERR_NET_URL,
FMOD_ERR_NET_WOULD_BLOCK,
FMOD_ERR_NOTREADY,
FMOD_ERR_OUTPUT_ALLOCATED,
FMOD_ERR_OUTPUT_CREATEBUFFER,
FMOD_ERR_OUTPUT_DRIVERCALL,
FMOD_ERR_OUTPUT_FORMAT,
FMOD_ERR_OUTPUT_INIT,
FMOD_ERR_OUTPUT_NODRIVERS,
FMOD_ERR_PLUGIN,
FMOD_ERR_PLUGIN_MISSING,
FMOD_ERR_PLUGIN_RESOURCE,
FMOD_ERR_PLUGIN_VERSION,
FMOD_ERR_RECORD,
FMOD_ERR_REVERB_CHANNELGROUP,
FMOD_ERR_REVERB_INSTANCE,
FMOD_ERR_SUBSOUNDS,
FMOD_ERR_SUBSOUND_ALLOCATED,
FMOD_ERR_SUBSOUND_CANTMOVE,
FMOD_ERR_TAGNOTFOUND,
FMOD_ERR_TOOMANYCHANNELS,
FMOD_ERR_TRUNCATED,
FMOD_ERR_UNIMPLEMENTED,
FMOD_ERR_UNINITIALIZED,
FMOD_ERR_UNSUPPORTED,
FMOD_ERR_VERSION,
FMOD_ERR_EVENT_ALREADY_LOADED,
FMOD_ERR_EVENT_LIVEUPDATE_BUSY,
FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH,
FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT,
FMOD_ERR_EVENT_NOTFOUND,
FMOD_ERR_STUDIO_UNINITIALIZED,
FMOD_ERR_STUDIO_NOT_LOADED,
FMOD_ERR_INVALID_STRING,
FMOD_ERR_ALREADY_LOCKED,
FMOD_ERR_NOT_LOCKED,
FMOD_ERR_RECORD_DISCONNECTED,
FMOD_ERR_TOOMANYSAMPLES,
FMOD_RESULT_FORCEINT = 65536
} FMOD_RESULT;
typedef enum FMOD_CHANNELCONTROL_TYPE
{
FMOD_CHANNELCONTROL_CHANNEL,
FMOD_CHANNELCONTROL_CHANNELGROUP,
FMOD_CHANNELCONTROL_MAX,
FMOD_CHANNELCONTROL_FORCEINT = 65536
} FMOD_CHANNELCONTROL_TYPE;
typedef enum FMOD_OUTPUTTYPE
{
FMOD_OUTPUTTYPE_AUTODETECT,
FMOD_OUTPUTTYPE_UNKNOWN,
FMOD_OUTPUTTYPE_NOSOUND,
FMOD_OUTPUTTYPE_WAVWRITER,
FMOD_OUTPUTTYPE_NOSOUND_NRT,
FMOD_OUTPUTTYPE_WAVWRITER_NRT,
FMOD_OUTPUTTYPE_WASAPI,
FMOD_OUTPUTTYPE_ASIO,
FMOD_OUTPUTTYPE_PULSEAUDIO,
FMOD_OUTPUTTYPE_ALSA,
FMOD_OUTPUTTYPE_COREAUDIO,
FMOD_OUTPUTTYPE_AUDIOTRACK,
FMOD_OUTPUTTYPE_OPENSL,
FMOD_OUTPUTTYPE_AUDIOOUT,
FMOD_OUTPUTTYPE_AUDIO3D,
FMOD_OUTPUTTYPE_WEBAUDIO,
FMOD_OUTPUTTYPE_NNAUDIO,
FMOD_OUTPUTTYPE_WINSONIC,
FMOD_OUTPUTTYPE_AAUDIO,
FMOD_OUTPUTTYPE_MAX,
FMOD_OUTPUTTYPE_FORCEINT = 65536
} FMOD_OUTPUTTYPE;
typedef enum FMOD_DEBUG_MODE
{
FMOD_DEBUG_MODE_TTY,
FMOD_DEBUG_MODE_FILE,
FMOD_DEBUG_MODE_CALLBACK,
FMOD_DEBUG_MODE_FORCEINT = 65536
} FMOD_DEBUG_MODE;
typedef enum FMOD_SPEAKERMODE
{
FMOD_SPEAKERMODE_DEFAULT,
FMOD_SPEAKERMODE_RAW,
FMOD_SPEAKERMODE_MONO,
FMOD_SPEAKERMODE_STEREO,
FMOD_SPEAKERMODE_QUAD,
FMOD_SPEAKERMODE_SURROUND,
FMOD_SPEAKERMODE_5POINT1,
FMOD_SPEAKERMODE_7POINT1,
FMOD_SPEAKERMODE_7POINT1POINT4,
FMOD_SPEAKERMODE_MAX,
FMOD_SPEAKERMODE_FORCEINT = 65536
} FMOD_SPEAKERMODE;
typedef enum FMOD_SPEAKER
{
FMOD_SPEAKER_NONE = -1,
FMOD_SPEAKER_FRONT_LEFT = 0,
FMOD_SPEAKER_FRONT_RIGHT,
FMOD_SPEAKER_FRONT_CENTER,
FMOD_SPEAKER_LOW_FREQUENCY,
FMOD_SPEAKER_SURROUND_LEFT,
FMOD_SPEAKER_SURROUND_RIGHT,
FMOD_SPEAKER_BACK_LEFT,
FMOD_SPEAKER_BACK_RIGHT,
FMOD_SPEAKER_TOP_FRONT_LEFT,
FMOD_SPEAKER_TOP_FRONT_RIGHT,
FMOD_SPEAKER_TOP_BACK_LEFT,
FMOD_SPEAKER_TOP_BACK_RIGHT,
FMOD_SPEAKER_MAX,
FMOD_SPEAKER_FORCEINT = 65536
} FMOD_SPEAKER;
typedef enum FMOD_CHANNELORDER
{
FMOD_CHANNELORDER_DEFAULT,
FMOD_CHANNELORDER_WAVEFORMAT,
FMOD_CHANNELORDER_PROTOOLS,
FMOD_CHANNELORDER_ALLMONO,
FMOD_CHANNELORDER_ALLSTEREO,
FMOD_CHANNELORDER_ALSA,
FMOD_CHANNELORDER_MAX,
FMOD_CHANNELORDER_FORCEINT = 65536
} FMOD_CHANNELORDER;
typedef enum FMOD_PLUGINTYPE
{
FMOD_PLUGINTYPE_OUTPUT,
FMOD_PLUGINTYPE_CODEC,
FMOD_PLUGINTYPE_DSP,
FMOD_PLUGINTYPE_MAX,
FMOD_PLUGINTYPE_FORCEINT = 65536
} FMOD_PLUGINTYPE;
typedef enum FMOD_SOUND_TYPE
{
FMOD_SOUND_TYPE_UNKNOWN,
FMOD_SOUND_TYPE_AIFF,
FMOD_SOUND_TYPE_ASF,
FMOD_SOUND_TYPE_DLS,
FMOD_SOUND_TYPE_FLAC,
FMOD_SOUND_TYPE_FSB,
FMOD_SOUND_TYPE_IT,
FMOD_SOUND_TYPE_MIDI,
FMOD_SOUND_TYPE_MOD,
FMOD_SOUND_TYPE_MPEG,
FMOD_SOUND_TYPE_OGGVORBIS,
FMOD_SOUND_TYPE_PLAYLIST,
FMOD_SOUND_TYPE_RAW,
FMOD_SOUND_TYPE_S3M,
FMOD_SOUND_TYPE_USER,
FMOD_SOUND_TYPE_WAV,
FMOD_SOUND_TYPE_XM,
FMOD_SOUND_TYPE_XMA,
FMOD_SOUND_TYPE_AUDIOQUEUE,
FMOD_SOUND_TYPE_AT9,
FMOD_SOUND_TYPE_VORBIS,
FMOD_SOUND_TYPE_MEDIA_FOUNDATION,
FMOD_SOUND_TYPE_MEDIACODEC,
FMOD_SOUND_TYPE_FADPCM,
FMOD_SOUND_TYPE_OPUS,
FMOD_SOUND_TYPE_MAX,
FMOD_SOUND_TYPE_FORCEINT = 65536
} FMOD_SOUND_TYPE;
typedef enum FMOD_SOUND_FORMAT
{
FMOD_SOUND_FORMAT_NONE,
FMOD_SOUND_FORMAT_PCM8,
FMOD_SOUND_FORMAT_PCM16,
FMOD_SOUND_FORMAT_PCM24,
FMOD_SOUND_FORMAT_PCM32,
FMOD_SOUND_FORMAT_PCMFLOAT,
FMOD_SOUND_FORMAT_BITSTREAM,
FMOD_SOUND_FORMAT_MAX,
FMOD_SOUND_FORMAT_FORCEINT = 65536
} FMOD_SOUND_FORMAT;
typedef enum FMOD_OPENSTATE
{
FMOD_OPENSTATE_READY,
FMOD_OPENSTATE_LOADING,
FMOD_OPENSTATE_ERROR,
FMOD_OPENSTATE_CONNECTING,
FMOD_OPENSTATE_BUFFERING,
FMOD_OPENSTATE_SEEKING,
FMOD_OPENSTATE_PLAYING,
FMOD_OPENSTATE_SETPOSITION,
FMOD_OPENSTATE_MAX,
FMOD_OPENSTATE_FORCEINT = 65536
} FMOD_OPENSTATE;
typedef enum FMOD_SOUNDGROUP_BEHAVIOR
{
FMOD_SOUNDGROUP_BEHAVIOR_FAIL,
FMOD_SOUNDGROUP_BEHAVIOR_MUTE,
FMOD_SOUNDGROUP_BEHAVIOR_STEALLOWEST,
FMOD_SOUNDGROUP_BEHAVIOR_MAX,
FMOD_SOUNDGROUP_BEHAVIOR_FORCEINT = 65536
} FMOD_SOUNDGROUP_BEHAVIOR;
typedef enum FMOD_CHANNELCONTROL_CALLBACK_TYPE
{
FMOD_CHANNELCONTROL_CALLBACK_END,
FMOD_CHANNELCONTROL_CALLBACK_VIRTUALVOICE,
FMOD_CHANNELCONTROL_CALLBACK_SYNCPOINT,
FMOD_CHANNELCONTROL_CALLBACK_OCCLUSION,
FMOD_CHANNELCONTROL_CALLBACK_MAX,
FMOD_CHANNELCONTROL_CALLBACK_FORCEINT = 65536
} FMOD_CHANNELCONTROL_CALLBACK_TYPE;
typedef enum FMOD_CHANNELCONTROL_DSP_INDEX
{
FMOD_CHANNELCONTROL_DSP_HEAD = -1,
FMOD_CHANNELCONTROL_DSP_FADER = -2,
FMOD_CHANNELCONTROL_DSP_TAIL = -3,
FMOD_CHANNELCONTROL_DSP_FORCEINT = 65536
} FMOD_CHANNELCONTROL_DSP_INDEX;
typedef enum FMOD_ERRORCALLBACK_INSTANCETYPE
{
FMOD_ERRORCALLBACK_INSTANCETYPE_NONE,
FMOD_ERRORCALLBACK_INSTANCETYPE_SYSTEM,
FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNEL,
FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELGROUP,
FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELCONTROL,
FMOD_ERRORCALLBACK_INSTANCETYPE_SOUND,
FMOD_ERRORCALLBACK_INSTANCETYPE_SOUNDGROUP,
FMOD_ERRORCALLBACK_INSTANCETYPE_DSP,
FMOD_ERRORCALLBACK_INSTANCETYPE_DSPCONNECTION,
FMOD_ERRORCALLBACK_INSTANCETYPE_GEOMETRY,
FMOD_ERRORCALLBACK_INSTANCETYPE_REVERB3D,
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_SYSTEM,
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTDESCRIPTION,
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTINSTANCE,
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_PARAMETERINSTANCE,
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BUS,
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_VCA,
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BANK,
FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_COMMANDREPLAY,
FMOD_ERRORCALLBACK_INSTANCETYPE_FORCEINT = 65536
} FMOD_ERRORCALLBACK_INSTANCETYPE;
typedef enum FMOD_DSP_RESAMPLER
{
FMOD_DSP_RESAMPLER_DEFAULT,
FMOD_DSP_RESAMPLER_NOINTERP,
FMOD_DSP_RESAMPLER_LINEAR,
FMOD_DSP_RESAMPLER_CUBIC,
FMOD_DSP_RESAMPLER_SPLINE,
FMOD_DSP_RESAMPLER_MAX,
FMOD_DSP_RESAMPLER_FORCEINT = 65536
} FMOD_DSP_RESAMPLER;
typedef enum FMOD_DSPCONNECTION_TYPE
{
FMOD_DSPCONNECTION_TYPE_STANDARD,
FMOD_DSPCONNECTION_TYPE_SIDECHAIN,
FMOD_DSPCONNECTION_TYPE_SEND,
FMOD_DSPCONNECTION_TYPE_SEND_SIDECHAIN,
FMOD_DSPCONNECTION_TYPE_MAX,
FMOD_DSPCONNECTION_TYPE_FORCEINT = 65536
} FMOD_DSPCONNECTION_TYPE;
typedef enum FMOD_TAGTYPE
{
FMOD_TAGTYPE_UNKNOWN,
FMOD_TAGTYPE_ID3V1,
FMOD_TAGTYPE_ID3V2,
FMOD_TAGTYPE_VORBISCOMMENT,
FMOD_TAGTYPE_SHOUTCAST,
FMOD_TAGTYPE_ICECAST,
FMOD_TAGTYPE_ASF,
FMOD_TAGTYPE_MIDI,
FMOD_TAGTYPE_PLAYLIST,
FMOD_TAGTYPE_FMOD,
FMOD_TAGTYPE_USER,
FMOD_TAGTYPE_MAX,
FMOD_TAGTYPE_FORCEINT = 65536
} FMOD_TAGTYPE;
typedef enum FMOD_TAGDATATYPE
{
FMOD_TAGDATATYPE_BINARY,
FMOD_TAGDATATYPE_INT,
FMOD_TAGDATATYPE_FLOAT,
FMOD_TAGDATATYPE_STRING,
FMOD_TAGDATATYPE_STRING_UTF16,
FMOD_TAGDATATYPE_STRING_UTF16BE,
FMOD_TAGDATATYPE_STRING_UTF8,
FMOD_TAGDATATYPE_MAX,
FMOD_TAGDATATYPE_FORCEINT = 65536
} FMOD_TAGDATATYPE;
/*
FMOD callbacks
*/
typedef FMOD_RESULT (F_CALL *FMOD_DEBUG_CALLBACK) (FMOD_DEBUG_FLAGS flags, const char *file, int line, const char* func, const char* message);
typedef FMOD_RESULT (F_CALL *FMOD_SYSTEM_CALLBACK) (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK_TYPE type, void *commanddata1, void* commanddata2, void *userdata);
typedef FMOD_RESULT (F_CALL *FMOD_CHANNELCONTROL_CALLBACK) (FMOD_CHANNELCONTROL *channelcontrol, FMOD_CHANNELCONTROL_TYPE controltype, FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype, void *commanddata1, void *commanddata2);
typedef FMOD_RESULT (F_CALL *FMOD_SOUND_NONBLOCK_CALLBACK) (FMOD_SOUND *sound, FMOD_RESULT result);
typedef FMOD_RESULT (F_CALL *FMOD_SOUND_PCMREAD_CALLBACK) (FMOD_SOUND *sound, void *data, unsigned int datalen);
typedef FMOD_RESULT (F_CALL *FMOD_SOUND_PCMSETPOS_CALLBACK) (FMOD_SOUND *sound, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
typedef FMOD_RESULT (F_CALL *FMOD_FILE_OPEN_CALLBACK) (const char *name, unsigned int *filesize, void **handle, void *userdata);
typedef FMOD_RESULT (F_CALL *FMOD_FILE_CLOSE_CALLBACK) (void *handle, void *userdata);
typedef FMOD_RESULT (F_CALL *FMOD_FILE_READ_CALLBACK) (void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata);
typedef FMOD_RESULT (F_CALL *FMOD_FILE_SEEK_CALLBACK) (void *handle, unsigned int pos, void *userdata);
typedef FMOD_RESULT (F_CALL *FMOD_FILE_ASYNCREAD_CALLBACK) (FMOD_ASYNCREADINFO *info, void *userdata);
typedef FMOD_RESULT (F_CALL *FMOD_FILE_ASYNCCANCEL_CALLBACK)(FMOD_ASYNCREADINFO *info, void *userdata);
typedef void (F_CALL *FMOD_FILE_ASYNCDONE_FUNC) (FMOD_ASYNCREADINFO *info, FMOD_RESULT result);
typedef void* (F_CALL *FMOD_MEMORY_ALLOC_CALLBACK) (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
typedef void* (F_CALL *FMOD_MEMORY_REALLOC_CALLBACK) (void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
typedef void (F_CALL *FMOD_MEMORY_FREE_CALLBACK) (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr);
typedef float (F_CALL *FMOD_3D_ROLLOFF_CALLBACK) (FMOD_CHANNELCONTROL *channelcontrol, float distance);
/*
FMOD structs
*/
struct FMOD_ASYNCREADINFO
{
void *handle;
unsigned int offset;
unsigned int sizebytes;
int priority;
void *userdata;
void *buffer;
unsigned int bytesread;
FMOD_FILE_ASYNCDONE_FUNC done;
};
typedef struct FMOD_VECTOR
{
float x;
float y;
float z;
} FMOD_VECTOR;
typedef struct FMOD_3D_ATTRIBUTES
{
FMOD_VECTOR position;
FMOD_VECTOR velocity;
FMOD_VECTOR forward;
FMOD_VECTOR up;
} FMOD_3D_ATTRIBUTES;
typedef struct FMOD_GUID
{
unsigned int Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} FMOD_GUID;
typedef struct FMOD_PLUGINLIST
{
FMOD_PLUGINTYPE type;
void *description;
} FMOD_PLUGINLIST;
typedef struct FMOD_ADVANCEDSETTINGS
{
int cbSize;
int maxMPEGCodecs;
int maxADPCMCodecs;
int maxXMACodecs;
int maxVorbisCodecs;
int maxAT9Codecs;
int maxFADPCMCodecs;
int maxPCMCodecs;
int ASIONumChannels;
char **ASIOChannelList;
FMOD_SPEAKER *ASIOSpeakerList;
float vol0virtualvol;
unsigned int defaultDecodeBufferSize;
unsigned short profilePort;
unsigned int geometryMaxFadeTime;
float distanceFilterCenterFreq;
int reverb3Dinstance;
int DSPBufferPoolSize;
unsigned int stackSizeStream;
unsigned int stackSizeNonBlocking;
unsigned int stackSizeMixer;
FMOD_DSP_RESAMPLER resamplerMethod;
unsigned int commandQueueSize;
unsigned int randomSeed;
} FMOD_ADVANCEDSETTINGS;
typedef struct FMOD_TAG
{
FMOD_TAGTYPE type;
FMOD_TAGDATATYPE datatype;
char *name;
void *data;
unsigned int datalen;
FMOD_BOOL updated;
} FMOD_TAG;
typedef struct FMOD_CREATESOUNDEXINFO
{
int cbsize;
unsigned int length;
unsigned int fileoffset;
int numchannels;
int defaultfrequency;
FMOD_SOUND_FORMAT format;
unsigned int decodebuffersize;
int initialsubsound;
int numsubsounds;
int *inclusionlist;
int inclusionlistnum;
FMOD_SOUND_PCMREAD_CALLBACK pcmreadcallback;
FMOD_SOUND_PCMSETPOS_CALLBACK pcmsetposcallback;
FMOD_SOUND_NONBLOCK_CALLBACK nonblockcallback;
const char *dlsname;
const char *encryptionkey;
int maxpolyphony;
void *userdata;
FMOD_SOUND_TYPE suggestedsoundtype;
FMOD_FILE_OPEN_CALLBACK fileuseropen;
FMOD_FILE_CLOSE_CALLBACK fileuserclose;
FMOD_FILE_READ_CALLBACK fileuserread;
FMOD_FILE_SEEK_CALLBACK fileuserseek;
FMOD_FILE_ASYNCREAD_CALLBACK fileuserasyncread;
FMOD_FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel;
void *fileuserdata;
int filebuffersize;
FMOD_CHANNELORDER channelorder;
FMOD_SOUNDGROUP *initialsoundgroup;
unsigned int initialseekposition;
FMOD_TIMEUNIT initialseekpostype;
int ignoresetfilesystem;
unsigned int audioqueuepolicy;
unsigned int minmidigranularity;
int nonblockthreadid;
FMOD_GUID *fsbguid;
} FMOD_CREATESOUNDEXINFO;
typedef struct FMOD_REVERB_PROPERTIES
{
float DecayTime;
float EarlyDelay;
float LateDelay;
float HFReference;
float HFDecayRatio;
float Diffusion;
float Density;
float LowShelfFrequency;
float LowShelfGain;
float HighCut;
float EarlyLateMix;
float WetLevel;
} FMOD_REVERB_PROPERTIES;
typedef struct FMOD_ERRORCALLBACK_INFO
{
FMOD_RESULT result;
FMOD_ERRORCALLBACK_INSTANCETYPE instancetype;
void *instance;
const char *functionname;
const char *functionparams;
} FMOD_ERRORCALLBACK_INFO;
/*
FMOD optional headers for plugin development
*/
#include "fmod_codec.h"
#include "fmod_dsp.h"
#include "fmod_output.h"
#endif

846
engine/fmodcore/inc/fmod_dsp.cs

@ -0,0 +1,846 @@
/* ======================================================================================== */
/* FMOD Core API - DSP header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header if you are wanting to develop your own DSP plugin to use with FMODs */
/* dsp system. With this header you can make your own DSP plugin that FMOD can */
/* register and use. See the documentation and examples on how to make a working plugin. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=plugin-api-dsp.html */
/* =========================================================================================*/
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace FMOD
{
[StructLayout(LayoutKind.Sequential)]
public struct DSP_BUFFER_ARRAY
{
public int numbuffers;
public int[] buffernumchannels;
public CHANNELMASK[] bufferchannelmask;
public IntPtr[] buffers;
public SPEAKERMODE speakermode;
}
public enum DSP_PROCESS_OPERATION
{
PROCESS_PERFORM = 0,
PROCESS_QUERY
}
[StructLayout(LayoutKind.Sequential)]
public struct COMPLEX
{
public float real;
public float imag;
}
public enum DSP_PAN_SURROUND_FLAGS
{
DEFAULT = 0,
ROTATION_NOT_BIASED = 1,
}
/*
DSP callbacks
*/
public delegate RESULT DSP_CREATECALLBACK (ref DSP_STATE dsp_state);
public delegate RESULT DSP_RELEASECALLBACK (ref DSP_STATE dsp_state);
public delegate RESULT DSP_RESETCALLBACK (ref DSP_STATE dsp_state);
public delegate RESULT DSP_SETPOSITIONCALLBACK (ref DSP_STATE dsp_state, uint pos);
public delegate RESULT DSP_READCALLBACK (ref DSP_STATE dsp_state, IntPtr inbuffer, IntPtr outbuffer, uint length, int inchannels, ref int outchannels);
public delegate RESULT DSP_SHOULDIPROCESS_CALLBACK (ref DSP_STATE dsp_state, bool inputsidle, uint length, CHANNELMASK inmask, int inchannels, SPEAKERMODE speakermode);
public delegate RESULT DSP_PROCESS_CALLBACK (ref DSP_STATE dsp_state, uint length, ref DSP_BUFFER_ARRAY inbufferarray, ref DSP_BUFFER_ARRAY outbufferarray, bool inputsidle, DSP_PROCESS_OPERATION op);
public delegate RESULT DSP_SETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, float value);
public delegate RESULT DSP_SETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, int value);
public delegate RESULT DSP_SETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, bool value);
public delegate RESULT DSP_SETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, IntPtr data, uint length);
public delegate RESULT DSP_GETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, ref float value, IntPtr valuestr);
public delegate RESULT DSP_GETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, ref int value, IntPtr valuestr);
public delegate RESULT DSP_GETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, ref bool value, IntPtr valuestr);
public delegate RESULT DSP_GETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, ref IntPtr data, ref uint length, IntPtr valuestr);
public delegate RESULT DSP_SYSTEM_REGISTER_CALLBACK (ref DSP_STATE dsp_state);
public delegate RESULT DSP_SYSTEM_DEREGISTER_CALLBACK (ref DSP_STATE dsp_state);
public delegate RESULT DSP_SYSTEM_MIX_CALLBACK (ref DSP_STATE dsp_state, int stage);
/*
DSP functions
*/
public delegate IntPtr DSP_ALLOC_FUNC (uint size, MEMORY_TYPE type, StringWrapper sourcestr);
public delegate IntPtr DSP_REALLOC_FUNC (IntPtr ptr, uint size, MEMORY_TYPE type, StringWrapper sourcestr);
public delegate void DSP_FREE_FUNC (IntPtr ptr, MEMORY_TYPE type, StringWrapper sourcestr);
public delegate void DSP_LOG_FUNC (DEBUG_FLAGS level, StringWrapper file, int line, StringWrapper function, StringWrapper format);
public delegate RESULT DSP_GETSAMPLERATE_FUNC (ref DSP_STATE dsp_state, ref int rate);
public delegate RESULT DSP_GETBLOCKSIZE_FUNC (ref DSP_STATE dsp_state, ref uint blocksize);
public delegate RESULT DSP_GETSPEAKERMODE_FUNC (ref DSP_STATE dsp_state, ref int speakermode_mixer, ref int speakermode_output);
public delegate RESULT DSP_GETCLOCK_FUNC (ref DSP_STATE dsp_state, out ulong clock, out uint offset, out uint length);
public delegate RESULT DSP_GETLISTENERATTRIBUTES_FUNC (ref DSP_STATE dsp_state, ref int numlisteners, IntPtr attributes);
public delegate RESULT DSP_GETUSERDATA_FUNC (ref DSP_STATE dsp_state, out IntPtr userdata);
public delegate RESULT DSP_DFT_FFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr signal, IntPtr dft, IntPtr window, int signalhop);
public delegate RESULT DSP_DFT_IFFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr dft, IntPtr signal, IntPtr window, int signalhop);
public delegate RESULT DSP_PAN_SUMMONOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, IntPtr matrix);
public delegate RESULT DSP_PAN_SUMSTEREOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix);
public delegate RESULT DSP_PAN_SUMSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix, DSP_PAN_SURROUND_FLAGS flags);
public delegate RESULT DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix);
public delegate RESULT DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix);
public delegate RESULT DSP_PAN_GETROLLOFFGAIN_FUNC (ref DSP_STATE dsp_state, DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, out float gain);
public enum DSP_TYPE : int
{
UNKNOWN,
MIXER,
OSCILLATOR,
LOWPASS,
ITLOWPASS,
HIGHPASS,
ECHO,
FADER,
FLANGE,
DISTORTION,
NORMALIZE,
LIMITER,
PARAMEQ,
PITCHSHIFT,
CHORUS,
VSTPLUGIN,
WINAMPPLUGIN,
ITECHO,
COMPRESSOR,
SFXREVERB,
LOWPASS_SIMPLE,
DELAY,
TREMOLO,
LADSPAPLUGIN,
SEND,
RETURN,
HIGHPASS_SIMPLE,
PAN,
THREE_EQ,
FFT,
LOUDNESS_METER,
ENVELOPEFOLLOWER,
CONVOLUTIONREVERB,
CHANNELMIX,
TRANSCEIVER,
OBJECTPAN,
MULTIBAND_EQ,
MAX
}
public enum DSP_PARAMETER_TYPE
{
FLOAT = 0,
INT,
BOOL,
DATA,
MAX
}
public enum DSP_PARAMETER_FLOAT_MAPPING_TYPE
{
DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR = 0,
DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO,
DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR,
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR
{
public int numpoints;
public IntPtr pointparamvalues;
public IntPtr pointpositions;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_FLOAT_MAPPING
{
public DSP_PARAMETER_FLOAT_MAPPING_TYPE type;
public DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_DESC_FLOAT
{
public float min;
public float max;
public float defaultval;
public DSP_PARAMETER_FLOAT_MAPPING mapping;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_DESC_INT
{
public int min;
public int max;
public int defaultval;
public bool goestoinf;
public IntPtr valuenames;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_DESC_BOOL
{
public bool defaultval;
public IntPtr valuenames;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_DESC_DATA
{
public int datatype;
}
[StructLayout(LayoutKind.Explicit)]
public struct DSP_PARAMETER_DESC_UNION
{
[FieldOffset(0)]
public DSP_PARAMETER_DESC_FLOAT floatdesc;
[FieldOffset(0)]
public DSP_PARAMETER_DESC_INT intdesc;
[FieldOffset(0)]
public DSP_PARAMETER_DESC_BOOL booldesc;
[FieldOffset(0)]
public DSP_PARAMETER_DESC_DATA datadesc;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_DESC
{
public DSP_PARAMETER_TYPE type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] name;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] label;
public string description;
public DSP_PARAMETER_DESC_UNION desc;
}
public enum DSP_PARAMETER_DATA_TYPE
{
DSP_PARAMETER_DATA_TYPE_USER = 0,
DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1,
DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2,
DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3,
DSP_PARAMETER_DATA_TYPE_FFT = -4,
DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_OVERALLGAIN
{
public float linear_gain;
public float linear_gain_additive;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_3DATTRIBUTES
{
public ATTRIBUTES_3D relative;
public ATTRIBUTES_3D absolute;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_3DATTRIBUTES_MULTI
{
public int numlisteners;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public ATTRIBUTES_3D[] relative;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public float[] weight;
public ATTRIBUTES_3D absolute;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_SIDECHAIN
{
public int sidechainenable;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_PARAMETER_FFT
{
public int length;
public int numchannels;
[MarshalAs(UnmanagedType.ByValArray,SizeConst=32)]
private IntPtr[] spectrum_internal;
public float[][] spectrum
{
get
{
var buffer = new float[numchannels][];
for (int i = 0; i < numchannels; ++i)
{
buffer[i] = new float[length];
Marshal.Copy(spectrum_internal[i], buffer[i], 0, length);
}
return buffer;
}
}
public void getSpectrum(ref float[][] buffer)
{
int bufferLength = Math.Min(buffer.Length, numchannels);
for (int i = 0; i < bufferLength; ++i)
{
getSpectrum(i, ref buffer[i]);
}
}
public void getSpectrum(int channel, ref float[] buffer)
{
int bufferLength = Math.Min(buffer.Length, length);
Marshal.Copy(spectrum_internal[channel], buffer, 0, bufferLength);
}
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_DESCRIPTION
{
public uint pluginsdkversion;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] name;
public uint version;
public int numinputbuffers;
public int numoutputbuffers;
public DSP_CREATECALLBACK create;
public DSP_RELEASECALLBACK release;
public DSP_RESETCALLBACK reset;
public DSP_READCALLBACK read;
public DSP_PROCESS_CALLBACK process;
public DSP_SETPOSITIONCALLBACK setposition;
public int numparameters;
public IntPtr paramdesc;
public DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat;
public DSP_SETPARAM_INT_CALLBACK setparameterint;
public DSP_SETPARAM_BOOL_CALLBACK setparameterbool;
public DSP_SETPARAM_DATA_CALLBACK setparameterdata;
public DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat;
public DSP_GETPARAM_INT_CALLBACK getparameterint;
public DSP_GETPARAM_BOOL_CALLBACK getparameterbool;
public DSP_GETPARAM_DATA_CALLBACK getparameterdata;
public DSP_SHOULDIPROCESS_CALLBACK shouldiprocess;
public IntPtr userdata;
public DSP_SYSTEM_REGISTER_CALLBACK sys_register;
public DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister;
public DSP_SYSTEM_MIX_CALLBACK sys_mix;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_STATE_DFT_FUNCTIONS
{
public DSP_DFT_FFTREAL_FUNC fftreal;
public DSP_DFT_IFFTREAL_FUNC inversefftreal;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_STATE_PAN_FUNCTIONS
{
public DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix;
public DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix;
public DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix;
public DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix;
public DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix;
public DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_STATE_FUNCTIONS
{
public DSP_ALLOC_FUNC alloc;
public DSP_REALLOC_FUNC realloc;
public DSP_FREE_FUNC free;
public DSP_GETSAMPLERATE_FUNC getsamplerate;
public DSP_GETBLOCKSIZE_FUNC getblocksize;
public IntPtr dft;
public IntPtr pan;
public DSP_GETSPEAKERMODE_FUNC getspeakermode;
public DSP_GETCLOCK_FUNC getclock;
public DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes;
public DSP_LOG_FUNC log;
public DSP_GETUSERDATA_FUNC getuserdata;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_STATE
{
public IntPtr instance;
public IntPtr plugindata;
public uint channelmask;
public int source_speakermode;
public IntPtr sidechaindata;
public int sidechainchannels;
public IntPtr functions;
public int systemobject;
}
[StructLayout(LayoutKind.Sequential)]
public struct DSP_METERING_INFO
{
public int numsamples;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=32)]
public float[] peaklevel;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=32)]
public float[] rmslevel;
public short numchannels;
}
/*
==============================================================================================================
FMOD built in effect parameters.
Use DSP::setParameter with these enums for the 'index' parameter.
==============================================================================================================
*/
public enum DSP_OSCILLATOR : int
{
TYPE,
RATE
}
public enum DSP_LOWPASS : int
{
CUTOFF,
RESONANCE
}
public enum DSP_ITLOWPASS : int
{
CUTOFF,
RESONANCE
}
public enum DSP_HIGHPASS : int
{
CUTOFF,
RESONANCE
}
public enum DSP_ECHO : int
{
DELAY,
FEEDBACK,
DRYLEVEL,
WETLEVEL
}
public enum DSP_FADER : int
{
GAIN,
OVERALL_GAIN,
}
public enum DSP_DELAY : int
{
CH0,
CH1,
CH2,
CH3,
CH4,
CH5,
CH6,
CH7,
CH8,
CH9,
CH10,
CH11,
CH12,
CH13,
CH14,
CH15,
MAXDELAY,
}
public enum DSP_FLANGE : int
{
MIX,
DEPTH,
RATE
}
public enum DSP_TREMOLO : int
{
FREQUENCY,
DEPTH,
SHAPE,
SKEW,
DUTY,
SQUARE,
PHASE,
SPREAD
}
public enum DSP_DISTORTION : int
{
LEVEL
}
public enum DSP_NORMALIZE : int
{
FADETIME,
THRESHHOLD,
MAXAMP
}
public enum DSP_LIMITER : int
{
RELEASETIME,
CEILING,
MAXIMIZERGAIN,
MODE,
}
public enum DSP_PARAMEQ : int
{
CENTER,
BANDWIDTH,
GAIN
}
public enum DSP_MULTIBAND_EQ : int
{
A_FILTER,
A_FREQUENCY,
A_Q,
A_GAIN,
B_FILTER,
B_FREQUENCY,
B_Q,
B_GAIN,
C_FILTER,
C_FREQUENCY,
C_Q,
C_GAIN,
D_FILTER,
D_FREQUENCY,
D_Q,
D_GAIN,
E_FILTER,
E_FREQUENCY,
E_Q,
E_GAIN,
}
public enum DSP_MULTIBAND_EQ_FILTER_TYPE : int
{
DISABLED,
LOWPASS_12DB,
LOWPASS_24DB,
LOWPASS_48DB,
HIGHPASS_12DB,
HIGHPASS_24DB,
HIGHPASS_48DB,
LOWSHELF,
HIGHSHELF,
PEAKING,
BANDPASS,
NOTCH,
ALLPASS,
}
public enum DSP_PITCHSHIFT : int
{
PITCH,
FFTSIZE,
OVERLAP,
MAXCHANNELS
}
public enum DSP_CHORUS : int
{
MIX,
RATE,
DEPTH,
}
public enum DSP_ITECHO : int
{
WETDRYMIX,
FEEDBACK,
LEFTDELAY,
RIGHTDELAY,
PANDELAY
}
public enum DSP_COMPRESSOR : int
{
THRESHOLD,
RATIO,
ATTACK,
RELEASE,
GAINMAKEUP,
USESIDECHAIN,
LINKED
}
public enum DSP_SFXREVERB : int
{
DECAYTIME,
EARLYDELAY,
LATEDELAY,
HFREFERENCE,
HFDECAYRATIO,
DIFFUSION,
DENSITY,
LOWSHELFFREQUENCY,
LOWSHELFGAIN,
HIGHCUT,
EARLYLATEMIX,
WETLEVEL,
DRYLEVEL
}
public enum DSP_LOWPASS_SIMPLE : int
{
CUTOFF
}
public enum DSP_SEND : int
{
RETURNID,
LEVEL,
}
public enum DSP_RETURN : int
{
ID,
INPUT_SPEAKER_MODE
}
public enum DSP_HIGHPASS_SIMPLE : int
{
CUTOFF
}
public enum DSP_PAN_2D_STEREO_MODE_TYPE : int
{
DISTRIBUTED,
DISCRETE
}
public enum DSP_PAN_MODE_TYPE : int
{
MONO,
STEREO,
SURROUND
}
public enum DSP_PAN_3D_ROLLOFF_TYPE : int
{
LINEARSQUARED,
LINEAR,
INVERSE,
INVERSETAPERED,
CUSTOM
}
public enum DSP_PAN_3D_EXTENT_MODE_TYPE : int
{
AUTO,
USER,
OFF
}
public enum DSP_PAN : int
{
MODE,
_2D_STEREO_POSITION,
_2D_DIRECTION,
_2D_EXTENT,
_2D_ROTATION,
_2D_LFE_LEVEL,
_2D_STEREO_MODE,
_2D_STEREO_SEPARATION,
_2D_STEREO_AXIS,
ENABLED_SPEAKERS,
_3D_POSITION,
_3D_ROLLOFF,
_3D_MIN_DISTANCE,
_3D_MAX_DISTANCE,
_3D_EXTENT_MODE,
_3D_SOUND_SIZE,
_3D_MIN_EXTENT,
_3D_PAN_BLEND,
LFE_UPMIX_ENABLED,
OVERALL_GAIN,
SURROUND_SPEAKER_MODE,
_2D_HEIGHT_BLEND,
}
public enum DSP_THREE_EQ_CROSSOVERSLOPE_TYPE : int
{
_12DB,
_24DB,
_48DB
}
public enum DSP_THREE_EQ : int
{
LOWGAIN,
MIDGAIN,
HIGHGAIN,
LOWCROSSOVER,
HIGHCROSSOVER,
CROSSOVERSLOPE
}
public enum DSP_FFT_WINDOW : int
{
RECT,
TRIANGLE,
HAMMING,
HANNING,
BLACKMAN,
BLACKMANHARRIS
}
public enum DSP_FFT : int
{
WINDOWSIZE,
WINDOWTYPE,
SPECTRUMDATA,
DOMINANT_FREQ
}
public enum DSP_ENVELOPEFOLLOWER : int
{
ATTACK,
RELEASE,
ENVELOPE,
USESIDECHAIN
}
public enum DSP_CONVOLUTION_REVERB : int
{
IR,
WET,
DRY,
LINKED
}
public enum DSP_CHANNELMIX_OUTPUT : int
{
DEFAULT,
ALLMONO,
ALLSTEREO,
ALLQUAD,
ALL5POINT1,
ALL7POINT1,
ALLLFE,
ALL7POINT1POINT4
}
public enum DSP_CHANNELMIX : int
{
OUTPUTGROUPING,
GAIN_CH0,
GAIN_CH1,
GAIN_CH2,
GAIN_CH3,
GAIN_CH4,
GAIN_CH5,
GAIN_CH6,
GAIN_CH7,
GAIN_CH8,
GAIN_CH9,
GAIN_CH10,
GAIN_CH11,
GAIN_CH12,
GAIN_CH13,
GAIN_CH14,
GAIN_CH15,
GAIN_CH16,
GAIN_CH17,
GAIN_CH18,
GAIN_CH19,
GAIN_CH20,
GAIN_CH21,
GAIN_CH22,
GAIN_CH23,
GAIN_CH24,
GAIN_CH25,
GAIN_CH26,
GAIN_CH27,
GAIN_CH28,
GAIN_CH29,
GAIN_CH30,
GAIN_CH31,
OUTPUT_CH0,
OUTPUT_CH1,
OUTPUT_CH2,
OUTPUT_CH3,
OUTPUT_CH4,
OUTPUT_CH5,
OUTPUT_CH6,
OUTPUT_CH7,
OUTPUT_CH8,
OUTPUT_CH9,
OUTPUT_CH10,
OUTPUT_CH11,
OUTPUT_CH12,
OUTPUT_CH13,
OUTPUT_CH14,
OUTPUT_CH15,
OUTPUT_CH16,
OUTPUT_CH17,
OUTPUT_CH18,
OUTPUT_CH19,
OUTPUT_CH20,
OUTPUT_CH21,
OUTPUT_CH22,
OUTPUT_CH23,
OUTPUT_CH24,
OUTPUT_CH25,
OUTPUT_CH26,
OUTPUT_CH27,
OUTPUT_CH28,
OUTPUT_CH29,
OUTPUT_CH30,
OUTPUT_CH31,
}
public enum DSP_TRANSCEIVER_SPEAKERMODE : int
{
AUTO = -1,
MONO = 0,
STEREO,
SURROUND,
}
public enum DSP_TRANSCEIVER : int
{
TRANSMIT,
GAIN,
CHANNEL,
TRANSMITSPEAKERMODE
}
public enum DSP_OBJECTPAN : int
{
_3D_POSITION,
_3D_ROLLOFF,
_3D_MIN_DISTANCE,
_3D_MAX_DISTANCE,
_3D_EXTENT_MODE,
_3D_SOUND_SIZE,
_3D_MIN_EXTENT,
OVERALL_GAIN,
OUTPUTGAIN
}
}

414
engine/fmodcore/inc/fmod_dsp.h

@ -0,0 +1,414 @@
/* ======================================================================================== */
/* FMOD Core API - DSP header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header if you are wanting to develop your own DSP plugin to use with FMODs */
/* dsp system. With this header you can make your own DSP plugin that FMOD can */
/* register and use. See the documentation and examples on how to make a working plugin. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=plugin-api-dsp.html */
/* =========================================================================================*/
#ifndef _FMOD_DSP_H
#define _FMOD_DSP_H
#include "fmod_dsp_effects.h"
typedef struct FMOD_DSP_STATE FMOD_DSP_STATE;
typedef struct FMOD_DSP_BUFFER_ARRAY FMOD_DSP_BUFFER_ARRAY;
typedef struct FMOD_COMPLEX FMOD_COMPLEX;
/*
DSP Constants
*/
#define FMOD_PLUGIN_SDK_VERSION 110
#define FMOD_DSP_GETPARAM_VALUESTR_LENGTH 32
typedef enum
{
FMOD_DSP_PROCESS_PERFORM,
FMOD_DSP_PROCESS_QUERY
} FMOD_DSP_PROCESS_OPERATION;
typedef enum FMOD_DSP_PAN_SURROUND_FLAGS
{
FMOD_DSP_PAN_SURROUND_DEFAULT = 0,
FMOD_DSP_PAN_SURROUND_ROTATION_NOT_BIASED = 1,
FMOD_DSP_PAN_SURROUND_FLAGS_FORCEINT = 65536
} FMOD_DSP_PAN_SURROUND_FLAGS;
typedef enum
{
FMOD_DSP_PARAMETER_TYPE_FLOAT,
FMOD_DSP_PARAMETER_TYPE_INT,
FMOD_DSP_PARAMETER_TYPE_BOOL,
FMOD_DSP_PARAMETER_TYPE_DATA,
FMOD_DSP_PARAMETER_TYPE_MAX,
FMOD_DSP_PARAMETER_TYPE_FORCEINT = 65536
} FMOD_DSP_PARAMETER_TYPE;
typedef enum
{
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR,
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO,
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR,
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_FORCEINT = 65536
} FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE;
typedef enum
{
FMOD_DSP_PARAMETER_DATA_TYPE_USER = 0,
FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1,
FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2,
FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3,
FMOD_DSP_PARAMETER_DATA_TYPE_FFT = -4,
FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5,
} FMOD_DSP_PARAMETER_DATA_TYPE;
/*
DSP Callbacks
*/
typedef FMOD_RESULT (F_CALL *FMOD_DSP_CREATE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_RELEASE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_RESET_CALLBACK) (FMOD_DSP_STATE *dsp_state);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_READ_CALLBACK) (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_PROCESS_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int length, const FMOD_DSP_BUFFER_ARRAY *inbufferarray, FMOD_DSP_BUFFER_ARRAY *outbufferarray, FMOD_BOOL inputsidle, FMOD_DSP_PROCESS_OPERATION op);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPOSITION_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int pos);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SHOULDIPROCESS_CALLBACK) (FMOD_DSP_STATE *dsp_state, FMOD_BOOL inputsidle, unsigned int length, FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE speakermode);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float value);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int value);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL value);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void *data, unsigned int length);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int *value, char *valuestr);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL *value, char *valuestr);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void **data, unsigned int *length, char *valuestr);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_REGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_MIX_CALLBACK) (FMOD_DSP_STATE *dsp_state, int stage);
/*
DSP Functions
*/
typedef void * (F_CALL *FMOD_DSP_ALLOC_FUNC) (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
typedef void * (F_CALL *FMOD_DSP_REALLOC_FUNC) (void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
typedef void (F_CALL *FMOD_DSP_FREE_FUNC) (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr);
typedef void (F_CALL *FMOD_DSP_LOG_FUNC) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETSAMPLERATE_FUNC) (FMOD_DSP_STATE *dsp_state, int *rate);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETBLOCKSIZE_FUNC) (FMOD_DSP_STATE *dsp_state, unsigned int *blocksize);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETSPEAKERMODE_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE *speakermode_mixer, FMOD_SPEAKERMODE *speakermode_output);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETCLOCK_FUNC) (FMOD_DSP_STATE *dsp_state, unsigned long long *clock, unsigned int *offset, unsigned int *length);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETLISTENERATTRIBUTES_FUNC) (FMOD_DSP_STATE *dsp_state, int *numlisteners, FMOD_3D_ATTRIBUTES *attributes);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETUSERDATA_FUNC) (FMOD_DSP_STATE *dsp_state, void **userdata);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_DFT_FFTREAL_FUNC) (FMOD_DSP_STATE *dsp_state, int size, const float *signal, FMOD_COMPLEX* dft, const float *window, int signalhop);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_DFT_IFFTREAL_FUNC) (FMOD_DSP_STATE *dsp_state, int size, const FMOD_COMPLEX *dft, float* signal, const float *window, int signalhop);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMMONOMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE sourceSpeakerMode, float lowFrequencyGain, float overallGain, float *matrix);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMSTEREOMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMSURROUNDMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE sourceSpeakerMode, FMOD_SPEAKERMODE targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix, FMOD_DSP_PAN_SURROUND_FLAGS flags);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_GETROLLOFFGAIN_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, float *gain);
/*
DSP Structures
*/
struct FMOD_DSP_BUFFER_ARRAY
{
int numbuffers;
int *buffernumchannels;
FMOD_CHANNELMASK *bufferchannelmask;
float **buffers;
FMOD_SPEAKERMODE speakermode;
};
struct FMOD_COMPLEX
{
float real;
float imag;
};
typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR
{
int numpoints;
float *pointparamvalues;
float *pointpositions;
} FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR;
typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING
{
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE type;
FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping;
} FMOD_DSP_PARAMETER_FLOAT_MAPPING;
typedef struct FMOD_DSP_PARAMETER_DESC_FLOAT
{
float min;
float max;
float defaultval;
FMOD_DSP_PARAMETER_FLOAT_MAPPING mapping;
} FMOD_DSP_PARAMETER_DESC_FLOAT;
typedef struct FMOD_DSP_PARAMETER_DESC_INT
{
int min;
int max;
int defaultval;
FMOD_BOOL goestoinf;
const char* const* valuenames;
} FMOD_DSP_PARAMETER_DESC_INT;
typedef struct FMOD_DSP_PARAMETER_DESC_BOOL
{
FMOD_BOOL defaultval;
const char* const* valuenames;
} FMOD_DSP_PARAMETER_DESC_BOOL;
typedef struct FMOD_DSP_PARAMETER_DESC_DATA
{
int datatype;
} FMOD_DSP_PARAMETER_DESC_DATA;
typedef struct FMOD_DSP_PARAMETER_DESC
{
FMOD_DSP_PARAMETER_TYPE type;
char name[16];
char label[16];
const char *description;
union
{
FMOD_DSP_PARAMETER_DESC_FLOAT floatdesc;
FMOD_DSP_PARAMETER_DESC_INT intdesc;
FMOD_DSP_PARAMETER_DESC_BOOL booldesc;
FMOD_DSP_PARAMETER_DESC_DATA datadesc;
};
} FMOD_DSP_PARAMETER_DESC;
typedef struct FMOD_DSP_PARAMETER_OVERALLGAIN
{
float linear_gain;
float linear_gain_additive;
} FMOD_DSP_PARAMETER_OVERALLGAIN;
typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES
{
FMOD_3D_ATTRIBUTES relative;
FMOD_3D_ATTRIBUTES absolute;
} FMOD_DSP_PARAMETER_3DATTRIBUTES;
typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI
{
int numlisteners;
FMOD_3D_ATTRIBUTES relative[FMOD_MAX_LISTENERS];
float weight[FMOD_MAX_LISTENERS];
FMOD_3D_ATTRIBUTES absolute;
} FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI;
typedef struct FMOD_DSP_PARAMETER_SIDECHAIN
{
FMOD_BOOL sidechainenable;
} FMOD_DSP_PARAMETER_SIDECHAIN;
typedef struct FMOD_DSP_PARAMETER_FFT
{
int length;
int numchannels;
float *spectrum[32];
} FMOD_DSP_PARAMETER_FFT;
typedef struct FMOD_DSP_DESCRIPTION
{
unsigned int pluginsdkversion;
char name[32];
unsigned int version;
int numinputbuffers;
int numoutputbuffers;
FMOD_DSP_CREATE_CALLBACK create;
FMOD_DSP_RELEASE_CALLBACK release;
FMOD_DSP_RESET_CALLBACK reset;
FMOD_DSP_READ_CALLBACK read;
FMOD_DSP_PROCESS_CALLBACK process;
FMOD_DSP_SETPOSITION_CALLBACK setposition;
int numparameters;
FMOD_DSP_PARAMETER_DESC **paramdesc;
FMOD_DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat;
FMOD_DSP_SETPARAM_INT_CALLBACK setparameterint;
FMOD_DSP_SETPARAM_BOOL_CALLBACK setparameterbool;
FMOD_DSP_SETPARAM_DATA_CALLBACK setparameterdata;
FMOD_DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat;
FMOD_DSP_GETPARAM_INT_CALLBACK getparameterint;
FMOD_DSP_GETPARAM_BOOL_CALLBACK getparameterbool;
FMOD_DSP_GETPARAM_DATA_CALLBACK getparameterdata;
FMOD_DSP_SHOULDIPROCESS_CALLBACK shouldiprocess;
void *userdata;
FMOD_DSP_SYSTEM_REGISTER_CALLBACK sys_register;
FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister;
FMOD_DSP_SYSTEM_MIX_CALLBACK sys_mix;
} FMOD_DSP_DESCRIPTION;
typedef struct FMOD_DSP_STATE_DFT_FUNCTIONS
{
FMOD_DSP_DFT_FFTREAL_FUNC fftreal;
FMOD_DSP_DFT_IFFTREAL_FUNC inversefftreal;
} FMOD_DSP_STATE_DFT_FUNCTIONS;
typedef struct FMOD_DSP_STATE_PAN_FUNCTIONS
{
FMOD_DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix;
FMOD_DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix;
FMOD_DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix;
FMOD_DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix;
FMOD_DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix;
FMOD_DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain;
} FMOD_DSP_STATE_PAN_FUNCTIONS;
typedef struct FMOD_DSP_STATE_FUNCTIONS
{
FMOD_DSP_ALLOC_FUNC alloc;
FMOD_DSP_REALLOC_FUNC realloc;
FMOD_DSP_FREE_FUNC free;
FMOD_DSP_GETSAMPLERATE_FUNC getsamplerate;
FMOD_DSP_GETBLOCKSIZE_FUNC getblocksize;
FMOD_DSP_STATE_DFT_FUNCTIONS *dft;
FMOD_DSP_STATE_PAN_FUNCTIONS *pan;
FMOD_DSP_GETSPEAKERMODE_FUNC getspeakermode;
FMOD_DSP_GETCLOCK_FUNC getclock;
FMOD_DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes;
FMOD_DSP_LOG_FUNC log;
FMOD_DSP_GETUSERDATA_FUNC getuserdata;
} FMOD_DSP_STATE_FUNCTIONS;
struct FMOD_DSP_STATE
{
void *instance;
void *plugindata;
FMOD_CHANNELMASK channelmask;
FMOD_SPEAKERMODE source_speakermode;
float *sidechaindata;
int sidechainchannels;
FMOD_DSP_STATE_FUNCTIONS *functions;
int systemobject;
};
typedef struct FMOD_DSP_METERING_INFO
{
int numsamples;
float peaklevel[32];
float rmslevel[32];
short numchannels;
} FMOD_DSP_METERING_INFO;
/*
DSP Macros
*/
#define FMOD_DSP_INIT_PARAMDESC_FLOAT(_paramstruct, _name, _label, _description, _min, _max, _defaultval) \
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \
strncpy((_paramstruct).name, _name, 15); \
strncpy((_paramstruct).label, _label, 15); \
(_paramstruct).description = _description; \
(_paramstruct).floatdesc.min = _min; \
(_paramstruct).floatdesc.max = _max; \
(_paramstruct).floatdesc.defaultval = _defaultval; \
(_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO;
#define FMOD_DSP_INIT_PARAMDESC_FLOAT_WITH_MAPPING(_paramstruct, _name, _label, _description, _defaultval, _values, _positions); \
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \
strncpy((_paramstruct).name, _name , 15); \
strncpy((_paramstruct).label, _label, 15); \
(_paramstruct).description = _description; \
(_paramstruct).floatdesc.min = _values[0]; \
(_paramstruct).floatdesc.max = _values[sizeof(_values) / sizeof(float) - 1]; \
(_paramstruct).floatdesc.defaultval = _defaultval; \
(_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR; \
(_paramstruct).floatdesc.mapping.piecewiselinearmapping.numpoints = sizeof(_values) / sizeof(float); \
(_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointparamvalues = _values; \
(_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointpositions = _positions;
#define FMOD_DSP_INIT_PARAMDESC_INT(_paramstruct, _name, _label, _description, _min, _max, _defaultval, _goestoinf, _valuenames) \
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \
strncpy((_paramstruct).name, _name , 15); \
strncpy((_paramstruct).label, _label, 15); \
(_paramstruct).description = _description; \
(_paramstruct).intdesc.min = _min; \
(_paramstruct).intdesc.max = _max; \
(_paramstruct).intdesc.defaultval = _defaultval; \
(_paramstruct).intdesc.goestoinf = _goestoinf; \
(_paramstruct).intdesc.valuenames = _valuenames;
#define FMOD_DSP_INIT_PARAMDESC_INT_ENUMERATED(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \
strncpy((_paramstruct).name, _name , 15); \
strncpy((_paramstruct).label, _label, 15); \
(_paramstruct).description = _description; \
(_paramstruct).intdesc.min = 0; \
(_paramstruct).intdesc.max = sizeof(_valuenames) / sizeof(char*) - 1; \
(_paramstruct).intdesc.defaultval = _defaultval; \
(_paramstruct).intdesc.goestoinf = false; \
(_paramstruct).intdesc.valuenames = _valuenames;
#define FMOD_DSP_INIT_PARAMDESC_BOOL(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_BOOL; \
strncpy((_paramstruct).name, _name , 15); \
strncpy((_paramstruct).label, _label, 15); \
(_paramstruct).description = _description; \
(_paramstruct).booldesc.defaultval = _defaultval; \
(_paramstruct).booldesc.valuenames = _valuenames;
#define FMOD_DSP_INIT_PARAMDESC_DATA(_paramstruct, _name, _label, _description, _datatype) \
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_DATA; \
strncpy((_paramstruct).name, _name , 15); \
strncpy((_paramstruct).label, _label, 15); \
(_paramstruct).description = _description; \
(_paramstruct).datadesc.datatype = _datatype;
#define FMOD_DSP_ALLOC(_state, _size) \
(_state)->functions->alloc(_size, FMOD_MEMORY_NORMAL, __FILE__)
#define FMOD_DSP_REALLOC(_state, _ptr, _size) \
(_state)->functions->realloc(_ptr, _size, FMOD_MEMORY_NORMAL, __FILE__)
#define FMOD_DSP_FREE(_state, _ptr) \
(_state)->functions->free(_ptr, FMOD_MEMORY_NORMAL, __FILE__)
#define FMOD_DSP_LOG(_state, _level, _location, _format, ...) \
(_state)->functions->log(_level, __FILE__, __LINE__, _location, _format, __VA_ARGS__)
#define FMOD_DSP_GETSAMPLERATE(_state, _rate) \
(_state)->functions->getsamplerate(_state, _rate)
#define FMOD_DSP_GETBLOCKSIZE(_state, _blocksize) \
(_state)->functions->getblocksize(_state, _blocksize)
#define FMOD_DSP_GETSPEAKERMODE(_state, _speakermodemix, _speakermodeout) \
(_state)->functions->getspeakermode(_state, _speakermodemix, _speakermodeout)
#define FMOD_DSP_GETCLOCK(_state, _clock, _offset, _length) \
(_state)->functions->getclock(_state, _clock, _offset, _length)
#define FMOD_DSP_GETLISTENERATTRIBUTES(_state, _numlisteners, _attributes) \
(_state)->functions->getlistenerattributes(_state, _numlisteners, _attributes)
#define FMOD_DSP_GETUSERDATA(_state, _userdata) \
(_state)->functions->getuserdata(_state, _userdata)
#define FMOD_DSP_DFT_FFTREAL(_state, _size, _signal, _dft, _window, _signalhop) \
(_state)->functions->dft->fftreal(_state, _size, _signal, _dft, _window, _signalhop)
#define FMOD_DSP_DFT_IFFTREAL(_state, _size, _dft, _signal, _window, _signalhop) \
(_state)->functions->dft->inversefftreal(_state, _size, _dft, _signal, _window, _signalhop)
#define FMOD_DSP_PAN_SUMMONOMATRIX(_state, _sourcespeakermode, _lowfrequencygain, _overallgain, _matrix) \
(_state)->functions->pan->summonomatrix(_state, _sourcespeakermode, _lowfrequencygain, _overallgain, _matrix)
#define FMOD_DSP_PAN_SUMSTEREOMATRIX(_state, _sourcespeakermode, _pan, _lowfrequencygain, _overallgain, _matrixhop, _matrix) \
(_state)->functions->pan->sumstereomatrix(_state, _sourcespeakermode, _pan, _lowfrequencygain, _overallgain, _matrixhop, _matrix)
#define FMOD_DSP_PAN_SUMSURROUNDMATRIX(_state, _sourcespeakermode, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, _matrixhop, _matrix, _flags) \
(_state)->functions->pan->sumsurroundmatrix(_state, _sourcespeakermode, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, _matrixhop, _matrix, _flags)
#define FMOD_DSP_PAN_SUMMONOTOSURROUNDMATRIX(_state, _targetspeakermode, _direction, _extent, _lowfrequencygain, _overallgain, _matrixhop, _matrix) \
(_state)->functions->pan->summonotosurroundmatrix(_state, _targetspeakermode, _direction, _extent, _lowfrequencygain, _overallgain, _matrixhop, _matrix)
#define FMOD_DSP_PAN_SUMSTEREOTOSURROUNDMATRIX(_state, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, matrixhop, _matrix) \
(_state)->functions->pan->sumstereotosurroundmatrix(_state, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, matrixhop, _matrix)
#define FMOD_DSP_PAN_GETROLLOFFGAIN(_state, _rolloff, _distance, _mindistance, _maxdistance, _gain) \
(_state)->functions->pan->getrolloffgain(_state, _rolloff, _distance, _mindistance, _maxdistance, _gain)
#endif

537
engine/fmodcore/inc/fmod_dsp_effects.h

@ -0,0 +1,537 @@
/* ============================================================================================================= */
/* FMOD Core API - Built-in effects header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* In this header you can find parameter structures for FMOD system registered DSP effects */
/* and generators. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common-dsp-effects.html#fmod_dsp_type */
/* ============================================================================================================= */
#ifndef _FMOD_DSP_EFFECTS_H
#define _FMOD_DSP_EFFECTS_H
typedef enum
{
FMOD_DSP_TYPE_UNKNOWN,
FMOD_DSP_TYPE_MIXER,
FMOD_DSP_TYPE_OSCILLATOR,
FMOD_DSP_TYPE_LOWPASS,
FMOD_DSP_TYPE_ITLOWPASS,
FMOD_DSP_TYPE_HIGHPASS,
FMOD_DSP_TYPE_ECHO,
FMOD_DSP_TYPE_FADER,
FMOD_DSP_TYPE_FLANGE,
FMOD_DSP_TYPE_DISTORTION,
FMOD_DSP_TYPE_NORMALIZE,
FMOD_DSP_TYPE_LIMITER,
FMOD_DSP_TYPE_PARAMEQ,
FMOD_DSP_TYPE_PITCHSHIFT,
FMOD_DSP_TYPE_CHORUS,
FMOD_DSP_TYPE_VSTPLUGIN,
FMOD_DSP_TYPE_WINAMPPLUGIN,
FMOD_DSP_TYPE_ITECHO,
FMOD_DSP_TYPE_COMPRESSOR,
FMOD_DSP_TYPE_SFXREVERB,
FMOD_DSP_TYPE_LOWPASS_SIMPLE,
FMOD_DSP_TYPE_DELAY,
FMOD_DSP_TYPE_TREMOLO,
FMOD_DSP_TYPE_LADSPAPLUGIN,
FMOD_DSP_TYPE_SEND,
FMOD_DSP_TYPE_RETURN,
FMOD_DSP_TYPE_HIGHPASS_SIMPLE,
FMOD_DSP_TYPE_PAN,
FMOD_DSP_TYPE_THREE_EQ,
FMOD_DSP_TYPE_FFT,
FMOD_DSP_TYPE_LOUDNESS_METER,
FMOD_DSP_TYPE_ENVELOPEFOLLOWER,
FMOD_DSP_TYPE_CONVOLUTIONREVERB,
FMOD_DSP_TYPE_CHANNELMIX,
FMOD_DSP_TYPE_TRANSCEIVER,
FMOD_DSP_TYPE_OBJECTPAN,
FMOD_DSP_TYPE_MULTIBAND_EQ,
FMOD_DSP_TYPE_MAX,
FMOD_DSP_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
} FMOD_DSP_TYPE;
/*
===================================================================================================
FMOD built in effect parameters.
Use DSP::setParameter with these enums for the 'index' parameter.
===================================================================================================
*/
typedef enum
{
FMOD_DSP_OSCILLATOR_TYPE,
FMOD_DSP_OSCILLATOR_RATE
} FMOD_DSP_OSCILLATOR;
typedef enum
{
FMOD_DSP_LOWPASS_CUTOFF,
FMOD_DSP_LOWPASS_RESONANCE
} FMOD_DSP_LOWPASS;
typedef enum
{
FMOD_DSP_ITLOWPASS_CUTOFF,
FMOD_DSP_ITLOWPASS_RESONANCE
} FMOD_DSP_ITLOWPASS;
typedef enum
{
FMOD_DSP_HIGHPASS_CUTOFF,
FMOD_DSP_HIGHPASS_RESONANCE
} FMOD_DSP_HIGHPASS;
typedef enum
{
FMOD_DSP_ECHO_DELAY,
FMOD_DSP_ECHO_FEEDBACK,
FMOD_DSP_ECHO_DRYLEVEL,
FMOD_DSP_ECHO_WETLEVEL
} FMOD_DSP_ECHO;
typedef enum FMOD_DSP_FADER
{
FMOD_DSP_FADER_GAIN,
FMOD_DSP_FADER_OVERALL_GAIN,
} FMOD_DSP_FADER;
typedef enum
{
FMOD_DSP_FLANGE_MIX,
FMOD_DSP_FLANGE_DEPTH,
FMOD_DSP_FLANGE_RATE
} FMOD_DSP_FLANGE;
typedef enum
{
FMOD_DSP_DISTORTION_LEVEL
} FMOD_DSP_DISTORTION;
typedef enum
{
FMOD_DSP_NORMALIZE_FADETIME,
FMOD_DSP_NORMALIZE_THRESHHOLD,
FMOD_DSP_NORMALIZE_MAXAMP
} FMOD_DSP_NORMALIZE;
typedef enum
{
FMOD_DSP_LIMITER_RELEASETIME,
FMOD_DSP_LIMITER_CEILING,
FMOD_DSP_LIMITER_MAXIMIZERGAIN,
FMOD_DSP_LIMITER_MODE,
} FMOD_DSP_LIMITER;
typedef enum
{
FMOD_DSP_PARAMEQ_CENTER,
FMOD_DSP_PARAMEQ_BANDWIDTH,
FMOD_DSP_PARAMEQ_GAIN
} FMOD_DSP_PARAMEQ;
typedef enum FMOD_DSP_MULTIBAND_EQ
{
FMOD_DSP_MULTIBAND_EQ_A_FILTER,
FMOD_DSP_MULTIBAND_EQ_A_FREQUENCY,
FMOD_DSP_MULTIBAND_EQ_A_Q,
FMOD_DSP_MULTIBAND_EQ_A_GAIN,
FMOD_DSP_MULTIBAND_EQ_B_FILTER,
FMOD_DSP_MULTIBAND_EQ_B_FREQUENCY,
FMOD_DSP_MULTIBAND_EQ_B_Q,
FMOD_DSP_MULTIBAND_EQ_B_GAIN,
FMOD_DSP_MULTIBAND_EQ_C_FILTER,
FMOD_DSP_MULTIBAND_EQ_C_FREQUENCY,
FMOD_DSP_MULTIBAND_EQ_C_Q,
FMOD_DSP_MULTIBAND_EQ_C_GAIN,
FMOD_DSP_MULTIBAND_EQ_D_FILTER,
FMOD_DSP_MULTIBAND_EQ_D_FREQUENCY,
FMOD_DSP_MULTIBAND_EQ_D_Q,
FMOD_DSP_MULTIBAND_EQ_D_GAIN,
FMOD_DSP_MULTIBAND_EQ_E_FILTER,
FMOD_DSP_MULTIBAND_EQ_E_FREQUENCY,
FMOD_DSP_MULTIBAND_EQ_E_Q,
FMOD_DSP_MULTIBAND_EQ_E_GAIN,
} FMOD_DSP_MULTIBAND_EQ;
typedef enum FMOD_DSP_MULTIBAND_EQ_FILTER_TYPE
{
FMOD_DSP_MULTIBAND_EQ_FILTER_DISABLED,
FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_12DB,
FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_24DB,
FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_48DB,
FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_12DB,
FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_24DB,
FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_48DB,
FMOD_DSP_MULTIBAND_EQ_FILTER_LOWSHELF,
FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHSHELF,
FMOD_DSP_MULTIBAND_EQ_FILTER_PEAKING,
FMOD_DSP_MULTIBAND_EQ_FILTER_BANDPASS,
FMOD_DSP_MULTIBAND_EQ_FILTER_NOTCH,
FMOD_DSP_MULTIBAND_EQ_FILTER_ALLPASS,
} FMOD_DSP_MULTIBAND_EQ_FILTER_TYPE;
typedef enum
{
FMOD_DSP_PITCHSHIFT_PITCH,
FMOD_DSP_PITCHSHIFT_FFTSIZE,
FMOD_DSP_PITCHSHIFT_OVERLAP,
FMOD_DSP_PITCHSHIFT_MAXCHANNELS
} FMOD_DSP_PITCHSHIFT;
typedef enum
{
FMOD_DSP_CHORUS_MIX,
FMOD_DSP_CHORUS_RATE,
FMOD_DSP_CHORUS_DEPTH,
} FMOD_DSP_CHORUS;
typedef enum
{
FMOD_DSP_ITECHO_WETDRYMIX,
FMOD_DSP_ITECHO_FEEDBACK,
FMOD_DSP_ITECHO_LEFTDELAY,
FMOD_DSP_ITECHO_RIGHTDELAY,
FMOD_DSP_ITECHO_PANDELAY
} FMOD_DSP_ITECHO;
typedef enum
{
FMOD_DSP_COMPRESSOR_THRESHOLD,
FMOD_DSP_COMPRESSOR_RATIO,
FMOD_DSP_COMPRESSOR_ATTACK,
FMOD_DSP_COMPRESSOR_RELEASE,
FMOD_DSP_COMPRESSOR_GAINMAKEUP,
FMOD_DSP_COMPRESSOR_USESIDECHAIN,
FMOD_DSP_COMPRESSOR_LINKED
} FMOD_DSP_COMPRESSOR;
typedef enum
{
FMOD_DSP_SFXREVERB_DECAYTIME,
FMOD_DSP_SFXREVERB_EARLYDELAY,
FMOD_DSP_SFXREVERB_LATEDELAY,
FMOD_DSP_SFXREVERB_HFREFERENCE,
FMOD_DSP_SFXREVERB_HFDECAYRATIO,
FMOD_DSP_SFXREVERB_DIFFUSION,
FMOD_DSP_SFXREVERB_DENSITY,
FMOD_DSP_SFXREVERB_LOWSHELFFREQUENCY,
FMOD_DSP_SFXREVERB_LOWSHELFGAIN,
FMOD_DSP_SFXREVERB_HIGHCUT,
FMOD_DSP_SFXREVERB_EARLYLATEMIX,
FMOD_DSP_SFXREVERB_WETLEVEL,
FMOD_DSP_SFXREVERB_DRYLEVEL
} FMOD_DSP_SFXREVERB;
typedef enum
{
FMOD_DSP_LOWPASS_SIMPLE_CUTOFF
} FMOD_DSP_LOWPASS_SIMPLE;
typedef enum
{
FMOD_DSP_DELAY_CH0,
FMOD_DSP_DELAY_CH1,
FMOD_DSP_DELAY_CH2,
FMOD_DSP_DELAY_CH3,
FMOD_DSP_DELAY_CH4,
FMOD_DSP_DELAY_CH5,
FMOD_DSP_DELAY_CH6,
FMOD_DSP_DELAY_CH7,
FMOD_DSP_DELAY_CH8,
FMOD_DSP_DELAY_CH9,
FMOD_DSP_DELAY_CH10,
FMOD_DSP_DELAY_CH11,
FMOD_DSP_DELAY_CH12,
FMOD_DSP_DELAY_CH13,
FMOD_DSP_DELAY_CH14,
FMOD_DSP_DELAY_CH15,
FMOD_DSP_DELAY_MAXDELAY
} FMOD_DSP_DELAY;
typedef enum
{
FMOD_DSP_TREMOLO_FREQUENCY,
FMOD_DSP_TREMOLO_DEPTH,
FMOD_DSP_TREMOLO_SHAPE,
FMOD_DSP_TREMOLO_SKEW,
FMOD_DSP_TREMOLO_DUTY,
FMOD_DSP_TREMOLO_SQUARE,
FMOD_DSP_TREMOLO_PHASE,
FMOD_DSP_TREMOLO_SPREAD
} FMOD_DSP_TREMOLO;
typedef enum
{
FMOD_DSP_SEND_RETURNID,
FMOD_DSP_SEND_LEVEL,
} FMOD_DSP_SEND;
typedef enum
{
FMOD_DSP_RETURN_ID,
FMOD_DSP_RETURN_INPUT_SPEAKER_MODE
} FMOD_DSP_RETURN;
typedef enum
{
FMOD_DSP_HIGHPASS_SIMPLE_CUTOFF
} FMOD_DSP_HIGHPASS_SIMPLE;
typedef enum
{
FMOD_DSP_PAN_2D_STEREO_MODE_DISTRIBUTED,
FMOD_DSP_PAN_2D_STEREO_MODE_DISCRETE
} FMOD_DSP_PAN_2D_STEREO_MODE_TYPE;
typedef enum
{
FMOD_DSP_PAN_MODE_MONO,
FMOD_DSP_PAN_MODE_STEREO,
FMOD_DSP_PAN_MODE_SURROUND
} FMOD_DSP_PAN_MODE_TYPE;
typedef enum
{
FMOD_DSP_PAN_3D_ROLLOFF_LINEARSQUARED,
FMOD_DSP_PAN_3D_ROLLOFF_LINEAR,
FMOD_DSP_PAN_3D_ROLLOFF_INVERSE,
FMOD_DSP_PAN_3D_ROLLOFF_INVERSETAPERED,
FMOD_DSP_PAN_3D_ROLLOFF_CUSTOM
} FMOD_DSP_PAN_3D_ROLLOFF_TYPE;
typedef enum
{
FMOD_DSP_PAN_3D_EXTENT_MODE_AUTO,
FMOD_DSP_PAN_3D_EXTENT_MODE_USER,
FMOD_DSP_PAN_3D_EXTENT_MODE_OFF
} FMOD_DSP_PAN_3D_EXTENT_MODE_TYPE;
typedef enum
{
FMOD_DSP_PAN_MODE,
FMOD_DSP_PAN_2D_STEREO_POSITION,
FMOD_DSP_PAN_2D_DIRECTION,
FMOD_DSP_PAN_2D_EXTENT,
FMOD_DSP_PAN_2D_ROTATION,
FMOD_DSP_PAN_2D_LFE_LEVEL,
FMOD_DSP_PAN_2D_STEREO_MODE,
FMOD_DSP_PAN_2D_STEREO_SEPARATION,
FMOD_DSP_PAN_2D_STEREO_AXIS,
FMOD_DSP_PAN_ENABLED_SPEAKERS,
FMOD_DSP_PAN_3D_POSITION,
FMOD_DSP_PAN_3D_ROLLOFF,
FMOD_DSP_PAN_3D_MIN_DISTANCE,
FMOD_DSP_PAN_3D_MAX_DISTANCE,
FMOD_DSP_PAN_3D_EXTENT_MODE,
FMOD_DSP_PAN_3D_SOUND_SIZE,
FMOD_DSP_PAN_3D_MIN_EXTENT,
FMOD_DSP_PAN_3D_PAN_BLEND,
FMOD_DSP_PAN_LFE_UPMIX_ENABLED,
FMOD_DSP_PAN_OVERALL_GAIN,
FMOD_DSP_PAN_SURROUND_SPEAKER_MODE,
FMOD_DSP_PAN_2D_HEIGHT_BLEND,
} FMOD_DSP_PAN;
typedef enum
{
FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_12DB,
FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_24DB,
FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_48DB
} FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_TYPE;
typedef enum
{
FMOD_DSP_THREE_EQ_LOWGAIN,
FMOD_DSP_THREE_EQ_MIDGAIN,
FMOD_DSP_THREE_EQ_HIGHGAIN,
FMOD_DSP_THREE_EQ_LOWCROSSOVER,
FMOD_DSP_THREE_EQ_HIGHCROSSOVER,
FMOD_DSP_THREE_EQ_CROSSOVERSLOPE
} FMOD_DSP_THREE_EQ;
typedef enum
{
FMOD_DSP_FFT_WINDOW_RECT,
FMOD_DSP_FFT_WINDOW_TRIANGLE,
FMOD_DSP_FFT_WINDOW_HAMMING,
FMOD_DSP_FFT_WINDOW_HANNING,
FMOD_DSP_FFT_WINDOW_BLACKMAN,
FMOD_DSP_FFT_WINDOW_BLACKMANHARRIS
} FMOD_DSP_FFT_WINDOW;
typedef enum
{
FMOD_DSP_FFT_WINDOWSIZE,
FMOD_DSP_FFT_WINDOWTYPE,
FMOD_DSP_FFT_SPECTRUMDATA,
FMOD_DSP_FFT_DOMINANT_FREQ
} FMOD_DSP_FFT;
typedef enum
{
FMOD_DSP_ENVELOPEFOLLOWER_ATTACK,
FMOD_DSP_ENVELOPEFOLLOWER_RELEASE,
FMOD_DSP_ENVELOPEFOLLOWER_ENVELOPE,
FMOD_DSP_ENVELOPEFOLLOWER_USESIDECHAIN
} FMOD_DSP_ENVELOPEFOLLOWER;
typedef enum
{
FMOD_DSP_CONVOLUTION_REVERB_PARAM_IR,
FMOD_DSP_CONVOLUTION_REVERB_PARAM_WET,
FMOD_DSP_CONVOLUTION_REVERB_PARAM_DRY,
FMOD_DSP_CONVOLUTION_REVERB_PARAM_LINKED
} FMOD_DSP_CONVOLUTION_REVERB;
typedef enum
{
FMOD_DSP_CHANNELMIX_OUTPUT_DEFAULT,
FMOD_DSP_CHANNELMIX_OUTPUT_ALLMONO,
FMOD_DSP_CHANNELMIX_OUTPUT_ALLSTEREO,
FMOD_DSP_CHANNELMIX_OUTPUT_ALLQUAD,
FMOD_DSP_CHANNELMIX_OUTPUT_ALL5POINT1,
FMOD_DSP_CHANNELMIX_OUTPUT_ALL7POINT1,
FMOD_DSP_CHANNELMIX_OUTPUT_ALLLFE,
FMOD_DSP_CHANNELMIX_OUTPUT_ALL7POINT1POINT4
} FMOD_DSP_CHANNELMIX_OUTPUT;
typedef enum
{
FMOD_DSP_CHANNELMIX_OUTPUTGROUPING,
FMOD_DSP_CHANNELMIX_GAIN_CH0,
FMOD_DSP_CHANNELMIX_GAIN_CH1,
FMOD_DSP_CHANNELMIX_GAIN_CH2,
FMOD_DSP_CHANNELMIX_GAIN_CH3,
FMOD_DSP_CHANNELMIX_GAIN_CH4,
FMOD_DSP_CHANNELMIX_GAIN_CH5,
FMOD_DSP_CHANNELMIX_GAIN_CH6,
FMOD_DSP_CHANNELMIX_GAIN_CH7,
FMOD_DSP_CHANNELMIX_GAIN_CH8,
FMOD_DSP_CHANNELMIX_GAIN_CH9,
FMOD_DSP_CHANNELMIX_GAIN_CH10,
FMOD_DSP_CHANNELMIX_GAIN_CH11,
FMOD_DSP_CHANNELMIX_GAIN_CH12,
FMOD_DSP_CHANNELMIX_GAIN_CH13,
FMOD_DSP_CHANNELMIX_GAIN_CH14,
FMOD_DSP_CHANNELMIX_GAIN_CH15,
FMOD_DSP_CHANNELMIX_GAIN_CH16,
FMOD_DSP_CHANNELMIX_GAIN_CH17,
FMOD_DSP_CHANNELMIX_GAIN_CH18,
FMOD_DSP_CHANNELMIX_GAIN_CH19,
FMOD_DSP_CHANNELMIX_GAIN_CH20,
FMOD_DSP_CHANNELMIX_GAIN_CH21,
FMOD_DSP_CHANNELMIX_GAIN_CH22,
FMOD_DSP_CHANNELMIX_GAIN_CH23,
FMOD_DSP_CHANNELMIX_GAIN_CH24,
FMOD_DSP_CHANNELMIX_GAIN_CH25,
FMOD_DSP_CHANNELMIX_GAIN_CH26,
FMOD_DSP_CHANNELMIX_GAIN_CH27,
FMOD_DSP_CHANNELMIX_GAIN_CH28,
FMOD_DSP_CHANNELMIX_GAIN_CH29,
FMOD_DSP_CHANNELMIX_GAIN_CH30,
FMOD_DSP_CHANNELMIX_GAIN_CH31,
FMOD_DSP_CHANNELMIX_OUTPUT_CH0,
FMOD_DSP_CHANNELMIX_OUTPUT_CH1,
FMOD_DSP_CHANNELMIX_OUTPUT_CH2,
FMOD_DSP_CHANNELMIX_OUTPUT_CH3,
FMOD_DSP_CHANNELMIX_OUTPUT_CH4,
FMOD_DSP_CHANNELMIX_OUTPUT_CH5,
FMOD_DSP_CHANNELMIX_OUTPUT_CH6,
FMOD_DSP_CHANNELMIX_OUTPUT_CH7,
FMOD_DSP_CHANNELMIX_OUTPUT_CH8,
FMOD_DSP_CHANNELMIX_OUTPUT_CH9,
FMOD_DSP_CHANNELMIX_OUTPUT_CH10,
FMOD_DSP_CHANNELMIX_OUTPUT_CH11,
FMOD_DSP_CHANNELMIX_OUTPUT_CH12,
FMOD_DSP_CHANNELMIX_OUTPUT_CH13,
FMOD_DSP_CHANNELMIX_OUTPUT_CH14,
FMOD_DSP_CHANNELMIX_OUTPUT_CH15,
FMOD_DSP_CHANNELMIX_OUTPUT_CH16,
FMOD_DSP_CHANNELMIX_OUTPUT_CH17,
FMOD_DSP_CHANNELMIX_OUTPUT_CH18,
FMOD_DSP_CHANNELMIX_OUTPUT_CH19,
FMOD_DSP_CHANNELMIX_OUTPUT_CH20,
FMOD_DSP_CHANNELMIX_OUTPUT_CH21,
FMOD_DSP_CHANNELMIX_OUTPUT_CH22,
FMOD_DSP_CHANNELMIX_OUTPUT_CH23,
FMOD_DSP_CHANNELMIX_OUTPUT_CH24,
FMOD_DSP_CHANNELMIX_OUTPUT_CH25,
FMOD_DSP_CHANNELMIX_OUTPUT_CH26,
FMOD_DSP_CHANNELMIX_OUTPUT_CH27,
FMOD_DSP_CHANNELMIX_OUTPUT_CH28,
FMOD_DSP_CHANNELMIX_OUTPUT_CH29,
FMOD_DSP_CHANNELMIX_OUTPUT_CH30,
FMOD_DSP_CHANNELMIX_OUTPUT_CH31
} FMOD_DSP_CHANNELMIX;
typedef enum
{
FMOD_DSP_TRANSCEIVER_SPEAKERMODE_AUTO = -1,
FMOD_DSP_TRANSCEIVER_SPEAKERMODE_MONO = 0,
FMOD_DSP_TRANSCEIVER_SPEAKERMODE_STEREO,
FMOD_DSP_TRANSCEIVER_SPEAKERMODE_SURROUND,
} FMOD_DSP_TRANSCEIVER_SPEAKERMODE;
typedef enum
{
FMOD_DSP_TRANSCEIVER_TRANSMIT,
FMOD_DSP_TRANSCEIVER_GAIN,
FMOD_DSP_TRANSCEIVER_CHANNEL,
FMOD_DSP_TRANSCEIVER_TRANSMITSPEAKERMODE
} FMOD_DSP_TRANSCEIVER;
typedef enum
{
FMOD_DSP_OBJECTPAN_3D_POSITION,
FMOD_DSP_OBJECTPAN_3D_ROLLOFF,
FMOD_DSP_OBJECTPAN_3D_MIN_DISTANCE,
FMOD_DSP_OBJECTPAN_3D_MAX_DISTANCE,
FMOD_DSP_OBJECTPAN_3D_EXTENT_MODE,
FMOD_DSP_OBJECTPAN_3D_SOUND_SIZE,
FMOD_DSP_OBJECTPAN_3D_MIN_EXTENT,
FMOD_DSP_OBJECTPAN_OVERALL_GAIN,
FMOD_DSP_OBJECTPAN_OUTPUTGAIN
} FMOD_DSP_OBJECTPAN;
#endif

106
engine/fmodcore/inc/fmod_errors.cs

@ -0,0 +1,106 @@
/* ============================================================================================== */
/* FMOD Core / Studio API - Error string header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header if you want to store or display a string version / english explanation */
/* of the FMOD error codes. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#fmod_result */
/* =============================================================================================== */
namespace FMOD
{
public class Error
{
public static string String(FMOD.RESULT errcode)
{
switch (errcode)
{
case FMOD.RESULT.OK: return "No errors.";
case FMOD.RESULT.ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound).";
case FMOD.RESULT.ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel.";
case FMOD.RESULT.ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound.";
case FMOD.RESULT.ERR_DMA: return "DMA Failure. See debug output for more information.";
case FMOD.RESULT.ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts.";
case FMOD.RESULT.ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph.";
case FMOD.RESULT.ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map.";
case FMOD.RESULT.ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released.";
case FMOD.RESULT.ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified.";
case FMOD.RESULT.ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system.";
case FMOD.RESULT.ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph.";
case FMOD.RESULT.ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type.";
case FMOD.RESULT.ERR_FILE_BAD: return "Error loading file.";
case FMOD.RESULT.ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format.";
case FMOD.RESULT.ERR_FILE_DISKEJECTED: return "Media was ejected while reading.";
case FMOD.RESULT.ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?).";
case FMOD.RESULT.ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data.";
case FMOD.RESULT.ERR_FILE_NOTFOUND: return "File not found.";
case FMOD.RESULT.ERR_FORMAT: return "Unsupported file or audio format.";
case FMOD.RESULT.ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library.";
case FMOD.RESULT.ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere.";
case FMOD.RESULT.ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden.";
case FMOD.RESULT.ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource.";
case FMOD.RESULT.ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred.";
case FMOD.RESULT.ERR_HTTP_TIMEOUT: return "The HTTP request timed out.";
case FMOD.RESULT.ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function.";
case FMOD.RESULT.ERR_INITIALIZED: return "Cannot call this command after System::init.";
case FMOD.RESULT.ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support.";
case FMOD.RESULT.ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float.";
case FMOD.RESULT.ERR_INVALID_HANDLE: return "An invalid object handle was used.";
case FMOD.RESULT.ERR_INVALID_PARAM: return "An invalid parameter was passed to this function.";
case FMOD.RESULT.ERR_INVALID_POSITION: return "An invalid seek position was passed to this function.";
case FMOD.RESULT.ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode.";
case FMOD.RESULT.ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle.";
case FMOD.RESULT.ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported.";
case FMOD.RESULT.ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular.";
case FMOD.RESULT.ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup.";
case FMOD.RESULT.ERR_MEMORY: return "Not enough memory or resources.";
case FMOD.RESULT.ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used.";
case FMOD.RESULT.ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound.";
case FMOD.RESULT.ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support.";
case FMOD.RESULT.ERR_NET_CONNECT: return "Couldn't connect to the specified host.";
case FMOD.RESULT.ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere.";
case FMOD.RESULT.ERR_NET_URL: return "The specified URL couldn't be resolved.";
case FMOD.RESULT.ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately.";
case FMOD.RESULT.ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready.";
case FMOD.RESULT.ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused.";
case FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer.";
case FMOD.RESULT.ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.";
case FMOD.RESULT.ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format.";
case FMOD.RESULT.ERR_OUTPUT_INIT: return "Error initializing output device.";
case FMOD.RESULT.ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails.";
case FMOD.RESULT.ERR_PLUGIN: return "An unspecified error has been returned from a plugin.";
case FMOD.RESULT.ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available.";
case FMOD.RESULT.ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)";
case FMOD.RESULT.ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version.";
case FMOD.RESULT.ERR_RECORD: return "An error occurred trying to initialize the recording device.";
case FMOD.RESULT.ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection.";
case FMOD.RESULT.ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist.";
case FMOD.RESULT.ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound.";
case FMOD.RESULT.ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first.";
case FMOD.RESULT.ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file.";
case FMOD.RESULT.ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags.";
case FMOD.RESULT.ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat.";
case FMOD.RESULT.ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated.";
case FMOD.RESULT.ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!";
case FMOD.RESULT.ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called.";
case FMOD.RESULT.ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified.";
case FMOD.RESULT.ERR_VERSION: return "The version number of this file format is not supported.";
case FMOD.RESULT.ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded.";
case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected.";
case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool.";
case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out.";
case FMOD.RESULT.ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found.";
case FMOD.RESULT.ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized.";
case FMOD.RESULT.ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded.";
case FMOD.RESULT.ERR_INVALID_STRING: return "An invalid string was passed to this function.";
case FMOD.RESULT.ERR_ALREADY_LOCKED: return "The specified resource is already locked.";
case FMOD.RESULT.ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked.";
case FMOD.RESULT.ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected.";
case FMOD.RESULT.ERR_TOOMANYSAMPLES: return "The length provided exceed the allowable limit.";
default: return "Unknown error.";
}
}
}
}

110
engine/fmodcore/inc/fmod_errors.h

@ -0,0 +1,110 @@
/* ============================================================================================== */
/* FMOD Core / Studio API - Error string header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header if you want to store or display a string version / english explanation */
/* of the FMOD error codes. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#fmod_result */
/* =============================================================================================== */
#ifndef _FMOD_ERRORS_H
#define _FMOD_ERRORS_H
#include "fmod.h"
#ifdef __GNUC__
static const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused));
#endif
static const char *FMOD_ErrorString(FMOD_RESULT errcode)
{
switch (errcode)
{
case FMOD_OK: return "No errors.";
case FMOD_ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound).";
case FMOD_ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel.";
case FMOD_ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound.";
case FMOD_ERR_DMA: return "DMA Failure. See debug output for more information.";
case FMOD_ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts.";
case FMOD_ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph.";
case FMOD_ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map.";
case FMOD_ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released.";
case FMOD_ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified.";
case FMOD_ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system.";
case FMOD_ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph.";
case FMOD_ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type.";
case FMOD_ERR_FILE_BAD: return "Error loading file.";
case FMOD_ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format.";
case FMOD_ERR_FILE_DISKEJECTED: return "Media was ejected while reading.";
case FMOD_ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?).";
case FMOD_ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data.";
case FMOD_ERR_FILE_NOTFOUND: return "File not found.";
case FMOD_ERR_FORMAT: return "Unsupported file or audio format.";
case FMOD_ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library.";
case FMOD_ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere.";
case FMOD_ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden.";
case FMOD_ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource.";
case FMOD_ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred.";
case FMOD_ERR_HTTP_TIMEOUT: return "The HTTP request timed out.";
case FMOD_ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function.";
case FMOD_ERR_INITIALIZED: return "Cannot call this command after System::init.";
case FMOD_ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support.";
case FMOD_ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float.";
case FMOD_ERR_INVALID_HANDLE: return "An invalid object handle was used.";
case FMOD_ERR_INVALID_PARAM: return "An invalid parameter was passed to this function.";
case FMOD_ERR_INVALID_POSITION: return "An invalid seek position was passed to this function.";
case FMOD_ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode.";
case FMOD_ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle.";
case FMOD_ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported.";
case FMOD_ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular.";
case FMOD_ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup.";
case FMOD_ERR_MEMORY: return "Not enough memory or resources.";
case FMOD_ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used.";
case FMOD_ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound.";
case FMOD_ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support.";
case FMOD_ERR_NET_CONNECT: return "Couldn't connect to the specified host.";
case FMOD_ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere.";
case FMOD_ERR_NET_URL: return "The specified URL couldn't be resolved.";
case FMOD_ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately.";
case FMOD_ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready.";
case FMOD_ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused.";
case FMOD_ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer.";
case FMOD_ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.";
case FMOD_ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format.";
case FMOD_ERR_OUTPUT_INIT: return "Error initializing output device.";
case FMOD_ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails.";
case FMOD_ERR_PLUGIN: return "An unspecified error has been returned from a plugin.";
case FMOD_ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available.";
case FMOD_ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)";
case FMOD_ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version.";
case FMOD_ERR_RECORD: return "An error occurred trying to initialize the recording device.";
case FMOD_ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection.";
case FMOD_ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist.";
case FMOD_ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound.";
case FMOD_ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first.";
case FMOD_ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file.";
case FMOD_ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags.";
case FMOD_ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat.";
case FMOD_ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated.";
case FMOD_ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!";
case FMOD_ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called.";
case FMOD_ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified.";
case FMOD_ERR_VERSION: return "The version number of this file format is not supported.";
case FMOD_ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded.";
case FMOD_ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected.";
case FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool.";
case FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out.";
case FMOD_ERR_EVENT_NOTFOUND: return "The requested event, parameter, bus or vca could not be found.";
case FMOD_ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized.";
case FMOD_ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded.";
case FMOD_ERR_INVALID_STRING: return "An invalid string was passed to this function.";
case FMOD_ERR_ALREADY_LOCKED: return "The specified resource is already locked.";
case FMOD_ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked.";
case FMOD_ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected.";
case FMOD_ERR_TOOMANYSAMPLES: return "The length provided exceeds the allowable limit.";
default : return "Unknown error.";
};
}
#endif

129
engine/fmodcore/inc/fmod_output.h

@ -0,0 +1,129 @@
/* ======================================================================================== */
/* FMOD Core API - output development header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header if you are wanting to develop your own output plugin to use with */
/* FMOD's output system. With this header you can make your own output plugin that FMOD */
/* can register and use. See the documentation and examples on how to make a working */
/* plugin. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=plugin-api-output.html */
/* ======================================================================================== */
#ifndef _FMOD_OUTPUT_H
#define _FMOD_OUTPUT_H
typedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE;
typedef struct FMOD_OUTPUT_OBJECT3DINFO FMOD_OUTPUT_OBJECT3DINFO;
/*
Output constants
*/
#define FMOD_OUTPUT_PLUGIN_VERSION 4
typedef unsigned int FMOD_OUTPUT_METHOD;
#define FMOD_OUTPUT_METHOD_MIX_DIRECT 0
#define FMOD_OUTPUT_METHOD_POLLING 1
#define FMOD_OUTPUT_METHOD_MIX_BUFFERED 2
/*
Output callbacks
*/
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *numdrivers);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_GETDRIVERINFO_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_INIT_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_START_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_STOP_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_CLOSE_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_UPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_GETHANDLE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **handle);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_GETPOSITION_CALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_LOCK_CALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_UNLOCK_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_MIXER_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *maxhardwareobjects);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **object3d);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OBJECT3DFREE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *object3d);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *object3d, const FMOD_OUTPUT_OBJECT3DINFO *info);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OPENPORT_CALLBACK) (FMOD_OUTPUT_STATE *output_state, FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, int *portId, int *portRate, int *portChannels, FMOD_SOUND_FORMAT *portFormat);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_CLOSEPORT_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int portId);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_DEVICELISTCHANGED_CALLBACK)(FMOD_OUTPUT_STATE *output_state);
/*
Output functions
*/
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_READFROMMIXER_FUNC) (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_COPYPORT_FUNC) (FMOD_OUTPUT_STATE *output_state, int portId, void *buffer, unsigned int length);
typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_REQUESTRESET_FUNC) (FMOD_OUTPUT_STATE *output_state);
typedef void * (F_CALL *FMOD_OUTPUT_ALLOC_FUNC) (unsigned int size, unsigned int align, const char *file, int line);
typedef void (F_CALL *FMOD_OUTPUT_FREE_FUNC) (void *ptr, const char *file, int line);
typedef void (F_CALL *FMOD_OUTPUT_LOG_FUNC) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...);
/*
Output structures
*/
typedef struct FMOD_OUTPUT_DESCRIPTION
{
unsigned int apiversion;
const char *name;
unsigned int version;
FMOD_OUTPUT_METHOD polling; /* This will become "method" on the next major version */
FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK getnumdrivers;
FMOD_OUTPUT_GETDRIVERINFO_CALLBACK getdriverinfo;
FMOD_OUTPUT_INIT_CALLBACK init;
FMOD_OUTPUT_START_CALLBACK start;
FMOD_OUTPUT_STOP_CALLBACK stop;
FMOD_OUTPUT_CLOSE_CALLBACK close;
FMOD_OUTPUT_UPDATE_CALLBACK update;
FMOD_OUTPUT_GETHANDLE_CALLBACK gethandle;
FMOD_OUTPUT_GETPOSITION_CALLBACK getposition;
FMOD_OUTPUT_LOCK_CALLBACK lock;
FMOD_OUTPUT_UNLOCK_CALLBACK unlock;
FMOD_OUTPUT_MIXER_CALLBACK mixer;
FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK object3dgetinfo;
FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK object3dalloc;
FMOD_OUTPUT_OBJECT3DFREE_CALLBACK object3dfree;
FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK object3dupdate;
FMOD_OUTPUT_OPENPORT_CALLBACK openport;
FMOD_OUTPUT_CLOSEPORT_CALLBACK closeport;
FMOD_OUTPUT_DEVICELISTCHANGED_CALLBACK devicelistchanged;
} FMOD_OUTPUT_DESCRIPTION;
struct FMOD_OUTPUT_STATE
{
void *plugindata;
FMOD_OUTPUT_READFROMMIXER_FUNC readfrommixer;
FMOD_OUTPUT_ALLOC_FUNC alloc;
FMOD_OUTPUT_FREE_FUNC free;
FMOD_OUTPUT_LOG_FUNC log;
FMOD_OUTPUT_COPYPORT_FUNC copyport;
FMOD_OUTPUT_REQUESTRESET_FUNC requestreset;
};
struct FMOD_OUTPUT_OBJECT3DINFO
{
float *buffer;
unsigned int bufferlength;
FMOD_VECTOR position;
float gain;
float spread;
float priority;
};
/*
Output macros
*/
#define FMOD_OUTPUT_READFROMMIXER(_state, _buffer, _length) \
(_state)->readfrommixer(_state, _buffer, _length)
#define FMOD_OUTPUT_ALLOC(_state, _size, _align) \
(_state)->alloc(_size, _align, __FILE__, __LINE__)
#define FMOD_OUTPUT_FREE(_state, _ptr) \
(_state)->free(_ptr, __FILE__, __LINE__)
#define FMOD_OUTPUT_LOG(_state, _level, _location, _format, ...) \
(_state)->log(_level, __FILE__, __LINE__, _location, _format, __VA_ARGS__)
#define FMOD_OUTPUT_COPYPORT(_state, _id, _buffer, _length) \
(_state)->copyport(_state, _id, _buffer, _length)
#define FMOD_OUTPUT_REQUESTRESET(_state) \
(_state)->requestreset(_state)
#endif /* _FMOD_OUTPUT_H */

BIN
engine/fmodcore/lib/x64/fmod.dll

BIN
engine/fmodcore/lib/x64/fmodL.dll

BIN
engine/fmodcore/lib/x64/fmodL_vc.lib

BIN
engine/fmodcore/lib/x64/fmod_vc.lib

BIN
engine/fmodcore/lib/x86/fmod.dll

BIN
engine/fmodcore/lib/x86/fmodL.dll

BIN
engine/fmodcore/lib/x86/fmodL_vc.lib

BIN
engine/fmodcore/lib/x86/fmod_vc.lib

BIN
engine/fmodcore/lib/x86/libfmod.a

BIN
engine/fmodcore/lib/x86/libfmodL.a

31
engine/projects/uniquake/uniquake.vcxproj

@ -95,16 +95,15 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;UNIQUAKE_EXPORTS;_WINDOWS;_USRDLL;GLQUAKE;UQE_FMOD;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;UNIQUAKE_EXPORTS;_WINDOWS;_USRDLL;GLQUAKE;UQE_FMOD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode> <ConformanceMode>false</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\fmodcore\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC> <EnableUAC>false</EnableUAC>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winmm.lib;wsock32.lib;glu32.lib;fmodexL_vc.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\fmod-4\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winmm.lib;wsock32.lib;glu32.lib;fmodL_vc.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\fmodcore\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(TargetDir)$(TargetName).dll $(SolutionDir)..\..\..\Assets\Plugins\windows\x86\uniquake.dll</Command> <Command>copy $(TargetDir)$(TargetName).dll $(SolutionDir)..\..\..\Assets\Plugins\windows\x86\uniquake.dll</Command>
@ -116,18 +115,17 @@
<WarningLevel>Level1</WarningLevel> <WarningLevel>Level1</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck> <SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;UNIQUAKE_EXPORTS;_WINDOWS;_USRDLL;GLQUAKE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;UNIQUAKE_EXPORTS;_WINDOWS;_USRDLL;GLQUAKE;UQE_FMOD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode> <ConformanceMode>false</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\fmodcore\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC> <EnableUAC>false</EnableUAC>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winmm.lib;wsock32.lib;glu32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\fmod-4\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winmm.lib;wsock32.lib;glu32.lib;fmodL_vc.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\fmodcore\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(TargetDir)$(TargetName).dll $(SolutionDir)..\..\..\Assets\Plugins\windows\x86_64\uniquake.dll</Command> <Command>copy $(TargetDir)$(TargetName).dll $(SolutionDir)..\..\..\Assets\Plugins\windows\x86_64\uniquake.dll</Command>
@ -236,13 +234,14 @@
<ClInclude Include="..\..\code\winquake.h" /> <ClInclude Include="..\..\code\winquake.h" />
<ClInclude Include="..\..\code\world.h" /> <ClInclude Include="..\..\code\world.h" />
<ClInclude Include="..\..\code\zone.h" /> <ClInclude Include="..\..\code\zone.h" />
<ClInclude Include="..\..\fmod-4\inc\fmod.h" />
<ClInclude Include="..\..\fmod-4\inc\fmod.hpp" />
<ClInclude Include="..\..\fmod-4\inc\fmod_codec.h" />
<ClInclude Include="..\..\fmod-4\inc\fmod_dsp.h" />
<ClInclude Include="..\..\fmod-4\inc\fmod_errors.h" />
<ClInclude Include="..\..\fmod-4\inc\fmod_memoryinfo.h" />
<ClInclude Include="..\..\fmod-4\inc\fmod_output.h" />
<ClInclude Include="..\..\fmodcore\inc\fmod.h" />
<ClInclude Include="..\..\fmodcore\inc\fmod.hpp" />
<ClInclude Include="..\..\fmodcore\inc\fmod_codec.h" />
<ClInclude Include="..\..\fmodcore\inc\fmod_common.h" />
<ClInclude Include="..\..\fmodcore\inc\fmod_dsp.h" />
<ClInclude Include="..\..\fmodcore\inc\fmod_dsp_effects.h" />
<ClInclude Include="..\..\fmodcore\inc\fmod_errors.h" />
<ClInclude Include="..\..\fmodcore\inc\fmod_output.h" />
<ClInclude Include="..\..\jpeg-6\jchuff.h" /> <ClInclude Include="..\..\jpeg-6\jchuff.h" />
<ClInclude Include="..\..\jpeg-6\jconfig.h" /> <ClInclude Include="..\..\jpeg-6\jconfig.h" />
<ClInclude Include="..\..\jpeg-6\jdct.h" /> <ClInclude Include="..\..\jpeg-6\jdct.h" />

17
engine/projects/uniquake/uniquake.vcxproj.filters

@ -216,25 +216,28 @@
<ClInclude Include="..\..\jpeg-6\jversion.h"> <ClInclude Include="..\..\jpeg-6\jversion.h">
<Filter>jpeg</Filter> <Filter>jpeg</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\fmod-4\inc\fmod.h">
<ClInclude Include="..\..\fmodcore\inc\fmod.h">
<Filter>fmod</Filter> <Filter>fmod</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\fmod-4\inc\fmod.hpp">
<ClInclude Include="..\..\fmodcore\inc\fmod.hpp">
<Filter>fmod</Filter> <Filter>fmod</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\fmod-4\inc\fmod_codec.h">
<ClInclude Include="..\..\fmodcore\inc\fmod_codec.h">
<Filter>fmod</Filter> <Filter>fmod</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\fmod-4\inc\fmod_dsp.h">
<ClInclude Include="..\..\fmodcore\inc\fmod_common.h">
<Filter>fmod</Filter> <Filter>fmod</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\fmod-4\inc\fmod_errors.h">
<ClInclude Include="..\..\fmodcore\inc\fmod_dsp.h">
<Filter>fmod</Filter> <Filter>fmod</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\fmod-4\inc\fmod_memoryinfo.h">
<ClInclude Include="..\..\fmodcore\inc\fmod_dsp_effects.h">
<Filter>fmod</Filter> <Filter>fmod</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\fmod-4\inc\fmod_output.h">
<ClInclude Include="..\..\fmodcore\inc\fmod_errors.h">
<Filter>fmod</Filter>
</ClInclude>
<ClInclude Include="..\..\fmodcore\inc\fmod_output.h">
<Filter>fmod</Filter> <Filter>fmod</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>

Loading…
Cancel
Save