From 6cfc54f019ea793c75c012af9c8249eac936cfac Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 11 Mar 2022 15:33:28 -0500 Subject: Added music and lamp popping sound --- vendor/fmod/inc/fmod.cs | 3974 ++++++++++++++++++++++++++++++++++ vendor/fmod/inc/fmod.h | 667 ++++++ vendor/fmod/inc/fmod.hpp | 606 ++++++ vendor/fmod/inc/fmod_codec.h | 136 ++ vendor/fmod/inc/fmod_common.h | 880 ++++++++ vendor/fmod/inc/fmod_dsp.cs | 897 ++++++++ vendor/fmod/inc/fmod_dsp.h | 421 ++++ vendor/fmod/inc/fmod_dsp_effects.h | 577 +++++ vendor/fmod/inc/fmod_errors.cs | 106 + vendor/fmod/inc/fmod_errors.h | 110 + vendor/fmod/inc/fmod_output.h | 122 ++ vendor/fmod/inc/fmod_studio.cs | 2250 +++++++++++++++++++ vendor/fmod/inc/fmod_studio.h | 248 +++ vendor/fmod/inc/fmod_studio.hpp | 402 ++++ vendor/fmod/inc/fmod_studio_common.h | 336 +++ vendor/fmod/lib/libfmod.dylib | Bin 0 -> 2550784 bytes vendor/fmod/lib/libfmodL.dylib | Bin 0 -> 2880512 bytes vendor/fmod/lib/libfmodstudio.dylib | Bin 0 -> 2170240 bytes vendor/fmod/lib/libfmodstudioL.dylib | Bin 0 -> 3539864 bytes 19 files changed, 11732 insertions(+) create mode 100644 vendor/fmod/inc/fmod.cs create mode 100644 vendor/fmod/inc/fmod.h create mode 100644 vendor/fmod/inc/fmod.hpp create mode 100644 vendor/fmod/inc/fmod_codec.h create mode 100644 vendor/fmod/inc/fmod_common.h create mode 100644 vendor/fmod/inc/fmod_dsp.cs create mode 100644 vendor/fmod/inc/fmod_dsp.h create mode 100644 vendor/fmod/inc/fmod_dsp_effects.h create mode 100644 vendor/fmod/inc/fmod_errors.cs create mode 100644 vendor/fmod/inc/fmod_errors.h create mode 100644 vendor/fmod/inc/fmod_output.h create mode 100644 vendor/fmod/inc/fmod_studio.cs create mode 100644 vendor/fmod/inc/fmod_studio.h create mode 100644 vendor/fmod/inc/fmod_studio.hpp create mode 100644 vendor/fmod/inc/fmod_studio_common.h create mode 100644 vendor/fmod/lib/libfmod.dylib create mode 100644 vendor/fmod/lib/libfmodL.dylib create mode 100644 vendor/fmod/lib/libfmodstudio.dylib create mode 100644 vendor/fmod/lib/libfmodstudioL.dylib (limited to 'vendor/fmod') diff --git a/vendor/fmod/inc/fmod.cs b/vendor/fmod/inc/fmod.cs new file mode 100644 index 0000000..6345688 --- /dev/null +++ b/vendor/fmod/inc/fmod.cs @@ -0,0 +1,3974 @@ +/* ======================================================================================== */ +/* FMOD Core API - C# wrapper. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */ +/* ======================================================================================== */ + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections.Generic; + +namespace FMOD +{ + /* + FMOD version number. Check this against FMOD::System::getVersion / System_GetVersion + 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number. + */ + public partial class VERSION + { + public const int number = 0x00020205; +#if !UNITY_2019_4_OR_NEWER + public const string dll = "fmod"; +#endif + } + + public class CONSTANTS + { + public const int MAX_CHANNEL_WIDTH = 32; + public const int MAX_LISTENERS = 8; + public const int REVERB_MAXINSTANCES = 4; + public const int MAX_SYSTEMS = 8; + } + + /* + FMOD core types + */ + public enum RESULT : int + { + OK, + ERR_BADCOMMAND, + ERR_CHANNEL_ALLOC, + ERR_CHANNEL_STOLEN, + ERR_DMA, + ERR_DSP_CONNECTION, + ERR_DSP_DONTPROCESS, + ERR_DSP_FORMAT, + ERR_DSP_INUSE, + ERR_DSP_NOTFOUND, + ERR_DSP_RESERVED, + ERR_DSP_SILENCE, + ERR_DSP_TYPE, + ERR_FILE_BAD, + ERR_FILE_COULDNOTSEEK, + ERR_FILE_DISKEJECTED, + ERR_FILE_EOF, + ERR_FILE_ENDOFDATA, + ERR_FILE_NOTFOUND, + ERR_FORMAT, + ERR_HEADER_MISMATCH, + ERR_HTTP, + ERR_HTTP_ACCESS, + ERR_HTTP_PROXY_AUTH, + ERR_HTTP_SERVER_ERROR, + ERR_HTTP_TIMEOUT, + ERR_INITIALIZATION, + ERR_INITIALIZED, + ERR_INTERNAL, + ERR_INVALID_FLOAT, + ERR_INVALID_HANDLE, + ERR_INVALID_PARAM, + ERR_INVALID_POSITION, + ERR_INVALID_SPEAKER, + ERR_INVALID_SYNCPOINT, + ERR_INVALID_THREAD, + ERR_INVALID_VECTOR, + ERR_MAXAUDIBLE, + ERR_MEMORY, + ERR_MEMORY_CANTPOINT, + ERR_NEEDS3D, + ERR_NEEDSHARDWARE, + ERR_NET_CONNECT, + ERR_NET_SOCKET_ERROR, + ERR_NET_URL, + ERR_NET_WOULD_BLOCK, + ERR_NOTREADY, + ERR_OUTPUT_ALLOCATED, + ERR_OUTPUT_CREATEBUFFER, + ERR_OUTPUT_DRIVERCALL, + ERR_OUTPUT_FORMAT, + ERR_OUTPUT_INIT, + ERR_OUTPUT_NODRIVERS, + ERR_PLUGIN, + ERR_PLUGIN_MISSING, + ERR_PLUGIN_RESOURCE, + ERR_PLUGIN_VERSION, + ERR_RECORD, + ERR_REVERB_CHANNELGROUP, + ERR_REVERB_INSTANCE, + ERR_SUBSOUNDS, + ERR_SUBSOUND_ALLOCATED, + ERR_SUBSOUND_CANTMOVE, + ERR_TAGNOTFOUND, + ERR_TOOMANYCHANNELS, + ERR_TRUNCATED, + ERR_UNIMPLEMENTED, + ERR_UNINITIALIZED, + ERR_UNSUPPORTED, + ERR_VERSION, + ERR_EVENT_ALREADY_LOADED, + ERR_EVENT_LIVEUPDATE_BUSY, + ERR_EVENT_LIVEUPDATE_MISMATCH, + ERR_EVENT_LIVEUPDATE_TIMEOUT, + ERR_EVENT_NOTFOUND, + ERR_STUDIO_UNINITIALIZED, + ERR_STUDIO_NOT_LOADED, + ERR_INVALID_STRING, + ERR_ALREADY_LOCKED, + ERR_NOT_LOCKED, + ERR_RECORD_DISCONNECTED, + ERR_TOOMANYSAMPLES, + } + + public enum CHANNELCONTROL_TYPE : int + { + CHANNEL, + CHANNELGROUP, + MAX + } + + [StructLayout(LayoutKind.Sequential)] + public struct VECTOR + { + public float x; + public float y; + public float z; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ATTRIBUTES_3D + { + public VECTOR position; + public VECTOR velocity; + public VECTOR forward; + public VECTOR up; + } + + [StructLayout(LayoutKind.Sequential)] + public partial struct GUID + { + public int Data1; + public int Data2; + public int Data3; + public int Data4; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ASYNCREADINFO + { + public IntPtr handle; + public uint offset; + public uint sizebytes; + public int priority; + + public IntPtr userdata; + public IntPtr buffer; + public uint bytesread; + public FILE_ASYNCDONE_FUNC done; + } + + public enum OUTPUTTYPE : int + { + AUTODETECT, + + UNKNOWN, + NOSOUND, + WAVWRITER, + NOSOUND_NRT, + WAVWRITER_NRT, + + WASAPI, + ASIO, + PULSEAUDIO, + ALSA, + COREAUDIO, + AUDIOTRACK, + OPENSL, + AUDIOOUT, + AUDIO3D, + WEBAUDIO, + NNAUDIO, + WINSONIC, + AAUDIO, + AUDIOWORKLET, + + MAX, + } + + public enum PORT_TYPE : int + { + MUSIC, + COPYRIGHT_MUSIC, + VOICE, + CONTROLLER, + PERSONAL, + VIBRATION, + AUX, + + MAX + } + + public enum DEBUG_MODE : int + { + TTY, + FILE, + CALLBACK, + } + + [Flags] + public enum DEBUG_FLAGS : uint + { + NONE = 0x00000000, + ERROR = 0x00000001, + WARNING = 0x00000002, + LOG = 0x00000004, + + TYPE_MEMORY = 0x00000100, + TYPE_FILE = 0x00000200, + TYPE_CODEC = 0x00000400, + TYPE_TRACE = 0x00000800, + + DISPLAY_TIMESTAMPS = 0x00010000, + DISPLAY_LINENUMBERS = 0x00020000, + DISPLAY_THREAD = 0x00040000, + } + + [Flags] + public enum MEMORY_TYPE : uint + { + NORMAL = 0x00000000, + STREAM_FILE = 0x00000001, + STREAM_DECODE = 0x00000002, + SAMPLEDATA = 0x00000004, + DSP_BUFFER = 0x00000008, + PLUGIN = 0x00000010, + PERSISTENT = 0x00200000, + ALL = 0xFFFFFFFF + } + + public enum SPEAKERMODE : int + { + DEFAULT, + RAW, + MONO, + STEREO, + QUAD, + SURROUND, + _5POINT1, + _7POINT1, + _7POINT1POINT4, + + MAX, + } + + public enum SPEAKER : int + { + NONE = -1, + FRONT_LEFT, + FRONT_RIGHT, + FRONT_CENTER, + LOW_FREQUENCY, + SURROUND_LEFT, + SURROUND_RIGHT, + BACK_LEFT, + BACK_RIGHT, + TOP_FRONT_LEFT, + TOP_FRONT_RIGHT, + TOP_BACK_LEFT, + TOP_BACK_RIGHT, + + MAX, + } + + [Flags] + public enum CHANNELMASK : uint + { + FRONT_LEFT = 0x00000001, + FRONT_RIGHT = 0x00000002, + FRONT_CENTER = 0x00000004, + LOW_FREQUENCY = 0x00000008, + SURROUND_LEFT = 0x00000010, + SURROUND_RIGHT = 0x00000020, + BACK_LEFT = 0x00000040, + BACK_RIGHT = 0x00000080, + BACK_CENTER = 0x00000100, + + MONO = (FRONT_LEFT), + STEREO = (FRONT_LEFT | FRONT_RIGHT), + LRC = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER), + QUAD = (FRONT_LEFT | FRONT_RIGHT | SURROUND_LEFT | SURROUND_RIGHT), + SURROUND = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT), + _5POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT), + _5POINT1_REARS = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT), + _7POINT0 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT), + _7POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT) + } + + public enum CHANNELORDER : int + { + DEFAULT, + WAVEFORMAT, + PROTOOLS, + ALLMONO, + ALLSTEREO, + ALSA, + + MAX, + } + + public enum PLUGINTYPE : int + { + OUTPUT, + CODEC, + DSP, + + MAX, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PLUGINLIST + { + PLUGINTYPE type; + IntPtr description; + } + + [Flags] + public enum INITFLAGS : uint + { + NORMAL = 0x00000000, + STREAM_FROM_UPDATE = 0x00000001, + MIX_FROM_UPDATE = 0x00000002, + _3D_RIGHTHANDED = 0x00000004, + CHANNEL_LOWPASS = 0x00000100, + CHANNEL_DISTANCEFILTER = 0x00000200, + PROFILE_ENABLE = 0x00010000, + VOL0_BECOMES_VIRTUAL = 0x00020000, + GEOMETRY_USECLOSEST = 0x00040000, + PREFER_DOLBY_DOWNMIX = 0x00080000, + THREAD_UNSAFE = 0x00100000, + PROFILE_METER_ALL = 0x00200000, + MEMORY_TRACKING = 0x00400000, + } + + public enum SOUND_TYPE : int + { + UNKNOWN, + AIFF, + ASF, + DLS, + FLAC, + FSB, + IT, + MIDI, + MOD, + MPEG, + OGGVORBIS, + PLAYLIST, + RAW, + S3M, + USER, + WAV, + XM, + XMA, + AUDIOQUEUE, + AT9, + VORBIS, + MEDIA_FOUNDATION, + MEDIACODEC, + FADPCM, + OPUS, + + MAX, + } + + public enum SOUND_FORMAT : int + { + NONE, + PCM8, + PCM16, + PCM24, + PCM32, + PCMFLOAT, + BITSTREAM, + + MAX + } + + [Flags] + public enum MODE : uint + { + DEFAULT = 0x00000000, + LOOP_OFF = 0x00000001, + LOOP_NORMAL = 0x00000002, + LOOP_BIDI = 0x00000004, + _2D = 0x00000008, + _3D = 0x00000010, + CREATESTREAM = 0x00000080, + CREATESAMPLE = 0x00000100, + CREATECOMPRESSEDSAMPLE = 0x00000200, + OPENUSER = 0x00000400, + OPENMEMORY = 0x00000800, + OPENMEMORY_POINT = 0x10000000, + OPENRAW = 0x00001000, + OPENONLY = 0x00002000, + ACCURATETIME = 0x00004000, + MPEGSEARCH = 0x00008000, + NONBLOCKING = 0x00010000, + UNIQUE = 0x00020000, + _3D_HEADRELATIVE = 0x00040000, + _3D_WORLDRELATIVE = 0x00080000, + _3D_INVERSEROLLOFF = 0x00100000, + _3D_LINEARROLLOFF = 0x00200000, + _3D_LINEARSQUAREROLLOFF = 0x00400000, + _3D_INVERSETAPEREDROLLOFF = 0x00800000, + _3D_CUSTOMROLLOFF = 0x04000000, + _3D_IGNOREGEOMETRY = 0x40000000, + IGNORETAGS = 0x02000000, + LOWMEM = 0x08000000, + VIRTUAL_PLAYFROMSTART = 0x80000000 + } + + public enum OPENSTATE : int + { + READY = 0, + LOADING, + ERROR, + CONNECTING, + BUFFERING, + SEEKING, + PLAYING, + SETPOSITION, + + MAX, + } + + public enum SOUNDGROUP_BEHAVIOR : int + { + BEHAVIOR_FAIL, + BEHAVIOR_MUTE, + BEHAVIOR_STEALLOWEST, + + MAX, + } + + public enum CHANNELCONTROL_CALLBACK_TYPE : int + { + END, + VIRTUALVOICE, + SYNCPOINT, + OCCLUSION, + + MAX, + } + + public struct CHANNELCONTROL_DSP_INDEX + { + public const int HEAD = -1; + public const int FADER = -2; + public const int TAIL = -3; + } + + public enum ERRORCALLBACK_INSTANCETYPE : int + { + NONE, + SYSTEM, + CHANNEL, + CHANNELGROUP, + CHANNELCONTROL, + SOUND, + SOUNDGROUP, + DSP, + DSPCONNECTION, + GEOMETRY, + REVERB3D, + STUDIO_SYSTEM, + STUDIO_EVENTDESCRIPTION, + STUDIO_EVENTINSTANCE, + STUDIO_PARAMETERINSTANCE, + STUDIO_BUS, + STUDIO_VCA, + STUDIO_BANK, + STUDIO_COMMANDREPLAY + } + + [StructLayout(LayoutKind.Sequential)] + public struct ERRORCALLBACK_INFO + { + public RESULT result; + public ERRORCALLBACK_INSTANCETYPE instancetype; + public IntPtr instance; + public StringWrapper functionname; + public StringWrapper functionparams; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CPU_USAGE + { + public float dsp; /* DSP mixing CPU usage. */ + public float stream; /* Streaming engine CPU usage. */ + public float geometry; /* Geometry engine CPU usage. */ + public float update; /* System::update CPU usage. */ + public float convolution1; /* Convolution reverb processing thread #1 CPU usage */ + public float convolution2; /* Convolution reverb processing thread #2 CPU usage */ + } + + [Flags] + public enum SYSTEM_CALLBACK_TYPE : uint + { + DEVICELISTCHANGED = 0x00000001, + DEVICELOST = 0x00000002, + MEMORYALLOCATIONFAILED = 0x00000004, + THREADCREATED = 0x00000008, + BADDSPCONNECTION = 0x00000010, + PREMIX = 0x00000020, + POSTMIX = 0x00000040, + ERROR = 0x00000080, + MIDMIX = 0x00000100, + THREADDESTROYED = 0x00000200, + PREUPDATE = 0x00000400, + POSTUPDATE = 0x00000800, + RECORDLISTCHANGED = 0x00001000, + BUFFEREDNOMIX = 0x00002000, + DEVICEREINITIALIZE = 0x00004000, + OUTPUTUNDERRUN = 0x00008000, + ALL = 0xFFFFFFFF, + } + + /* + FMOD Callbacks + */ + public delegate RESULT DEBUG_CALLBACK (DEBUG_FLAGS flags, IntPtr file, int line, IntPtr func, IntPtr message); + public delegate RESULT SYSTEM_CALLBACK (IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata1, IntPtr commanddata2, IntPtr userdata); + public delegate RESULT CHANNELCONTROL_CALLBACK (IntPtr channelcontrol, CHANNELCONTROL_TYPE controltype, CHANNELCONTROL_CALLBACK_TYPE callbacktype, IntPtr commanddata1, IntPtr commanddata2); + public delegate RESULT SOUND_NONBLOCK_CALLBACK (IntPtr sound, RESULT result); + public delegate RESULT SOUND_PCMREAD_CALLBACK (IntPtr sound, IntPtr data, uint datalen); + public delegate RESULT SOUND_PCMSETPOS_CALLBACK (IntPtr sound, int subsound, uint position, TIMEUNIT postype); + public delegate RESULT FILE_OPEN_CALLBACK (IntPtr name, ref uint filesize, ref IntPtr handle, IntPtr userdata); + public delegate RESULT FILE_CLOSE_CALLBACK (IntPtr handle, IntPtr userdata); + public delegate RESULT FILE_READ_CALLBACK (IntPtr handle, IntPtr buffer, uint sizebytes, ref uint bytesread, IntPtr userdata); + public delegate RESULT FILE_SEEK_CALLBACK (IntPtr handle, uint pos, IntPtr userdata); + public delegate RESULT FILE_ASYNCREAD_CALLBACK (IntPtr info, IntPtr userdata); + public delegate RESULT FILE_ASYNCCANCEL_CALLBACK(IntPtr info, IntPtr userdata); + public delegate RESULT FILE_ASYNCDONE_FUNC (IntPtr info, RESULT result); + public delegate IntPtr MEMORY_ALLOC_CALLBACK (uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate IntPtr MEMORY_REALLOC_CALLBACK (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void MEMORY_FREE_CALLBACK (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); + public delegate float CB_3D_ROLLOFF_CALLBACK (IntPtr channelcontrol, float distance); + + public enum DSP_RESAMPLER : int + { + DEFAULT, + NOINTERP, + LINEAR, + CUBIC, + SPLINE, + + MAX, + } + + public enum DSPCONNECTION_TYPE : int + { + STANDARD, + SIDECHAIN, + SEND, + SEND_SIDECHAIN, + + MAX, + } + + public enum TAGTYPE : int + { + UNKNOWN = 0, + ID3V1, + ID3V2, + VORBISCOMMENT, + SHOUTCAST, + ICECAST, + ASF, + MIDI, + PLAYLIST, + FMOD, + USER, + + MAX + } + + public enum TAGDATATYPE : int + { + BINARY = 0, + INT, + FLOAT, + STRING, + STRING_UTF16, + STRING_UTF16BE, + STRING_UTF8, + + MAX + } + + [StructLayout(LayoutKind.Sequential)] + public struct TAG + { + public TAGTYPE type; + public TAGDATATYPE datatype; + public StringWrapper name; + public IntPtr data; + public uint datalen; + public bool updated; + } + + [Flags] + public enum TIMEUNIT : uint + { + MS = 0x00000001, + PCM = 0x00000002, + PCMBYTES = 0x00000004, + RAWBYTES = 0x00000008, + PCMFRACTION = 0x00000010, + MODORDER = 0x00000100, + MODROW = 0x00000200, + MODPATTERN = 0x00000400, + } + + public struct PORT_INDEX + { + public const ulong NONE = 0xFFFFFFFFFFFFFFFF; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CREATESOUNDEXINFO + { + public int cbsize; + public uint length; + public uint fileoffset; + public int numchannels; + public int defaultfrequency; + public SOUND_FORMAT format; + public uint decodebuffersize; + public int initialsubsound; + public int numsubsounds; + public IntPtr inclusionlist; + public int inclusionlistnum; + public SOUND_PCMREAD_CALLBACK pcmreadcallback; + public SOUND_PCMSETPOS_CALLBACK pcmsetposcallback; + public SOUND_NONBLOCK_CALLBACK nonblockcallback; + public IntPtr dlsname; + public IntPtr encryptionkey; + public int maxpolyphony; + public IntPtr userdata; + public SOUND_TYPE suggestedsoundtype; + public FILE_OPEN_CALLBACK fileuseropen; + public FILE_CLOSE_CALLBACK fileuserclose; + public FILE_READ_CALLBACK fileuserread; + public FILE_SEEK_CALLBACK fileuserseek; + public FILE_ASYNCREAD_CALLBACK fileuserasyncread; + public FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel; + public IntPtr fileuserdata; + public int filebuffersize; + public CHANNELORDER channelorder; + public IntPtr initialsoundgroup; + public uint initialseekposition; + public TIMEUNIT initialseekpostype; + public int ignoresetfilesystem; + public uint audioqueuepolicy; + public uint minmidigranularity; + public int nonblockthreadid; + public IntPtr fsbguid; + } + +#pragma warning disable 414 + [StructLayout(LayoutKind.Sequential)] + public struct REVERB_PROPERTIES + { + public float DecayTime; + public float EarlyDelay; + public float LateDelay; + public float HFReference; + public float HFDecayRatio; + public float Diffusion; + public float Density; + public float LowShelfFrequency; + public float LowShelfGain; + public float HighCut; + public float EarlyLateMix; + public float WetLevel; + + #region wrapperinternal + public 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) + { + DecayTime = decayTime; + EarlyDelay = earlyDelay; + LateDelay = lateDelay; + HFReference = hfReference; + HFDecayRatio = hfDecayRatio; + Diffusion = diffusion; + Density = density; + LowShelfFrequency = lowShelfFrequency; + LowShelfGain = lowShelfGain; + HighCut = highCut; + EarlyLateMix = earlyLateMix; + WetLevel = wetLevel; + } + #endregion + } +#pragma warning restore 414 + + public class PRESET + { + /* Instance Env Diffus Room RoomHF RmLF DecTm DecHF DecLF Refl RefDel Revb RevDel ModTm ModDp HFRef LFRef Diffus Densty FLAGS */ + public static REVERB_PROPERTIES OFF() { return new REVERB_PROPERTIES( 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f );} + public static REVERB_PROPERTIES GENERIC() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f );} + public static REVERB_PROPERTIES PADDEDCELL() { return new REVERB_PROPERTIES( 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f );} + public static REVERB_PROPERTIES ROOM() { return new REVERB_PROPERTIES( 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f );} + public static REVERB_PROPERTIES BATHROOM() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f );} + public static REVERB_PROPERTIES LIVINGROOM() { return new REVERB_PROPERTIES( 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f );} + public static REVERB_PROPERTIES STONEROOM() { return new REVERB_PROPERTIES( 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f );} + public static REVERB_PROPERTIES AUDITORIUM() { return new REVERB_PROPERTIES( 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f );} + public static REVERB_PROPERTIES CONCERTHALL() { return new REVERB_PROPERTIES( 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f );} + public static REVERB_PROPERTIES CAVE() { return new REVERB_PROPERTIES( 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f );} + public static REVERB_PROPERTIES ARENA() { return new REVERB_PROPERTIES( 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f );} + public static REVERB_PROPERTIES HANGAR() { return new REVERB_PROPERTIES( 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f );} + public static REVERB_PROPERTIES CARPETTEDHALLWAY() { return new REVERB_PROPERTIES( 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f );} + public static REVERB_PROPERTIES HALLWAY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f );} + public static REVERB_PROPERTIES STONECORRIDOR() { return new REVERB_PROPERTIES( 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f );} + public static REVERB_PROPERTIES ALLEY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f );} + public static REVERB_PROPERTIES FOREST() { return new REVERB_PROPERTIES( 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f );} + public static REVERB_PROPERTIES CITY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f );} + public static REVERB_PROPERTIES MOUNTAINS() { return new REVERB_PROPERTIES( 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f );} + public static REVERB_PROPERTIES QUARRY() { return new REVERB_PROPERTIES( 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f );} + public static REVERB_PROPERTIES PLAIN() { return new REVERB_PROPERTIES( 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f );} + public static REVERB_PROPERTIES PARKINGLOT() { return new REVERB_PROPERTIES( 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f );} + public static REVERB_PROPERTIES SEWERPIPE() { return new REVERB_PROPERTIES( 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f );} + public static REVERB_PROPERTIES UNDERWATER() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f );} + } + + [StructLayout(LayoutKind.Sequential)] + public struct ADVANCEDSETTINGS + { + public int cbSize; + public int maxMPEGCodecs; + public int maxADPCMCodecs; + public int maxXMACodecs; + public int maxVorbisCodecs; + public int maxAT9Codecs; + public int maxFADPCMCodecs; + public int maxPCMCodecs; + public int ASIONumChannels; + public IntPtr ASIOChannelList; + public IntPtr ASIOSpeakerList; + public float vol0virtualvol; + public uint defaultDecodeBufferSize; + public ushort profilePort; + public uint geometryMaxFadeTime; + public float distanceFilterCenterFreq; + public int reverb3Dinstance; + public int DSPBufferPoolSize; + public DSP_RESAMPLER resamplerMethod; + public uint randomSeed; + public int maxConvolutionThreads; + public int maxOpusCodecs; + } + + [Flags] + public enum DRIVER_STATE : uint + { + CONNECTED = 0x00000001, + DEFAULT = 0x00000002, + } + + public enum THREAD_PRIORITY : int + { + /* Platform specific priority range */ + PLATFORM_MIN = -32 * 1024, + PLATFORM_MAX = 32 * 1024, + + /* Platform agnostic priorities, maps internally to platform specific value */ + DEFAULT = PLATFORM_MIN - 1, + LOW = PLATFORM_MIN - 2, + MEDIUM = PLATFORM_MIN - 3, + HIGH = PLATFORM_MIN - 4, + VERY_HIGH = PLATFORM_MIN - 5, + EXTREME = PLATFORM_MIN - 6, + CRITICAL = PLATFORM_MIN - 7, + + /* Thread defaults */ + MIXER = EXTREME, + FEEDER = CRITICAL, + STREAM = VERY_HIGH, + FILE = HIGH, + NONBLOCKING = HIGH, + RECORD = HIGH, + GEOMETRY = LOW, + PROFILER = MEDIUM, + STUDIO_UPDATE = MEDIUM, + STUDIO_LOAD_BANK = MEDIUM, + STUDIO_LOAD_SAMPLE = MEDIUM, + CONVOLUTION1 = VERY_HIGH, + CONVOLUTION2 = VERY_HIGH + + } + + public enum THREAD_STACK_SIZE : uint + { + DEFAULT = 0, + MIXER = 80 * 1024, + FEEDER = 16 * 1024, + STREAM = 96 * 1024, + FILE = 64 * 1024, + NONBLOCKING = 112 * 1024, + RECORD = 16 * 1024, + GEOMETRY = 48 * 1024, + PROFILER = 128 * 1024, + STUDIO_UPDATE = 96 * 1024, + STUDIO_LOAD_BANK = 96 * 1024, + STUDIO_LOAD_SAMPLE = 96 * 1024, + CONVOLUTION1 = 16 * 1024, + CONVOLUTION2 = 16 * 1024 + } + + [Flags] + public enum THREAD_AFFINITY : long + { + /* Platform agnostic thread groupings */ + GROUP_DEFAULT = 0x4000000000000000, + GROUP_A = 0x4000000000000001, + GROUP_B = 0x4000000000000002, + GROUP_C = 0x4000000000000003, + + /* Thread defaults */ + MIXER = GROUP_A, + FEEDER = GROUP_C, + STREAM = GROUP_C, + FILE = GROUP_C, + NONBLOCKING = GROUP_C, + RECORD = GROUP_C, + GEOMETRY = GROUP_C, + PROFILER = GROUP_C, + STUDIO_UPDATE = GROUP_B, + STUDIO_LOAD_BANK = GROUP_C, + STUDIO_LOAD_SAMPLE = GROUP_C, + CONVOLUTION1 = GROUP_C, + CONVOLUTION2 = GROUP_C, + + /* Core mask, valid up to 1 << 61 */ + CORE_ALL = 0, + CORE_0 = 1 << 0, + CORE_1 = 1 << 1, + CORE_2 = 1 << 2, + CORE_3 = 1 << 3, + CORE_4 = 1 << 4, + CORE_5 = 1 << 5, + CORE_6 = 1 << 6, + CORE_7 = 1 << 7, + CORE_8 = 1 << 8, + CORE_9 = 1 << 9, + CORE_10 = 1 << 10, + CORE_11 = 1 << 11, + CORE_12 = 1 << 12, + CORE_13 = 1 << 13, + CORE_14 = 1 << 14, + CORE_15 = 1 << 15 + } + + public enum THREAD_TYPE : int + { + MIXER, + FEEDER, + STREAM, + FILE, + NONBLOCKING, + RECORD, + GEOMETRY, + PROFILER, + STUDIO_UPDATE, + STUDIO_LOAD_BANK, + STUDIO_LOAD_SAMPLE, + CONVOLUTION1, + CONVOLUTION2, + + MAX + } + + /* + FMOD System factory functions. Use this to create an FMOD System Instance. below you will see System init/close to get started. + */ + public struct Factory + { + public static RESULT System_Create(out System system) + { + return FMOD5_System_Create(out system.handle, VERSION.number); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Create(out IntPtr system, uint headerversion); + + #endregion + } + + /* + FMOD global system functions (optional). + */ + public struct Memory + { + public static RESULT Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags = MEMORY_TYPE.ALL) + { + return FMOD5_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); + } + + public static RESULT GetStats(out int currentalloced, out int maxalloced, bool blocking = true) + { + return FMOD5_Memory_GetStats(out currentalloced, out maxalloced, blocking); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Memory_Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Memory_GetStats (out int currentalloced, out int maxalloced, bool blocking); + + #endregion + } + + public struct Debug + { + public static RESULT Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode = DEBUG_MODE.TTY, DEBUG_CALLBACK callback = null, string filename = null) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Debug_Initialize(flags, mode, callback, encoder.byteFromStringUTF8(filename)); + } + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Debug_Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode, DEBUG_CALLBACK callback, byte[] filename); + + #endregion + } + + public struct Thread + { + public static RESULT SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity = THREAD_AFFINITY.GROUP_DEFAULT, THREAD_PRIORITY priority = THREAD_PRIORITY.DEFAULT, THREAD_STACK_SIZE stacksize = THREAD_STACK_SIZE.DEFAULT) + { + return FMOD5_Thread_SetAttributes(type, affinity, priority, stacksize); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Thread_SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity, THREAD_PRIORITY priority, THREAD_STACK_SIZE stacksize); + #endregion + } + + /* + 'System' API. + */ + public struct System + { + public RESULT release() + { + return FMOD5_System_Release(this.handle); + } + + // Setup functions. + public RESULT setOutput(OUTPUTTYPE output) + { + return FMOD5_System_SetOutput(this.handle, output); + } + public RESULT getOutput(out OUTPUTTYPE output) + { + return FMOD5_System_GetOutput(this.handle, out output); + } + public RESULT getNumDrivers(out int numdrivers) + { + return FMOD5_System_GetNumDrivers(this.handle, out numdrivers); + } + public RESULT getDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels); + using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) + { + name = encoding.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) + { + return FMOD5_System_GetDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels); + } + public RESULT setDriver(int driver) + { + return FMOD5_System_SetDriver(this.handle, driver); + } + public RESULT getDriver(out int driver) + { + return FMOD5_System_GetDriver(this.handle, out driver); + } + public RESULT setSoftwareChannels(int numsoftwarechannels) + { + return FMOD5_System_SetSoftwareChannels(this.handle, numsoftwarechannels); + } + public RESULT getSoftwareChannels(out int numsoftwarechannels) + { + return FMOD5_System_GetSoftwareChannels(this.handle, out numsoftwarechannels); + } + public RESULT setSoftwareFormat(int samplerate, SPEAKERMODE speakermode, int numrawspeakers) + { + return FMOD5_System_SetSoftwareFormat(this.handle, samplerate, speakermode, numrawspeakers); + } + public RESULT getSoftwareFormat(out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers) + { + return FMOD5_System_GetSoftwareFormat(this.handle, out samplerate, out speakermode, out numrawspeakers); + } + public RESULT setDSPBufferSize(uint bufferlength, int numbuffers) + { + return FMOD5_System_SetDSPBufferSize(this.handle, bufferlength, numbuffers); + } + public RESULT getDSPBufferSize(out uint bufferlength, out int numbuffers) + { + return FMOD5_System_GetDSPBufferSize(this.handle, out bufferlength, out numbuffers); + } + public RESULT setFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign) + { + return FMOD5_System_SetFileSystem(this.handle, useropen, userclose, userread, userseek, userasyncread, userasynccancel, blockalign); + } + public RESULT attachFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek) + { + return FMOD5_System_AttachFileSystem(this.handle, useropen, userclose, userread, userseek); + } + public RESULT setAdvancedSettings(ref ADVANCEDSETTINGS settings) + { + settings.cbSize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); + return FMOD5_System_SetAdvancedSettings(this.handle, ref settings); + } + public RESULT getAdvancedSettings(ref ADVANCEDSETTINGS settings) + { + settings.cbSize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); + return FMOD5_System_GetAdvancedSettings(this.handle, ref settings); + } + public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) + { + return FMOD5_System_SetCallback(this.handle, callback, callbackmask); + } + + // Plug-in support. + public RESULT setPluginPath(string path) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_SetPluginPath(this.handle, encoder.byteFromStringUTF8(path)); + } + } + public RESULT loadPlugin(string filename, out uint handle, uint priority = 0) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_LoadPlugin(this.handle, encoder.byteFromStringUTF8(filename), out handle, priority); + } + } + public RESULT unloadPlugin(uint handle) + { + return FMOD5_System_UnloadPlugin(this.handle, handle); + } + public RESULT getNumNestedPlugins(uint handle, out int count) + { + return FMOD5_System_GetNumNestedPlugins(this.handle, handle, out count); + } + public RESULT getNestedPlugin(uint handle, int index, out uint nestedhandle) + { + return FMOD5_System_GetNestedPlugin(this.handle, handle, index, out nestedhandle); + } + public RESULT getNumPlugins(PLUGINTYPE plugintype, out int numplugins) + { + return FMOD5_System_GetNumPlugins(this.handle, plugintype, out numplugins); + } + public RESULT getPluginHandle(PLUGINTYPE plugintype, int index, out uint handle) + { + return FMOD5_System_GetPluginHandle(this.handle, plugintype, index, out handle); + } + public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out string name, int namelen, out uint version) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, stringMem, namelen, out version); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out uint version) + { + return FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, IntPtr.Zero, 0, out version); + } + public RESULT setOutputByPlugin(uint handle) + { + return FMOD5_System_SetOutputByPlugin(this.handle, handle); + } + public RESULT getOutputByPlugin(out uint handle) + { + return FMOD5_System_GetOutputByPlugin(this.handle, out handle); + } + public RESULT createDSPByPlugin(uint handle, out DSP dsp) + { + return FMOD5_System_CreateDSPByPlugin(this.handle, handle, out dsp.handle); + } + public RESULT getDSPInfoByPlugin(uint handle, out IntPtr description) + { + return FMOD5_System_GetDSPInfoByPlugin(this.handle, handle, out description); + } + /* + public RESULT registerCodec (ref CODEC_DESCRIPTION description, out uint handle, uint priority) + public RESULT registerCodec (ref CODEC_DESCRIPTION description, out uint handle, uint priority = 0) + public RESULT registerCodec(ref CODEC_DESCRIPTION description, out uint handle, uint priority) + { + return FMOD5_System_RegisterCodec(this.handle, ref description, out handle, priority); + } + */ + public RESULT registerDSP(ref DSP_DESCRIPTION description, out uint handle) + { + return FMOD5_System_RegisterDSP(this.handle, ref description, out handle); + } + /* + public RESULT registerOutput(ref OUTPUT_DESCRIPTION description, out uint handle) + { + return FMOD5_System_RegisterOutput(this.handle, ref description, out handle); + } + */ + + // Init/Close. + public RESULT init(int maxchannels, INITFLAGS flags, IntPtr extradriverdata) + { + return FMOD5_System_Init(this.handle, maxchannels, flags, extradriverdata); + } + public RESULT close() + { + return FMOD5_System_Close(this.handle); + } + + // General post-init system functions. + public RESULT update() + { + return FMOD5_System_Update(this.handle); + } + public RESULT setSpeakerPosition(SPEAKER speaker, float x, float y, bool active) + { + return FMOD5_System_SetSpeakerPosition(this.handle, speaker, x, y, active); + } + public RESULT getSpeakerPosition(SPEAKER speaker, out float x, out float y, out bool active) + { + return FMOD5_System_GetSpeakerPosition(this.handle, speaker, out x, out y, out active); + } + public RESULT setStreamBufferSize(uint filebuffersize, TIMEUNIT filebuffersizetype) + { + return FMOD5_System_SetStreamBufferSize(this.handle, filebuffersize, filebuffersizetype); + } + public RESULT getStreamBufferSize(out uint filebuffersize, out TIMEUNIT filebuffersizetype) + { + return FMOD5_System_GetStreamBufferSize(this.handle, out filebuffersize, out filebuffersizetype); + } + public RESULT set3DSettings(float dopplerscale, float distancefactor, float rolloffscale) + { + return FMOD5_System_Set3DSettings(this.handle, dopplerscale, distancefactor, rolloffscale); + } + public RESULT get3DSettings(out float dopplerscale, out float distancefactor, out float rolloffscale) + { + return FMOD5_System_Get3DSettings(this.handle, out dopplerscale, out distancefactor, out rolloffscale); + } + public RESULT set3DNumListeners(int numlisteners) + { + return FMOD5_System_Set3DNumListeners(this.handle, numlisteners); + } + public RESULT get3DNumListeners(out int numlisteners) + { + return FMOD5_System_Get3DNumListeners(this.handle, out numlisteners); + } + public RESULT set3DListenerAttributes(int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up) + { + return FMOD5_System_Set3DListenerAttributes(this.handle, listener, ref pos, ref vel, ref forward, ref up); + } + public RESULT get3DListenerAttributes(int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up) + { + return FMOD5_System_Get3DListenerAttributes(this.handle, listener, out pos, out vel, out forward, out up); + } + public RESULT set3DRolloffCallback(CB_3D_ROLLOFF_CALLBACK callback) + { + return FMOD5_System_Set3DRolloffCallback(this.handle, callback); + } + public RESULT mixerSuspend() + { + return FMOD5_System_MixerSuspend(this.handle); + } + public RESULT mixerResume() + { + return FMOD5_System_MixerResume(this.handle); + } + public RESULT getDefaultMixMatrix(SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop) + { + return FMOD5_System_GetDefaultMixMatrix(this.handle, sourcespeakermode, targetspeakermode, matrix, matrixhop); + } + public RESULT getSpeakerModeChannels(SPEAKERMODE mode, out int channels) + { + return FMOD5_System_GetSpeakerModeChannels(this.handle, mode, out channels); + } + + // System information functions. + public RESULT getVersion(out uint version) + { + return FMOD5_System_GetVersion(this.handle, out version); + } + public RESULT getOutputHandle(out IntPtr handle) + { + return FMOD5_System_GetOutputHandle(this.handle, out handle); + } + public RESULT getChannelsPlaying(out int channels) + { + return FMOD5_System_GetChannelsPlaying(this.handle, out channels, IntPtr.Zero); + } + public RESULT getChannelsPlaying(out int channels, out int realchannels) + { + return FMOD5_System_GetChannelsPlaying(this.handle, out channels, out realchannels); + } + public RESULT getCPUUsage(out CPU_USAGE usage) + { + return FMOD5_System_GetCPUUsage(this.handle, out usage); + } + public RESULT getFileUsage(out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead) + { + return FMOD5_System_GetFileUsage(this.handle, out sampleBytesRead, out streamBytesRead, out otherBytesRead); + } + + // Sound/DSP/Channel/FX creation and retrieval. + public RESULT createSound(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateSound(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); + } + } + public RESULT createSound(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateSound(this.handle, data, mode, ref exinfo, out sound.handle); + } + public RESULT createSound(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateSound(this.handle, name_or_data, mode, ref exinfo, out sound.handle); + } + public RESULT createSound(string name, MODE mode, out Sound sound) + { + CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); + exinfo.cbsize = MarshalHelper.SizeOf(typeof(CREATESOUNDEXINFO)); + + return createSound(name, mode, ref exinfo, out sound); + } + public RESULT createStream(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateStream(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); + } + } + public RESULT createStream(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateStream(this.handle, data, mode, ref exinfo, out sound.handle); + } + public RESULT createStream(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateStream(this.handle, name_or_data, mode, ref exinfo, out sound.handle); + } + public RESULT createStream(string name, MODE mode, out Sound sound) + { + CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); + exinfo.cbsize = MarshalHelper.SizeOf(typeof(CREATESOUNDEXINFO)); + + return createStream(name, mode, ref exinfo, out sound); + } + public RESULT createDSP(ref DSP_DESCRIPTION description, out DSP dsp) + { + return FMOD5_System_CreateDSP(this.handle, ref description, out dsp.handle); + } + public RESULT createDSPByType(DSP_TYPE type, out DSP dsp) + { + return FMOD5_System_CreateDSPByType(this.handle, type, out dsp.handle); + } + public RESULT createChannelGroup(string name, out ChannelGroup channelgroup) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateChannelGroup(this.handle, encoder.byteFromStringUTF8(name), out channelgroup.handle); + } + } + public RESULT createSoundGroup(string name, out SoundGroup soundgroup) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateSoundGroup(this.handle, encoder.byteFromStringUTF8(name), out soundgroup.handle); + } + } + public RESULT createReverb3D(out Reverb3D reverb) + { + return FMOD5_System_CreateReverb3D(this.handle, out reverb.handle); + } + public RESULT playSound(Sound sound, ChannelGroup channelgroup, bool paused, out Channel channel) + { + return FMOD5_System_PlaySound(this.handle, sound.handle, channelgroup.handle, paused, out channel.handle); + } + public RESULT playDSP(DSP dsp, ChannelGroup channelgroup, bool paused, out Channel channel) + { + return FMOD5_System_PlayDSP(this.handle, dsp.handle, channelgroup.handle, paused, out channel.handle); + } + public RESULT getChannel(int channelid, out Channel channel) + { + return FMOD5_System_GetChannel(this.handle, channelid, out channel.handle); + } + public RESULT getDSPInfoByType(DSP_TYPE type, out IntPtr description) + { + return FMOD5_System_GetDSPInfoByType(this.handle, type, out description); + } + public RESULT getMasterChannelGroup(out ChannelGroup channelgroup) + { + return FMOD5_System_GetMasterChannelGroup(this.handle, out channelgroup.handle); + } + public RESULT getMasterSoundGroup(out SoundGroup soundgroup) + { + return FMOD5_System_GetMasterSoundGroup(this.handle, out soundgroup.handle); + } + + // Routing to ports. + public RESULT attachChannelGroupToPort(PORT_TYPE portType, ulong portIndex, ChannelGroup channelgroup, bool passThru = false) + { + return FMOD5_System_AttachChannelGroupToPort(this.handle, portType, portIndex, channelgroup.handle, passThru); + } + public RESULT detachChannelGroupFromPort(ChannelGroup channelgroup) + { + return FMOD5_System_DetachChannelGroupFromPort(this.handle, channelgroup.handle); + } + + // Reverb api. + public RESULT setReverbProperties(int instance, ref REVERB_PROPERTIES prop) + { + return FMOD5_System_SetReverbProperties(this.handle, instance, ref prop); + } + public RESULT getReverbProperties(int instance, out REVERB_PROPERTIES prop) + { + return FMOD5_System_GetReverbProperties(this.handle, instance, out prop); + } + + // System level DSP functionality. + public RESULT lockDSP() + { + return FMOD5_System_LockDSP(this.handle); + } + public RESULT unlockDSP() + { + return FMOD5_System_UnlockDSP(this.handle); + } + + // Recording api + public RESULT getRecordNumDrivers(out int numdrivers, out int numconnected) + { + return FMOD5_System_GetRecordNumDrivers(this.handle, out numdrivers, out numconnected); + } + public RESULT getRecordDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetRecordDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels, out state); + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getRecordDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) + { + return FMOD5_System_GetRecordDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels, out state); + } + public RESULT getRecordPosition(int id, out uint position) + { + return FMOD5_System_GetRecordPosition(this.handle, id, out position); + } + public RESULT recordStart(int id, Sound sound, bool loop) + { + return FMOD5_System_RecordStart(this.handle, id, sound.handle, loop); + } + public RESULT recordStop(int id) + { + return FMOD5_System_RecordStop(this.handle, id); + } + public RESULT isRecording(int id, out bool recording) + { + return FMOD5_System_IsRecording(this.handle, id, out recording); + } + + // Geometry api + public RESULT createGeometry(int maxpolygons, int maxvertices, out Geometry geometry) + { + return FMOD5_System_CreateGeometry(this.handle, maxpolygons, maxvertices, out geometry.handle); + } + public RESULT setGeometrySettings(float maxworldsize) + { + return FMOD5_System_SetGeometrySettings(this.handle, maxworldsize); + } + public RESULT getGeometrySettings(out float maxworldsize) + { + return FMOD5_System_GetGeometrySettings(this.handle, out maxworldsize); + } + public RESULT loadGeometry(IntPtr data, int datasize, out Geometry geometry) + { + return FMOD5_System_LoadGeometry(this.handle, data, datasize, out geometry.handle); + } + public RESULT getGeometryOcclusion(ref VECTOR listener, ref VECTOR source, out float direct, out float reverb) + { + return FMOD5_System_GetGeometryOcclusion(this.handle, ref listener, ref source, out direct, out reverb); + } + + // Network functions + public RESULT setNetworkProxy(string proxy) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_SetNetworkProxy(this.handle, encoder.byteFromStringUTF8(proxy)); + } + } + public RESULT getNetworkProxy(out string proxy, int proxylen) + { + IntPtr stringMem = Marshal.AllocHGlobal(proxylen); + + RESULT result = FMOD5_System_GetNetworkProxy(this.handle, stringMem, proxylen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + proxy = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT setNetworkTimeout(int timeout) + { + return FMOD5_System_SetNetworkTimeout(this.handle, timeout); + } + public RESULT getNetworkTimeout(out int timeout) + { + return FMOD5_System_GetNetworkTimeout(this.handle, out timeout); + } + + // Userdata set/get + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_System_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_System_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Release (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetOutput (IntPtr system, OUTPUTTYPE output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutput (IntPtr system, out OUTPUTTYPE output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumDrivers (IntPtr system, out int numdrivers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetDriver (IntPtr system, int driver); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDriver (IntPtr system, out int driver); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSoftwareChannels (IntPtr system, int numsoftwarechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSoftwareChannels (IntPtr system, out int numsoftwarechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSoftwareFormat (IntPtr system, int samplerate, SPEAKERMODE speakermode, int numrawspeakers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSoftwareFormat (IntPtr system, out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetDSPBufferSize (IntPtr system, uint bufferlength, int numbuffers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPBufferSize (IntPtr system, out uint bufferlength, out int numbuffers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_AttachFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetPluginPath (IntPtr system, byte[] path); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LoadPlugin (IntPtr system, byte[] filename, out uint handle, uint priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_UnloadPlugin (IntPtr system, uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumNestedPlugins (IntPtr system, uint handle, out int count); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNestedPlugin (IntPtr system, uint handle, int index, out uint nestedhandle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumPlugins (IntPtr system, PLUGINTYPE plugintype, out int numplugins); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetPluginHandle (IntPtr system, PLUGINTYPE plugintype, int index, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetPluginInfo (IntPtr system, uint handle, out PLUGINTYPE plugintype, IntPtr name, int namelen, out uint version); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetOutputByPlugin (IntPtr system, uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutputByPlugin (IntPtr system, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSPByPlugin (IntPtr system, uint handle, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPInfoByPlugin (IntPtr system, uint handle, out IntPtr description); + //[DllImport(VERSION.dll)] + //private static extern RESULT FMOD5_System_RegisterCodec (IntPtr system, out CODEC_DESCRIPTION description, out uint handle, uint priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RegisterDSP (IntPtr system, ref DSP_DESCRIPTION description, out uint handle); + //[DllImport(VERSION.dll)] + //private static extern RESULT FMOD5_System_RegisterOutput (IntPtr system, ref OUTPUT_DESCRIPTION description, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Init (IntPtr system, int maxchannels, INITFLAGS flags, IntPtr extradriverdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Close (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Update (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSpeakerPosition (IntPtr system, SPEAKER speaker, float x, float y, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSpeakerPosition (IntPtr system, SPEAKER speaker, out float x, out float y, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetStreamBufferSize (IntPtr system, uint filebuffersize, TIMEUNIT filebuffersizetype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetStreamBufferSize (IntPtr system, out uint filebuffersize, out TIMEUNIT filebuffersizetype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DSettings (IntPtr system, float dopplerscale, float distancefactor, float rolloffscale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DSettings (IntPtr system, out float dopplerscale, out float distancefactor, out float rolloffscale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DNumListeners (IntPtr system, int numlisteners); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DNumListeners (IntPtr system, out int numlisteners); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DListenerAttributes (IntPtr system, int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DListenerAttributes (IntPtr system, int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DRolloffCallback (IntPtr system, CB_3D_ROLLOFF_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_MixerSuspend (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_MixerResume (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDefaultMixMatrix (IntPtr system, SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSpeakerModeChannels (IntPtr system, SPEAKERMODE mode, out int channels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetVersion (IntPtr system, out uint version); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutputHandle (IntPtr system, out IntPtr handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, out int realchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetFileUsage (IntPtr system, out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSound (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSound (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateStream (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateStream (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSP (IntPtr system, ref DSP_DESCRIPTION description, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSPByType (IntPtr system, DSP_TYPE type, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateChannelGroup (IntPtr system, byte[] name, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSoundGroup (IntPtr system, byte[] name, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateReverb3D (IntPtr system, out IntPtr reverb); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_PlaySound (IntPtr system, IntPtr sound, IntPtr channelgroup, bool paused, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_PlayDSP (IntPtr system, IntPtr dsp, IntPtr channelgroup, bool paused, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannel (IntPtr system, int channelid, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPInfoByType (IntPtr system, DSP_TYPE type, out IntPtr description); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetMasterChannelGroup (IntPtr system, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetMasterSoundGroup (IntPtr system, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_AttachChannelGroupToPort (IntPtr system, PORT_TYPE portType, ulong portIndex, IntPtr channelgroup, bool passThru); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_DetachChannelGroupFromPort(IntPtr system, IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetReverbProperties (IntPtr system, int instance, ref REVERB_PROPERTIES prop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetReverbProperties (IntPtr system, int instance, out REVERB_PROPERTIES prop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LockDSP (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_UnlockDSP (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordNumDrivers (IntPtr system, out int numdrivers, out int numconnected); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordPosition (IntPtr system, int id, out uint position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RecordStart (IntPtr system, int id, IntPtr sound, bool loop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RecordStop (IntPtr system, int id); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_IsRecording (IntPtr system, int id, out bool recording); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateGeometry (IntPtr system, int maxpolygons, int maxvertices, out IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetGeometrySettings (IntPtr system, float maxworldsize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetGeometrySettings (IntPtr system, out float maxworldsize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LoadGeometry (IntPtr system, IntPtr data, int datasize, out IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetGeometryOcclusion (IntPtr system, ref VECTOR listener, ref VECTOR source, out float direct, out float reverb); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetNetworkProxy (IntPtr system, byte[] proxy); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNetworkProxy (IntPtr system, IntPtr proxy, int proxylen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetNetworkTimeout (IntPtr system, int timeout); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNetworkTimeout (IntPtr system, out int timeout); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetUserData (IntPtr system, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetUserData (IntPtr system, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public System(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + + /* + 'Sound' API. + */ + public struct Sound + { + public RESULT release() + { + return FMOD5_Sound_Release(this.handle); + } + public RESULT getSystemObject(out System system) + { + return FMOD5_Sound_GetSystemObject(this.handle, out system.handle); + } + + // Standard sound manipulation functions. + public RESULT @lock(uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2) + { + return FMOD5_Sound_Lock(this.handle, offset, length, out ptr1, out ptr2, out len1, out len2); + } + public RESULT unlock(IntPtr ptr1, IntPtr ptr2, uint len1, uint len2) + { + return FMOD5_Sound_Unlock(this.handle, ptr1, ptr2, len1, len2); + } + public RESULT setDefaults(float frequency, int priority) + { + return FMOD5_Sound_SetDefaults(this.handle, frequency, priority); + } + public RESULT getDefaults(out float frequency, out int priority) + { + return FMOD5_Sound_GetDefaults(this.handle, out frequency, out priority); + } + public RESULT set3DMinMaxDistance(float min, float max) + { + return FMOD5_Sound_Set3DMinMaxDistance(this.handle, min, max); + } + public RESULT get3DMinMaxDistance(out float min, out float max) + { + return FMOD5_Sound_Get3DMinMaxDistance(this.handle, out min, out max); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_Sound_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_Sound_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_Sound_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_Sound_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + + public RESULT getSubSound(int index, out Sound subsound) + { + return FMOD5_Sound_GetSubSound(this.handle, index, out subsound.handle); + } + public RESULT getSubSoundParent(out Sound parentsound) + { + return FMOD5_Sound_GetSubSoundParent(this.handle, out parentsound.handle); + } + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_Sound_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getLength(out uint length, TIMEUNIT lengthtype) + { + return FMOD5_Sound_GetLength(this.handle, out length, lengthtype); + } + public RESULT getFormat(out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits) + { + return FMOD5_Sound_GetFormat(this.handle, out type, out format, out channels, out bits); + } + public RESULT getNumSubSounds(out int numsubsounds) + { + return FMOD5_Sound_GetNumSubSounds(this.handle, out numsubsounds); + } + public RESULT getNumTags(out int numtags, out int numtagsupdated) + { + return FMOD5_Sound_GetNumTags(this.handle, out numtags, out numtagsupdated); + } + public RESULT getTag(string name, int index, out TAG tag) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Sound_GetTag(this.handle, encoder.byteFromStringUTF8(name), index, out tag); + } + } + public RESULT getOpenState(out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy) + { + return FMOD5_Sound_GetOpenState(this.handle, out openstate, out percentbuffered, out starving, out diskbusy); + } + public RESULT readData(IntPtr buffer, uint length, out uint read) + { + return FMOD5_Sound_ReadData(this.handle, buffer, length, out read); + } + public RESULT seekData(uint pcm) + { + return FMOD5_Sound_SeekData(this.handle, pcm); + } + public RESULT setSoundGroup(SoundGroup soundgroup) + { + return FMOD5_Sound_SetSoundGroup(this.handle, soundgroup.handle); + } + public RESULT getSoundGroup(out SoundGroup soundgroup) + { + return FMOD5_Sound_GetSoundGroup(this.handle, out soundgroup.handle); + } + + // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks. + public RESULT getNumSyncPoints(out int numsyncpoints) + { + return FMOD5_Sound_GetNumSyncPoints(this.handle, out numsyncpoints); + } + public RESULT getSyncPoint(int index, out IntPtr point) + { + return FMOD5_Sound_GetSyncPoint(this.handle, index, out point); + } + public RESULT getSyncPointInfo(IntPtr point, out string name, int namelen, out uint offset, TIMEUNIT offsettype) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_Sound_GetSyncPointInfo(this.handle, point, stringMem, namelen, out offset, offsettype); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getSyncPointInfo(IntPtr point, out uint offset, TIMEUNIT offsettype) + { + return FMOD5_Sound_GetSyncPointInfo(this.handle, point, IntPtr.Zero, 0, out offset, offsettype); + } + public RESULT addSyncPoint(uint offset, TIMEUNIT offsettype, string name, out IntPtr point) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Sound_AddSyncPoint(this.handle, offset, offsettype, encoder.byteFromStringUTF8(name), out point); + } + } + public RESULT deleteSyncPoint(IntPtr point) + { + return FMOD5_Sound_DeleteSyncPoint(this.handle, point); + } + + // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time. + public RESULT setMode(MODE mode) + { + return FMOD5_Sound_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_Sound_GetMode(this.handle, out mode); + } + public RESULT setLoopCount(int loopcount) + { + return FMOD5_Sound_SetLoopCount(this.handle, loopcount); + } + public RESULT getLoopCount(out int loopcount) + { + return FMOD5_Sound_GetLoopCount(this.handle, out loopcount); + } + public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Sound_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); + } + public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Sound_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); + } + + // For MOD/S3M/XM/IT/MID sequenced formats only. + public RESULT getMusicNumChannels(out int numchannels) + { + return FMOD5_Sound_GetMusicNumChannels(this.handle, out numchannels); + } + public RESULT setMusicChannelVolume(int channel, float volume) + { + return FMOD5_Sound_SetMusicChannelVolume(this.handle, channel, volume); + } + public RESULT getMusicChannelVolume(int channel, out float volume) + { + return FMOD5_Sound_GetMusicChannelVolume(this.handle, channel, out volume); + } + public RESULT setMusicSpeed(float speed) + { + return FMOD5_Sound_SetMusicSpeed(this.handle, speed); + } + public RESULT getMusicSpeed(out float speed) + { + return FMOD5_Sound_GetMusicSpeed(this.handle, out speed); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Sound_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Sound_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Release (IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSystemObject (IntPtr sound, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Lock (IntPtr sound, uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Unlock (IntPtr sound, IntPtr ptr1, IntPtr ptr2, uint len1, uint len2); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetDefaults (IntPtr sound, float frequency, int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetDefaults (IntPtr sound, out float frequency, out int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DMinMaxDistance (IntPtr sound, float min, float max); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DMinMaxDistance (IntPtr sound, out float min, out float max); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DConeSettings (IntPtr sound, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DConeSettings (IntPtr sound, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DCustomRolloff (IntPtr sound, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DCustomRolloff (IntPtr sound, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSubSound (IntPtr sound, int index, out IntPtr subsound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSubSoundParent (IntPtr sound, out IntPtr parentsound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetName (IntPtr sound, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLength (IntPtr sound, out uint length, TIMEUNIT lengthtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetFormat (IntPtr sound, out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumSubSounds (IntPtr sound, out int numsubsounds); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumTags (IntPtr sound, out int numtags, out int numtagsupdated); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetTag (IntPtr sound, byte[] name, int index, out TAG tag); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetOpenState (IntPtr sound, out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, IntPtr buffer, uint length, out uint read); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SeekData (IntPtr sound, uint pcm); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetSoundGroup (IntPtr sound, IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSoundGroup (IntPtr sound, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumSyncPoints (IntPtr sound, out int numsyncpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSyncPoint (IntPtr sound, int index, out IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSyncPointInfo (IntPtr sound, IntPtr point, IntPtr name, int namelen, out uint offset, TIMEUNIT offsettype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_AddSyncPoint (IntPtr sound, uint offset, TIMEUNIT offsettype, byte[] name, out IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_DeleteSyncPoint (IntPtr sound, IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMode (IntPtr sound, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMode (IntPtr sound, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetLoopCount (IntPtr sound, int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLoopCount (IntPtr sound, out int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetLoopPoints (IntPtr sound, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLoopPoints (IntPtr sound, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicNumChannels (IntPtr sound, out int numchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMusicChannelVolume (IntPtr sound, int channel, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicChannelVolume (IntPtr sound, int channel, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMusicSpeed (IntPtr sound, float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicSpeed (IntPtr sound, out float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetUserData (IntPtr sound, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetUserData (IntPtr sound, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Sound(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'ChannelControl' API + */ + interface IChannelControl + { + RESULT getSystemObject (out System system); + + // General control functionality for Channels and ChannelGroups. + RESULT stop (); + RESULT setPaused (bool paused); + RESULT getPaused (out bool paused); + RESULT setVolume (float volume); + RESULT getVolume (out float volume); + RESULT setVolumeRamp (bool ramp); + RESULT getVolumeRamp (out bool ramp); + RESULT getAudibility (out float audibility); + RESULT setPitch (float pitch); + RESULT getPitch (out float pitch); + RESULT setMute (bool mute); + RESULT getMute (out bool mute); + RESULT setReverbProperties (int instance, float wet); + RESULT getReverbProperties (int instance, out float wet); + RESULT setLowPassGain (float gain); + RESULT getLowPassGain (out float gain); + RESULT setMode (MODE mode); + RESULT getMode (out MODE mode); + RESULT setCallback (CHANNELCONTROL_CALLBACK callback); + RESULT isPlaying (out 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. + RESULT setPan (float pan); + RESULT setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + RESULT setMixLevelsInput (float[] levels, int numlevels); + RESULT setMixMatrix (float[] matrix, int outchannels, int inchannels, int inchannel_hop); + RESULT getMixMatrix (float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + + // Clock based functionality. + RESULT getDSPClock (out ulong dspclock, out ulong parentclock); + RESULT setDelay (ulong dspclock_start, ulong dspclock_end, bool stopchannels); + RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end); + RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + RESULT addFadePoint (ulong dspclock, float volume); + RESULT setFadePointRamp (ulong dspclock, float volume); + RESULT removeFadePoints (ulong dspclock_start, ulong dspclock_end); + RESULT getFadePoints (ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + + // DSP effects. + RESULT getDSP (int index, out DSP dsp); + RESULT addDSP (int index, DSP dsp); + RESULT removeDSP (DSP dsp); + RESULT getNumDSPs (out int numdsps); + RESULT setDSPIndex (DSP dsp, int index); + RESULT getDSPIndex (DSP dsp, out int index); + + // 3D functionality. + RESULT set3DAttributes (ref VECTOR pos, ref VECTOR vel); + RESULT get3DAttributes (out VECTOR pos, out VECTOR vel); + RESULT set3DMinMaxDistance (float mindistance, float maxdistance); + RESULT get3DMinMaxDistance (out float mindistance, out float maxdistance); + RESULT set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume); + RESULT get3DConeSettings (out float insideconeangle, out float outsideconeangle, out float outsidevolume); + RESULT set3DConeOrientation (ref VECTOR orientation); + RESULT get3DConeOrientation (out VECTOR orientation); + RESULT set3DCustomRolloff (ref VECTOR points, int numpoints); + RESULT get3DCustomRolloff (out IntPtr points, out int numpoints); + RESULT set3DOcclusion (float directocclusion, float reverbocclusion); + RESULT get3DOcclusion (out float directocclusion, out float reverbocclusion); + RESULT set3DSpread (float angle); + RESULT get3DSpread (out float angle); + RESULT set3DLevel (float level); + RESULT get3DLevel (out float level); + RESULT set3DDopplerLevel (float level); + RESULT get3DDopplerLevel (out float level); + RESULT set3DDistanceFilter (bool custom, float customLevel, float centerFreq); + RESULT get3DDistanceFilter (out bool custom, out float customLevel, out float centerFreq); + + // Userdata set/get. + RESULT setUserData (IntPtr userdata); + RESULT getUserData (out IntPtr userdata); + } + + /* + 'Channel' API + */ + public struct Channel : IChannelControl + { + // Channel specific control functionality. + public RESULT setFrequency(float frequency) + { + return FMOD5_Channel_SetFrequency(this.handle, frequency); + } + public RESULT getFrequency(out float frequency) + { + return FMOD5_Channel_GetFrequency(this.handle, out frequency); + } + public RESULT setPriority(int priority) + { + return FMOD5_Channel_SetPriority(this.handle, priority); + } + public RESULT getPriority(out int priority) + { + return FMOD5_Channel_GetPriority(this.handle, out priority); + } + public RESULT setPosition(uint position, TIMEUNIT postype) + { + return FMOD5_Channel_SetPosition(this.handle, position, postype); + } + public RESULT getPosition(out uint position, TIMEUNIT postype) + { + return FMOD5_Channel_GetPosition(this.handle, out position, postype); + } + public RESULT setChannelGroup(ChannelGroup channelgroup) + { + return FMOD5_Channel_SetChannelGroup(this.handle, channelgroup.handle); + } + public RESULT getChannelGroup(out ChannelGroup channelgroup) + { + return FMOD5_Channel_GetChannelGroup(this.handle, out channelgroup.handle); + } + public RESULT setLoopCount(int loopcount) + { + return FMOD5_Channel_SetLoopCount(this.handle, loopcount); + } + public RESULT getLoopCount(out int loopcount) + { + return FMOD5_Channel_GetLoopCount(this.handle, out loopcount); + } + public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Channel_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); + } + public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Channel_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); + } + + // Information only functions. + public RESULT isVirtual(out bool isvirtual) + { + return FMOD5_Channel_IsVirtual(this.handle, out isvirtual); + } + public RESULT getCurrentSound(out Sound sound) + { + return FMOD5_Channel_GetCurrentSound(this.handle, out sound.handle); + } + public RESULT getIndex(out int index) + { + return FMOD5_Channel_GetIndex(this.handle, out index); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_Channel_GetSystemObject(this.handle, out system.handle); + } + + // General control functionality for Channels and ChannelGroups. + public RESULT stop() + { + return FMOD5_Channel_Stop(this.handle); + } + public RESULT setPaused(bool paused) + { + return FMOD5_Channel_SetPaused(this.handle, paused); + } + public RESULT getPaused(out bool paused) + { + return FMOD5_Channel_GetPaused(this.handle, out paused); + } + public RESULT setVolume(float volume) + { + return FMOD5_Channel_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_Channel_GetVolume(this.handle, out volume); + } + public RESULT setVolumeRamp(bool ramp) + { + return FMOD5_Channel_SetVolumeRamp(this.handle, ramp); + } + public RESULT getVolumeRamp(out bool ramp) + { + return FMOD5_Channel_GetVolumeRamp(this.handle, out ramp); + } + public RESULT getAudibility(out float audibility) + { + return FMOD5_Channel_GetAudibility(this.handle, out audibility); + } + public RESULT setPitch(float pitch) + { + return FMOD5_Channel_SetPitch(this.handle, pitch); + } + public RESULT getPitch(out float pitch) + { + return FMOD5_Channel_GetPitch(this.handle, out pitch); + } + public RESULT setMute(bool mute) + { + return FMOD5_Channel_SetMute(this.handle, mute); + } + public RESULT getMute(out bool mute) + { + return FMOD5_Channel_GetMute(this.handle, out mute); + } + public RESULT setReverbProperties(int instance, float wet) + { + return FMOD5_Channel_SetReverbProperties(this.handle, instance, wet); + } + public RESULT getReverbProperties(int instance, out float wet) + { + return FMOD5_Channel_GetReverbProperties(this.handle, instance, out wet); + } + public RESULT setLowPassGain(float gain) + { + return FMOD5_Channel_SetLowPassGain(this.handle, gain); + } + public RESULT getLowPassGain(out float gain) + { + return FMOD5_Channel_GetLowPassGain(this.handle, out gain); + } + public RESULT setMode(MODE mode) + { + return FMOD5_Channel_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_Channel_GetMode(this.handle, out mode); + } + public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) + { + return FMOD5_Channel_SetCallback(this.handle, callback); + } + public RESULT isPlaying(out bool isplaying) + { + return FMOD5_Channel_IsPlaying(this.handle, out 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. + public RESULT setPan(float pan) + { + return FMOD5_Channel_SetPan(this.handle, pan); + } + public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) + { + return FMOD5_Channel_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); + } + public RESULT setMixLevelsInput(float[] levels, int numlevels) + { + return FMOD5_Channel_SetMixLevelsInput(this.handle, levels, numlevels); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) + { + return FMOD5_Channel_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) + { + return FMOD5_Channel_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + + // Clock based functionality. + public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) + { + return FMOD5_Channel_GetDSPClock(this.handle, out dspclock, out parentclock); + } + public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels = true) + { + return FMOD5_Channel_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) + { + return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) + { + return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); + } + public RESULT addFadePoint(ulong dspclock, float volume) + { + return FMOD5_Channel_AddFadePoint(this.handle, dspclock, volume); + } + public RESULT setFadePointRamp(ulong dspclock, float volume) + { + return FMOD5_Channel_SetFadePointRamp(this.handle, dspclock, volume); + } + public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) + { + return FMOD5_Channel_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); + } + public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) + { + return FMOD5_Channel_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); + } + + // DSP effects. + public RESULT getDSP(int index, out DSP dsp) + { + return FMOD5_Channel_GetDSP(this.handle, index, out dsp.handle); + } + public RESULT addDSP(int index, DSP dsp) + { + return FMOD5_Channel_AddDSP(this.handle, index, dsp.handle); + } + public RESULT removeDSP(DSP dsp) + { + return FMOD5_Channel_RemoveDSP(this.handle, dsp.handle); + } + public RESULT getNumDSPs(out int numdsps) + { + return FMOD5_Channel_GetNumDSPs(this.handle, out numdsps); + } + public RESULT setDSPIndex(DSP dsp, int index) + { + return FMOD5_Channel_SetDSPIndex(this.handle, dsp.handle, index); + } + public RESULT getDSPIndex(DSP dsp, out int index) + { + return FMOD5_Channel_GetDSPIndex(this.handle, dsp.handle, out index); + } + + // 3D functionality. + public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) + { + return FMOD5_Channel_Set3DAttributes(this.handle, ref pos, ref vel); + } + public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) + { + return FMOD5_Channel_Get3DAttributes(this.handle, out pos, out vel); + } + public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) + { + return FMOD5_Channel_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); + } + public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) + { + return FMOD5_Channel_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_Channel_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_Channel_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DConeOrientation(ref VECTOR orientation) + { + return FMOD5_Channel_Set3DConeOrientation(this.handle, ref orientation); + } + public RESULT get3DConeOrientation(out VECTOR orientation) + { + return FMOD5_Channel_Get3DConeOrientation(this.handle, out orientation); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_Channel_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_Channel_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) + { + return FMOD5_Channel_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); + } + public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) + { + return FMOD5_Channel_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); + } + public RESULT set3DSpread(float angle) + { + return FMOD5_Channel_Set3DSpread(this.handle, angle); + } + public RESULT get3DSpread(out float angle) + { + return FMOD5_Channel_Get3DSpread(this.handle, out angle); + } + public RESULT set3DLevel(float level) + { + return FMOD5_Channel_Set3DLevel(this.handle, level); + } + public RESULT get3DLevel(out float level) + { + return FMOD5_Channel_Get3DLevel(this.handle, out level); + } + public RESULT set3DDopplerLevel(float level) + { + return FMOD5_Channel_Set3DDopplerLevel(this.handle, level); + } + public RESULT get3DDopplerLevel(out float level) + { + return FMOD5_Channel_Get3DDopplerLevel(this.handle, out level); + } + public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) + { + return FMOD5_Channel_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); + } + public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) + { + return FMOD5_Channel_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Channel_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Channel_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetFrequency (IntPtr channel, float frequency); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetFrequency (IntPtr channel, out float frequency); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPriority (IntPtr channel, int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPriority (IntPtr channel, out int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPosition (IntPtr channel, uint position, TIMEUNIT postype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPosition (IntPtr channel, out uint position, TIMEUNIT postype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetChannelGroup (IntPtr channel, IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetChannelGroup (IntPtr channel, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLoopCount (IntPtr channel, int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLoopCount (IntPtr channel, out int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLoopPoints (IntPtr channel, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLoopPoints (IntPtr channel, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_IsVirtual (IntPtr channel, out bool isvirtual); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetCurrentSound (IntPtr channel, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetIndex (IntPtr channel, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetSystemObject (IntPtr channel, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Stop (IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPaused (IntPtr channel, bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPaused (IntPtr channel, out bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetVolume (IntPtr channel, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetVolume (IntPtr channel, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetVolumeRamp (IntPtr channel, bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetVolumeRamp (IntPtr channel, out bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetAudibility (IntPtr channel, out float audibility); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPitch (IntPtr channel, float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPitch (IntPtr channel, out float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMute (IntPtr channel, bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMute (IntPtr channel, out bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetReverbProperties (IntPtr channel, int instance, float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetReverbProperties (IntPtr channel, int instance, out float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLowPassGain (IntPtr channel, float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLowPassGain (IntPtr channel, out float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMode (IntPtr channel, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMode (IntPtr channel, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetCallback (IntPtr channel, CHANNELCONTROL_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_IsPlaying (IntPtr channel, out bool isplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPan (IntPtr channel, float pan); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixLevelsOutput (IntPtr channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixLevelsInput (IntPtr channel, float[] levels, int numlevels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixMatrix (IntPtr channel, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMixMatrix (IntPtr channel, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSPClock (IntPtr channel, out ulong dspclock, out ulong parentclock); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetDelay (IntPtr channel, ulong dspclock_start, ulong dspclock_end, bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_AddFadePoint (IntPtr channel, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetFadePointRamp (IntPtr channel, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_RemoveFadePoints (IntPtr channel, ulong dspclock_start, ulong dspclock_end); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetFadePoints (IntPtr channel, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSP (IntPtr channel, int index, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_AddDSP (IntPtr channel, int index, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_RemoveDSP (IntPtr channel, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetNumDSPs (IntPtr channel, out int numdsps); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetDSPIndex (IntPtr channel, IntPtr dsp, int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSPIndex (IntPtr channel, IntPtr dsp, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DAttributes (IntPtr channel, ref VECTOR pos, ref VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DAttributes (IntPtr channel, out VECTOR pos, out VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DMinMaxDistance (IntPtr channel, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DMinMaxDistance (IntPtr channel, out float mindistance, out float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DConeSettings (IntPtr channel, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DConeSettings (IntPtr channel, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DConeOrientation (IntPtr channel, ref VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DConeOrientation (IntPtr channel, out VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DCustomRolloff (IntPtr channel, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DCustomRolloff (IntPtr channel, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DOcclusion (IntPtr channel, float directocclusion, float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DOcclusion (IntPtr channel, out float directocclusion, out float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DSpread (IntPtr channel, float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DSpread (IntPtr channel, out float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DLevel (IntPtr channel, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DLevel (IntPtr channel, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DDopplerLevel (IntPtr channel, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DDopplerLevel (IntPtr channel, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DDistanceFilter (IntPtr channel, bool custom, float customLevel, float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DDistanceFilter (IntPtr channel, out bool custom, out float customLevel, out float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetUserData (IntPtr channel, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetUserData (IntPtr channel, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Channel(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'ChannelGroup' API + */ + public struct ChannelGroup : IChannelControl + { + public RESULT release() + { + return FMOD5_ChannelGroup_Release(this.handle); + } + + // Nested channel groups. + public RESULT addGroup(ChannelGroup group, bool propagatedspclock = true) + { + return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, IntPtr.Zero); + } + public RESULT addGroup(ChannelGroup group, bool propagatedspclock, out DSPConnection connection) + { + return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, out connection.handle); + } + public RESULT getNumGroups(out int numgroups) + { + return FMOD5_ChannelGroup_GetNumGroups(this.handle, out numgroups); + } + public RESULT getGroup(int index, out ChannelGroup group) + { + return FMOD5_ChannelGroup_GetGroup(this.handle, index, out group.handle); + } + public RESULT getParentGroup(out ChannelGroup group) + { + return FMOD5_ChannelGroup_GetParentGroup(this.handle, out group.handle); + } + + // Information only functions. + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_ChannelGroup_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getNumChannels(out int numchannels) + { + return FMOD5_ChannelGroup_GetNumChannels(this.handle, out numchannels); + } + public RESULT getChannel(int index, out Channel channel) + { + return FMOD5_ChannelGroup_GetChannel(this.handle, index, out channel.handle); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_ChannelGroup_GetSystemObject(this.handle, out system.handle); + } + + // General control functionality for Channels and ChannelGroups. + public RESULT stop() + { + return FMOD5_ChannelGroup_Stop(this.handle); + } + public RESULT setPaused(bool paused) + { + return FMOD5_ChannelGroup_SetPaused(this.handle, paused); + } + public RESULT getPaused(out bool paused) + { + return FMOD5_ChannelGroup_GetPaused(this.handle, out paused); + } + public RESULT setVolume(float volume) + { + return FMOD5_ChannelGroup_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_ChannelGroup_GetVolume(this.handle, out volume); + } + public RESULT setVolumeRamp(bool ramp) + { + return FMOD5_ChannelGroup_SetVolumeRamp(this.handle, ramp); + } + public RESULT getVolumeRamp(out bool ramp) + { + return FMOD5_ChannelGroup_GetVolumeRamp(this.handle, out ramp); + } + public RESULT getAudibility(out float audibility) + { + return FMOD5_ChannelGroup_GetAudibility(this.handle, out audibility); + } + public RESULT setPitch(float pitch) + { + return FMOD5_ChannelGroup_SetPitch(this.handle, pitch); + } + public RESULT getPitch(out float pitch) + { + return FMOD5_ChannelGroup_GetPitch(this.handle, out pitch); + } + public RESULT setMute(bool mute) + { + return FMOD5_ChannelGroup_SetMute(this.handle, mute); + } + public RESULT getMute(out bool mute) + { + return FMOD5_ChannelGroup_GetMute(this.handle, out mute); + } + public RESULT setReverbProperties(int instance, float wet) + { + return FMOD5_ChannelGroup_SetReverbProperties(this.handle, instance, wet); + } + public RESULT getReverbProperties(int instance, out float wet) + { + return FMOD5_ChannelGroup_GetReverbProperties(this.handle, instance, out wet); + } + public RESULT setLowPassGain(float gain) + { + return FMOD5_ChannelGroup_SetLowPassGain(this.handle, gain); + } + public RESULT getLowPassGain(out float gain) + { + return FMOD5_ChannelGroup_GetLowPassGain(this.handle, out gain); + } + public RESULT setMode(MODE mode) + { + return FMOD5_ChannelGroup_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_ChannelGroup_GetMode(this.handle, out mode); + } + public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) + { + return FMOD5_ChannelGroup_SetCallback(this.handle, callback); + } + public RESULT isPlaying(out bool isplaying) + { + return FMOD5_ChannelGroup_IsPlaying(this.handle, out 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. + public RESULT setPan(float pan) + { + return FMOD5_ChannelGroup_SetPan(this.handle, pan); + } + public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) + { + return FMOD5_ChannelGroup_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); + } + public RESULT setMixLevelsInput(float[] levels, int numlevels) + { + return FMOD5_ChannelGroup_SetMixLevelsInput(this.handle, levels, numlevels); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop) + { + return FMOD5_ChannelGroup_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop) + { + return FMOD5_ChannelGroup_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + + // Clock based functionality. + public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) + { + return FMOD5_ChannelGroup_GetDSPClock(this.handle, out dspclock, out parentclock); + } + public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels) + { + return FMOD5_ChannelGroup_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) + { + return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) + { + return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); + } + public RESULT addFadePoint(ulong dspclock, float volume) + { + return FMOD5_ChannelGroup_AddFadePoint(this.handle, dspclock, volume); + } + public RESULT setFadePointRamp(ulong dspclock, float volume) + { + return FMOD5_ChannelGroup_SetFadePointRamp(this.handle, dspclock, volume); + } + public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) + { + return FMOD5_ChannelGroup_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); + } + public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) + { + return FMOD5_ChannelGroup_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); + } + + // DSP effects. + public RESULT getDSP(int index, out DSP dsp) + { + return FMOD5_ChannelGroup_GetDSP(this.handle, index, out dsp.handle); + } + public RESULT addDSP(int index, DSP dsp) + { + return FMOD5_ChannelGroup_AddDSP(this.handle, index, dsp.handle); + } + public RESULT removeDSP(DSP dsp) + { + return FMOD5_ChannelGroup_RemoveDSP(this.handle, dsp.handle); + } + public RESULT getNumDSPs(out int numdsps) + { + return FMOD5_ChannelGroup_GetNumDSPs(this.handle, out numdsps); + } + public RESULT setDSPIndex(DSP dsp, int index) + { + return FMOD5_ChannelGroup_SetDSPIndex(this.handle, dsp.handle, index); + } + public RESULT getDSPIndex(DSP dsp, out int index) + { + return FMOD5_ChannelGroup_GetDSPIndex(this.handle, dsp.handle, out index); + } + + // 3D functionality. + public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) + { + return FMOD5_ChannelGroup_Set3DAttributes(this.handle, ref pos, ref vel); + } + public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) + { + return FMOD5_ChannelGroup_Get3DAttributes(this.handle, out pos, out vel); + } + public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) + { + return FMOD5_ChannelGroup_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); + } + public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) + { + return FMOD5_ChannelGroup_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_ChannelGroup_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_ChannelGroup_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DConeOrientation(ref VECTOR orientation) + { + return FMOD5_ChannelGroup_Set3DConeOrientation(this.handle, ref orientation); + } + public RESULT get3DConeOrientation(out VECTOR orientation) + { + return FMOD5_ChannelGroup_Get3DConeOrientation(this.handle, out orientation); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_ChannelGroup_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_ChannelGroup_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) + { + return FMOD5_ChannelGroup_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); + } + public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) + { + return FMOD5_ChannelGroup_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); + } + public RESULT set3DSpread(float angle) + { + return FMOD5_ChannelGroup_Set3DSpread(this.handle, angle); + } + public RESULT get3DSpread(out float angle) + { + return FMOD5_ChannelGroup_Get3DSpread(this.handle, out angle); + } + public RESULT set3DLevel(float level) + { + return FMOD5_ChannelGroup_Set3DLevel(this.handle, level); + } + public RESULT get3DLevel(out float level) + { + return FMOD5_ChannelGroup_Get3DLevel(this.handle, out level); + } + public RESULT set3DDopplerLevel(float level) + { + return FMOD5_ChannelGroup_Set3DDopplerLevel(this.handle, level); + } + public RESULT get3DDopplerLevel(out float level) + { + return FMOD5_ChannelGroup_Get3DDopplerLevel(this.handle, out level); + } + public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) + { + return FMOD5_ChannelGroup_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); + } + public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) + { + return FMOD5_ChannelGroup_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_ChannelGroup_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_ChannelGroup_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Release (IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, out IntPtr connection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumGroups (IntPtr channelgroup, out int numgroups); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetGroup (IntPtr channelgroup, int index, out IntPtr group); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetParentGroup (IntPtr channelgroup, out IntPtr group); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetName (IntPtr channelgroup, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumChannels (IntPtr channelgroup, out int numchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetChannel (IntPtr channelgroup, int index, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetSystemObject (IntPtr channelgroup, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Stop (IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPaused (IntPtr channelgroup, bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetPaused (IntPtr channelgroup, out bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetVolume (IntPtr channelgroup, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetVolume (IntPtr channelgroup, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetVolumeRamp (IntPtr channelgroup, bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetVolumeRamp (IntPtr channelgroup, out bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetAudibility (IntPtr channelgroup, out float audibility); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPitch (IntPtr channelgroup, float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetPitch (IntPtr channelgroup, out float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMute (IntPtr channelgroup, bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMute (IntPtr channelgroup, out bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetReverbProperties (IntPtr channelgroup, int instance, float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetReverbProperties (IntPtr channelgroup, int instance, out float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetLowPassGain (IntPtr channelgroup, float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetLowPassGain (IntPtr channelgroup, out float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMode (IntPtr channelgroup, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMode (IntPtr channelgroup, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetCallback (IntPtr channelgroup, CHANNELCONTROL_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_IsPlaying (IntPtr channelgroup, out bool isplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPan (IntPtr channelgroup, float pan); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsOutput (IntPtr channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsInput (IntPtr channelgroup, float[] levels, int numlevels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixMatrix (IntPtr channelgroup, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMixMatrix (IntPtr channelgroup, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSPClock (IntPtr channelgroup, out ulong dspclock, out ulong parentclock); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetDelay (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end, bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddFadePoint (IntPtr channelgroup, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetFadePointRamp (IntPtr channelgroup, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_RemoveFadePoints (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetFadePoints (IntPtr channelgroup, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSP (IntPtr channelgroup, int index, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddDSP (IntPtr channelgroup, int index, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_RemoveDSP (IntPtr channelgroup, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumDSPs (IntPtr channelgroup, out int numdsps); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetDSPIndex (IntPtr channelgroup, IntPtr dsp, int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSPIndex (IntPtr channelgroup, IntPtr dsp, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DAttributes (IntPtr channelgroup, ref VECTOR pos, ref VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DAttributes (IntPtr channelgroup, out VECTOR pos, out VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DMinMaxDistance (IntPtr channelgroup, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DMinMaxDistance (IntPtr channelgroup, out float mindistance, out float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DConeSettings (IntPtr channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DConeSettings (IntPtr channelgroup, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DConeOrientation(IntPtr channelgroup, ref VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DConeOrientation(IntPtr channelgroup, out VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DCustomRolloff (IntPtr channelgroup, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DCustomRolloff (IntPtr channelgroup, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DOcclusion (IntPtr channelgroup, float directocclusion, float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DOcclusion (IntPtr channelgroup, out float directocclusion, out float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DSpread (IntPtr channelgroup, float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DSpread (IntPtr channelgroup, out float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DLevel (IntPtr channelgroup, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DLevel (IntPtr channelgroup, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DDopplerLevel (IntPtr channelgroup, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DDopplerLevel (IntPtr channelgroup, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DDistanceFilter (IntPtr channelgroup, bool custom, float customLevel, float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DDistanceFilter (IntPtr channelgroup, out bool custom, out float customLevel, out float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetUserData (IntPtr channelgroup, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetUserData (IntPtr channelgroup, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public ChannelGroup(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'SoundGroup' API + */ + public struct SoundGroup + { + public RESULT release() + { + return FMOD5_SoundGroup_Release(this.handle); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_SoundGroup_GetSystemObject(this.handle, out system.handle); + } + + // SoundGroup control functions. + public RESULT setMaxAudible(int maxaudible) + { + return FMOD5_SoundGroup_SetMaxAudible(this.handle, maxaudible); + } + public RESULT getMaxAudible(out int maxaudible) + { + return FMOD5_SoundGroup_GetMaxAudible(this.handle, out maxaudible); + } + public RESULT setMaxAudibleBehavior(SOUNDGROUP_BEHAVIOR behavior) + { + return FMOD5_SoundGroup_SetMaxAudibleBehavior(this.handle, behavior); + } + public RESULT getMaxAudibleBehavior(out SOUNDGROUP_BEHAVIOR behavior) + { + return FMOD5_SoundGroup_GetMaxAudibleBehavior(this.handle, out behavior); + } + public RESULT setMuteFadeSpeed(float speed) + { + return FMOD5_SoundGroup_SetMuteFadeSpeed(this.handle, speed); + } + public RESULT getMuteFadeSpeed(out float speed) + { + return FMOD5_SoundGroup_GetMuteFadeSpeed(this.handle, out speed); + } + public RESULT setVolume(float volume) + { + return FMOD5_SoundGroup_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_SoundGroup_GetVolume(this.handle, out volume); + } + public RESULT stop() + { + return FMOD5_SoundGroup_Stop(this.handle); + } + + // Information only functions. + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_SoundGroup_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getNumSounds(out int numsounds) + { + return FMOD5_SoundGroup_GetNumSounds(this.handle, out numsounds); + } + public RESULT getSound(int index, out Sound sound) + { + return FMOD5_SoundGroup_GetSound(this.handle, index, out sound.handle); + } + public RESULT getNumPlaying(out int numplaying) + { + return FMOD5_SoundGroup_GetNumPlaying(this.handle, out numplaying); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_SoundGroup_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_SoundGroup_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_Release (IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetSystemObject (IntPtr soundgroup, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMaxAudible (IntPtr soundgroup, int maxaudible); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMaxAudible (IntPtr soundgroup, out int maxaudible); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMaxAudibleBehavior (IntPtr soundgroup, SOUNDGROUP_BEHAVIOR behavior); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMaxAudibleBehavior (IntPtr soundgroup, out SOUNDGROUP_BEHAVIOR behavior); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMuteFadeSpeed (IntPtr soundgroup, float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMuteFadeSpeed (IntPtr soundgroup, out float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetVolume (IntPtr soundgroup, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetVolume (IntPtr soundgroup, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_Stop (IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetName (IntPtr soundgroup, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetNumSounds (IntPtr soundgroup, out int numsounds); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetSound (IntPtr soundgroup, int index, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetNumPlaying (IntPtr soundgroup, out int numplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetUserData (IntPtr soundgroup, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetUserData (IntPtr soundgroup, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public SoundGroup(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'DSP' API + */ + public struct DSP + { + public RESULT release() + { + return FMOD5_DSP_Release(this.handle); + } + public RESULT getSystemObject(out System system) + { + return FMOD5_DSP_GetSystemObject(this.handle, out system.handle); + } + + // Connection / disconnection / input and output enumeration. + public RESULT addInput(DSP input) + { + return FMOD5_DSP_AddInput(this.handle, input.handle, IntPtr.Zero, DSPCONNECTION_TYPE.STANDARD); + } + public RESULT addInput(DSP input, out DSPConnection connection, DSPCONNECTION_TYPE type = DSPCONNECTION_TYPE.STANDARD) + { + return FMOD5_DSP_AddInput(this.handle, input.handle, out connection.handle, type); + } + public RESULT disconnectFrom(DSP target, DSPConnection connection) + { + return FMOD5_DSP_DisconnectFrom(this.handle, target.handle, connection.handle); + } + public RESULT disconnectAll(bool inputs, bool outputs) + { + return FMOD5_DSP_DisconnectAll(this.handle, inputs, outputs); + } + public RESULT getNumInputs(out int numinputs) + { + return FMOD5_DSP_GetNumInputs(this.handle, out numinputs); + } + public RESULT getNumOutputs(out int numoutputs) + { + return FMOD5_DSP_GetNumOutputs(this.handle, out numoutputs); + } + public RESULT getInput(int index, out DSP input, out DSPConnection inputconnection) + { + return FMOD5_DSP_GetInput(this.handle, index, out input.handle, out inputconnection.handle); + } + public RESULT getOutput(int index, out DSP output, out DSPConnection outputconnection) + { + return FMOD5_DSP_GetOutput(this.handle, index, out output.handle, out outputconnection.handle); + } + + // DSP unit control. + public RESULT setActive(bool active) + { + return FMOD5_DSP_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_DSP_GetActive(this.handle, out active); + } + public RESULT setBypass(bool bypass) + { + return FMOD5_DSP_SetBypass(this.handle, bypass); + } + public RESULT getBypass(out bool bypass) + { + return FMOD5_DSP_GetBypass(this.handle, out bypass); + } + public RESULT setWetDryMix(float prewet, float postwet, float dry) + { + return FMOD5_DSP_SetWetDryMix(this.handle, prewet, postwet, dry); + } + public RESULT getWetDryMix(out float prewet, out float postwet, out float dry) + { + return FMOD5_DSP_GetWetDryMix(this.handle, out prewet, out postwet, out dry); + } + public RESULT setChannelFormat(CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode) + { + return FMOD5_DSP_SetChannelFormat(this.handle, channelmask, numchannels, source_speakermode); + } + public RESULT getChannelFormat(out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode) + { + return FMOD5_DSP_GetChannelFormat(this.handle, out channelmask, out numchannels, out source_speakermode); + } + public RESULT getOutputChannelFormat(CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode) + { + return FMOD5_DSP_GetOutputChannelFormat(this.handle, inmask, inchannels, inspeakermode, out outmask, out outchannels, out outspeakermode); + } + public RESULT reset() + { + return FMOD5_DSP_Reset(this.handle); + } + + // DSP parameter control. + public RESULT setParameterFloat(int index, float value) + { + return FMOD5_DSP_SetParameterFloat(this.handle, index, value); + } + public RESULT setParameterInt(int index, int value) + { + return FMOD5_DSP_SetParameterInt(this.handle, index, value); + } + public RESULT setParameterBool(int index, bool value) + { + return FMOD5_DSP_SetParameterBool(this.handle, index, value); + } + public RESULT setParameterData(int index, byte[] data) + { + return FMOD5_DSP_SetParameterData(this.handle, index, Marshal.UnsafeAddrOfPinnedArrayElement(data, 0), (uint)data.Length); + } + public RESULT getParameterFloat(int index, out float value) + { + return FMOD5_DSP_GetParameterFloat(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterInt(int index, out int value) + { + return FMOD5_DSP_GetParameterInt(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterBool(int index, out bool value) + { + return FMOD5_DSP_GetParameterBool(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterData(int index, out IntPtr data, out uint length) + { + return FMOD5_DSP_GetParameterData(this.handle, index, out data, out length, IntPtr.Zero, 0); + } + public RESULT getNumParameters(out int numparams) + { + return FMOD5_DSP_GetNumParameters(this.handle, out numparams); + } + public RESULT getParameterInfo(int index, out DSP_PARAMETER_DESC desc) + { + IntPtr descPtr; + RESULT result = FMOD5_DSP_GetParameterInfo(this.handle, index, out descPtr); + desc = (DSP_PARAMETER_DESC)MarshalHelper.PtrToStructure(descPtr, typeof(DSP_PARAMETER_DESC)); + return result; + } + public RESULT getDataParameterIndex(int datatype, out int index) + { + return FMOD5_DSP_GetDataParameterIndex(this.handle, datatype, out index); + } + public RESULT showConfigDialog(IntPtr hwnd, bool show) + { + return FMOD5_DSP_ShowConfigDialog(this.handle, hwnd, show); + } + + // DSP attributes. + public RESULT getInfo(out string name, out uint version, out int channels, out int configwidth, out int configheight) + { + IntPtr nameMem = Marshal.AllocHGlobal(32); + + RESULT result = FMOD5_DSP_GetInfo(this.handle, nameMem, out version, out channels, out configwidth, out configheight); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(nameMem); + } + Marshal.FreeHGlobal(nameMem); + return result; + } + public RESULT getInfo(out uint version, out int channels, out int configwidth, out int configheight) + { + return FMOD5_DSP_GetInfo(this.handle, IntPtr.Zero, out version, out channels, out configwidth, out configheight); ; + } + public RESULT getType(out DSP_TYPE type) + { + return FMOD5_DSP_GetType(this.handle, out type); + } + public RESULT getIdle(out bool idle) + { + return FMOD5_DSP_GetIdle(this.handle, out idle); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_DSP_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_DSP_GetUserData(this.handle, out userdata); + } + + // Metering. + public RESULT setMeteringEnabled(bool inputEnabled, bool outputEnabled) + { + return FMOD5_DSP_SetMeteringEnabled(this.handle, inputEnabled, outputEnabled); + } + public RESULT getMeteringEnabled(out bool inputEnabled, out bool outputEnabled) + { + return FMOD5_DSP_GetMeteringEnabled(this.handle, out inputEnabled, out outputEnabled); + } + + public RESULT getMeteringInfo(IntPtr zero, out DSP_METERING_INFO outputInfo) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, zero, out outputInfo); + } + public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, IntPtr zero) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, zero); + } + public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, out outputInfo); + } + + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD5_DSP_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_Release (IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetSystemObject (IntPtr dsp, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, IntPtr zero, DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, out IntPtr connection, DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_DisconnectFrom (IntPtr dsp, IntPtr target, IntPtr connection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_DisconnectAll (IntPtr dsp, bool inputs, bool outputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumInputs (IntPtr dsp, out int numinputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumOutputs (IntPtr dsp, out int numoutputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetInput (IntPtr dsp, int index, out IntPtr input, out IntPtr inputconnection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetOutput (IntPtr dsp, int index, out IntPtr output, out IntPtr outputconnection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetActive (IntPtr dsp, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetActive (IntPtr dsp, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetBypass (IntPtr dsp, bool bypass); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetBypass (IntPtr dsp, out bool bypass); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetWetDryMix (IntPtr dsp, float prewet, float postwet, float dry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetWetDryMix (IntPtr dsp, out float prewet, out float postwet, out float dry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetChannelFormat (IntPtr dsp, CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetChannelFormat (IntPtr dsp, out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetOutputChannelFormat (IntPtr dsp, CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_Reset (IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterFloat (IntPtr dsp, int index, float value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterInt (IntPtr dsp, int index, int value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterBool (IntPtr dsp, int index, bool value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterData (IntPtr dsp, int index, IntPtr data, uint length); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterFloat (IntPtr dsp, int index, out float value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterInt (IntPtr dsp, int index, out int value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterBool (IntPtr dsp, int index, out bool value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterData (IntPtr dsp, int index, out IntPtr data, out uint length, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumParameters (IntPtr dsp, out int numparams); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterInfo (IntPtr dsp, int index, out IntPtr desc); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetDataParameterIndex (IntPtr dsp, int datatype, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_ShowConfigDialog (IntPtr dsp, IntPtr hwnd, bool show); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetInfo (IntPtr dsp, IntPtr name, out uint version, out int channels, out int configwidth, out int configheight); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetType (IntPtr dsp, out DSP_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetIdle (IntPtr dsp, out bool idle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetUserData (IntPtr dsp, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetUserData (IntPtr dsp, out IntPtr userdata); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_SetMeteringEnabled (IntPtr dsp, bool inputEnabled, bool outputEnabled); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringEnabled (IntPtr dsp, out bool inputEnabled, out bool outputEnabled); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, IntPtr zero, out DSP_METERING_INFO outputInfo); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, IntPtr zero); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetCPUUsage (IntPtr dsp, out uint exclusive, out uint inclusive); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public DSP(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'DSPConnection' API + */ + public struct DSPConnection + { + public RESULT getInput(out DSP input) + { + return FMOD5_DSPConnection_GetInput(this.handle, out input.handle); + } + public RESULT getOutput(out DSP output) + { + return FMOD5_DSPConnection_GetOutput(this.handle, out output.handle); + } + public RESULT setMix(float volume) + { + return FMOD5_DSPConnection_SetMix(this.handle, volume); + } + public RESULT getMix(out float volume) + { + return FMOD5_DSPConnection_GetMix(this.handle, out volume); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) + { + return FMOD5_DSPConnection_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) + { + return FMOD5_DSPConnection_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + public RESULT getType(out DSPCONNECTION_TYPE type) + { + return FMOD5_DSPConnection_GetType(this.handle, out type); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_DSPConnection_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_DSPConnection_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetInput (IntPtr dspconnection, out IntPtr input); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetOutput (IntPtr dspconnection, out IntPtr output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetMix (IntPtr dspconnection, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetMix (IntPtr dspconnection, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetMixMatrix (IntPtr dspconnection, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetMixMatrix (IntPtr dspconnection, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetType (IntPtr dspconnection, out DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetUserData (IntPtr dspconnection, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetUserData (IntPtr dspconnection, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public DSPConnection(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'Geometry' API + */ + public struct Geometry + { + public RESULT release() + { + return FMOD5_Geometry_Release(this.handle); + } + + // Polygon manipulation. + public RESULT addPolygon(float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex) + { + return FMOD5_Geometry_AddPolygon(this.handle, directocclusion, reverbocclusion, doublesided, numvertices, vertices, out polygonindex); + } + public RESULT getNumPolygons(out int numpolygons) + { + return FMOD5_Geometry_GetNumPolygons(this.handle, out numpolygons); + } + public RESULT getMaxPolygons(out int maxpolygons, out int maxvertices) + { + return FMOD5_Geometry_GetMaxPolygons(this.handle, out maxpolygons, out maxvertices); + } + public RESULT getPolygonNumVertices(int index, out int numvertices) + { + return FMOD5_Geometry_GetPolygonNumVertices(this.handle, index, out numvertices); + } + public RESULT setPolygonVertex(int index, int vertexindex, ref VECTOR vertex) + { + return FMOD5_Geometry_SetPolygonVertex(this.handle, index, vertexindex, ref vertex); + } + public RESULT getPolygonVertex(int index, int vertexindex, out VECTOR vertex) + { + return FMOD5_Geometry_GetPolygonVertex(this.handle, index, vertexindex, out vertex); + } + public RESULT setPolygonAttributes(int index, float directocclusion, float reverbocclusion, bool doublesided) + { + return FMOD5_Geometry_SetPolygonAttributes(this.handle, index, directocclusion, reverbocclusion, doublesided); + } + public RESULT getPolygonAttributes(int index, out float directocclusion, out float reverbocclusion, out bool doublesided) + { + return FMOD5_Geometry_GetPolygonAttributes(this.handle, index, out directocclusion, out reverbocclusion, out doublesided); + } + + // Object manipulation. + public RESULT setActive(bool active) + { + return FMOD5_Geometry_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_Geometry_GetActive(this.handle, out active); + } + public RESULT setRotation(ref VECTOR forward, ref VECTOR up) + { + return FMOD5_Geometry_SetRotation(this.handle, ref forward, ref up); + } + public RESULT getRotation(out VECTOR forward, out VECTOR up) + { + return FMOD5_Geometry_GetRotation(this.handle, out forward, out up); + } + public RESULT setPosition(ref VECTOR position) + { + return FMOD5_Geometry_SetPosition(this.handle, ref position); + } + public RESULT getPosition(out VECTOR position) + { + return FMOD5_Geometry_GetPosition(this.handle, out position); + } + public RESULT setScale(ref VECTOR scale) + { + return FMOD5_Geometry_SetScale(this.handle, ref scale); + } + public RESULT getScale(out VECTOR scale) + { + return FMOD5_Geometry_GetScale(this.handle, out scale); + } + public RESULT save(IntPtr data, out int datasize) + { + return FMOD5_Geometry_Save(this.handle, data, out datasize); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Geometry_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Geometry_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_Release (IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_AddPolygon (IntPtr geometry, float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetNumPolygons (IntPtr geometry, out int numpolygons); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetMaxPolygons (IntPtr geometry, out int maxpolygons, out int maxvertices); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonNumVertices(IntPtr geometry, int index, out int numvertices); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPolygonVertex (IntPtr geometry, int index, int vertexindex, ref VECTOR vertex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonVertex (IntPtr geometry, int index, int vertexindex, out VECTOR vertex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPolygonAttributes (IntPtr geometry, int index, float directocclusion, float reverbocclusion, bool doublesided); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonAttributes (IntPtr geometry, int index, out float directocclusion, out float reverbocclusion, out bool doublesided); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetActive (IntPtr geometry, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetActive (IntPtr geometry, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetRotation (IntPtr geometry, ref VECTOR forward, ref VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetRotation (IntPtr geometry, out VECTOR forward, out VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPosition (IntPtr geometry, ref VECTOR position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPosition (IntPtr geometry, out VECTOR position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetScale (IntPtr geometry, ref VECTOR scale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetScale (IntPtr geometry, out VECTOR scale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_Save (IntPtr geometry, IntPtr data, out int datasize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetUserData (IntPtr geometry, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetUserData (IntPtr geometry, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Geometry(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'Reverb3D' API + */ + public struct Reverb3D + { + public RESULT release() + { + return FMOD5_Reverb3D_Release(this.handle); + } + + // Reverb manipulation. + public RESULT set3DAttributes(ref VECTOR position, float mindistance, float maxdistance) + { + return FMOD5_Reverb3D_Set3DAttributes(this.handle, ref position, mindistance, maxdistance); + } + public RESULT get3DAttributes(ref VECTOR position, ref float mindistance, ref float maxdistance) + { + return FMOD5_Reverb3D_Get3DAttributes(this.handle, ref position, ref mindistance, ref maxdistance); + } + public RESULT setProperties(ref REVERB_PROPERTIES properties) + { + return FMOD5_Reverb3D_SetProperties(this.handle, ref properties); + } + public RESULT getProperties(ref REVERB_PROPERTIES properties) + { + return FMOD5_Reverb3D_GetProperties(this.handle, ref properties); + } + public RESULT setActive(bool active) + { + return FMOD5_Reverb3D_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_Reverb3D_GetActive(this.handle, out active); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Reverb3D_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Reverb3D_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Release (IntPtr reverb3d); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Set3DAttributes (IntPtr reverb3d, ref VECTOR position, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Get3DAttributes (IntPtr reverb3d, ref VECTOR position, ref float mindistance, ref float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetActive (IntPtr reverb3d, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetActive (IntPtr reverb3d, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetUserData (IntPtr reverb3d, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetUserData (IntPtr reverb3d, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Reverb3D(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + #region Helper Functions + [StructLayout(LayoutKind.Sequential)] + public struct StringWrapper + { + IntPtr nativeUtf8Ptr; + + public StringWrapper(IntPtr ptr) + { + nativeUtf8Ptr = ptr; + } + + public static implicit operator string(StringWrapper fstring) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return encoder.stringFromNative(fstring.nativeUtf8Ptr); + } + } + } + + static class StringHelper + { + public class ThreadSafeEncoding : IDisposable + { + UTF8Encoding encoding = new UTF8Encoding(); + byte[] encodedBuffer = new byte[128]; + char[] decodedBuffer = new char[128]; + bool inUse; + GCHandle gcHandle; + + public bool InUse() { return inUse; } + public void SetInUse() { inUse = true; } + + private int roundUpPowerTwo(int number) + { + int newNumber = 1; + while (newNumber <= number) + { + newNumber *= 2; + } + + return newNumber; + } + + public byte[] byteFromStringUTF8(string s) + { + if (s == null) + { + return null; + } + + int maximumLength = encoding.GetMaxByteCount(s.Length) + 1; // +1 for null terminator + if (maximumLength > encodedBuffer.Length) + { + int encodedLength = encoding.GetByteCount(s) + 1; // +1 for null terminator + if (encodedLength > encodedBuffer.Length) + { + encodedBuffer = new byte[roundUpPowerTwo(encodedLength)]; + } + } + + int byteCount = encoding.GetBytes(s, 0, s.Length, encodedBuffer, 0); + encodedBuffer[byteCount] = 0; // Apply null terminator + + return encodedBuffer; + } + + public IntPtr intptrFromStringUTF8(string s) + { + if (s == null) + { + return IntPtr.Zero; + } + + gcHandle = GCHandle.Alloc(byteFromStringUTF8(s), GCHandleType.Pinned); + return gcHandle.AddrOfPinnedObject(); + } + + public string stringFromNative(IntPtr nativePtr) + { + if (nativePtr == IntPtr.Zero) + { + return ""; + } + + int nativeLen = 0; + while (Marshal.ReadByte(nativePtr, nativeLen) != 0) + { + nativeLen++; + } + + if (nativeLen == 0) + { + return ""; + } + + if (nativeLen > encodedBuffer.Length) + { + encodedBuffer = new byte[roundUpPowerTwo(nativeLen)]; + } + + Marshal.Copy(nativePtr, encodedBuffer, 0, nativeLen); + + int maximumLength = encoding.GetMaxCharCount(nativeLen); + if (maximumLength > decodedBuffer.Length) + { + int decodedLength = encoding.GetCharCount(encodedBuffer, 0, nativeLen); + if (decodedLength > decodedBuffer.Length) + { + decodedBuffer = new char[roundUpPowerTwo(decodedLength)]; + } + } + + int charCount = encoding.GetChars(encodedBuffer, 0, nativeLen, decodedBuffer, 0); + + return new String(decodedBuffer, 0, charCount); + } + + public void Dispose() + { + if (gcHandle.IsAllocated) + { + gcHandle.Free(); + } + lock (encoders) + { + inUse = false; + } + } + } + + static List encoders = new List(1); + + public static ThreadSafeEncoding GetFreeHelper() + { + lock (encoders) + { + ThreadSafeEncoding helper = null; + // Search for not in use helper + for (int i = 0; i < encoders.Count; i++) + { + if (!encoders[i].InUse()) + { + helper = encoders[i]; + break; + } + } + // Otherwise create another helper + if (helper == null) + { + helper = new ThreadSafeEncoding(); + encoders.Add(helper); + } + helper.SetInUse(); + return helper; + } + } + } + + // Some of the Marshal functions were marked as deprecated / obsolete, however that decision was reversed: https://github.com/dotnet/corefx/pull/10541 + // Use the old syntax (non-generic) to ensure maximum compatibility (especially with Unity) ignoring the warnings + public static class MarshalHelper + { +#pragma warning disable 618 + public static int SizeOf(Type t) + { + return Marshal.SizeOf(t); // Always use Type version, never Object version as it boxes causes GC allocations + } + + public static object PtrToStructure(IntPtr ptr, Type structureType) + { + return Marshal.PtrToStructure(ptr, structureType); + } +#pragma warning restore 618 + } + + #endregion +} diff --git a/vendor/fmod/inc/fmod.h b/vendor/fmod/inc/fmod.h new file mode 100644 index 0000000..0c73298 --- /dev/null +++ b/vendor/fmod/inc/fmod.h @@ -0,0 +1,667 @@ +/* ======================================================================================== */ +/* 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_RESULT F_API FMOD_Thread_SetAttributes (FMOD_THREAD_TYPE type, FMOD_THREAD_AFFINITY affinity, FMOD_THREAD_PRIORITY priority, FMOD_THREAD_STACK_SIZE stacksize); + +/* + 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, unsigned int headerversion); +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, FMOD_CPU_USAGE *usage); +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_GetDSPInfoByType (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, const FMOD_DSP_DESCRIPTION **description); +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 */ diff --git a/vendor/fmod/inc/fmod.hpp b/vendor/fmod/inc/fmod.hpp new file mode 100644 index 0000000..243b270 --- /dev/null +++ b/vendor/fmod/inc/fmod.hpp @@ -0,0 +1,606 @@ +/* ======================================================================================== */ +/* 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); } + inline FMOD_RESULT Thread_SetAttributes (FMOD_THREAD_TYPE type, FMOD_THREAD_AFFINITY affinity = FMOD_THREAD_AFFINITY_GROUP_DEFAULT, FMOD_THREAD_PRIORITY priority = FMOD_THREAD_PRIORITY_DEFAULT, FMOD_THREAD_STACK_SIZE stacksize = FMOD_THREAD_STACK_SIZE_DEFAULT) { return FMOD_Thread_SetAttributes(type, affinity, priority, stacksize); } + + /* + FMOD System factory functions. + */ + inline FMOD_RESULT System_Create (System **system, unsigned int headerversion = FMOD_VERSION) { return FMOD_System_Create((FMOD_SYSTEM **)system, headerversion); } + + /* + '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 (FMOD_CPU_USAGE *usage); + 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 getDSPInfoByType (FMOD_DSP_TYPE type, const FMOD_DSP_DESCRIPTION **description); + 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 diff --git a/vendor/fmod/inc/fmod_codec.h b/vendor/fmod/inc/fmod_codec.h new file mode 100644 index 0000000..668d9cf --- /dev/null +++ b/vendor/fmod/inc/fmod_codec.h @@ -0,0 +1,136 @@ +/* ======================================================================================== */ +/* 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_PLUGIN_VERSION 1 + +typedef int FMOD_CODEC_SEEK_METHOD; +#define FMOD_CODEC_SEEK_METHOD_SET 0 +#define FMOD_CODEC_SEEK_METHOD_CURRENT 1 +#define FMOD_CODEC_SEEK_METHOD_END 2 + +/* + 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); +typedef void * (F_CALLBACK *FMOD_CODEC_ALLOC_FUNC) (unsigned int size, unsigned int align, const char *file, int line); +typedef void (F_CALLBACK *FMOD_CODEC_FREE_FUNC) (void *ptr, const char *file, int line); +typedef void (F_CALLBACK *FMOD_CODEC_LOG_FUNC) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...); + +typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_FILE_READ_FUNC) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int sizebytes, unsigned int *bytesread); +typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_FILE_SEEK_FUNC) (FMOD_CODEC_STATE *codec_state, unsigned int pos, FMOD_CODEC_SEEK_METHOD method); +typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_FILE_TELL_FUNC) (FMOD_CODEC_STATE *codec_state, unsigned int *pos); +typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_FILE_SIZE_FUNC) (FMOD_CODEC_STATE *codec_state, unsigned int *size); + +/* + Codec structures +*/ +typedef struct FMOD_CODEC_DESCRIPTION +{ + unsigned int apiversion; + 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; +}; + +typedef struct FMOD_CODEC_STATE_FUNCTIONS +{ + FMOD_CODEC_METADATA_FUNC metadata; + FMOD_CODEC_ALLOC_FUNC alloc; + FMOD_CODEC_FREE_FUNC free; + FMOD_CODEC_LOG_FUNC log; + FMOD_CODEC_FILE_READ_FUNC read; + FMOD_CODEC_FILE_SEEK_FUNC seek; + FMOD_CODEC_FILE_TELL_FUNC tell; + FMOD_CODEC_FILE_SIZE_FUNC size; +} FMOD_CODEC_STATE_FUNCTIONS; + +struct FMOD_CODEC_STATE +{ + void *plugindata; + FMOD_CODEC_WAVEFORMAT *waveformat; + FMOD_CODEC_STATE_FUNCTIONS *functions; + int numsubsounds; +}; + +/* + Codec macros +*/ +#define FMOD_CODEC_METADATA(_state, _tagtype, _name, _data, _datalen, _datatype, _unique) \ + (_state)->functions->metadata(_size, _tagtype, _name, _data, _datalen, _datatype, _unique) +#define FMOD_CODEC_ALLOC(_state, _size, _align) \ + (_state)->functions->alloc(_size, _align, __FILE__, __LINE__) +#define FMOD_CODEC_FREE(_state, _ptr) \ + (_state)->functions->free(_ptr, __FILE__, __LINE__) +#define FMOD_CODEC_LOG(_state, _level, _location, _format, ...) \ + (_state)->functions->log(_level, __FILE__, __LINE__, _location, _format, __VA_ARGS__) +#define FMOD_CODEC_FILE_READ(_state, _buffer, _sizebytes, _bytesread) \ + (_state)->functions->read(_state, _buffer, _sizebytes, _bytesread) +#define FMOD_CODEC_FILE_SEEK(_state, _pos, _method) \ + (_state)->functions->seek(_state, _pos, _method) +#define FMOD_CODEC_FILE_TELL(_state, _pos) \ + (_state)->functions->tell(_state, _pos) +#define FMOD_CODEC_FILE_SIZE(_state, _size) \ + (_state)->functions->size(_state, _size) + +#endif + + diff --git a/vendor/fmod/inc/fmod_common.h b/vendor/fmod/inc/fmod_common.h new file mode 100644 index 0000000..a938bb0 --- /dev/null +++ b/vendor/fmod/inc/fmod_common.h @@ -0,0 +1,880 @@ +/* ======================================================================================== */ +/* 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 long long FMOD_PORT_INDEX; + +/* + FMOD constants +*/ +#define FMOD_VERSION 0x00020205 /* 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_BUFFEREDNOMIX 0x00002000 +#define FMOD_SYSTEM_CALLBACK_DEVICEREINITIALIZE 0x00004000 +#define FMOD_SYSTEM_CALLBACK_OUTPUTUNDERRUN 0x00008000 +#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) + +typedef int FMOD_THREAD_PRIORITY; +/* Platform specific priority range */ +#define FMOD_THREAD_PRIORITY_PLATFORM_MIN (-32 * 1024) +#define FMOD_THREAD_PRIORITY_PLATFORM_MAX ( 32 * 1024) +/* Platform agnostic priorities, maps internally to platform specific value */ +#define FMOD_THREAD_PRIORITY_DEFAULT (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 1) +#define FMOD_THREAD_PRIORITY_LOW (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 2) +#define FMOD_THREAD_PRIORITY_MEDIUM (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 3) +#define FMOD_THREAD_PRIORITY_HIGH (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 4) +#define FMOD_THREAD_PRIORITY_VERY_HIGH (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 5) +#define FMOD_THREAD_PRIORITY_EXTREME (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 6) +#define FMOD_THREAD_PRIORITY_CRITICAL (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 7) +/* Thread defaults */ +#define FMOD_THREAD_PRIORITY_MIXER FMOD_THREAD_PRIORITY_EXTREME +#define FMOD_THREAD_PRIORITY_FEEDER FMOD_THREAD_PRIORITY_CRITICAL +#define FMOD_THREAD_PRIORITY_STREAM FMOD_THREAD_PRIORITY_VERY_HIGH +#define FMOD_THREAD_PRIORITY_FILE FMOD_THREAD_PRIORITY_HIGH +#define FMOD_THREAD_PRIORITY_NONBLOCKING FMOD_THREAD_PRIORITY_HIGH +#define FMOD_THREAD_PRIORITY_RECORD FMOD_THREAD_PRIORITY_HIGH +#define FMOD_THREAD_PRIORITY_GEOMETRY FMOD_THREAD_PRIORITY_LOW +#define FMOD_THREAD_PRIORITY_PROFILER FMOD_THREAD_PRIORITY_MEDIUM +#define FMOD_THREAD_PRIORITY_STUDIO_UPDATE FMOD_THREAD_PRIORITY_MEDIUM +#define FMOD_THREAD_PRIORITY_STUDIO_LOAD_BANK FMOD_THREAD_PRIORITY_MEDIUM +#define FMOD_THREAD_PRIORITY_STUDIO_LOAD_SAMPLE FMOD_THREAD_PRIORITY_MEDIUM +#define FMOD_THREAD_PRIORITY_CONVOLUTION1 FMOD_THREAD_PRIORITY_VERY_HIGH +#define FMOD_THREAD_PRIORITY_CONVOLUTION2 FMOD_THREAD_PRIORITY_VERY_HIGH + +typedef unsigned int FMOD_THREAD_STACK_SIZE; +#define FMOD_THREAD_STACK_SIZE_DEFAULT 0 +#define FMOD_THREAD_STACK_SIZE_MIXER (80 * 1024) +#define FMOD_THREAD_STACK_SIZE_FEEDER (16 * 1024) +#define FMOD_THREAD_STACK_SIZE_STREAM (96 * 1024) +#define FMOD_THREAD_STACK_SIZE_FILE (64 * 1024) +#define FMOD_THREAD_STACK_SIZE_NONBLOCKING (112 * 1024) +#define FMOD_THREAD_STACK_SIZE_RECORD (16 * 1024) +#define FMOD_THREAD_STACK_SIZE_GEOMETRY (48 * 1024) +#define FMOD_THREAD_STACK_SIZE_PROFILER (128 * 1024) +#define FMOD_THREAD_STACK_SIZE_STUDIO_UPDATE (96 * 1024) +#define FMOD_THREAD_STACK_SIZE_STUDIO_LOAD_BANK (96 * 1024) +#define FMOD_THREAD_STACK_SIZE_STUDIO_LOAD_SAMPLE (96 * 1024) +#define FMOD_THREAD_STACK_SIZE_CONVOLUTION1 (16 * 1024) +#define FMOD_THREAD_STACK_SIZE_CONVOLUTION2 (16 * 1024) + +typedef long long FMOD_THREAD_AFFINITY; +/* Platform agnostic thread groupings */ +#define FMOD_THREAD_AFFINITY_GROUP_DEFAULT 0x4000000000000000 +#define FMOD_THREAD_AFFINITY_GROUP_A 0x4000000000000001 +#define FMOD_THREAD_AFFINITY_GROUP_B 0x4000000000000002 +#define FMOD_THREAD_AFFINITY_GROUP_C 0x4000000000000003 +/* Thread defaults */ +#define FMOD_THREAD_AFFINITY_MIXER FMOD_THREAD_AFFINITY_GROUP_A +#define FMOD_THREAD_AFFINITY_FEEDER FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_STREAM FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_FILE FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_NONBLOCKING FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_RECORD FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_GEOMETRY FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_PROFILER FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_STUDIO_UPDATE FMOD_THREAD_AFFINITY_GROUP_B +#define FMOD_THREAD_AFFINITY_STUDIO_LOAD_BANK FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_STUDIO_LOAD_SAMPLE FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_CONVOLUTION1 FMOD_THREAD_AFFINITY_GROUP_C +#define FMOD_THREAD_AFFINITY_CONVOLUTION2 FMOD_THREAD_AFFINITY_GROUP_C + +/* Core mask, valid up to 1 << 62 */ +#define FMOD_THREAD_AFFINITY_CORE_ALL 0 +#define FMOD_THREAD_AFFINITY_CORE_0 (1 << 0) +#define FMOD_THREAD_AFFINITY_CORE_1 (1 << 1) +#define FMOD_THREAD_AFFINITY_CORE_2 (1 << 2) +#define FMOD_THREAD_AFFINITY_CORE_3 (1 << 3) +#define FMOD_THREAD_AFFINITY_CORE_4 (1 << 4) +#define FMOD_THREAD_AFFINITY_CORE_5 (1 << 5) +#define FMOD_THREAD_AFFINITY_CORE_6 (1 << 6) +#define FMOD_THREAD_AFFINITY_CORE_7 (1 << 7) +#define FMOD_THREAD_AFFINITY_CORE_8 (1 << 8) +#define FMOD_THREAD_AFFINITY_CORE_9 (1 << 9) +#define FMOD_THREAD_AFFINITY_CORE_10 (1 << 10) +#define FMOD_THREAD_AFFINITY_CORE_11 (1 << 11) +#define FMOD_THREAD_AFFINITY_CORE_12 (1 << 12) +#define FMOD_THREAD_AFFINITY_CORE_13 (1 << 13) +#define FMOD_THREAD_AFFINITY_CORE_14 (1 << 14) +#define FMOD_THREAD_AFFINITY_CORE_15 (1 << 15) + +/* 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_THREAD_TYPE +{ + FMOD_THREAD_TYPE_MIXER, + FMOD_THREAD_TYPE_FEEDER, + FMOD_THREAD_TYPE_STREAM, + FMOD_THREAD_TYPE_FILE, + FMOD_THREAD_TYPE_NONBLOCKING, + FMOD_THREAD_TYPE_RECORD, + FMOD_THREAD_TYPE_GEOMETRY, + FMOD_THREAD_TYPE_PROFILER, + FMOD_THREAD_TYPE_STUDIO_UPDATE, + FMOD_THREAD_TYPE_STUDIO_LOAD_BANK, + FMOD_THREAD_TYPE_STUDIO_LOAD_SAMPLE, + FMOD_THREAD_TYPE_CONVOLUTION1, + FMOD_THREAD_TYPE_CONVOLUTION2, + + FMOD_THREAD_TYPE_MAX, + FMOD_THREAD_TYPE_FORCEINT = 65536 +} FMOD_THREAD_TYPE; + +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_AUDIOWORKLET, + + 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; + +typedef enum FMOD_PORT_TYPE +{ + FMOD_PORT_TYPE_MUSIC, + FMOD_PORT_TYPE_COPYRIGHT_MUSIC, + FMOD_PORT_TYPE_VOICE, + FMOD_PORT_TYPE_CONTROLLER, + FMOD_PORT_TYPE_PERSONAL, + FMOD_PORT_TYPE_VIBRATION, + FMOD_PORT_TYPE_AUX, + + FMOD_PORT_TYPE_MAX, + FMOD_PORT_TYPE_FORCEINT = 65536 +} FMOD_PORT_TYPE; + +/* + 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; + FMOD_DSP_RESAMPLER resamplerMethod; + unsigned int randomSeed; + int maxConvolutionThreads; + int maxOpusCodecs; +} 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; + +typedef struct FMOD_CPU_USAGE +{ + float dsp; + float stream; + float geometry; + float update; + float convolution1; + float convolution2; +} FMOD_CPU_USAGE; + + +/* + FMOD optional headers for plugin development +*/ +#include "fmod_codec.h" +#include "fmod_dsp.h" +#include "fmod_output.h" + +#endif diff --git a/vendor/fmod/inc/fmod_dsp.cs b/vendor/fmod/inc/fmod_dsp.cs new file mode 100644 index 0000000..92ad06d --- /dev/null +++ b/vendor/fmod/inc/fmod_dsp.cs @@ -0,0 +1,897 @@ +/* ======================================================================================== */ +/* 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, IntPtr sourcestr); + public delegate IntPtr DSP_REALLOC_FUNC (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void DSP_FREE_FUNC (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); + public delegate void DSP_LOG_FUNC (DEBUG_FLAGS level, IntPtr file, int line, IntPtr function, IntPtr 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, + DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE = -6 + } + + [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_LOUDNESS_METER_INFO_TYPE + { + public float momentaryloudness; + public float shorttermloudness; + public float integratedloudness; + public float loudness10thpercentile; + public float loudness95thpercentile; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 66)] + public float[] loudnesshistogram; + public float maxtruepeak; + public float maxmomentaryloudness; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_LOUDNESS_METER_WEIGHTING_TYPE + { + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public float[] channelweight; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_ATTENUATION_RANGE + { + public float min; + public float max; + } + + [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, + THRESHOLD, + 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, + ATTENUATION_RANGE, + OVERRIDE_RANGE + } + + 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_LOUDNESS_METER : int + { + STATE, + WEIGHTING, + INFO + } + + + public enum DSP_LOUDNESS_METER_STATE_TYPE : int + { + RESET_INTEGRATED = -3, + RESET_MAXPEAK = -2, + RESET_ALL = -1, + PAUSED = 0, + ANALYZING = 1 + } + + 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, + ATTENUATION_RANGE, + OVERRIDE_RANGE + } +} diff --git a/vendor/fmod/inc/fmod_dsp.h b/vendor/fmod/inc/fmod_dsp.h new file mode 100644 index 0000000..3e28a40 --- /dev/null +++ b/vendor/fmod/inc/fmod_dsp.h @@ -0,0 +1,421 @@ +/* ======================================================================================== */ +/* 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_ATTENUATION_RANGE = -6, +} 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_ATTENUATION_RANGE +{ + float min; + float max; +} FMOD_DSP_PARAMETER_ATTENUATION_RANGE; + +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 + diff --git a/vendor/fmod/inc/fmod_dsp_effects.h b/vendor/fmod/inc/fmod_dsp_effects.h new file mode 100644 index 0000000..e5645cb --- /dev/null +++ b/vendor/fmod/inc/fmod_dsp_effects.h @@ -0,0 +1,577 @@ +/* ============================================================================================================= */ +/* 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_THRESHOLD, + 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_ATTENUATION_RANGE, + FMOD_DSP_PAN_OVERRIDE_RANGE +} 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; + +#define FMOD_DSP_LOUDNESS_METER_HISTOGRAM_SAMPLES 66 + +typedef enum +{ + FMOD_DSP_LOUDNESS_METER_STATE, + FMOD_DSP_LOUDNESS_METER_WEIGHTING, + FMOD_DSP_LOUDNESS_METER_INFO +} FMOD_DSP_LOUDNESS_METER; + + +typedef enum +{ + FMOD_DSP_LOUDNESS_METER_STATE_RESET_INTEGRATED = -3, + FMOD_DSP_LOUDNESS_METER_STATE_RESET_MAXPEAK = -2, + FMOD_DSP_LOUDNESS_METER_STATE_RESET_ALL = -1, + FMOD_DSP_LOUDNESS_METER_STATE_PAUSED = 0, + FMOD_DSP_LOUDNESS_METER_STATE_ANALYZING = 1 +} FMOD_DSP_LOUDNESS_METER_STATE_TYPE; + +typedef struct FMOD_DSP_LOUDNESS_METER_INFO_TYPE +{ + float momentaryloudness; + float shorttermloudness; + float integratedloudness; + float loudness10thpercentile; + float loudness95thpercentile; + float loudnesshistogram[FMOD_DSP_LOUDNESS_METER_HISTOGRAM_SAMPLES]; + float maxtruepeak; + float maxmomentaryloudness; +} FMOD_DSP_LOUDNESS_METER_INFO_TYPE; + +typedef struct FMOD_DSP_LOUDNESS_METER_WEIGHTING_TYPE +{ + float channelweight[32]; +} FMOD_DSP_LOUDNESS_METER_WEIGHTING_TYPE; + + +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_ATTENUATION_RANGE, + FMOD_DSP_OBJECTPAN_OVERRIDE_RANGE +} FMOD_DSP_OBJECTPAN; + +#endif + diff --git a/vendor/fmod/inc/fmod_errors.cs b/vendor/fmod/inc/fmod_errors.cs new file mode 100644 index 0000000..e7b9cd2 --- /dev/null +++ b/vendor/fmod/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."; + } + } + } +} diff --git a/vendor/fmod/inc/fmod_errors.h b/vendor/fmod/inc/fmod_errors.h new file mode 100644 index 0000000..ea17340 --- /dev/null +++ b/vendor/fmod/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 diff --git a/vendor/fmod/inc/fmod_output.h b/vendor/fmod/inc/fmod_output.h new file mode 100644 index 0000000..0d511a0 --- /dev/null +++ b/vendor/fmod/inc/fmod_output.h @@ -0,0 +1,122 @@ +/* ======================================================================================== */ +/* 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 5 + +typedef unsigned int FMOD_OUTPUT_METHOD; +#define FMOD_OUTPUT_METHOD_MIX_DIRECT 0 +#define FMOD_OUTPUT_METHOD_MIX_BUFFERED 1 + +/* + 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, int *dspnumadditionalbuffers, 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_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 method; + 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_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 */ diff --git a/vendor/fmod/inc/fmod_studio.cs b/vendor/fmod/inc/fmod_studio.cs new file mode 100644 index 0000000..e8237cc --- /dev/null +++ b/vendor/fmod/inc/fmod_studio.cs @@ -0,0 +1,2250 @@ +/* ======================================================================================== */ +/* FMOD Studio API - C# wrapper. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/resources/documentation-api?version=2.0&page=page=studio-api.html */ +/* ======================================================================================== */ + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections; + +namespace FMOD.Studio +{ + public partial class STUDIO_VERSION + { +#if !UNITY_2019_4_OR_NEWER + public const string dll = "fmodstudio"; +#endif + } + + public enum STOP_MODE : int + { + ALLOWFADEOUT, + IMMEDIATE, + } + + public enum LOADING_STATE : int + { + UNLOADING, + UNLOADED, + LOADING, + LOADED, + ERROR, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PROGRAMMER_SOUND_PROPERTIES + { + public StringWrapper name; + public IntPtr sound; + public int subsoundIndex; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TIMELINE_MARKER_PROPERTIES + { + public StringWrapper name; + public int position; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TIMELINE_BEAT_PROPERTIES + { + public int bar; + public int beat; + public int position; + public float tempo; + public int timesignatureupper; + public int timesignaturelower; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TIMELINE_NESTED_BEAT_PROPERTIES + { + public GUID eventid; + public TIMELINE_BEAT_PROPERTIES properties; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ADVANCEDSETTINGS + { + public int cbsize; + public int commandqueuesize; + public int handleinitialsize; + public int studioupdateperiod; + public int idlesampledatapoolsize; + public int streamingscheduledelay; + public IntPtr encryptionkey; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CPU_USAGE + { + public float update; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BUFFER_INFO + { + public int currentusage; + public int peakusage; + public int capacity; + public int stallcount; + public float stalltime; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BUFFER_USAGE + { + public BUFFER_INFO studiocommandqueue; + public BUFFER_INFO studiohandle; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BANK_INFO + { + public int size; + public IntPtr userdata; + public int userdatalength; + public FILE_OPEN_CALLBACK opencallback; + public FILE_CLOSE_CALLBACK closecallback; + public FILE_READ_CALLBACK readcallback; + public FILE_SEEK_CALLBACK seekcallback; + } + + [Flags] + public enum SYSTEM_CALLBACK_TYPE : uint + { + PREUPDATE = 0x00000001, + POSTUPDATE = 0x00000002, + BANK_UNLOAD = 0x00000004, + LIVEUPDATE_CONNECTED = 0x00000008, + LIVEUPDATE_DISCONNECTED = 0x00000010, + ALL = 0xFFFFFFFF, + } + + public delegate RESULT SYSTEM_CALLBACK(IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata, IntPtr userdata); + + public enum PARAMETER_TYPE : int + { + GAME_CONTROLLED, + AUTOMATIC_DISTANCE, + AUTOMATIC_EVENT_CONE_ANGLE, + AUTOMATIC_EVENT_ORIENTATION, + AUTOMATIC_DIRECTION, + AUTOMATIC_ELEVATION, + AUTOMATIC_LISTENER_ORIENTATION, + AUTOMATIC_SPEED, + AUTOMATIC_SPEED_ABSOLUTE, + AUTOMATIC_DISTANCE_NORMALIZED, + MAX + } + + [Flags] + public enum PARAMETER_FLAGS : uint + { + READONLY = 0x00000001, + AUTOMATIC = 0x00000002, + GLOBAL = 0x00000004, + DISCRETE = 0x00000008, + LABELED = 0x00000010, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PARAMETER_ID + { + public uint data1; + public uint data2; + } + + [StructLayout(LayoutKind.Sequential)] + public struct PARAMETER_DESCRIPTION + { + public StringWrapper name; + public PARAMETER_ID id; + public float minimum; + public float maximum; + public float defaultvalue; + public PARAMETER_TYPE type; + public PARAMETER_FLAGS flags; + public GUID guid; + } + + // This is only need for loading memory and given our C# wrapper LOAD_MEMORY_POINT isn't feasible anyway + enum LOAD_MEMORY_MODE : int + { + LOAD_MEMORY, + LOAD_MEMORY_POINT, + } + + enum LOAD_MEMORY_ALIGNMENT : int + { + VALUE = 32 + } + + [StructLayout(LayoutKind.Sequential)] + public struct SOUND_INFO + { + public IntPtr name_or_data; + public MODE mode; + public CREATESOUNDEXINFO exinfo; + public int subsoundindex; + + public string name + { + get + { + using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) + { + return ((mode & (MODE.OPENMEMORY | MODE.OPENMEMORY_POINT)) == 0) ? encoding.stringFromNative(name_or_data) : String.Empty; + } + } + } + } + + public enum USER_PROPERTY_TYPE : int + { + INTEGER, + BOOLEAN, + FLOAT, + STRING, + } + + [StructLayout(LayoutKind.Sequential)] + public struct USER_PROPERTY + { + public StringWrapper name; + public USER_PROPERTY_TYPE type; + private Union_IntBoolFloatString value; + + public int intValue() { return (type == USER_PROPERTY_TYPE.INTEGER) ? value.intvalue : -1; } + public bool boolValue() { return (type == USER_PROPERTY_TYPE.BOOLEAN) ? value.boolvalue : false; } + public float floatValue() { return (type == USER_PROPERTY_TYPE.FLOAT) ? value.floatvalue : -1; } + public string stringValue() { return (type == USER_PROPERTY_TYPE.STRING) ? value.stringvalue : ""; } + }; + + [StructLayout(LayoutKind.Explicit)] + struct Union_IntBoolFloatString + { + [FieldOffset(0)] + public int intvalue; + [FieldOffset(0)] + public bool boolvalue; + [FieldOffset(0)] + public float floatvalue; + [FieldOffset(0)] + public StringWrapper stringvalue; + } + + [Flags] + public enum INITFLAGS : uint + { + NORMAL = 0x00000000, + LIVEUPDATE = 0x00000001, + ALLOW_MISSING_PLUGINS = 0x00000002, + SYNCHRONOUS_UPDATE = 0x00000004, + DEFERRED_CALLBACKS = 0x00000008, + LOAD_FROM_UPDATE = 0x00000010, + MEMORY_TRACKING = 0x00000020, + } + + [Flags] + public enum LOAD_BANK_FLAGS : uint + { + NORMAL = 0x00000000, + NONBLOCKING = 0x00000001, + DECOMPRESS_SAMPLES = 0x00000002, + UNENCRYPTED = 0x00000004, + } + + [Flags] + public enum COMMANDCAPTURE_FLAGS : uint + { + NORMAL = 0x00000000, + FILEFLUSH = 0x00000001, + SKIP_INITIAL_STATE = 0x00000002, + } + + [Flags] + public enum COMMANDREPLAY_FLAGS : uint + { + NORMAL = 0x00000000, + SKIP_CLEANUP = 0x00000001, + FAST_FORWARD = 0x00000002, + SKIP_BANK_LOAD = 0x00000004, + } + + public enum PLAYBACK_STATE : int + { + PLAYING, + SUSTAINING, + STOPPED, + STARTING, + STOPPING, + } + + public enum EVENT_PROPERTY : int + { + CHANNELPRIORITY, + SCHEDULE_DELAY, + SCHEDULE_LOOKAHEAD, + MINIMUM_DISTANCE, + MAXIMUM_DISTANCE, + COOLDOWN, + MAX + }; + + [StructLayout(LayoutKind.Sequential)] + public struct PLUGIN_INSTANCE_PROPERTIES + { + public IntPtr name; + public IntPtr dsp; + } + + [Flags] + public enum EVENT_CALLBACK_TYPE : uint + { + CREATED = 0x00000001, + DESTROYED = 0x00000002, + STARTING = 0x00000004, + STARTED = 0x00000008, + RESTARTED = 0x00000010, + STOPPED = 0x00000020, + START_FAILED = 0x00000040, + CREATE_PROGRAMMER_SOUND = 0x00000080, + DESTROY_PROGRAMMER_SOUND = 0x00000100, + PLUGIN_CREATED = 0x00000200, + PLUGIN_DESTROYED = 0x00000400, + TIMELINE_MARKER = 0x00000800, + TIMELINE_BEAT = 0x00001000, + SOUND_PLAYED = 0x00002000, + SOUND_STOPPED = 0x00004000, + REAL_TO_VIRTUAL = 0x00008000, + VIRTUAL_TO_REAL = 0x00010000, + START_EVENT_COMMAND = 0x00020000, + NESTED_TIMELINE_BEAT = 0x00040000, + + ALL = 0xFFFFFFFF, + } + + public delegate RESULT EVENT_CALLBACK(EVENT_CALLBACK_TYPE type, IntPtr _event, IntPtr parameters); + + public delegate RESULT COMMANDREPLAY_FRAME_CALLBACK(IntPtr replay, int commandindex, float currenttime, IntPtr userdata); + public delegate RESULT COMMANDREPLAY_LOAD_BANK_CALLBACK(IntPtr replay, int commandindex, GUID bankguid, IntPtr bankfilename, LOAD_BANK_FLAGS flags, out IntPtr bank, IntPtr userdata); + public delegate RESULT COMMANDREPLAY_CREATE_INSTANCE_CALLBACK(IntPtr replay, int commandindex, IntPtr eventdescription, out IntPtr instance, IntPtr userdata); + + public enum INSTANCETYPE : int + { + NONE, + SYSTEM, + EVENTDESCRIPTION, + EVENTINSTANCE, + PARAMETERINSTANCE, + BUS, + VCA, + BANK, + COMMANDREPLAY, + } + + [StructLayout(LayoutKind.Sequential)] + public struct COMMAND_INFO + { + public StringWrapper commandname; + public int parentcommandindex; + public int framenumber; + public float frametime; + public INSTANCETYPE instancetype; + public INSTANCETYPE outputtype; + public UInt32 instancehandle; + public UInt32 outputhandle; + } + + [StructLayout(LayoutKind.Sequential)] + public struct MEMORY_USAGE + { + public int exclusive; + public int inclusive; + public int sampledata; + } + + public struct Util + { + public static RESULT parseID(string idString, out GUID id) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_ParseID(encoder.byteFromStringUTF8(idString), out id); + } + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_ParseID(byte[] idString, out GUID id); + #endregion + } + + public struct System + { + // Initialization / system functions. + public static RESULT create(out System system) + { + return FMOD_Studio_System_Create(out system.handle, VERSION.number); + } + public RESULT setAdvancedSettings(ADVANCEDSETTINGS settings) + { + settings.cbsize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); + return FMOD_Studio_System_SetAdvancedSettings(this.handle, ref settings); + } + public RESULT setAdvancedSettings(ADVANCEDSETTINGS settings, string encryptionKey) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr userKey = settings.encryptionkey; + settings.encryptionkey = encoder.intptrFromStringUTF8(encryptionKey); + FMOD.RESULT result = setAdvancedSettings(settings); + settings.encryptionkey = userKey; + return result; + } + } + public RESULT getAdvancedSettings(out ADVANCEDSETTINGS settings) + { + settings.cbsize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); + return FMOD_Studio_System_GetAdvancedSettings(this.handle, out settings); + } + public RESULT initialize(int maxchannels, INITFLAGS studioflags, FMOD.INITFLAGS flags, IntPtr extradriverdata) + { + return FMOD_Studio_System_Initialize(this.handle, maxchannels, studioflags, flags, extradriverdata); + } + public RESULT release() + { + return FMOD_Studio_System_Release(this.handle); + } + public RESULT update() + { + return FMOD_Studio_System_Update(this.handle); + } + public RESULT getCoreSystem(out FMOD.System coresystem) + { + return FMOD_Studio_System_GetCoreSystem(this.handle, out coresystem.handle); + } + public RESULT getEvent(string path, out EventDescription _event) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetEvent(this.handle, encoder.byteFromStringUTF8(path), out _event.handle); + } + } + public RESULT getBus(string path, out Bus bus) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetBus(this.handle, encoder.byteFromStringUTF8(path), out bus.handle); + } + } + public RESULT getVCA(string path, out VCA vca) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetVCA(this.handle, encoder.byteFromStringUTF8(path), out vca.handle); + } + } + public RESULT getBank(string path, out Bank bank) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetBank(this.handle, encoder.byteFromStringUTF8(path), out bank.handle); + } + } + + public RESULT getEventByID(GUID id, out EventDescription _event) + { + return FMOD_Studio_System_GetEventByID(this.handle, ref id, out _event.handle); + } + public RESULT getBusByID(GUID id, out Bus bus) + { + return FMOD_Studio_System_GetBusByID(this.handle, ref id, out bus.handle); + } + public RESULT getVCAByID(GUID id, out VCA vca) + { + return FMOD_Studio_System_GetVCAByID(this.handle, ref id, out vca.handle); + } + public RESULT getBankByID(GUID id, out Bank bank) + { + return FMOD_Studio_System_GetBankByID(this.handle, ref id, out bank.handle); + } + public RESULT getSoundInfo(string key, out SOUND_INFO info) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetSoundInfo(this.handle, encoder.byteFromStringUTF8(key), out info); + } + } + public RESULT getParameterDescriptionByName(string name, out PARAMETER_DESCRIPTION parameter) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetParameterDescriptionByName(this.handle, encoder.byteFromStringUTF8(name), out parameter); + } + } + public RESULT getParameterDescriptionByID(PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_System_GetParameterDescriptionByID(this.handle, id, out parameter); + } + public RESULT getParameterLabelByName(string name, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + byte[] nameBytes = encoder.byteFromStringUTF8(name); + RESULT result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterLabelByID(PARAMETER_ID id, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterByID(PARAMETER_ID id, out float value) + { + float finalValue; + return getParameterByID(id, out value, out finalValue); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value, out float finalvalue) + { + return FMOD_Studio_System_GetParameterByID(this.handle, id, out value, out finalvalue); + } + public RESULT setParameterByID(PARAMETER_ID id, float value, bool ignoreseekspeed = false) + { + return FMOD_Studio_System_SetParameterByID(this.handle, id, value, ignoreseekspeed); + } + public RESULT setParameterByIDWithLabel(PARAMETER_ID id, string label, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_SetParameterByIDWithLabel(this.handle, id, encoder.byteFromStringUTF8(label), ignoreseekspeed); + } + } + public RESULT setParametersByIDs(PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed = false) + { + return FMOD_Studio_System_SetParametersByIDs(this.handle, ids, values, count, ignoreseekspeed); + } + public RESULT getParameterByName(string name, out float value) + { + float finalValue; + return getParameterByName(name, out value, out finalValue); + } + public RESULT getParameterByName(string name, out float value, out float finalvalue) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetParameterByName(this.handle, encoder.byteFromStringUTF8(name), out value, out finalvalue); + } + } + public RESULT setParameterByName(string name, float value, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_SetParameterByName(this.handle, encoder.byteFromStringUTF8(name), value, ignoreseekspeed); + } + } + public RESULT setParameterByNameWithLabel(string name, string label, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper(), + labelEncoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_SetParameterByNameWithLabel(this.handle, encoder.byteFromStringUTF8(name), labelEncoder.byteFromStringUTF8(label), ignoreseekspeed); + } + } + public RESULT lookupID(string path, out GUID id) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LookupID(this.handle, encoder.byteFromStringUTF8(path), out id); + } + } + public RESULT lookupPath(GUID id, out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_System_LookupPath(this.handle, ref id, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_System_LookupPath(this.handle, ref id, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getNumListeners(out int numlisteners) + { + return FMOD_Studio_System_GetNumListeners(this.handle, out numlisteners); + } + public RESULT setNumListeners(int numlisteners) + { + return FMOD_Studio_System_SetNumListeners(this.handle, numlisteners); + } + public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes) + { + return FMOD_Studio_System_GetListenerAttributes(this.handle, listener, out attributes, IntPtr.Zero); + } + public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes, out VECTOR attenuationposition) + { + return FMOD_Studio_System_GetListenerAttributes(this.handle, listener, out attributes, out attenuationposition); + } + public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes) + { + return FMOD_Studio_System_SetListenerAttributes(this.handle, listener, ref attributes, IntPtr.Zero); + } + public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes, VECTOR attenuationposition) + { + return FMOD_Studio_System_SetListenerAttributes(this.handle, listener, ref attributes, ref attenuationposition); + } + public RESULT getListenerWeight(int listener, out float weight) + { + return FMOD_Studio_System_GetListenerWeight(this.handle, listener, out weight); + } + public RESULT setListenerWeight(int listener, float weight) + { + return FMOD_Studio_System_SetListenerWeight(this.handle, listener, weight); + } + public RESULT loadBankFile(string filename, LOAD_BANK_FLAGS flags, out Bank bank) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LoadBankFile(this.handle, encoder.byteFromStringUTF8(filename), flags, out bank.handle); + } + } + public RESULT loadBankMemory(byte[] buffer, LOAD_BANK_FLAGS flags, out Bank bank) + { + // Manually pin the byte array. It's what the marshaller should do anyway but don't leave it to chance. + GCHandle pinnedArray = GCHandle.Alloc(buffer, GCHandleType.Pinned); + IntPtr pointer = pinnedArray.AddrOfPinnedObject(); + RESULT result = FMOD_Studio_System_LoadBankMemory(this.handle, pointer, buffer.Length, LOAD_MEMORY_MODE.LOAD_MEMORY, flags, out bank.handle); + pinnedArray.Free(); + return result; + } + public RESULT loadBankCustom(BANK_INFO info, LOAD_BANK_FLAGS flags, out Bank bank) + { + info.size = MarshalHelper.SizeOf(typeof(BANK_INFO)); + return FMOD_Studio_System_LoadBankCustom(this.handle, ref info, flags, out bank.handle); + } + public RESULT unloadAll() + { + return FMOD_Studio_System_UnloadAll(this.handle); + } + public RESULT flushCommands() + { + return FMOD_Studio_System_FlushCommands(this.handle); + } + public RESULT flushSampleLoading() + { + return FMOD_Studio_System_FlushSampleLoading(this.handle); + } + public RESULT startCommandCapture(string filename, COMMANDCAPTURE_FLAGS flags) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_StartCommandCapture(this.handle, encoder.byteFromStringUTF8(filename), flags); + } + } + public RESULT stopCommandCapture() + { + return FMOD_Studio_System_StopCommandCapture(this.handle); + } + public RESULT loadCommandReplay(string filename, COMMANDREPLAY_FLAGS flags, out CommandReplay replay) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LoadCommandReplay(this.handle, encoder.byteFromStringUTF8(filename), flags, out replay.handle); + } + } + public RESULT getBankCount(out int count) + { + return FMOD_Studio_System_GetBankCount(this.handle, out count); + } + public RESULT getBankList(out Bank[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_System_GetBankCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new Bank[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_System_GetBankList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new Bank[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getParameterDescriptionCount(out int count) + { + return FMOD_Studio_System_GetParameterDescriptionCount(this.handle, out count); + } + public RESULT getParameterDescriptionList(out PARAMETER_DESCRIPTION[] array) + { + array = null; + + int capacity; + RESULT result = FMOD_Studio_System_GetParameterDescriptionCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new PARAMETER_DESCRIPTION[0]; + return RESULT.OK; + } + + PARAMETER_DESCRIPTION[] tempArray = new PARAMETER_DESCRIPTION[capacity]; + int actualCount; + result = FMOD_Studio_System_GetParameterDescriptionList(this.handle, tempArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + + if (actualCount != capacity) + { + Array.Resize(ref tempArray, actualCount); + } + + array = tempArray; + + return RESULT.OK; + } + public RESULT getCPUUsage(out CPU_USAGE usage, out FMOD.CPU_USAGE usage_core) + { + return FMOD_Studio_System_GetCPUUsage(this.handle, out usage, out usage_core); + } + public RESULT getBufferUsage(out BUFFER_USAGE usage) + { + return FMOD_Studio_System_GetBufferUsage(this.handle, out usage); + } + public RESULT resetBufferUsage() + { + return FMOD_Studio_System_ResetBufferUsage(this.handle); + } + + public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_System_SetCallback(this.handle, callback, callbackmask); + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_System_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_System_SetUserData(this.handle, userdata); + } + + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_System_GetMemoryUsage(this.handle, out memoryusage); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Create (out IntPtr system, uint headerversion); + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_System_IsValid (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetAdvancedSettings (IntPtr system, out ADVANCEDSETTINGS settings); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Initialize (IntPtr system, int maxchannels, INITFLAGS studioflags, FMOD.INITFLAGS flags, IntPtr extradriverdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Release (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Update (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetCoreSystem (IntPtr system, out IntPtr coresystem); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetEvent (IntPtr system, byte[] path, out IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBus (IntPtr system, byte[] path, out IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetVCA (IntPtr system, byte[] path, out IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBank (IntPtr system, byte[] path, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetEventByID (IntPtr system, ref GUID id, out IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBusByID (IntPtr system, ref GUID id, out IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetVCAByID (IntPtr system, ref GUID id, out IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankByID (IntPtr system, ref GUID id, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetSoundInfo (IntPtr system, byte[] key, out SOUND_INFO info); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionByName(IntPtr system, byte[] name, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionByID(IntPtr system, PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterLabelByName (IntPtr system, byte[] name, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterLabelByID (IntPtr system, PARAMETER_ID id, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterByID (IntPtr system, PARAMETER_ID id, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByID (IntPtr system, PARAMETER_ID id, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByIDWithLabel (IntPtr system, PARAMETER_ID id, byte[] label, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParametersByIDs (IntPtr system, PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterByName (IntPtr system, byte[] name, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByName (IntPtr system, byte[] name, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByNameWithLabel (IntPtr system, byte[] name, byte[] label, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LookupID (IntPtr system, byte[] path, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LookupPath (IntPtr system, ref GUID id, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetNumListeners (IntPtr system, out int numlisteners); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetNumListeners (IntPtr system, int numlisteners); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetListenerAttributes (IntPtr system, int listener, out ATTRIBUTES_3D attributes, IntPtr zero); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetListenerAttributes (IntPtr system, int listener, out ATTRIBUTES_3D attributes, out VECTOR attenuationposition); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetListenerAttributes (IntPtr system, int listener, ref ATTRIBUTES_3D attributes, IntPtr zero); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetListenerAttributes (IntPtr system, int listener, ref ATTRIBUTES_3D attributes, ref VECTOR attenuationposition); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetListenerWeight (IntPtr system, int listener, out float weight); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetListenerWeight (IntPtr system, int listener, float weight); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankFile (IntPtr system, byte[] filename, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankMemory (IntPtr system, IntPtr buffer, int length, LOAD_MEMORY_MODE mode, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankCustom (IntPtr system, ref BANK_INFO info, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_UnloadAll (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_FlushCommands (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_FlushSampleLoading (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_StartCommandCapture (IntPtr system, byte[] filename, COMMANDCAPTURE_FLAGS flags); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_StopCommandCapture (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadCommandReplay (IntPtr system, byte[] filename, COMMANDREPLAY_FLAGS flags, out IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankCount (IntPtr system, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankList (IntPtr system, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionCount(IntPtr system, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionList(IntPtr system, [Out] PARAMETER_DESCRIPTION[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage, out FMOD.CPU_USAGE usage_core); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBufferUsage (IntPtr system, out BUFFER_USAGE usage); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_ResetBufferUsage (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetUserData (IntPtr system, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetUserData (IntPtr system, IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetMemoryUsage (IntPtr system, out MEMORY_USAGE memoryusage); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public System(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_System_IsValid(this.handle); + } + + #endregion + } + + public struct EventDescription + { + public RESULT getID(out GUID id) + { + return FMOD_Studio_EventDescription_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_EventDescription_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterDescriptionCount(out int count) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionCount(this.handle, out count); + } + public RESULT getParameterDescriptionByIndex(int index, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(this.handle, index, out parameter); + } + public RESULT getParameterDescriptionByName(string name, out PARAMETER_DESCRIPTION parameter) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByName(this.handle, encoder.byteFromStringUTF8(name), out parameter); + } + } + public RESULT getParameterDescriptionByID(PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByID(this.handle, id, out parameter); + } + public RESULT getParameterLabelByIndex(int index, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterLabelByName(string name, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + byte[] nameBytes = encoder.byteFromStringUTF8(name); + RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterLabelByID(PARAMETER_ID id, int labelindex, out string label) + { + label = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, IntPtr.Zero, 0, out retrieved); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + label = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getUserPropertyCount(out int count) + { + return FMOD_Studio_EventDescription_GetUserPropertyCount(this.handle, out count); + } + public RESULT getUserPropertyByIndex(int index, out USER_PROPERTY property) + { + return FMOD_Studio_EventDescription_GetUserPropertyByIndex(this.handle, index, out property); + } + public RESULT getUserProperty(string name, out USER_PROPERTY property) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventDescription_GetUserProperty(this.handle, encoder.byteFromStringUTF8(name), out property); + } + } + public RESULT getLength(out int length) + { + return FMOD_Studio_EventDescription_GetLength(this.handle, out length); + } + public RESULT getMinMaxDistance(out float min, out float max) + { + return FMOD_Studio_EventDescription_GetMinMaxDistance(this.handle, out min, out max); + } + public RESULT getSoundSize(out float size) + { + return FMOD_Studio_EventDescription_GetSoundSize(this.handle, out size); + } + public RESULT isSnapshot(out bool snapshot) + { + return FMOD_Studio_EventDescription_IsSnapshot(this.handle, out snapshot); + } + public RESULT isOneshot(out bool oneshot) + { + return FMOD_Studio_EventDescription_IsOneshot(this.handle, out oneshot); + } + public RESULT isStream(out bool isStream) + { + return FMOD_Studio_EventDescription_IsStream(this.handle, out isStream); + } + public RESULT is3D(out bool is3D) + { + return FMOD_Studio_EventDescription_Is3D(this.handle, out is3D); + } + public RESULT isDopplerEnabled(out bool doppler) + { + return FMOD_Studio_EventDescription_IsDopplerEnabled(this.handle, out doppler); + } + public RESULT hasSustainPoint(out bool sustainPoint) + { + return FMOD_Studio_EventDescription_HasSustainPoint(this.handle, out sustainPoint); + } + + public RESULT createInstance(out EventInstance instance) + { + return FMOD_Studio_EventDescription_CreateInstance(this.handle, out instance.handle); + } + + public RESULT getInstanceCount(out int count) + { + return FMOD_Studio_EventDescription_GetInstanceCount(this.handle, out count); + } + public RESULT getInstanceList(out EventInstance[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_EventDescription_GetInstanceCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new EventInstance[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_EventDescription_GetInstanceList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new EventInstance[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + + public RESULT loadSampleData() + { + return FMOD_Studio_EventDescription_LoadSampleData(this.handle); + } + + public RESULT unloadSampleData() + { + return FMOD_Studio_EventDescription_UnloadSampleData(this.handle); + } + + public RESULT getSampleLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_EventDescription_GetSampleLoadingState(this.handle, out state); + } + + public RESULT releaseAllInstances() + { + return FMOD_Studio_EventDescription_ReleaseAllInstances(this.handle); + } + public RESULT setCallback(EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_EventDescription_SetCallback(this.handle, callback, callbackmask); + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_EventDescription_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_EventDescription_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_EventDescription_IsValid (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetID (IntPtr eventdescription, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetPath (IntPtr eventdescription, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionCount(IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(IntPtr eventdescription, int index, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByName(IntPtr eventdescription, byte[] name, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByID(IntPtr eventdescription, PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByIndex(IntPtr eventdescription, int index, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByName(IntPtr eventdescription, byte[] name, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByID (IntPtr eventdescription, PARAMETER_ID id, int labelindex, IntPtr label, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyCount (IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyByIndex(IntPtr eventdescription, int index, out USER_PROPERTY property); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserProperty (IntPtr eventdescription, byte[] name, out USER_PROPERTY property); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetLength (IntPtr eventdescription, out int length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetMinMaxDistance (IntPtr eventdescription, out float min, out float max); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetSoundSize (IntPtr eventdescription, out float size); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsSnapshot (IntPtr eventdescription, out bool snapshot); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsOneshot (IntPtr eventdescription, out bool oneshot); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsStream (IntPtr eventdescription, out bool isStream); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_Is3D (IntPtr eventdescription, out bool is3D); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsDopplerEnabled (IntPtr eventdescription, out bool doppler); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_HasSustainPoint (IntPtr eventdescription, out bool sustainPoint); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_CreateInstance (IntPtr eventdescription, out IntPtr instance); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetInstanceCount (IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetInstanceList (IntPtr eventdescription, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_LoadSampleData (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_UnloadSampleData (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetSampleLoadingState (IntPtr eventdescription, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_ReleaseAllInstances (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_SetCallback (IntPtr eventdescription, EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserData (IntPtr eventdescription, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_SetUserData (IntPtr eventdescription, IntPtr userdata); + #endregion + #region wrapperinternal + + public IntPtr handle; + + public EventDescription(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_EventDescription_IsValid(this.handle); + } + + #endregion + } + + public struct EventInstance + { + public RESULT getDescription(out EventDescription description) + { + return FMOD_Studio_EventInstance_GetDescription(this.handle, out description.handle); + } + public RESULT getVolume(out float volume) + { + return FMOD_Studio_EventInstance_GetVolume(this.handle, out volume, IntPtr.Zero); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_EventInstance_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_EventInstance_SetVolume(this.handle, volume); + } + public RESULT getPitch(out float pitch) + { + return FMOD_Studio_EventInstance_GetPitch(this.handle, out pitch, IntPtr.Zero); + } + public RESULT getPitch(out float pitch, out float finalpitch) + { + return FMOD_Studio_EventInstance_GetPitch(this.handle, out pitch, out finalpitch); + } + public RESULT setPitch(float pitch) + { + return FMOD_Studio_EventInstance_SetPitch(this.handle, pitch); + } + public RESULT get3DAttributes(out ATTRIBUTES_3D attributes) + { + return FMOD_Studio_EventInstance_Get3DAttributes(this.handle, out attributes); + } + public RESULT set3DAttributes(ATTRIBUTES_3D attributes) + { + return FMOD_Studio_EventInstance_Set3DAttributes(this.handle, ref attributes); + } + public RESULT getListenerMask(out uint mask) + { + return FMOD_Studio_EventInstance_GetListenerMask(this.handle, out mask); + } + public RESULT setListenerMask(uint mask) + { + return FMOD_Studio_EventInstance_SetListenerMask(this.handle, mask); + } + public RESULT getProperty(EVENT_PROPERTY index, out float value) + { + return FMOD_Studio_EventInstance_GetProperty(this.handle, index, out value); + } + public RESULT setProperty(EVENT_PROPERTY index, float value) + { + return FMOD_Studio_EventInstance_SetProperty(this.handle, index, value); + } + public RESULT getReverbLevel(int index, out float level) + { + return FMOD_Studio_EventInstance_GetReverbLevel(this.handle, index, out level); + } + public RESULT setReverbLevel(int index, float level) + { + return FMOD_Studio_EventInstance_SetReverbLevel(this.handle, index, level); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_EventInstance_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_EventInstance_SetPaused(this.handle, paused); + } + public RESULT start() + { + return FMOD_Studio_EventInstance_Start(this.handle); + } + public RESULT stop(STOP_MODE mode) + { + return FMOD_Studio_EventInstance_Stop(this.handle, mode); + } + public RESULT getTimelinePosition(out int position) + { + return FMOD_Studio_EventInstance_GetTimelinePosition(this.handle, out position); + } + public RESULT setTimelinePosition(int position) + { + return FMOD_Studio_EventInstance_SetTimelinePosition(this.handle, position); + } + public RESULT getPlaybackState(out PLAYBACK_STATE state) + { + return FMOD_Studio_EventInstance_GetPlaybackState(this.handle, out state); + } + public RESULT getChannelGroup(out FMOD.ChannelGroup group) + { + return FMOD_Studio_EventInstance_GetChannelGroup(this.handle, out group.handle); + } + public RESULT getMinMaxDistance(out float min, out float max) + { + return FMOD_Studio_EventInstance_GetMinMaxDistance(this.handle, out min, out max); + } + public RESULT release() + { + return FMOD_Studio_EventInstance_Release(this.handle); + } + public RESULT isVirtual(out bool virtualstate) + { + return FMOD_Studio_EventInstance_IsVirtual(this.handle, out virtualstate); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value) + { + float finalvalue; + return getParameterByID(id, out value, out finalvalue); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value, out float finalvalue) + { + return FMOD_Studio_EventInstance_GetParameterByID(this.handle, id, out value, out finalvalue); + } + public RESULT setParameterByID(PARAMETER_ID id, float value, bool ignoreseekspeed = false) + { + return FMOD_Studio_EventInstance_SetParameterByID(this.handle, id, value, ignoreseekspeed); + } + public RESULT setParameterByIDWithLabel(PARAMETER_ID id, string label, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_SetParameterByIDWithLabel(this.handle, id, encoder.byteFromStringUTF8(label), ignoreseekspeed); + } + } + public RESULT setParametersByIDs(PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed = false) + { + return FMOD_Studio_EventInstance_SetParametersByIDs(this.handle, ids, values, count, ignoreseekspeed); + } + public RESULT getParameterByName(string name, out float value) + { + float finalValue; + return getParameterByName(name, out value, out finalValue); + } + public RESULT getParameterByName(string name, out float value, out float finalvalue) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_GetParameterByName(this.handle, encoder.byteFromStringUTF8(name), out value, out finalvalue); + } + } + public RESULT setParameterByName(string name, float value, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_SetParameterByName(this.handle, encoder.byteFromStringUTF8(name), value, ignoreseekspeed); + } + } + public RESULT setParameterByNameWithLabel(string name, string label, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper(), + labelEncoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_SetParameterByNameWithLabel(this.handle, encoder.byteFromStringUTF8(name), labelEncoder.byteFromStringUTF8(label), ignoreseekspeed); + } + } + public RESULT keyOff() + { + return FMOD_Studio_EventInstance_KeyOff(this.handle); + } + public RESULT setCallback(EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_EventInstance_SetCallback(this.handle, callback, callbackmask); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_EventInstance_GetUserData(this.handle, out userdata); + } + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_EventInstance_SetUserData(this.handle, userdata); + } + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD_Studio_EventInstance_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_EventInstance_GetMemoryUsage(this.handle, out memoryusage); + } + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_EventInstance_IsValid (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetDescription (IntPtr _event, out IntPtr description); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetVolume (IntPtr _event, out float volume, IntPtr zero); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetVolume (IntPtr _event, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetVolume (IntPtr _event, float volume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPitch (IntPtr _event, out float pitch, IntPtr zero); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPitch (IntPtr _event, out float pitch, out float finalpitch); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetPitch (IntPtr _event, float pitch); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Get3DAttributes (IntPtr _event, out ATTRIBUTES_3D attributes); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Set3DAttributes (IntPtr _event, ref ATTRIBUTES_3D attributes); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetListenerMask (IntPtr _event, out uint mask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetListenerMask (IntPtr _event, uint mask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetProperty (IntPtr _event, EVENT_PROPERTY index, out float value); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetProperty (IntPtr _event, EVENT_PROPERTY index, float value); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetReverbLevel (IntPtr _event, int index, out float level); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetReverbLevel (IntPtr _event, int index, float level); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPaused (IntPtr _event, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetPaused (IntPtr _event, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Start (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Stop (IntPtr _event, STOP_MODE mode); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetTimelinePosition (IntPtr _event, out int position); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetTimelinePosition (IntPtr _event, int position); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPlaybackState (IntPtr _event, out PLAYBACK_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetChannelGroup (IntPtr _event, out IntPtr group); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetMinMaxDistance (IntPtr _event, out float min, out float max); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Release (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_IsVirtual (IntPtr _event, out bool virtualstate); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetParameterByName (IntPtr _event, byte[] name, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByName (IntPtr _event, byte[] name, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByNameWithLabel (IntPtr _event, byte[] name, byte[] label, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetParameterByID (IntPtr _event, PARAMETER_ID id, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByID (IntPtr _event, PARAMETER_ID id, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByIDWithLabel (IntPtr _event, PARAMETER_ID id, byte[] label, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParametersByIDs (IntPtr _event, PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_KeyOff (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetCallback (IntPtr _event, EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetUserData (IntPtr _event, out IntPtr userdata); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetUserData (IntPtr _event, IntPtr userdata); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetCPUUsage (IntPtr _event, out uint exclusive, out uint inclusive); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetMemoryUsage (IntPtr _event, out MEMORY_USAGE memoryusage); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public EventInstance(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_EventInstance_IsValid(this.handle); + } + + #endregion + } + + public struct Bus + { + public RESULT getID(out GUID id) + { + return FMOD_Studio_Bus_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bus_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bus_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + + } + public RESULT getVolume(out float volume) + { + float finalVolume; + return getVolume(out volume, out finalVolume); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_Bus_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_Bus_SetVolume(this.handle, volume); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_Bus_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_Bus_SetPaused(this.handle, paused); + } + public RESULT getMute(out bool mute) + { + return FMOD_Studio_Bus_GetMute(this.handle, out mute); + } + public RESULT setMute(bool mute) + { + return FMOD_Studio_Bus_SetMute(this.handle, mute); + } + public RESULT stopAllEvents(STOP_MODE mode) + { + return FMOD_Studio_Bus_StopAllEvents(this.handle, mode); + } + public RESULT lockChannelGroup() + { + return FMOD_Studio_Bus_LockChannelGroup(this.handle); + } + public RESULT unlockChannelGroup() + { + return FMOD_Studio_Bus_UnlockChannelGroup(this.handle); + } + public RESULT getChannelGroup(out FMOD.ChannelGroup group) + { + return FMOD_Studio_Bus_GetChannelGroup(this.handle, out group.handle); + } + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD_Studio_Bus_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_Bus_GetMemoryUsage(this.handle, out memoryusage); + } + public RESULT getPortIndex(out ulong index) + { + return FMOD_Studio_Bus_GetPortIndex(this.handle, out index); + } + public RESULT setPortIndex(ulong index) + { + return FMOD_Studio_Bus_SetPortIndex(this.handle, index); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_Bus_IsValid (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetID (IntPtr bus, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetPath (IntPtr bus, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetVolume (IntPtr bus, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetVolume (IntPtr bus, float volume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetPaused (IntPtr bus, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetPaused (IntPtr bus, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetMute (IntPtr bus, out bool mute); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetMute (IntPtr bus, bool mute); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_StopAllEvents (IntPtr bus, STOP_MODE mode); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_LockChannelGroup (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_UnlockChannelGroup (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetChannelGroup (IntPtr bus, out IntPtr group); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetCPUUsage (IntPtr bus, out uint exclusive, out uint inclusive); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetMemoryUsage (IntPtr bus, out MEMORY_USAGE memoryusage); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetPortIndex (IntPtr bus, out ulong index); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetPortIndex (IntPtr bus, ulong index); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Bus(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_Bus_IsValid(this.handle); + } + + #endregion + } + + public struct VCA + { + public RESULT getID(out GUID id) + { + return FMOD_Studio_VCA_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_VCA_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_VCA_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getVolume(out float volume) + { + float finalVolume; + return getVolume(out volume, out finalVolume); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_VCA_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_VCA_SetVolume(this.handle, volume); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_VCA_IsValid (IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetID (IntPtr vca, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetPath (IntPtr vca, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetVolume (IntPtr vca, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_SetVolume (IntPtr vca, float volume); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public VCA(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_VCA_IsValid(this.handle); + } + + #endregion + } + + public struct Bank + { + // Property access + + public RESULT getID(out GUID id) + { + return FMOD_Studio_Bank_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bank_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bank_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT unload() + { + return FMOD_Studio_Bank_Unload(this.handle); + } + public RESULT loadSampleData() + { + return FMOD_Studio_Bank_LoadSampleData(this.handle); + } + public RESULT unloadSampleData() + { + return FMOD_Studio_Bank_UnloadSampleData(this.handle); + } + public RESULT getLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_Bank_GetLoadingState(this.handle, out state); + } + public RESULT getSampleLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_Bank_GetSampleLoadingState(this.handle, out state); + } + + // Enumeration + public RESULT getStringCount(out int count) + { + return FMOD_Studio_Bank_GetStringCount(this.handle, out count); + } + public RESULT getStringInfo(int index, out GUID id, out string path) + { + path = null; + id = new GUID(); + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bank_GetStringInfo(this.handle, index, out id, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bank_GetStringInfo(this.handle, index, out id, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + + public RESULT getEventCount(out int count) + { + return FMOD_Studio_Bank_GetEventCount(this.handle, out count); + } + public RESULT getEventList(out EventDescription[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetEventCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new EventDescription[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetEventList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new EventDescription[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getBusCount(out int count) + { + return FMOD_Studio_Bank_GetBusCount(this.handle, out count); + } + public RESULT getBusList(out Bus[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetBusCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new Bus[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetBusList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new Bus[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getVCACount(out int count) + { + return FMOD_Studio_Bank_GetVCACount(this.handle, out count); + } + public RESULT getVCAList(out VCA[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetVCACount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new VCA[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetVCAList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new VCA[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_Bank_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_Bank_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_Bank_IsValid (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetID (IntPtr bank, out GUID id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetPath (IntPtr bank, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_Unload (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_LoadSampleData (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_UnloadSampleData (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetLoadingState (IntPtr bank, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetSampleLoadingState (IntPtr bank, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetStringCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetStringInfo (IntPtr bank, int index, out GUID id, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetEventCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetEventList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetBusCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetBusList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetVCACount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetVCAList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetUserData (IntPtr bank, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_SetUserData (IntPtr bank, IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public Bank(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_Bank_IsValid(this.handle); + } + + #endregion + } + + public struct CommandReplay + { + // Information query + public RESULT getSystem(out System system) + { + return FMOD_Studio_CommandReplay_GetSystem(this.handle, out system.handle); + } + + public RESULT getLength(out float length) + { + return FMOD_Studio_CommandReplay_GetLength(this.handle, out length); + } + public RESULT getCommandCount(out int count) + { + return FMOD_Studio_CommandReplay_GetCommandCount(this.handle, out count); + } + public RESULT getCommandInfo(int commandIndex, out COMMAND_INFO info) + { + return FMOD_Studio_CommandReplay_GetCommandInfo(this.handle, commandIndex, out info); + } + + public RESULT getCommandString(int commandIndex, out string buffer) + { + buffer = null; + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + int stringLength = 256; + IntPtr stringMem = Marshal.AllocHGlobal(256); + RESULT result = FMOD_Studio_CommandReplay_GetCommandString(this.handle, commandIndex, stringMem, stringLength); + + while (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringLength *= 2; + stringMem = Marshal.AllocHGlobal(stringLength); + result = FMOD_Studio_CommandReplay_GetCommandString(this.handle, commandIndex, stringMem, stringLength); + } + + if (result == RESULT.OK) + { + buffer = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getCommandAtTime(float time, out int commandIndex) + { + return FMOD_Studio_CommandReplay_GetCommandAtTime(this.handle, time, out commandIndex); + } + // Playback + public RESULT setBankPath(string bankPath) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_CommandReplay_SetBankPath(this.handle, encoder.byteFromStringUTF8(bankPath)); + } + } + public RESULT start() + { + return FMOD_Studio_CommandReplay_Start(this.handle); + } + public RESULT stop() + { + return FMOD_Studio_CommandReplay_Stop(this.handle); + } + public RESULT seekToTime(float time) + { + return FMOD_Studio_CommandReplay_SeekToTime(this.handle, time); + } + public RESULT seekToCommand(int commandIndex) + { + return FMOD_Studio_CommandReplay_SeekToCommand(this.handle, commandIndex); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_CommandReplay_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_CommandReplay_SetPaused(this.handle, paused); + } + public RESULT getPlaybackState(out PLAYBACK_STATE state) + { + return FMOD_Studio_CommandReplay_GetPlaybackState(this.handle, out state); + } + public RESULT getCurrentCommand(out int commandIndex, out float currentTime) + { + return FMOD_Studio_CommandReplay_GetCurrentCommand(this.handle, out commandIndex, out currentTime); + } + // Release + public RESULT release() + { + return FMOD_Studio_CommandReplay_Release(this.handle); + } + // Callbacks + public RESULT setFrameCallback(COMMANDREPLAY_FRAME_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetFrameCallback(this.handle, callback); + } + public RESULT setLoadBankCallback(COMMANDREPLAY_LOAD_BANK_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetLoadBankCallback(this.handle, callback); + } + public RESULT setCreateInstanceCallback(COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetCreateInstanceCallback(this.handle, callback); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_CommandReplay_GetUserData(this.handle, out userdata); + } + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_CommandReplay_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_CommandReplay_IsValid (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetSystem (IntPtr replay, out IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetLength (IntPtr replay, out float length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandCount (IntPtr replay, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandInfo (IntPtr replay, int commandindex, out COMMAND_INFO info); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandString (IntPtr replay, int commandIndex, IntPtr buffer, int length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandAtTime (IntPtr replay, float time, out int commandIndex); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetBankPath (IntPtr replay, byte[] bankPath); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Start (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Stop (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SeekToTime (IntPtr replay, float time); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SeekToCommand (IntPtr replay, int commandIndex); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetPaused (IntPtr replay, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetPaused (IntPtr replay, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetPlaybackState (IntPtr replay, out PLAYBACK_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCurrentCommand (IntPtr replay, out int commandIndex, out float currentTime); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Release (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetFrameCallback (IntPtr replay, COMMANDREPLAY_FRAME_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetLoadBankCallback (IntPtr replay, COMMANDREPLAY_LOAD_BANK_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetCreateInstanceCallback(IntPtr replay, COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetUserData (IntPtr replay, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetUserData (IntPtr replay, IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public CommandReplay(IntPtr ptr) { this.handle = ptr; } + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_CommandReplay_IsValid(this.handle); + } + + #endregion + } +} // FMOD diff --git a/vendor/fmod/inc/fmod_studio.h b/vendor/fmod/inc/fmod_studio.h new file mode 100644 index 0000000..b241788 --- /dev/null +++ b/vendor/fmod/inc/fmod_studio.h @@ -0,0 +1,248 @@ +/* ======================================================================================== */ +/* FMOD Studio API - C header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ +/* */ +/* Use this header in conjunction with fmod_studio_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=page=studio-api.html */ +/* ======================================================================================== */ +#ifndef FMOD_STUDIO_H +#define FMOD_STUDIO_H + +#include "fmod_studio_common.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* + Global +*/ +FMOD_RESULT F_API FMOD_Studio_ParseID(const char *idstring, FMOD_GUID *id); +FMOD_RESULT F_API FMOD_Studio_System_Create(FMOD_STUDIO_SYSTEM **system, unsigned int headerversion); + +/* + System +*/ +FMOD_BOOL F_API FMOD_Studio_System_IsValid(FMOD_STUDIO_SYSTEM *system); +FMOD_RESULT F_API FMOD_Studio_System_SetAdvancedSettings(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_ADVANCEDSETTINGS *settings); +FMOD_RESULT F_API FMOD_Studio_System_GetAdvancedSettings(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_ADVANCEDSETTINGS *settings); +FMOD_RESULT F_API FMOD_Studio_System_Initialize(FMOD_STUDIO_SYSTEM *system, int maxchannels, FMOD_STUDIO_INITFLAGS studioflags, FMOD_INITFLAGS flags, void *extradriverdata); +FMOD_RESULT F_API FMOD_Studio_System_Release(FMOD_STUDIO_SYSTEM *system); +FMOD_RESULT F_API FMOD_Studio_System_Update(FMOD_STUDIO_SYSTEM *system); +FMOD_RESULT F_API FMOD_Studio_System_GetCoreSystem(FMOD_STUDIO_SYSTEM *system, FMOD_SYSTEM **coresystem); +FMOD_RESULT F_API FMOD_Studio_System_GetEvent(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_EVENTDESCRIPTION **event); +FMOD_RESULT F_API FMOD_Studio_System_GetBus(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_BUS **bus); +FMOD_RESULT F_API FMOD_Studio_System_GetVCA(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_VCA **vca); +FMOD_RESULT F_API FMOD_Studio_System_GetBank(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_BANK **bank); +FMOD_RESULT F_API FMOD_Studio_System_GetEventByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_EVENTDESCRIPTION **event); +FMOD_RESULT F_API FMOD_Studio_System_GetBusByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_BUS **bus); +FMOD_RESULT F_API FMOD_Studio_System_GetVCAByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_VCA **vca); +FMOD_RESULT F_API FMOD_Studio_System_GetBankByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_BANK **bank); +FMOD_RESULT F_API FMOD_Studio_System_GetSoundInfo(FMOD_STUDIO_SYSTEM *system, const char *key, FMOD_STUDIO_SOUND_INFO *info); +FMOD_RESULT F_API FMOD_Studio_System_GetParameterDescriptionByName(FMOD_STUDIO_SYSTEM *system, const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); +FMOD_RESULT F_API FMOD_Studio_System_GetParameterDescriptionByID(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); +FMOD_RESULT F_API FMOD_Studio_System_GetParameterLabelByName(FMOD_STUDIO_SYSTEM *system, const char *name, int labelindex, char *label, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_System_GetParameterLabelByID(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, int labelindex, char *label, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_System_GetParameterByID(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, float *value, float *finalvalue); +FMOD_RESULT F_API FMOD_Studio_System_SetParameterByID(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, float value, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_System_SetParameterByIDWithLabel(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, const char *label, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_System_SetParametersByIDs(FMOD_STUDIO_SYSTEM *system, const FMOD_STUDIO_PARAMETER_ID *ids, float *values, int count, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_System_GetParameterByName(FMOD_STUDIO_SYSTEM *system, const char *name, float *value, float *finalvalue); +FMOD_RESULT F_API FMOD_Studio_System_SetParameterByName(FMOD_STUDIO_SYSTEM *system, const char *name, float value, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_System_SetParameterByNameWithLabel(FMOD_STUDIO_SYSTEM *system, const char *name, const char *label, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_System_LookupID(FMOD_STUDIO_SYSTEM *system, const char *path, FMOD_GUID *id); +FMOD_RESULT F_API FMOD_Studio_System_LookupPath(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, char *path, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_System_GetNumListeners(FMOD_STUDIO_SYSTEM *system, int *numlisteners); +FMOD_RESULT F_API FMOD_Studio_System_SetNumListeners(FMOD_STUDIO_SYSTEM *system, int numlisteners); +FMOD_RESULT F_API FMOD_Studio_System_GetListenerAttributes(FMOD_STUDIO_SYSTEM *system, int index, FMOD_3D_ATTRIBUTES *attributes, FMOD_VECTOR *attenuationposition); +FMOD_RESULT F_API FMOD_Studio_System_SetListenerAttributes(FMOD_STUDIO_SYSTEM *system, int index, const FMOD_3D_ATTRIBUTES *attributes, const FMOD_VECTOR *attenuationposition); +FMOD_RESULT F_API FMOD_Studio_System_GetListenerWeight(FMOD_STUDIO_SYSTEM *system, int index, float *weight); +FMOD_RESULT F_API FMOD_Studio_System_SetListenerWeight(FMOD_STUDIO_SYSTEM *system, int index, float weight); +FMOD_RESULT F_API FMOD_Studio_System_LoadBankFile(FMOD_STUDIO_SYSTEM *system, const char *filename, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank); +FMOD_RESULT F_API FMOD_Studio_System_LoadBankMemory(FMOD_STUDIO_SYSTEM *system, const char *buffer, int length, FMOD_STUDIO_LOAD_MEMORY_MODE mode, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank); +FMOD_RESULT F_API FMOD_Studio_System_LoadBankCustom(FMOD_STUDIO_SYSTEM *system, const FMOD_STUDIO_BANK_INFO *info, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank); +FMOD_RESULT F_API FMOD_Studio_System_RegisterPlugin(FMOD_STUDIO_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description); +FMOD_RESULT F_API FMOD_Studio_System_UnregisterPlugin(FMOD_STUDIO_SYSTEM *system, const char *name); +FMOD_RESULT F_API FMOD_Studio_System_UnloadAll(FMOD_STUDIO_SYSTEM *system); +FMOD_RESULT F_API FMOD_Studio_System_FlushCommands(FMOD_STUDIO_SYSTEM *system); +FMOD_RESULT F_API FMOD_Studio_System_FlushSampleLoading(FMOD_STUDIO_SYSTEM *system); +FMOD_RESULT F_API FMOD_Studio_System_StartCommandCapture(FMOD_STUDIO_SYSTEM *system, const char *filename, FMOD_STUDIO_COMMANDCAPTURE_FLAGS flags); +FMOD_RESULT F_API FMOD_Studio_System_StopCommandCapture(FMOD_STUDIO_SYSTEM *system); +FMOD_RESULT F_API FMOD_Studio_System_LoadCommandReplay(FMOD_STUDIO_SYSTEM *system, const char *filename, FMOD_STUDIO_COMMANDREPLAY_FLAGS flags, FMOD_STUDIO_COMMANDREPLAY **replay); +FMOD_RESULT F_API FMOD_Studio_System_GetBankCount(FMOD_STUDIO_SYSTEM *system, int *count); +FMOD_RESULT F_API FMOD_Studio_System_GetBankList(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_BANK **array, int capacity, int *count); +FMOD_RESULT F_API FMOD_Studio_System_GetParameterDescriptionCount(FMOD_STUDIO_SYSTEM *system, int *count); +FMOD_RESULT F_API FMOD_Studio_System_GetParameterDescriptionList(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_DESCRIPTION *array, int capacity, int *count); +FMOD_RESULT F_API FMOD_Studio_System_GetCPUUsage(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_CPU_USAGE *usage, FMOD_CPU_USAGE *usage_core); +FMOD_RESULT F_API FMOD_Studio_System_GetBufferUsage(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_BUFFER_USAGE *usage); +FMOD_RESULT F_API FMOD_Studio_System_ResetBufferUsage(FMOD_STUDIO_SYSTEM *system); +FMOD_RESULT F_API FMOD_Studio_System_SetCallback(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_SYSTEM_CALLBACK callback, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE callbackmask); +FMOD_RESULT F_API FMOD_Studio_System_SetUserData(FMOD_STUDIO_SYSTEM *system, void *userdata); +FMOD_RESULT F_API FMOD_Studio_System_GetUserData(FMOD_STUDIO_SYSTEM *system, void **userdata); +FMOD_RESULT F_API FMOD_Studio_System_GetMemoryUsage(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_MEMORY_USAGE *memoryusage); + +/* + EventDescription +*/ +FMOD_BOOL F_API FMOD_Studio_EventDescription_IsValid(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetID(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_GUID *id); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetPath(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, char *path, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterDescriptionCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int index, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterDescriptionByName(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterDescriptionByID(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_PARAMETER_ID id, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterLabelByIndex(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int index, int labelindex, char *label, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterLabelByName(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, const char *name, int labelindex, char *label, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterLabelByID(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_PARAMETER_ID id, int labelindex, char *label, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserPropertyCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserPropertyByIndex(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int index, FMOD_STUDIO_USER_PROPERTY *property); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserProperty(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, const char *name, FMOD_STUDIO_USER_PROPERTY *property); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetLength(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *length); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetMinMaxDistance(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, float *min, float *max); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetSoundSize(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, float *size); +FMOD_RESULT F_API FMOD_Studio_EventDescription_IsSnapshot(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *snapshot); +FMOD_RESULT F_API FMOD_Studio_EventDescription_IsOneshot(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *oneshot); +FMOD_RESULT F_API FMOD_Studio_EventDescription_IsStream(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *isStream); +FMOD_RESULT F_API FMOD_Studio_EventDescription_Is3D(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *is3D); +FMOD_RESULT F_API FMOD_Studio_EventDescription_IsDopplerEnabled(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *doppler); +FMOD_RESULT F_API FMOD_Studio_EventDescription_HasSustainPoint(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *sustainPoint); +FMOD_RESULT F_API FMOD_Studio_EventDescription_CreateInstance(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENTINSTANCE **instance); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetInstanceCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetInstanceList(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENTINSTANCE **array, int capacity, int *count); +FMOD_RESULT F_API FMOD_Studio_EventDescription_LoadSampleData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription); +FMOD_RESULT F_API FMOD_Studio_EventDescription_UnloadSampleData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetSampleLoadingState(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_LOADING_STATE *state); +FMOD_RESULT F_API FMOD_Studio_EventDescription_ReleaseAllInstances(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription); +FMOD_RESULT F_API FMOD_Studio_EventDescription_SetCallback(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask); +FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, void **userdata); +FMOD_RESULT F_API FMOD_Studio_EventDescription_SetUserData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, void *userdata); + +/* + EventInstance +*/ +FMOD_BOOL F_API FMOD_Studio_EventInstance_IsValid(FMOD_STUDIO_EVENTINSTANCE *eventinstance); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetDescription(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENTDESCRIPTION **description); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetVolume(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float *volume, float *finalvolume); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetVolume(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float volume); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPitch(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float *pitch, float *finalpitch); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetPitch(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float pitch); +FMOD_RESULT F_API FMOD_Studio_EventInstance_Get3DAttributes(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_3D_ATTRIBUTES *attributes); +FMOD_RESULT F_API FMOD_Studio_EventInstance_Set3DAttributes(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_3D_ATTRIBUTES *attributes); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetListenerMask(FMOD_STUDIO_EVENTINSTANCE *eventinstance, unsigned int *mask); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetListenerMask(FMOD_STUDIO_EVENTINSTANCE *eventinstance, unsigned int mask); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetProperty(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_PROPERTY index, float *value); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetProperty(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_PROPERTY index, float value); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetReverbLevel(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int index, float *level); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetReverbLevel(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int index, float level); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPaused(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL *paused); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetPaused(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL paused); +FMOD_RESULT F_API FMOD_Studio_EventInstance_Start(FMOD_STUDIO_EVENTINSTANCE *eventinstance); +FMOD_RESULT F_API FMOD_Studio_EventInstance_Stop(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_STOP_MODE mode); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetTimelinePosition(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int *position); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetTimelinePosition(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int position); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPlaybackState(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PLAYBACK_STATE *state); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetChannelGroup(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_CHANNELGROUP **group); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetMinMaxDistance(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float *min, float *max); +FMOD_RESULT F_API FMOD_Studio_EventInstance_Release(FMOD_STUDIO_EVENTINSTANCE *eventinstance); +FMOD_RESULT F_API FMOD_Studio_EventInstance_IsVirtual(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL *virtualstate); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetParameterByName(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, float *value, float *finalvalue); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterByName(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, float value, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterByNameWithLabel(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, const char *label, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetParameterByID(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PARAMETER_ID id, float *value, float *finalvalue); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterByID(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PARAMETER_ID id, float value, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterByIDWithLabel(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PARAMETER_ID id, const char *label, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParametersByIDs(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const FMOD_STUDIO_PARAMETER_ID *ids, float *values, int count, FMOD_BOOL ignoreseekspeed); +FMOD_RESULT F_API FMOD_Studio_EventInstance_KeyOff(FMOD_STUDIO_EVENTINSTANCE *eventinstance); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetCallback(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetUserData(FMOD_STUDIO_EVENTINSTANCE *eventinstance, void **userdata); +FMOD_RESULT F_API FMOD_Studio_EventInstance_SetUserData(FMOD_STUDIO_EVENTINSTANCE *eventinstance, void *userdata); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetCPUUsage(FMOD_STUDIO_EVENTINSTANCE *eventinstance, unsigned int *exclusive, unsigned int *inclusive); +FMOD_RESULT F_API FMOD_Studio_EventInstance_GetMemoryUsage(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_MEMORY_USAGE *memoryusage); + +/* + Bus +*/ +FMOD_BOOL F_API FMOD_Studio_Bus_IsValid(FMOD_STUDIO_BUS *bus); +FMOD_RESULT F_API FMOD_Studio_Bus_GetID(FMOD_STUDIO_BUS *bus, FMOD_GUID *id); +FMOD_RESULT F_API FMOD_Studio_Bus_GetPath(FMOD_STUDIO_BUS *bus, char *path, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_Bus_GetVolume(FMOD_STUDIO_BUS *bus, float *volume, float *finalvolume); +FMOD_RESULT F_API FMOD_Studio_Bus_SetVolume(FMOD_STUDIO_BUS *bus, float volume); +FMOD_RESULT F_API FMOD_Studio_Bus_GetPaused(FMOD_STUDIO_BUS *bus, FMOD_BOOL *paused); +FMOD_RESULT F_API FMOD_Studio_Bus_SetPaused(FMOD_STUDIO_BUS *bus, FMOD_BOOL paused); +FMOD_RESULT F_API FMOD_Studio_Bus_GetMute(FMOD_STUDIO_BUS *bus, FMOD_BOOL *mute); +FMOD_RESULT F_API FMOD_Studio_Bus_SetMute(FMOD_STUDIO_BUS *bus, FMOD_BOOL mute); +FMOD_RESULT F_API FMOD_Studio_Bus_StopAllEvents(FMOD_STUDIO_BUS *bus, FMOD_STUDIO_STOP_MODE mode); +FMOD_RESULT F_API FMOD_Studio_Bus_GetPortIndex(FMOD_STUDIO_BUS *bus, FMOD_PORT_INDEX *index); +FMOD_RESULT F_API FMOD_Studio_Bus_SetPortIndex(FMOD_STUDIO_BUS *bus, FMOD_PORT_INDEX index); +FMOD_RESULT F_API FMOD_Studio_Bus_LockChannelGroup(FMOD_STUDIO_BUS *bus); +FMOD_RESULT F_API FMOD_Studio_Bus_UnlockChannelGroup(FMOD_STUDIO_BUS *bus); +FMOD_RESULT F_API FMOD_Studio_Bus_GetChannelGroup(FMOD_STUDIO_BUS *bus, FMOD_CHANNELGROUP **group); +FMOD_RESULT F_API FMOD_Studio_Bus_GetCPUUsage(FMOD_STUDIO_BUS *bus, unsigned int *exclusive, unsigned int *inclusive); +FMOD_RESULT F_API FMOD_Studio_Bus_GetMemoryUsage(FMOD_STUDIO_BUS *bus, FMOD_STUDIO_MEMORY_USAGE *memoryusage); + +/* + VCA +*/ +FMOD_BOOL F_API FMOD_Studio_VCA_IsValid(FMOD_STUDIO_VCA *vca); +FMOD_RESULT F_API FMOD_Studio_VCA_GetID(FMOD_STUDIO_VCA *vca, FMOD_GUID *id); +FMOD_RESULT F_API FMOD_Studio_VCA_GetPath(FMOD_STUDIO_VCA *vca, char *path, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_VCA_GetVolume(FMOD_STUDIO_VCA *vca, float *volume, float *finalvolume); +FMOD_RESULT F_API FMOD_Studio_VCA_SetVolume(FMOD_STUDIO_VCA *vca, float volume); + +/* + Bank +*/ +FMOD_BOOL F_API FMOD_Studio_Bank_IsValid(FMOD_STUDIO_BANK *bank); +FMOD_RESULT F_API FMOD_Studio_Bank_GetID(FMOD_STUDIO_BANK *bank, FMOD_GUID *id); +FMOD_RESULT F_API FMOD_Studio_Bank_GetPath(FMOD_STUDIO_BANK *bank, char *path, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_Bank_Unload(FMOD_STUDIO_BANK *bank); +FMOD_RESULT F_API FMOD_Studio_Bank_LoadSampleData(FMOD_STUDIO_BANK *bank); +FMOD_RESULT F_API FMOD_Studio_Bank_UnloadSampleData(FMOD_STUDIO_BANK *bank); +FMOD_RESULT F_API FMOD_Studio_Bank_GetLoadingState(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_LOADING_STATE *state); +FMOD_RESULT F_API FMOD_Studio_Bank_GetSampleLoadingState(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_LOADING_STATE *state); +FMOD_RESULT F_API FMOD_Studio_Bank_GetStringCount(FMOD_STUDIO_BANK *bank, int *count); +FMOD_RESULT F_API FMOD_Studio_Bank_GetStringInfo(FMOD_STUDIO_BANK *bank, int index, FMOD_GUID *id, char *path, int size, int *retrieved); +FMOD_RESULT F_API FMOD_Studio_Bank_GetEventCount(FMOD_STUDIO_BANK *bank, int *count); +FMOD_RESULT F_API FMOD_Studio_Bank_GetEventList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_EVENTDESCRIPTION **array, int capacity, int *count); +FMOD_RESULT F_API FMOD_Studio_Bank_GetBusCount(FMOD_STUDIO_BANK *bank, int *count); +FMOD_RESULT F_API FMOD_Studio_Bank_GetBusList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_BUS **array, int capacity, int *count); +FMOD_RESULT F_API FMOD_Studio_Bank_GetVCACount(FMOD_STUDIO_BANK *bank, int *count); +FMOD_RESULT F_API FMOD_Studio_Bank_GetVCAList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_VCA **array, int capacity, int *count); +FMOD_RESULT F_API FMOD_Studio_Bank_GetUserData(FMOD_STUDIO_BANK *bank, void **userdata); +FMOD_RESULT F_API FMOD_Studio_Bank_SetUserData(FMOD_STUDIO_BANK *bank, void *userdata); + +/* + Command playback information +*/ +FMOD_BOOL F_API FMOD_Studio_CommandReplay_IsValid(FMOD_STUDIO_COMMANDREPLAY *replay); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetSystem(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_SYSTEM **system); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetLength(FMOD_STUDIO_COMMANDREPLAY *replay, float *length); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandCount(FMOD_STUDIO_COMMANDREPLAY *replay, int *count); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandInfo(FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex, FMOD_STUDIO_COMMAND_INFO *info); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandString(FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex, char *buffer, int length); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandAtTime(FMOD_STUDIO_COMMANDREPLAY *replay, float time, int *commandindex); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetBankPath(FMOD_STUDIO_COMMANDREPLAY *replay, const char *bankPath); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_Start(FMOD_STUDIO_COMMANDREPLAY *replay); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_Stop(FMOD_STUDIO_COMMANDREPLAY *replay); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_SeekToTime(FMOD_STUDIO_COMMANDREPLAY *replay, float time); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_SeekToCommand(FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetPaused(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_BOOL *paused); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetPaused(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_BOOL paused); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetPlaybackState(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_PLAYBACK_STATE *state); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCurrentCommand(FMOD_STUDIO_COMMANDREPLAY *replay, int *commandindex, float *currenttime); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_Release(FMOD_STUDIO_COMMANDREPLAY *replay); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetFrameCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK callback); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetLoadBankCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK callback); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetCreateInstanceCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetUserData(FMOD_STUDIO_COMMANDREPLAY *replay, void **userdata); +FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetUserData(FMOD_STUDIO_COMMANDREPLAY *replay, void *userdata); + +#ifdef __cplusplus +} +#endif + +#endif /* FMOD_STUDIO_H */ diff --git a/vendor/fmod/inc/fmod_studio.hpp b/vendor/fmod/inc/fmod_studio.hpp new file mode 100644 index 0000000..460f213 --- /dev/null +++ b/vendor/fmod/inc/fmod_studio.hpp @@ -0,0 +1,402 @@ +/* ======================================================================================== */ +/* FMOD Studio API - C++ header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ +/* */ +/* Use this header in conjunction with fmod_studio_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=page=studio-api.html */ +/* ======================================================================================== */ +#ifndef FMOD_STUDIO_HPP +#define FMOD_STUDIO_HPP + +#include "fmod_studio_common.h" +#include "fmod_studio.h" + +#include "fmod.hpp" + +namespace FMOD +{ + +namespace Studio +{ + typedef FMOD_GUID ID; // Deprecated. Please use FMOD_GUID type. + + class System; + class EventDescription; + class EventInstance; + class Bus; + class VCA; + class Bank; + class CommandReplay; + + inline FMOD_RESULT parseID(const char *idstring, FMOD_GUID *id) { return FMOD_Studio_ParseID(idstring, id); } + + class System + { + private: + // Constructor made private so user cannot statically instance a System class. System::create must be used. + System(); + System(const System &); + + public: + static FMOD_RESULT F_API create(System **system, unsigned int headerversion = FMOD_VERSION); + FMOD_RESULT F_API setAdvancedSettings(FMOD_STUDIO_ADVANCEDSETTINGS *settings); + FMOD_RESULT F_API getAdvancedSettings(FMOD_STUDIO_ADVANCEDSETTINGS *settings); + FMOD_RESULT F_API initialize(int maxchannels, FMOD_STUDIO_INITFLAGS studioflags, FMOD_INITFLAGS flags, void *extradriverdata); + FMOD_RESULT F_API release(); + + // Handle validity + bool F_API isValid() const; + + // Update processing + FMOD_RESULT F_API update(); + FMOD_RESULT F_API flushCommands(); + FMOD_RESULT F_API flushSampleLoading(); + + // Low-level API access + FMOD_RESULT F_API getCoreSystem(FMOD::System **system) const; + + // Asset retrieval + FMOD_RESULT F_API getEvent(const char *path, EventDescription **event) const; + FMOD_RESULT F_API getBus(const char *path, Bus **bus) const; + FMOD_RESULT F_API getVCA(const char *path, VCA **vca) const; + FMOD_RESULT F_API getBank(const char *path, Bank **bank) const; + FMOD_RESULT F_API getEventByID(const FMOD_GUID *id, EventDescription **event) const; + FMOD_RESULT F_API getBusByID(const FMOD_GUID *id, Bus **bus) const; + FMOD_RESULT F_API getVCAByID(const FMOD_GUID *id, VCA **vca) const; + FMOD_RESULT F_API getBankByID(const FMOD_GUID *id, Bank **bank) const; + FMOD_RESULT F_API getSoundInfo(const char *key, FMOD_STUDIO_SOUND_INFO *info) const; + FMOD_RESULT F_API getParameterDescriptionByName(const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; + FMOD_RESULT F_API getParameterDescriptionByID(FMOD_STUDIO_PARAMETER_ID id, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; + FMOD_RESULT F_API getParameterLabelByName(const char *name, int labelindex, char *label, int size, int *retrieved) const; + FMOD_RESULT F_API getParameterLabelByID(FMOD_STUDIO_PARAMETER_ID id, int labelindex, char *label, int size, int *retrieved) const; + + // Global parameter control + FMOD_RESULT F_API getParameterByID(FMOD_STUDIO_PARAMETER_ID id, float *value, float *finalvalue = 0) const; + FMOD_RESULT F_API setParameterByID(FMOD_STUDIO_PARAMETER_ID id, float value, bool ignoreseekspeed = false); + FMOD_RESULT F_API setParameterByIDWithLabel(FMOD_STUDIO_PARAMETER_ID id, const char *label, bool ignoreseekspeed = false); + FMOD_RESULT F_API setParametersByIDs(const FMOD_STUDIO_PARAMETER_ID *ids, float *values, int count, bool ignoreseekspeed = false); + FMOD_RESULT F_API getParameterByName(const char *name, float *value, float *finalvalue = 0) const; + FMOD_RESULT F_API setParameterByName(const char *name, float value, bool ignoreseekspeed = false); + FMOD_RESULT F_API setParameterByNameWithLabel(const char *name, const char *label, bool ignoreseekspeed = false); + + // Path lookup + FMOD_RESULT F_API lookupID(const char *path, FMOD_GUID *id) const; + FMOD_RESULT F_API lookupPath(const FMOD_GUID *id, char *path, int size, int *retrieved) const; + + // Listener control + FMOD_RESULT F_API getNumListeners(int *numlisteners); + FMOD_RESULT F_API setNumListeners(int numlisteners); + FMOD_RESULT F_API getListenerAttributes(int listener, FMOD_3D_ATTRIBUTES *attributes, FMOD_VECTOR *attenuationposition = 0) const; + FMOD_RESULT F_API setListenerAttributes(int listener, const FMOD_3D_ATTRIBUTES *attributes, const FMOD_VECTOR *attenuationposition = 0); + FMOD_RESULT F_API getListenerWeight(int listener, float *weight); + FMOD_RESULT F_API setListenerWeight(int listener, float weight); + + // Bank control + FMOD_RESULT F_API loadBankFile(const char *filename, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank); + FMOD_RESULT F_API loadBankMemory(const char *buffer, int length, FMOD_STUDIO_LOAD_MEMORY_MODE mode, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank); + FMOD_RESULT F_API loadBankCustom(const FMOD_STUDIO_BANK_INFO *info, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank); + FMOD_RESULT F_API unloadAll(); + + // General functionality + FMOD_RESULT F_API getBufferUsage(FMOD_STUDIO_BUFFER_USAGE *usage) const; + FMOD_RESULT F_API resetBufferUsage(); + FMOD_RESULT F_API registerPlugin(const FMOD_DSP_DESCRIPTION *description); + FMOD_RESULT F_API unregisterPlugin(const char *name); + + // Enumeration + FMOD_RESULT F_API getBankCount(int *count) const; + FMOD_RESULT F_API getBankList(Bank **array, int capacity, int *count) const; + FMOD_RESULT F_API getParameterDescriptionCount(int *count) const; + FMOD_RESULT F_API getParameterDescriptionList(FMOD_STUDIO_PARAMETER_DESCRIPTION *array, int capacity, int *count) const; + + // Command capture and replay + FMOD_RESULT F_API startCommandCapture(const char *filename, FMOD_STUDIO_COMMANDCAPTURE_FLAGS flags); + FMOD_RESULT F_API stopCommandCapture(); + FMOD_RESULT F_API loadCommandReplay(const char *filename, FMOD_STUDIO_COMMANDREPLAY_FLAGS flags, CommandReplay **replay); + + // Callbacks + FMOD_RESULT F_API setCallback(FMOD_STUDIO_SYSTEM_CALLBACK callback, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_STUDIO_SYSTEM_CALLBACK_ALL); + FMOD_RESULT F_API getUserData(void **userdata) const; + FMOD_RESULT F_API setUserData(void *userdata); + + // Monitoring + FMOD_RESULT F_API getCPUUsage(FMOD_STUDIO_CPU_USAGE *usage, FMOD_CPU_USAGE *usage_core) const; + FMOD_RESULT F_API getMemoryUsage(FMOD_STUDIO_MEMORY_USAGE *memoryusage) const; + }; + + class EventDescription + { + private: + // Constructor made private so user cannot statically instance the class. + EventDescription(); + EventDescription(const EventDescription &); + + public: + // Handle validity + bool F_API isValid() const; + + // Property access + FMOD_RESULT F_API getID(FMOD_GUID *id) const; + FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const; + FMOD_RESULT F_API getParameterDescriptionCount(int *count) const; + FMOD_RESULT F_API getParameterDescriptionByIndex(int index, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; + FMOD_RESULT F_API getParameterDescriptionByName(const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; + FMOD_RESULT F_API getParameterDescriptionByID(FMOD_STUDIO_PARAMETER_ID id, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; + FMOD_RESULT F_API getParameterLabelByIndex(int index, int labelindex, char *label, int size, int *retrieved) const; + FMOD_RESULT F_API getParameterLabelByName(const char *name, int labelindex, char *label, int size, int *retrieved) const; + FMOD_RESULT F_API getParameterLabelByID(FMOD_STUDIO_PARAMETER_ID id, int labelindex, char *label, int size, int *retrieved) const; + FMOD_RESULT F_API getUserPropertyCount(int *count) const; + FMOD_RESULT F_API getUserPropertyByIndex(int index, FMOD_STUDIO_USER_PROPERTY *property) const; + FMOD_RESULT F_API getUserProperty(const char *name, FMOD_STUDIO_USER_PROPERTY *property) const; + FMOD_RESULT F_API getLength(int *length) const; + FMOD_RESULT F_API getMinMaxDistance(float *min, float *max) const; + FMOD_RESULT F_API getSoundSize(float *size) const; + + FMOD_RESULT F_API isSnapshot(bool *snapshot) const; + FMOD_RESULT F_API isOneshot(bool *oneshot) const; + FMOD_RESULT F_API isStream(bool *isStream) const; + FMOD_RESULT F_API is3D(bool *is3d) const; + FMOD_RESULT F_API isDopplerEnabled(bool *doppler) const; + FMOD_RESULT F_API hasSustainPoint(bool *sustainPoint) const; + + // Playback control + FMOD_RESULT F_API createInstance(EventInstance **instance) const; + FMOD_RESULT F_API getInstanceCount(int *count) const; + FMOD_RESULT F_API getInstanceList(EventInstance **array, int capacity, int *count) const; + + // Sample data loading control + FMOD_RESULT F_API loadSampleData(); + FMOD_RESULT F_API unloadSampleData(); + FMOD_RESULT F_API getSampleLoadingState(FMOD_STUDIO_LOADING_STATE *state) const; + + // Convenience functions + FMOD_RESULT F_API releaseAllInstances(); + + // Callbacks + FMOD_RESULT F_API setCallback(FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL); + FMOD_RESULT F_API getUserData(void **userdata) const; + FMOD_RESULT F_API setUserData(void *userdata); + }; + + class EventInstance + { + private: + // Constructor made private so user cannot statically instance the class. + EventInstance(); + EventInstance(const EventInstance &); + + public: + // Handle validity + bool F_API isValid() const; + + // Property access + FMOD_RESULT F_API getDescription(EventDescription **description) const; + + // Playback control + FMOD_RESULT F_API getVolume(float *volume, float *finalvolume = 0) const; + FMOD_RESULT F_API setVolume(float volume); + + FMOD_RESULT F_API getPitch(float *pitch, float *finalpitch = 0) const; + FMOD_RESULT F_API setPitch(float pitch); + + FMOD_RESULT F_API get3DAttributes(FMOD_3D_ATTRIBUTES *attributes) const; + FMOD_RESULT F_API set3DAttributes(const FMOD_3D_ATTRIBUTES *attributes); + + FMOD_RESULT F_API getListenerMask(unsigned int *mask) const; + FMOD_RESULT F_API setListenerMask(unsigned int mask); + + FMOD_RESULT F_API getProperty(FMOD_STUDIO_EVENT_PROPERTY index, float *value) const; + FMOD_RESULT F_API setProperty(FMOD_STUDIO_EVENT_PROPERTY index, float value); + + FMOD_RESULT F_API getReverbLevel(int index, float *level) const; + FMOD_RESULT F_API setReverbLevel(int index, float level); + + FMOD_RESULT F_API getPaused(bool *paused) const; + FMOD_RESULT F_API setPaused(bool paused); + + FMOD_RESULT F_API start(); + FMOD_RESULT F_API stop(FMOD_STUDIO_STOP_MODE mode); + + FMOD_RESULT F_API getTimelinePosition(int *position) const; + FMOD_RESULT F_API setTimelinePosition(int position); + + FMOD_RESULT F_API getPlaybackState(FMOD_STUDIO_PLAYBACK_STATE *state) const; + + FMOD_RESULT F_API getChannelGroup(ChannelGroup **group) const; + + FMOD_RESULT F_API getMinMaxDistance(float *min, float *max) const; + + FMOD_RESULT F_API release(); + + FMOD_RESULT F_API isVirtual(bool *virtualstate) const; + + FMOD_RESULT F_API getParameterByID(FMOD_STUDIO_PARAMETER_ID id, float *value, float *finalvalue = 0) const; + FMOD_RESULT F_API setParameterByID(FMOD_STUDIO_PARAMETER_ID id, float value, bool ignoreseekspeed = false); + FMOD_RESULT F_API setParameterByIDWithLabel(FMOD_STUDIO_PARAMETER_ID id, const char* label, bool ignoreseekspeed = false); + FMOD_RESULT F_API setParametersByIDs(const FMOD_STUDIO_PARAMETER_ID *ids, float *values, int count, bool ignoreseekspeed = false); + + FMOD_RESULT F_API getParameterByName(const char *name, float *value, float *finalvalue = 0) const; + FMOD_RESULT F_API setParameterByName(const char *name, float value, bool ignoreseekspeed = false); + FMOD_RESULT F_API setParameterByNameWithLabel(const char *name, const char* label, bool ignoreseekspeed = false); + + FMOD_RESULT F_API keyOff(); + + // Monitoring + FMOD_RESULT F_API getCPUUsage(unsigned int *exclusive, unsigned int *inclusive) const; + FMOD_RESULT F_API getMemoryUsage(FMOD_STUDIO_MEMORY_USAGE *memoryusage) const; + + // Callbacks + FMOD_RESULT F_API setCallback(FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL); + FMOD_RESULT F_API getUserData(void **userdata) const; + FMOD_RESULT F_API setUserData(void *userdata); + }; + + class Bus + { + private: + // Constructor made private so user cannot statically instance the class. + Bus(); + Bus(const Bus &); + + public: + // Handle validity + bool F_API isValid() const; + + // Property access + FMOD_RESULT F_API getID(FMOD_GUID *id) const; + FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const; + + // Playback control + FMOD_RESULT F_API getVolume(float *volume, float *finalvolume = 0) const; + FMOD_RESULT F_API setVolume(float volume); + + FMOD_RESULT F_API getPaused(bool *paused) const; + FMOD_RESULT F_API setPaused(bool paused); + + FMOD_RESULT F_API getMute(bool *mute) const; + FMOD_RESULT F_API setMute(bool mute); + + FMOD_RESULT F_API stopAllEvents(FMOD_STUDIO_STOP_MODE mode); + + // Output port + FMOD_RESULT F_API getPortIndex(FMOD_PORT_INDEX *index) const; + FMOD_RESULT F_API setPortIndex(FMOD_PORT_INDEX index); + + // Low-level API access + FMOD_RESULT F_API lockChannelGroup(); + FMOD_RESULT F_API unlockChannelGroup(); + FMOD_RESULT F_API getChannelGroup(FMOD::ChannelGroup **group) const; + + // Monitoring + FMOD_RESULT F_API getCPUUsage(unsigned int *exclusive, unsigned int *inclusive) const; + FMOD_RESULT F_API getMemoryUsage(FMOD_STUDIO_MEMORY_USAGE *memoryusage) const; + }; + + class VCA + { + private: + // Constructor made private so user cannot statically instance the class. + VCA(); + VCA(const VCA &); + + public: + // Handle validity + bool F_API isValid() const; + + // Property access + FMOD_RESULT F_API getID(FMOD_GUID *id) const; + FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const; + + // Playback control + FMOD_RESULT F_API getVolume(float *volume, float *finalvolume = 0) const; + FMOD_RESULT F_API setVolume(float volume); + }; + + class Bank + { + private: + // Constructor made private so user cannot statically instance the class. + Bank(); + Bank(const Bank &); + + public: + // Handle validity + bool F_API isValid() const; + + // Property access + FMOD_RESULT F_API getID(FMOD_GUID *id) const; + FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const; + + // Loading control + FMOD_RESULT F_API unload(); + FMOD_RESULT F_API loadSampleData(); + FMOD_RESULT F_API unloadSampleData(); + + FMOD_RESULT F_API getLoadingState(FMOD_STUDIO_LOADING_STATE *state) const; + FMOD_RESULT F_API getSampleLoadingState(FMOD_STUDIO_LOADING_STATE *state) const; + + // Enumeration + FMOD_RESULT F_API getStringCount(int *count) const; + FMOD_RESULT F_API getStringInfo(int index, FMOD_GUID *id, char *path, int size, int *retrieved) const; + FMOD_RESULT F_API getEventCount(int *count) const; + FMOD_RESULT F_API getEventList(EventDescription **array, int capacity, int *count) const; + FMOD_RESULT F_API getBusCount(int *count) const; + FMOD_RESULT F_API getBusList(Bus **array, int capacity, int *count) const; + FMOD_RESULT F_API getVCACount(int *count) const; + FMOD_RESULT F_API getVCAList(VCA **array, int capacity, int *count) const; + + FMOD_RESULT F_API getUserData(void **userdata) const; + FMOD_RESULT F_API setUserData(void *userdata); + }; + + class CommandReplay + { + private: + // Constructor made private so user cannot statically instance the class. + CommandReplay(); + CommandReplay(const CommandReplay &); + + public: + // Handle validity + bool F_API isValid() const; + + // Information query + FMOD_RESULT F_API getSystem(System **system) const; + FMOD_RESULT F_API getLength(float *length) const; + + FMOD_RESULT F_API getCommandCount(int *count) const; + FMOD_RESULT F_API getCommandInfo(int commandindex, FMOD_STUDIO_COMMAND_INFO *info) const; + FMOD_RESULT F_API getCommandString(int commandindex, char *buffer, int length) const; + FMOD_RESULT F_API getCommandAtTime(float time, int *commandindex) const; + + // Playback + FMOD_RESULT F_API setBankPath(const char *bankPath); + FMOD_RESULT F_API start(); + FMOD_RESULT F_API stop(); + FMOD_RESULT F_API seekToTime(float time); + FMOD_RESULT F_API seekToCommand(int commandindex); + FMOD_RESULT F_API getPaused(bool *paused) const; + FMOD_RESULT F_API setPaused(bool paused); + FMOD_RESULT F_API getPlaybackState(FMOD_STUDIO_PLAYBACK_STATE *state) const; + FMOD_RESULT F_API getCurrentCommand(int *commandindex, float *currenttime) const; + + // Release + FMOD_RESULT F_API release(); + + // Callbacks + FMOD_RESULT F_API setFrameCallback(FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK callback); + FMOD_RESULT F_API setLoadBankCallback(FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK callback); + FMOD_RESULT F_API setCreateInstanceCallback(FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback); + + FMOD_RESULT F_API getUserData(void **userdata) const; + FMOD_RESULT F_API setUserData(void *userdata); + }; + +} // namespace Studio + +} // namespace FMOD + +#endif //FMOD_STUDIO_HPP diff --git a/vendor/fmod/inc/fmod_studio_common.h b/vendor/fmod/inc/fmod_studio_common.h new file mode 100644 index 0000000..e22d993 --- /dev/null +++ b/vendor/fmod/inc/fmod_studio_common.h @@ -0,0 +1,336 @@ +/* ======================================================================================== */ +/* FMOD Studio API - Common C/C++ header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ +/* */ +/* This header defines common enumerations, structs and callbacks that are shared between */ +/* the C and C++ interfaces. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/resources/documentation-api?version=2.0&page=page=studio-api.html */ +/* ======================================================================================== */ +#ifndef FMOD_STUDIO_COMMON_H +#define FMOD_STUDIO_COMMON_H + +#include "fmod.h" + +/* + FMOD Studio types. +*/ +typedef struct FMOD_STUDIO_SYSTEM FMOD_STUDIO_SYSTEM; +typedef struct FMOD_STUDIO_EVENTDESCRIPTION FMOD_STUDIO_EVENTDESCRIPTION; +typedef struct FMOD_STUDIO_EVENTINSTANCE FMOD_STUDIO_EVENTINSTANCE; +typedef struct FMOD_STUDIO_BUS FMOD_STUDIO_BUS; +typedef struct FMOD_STUDIO_VCA FMOD_STUDIO_VCA; +typedef struct FMOD_STUDIO_BANK FMOD_STUDIO_BANK; +typedef struct FMOD_STUDIO_COMMANDREPLAY FMOD_STUDIO_COMMANDREPLAY; + +/* + FMOD Studio constants +*/ +#define FMOD_STUDIO_LOAD_MEMORY_ALIGNMENT 32 + +typedef unsigned int FMOD_STUDIO_INITFLAGS; +#define FMOD_STUDIO_INIT_NORMAL 0x00000000 +#define FMOD_STUDIO_INIT_LIVEUPDATE 0x00000001 +#define FMOD_STUDIO_INIT_ALLOW_MISSING_PLUGINS 0x00000002 +#define FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE 0x00000004 +#define FMOD_STUDIO_INIT_DEFERRED_CALLBACKS 0x00000008 +#define FMOD_STUDIO_INIT_LOAD_FROM_UPDATE 0x00000010 +#define FMOD_STUDIO_INIT_MEMORY_TRACKING 0x00000020 + +typedef unsigned int FMOD_STUDIO_PARAMETER_FLAGS; +#define FMOD_STUDIO_PARAMETER_READONLY 0x00000001 +#define FMOD_STUDIO_PARAMETER_AUTOMATIC 0x00000002 +#define FMOD_STUDIO_PARAMETER_GLOBAL 0x00000004 +#define FMOD_STUDIO_PARAMETER_DISCRETE 0x00000008 +#define FMOD_STUDIO_PARAMETER_LABELED 0x00000010 + +typedef unsigned int FMOD_STUDIO_SYSTEM_CALLBACK_TYPE; +#define FMOD_STUDIO_SYSTEM_CALLBACK_PREUPDATE 0x00000001 +#define FMOD_STUDIO_SYSTEM_CALLBACK_POSTUPDATE 0x00000002 +#define FMOD_STUDIO_SYSTEM_CALLBACK_BANK_UNLOAD 0x00000004 +#define FMOD_STUDIO_SYSTEM_CALLBACK_LIVEUPDATE_CONNECTED 0x00000008 +#define FMOD_STUDIO_SYSTEM_CALLBACK_LIVEUPDATE_DISCONNECTED 0x00000010 +#define FMOD_STUDIO_SYSTEM_CALLBACK_ALL 0xFFFFFFFF + +typedef unsigned int FMOD_STUDIO_EVENT_CALLBACK_TYPE; +#define FMOD_STUDIO_EVENT_CALLBACK_CREATED 0x00000001 +#define FMOD_STUDIO_EVENT_CALLBACK_DESTROYED 0x00000002 +#define FMOD_STUDIO_EVENT_CALLBACK_STARTING 0x00000004 +#define FMOD_STUDIO_EVENT_CALLBACK_STARTED 0x00000008 +#define FMOD_STUDIO_EVENT_CALLBACK_RESTARTED 0x00000010 +#define FMOD_STUDIO_EVENT_CALLBACK_STOPPED 0x00000020 +#define FMOD_STUDIO_EVENT_CALLBACK_START_FAILED 0x00000040 +#define FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND 0x00000080 +#define FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND 0x00000100 +#define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED 0x00000200 +#define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED 0x00000400 +#define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER 0x00000800 +#define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT 0x00001000 +#define FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED 0x00002000 +#define FMOD_STUDIO_EVENT_CALLBACK_SOUND_STOPPED 0x00004000 +#define FMOD_STUDIO_EVENT_CALLBACK_REAL_TO_VIRTUAL 0x00008000 +#define FMOD_STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL 0x00010000 +#define FMOD_STUDIO_EVENT_CALLBACK_START_EVENT_COMMAND 0x00020000 +#define FMOD_STUDIO_EVENT_CALLBACK_NESTED_TIMELINE_BEAT 0x00040000 +#define FMOD_STUDIO_EVENT_CALLBACK_ALL 0xFFFFFFFF + +typedef unsigned int FMOD_STUDIO_LOAD_BANK_FLAGS; +#define FMOD_STUDIO_LOAD_BANK_NORMAL 0x00000000 +#define FMOD_STUDIO_LOAD_BANK_NONBLOCKING 0x00000001 +#define FMOD_STUDIO_LOAD_BANK_DECOMPRESS_SAMPLES 0x00000002 +#define FMOD_STUDIO_LOAD_BANK_UNENCRYPTED 0x00000004 + +typedef unsigned int FMOD_STUDIO_COMMANDCAPTURE_FLAGS; +#define FMOD_STUDIO_COMMANDCAPTURE_NORMAL 0x00000000 +#define FMOD_STUDIO_COMMANDCAPTURE_FILEFLUSH 0x00000001 +#define FMOD_STUDIO_COMMANDCAPTURE_SKIP_INITIAL_STATE 0x00000002 + +typedef unsigned int FMOD_STUDIO_COMMANDREPLAY_FLAGS; +#define FMOD_STUDIO_COMMANDREPLAY_NORMAL 0x00000000 +#define FMOD_STUDIO_COMMANDREPLAY_SKIP_CLEANUP 0x00000001 +#define FMOD_STUDIO_COMMANDREPLAY_FAST_FORWARD 0x00000002 +#define FMOD_STUDIO_COMMANDREPLAY_SKIP_BANK_LOAD 0x00000004 + +typedef enum FMOD_STUDIO_LOADING_STATE +{ + FMOD_STUDIO_LOADING_STATE_UNLOADING, + FMOD_STUDIO_LOADING_STATE_UNLOADED, + FMOD_STUDIO_LOADING_STATE_LOADING, + FMOD_STUDIO_LOADING_STATE_LOADED, + FMOD_STUDIO_LOADING_STATE_ERROR, + + FMOD_STUDIO_LOADING_STATE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ +} FMOD_STUDIO_LOADING_STATE; + +typedef enum FMOD_STUDIO_LOAD_MEMORY_MODE +{ + FMOD_STUDIO_LOAD_MEMORY, + FMOD_STUDIO_LOAD_MEMORY_POINT, + + FMOD_STUDIO_LOAD_MEMORY_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ +} FMOD_STUDIO_LOAD_MEMORY_MODE; + +typedef enum FMOD_STUDIO_PARAMETER_TYPE +{ + FMOD_STUDIO_PARAMETER_GAME_CONTROLLED, + FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE, + FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_CONE_ANGLE, + FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION, + FMOD_STUDIO_PARAMETER_AUTOMATIC_DIRECTION, + FMOD_STUDIO_PARAMETER_AUTOMATIC_ELEVATION, + FMOD_STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION, + FMOD_STUDIO_PARAMETER_AUTOMATIC_SPEED, + FMOD_STUDIO_PARAMETER_AUTOMATIC_SPEED_ABSOLUTE, + FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE_NORMALIZED, + + FMOD_STUDIO_PARAMETER_MAX, + FMOD_STUDIO_PARAMETER_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ +} FMOD_STUDIO_PARAMETER_TYPE; + +typedef enum FMOD_STUDIO_USER_PROPERTY_TYPE +{ + FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER, + FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN, + FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT, + FMOD_STUDIO_USER_PROPERTY_TYPE_STRING, + + FMOD_STUDIO_USER_PROPERTY_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ +} FMOD_STUDIO_USER_PROPERTY_TYPE; + +typedef enum FMOD_STUDIO_EVENT_PROPERTY +{ + FMOD_STUDIO_EVENT_PROPERTY_CHANNELPRIORITY, + FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY, + FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD, + FMOD_STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE, + FMOD_STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE, + FMOD_STUDIO_EVENT_PROPERTY_COOLDOWN, + FMOD_STUDIO_EVENT_PROPERTY_MAX, + + FMOD_STUDIO_EVENT_PROPERTY_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ +} FMOD_STUDIO_EVENT_PROPERTY; + +typedef enum FMOD_STUDIO_PLAYBACK_STATE +{ + FMOD_STUDIO_PLAYBACK_PLAYING, + FMOD_STUDIO_PLAYBACK_SUSTAINING, + FMOD_STUDIO_PLAYBACK_STOPPED, + FMOD_STUDIO_PLAYBACK_STARTING, + FMOD_STUDIO_PLAYBACK_STOPPING, + + FMOD_STUDIO_PLAYBACK_FORCEINT = 65536 +} FMOD_STUDIO_PLAYBACK_STATE; + +typedef enum FMOD_STUDIO_STOP_MODE +{ + FMOD_STUDIO_STOP_ALLOWFADEOUT, + FMOD_STUDIO_STOP_IMMEDIATE, + + FMOD_STUDIO_STOP_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ +} FMOD_STUDIO_STOP_MODE; + +typedef enum FMOD_STUDIO_INSTANCETYPE +{ + FMOD_STUDIO_INSTANCETYPE_NONE, + FMOD_STUDIO_INSTANCETYPE_SYSTEM, + FMOD_STUDIO_INSTANCETYPE_EVENTDESCRIPTION, + FMOD_STUDIO_INSTANCETYPE_EVENTINSTANCE, + FMOD_STUDIO_INSTANCETYPE_PARAMETERINSTANCE, + FMOD_STUDIO_INSTANCETYPE_BUS, + FMOD_STUDIO_INSTANCETYPE_VCA, + FMOD_STUDIO_INSTANCETYPE_BANK, + FMOD_STUDIO_INSTANCETYPE_COMMANDREPLAY, + + FMOD_STUDIO_INSTANCETYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ +} FMOD_STUDIO_INSTANCETYPE; + +/* + FMOD Studio structures +*/ +typedef struct FMOD_STUDIO_BANK_INFO +{ + int size; + void *userdata; + int userdatalength; + FMOD_FILE_OPEN_CALLBACK opencallback; + FMOD_FILE_CLOSE_CALLBACK closecallback; + FMOD_FILE_READ_CALLBACK readcallback; + FMOD_FILE_SEEK_CALLBACK seekcallback; +} FMOD_STUDIO_BANK_INFO; + +typedef struct FMOD_STUDIO_PARAMETER_ID +{ + unsigned int data1; + unsigned int data2; +} FMOD_STUDIO_PARAMETER_ID; + +typedef struct FMOD_STUDIO_PARAMETER_DESCRIPTION +{ + const char *name; + FMOD_STUDIO_PARAMETER_ID id; + float minimum; + float maximum; + float defaultvalue; + FMOD_STUDIO_PARAMETER_TYPE type; + FMOD_STUDIO_PARAMETER_FLAGS flags; + FMOD_GUID guid; +} FMOD_STUDIO_PARAMETER_DESCRIPTION; + +typedef struct FMOD_STUDIO_USER_PROPERTY +{ + const char *name; + FMOD_STUDIO_USER_PROPERTY_TYPE type; + + union + { + int intvalue; + FMOD_BOOL boolvalue; + float floatvalue; + const char *stringvalue; + }; +} FMOD_STUDIO_USER_PROPERTY; + +typedef struct FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES +{ + const char *name; + FMOD_SOUND *sound; + int subsoundIndex; +} FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES; + +typedef struct FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES +{ + const char *name; + FMOD_DSP *dsp; +} FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES; + +typedef struct FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES +{ + const char *name; + int position; +} FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES; + +typedef struct FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES +{ + int bar; + int beat; + int position; + float tempo; + int timesignatureupper; + int timesignaturelower; +} FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES; + +typedef struct FMOD_STUDIO_TIMELINE_NESTED_BEAT_PROPERTIES +{ + FMOD_GUID eventid; + FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES properties; +} FMOD_STUDIO_TIMELINE_NESTED_BEAT_PROPERTIES; + +typedef struct FMOD_STUDIO_ADVANCEDSETTINGS +{ + int cbsize; + unsigned int commandqueuesize; + unsigned int handleinitialsize; + int studioupdateperiod; + int idlesampledatapoolsize; + unsigned int streamingscheduledelay; + const char* encryptionkey; +} FMOD_STUDIO_ADVANCEDSETTINGS; + +typedef struct FMOD_STUDIO_CPU_USAGE +{ + float update; +} FMOD_STUDIO_CPU_USAGE; + +typedef struct FMOD_STUDIO_BUFFER_INFO +{ + int currentusage; + int peakusage; + int capacity; + int stallcount; + float stalltime; +} FMOD_STUDIO_BUFFER_INFO; + +typedef struct FMOD_STUDIO_BUFFER_USAGE +{ + FMOD_STUDIO_BUFFER_INFO studiocommandqueue; + FMOD_STUDIO_BUFFER_INFO studiohandle; +} FMOD_STUDIO_BUFFER_USAGE; + +typedef struct FMOD_STUDIO_SOUND_INFO +{ + const char *name_or_data; + FMOD_MODE mode; + FMOD_CREATESOUNDEXINFO exinfo; + int subsoundindex; +} FMOD_STUDIO_SOUND_INFO; + +typedef struct FMOD_STUDIO_COMMAND_INFO +{ + const char *commandname; + int parentcommandindex; + int framenumber; + float frametime; + FMOD_STUDIO_INSTANCETYPE instancetype; + FMOD_STUDIO_INSTANCETYPE outputtype; + unsigned int instancehandle; + unsigned int outputhandle; +} FMOD_STUDIO_COMMAND_INFO; + +typedef struct FMOD_STUDIO_MEMORY_USAGE +{ + int exclusive; + int inclusive; + int sampledata; +} FMOD_STUDIO_MEMORY_USAGE; + +/* + FMOD Studio callbacks. +*/ +typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_SYSTEM_CALLBACK) (FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE type, void *commanddata, void *userdata); +typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_EVENT_CALLBACK) (FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE *event, void *parameters); +typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK) (FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex, float currenttime, void *userdata); +typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK) (FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex, const FMOD_GUID *bankguid, const char *bankfilename, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank, void *userdata); +typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK) (FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex, FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENTINSTANCE **instance, void *userdata); + +#endif // FMOD_STUDIO_COMMON_H diff --git a/vendor/fmod/lib/libfmod.dylib b/vendor/fmod/lib/libfmod.dylib new file mode 100644 index 0000000..e59b3b4 Binary files /dev/null and b/vendor/fmod/lib/libfmod.dylib differ diff --git a/vendor/fmod/lib/libfmodL.dylib b/vendor/fmod/lib/libfmodL.dylib new file mode 100644 index 0000000..a73cb33 Binary files /dev/null and b/vendor/fmod/lib/libfmodL.dylib differ diff --git a/vendor/fmod/lib/libfmodstudio.dylib b/vendor/fmod/lib/libfmodstudio.dylib new file mode 100644 index 0000000..e5b3d9c Binary files /dev/null and b/vendor/fmod/lib/libfmodstudio.dylib differ diff --git a/vendor/fmod/lib/libfmodstudioL.dylib b/vendor/fmod/lib/libfmodstudioL.dylib new file mode 100644 index 0000000..93a2954 Binary files /dev/null and b/vendor/fmod/lib/libfmodstudioL.dylib differ -- cgit 1.4.1