diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-11 15:33:28 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-11 15:33:28 -0500 |
commit | 6cfc54f019ea793c75c012af9c8249eac936cfac (patch) | |
tree | f19eed64e9b284136f3b802d4dee71ee24978646 /vendor/fmod/inc | |
parent | 456122f5f0086ed0dbe1b784266b96e9624aa8e1 (diff) | |
download | ether-6cfc54f019ea793c75c012af9c8249eac936cfac.tar.gz ether-6cfc54f019ea793c75c012af9c8249eac936cfac.tar.bz2 ether-6cfc54f019ea793c75c012af9c8249eac936cfac.zip |
Added music and lamp popping sound
Diffstat (limited to 'vendor/fmod/inc')
-rw-r--r-- | vendor/fmod/inc/fmod.cs | 3974 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod.h | 667 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod.hpp | 606 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_codec.h | 136 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_common.h | 880 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_dsp.cs | 897 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_dsp.h | 421 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_dsp_effects.h | 577 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_errors.cs | 106 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_errors.h | 110 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_output.h | 122 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_studio.cs | 2250 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_studio.h | 248 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_studio.hpp | 402 | ||||
-rw-r--r-- | vendor/fmod/inc/fmod_studio_common.h | 336 |
15 files changed, 11732 insertions, 0 deletions
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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Core API - C# wrapper. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* For more detail visit: */ | ||
6 | /* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */ | ||
7 | /* ======================================================================================== */ | ||
8 | |||
9 | using System; | ||
10 | using System.Text; | ||
11 | using System.Runtime.InteropServices; | ||
12 | using System.Collections.Generic; | ||
13 | |||
14 | namespace FMOD | ||
15 | { | ||
16 | /* | ||
17 | FMOD version number. Check this against FMOD::System::getVersion / System_GetVersion | ||
18 | 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number. | ||
19 | */ | ||
20 | public partial class VERSION | ||
21 | { | ||
22 | public const int number = 0x00020205; | ||
23 | #if !UNITY_2019_4_OR_NEWER | ||
24 | public const string dll = "fmod"; | ||
25 | #endif | ||
26 | } | ||
27 | |||
28 | public class CONSTANTS | ||
29 | { | ||
30 | public const int MAX_CHANNEL_WIDTH = 32; | ||
31 | public const int MAX_LISTENERS = 8; | ||
32 | public const int REVERB_MAXINSTANCES = 4; | ||
33 | public const int MAX_SYSTEMS = 8; | ||
34 | } | ||
35 | |||
36 | /* | ||
37 | FMOD core types | ||
38 | */ | ||
39 | public enum RESULT : int | ||
40 | { | ||
41 | OK, | ||
42 | ERR_BADCOMMAND, | ||
43 | ERR_CHANNEL_ALLOC, | ||
44 | ERR_CHANNEL_STOLEN, | ||
45 | ERR_DMA, | ||
46 | ERR_DSP_CONNECTION, | ||
47 | ERR_DSP_DONTPROCESS, | ||
48 | ERR_DSP_FORMAT, | ||
49 | ERR_DSP_INUSE, | ||
50 | ERR_DSP_NOTFOUND, | ||
51 | ERR_DSP_RESERVED, | ||
52 | ERR_DSP_SILENCE, | ||
53 | ERR_DSP_TYPE, | ||
54 | ERR_FILE_BAD, | ||
55 | ERR_FILE_COULDNOTSEEK, | ||
56 | ERR_FILE_DISKEJECTED, | ||
57 | ERR_FILE_EOF, | ||
58 | ERR_FILE_ENDOFDATA, | ||
59 | ERR_FILE_NOTFOUND, | ||
60 | ERR_FORMAT, | ||
61 | ERR_HEADER_MISMATCH, | ||
62 | ERR_HTTP, | ||
63 | ERR_HTTP_ACCESS, | ||
64 | ERR_HTTP_PROXY_AUTH, | ||
65 | ERR_HTTP_SERVER_ERROR, | ||
66 | ERR_HTTP_TIMEOUT, | ||
67 | ERR_INITIALIZATION, | ||
68 | ERR_INITIALIZED, | ||
69 | ERR_INTERNAL, | ||
70 | ERR_INVALID_FLOAT, | ||
71 | ERR_INVALID_HANDLE, | ||
72 | ERR_INVALID_PARAM, | ||
73 | ERR_INVALID_POSITION, | ||
74 | ERR_INVALID_SPEAKER, | ||
75 | ERR_INVALID_SYNCPOINT, | ||
76 | ERR_INVALID_THREAD, | ||
77 | ERR_INVALID_VECTOR, | ||
78 | ERR_MAXAUDIBLE, | ||
79 | ERR_MEMORY, | ||
80 | ERR_MEMORY_CANTPOINT, | ||
81 | ERR_NEEDS3D, | ||
82 | ERR_NEEDSHARDWARE, | ||
83 | ERR_NET_CONNECT, | ||
84 | ERR_NET_SOCKET_ERROR, | ||
85 | ERR_NET_URL, | ||
86 | ERR_NET_WOULD_BLOCK, | ||
87 | ERR_NOTREADY, | ||
88 | ERR_OUTPUT_ALLOCATED, | ||
89 | ERR_OUTPUT_CREATEBUFFER, | ||
90 | ERR_OUTPUT_DRIVERCALL, | ||
91 | ERR_OUTPUT_FORMAT, | ||
92 | ERR_OUTPUT_INIT, | ||
93 | ERR_OUTPUT_NODRIVERS, | ||
94 | ERR_PLUGIN, | ||
95 | ERR_PLUGIN_MISSING, | ||
96 | ERR_PLUGIN_RESOURCE, | ||
97 | ERR_PLUGIN_VERSION, | ||
98 | ERR_RECORD, | ||
99 | ERR_REVERB_CHANNELGROUP, | ||
100 | ERR_REVERB_INSTANCE, | ||
101 | ERR_SUBSOUNDS, | ||
102 | ERR_SUBSOUND_ALLOCATED, | ||
103 | ERR_SUBSOUND_CANTMOVE, | ||
104 | ERR_TAGNOTFOUND, | ||
105 | ERR_TOOMANYCHANNELS, | ||
106 | ERR_TRUNCATED, | ||
107 | ERR_UNIMPLEMENTED, | ||
108 | ERR_UNINITIALIZED, | ||
109 | ERR_UNSUPPORTED, | ||
110 | ERR_VERSION, | ||
111 | ERR_EVENT_ALREADY_LOADED, | ||
112 | ERR_EVENT_LIVEUPDATE_BUSY, | ||
113 | ERR_EVENT_LIVEUPDATE_MISMATCH, | ||
114 | ERR_EVENT_LIVEUPDATE_TIMEOUT, | ||
115 | ERR_EVENT_NOTFOUND, | ||
116 | ERR_STUDIO_UNINITIALIZED, | ||
117 | ERR_STUDIO_NOT_LOADED, | ||
118 | ERR_INVALID_STRING, | ||
119 | ERR_ALREADY_LOCKED, | ||
120 | ERR_NOT_LOCKED, | ||
121 | ERR_RECORD_DISCONNECTED, | ||
122 | ERR_TOOMANYSAMPLES, | ||
123 | } | ||
124 | |||
125 | public enum CHANNELCONTROL_TYPE : int | ||
126 | { | ||
127 | CHANNEL, | ||
128 | CHANNELGROUP, | ||
129 | MAX | ||
130 | } | ||
131 | |||
132 | [StructLayout(LayoutKind.Sequential)] | ||
133 | public struct VECTOR | ||
134 | { | ||
135 | public float x; | ||
136 | public float y; | ||
137 | public float z; | ||
138 | } | ||
139 | |||
140 | [StructLayout(LayoutKind.Sequential)] | ||
141 | public struct ATTRIBUTES_3D | ||
142 | { | ||
143 | public VECTOR position; | ||
144 | public VECTOR velocity; | ||
145 | public VECTOR forward; | ||
146 | public VECTOR up; | ||
147 | } | ||
148 | |||
149 | [StructLayout(LayoutKind.Sequential)] | ||
150 | public partial struct GUID | ||
151 | { | ||
152 | public int Data1; | ||
153 | public int Data2; | ||
154 | public int Data3; | ||
155 | public int Data4; | ||
156 | } | ||
157 | |||
158 | [StructLayout(LayoutKind.Sequential)] | ||
159 | public struct ASYNCREADINFO | ||
160 | { | ||
161 | public IntPtr handle; | ||
162 | public uint offset; | ||
163 | public uint sizebytes; | ||
164 | public int priority; | ||
165 | |||
166 | public IntPtr userdata; | ||
167 | public IntPtr buffer; | ||
168 | public uint bytesread; | ||
169 | public FILE_ASYNCDONE_FUNC done; | ||
170 | } | ||
171 | |||
172 | public enum OUTPUTTYPE : int | ||
173 | { | ||
174 | AUTODETECT, | ||
175 | |||
176 | UNKNOWN, | ||
177 | NOSOUND, | ||
178 | WAVWRITER, | ||
179 | NOSOUND_NRT, | ||
180 | WAVWRITER_NRT, | ||
181 | |||
182 | WASAPI, | ||
183 | ASIO, | ||
184 | PULSEAUDIO, | ||
185 | ALSA, | ||
186 | COREAUDIO, | ||
187 | AUDIOTRACK, | ||
188 | OPENSL, | ||
189 | AUDIOOUT, | ||
190 | AUDIO3D, | ||
191 | WEBAUDIO, | ||
192 | NNAUDIO, | ||
193 | WINSONIC, | ||
194 | AAUDIO, | ||
195 | AUDIOWORKLET, | ||
196 | |||
197 | MAX, | ||
198 | } | ||
199 | |||
200 | public enum PORT_TYPE : int | ||
201 | { | ||
202 | MUSIC, | ||
203 | COPYRIGHT_MUSIC, | ||
204 | VOICE, | ||
205 | CONTROLLER, | ||
206 | PERSONAL, | ||
207 | VIBRATION, | ||
208 | AUX, | ||
209 | |||
210 | MAX | ||
211 | } | ||
212 | |||
213 | public enum DEBUG_MODE : int | ||
214 | { | ||
215 | TTY, | ||
216 | FILE, | ||
217 | CALLBACK, | ||
218 | } | ||
219 | |||
220 | [Flags] | ||
221 | public enum DEBUG_FLAGS : uint | ||
222 | { | ||
223 | NONE = 0x00000000, | ||
224 | ERROR = 0x00000001, | ||
225 | WARNING = 0x00000002, | ||
226 | LOG = 0x00000004, | ||
227 | |||
228 | TYPE_MEMORY = 0x00000100, | ||
229 | TYPE_FILE = 0x00000200, | ||
230 | TYPE_CODEC = 0x00000400, | ||
231 | TYPE_TRACE = 0x00000800, | ||
232 | |||
233 | DISPLAY_TIMESTAMPS = 0x00010000, | ||
234 | DISPLAY_LINENUMBERS = 0x00020000, | ||
235 | DISPLAY_THREAD = 0x00040000, | ||
236 | } | ||
237 | |||
238 | [Flags] | ||
239 | public enum MEMORY_TYPE : uint | ||
240 | { | ||
241 | NORMAL = 0x00000000, | ||
242 | STREAM_FILE = 0x00000001, | ||
243 | STREAM_DECODE = 0x00000002, | ||
244 | SAMPLEDATA = 0x00000004, | ||
245 | DSP_BUFFER = 0x00000008, | ||
246 | PLUGIN = 0x00000010, | ||
247 | PERSISTENT = 0x00200000, | ||
248 | ALL = 0xFFFFFFFF | ||
249 | } | ||
250 | |||
251 | public enum SPEAKERMODE : int | ||
252 | { | ||
253 | DEFAULT, | ||
254 | RAW, | ||
255 | MONO, | ||
256 | STEREO, | ||
257 | QUAD, | ||
258 | SURROUND, | ||
259 | _5POINT1, | ||
260 | _7POINT1, | ||
261 | _7POINT1POINT4, | ||
262 | |||
263 | MAX, | ||
264 | } | ||
265 | |||
266 | public enum SPEAKER : int | ||
267 | { | ||
268 | NONE = -1, | ||
269 | FRONT_LEFT, | ||
270 | FRONT_RIGHT, | ||
271 | FRONT_CENTER, | ||
272 | LOW_FREQUENCY, | ||
273 | SURROUND_LEFT, | ||
274 | SURROUND_RIGHT, | ||
275 | BACK_LEFT, | ||
276 | BACK_RIGHT, | ||
277 | TOP_FRONT_LEFT, | ||
278 | TOP_FRONT_RIGHT, | ||
279 | TOP_BACK_LEFT, | ||
280 | TOP_BACK_RIGHT, | ||
281 | |||
282 | MAX, | ||
283 | } | ||
284 | |||
285 | [Flags] | ||
286 | public enum CHANNELMASK : uint | ||
287 | { | ||
288 | FRONT_LEFT = 0x00000001, | ||
289 | FRONT_RIGHT = 0x00000002, | ||
290 | FRONT_CENTER = 0x00000004, | ||
291 | LOW_FREQUENCY = 0x00000008, | ||
292 | SURROUND_LEFT = 0x00000010, | ||
293 | SURROUND_RIGHT = 0x00000020, | ||
294 | BACK_LEFT = 0x00000040, | ||
295 | BACK_RIGHT = 0x00000080, | ||
296 | BACK_CENTER = 0x00000100, | ||
297 | |||
298 | MONO = (FRONT_LEFT), | ||
299 | STEREO = (FRONT_LEFT | FRONT_RIGHT), | ||
300 | LRC = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER), | ||
301 | QUAD = (FRONT_LEFT | FRONT_RIGHT | SURROUND_LEFT | SURROUND_RIGHT), | ||
302 | SURROUND = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT), | ||
303 | _5POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT), | ||
304 | _5POINT1_REARS = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT), | ||
305 | _7POINT0 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT), | ||
306 | _7POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT) | ||
307 | } | ||
308 | |||
309 | public enum CHANNELORDER : int | ||
310 | { | ||
311 | DEFAULT, | ||
312 | WAVEFORMAT, | ||
313 | PROTOOLS, | ||
314 | ALLMONO, | ||
315 | ALLSTEREO, | ||
316 | ALSA, | ||
317 | |||
318 | MAX, | ||
319 | } | ||
320 | |||
321 | public enum PLUGINTYPE : int | ||
322 | { | ||
323 | OUTPUT, | ||
324 | CODEC, | ||
325 | DSP, | ||
326 | |||
327 | MAX, | ||
328 | } | ||
329 | |||
330 | [StructLayout(LayoutKind.Sequential)] | ||
331 | public struct PLUGINLIST | ||
332 | { | ||
333 | PLUGINTYPE type; | ||
334 | IntPtr description; | ||
335 | } | ||
336 | |||
337 | [Flags] | ||
338 | public enum INITFLAGS : uint | ||
339 | { | ||
340 | NORMAL = 0x00000000, | ||
341 | STREAM_FROM_UPDATE = 0x00000001, | ||
342 | MIX_FROM_UPDATE = 0x00000002, | ||
343 | _3D_RIGHTHANDED = 0x00000004, | ||
344 | CHANNEL_LOWPASS = 0x00000100, | ||
345 | CHANNEL_DISTANCEFILTER = 0x00000200, | ||
346 | PROFILE_ENABLE = 0x00010000, | ||
347 | VOL0_BECOMES_VIRTUAL = 0x00020000, | ||
348 | GEOMETRY_USECLOSEST = 0x00040000, | ||
349 | PREFER_DOLBY_DOWNMIX = 0x00080000, | ||
350 | THREAD_UNSAFE = 0x00100000, | ||
351 | PROFILE_METER_ALL = 0x00200000, | ||
352 | MEMORY_TRACKING = 0x00400000, | ||
353 | } | ||
354 | |||
355 | public enum SOUND_TYPE : int | ||
356 | { | ||
357 | UNKNOWN, | ||
358 | AIFF, | ||
359 | ASF, | ||
360 | DLS, | ||
361 | FLAC, | ||
362 | FSB, | ||
363 | IT, | ||
364 | MIDI, | ||
365 | MOD, | ||
366 | MPEG, | ||
367 | OGGVORBIS, | ||
368 | PLAYLIST, | ||
369 | RAW, | ||
370 | S3M, | ||
371 | USER, | ||
372 | WAV, | ||
373 | XM, | ||
374 | XMA, | ||
375 | AUDIOQUEUE, | ||
376 | AT9, | ||
377 | VORBIS, | ||
378 | MEDIA_FOUNDATION, | ||
379 | MEDIACODEC, | ||
380 | FADPCM, | ||
381 | OPUS, | ||
382 | |||
383 | MAX, | ||
384 | } | ||
385 | |||
386 | public enum SOUND_FORMAT : int | ||
387 | { | ||
388 | NONE, | ||
389 | PCM8, | ||
390 | PCM16, | ||
391 | PCM24, | ||
392 | PCM32, | ||
393 | PCMFLOAT, | ||
394 | BITSTREAM, | ||
395 | |||
396 | MAX | ||
397 | } | ||
398 | |||
399 | [Flags] | ||
400 | public enum MODE : uint | ||
401 | { | ||
402 | DEFAULT = 0x00000000, | ||
403 | LOOP_OFF = 0x00000001, | ||
404 | LOOP_NORMAL = 0x00000002, | ||
405 | LOOP_BIDI = 0x00000004, | ||
406 | _2D = 0x00000008, | ||
407 | _3D = 0x00000010, | ||
408 | CREATESTREAM = 0x00000080, | ||
409 | CREATESAMPLE = 0x00000100, | ||
410 | CREATECOMPRESSEDSAMPLE = 0x00000200, | ||
411 | OPENUSER = 0x00000400, | ||
412 | OPENMEMORY = 0x00000800, | ||
413 | OPENMEMORY_POINT = 0x10000000, | ||
414 | OPENRAW = 0x00001000, | ||
415 | OPENONLY = 0x00002000, | ||
416 | ACCURATETIME = 0x00004000, | ||
417 | MPEGSEARCH = 0x00008000, | ||
418 | NONBLOCKING = 0x00010000, | ||
419 | UNIQUE = 0x00020000, | ||
420 | _3D_HEADRELATIVE = 0x00040000, | ||
421 | _3D_WORLDRELATIVE = 0x00080000, | ||
422 | _3D_INVERSEROLLOFF = 0x00100000, | ||
423 | _3D_LINEARROLLOFF = 0x00200000, | ||
424 | _3D_LINEARSQUAREROLLOFF = 0x00400000, | ||
425 | _3D_INVERSETAPEREDROLLOFF = 0x00800000, | ||
426 | _3D_CUSTOMROLLOFF = 0x04000000, | ||
427 | _3D_IGNOREGEOMETRY = 0x40000000, | ||
428 | IGNORETAGS = 0x02000000, | ||
429 | LOWMEM = 0x08000000, | ||
430 | VIRTUAL_PLAYFROMSTART = 0x80000000 | ||
431 | } | ||
432 | |||
433 | public enum OPENSTATE : int | ||
434 | { | ||
435 | READY = 0, | ||
436 | LOADING, | ||
437 | ERROR, | ||
438 | CONNECTING, | ||
439 | BUFFERING, | ||
440 | SEEKING, | ||
441 | PLAYING, | ||
442 | SETPOSITION, | ||
443 | |||
444 | MAX, | ||
445 | } | ||
446 | |||
447 | public enum SOUNDGROUP_BEHAVIOR : int | ||
448 | { | ||
449 | BEHAVIOR_FAIL, | ||
450 | BEHAVIOR_MUTE, | ||
451 | BEHAVIOR_STEALLOWEST, | ||
452 | |||
453 | MAX, | ||
454 | } | ||
455 | |||
456 | public enum CHANNELCONTROL_CALLBACK_TYPE : int | ||
457 | { | ||
458 | END, | ||
459 | VIRTUALVOICE, | ||
460 | SYNCPOINT, | ||
461 | OCCLUSION, | ||
462 | |||
463 | MAX, | ||
464 | } | ||
465 | |||
466 | public struct CHANNELCONTROL_DSP_INDEX | ||
467 | { | ||
468 | public const int HEAD = -1; | ||
469 | public const int FADER = -2; | ||
470 | public const int TAIL = -3; | ||
471 | } | ||
472 | |||
473 | public enum ERRORCALLBACK_INSTANCETYPE : int | ||
474 | { | ||
475 | NONE, | ||
476 | SYSTEM, | ||
477 | CHANNEL, | ||
478 | CHANNELGROUP, | ||
479 | CHANNELCONTROL, | ||
480 | SOUND, | ||
481 | SOUNDGROUP, | ||
482 | DSP, | ||
483 | DSPCONNECTION, | ||
484 | GEOMETRY, | ||
485 | REVERB3D, | ||
486 | STUDIO_SYSTEM, | ||
487 | STUDIO_EVENTDESCRIPTION, | ||
488 | STUDIO_EVENTINSTANCE, | ||
489 | STUDIO_PARAMETERINSTANCE, | ||
490 | STUDIO_BUS, | ||
491 | STUDIO_VCA, | ||
492 | STUDIO_BANK, | ||
493 | STUDIO_COMMANDREPLAY | ||
494 | } | ||
495 | |||
496 | [StructLayout(LayoutKind.Sequential)] | ||
497 | public struct ERRORCALLBACK_INFO | ||
498 | { | ||
499 | public RESULT result; | ||
500 | public ERRORCALLBACK_INSTANCETYPE instancetype; | ||
501 | public IntPtr instance; | ||
502 | public StringWrapper functionname; | ||
503 | public StringWrapper functionparams; | ||
504 | } | ||
505 | |||
506 | [StructLayout(LayoutKind.Sequential)] | ||
507 | public struct CPU_USAGE | ||
508 | { | ||
509 | public float dsp; /* DSP mixing CPU usage. */ | ||
510 | public float stream; /* Streaming engine CPU usage. */ | ||
511 | public float geometry; /* Geometry engine CPU usage. */ | ||
512 | public float update; /* System::update CPU usage. */ | ||
513 | public float convolution1; /* Convolution reverb processing thread #1 CPU usage */ | ||
514 | public float convolution2; /* Convolution reverb processing thread #2 CPU usage */ | ||
515 | } | ||
516 | |||
517 | [Flags] | ||
518 | public enum SYSTEM_CALLBACK_TYPE : uint | ||
519 | { | ||
520 | DEVICELISTCHANGED = 0x00000001, | ||
521 | DEVICELOST = 0x00000002, | ||
522 | MEMORYALLOCATIONFAILED = 0x00000004, | ||
523 | THREADCREATED = 0x00000008, | ||
524 | BADDSPCONNECTION = 0x00000010, | ||
525 | PREMIX = 0x00000020, | ||
526 | POSTMIX = 0x00000040, | ||
527 | ERROR = 0x00000080, | ||
528 | MIDMIX = 0x00000100, | ||
529 | THREADDESTROYED = 0x00000200, | ||
530 | PREUPDATE = 0x00000400, | ||
531 | POSTUPDATE = 0x00000800, | ||
532 | RECORDLISTCHANGED = 0x00001000, | ||
533 | BUFFEREDNOMIX = 0x00002000, | ||
534 | DEVICEREINITIALIZE = 0x00004000, | ||
535 | OUTPUTUNDERRUN = 0x00008000, | ||
536 | ALL = 0xFFFFFFFF, | ||
537 | } | ||
538 | |||
539 | /* | ||
540 | FMOD Callbacks | ||
541 | */ | ||
542 | public delegate RESULT DEBUG_CALLBACK (DEBUG_FLAGS flags, IntPtr file, int line, IntPtr func, IntPtr message); | ||
543 | public delegate RESULT SYSTEM_CALLBACK (IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata1, IntPtr commanddata2, IntPtr userdata); | ||
544 | public delegate RESULT CHANNELCONTROL_CALLBACK (IntPtr channelcontrol, CHANNELCONTROL_TYPE controltype, CHANNELCONTROL_CALLBACK_TYPE callbacktype, IntPtr commanddata1, IntPtr commanddata2); | ||
545 | public delegate RESULT SOUND_NONBLOCK_CALLBACK (IntPtr sound, RESULT result); | ||
546 | public delegate RESULT SOUND_PCMREAD_CALLBACK (IntPtr sound, IntPtr data, uint datalen); | ||
547 | public delegate RESULT SOUND_PCMSETPOS_CALLBACK (IntPtr sound, int subsound, uint position, TIMEUNIT postype); | ||
548 | public delegate RESULT FILE_OPEN_CALLBACK (IntPtr name, ref uint filesize, ref IntPtr handle, IntPtr userdata); | ||
549 | public delegate RESULT FILE_CLOSE_CALLBACK (IntPtr handle, IntPtr userdata); | ||
550 | public delegate RESULT FILE_READ_CALLBACK (IntPtr handle, IntPtr buffer, uint sizebytes, ref uint bytesread, IntPtr userdata); | ||
551 | public delegate RESULT FILE_SEEK_CALLBACK (IntPtr handle, uint pos, IntPtr userdata); | ||
552 | public delegate RESULT FILE_ASYNCREAD_CALLBACK (IntPtr info, IntPtr userdata); | ||
553 | public delegate RESULT FILE_ASYNCCANCEL_CALLBACK(IntPtr info, IntPtr userdata); | ||
554 | public delegate RESULT FILE_ASYNCDONE_FUNC (IntPtr info, RESULT result); | ||
555 | public delegate IntPtr MEMORY_ALLOC_CALLBACK (uint size, MEMORY_TYPE type, IntPtr sourcestr); | ||
556 | public delegate IntPtr MEMORY_REALLOC_CALLBACK (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); | ||
557 | public delegate void MEMORY_FREE_CALLBACK (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); | ||
558 | public delegate float CB_3D_ROLLOFF_CALLBACK (IntPtr channelcontrol, float distance); | ||
559 | |||
560 | public enum DSP_RESAMPLER : int | ||
561 | { | ||
562 | DEFAULT, | ||
563 | NOINTERP, | ||
564 | LINEAR, | ||
565 | CUBIC, | ||
566 | SPLINE, | ||
567 | |||
568 | MAX, | ||
569 | } | ||
570 | |||
571 | public enum DSPCONNECTION_TYPE : int | ||
572 | { | ||
573 | STANDARD, | ||
574 | SIDECHAIN, | ||
575 | SEND, | ||
576 | SEND_SIDECHAIN, | ||
577 | |||
578 | MAX, | ||
579 | } | ||
580 | |||
581 | public enum TAGTYPE : int | ||
582 | { | ||
583 | UNKNOWN = 0, | ||
584 | ID3V1, | ||
585 | ID3V2, | ||
586 | VORBISCOMMENT, | ||
587 | SHOUTCAST, | ||
588 | ICECAST, | ||
589 | ASF, | ||
590 | MIDI, | ||
591 | PLAYLIST, | ||
592 | FMOD, | ||
593 | USER, | ||
594 | |||
595 | MAX | ||
596 | } | ||
597 | |||
598 | public enum TAGDATATYPE : int | ||
599 | { | ||
600 | BINARY = 0, | ||
601 | INT, | ||
602 | FLOAT, | ||
603 | STRING, | ||
604 | STRING_UTF16, | ||
605 | STRING_UTF16BE, | ||
606 | STRING_UTF8, | ||
607 | |||
608 | MAX | ||
609 | } | ||
610 | |||
611 | [StructLayout(LayoutKind.Sequential)] | ||
612 | public struct TAG | ||
613 | { | ||
614 | public TAGTYPE type; | ||
615 | public TAGDATATYPE datatype; | ||
616 | public StringWrapper name; | ||
617 | public IntPtr data; | ||
618 | public uint datalen; | ||
619 | public bool updated; | ||
620 | } | ||
621 | |||
622 | [Flags] | ||
623 | public enum TIMEUNIT : uint | ||
624 | { | ||
625 | MS = 0x00000001, | ||
626 | PCM = 0x00000002, | ||
627 | PCMBYTES = 0x00000004, | ||
628 | RAWBYTES = 0x00000008, | ||
629 | PCMFRACTION = 0x00000010, | ||
630 | MODORDER = 0x00000100, | ||
631 | MODROW = 0x00000200, | ||
632 | MODPATTERN = 0x00000400, | ||
633 | } | ||
634 | |||
635 | public struct PORT_INDEX | ||
636 | { | ||
637 | public const ulong NONE = 0xFFFFFFFFFFFFFFFF; | ||
638 | } | ||
639 | |||
640 | [StructLayout(LayoutKind.Sequential)] | ||
641 | public struct CREATESOUNDEXINFO | ||
642 | { | ||
643 | public int cbsize; | ||
644 | public uint length; | ||
645 | public uint fileoffset; | ||
646 | public int numchannels; | ||
647 | public int defaultfrequency; | ||
648 | public SOUND_FORMAT format; | ||
649 | public uint decodebuffersize; | ||
650 | public int initialsubsound; | ||
651 | public int numsubsounds; | ||
652 | public IntPtr inclusionlist; | ||
653 | public int inclusionlistnum; | ||
654 | public SOUND_PCMREAD_CALLBACK pcmreadcallback; | ||
655 | public SOUND_PCMSETPOS_CALLBACK pcmsetposcallback; | ||
656 | public SOUND_NONBLOCK_CALLBACK nonblockcallback; | ||
657 | public IntPtr dlsname; | ||
658 | public IntPtr encryptionkey; | ||
659 | public int maxpolyphony; | ||
660 | public IntPtr userdata; | ||
661 | public SOUND_TYPE suggestedsoundtype; | ||
662 | public FILE_OPEN_CALLBACK fileuseropen; | ||
663 | public FILE_CLOSE_CALLBACK fileuserclose; | ||
664 | public FILE_READ_CALLBACK fileuserread; | ||
665 | public FILE_SEEK_CALLBACK fileuserseek; | ||
666 | public FILE_ASYNCREAD_CALLBACK fileuserasyncread; | ||
667 | public FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel; | ||
668 | public IntPtr fileuserdata; | ||
669 | public int filebuffersize; | ||
670 | public CHANNELORDER channelorder; | ||
671 | public IntPtr initialsoundgroup; | ||
672 | public uint initialseekposition; | ||
673 | public TIMEUNIT initialseekpostype; | ||
674 | public int ignoresetfilesystem; | ||
675 | public uint audioqueuepolicy; | ||
676 | public uint minmidigranularity; | ||
677 | public int nonblockthreadid; | ||
678 | public IntPtr fsbguid; | ||
679 | } | ||
680 | |||
681 | #pragma warning disable 414 | ||
682 | [StructLayout(LayoutKind.Sequential)] | ||
683 | public struct REVERB_PROPERTIES | ||
684 | { | ||
685 | public float DecayTime; | ||
686 | public float EarlyDelay; | ||
687 | public float LateDelay; | ||
688 | public float HFReference; | ||
689 | public float HFDecayRatio; | ||
690 | public float Diffusion; | ||
691 | public float Density; | ||
692 | public float LowShelfFrequency; | ||
693 | public float LowShelfGain; | ||
694 | public float HighCut; | ||
695 | public float EarlyLateMix; | ||
696 | public float WetLevel; | ||
697 | |||
698 | #region wrapperinternal | ||
699 | public REVERB_PROPERTIES(float decayTime, float earlyDelay, float lateDelay, float hfReference, | ||
700 | float hfDecayRatio, float diffusion, float density, float lowShelfFrequency, float lowShelfGain, | ||
701 | float highCut, float earlyLateMix, float wetLevel) | ||
702 | { | ||
703 | DecayTime = decayTime; | ||
704 | EarlyDelay = earlyDelay; | ||
705 | LateDelay = lateDelay; | ||
706 | HFReference = hfReference; | ||
707 | HFDecayRatio = hfDecayRatio; | ||
708 | Diffusion = diffusion; | ||
709 | Density = density; | ||
710 | LowShelfFrequency = lowShelfFrequency; | ||
711 | LowShelfGain = lowShelfGain; | ||
712 | HighCut = highCut; | ||
713 | EarlyLateMix = earlyLateMix; | ||
714 | WetLevel = wetLevel; | ||
715 | } | ||
716 | #endregion | ||
717 | } | ||
718 | #pragma warning restore 414 | ||
719 | |||
720 | public class PRESET | ||
721 | { | ||
722 | /* Instance Env Diffus Room RoomHF RmLF DecTm DecHF DecLF Refl RefDel Revb RevDel ModTm ModDp HFRef LFRef Diffus Densty FLAGS */ | ||
723 | public static REVERB_PROPERTIES OFF() { return new REVERB_PROPERTIES( 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f );} | ||
724 | public static REVERB_PROPERTIES GENERIC() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f );} | ||
725 | public static REVERB_PROPERTIES PADDEDCELL() { return new REVERB_PROPERTIES( 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f );} | ||
726 | public static REVERB_PROPERTIES ROOM() { return new REVERB_PROPERTIES( 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f );} | ||
727 | public static REVERB_PROPERTIES BATHROOM() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f );} | ||
728 | public static REVERB_PROPERTIES LIVINGROOM() { return new REVERB_PROPERTIES( 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f );} | ||
729 | public static REVERB_PROPERTIES STONEROOM() { return new REVERB_PROPERTIES( 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f );} | ||
730 | public static REVERB_PROPERTIES AUDITORIUM() { return new REVERB_PROPERTIES( 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f );} | ||
731 | public static REVERB_PROPERTIES CONCERTHALL() { return new REVERB_PROPERTIES( 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f );} | ||
732 | public static REVERB_PROPERTIES CAVE() { return new REVERB_PROPERTIES( 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f );} | ||
733 | public static REVERB_PROPERTIES ARENA() { return new REVERB_PROPERTIES( 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f );} | ||
734 | public static REVERB_PROPERTIES HANGAR() { return new REVERB_PROPERTIES( 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f );} | ||
735 | public static REVERB_PROPERTIES CARPETTEDHALLWAY() { return new REVERB_PROPERTIES( 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f );} | ||
736 | public static REVERB_PROPERTIES HALLWAY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f );} | ||
737 | public static REVERB_PROPERTIES STONECORRIDOR() { return new REVERB_PROPERTIES( 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f );} | ||
738 | public static REVERB_PROPERTIES ALLEY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f );} | ||
739 | public static REVERB_PROPERTIES FOREST() { return new REVERB_PROPERTIES( 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f );} | ||
740 | public static REVERB_PROPERTIES CITY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f );} | ||
741 | public static REVERB_PROPERTIES MOUNTAINS() { return new REVERB_PROPERTIES( 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f );} | ||
742 | public static REVERB_PROPERTIES QUARRY() { return new REVERB_PROPERTIES( 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f );} | ||
743 | public static REVERB_PROPERTIES PLAIN() { return new REVERB_PROPERTIES( 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f );} | ||
744 | public static REVERB_PROPERTIES PARKINGLOT() { return new REVERB_PROPERTIES( 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f );} | ||
745 | public static REVERB_PROPERTIES SEWERPIPE() { return new REVERB_PROPERTIES( 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f );} | ||
746 | public static REVERB_PROPERTIES UNDERWATER() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f );} | ||
747 | } | ||
748 | |||
749 | [StructLayout(LayoutKind.Sequential)] | ||
750 | public struct ADVANCEDSETTINGS | ||
751 | { | ||
752 | public int cbSize; | ||
753 | public int maxMPEGCodecs; | ||
754 | public int maxADPCMCodecs; | ||
755 | public int maxXMACodecs; | ||
756 | public int maxVorbisCodecs; | ||
757 | public int maxAT9Codecs; | ||
758 | public int maxFADPCMCodecs; | ||
759 | public int maxPCMCodecs; | ||
760 | public int ASIONumChannels; | ||
761 | public IntPtr ASIOChannelList; | ||
762 | public IntPtr ASIOSpeakerList; | ||
763 | public float vol0virtualvol; | ||
764 | public uint defaultDecodeBufferSize; | ||
765 | public ushort profilePort; | ||
766 | public uint geometryMaxFadeTime; | ||
767 | public float distanceFilterCenterFreq; | ||
768 | public int reverb3Dinstance; | ||
769 | public int DSPBufferPoolSize; | ||
770 | public DSP_RESAMPLER resamplerMethod; | ||
771 | public uint randomSeed; | ||
772 | public int maxConvolutionThreads; | ||
773 | public int maxOpusCodecs; | ||
774 | } | ||
775 | |||
776 | [Flags] | ||
777 | public enum DRIVER_STATE : uint | ||
778 | { | ||
779 | CONNECTED = 0x00000001, | ||
780 | DEFAULT = 0x00000002, | ||
781 | } | ||
782 | |||
783 | public enum THREAD_PRIORITY : int | ||
784 | { | ||
785 | /* Platform specific priority range */ | ||
786 | PLATFORM_MIN = -32 * 1024, | ||
787 | PLATFORM_MAX = 32 * 1024, | ||
788 | |||
789 | /* Platform agnostic priorities, maps internally to platform specific value */ | ||
790 | DEFAULT = PLATFORM_MIN - 1, | ||
791 | LOW = PLATFORM_MIN - 2, | ||
792 | MEDIUM = PLATFORM_MIN - 3, | ||
793 | HIGH = PLATFORM_MIN - 4, | ||
794 | VERY_HIGH = PLATFORM_MIN - 5, | ||
795 | EXTREME = PLATFORM_MIN - 6, | ||
796 | CRITICAL = PLATFORM_MIN - 7, | ||
797 | |||
798 | /* Thread defaults */ | ||
799 | MIXER = EXTREME, | ||
800 | FEEDER = CRITICAL, | ||
801 | STREAM = VERY_HIGH, | ||
802 | FILE = HIGH, | ||
803 | NONBLOCKING = HIGH, | ||
804 | RECORD = HIGH, | ||
805 | GEOMETRY = LOW, | ||
806 | PROFILER = MEDIUM, | ||
807 | STUDIO_UPDATE = MEDIUM, | ||
808 | STUDIO_LOAD_BANK = MEDIUM, | ||
809 | STUDIO_LOAD_SAMPLE = MEDIUM, | ||
810 | CONVOLUTION1 = VERY_HIGH, | ||
811 | CONVOLUTION2 = VERY_HIGH | ||
812 | |||
813 | } | ||
814 | |||
815 | public enum THREAD_STACK_SIZE : uint | ||
816 | { | ||
817 | DEFAULT = 0, | ||
818 | MIXER = 80 * 1024, | ||
819 | FEEDER = 16 * 1024, | ||
820 | STREAM = 96 * 1024, | ||
821 | FILE = 64 * 1024, | ||
822 | NONBLOCKING = 112 * 1024, | ||
823 | RECORD = 16 * 1024, | ||
824 | GEOMETRY = 48 * 1024, | ||
825 | PROFILER = 128 * 1024, | ||
826 | STUDIO_UPDATE = 96 * 1024, | ||
827 | STUDIO_LOAD_BANK = 96 * 1024, | ||
828 | STUDIO_LOAD_SAMPLE = 96 * 1024, | ||
829 | CONVOLUTION1 = 16 * 1024, | ||
830 | CONVOLUTION2 = 16 * 1024 | ||
831 | } | ||
832 | |||
833 | [Flags] | ||
834 | public enum THREAD_AFFINITY : long | ||
835 | { | ||
836 | /* Platform agnostic thread groupings */ | ||
837 | GROUP_DEFAULT = 0x4000000000000000, | ||
838 | GROUP_A = 0x4000000000000001, | ||
839 | GROUP_B = 0x4000000000000002, | ||
840 | GROUP_C = 0x4000000000000003, | ||
841 | |||
842 | /* Thread defaults */ | ||
843 | MIXER = GROUP_A, | ||
844 | FEEDER = GROUP_C, | ||
845 | STREAM = GROUP_C, | ||
846 | FILE = GROUP_C, | ||
847 | NONBLOCKING = GROUP_C, | ||
848 | RECORD = GROUP_C, | ||
849 | GEOMETRY = GROUP_C, | ||
850 | PROFILER = GROUP_C, | ||
851 | STUDIO_UPDATE = GROUP_B, | ||
852 | STUDIO_LOAD_BANK = GROUP_C, | ||
853 | STUDIO_LOAD_SAMPLE = GROUP_C, | ||
854 | CONVOLUTION1 = GROUP_C, | ||
855 | CONVOLUTION2 = GROUP_C, | ||
856 | |||
857 | /* Core mask, valid up to 1 << 61 */ | ||
858 | CORE_ALL = 0, | ||
859 | CORE_0 = 1 << 0, | ||
860 | CORE_1 = 1 << 1, | ||
861 | CORE_2 = 1 << 2, | ||
862 | CORE_3 = 1 << 3, | ||
863 | CORE_4 = 1 << 4, | ||
864 | CORE_5 = 1 << 5, | ||
865 | CORE_6 = 1 << 6, | ||
866 | CORE_7 = 1 << 7, | ||
867 | CORE_8 = 1 << 8, | ||
868 | CORE_9 = 1 << 9, | ||
869 | CORE_10 = 1 << 10, | ||
870 | CORE_11 = 1 << 11, | ||
871 | CORE_12 = 1 << 12, | ||
872 | CORE_13 = 1 << 13, | ||
873 | CORE_14 = 1 << 14, | ||
874 | CORE_15 = 1 << 15 | ||
875 | } | ||
876 | |||
877 | public enum THREAD_TYPE : int | ||
878 | { | ||
879 | MIXER, | ||
880 | FEEDER, | ||
881 | STREAM, | ||
882 | FILE, | ||
883 | NONBLOCKING, | ||
884 | RECORD, | ||
885 | GEOMETRY, | ||
886 | PROFILER, | ||
887 | STUDIO_UPDATE, | ||
888 | STUDIO_LOAD_BANK, | ||
889 | STUDIO_LOAD_SAMPLE, | ||
890 | CONVOLUTION1, | ||
891 | CONVOLUTION2, | ||
892 | |||
893 | MAX | ||
894 | } | ||
895 | |||
896 | /* | ||
897 | FMOD System factory functions. Use this to create an FMOD System Instance. below you will see System init/close to get started. | ||
898 | */ | ||
899 | public struct Factory | ||
900 | { | ||
901 | public static RESULT System_Create(out System system) | ||
902 | { | ||
903 | return FMOD5_System_Create(out system.handle, VERSION.number); | ||
904 | } | ||
905 | |||
906 | #region importfunctions | ||
907 | [DllImport(VERSION.dll)] | ||
908 | private static extern RESULT FMOD5_System_Create(out IntPtr system, uint headerversion); | ||
909 | |||
910 | #endregion | ||
911 | } | ||
912 | |||
913 | /* | ||
914 | FMOD global system functions (optional). | ||
915 | */ | ||
916 | public struct Memory | ||
917 | { | ||
918 | 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) | ||
919 | { | ||
920 | return FMOD5_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); | ||
921 | } | ||
922 | |||
923 | public static RESULT GetStats(out int currentalloced, out int maxalloced, bool blocking = true) | ||
924 | { | ||
925 | return FMOD5_Memory_GetStats(out currentalloced, out maxalloced, blocking); | ||
926 | } | ||
927 | |||
928 | #region importfunctions | ||
929 | [DllImport(VERSION.dll)] | ||
930 | 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); | ||
931 | [DllImport(VERSION.dll)] | ||
932 | private static extern RESULT FMOD5_Memory_GetStats (out int currentalloced, out int maxalloced, bool blocking); | ||
933 | |||
934 | #endregion | ||
935 | } | ||
936 | |||
937 | public struct Debug | ||
938 | { | ||
939 | public static RESULT Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode = DEBUG_MODE.TTY, DEBUG_CALLBACK callback = null, string filename = null) | ||
940 | { | ||
941 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
942 | { | ||
943 | return FMOD5_Debug_Initialize(flags, mode, callback, encoder.byteFromStringUTF8(filename)); | ||
944 | } | ||
945 | } | ||
946 | |||
947 | #region importfunctions | ||
948 | [DllImport(VERSION.dll)] | ||
949 | private static extern RESULT FMOD5_Debug_Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode, DEBUG_CALLBACK callback, byte[] filename); | ||
950 | |||
951 | #endregion | ||
952 | } | ||
953 | |||
954 | public struct Thread | ||
955 | { | ||
956 | 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) | ||
957 | { | ||
958 | return FMOD5_Thread_SetAttributes(type, affinity, priority, stacksize); | ||
959 | } | ||
960 | |||
961 | #region importfunctions | ||
962 | [DllImport(VERSION.dll)] | ||
963 | private static extern RESULT FMOD5_Thread_SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity, THREAD_PRIORITY priority, THREAD_STACK_SIZE stacksize); | ||
964 | #endregion | ||
965 | } | ||
966 | |||
967 | /* | ||
968 | 'System' API. | ||
969 | */ | ||
970 | public struct System | ||
971 | { | ||
972 | public RESULT release() | ||
973 | { | ||
974 | return FMOD5_System_Release(this.handle); | ||
975 | } | ||
976 | |||
977 | // Setup functions. | ||
978 | public RESULT setOutput(OUTPUTTYPE output) | ||
979 | { | ||
980 | return FMOD5_System_SetOutput(this.handle, output); | ||
981 | } | ||
982 | public RESULT getOutput(out OUTPUTTYPE output) | ||
983 | { | ||
984 | return FMOD5_System_GetOutput(this.handle, out output); | ||
985 | } | ||
986 | public RESULT getNumDrivers(out int numdrivers) | ||
987 | { | ||
988 | return FMOD5_System_GetNumDrivers(this.handle, out numdrivers); | ||
989 | } | ||
990 | public RESULT getDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) | ||
991 | { | ||
992 | IntPtr stringMem = Marshal.AllocHGlobal(namelen); | ||
993 | |||
994 | RESULT result = FMOD5_System_GetDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels); | ||
995 | using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) | ||
996 | { | ||
997 | name = encoding.stringFromNative(stringMem); | ||
998 | } | ||
999 | Marshal.FreeHGlobal(stringMem); | ||
1000 | |||
1001 | return result; | ||
1002 | } | ||
1003 | public RESULT getDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) | ||
1004 | { | ||
1005 | return FMOD5_System_GetDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels); | ||
1006 | } | ||
1007 | public RESULT setDriver(int driver) | ||
1008 | { | ||
1009 | return FMOD5_System_SetDriver(this.handle, driver); | ||
1010 | } | ||
1011 | public RESULT getDriver(out int driver) | ||
1012 | { | ||
1013 | return FMOD5_System_GetDriver(this.handle, out driver); | ||
1014 | } | ||
1015 | public RESULT setSoftwareChannels(int numsoftwarechannels) | ||
1016 | { | ||
1017 | return FMOD5_System_SetSoftwareChannels(this.handle, numsoftwarechannels); | ||
1018 | } | ||
1019 | public RESULT getSoftwareChannels(out int numsoftwarechannels) | ||
1020 | { | ||
1021 | return FMOD5_System_GetSoftwareChannels(this.handle, out numsoftwarechannels); | ||
1022 | } | ||
1023 | public RESULT setSoftwareFormat(int samplerate, SPEAKERMODE speakermode, int numrawspeakers) | ||
1024 | { | ||
1025 | return FMOD5_System_SetSoftwareFormat(this.handle, samplerate, speakermode, numrawspeakers); | ||
1026 | } | ||
1027 | public RESULT getSoftwareFormat(out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers) | ||
1028 | { | ||
1029 | return FMOD5_System_GetSoftwareFormat(this.handle, out samplerate, out speakermode, out numrawspeakers); | ||
1030 | } | ||
1031 | public RESULT setDSPBufferSize(uint bufferlength, int numbuffers) | ||
1032 | { | ||
1033 | return FMOD5_System_SetDSPBufferSize(this.handle, bufferlength, numbuffers); | ||
1034 | } | ||
1035 | public RESULT getDSPBufferSize(out uint bufferlength, out int numbuffers) | ||
1036 | { | ||
1037 | return FMOD5_System_GetDSPBufferSize(this.handle, out bufferlength, out numbuffers); | ||
1038 | } | ||
1039 | 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) | ||
1040 | { | ||
1041 | return FMOD5_System_SetFileSystem(this.handle, useropen, userclose, userread, userseek, userasyncread, userasynccancel, blockalign); | ||
1042 | } | ||
1043 | public RESULT attachFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek) | ||
1044 | { | ||
1045 | return FMOD5_System_AttachFileSystem(this.handle, useropen, userclose, userread, userseek); | ||
1046 | } | ||
1047 | public RESULT setAdvancedSettings(ref ADVANCEDSETTINGS settings) | ||
1048 | { | ||
1049 | settings.cbSize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); | ||
1050 | return FMOD5_System_SetAdvancedSettings(this.handle, ref settings); | ||
1051 | } | ||
1052 | public RESULT getAdvancedSettings(ref ADVANCEDSETTINGS settings) | ||
1053 | { | ||
1054 | settings.cbSize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); | ||
1055 | return FMOD5_System_GetAdvancedSettings(this.handle, ref settings); | ||
1056 | } | ||
1057 | public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) | ||
1058 | { | ||
1059 | return FMOD5_System_SetCallback(this.handle, callback, callbackmask); | ||
1060 | } | ||
1061 | |||
1062 | // Plug-in support. | ||
1063 | public RESULT setPluginPath(string path) | ||
1064 | { | ||
1065 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1066 | { | ||
1067 | return FMOD5_System_SetPluginPath(this.handle, encoder.byteFromStringUTF8(path)); | ||
1068 | } | ||
1069 | } | ||
1070 | public RESULT loadPlugin(string filename, out uint handle, uint priority = 0) | ||
1071 | { | ||
1072 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1073 | { | ||
1074 | return FMOD5_System_LoadPlugin(this.handle, encoder.byteFromStringUTF8(filename), out handle, priority); | ||
1075 | } | ||
1076 | } | ||
1077 | public RESULT unloadPlugin(uint handle) | ||
1078 | { | ||
1079 | return FMOD5_System_UnloadPlugin(this.handle, handle); | ||
1080 | } | ||
1081 | public RESULT getNumNestedPlugins(uint handle, out int count) | ||
1082 | { | ||
1083 | return FMOD5_System_GetNumNestedPlugins(this.handle, handle, out count); | ||
1084 | } | ||
1085 | public RESULT getNestedPlugin(uint handle, int index, out uint nestedhandle) | ||
1086 | { | ||
1087 | return FMOD5_System_GetNestedPlugin(this.handle, handle, index, out nestedhandle); | ||
1088 | } | ||
1089 | public RESULT getNumPlugins(PLUGINTYPE plugintype, out int numplugins) | ||
1090 | { | ||
1091 | return FMOD5_System_GetNumPlugins(this.handle, plugintype, out numplugins); | ||
1092 | } | ||
1093 | public RESULT getPluginHandle(PLUGINTYPE plugintype, int index, out uint handle) | ||
1094 | { | ||
1095 | return FMOD5_System_GetPluginHandle(this.handle, plugintype, index, out handle); | ||
1096 | } | ||
1097 | public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out string name, int namelen, out uint version) | ||
1098 | { | ||
1099 | IntPtr stringMem = Marshal.AllocHGlobal(namelen); | ||
1100 | |||
1101 | RESULT result = FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, stringMem, namelen, out version); | ||
1102 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1103 | { | ||
1104 | name = encoder.stringFromNative(stringMem); | ||
1105 | } | ||
1106 | Marshal.FreeHGlobal(stringMem); | ||
1107 | |||
1108 | return result; | ||
1109 | } | ||
1110 | public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out uint version) | ||
1111 | { | ||
1112 | return FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, IntPtr.Zero, 0, out version); | ||
1113 | } | ||
1114 | public RESULT setOutputByPlugin(uint handle) | ||
1115 | { | ||
1116 | return FMOD5_System_SetOutputByPlugin(this.handle, handle); | ||
1117 | } | ||
1118 | public RESULT getOutputByPlugin(out uint handle) | ||
1119 | { | ||
1120 | return FMOD5_System_GetOutputByPlugin(this.handle, out handle); | ||
1121 | } | ||
1122 | public RESULT createDSPByPlugin(uint handle, out DSP dsp) | ||
1123 | { | ||
1124 | return FMOD5_System_CreateDSPByPlugin(this.handle, handle, out dsp.handle); | ||
1125 | } | ||
1126 | public RESULT getDSPInfoByPlugin(uint handle, out IntPtr description) | ||
1127 | { | ||
1128 | return FMOD5_System_GetDSPInfoByPlugin(this.handle, handle, out description); | ||
1129 | } | ||
1130 | /* | ||
1131 | public RESULT registerCodec (ref CODEC_DESCRIPTION description, out uint handle, uint priority) | ||
1132 | public RESULT registerCodec (ref CODEC_DESCRIPTION description, out uint handle, uint priority = 0) | ||
1133 | public RESULT registerCodec(ref CODEC_DESCRIPTION description, out uint handle, uint priority) | ||
1134 | { | ||
1135 | return FMOD5_System_RegisterCodec(this.handle, ref description, out handle, priority); | ||
1136 | } | ||
1137 | */ | ||
1138 | public RESULT registerDSP(ref DSP_DESCRIPTION description, out uint handle) | ||
1139 | { | ||
1140 | return FMOD5_System_RegisterDSP(this.handle, ref description, out handle); | ||
1141 | } | ||
1142 | /* | ||
1143 | public RESULT registerOutput(ref OUTPUT_DESCRIPTION description, out uint handle) | ||
1144 | { | ||
1145 | return FMOD5_System_RegisterOutput(this.handle, ref description, out handle); | ||
1146 | } | ||
1147 | */ | ||
1148 | |||
1149 | // Init/Close. | ||
1150 | public RESULT init(int maxchannels, INITFLAGS flags, IntPtr extradriverdata) | ||
1151 | { | ||
1152 | return FMOD5_System_Init(this.handle, maxchannels, flags, extradriverdata); | ||
1153 | } | ||
1154 | public RESULT close() | ||
1155 | { | ||
1156 | return FMOD5_System_Close(this.handle); | ||
1157 | } | ||
1158 | |||
1159 | // General post-init system functions. | ||
1160 | public RESULT update() | ||
1161 | { | ||
1162 | return FMOD5_System_Update(this.handle); | ||
1163 | } | ||
1164 | public RESULT setSpeakerPosition(SPEAKER speaker, float x, float y, bool active) | ||
1165 | { | ||
1166 | return FMOD5_System_SetSpeakerPosition(this.handle, speaker, x, y, active); | ||
1167 | } | ||
1168 | public RESULT getSpeakerPosition(SPEAKER speaker, out float x, out float y, out bool active) | ||
1169 | { | ||
1170 | return FMOD5_System_GetSpeakerPosition(this.handle, speaker, out x, out y, out active); | ||
1171 | } | ||
1172 | public RESULT setStreamBufferSize(uint filebuffersize, TIMEUNIT filebuffersizetype) | ||
1173 | { | ||
1174 | return FMOD5_System_SetStreamBufferSize(this.handle, filebuffersize, filebuffersizetype); | ||
1175 | } | ||
1176 | public RESULT getStreamBufferSize(out uint filebuffersize, out TIMEUNIT filebuffersizetype) | ||
1177 | { | ||
1178 | return FMOD5_System_GetStreamBufferSize(this.handle, out filebuffersize, out filebuffersizetype); | ||
1179 | } | ||
1180 | public RESULT set3DSettings(float dopplerscale, float distancefactor, float rolloffscale) | ||
1181 | { | ||
1182 | return FMOD5_System_Set3DSettings(this.handle, dopplerscale, distancefactor, rolloffscale); | ||
1183 | } | ||
1184 | public RESULT get3DSettings(out float dopplerscale, out float distancefactor, out float rolloffscale) | ||
1185 | { | ||
1186 | return FMOD5_System_Get3DSettings(this.handle, out dopplerscale, out distancefactor, out rolloffscale); | ||
1187 | } | ||
1188 | public RESULT set3DNumListeners(int numlisteners) | ||
1189 | { | ||
1190 | return FMOD5_System_Set3DNumListeners(this.handle, numlisteners); | ||
1191 | } | ||
1192 | public RESULT get3DNumListeners(out int numlisteners) | ||
1193 | { | ||
1194 | return FMOD5_System_Get3DNumListeners(this.handle, out numlisteners); | ||
1195 | } | ||
1196 | public RESULT set3DListenerAttributes(int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up) | ||
1197 | { | ||
1198 | return FMOD5_System_Set3DListenerAttributes(this.handle, listener, ref pos, ref vel, ref forward, ref up); | ||
1199 | } | ||
1200 | public RESULT get3DListenerAttributes(int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up) | ||
1201 | { | ||
1202 | return FMOD5_System_Get3DListenerAttributes(this.handle, listener, out pos, out vel, out forward, out up); | ||
1203 | } | ||
1204 | public RESULT set3DRolloffCallback(CB_3D_ROLLOFF_CALLBACK callback) | ||
1205 | { | ||
1206 | return FMOD5_System_Set3DRolloffCallback(this.handle, callback); | ||
1207 | } | ||
1208 | public RESULT mixerSuspend() | ||
1209 | { | ||
1210 | return FMOD5_System_MixerSuspend(this.handle); | ||
1211 | } | ||
1212 | public RESULT mixerResume() | ||
1213 | { | ||
1214 | return FMOD5_System_MixerResume(this.handle); | ||
1215 | } | ||
1216 | public RESULT getDefaultMixMatrix(SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop) | ||
1217 | { | ||
1218 | return FMOD5_System_GetDefaultMixMatrix(this.handle, sourcespeakermode, targetspeakermode, matrix, matrixhop); | ||
1219 | } | ||
1220 | public RESULT getSpeakerModeChannels(SPEAKERMODE mode, out int channels) | ||
1221 | { | ||
1222 | return FMOD5_System_GetSpeakerModeChannels(this.handle, mode, out channels); | ||
1223 | } | ||
1224 | |||
1225 | // System information functions. | ||
1226 | public RESULT getVersion(out uint version) | ||
1227 | { | ||
1228 | return FMOD5_System_GetVersion(this.handle, out version); | ||
1229 | } | ||
1230 | public RESULT getOutputHandle(out IntPtr handle) | ||
1231 | { | ||
1232 | return FMOD5_System_GetOutputHandle(this.handle, out handle); | ||
1233 | } | ||
1234 | public RESULT getChannelsPlaying(out int channels) | ||
1235 | { | ||
1236 | return FMOD5_System_GetChannelsPlaying(this.handle, out channels, IntPtr.Zero); | ||
1237 | } | ||
1238 | public RESULT getChannelsPlaying(out int channels, out int realchannels) | ||
1239 | { | ||
1240 | return FMOD5_System_GetChannelsPlaying(this.handle, out channels, out realchannels); | ||
1241 | } | ||
1242 | public RESULT getCPUUsage(out CPU_USAGE usage) | ||
1243 | { | ||
1244 | return FMOD5_System_GetCPUUsage(this.handle, out usage); | ||
1245 | } | ||
1246 | public RESULT getFileUsage(out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead) | ||
1247 | { | ||
1248 | return FMOD5_System_GetFileUsage(this.handle, out sampleBytesRead, out streamBytesRead, out otherBytesRead); | ||
1249 | } | ||
1250 | |||
1251 | // Sound/DSP/Channel/FX creation and retrieval. | ||
1252 | public RESULT createSound(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) | ||
1253 | { | ||
1254 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1255 | { | ||
1256 | return FMOD5_System_CreateSound(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); | ||
1257 | } | ||
1258 | } | ||
1259 | public RESULT createSound(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) | ||
1260 | { | ||
1261 | return FMOD5_System_CreateSound(this.handle, data, mode, ref exinfo, out sound.handle); | ||
1262 | } | ||
1263 | public RESULT createSound(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) | ||
1264 | { | ||
1265 | return FMOD5_System_CreateSound(this.handle, name_or_data, mode, ref exinfo, out sound.handle); | ||
1266 | } | ||
1267 | public RESULT createSound(string name, MODE mode, out Sound sound) | ||
1268 | { | ||
1269 | CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); | ||
1270 | exinfo.cbsize = MarshalHelper.SizeOf(typeof(CREATESOUNDEXINFO)); | ||
1271 | |||
1272 | return createSound(name, mode, ref exinfo, out sound); | ||
1273 | } | ||
1274 | public RESULT createStream(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) | ||
1275 | { | ||
1276 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1277 | { | ||
1278 | return FMOD5_System_CreateStream(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); | ||
1279 | } | ||
1280 | } | ||
1281 | public RESULT createStream(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) | ||
1282 | { | ||
1283 | return FMOD5_System_CreateStream(this.handle, data, mode, ref exinfo, out sound.handle); | ||
1284 | } | ||
1285 | public RESULT createStream(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) | ||
1286 | { | ||
1287 | return FMOD5_System_CreateStream(this.handle, name_or_data, mode, ref exinfo, out sound.handle); | ||
1288 | } | ||
1289 | public RESULT createStream(string name, MODE mode, out Sound sound) | ||
1290 | { | ||
1291 | CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); | ||
1292 | exinfo.cbsize = MarshalHelper.SizeOf(typeof(CREATESOUNDEXINFO)); | ||
1293 | |||
1294 | return createStream(name, mode, ref exinfo, out sound); | ||
1295 | } | ||
1296 | public RESULT createDSP(ref DSP_DESCRIPTION description, out DSP dsp) | ||
1297 | { | ||
1298 | return FMOD5_System_CreateDSP(this.handle, ref description, out dsp.handle); | ||
1299 | } | ||
1300 | public RESULT createDSPByType(DSP_TYPE type, out DSP dsp) | ||
1301 | { | ||
1302 | return FMOD5_System_CreateDSPByType(this.handle, type, out dsp.handle); | ||
1303 | } | ||
1304 | public RESULT createChannelGroup(string name, out ChannelGroup channelgroup) | ||
1305 | { | ||
1306 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1307 | { | ||
1308 | return FMOD5_System_CreateChannelGroup(this.handle, encoder.byteFromStringUTF8(name), out channelgroup.handle); | ||
1309 | } | ||
1310 | } | ||
1311 | public RESULT createSoundGroup(string name, out SoundGroup soundgroup) | ||
1312 | { | ||
1313 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1314 | { | ||
1315 | return FMOD5_System_CreateSoundGroup(this.handle, encoder.byteFromStringUTF8(name), out soundgroup.handle); | ||
1316 | } | ||
1317 | } | ||
1318 | public RESULT createReverb3D(out Reverb3D reverb) | ||
1319 | { | ||
1320 | return FMOD5_System_CreateReverb3D(this.handle, out reverb.handle); | ||
1321 | } | ||
1322 | public RESULT playSound(Sound sound, ChannelGroup channelgroup, bool paused, out Channel channel) | ||
1323 | { | ||
1324 | return FMOD5_System_PlaySound(this.handle, sound.handle, channelgroup.handle, paused, out channel.handle); | ||
1325 | } | ||
1326 | public RESULT playDSP(DSP dsp, ChannelGroup channelgroup, bool paused, out Channel channel) | ||
1327 | { | ||
1328 | return FMOD5_System_PlayDSP(this.handle, dsp.handle, channelgroup.handle, paused, out channel.handle); | ||
1329 | } | ||
1330 | public RESULT getChannel(int channelid, out Channel channel) | ||
1331 | { | ||
1332 | return FMOD5_System_GetChannel(this.handle, channelid, out channel.handle); | ||
1333 | } | ||
1334 | public RESULT getDSPInfoByType(DSP_TYPE type, out IntPtr description) | ||
1335 | { | ||
1336 | return FMOD5_System_GetDSPInfoByType(this.handle, type, out description); | ||
1337 | } | ||
1338 | public RESULT getMasterChannelGroup(out ChannelGroup channelgroup) | ||
1339 | { | ||
1340 | return FMOD5_System_GetMasterChannelGroup(this.handle, out channelgroup.handle); | ||
1341 | } | ||
1342 | public RESULT getMasterSoundGroup(out SoundGroup soundgroup) | ||
1343 | { | ||
1344 | return FMOD5_System_GetMasterSoundGroup(this.handle, out soundgroup.handle); | ||
1345 | } | ||
1346 | |||
1347 | // Routing to ports. | ||
1348 | public RESULT attachChannelGroupToPort(PORT_TYPE portType, ulong portIndex, ChannelGroup channelgroup, bool passThru = false) | ||
1349 | { | ||
1350 | return FMOD5_System_AttachChannelGroupToPort(this.handle, portType, portIndex, channelgroup.handle, passThru); | ||
1351 | } | ||
1352 | public RESULT detachChannelGroupFromPort(ChannelGroup channelgroup) | ||
1353 | { | ||
1354 | return FMOD5_System_DetachChannelGroupFromPort(this.handle, channelgroup.handle); | ||
1355 | } | ||
1356 | |||
1357 | // Reverb api. | ||
1358 | public RESULT setReverbProperties(int instance, ref REVERB_PROPERTIES prop) | ||
1359 | { | ||
1360 | return FMOD5_System_SetReverbProperties(this.handle, instance, ref prop); | ||
1361 | } | ||
1362 | public RESULT getReverbProperties(int instance, out REVERB_PROPERTIES prop) | ||
1363 | { | ||
1364 | return FMOD5_System_GetReverbProperties(this.handle, instance, out prop); | ||
1365 | } | ||
1366 | |||
1367 | // System level DSP functionality. | ||
1368 | public RESULT lockDSP() | ||
1369 | { | ||
1370 | return FMOD5_System_LockDSP(this.handle); | ||
1371 | } | ||
1372 | public RESULT unlockDSP() | ||
1373 | { | ||
1374 | return FMOD5_System_UnlockDSP(this.handle); | ||
1375 | } | ||
1376 | |||
1377 | // Recording api | ||
1378 | public RESULT getRecordNumDrivers(out int numdrivers, out int numconnected) | ||
1379 | { | ||
1380 | return FMOD5_System_GetRecordNumDrivers(this.handle, out numdrivers, out numconnected); | ||
1381 | } | ||
1382 | 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) | ||
1383 | { | ||
1384 | IntPtr stringMem = Marshal.AllocHGlobal(namelen); | ||
1385 | |||
1386 | RESULT result = FMOD5_System_GetRecordDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels, out state); | ||
1387 | |||
1388 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1389 | { | ||
1390 | name = encoder.stringFromNative(stringMem); | ||
1391 | } | ||
1392 | Marshal.FreeHGlobal(stringMem); | ||
1393 | |||
1394 | return result; | ||
1395 | } | ||
1396 | public RESULT getRecordDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) | ||
1397 | { | ||
1398 | return FMOD5_System_GetRecordDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels, out state); | ||
1399 | } | ||
1400 | public RESULT getRecordPosition(int id, out uint position) | ||
1401 | { | ||
1402 | return FMOD5_System_GetRecordPosition(this.handle, id, out position); | ||
1403 | } | ||
1404 | public RESULT recordStart(int id, Sound sound, bool loop) | ||
1405 | { | ||
1406 | return FMOD5_System_RecordStart(this.handle, id, sound.handle, loop); | ||
1407 | } | ||
1408 | public RESULT recordStop(int id) | ||
1409 | { | ||
1410 | return FMOD5_System_RecordStop(this.handle, id); | ||
1411 | } | ||
1412 | public RESULT isRecording(int id, out bool recording) | ||
1413 | { | ||
1414 | return FMOD5_System_IsRecording(this.handle, id, out recording); | ||
1415 | } | ||
1416 | |||
1417 | // Geometry api | ||
1418 | public RESULT createGeometry(int maxpolygons, int maxvertices, out Geometry geometry) | ||
1419 | { | ||
1420 | return FMOD5_System_CreateGeometry(this.handle, maxpolygons, maxvertices, out geometry.handle); | ||
1421 | } | ||
1422 | public RESULT setGeometrySettings(float maxworldsize) | ||
1423 | { | ||
1424 | return FMOD5_System_SetGeometrySettings(this.handle, maxworldsize); | ||
1425 | } | ||
1426 | public RESULT getGeometrySettings(out float maxworldsize) | ||
1427 | { | ||
1428 | return FMOD5_System_GetGeometrySettings(this.handle, out maxworldsize); | ||
1429 | } | ||
1430 | public RESULT loadGeometry(IntPtr data, int datasize, out Geometry geometry) | ||
1431 | { | ||
1432 | return FMOD5_System_LoadGeometry(this.handle, data, datasize, out geometry.handle); | ||
1433 | } | ||
1434 | public RESULT getGeometryOcclusion(ref VECTOR listener, ref VECTOR source, out float direct, out float reverb) | ||
1435 | { | ||
1436 | return FMOD5_System_GetGeometryOcclusion(this.handle, ref listener, ref source, out direct, out reverb); | ||
1437 | } | ||
1438 | |||
1439 | // Network functions | ||
1440 | public RESULT setNetworkProxy(string proxy) | ||
1441 | { | ||
1442 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1443 | { | ||
1444 | return FMOD5_System_SetNetworkProxy(this.handle, encoder.byteFromStringUTF8(proxy)); | ||
1445 | } | ||
1446 | } | ||
1447 | public RESULT getNetworkProxy(out string proxy, int proxylen) | ||
1448 | { | ||
1449 | IntPtr stringMem = Marshal.AllocHGlobal(proxylen); | ||
1450 | |||
1451 | RESULT result = FMOD5_System_GetNetworkProxy(this.handle, stringMem, proxylen); | ||
1452 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1453 | { | ||
1454 | proxy = encoder.stringFromNative(stringMem); | ||
1455 | } | ||
1456 | Marshal.FreeHGlobal(stringMem); | ||
1457 | |||
1458 | return result; | ||
1459 | } | ||
1460 | public RESULT setNetworkTimeout(int timeout) | ||
1461 | { | ||
1462 | return FMOD5_System_SetNetworkTimeout(this.handle, timeout); | ||
1463 | } | ||
1464 | public RESULT getNetworkTimeout(out int timeout) | ||
1465 | { | ||
1466 | return FMOD5_System_GetNetworkTimeout(this.handle, out timeout); | ||
1467 | } | ||
1468 | |||
1469 | // Userdata set/get | ||
1470 | public RESULT setUserData(IntPtr userdata) | ||
1471 | { | ||
1472 | return FMOD5_System_SetUserData(this.handle, userdata); | ||
1473 | } | ||
1474 | public RESULT getUserData(out IntPtr userdata) | ||
1475 | { | ||
1476 | return FMOD5_System_GetUserData(this.handle, out userdata); | ||
1477 | } | ||
1478 | |||
1479 | #region importfunctions | ||
1480 | [DllImport(VERSION.dll)] | ||
1481 | private static extern RESULT FMOD5_System_Release (IntPtr system); | ||
1482 | [DllImport(VERSION.dll)] | ||
1483 | private static extern RESULT FMOD5_System_SetOutput (IntPtr system, OUTPUTTYPE output); | ||
1484 | [DllImport(VERSION.dll)] | ||
1485 | private static extern RESULT FMOD5_System_GetOutput (IntPtr system, out OUTPUTTYPE output); | ||
1486 | [DllImport(VERSION.dll)] | ||
1487 | private static extern RESULT FMOD5_System_GetNumDrivers (IntPtr system, out int numdrivers); | ||
1488 | [DllImport(VERSION.dll)] | ||
1489 | 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); | ||
1490 | [DllImport(VERSION.dll)] | ||
1491 | private static extern RESULT FMOD5_System_SetDriver (IntPtr system, int driver); | ||
1492 | [DllImport(VERSION.dll)] | ||
1493 | private static extern RESULT FMOD5_System_GetDriver (IntPtr system, out int driver); | ||
1494 | [DllImport(VERSION.dll)] | ||
1495 | private static extern RESULT FMOD5_System_SetSoftwareChannels (IntPtr system, int numsoftwarechannels); | ||
1496 | [DllImport(VERSION.dll)] | ||
1497 | private static extern RESULT FMOD5_System_GetSoftwareChannels (IntPtr system, out int numsoftwarechannels); | ||
1498 | [DllImport(VERSION.dll)] | ||
1499 | private static extern RESULT FMOD5_System_SetSoftwareFormat (IntPtr system, int samplerate, SPEAKERMODE speakermode, int numrawspeakers); | ||
1500 | [DllImport(VERSION.dll)] | ||
1501 | private static extern RESULT FMOD5_System_GetSoftwareFormat (IntPtr system, out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers); | ||
1502 | [DllImport(VERSION.dll)] | ||
1503 | private static extern RESULT FMOD5_System_SetDSPBufferSize (IntPtr system, uint bufferlength, int numbuffers); | ||
1504 | [DllImport(VERSION.dll)] | ||
1505 | private static extern RESULT FMOD5_System_GetDSPBufferSize (IntPtr system, out uint bufferlength, out int numbuffers); | ||
1506 | [DllImport(VERSION.dll)] | ||
1507 | 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); | ||
1508 | [DllImport(VERSION.dll)] | ||
1509 | 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); | ||
1510 | [DllImport(VERSION.dll)] | ||
1511 | private static extern RESULT FMOD5_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); | ||
1512 | [DllImport(VERSION.dll)] | ||
1513 | private static extern RESULT FMOD5_System_GetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); | ||
1514 | [DllImport(VERSION.dll)] | ||
1515 | private static extern RESULT FMOD5_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); | ||
1516 | [DllImport(VERSION.dll)] | ||
1517 | private static extern RESULT FMOD5_System_SetPluginPath (IntPtr system, byte[] path); | ||
1518 | [DllImport(VERSION.dll)] | ||
1519 | private static extern RESULT FMOD5_System_LoadPlugin (IntPtr system, byte[] filename, out uint handle, uint priority); | ||
1520 | [DllImport(VERSION.dll)] | ||
1521 | private static extern RESULT FMOD5_System_UnloadPlugin (IntPtr system, uint handle); | ||
1522 | [DllImport(VERSION.dll)] | ||
1523 | private static extern RESULT FMOD5_System_GetNumNestedPlugins (IntPtr system, uint handle, out int count); | ||
1524 | [DllImport(VERSION.dll)] | ||
1525 | private static extern RESULT FMOD5_System_GetNestedPlugin (IntPtr system, uint handle, int index, out uint nestedhandle); | ||
1526 | [DllImport(VERSION.dll)] | ||
1527 | private static extern RESULT FMOD5_System_GetNumPlugins (IntPtr system, PLUGINTYPE plugintype, out int numplugins); | ||
1528 | [DllImport(VERSION.dll)] | ||
1529 | private static extern RESULT FMOD5_System_GetPluginHandle (IntPtr system, PLUGINTYPE plugintype, int index, out uint handle); | ||
1530 | [DllImport(VERSION.dll)] | ||
1531 | private static extern RESULT FMOD5_System_GetPluginInfo (IntPtr system, uint handle, out PLUGINTYPE plugintype, IntPtr name, int namelen, out uint version); | ||
1532 | [DllImport(VERSION.dll)] | ||
1533 | private static extern RESULT FMOD5_System_SetOutputByPlugin (IntPtr system, uint handle); | ||
1534 | [DllImport(VERSION.dll)] | ||
1535 | private static extern RESULT FMOD5_System_GetOutputByPlugin (IntPtr system, out uint handle); | ||
1536 | [DllImport(VERSION.dll)] | ||
1537 | private static extern RESULT FMOD5_System_CreateDSPByPlugin (IntPtr system, uint handle, out IntPtr dsp); | ||
1538 | [DllImport(VERSION.dll)] | ||
1539 | private static extern RESULT FMOD5_System_GetDSPInfoByPlugin (IntPtr system, uint handle, out IntPtr description); | ||
1540 | //[DllImport(VERSION.dll)] | ||
1541 | //private static extern RESULT FMOD5_System_RegisterCodec (IntPtr system, out CODEC_DESCRIPTION description, out uint handle, uint priority); | ||
1542 | [DllImport(VERSION.dll)] | ||
1543 | private static extern RESULT FMOD5_System_RegisterDSP (IntPtr system, ref DSP_DESCRIPTION description, out uint handle); | ||
1544 | //[DllImport(VERSION.dll)] | ||
1545 | //private static extern RESULT FMOD5_System_RegisterOutput (IntPtr system, ref OUTPUT_DESCRIPTION description, out uint handle); | ||
1546 | [DllImport(VERSION.dll)] | ||
1547 | private static extern RESULT FMOD5_System_Init (IntPtr system, int maxchannels, INITFLAGS flags, IntPtr extradriverdata); | ||
1548 | [DllImport(VERSION.dll)] | ||
1549 | private static extern RESULT FMOD5_System_Close (IntPtr system); | ||
1550 | [DllImport(VERSION.dll)] | ||
1551 | private static extern RESULT FMOD5_System_Update (IntPtr system); | ||
1552 | [DllImport(VERSION.dll)] | ||
1553 | private static extern RESULT FMOD5_System_SetSpeakerPosition (IntPtr system, SPEAKER speaker, float x, float y, bool active); | ||
1554 | [DllImport(VERSION.dll)] | ||
1555 | private static extern RESULT FMOD5_System_GetSpeakerPosition (IntPtr system, SPEAKER speaker, out float x, out float y, out bool active); | ||
1556 | [DllImport(VERSION.dll)] | ||
1557 | private static extern RESULT FMOD5_System_SetStreamBufferSize (IntPtr system, uint filebuffersize, TIMEUNIT filebuffersizetype); | ||
1558 | [DllImport(VERSION.dll)] | ||
1559 | private static extern RESULT FMOD5_System_GetStreamBufferSize (IntPtr system, out uint filebuffersize, out TIMEUNIT filebuffersizetype); | ||
1560 | [DllImport(VERSION.dll)] | ||
1561 | private static extern RESULT FMOD5_System_Set3DSettings (IntPtr system, float dopplerscale, float distancefactor, float rolloffscale); | ||
1562 | [DllImport(VERSION.dll)] | ||
1563 | private static extern RESULT FMOD5_System_Get3DSettings (IntPtr system, out float dopplerscale, out float distancefactor, out float rolloffscale); | ||
1564 | [DllImport(VERSION.dll)] | ||
1565 | private static extern RESULT FMOD5_System_Set3DNumListeners (IntPtr system, int numlisteners); | ||
1566 | [DllImport(VERSION.dll)] | ||
1567 | private static extern RESULT FMOD5_System_Get3DNumListeners (IntPtr system, out int numlisteners); | ||
1568 | [DllImport(VERSION.dll)] | ||
1569 | private static extern RESULT FMOD5_System_Set3DListenerAttributes (IntPtr system, int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up); | ||
1570 | [DllImport(VERSION.dll)] | ||
1571 | private static extern RESULT FMOD5_System_Get3DListenerAttributes (IntPtr system, int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up); | ||
1572 | [DllImport(VERSION.dll)] | ||
1573 | private static extern RESULT FMOD5_System_Set3DRolloffCallback (IntPtr system, CB_3D_ROLLOFF_CALLBACK callback); | ||
1574 | [DllImport(VERSION.dll)] | ||
1575 | private static extern RESULT FMOD5_System_MixerSuspend (IntPtr system); | ||
1576 | [DllImport(VERSION.dll)] | ||
1577 | private static extern RESULT FMOD5_System_MixerResume (IntPtr system); | ||
1578 | [DllImport(VERSION.dll)] | ||
1579 | private static extern RESULT FMOD5_System_GetDefaultMixMatrix (IntPtr system, SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop); | ||
1580 | [DllImport(VERSION.dll)] | ||
1581 | private static extern RESULT FMOD5_System_GetSpeakerModeChannels (IntPtr system, SPEAKERMODE mode, out int channels); | ||
1582 | [DllImport(VERSION.dll)] | ||
1583 | private static extern RESULT FMOD5_System_GetVersion (IntPtr system, out uint version); | ||
1584 | [DllImport(VERSION.dll)] | ||
1585 | private static extern RESULT FMOD5_System_GetOutputHandle (IntPtr system, out IntPtr handle); | ||
1586 | [DllImport(VERSION.dll)] | ||
1587 | private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, IntPtr zero); | ||
1588 | [DllImport(VERSION.dll)] | ||
1589 | private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, out int realchannels); | ||
1590 | [DllImport(VERSION.dll)] | ||
1591 | private static extern RESULT FMOD5_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage); | ||
1592 | [DllImport(VERSION.dll)] | ||
1593 | private static extern RESULT FMOD5_System_GetFileUsage (IntPtr system, out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead); | ||
1594 | [DllImport(VERSION.dll)] | ||
1595 | private static extern RESULT FMOD5_System_CreateSound (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); | ||
1596 | [DllImport(VERSION.dll)] | ||
1597 | private static extern RESULT FMOD5_System_CreateSound (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); | ||
1598 | [DllImport(VERSION.dll)] | ||
1599 | private static extern RESULT FMOD5_System_CreateStream (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); | ||
1600 | [DllImport(VERSION.dll)] | ||
1601 | private static extern RESULT FMOD5_System_CreateStream (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); | ||
1602 | [DllImport(VERSION.dll)] | ||
1603 | private static extern RESULT FMOD5_System_CreateDSP (IntPtr system, ref DSP_DESCRIPTION description, out IntPtr dsp); | ||
1604 | [DllImport(VERSION.dll)] | ||
1605 | private static extern RESULT FMOD5_System_CreateDSPByType (IntPtr system, DSP_TYPE type, out IntPtr dsp); | ||
1606 | [DllImport(VERSION.dll)] | ||
1607 | private static extern RESULT FMOD5_System_CreateChannelGroup (IntPtr system, byte[] name, out IntPtr channelgroup); | ||
1608 | [DllImport(VERSION.dll)] | ||
1609 | private static extern RESULT FMOD5_System_CreateSoundGroup (IntPtr system, byte[] name, out IntPtr soundgroup); | ||
1610 | [DllImport(VERSION.dll)] | ||
1611 | private static extern RESULT FMOD5_System_CreateReverb3D (IntPtr system, out IntPtr reverb); | ||
1612 | [DllImport(VERSION.dll)] | ||
1613 | private static extern RESULT FMOD5_System_PlaySound (IntPtr system, IntPtr sound, IntPtr channelgroup, bool paused, out IntPtr channel); | ||
1614 | [DllImport(VERSION.dll)] | ||
1615 | private static extern RESULT FMOD5_System_PlayDSP (IntPtr system, IntPtr dsp, IntPtr channelgroup, bool paused, out IntPtr channel); | ||
1616 | [DllImport(VERSION.dll)] | ||
1617 | private static extern RESULT FMOD5_System_GetChannel (IntPtr system, int channelid, out IntPtr channel); | ||
1618 | [DllImport(VERSION.dll)] | ||
1619 | private static extern RESULT FMOD5_System_GetDSPInfoByType (IntPtr system, DSP_TYPE type, out IntPtr description); | ||
1620 | [DllImport(VERSION.dll)] | ||
1621 | private static extern RESULT FMOD5_System_GetMasterChannelGroup (IntPtr system, out IntPtr channelgroup); | ||
1622 | [DllImport(VERSION.dll)] | ||
1623 | private static extern RESULT FMOD5_System_GetMasterSoundGroup (IntPtr system, out IntPtr soundgroup); | ||
1624 | [DllImport(VERSION.dll)] | ||
1625 | private static extern RESULT FMOD5_System_AttachChannelGroupToPort (IntPtr system, PORT_TYPE portType, ulong portIndex, IntPtr channelgroup, bool passThru); | ||
1626 | [DllImport(VERSION.dll)] | ||
1627 | private static extern RESULT FMOD5_System_DetachChannelGroupFromPort(IntPtr system, IntPtr channelgroup); | ||
1628 | [DllImport(VERSION.dll)] | ||
1629 | private static extern RESULT FMOD5_System_SetReverbProperties (IntPtr system, int instance, ref REVERB_PROPERTIES prop); | ||
1630 | [DllImport(VERSION.dll)] | ||
1631 | private static extern RESULT FMOD5_System_GetReverbProperties (IntPtr system, int instance, out REVERB_PROPERTIES prop); | ||
1632 | [DllImport(VERSION.dll)] | ||
1633 | private static extern RESULT FMOD5_System_LockDSP (IntPtr system); | ||
1634 | [DllImport(VERSION.dll)] | ||
1635 | private static extern RESULT FMOD5_System_UnlockDSP (IntPtr system); | ||
1636 | [DllImport(VERSION.dll)] | ||
1637 | private static extern RESULT FMOD5_System_GetRecordNumDrivers (IntPtr system, out int numdrivers, out int numconnected); | ||
1638 | [DllImport(VERSION.dll)] | ||
1639 | 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); | ||
1640 | [DllImport(VERSION.dll)] | ||
1641 | private static extern RESULT FMOD5_System_GetRecordPosition (IntPtr system, int id, out uint position); | ||
1642 | [DllImport(VERSION.dll)] | ||
1643 | private static extern RESULT FMOD5_System_RecordStart (IntPtr system, int id, IntPtr sound, bool loop); | ||
1644 | [DllImport(VERSION.dll)] | ||
1645 | private static extern RESULT FMOD5_System_RecordStop (IntPtr system, int id); | ||
1646 | [DllImport(VERSION.dll)] | ||
1647 | private static extern RESULT FMOD5_System_IsRecording (IntPtr system, int id, out bool recording); | ||
1648 | [DllImport(VERSION.dll)] | ||
1649 | private static extern RESULT FMOD5_System_CreateGeometry (IntPtr system, int maxpolygons, int maxvertices, out IntPtr geometry); | ||
1650 | [DllImport(VERSION.dll)] | ||
1651 | private static extern RESULT FMOD5_System_SetGeometrySettings (IntPtr system, float maxworldsize); | ||
1652 | [DllImport(VERSION.dll)] | ||
1653 | private static extern RESULT FMOD5_System_GetGeometrySettings (IntPtr system, out float maxworldsize); | ||
1654 | [DllImport(VERSION.dll)] | ||
1655 | private static extern RESULT FMOD5_System_LoadGeometry (IntPtr system, IntPtr data, int datasize, out IntPtr geometry); | ||
1656 | [DllImport(VERSION.dll)] | ||
1657 | private static extern RESULT FMOD5_System_GetGeometryOcclusion (IntPtr system, ref VECTOR listener, ref VECTOR source, out float direct, out float reverb); | ||
1658 | [DllImport(VERSION.dll)] | ||
1659 | private static extern RESULT FMOD5_System_SetNetworkProxy (IntPtr system, byte[] proxy); | ||
1660 | [DllImport(VERSION.dll)] | ||
1661 | private static extern RESULT FMOD5_System_GetNetworkProxy (IntPtr system, IntPtr proxy, int proxylen); | ||
1662 | [DllImport(VERSION.dll)] | ||
1663 | private static extern RESULT FMOD5_System_SetNetworkTimeout (IntPtr system, int timeout); | ||
1664 | [DllImport(VERSION.dll)] | ||
1665 | private static extern RESULT FMOD5_System_GetNetworkTimeout (IntPtr system, out int timeout); | ||
1666 | [DllImport(VERSION.dll)] | ||
1667 | private static extern RESULT FMOD5_System_SetUserData (IntPtr system, IntPtr userdata); | ||
1668 | [DllImport(VERSION.dll)] | ||
1669 | private static extern RESULT FMOD5_System_GetUserData (IntPtr system, out IntPtr userdata); | ||
1670 | #endregion | ||
1671 | |||
1672 | #region wrapperinternal | ||
1673 | |||
1674 | public IntPtr handle; | ||
1675 | |||
1676 | public System(IntPtr ptr) { this.handle = ptr; } | ||
1677 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
1678 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
1679 | |||
1680 | #endregion | ||
1681 | } | ||
1682 | |||
1683 | |||
1684 | /* | ||
1685 | 'Sound' API. | ||
1686 | */ | ||
1687 | public struct Sound | ||
1688 | { | ||
1689 | public RESULT release() | ||
1690 | { | ||
1691 | return FMOD5_Sound_Release(this.handle); | ||
1692 | } | ||
1693 | public RESULT getSystemObject(out System system) | ||
1694 | { | ||
1695 | return FMOD5_Sound_GetSystemObject(this.handle, out system.handle); | ||
1696 | } | ||
1697 | |||
1698 | // Standard sound manipulation functions. | ||
1699 | public RESULT @lock(uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2) | ||
1700 | { | ||
1701 | return FMOD5_Sound_Lock(this.handle, offset, length, out ptr1, out ptr2, out len1, out len2); | ||
1702 | } | ||
1703 | public RESULT unlock(IntPtr ptr1, IntPtr ptr2, uint len1, uint len2) | ||
1704 | { | ||
1705 | return FMOD5_Sound_Unlock(this.handle, ptr1, ptr2, len1, len2); | ||
1706 | } | ||
1707 | public RESULT setDefaults(float frequency, int priority) | ||
1708 | { | ||
1709 | return FMOD5_Sound_SetDefaults(this.handle, frequency, priority); | ||
1710 | } | ||
1711 | public RESULT getDefaults(out float frequency, out int priority) | ||
1712 | { | ||
1713 | return FMOD5_Sound_GetDefaults(this.handle, out frequency, out priority); | ||
1714 | } | ||
1715 | public RESULT set3DMinMaxDistance(float min, float max) | ||
1716 | { | ||
1717 | return FMOD5_Sound_Set3DMinMaxDistance(this.handle, min, max); | ||
1718 | } | ||
1719 | public RESULT get3DMinMaxDistance(out float min, out float max) | ||
1720 | { | ||
1721 | return FMOD5_Sound_Get3DMinMaxDistance(this.handle, out min, out max); | ||
1722 | } | ||
1723 | public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) | ||
1724 | { | ||
1725 | return FMOD5_Sound_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); | ||
1726 | } | ||
1727 | public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) | ||
1728 | { | ||
1729 | return FMOD5_Sound_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); | ||
1730 | } | ||
1731 | public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) | ||
1732 | { | ||
1733 | return FMOD5_Sound_Set3DCustomRolloff(this.handle, ref points, numpoints); | ||
1734 | } | ||
1735 | public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) | ||
1736 | { | ||
1737 | return FMOD5_Sound_Get3DCustomRolloff(this.handle, out points, out numpoints); | ||
1738 | } | ||
1739 | |||
1740 | public RESULT getSubSound(int index, out Sound subsound) | ||
1741 | { | ||
1742 | return FMOD5_Sound_GetSubSound(this.handle, index, out subsound.handle); | ||
1743 | } | ||
1744 | public RESULT getSubSoundParent(out Sound parentsound) | ||
1745 | { | ||
1746 | return FMOD5_Sound_GetSubSoundParent(this.handle, out parentsound.handle); | ||
1747 | } | ||
1748 | public RESULT getName(out string name, int namelen) | ||
1749 | { | ||
1750 | IntPtr stringMem = Marshal.AllocHGlobal(namelen); | ||
1751 | |||
1752 | RESULT result = FMOD5_Sound_GetName(this.handle, stringMem, namelen); | ||
1753 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1754 | { | ||
1755 | name = encoder.stringFromNative(stringMem); | ||
1756 | } | ||
1757 | Marshal.FreeHGlobal(stringMem); | ||
1758 | |||
1759 | return result; | ||
1760 | } | ||
1761 | public RESULT getLength(out uint length, TIMEUNIT lengthtype) | ||
1762 | { | ||
1763 | return FMOD5_Sound_GetLength(this.handle, out length, lengthtype); | ||
1764 | } | ||
1765 | public RESULT getFormat(out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits) | ||
1766 | { | ||
1767 | return FMOD5_Sound_GetFormat(this.handle, out type, out format, out channels, out bits); | ||
1768 | } | ||
1769 | public RESULT getNumSubSounds(out int numsubsounds) | ||
1770 | { | ||
1771 | return FMOD5_Sound_GetNumSubSounds(this.handle, out numsubsounds); | ||
1772 | } | ||
1773 | public RESULT getNumTags(out int numtags, out int numtagsupdated) | ||
1774 | { | ||
1775 | return FMOD5_Sound_GetNumTags(this.handle, out numtags, out numtagsupdated); | ||
1776 | } | ||
1777 | public RESULT getTag(string name, int index, out TAG tag) | ||
1778 | { | ||
1779 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1780 | { | ||
1781 | return FMOD5_Sound_GetTag(this.handle, encoder.byteFromStringUTF8(name), index, out tag); | ||
1782 | } | ||
1783 | } | ||
1784 | public RESULT getOpenState(out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy) | ||
1785 | { | ||
1786 | return FMOD5_Sound_GetOpenState(this.handle, out openstate, out percentbuffered, out starving, out diskbusy); | ||
1787 | } | ||
1788 | public RESULT readData(IntPtr buffer, uint length, out uint read) | ||
1789 | { | ||
1790 | return FMOD5_Sound_ReadData(this.handle, buffer, length, out read); | ||
1791 | } | ||
1792 | public RESULT seekData(uint pcm) | ||
1793 | { | ||
1794 | return FMOD5_Sound_SeekData(this.handle, pcm); | ||
1795 | } | ||
1796 | public RESULT setSoundGroup(SoundGroup soundgroup) | ||
1797 | { | ||
1798 | return FMOD5_Sound_SetSoundGroup(this.handle, soundgroup.handle); | ||
1799 | } | ||
1800 | public RESULT getSoundGroup(out SoundGroup soundgroup) | ||
1801 | { | ||
1802 | return FMOD5_Sound_GetSoundGroup(this.handle, out soundgroup.handle); | ||
1803 | } | ||
1804 | |||
1805 | // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks. | ||
1806 | public RESULT getNumSyncPoints(out int numsyncpoints) | ||
1807 | { | ||
1808 | return FMOD5_Sound_GetNumSyncPoints(this.handle, out numsyncpoints); | ||
1809 | } | ||
1810 | public RESULT getSyncPoint(int index, out IntPtr point) | ||
1811 | { | ||
1812 | return FMOD5_Sound_GetSyncPoint(this.handle, index, out point); | ||
1813 | } | ||
1814 | public RESULT getSyncPointInfo(IntPtr point, out string name, int namelen, out uint offset, TIMEUNIT offsettype) | ||
1815 | { | ||
1816 | IntPtr stringMem = Marshal.AllocHGlobal(namelen); | ||
1817 | |||
1818 | RESULT result = FMOD5_Sound_GetSyncPointInfo(this.handle, point, stringMem, namelen, out offset, offsettype); | ||
1819 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1820 | { | ||
1821 | name = encoder.stringFromNative(stringMem); | ||
1822 | } | ||
1823 | Marshal.FreeHGlobal(stringMem); | ||
1824 | |||
1825 | return result; | ||
1826 | } | ||
1827 | public RESULT getSyncPointInfo(IntPtr point, out uint offset, TIMEUNIT offsettype) | ||
1828 | { | ||
1829 | return FMOD5_Sound_GetSyncPointInfo(this.handle, point, IntPtr.Zero, 0, out offset, offsettype); | ||
1830 | } | ||
1831 | public RESULT addSyncPoint(uint offset, TIMEUNIT offsettype, string name, out IntPtr point) | ||
1832 | { | ||
1833 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1834 | { | ||
1835 | return FMOD5_Sound_AddSyncPoint(this.handle, offset, offsettype, encoder.byteFromStringUTF8(name), out point); | ||
1836 | } | ||
1837 | } | ||
1838 | public RESULT deleteSyncPoint(IntPtr point) | ||
1839 | { | ||
1840 | return FMOD5_Sound_DeleteSyncPoint(this.handle, point); | ||
1841 | } | ||
1842 | |||
1843 | // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time. | ||
1844 | public RESULT setMode(MODE mode) | ||
1845 | { | ||
1846 | return FMOD5_Sound_SetMode(this.handle, mode); | ||
1847 | } | ||
1848 | public RESULT getMode(out MODE mode) | ||
1849 | { | ||
1850 | return FMOD5_Sound_GetMode(this.handle, out mode); | ||
1851 | } | ||
1852 | public RESULT setLoopCount(int loopcount) | ||
1853 | { | ||
1854 | return FMOD5_Sound_SetLoopCount(this.handle, loopcount); | ||
1855 | } | ||
1856 | public RESULT getLoopCount(out int loopcount) | ||
1857 | { | ||
1858 | return FMOD5_Sound_GetLoopCount(this.handle, out loopcount); | ||
1859 | } | ||
1860 | public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) | ||
1861 | { | ||
1862 | return FMOD5_Sound_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); | ||
1863 | } | ||
1864 | public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) | ||
1865 | { | ||
1866 | return FMOD5_Sound_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); | ||
1867 | } | ||
1868 | |||
1869 | // For MOD/S3M/XM/IT/MID sequenced formats only. | ||
1870 | public RESULT getMusicNumChannels(out int numchannels) | ||
1871 | { | ||
1872 | return FMOD5_Sound_GetMusicNumChannels(this.handle, out numchannels); | ||
1873 | } | ||
1874 | public RESULT setMusicChannelVolume(int channel, float volume) | ||
1875 | { | ||
1876 | return FMOD5_Sound_SetMusicChannelVolume(this.handle, channel, volume); | ||
1877 | } | ||
1878 | public RESULT getMusicChannelVolume(int channel, out float volume) | ||
1879 | { | ||
1880 | return FMOD5_Sound_GetMusicChannelVolume(this.handle, channel, out volume); | ||
1881 | } | ||
1882 | public RESULT setMusicSpeed(float speed) | ||
1883 | { | ||
1884 | return FMOD5_Sound_SetMusicSpeed(this.handle, speed); | ||
1885 | } | ||
1886 | public RESULT getMusicSpeed(out float speed) | ||
1887 | { | ||
1888 | return FMOD5_Sound_GetMusicSpeed(this.handle, out speed); | ||
1889 | } | ||
1890 | |||
1891 | // Userdata set/get. | ||
1892 | public RESULT setUserData(IntPtr userdata) | ||
1893 | { | ||
1894 | return FMOD5_Sound_SetUserData(this.handle, userdata); | ||
1895 | } | ||
1896 | public RESULT getUserData(out IntPtr userdata) | ||
1897 | { | ||
1898 | return FMOD5_Sound_GetUserData(this.handle, out userdata); | ||
1899 | } | ||
1900 | |||
1901 | #region importfunctions | ||
1902 | [DllImport(VERSION.dll)] | ||
1903 | private static extern RESULT FMOD5_Sound_Release (IntPtr sound); | ||
1904 | [DllImport(VERSION.dll)] | ||
1905 | private static extern RESULT FMOD5_Sound_GetSystemObject (IntPtr sound, out IntPtr system); | ||
1906 | [DllImport(VERSION.dll)] | ||
1907 | 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); | ||
1908 | [DllImport(VERSION.dll)] | ||
1909 | private static extern RESULT FMOD5_Sound_Unlock (IntPtr sound, IntPtr ptr1, IntPtr ptr2, uint len1, uint len2); | ||
1910 | [DllImport(VERSION.dll)] | ||
1911 | private static extern RESULT FMOD5_Sound_SetDefaults (IntPtr sound, float frequency, int priority); | ||
1912 | [DllImport(VERSION.dll)] | ||
1913 | private static extern RESULT FMOD5_Sound_GetDefaults (IntPtr sound, out float frequency, out int priority); | ||
1914 | [DllImport(VERSION.dll)] | ||
1915 | private static extern RESULT FMOD5_Sound_Set3DMinMaxDistance (IntPtr sound, float min, float max); | ||
1916 | [DllImport(VERSION.dll)] | ||
1917 | private static extern RESULT FMOD5_Sound_Get3DMinMaxDistance (IntPtr sound, out float min, out float max); | ||
1918 | [DllImport(VERSION.dll)] | ||
1919 | private static extern RESULT FMOD5_Sound_Set3DConeSettings (IntPtr sound, float insideconeangle, float outsideconeangle, float outsidevolume); | ||
1920 | [DllImport(VERSION.dll)] | ||
1921 | private static extern RESULT FMOD5_Sound_Get3DConeSettings (IntPtr sound, out float insideconeangle, out float outsideconeangle, out float outsidevolume); | ||
1922 | [DllImport(VERSION.dll)] | ||
1923 | private static extern RESULT FMOD5_Sound_Set3DCustomRolloff (IntPtr sound, ref VECTOR points, int numpoints); | ||
1924 | [DllImport(VERSION.dll)] | ||
1925 | private static extern RESULT FMOD5_Sound_Get3DCustomRolloff (IntPtr sound, out IntPtr points, out int numpoints); | ||
1926 | [DllImport(VERSION.dll)] | ||
1927 | private static extern RESULT FMOD5_Sound_GetSubSound (IntPtr sound, int index, out IntPtr subsound); | ||
1928 | [DllImport(VERSION.dll)] | ||
1929 | private static extern RESULT FMOD5_Sound_GetSubSoundParent (IntPtr sound, out IntPtr parentsound); | ||
1930 | [DllImport(VERSION.dll)] | ||
1931 | private static extern RESULT FMOD5_Sound_GetName (IntPtr sound, IntPtr name, int namelen); | ||
1932 | [DllImport(VERSION.dll)] | ||
1933 | private static extern RESULT FMOD5_Sound_GetLength (IntPtr sound, out uint length, TIMEUNIT lengthtype); | ||
1934 | [DllImport(VERSION.dll)] | ||
1935 | private static extern RESULT FMOD5_Sound_GetFormat (IntPtr sound, out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits); | ||
1936 | [DllImport(VERSION.dll)] | ||
1937 | private static extern RESULT FMOD5_Sound_GetNumSubSounds (IntPtr sound, out int numsubsounds); | ||
1938 | [DllImport(VERSION.dll)] | ||
1939 | private static extern RESULT FMOD5_Sound_GetNumTags (IntPtr sound, out int numtags, out int numtagsupdated); | ||
1940 | [DllImport(VERSION.dll)] | ||
1941 | private static extern RESULT FMOD5_Sound_GetTag (IntPtr sound, byte[] name, int index, out TAG tag); | ||
1942 | [DllImport(VERSION.dll)] | ||
1943 | private static extern RESULT FMOD5_Sound_GetOpenState (IntPtr sound, out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy); | ||
1944 | [DllImport(VERSION.dll)] | ||
1945 | private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, IntPtr buffer, uint length, out uint read); | ||
1946 | [DllImport(VERSION.dll)] | ||
1947 | private static extern RESULT FMOD5_Sound_SeekData (IntPtr sound, uint pcm); | ||
1948 | [DllImport(VERSION.dll)] | ||
1949 | private static extern RESULT FMOD5_Sound_SetSoundGroup (IntPtr sound, IntPtr soundgroup); | ||
1950 | [DllImport(VERSION.dll)] | ||
1951 | private static extern RESULT FMOD5_Sound_GetSoundGroup (IntPtr sound, out IntPtr soundgroup); | ||
1952 | [DllImport(VERSION.dll)] | ||
1953 | private static extern RESULT FMOD5_Sound_GetNumSyncPoints (IntPtr sound, out int numsyncpoints); | ||
1954 | [DllImport(VERSION.dll)] | ||
1955 | private static extern RESULT FMOD5_Sound_GetSyncPoint (IntPtr sound, int index, out IntPtr point); | ||
1956 | [DllImport(VERSION.dll)] | ||
1957 | private static extern RESULT FMOD5_Sound_GetSyncPointInfo (IntPtr sound, IntPtr point, IntPtr name, int namelen, out uint offset, TIMEUNIT offsettype); | ||
1958 | [DllImport(VERSION.dll)] | ||
1959 | private static extern RESULT FMOD5_Sound_AddSyncPoint (IntPtr sound, uint offset, TIMEUNIT offsettype, byte[] name, out IntPtr point); | ||
1960 | [DllImport(VERSION.dll)] | ||
1961 | private static extern RESULT FMOD5_Sound_DeleteSyncPoint (IntPtr sound, IntPtr point); | ||
1962 | [DllImport(VERSION.dll)] | ||
1963 | private static extern RESULT FMOD5_Sound_SetMode (IntPtr sound, MODE mode); | ||
1964 | [DllImport(VERSION.dll)] | ||
1965 | private static extern RESULT FMOD5_Sound_GetMode (IntPtr sound, out MODE mode); | ||
1966 | [DllImport(VERSION.dll)] | ||
1967 | private static extern RESULT FMOD5_Sound_SetLoopCount (IntPtr sound, int loopcount); | ||
1968 | [DllImport(VERSION.dll)] | ||
1969 | private static extern RESULT FMOD5_Sound_GetLoopCount (IntPtr sound, out int loopcount); | ||
1970 | [DllImport(VERSION.dll)] | ||
1971 | private static extern RESULT FMOD5_Sound_SetLoopPoints (IntPtr sound, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); | ||
1972 | [DllImport(VERSION.dll)] | ||
1973 | private static extern RESULT FMOD5_Sound_GetLoopPoints (IntPtr sound, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); | ||
1974 | [DllImport(VERSION.dll)] | ||
1975 | private static extern RESULT FMOD5_Sound_GetMusicNumChannels (IntPtr sound, out int numchannels); | ||
1976 | [DllImport(VERSION.dll)] | ||
1977 | private static extern RESULT FMOD5_Sound_SetMusicChannelVolume (IntPtr sound, int channel, float volume); | ||
1978 | [DllImport(VERSION.dll)] | ||
1979 | private static extern RESULT FMOD5_Sound_GetMusicChannelVolume (IntPtr sound, int channel, out float volume); | ||
1980 | [DllImport(VERSION.dll)] | ||
1981 | private static extern RESULT FMOD5_Sound_SetMusicSpeed (IntPtr sound, float speed); | ||
1982 | [DllImport(VERSION.dll)] | ||
1983 | private static extern RESULT FMOD5_Sound_GetMusicSpeed (IntPtr sound, out float speed); | ||
1984 | [DllImport(VERSION.dll)] | ||
1985 | private static extern RESULT FMOD5_Sound_SetUserData (IntPtr sound, IntPtr userdata); | ||
1986 | [DllImport(VERSION.dll)] | ||
1987 | private static extern RESULT FMOD5_Sound_GetUserData (IntPtr sound, out IntPtr userdata); | ||
1988 | #endregion | ||
1989 | |||
1990 | #region wrapperinternal | ||
1991 | |||
1992 | public IntPtr handle; | ||
1993 | |||
1994 | public Sound(IntPtr ptr) { this.handle = ptr; } | ||
1995 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
1996 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
1997 | |||
1998 | #endregion | ||
1999 | } | ||
2000 | |||
2001 | /* | ||
2002 | 'ChannelControl' API | ||
2003 | */ | ||
2004 | interface IChannelControl | ||
2005 | { | ||
2006 | RESULT getSystemObject (out System system); | ||
2007 | |||
2008 | // General control functionality for Channels and ChannelGroups. | ||
2009 | RESULT stop (); | ||
2010 | RESULT setPaused (bool paused); | ||
2011 | RESULT getPaused (out bool paused); | ||
2012 | RESULT setVolume (float volume); | ||
2013 | RESULT getVolume (out float volume); | ||
2014 | RESULT setVolumeRamp (bool ramp); | ||
2015 | RESULT getVolumeRamp (out bool ramp); | ||
2016 | RESULT getAudibility (out float audibility); | ||
2017 | RESULT setPitch (float pitch); | ||
2018 | RESULT getPitch (out float pitch); | ||
2019 | RESULT setMute (bool mute); | ||
2020 | RESULT getMute (out bool mute); | ||
2021 | RESULT setReverbProperties (int instance, float wet); | ||
2022 | RESULT getReverbProperties (int instance, out float wet); | ||
2023 | RESULT setLowPassGain (float gain); | ||
2024 | RESULT getLowPassGain (out float gain); | ||
2025 | RESULT setMode (MODE mode); | ||
2026 | RESULT getMode (out MODE mode); | ||
2027 | RESULT setCallback (CHANNELCONTROL_CALLBACK callback); | ||
2028 | RESULT isPlaying (out bool isplaying); | ||
2029 | |||
2030 | // 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. | ||
2031 | RESULT setPan (float pan); | ||
2032 | RESULT setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); | ||
2033 | RESULT setMixLevelsInput (float[] levels, int numlevels); | ||
2034 | RESULT setMixMatrix (float[] matrix, int outchannels, int inchannels, int inchannel_hop); | ||
2035 | RESULT getMixMatrix (float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); | ||
2036 | |||
2037 | // Clock based functionality. | ||
2038 | RESULT getDSPClock (out ulong dspclock, out ulong parentclock); | ||
2039 | RESULT setDelay (ulong dspclock_start, ulong dspclock_end, bool stopchannels); | ||
2040 | RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end); | ||
2041 | RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); | ||
2042 | RESULT addFadePoint (ulong dspclock, float volume); | ||
2043 | RESULT setFadePointRamp (ulong dspclock, float volume); | ||
2044 | RESULT removeFadePoints (ulong dspclock_start, ulong dspclock_end); | ||
2045 | RESULT getFadePoints (ref uint numpoints, ulong[] point_dspclock, float[] point_volume); | ||
2046 | |||
2047 | // DSP effects. | ||
2048 | RESULT getDSP (int index, out DSP dsp); | ||
2049 | RESULT addDSP (int index, DSP dsp); | ||
2050 | RESULT removeDSP (DSP dsp); | ||
2051 | RESULT getNumDSPs (out int numdsps); | ||
2052 | RESULT setDSPIndex (DSP dsp, int index); | ||
2053 | RESULT getDSPIndex (DSP dsp, out int index); | ||
2054 | |||
2055 | // 3D functionality. | ||
2056 | RESULT set3DAttributes (ref VECTOR pos, ref VECTOR vel); | ||
2057 | RESULT get3DAttributes (out VECTOR pos, out VECTOR vel); | ||
2058 | RESULT set3DMinMaxDistance (float mindistance, float maxdistance); | ||
2059 | RESULT get3DMinMaxDistance (out float mindistance, out float maxdistance); | ||
2060 | RESULT set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume); | ||
2061 | RESULT get3DConeSettings (out float insideconeangle, out float outsideconeangle, out float outsidevolume); | ||
2062 | RESULT set3DConeOrientation (ref VECTOR orientation); | ||
2063 | RESULT get3DConeOrientation (out VECTOR orientation); | ||
2064 | RESULT set3DCustomRolloff (ref VECTOR points, int numpoints); | ||
2065 | RESULT get3DCustomRolloff (out IntPtr points, out int numpoints); | ||
2066 | RESULT set3DOcclusion (float directocclusion, float reverbocclusion); | ||
2067 | RESULT get3DOcclusion (out float directocclusion, out float reverbocclusion); | ||
2068 | RESULT set3DSpread (float angle); | ||
2069 | RESULT get3DSpread (out float angle); | ||
2070 | RESULT set3DLevel (float level); | ||
2071 | RESULT get3DLevel (out float level); | ||
2072 | RESULT set3DDopplerLevel (float level); | ||
2073 | RESULT get3DDopplerLevel (out float level); | ||
2074 | RESULT set3DDistanceFilter (bool custom, float customLevel, float centerFreq); | ||
2075 | RESULT get3DDistanceFilter (out bool custom, out float customLevel, out float centerFreq); | ||
2076 | |||
2077 | // Userdata set/get. | ||
2078 | RESULT setUserData (IntPtr userdata); | ||
2079 | RESULT getUserData (out IntPtr userdata); | ||
2080 | } | ||
2081 | |||
2082 | /* | ||
2083 | 'Channel' API | ||
2084 | */ | ||
2085 | public struct Channel : IChannelControl | ||
2086 | { | ||
2087 | // Channel specific control functionality. | ||
2088 | public RESULT setFrequency(float frequency) | ||
2089 | { | ||
2090 | return FMOD5_Channel_SetFrequency(this.handle, frequency); | ||
2091 | } | ||
2092 | public RESULT getFrequency(out float frequency) | ||
2093 | { | ||
2094 | return FMOD5_Channel_GetFrequency(this.handle, out frequency); | ||
2095 | } | ||
2096 | public RESULT setPriority(int priority) | ||
2097 | { | ||
2098 | return FMOD5_Channel_SetPriority(this.handle, priority); | ||
2099 | } | ||
2100 | public RESULT getPriority(out int priority) | ||
2101 | { | ||
2102 | return FMOD5_Channel_GetPriority(this.handle, out priority); | ||
2103 | } | ||
2104 | public RESULT setPosition(uint position, TIMEUNIT postype) | ||
2105 | { | ||
2106 | return FMOD5_Channel_SetPosition(this.handle, position, postype); | ||
2107 | } | ||
2108 | public RESULT getPosition(out uint position, TIMEUNIT postype) | ||
2109 | { | ||
2110 | return FMOD5_Channel_GetPosition(this.handle, out position, postype); | ||
2111 | } | ||
2112 | public RESULT setChannelGroup(ChannelGroup channelgroup) | ||
2113 | { | ||
2114 | return FMOD5_Channel_SetChannelGroup(this.handle, channelgroup.handle); | ||
2115 | } | ||
2116 | public RESULT getChannelGroup(out ChannelGroup channelgroup) | ||
2117 | { | ||
2118 | return FMOD5_Channel_GetChannelGroup(this.handle, out channelgroup.handle); | ||
2119 | } | ||
2120 | public RESULT setLoopCount(int loopcount) | ||
2121 | { | ||
2122 | return FMOD5_Channel_SetLoopCount(this.handle, loopcount); | ||
2123 | } | ||
2124 | public RESULT getLoopCount(out int loopcount) | ||
2125 | { | ||
2126 | return FMOD5_Channel_GetLoopCount(this.handle, out loopcount); | ||
2127 | } | ||
2128 | public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) | ||
2129 | { | ||
2130 | return FMOD5_Channel_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); | ||
2131 | } | ||
2132 | public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) | ||
2133 | { | ||
2134 | return FMOD5_Channel_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); | ||
2135 | } | ||
2136 | |||
2137 | // Information only functions. | ||
2138 | public RESULT isVirtual(out bool isvirtual) | ||
2139 | { | ||
2140 | return FMOD5_Channel_IsVirtual(this.handle, out isvirtual); | ||
2141 | } | ||
2142 | public RESULT getCurrentSound(out Sound sound) | ||
2143 | { | ||
2144 | return FMOD5_Channel_GetCurrentSound(this.handle, out sound.handle); | ||
2145 | } | ||
2146 | public RESULT getIndex(out int index) | ||
2147 | { | ||
2148 | return FMOD5_Channel_GetIndex(this.handle, out index); | ||
2149 | } | ||
2150 | |||
2151 | public RESULT getSystemObject(out System system) | ||
2152 | { | ||
2153 | return FMOD5_Channel_GetSystemObject(this.handle, out system.handle); | ||
2154 | } | ||
2155 | |||
2156 | // General control functionality for Channels and ChannelGroups. | ||
2157 | public RESULT stop() | ||
2158 | { | ||
2159 | return FMOD5_Channel_Stop(this.handle); | ||
2160 | } | ||
2161 | public RESULT setPaused(bool paused) | ||
2162 | { | ||
2163 | return FMOD5_Channel_SetPaused(this.handle, paused); | ||
2164 | } | ||
2165 | public RESULT getPaused(out bool paused) | ||
2166 | { | ||
2167 | return FMOD5_Channel_GetPaused(this.handle, out paused); | ||
2168 | } | ||
2169 | public RESULT setVolume(float volume) | ||
2170 | { | ||
2171 | return FMOD5_Channel_SetVolume(this.handle, volume); | ||
2172 | } | ||
2173 | public RESULT getVolume(out float volume) | ||
2174 | { | ||
2175 | return FMOD5_Channel_GetVolume(this.handle, out volume); | ||
2176 | } | ||
2177 | public RESULT setVolumeRamp(bool ramp) | ||
2178 | { | ||
2179 | return FMOD5_Channel_SetVolumeRamp(this.handle, ramp); | ||
2180 | } | ||
2181 | public RESULT getVolumeRamp(out bool ramp) | ||
2182 | { | ||
2183 | return FMOD5_Channel_GetVolumeRamp(this.handle, out ramp); | ||
2184 | } | ||
2185 | public RESULT getAudibility(out float audibility) | ||
2186 | { | ||
2187 | return FMOD5_Channel_GetAudibility(this.handle, out audibility); | ||
2188 | } | ||
2189 | public RESULT setPitch(float pitch) | ||
2190 | { | ||
2191 | return FMOD5_Channel_SetPitch(this.handle, pitch); | ||
2192 | } | ||
2193 | public RESULT getPitch(out float pitch) | ||
2194 | { | ||
2195 | return FMOD5_Channel_GetPitch(this.handle, out pitch); | ||
2196 | } | ||
2197 | public RESULT setMute(bool mute) | ||
2198 | { | ||
2199 | return FMOD5_Channel_SetMute(this.handle, mute); | ||
2200 | } | ||
2201 | public RESULT getMute(out bool mute) | ||
2202 | { | ||
2203 | return FMOD5_Channel_GetMute(this.handle, out mute); | ||
2204 | } | ||
2205 | public RESULT setReverbProperties(int instance, float wet) | ||
2206 | { | ||
2207 | return FMOD5_Channel_SetReverbProperties(this.handle, instance, wet); | ||
2208 | } | ||
2209 | public RESULT getReverbProperties(int instance, out float wet) | ||
2210 | { | ||
2211 | return FMOD5_Channel_GetReverbProperties(this.handle, instance, out wet); | ||
2212 | } | ||
2213 | public RESULT setLowPassGain(float gain) | ||
2214 | { | ||
2215 | return FMOD5_Channel_SetLowPassGain(this.handle, gain); | ||
2216 | } | ||
2217 | public RESULT getLowPassGain(out float gain) | ||
2218 | { | ||
2219 | return FMOD5_Channel_GetLowPassGain(this.handle, out gain); | ||
2220 | } | ||
2221 | public RESULT setMode(MODE mode) | ||
2222 | { | ||
2223 | return FMOD5_Channel_SetMode(this.handle, mode); | ||
2224 | } | ||
2225 | public RESULT getMode(out MODE mode) | ||
2226 | { | ||
2227 | return FMOD5_Channel_GetMode(this.handle, out mode); | ||
2228 | } | ||
2229 | public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) | ||
2230 | { | ||
2231 | return FMOD5_Channel_SetCallback(this.handle, callback); | ||
2232 | } | ||
2233 | public RESULT isPlaying(out bool isplaying) | ||
2234 | { | ||
2235 | return FMOD5_Channel_IsPlaying(this.handle, out isplaying); | ||
2236 | } | ||
2237 | |||
2238 | // 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. | ||
2239 | public RESULT setPan(float pan) | ||
2240 | { | ||
2241 | return FMOD5_Channel_SetPan(this.handle, pan); | ||
2242 | } | ||
2243 | public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) | ||
2244 | { | ||
2245 | return FMOD5_Channel_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); | ||
2246 | } | ||
2247 | public RESULT setMixLevelsInput(float[] levels, int numlevels) | ||
2248 | { | ||
2249 | return FMOD5_Channel_SetMixLevelsInput(this.handle, levels, numlevels); | ||
2250 | } | ||
2251 | public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) | ||
2252 | { | ||
2253 | return FMOD5_Channel_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); | ||
2254 | } | ||
2255 | public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) | ||
2256 | { | ||
2257 | return FMOD5_Channel_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); | ||
2258 | } | ||
2259 | |||
2260 | // Clock based functionality. | ||
2261 | public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) | ||
2262 | { | ||
2263 | return FMOD5_Channel_GetDSPClock(this.handle, out dspclock, out parentclock); | ||
2264 | } | ||
2265 | public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels = true) | ||
2266 | { | ||
2267 | return FMOD5_Channel_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); | ||
2268 | } | ||
2269 | public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) | ||
2270 | { | ||
2271 | return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); | ||
2272 | } | ||
2273 | public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) | ||
2274 | { | ||
2275 | return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); | ||
2276 | } | ||
2277 | public RESULT addFadePoint(ulong dspclock, float volume) | ||
2278 | { | ||
2279 | return FMOD5_Channel_AddFadePoint(this.handle, dspclock, volume); | ||
2280 | } | ||
2281 | public RESULT setFadePointRamp(ulong dspclock, float volume) | ||
2282 | { | ||
2283 | return FMOD5_Channel_SetFadePointRamp(this.handle, dspclock, volume); | ||
2284 | } | ||
2285 | public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) | ||
2286 | { | ||
2287 | return FMOD5_Channel_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); | ||
2288 | } | ||
2289 | public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) | ||
2290 | { | ||
2291 | return FMOD5_Channel_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); | ||
2292 | } | ||
2293 | |||
2294 | // DSP effects. | ||
2295 | public RESULT getDSP(int index, out DSP dsp) | ||
2296 | { | ||
2297 | return FMOD5_Channel_GetDSP(this.handle, index, out dsp.handle); | ||
2298 | } | ||
2299 | public RESULT addDSP(int index, DSP dsp) | ||
2300 | { | ||
2301 | return FMOD5_Channel_AddDSP(this.handle, index, dsp.handle); | ||
2302 | } | ||
2303 | public RESULT removeDSP(DSP dsp) | ||
2304 | { | ||
2305 | return FMOD5_Channel_RemoveDSP(this.handle, dsp.handle); | ||
2306 | } | ||
2307 | public RESULT getNumDSPs(out int numdsps) | ||
2308 | { | ||
2309 | return FMOD5_Channel_GetNumDSPs(this.handle, out numdsps); | ||
2310 | } | ||
2311 | public RESULT setDSPIndex(DSP dsp, int index) | ||
2312 | { | ||
2313 | return FMOD5_Channel_SetDSPIndex(this.handle, dsp.handle, index); | ||
2314 | } | ||
2315 | public RESULT getDSPIndex(DSP dsp, out int index) | ||
2316 | { | ||
2317 | return FMOD5_Channel_GetDSPIndex(this.handle, dsp.handle, out index); | ||
2318 | } | ||
2319 | |||
2320 | // 3D functionality. | ||
2321 | public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) | ||
2322 | { | ||
2323 | return FMOD5_Channel_Set3DAttributes(this.handle, ref pos, ref vel); | ||
2324 | } | ||
2325 | public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) | ||
2326 | { | ||
2327 | return FMOD5_Channel_Get3DAttributes(this.handle, out pos, out vel); | ||
2328 | } | ||
2329 | public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) | ||
2330 | { | ||
2331 | return FMOD5_Channel_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); | ||
2332 | } | ||
2333 | public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) | ||
2334 | { | ||
2335 | return FMOD5_Channel_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); | ||
2336 | } | ||
2337 | public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) | ||
2338 | { | ||
2339 | return FMOD5_Channel_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); | ||
2340 | } | ||
2341 | public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) | ||
2342 | { | ||
2343 | return FMOD5_Channel_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); | ||
2344 | } | ||
2345 | public RESULT set3DConeOrientation(ref VECTOR orientation) | ||
2346 | { | ||
2347 | return FMOD5_Channel_Set3DConeOrientation(this.handle, ref orientation); | ||
2348 | } | ||
2349 | public RESULT get3DConeOrientation(out VECTOR orientation) | ||
2350 | { | ||
2351 | return FMOD5_Channel_Get3DConeOrientation(this.handle, out orientation); | ||
2352 | } | ||
2353 | public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) | ||
2354 | { | ||
2355 | return FMOD5_Channel_Set3DCustomRolloff(this.handle, ref points, numpoints); | ||
2356 | } | ||
2357 | public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) | ||
2358 | { | ||
2359 | return FMOD5_Channel_Get3DCustomRolloff(this.handle, out points, out numpoints); | ||
2360 | } | ||
2361 | public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) | ||
2362 | { | ||
2363 | return FMOD5_Channel_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); | ||
2364 | } | ||
2365 | public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) | ||
2366 | { | ||
2367 | return FMOD5_Channel_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); | ||
2368 | } | ||
2369 | public RESULT set3DSpread(float angle) | ||
2370 | { | ||
2371 | return FMOD5_Channel_Set3DSpread(this.handle, angle); | ||
2372 | } | ||
2373 | public RESULT get3DSpread(out float angle) | ||
2374 | { | ||
2375 | return FMOD5_Channel_Get3DSpread(this.handle, out angle); | ||
2376 | } | ||
2377 | public RESULT set3DLevel(float level) | ||
2378 | { | ||
2379 | return FMOD5_Channel_Set3DLevel(this.handle, level); | ||
2380 | } | ||
2381 | public RESULT get3DLevel(out float level) | ||
2382 | { | ||
2383 | return FMOD5_Channel_Get3DLevel(this.handle, out level); | ||
2384 | } | ||
2385 | public RESULT set3DDopplerLevel(float level) | ||
2386 | { | ||
2387 | return FMOD5_Channel_Set3DDopplerLevel(this.handle, level); | ||
2388 | } | ||
2389 | public RESULT get3DDopplerLevel(out float level) | ||
2390 | { | ||
2391 | return FMOD5_Channel_Get3DDopplerLevel(this.handle, out level); | ||
2392 | } | ||
2393 | public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) | ||
2394 | { | ||
2395 | return FMOD5_Channel_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); | ||
2396 | } | ||
2397 | public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) | ||
2398 | { | ||
2399 | return FMOD5_Channel_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); | ||
2400 | } | ||
2401 | |||
2402 | // Userdata set/get. | ||
2403 | public RESULT setUserData(IntPtr userdata) | ||
2404 | { | ||
2405 | return FMOD5_Channel_SetUserData(this.handle, userdata); | ||
2406 | } | ||
2407 | public RESULT getUserData(out IntPtr userdata) | ||
2408 | { | ||
2409 | return FMOD5_Channel_GetUserData(this.handle, out userdata); | ||
2410 | } | ||
2411 | |||
2412 | #region importfunctions | ||
2413 | [DllImport(VERSION.dll)] | ||
2414 | private static extern RESULT FMOD5_Channel_SetFrequency (IntPtr channel, float frequency); | ||
2415 | [DllImport(VERSION.dll)] | ||
2416 | private static extern RESULT FMOD5_Channel_GetFrequency (IntPtr channel, out float frequency); | ||
2417 | [DllImport(VERSION.dll)] | ||
2418 | private static extern RESULT FMOD5_Channel_SetPriority (IntPtr channel, int priority); | ||
2419 | [DllImport(VERSION.dll)] | ||
2420 | private static extern RESULT FMOD5_Channel_GetPriority (IntPtr channel, out int priority); | ||
2421 | [DllImport(VERSION.dll)] | ||
2422 | private static extern RESULT FMOD5_Channel_SetPosition (IntPtr channel, uint position, TIMEUNIT postype); | ||
2423 | [DllImport(VERSION.dll)] | ||
2424 | private static extern RESULT FMOD5_Channel_GetPosition (IntPtr channel, out uint position, TIMEUNIT postype); | ||
2425 | [DllImport(VERSION.dll)] | ||
2426 | private static extern RESULT FMOD5_Channel_SetChannelGroup (IntPtr channel, IntPtr channelgroup); | ||
2427 | [DllImport(VERSION.dll)] | ||
2428 | private static extern RESULT FMOD5_Channel_GetChannelGroup (IntPtr channel, out IntPtr channelgroup); | ||
2429 | [DllImport(VERSION.dll)] | ||
2430 | private static extern RESULT FMOD5_Channel_SetLoopCount (IntPtr channel, int loopcount); | ||
2431 | [DllImport(VERSION.dll)] | ||
2432 | private static extern RESULT FMOD5_Channel_GetLoopCount (IntPtr channel, out int loopcount); | ||
2433 | [DllImport(VERSION.dll)] | ||
2434 | private static extern RESULT FMOD5_Channel_SetLoopPoints (IntPtr channel, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); | ||
2435 | [DllImport(VERSION.dll)] | ||
2436 | private static extern RESULT FMOD5_Channel_GetLoopPoints (IntPtr channel, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); | ||
2437 | [DllImport(VERSION.dll)] | ||
2438 | private static extern RESULT FMOD5_Channel_IsVirtual (IntPtr channel, out bool isvirtual); | ||
2439 | [DllImport(VERSION.dll)] | ||
2440 | private static extern RESULT FMOD5_Channel_GetCurrentSound (IntPtr channel, out IntPtr sound); | ||
2441 | [DllImport(VERSION.dll)] | ||
2442 | private static extern RESULT FMOD5_Channel_GetIndex (IntPtr channel, out int index); | ||
2443 | [DllImport(VERSION.dll)] | ||
2444 | private static extern RESULT FMOD5_Channel_GetSystemObject (IntPtr channel, out IntPtr system); | ||
2445 | [DllImport(VERSION.dll)] | ||
2446 | private static extern RESULT FMOD5_Channel_Stop (IntPtr channel); | ||
2447 | [DllImport(VERSION.dll)] | ||
2448 | private static extern RESULT FMOD5_Channel_SetPaused (IntPtr channel, bool paused); | ||
2449 | [DllImport(VERSION.dll)] | ||
2450 | private static extern RESULT FMOD5_Channel_GetPaused (IntPtr channel, out bool paused); | ||
2451 | [DllImport(VERSION.dll)] | ||
2452 | private static extern RESULT FMOD5_Channel_SetVolume (IntPtr channel, float volume); | ||
2453 | [DllImport(VERSION.dll)] | ||
2454 | private static extern RESULT FMOD5_Channel_GetVolume (IntPtr channel, out float volume); | ||
2455 | [DllImport(VERSION.dll)] | ||
2456 | private static extern RESULT FMOD5_Channel_SetVolumeRamp (IntPtr channel, bool ramp); | ||
2457 | [DllImport(VERSION.dll)] | ||
2458 | private static extern RESULT FMOD5_Channel_GetVolumeRamp (IntPtr channel, out bool ramp); | ||
2459 | [DllImport(VERSION.dll)] | ||
2460 | private static extern RESULT FMOD5_Channel_GetAudibility (IntPtr channel, out float audibility); | ||
2461 | [DllImport(VERSION.dll)] | ||
2462 | private static extern RESULT FMOD5_Channel_SetPitch (IntPtr channel, float pitch); | ||
2463 | [DllImport(VERSION.dll)] | ||
2464 | private static extern RESULT FMOD5_Channel_GetPitch (IntPtr channel, out float pitch); | ||
2465 | [DllImport(VERSION.dll)] | ||
2466 | private static extern RESULT FMOD5_Channel_SetMute (IntPtr channel, bool mute); | ||
2467 | [DllImport(VERSION.dll)] | ||
2468 | private static extern RESULT FMOD5_Channel_GetMute (IntPtr channel, out bool mute); | ||
2469 | [DllImport(VERSION.dll)] | ||
2470 | private static extern RESULT FMOD5_Channel_SetReverbProperties (IntPtr channel, int instance, float wet); | ||
2471 | [DllImport(VERSION.dll)] | ||
2472 | private static extern RESULT FMOD5_Channel_GetReverbProperties (IntPtr channel, int instance, out float wet); | ||
2473 | [DllImport(VERSION.dll)] | ||
2474 | private static extern RESULT FMOD5_Channel_SetLowPassGain (IntPtr channel, float gain); | ||
2475 | [DllImport(VERSION.dll)] | ||
2476 | private static extern RESULT FMOD5_Channel_GetLowPassGain (IntPtr channel, out float gain); | ||
2477 | [DllImport(VERSION.dll)] | ||
2478 | private static extern RESULT FMOD5_Channel_SetMode (IntPtr channel, MODE mode); | ||
2479 | [DllImport(VERSION.dll)] | ||
2480 | private static extern RESULT FMOD5_Channel_GetMode (IntPtr channel, out MODE mode); | ||
2481 | [DllImport(VERSION.dll)] | ||
2482 | private static extern RESULT FMOD5_Channel_SetCallback (IntPtr channel, CHANNELCONTROL_CALLBACK callback); | ||
2483 | [DllImport(VERSION.dll)] | ||
2484 | private static extern RESULT FMOD5_Channel_IsPlaying (IntPtr channel, out bool isplaying); | ||
2485 | [DllImport(VERSION.dll)] | ||
2486 | private static extern RESULT FMOD5_Channel_SetPan (IntPtr channel, float pan); | ||
2487 | [DllImport(VERSION.dll)] | ||
2488 | 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); | ||
2489 | [DllImport(VERSION.dll)] | ||
2490 | private static extern RESULT FMOD5_Channel_SetMixLevelsInput (IntPtr channel, float[] levels, int numlevels); | ||
2491 | [DllImport(VERSION.dll)] | ||
2492 | private static extern RESULT FMOD5_Channel_SetMixMatrix (IntPtr channel, float[] matrix, int outchannels, int inchannels, int inchannel_hop); | ||
2493 | [DllImport(VERSION.dll)] | ||
2494 | private static extern RESULT FMOD5_Channel_GetMixMatrix (IntPtr channel, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); | ||
2495 | [DllImport(VERSION.dll)] | ||
2496 | private static extern RESULT FMOD5_Channel_GetDSPClock (IntPtr channel, out ulong dspclock, out ulong parentclock); | ||
2497 | [DllImport(VERSION.dll)] | ||
2498 | private static extern RESULT FMOD5_Channel_SetDelay (IntPtr channel, ulong dspclock_start, ulong dspclock_end, bool stopchannels); | ||
2499 | [DllImport(VERSION.dll)] | ||
2500 | private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); | ||
2501 | [DllImport(VERSION.dll)] | ||
2502 | private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); | ||
2503 | [DllImport(VERSION.dll)] | ||
2504 | private static extern RESULT FMOD5_Channel_AddFadePoint (IntPtr channel, ulong dspclock, float volume); | ||
2505 | [DllImport(VERSION.dll)] | ||
2506 | private static extern RESULT FMOD5_Channel_SetFadePointRamp (IntPtr channel, ulong dspclock, float volume); | ||
2507 | [DllImport(VERSION.dll)] | ||
2508 | private static extern RESULT FMOD5_Channel_RemoveFadePoints (IntPtr channel, ulong dspclock_start, ulong dspclock_end); | ||
2509 | [DllImport(VERSION.dll)] | ||
2510 | private static extern RESULT FMOD5_Channel_GetFadePoints (IntPtr channel, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); | ||
2511 | [DllImport(VERSION.dll)] | ||
2512 | private static extern RESULT FMOD5_Channel_GetDSP (IntPtr channel, int index, out IntPtr dsp); | ||
2513 | [DllImport(VERSION.dll)] | ||
2514 | private static extern RESULT FMOD5_Channel_AddDSP (IntPtr channel, int index, IntPtr dsp); | ||
2515 | [DllImport(VERSION.dll)] | ||
2516 | private static extern RESULT FMOD5_Channel_RemoveDSP (IntPtr channel, IntPtr dsp); | ||
2517 | [DllImport(VERSION.dll)] | ||
2518 | private static extern RESULT FMOD5_Channel_GetNumDSPs (IntPtr channel, out int numdsps); | ||
2519 | [DllImport(VERSION.dll)] | ||
2520 | private static extern RESULT FMOD5_Channel_SetDSPIndex (IntPtr channel, IntPtr dsp, int index); | ||
2521 | [DllImport(VERSION.dll)] | ||
2522 | private static extern RESULT FMOD5_Channel_GetDSPIndex (IntPtr channel, IntPtr dsp, out int index); | ||
2523 | [DllImport(VERSION.dll)] | ||
2524 | private static extern RESULT FMOD5_Channel_Set3DAttributes (IntPtr channel, ref VECTOR pos, ref VECTOR vel); | ||
2525 | [DllImport(VERSION.dll)] | ||
2526 | private static extern RESULT FMOD5_Channel_Get3DAttributes (IntPtr channel, out VECTOR pos, out VECTOR vel); | ||
2527 | [DllImport(VERSION.dll)] | ||
2528 | private static extern RESULT FMOD5_Channel_Set3DMinMaxDistance (IntPtr channel, float mindistance, float maxdistance); | ||
2529 | [DllImport(VERSION.dll)] | ||
2530 | private static extern RESULT FMOD5_Channel_Get3DMinMaxDistance (IntPtr channel, out float mindistance, out float maxdistance); | ||
2531 | [DllImport(VERSION.dll)] | ||
2532 | private static extern RESULT FMOD5_Channel_Set3DConeSettings (IntPtr channel, float insideconeangle, float outsideconeangle, float outsidevolume); | ||
2533 | [DllImport(VERSION.dll)] | ||
2534 | private static extern RESULT FMOD5_Channel_Get3DConeSettings (IntPtr channel, out float insideconeangle, out float outsideconeangle, out float outsidevolume); | ||
2535 | [DllImport(VERSION.dll)] | ||
2536 | private static extern RESULT FMOD5_Channel_Set3DConeOrientation (IntPtr channel, ref VECTOR orientation); | ||
2537 | [DllImport(VERSION.dll)] | ||
2538 | private static extern RESULT FMOD5_Channel_Get3DConeOrientation (IntPtr channel, out VECTOR orientation); | ||
2539 | [DllImport(VERSION.dll)] | ||
2540 | private static extern RESULT FMOD5_Channel_Set3DCustomRolloff (IntPtr channel, ref VECTOR points, int numpoints); | ||
2541 | [DllImport(VERSION.dll)] | ||
2542 | private static extern RESULT FMOD5_Channel_Get3DCustomRolloff (IntPtr channel, out IntPtr points, out int numpoints); | ||
2543 | [DllImport(VERSION.dll)] | ||
2544 | private static extern RESULT FMOD5_Channel_Set3DOcclusion (IntPtr channel, float directocclusion, float reverbocclusion); | ||
2545 | [DllImport(VERSION.dll)] | ||
2546 | private static extern RESULT FMOD5_Channel_Get3DOcclusion (IntPtr channel, out float directocclusion, out float reverbocclusion); | ||
2547 | [DllImport(VERSION.dll)] | ||
2548 | private static extern RESULT FMOD5_Channel_Set3DSpread (IntPtr channel, float angle); | ||
2549 | [DllImport(VERSION.dll)] | ||
2550 | private static extern RESULT FMOD5_Channel_Get3DSpread (IntPtr channel, out float angle); | ||
2551 | [DllImport(VERSION.dll)] | ||
2552 | private static extern RESULT FMOD5_Channel_Set3DLevel (IntPtr channel, float level); | ||
2553 | [DllImport(VERSION.dll)] | ||
2554 | private static extern RESULT FMOD5_Channel_Get3DLevel (IntPtr channel, out float level); | ||
2555 | [DllImport(VERSION.dll)] | ||
2556 | private static extern RESULT FMOD5_Channel_Set3DDopplerLevel (IntPtr channel, float level); | ||
2557 | [DllImport(VERSION.dll)] | ||
2558 | private static extern RESULT FMOD5_Channel_Get3DDopplerLevel (IntPtr channel, out float level); | ||
2559 | [DllImport(VERSION.dll)] | ||
2560 | private static extern RESULT FMOD5_Channel_Set3DDistanceFilter (IntPtr channel, bool custom, float customLevel, float centerFreq); | ||
2561 | [DllImport(VERSION.dll)] | ||
2562 | private static extern RESULT FMOD5_Channel_Get3DDistanceFilter (IntPtr channel, out bool custom, out float customLevel, out float centerFreq); | ||
2563 | [DllImport(VERSION.dll)] | ||
2564 | private static extern RESULT FMOD5_Channel_SetUserData (IntPtr channel, IntPtr userdata); | ||
2565 | [DllImport(VERSION.dll)] | ||
2566 | private static extern RESULT FMOD5_Channel_GetUserData (IntPtr channel, out IntPtr userdata); | ||
2567 | #endregion | ||
2568 | |||
2569 | #region wrapperinternal | ||
2570 | |||
2571 | public IntPtr handle; | ||
2572 | |||
2573 | public Channel(IntPtr ptr) { this.handle = ptr; } | ||
2574 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
2575 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
2576 | |||
2577 | #endregion | ||
2578 | } | ||
2579 | |||
2580 | /* | ||
2581 | 'ChannelGroup' API | ||
2582 | */ | ||
2583 | public struct ChannelGroup : IChannelControl | ||
2584 | { | ||
2585 | public RESULT release() | ||
2586 | { | ||
2587 | return FMOD5_ChannelGroup_Release(this.handle); | ||
2588 | } | ||
2589 | |||
2590 | // Nested channel groups. | ||
2591 | public RESULT addGroup(ChannelGroup group, bool propagatedspclock = true) | ||
2592 | { | ||
2593 | return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, IntPtr.Zero); | ||
2594 | } | ||
2595 | public RESULT addGroup(ChannelGroup group, bool propagatedspclock, out DSPConnection connection) | ||
2596 | { | ||
2597 | return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, out connection.handle); | ||
2598 | } | ||
2599 | public RESULT getNumGroups(out int numgroups) | ||
2600 | { | ||
2601 | return FMOD5_ChannelGroup_GetNumGroups(this.handle, out numgroups); | ||
2602 | } | ||
2603 | public RESULT getGroup(int index, out ChannelGroup group) | ||
2604 | { | ||
2605 | return FMOD5_ChannelGroup_GetGroup(this.handle, index, out group.handle); | ||
2606 | } | ||
2607 | public RESULT getParentGroup(out ChannelGroup group) | ||
2608 | { | ||
2609 | return FMOD5_ChannelGroup_GetParentGroup(this.handle, out group.handle); | ||
2610 | } | ||
2611 | |||
2612 | // Information only functions. | ||
2613 | public RESULT getName(out string name, int namelen) | ||
2614 | { | ||
2615 | IntPtr stringMem = Marshal.AllocHGlobal(namelen); | ||
2616 | |||
2617 | RESULT result = FMOD5_ChannelGroup_GetName(this.handle, stringMem, namelen); | ||
2618 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
2619 | { | ||
2620 | name = encoder.stringFromNative(stringMem); | ||
2621 | } | ||
2622 | Marshal.FreeHGlobal(stringMem); | ||
2623 | |||
2624 | return result; | ||
2625 | } | ||
2626 | public RESULT getNumChannels(out int numchannels) | ||
2627 | { | ||
2628 | return FMOD5_ChannelGroup_GetNumChannels(this.handle, out numchannels); | ||
2629 | } | ||
2630 | public RESULT getChannel(int index, out Channel channel) | ||
2631 | { | ||
2632 | return FMOD5_ChannelGroup_GetChannel(this.handle, index, out channel.handle); | ||
2633 | } | ||
2634 | |||
2635 | public RESULT getSystemObject(out System system) | ||
2636 | { | ||
2637 | return FMOD5_ChannelGroup_GetSystemObject(this.handle, out system.handle); | ||
2638 | } | ||
2639 | |||
2640 | // General control functionality for Channels and ChannelGroups. | ||
2641 | public RESULT stop() | ||
2642 | { | ||
2643 | return FMOD5_ChannelGroup_Stop(this.handle); | ||
2644 | } | ||
2645 | public RESULT setPaused(bool paused) | ||
2646 | { | ||
2647 | return FMOD5_ChannelGroup_SetPaused(this.handle, paused); | ||
2648 | } | ||
2649 | public RESULT getPaused(out bool paused) | ||
2650 | { | ||
2651 | return FMOD5_ChannelGroup_GetPaused(this.handle, out paused); | ||
2652 | } | ||
2653 | public RESULT setVolume(float volume) | ||
2654 | { | ||
2655 | return FMOD5_ChannelGroup_SetVolume(this.handle, volume); | ||
2656 | } | ||
2657 | public RESULT getVolume(out float volume) | ||
2658 | { | ||
2659 | return FMOD5_ChannelGroup_GetVolume(this.handle, out volume); | ||
2660 | } | ||
2661 | public RESULT setVolumeRamp(bool ramp) | ||
2662 | { | ||
2663 | return FMOD5_ChannelGroup_SetVolumeRamp(this.handle, ramp); | ||
2664 | } | ||
2665 | public RESULT getVolumeRamp(out bool ramp) | ||
2666 | { | ||
2667 | return FMOD5_ChannelGroup_GetVolumeRamp(this.handle, out ramp); | ||
2668 | } | ||
2669 | public RESULT getAudibility(out float audibility) | ||
2670 | { | ||
2671 | return FMOD5_ChannelGroup_GetAudibility(this.handle, out audibility); | ||
2672 | } | ||
2673 | public RESULT setPitch(float pitch) | ||
2674 | { | ||
2675 | return FMOD5_ChannelGroup_SetPitch(this.handle, pitch); | ||
2676 | } | ||
2677 | public RESULT getPitch(out float pitch) | ||
2678 | { | ||
2679 | return FMOD5_ChannelGroup_GetPitch(this.handle, out pitch); | ||
2680 | } | ||
2681 | public RESULT setMute(bool mute) | ||
2682 | { | ||
2683 | return FMOD5_ChannelGroup_SetMute(this.handle, mute); | ||
2684 | } | ||
2685 | public RESULT getMute(out bool mute) | ||
2686 | { | ||
2687 | return FMOD5_ChannelGroup_GetMute(this.handle, out mute); | ||
2688 | } | ||
2689 | public RESULT setReverbProperties(int instance, float wet) | ||
2690 | { | ||
2691 | return FMOD5_ChannelGroup_SetReverbProperties(this.handle, instance, wet); | ||
2692 | } | ||
2693 | public RESULT getReverbProperties(int instance, out float wet) | ||
2694 | { | ||
2695 | return FMOD5_ChannelGroup_GetReverbProperties(this.handle, instance, out wet); | ||
2696 | } | ||
2697 | public RESULT setLowPassGain(float gain) | ||
2698 | { | ||
2699 | return FMOD5_ChannelGroup_SetLowPassGain(this.handle, gain); | ||
2700 | } | ||
2701 | public RESULT getLowPassGain(out float gain) | ||
2702 | { | ||
2703 | return FMOD5_ChannelGroup_GetLowPassGain(this.handle, out gain); | ||
2704 | } | ||
2705 | public RESULT setMode(MODE mode) | ||
2706 | { | ||
2707 | return FMOD5_ChannelGroup_SetMode(this.handle, mode); | ||
2708 | } | ||
2709 | public RESULT getMode(out MODE mode) | ||
2710 | { | ||
2711 | return FMOD5_ChannelGroup_GetMode(this.handle, out mode); | ||
2712 | } | ||
2713 | public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) | ||
2714 | { | ||
2715 | return FMOD5_ChannelGroup_SetCallback(this.handle, callback); | ||
2716 | } | ||
2717 | public RESULT isPlaying(out bool isplaying) | ||
2718 | { | ||
2719 | return FMOD5_ChannelGroup_IsPlaying(this.handle, out isplaying); | ||
2720 | } | ||
2721 | |||
2722 | // 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. | ||
2723 | public RESULT setPan(float pan) | ||
2724 | { | ||
2725 | return FMOD5_ChannelGroup_SetPan(this.handle, pan); | ||
2726 | } | ||
2727 | public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) | ||
2728 | { | ||
2729 | return FMOD5_ChannelGroup_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); | ||
2730 | } | ||
2731 | public RESULT setMixLevelsInput(float[] levels, int numlevels) | ||
2732 | { | ||
2733 | return FMOD5_ChannelGroup_SetMixLevelsInput(this.handle, levels, numlevels); | ||
2734 | } | ||
2735 | public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop) | ||
2736 | { | ||
2737 | return FMOD5_ChannelGroup_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); | ||
2738 | } | ||
2739 | public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop) | ||
2740 | { | ||
2741 | return FMOD5_ChannelGroup_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); | ||
2742 | } | ||
2743 | |||
2744 | // Clock based functionality. | ||
2745 | public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) | ||
2746 | { | ||
2747 | return FMOD5_ChannelGroup_GetDSPClock(this.handle, out dspclock, out parentclock); | ||
2748 | } | ||
2749 | public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels) | ||
2750 | { | ||
2751 | return FMOD5_ChannelGroup_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); | ||
2752 | } | ||
2753 | public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) | ||
2754 | { | ||
2755 | return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); | ||
2756 | } | ||
2757 | public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) | ||
2758 | { | ||
2759 | return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); | ||
2760 | } | ||
2761 | public RESULT addFadePoint(ulong dspclock, float volume) | ||
2762 | { | ||
2763 | return FMOD5_ChannelGroup_AddFadePoint(this.handle, dspclock, volume); | ||
2764 | } | ||
2765 | public RESULT setFadePointRamp(ulong dspclock, float volume) | ||
2766 | { | ||
2767 | return FMOD5_ChannelGroup_SetFadePointRamp(this.handle, dspclock, volume); | ||
2768 | } | ||
2769 | public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) | ||
2770 | { | ||
2771 | return FMOD5_ChannelGroup_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); | ||
2772 | } | ||
2773 | public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) | ||
2774 | { | ||
2775 | return FMOD5_ChannelGroup_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); | ||
2776 | } | ||
2777 | |||
2778 | // DSP effects. | ||
2779 | public RESULT getDSP(int index, out DSP dsp) | ||
2780 | { | ||
2781 | return FMOD5_ChannelGroup_GetDSP(this.handle, index, out dsp.handle); | ||
2782 | } | ||
2783 | public RESULT addDSP(int index, DSP dsp) | ||
2784 | { | ||
2785 | return FMOD5_ChannelGroup_AddDSP(this.handle, index, dsp.handle); | ||
2786 | } | ||
2787 | public RESULT removeDSP(DSP dsp) | ||
2788 | { | ||
2789 | return FMOD5_ChannelGroup_RemoveDSP(this.handle, dsp.handle); | ||
2790 | } | ||
2791 | public RESULT getNumDSPs(out int numdsps) | ||
2792 | { | ||
2793 | return FMOD5_ChannelGroup_GetNumDSPs(this.handle, out numdsps); | ||
2794 | } | ||
2795 | public RESULT setDSPIndex(DSP dsp, int index) | ||
2796 | { | ||
2797 | return FMOD5_ChannelGroup_SetDSPIndex(this.handle, dsp.handle, index); | ||
2798 | } | ||
2799 | public RESULT getDSPIndex(DSP dsp, out int index) | ||
2800 | { | ||
2801 | return FMOD5_ChannelGroup_GetDSPIndex(this.handle, dsp.handle, out index); | ||
2802 | } | ||
2803 | |||
2804 | // 3D functionality. | ||
2805 | public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) | ||
2806 | { | ||
2807 | return FMOD5_ChannelGroup_Set3DAttributes(this.handle, ref pos, ref vel); | ||
2808 | } | ||
2809 | public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) | ||
2810 | { | ||
2811 | return FMOD5_ChannelGroup_Get3DAttributes(this.handle, out pos, out vel); | ||
2812 | } | ||
2813 | public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) | ||
2814 | { | ||
2815 | return FMOD5_ChannelGroup_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); | ||
2816 | } | ||
2817 | public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) | ||
2818 | { | ||
2819 | return FMOD5_ChannelGroup_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); | ||
2820 | } | ||
2821 | public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) | ||
2822 | { | ||
2823 | return FMOD5_ChannelGroup_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); | ||
2824 | } | ||
2825 | public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) | ||
2826 | { | ||
2827 | return FMOD5_ChannelGroup_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); | ||
2828 | } | ||
2829 | public RESULT set3DConeOrientation(ref VECTOR orientation) | ||
2830 | { | ||
2831 | return FMOD5_ChannelGroup_Set3DConeOrientation(this.handle, ref orientation); | ||
2832 | } | ||
2833 | public RESULT get3DConeOrientation(out VECTOR orientation) | ||
2834 | { | ||
2835 | return FMOD5_ChannelGroup_Get3DConeOrientation(this.handle, out orientation); | ||
2836 | } | ||
2837 | public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) | ||
2838 | { | ||
2839 | return FMOD5_ChannelGroup_Set3DCustomRolloff(this.handle, ref points, numpoints); | ||
2840 | } | ||
2841 | public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) | ||
2842 | { | ||
2843 | return FMOD5_ChannelGroup_Get3DCustomRolloff(this.handle, out points, out numpoints); | ||
2844 | } | ||
2845 | public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) | ||
2846 | { | ||
2847 | return FMOD5_ChannelGroup_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); | ||
2848 | } | ||
2849 | public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) | ||
2850 | { | ||
2851 | return FMOD5_ChannelGroup_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); | ||
2852 | } | ||
2853 | public RESULT set3DSpread(float angle) | ||
2854 | { | ||
2855 | return FMOD5_ChannelGroup_Set3DSpread(this.handle, angle); | ||
2856 | } | ||
2857 | public RESULT get3DSpread(out float angle) | ||
2858 | { | ||
2859 | return FMOD5_ChannelGroup_Get3DSpread(this.handle, out angle); | ||
2860 | } | ||
2861 | public RESULT set3DLevel(float level) | ||
2862 | { | ||
2863 | return FMOD5_ChannelGroup_Set3DLevel(this.handle, level); | ||
2864 | } | ||
2865 | public RESULT get3DLevel(out float level) | ||
2866 | { | ||
2867 | return FMOD5_ChannelGroup_Get3DLevel(this.handle, out level); | ||
2868 | } | ||
2869 | public RESULT set3DDopplerLevel(float level) | ||
2870 | { | ||
2871 | return FMOD5_ChannelGroup_Set3DDopplerLevel(this.handle, level); | ||
2872 | } | ||
2873 | public RESULT get3DDopplerLevel(out float level) | ||
2874 | { | ||
2875 | return FMOD5_ChannelGroup_Get3DDopplerLevel(this.handle, out level); | ||
2876 | } | ||
2877 | public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) | ||
2878 | { | ||
2879 | return FMOD5_ChannelGroup_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); | ||
2880 | } | ||
2881 | public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) | ||
2882 | { | ||
2883 | return FMOD5_ChannelGroup_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); | ||
2884 | } | ||
2885 | |||
2886 | // Userdata set/get. | ||
2887 | public RESULT setUserData(IntPtr userdata) | ||
2888 | { | ||
2889 | return FMOD5_ChannelGroup_SetUserData(this.handle, userdata); | ||
2890 | } | ||
2891 | public RESULT getUserData(out IntPtr userdata) | ||
2892 | { | ||
2893 | return FMOD5_ChannelGroup_GetUserData(this.handle, out userdata); | ||
2894 | } | ||
2895 | |||
2896 | #region importfunctions | ||
2897 | [DllImport(VERSION.dll)] | ||
2898 | private static extern RESULT FMOD5_ChannelGroup_Release (IntPtr channelgroup); | ||
2899 | [DllImport(VERSION.dll)] | ||
2900 | private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, IntPtr zero); | ||
2901 | [DllImport(VERSION.dll)] | ||
2902 | private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, out IntPtr connection); | ||
2903 | [DllImport(VERSION.dll)] | ||
2904 | private static extern RESULT FMOD5_ChannelGroup_GetNumGroups (IntPtr channelgroup, out int numgroups); | ||
2905 | [DllImport(VERSION.dll)] | ||
2906 | private static extern RESULT FMOD5_ChannelGroup_GetGroup (IntPtr channelgroup, int index, out IntPtr group); | ||
2907 | [DllImport(VERSION.dll)] | ||
2908 | private static extern RESULT FMOD5_ChannelGroup_GetParentGroup (IntPtr channelgroup, out IntPtr group); | ||
2909 | [DllImport(VERSION.dll)] | ||
2910 | private static extern RESULT FMOD5_ChannelGroup_GetName (IntPtr channelgroup, IntPtr name, int namelen); | ||
2911 | [DllImport(VERSION.dll)] | ||
2912 | private static extern RESULT FMOD5_ChannelGroup_GetNumChannels (IntPtr channelgroup, out int numchannels); | ||
2913 | [DllImport(VERSION.dll)] | ||
2914 | private static extern RESULT FMOD5_ChannelGroup_GetChannel (IntPtr channelgroup, int index, out IntPtr channel); | ||
2915 | [DllImport(VERSION.dll)] | ||
2916 | private static extern RESULT FMOD5_ChannelGroup_GetSystemObject (IntPtr channelgroup, out IntPtr system); | ||
2917 | [DllImport(VERSION.dll)] | ||
2918 | private static extern RESULT FMOD5_ChannelGroup_Stop (IntPtr channelgroup); | ||
2919 | [DllImport(VERSION.dll)] | ||
2920 | private static extern RESULT FMOD5_ChannelGroup_SetPaused (IntPtr channelgroup, bool paused); | ||
2921 | [DllImport(VERSION.dll)] | ||
2922 | private static extern RESULT FMOD5_ChannelGroup_GetPaused (IntPtr channelgroup, out bool paused); | ||
2923 | [DllImport(VERSION.dll)] | ||
2924 | private static extern RESULT FMOD5_ChannelGroup_SetVolume (IntPtr channelgroup, float volume); | ||
2925 | [DllImport(VERSION.dll)] | ||
2926 | private static extern RESULT FMOD5_ChannelGroup_GetVolume (IntPtr channelgroup, out float volume); | ||
2927 | [DllImport(VERSION.dll)] | ||
2928 | private static extern RESULT FMOD5_ChannelGroup_SetVolumeRamp (IntPtr channelgroup, bool ramp); | ||
2929 | [DllImport(VERSION.dll)] | ||
2930 | private static extern RESULT FMOD5_ChannelGroup_GetVolumeRamp (IntPtr channelgroup, out bool ramp); | ||
2931 | [DllImport(VERSION.dll)] | ||
2932 | private static extern RESULT FMOD5_ChannelGroup_GetAudibility (IntPtr channelgroup, out float audibility); | ||
2933 | [DllImport(VERSION.dll)] | ||
2934 | private static extern RESULT FMOD5_ChannelGroup_SetPitch (IntPtr channelgroup, float pitch); | ||
2935 | [DllImport(VERSION.dll)] | ||
2936 | private static extern RESULT FMOD5_ChannelGroup_GetPitch (IntPtr channelgroup, out float pitch); | ||
2937 | [DllImport(VERSION.dll)] | ||
2938 | private static extern RESULT FMOD5_ChannelGroup_SetMute (IntPtr channelgroup, bool mute); | ||
2939 | [DllImport(VERSION.dll)] | ||
2940 | private static extern RESULT FMOD5_ChannelGroup_GetMute (IntPtr channelgroup, out bool mute); | ||
2941 | [DllImport(VERSION.dll)] | ||
2942 | private static extern RESULT FMOD5_ChannelGroup_SetReverbProperties (IntPtr channelgroup, int instance, float wet); | ||
2943 | [DllImport(VERSION.dll)] | ||
2944 | private static extern RESULT FMOD5_ChannelGroup_GetReverbProperties (IntPtr channelgroup, int instance, out float wet); | ||
2945 | [DllImport(VERSION.dll)] | ||
2946 | private static extern RESULT FMOD5_ChannelGroup_SetLowPassGain (IntPtr channelgroup, float gain); | ||
2947 | [DllImport(VERSION.dll)] | ||
2948 | private static extern RESULT FMOD5_ChannelGroup_GetLowPassGain (IntPtr channelgroup, out float gain); | ||
2949 | [DllImport(VERSION.dll)] | ||
2950 | private static extern RESULT FMOD5_ChannelGroup_SetMode (IntPtr channelgroup, MODE mode); | ||
2951 | [DllImport(VERSION.dll)] | ||
2952 | private static extern RESULT FMOD5_ChannelGroup_GetMode (IntPtr channelgroup, out MODE mode); | ||
2953 | [DllImport(VERSION.dll)] | ||
2954 | private static extern RESULT FMOD5_ChannelGroup_SetCallback (IntPtr channelgroup, CHANNELCONTROL_CALLBACK callback); | ||
2955 | [DllImport(VERSION.dll)] | ||
2956 | private static extern RESULT FMOD5_ChannelGroup_IsPlaying (IntPtr channelgroup, out bool isplaying); | ||
2957 | [DllImport(VERSION.dll)] | ||
2958 | private static extern RESULT FMOD5_ChannelGroup_SetPan (IntPtr channelgroup, float pan); | ||
2959 | [DllImport(VERSION.dll)] | ||
2960 | 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); | ||
2961 | [DllImport(VERSION.dll)] | ||
2962 | private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsInput (IntPtr channelgroup, float[] levels, int numlevels); | ||
2963 | [DllImport(VERSION.dll)] | ||
2964 | private static extern RESULT FMOD5_ChannelGroup_SetMixMatrix (IntPtr channelgroup, float[] matrix, int outchannels, int inchannels, int inchannel_hop); | ||
2965 | [DllImport(VERSION.dll)] | ||
2966 | private static extern RESULT FMOD5_ChannelGroup_GetMixMatrix (IntPtr channelgroup, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); | ||
2967 | [DllImport(VERSION.dll)] | ||
2968 | private static extern RESULT FMOD5_ChannelGroup_GetDSPClock (IntPtr channelgroup, out ulong dspclock, out ulong parentclock); | ||
2969 | [DllImport(VERSION.dll)] | ||
2970 | private static extern RESULT FMOD5_ChannelGroup_SetDelay (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end, bool stopchannels); | ||
2971 | [DllImport(VERSION.dll)] | ||
2972 | private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); | ||
2973 | [DllImport(VERSION.dll)] | ||
2974 | private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); | ||
2975 | [DllImport(VERSION.dll)] | ||
2976 | private static extern RESULT FMOD5_ChannelGroup_AddFadePoint (IntPtr channelgroup, ulong dspclock, float volume); | ||
2977 | [DllImport(VERSION.dll)] | ||
2978 | private static extern RESULT FMOD5_ChannelGroup_SetFadePointRamp (IntPtr channelgroup, ulong dspclock, float volume); | ||
2979 | [DllImport(VERSION.dll)] | ||
2980 | private static extern RESULT FMOD5_ChannelGroup_RemoveFadePoints (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end); | ||
2981 | [DllImport(VERSION.dll)] | ||
2982 | private static extern RESULT FMOD5_ChannelGroup_GetFadePoints (IntPtr channelgroup, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); | ||
2983 | [DllImport(VERSION.dll)] | ||
2984 | private static extern RESULT FMOD5_ChannelGroup_GetDSP (IntPtr channelgroup, int index, out IntPtr dsp); | ||
2985 | [DllImport(VERSION.dll)] | ||
2986 | private static extern RESULT FMOD5_ChannelGroup_AddDSP (IntPtr channelgroup, int index, IntPtr dsp); | ||
2987 | [DllImport(VERSION.dll)] | ||
2988 | private static extern RESULT FMOD5_ChannelGroup_RemoveDSP (IntPtr channelgroup, IntPtr dsp); | ||
2989 | [DllImport(VERSION.dll)] | ||
2990 | private static extern RESULT FMOD5_ChannelGroup_GetNumDSPs (IntPtr channelgroup, out int numdsps); | ||
2991 | [DllImport(VERSION.dll)] | ||
2992 | private static extern RESULT FMOD5_ChannelGroup_SetDSPIndex (IntPtr channelgroup, IntPtr dsp, int index); | ||
2993 | [DllImport(VERSION.dll)] | ||
2994 | private static extern RESULT FMOD5_ChannelGroup_GetDSPIndex (IntPtr channelgroup, IntPtr dsp, out int index); | ||
2995 | [DllImport(VERSION.dll)] | ||
2996 | private static extern RESULT FMOD5_ChannelGroup_Set3DAttributes (IntPtr channelgroup, ref VECTOR pos, ref VECTOR vel); | ||
2997 | [DllImport(VERSION.dll)] | ||
2998 | private static extern RESULT FMOD5_ChannelGroup_Get3DAttributes (IntPtr channelgroup, out VECTOR pos, out VECTOR vel); | ||
2999 | [DllImport(VERSION.dll)] | ||
3000 | private static extern RESULT FMOD5_ChannelGroup_Set3DMinMaxDistance (IntPtr channelgroup, float mindistance, float maxdistance); | ||
3001 | [DllImport(VERSION.dll)] | ||
3002 | private static extern RESULT FMOD5_ChannelGroup_Get3DMinMaxDistance (IntPtr channelgroup, out float mindistance, out float maxdistance); | ||
3003 | [DllImport(VERSION.dll)] | ||
3004 | private static extern RESULT FMOD5_ChannelGroup_Set3DConeSettings (IntPtr channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume); | ||
3005 | [DllImport(VERSION.dll)] | ||
3006 | private static extern RESULT FMOD5_ChannelGroup_Get3DConeSettings (IntPtr channelgroup, out float insideconeangle, out float outsideconeangle, out float outsidevolume); | ||
3007 | [DllImport(VERSION.dll)] | ||
3008 | private static extern RESULT FMOD5_ChannelGroup_Set3DConeOrientation(IntPtr channelgroup, ref VECTOR orientation); | ||
3009 | [DllImport(VERSION.dll)] | ||
3010 | private static extern RESULT FMOD5_ChannelGroup_Get3DConeOrientation(IntPtr channelgroup, out VECTOR orientation); | ||
3011 | [DllImport(VERSION.dll)] | ||
3012 | private static extern RESULT FMOD5_ChannelGroup_Set3DCustomRolloff (IntPtr channelgroup, ref VECTOR points, int numpoints); | ||
3013 | [DllImport(VERSION.dll)] | ||
3014 | private static extern RESULT FMOD5_ChannelGroup_Get3DCustomRolloff (IntPtr channelgroup, out IntPtr points, out int numpoints); | ||
3015 | [DllImport(VERSION.dll)] | ||
3016 | private static extern RESULT FMOD5_ChannelGroup_Set3DOcclusion (IntPtr channelgroup, float directocclusion, float reverbocclusion); | ||
3017 | [DllImport(VERSION.dll)] | ||
3018 | private static extern RESULT FMOD5_ChannelGroup_Get3DOcclusion (IntPtr channelgroup, out float directocclusion, out float reverbocclusion); | ||
3019 | [DllImport(VERSION.dll)] | ||
3020 | private static extern RESULT FMOD5_ChannelGroup_Set3DSpread (IntPtr channelgroup, float angle); | ||
3021 | [DllImport(VERSION.dll)] | ||
3022 | private static extern RESULT FMOD5_ChannelGroup_Get3DSpread (IntPtr channelgroup, out float angle); | ||
3023 | [DllImport(VERSION.dll)] | ||
3024 | private static extern RESULT FMOD5_ChannelGroup_Set3DLevel (IntPtr channelgroup, float level); | ||
3025 | [DllImport(VERSION.dll)] | ||
3026 | private static extern RESULT FMOD5_ChannelGroup_Get3DLevel (IntPtr channelgroup, out float level); | ||
3027 | [DllImport(VERSION.dll)] | ||
3028 | private static extern RESULT FMOD5_ChannelGroup_Set3DDopplerLevel (IntPtr channelgroup, float level); | ||
3029 | [DllImport(VERSION.dll)] | ||
3030 | private static extern RESULT FMOD5_ChannelGroup_Get3DDopplerLevel (IntPtr channelgroup, out float level); | ||
3031 | [DllImport(VERSION.dll)] | ||
3032 | private static extern RESULT FMOD5_ChannelGroup_Set3DDistanceFilter (IntPtr channelgroup, bool custom, float customLevel, float centerFreq); | ||
3033 | [DllImport(VERSION.dll)] | ||
3034 | private static extern RESULT FMOD5_ChannelGroup_Get3DDistanceFilter (IntPtr channelgroup, out bool custom, out float customLevel, out float centerFreq); | ||
3035 | [DllImport(VERSION.dll)] | ||
3036 | private static extern RESULT FMOD5_ChannelGroup_SetUserData (IntPtr channelgroup, IntPtr userdata); | ||
3037 | [DllImport(VERSION.dll)] | ||
3038 | private static extern RESULT FMOD5_ChannelGroup_GetUserData (IntPtr channelgroup, out IntPtr userdata); | ||
3039 | #endregion | ||
3040 | |||
3041 | #region wrapperinternal | ||
3042 | |||
3043 | public IntPtr handle; | ||
3044 | |||
3045 | public ChannelGroup(IntPtr ptr) { this.handle = ptr; } | ||
3046 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
3047 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
3048 | |||
3049 | #endregion | ||
3050 | } | ||
3051 | |||
3052 | /* | ||
3053 | 'SoundGroup' API | ||
3054 | */ | ||
3055 | public struct SoundGroup | ||
3056 | { | ||
3057 | public RESULT release() | ||
3058 | { | ||
3059 | return FMOD5_SoundGroup_Release(this.handle); | ||
3060 | } | ||
3061 | |||
3062 | public RESULT getSystemObject(out System system) | ||
3063 | { | ||
3064 | return FMOD5_SoundGroup_GetSystemObject(this.handle, out system.handle); | ||
3065 | } | ||
3066 | |||
3067 | // SoundGroup control functions. | ||
3068 | public RESULT setMaxAudible(int maxaudible) | ||
3069 | { | ||
3070 | return FMOD5_SoundGroup_SetMaxAudible(this.handle, maxaudible); | ||
3071 | } | ||
3072 | public RESULT getMaxAudible(out int maxaudible) | ||
3073 | { | ||
3074 | return FMOD5_SoundGroup_GetMaxAudible(this.handle, out maxaudible); | ||
3075 | } | ||
3076 | public RESULT setMaxAudibleBehavior(SOUNDGROUP_BEHAVIOR behavior) | ||
3077 | { | ||
3078 | return FMOD5_SoundGroup_SetMaxAudibleBehavior(this.handle, behavior); | ||
3079 | } | ||
3080 | public RESULT getMaxAudibleBehavior(out SOUNDGROUP_BEHAVIOR behavior) | ||
3081 | { | ||
3082 | return FMOD5_SoundGroup_GetMaxAudibleBehavior(this.handle, out behavior); | ||
3083 | } | ||
3084 | public RESULT setMuteFadeSpeed(float speed) | ||
3085 | { | ||
3086 | return FMOD5_SoundGroup_SetMuteFadeSpeed(this.handle, speed); | ||
3087 | } | ||
3088 | public RESULT getMuteFadeSpeed(out float speed) | ||
3089 | { | ||
3090 | return FMOD5_SoundGroup_GetMuteFadeSpeed(this.handle, out speed); | ||
3091 | } | ||
3092 | public RESULT setVolume(float volume) | ||
3093 | { | ||
3094 | return FMOD5_SoundGroup_SetVolume(this.handle, volume); | ||
3095 | } | ||
3096 | public RESULT getVolume(out float volume) | ||
3097 | { | ||
3098 | return FMOD5_SoundGroup_GetVolume(this.handle, out volume); | ||
3099 | } | ||
3100 | public RESULT stop() | ||
3101 | { | ||
3102 | return FMOD5_SoundGroup_Stop(this.handle); | ||
3103 | } | ||
3104 | |||
3105 | // Information only functions. | ||
3106 | public RESULT getName(out string name, int namelen) | ||
3107 | { | ||
3108 | IntPtr stringMem = Marshal.AllocHGlobal(namelen); | ||
3109 | |||
3110 | RESULT result = FMOD5_SoundGroup_GetName(this.handle, stringMem, namelen); | ||
3111 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
3112 | { | ||
3113 | name = encoder.stringFromNative(stringMem); | ||
3114 | } | ||
3115 | Marshal.FreeHGlobal(stringMem); | ||
3116 | |||
3117 | return result; | ||
3118 | } | ||
3119 | public RESULT getNumSounds(out int numsounds) | ||
3120 | { | ||
3121 | return FMOD5_SoundGroup_GetNumSounds(this.handle, out numsounds); | ||
3122 | } | ||
3123 | public RESULT getSound(int index, out Sound sound) | ||
3124 | { | ||
3125 | return FMOD5_SoundGroup_GetSound(this.handle, index, out sound.handle); | ||
3126 | } | ||
3127 | public RESULT getNumPlaying(out int numplaying) | ||
3128 | { | ||
3129 | return FMOD5_SoundGroup_GetNumPlaying(this.handle, out numplaying); | ||
3130 | } | ||
3131 | |||
3132 | // Userdata set/get. | ||
3133 | public RESULT setUserData(IntPtr userdata) | ||
3134 | { | ||
3135 | return FMOD5_SoundGroup_SetUserData(this.handle, userdata); | ||
3136 | } | ||
3137 | public RESULT getUserData(out IntPtr userdata) | ||
3138 | { | ||
3139 | return FMOD5_SoundGroup_GetUserData(this.handle, out userdata); | ||
3140 | } | ||
3141 | |||
3142 | #region importfunctions | ||
3143 | [DllImport(VERSION.dll)] | ||
3144 | private static extern RESULT FMOD5_SoundGroup_Release (IntPtr soundgroup); | ||
3145 | [DllImport(VERSION.dll)] | ||
3146 | private static extern RESULT FMOD5_SoundGroup_GetSystemObject (IntPtr soundgroup, out IntPtr system); | ||
3147 | [DllImport(VERSION.dll)] | ||
3148 | private static extern RESULT FMOD5_SoundGroup_SetMaxAudible (IntPtr soundgroup, int maxaudible); | ||
3149 | [DllImport(VERSION.dll)] | ||
3150 | private static extern RESULT FMOD5_SoundGroup_GetMaxAudible (IntPtr soundgroup, out int maxaudible); | ||
3151 | [DllImport(VERSION.dll)] | ||
3152 | private static extern RESULT FMOD5_SoundGroup_SetMaxAudibleBehavior (IntPtr soundgroup, SOUNDGROUP_BEHAVIOR behavior); | ||
3153 | [DllImport(VERSION.dll)] | ||
3154 | private static extern RESULT FMOD5_SoundGroup_GetMaxAudibleBehavior (IntPtr soundgroup, out SOUNDGROUP_BEHAVIOR behavior); | ||
3155 | [DllImport(VERSION.dll)] | ||
3156 | private static extern RESULT FMOD5_SoundGroup_SetMuteFadeSpeed (IntPtr soundgroup, float speed); | ||
3157 | [DllImport(VERSION.dll)] | ||
3158 | private static extern RESULT FMOD5_SoundGroup_GetMuteFadeSpeed (IntPtr soundgroup, out float speed); | ||
3159 | [DllImport(VERSION.dll)] | ||
3160 | private static extern RESULT FMOD5_SoundGroup_SetVolume (IntPtr soundgroup, float volume); | ||
3161 | [DllImport(VERSION.dll)] | ||
3162 | private static extern RESULT FMOD5_SoundGroup_GetVolume (IntPtr soundgroup, out float volume); | ||
3163 | [DllImport(VERSION.dll)] | ||
3164 | private static extern RESULT FMOD5_SoundGroup_Stop (IntPtr soundgroup); | ||
3165 | [DllImport(VERSION.dll)] | ||
3166 | private static extern RESULT FMOD5_SoundGroup_GetName (IntPtr soundgroup, IntPtr name, int namelen); | ||
3167 | [DllImport(VERSION.dll)] | ||
3168 | private static extern RESULT FMOD5_SoundGroup_GetNumSounds (IntPtr soundgroup, out int numsounds); | ||
3169 | [DllImport(VERSION.dll)] | ||
3170 | private static extern RESULT FMOD5_SoundGroup_GetSound (IntPtr soundgroup, int index, out IntPtr sound); | ||
3171 | [DllImport(VERSION.dll)] | ||
3172 | private static extern RESULT FMOD5_SoundGroup_GetNumPlaying (IntPtr soundgroup, out int numplaying); | ||
3173 | [DllImport(VERSION.dll)] | ||
3174 | private static extern RESULT FMOD5_SoundGroup_SetUserData (IntPtr soundgroup, IntPtr userdata); | ||
3175 | [DllImport(VERSION.dll)] | ||
3176 | private static extern RESULT FMOD5_SoundGroup_GetUserData (IntPtr soundgroup, out IntPtr userdata); | ||
3177 | #endregion | ||
3178 | |||
3179 | #region wrapperinternal | ||
3180 | |||
3181 | public IntPtr handle; | ||
3182 | |||
3183 | public SoundGroup(IntPtr ptr) { this.handle = ptr; } | ||
3184 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
3185 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
3186 | |||
3187 | #endregion | ||
3188 | } | ||
3189 | |||
3190 | /* | ||
3191 | 'DSP' API | ||
3192 | */ | ||
3193 | public struct DSP | ||
3194 | { | ||
3195 | public RESULT release() | ||
3196 | { | ||
3197 | return FMOD5_DSP_Release(this.handle); | ||
3198 | } | ||
3199 | public RESULT getSystemObject(out System system) | ||
3200 | { | ||
3201 | return FMOD5_DSP_GetSystemObject(this.handle, out system.handle); | ||
3202 | } | ||
3203 | |||
3204 | // Connection / disconnection / input and output enumeration. | ||
3205 | public RESULT addInput(DSP input) | ||
3206 | { | ||
3207 | return FMOD5_DSP_AddInput(this.handle, input.handle, IntPtr.Zero, DSPCONNECTION_TYPE.STANDARD); | ||
3208 | } | ||
3209 | public RESULT addInput(DSP input, out DSPConnection connection, DSPCONNECTION_TYPE type = DSPCONNECTION_TYPE.STANDARD) | ||
3210 | { | ||
3211 | return FMOD5_DSP_AddInput(this.handle, input.handle, out connection.handle, type); | ||
3212 | } | ||
3213 | public RESULT disconnectFrom(DSP target, DSPConnection connection) | ||
3214 | { | ||
3215 | return FMOD5_DSP_DisconnectFrom(this.handle, target.handle, connection.handle); | ||
3216 | } | ||
3217 | public RESULT disconnectAll(bool inputs, bool outputs) | ||
3218 | { | ||
3219 | return FMOD5_DSP_DisconnectAll(this.handle, inputs, outputs); | ||
3220 | } | ||
3221 | public RESULT getNumInputs(out int numinputs) | ||
3222 | { | ||
3223 | return FMOD5_DSP_GetNumInputs(this.handle, out numinputs); | ||
3224 | } | ||
3225 | public RESULT getNumOutputs(out int numoutputs) | ||
3226 | { | ||
3227 | return FMOD5_DSP_GetNumOutputs(this.handle, out numoutputs); | ||
3228 | } | ||
3229 | public RESULT getInput(int index, out DSP input, out DSPConnection inputconnection) | ||
3230 | { | ||
3231 | return FMOD5_DSP_GetInput(this.handle, index, out input.handle, out inputconnection.handle); | ||
3232 | } | ||
3233 | public RESULT getOutput(int index, out DSP output, out DSPConnection outputconnection) | ||
3234 | { | ||
3235 | return FMOD5_DSP_GetOutput(this.handle, index, out output.handle, out outputconnection.handle); | ||
3236 | } | ||
3237 | |||
3238 | // DSP unit control. | ||
3239 | public RESULT setActive(bool active) | ||
3240 | { | ||
3241 | return FMOD5_DSP_SetActive(this.handle, active); | ||
3242 | } | ||
3243 | public RESULT getActive(out bool active) | ||
3244 | { | ||
3245 | return FMOD5_DSP_GetActive(this.handle, out active); | ||
3246 | } | ||
3247 | public RESULT setBypass(bool bypass) | ||
3248 | { | ||
3249 | return FMOD5_DSP_SetBypass(this.handle, bypass); | ||
3250 | } | ||
3251 | public RESULT getBypass(out bool bypass) | ||
3252 | { | ||
3253 | return FMOD5_DSP_GetBypass(this.handle, out bypass); | ||
3254 | } | ||
3255 | public RESULT setWetDryMix(float prewet, float postwet, float dry) | ||
3256 | { | ||
3257 | return FMOD5_DSP_SetWetDryMix(this.handle, prewet, postwet, dry); | ||
3258 | } | ||
3259 | public RESULT getWetDryMix(out float prewet, out float postwet, out float dry) | ||
3260 | { | ||
3261 | return FMOD5_DSP_GetWetDryMix(this.handle, out prewet, out postwet, out dry); | ||
3262 | } | ||
3263 | public RESULT setChannelFormat(CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode) | ||
3264 | { | ||
3265 | return FMOD5_DSP_SetChannelFormat(this.handle, channelmask, numchannels, source_speakermode); | ||
3266 | } | ||
3267 | public RESULT getChannelFormat(out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode) | ||
3268 | { | ||
3269 | return FMOD5_DSP_GetChannelFormat(this.handle, out channelmask, out numchannels, out source_speakermode); | ||
3270 | } | ||
3271 | public RESULT getOutputChannelFormat(CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode) | ||
3272 | { | ||
3273 | return FMOD5_DSP_GetOutputChannelFormat(this.handle, inmask, inchannels, inspeakermode, out outmask, out outchannels, out outspeakermode); | ||
3274 | } | ||
3275 | public RESULT reset() | ||
3276 | { | ||
3277 | return FMOD5_DSP_Reset(this.handle); | ||
3278 | } | ||
3279 | |||
3280 | // DSP parameter control. | ||
3281 | public RESULT setParameterFloat(int index, float value) | ||
3282 | { | ||
3283 | return FMOD5_DSP_SetParameterFloat(this.handle, index, value); | ||
3284 | } | ||
3285 | public RESULT setParameterInt(int index, int value) | ||
3286 | { | ||
3287 | return FMOD5_DSP_SetParameterInt(this.handle, index, value); | ||
3288 | } | ||
3289 | public RESULT setParameterBool(int index, bool value) | ||
3290 | { | ||
3291 | return FMOD5_DSP_SetParameterBool(this.handle, index, value); | ||
3292 | } | ||
3293 | public RESULT setParameterData(int index, byte[] data) | ||
3294 | { | ||
3295 | return FMOD5_DSP_SetParameterData(this.handle, index, Marshal.UnsafeAddrOfPinnedArrayElement(data, 0), (uint)data.Length); | ||
3296 | } | ||
3297 | public RESULT getParameterFloat(int index, out float value) | ||
3298 | { | ||
3299 | return FMOD5_DSP_GetParameterFloat(this.handle, index, out value, IntPtr.Zero, 0); | ||
3300 | } | ||
3301 | public RESULT getParameterInt(int index, out int value) | ||
3302 | { | ||
3303 | return FMOD5_DSP_GetParameterInt(this.handle, index, out value, IntPtr.Zero, 0); | ||
3304 | } | ||
3305 | public RESULT getParameterBool(int index, out bool value) | ||
3306 | { | ||
3307 | return FMOD5_DSP_GetParameterBool(this.handle, index, out value, IntPtr.Zero, 0); | ||
3308 | } | ||
3309 | public RESULT getParameterData(int index, out IntPtr data, out uint length) | ||
3310 | { | ||
3311 | return FMOD5_DSP_GetParameterData(this.handle, index, out data, out length, IntPtr.Zero, 0); | ||
3312 | } | ||
3313 | public RESULT getNumParameters(out int numparams) | ||
3314 | { | ||
3315 | return FMOD5_DSP_GetNumParameters(this.handle, out numparams); | ||
3316 | } | ||
3317 | public RESULT getParameterInfo(int index, out DSP_PARAMETER_DESC desc) | ||
3318 | { | ||
3319 | IntPtr descPtr; | ||
3320 | RESULT result = FMOD5_DSP_GetParameterInfo(this.handle, index, out descPtr); | ||
3321 | desc = (DSP_PARAMETER_DESC)MarshalHelper.PtrToStructure(descPtr, typeof(DSP_PARAMETER_DESC)); | ||
3322 | return result; | ||
3323 | } | ||
3324 | public RESULT getDataParameterIndex(int datatype, out int index) | ||
3325 | { | ||
3326 | return FMOD5_DSP_GetDataParameterIndex(this.handle, datatype, out index); | ||
3327 | } | ||
3328 | public RESULT showConfigDialog(IntPtr hwnd, bool show) | ||
3329 | { | ||
3330 | return FMOD5_DSP_ShowConfigDialog(this.handle, hwnd, show); | ||
3331 | } | ||
3332 | |||
3333 | // DSP attributes. | ||
3334 | public RESULT getInfo(out string name, out uint version, out int channels, out int configwidth, out int configheight) | ||
3335 | { | ||
3336 | IntPtr nameMem = Marshal.AllocHGlobal(32); | ||
3337 | |||
3338 | RESULT result = FMOD5_DSP_GetInfo(this.handle, nameMem, out version, out channels, out configwidth, out configheight); | ||
3339 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
3340 | { | ||
3341 | name = encoder.stringFromNative(nameMem); | ||
3342 | } | ||
3343 | Marshal.FreeHGlobal(nameMem); | ||
3344 | return result; | ||
3345 | } | ||
3346 | public RESULT getInfo(out uint version, out int channels, out int configwidth, out int configheight) | ||
3347 | { | ||
3348 | return FMOD5_DSP_GetInfo(this.handle, IntPtr.Zero, out version, out channels, out configwidth, out configheight); ; | ||
3349 | } | ||
3350 | public RESULT getType(out DSP_TYPE type) | ||
3351 | { | ||
3352 | return FMOD5_DSP_GetType(this.handle, out type); | ||
3353 | } | ||
3354 | public RESULT getIdle(out bool idle) | ||
3355 | { | ||
3356 | return FMOD5_DSP_GetIdle(this.handle, out idle); | ||
3357 | } | ||
3358 | |||
3359 | // Userdata set/get. | ||
3360 | public RESULT setUserData(IntPtr userdata) | ||
3361 | { | ||
3362 | return FMOD5_DSP_SetUserData(this.handle, userdata); | ||
3363 | } | ||
3364 | public RESULT getUserData(out IntPtr userdata) | ||
3365 | { | ||
3366 | return FMOD5_DSP_GetUserData(this.handle, out userdata); | ||
3367 | } | ||
3368 | |||
3369 | // Metering. | ||
3370 | public RESULT setMeteringEnabled(bool inputEnabled, bool outputEnabled) | ||
3371 | { | ||
3372 | return FMOD5_DSP_SetMeteringEnabled(this.handle, inputEnabled, outputEnabled); | ||
3373 | } | ||
3374 | public RESULT getMeteringEnabled(out bool inputEnabled, out bool outputEnabled) | ||
3375 | { | ||
3376 | return FMOD5_DSP_GetMeteringEnabled(this.handle, out inputEnabled, out outputEnabled); | ||
3377 | } | ||
3378 | |||
3379 | public RESULT getMeteringInfo(IntPtr zero, out DSP_METERING_INFO outputInfo) | ||
3380 | { | ||
3381 | return FMOD5_DSP_GetMeteringInfo(this.handle, zero, out outputInfo); | ||
3382 | } | ||
3383 | public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, IntPtr zero) | ||
3384 | { | ||
3385 | return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, zero); | ||
3386 | } | ||
3387 | public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo) | ||
3388 | { | ||
3389 | return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, out outputInfo); | ||
3390 | } | ||
3391 | |||
3392 | public RESULT getCPUUsage(out uint exclusive, out uint inclusive) | ||
3393 | { | ||
3394 | return FMOD5_DSP_GetCPUUsage(this.handle, out exclusive, out inclusive); | ||
3395 | } | ||
3396 | |||
3397 | #region importfunctions | ||
3398 | [DllImport(VERSION.dll)] | ||
3399 | private static extern RESULT FMOD5_DSP_Release (IntPtr dsp); | ||
3400 | [DllImport(VERSION.dll)] | ||
3401 | private static extern RESULT FMOD5_DSP_GetSystemObject (IntPtr dsp, out IntPtr system); | ||
3402 | [DllImport(VERSION.dll)] | ||
3403 | private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, IntPtr zero, DSPCONNECTION_TYPE type); | ||
3404 | [DllImport(VERSION.dll)] | ||
3405 | private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, out IntPtr connection, DSPCONNECTION_TYPE type); | ||
3406 | [DllImport(VERSION.dll)] | ||
3407 | private static extern RESULT FMOD5_DSP_DisconnectFrom (IntPtr dsp, IntPtr target, IntPtr connection); | ||
3408 | [DllImport(VERSION.dll)] | ||
3409 | private static extern RESULT FMOD5_DSP_DisconnectAll (IntPtr dsp, bool inputs, bool outputs); | ||
3410 | [DllImport(VERSION.dll)] | ||
3411 | private static extern RESULT FMOD5_DSP_GetNumInputs (IntPtr dsp, out int numinputs); | ||
3412 | [DllImport(VERSION.dll)] | ||
3413 | private static extern RESULT FMOD5_DSP_GetNumOutputs (IntPtr dsp, out int numoutputs); | ||
3414 | [DllImport(VERSION.dll)] | ||
3415 | private static extern RESULT FMOD5_DSP_GetInput (IntPtr dsp, int index, out IntPtr input, out IntPtr inputconnection); | ||
3416 | [DllImport(VERSION.dll)] | ||
3417 | private static extern RESULT FMOD5_DSP_GetOutput (IntPtr dsp, int index, out IntPtr output, out IntPtr outputconnection); | ||
3418 | [DllImport(VERSION.dll)] | ||
3419 | private static extern RESULT FMOD5_DSP_SetActive (IntPtr dsp, bool active); | ||
3420 | [DllImport(VERSION.dll)] | ||
3421 | private static extern RESULT FMOD5_DSP_GetActive (IntPtr dsp, out bool active); | ||
3422 | [DllImport(VERSION.dll)] | ||
3423 | private static extern RESULT FMOD5_DSP_SetBypass (IntPtr dsp, bool bypass); | ||
3424 | [DllImport(VERSION.dll)] | ||
3425 | private static extern RESULT FMOD5_DSP_GetBypass (IntPtr dsp, out bool bypass); | ||
3426 | [DllImport(VERSION.dll)] | ||
3427 | private static extern RESULT FMOD5_DSP_SetWetDryMix (IntPtr dsp, float prewet, float postwet, float dry); | ||
3428 | [DllImport(VERSION.dll)] | ||
3429 | private static extern RESULT FMOD5_DSP_GetWetDryMix (IntPtr dsp, out float prewet, out float postwet, out float dry); | ||
3430 | [DllImport(VERSION.dll)] | ||
3431 | private static extern RESULT FMOD5_DSP_SetChannelFormat (IntPtr dsp, CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode); | ||
3432 | [DllImport(VERSION.dll)] | ||
3433 | private static extern RESULT FMOD5_DSP_GetChannelFormat (IntPtr dsp, out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode); | ||
3434 | [DllImport(VERSION.dll)] | ||
3435 | private static extern RESULT FMOD5_DSP_GetOutputChannelFormat (IntPtr dsp, CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode); | ||
3436 | [DllImport(VERSION.dll)] | ||
3437 | private static extern RESULT FMOD5_DSP_Reset (IntPtr dsp); | ||
3438 | [DllImport(VERSION.dll)] | ||
3439 | private static extern RESULT FMOD5_DSP_SetParameterFloat (IntPtr dsp, int index, float value); | ||
3440 | [DllImport(VERSION.dll)] | ||
3441 | private static extern RESULT FMOD5_DSP_SetParameterInt (IntPtr dsp, int index, int value); | ||
3442 | [DllImport(VERSION.dll)] | ||
3443 | private static extern RESULT FMOD5_DSP_SetParameterBool (IntPtr dsp, int index, bool value); | ||
3444 | [DllImport(VERSION.dll)] | ||
3445 | private static extern RESULT FMOD5_DSP_SetParameterData (IntPtr dsp, int index, IntPtr data, uint length); | ||
3446 | [DllImport(VERSION.dll)] | ||
3447 | private static extern RESULT FMOD5_DSP_GetParameterFloat (IntPtr dsp, int index, out float value, IntPtr valuestr, int valuestrlen); | ||
3448 | [DllImport(VERSION.dll)] | ||
3449 | private static extern RESULT FMOD5_DSP_GetParameterInt (IntPtr dsp, int index, out int value, IntPtr valuestr, int valuestrlen); | ||
3450 | [DllImport(VERSION.dll)] | ||
3451 | private static extern RESULT FMOD5_DSP_GetParameterBool (IntPtr dsp, int index, out bool value, IntPtr valuestr, int valuestrlen); | ||
3452 | [DllImport(VERSION.dll)] | ||
3453 | private static extern RESULT FMOD5_DSP_GetParameterData (IntPtr dsp, int index, out IntPtr data, out uint length, IntPtr valuestr, int valuestrlen); | ||
3454 | [DllImport(VERSION.dll)] | ||
3455 | private static extern RESULT FMOD5_DSP_GetNumParameters (IntPtr dsp, out int numparams); | ||
3456 | [DllImport(VERSION.dll)] | ||
3457 | private static extern RESULT FMOD5_DSP_GetParameterInfo (IntPtr dsp, int index, out IntPtr desc); | ||
3458 | [DllImport(VERSION.dll)] | ||
3459 | private static extern RESULT FMOD5_DSP_GetDataParameterIndex (IntPtr dsp, int datatype, out int index); | ||
3460 | [DllImport(VERSION.dll)] | ||
3461 | private static extern RESULT FMOD5_DSP_ShowConfigDialog (IntPtr dsp, IntPtr hwnd, bool show); | ||
3462 | [DllImport(VERSION.dll)] | ||
3463 | private static extern RESULT FMOD5_DSP_GetInfo (IntPtr dsp, IntPtr name, out uint version, out int channels, out int configwidth, out int configheight); | ||
3464 | [DllImport(VERSION.dll)] | ||
3465 | private static extern RESULT FMOD5_DSP_GetType (IntPtr dsp, out DSP_TYPE type); | ||
3466 | [DllImport(VERSION.dll)] | ||
3467 | private static extern RESULT FMOD5_DSP_GetIdle (IntPtr dsp, out bool idle); | ||
3468 | [DllImport(VERSION.dll)] | ||
3469 | private static extern RESULT FMOD5_DSP_SetUserData (IntPtr dsp, IntPtr userdata); | ||
3470 | [DllImport(VERSION.dll)] | ||
3471 | private static extern RESULT FMOD5_DSP_GetUserData (IntPtr dsp, out IntPtr userdata); | ||
3472 | [DllImport(VERSION.dll)] | ||
3473 | public static extern RESULT FMOD5_DSP_SetMeteringEnabled (IntPtr dsp, bool inputEnabled, bool outputEnabled); | ||
3474 | [DllImport(VERSION.dll)] | ||
3475 | public static extern RESULT FMOD5_DSP_GetMeteringEnabled (IntPtr dsp, out bool inputEnabled, out bool outputEnabled); | ||
3476 | [DllImport(VERSION.dll)] | ||
3477 | public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, IntPtr zero, out DSP_METERING_INFO outputInfo); | ||
3478 | [DllImport(VERSION.dll)] | ||
3479 | public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, IntPtr zero); | ||
3480 | [DllImport(VERSION.dll)] | ||
3481 | public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo); | ||
3482 | [DllImport(VERSION.dll)] | ||
3483 | public static extern RESULT FMOD5_DSP_GetCPUUsage (IntPtr dsp, out uint exclusive, out uint inclusive); | ||
3484 | #endregion | ||
3485 | |||
3486 | #region wrapperinternal | ||
3487 | |||
3488 | public IntPtr handle; | ||
3489 | |||
3490 | public DSP(IntPtr ptr) { this.handle = ptr; } | ||
3491 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
3492 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
3493 | |||
3494 | #endregion | ||
3495 | } | ||
3496 | |||
3497 | /* | ||
3498 | 'DSPConnection' API | ||
3499 | */ | ||
3500 | public struct DSPConnection | ||
3501 | { | ||
3502 | public RESULT getInput(out DSP input) | ||
3503 | { | ||
3504 | return FMOD5_DSPConnection_GetInput(this.handle, out input.handle); | ||
3505 | } | ||
3506 | public RESULT getOutput(out DSP output) | ||
3507 | { | ||
3508 | return FMOD5_DSPConnection_GetOutput(this.handle, out output.handle); | ||
3509 | } | ||
3510 | public RESULT setMix(float volume) | ||
3511 | { | ||
3512 | return FMOD5_DSPConnection_SetMix(this.handle, volume); | ||
3513 | } | ||
3514 | public RESULT getMix(out float volume) | ||
3515 | { | ||
3516 | return FMOD5_DSPConnection_GetMix(this.handle, out volume); | ||
3517 | } | ||
3518 | public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) | ||
3519 | { | ||
3520 | return FMOD5_DSPConnection_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); | ||
3521 | } | ||
3522 | public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) | ||
3523 | { | ||
3524 | return FMOD5_DSPConnection_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); | ||
3525 | } | ||
3526 | public RESULT getType(out DSPCONNECTION_TYPE type) | ||
3527 | { | ||
3528 | return FMOD5_DSPConnection_GetType(this.handle, out type); | ||
3529 | } | ||
3530 | |||
3531 | // Userdata set/get. | ||
3532 | public RESULT setUserData(IntPtr userdata) | ||
3533 | { | ||
3534 | return FMOD5_DSPConnection_SetUserData(this.handle, userdata); | ||
3535 | } | ||
3536 | public RESULT getUserData(out IntPtr userdata) | ||
3537 | { | ||
3538 | return FMOD5_DSPConnection_GetUserData(this.handle, out userdata); | ||
3539 | } | ||
3540 | |||
3541 | #region importfunctions | ||
3542 | [DllImport(VERSION.dll)] | ||
3543 | private static extern RESULT FMOD5_DSPConnection_GetInput (IntPtr dspconnection, out IntPtr input); | ||
3544 | [DllImport(VERSION.dll)] | ||
3545 | private static extern RESULT FMOD5_DSPConnection_GetOutput (IntPtr dspconnection, out IntPtr output); | ||
3546 | [DllImport(VERSION.dll)] | ||
3547 | private static extern RESULT FMOD5_DSPConnection_SetMix (IntPtr dspconnection, float volume); | ||
3548 | [DllImport(VERSION.dll)] | ||
3549 | private static extern RESULT FMOD5_DSPConnection_GetMix (IntPtr dspconnection, out float volume); | ||
3550 | [DllImport(VERSION.dll)] | ||
3551 | private static extern RESULT FMOD5_DSPConnection_SetMixMatrix (IntPtr dspconnection, float[] matrix, int outchannels, int inchannels, int inchannel_hop); | ||
3552 | [DllImport(VERSION.dll)] | ||
3553 | private static extern RESULT FMOD5_DSPConnection_GetMixMatrix (IntPtr dspconnection, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); | ||
3554 | [DllImport(VERSION.dll)] | ||
3555 | private static extern RESULT FMOD5_DSPConnection_GetType (IntPtr dspconnection, out DSPCONNECTION_TYPE type); | ||
3556 | [DllImport(VERSION.dll)] | ||
3557 | private static extern RESULT FMOD5_DSPConnection_SetUserData (IntPtr dspconnection, IntPtr userdata); | ||
3558 | [DllImport(VERSION.dll)] | ||
3559 | private static extern RESULT FMOD5_DSPConnection_GetUserData (IntPtr dspconnection, out IntPtr userdata); | ||
3560 | #endregion | ||
3561 | |||
3562 | #region wrapperinternal | ||
3563 | |||
3564 | public IntPtr handle; | ||
3565 | |||
3566 | public DSPConnection(IntPtr ptr) { this.handle = ptr; } | ||
3567 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
3568 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
3569 | |||
3570 | #endregion | ||
3571 | } | ||
3572 | |||
3573 | /* | ||
3574 | 'Geometry' API | ||
3575 | */ | ||
3576 | public struct Geometry | ||
3577 | { | ||
3578 | public RESULT release() | ||
3579 | { | ||
3580 | return FMOD5_Geometry_Release(this.handle); | ||
3581 | } | ||
3582 | |||
3583 | // Polygon manipulation. | ||
3584 | public RESULT addPolygon(float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex) | ||
3585 | { | ||
3586 | return FMOD5_Geometry_AddPolygon(this.handle, directocclusion, reverbocclusion, doublesided, numvertices, vertices, out polygonindex); | ||
3587 | } | ||
3588 | public RESULT getNumPolygons(out int numpolygons) | ||
3589 | { | ||
3590 | return FMOD5_Geometry_GetNumPolygons(this.handle, out numpolygons); | ||
3591 | } | ||
3592 | public RESULT getMaxPolygons(out int maxpolygons, out int maxvertices) | ||
3593 | { | ||
3594 | return FMOD5_Geometry_GetMaxPolygons(this.handle, out maxpolygons, out maxvertices); | ||
3595 | } | ||
3596 | public RESULT getPolygonNumVertices(int index, out int numvertices) | ||
3597 | { | ||
3598 | return FMOD5_Geometry_GetPolygonNumVertices(this.handle, index, out numvertices); | ||
3599 | } | ||
3600 | public RESULT setPolygonVertex(int index, int vertexindex, ref VECTOR vertex) | ||
3601 | { | ||
3602 | return FMOD5_Geometry_SetPolygonVertex(this.handle, index, vertexindex, ref vertex); | ||
3603 | } | ||
3604 | public RESULT getPolygonVertex(int index, int vertexindex, out VECTOR vertex) | ||
3605 | { | ||
3606 | return FMOD5_Geometry_GetPolygonVertex(this.handle, index, vertexindex, out vertex); | ||
3607 | } | ||
3608 | public RESULT setPolygonAttributes(int index, float directocclusion, float reverbocclusion, bool doublesided) | ||
3609 | { | ||
3610 | return FMOD5_Geometry_SetPolygonAttributes(this.handle, index, directocclusion, reverbocclusion, doublesided); | ||
3611 | } | ||
3612 | public RESULT getPolygonAttributes(int index, out float directocclusion, out float reverbocclusion, out bool doublesided) | ||
3613 | { | ||
3614 | return FMOD5_Geometry_GetPolygonAttributes(this.handle, index, out directocclusion, out reverbocclusion, out doublesided); | ||
3615 | } | ||
3616 | |||
3617 | // Object manipulation. | ||
3618 | public RESULT setActive(bool active) | ||
3619 | { | ||
3620 | return FMOD5_Geometry_SetActive(this.handle, active); | ||
3621 | } | ||
3622 | public RESULT getActive(out bool active) | ||
3623 | { | ||
3624 | return FMOD5_Geometry_GetActive(this.handle, out active); | ||
3625 | } | ||
3626 | public RESULT setRotation(ref VECTOR forward, ref VECTOR up) | ||
3627 | { | ||
3628 | return FMOD5_Geometry_SetRotation(this.handle, ref forward, ref up); | ||
3629 | } | ||
3630 | public RESULT getRotation(out VECTOR forward, out VECTOR up) | ||
3631 | { | ||
3632 | return FMOD5_Geometry_GetRotation(this.handle, out forward, out up); | ||
3633 | } | ||
3634 | public RESULT setPosition(ref VECTOR position) | ||
3635 | { | ||
3636 | return FMOD5_Geometry_SetPosition(this.handle, ref position); | ||
3637 | } | ||
3638 | public RESULT getPosition(out VECTOR position) | ||
3639 | { | ||
3640 | return FMOD5_Geometry_GetPosition(this.handle, out position); | ||
3641 | } | ||
3642 | public RESULT setScale(ref VECTOR scale) | ||
3643 | { | ||
3644 | return FMOD5_Geometry_SetScale(this.handle, ref scale); | ||
3645 | } | ||
3646 | public RESULT getScale(out VECTOR scale) | ||
3647 | { | ||
3648 | return FMOD5_Geometry_GetScale(this.handle, out scale); | ||
3649 | } | ||
3650 | public RESULT save(IntPtr data, out int datasize) | ||
3651 | { | ||
3652 | return FMOD5_Geometry_Save(this.handle, data, out datasize); | ||
3653 | } | ||
3654 | |||
3655 | // Userdata set/get. | ||
3656 | public RESULT setUserData(IntPtr userdata) | ||
3657 | { | ||
3658 | return FMOD5_Geometry_SetUserData(this.handle, userdata); | ||
3659 | } | ||
3660 | public RESULT getUserData(out IntPtr userdata) | ||
3661 | { | ||
3662 | return FMOD5_Geometry_GetUserData(this.handle, out userdata); | ||
3663 | } | ||
3664 | |||
3665 | #region importfunctions | ||
3666 | [DllImport(VERSION.dll)] | ||
3667 | private static extern RESULT FMOD5_Geometry_Release (IntPtr geometry); | ||
3668 | [DllImport(VERSION.dll)] | ||
3669 | private static extern RESULT FMOD5_Geometry_AddPolygon (IntPtr geometry, float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex); | ||
3670 | [DllImport(VERSION.dll)] | ||
3671 | private static extern RESULT FMOD5_Geometry_GetNumPolygons (IntPtr geometry, out int numpolygons); | ||
3672 | [DllImport(VERSION.dll)] | ||
3673 | private static extern RESULT FMOD5_Geometry_GetMaxPolygons (IntPtr geometry, out int maxpolygons, out int maxvertices); | ||
3674 | [DllImport(VERSION.dll)] | ||
3675 | private static extern RESULT FMOD5_Geometry_GetPolygonNumVertices(IntPtr geometry, int index, out int numvertices); | ||
3676 | [DllImport(VERSION.dll)] | ||
3677 | private static extern RESULT FMOD5_Geometry_SetPolygonVertex (IntPtr geometry, int index, int vertexindex, ref VECTOR vertex); | ||
3678 | [DllImport(VERSION.dll)] | ||
3679 | private static extern RESULT FMOD5_Geometry_GetPolygonVertex (IntPtr geometry, int index, int vertexindex, out VECTOR vertex); | ||
3680 | [DllImport(VERSION.dll)] | ||
3681 | private static extern RESULT FMOD5_Geometry_SetPolygonAttributes (IntPtr geometry, int index, float directocclusion, float reverbocclusion, bool doublesided); | ||
3682 | [DllImport(VERSION.dll)] | ||
3683 | private static extern RESULT FMOD5_Geometry_GetPolygonAttributes (IntPtr geometry, int index, out float directocclusion, out float reverbocclusion, out bool doublesided); | ||
3684 | [DllImport(VERSION.dll)] | ||
3685 | private static extern RESULT FMOD5_Geometry_SetActive (IntPtr geometry, bool active); | ||
3686 | [DllImport(VERSION.dll)] | ||
3687 | private static extern RESULT FMOD5_Geometry_GetActive (IntPtr geometry, out bool active); | ||
3688 | [DllImport(VERSION.dll)] | ||
3689 | private static extern RESULT FMOD5_Geometry_SetRotation (IntPtr geometry, ref VECTOR forward, ref VECTOR up); | ||
3690 | [DllImport(VERSION.dll)] | ||
3691 | private static extern RESULT FMOD5_Geometry_GetRotation (IntPtr geometry, out VECTOR forward, out VECTOR up); | ||
3692 | [DllImport(VERSION.dll)] | ||
3693 | private static extern RESULT FMOD5_Geometry_SetPosition (IntPtr geometry, ref VECTOR position); | ||
3694 | [DllImport(VERSION.dll)] | ||
3695 | private static extern RESULT FMOD5_Geometry_GetPosition (IntPtr geometry, out VECTOR position); | ||
3696 | [DllImport(VERSION.dll)] | ||
3697 | private static extern RESULT FMOD5_Geometry_SetScale (IntPtr geometry, ref VECTOR scale); | ||
3698 | [DllImport(VERSION.dll)] | ||
3699 | private static extern RESULT FMOD5_Geometry_GetScale (IntPtr geometry, out VECTOR scale); | ||
3700 | [DllImport(VERSION.dll)] | ||
3701 | private static extern RESULT FMOD5_Geometry_Save (IntPtr geometry, IntPtr data, out int datasize); | ||
3702 | [DllImport(VERSION.dll)] | ||
3703 | private static extern RESULT FMOD5_Geometry_SetUserData (IntPtr geometry, IntPtr userdata); | ||
3704 | [DllImport(VERSION.dll)] | ||
3705 | private static extern RESULT FMOD5_Geometry_GetUserData (IntPtr geometry, out IntPtr userdata); | ||
3706 | #endregion | ||
3707 | |||
3708 | #region wrapperinternal | ||
3709 | |||
3710 | public IntPtr handle; | ||
3711 | |||
3712 | public Geometry(IntPtr ptr) { this.handle = ptr; } | ||
3713 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
3714 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
3715 | |||
3716 | #endregion | ||
3717 | } | ||
3718 | |||
3719 | /* | ||
3720 | 'Reverb3D' API | ||
3721 | */ | ||
3722 | public struct Reverb3D | ||
3723 | { | ||
3724 | public RESULT release() | ||
3725 | { | ||
3726 | return FMOD5_Reverb3D_Release(this.handle); | ||
3727 | } | ||
3728 | |||
3729 | // Reverb manipulation. | ||
3730 | public RESULT set3DAttributes(ref VECTOR position, float mindistance, float maxdistance) | ||
3731 | { | ||
3732 | return FMOD5_Reverb3D_Set3DAttributes(this.handle, ref position, mindistance, maxdistance); | ||
3733 | } | ||
3734 | public RESULT get3DAttributes(ref VECTOR position, ref float mindistance, ref float maxdistance) | ||
3735 | { | ||
3736 | return FMOD5_Reverb3D_Get3DAttributes(this.handle, ref position, ref mindistance, ref maxdistance); | ||
3737 | } | ||
3738 | public RESULT setProperties(ref REVERB_PROPERTIES properties) | ||
3739 | { | ||
3740 | return FMOD5_Reverb3D_SetProperties(this.handle, ref properties); | ||
3741 | } | ||
3742 | public RESULT getProperties(ref REVERB_PROPERTIES properties) | ||
3743 | { | ||
3744 | return FMOD5_Reverb3D_GetProperties(this.handle, ref properties); | ||
3745 | } | ||
3746 | public RESULT setActive(bool active) | ||
3747 | { | ||
3748 | return FMOD5_Reverb3D_SetActive(this.handle, active); | ||
3749 | } | ||
3750 | public RESULT getActive(out bool active) | ||
3751 | { | ||
3752 | return FMOD5_Reverb3D_GetActive(this.handle, out active); | ||
3753 | } | ||
3754 | |||
3755 | // Userdata set/get. | ||
3756 | public RESULT setUserData(IntPtr userdata) | ||
3757 | { | ||
3758 | return FMOD5_Reverb3D_SetUserData(this.handle, userdata); | ||
3759 | } | ||
3760 | public RESULT getUserData(out IntPtr userdata) | ||
3761 | { | ||
3762 | return FMOD5_Reverb3D_GetUserData(this.handle, out userdata); | ||
3763 | } | ||
3764 | |||
3765 | #region importfunctions | ||
3766 | [DllImport(VERSION.dll)] | ||
3767 | private static extern RESULT FMOD5_Reverb3D_Release (IntPtr reverb3d); | ||
3768 | [DllImport(VERSION.dll)] | ||
3769 | private static extern RESULT FMOD5_Reverb3D_Set3DAttributes (IntPtr reverb3d, ref VECTOR position, float mindistance, float maxdistance); | ||
3770 | [DllImport(VERSION.dll)] | ||
3771 | private static extern RESULT FMOD5_Reverb3D_Get3DAttributes (IntPtr reverb3d, ref VECTOR position, ref float mindistance, ref float maxdistance); | ||
3772 | [DllImport(VERSION.dll)] | ||
3773 | private static extern RESULT FMOD5_Reverb3D_SetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); | ||
3774 | [DllImport(VERSION.dll)] | ||
3775 | private static extern RESULT FMOD5_Reverb3D_GetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); | ||
3776 | [DllImport(VERSION.dll)] | ||
3777 | private static extern RESULT FMOD5_Reverb3D_SetActive (IntPtr reverb3d, bool active); | ||
3778 | [DllImport(VERSION.dll)] | ||
3779 | private static extern RESULT FMOD5_Reverb3D_GetActive (IntPtr reverb3d, out bool active); | ||
3780 | [DllImport(VERSION.dll)] | ||
3781 | private static extern RESULT FMOD5_Reverb3D_SetUserData (IntPtr reverb3d, IntPtr userdata); | ||
3782 | [DllImport(VERSION.dll)] | ||
3783 | private static extern RESULT FMOD5_Reverb3D_GetUserData (IntPtr reverb3d, out IntPtr userdata); | ||
3784 | #endregion | ||
3785 | |||
3786 | #region wrapperinternal | ||
3787 | |||
3788 | public IntPtr handle; | ||
3789 | |||
3790 | public Reverb3D(IntPtr ptr) { this.handle = ptr; } | ||
3791 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
3792 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
3793 | |||
3794 | #endregion | ||
3795 | } | ||
3796 | |||
3797 | #region Helper Functions | ||
3798 | [StructLayout(LayoutKind.Sequential)] | ||
3799 | public struct StringWrapper | ||
3800 | { | ||
3801 | IntPtr nativeUtf8Ptr; | ||
3802 | |||
3803 | public StringWrapper(IntPtr ptr) | ||
3804 | { | ||
3805 | nativeUtf8Ptr = ptr; | ||
3806 | } | ||
3807 | |||
3808 | public static implicit operator string(StringWrapper fstring) | ||
3809 | { | ||
3810 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
3811 | { | ||
3812 | return encoder.stringFromNative(fstring.nativeUtf8Ptr); | ||
3813 | } | ||
3814 | } | ||
3815 | } | ||
3816 | |||
3817 | static class StringHelper | ||
3818 | { | ||
3819 | public class ThreadSafeEncoding : IDisposable | ||
3820 | { | ||
3821 | UTF8Encoding encoding = new UTF8Encoding(); | ||
3822 | byte[] encodedBuffer = new byte[128]; | ||
3823 | char[] decodedBuffer = new char[128]; | ||
3824 | bool inUse; | ||
3825 | GCHandle gcHandle; | ||
3826 | |||
3827 | public bool InUse() { return inUse; } | ||
3828 | public void SetInUse() { inUse = true; } | ||
3829 | |||
3830 | private int roundUpPowerTwo(int number) | ||
3831 | { | ||
3832 | int newNumber = 1; | ||
3833 | while (newNumber <= number) | ||
3834 | { | ||
3835 | newNumber *= 2; | ||
3836 | } | ||
3837 | |||
3838 | return newNumber; | ||
3839 | } | ||
3840 | |||
3841 | public byte[] byteFromStringUTF8(string s) | ||
3842 | { | ||
3843 | if (s == null) | ||
3844 | { | ||
3845 | return null; | ||
3846 | } | ||
3847 | |||
3848 | int maximumLength = encoding.GetMaxByteCount(s.Length) + 1; // +1 for null terminator | ||
3849 | if (maximumLength > encodedBuffer.Length) | ||
3850 | { | ||
3851 | int encodedLength = encoding.GetByteCount(s) + 1; // +1 for null terminator | ||
3852 | if (encodedLength > encodedBuffer.Length) | ||
3853 | { | ||
3854 | encodedBuffer = new byte[roundUpPowerTwo(encodedLength)]; | ||
3855 | } | ||
3856 | } | ||
3857 | |||
3858 | int byteCount = encoding.GetBytes(s, 0, s.Length, encodedBuffer, 0); | ||
3859 | encodedBuffer[byteCount] = 0; // Apply null terminator | ||
3860 | |||
3861 | return encodedBuffer; | ||
3862 | } | ||
3863 | |||
3864 | public IntPtr intptrFromStringUTF8(string s) | ||
3865 | { | ||
3866 | if (s == null) | ||
3867 | { | ||
3868 | return IntPtr.Zero; | ||
3869 | } | ||
3870 | |||
3871 | gcHandle = GCHandle.Alloc(byteFromStringUTF8(s), GCHandleType.Pinned); | ||
3872 | return gcHandle.AddrOfPinnedObject(); | ||
3873 | } | ||
3874 | |||
3875 | public string stringFromNative(IntPtr nativePtr) | ||
3876 | { | ||
3877 | if (nativePtr == IntPtr.Zero) | ||
3878 | { | ||
3879 | return ""; | ||
3880 | } | ||
3881 | |||
3882 | int nativeLen = 0; | ||
3883 | while (Marshal.ReadByte(nativePtr, nativeLen) != 0) | ||
3884 | { | ||
3885 | nativeLen++; | ||
3886 | } | ||
3887 | |||
3888 | if (nativeLen == 0) | ||
3889 | { | ||
3890 | return ""; | ||
3891 | } | ||
3892 | |||
3893 | if (nativeLen > encodedBuffer.Length) | ||
3894 | { | ||
3895 | encodedBuffer = new byte[roundUpPowerTwo(nativeLen)]; | ||
3896 | } | ||
3897 | |||
3898 | Marshal.Copy(nativePtr, encodedBuffer, 0, nativeLen); | ||
3899 | |||
3900 | int maximumLength = encoding.GetMaxCharCount(nativeLen); | ||
3901 | if (maximumLength > decodedBuffer.Length) | ||
3902 | { | ||
3903 | int decodedLength = encoding.GetCharCount(encodedBuffer, 0, nativeLen); | ||
3904 | if (decodedLength > decodedBuffer.Length) | ||
3905 | { | ||
3906 | decodedBuffer = new char[roundUpPowerTwo(decodedLength)]; | ||
3907 | } | ||
3908 | } | ||
3909 | |||
3910 | int charCount = encoding.GetChars(encodedBuffer, 0, nativeLen, decodedBuffer, 0); | ||
3911 | |||
3912 | return new String(decodedBuffer, 0, charCount); | ||
3913 | } | ||
3914 | |||
3915 | public void Dispose() | ||
3916 | { | ||
3917 | if (gcHandle.IsAllocated) | ||
3918 | { | ||
3919 | gcHandle.Free(); | ||
3920 | } | ||
3921 | lock (encoders) | ||
3922 | { | ||
3923 | inUse = false; | ||
3924 | } | ||
3925 | } | ||
3926 | } | ||
3927 | |||
3928 | static List<ThreadSafeEncoding> encoders = new List<ThreadSafeEncoding>(1); | ||
3929 | |||
3930 | public static ThreadSafeEncoding GetFreeHelper() | ||
3931 | { | ||
3932 | lock (encoders) | ||
3933 | { | ||
3934 | ThreadSafeEncoding helper = null; | ||
3935 | // Search for not in use helper | ||
3936 | for (int i = 0; i < encoders.Count; i++) | ||
3937 | { | ||
3938 | if (!encoders[i].InUse()) | ||
3939 | { | ||
3940 | helper = encoders[i]; | ||
3941 | break; | ||
3942 | } | ||
3943 | } | ||
3944 | // Otherwise create another helper | ||
3945 | if (helper == null) | ||
3946 | { | ||
3947 | helper = new ThreadSafeEncoding(); | ||
3948 | encoders.Add(helper); | ||
3949 | } | ||
3950 | helper.SetInUse(); | ||
3951 | return helper; | ||
3952 | } | ||
3953 | } | ||
3954 | } | ||
3955 | |||
3956 | // Some of the Marshal functions were marked as deprecated / obsolete, however that decision was reversed: https://github.com/dotnet/corefx/pull/10541 | ||
3957 | // Use the old syntax (non-generic) to ensure maximum compatibility (especially with Unity) ignoring the warnings | ||
3958 | public static class MarshalHelper | ||
3959 | { | ||
3960 | #pragma warning disable 618 | ||
3961 | public static int SizeOf(Type t) | ||
3962 | { | ||
3963 | return Marshal.SizeOf(t); // Always use Type version, never Object version as it boxes causes GC allocations | ||
3964 | } | ||
3965 | |||
3966 | public static object PtrToStructure(IntPtr ptr, Type structureType) | ||
3967 | { | ||
3968 | return Marshal.PtrToStructure(ptr, structureType); | ||
3969 | } | ||
3970 | #pragma warning restore 618 | ||
3971 | } | ||
3972 | |||
3973 | #endregion | ||
3974 | } | ||
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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Core API - C header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header in conjunction with fmod_common.h (which contains all the constants / */ | ||
6 | /* callbacks) to develop using the C interface */ | ||
7 | /* */ | ||
8 | /* For more detail visit: */ | ||
9 | /* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */ | ||
10 | /* ======================================================================================== */ | ||
11 | |||
12 | #ifndef _FMOD_H | ||
13 | #define _FMOD_H | ||
14 | |||
15 | #include "fmod_common.h" | ||
16 | |||
17 | #ifdef __cplusplus | ||
18 | extern "C" | ||
19 | { | ||
20 | #endif | ||
21 | |||
22 | /* | ||
23 | FMOD global system functions (optional). | ||
24 | */ | ||
25 | 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); | ||
26 | FMOD_RESULT F_API FMOD_Memory_GetStats (int *currentalloced, int *maxalloced, FMOD_BOOL blocking); | ||
27 | FMOD_RESULT F_API FMOD_Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode, FMOD_DEBUG_CALLBACK callback, const char *filename); | ||
28 | FMOD_RESULT F_API FMOD_File_SetDiskBusy (int busy); | ||
29 | FMOD_RESULT F_API FMOD_File_GetDiskBusy (int *busy); | ||
30 | FMOD_RESULT F_API FMOD_Thread_SetAttributes (FMOD_THREAD_TYPE type, FMOD_THREAD_AFFINITY affinity, FMOD_THREAD_PRIORITY priority, FMOD_THREAD_STACK_SIZE stacksize); | ||
31 | |||
32 | /* | ||
33 | FMOD System factory functions. Use this to create an FMOD System Instance. below you will see FMOD_System_Init/Close to get started. | ||
34 | */ | ||
35 | FMOD_RESULT F_API FMOD_System_Create (FMOD_SYSTEM **system, unsigned int headerversion); | ||
36 | FMOD_RESULT F_API FMOD_System_Release (FMOD_SYSTEM *system); | ||
37 | |||
38 | /* | ||
39 | 'System' API | ||
40 | */ | ||
41 | |||
42 | /* Setup functions. */ | ||
43 | FMOD_RESULT F_API FMOD_System_SetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE output); | ||
44 | FMOD_RESULT F_API FMOD_System_GetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE *output); | ||
45 | FMOD_RESULT F_API FMOD_System_GetNumDrivers (FMOD_SYSTEM *system, int *numdrivers); | ||
46 | 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); | ||
47 | FMOD_RESULT F_API FMOD_System_SetDriver (FMOD_SYSTEM *system, int driver); | ||
48 | FMOD_RESULT F_API FMOD_System_GetDriver (FMOD_SYSTEM *system, int *driver); | ||
49 | FMOD_RESULT F_API FMOD_System_SetSoftwareChannels (FMOD_SYSTEM *system, int numsoftwarechannels); | ||
50 | FMOD_RESULT F_API FMOD_System_GetSoftwareChannels (FMOD_SYSTEM *system, int *numsoftwarechannels); | ||
51 | FMOD_RESULT F_API FMOD_System_SetSoftwareFormat (FMOD_SYSTEM *system, int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers); | ||
52 | FMOD_RESULT F_API FMOD_System_GetSoftwareFormat (FMOD_SYSTEM *system, int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers); | ||
53 | FMOD_RESULT F_API FMOD_System_SetDSPBufferSize (FMOD_SYSTEM *system, unsigned int bufferlength, int numbuffers); | ||
54 | FMOD_RESULT F_API FMOD_System_GetDSPBufferSize (FMOD_SYSTEM *system, unsigned int *bufferlength, int *numbuffers); | ||
55 | 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); | ||
56 | 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); | ||
57 | FMOD_RESULT F_API FMOD_System_SetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings); | ||
58 | FMOD_RESULT F_API FMOD_System_GetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings); | ||
59 | FMOD_RESULT F_API FMOD_System_SetCallback (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask); | ||
60 | |||
61 | /* Plug-in support. */ | ||
62 | FMOD_RESULT F_API FMOD_System_SetPluginPath (FMOD_SYSTEM *system, const char *path); | ||
63 | FMOD_RESULT F_API FMOD_System_LoadPlugin (FMOD_SYSTEM *system, const char *filename, unsigned int *handle, unsigned int priority); | ||
64 | FMOD_RESULT F_API FMOD_System_UnloadPlugin (FMOD_SYSTEM *system, unsigned int handle); | ||
65 | FMOD_RESULT F_API FMOD_System_GetNumNestedPlugins (FMOD_SYSTEM *system, unsigned int handle, int *count); | ||
66 | FMOD_RESULT F_API FMOD_System_GetNestedPlugin (FMOD_SYSTEM *system, unsigned int handle, int index, unsigned int *nestedhandle); | ||
67 | FMOD_RESULT F_API FMOD_System_GetNumPlugins (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int *numplugins); | ||
68 | FMOD_RESULT F_API FMOD_System_GetPluginHandle (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle); | ||
69 | FMOD_RESULT F_API FMOD_System_GetPluginInfo (FMOD_SYSTEM *system, unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version); | ||
70 | FMOD_RESULT F_API FMOD_System_SetOutputByPlugin (FMOD_SYSTEM *system, unsigned int handle); | ||
71 | FMOD_RESULT F_API FMOD_System_GetOutputByPlugin (FMOD_SYSTEM *system, unsigned int *handle); | ||
72 | FMOD_RESULT F_API FMOD_System_CreateDSPByPlugin (FMOD_SYSTEM *system, unsigned int handle, FMOD_DSP **dsp); | ||
73 | FMOD_RESULT F_API FMOD_System_GetDSPInfoByPlugin (FMOD_SYSTEM *system, unsigned int handle, const FMOD_DSP_DESCRIPTION **description); | ||
74 | FMOD_RESULT F_API FMOD_System_RegisterCodec (FMOD_SYSTEM *system, FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority); | ||
75 | FMOD_RESULT F_API FMOD_System_RegisterDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, unsigned int *handle); | ||
76 | FMOD_RESULT F_API FMOD_System_RegisterOutput (FMOD_SYSTEM *system, const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle); | ||
77 | |||
78 | /* Init/Close. */ | ||
79 | FMOD_RESULT F_API FMOD_System_Init (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata); | ||
80 | FMOD_RESULT F_API FMOD_System_Close (FMOD_SYSTEM *system); | ||
81 | |||
82 | /* General post-init system functions. */ | ||
83 | FMOD_RESULT F_API FMOD_System_Update (FMOD_SYSTEM *system); | ||
84 | FMOD_RESULT F_API FMOD_System_SetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float x, float y, FMOD_BOOL active); | ||
85 | FMOD_RESULT F_API FMOD_System_GetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float *x, float *y, FMOD_BOOL *active); | ||
86 | FMOD_RESULT F_API FMOD_System_SetStreamBufferSize (FMOD_SYSTEM *system, unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype); | ||
87 | FMOD_RESULT F_API FMOD_System_GetStreamBufferSize (FMOD_SYSTEM *system, unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype); | ||
88 | FMOD_RESULT F_API FMOD_System_Set3DSettings (FMOD_SYSTEM *system, float dopplerscale, float distancefactor, float rolloffscale); | ||
89 | FMOD_RESULT F_API FMOD_System_Get3DSettings (FMOD_SYSTEM *system, float *dopplerscale, float *distancefactor, float *rolloffscale); | ||
90 | FMOD_RESULT F_API FMOD_System_Set3DNumListeners (FMOD_SYSTEM *system, int numlisteners); | ||
91 | FMOD_RESULT F_API FMOD_System_Get3DNumListeners (FMOD_SYSTEM *system, int *numlisteners); | ||
92 | 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); | ||
93 | FMOD_RESULT F_API FMOD_System_Get3DListenerAttributes (FMOD_SYSTEM *system, int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up); | ||
94 | FMOD_RESULT F_API FMOD_System_Set3DRolloffCallback (FMOD_SYSTEM *system, FMOD_3D_ROLLOFF_CALLBACK callback); | ||
95 | FMOD_RESULT F_API FMOD_System_MixerSuspend (FMOD_SYSTEM *system); | ||
96 | FMOD_RESULT F_API FMOD_System_MixerResume (FMOD_SYSTEM *system); | ||
97 | FMOD_RESULT F_API FMOD_System_GetDefaultMixMatrix (FMOD_SYSTEM *system, FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop); | ||
98 | FMOD_RESULT F_API FMOD_System_GetSpeakerModeChannels (FMOD_SYSTEM *system, FMOD_SPEAKERMODE mode, int *channels); | ||
99 | |||
100 | /* System information functions. */ | ||
101 | FMOD_RESULT F_API FMOD_System_GetVersion (FMOD_SYSTEM *system, unsigned int *version); | ||
102 | FMOD_RESULT F_API FMOD_System_GetOutputHandle (FMOD_SYSTEM *system, void **handle); | ||
103 | FMOD_RESULT F_API FMOD_System_GetChannelsPlaying (FMOD_SYSTEM *system, int *channels, int *realchannels); | ||
104 | FMOD_RESULT F_API FMOD_System_GetCPUUsage (FMOD_SYSTEM *system, FMOD_CPU_USAGE *usage); | ||
105 | FMOD_RESULT F_API FMOD_System_GetFileUsage (FMOD_SYSTEM *system, long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead); | ||
106 | |||
107 | /* Sound/DSP/Channel/FX creation and retrieval. */ | ||
108 | FMOD_RESULT F_API FMOD_System_CreateSound (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound); | ||
109 | FMOD_RESULT F_API FMOD_System_CreateStream (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound); | ||
110 | FMOD_RESULT F_API FMOD_System_CreateDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, FMOD_DSP **dsp); | ||
111 | FMOD_RESULT F_API FMOD_System_CreateDSPByType (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, FMOD_DSP **dsp); | ||
112 | FMOD_RESULT F_API FMOD_System_CreateChannelGroup (FMOD_SYSTEM *system, const char *name, FMOD_CHANNELGROUP **channelgroup); | ||
113 | FMOD_RESULT F_API FMOD_System_CreateSoundGroup (FMOD_SYSTEM *system, const char *name, FMOD_SOUNDGROUP **soundgroup); | ||
114 | FMOD_RESULT F_API FMOD_System_CreateReverb3D (FMOD_SYSTEM *system, FMOD_REVERB3D **reverb); | ||
115 | FMOD_RESULT F_API FMOD_System_PlaySound (FMOD_SYSTEM *system, FMOD_SOUND *sound, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel); | ||
116 | FMOD_RESULT F_API FMOD_System_PlayDSP (FMOD_SYSTEM *system, FMOD_DSP *dsp, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel); | ||
117 | FMOD_RESULT F_API FMOD_System_GetChannel (FMOD_SYSTEM *system, int channelid, FMOD_CHANNEL **channel); | ||
118 | FMOD_RESULT F_API FMOD_System_GetDSPInfoByType (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, const FMOD_DSP_DESCRIPTION **description); | ||
119 | FMOD_RESULT F_API FMOD_System_GetMasterChannelGroup (FMOD_SYSTEM *system, FMOD_CHANNELGROUP **channelgroup); | ||
120 | FMOD_RESULT F_API FMOD_System_GetMasterSoundGroup (FMOD_SYSTEM *system, FMOD_SOUNDGROUP **soundgroup); | ||
121 | |||
122 | /* Routing to ports. */ | ||
123 | FMOD_RESULT F_API FMOD_System_AttachChannelGroupToPort (FMOD_SYSTEM *system, FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL passThru); | ||
124 | FMOD_RESULT F_API FMOD_System_DetachChannelGroupFromPort(FMOD_SYSTEM *system, FMOD_CHANNELGROUP *channelgroup); | ||
125 | |||
126 | /* Reverb API. */ | ||
127 | FMOD_RESULT F_API FMOD_System_SetReverbProperties (FMOD_SYSTEM *system, int instance, const FMOD_REVERB_PROPERTIES *prop); | ||
128 | FMOD_RESULT F_API FMOD_System_GetReverbProperties (FMOD_SYSTEM *system, int instance, FMOD_REVERB_PROPERTIES *prop); | ||
129 | |||
130 | /* System level DSP functionality. */ | ||
131 | FMOD_RESULT F_API FMOD_System_LockDSP (FMOD_SYSTEM *system); | ||
132 | FMOD_RESULT F_API FMOD_System_UnlockDSP (FMOD_SYSTEM *system); | ||
133 | |||
134 | /* Recording API. */ | ||
135 | FMOD_RESULT F_API FMOD_System_GetRecordNumDrivers (FMOD_SYSTEM *system, int *numdrivers, int *numconnected); | ||
136 | 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); | ||
137 | FMOD_RESULT F_API FMOD_System_GetRecordPosition (FMOD_SYSTEM *system, int id, unsigned int *position); | ||
138 | FMOD_RESULT F_API FMOD_System_RecordStart (FMOD_SYSTEM *system, int id, FMOD_SOUND *sound, FMOD_BOOL loop); | ||
139 | FMOD_RESULT F_API FMOD_System_RecordStop (FMOD_SYSTEM *system, int id); | ||
140 | FMOD_RESULT F_API FMOD_System_IsRecording (FMOD_SYSTEM *system, int id, FMOD_BOOL *recording); | ||
141 | |||
142 | /* Geometry API. */ | ||
143 | FMOD_RESULT F_API FMOD_System_CreateGeometry (FMOD_SYSTEM *system, int maxpolygons, int maxvertices, FMOD_GEOMETRY **geometry); | ||
144 | FMOD_RESULT F_API FMOD_System_SetGeometrySettings (FMOD_SYSTEM *system, float maxworldsize); | ||
145 | FMOD_RESULT F_API FMOD_System_GetGeometrySettings (FMOD_SYSTEM *system, float *maxworldsize); | ||
146 | FMOD_RESULT F_API FMOD_System_LoadGeometry (FMOD_SYSTEM *system, const void *data, int datasize, FMOD_GEOMETRY **geometry); | ||
147 | FMOD_RESULT F_API FMOD_System_GetGeometryOcclusion (FMOD_SYSTEM *system, const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb); | ||
148 | |||
149 | /* Network functions. */ | ||
150 | FMOD_RESULT F_API FMOD_System_SetNetworkProxy (FMOD_SYSTEM *system, const char *proxy); | ||
151 | FMOD_RESULT F_API FMOD_System_GetNetworkProxy (FMOD_SYSTEM *system, char *proxy, int proxylen); | ||
152 | FMOD_RESULT F_API FMOD_System_SetNetworkTimeout (FMOD_SYSTEM *system, int timeout); | ||
153 | FMOD_RESULT F_API FMOD_System_GetNetworkTimeout (FMOD_SYSTEM *system, int *timeout); | ||
154 | |||
155 | /* Userdata set/get. */ | ||
156 | FMOD_RESULT F_API FMOD_System_SetUserData (FMOD_SYSTEM *system, void *userdata); | ||
157 | FMOD_RESULT F_API FMOD_System_GetUserData (FMOD_SYSTEM *system, void **userdata); | ||
158 | |||
159 | /* Sound API | ||
160 | */ | ||
161 | |||
162 | FMOD_RESULT F_API FMOD_Sound_Release (FMOD_SOUND *sound); | ||
163 | FMOD_RESULT F_API FMOD_Sound_GetSystemObject (FMOD_SOUND *sound, FMOD_SYSTEM **system); | ||
164 | |||
165 | /* | ||
166 | Standard sound manipulation functions. | ||
167 | */ | ||
168 | |||
169 | 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); | ||
170 | FMOD_RESULT F_API FMOD_Sound_Unlock (FMOD_SOUND *sound, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2); | ||
171 | FMOD_RESULT F_API FMOD_Sound_SetDefaults (FMOD_SOUND *sound, float frequency, int priority); | ||
172 | FMOD_RESULT F_API FMOD_Sound_GetDefaults (FMOD_SOUND *sound, float *frequency, int *priority); | ||
173 | FMOD_RESULT F_API FMOD_Sound_Set3DMinMaxDistance (FMOD_SOUND *sound, float min, float max); | ||
174 | FMOD_RESULT F_API FMOD_Sound_Get3DMinMaxDistance (FMOD_SOUND *sound, float *min, float *max); | ||
175 | FMOD_RESULT F_API FMOD_Sound_Set3DConeSettings (FMOD_SOUND *sound, float insideconeangle, float outsideconeangle, float outsidevolume); | ||
176 | FMOD_RESULT F_API FMOD_Sound_Get3DConeSettings (FMOD_SOUND *sound, float *insideconeangle, float *outsideconeangle, float *outsidevolume); | ||
177 | FMOD_RESULT F_API FMOD_Sound_Set3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR *points, int numpoints); | ||
178 | FMOD_RESULT F_API FMOD_Sound_Get3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR **points, int *numpoints); | ||
179 | FMOD_RESULT F_API FMOD_Sound_GetSubSound (FMOD_SOUND *sound, int index, FMOD_SOUND **subsound); | ||
180 | FMOD_RESULT F_API FMOD_Sound_GetSubSoundParent (FMOD_SOUND *sound, FMOD_SOUND **parentsound); | ||
181 | FMOD_RESULT F_API FMOD_Sound_GetName (FMOD_SOUND *sound, char *name, int namelen); | ||
182 | FMOD_RESULT F_API FMOD_Sound_GetLength (FMOD_SOUND *sound, unsigned int *length, FMOD_TIMEUNIT lengthtype); | ||
183 | FMOD_RESULT F_API FMOD_Sound_GetFormat (FMOD_SOUND *sound, FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits); | ||
184 | FMOD_RESULT F_API FMOD_Sound_GetNumSubSounds (FMOD_SOUND *sound, int *numsubsounds); | ||
185 | FMOD_RESULT F_API FMOD_Sound_GetNumTags (FMOD_SOUND *sound, int *numtags, int *numtagsupdated); | ||
186 | FMOD_RESULT F_API FMOD_Sound_GetTag (FMOD_SOUND *sound, const char *name, int index, FMOD_TAG *tag); | ||
187 | FMOD_RESULT F_API FMOD_Sound_GetOpenState (FMOD_SOUND *sound, FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, FMOD_BOOL *starving, FMOD_BOOL *diskbusy); | ||
188 | FMOD_RESULT F_API FMOD_Sound_ReadData (FMOD_SOUND *sound, void *buffer, unsigned int length, unsigned int *read); | ||
189 | FMOD_RESULT F_API FMOD_Sound_SeekData (FMOD_SOUND *sound, unsigned int pcm); | ||
190 | |||
191 | FMOD_RESULT F_API FMOD_Sound_SetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP *soundgroup); | ||
192 | FMOD_RESULT F_API FMOD_Sound_GetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP **soundgroup); | ||
193 | |||
194 | /* | ||
195 | Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks. | ||
196 | */ | ||
197 | |||
198 | FMOD_RESULT F_API FMOD_Sound_GetNumSyncPoints (FMOD_SOUND *sound, int *numsyncpoints); | ||
199 | FMOD_RESULT F_API FMOD_Sound_GetSyncPoint (FMOD_SOUND *sound, int index, FMOD_SYNCPOINT **point); | ||
200 | FMOD_RESULT F_API FMOD_Sound_GetSyncPointInfo (FMOD_SOUND *sound, FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype); | ||
201 | FMOD_RESULT F_API FMOD_Sound_AddSyncPoint (FMOD_SOUND *sound, unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point); | ||
202 | FMOD_RESULT F_API FMOD_Sound_DeleteSyncPoint (FMOD_SOUND *sound, FMOD_SYNCPOINT *point); | ||
203 | |||
204 | /* | ||
205 | Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time. | ||
206 | */ | ||
207 | |||
208 | FMOD_RESULT F_API FMOD_Sound_SetMode (FMOD_SOUND *sound, FMOD_MODE mode); | ||
209 | FMOD_RESULT F_API FMOD_Sound_GetMode (FMOD_SOUND *sound, FMOD_MODE *mode); | ||
210 | FMOD_RESULT F_API FMOD_Sound_SetLoopCount (FMOD_SOUND *sound, int loopcount); | ||
211 | FMOD_RESULT F_API FMOD_Sound_GetLoopCount (FMOD_SOUND *sound, int *loopcount); | ||
212 | FMOD_RESULT F_API FMOD_Sound_SetLoopPoints (FMOD_SOUND *sound, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype); | ||
213 | FMOD_RESULT F_API FMOD_Sound_GetLoopPoints (FMOD_SOUND *sound, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype); | ||
214 | |||
215 | /* | ||
216 | For MOD/S3M/XM/IT/MID sequenced formats only. | ||
217 | */ | ||
218 | |||
219 | FMOD_RESULT F_API FMOD_Sound_GetMusicNumChannels (FMOD_SOUND *sound, int *numchannels); | ||
220 | FMOD_RESULT F_API FMOD_Sound_SetMusicChannelVolume (FMOD_SOUND *sound, int channel, float volume); | ||
221 | FMOD_RESULT F_API FMOD_Sound_GetMusicChannelVolume (FMOD_SOUND *sound, int channel, float *volume); | ||
222 | FMOD_RESULT F_API FMOD_Sound_SetMusicSpeed (FMOD_SOUND *sound, float speed); | ||
223 | FMOD_RESULT F_API FMOD_Sound_GetMusicSpeed (FMOD_SOUND *sound, float *speed); | ||
224 | |||
225 | /* | ||
226 | Userdata set/get. | ||
227 | */ | ||
228 | |||
229 | FMOD_RESULT F_API FMOD_Sound_SetUserData (FMOD_SOUND *sound, void *userdata); | ||
230 | FMOD_RESULT F_API FMOD_Sound_GetUserData (FMOD_SOUND *sound, void **userdata); | ||
231 | |||
232 | /* | ||
233 | 'Channel' API | ||
234 | */ | ||
235 | |||
236 | FMOD_RESULT F_API FMOD_Channel_GetSystemObject (FMOD_CHANNEL *channel, FMOD_SYSTEM **system); | ||
237 | |||
238 | /* | ||
239 | General control functionality for Channels and ChannelGroups. | ||
240 | */ | ||
241 | |||
242 | FMOD_RESULT F_API FMOD_Channel_Stop (FMOD_CHANNEL *channel); | ||
243 | FMOD_RESULT F_API FMOD_Channel_SetPaused (FMOD_CHANNEL *channel, FMOD_BOOL paused); | ||
244 | FMOD_RESULT F_API FMOD_Channel_GetPaused (FMOD_CHANNEL *channel, FMOD_BOOL *paused); | ||
245 | FMOD_RESULT F_API FMOD_Channel_SetVolume (FMOD_CHANNEL *channel, float volume); | ||
246 | FMOD_RESULT F_API FMOD_Channel_GetVolume (FMOD_CHANNEL *channel, float *volume); | ||
247 | FMOD_RESULT F_API FMOD_Channel_SetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL ramp); | ||
248 | FMOD_RESULT F_API FMOD_Channel_GetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL *ramp); | ||
249 | FMOD_RESULT F_API FMOD_Channel_GetAudibility (FMOD_CHANNEL *channel, float *audibility); | ||
250 | FMOD_RESULT F_API FMOD_Channel_SetPitch (FMOD_CHANNEL *channel, float pitch); | ||
251 | FMOD_RESULT F_API FMOD_Channel_GetPitch (FMOD_CHANNEL *channel, float *pitch); | ||
252 | FMOD_RESULT F_API FMOD_Channel_SetMute (FMOD_CHANNEL *channel, FMOD_BOOL mute); | ||
253 | FMOD_RESULT F_API FMOD_Channel_GetMute (FMOD_CHANNEL *channel, FMOD_BOOL *mute); | ||
254 | FMOD_RESULT F_API FMOD_Channel_SetReverbProperties (FMOD_CHANNEL *channel, int instance, float wet); | ||
255 | FMOD_RESULT F_API FMOD_Channel_GetReverbProperties (FMOD_CHANNEL *channel, int instance, float *wet); | ||
256 | FMOD_RESULT F_API FMOD_Channel_SetLowPassGain (FMOD_CHANNEL *channel, float gain); | ||
257 | FMOD_RESULT F_API FMOD_Channel_GetLowPassGain (FMOD_CHANNEL *channel, float *gain); | ||
258 | FMOD_RESULT F_API FMOD_Channel_SetMode (FMOD_CHANNEL *channel, FMOD_MODE mode); | ||
259 | FMOD_RESULT F_API FMOD_Channel_GetMode (FMOD_CHANNEL *channel, FMOD_MODE *mode); | ||
260 | FMOD_RESULT F_API FMOD_Channel_SetCallback (FMOD_CHANNEL *channel, FMOD_CHANNELCONTROL_CALLBACK callback); | ||
261 | FMOD_RESULT F_API FMOD_Channel_IsPlaying (FMOD_CHANNEL *channel, FMOD_BOOL *isplaying); | ||
262 | |||
263 | /* | ||
264 | 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. | ||
265 | */ | ||
266 | |||
267 | FMOD_RESULT F_API FMOD_Channel_SetPan (FMOD_CHANNEL *channel, float pan); | ||
268 | 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); | ||
269 | FMOD_RESULT F_API FMOD_Channel_SetMixLevelsInput (FMOD_CHANNEL *channel, float *levels, int numlevels); | ||
270 | FMOD_RESULT F_API FMOD_Channel_SetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int outchannels, int inchannels, int inchannel_hop); | ||
271 | FMOD_RESULT F_API FMOD_Channel_GetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int *outchannels, int *inchannels, int inchannel_hop); | ||
272 | |||
273 | /* | ||
274 | Clock based functionality. | ||
275 | */ | ||
276 | |||
277 | FMOD_RESULT F_API FMOD_Channel_GetDSPClock (FMOD_CHANNEL *channel, unsigned long long *dspclock, unsigned long long *parentclock); | ||
278 | FMOD_RESULT F_API FMOD_Channel_SetDelay (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels); | ||
279 | FMOD_RESULT F_API FMOD_Channel_GetDelay (FMOD_CHANNEL *channel, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels); | ||
280 | FMOD_RESULT F_API FMOD_Channel_AddFadePoint (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume); | ||
281 | FMOD_RESULT F_API FMOD_Channel_SetFadePointRamp (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume); | ||
282 | FMOD_RESULT F_API FMOD_Channel_RemoveFadePoints (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end); | ||
283 | FMOD_RESULT F_API FMOD_Channel_GetFadePoints (FMOD_CHANNEL *channel, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume); | ||
284 | |||
285 | /* | ||
286 | DSP effects. | ||
287 | */ | ||
288 | |||
289 | FMOD_RESULT F_API FMOD_Channel_GetDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP **dsp); | ||
290 | FMOD_RESULT F_API FMOD_Channel_AddDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP *dsp); | ||
291 | FMOD_RESULT F_API FMOD_Channel_RemoveDSP (FMOD_CHANNEL *channel, FMOD_DSP *dsp); | ||
292 | FMOD_RESULT F_API FMOD_Channel_GetNumDSPs (FMOD_CHANNEL *channel, int *numdsps); | ||
293 | FMOD_RESULT F_API FMOD_Channel_SetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int index); | ||
294 | FMOD_RESULT F_API FMOD_Channel_GetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int *index); | ||
295 | |||
296 | /* | ||
297 | 3D functionality. | ||
298 | */ | ||
299 | |||
300 | FMOD_RESULT F_API FMOD_Channel_Set3DAttributes (FMOD_CHANNEL *channel, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel); | ||
301 | FMOD_RESULT F_API FMOD_Channel_Get3DAttributes (FMOD_CHANNEL *channel, FMOD_VECTOR *pos, FMOD_VECTOR *vel); | ||
302 | FMOD_RESULT F_API FMOD_Channel_Set3DMinMaxDistance (FMOD_CHANNEL *channel, float mindistance, float maxdistance); | ||
303 | FMOD_RESULT F_API FMOD_Channel_Get3DMinMaxDistance (FMOD_CHANNEL *channel, float *mindistance, float *maxdistance); | ||
304 | FMOD_RESULT F_API FMOD_Channel_Set3DConeSettings (FMOD_CHANNEL *channel, float insideconeangle, float outsideconeangle, float outsidevolume); | ||
305 | FMOD_RESULT F_API FMOD_Channel_Get3DConeSettings (FMOD_CHANNEL *channel, float *insideconeangle, float *outsideconeangle, float *outsidevolume); | ||
306 | FMOD_RESULT F_API FMOD_Channel_Set3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation); | ||
307 | FMOD_RESULT F_API FMOD_Channel_Get3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation); | ||
308 | FMOD_RESULT F_API FMOD_Channel_Set3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR *points, int numpoints); | ||
309 | FMOD_RESULT F_API FMOD_Channel_Get3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR **points, int *numpoints); | ||
310 | FMOD_RESULT F_API FMOD_Channel_Set3DOcclusion (FMOD_CHANNEL *channel, float directocclusion, float reverbocclusion); | ||
311 | FMOD_RESULT F_API FMOD_Channel_Get3DOcclusion (FMOD_CHANNEL *channel, float *directocclusion, float *reverbocclusion); | ||
312 | FMOD_RESULT F_API FMOD_Channel_Set3DSpread (FMOD_CHANNEL *channel, float angle); | ||
313 | FMOD_RESULT F_API FMOD_Channel_Get3DSpread (FMOD_CHANNEL *channel, float *angle); | ||
314 | FMOD_RESULT F_API FMOD_Channel_Set3DLevel (FMOD_CHANNEL *channel, float level); | ||
315 | FMOD_RESULT F_API FMOD_Channel_Get3DLevel (FMOD_CHANNEL *channel, float *level); | ||
316 | FMOD_RESULT F_API FMOD_Channel_Set3DDopplerLevel (FMOD_CHANNEL *channel, float level); | ||
317 | FMOD_RESULT F_API FMOD_Channel_Get3DDopplerLevel (FMOD_CHANNEL *channel, float *level); | ||
318 | FMOD_RESULT F_API FMOD_Channel_Set3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL custom, float customLevel, float centerFreq); | ||
319 | FMOD_RESULT F_API FMOD_Channel_Get3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL *custom, float *customLevel, float *centerFreq); | ||
320 | |||
321 | /* | ||
322 | Userdata set/get. | ||
323 | */ | ||
324 | |||
325 | FMOD_RESULT F_API FMOD_Channel_SetUserData (FMOD_CHANNEL *channel, void *userdata); | ||
326 | FMOD_RESULT F_API FMOD_Channel_GetUserData (FMOD_CHANNEL *channel, void **userdata); | ||
327 | |||
328 | /* | ||
329 | Channel specific control functionality. | ||
330 | */ | ||
331 | |||
332 | FMOD_RESULT F_API FMOD_Channel_SetFrequency (FMOD_CHANNEL *channel, float frequency); | ||
333 | FMOD_RESULT F_API FMOD_Channel_GetFrequency (FMOD_CHANNEL *channel, float *frequency); | ||
334 | FMOD_RESULT F_API FMOD_Channel_SetPriority (FMOD_CHANNEL *channel, int priority); | ||
335 | FMOD_RESULT F_API FMOD_Channel_GetPriority (FMOD_CHANNEL *channel, int *priority); | ||
336 | FMOD_RESULT F_API FMOD_Channel_SetPosition (FMOD_CHANNEL *channel, unsigned int position, FMOD_TIMEUNIT postype); | ||
337 | FMOD_RESULT F_API FMOD_Channel_GetPosition (FMOD_CHANNEL *channel, unsigned int *position, FMOD_TIMEUNIT postype); | ||
338 | FMOD_RESULT F_API FMOD_Channel_SetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP *channelgroup); | ||
339 | FMOD_RESULT F_API FMOD_Channel_GetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP **channelgroup); | ||
340 | FMOD_RESULT F_API FMOD_Channel_SetLoopCount (FMOD_CHANNEL *channel, int loopcount); | ||
341 | FMOD_RESULT F_API FMOD_Channel_GetLoopCount (FMOD_CHANNEL *channel, int *loopcount); | ||
342 | FMOD_RESULT F_API FMOD_Channel_SetLoopPoints (FMOD_CHANNEL *channel, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype); | ||
343 | FMOD_RESULT F_API FMOD_Channel_GetLoopPoints (FMOD_CHANNEL *channel, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype); | ||
344 | |||
345 | /* | ||
346 | Information only functions. | ||
347 | */ | ||
348 | |||
349 | FMOD_RESULT F_API FMOD_Channel_IsVirtual (FMOD_CHANNEL *channel, FMOD_BOOL *isvirtual); | ||
350 | FMOD_RESULT F_API FMOD_Channel_GetCurrentSound (FMOD_CHANNEL *channel, FMOD_SOUND **sound); | ||
351 | FMOD_RESULT F_API FMOD_Channel_GetIndex (FMOD_CHANNEL *channel, int *index); | ||
352 | |||
353 | /* | ||
354 | 'ChannelGroup' API | ||
355 | */ | ||
356 | |||
357 | FMOD_RESULT F_API FMOD_ChannelGroup_GetSystemObject (FMOD_CHANNELGROUP *channelgroup, FMOD_SYSTEM **system); | ||
358 | |||
359 | /* | ||
360 | General control functionality for Channels and ChannelGroups. | ||
361 | */ | ||
362 | |||
363 | FMOD_RESULT F_API FMOD_ChannelGroup_Stop (FMOD_CHANNELGROUP *channelgroup); | ||
364 | FMOD_RESULT F_API FMOD_ChannelGroup_SetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused); | ||
365 | FMOD_RESULT F_API FMOD_ChannelGroup_GetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *paused); | ||
366 | FMOD_RESULT F_API FMOD_ChannelGroup_SetVolume (FMOD_CHANNELGROUP *channelgroup, float volume); | ||
367 | FMOD_RESULT F_API FMOD_ChannelGroup_GetVolume (FMOD_CHANNELGROUP *channelgroup, float *volume); | ||
368 | FMOD_RESULT F_API FMOD_ChannelGroup_SetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL ramp); | ||
369 | FMOD_RESULT F_API FMOD_ChannelGroup_GetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *ramp); | ||
370 | FMOD_RESULT F_API FMOD_ChannelGroup_GetAudibility (FMOD_CHANNELGROUP *channelgroup, float *audibility); | ||
371 | FMOD_RESULT F_API FMOD_ChannelGroup_SetPitch (FMOD_CHANNELGROUP *channelgroup, float pitch); | ||
372 | FMOD_RESULT F_API FMOD_ChannelGroup_GetPitch (FMOD_CHANNELGROUP *channelgroup, float *pitch); | ||
373 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL mute); | ||
374 | FMOD_RESULT F_API FMOD_ChannelGroup_GetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *mute); | ||
375 | FMOD_RESULT F_API FMOD_ChannelGroup_SetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float wet); | ||
376 | FMOD_RESULT F_API FMOD_ChannelGroup_GetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float *wet); | ||
377 | FMOD_RESULT F_API FMOD_ChannelGroup_SetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float gain); | ||
378 | FMOD_RESULT F_API FMOD_ChannelGroup_GetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float *gain); | ||
379 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE mode); | ||
380 | FMOD_RESULT F_API FMOD_ChannelGroup_GetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE *mode); | ||
381 | FMOD_RESULT F_API FMOD_ChannelGroup_SetCallback (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELCONTROL_CALLBACK callback); | ||
382 | FMOD_RESULT F_API FMOD_ChannelGroup_IsPlaying (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *isplaying); | ||
383 | |||
384 | /* | ||
385 | 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. | ||
386 | */ | ||
387 | |||
388 | FMOD_RESULT F_API FMOD_ChannelGroup_SetPan (FMOD_CHANNELGROUP *channelgroup, float pan); | ||
389 | 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); | ||
390 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsInput (FMOD_CHANNELGROUP *channelgroup, float *levels, int numlevels); | ||
391 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int outchannels, int inchannels, int inchannel_hop); | ||
392 | FMOD_RESULT F_API FMOD_ChannelGroup_GetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int *outchannels, int *inchannels, int inchannel_hop); | ||
393 | |||
394 | /* | ||
395 | Clock based functionality. | ||
396 | */ | ||
397 | |||
398 | FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPClock (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock, unsigned long long *parentclock); | ||
399 | FMOD_RESULT F_API FMOD_ChannelGroup_SetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels); | ||
400 | FMOD_RESULT F_API FMOD_ChannelGroup_GetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels); | ||
401 | FMOD_RESULT F_API FMOD_ChannelGroup_AddFadePoint (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume); | ||
402 | FMOD_RESULT F_API FMOD_ChannelGroup_SetFadePointRamp (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume); | ||
403 | FMOD_RESULT F_API FMOD_ChannelGroup_RemoveFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end); | ||
404 | FMOD_RESULT F_API FMOD_ChannelGroup_GetFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume); | ||
405 | |||
406 | /* | ||
407 | DSP effects. | ||
408 | */ | ||
409 | |||
410 | FMOD_RESULT F_API FMOD_ChannelGroup_GetDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP **dsp); | ||
411 | FMOD_RESULT F_API FMOD_ChannelGroup_AddDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP *dsp); | ||
412 | FMOD_RESULT F_API FMOD_ChannelGroup_RemoveDSP (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp); | ||
413 | FMOD_RESULT F_API FMOD_ChannelGroup_GetNumDSPs (FMOD_CHANNELGROUP *channelgroup, int *numdsps); | ||
414 | FMOD_RESULT F_API FMOD_ChannelGroup_SetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int index); | ||
415 | FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int *index); | ||
416 | |||
417 | /* | ||
418 | 3D functionality. | ||
419 | */ | ||
420 | |||
421 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DAttributes (FMOD_CHANNELGROUP *channelgroup, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel); | ||
422 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DAttributes (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *pos, FMOD_VECTOR *vel); | ||
423 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float mindistance, float maxdistance); | ||
424 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float *mindistance, float *maxdistance); | ||
425 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume); | ||
426 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float *insideconeangle, float *outsideconeangle, float *outsidevolume); | ||
427 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation); | ||
428 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation); | ||
429 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *points, int numpoints); | ||
430 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR **points, int *numpoints); | ||
431 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float directocclusion, float reverbocclusion); | ||
432 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float *directocclusion, float *reverbocclusion); | ||
433 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DSpread (FMOD_CHANNELGROUP *channelgroup, float angle); | ||
434 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DSpread (FMOD_CHANNELGROUP *channelgroup, float *angle); | ||
435 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DLevel (FMOD_CHANNELGROUP *channelgroup, float level); | ||
436 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DLevel (FMOD_CHANNELGROUP *channelgroup, float *level); | ||
437 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float level); | ||
438 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float *level); | ||
439 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL custom, float customLevel, float centerFreq); | ||
440 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *custom, float *customLevel, float *centerFreq); | ||
441 | |||
442 | /* | ||
443 | Userdata set/get. | ||
444 | */ | ||
445 | |||
446 | FMOD_RESULT F_API FMOD_ChannelGroup_SetUserData (FMOD_CHANNELGROUP *channelgroup, void *userdata); | ||
447 | FMOD_RESULT F_API FMOD_ChannelGroup_GetUserData (FMOD_CHANNELGROUP *channelgroup, void **userdata); | ||
448 | |||
449 | FMOD_RESULT F_API FMOD_ChannelGroup_Release (FMOD_CHANNELGROUP *channelgroup); | ||
450 | |||
451 | /* | ||
452 | Nested channel groups. | ||
453 | */ | ||
454 | |||
455 | FMOD_RESULT F_API FMOD_ChannelGroup_AddGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP *group, FMOD_BOOL propagatedspclock, FMOD_DSPCONNECTION **connection); | ||
456 | FMOD_RESULT F_API FMOD_ChannelGroup_GetNumGroups (FMOD_CHANNELGROUP *channelgroup, int *numgroups); | ||
457 | FMOD_RESULT F_API FMOD_ChannelGroup_GetGroup (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNELGROUP **group); | ||
458 | FMOD_RESULT F_API FMOD_ChannelGroup_GetParentGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP **group); | ||
459 | |||
460 | /* | ||
461 | Information only functions. | ||
462 | */ | ||
463 | |||
464 | FMOD_RESULT F_API FMOD_ChannelGroup_GetName (FMOD_CHANNELGROUP *channelgroup, char *name, int namelen); | ||
465 | FMOD_RESULT F_API FMOD_ChannelGroup_GetNumChannels (FMOD_CHANNELGROUP *channelgroup, int *numchannels); | ||
466 | FMOD_RESULT F_API FMOD_ChannelGroup_GetChannel (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNEL **channel); | ||
467 | |||
468 | /* | ||
469 | 'SoundGroup' API | ||
470 | */ | ||
471 | |||
472 | FMOD_RESULT F_API FMOD_SoundGroup_Release (FMOD_SOUNDGROUP *soundgroup); | ||
473 | FMOD_RESULT F_API FMOD_SoundGroup_GetSystemObject (FMOD_SOUNDGROUP *soundgroup, FMOD_SYSTEM **system); | ||
474 | |||
475 | /* | ||
476 | SoundGroup control functions. | ||
477 | */ | ||
478 | |||
479 | FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int maxaudible); | ||
480 | FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int *maxaudible); | ||
481 | FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR behavior); | ||
482 | FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior); | ||
483 | FMOD_RESULT F_API FMOD_SoundGroup_SetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float speed); | ||
484 | FMOD_RESULT F_API FMOD_SoundGroup_GetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float *speed); | ||
485 | FMOD_RESULT F_API FMOD_SoundGroup_SetVolume (FMOD_SOUNDGROUP *soundgroup, float volume); | ||
486 | FMOD_RESULT F_API FMOD_SoundGroup_GetVolume (FMOD_SOUNDGROUP *soundgroup, float *volume); | ||
487 | FMOD_RESULT F_API FMOD_SoundGroup_Stop (FMOD_SOUNDGROUP *soundgroup); | ||
488 | |||
489 | /* | ||
490 | Information only functions. | ||
491 | */ | ||
492 | |||
493 | FMOD_RESULT F_API FMOD_SoundGroup_GetName (FMOD_SOUNDGROUP *soundgroup, char *name, int namelen); | ||
494 | FMOD_RESULT F_API FMOD_SoundGroup_GetNumSounds (FMOD_SOUNDGROUP *soundgroup, int *numsounds); | ||
495 | FMOD_RESULT F_API FMOD_SoundGroup_GetSound (FMOD_SOUNDGROUP *soundgroup, int index, FMOD_SOUND **sound); | ||
496 | FMOD_RESULT F_API FMOD_SoundGroup_GetNumPlaying (FMOD_SOUNDGROUP *soundgroup, int *numplaying); | ||
497 | |||
498 | /* | ||
499 | Userdata set/get. | ||
500 | */ | ||
501 | |||
502 | FMOD_RESULT F_API FMOD_SoundGroup_SetUserData (FMOD_SOUNDGROUP *soundgroup, void *userdata); | ||
503 | FMOD_RESULT F_API FMOD_SoundGroup_GetUserData (FMOD_SOUNDGROUP *soundgroup, void **userdata); | ||
504 | |||
505 | /* | ||
506 | 'DSP' API | ||
507 | */ | ||
508 | |||
509 | FMOD_RESULT F_API FMOD_DSP_Release (FMOD_DSP *dsp); | ||
510 | FMOD_RESULT F_API FMOD_DSP_GetSystemObject (FMOD_DSP *dsp, FMOD_SYSTEM **system); | ||
511 | |||
512 | /* | ||
513 | Connection / disconnection / input and output enumeration. | ||
514 | */ | ||
515 | |||
516 | FMOD_RESULT F_API FMOD_DSP_AddInput (FMOD_DSP *dsp, FMOD_DSP *input, FMOD_DSPCONNECTION **connection, FMOD_DSPCONNECTION_TYPE type); | ||
517 | FMOD_RESULT F_API FMOD_DSP_DisconnectFrom (FMOD_DSP *dsp, FMOD_DSP *target, FMOD_DSPCONNECTION *connection); | ||
518 | FMOD_RESULT F_API FMOD_DSP_DisconnectAll (FMOD_DSP *dsp, FMOD_BOOL inputs, FMOD_BOOL outputs); | ||
519 | FMOD_RESULT F_API FMOD_DSP_GetNumInputs (FMOD_DSP *dsp, int *numinputs); | ||
520 | FMOD_RESULT F_API FMOD_DSP_GetNumOutputs (FMOD_DSP *dsp, int *numoutputs); | ||
521 | FMOD_RESULT F_API FMOD_DSP_GetInput (FMOD_DSP *dsp, int index, FMOD_DSP **input, FMOD_DSPCONNECTION **inputconnection); | ||
522 | FMOD_RESULT F_API FMOD_DSP_GetOutput (FMOD_DSP *dsp, int index, FMOD_DSP **output, FMOD_DSPCONNECTION **outputconnection); | ||
523 | |||
524 | /* | ||
525 | DSP unit control. | ||
526 | */ | ||
527 | |||
528 | FMOD_RESULT F_API FMOD_DSP_SetActive (FMOD_DSP *dsp, FMOD_BOOL active); | ||
529 | FMOD_RESULT F_API FMOD_DSP_GetActive (FMOD_DSP *dsp, FMOD_BOOL *active); | ||
530 | FMOD_RESULT F_API FMOD_DSP_SetBypass (FMOD_DSP *dsp, FMOD_BOOL bypass); | ||
531 | FMOD_RESULT F_API FMOD_DSP_GetBypass (FMOD_DSP *dsp, FMOD_BOOL *bypass); | ||
532 | FMOD_RESULT F_API FMOD_DSP_SetWetDryMix (FMOD_DSP *dsp, float prewet, float postwet, float dry); | ||
533 | FMOD_RESULT F_API FMOD_DSP_GetWetDryMix (FMOD_DSP *dsp, float *prewet, float *postwet, float *dry); | ||
534 | FMOD_RESULT F_API FMOD_DSP_SetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode); | ||
535 | FMOD_RESULT F_API FMOD_DSP_GetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode); | ||
536 | 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); | ||
537 | FMOD_RESULT F_API FMOD_DSP_Reset (FMOD_DSP *dsp); | ||
538 | |||
539 | /* | ||
540 | DSP parameter control. | ||
541 | */ | ||
542 | |||
543 | FMOD_RESULT F_API FMOD_DSP_SetParameterFloat (FMOD_DSP *dsp, int index, float value); | ||
544 | FMOD_RESULT F_API FMOD_DSP_SetParameterInt (FMOD_DSP *dsp, int index, int value); | ||
545 | FMOD_RESULT F_API FMOD_DSP_SetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL value); | ||
546 | FMOD_RESULT F_API FMOD_DSP_SetParameterData (FMOD_DSP *dsp, int index, void *data, unsigned int length); | ||
547 | FMOD_RESULT F_API FMOD_DSP_GetParameterFloat (FMOD_DSP *dsp, int index, float *value, char *valuestr, int valuestrlen); | ||
548 | FMOD_RESULT F_API FMOD_DSP_GetParameterInt (FMOD_DSP *dsp, int index, int *value, char *valuestr, int valuestrlen); | ||
549 | FMOD_RESULT F_API FMOD_DSP_GetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL *value, char *valuestr, int valuestrlen); | ||
550 | FMOD_RESULT F_API FMOD_DSP_GetParameterData (FMOD_DSP *dsp, int index, void **data, unsigned int *length, char *valuestr, int valuestrlen); | ||
551 | FMOD_RESULT F_API FMOD_DSP_GetNumParameters (FMOD_DSP *dsp, int *numparams); | ||
552 | FMOD_RESULT F_API FMOD_DSP_GetParameterInfo (FMOD_DSP *dsp, int index, FMOD_DSP_PARAMETER_DESC **desc); | ||
553 | FMOD_RESULT F_API FMOD_DSP_GetDataParameterIndex (FMOD_DSP *dsp, int datatype, int *index); | ||
554 | FMOD_RESULT F_API FMOD_DSP_ShowConfigDialog (FMOD_DSP *dsp, void *hwnd, FMOD_BOOL show); | ||
555 | |||
556 | /* | ||
557 | DSP attributes. | ||
558 | */ | ||
559 | |||
560 | FMOD_RESULT F_API FMOD_DSP_GetInfo (FMOD_DSP *dsp, char *name, unsigned int *version, int *channels, int *configwidth, int *configheight); | ||
561 | FMOD_RESULT F_API FMOD_DSP_GetType (FMOD_DSP *dsp, FMOD_DSP_TYPE *type); | ||
562 | FMOD_RESULT F_API FMOD_DSP_GetIdle (FMOD_DSP *dsp, FMOD_BOOL *idle); | ||
563 | |||
564 | /* | ||
565 | Userdata set/get. | ||
566 | */ | ||
567 | |||
568 | FMOD_RESULT F_API FMOD_DSP_SetUserData (FMOD_DSP *dsp, void *userdata); | ||
569 | FMOD_RESULT F_API FMOD_DSP_GetUserData (FMOD_DSP *dsp, void **userdata); | ||
570 | |||
571 | /* | ||
572 | Metering. | ||
573 | */ | ||
574 | |||
575 | FMOD_RESULT F_API FMOD_DSP_SetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL inputEnabled, FMOD_BOOL outputEnabled); | ||
576 | FMOD_RESULT F_API FMOD_DSP_GetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL *inputEnabled, FMOD_BOOL *outputEnabled); | ||
577 | FMOD_RESULT F_API FMOD_DSP_GetMeteringInfo (FMOD_DSP *dsp, FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo); | ||
578 | FMOD_RESULT F_API FMOD_DSP_GetCPUUsage (FMOD_DSP *dsp, unsigned int *exclusive, unsigned int *inclusive); | ||
579 | |||
580 | /* | ||
581 | 'DSPConnection' API | ||
582 | */ | ||
583 | |||
584 | FMOD_RESULT F_API FMOD_DSPConnection_GetInput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **input); | ||
585 | FMOD_RESULT F_API FMOD_DSPConnection_GetOutput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **output); | ||
586 | FMOD_RESULT F_API FMOD_DSPConnection_SetMix (FMOD_DSPCONNECTION *dspconnection, float volume); | ||
587 | FMOD_RESULT F_API FMOD_DSPConnection_GetMix (FMOD_DSPCONNECTION *dspconnection, float *volume); | ||
588 | FMOD_RESULT F_API FMOD_DSPConnection_SetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int outchannels, int inchannels, int inchannel_hop); | ||
589 | FMOD_RESULT F_API FMOD_DSPConnection_GetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int *outchannels, int *inchannels, int inchannel_hop); | ||
590 | FMOD_RESULT F_API FMOD_DSPConnection_GetType (FMOD_DSPCONNECTION *dspconnection, FMOD_DSPCONNECTION_TYPE *type); | ||
591 | |||
592 | /* | ||
593 | Userdata set/get. | ||
594 | */ | ||
595 | |||
596 | FMOD_RESULT F_API FMOD_DSPConnection_SetUserData (FMOD_DSPCONNECTION *dspconnection, void *userdata); | ||
597 | FMOD_RESULT F_API FMOD_DSPConnection_GetUserData (FMOD_DSPCONNECTION *dspconnection, void **userdata); | ||
598 | |||
599 | /* | ||
600 | 'Geometry' API | ||
601 | */ | ||
602 | |||
603 | FMOD_RESULT F_API FMOD_Geometry_Release (FMOD_GEOMETRY *geometry); | ||
604 | |||
605 | /* | ||
606 | Polygon manipulation. | ||
607 | */ | ||
608 | |||
609 | 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); | ||
610 | FMOD_RESULT F_API FMOD_Geometry_GetNumPolygons (FMOD_GEOMETRY *geometry, int *numpolygons); | ||
611 | FMOD_RESULT F_API FMOD_Geometry_GetMaxPolygons (FMOD_GEOMETRY *geometry, int *maxpolygons, int *maxvertices); | ||
612 | FMOD_RESULT F_API FMOD_Geometry_GetPolygonNumVertices (FMOD_GEOMETRY *geometry, int index, int *numvertices); | ||
613 | FMOD_RESULT F_API FMOD_Geometry_SetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, const FMOD_VECTOR *vertex); | ||
614 | FMOD_RESULT F_API FMOD_Geometry_GetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, FMOD_VECTOR *vertex); | ||
615 | FMOD_RESULT F_API FMOD_Geometry_SetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided); | ||
616 | FMOD_RESULT F_API FMOD_Geometry_GetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float *directocclusion, float *reverbocclusion, FMOD_BOOL *doublesided); | ||
617 | |||
618 | /* | ||
619 | Object manipulation. | ||
620 | */ | ||
621 | |||
622 | FMOD_RESULT F_API FMOD_Geometry_SetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL active); | ||
623 | FMOD_RESULT F_API FMOD_Geometry_GetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL *active); | ||
624 | FMOD_RESULT F_API FMOD_Geometry_SetRotation (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *forward, const FMOD_VECTOR *up); | ||
625 | FMOD_RESULT F_API FMOD_Geometry_GetRotation (FMOD_GEOMETRY *geometry, FMOD_VECTOR *forward, FMOD_VECTOR *up); | ||
626 | FMOD_RESULT F_API FMOD_Geometry_SetPosition (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *position); | ||
627 | FMOD_RESULT F_API FMOD_Geometry_GetPosition (FMOD_GEOMETRY *geometry, FMOD_VECTOR *position); | ||
628 | FMOD_RESULT F_API FMOD_Geometry_SetScale (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *scale); | ||
629 | FMOD_RESULT F_API FMOD_Geometry_GetScale (FMOD_GEOMETRY *geometry, FMOD_VECTOR *scale); | ||
630 | FMOD_RESULT F_API FMOD_Geometry_Save (FMOD_GEOMETRY *geometry, void *data, int *datasize); | ||
631 | |||
632 | /* | ||
633 | Userdata set/get. | ||
634 | */ | ||
635 | |||
636 | FMOD_RESULT F_API FMOD_Geometry_SetUserData (FMOD_GEOMETRY *geometry, void *userdata); | ||
637 | FMOD_RESULT F_API FMOD_Geometry_GetUserData (FMOD_GEOMETRY *geometry, void **userdata); | ||
638 | |||
639 | /* | ||
640 | 'Reverb3D' API | ||
641 | */ | ||
642 | |||
643 | FMOD_RESULT F_API FMOD_Reverb3D_Release (FMOD_REVERB3D *reverb3d); | ||
644 | |||
645 | /* | ||
646 | Reverb manipulation. | ||
647 | */ | ||
648 | |||
649 | FMOD_RESULT F_API FMOD_Reverb3D_Set3DAttributes (FMOD_REVERB3D *reverb3d, const FMOD_VECTOR *position, float mindistance, float maxdistance); | ||
650 | FMOD_RESULT F_API FMOD_Reverb3D_Get3DAttributes (FMOD_REVERB3D *reverb3d, FMOD_VECTOR *position, float *mindistance, float *maxdistance); | ||
651 | FMOD_RESULT F_API FMOD_Reverb3D_SetProperties (FMOD_REVERB3D *reverb3d, const FMOD_REVERB_PROPERTIES *properties); | ||
652 | FMOD_RESULT F_API FMOD_Reverb3D_GetProperties (FMOD_REVERB3D *reverb3d, FMOD_REVERB_PROPERTIES *properties); | ||
653 | FMOD_RESULT F_API FMOD_Reverb3D_SetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL active); | ||
654 | FMOD_RESULT F_API FMOD_Reverb3D_GetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL *active); | ||
655 | |||
656 | /* | ||
657 | Userdata set/get. | ||
658 | */ | ||
659 | |||
660 | FMOD_RESULT F_API FMOD_Reverb3D_SetUserData (FMOD_REVERB3D *reverb3d, void *userdata); | ||
661 | FMOD_RESULT F_API FMOD_Reverb3D_GetUserData (FMOD_REVERB3D *reverb3d, void **userdata); | ||
662 | |||
663 | #ifdef __cplusplus | ||
664 | } | ||
665 | #endif | ||
666 | |||
667 | #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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Core API - C++ header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header in conjunction with fmod_common.h (which contains all the constants / */ | ||
6 | /* callbacks) to develop using the C++ language. */ | ||
7 | /* */ | ||
8 | /* For more detail visit: */ | ||
9 | /* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */ | ||
10 | /* ======================================================================================== */ | ||
11 | #ifndef _FMOD_HPP | ||
12 | #define _FMOD_HPP | ||
13 | |||
14 | #include "fmod_common.h" | ||
15 | #include "fmod.h" | ||
16 | |||
17 | /* | ||
18 | FMOD Namespace | ||
19 | */ | ||
20 | namespace FMOD | ||
21 | { | ||
22 | class System; | ||
23 | class Sound; | ||
24 | class ChannelControl; | ||
25 | class Channel; | ||
26 | class ChannelGroup; | ||
27 | class SoundGroup; | ||
28 | class DSP; | ||
29 | class DSPConnection; | ||
30 | class Geometry; | ||
31 | class Reverb3D; | ||
32 | |||
33 | /* | ||
34 | FMOD global system functions (optional). | ||
35 | */ | ||
36 | 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); } | ||
37 | inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced, bool blocking = true) { return FMOD_Memory_GetStats(currentalloced, maxalloced, blocking); } | ||
38 | 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); } | ||
39 | inline FMOD_RESULT File_SetDiskBusy (int busy) { return FMOD_File_SetDiskBusy(busy); } | ||
40 | inline FMOD_RESULT File_GetDiskBusy (int *busy) { return FMOD_File_GetDiskBusy(busy); } | ||
41 | 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); } | ||
42 | |||
43 | /* | ||
44 | FMOD System factory functions. | ||
45 | */ | ||
46 | inline FMOD_RESULT System_Create (System **system, unsigned int headerversion = FMOD_VERSION) { return FMOD_System_Create((FMOD_SYSTEM **)system, headerversion); } | ||
47 | |||
48 | /* | ||
49 | 'System' API | ||
50 | */ | ||
51 | class System | ||
52 | { | ||
53 | private: | ||
54 | |||
55 | // Constructor made private so user cannot statically instance a System class. System_Create must be used. | ||
56 | System(); | ||
57 | System(const System &); | ||
58 | |||
59 | public: | ||
60 | |||
61 | FMOD_RESULT F_API release (); | ||
62 | |||
63 | // Setup functions. | ||
64 | FMOD_RESULT F_API setOutput (FMOD_OUTPUTTYPE output); | ||
65 | FMOD_RESULT F_API getOutput (FMOD_OUTPUTTYPE *output); | ||
66 | FMOD_RESULT F_API getNumDrivers (int *numdrivers); | ||
67 | FMOD_RESULT F_API getDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels); | ||
68 | FMOD_RESULT F_API setDriver (int driver); | ||
69 | FMOD_RESULT F_API getDriver (int *driver); | ||
70 | FMOD_RESULT F_API setSoftwareChannels (int numsoftwarechannels); | ||
71 | FMOD_RESULT F_API getSoftwareChannels (int *numsoftwarechannels); | ||
72 | FMOD_RESULT F_API setSoftwareFormat (int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers); | ||
73 | FMOD_RESULT F_API getSoftwareFormat (int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers); | ||
74 | FMOD_RESULT F_API setDSPBufferSize (unsigned int bufferlength, int numbuffers); | ||
75 | FMOD_RESULT F_API getDSPBufferSize (unsigned int *bufferlength, int *numbuffers); | ||
76 | 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); | ||
77 | 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); | ||
78 | FMOD_RESULT F_API setAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings); | ||
79 | FMOD_RESULT F_API getAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings); | ||
80 | FMOD_RESULT F_API setCallback (FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_SYSTEM_CALLBACK_ALL); | ||
81 | |||
82 | // Plug-in support. | ||
83 | FMOD_RESULT F_API setPluginPath (const char *path); | ||
84 | FMOD_RESULT F_API loadPlugin (const char *filename, unsigned int *handle, unsigned int priority = 0); | ||
85 | FMOD_RESULT F_API unloadPlugin (unsigned int handle); | ||
86 | FMOD_RESULT F_API getNumNestedPlugins (unsigned int handle, int *count); | ||
87 | FMOD_RESULT F_API getNestedPlugin (unsigned int handle, int index, unsigned int *nestedhandle); | ||
88 | FMOD_RESULT F_API getNumPlugins (FMOD_PLUGINTYPE plugintype, int *numplugins); | ||
89 | FMOD_RESULT F_API getPluginHandle (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle); | ||
90 | FMOD_RESULT F_API getPluginInfo (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version); | ||
91 | FMOD_RESULT F_API setOutputByPlugin (unsigned int handle); | ||
92 | FMOD_RESULT F_API getOutputByPlugin (unsigned int *handle); | ||
93 | FMOD_RESULT F_API createDSPByPlugin (unsigned int handle, DSP **dsp); | ||
94 | FMOD_RESULT F_API getDSPInfoByPlugin (unsigned int handle, const FMOD_DSP_DESCRIPTION **description); | ||
95 | FMOD_RESULT F_API registerCodec (FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority = 0); | ||
96 | FMOD_RESULT F_API registerDSP (const FMOD_DSP_DESCRIPTION *description, unsigned int *handle); | ||
97 | FMOD_RESULT F_API registerOutput (const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle); | ||
98 | |||
99 | // Init/Close. | ||
100 | FMOD_RESULT F_API init (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata); | ||
101 | FMOD_RESULT F_API close (); | ||
102 | |||
103 | // General post-init system functions. | ||
104 | FMOD_RESULT F_API update (); /* IMPORTANT! CALL THIS ONCE PER FRAME! */ | ||
105 | |||
106 | FMOD_RESULT F_API setSpeakerPosition (FMOD_SPEAKER speaker, float x, float y, bool active); | ||
107 | FMOD_RESULT F_API getSpeakerPosition (FMOD_SPEAKER speaker, float *x, float *y, bool *active); | ||
108 | FMOD_RESULT F_API setStreamBufferSize (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype); | ||
109 | FMOD_RESULT F_API getStreamBufferSize (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype); | ||
110 | FMOD_RESULT F_API set3DSettings (float dopplerscale, float distancefactor, float rolloffscale); | ||
111 | FMOD_RESULT F_API get3DSettings (float *dopplerscale, float *distancefactor, float *rolloffscale); | ||
112 | FMOD_RESULT F_API set3DNumListeners (int numlisteners); | ||
113 | FMOD_RESULT F_API get3DNumListeners (int *numlisteners); | ||
114 | FMOD_RESULT F_API set3DListenerAttributes (int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up); | ||
115 | FMOD_RESULT F_API get3DListenerAttributes (int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up); | ||
116 | FMOD_RESULT F_API set3DRolloffCallback (FMOD_3D_ROLLOFF_CALLBACK callback); | ||
117 | FMOD_RESULT F_API mixerSuspend (); | ||
118 | FMOD_RESULT F_API mixerResume (); | ||
119 | FMOD_RESULT F_API getDefaultMixMatrix (FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop); | ||
120 | FMOD_RESULT F_API getSpeakerModeChannels (FMOD_SPEAKERMODE mode, int *channels); | ||
121 | |||
122 | // System information functions. | ||
123 | FMOD_RESULT F_API getVersion (unsigned int *version); | ||
124 | FMOD_RESULT F_API getOutputHandle (void **handle); | ||
125 | FMOD_RESULT F_API getChannelsPlaying (int *channels, int *realchannels = 0); | ||
126 | FMOD_RESULT F_API getCPUUsage (FMOD_CPU_USAGE *usage); | ||
127 | FMOD_RESULT F_API getFileUsage (long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead); | ||
128 | |||
129 | // Sound/DSP/Channel/FX creation and retrieval. | ||
130 | FMOD_RESULT F_API createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound); | ||
131 | FMOD_RESULT F_API createStream (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound); | ||
132 | FMOD_RESULT F_API createDSP (const FMOD_DSP_DESCRIPTION *description, DSP **dsp); | ||
133 | FMOD_RESULT F_API createDSPByType (FMOD_DSP_TYPE type, DSP **dsp); | ||
134 | FMOD_RESULT F_API createChannelGroup (const char *name, ChannelGroup **channelgroup); | ||
135 | FMOD_RESULT F_API createSoundGroup (const char *name, SoundGroup **soundgroup); | ||
136 | FMOD_RESULT F_API createReverb3D (Reverb3D **reverb); | ||
137 | |||
138 | FMOD_RESULT F_API playSound (Sound *sound, ChannelGroup *channelgroup, bool paused, Channel **channel); | ||
139 | FMOD_RESULT F_API playDSP (DSP *dsp, ChannelGroup *channelgroup, bool paused, Channel **channel); | ||
140 | FMOD_RESULT F_API getChannel (int channelid, Channel **channel); | ||
141 | FMOD_RESULT F_API getDSPInfoByType (FMOD_DSP_TYPE type, const FMOD_DSP_DESCRIPTION **description); | ||
142 | FMOD_RESULT F_API getMasterChannelGroup (ChannelGroup **channelgroup); | ||
143 | FMOD_RESULT F_API getMasterSoundGroup (SoundGroup **soundgroup); | ||
144 | |||
145 | // Routing to ports. | ||
146 | FMOD_RESULT F_API attachChannelGroupToPort (FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, ChannelGroup *channelgroup, bool passThru = false); | ||
147 | FMOD_RESULT F_API detachChannelGroupFromPort (ChannelGroup *channelgroup); | ||
148 | |||
149 | // Reverb API. | ||
150 | FMOD_RESULT F_API setReverbProperties (int instance, const FMOD_REVERB_PROPERTIES *prop); | ||
151 | FMOD_RESULT F_API getReverbProperties (int instance, FMOD_REVERB_PROPERTIES *prop); | ||
152 | |||
153 | // System level DSP functionality. | ||
154 | FMOD_RESULT F_API lockDSP (); | ||
155 | FMOD_RESULT F_API unlockDSP (); | ||
156 | |||
157 | // Recording API. | ||
158 | FMOD_RESULT F_API getRecordNumDrivers (int *numdrivers, int *numconnected); | ||
159 | 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); | ||
160 | FMOD_RESULT F_API getRecordPosition (int id, unsigned int *position); | ||
161 | FMOD_RESULT F_API recordStart (int id, Sound *sound, bool loop); | ||
162 | FMOD_RESULT F_API recordStop (int id); | ||
163 | FMOD_RESULT F_API isRecording (int id, bool *recording); | ||
164 | |||
165 | // Geometry API. | ||
166 | FMOD_RESULT F_API createGeometry (int maxpolygons, int maxvertices, Geometry **geometry); | ||
167 | FMOD_RESULT F_API setGeometrySettings (float maxworldsize); | ||
168 | FMOD_RESULT F_API getGeometrySettings (float *maxworldsize); | ||
169 | FMOD_RESULT F_API loadGeometry (const void *data, int datasize, Geometry **geometry); | ||
170 | FMOD_RESULT F_API getGeometryOcclusion (const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb); | ||
171 | |||
172 | // Network functions. | ||
173 | FMOD_RESULT F_API setNetworkProxy (const char *proxy); | ||
174 | FMOD_RESULT F_API getNetworkProxy (char *proxy, int proxylen); | ||
175 | FMOD_RESULT F_API setNetworkTimeout (int timeout); | ||
176 | FMOD_RESULT F_API getNetworkTimeout (int *timeout); | ||
177 | |||
178 | // Userdata set/get. | ||
179 | FMOD_RESULT F_API setUserData (void *userdata); | ||
180 | FMOD_RESULT F_API getUserData (void **userdata); | ||
181 | }; | ||
182 | |||
183 | /* | ||
184 | 'Sound' API | ||
185 | */ | ||
186 | class Sound | ||
187 | { | ||
188 | private: | ||
189 | |||
190 | // Constructor made private so user cannot statically instance a Sound class. Appropriate Sound creation or retrieval function must be used. | ||
191 | Sound(); | ||
192 | Sound(const Sound &); | ||
193 | |||
194 | public: | ||
195 | |||
196 | FMOD_RESULT F_API release (); | ||
197 | FMOD_RESULT F_API getSystemObject (System **system); | ||
198 | |||
199 | // Standard sound manipulation functions. | ||
200 | FMOD_RESULT F_API lock (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2); | ||
201 | FMOD_RESULT F_API unlock (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2); | ||
202 | FMOD_RESULT F_API setDefaults (float frequency, int priority); | ||
203 | FMOD_RESULT F_API getDefaults (float *frequency, int *priority); | ||
204 | FMOD_RESULT F_API set3DMinMaxDistance (float min, float max); | ||
205 | FMOD_RESULT F_API get3DMinMaxDistance (float *min, float *max); | ||
206 | FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume); | ||
207 | FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume); | ||
208 | FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints); | ||
209 | FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints); | ||
210 | FMOD_RESULT F_API getSubSound (int index, Sound **subsound); | ||
211 | FMOD_RESULT F_API getSubSoundParent (Sound **parentsound); | ||
212 | FMOD_RESULT F_API getName (char *name, int namelen); | ||
213 | FMOD_RESULT F_API getLength (unsigned int *length, FMOD_TIMEUNIT lengthtype); | ||
214 | FMOD_RESULT F_API getFormat (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits); | ||
215 | FMOD_RESULT F_API getNumSubSounds (int *numsubsounds); | ||
216 | FMOD_RESULT F_API getNumTags (int *numtags, int *numtagsupdated); | ||
217 | FMOD_RESULT F_API getTag (const char *name, int index, FMOD_TAG *tag); | ||
218 | FMOD_RESULT F_API getOpenState (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy); | ||
219 | FMOD_RESULT F_API readData (void *buffer, unsigned int length, unsigned int *read); | ||
220 | FMOD_RESULT F_API seekData (unsigned int pcm); | ||
221 | |||
222 | FMOD_RESULT F_API setSoundGroup (SoundGroup *soundgroup); | ||
223 | FMOD_RESULT F_API getSoundGroup (SoundGroup **soundgroup); | ||
224 | |||
225 | // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks. | ||
226 | FMOD_RESULT F_API getNumSyncPoints (int *numsyncpoints); | ||
227 | FMOD_RESULT F_API getSyncPoint (int index, FMOD_SYNCPOINT **point); | ||
228 | FMOD_RESULT F_API getSyncPointInfo (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype); | ||
229 | FMOD_RESULT F_API addSyncPoint (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point); | ||
230 | FMOD_RESULT F_API deleteSyncPoint (FMOD_SYNCPOINT *point); | ||
231 | |||
232 | // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time. | ||
233 | FMOD_RESULT F_API setMode (FMOD_MODE mode); | ||
234 | FMOD_RESULT F_API getMode (FMOD_MODE *mode); | ||
235 | FMOD_RESULT F_API setLoopCount (int loopcount); | ||
236 | FMOD_RESULT F_API getLoopCount (int *loopcount); | ||
237 | FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype); | ||
238 | FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype); | ||
239 | |||
240 | // For MOD/S3M/XM/IT/MID sequenced formats only. | ||
241 | FMOD_RESULT F_API getMusicNumChannels (int *numchannels); | ||
242 | FMOD_RESULT F_API setMusicChannelVolume (int channel, float volume); | ||
243 | FMOD_RESULT F_API getMusicChannelVolume (int channel, float *volume); | ||
244 | FMOD_RESULT F_API setMusicSpeed (float speed); | ||
245 | FMOD_RESULT F_API getMusicSpeed (float *speed); | ||
246 | |||
247 | // Userdata set/get. | ||
248 | FMOD_RESULT F_API setUserData (void *userdata); | ||
249 | FMOD_RESULT F_API getUserData (void **userdata); | ||
250 | }; | ||
251 | |||
252 | |||
253 | /* | ||
254 | '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. | ||
255 | */ | ||
256 | class ChannelControl | ||
257 | { | ||
258 | private: | ||
259 | |||
260 | // Constructor made private so user cannot statically instance a Control class. | ||
261 | ChannelControl(); | ||
262 | ChannelControl(const ChannelControl &); | ||
263 | |||
264 | public: | ||
265 | |||
266 | FMOD_RESULT F_API getSystemObject (System **system); | ||
267 | |||
268 | // General control functionality for Channels and ChannelGroups. | ||
269 | FMOD_RESULT F_API stop (); | ||
270 | FMOD_RESULT F_API setPaused (bool paused); | ||
271 | FMOD_RESULT F_API getPaused (bool *paused); | ||
272 | FMOD_RESULT F_API setVolume (float volume); | ||
273 | FMOD_RESULT F_API getVolume (float *volume); | ||
274 | FMOD_RESULT F_API setVolumeRamp (bool ramp); | ||
275 | FMOD_RESULT F_API getVolumeRamp (bool *ramp); | ||
276 | FMOD_RESULT F_API getAudibility (float *audibility); | ||
277 | FMOD_RESULT F_API setPitch (float pitch); | ||
278 | FMOD_RESULT F_API getPitch (float *pitch); | ||
279 | FMOD_RESULT F_API setMute (bool mute); | ||
280 | FMOD_RESULT F_API getMute (bool *mute); | ||
281 | FMOD_RESULT F_API setReverbProperties (int instance, float wet); | ||
282 | FMOD_RESULT F_API getReverbProperties (int instance, float *wet); | ||
283 | FMOD_RESULT F_API setLowPassGain (float gain); | ||
284 | FMOD_RESULT F_API getLowPassGain (float *gain); | ||
285 | FMOD_RESULT F_API setMode (FMOD_MODE mode); | ||
286 | FMOD_RESULT F_API getMode (FMOD_MODE *mode); | ||
287 | FMOD_RESULT F_API setCallback (FMOD_CHANNELCONTROL_CALLBACK callback); | ||
288 | FMOD_RESULT F_API isPlaying (bool *isplaying); | ||
289 | |||
290 | // Panning and level adjustment. | ||
291 | // 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. | ||
292 | FMOD_RESULT F_API setPan (float pan); | ||
293 | FMOD_RESULT F_API setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); | ||
294 | FMOD_RESULT F_API setMixLevelsInput (float *levels, int numlevels); | ||
295 | FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0); | ||
296 | FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0); | ||
297 | |||
298 | // Clock based functionality. | ||
299 | FMOD_RESULT F_API getDSPClock (unsigned long long *dspclock, unsigned long long *parentclock); | ||
300 | FMOD_RESULT F_API setDelay (unsigned long long dspclock_start, unsigned long long dspclock_end, bool stopchannels = true); | ||
301 | FMOD_RESULT F_API getDelay (unsigned long long *dspclock_start, unsigned long long *dspclock_end, bool *stopchannels = 0); | ||
302 | FMOD_RESULT F_API addFadePoint (unsigned long long dspclock, float volume); | ||
303 | FMOD_RESULT F_API setFadePointRamp (unsigned long long dspclock, float volume); | ||
304 | FMOD_RESULT F_API removeFadePoints (unsigned long long dspclock_start, unsigned long long dspclock_end); | ||
305 | FMOD_RESULT F_API getFadePoints (unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume); | ||
306 | |||
307 | // DSP effects. | ||
308 | FMOD_RESULT F_API getDSP (int index, DSP **dsp); | ||
309 | FMOD_RESULT F_API addDSP (int index, DSP *dsp); | ||
310 | FMOD_RESULT F_API removeDSP (DSP *dsp); | ||
311 | FMOD_RESULT F_API getNumDSPs (int *numdsps); | ||
312 | FMOD_RESULT F_API setDSPIndex (DSP *dsp, int index); | ||
313 | FMOD_RESULT F_API getDSPIndex (DSP *dsp, int *index); | ||
314 | |||
315 | // 3D functionality. | ||
316 | FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel); | ||
317 | FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel); | ||
318 | FMOD_RESULT F_API set3DMinMaxDistance (float mindistance, float maxdistance); | ||
319 | FMOD_RESULT F_API get3DMinMaxDistance (float *mindistance, float *maxdistance); | ||
320 | FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume); | ||
321 | FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume); | ||
322 | FMOD_RESULT F_API set3DConeOrientation (FMOD_VECTOR *orientation); | ||
323 | FMOD_RESULT F_API get3DConeOrientation (FMOD_VECTOR *orientation); | ||
324 | FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints); | ||
325 | FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints); | ||
326 | FMOD_RESULT F_API set3DOcclusion (float directocclusion, float reverbocclusion); | ||
327 | FMOD_RESULT F_API get3DOcclusion (float *directocclusion, float *reverbocclusion); | ||
328 | FMOD_RESULT F_API set3DSpread (float angle); | ||
329 | FMOD_RESULT F_API get3DSpread (float *angle); | ||
330 | FMOD_RESULT F_API set3DLevel (float level); | ||
331 | FMOD_RESULT F_API get3DLevel (float *level); | ||
332 | FMOD_RESULT F_API set3DDopplerLevel (float level); | ||
333 | FMOD_RESULT F_API get3DDopplerLevel (float *level); | ||
334 | FMOD_RESULT F_API set3DDistanceFilter (bool custom, float customLevel, float centerFreq); | ||
335 | FMOD_RESULT F_API get3DDistanceFilter (bool *custom, float *customLevel, float *centerFreq); | ||
336 | |||
337 | // Userdata set/get. | ||
338 | FMOD_RESULT F_API setUserData (void *userdata); | ||
339 | FMOD_RESULT F_API getUserData (void **userdata); | ||
340 | }; | ||
341 | |||
342 | /* | ||
343 | 'Channel' API. | ||
344 | */ | ||
345 | class Channel : public ChannelControl | ||
346 | { | ||
347 | private: | ||
348 | |||
349 | // Constructor made private so user cannot statically instance a Channel class. Appropriate Channel creation or retrieval function must be used. | ||
350 | Channel(); | ||
351 | Channel(const Channel &); | ||
352 | |||
353 | public: | ||
354 | |||
355 | // Channel specific control functionality. | ||
356 | FMOD_RESULT F_API setFrequency (float frequency); | ||
357 | FMOD_RESULT F_API getFrequency (float *frequency); | ||
358 | FMOD_RESULT F_API setPriority (int priority); | ||
359 | FMOD_RESULT F_API getPriority (int *priority); | ||
360 | FMOD_RESULT F_API setPosition (unsigned int position, FMOD_TIMEUNIT postype); | ||
361 | FMOD_RESULT F_API getPosition (unsigned int *position, FMOD_TIMEUNIT postype); | ||
362 | FMOD_RESULT F_API setChannelGroup (ChannelGroup *channelgroup); | ||
363 | FMOD_RESULT F_API getChannelGroup (ChannelGroup **channelgroup); | ||
364 | FMOD_RESULT F_API setLoopCount (int loopcount); | ||
365 | FMOD_RESULT F_API getLoopCount (int *loopcount); | ||
366 | FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype); | ||
367 | FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype); | ||
368 | |||
369 | // Information only functions. | ||
370 | FMOD_RESULT F_API isVirtual (bool *isvirtual); | ||
371 | FMOD_RESULT F_API getCurrentSound (Sound **sound); | ||
372 | FMOD_RESULT F_API getIndex (int *index); | ||
373 | }; | ||
374 | |||
375 | /* | ||
376 | 'ChannelGroup' API | ||
377 | */ | ||
378 | class ChannelGroup : public ChannelControl | ||
379 | { | ||
380 | private: | ||
381 | |||
382 | // Constructor made private so user cannot statically instance a ChannelGroup class. Appropriate ChannelGroup creation or retrieval function must be used. | ||
383 | ChannelGroup(); | ||
384 | ChannelGroup(const ChannelGroup &); | ||
385 | |||
386 | public: | ||
387 | |||
388 | FMOD_RESULT F_API release (); | ||
389 | |||
390 | // Nested channel groups. | ||
391 | FMOD_RESULT F_API addGroup (ChannelGroup *group, bool propagatedspclock = true, DSPConnection **connection = 0); | ||
392 | FMOD_RESULT F_API getNumGroups (int *numgroups); | ||
393 | FMOD_RESULT F_API getGroup (int index, ChannelGroup **group); | ||
394 | FMOD_RESULT F_API getParentGroup (ChannelGroup **group); | ||
395 | |||
396 | // Information only functions. | ||
397 | FMOD_RESULT F_API getName (char *name, int namelen); | ||
398 | FMOD_RESULT F_API getNumChannels (int *numchannels); | ||
399 | FMOD_RESULT F_API getChannel (int index, Channel **channel); | ||
400 | }; | ||
401 | |||
402 | /* | ||
403 | 'SoundGroup' API | ||
404 | */ | ||
405 | class SoundGroup | ||
406 | { | ||
407 | private: | ||
408 | |||
409 | // Constructor made private so user cannot statically instance a SoundGroup class. Appropriate SoundGroup creation or retrieval function must be used. | ||
410 | SoundGroup(); | ||
411 | SoundGroup(const SoundGroup &); | ||
412 | |||
413 | public: | ||
414 | |||
415 | FMOD_RESULT F_API release (); | ||
416 | FMOD_RESULT F_API getSystemObject (System **system); | ||
417 | |||
418 | // SoundGroup control functions. | ||
419 | FMOD_RESULT F_API setMaxAudible (int maxaudible); | ||
420 | FMOD_RESULT F_API getMaxAudible (int *maxaudible); | ||
421 | FMOD_RESULT F_API setMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR behavior); | ||
422 | FMOD_RESULT F_API getMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR *behavior); | ||
423 | FMOD_RESULT F_API setMuteFadeSpeed (float speed); | ||
424 | FMOD_RESULT F_API getMuteFadeSpeed (float *speed); | ||
425 | FMOD_RESULT F_API setVolume (float volume); | ||
426 | FMOD_RESULT F_API getVolume (float *volume); | ||
427 | FMOD_RESULT F_API stop (); | ||
428 | |||
429 | // Information only functions. | ||
430 | FMOD_RESULT F_API getName (char *name, int namelen); | ||
431 | FMOD_RESULT F_API getNumSounds (int *numsounds); | ||
432 | FMOD_RESULT F_API getSound (int index, Sound **sound); | ||
433 | FMOD_RESULT F_API getNumPlaying (int *numplaying); | ||
434 | |||
435 | // Userdata set/get. | ||
436 | FMOD_RESULT F_API setUserData (void *userdata); | ||
437 | FMOD_RESULT F_API getUserData (void **userdata); | ||
438 | }; | ||
439 | |||
440 | /* | ||
441 | 'DSP' API | ||
442 | */ | ||
443 | class DSP | ||
444 | { | ||
445 | private: | ||
446 | |||
447 | // Constructor made private so user cannot statically instance a DSP class. Appropriate DSP creation or retrieval function must be used. | ||
448 | DSP(); | ||
449 | DSP(const DSP &); | ||
450 | |||
451 | public: | ||
452 | |||
453 | FMOD_RESULT F_API release (); | ||
454 | FMOD_RESULT F_API getSystemObject (System **system); | ||
455 | |||
456 | // Connection / disconnection / input and output enumeration. | ||
457 | FMOD_RESULT F_API addInput (DSP *input, DSPConnection **connection = 0, FMOD_DSPCONNECTION_TYPE type = FMOD_DSPCONNECTION_TYPE_STANDARD); | ||
458 | FMOD_RESULT F_API disconnectFrom (DSP *target, DSPConnection *connection = 0); | ||
459 | FMOD_RESULT F_API disconnectAll (bool inputs, bool outputs); | ||
460 | FMOD_RESULT F_API getNumInputs (int *numinputs); | ||
461 | FMOD_RESULT F_API getNumOutputs (int *numoutputs); | ||
462 | FMOD_RESULT F_API getInput (int index, DSP **input, DSPConnection **inputconnection); | ||
463 | FMOD_RESULT F_API getOutput (int index, DSP **output, DSPConnection **outputconnection); | ||
464 | |||
465 | // DSP unit control. | ||
466 | FMOD_RESULT F_API setActive (bool active); | ||
467 | FMOD_RESULT F_API getActive (bool *active); | ||
468 | FMOD_RESULT F_API setBypass (bool bypass); | ||
469 | FMOD_RESULT F_API getBypass (bool *bypass); | ||
470 | FMOD_RESULT F_API setWetDryMix (float prewet, float postwet, float dry); | ||
471 | FMOD_RESULT F_API getWetDryMix (float *prewet, float *postwet, float *dry); | ||
472 | FMOD_RESULT F_API setChannelFormat (FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode); | ||
473 | FMOD_RESULT F_API getChannelFormat (FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode); | ||
474 | FMOD_RESULT F_API getOutputChannelFormat (FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode); | ||
475 | FMOD_RESULT F_API reset (); | ||
476 | |||
477 | // DSP parameter control. | ||
478 | FMOD_RESULT F_API setParameterFloat (int index, float value); | ||
479 | FMOD_RESULT F_API setParameterInt (int index, int value); | ||
480 | FMOD_RESULT F_API setParameterBool (int index, bool value); | ||
481 | FMOD_RESULT F_API setParameterData (int index, void *data, unsigned int length); | ||
482 | FMOD_RESULT F_API getParameterFloat (int index, float *value, char *valuestr, int valuestrlen); | ||
483 | FMOD_RESULT F_API getParameterInt (int index, int *value, char *valuestr, int valuestrlen); | ||
484 | FMOD_RESULT F_API getParameterBool (int index, bool *value, char *valuestr, int valuestrlen); | ||
485 | FMOD_RESULT F_API getParameterData (int index, void **data, unsigned int *length, char *valuestr, int valuestrlen); | ||
486 | FMOD_RESULT F_API getNumParameters (int *numparams); | ||
487 | FMOD_RESULT F_API getParameterInfo (int index, FMOD_DSP_PARAMETER_DESC **desc); | ||
488 | FMOD_RESULT F_API getDataParameterIndex (int datatype, int *index); | ||
489 | FMOD_RESULT F_API showConfigDialog (void *hwnd, bool show); | ||
490 | |||
491 | // DSP attributes. | ||
492 | FMOD_RESULT F_API getInfo (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight); | ||
493 | FMOD_RESULT F_API getType (FMOD_DSP_TYPE *type); | ||
494 | FMOD_RESULT F_API getIdle (bool *idle); | ||
495 | |||
496 | // Userdata set/get. | ||
497 | FMOD_RESULT F_API setUserData (void *userdata); | ||
498 | FMOD_RESULT F_API getUserData (void **userdata); | ||
499 | |||
500 | // Metering. | ||
501 | FMOD_RESULT F_API setMeteringEnabled (bool inputEnabled, bool outputEnabled); | ||
502 | FMOD_RESULT F_API getMeteringEnabled (bool *inputEnabled, bool *outputEnabled); | ||
503 | FMOD_RESULT F_API getMeteringInfo (FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo); | ||
504 | FMOD_RESULT F_API getCPUUsage (unsigned int *exclusive, unsigned int *inclusive); | ||
505 | }; | ||
506 | |||
507 | |||
508 | /* | ||
509 | 'DSPConnection' API | ||
510 | */ | ||
511 | class DSPConnection | ||
512 | { | ||
513 | private: | ||
514 | |||
515 | // Constructor made private so user cannot statically instance a DSPConnection class. Appropriate DSPConnection creation or retrieval function must be used. | ||
516 | DSPConnection(); | ||
517 | DSPConnection(const DSPConnection &); | ||
518 | |||
519 | public: | ||
520 | |||
521 | FMOD_RESULT F_API getInput (DSP **input); | ||
522 | FMOD_RESULT F_API getOutput (DSP **output); | ||
523 | FMOD_RESULT F_API setMix (float volume); | ||
524 | FMOD_RESULT F_API getMix (float *volume); | ||
525 | FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0); | ||
526 | FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0); | ||
527 | FMOD_RESULT F_API getType (FMOD_DSPCONNECTION_TYPE *type); | ||
528 | |||
529 | // Userdata set/get. | ||
530 | FMOD_RESULT F_API setUserData (void *userdata); | ||
531 | FMOD_RESULT F_API getUserData (void **userdata); | ||
532 | }; | ||
533 | |||
534 | |||
535 | /* | ||
536 | 'Geometry' API | ||
537 | */ | ||
538 | class Geometry | ||
539 | { | ||
540 | private: | ||
541 | |||
542 | // Constructor made private so user cannot statically instance a Geometry class. Appropriate Geometry creation or retrieval function must be used. | ||
543 | Geometry(); | ||
544 | Geometry(const Geometry &); | ||
545 | |||
546 | public: | ||
547 | |||
548 | FMOD_RESULT F_API release (); | ||
549 | |||
550 | // Polygon manipulation. | ||
551 | FMOD_RESULT F_API addPolygon (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex); | ||
552 | FMOD_RESULT F_API getNumPolygons (int *numpolygons); | ||
553 | FMOD_RESULT F_API getMaxPolygons (int *maxpolygons, int *maxvertices); | ||
554 | FMOD_RESULT F_API getPolygonNumVertices (int index, int *numvertices); | ||
555 | FMOD_RESULT F_API setPolygonVertex (int index, int vertexindex, const FMOD_VECTOR *vertex); | ||
556 | FMOD_RESULT F_API getPolygonVertex (int index, int vertexindex, FMOD_VECTOR *vertex); | ||
557 | FMOD_RESULT F_API setPolygonAttributes (int index, float directocclusion, float reverbocclusion, bool doublesided); | ||
558 | FMOD_RESULT F_API getPolygonAttributes (int index, float *directocclusion, float *reverbocclusion, bool *doublesided); | ||
559 | |||
560 | // Object manipulation. | ||
561 | FMOD_RESULT F_API setActive (bool active); | ||
562 | FMOD_RESULT F_API getActive (bool *active); | ||
563 | FMOD_RESULT F_API setRotation (const FMOD_VECTOR *forward, const FMOD_VECTOR *up); | ||
564 | FMOD_RESULT F_API getRotation (FMOD_VECTOR *forward, FMOD_VECTOR *up); | ||
565 | FMOD_RESULT F_API setPosition (const FMOD_VECTOR *position); | ||
566 | FMOD_RESULT F_API getPosition (FMOD_VECTOR *position); | ||
567 | FMOD_RESULT F_API setScale (const FMOD_VECTOR *scale); | ||
568 | FMOD_RESULT F_API getScale (FMOD_VECTOR *scale); | ||
569 | FMOD_RESULT F_API save (void *data, int *datasize); | ||
570 | |||
571 | // Userdata set/get. | ||
572 | FMOD_RESULT F_API setUserData (void *userdata); | ||
573 | FMOD_RESULT F_API getUserData (void **userdata); | ||
574 | }; | ||
575 | |||
576 | |||
577 | /* | ||
578 | 'Reverb' API | ||
579 | */ | ||
580 | class Reverb3D | ||
581 | { | ||
582 | private: | ||
583 | |||
584 | // Constructor made private so user cannot statically instance a Reverb3D class. Appropriate Reverb creation or retrieval function must be used. | ||
585 | Reverb3D(); | ||
586 | Reverb3D(const Reverb3D &); | ||
587 | |||
588 | public: | ||
589 | |||
590 | FMOD_RESULT F_API release (); | ||
591 | |||
592 | // Reverb manipulation. | ||
593 | FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *position, float mindistance, float maxdistance); | ||
594 | FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *position, float *mindistance,float *maxdistance); | ||
595 | FMOD_RESULT F_API setProperties (const FMOD_REVERB_PROPERTIES *properties); | ||
596 | FMOD_RESULT F_API getProperties (FMOD_REVERB_PROPERTIES *properties); | ||
597 | FMOD_RESULT F_API setActive (bool active); | ||
598 | FMOD_RESULT F_API getActive (bool *active); | ||
599 | |||
600 | // Userdata set/get. | ||
601 | FMOD_RESULT F_API setUserData (void *userdata); | ||
602 | FMOD_RESULT F_API getUserData (void **userdata); | ||
603 | }; | ||
604 | } | ||
605 | |||
606 | #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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Core API - Codec development header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header if you are wanting to develop your own file format plugin to use with */ | ||
6 | /* FMOD's codec system. With this header you can make your own fileformat plugin that FMOD */ | ||
7 | /* can register and use. See the documentation and examples on how to make a working */ | ||
8 | /* plugin. */ | ||
9 | /* */ | ||
10 | /* For more detail visit: */ | ||
11 | /* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */ | ||
12 | /* ======================================================================================== */ | ||
13 | #ifndef _FMOD_CODEC_H | ||
14 | #define _FMOD_CODEC_H | ||
15 | |||
16 | /* | ||
17 | Codec types | ||
18 | */ | ||
19 | typedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE; | ||
20 | typedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT; | ||
21 | |||
22 | /* | ||
23 | Codec constants | ||
24 | */ | ||
25 | #define FMOD_CODEC_PLUGIN_VERSION 1 | ||
26 | |||
27 | typedef int FMOD_CODEC_SEEK_METHOD; | ||
28 | #define FMOD_CODEC_SEEK_METHOD_SET 0 | ||
29 | #define FMOD_CODEC_SEEK_METHOD_CURRENT 1 | ||
30 | #define FMOD_CODEC_SEEK_METHOD_END 2 | ||
31 | |||
32 | /* | ||
33 | Codec callbacks | ||
34 | */ | ||
35 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPEN_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo); | ||
36 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSE_CALLBACK) (FMOD_CODEC_STATE *codec_state); | ||
37 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READ_CALLBACK) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int samples_in, unsigned int *samples_out); | ||
38 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTH_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype); | ||
39 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype); | ||
40 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype); | ||
41 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATE_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound); | ||
42 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT_CALLBACK)(FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat); | ||
43 | |||
44 | /* | ||
45 | Codec functions | ||
46 | */ | ||
47 | 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); | ||
48 | typedef void * (F_CALLBACK *FMOD_CODEC_ALLOC_FUNC) (unsigned int size, unsigned int align, const char *file, int line); | ||
49 | typedef void (F_CALLBACK *FMOD_CODEC_FREE_FUNC) (void *ptr, const char *file, int line); | ||
50 | typedef void (F_CALLBACK *FMOD_CODEC_LOG_FUNC) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...); | ||
51 | |||
52 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_FILE_READ_FUNC) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int sizebytes, unsigned int *bytesread); | ||
53 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_FILE_SEEK_FUNC) (FMOD_CODEC_STATE *codec_state, unsigned int pos, FMOD_CODEC_SEEK_METHOD method); | ||
54 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_FILE_TELL_FUNC) (FMOD_CODEC_STATE *codec_state, unsigned int *pos); | ||
55 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_FILE_SIZE_FUNC) (FMOD_CODEC_STATE *codec_state, unsigned int *size); | ||
56 | |||
57 | /* | ||
58 | Codec structures | ||
59 | */ | ||
60 | typedef struct FMOD_CODEC_DESCRIPTION | ||
61 | { | ||
62 | unsigned int apiversion; | ||
63 | const char *name; | ||
64 | unsigned int version; | ||
65 | int defaultasstream; | ||
66 | FMOD_TIMEUNIT timeunits; | ||
67 | FMOD_CODEC_OPEN_CALLBACK open; | ||
68 | FMOD_CODEC_CLOSE_CALLBACK close; | ||
69 | FMOD_CODEC_READ_CALLBACK read; | ||
70 | FMOD_CODEC_GETLENGTH_CALLBACK getlength; | ||
71 | FMOD_CODEC_SETPOSITION_CALLBACK setposition; | ||
72 | FMOD_CODEC_GETPOSITION_CALLBACK getposition; | ||
73 | FMOD_CODEC_SOUNDCREATE_CALLBACK soundcreate; | ||
74 | FMOD_CODEC_GETWAVEFORMAT_CALLBACK getwaveformat; | ||
75 | } FMOD_CODEC_DESCRIPTION; | ||
76 | |||
77 | struct FMOD_CODEC_WAVEFORMAT | ||
78 | { | ||
79 | const char* name; | ||
80 | FMOD_SOUND_FORMAT format; | ||
81 | int channels; | ||
82 | int frequency; | ||
83 | unsigned int lengthbytes; | ||
84 | unsigned int lengthpcm; | ||
85 | unsigned int pcmblocksize; | ||
86 | int loopstart; | ||
87 | int loopend; | ||
88 | FMOD_MODE mode; | ||
89 | FMOD_CHANNELMASK channelmask; | ||
90 | FMOD_CHANNELORDER channelorder; | ||
91 | float peakvolume; | ||
92 | }; | ||
93 | |||
94 | typedef struct FMOD_CODEC_STATE_FUNCTIONS | ||
95 | { | ||
96 | FMOD_CODEC_METADATA_FUNC metadata; | ||
97 | FMOD_CODEC_ALLOC_FUNC alloc; | ||
98 | FMOD_CODEC_FREE_FUNC free; | ||
99 | FMOD_CODEC_LOG_FUNC log; | ||
100 | FMOD_CODEC_FILE_READ_FUNC read; | ||
101 | FMOD_CODEC_FILE_SEEK_FUNC seek; | ||
102 | FMOD_CODEC_FILE_TELL_FUNC tell; | ||
103 | FMOD_CODEC_FILE_SIZE_FUNC size; | ||
104 | } FMOD_CODEC_STATE_FUNCTIONS; | ||
105 | |||
106 | struct FMOD_CODEC_STATE | ||
107 | { | ||
108 | void *plugindata; | ||
109 | FMOD_CODEC_WAVEFORMAT *waveformat; | ||
110 | FMOD_CODEC_STATE_FUNCTIONS *functions; | ||
111 | int numsubsounds; | ||
112 | }; | ||
113 | |||
114 | /* | ||
115 | Codec macros | ||
116 | */ | ||
117 | #define FMOD_CODEC_METADATA(_state, _tagtype, _name, _data, _datalen, _datatype, _unique) \ | ||
118 | (_state)->functions->metadata(_size, _tagtype, _name, _data, _datalen, _datatype, _unique) | ||
119 | #define FMOD_CODEC_ALLOC(_state, _size, _align) \ | ||
120 | (_state)->functions->alloc(_size, _align, __FILE__, __LINE__) | ||
121 | #define FMOD_CODEC_FREE(_state, _ptr) \ | ||
122 | (_state)->functions->free(_ptr, __FILE__, __LINE__) | ||
123 | #define FMOD_CODEC_LOG(_state, _level, _location, _format, ...) \ | ||
124 | (_state)->functions->log(_level, __FILE__, __LINE__, _location, _format, __VA_ARGS__) | ||
125 | #define FMOD_CODEC_FILE_READ(_state, _buffer, _sizebytes, _bytesread) \ | ||
126 | (_state)->functions->read(_state, _buffer, _sizebytes, _bytesread) | ||
127 | #define FMOD_CODEC_FILE_SEEK(_state, _pos, _method) \ | ||
128 | (_state)->functions->seek(_state, _pos, _method) | ||
129 | #define FMOD_CODEC_FILE_TELL(_state, _pos) \ | ||
130 | (_state)->functions->tell(_state, _pos) | ||
131 | #define FMOD_CODEC_FILE_SIZE(_state, _size) \ | ||
132 | (_state)->functions->size(_state, _size) | ||
133 | |||
134 | #endif | ||
135 | |||
136 | |||
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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Core API - Common C/C++ header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* This header is included by fmod.hpp (C++ interface) and fmod.h (C interface) */ | ||
6 | /* */ | ||
7 | /* For more detail visit: */ | ||
8 | /* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html */ | ||
9 | /* ======================================================================================== */ | ||
10 | #ifndef _FMOD_COMMON_H | ||
11 | #define _FMOD_COMMON_H | ||
12 | |||
13 | /* | ||
14 | Library import helpers | ||
15 | */ | ||
16 | #if defined(_WIN32) || defined(__CYGWIN__) | ||
17 | #define F_CALL __stdcall | ||
18 | #else | ||
19 | #define F_CALL | ||
20 | #endif | ||
21 | |||
22 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__ORBIS__) || defined(F_USE_DECLSPEC) | ||
23 | #define F_EXPORT __declspec(dllexport) | ||
24 | #elif defined(__APPLE__) || defined(__ANDROID__) || defined(__linux__) || defined(F_USE_ATTRIBUTE) | ||
25 | #define F_EXPORT __attribute__((visibility("default"))) | ||
26 | #else | ||
27 | #define F_EXPORT | ||
28 | #endif | ||
29 | |||
30 | #ifdef DLL_EXPORTS | ||
31 | #define F_API F_EXPORT F_CALL | ||
32 | #else | ||
33 | #define F_API F_CALL | ||
34 | #endif | ||
35 | |||
36 | #define F_CALLBACK F_CALL | ||
37 | |||
38 | /* | ||
39 | FMOD core types | ||
40 | */ | ||
41 | typedef int FMOD_BOOL; | ||
42 | typedef struct FMOD_SYSTEM FMOD_SYSTEM; | ||
43 | typedef struct FMOD_SOUND FMOD_SOUND; | ||
44 | typedef struct FMOD_CHANNELCONTROL FMOD_CHANNELCONTROL; | ||
45 | typedef struct FMOD_CHANNEL FMOD_CHANNEL; | ||
46 | typedef struct FMOD_CHANNELGROUP FMOD_CHANNELGROUP; | ||
47 | typedef struct FMOD_SOUNDGROUP FMOD_SOUNDGROUP; | ||
48 | typedef struct FMOD_REVERB3D FMOD_REVERB3D; | ||
49 | typedef struct FMOD_DSP FMOD_DSP; | ||
50 | typedef struct FMOD_DSPCONNECTION FMOD_DSPCONNECTION; | ||
51 | typedef struct FMOD_POLYGON FMOD_POLYGON; | ||
52 | typedef struct FMOD_GEOMETRY FMOD_GEOMETRY; | ||
53 | typedef struct FMOD_SYNCPOINT FMOD_SYNCPOINT; | ||
54 | typedef struct FMOD_ASYNCREADINFO FMOD_ASYNCREADINFO; | ||
55 | typedef unsigned long long FMOD_PORT_INDEX; | ||
56 | |||
57 | /* | ||
58 | FMOD constants | ||
59 | */ | ||
60 | #define FMOD_VERSION 0x00020205 /* 0xaaaabbcc -> aaaa = product version, bb = major version, cc = minor version.*/ | ||
61 | |||
62 | typedef unsigned int FMOD_DEBUG_FLAGS; | ||
63 | #define FMOD_DEBUG_LEVEL_NONE 0x00000000 | ||
64 | #define FMOD_DEBUG_LEVEL_ERROR 0x00000001 | ||
65 | #define FMOD_DEBUG_LEVEL_WARNING 0x00000002 | ||
66 | #define FMOD_DEBUG_LEVEL_LOG 0x00000004 | ||
67 | #define FMOD_DEBUG_TYPE_MEMORY 0x00000100 | ||
68 | #define FMOD_DEBUG_TYPE_FILE 0x00000200 | ||
69 | #define FMOD_DEBUG_TYPE_CODEC 0x00000400 | ||
70 | #define FMOD_DEBUG_TYPE_TRACE 0x00000800 | ||
71 | #define FMOD_DEBUG_DISPLAY_TIMESTAMPS 0x00010000 | ||
72 | #define FMOD_DEBUG_DISPLAY_LINENUMBERS 0x00020000 | ||
73 | #define FMOD_DEBUG_DISPLAY_THREAD 0x00040000 | ||
74 | |||
75 | typedef unsigned int FMOD_MEMORY_TYPE; | ||
76 | #define FMOD_MEMORY_NORMAL 0x00000000 | ||
77 | #define FMOD_MEMORY_STREAM_FILE 0x00000001 | ||
78 | #define FMOD_MEMORY_STREAM_DECODE 0x00000002 | ||
79 | #define FMOD_MEMORY_SAMPLEDATA 0x00000004 | ||
80 | #define FMOD_MEMORY_DSP_BUFFER 0x00000008 | ||
81 | #define FMOD_MEMORY_PLUGIN 0x00000010 | ||
82 | #define FMOD_MEMORY_PERSISTENT 0x00200000 | ||
83 | #define FMOD_MEMORY_ALL 0xFFFFFFFF | ||
84 | |||
85 | typedef unsigned int FMOD_INITFLAGS; | ||
86 | #define FMOD_INIT_NORMAL 0x00000000 | ||
87 | #define FMOD_INIT_STREAM_FROM_UPDATE 0x00000001 | ||
88 | #define FMOD_INIT_MIX_FROM_UPDATE 0x00000002 | ||
89 | #define FMOD_INIT_3D_RIGHTHANDED 0x00000004 | ||
90 | #define FMOD_INIT_CHANNEL_LOWPASS 0x00000100 | ||
91 | #define FMOD_INIT_CHANNEL_DISTANCEFILTER 0x00000200 | ||
92 | #define FMOD_INIT_PROFILE_ENABLE 0x00010000 | ||
93 | #define FMOD_INIT_VOL0_BECOMES_VIRTUAL 0x00020000 | ||
94 | #define FMOD_INIT_GEOMETRY_USECLOSEST 0x00040000 | ||
95 | #define FMOD_INIT_PREFER_DOLBY_DOWNMIX 0x00080000 | ||
96 | #define FMOD_INIT_THREAD_UNSAFE 0x00100000 | ||
97 | #define FMOD_INIT_PROFILE_METER_ALL 0x00200000 | ||
98 | #define FMOD_INIT_MEMORY_TRACKING 0x00400000 | ||
99 | |||
100 | typedef unsigned int FMOD_DRIVER_STATE; | ||
101 | #define FMOD_DRIVER_STATE_CONNECTED 0x00000001 | ||
102 | #define FMOD_DRIVER_STATE_DEFAULT 0x00000002 | ||
103 | |||
104 | typedef unsigned int FMOD_TIMEUNIT; | ||
105 | #define FMOD_TIMEUNIT_MS 0x00000001 | ||
106 | #define FMOD_TIMEUNIT_PCM 0x00000002 | ||
107 | #define FMOD_TIMEUNIT_PCMBYTES 0x00000004 | ||
108 | #define FMOD_TIMEUNIT_RAWBYTES 0x00000008 | ||
109 | #define FMOD_TIMEUNIT_PCMFRACTION 0x00000010 | ||
110 | #define FMOD_TIMEUNIT_MODORDER 0x00000100 | ||
111 | #define FMOD_TIMEUNIT_MODROW 0x00000200 | ||
112 | #define FMOD_TIMEUNIT_MODPATTERN 0x00000400 | ||
113 | |||
114 | typedef unsigned int FMOD_SYSTEM_CALLBACK_TYPE; | ||
115 | #define FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED 0x00000001 | ||
116 | #define FMOD_SYSTEM_CALLBACK_DEVICELOST 0x00000002 | ||
117 | #define FMOD_SYSTEM_CALLBACK_MEMORYALLOCATIONFAILED 0x00000004 | ||
118 | #define FMOD_SYSTEM_CALLBACK_THREADCREATED 0x00000008 | ||
119 | #define FMOD_SYSTEM_CALLBACK_BADDSPCONNECTION 0x00000010 | ||
120 | #define FMOD_SYSTEM_CALLBACK_PREMIX 0x00000020 | ||
121 | #define FMOD_SYSTEM_CALLBACK_POSTMIX 0x00000040 | ||
122 | #define FMOD_SYSTEM_CALLBACK_ERROR 0x00000080 | ||
123 | #define FMOD_SYSTEM_CALLBACK_MIDMIX 0x00000100 | ||
124 | #define FMOD_SYSTEM_CALLBACK_THREADDESTROYED 0x00000200 | ||
125 | #define FMOD_SYSTEM_CALLBACK_PREUPDATE 0x00000400 | ||
126 | #define FMOD_SYSTEM_CALLBACK_POSTUPDATE 0x00000800 | ||
127 | #define FMOD_SYSTEM_CALLBACK_RECORDLISTCHANGED 0x00001000 | ||
128 | #define FMOD_SYSTEM_CALLBACK_BUFFEREDNOMIX 0x00002000 | ||
129 | #define FMOD_SYSTEM_CALLBACK_DEVICEREINITIALIZE 0x00004000 | ||
130 | #define FMOD_SYSTEM_CALLBACK_OUTPUTUNDERRUN 0x00008000 | ||
131 | #define FMOD_SYSTEM_CALLBACK_ALL 0xFFFFFFFF | ||
132 | |||
133 | typedef unsigned int FMOD_MODE; | ||
134 | #define FMOD_DEFAULT 0x00000000 | ||
135 | #define FMOD_LOOP_OFF 0x00000001 | ||
136 | #define FMOD_LOOP_NORMAL 0x00000002 | ||
137 | #define FMOD_LOOP_BIDI 0x00000004 | ||
138 | #define FMOD_2D 0x00000008 | ||
139 | #define FMOD_3D 0x00000010 | ||
140 | #define FMOD_CREATESTREAM 0x00000080 | ||
141 | #define FMOD_CREATESAMPLE 0x00000100 | ||
142 | #define FMOD_CREATECOMPRESSEDSAMPLE 0x00000200 | ||
143 | #define FMOD_OPENUSER 0x00000400 | ||
144 | #define FMOD_OPENMEMORY 0x00000800 | ||
145 | #define FMOD_OPENMEMORY_POINT 0x10000000 | ||
146 | #define FMOD_OPENRAW 0x00001000 | ||
147 | #define FMOD_OPENONLY 0x00002000 | ||
148 | #define FMOD_ACCURATETIME 0x00004000 | ||
149 | #define FMOD_MPEGSEARCH 0x00008000 | ||
150 | #define FMOD_NONBLOCKING 0x00010000 | ||
151 | #define FMOD_UNIQUE 0x00020000 | ||
152 | #define FMOD_3D_HEADRELATIVE 0x00040000 | ||
153 | #define FMOD_3D_WORLDRELATIVE 0x00080000 | ||
154 | #define FMOD_3D_INVERSEROLLOFF 0x00100000 | ||
155 | #define FMOD_3D_LINEARROLLOFF 0x00200000 | ||
156 | #define FMOD_3D_LINEARSQUAREROLLOFF 0x00400000 | ||
157 | #define FMOD_3D_INVERSETAPEREDROLLOFF 0x00800000 | ||
158 | #define FMOD_3D_CUSTOMROLLOFF 0x04000000 | ||
159 | #define FMOD_3D_IGNOREGEOMETRY 0x40000000 | ||
160 | #define FMOD_IGNORETAGS 0x02000000 | ||
161 | #define FMOD_LOWMEM 0x08000000 | ||
162 | #define FMOD_VIRTUAL_PLAYFROMSTART 0x80000000 | ||
163 | |||
164 | typedef unsigned int FMOD_CHANNELMASK; | ||
165 | #define FMOD_CHANNELMASK_FRONT_LEFT 0x00000001 | ||
166 | #define FMOD_CHANNELMASK_FRONT_RIGHT 0x00000002 | ||
167 | #define FMOD_CHANNELMASK_FRONT_CENTER 0x00000004 | ||
168 | #define FMOD_CHANNELMASK_LOW_FREQUENCY 0x00000008 | ||
169 | #define FMOD_CHANNELMASK_SURROUND_LEFT 0x00000010 | ||
170 | #define FMOD_CHANNELMASK_SURROUND_RIGHT 0x00000020 | ||
171 | #define FMOD_CHANNELMASK_BACK_LEFT 0x00000040 | ||
172 | #define FMOD_CHANNELMASK_BACK_RIGHT 0x00000080 | ||
173 | #define FMOD_CHANNELMASK_BACK_CENTER 0x00000100 | ||
174 | #define FMOD_CHANNELMASK_MONO (FMOD_CHANNELMASK_FRONT_LEFT) | ||
175 | #define FMOD_CHANNELMASK_STEREO (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT) | ||
176 | #define FMOD_CHANNELMASK_LRC (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER) | ||
177 | #define FMOD_CHANNELMASK_QUAD (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT) | ||
178 | #define FMOD_CHANNELMASK_SURROUND (FMOD_CHANNELMASK_FRONT_LEFT | FMOD_CHANNELMASK_FRONT_RIGHT | FMOD_CHANNELMASK_FRONT_CENTER | FMOD_CHANNELMASK_SURROUND_LEFT | FMOD_CHANNELMASK_SURROUND_RIGHT) | ||
179 | #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) | ||
180 | #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) | ||
181 | #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) | ||
182 | #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) | ||
183 | |||
184 | typedef int FMOD_THREAD_PRIORITY; | ||
185 | /* Platform specific priority range */ | ||
186 | #define FMOD_THREAD_PRIORITY_PLATFORM_MIN (-32 * 1024) | ||
187 | #define FMOD_THREAD_PRIORITY_PLATFORM_MAX ( 32 * 1024) | ||
188 | /* Platform agnostic priorities, maps internally to platform specific value */ | ||
189 | #define FMOD_THREAD_PRIORITY_DEFAULT (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 1) | ||
190 | #define FMOD_THREAD_PRIORITY_LOW (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 2) | ||
191 | #define FMOD_THREAD_PRIORITY_MEDIUM (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 3) | ||
192 | #define FMOD_THREAD_PRIORITY_HIGH (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 4) | ||
193 | #define FMOD_THREAD_PRIORITY_VERY_HIGH (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 5) | ||
194 | #define FMOD_THREAD_PRIORITY_EXTREME (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 6) | ||
195 | #define FMOD_THREAD_PRIORITY_CRITICAL (FMOD_THREAD_PRIORITY_PLATFORM_MIN - 7) | ||
196 | /* Thread defaults */ | ||
197 | #define FMOD_THREAD_PRIORITY_MIXER FMOD_THREAD_PRIORITY_EXTREME | ||
198 | #define FMOD_THREAD_PRIORITY_FEEDER FMOD_THREAD_PRIORITY_CRITICAL | ||
199 | #define FMOD_THREAD_PRIORITY_STREAM FMOD_THREAD_PRIORITY_VERY_HIGH | ||
200 | #define FMOD_THREAD_PRIORITY_FILE FMOD_THREAD_PRIORITY_HIGH | ||
201 | #define FMOD_THREAD_PRIORITY_NONBLOCKING FMOD_THREAD_PRIORITY_HIGH | ||
202 | #define FMOD_THREAD_PRIORITY_RECORD FMOD_THREAD_PRIORITY_HIGH | ||
203 | #define FMOD_THREAD_PRIORITY_GEOMETRY FMOD_THREAD_PRIORITY_LOW | ||
204 | #define FMOD_THREAD_PRIORITY_PROFILER FMOD_THREAD_PRIORITY_MEDIUM | ||
205 | #define FMOD_THREAD_PRIORITY_STUDIO_UPDATE FMOD_THREAD_PRIORITY_MEDIUM | ||
206 | #define FMOD_THREAD_PRIORITY_STUDIO_LOAD_BANK FMOD_THREAD_PRIORITY_MEDIUM | ||
207 | #define FMOD_THREAD_PRIORITY_STUDIO_LOAD_SAMPLE FMOD_THREAD_PRIORITY_MEDIUM | ||
208 | #define FMOD_THREAD_PRIORITY_CONVOLUTION1 FMOD_THREAD_PRIORITY_VERY_HIGH | ||
209 | #define FMOD_THREAD_PRIORITY_CONVOLUTION2 FMOD_THREAD_PRIORITY_VERY_HIGH | ||
210 | |||
211 | typedef unsigned int FMOD_THREAD_STACK_SIZE; | ||
212 | #define FMOD_THREAD_STACK_SIZE_DEFAULT 0 | ||
213 | #define FMOD_THREAD_STACK_SIZE_MIXER (80 * 1024) | ||
214 | #define FMOD_THREAD_STACK_SIZE_FEEDER (16 * 1024) | ||
215 | #define FMOD_THREAD_STACK_SIZE_STREAM (96 * 1024) | ||
216 | #define FMOD_THREAD_STACK_SIZE_FILE (64 * 1024) | ||
217 | #define FMOD_THREAD_STACK_SIZE_NONBLOCKING (112 * 1024) | ||
218 | #define FMOD_THREAD_STACK_SIZE_RECORD (16 * 1024) | ||
219 | #define FMOD_THREAD_STACK_SIZE_GEOMETRY (48 * 1024) | ||
220 | #define FMOD_THREAD_STACK_SIZE_PROFILER (128 * 1024) | ||
221 | #define FMOD_THREAD_STACK_SIZE_STUDIO_UPDATE (96 * 1024) | ||
222 | #define FMOD_THREAD_STACK_SIZE_STUDIO_LOAD_BANK (96 * 1024) | ||
223 | #define FMOD_THREAD_STACK_SIZE_STUDIO_LOAD_SAMPLE (96 * 1024) | ||
224 | #define FMOD_THREAD_STACK_SIZE_CONVOLUTION1 (16 * 1024) | ||
225 | #define FMOD_THREAD_STACK_SIZE_CONVOLUTION2 (16 * 1024) | ||
226 | |||
227 | typedef long long FMOD_THREAD_AFFINITY; | ||
228 | /* Platform agnostic thread groupings */ | ||
229 | #define FMOD_THREAD_AFFINITY_GROUP_DEFAULT 0x4000000000000000 | ||
230 | #define FMOD_THREAD_AFFINITY_GROUP_A 0x4000000000000001 | ||
231 | #define FMOD_THREAD_AFFINITY_GROUP_B 0x4000000000000002 | ||
232 | #define FMOD_THREAD_AFFINITY_GROUP_C 0x4000000000000003 | ||
233 | /* Thread defaults */ | ||
234 | #define FMOD_THREAD_AFFINITY_MIXER FMOD_THREAD_AFFINITY_GROUP_A | ||
235 | #define FMOD_THREAD_AFFINITY_FEEDER FMOD_THREAD_AFFINITY_GROUP_C | ||
236 | #define FMOD_THREAD_AFFINITY_STREAM FMOD_THREAD_AFFINITY_GROUP_C | ||
237 | #define FMOD_THREAD_AFFINITY_FILE FMOD_THREAD_AFFINITY_GROUP_C | ||
238 | #define FMOD_THREAD_AFFINITY_NONBLOCKING FMOD_THREAD_AFFINITY_GROUP_C | ||
239 | #define FMOD_THREAD_AFFINITY_RECORD FMOD_THREAD_AFFINITY_GROUP_C | ||
240 | #define FMOD_THREAD_AFFINITY_GEOMETRY FMOD_THREAD_AFFINITY_GROUP_C | ||
241 | #define FMOD_THREAD_AFFINITY_PROFILER FMOD_THREAD_AFFINITY_GROUP_C | ||
242 | #define FMOD_THREAD_AFFINITY_STUDIO_UPDATE FMOD_THREAD_AFFINITY_GROUP_B | ||
243 | #define FMOD_THREAD_AFFINITY_STUDIO_LOAD_BANK FMOD_THREAD_AFFINITY_GROUP_C | ||
244 | #define FMOD_THREAD_AFFINITY_STUDIO_LOAD_SAMPLE FMOD_THREAD_AFFINITY_GROUP_C | ||
245 | #define FMOD_THREAD_AFFINITY_CONVOLUTION1 FMOD_THREAD_AFFINITY_GROUP_C | ||
246 | #define FMOD_THREAD_AFFINITY_CONVOLUTION2 FMOD_THREAD_AFFINITY_GROUP_C | ||
247 | |||
248 | /* Core mask, valid up to 1 << 62 */ | ||
249 | #define FMOD_THREAD_AFFINITY_CORE_ALL 0 | ||
250 | #define FMOD_THREAD_AFFINITY_CORE_0 (1 << 0) | ||
251 | #define FMOD_THREAD_AFFINITY_CORE_1 (1 << 1) | ||
252 | #define FMOD_THREAD_AFFINITY_CORE_2 (1 << 2) | ||
253 | #define FMOD_THREAD_AFFINITY_CORE_3 (1 << 3) | ||
254 | #define FMOD_THREAD_AFFINITY_CORE_4 (1 << 4) | ||
255 | #define FMOD_THREAD_AFFINITY_CORE_5 (1 << 5) | ||
256 | #define FMOD_THREAD_AFFINITY_CORE_6 (1 << 6) | ||
257 | #define FMOD_THREAD_AFFINITY_CORE_7 (1 << 7) | ||
258 | #define FMOD_THREAD_AFFINITY_CORE_8 (1 << 8) | ||
259 | #define FMOD_THREAD_AFFINITY_CORE_9 (1 << 9) | ||
260 | #define FMOD_THREAD_AFFINITY_CORE_10 (1 << 10) | ||
261 | #define FMOD_THREAD_AFFINITY_CORE_11 (1 << 11) | ||
262 | #define FMOD_THREAD_AFFINITY_CORE_12 (1 << 12) | ||
263 | #define FMOD_THREAD_AFFINITY_CORE_13 (1 << 13) | ||
264 | #define FMOD_THREAD_AFFINITY_CORE_14 (1 << 14) | ||
265 | #define FMOD_THREAD_AFFINITY_CORE_15 (1 << 15) | ||
266 | |||
267 | /* Preset for FMOD_REVERB_PROPERTIES */ | ||
268 | #define FMOD_PRESET_OFF { 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f } | ||
269 | #define FMOD_PRESET_GENERIC { 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f } | ||
270 | #define FMOD_PRESET_PADDEDCELL { 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f } | ||
271 | #define FMOD_PRESET_ROOM { 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f } | ||
272 | #define FMOD_PRESET_BATHROOM { 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f } | ||
273 | #define FMOD_PRESET_LIVINGROOM { 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f } | ||
274 | #define FMOD_PRESET_STONEROOM { 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f } | ||
275 | #define FMOD_PRESET_AUDITORIUM { 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f } | ||
276 | #define FMOD_PRESET_CONCERTHALL { 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f } | ||
277 | #define FMOD_PRESET_CAVE { 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f } | ||
278 | #define FMOD_PRESET_ARENA { 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f } | ||
279 | #define FMOD_PRESET_HANGAR { 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f } | ||
280 | #define FMOD_PRESET_CARPETTEDHALLWAY { 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f } | ||
281 | #define FMOD_PRESET_HALLWAY { 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f } | ||
282 | #define FMOD_PRESET_STONECORRIDOR { 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f } | ||
283 | #define FMOD_PRESET_ALLEY { 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f } | ||
284 | #define FMOD_PRESET_FOREST { 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f } | ||
285 | #define FMOD_PRESET_CITY { 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f } | ||
286 | #define FMOD_PRESET_MOUNTAINS { 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f } | ||
287 | #define FMOD_PRESET_QUARRY { 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f } | ||
288 | #define FMOD_PRESET_PLAIN { 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f } | ||
289 | #define FMOD_PRESET_PARKINGLOT { 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f } | ||
290 | #define FMOD_PRESET_SEWERPIPE { 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f } | ||
291 | #define FMOD_PRESET_UNDERWATER { 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f } | ||
292 | |||
293 | #define FMOD_MAX_CHANNEL_WIDTH 32 | ||
294 | #define FMOD_MAX_SYSTEMS 8 | ||
295 | #define FMOD_MAX_LISTENERS 8 | ||
296 | #define FMOD_REVERB_MAXINSTANCES 4 | ||
297 | #define FMOD_PORT_INDEX_NONE 0xFFFFFFFFFFFFFFFF | ||
298 | |||
299 | typedef enum FMOD_THREAD_TYPE | ||
300 | { | ||
301 | FMOD_THREAD_TYPE_MIXER, | ||
302 | FMOD_THREAD_TYPE_FEEDER, | ||
303 | FMOD_THREAD_TYPE_STREAM, | ||
304 | FMOD_THREAD_TYPE_FILE, | ||
305 | FMOD_THREAD_TYPE_NONBLOCKING, | ||
306 | FMOD_THREAD_TYPE_RECORD, | ||
307 | FMOD_THREAD_TYPE_GEOMETRY, | ||
308 | FMOD_THREAD_TYPE_PROFILER, | ||
309 | FMOD_THREAD_TYPE_STUDIO_UPDATE, | ||
310 | FMOD_THREAD_TYPE_STUDIO_LOAD_BANK, | ||
311 | FMOD_THREAD_TYPE_STUDIO_LOAD_SAMPLE, | ||
312 | FMOD_THREAD_TYPE_CONVOLUTION1, | ||
313 | FMOD_THREAD_TYPE_CONVOLUTION2, | ||
314 | |||
315 | FMOD_THREAD_TYPE_MAX, | ||
316 | FMOD_THREAD_TYPE_FORCEINT = 65536 | ||
317 | } FMOD_THREAD_TYPE; | ||
318 | |||
319 | typedef enum FMOD_RESULT | ||
320 | { | ||
321 | FMOD_OK, | ||
322 | FMOD_ERR_BADCOMMAND, | ||
323 | FMOD_ERR_CHANNEL_ALLOC, | ||
324 | FMOD_ERR_CHANNEL_STOLEN, | ||
325 | FMOD_ERR_DMA, | ||
326 | FMOD_ERR_DSP_CONNECTION, | ||
327 | FMOD_ERR_DSP_DONTPROCESS, | ||
328 | FMOD_ERR_DSP_FORMAT, | ||
329 | FMOD_ERR_DSP_INUSE, | ||
330 | FMOD_ERR_DSP_NOTFOUND, | ||
331 | FMOD_ERR_DSP_RESERVED, | ||
332 | FMOD_ERR_DSP_SILENCE, | ||
333 | FMOD_ERR_DSP_TYPE, | ||
334 | FMOD_ERR_FILE_BAD, | ||
335 | FMOD_ERR_FILE_COULDNOTSEEK, | ||
336 | FMOD_ERR_FILE_DISKEJECTED, | ||
337 | FMOD_ERR_FILE_EOF, | ||
338 | FMOD_ERR_FILE_ENDOFDATA, | ||
339 | FMOD_ERR_FILE_NOTFOUND, | ||
340 | FMOD_ERR_FORMAT, | ||
341 | FMOD_ERR_HEADER_MISMATCH, | ||
342 | FMOD_ERR_HTTP, | ||
343 | FMOD_ERR_HTTP_ACCESS, | ||
344 | FMOD_ERR_HTTP_PROXY_AUTH, | ||
345 | FMOD_ERR_HTTP_SERVER_ERROR, | ||
346 | FMOD_ERR_HTTP_TIMEOUT, | ||
347 | FMOD_ERR_INITIALIZATION, | ||
348 | FMOD_ERR_INITIALIZED, | ||
349 | FMOD_ERR_INTERNAL, | ||
350 | FMOD_ERR_INVALID_FLOAT, | ||
351 | FMOD_ERR_INVALID_HANDLE, | ||
352 | FMOD_ERR_INVALID_PARAM, | ||
353 | FMOD_ERR_INVALID_POSITION, | ||
354 | FMOD_ERR_INVALID_SPEAKER, | ||
355 | FMOD_ERR_INVALID_SYNCPOINT, | ||
356 | FMOD_ERR_INVALID_THREAD, | ||
357 | FMOD_ERR_INVALID_VECTOR, | ||
358 | FMOD_ERR_MAXAUDIBLE, | ||
359 | FMOD_ERR_MEMORY, | ||
360 | FMOD_ERR_MEMORY_CANTPOINT, | ||
361 | FMOD_ERR_NEEDS3D, | ||
362 | FMOD_ERR_NEEDSHARDWARE, | ||
363 | FMOD_ERR_NET_CONNECT, | ||
364 | FMOD_ERR_NET_SOCKET_ERROR, | ||
365 | FMOD_ERR_NET_URL, | ||
366 | FMOD_ERR_NET_WOULD_BLOCK, | ||
367 | FMOD_ERR_NOTREADY, | ||
368 | FMOD_ERR_OUTPUT_ALLOCATED, | ||
369 | FMOD_ERR_OUTPUT_CREATEBUFFER, | ||
370 | FMOD_ERR_OUTPUT_DRIVERCALL, | ||
371 | FMOD_ERR_OUTPUT_FORMAT, | ||
372 | FMOD_ERR_OUTPUT_INIT, | ||
373 | FMOD_ERR_OUTPUT_NODRIVERS, | ||
374 | FMOD_ERR_PLUGIN, | ||
375 | FMOD_ERR_PLUGIN_MISSING, | ||
376 | FMOD_ERR_PLUGIN_RESOURCE, | ||
377 | FMOD_ERR_PLUGIN_VERSION, | ||
378 | FMOD_ERR_RECORD, | ||
379 | FMOD_ERR_REVERB_CHANNELGROUP, | ||
380 | FMOD_ERR_REVERB_INSTANCE, | ||
381 | FMOD_ERR_SUBSOUNDS, | ||
382 | FMOD_ERR_SUBSOUND_ALLOCATED, | ||
383 | FMOD_ERR_SUBSOUND_CANTMOVE, | ||
384 | FMOD_ERR_TAGNOTFOUND, | ||
385 | FMOD_ERR_TOOMANYCHANNELS, | ||
386 | FMOD_ERR_TRUNCATED, | ||
387 | FMOD_ERR_UNIMPLEMENTED, | ||
388 | FMOD_ERR_UNINITIALIZED, | ||
389 | FMOD_ERR_UNSUPPORTED, | ||
390 | FMOD_ERR_VERSION, | ||
391 | FMOD_ERR_EVENT_ALREADY_LOADED, | ||
392 | FMOD_ERR_EVENT_LIVEUPDATE_BUSY, | ||
393 | FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH, | ||
394 | FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT, | ||
395 | FMOD_ERR_EVENT_NOTFOUND, | ||
396 | FMOD_ERR_STUDIO_UNINITIALIZED, | ||
397 | FMOD_ERR_STUDIO_NOT_LOADED, | ||
398 | FMOD_ERR_INVALID_STRING, | ||
399 | FMOD_ERR_ALREADY_LOCKED, | ||
400 | FMOD_ERR_NOT_LOCKED, | ||
401 | FMOD_ERR_RECORD_DISCONNECTED, | ||
402 | FMOD_ERR_TOOMANYSAMPLES, | ||
403 | |||
404 | FMOD_RESULT_FORCEINT = 65536 | ||
405 | } FMOD_RESULT; | ||
406 | |||
407 | typedef enum FMOD_CHANNELCONTROL_TYPE | ||
408 | { | ||
409 | FMOD_CHANNELCONTROL_CHANNEL, | ||
410 | FMOD_CHANNELCONTROL_CHANNELGROUP, | ||
411 | |||
412 | FMOD_CHANNELCONTROL_MAX, | ||
413 | FMOD_CHANNELCONTROL_FORCEINT = 65536 | ||
414 | } FMOD_CHANNELCONTROL_TYPE; | ||
415 | |||
416 | typedef enum FMOD_OUTPUTTYPE | ||
417 | { | ||
418 | FMOD_OUTPUTTYPE_AUTODETECT, | ||
419 | FMOD_OUTPUTTYPE_UNKNOWN, | ||
420 | FMOD_OUTPUTTYPE_NOSOUND, | ||
421 | FMOD_OUTPUTTYPE_WAVWRITER, | ||
422 | FMOD_OUTPUTTYPE_NOSOUND_NRT, | ||
423 | FMOD_OUTPUTTYPE_WAVWRITER_NRT, | ||
424 | FMOD_OUTPUTTYPE_WASAPI, | ||
425 | FMOD_OUTPUTTYPE_ASIO, | ||
426 | FMOD_OUTPUTTYPE_PULSEAUDIO, | ||
427 | FMOD_OUTPUTTYPE_ALSA, | ||
428 | FMOD_OUTPUTTYPE_COREAUDIO, | ||
429 | FMOD_OUTPUTTYPE_AUDIOTRACK, | ||
430 | FMOD_OUTPUTTYPE_OPENSL, | ||
431 | FMOD_OUTPUTTYPE_AUDIOOUT, | ||
432 | FMOD_OUTPUTTYPE_AUDIO3D, | ||
433 | FMOD_OUTPUTTYPE_WEBAUDIO, | ||
434 | FMOD_OUTPUTTYPE_NNAUDIO, | ||
435 | FMOD_OUTPUTTYPE_WINSONIC, | ||
436 | FMOD_OUTPUTTYPE_AAUDIO, | ||
437 | FMOD_OUTPUTTYPE_AUDIOWORKLET, | ||
438 | |||
439 | FMOD_OUTPUTTYPE_MAX, | ||
440 | FMOD_OUTPUTTYPE_FORCEINT = 65536 | ||
441 | } FMOD_OUTPUTTYPE; | ||
442 | |||
443 | typedef enum FMOD_DEBUG_MODE | ||
444 | { | ||
445 | FMOD_DEBUG_MODE_TTY, | ||
446 | FMOD_DEBUG_MODE_FILE, | ||
447 | FMOD_DEBUG_MODE_CALLBACK, | ||
448 | |||
449 | FMOD_DEBUG_MODE_FORCEINT = 65536 | ||
450 | } FMOD_DEBUG_MODE; | ||
451 | |||
452 | typedef enum FMOD_SPEAKERMODE | ||
453 | { | ||
454 | FMOD_SPEAKERMODE_DEFAULT, | ||
455 | FMOD_SPEAKERMODE_RAW, | ||
456 | FMOD_SPEAKERMODE_MONO, | ||
457 | FMOD_SPEAKERMODE_STEREO, | ||
458 | FMOD_SPEAKERMODE_QUAD, | ||
459 | FMOD_SPEAKERMODE_SURROUND, | ||
460 | FMOD_SPEAKERMODE_5POINT1, | ||
461 | FMOD_SPEAKERMODE_7POINT1, | ||
462 | FMOD_SPEAKERMODE_7POINT1POINT4, | ||
463 | |||
464 | FMOD_SPEAKERMODE_MAX, | ||
465 | FMOD_SPEAKERMODE_FORCEINT = 65536 | ||
466 | } FMOD_SPEAKERMODE; | ||
467 | |||
468 | typedef enum FMOD_SPEAKER | ||
469 | { | ||
470 | FMOD_SPEAKER_NONE = -1, | ||
471 | FMOD_SPEAKER_FRONT_LEFT = 0, | ||
472 | FMOD_SPEAKER_FRONT_RIGHT, | ||
473 | FMOD_SPEAKER_FRONT_CENTER, | ||
474 | FMOD_SPEAKER_LOW_FREQUENCY, | ||
475 | FMOD_SPEAKER_SURROUND_LEFT, | ||
476 | FMOD_SPEAKER_SURROUND_RIGHT, | ||
477 | FMOD_SPEAKER_BACK_LEFT, | ||
478 | FMOD_SPEAKER_BACK_RIGHT, | ||
479 | FMOD_SPEAKER_TOP_FRONT_LEFT, | ||
480 | FMOD_SPEAKER_TOP_FRONT_RIGHT, | ||
481 | FMOD_SPEAKER_TOP_BACK_LEFT, | ||
482 | FMOD_SPEAKER_TOP_BACK_RIGHT, | ||
483 | |||
484 | FMOD_SPEAKER_MAX, | ||
485 | FMOD_SPEAKER_FORCEINT = 65536 | ||
486 | } FMOD_SPEAKER; | ||
487 | |||
488 | typedef enum FMOD_CHANNELORDER | ||
489 | { | ||
490 | FMOD_CHANNELORDER_DEFAULT, | ||
491 | FMOD_CHANNELORDER_WAVEFORMAT, | ||
492 | FMOD_CHANNELORDER_PROTOOLS, | ||
493 | FMOD_CHANNELORDER_ALLMONO, | ||
494 | FMOD_CHANNELORDER_ALLSTEREO, | ||
495 | FMOD_CHANNELORDER_ALSA, | ||
496 | |||
497 | FMOD_CHANNELORDER_MAX, | ||
498 | FMOD_CHANNELORDER_FORCEINT = 65536 | ||
499 | } FMOD_CHANNELORDER; | ||
500 | |||
501 | typedef enum FMOD_PLUGINTYPE | ||
502 | { | ||
503 | FMOD_PLUGINTYPE_OUTPUT, | ||
504 | FMOD_PLUGINTYPE_CODEC, | ||
505 | FMOD_PLUGINTYPE_DSP, | ||
506 | |||
507 | FMOD_PLUGINTYPE_MAX, | ||
508 | FMOD_PLUGINTYPE_FORCEINT = 65536 | ||
509 | } FMOD_PLUGINTYPE; | ||
510 | |||
511 | typedef enum FMOD_SOUND_TYPE | ||
512 | { | ||
513 | FMOD_SOUND_TYPE_UNKNOWN, | ||
514 | FMOD_SOUND_TYPE_AIFF, | ||
515 | FMOD_SOUND_TYPE_ASF, | ||
516 | FMOD_SOUND_TYPE_DLS, | ||
517 | FMOD_SOUND_TYPE_FLAC, | ||
518 | FMOD_SOUND_TYPE_FSB, | ||
519 | FMOD_SOUND_TYPE_IT, | ||
520 | FMOD_SOUND_TYPE_MIDI, | ||
521 | FMOD_SOUND_TYPE_MOD, | ||
522 | FMOD_SOUND_TYPE_MPEG, | ||
523 | FMOD_SOUND_TYPE_OGGVORBIS, | ||
524 | FMOD_SOUND_TYPE_PLAYLIST, | ||
525 | FMOD_SOUND_TYPE_RAW, | ||
526 | FMOD_SOUND_TYPE_S3M, | ||
527 | FMOD_SOUND_TYPE_USER, | ||
528 | FMOD_SOUND_TYPE_WAV, | ||
529 | FMOD_SOUND_TYPE_XM, | ||
530 | FMOD_SOUND_TYPE_XMA, | ||
531 | FMOD_SOUND_TYPE_AUDIOQUEUE, | ||
532 | FMOD_SOUND_TYPE_AT9, | ||
533 | FMOD_SOUND_TYPE_VORBIS, | ||
534 | FMOD_SOUND_TYPE_MEDIA_FOUNDATION, | ||
535 | FMOD_SOUND_TYPE_MEDIACODEC, | ||
536 | FMOD_SOUND_TYPE_FADPCM, | ||
537 | FMOD_SOUND_TYPE_OPUS, | ||
538 | |||
539 | FMOD_SOUND_TYPE_MAX, | ||
540 | FMOD_SOUND_TYPE_FORCEINT = 65536 | ||
541 | } FMOD_SOUND_TYPE; | ||
542 | |||
543 | typedef enum FMOD_SOUND_FORMAT | ||
544 | { | ||
545 | FMOD_SOUND_FORMAT_NONE, | ||
546 | FMOD_SOUND_FORMAT_PCM8, | ||
547 | FMOD_SOUND_FORMAT_PCM16, | ||
548 | FMOD_SOUND_FORMAT_PCM24, | ||
549 | FMOD_SOUND_FORMAT_PCM32, | ||
550 | FMOD_SOUND_FORMAT_PCMFLOAT, | ||
551 | FMOD_SOUND_FORMAT_BITSTREAM, | ||
552 | |||
553 | FMOD_SOUND_FORMAT_MAX, | ||
554 | FMOD_SOUND_FORMAT_FORCEINT = 65536 | ||
555 | } FMOD_SOUND_FORMAT; | ||
556 | |||
557 | typedef enum FMOD_OPENSTATE | ||
558 | { | ||
559 | FMOD_OPENSTATE_READY, | ||
560 | FMOD_OPENSTATE_LOADING, | ||
561 | FMOD_OPENSTATE_ERROR, | ||
562 | FMOD_OPENSTATE_CONNECTING, | ||
563 | FMOD_OPENSTATE_BUFFERING, | ||
564 | FMOD_OPENSTATE_SEEKING, | ||
565 | FMOD_OPENSTATE_PLAYING, | ||
566 | FMOD_OPENSTATE_SETPOSITION, | ||
567 | |||
568 | FMOD_OPENSTATE_MAX, | ||
569 | FMOD_OPENSTATE_FORCEINT = 65536 | ||
570 | } FMOD_OPENSTATE; | ||
571 | |||
572 | typedef enum FMOD_SOUNDGROUP_BEHAVIOR | ||
573 | { | ||
574 | FMOD_SOUNDGROUP_BEHAVIOR_FAIL, | ||
575 | FMOD_SOUNDGROUP_BEHAVIOR_MUTE, | ||
576 | FMOD_SOUNDGROUP_BEHAVIOR_STEALLOWEST, | ||
577 | |||
578 | FMOD_SOUNDGROUP_BEHAVIOR_MAX, | ||
579 | FMOD_SOUNDGROUP_BEHAVIOR_FORCEINT = 65536 | ||
580 | } FMOD_SOUNDGROUP_BEHAVIOR; | ||
581 | |||
582 | typedef enum FMOD_CHANNELCONTROL_CALLBACK_TYPE | ||
583 | { | ||
584 | FMOD_CHANNELCONTROL_CALLBACK_END, | ||
585 | FMOD_CHANNELCONTROL_CALLBACK_VIRTUALVOICE, | ||
586 | FMOD_CHANNELCONTROL_CALLBACK_SYNCPOINT, | ||
587 | FMOD_CHANNELCONTROL_CALLBACK_OCCLUSION, | ||
588 | |||
589 | FMOD_CHANNELCONTROL_CALLBACK_MAX, | ||
590 | FMOD_CHANNELCONTROL_CALLBACK_FORCEINT = 65536 | ||
591 | } FMOD_CHANNELCONTROL_CALLBACK_TYPE; | ||
592 | |||
593 | typedef enum FMOD_CHANNELCONTROL_DSP_INDEX | ||
594 | { | ||
595 | FMOD_CHANNELCONTROL_DSP_HEAD = -1, | ||
596 | FMOD_CHANNELCONTROL_DSP_FADER = -2, | ||
597 | FMOD_CHANNELCONTROL_DSP_TAIL = -3, | ||
598 | |||
599 | FMOD_CHANNELCONTROL_DSP_FORCEINT = 65536 | ||
600 | } FMOD_CHANNELCONTROL_DSP_INDEX; | ||
601 | |||
602 | typedef enum FMOD_ERRORCALLBACK_INSTANCETYPE | ||
603 | { | ||
604 | FMOD_ERRORCALLBACK_INSTANCETYPE_NONE, | ||
605 | FMOD_ERRORCALLBACK_INSTANCETYPE_SYSTEM, | ||
606 | FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNEL, | ||
607 | FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELGROUP, | ||
608 | FMOD_ERRORCALLBACK_INSTANCETYPE_CHANNELCONTROL, | ||
609 | FMOD_ERRORCALLBACK_INSTANCETYPE_SOUND, | ||
610 | FMOD_ERRORCALLBACK_INSTANCETYPE_SOUNDGROUP, | ||
611 | FMOD_ERRORCALLBACK_INSTANCETYPE_DSP, | ||
612 | FMOD_ERRORCALLBACK_INSTANCETYPE_DSPCONNECTION, | ||
613 | FMOD_ERRORCALLBACK_INSTANCETYPE_GEOMETRY, | ||
614 | FMOD_ERRORCALLBACK_INSTANCETYPE_REVERB3D, | ||
615 | FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_SYSTEM, | ||
616 | FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTDESCRIPTION, | ||
617 | FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_EVENTINSTANCE, | ||
618 | FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_PARAMETERINSTANCE, | ||
619 | FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BUS, | ||
620 | FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_VCA, | ||
621 | FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_BANK, | ||
622 | FMOD_ERRORCALLBACK_INSTANCETYPE_STUDIO_COMMANDREPLAY, | ||
623 | |||
624 | FMOD_ERRORCALLBACK_INSTANCETYPE_FORCEINT = 65536 | ||
625 | } FMOD_ERRORCALLBACK_INSTANCETYPE; | ||
626 | |||
627 | typedef enum FMOD_DSP_RESAMPLER | ||
628 | { | ||
629 | FMOD_DSP_RESAMPLER_DEFAULT, | ||
630 | FMOD_DSP_RESAMPLER_NOINTERP, | ||
631 | FMOD_DSP_RESAMPLER_LINEAR, | ||
632 | FMOD_DSP_RESAMPLER_CUBIC, | ||
633 | FMOD_DSP_RESAMPLER_SPLINE, | ||
634 | |||
635 | FMOD_DSP_RESAMPLER_MAX, | ||
636 | FMOD_DSP_RESAMPLER_FORCEINT = 65536 | ||
637 | } FMOD_DSP_RESAMPLER; | ||
638 | |||
639 | typedef enum FMOD_DSPCONNECTION_TYPE | ||
640 | { | ||
641 | FMOD_DSPCONNECTION_TYPE_STANDARD, | ||
642 | FMOD_DSPCONNECTION_TYPE_SIDECHAIN, | ||
643 | FMOD_DSPCONNECTION_TYPE_SEND, | ||
644 | FMOD_DSPCONNECTION_TYPE_SEND_SIDECHAIN, | ||
645 | |||
646 | FMOD_DSPCONNECTION_TYPE_MAX, | ||
647 | FMOD_DSPCONNECTION_TYPE_FORCEINT = 65536 | ||
648 | } FMOD_DSPCONNECTION_TYPE; | ||
649 | |||
650 | typedef enum FMOD_TAGTYPE | ||
651 | { | ||
652 | FMOD_TAGTYPE_UNKNOWN, | ||
653 | FMOD_TAGTYPE_ID3V1, | ||
654 | FMOD_TAGTYPE_ID3V2, | ||
655 | FMOD_TAGTYPE_VORBISCOMMENT, | ||
656 | FMOD_TAGTYPE_SHOUTCAST, | ||
657 | FMOD_TAGTYPE_ICECAST, | ||
658 | FMOD_TAGTYPE_ASF, | ||
659 | FMOD_TAGTYPE_MIDI, | ||
660 | FMOD_TAGTYPE_PLAYLIST, | ||
661 | FMOD_TAGTYPE_FMOD, | ||
662 | FMOD_TAGTYPE_USER, | ||
663 | |||
664 | FMOD_TAGTYPE_MAX, | ||
665 | FMOD_TAGTYPE_FORCEINT = 65536 | ||
666 | } FMOD_TAGTYPE; | ||
667 | |||
668 | typedef enum FMOD_TAGDATATYPE | ||
669 | { | ||
670 | FMOD_TAGDATATYPE_BINARY, | ||
671 | FMOD_TAGDATATYPE_INT, | ||
672 | FMOD_TAGDATATYPE_FLOAT, | ||
673 | FMOD_TAGDATATYPE_STRING, | ||
674 | FMOD_TAGDATATYPE_STRING_UTF16, | ||
675 | FMOD_TAGDATATYPE_STRING_UTF16BE, | ||
676 | FMOD_TAGDATATYPE_STRING_UTF8, | ||
677 | |||
678 | FMOD_TAGDATATYPE_MAX, | ||
679 | FMOD_TAGDATATYPE_FORCEINT = 65536 | ||
680 | } FMOD_TAGDATATYPE; | ||
681 | |||
682 | typedef enum FMOD_PORT_TYPE | ||
683 | { | ||
684 | FMOD_PORT_TYPE_MUSIC, | ||
685 | FMOD_PORT_TYPE_COPYRIGHT_MUSIC, | ||
686 | FMOD_PORT_TYPE_VOICE, | ||
687 | FMOD_PORT_TYPE_CONTROLLER, | ||
688 | FMOD_PORT_TYPE_PERSONAL, | ||
689 | FMOD_PORT_TYPE_VIBRATION, | ||
690 | FMOD_PORT_TYPE_AUX, | ||
691 | |||
692 | FMOD_PORT_TYPE_MAX, | ||
693 | FMOD_PORT_TYPE_FORCEINT = 65536 | ||
694 | } FMOD_PORT_TYPE; | ||
695 | |||
696 | /* | ||
697 | FMOD callbacks | ||
698 | */ | ||
699 | typedef FMOD_RESULT (F_CALL *FMOD_DEBUG_CALLBACK) (FMOD_DEBUG_FLAGS flags, const char *file, int line, const char* func, const char* message); | ||
700 | typedef FMOD_RESULT (F_CALL *FMOD_SYSTEM_CALLBACK) (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK_TYPE type, void *commanddata1, void* commanddata2, void *userdata); | ||
701 | typedef FMOD_RESULT (F_CALL *FMOD_CHANNELCONTROL_CALLBACK) (FMOD_CHANNELCONTROL *channelcontrol, FMOD_CHANNELCONTROL_TYPE controltype, FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype, void *commanddata1, void *commanddata2); | ||
702 | typedef FMOD_RESULT (F_CALL *FMOD_SOUND_NONBLOCK_CALLBACK) (FMOD_SOUND *sound, FMOD_RESULT result); | ||
703 | typedef FMOD_RESULT (F_CALL *FMOD_SOUND_PCMREAD_CALLBACK) (FMOD_SOUND *sound, void *data, unsigned int datalen); | ||
704 | typedef FMOD_RESULT (F_CALL *FMOD_SOUND_PCMSETPOS_CALLBACK) (FMOD_SOUND *sound, int subsound, unsigned int position, FMOD_TIMEUNIT postype); | ||
705 | typedef FMOD_RESULT (F_CALL *FMOD_FILE_OPEN_CALLBACK) (const char *name, unsigned int *filesize, void **handle, void *userdata); | ||
706 | typedef FMOD_RESULT (F_CALL *FMOD_FILE_CLOSE_CALLBACK) (void *handle, void *userdata); | ||
707 | typedef FMOD_RESULT (F_CALL *FMOD_FILE_READ_CALLBACK) (void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata); | ||
708 | typedef FMOD_RESULT (F_CALL *FMOD_FILE_SEEK_CALLBACK) (void *handle, unsigned int pos, void *userdata); | ||
709 | typedef FMOD_RESULT (F_CALL *FMOD_FILE_ASYNCREAD_CALLBACK) (FMOD_ASYNCREADINFO *info, void *userdata); | ||
710 | typedef FMOD_RESULT (F_CALL *FMOD_FILE_ASYNCCANCEL_CALLBACK)(FMOD_ASYNCREADINFO *info, void *userdata); | ||
711 | typedef void (F_CALL *FMOD_FILE_ASYNCDONE_FUNC) (FMOD_ASYNCREADINFO *info, FMOD_RESULT result); | ||
712 | typedef void* (F_CALL *FMOD_MEMORY_ALLOC_CALLBACK) (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr); | ||
713 | typedef void* (F_CALL *FMOD_MEMORY_REALLOC_CALLBACK) (void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr); | ||
714 | typedef void (F_CALL *FMOD_MEMORY_FREE_CALLBACK) (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr); | ||
715 | typedef float (F_CALL *FMOD_3D_ROLLOFF_CALLBACK) (FMOD_CHANNELCONTROL *channelcontrol, float distance); | ||
716 | |||
717 | /* | ||
718 | FMOD structs | ||
719 | */ | ||
720 | struct FMOD_ASYNCREADINFO | ||
721 | { | ||
722 | void *handle; | ||
723 | unsigned int offset; | ||
724 | unsigned int sizebytes; | ||
725 | int priority; | ||
726 | void *userdata; | ||
727 | void *buffer; | ||
728 | unsigned int bytesread; | ||
729 | FMOD_FILE_ASYNCDONE_FUNC done; | ||
730 | }; | ||
731 | |||
732 | typedef struct FMOD_VECTOR | ||
733 | { | ||
734 | float x; | ||
735 | float y; | ||
736 | float z; | ||
737 | } FMOD_VECTOR; | ||
738 | |||
739 | typedef struct FMOD_3D_ATTRIBUTES | ||
740 | { | ||
741 | FMOD_VECTOR position; | ||
742 | FMOD_VECTOR velocity; | ||
743 | FMOD_VECTOR forward; | ||
744 | FMOD_VECTOR up; | ||
745 | } FMOD_3D_ATTRIBUTES; | ||
746 | |||
747 | typedef struct FMOD_GUID | ||
748 | { | ||
749 | unsigned int Data1; | ||
750 | unsigned short Data2; | ||
751 | unsigned short Data3; | ||
752 | unsigned char Data4[8]; | ||
753 | } FMOD_GUID; | ||
754 | |||
755 | typedef struct FMOD_PLUGINLIST | ||
756 | { | ||
757 | FMOD_PLUGINTYPE type; | ||
758 | void *description; | ||
759 | } FMOD_PLUGINLIST; | ||
760 | |||
761 | typedef struct FMOD_ADVANCEDSETTINGS | ||
762 | { | ||
763 | int cbSize; | ||
764 | int maxMPEGCodecs; | ||
765 | int maxADPCMCodecs; | ||
766 | int maxXMACodecs; | ||
767 | int maxVorbisCodecs; | ||
768 | int maxAT9Codecs; | ||
769 | int maxFADPCMCodecs; | ||
770 | int maxPCMCodecs; | ||
771 | int ASIONumChannels; | ||
772 | char **ASIOChannelList; | ||
773 | FMOD_SPEAKER *ASIOSpeakerList; | ||
774 | float vol0virtualvol; | ||
775 | unsigned int defaultDecodeBufferSize; | ||
776 | unsigned short profilePort; | ||
777 | unsigned int geometryMaxFadeTime; | ||
778 | float distanceFilterCenterFreq; | ||
779 | int reverb3Dinstance; | ||
780 | int DSPBufferPoolSize; | ||
781 | FMOD_DSP_RESAMPLER resamplerMethod; | ||
782 | unsigned int randomSeed; | ||
783 | int maxConvolutionThreads; | ||
784 | int maxOpusCodecs; | ||
785 | } FMOD_ADVANCEDSETTINGS; | ||
786 | |||
787 | typedef struct FMOD_TAG | ||
788 | { | ||
789 | FMOD_TAGTYPE type; | ||
790 | FMOD_TAGDATATYPE datatype; | ||
791 | char *name; | ||
792 | void *data; | ||
793 | unsigned int datalen; | ||
794 | FMOD_BOOL updated; | ||
795 | } FMOD_TAG; | ||
796 | |||
797 | typedef struct FMOD_CREATESOUNDEXINFO | ||
798 | { | ||
799 | int cbsize; | ||
800 | unsigned int length; | ||
801 | unsigned int fileoffset; | ||
802 | int numchannels; | ||
803 | int defaultfrequency; | ||
804 | FMOD_SOUND_FORMAT format; | ||
805 | unsigned int decodebuffersize; | ||
806 | int initialsubsound; | ||
807 | int numsubsounds; | ||
808 | int *inclusionlist; | ||
809 | int inclusionlistnum; | ||
810 | FMOD_SOUND_PCMREAD_CALLBACK pcmreadcallback; | ||
811 | FMOD_SOUND_PCMSETPOS_CALLBACK pcmsetposcallback; | ||
812 | FMOD_SOUND_NONBLOCK_CALLBACK nonblockcallback; | ||
813 | const char *dlsname; | ||
814 | const char *encryptionkey; | ||
815 | int maxpolyphony; | ||
816 | void *userdata; | ||
817 | FMOD_SOUND_TYPE suggestedsoundtype; | ||
818 | FMOD_FILE_OPEN_CALLBACK fileuseropen; | ||
819 | FMOD_FILE_CLOSE_CALLBACK fileuserclose; | ||
820 | FMOD_FILE_READ_CALLBACK fileuserread; | ||
821 | FMOD_FILE_SEEK_CALLBACK fileuserseek; | ||
822 | FMOD_FILE_ASYNCREAD_CALLBACK fileuserasyncread; | ||
823 | FMOD_FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel; | ||
824 | void *fileuserdata; | ||
825 | int filebuffersize; | ||
826 | FMOD_CHANNELORDER channelorder; | ||
827 | FMOD_SOUNDGROUP *initialsoundgroup; | ||
828 | unsigned int initialseekposition; | ||
829 | FMOD_TIMEUNIT initialseekpostype; | ||
830 | int ignoresetfilesystem; | ||
831 | unsigned int audioqueuepolicy; | ||
832 | unsigned int minmidigranularity; | ||
833 | int nonblockthreadid; | ||
834 | FMOD_GUID *fsbguid; | ||
835 | } FMOD_CREATESOUNDEXINFO; | ||
836 | |||
837 | typedef struct FMOD_REVERB_PROPERTIES | ||
838 | { | ||
839 | float DecayTime; | ||
840 | float EarlyDelay; | ||
841 | float LateDelay; | ||
842 | float HFReference; | ||
843 | float HFDecayRatio; | ||
844 | float Diffusion; | ||
845 | float Density; | ||
846 | float LowShelfFrequency; | ||
847 | float LowShelfGain; | ||
848 | float HighCut; | ||
849 | float EarlyLateMix; | ||
850 | float WetLevel; | ||
851 | } FMOD_REVERB_PROPERTIES; | ||
852 | |||
853 | typedef struct FMOD_ERRORCALLBACK_INFO | ||
854 | { | ||
855 | FMOD_RESULT result; | ||
856 | FMOD_ERRORCALLBACK_INSTANCETYPE instancetype; | ||
857 | void *instance; | ||
858 | const char *functionname; | ||
859 | const char *functionparams; | ||
860 | } FMOD_ERRORCALLBACK_INFO; | ||
861 | |||
862 | typedef struct FMOD_CPU_USAGE | ||
863 | { | ||
864 | float dsp; | ||
865 | float stream; | ||
866 | float geometry; | ||
867 | float update; | ||
868 | float convolution1; | ||
869 | float convolution2; | ||
870 | } FMOD_CPU_USAGE; | ||
871 | |||
872 | |||
873 | /* | ||
874 | FMOD optional headers for plugin development | ||
875 | */ | ||
876 | #include "fmod_codec.h" | ||
877 | #include "fmod_dsp.h" | ||
878 | #include "fmod_output.h" | ||
879 | |||
880 | #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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Core API - DSP header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header if you are wanting to develop your own DSP plugin to use with FMODs */ | ||
6 | /* dsp system. With this header you can make your own DSP plugin that FMOD can */ | ||
7 | /* register and use. See the documentation and examples on how to make a working plugin. */ | ||
8 | /* */ | ||
9 | /* For more detail visit: */ | ||
10 | /* https://fmod.com/resources/documentation-api?version=2.0&page=plugin-api-dsp.html */ | ||
11 | /* =========================================================================================*/ | ||
12 | |||
13 | using System; | ||
14 | using System.Text; | ||
15 | using System.Runtime.InteropServices; | ||
16 | |||
17 | namespace FMOD | ||
18 | { | ||
19 | [StructLayout(LayoutKind.Sequential)] | ||
20 | public struct DSP_BUFFER_ARRAY | ||
21 | { | ||
22 | public int numbuffers; | ||
23 | public int[] buffernumchannels; | ||
24 | public CHANNELMASK[] bufferchannelmask; | ||
25 | public IntPtr[] buffers; | ||
26 | public SPEAKERMODE speakermode; | ||
27 | } | ||
28 | |||
29 | public enum DSP_PROCESS_OPERATION | ||
30 | { | ||
31 | PROCESS_PERFORM = 0, | ||
32 | PROCESS_QUERY | ||
33 | } | ||
34 | |||
35 | [StructLayout(LayoutKind.Sequential)] | ||
36 | public struct COMPLEX | ||
37 | { | ||
38 | public float real; | ||
39 | public float imag; | ||
40 | } | ||
41 | |||
42 | public enum DSP_PAN_SURROUND_FLAGS | ||
43 | { | ||
44 | DEFAULT = 0, | ||
45 | ROTATION_NOT_BIASED = 1, | ||
46 | } | ||
47 | |||
48 | |||
49 | /* | ||
50 | DSP callbacks | ||
51 | */ | ||
52 | public delegate RESULT DSP_CREATECALLBACK (ref DSP_STATE dsp_state); | ||
53 | public delegate RESULT DSP_RELEASECALLBACK (ref DSP_STATE dsp_state); | ||
54 | public delegate RESULT DSP_RESETCALLBACK (ref DSP_STATE dsp_state); | ||
55 | public delegate RESULT DSP_SETPOSITIONCALLBACK (ref DSP_STATE dsp_state, uint pos); | ||
56 | public delegate RESULT DSP_READCALLBACK (ref DSP_STATE dsp_state, IntPtr inbuffer, IntPtr outbuffer, uint length, int inchannels, ref int outchannels); | ||
57 | public delegate RESULT DSP_SHOULDIPROCESS_CALLBACK (ref DSP_STATE dsp_state, bool inputsidle, uint length, CHANNELMASK inmask, int inchannels, SPEAKERMODE speakermode); | ||
58 | 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); | ||
59 | public delegate RESULT DSP_SETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, float value); | ||
60 | public delegate RESULT DSP_SETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, int value); | ||
61 | public delegate RESULT DSP_SETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, bool value); | ||
62 | public delegate RESULT DSP_SETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, IntPtr data, uint length); | ||
63 | public delegate RESULT DSP_GETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, ref float value, IntPtr valuestr); | ||
64 | public delegate RESULT DSP_GETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, ref int value, IntPtr valuestr); | ||
65 | public delegate RESULT DSP_GETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, ref bool value, IntPtr valuestr); | ||
66 | public delegate RESULT DSP_GETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, ref IntPtr data, ref uint length, IntPtr valuestr); | ||
67 | public delegate RESULT DSP_SYSTEM_REGISTER_CALLBACK (ref DSP_STATE dsp_state); | ||
68 | public delegate RESULT DSP_SYSTEM_DEREGISTER_CALLBACK (ref DSP_STATE dsp_state); | ||
69 | public delegate RESULT DSP_SYSTEM_MIX_CALLBACK (ref DSP_STATE dsp_state, int stage); | ||
70 | |||
71 | |||
72 | /* | ||
73 | DSP functions | ||
74 | */ | ||
75 | public delegate IntPtr DSP_ALLOC_FUNC (uint size, MEMORY_TYPE type, IntPtr sourcestr); | ||
76 | public delegate IntPtr DSP_REALLOC_FUNC (IntPtr ptr, uint size, MEMORY_TYPE type, IntPtr sourcestr); | ||
77 | public delegate void DSP_FREE_FUNC (IntPtr ptr, MEMORY_TYPE type, IntPtr sourcestr); | ||
78 | public delegate void DSP_LOG_FUNC (DEBUG_FLAGS level, IntPtr file, int line, IntPtr function, IntPtr format); | ||
79 | public delegate RESULT DSP_GETSAMPLERATE_FUNC (ref DSP_STATE dsp_state, ref int rate); | ||
80 | public delegate RESULT DSP_GETBLOCKSIZE_FUNC (ref DSP_STATE dsp_state, ref uint blocksize); | ||
81 | public delegate RESULT DSP_GETSPEAKERMODE_FUNC (ref DSP_STATE dsp_state, ref int speakermode_mixer, ref int speakermode_output); | ||
82 | public delegate RESULT DSP_GETCLOCK_FUNC (ref DSP_STATE dsp_state, out ulong clock, out uint offset, out uint length); | ||
83 | public delegate RESULT DSP_GETLISTENERATTRIBUTES_FUNC (ref DSP_STATE dsp_state, ref int numlisteners, IntPtr attributes); | ||
84 | public delegate RESULT DSP_GETUSERDATA_FUNC (ref DSP_STATE dsp_state, out IntPtr userdata); | ||
85 | public delegate RESULT DSP_DFT_FFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr signal, IntPtr dft, IntPtr window, int signalhop); | ||
86 | public delegate RESULT DSP_DFT_IFFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr dft, IntPtr signal, IntPtr window, int signalhop); | ||
87 | public delegate RESULT DSP_PAN_SUMMONOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, IntPtr matrix); | ||
88 | public delegate RESULT DSP_PAN_SUMSTEREOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); | ||
89 | 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); | ||
90 | 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); | ||
91 | 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); | ||
92 | 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); | ||
93 | |||
94 | |||
95 | public enum DSP_TYPE : int | ||
96 | { | ||
97 | UNKNOWN, | ||
98 | MIXER, | ||
99 | OSCILLATOR, | ||
100 | LOWPASS, | ||
101 | ITLOWPASS, | ||
102 | HIGHPASS, | ||
103 | ECHO, | ||
104 | FADER, | ||
105 | FLANGE, | ||
106 | DISTORTION, | ||
107 | NORMALIZE, | ||
108 | LIMITER, | ||
109 | PARAMEQ, | ||
110 | PITCHSHIFT, | ||
111 | CHORUS, | ||
112 | VSTPLUGIN, | ||
113 | WINAMPPLUGIN, | ||
114 | ITECHO, | ||
115 | COMPRESSOR, | ||
116 | SFXREVERB, | ||
117 | LOWPASS_SIMPLE, | ||
118 | DELAY, | ||
119 | TREMOLO, | ||
120 | LADSPAPLUGIN, | ||
121 | SEND, | ||
122 | RETURN, | ||
123 | HIGHPASS_SIMPLE, | ||
124 | PAN, | ||
125 | THREE_EQ, | ||
126 | FFT, | ||
127 | LOUDNESS_METER, | ||
128 | ENVELOPEFOLLOWER, | ||
129 | CONVOLUTIONREVERB, | ||
130 | CHANNELMIX, | ||
131 | TRANSCEIVER, | ||
132 | OBJECTPAN, | ||
133 | MULTIBAND_EQ, | ||
134 | MAX | ||
135 | } | ||
136 | |||
137 | public enum DSP_PARAMETER_TYPE | ||
138 | { | ||
139 | FLOAT = 0, | ||
140 | INT, | ||
141 | BOOL, | ||
142 | DATA, | ||
143 | MAX | ||
144 | } | ||
145 | |||
146 | public enum DSP_PARAMETER_FLOAT_MAPPING_TYPE | ||
147 | { | ||
148 | DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR = 0, | ||
149 | DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, | ||
150 | DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, | ||
151 | } | ||
152 | |||
153 | [StructLayout(LayoutKind.Sequential)] | ||
154 | public struct DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR | ||
155 | { | ||
156 | public int numpoints; | ||
157 | public IntPtr pointparamvalues; | ||
158 | public IntPtr pointpositions; | ||
159 | } | ||
160 | |||
161 | [StructLayout(LayoutKind.Sequential)] | ||
162 | public struct DSP_PARAMETER_FLOAT_MAPPING | ||
163 | { | ||
164 | public DSP_PARAMETER_FLOAT_MAPPING_TYPE type; | ||
165 | public DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; | ||
166 | } | ||
167 | |||
168 | |||
169 | [StructLayout(LayoutKind.Sequential)] | ||
170 | public struct DSP_PARAMETER_DESC_FLOAT | ||
171 | { | ||
172 | public float min; | ||
173 | public float max; | ||
174 | public float defaultval; | ||
175 | public DSP_PARAMETER_FLOAT_MAPPING mapping; | ||
176 | } | ||
177 | |||
178 | [StructLayout(LayoutKind.Sequential)] | ||
179 | public struct DSP_PARAMETER_DESC_INT | ||
180 | { | ||
181 | public int min; | ||
182 | public int max; | ||
183 | public int defaultval; | ||
184 | public bool goestoinf; | ||
185 | public IntPtr valuenames; | ||
186 | } | ||
187 | |||
188 | [StructLayout(LayoutKind.Sequential)] | ||
189 | public struct DSP_PARAMETER_DESC_BOOL | ||
190 | { | ||
191 | public bool defaultval; | ||
192 | public IntPtr valuenames; | ||
193 | } | ||
194 | |||
195 | [StructLayout(LayoutKind.Sequential)] | ||
196 | public struct DSP_PARAMETER_DESC_DATA | ||
197 | { | ||
198 | public int datatype; | ||
199 | } | ||
200 | |||
201 | [StructLayout(LayoutKind.Explicit)] | ||
202 | public struct DSP_PARAMETER_DESC_UNION | ||
203 | { | ||
204 | [FieldOffset(0)] | ||
205 | public DSP_PARAMETER_DESC_FLOAT floatdesc; | ||
206 | [FieldOffset(0)] | ||
207 | public DSP_PARAMETER_DESC_INT intdesc; | ||
208 | [FieldOffset(0)] | ||
209 | public DSP_PARAMETER_DESC_BOOL booldesc; | ||
210 | [FieldOffset(0)] | ||
211 | public DSP_PARAMETER_DESC_DATA datadesc; | ||
212 | } | ||
213 | |||
214 | [StructLayout(LayoutKind.Sequential)] | ||
215 | public struct DSP_PARAMETER_DESC | ||
216 | { | ||
217 | public DSP_PARAMETER_TYPE type; | ||
218 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] | ||
219 | public byte[] name; | ||
220 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] | ||
221 | public byte[] label; | ||
222 | public string description; | ||
223 | |||
224 | public DSP_PARAMETER_DESC_UNION desc; | ||
225 | } | ||
226 | |||
227 | public enum DSP_PARAMETER_DATA_TYPE | ||
228 | { | ||
229 | DSP_PARAMETER_DATA_TYPE_USER = 0, | ||
230 | DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, | ||
231 | DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, | ||
232 | DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, | ||
233 | DSP_PARAMETER_DATA_TYPE_FFT = -4, | ||
234 | DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, | ||
235 | DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE = -6 | ||
236 | } | ||
237 | |||
238 | [StructLayout(LayoutKind.Sequential)] | ||
239 | public struct DSP_PARAMETER_OVERALLGAIN | ||
240 | { | ||
241 | public float linear_gain; | ||
242 | public float linear_gain_additive; | ||
243 | } | ||
244 | |||
245 | [StructLayout(LayoutKind.Sequential)] | ||
246 | public struct DSP_PARAMETER_3DATTRIBUTES | ||
247 | { | ||
248 | public ATTRIBUTES_3D relative; | ||
249 | public ATTRIBUTES_3D absolute; | ||
250 | } | ||
251 | |||
252 | [StructLayout(LayoutKind.Sequential)] | ||
253 | public struct DSP_PARAMETER_3DATTRIBUTES_MULTI | ||
254 | { | ||
255 | public int numlisteners; | ||
256 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] | ||
257 | public ATTRIBUTES_3D[] relative; | ||
258 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] | ||
259 | public float[] weight; | ||
260 | public ATTRIBUTES_3D absolute; | ||
261 | } | ||
262 | |||
263 | [StructLayout(LayoutKind.Sequential)] | ||
264 | public struct DSP_PARAMETER_SIDECHAIN | ||
265 | { | ||
266 | public int sidechainenable; | ||
267 | } | ||
268 | |||
269 | [StructLayout(LayoutKind.Sequential)] | ||
270 | public struct DSP_PARAMETER_FFT | ||
271 | { | ||
272 | public int length; | ||
273 | public int numchannels; | ||
274 | |||
275 | [MarshalAs(UnmanagedType.ByValArray,SizeConst=32)] | ||
276 | private IntPtr[] spectrum_internal; | ||
277 | |||
278 | public float[][] spectrum | ||
279 | { | ||
280 | get | ||
281 | { | ||
282 | var buffer = new float[numchannels][]; | ||
283 | |||
284 | for (int i = 0; i < numchannels; ++i) | ||
285 | { | ||
286 | buffer[i] = new float[length]; | ||
287 | Marshal.Copy(spectrum_internal[i], buffer[i], 0, length); | ||
288 | } | ||
289 | |||
290 | return buffer; | ||
291 | } | ||
292 | } | ||
293 | |||
294 | public void getSpectrum(ref float[][] buffer) | ||
295 | { | ||
296 | int bufferLength = Math.Min(buffer.Length, numchannels); | ||
297 | for (int i = 0; i < bufferLength; ++i) | ||
298 | { | ||
299 | getSpectrum(i, ref buffer[i]); | ||
300 | } | ||
301 | } | ||
302 | |||
303 | public void getSpectrum(int channel, ref float[] buffer) | ||
304 | { | ||
305 | int bufferLength = Math.Min(buffer.Length, length); | ||
306 | Marshal.Copy(spectrum_internal[channel], buffer, 0, bufferLength); | ||
307 | } | ||
308 | } | ||
309 | |||
310 | [StructLayout(LayoutKind.Sequential)] | ||
311 | public struct DSP_LOUDNESS_METER_INFO_TYPE | ||
312 | { | ||
313 | public float momentaryloudness; | ||
314 | public float shorttermloudness; | ||
315 | public float integratedloudness; | ||
316 | public float loudness10thpercentile; | ||
317 | public float loudness95thpercentile; | ||
318 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 66)] | ||
319 | public float[] loudnesshistogram; | ||
320 | public float maxtruepeak; | ||
321 | public float maxmomentaryloudness; | ||
322 | } | ||
323 | |||
324 | [StructLayout(LayoutKind.Sequential)] | ||
325 | public struct DSP_LOUDNESS_METER_WEIGHTING_TYPE | ||
326 | { | ||
327 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] | ||
328 | public float[] channelweight; | ||
329 | } | ||
330 | |||
331 | [StructLayout(LayoutKind.Sequential)] | ||
332 | public struct DSP_PARAMETER_ATTENUATION_RANGE | ||
333 | { | ||
334 | public float min; | ||
335 | public float max; | ||
336 | } | ||
337 | |||
338 | [StructLayout(LayoutKind.Sequential)] | ||
339 | public struct DSP_DESCRIPTION | ||
340 | { | ||
341 | public uint pluginsdkversion; | ||
342 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] | ||
343 | public byte[] name; | ||
344 | public uint version; | ||
345 | public int numinputbuffers; | ||
346 | public int numoutputbuffers; | ||
347 | public DSP_CREATECALLBACK create; | ||
348 | public DSP_RELEASECALLBACK release; | ||
349 | public DSP_RESETCALLBACK reset; | ||
350 | public DSP_READCALLBACK read; | ||
351 | public DSP_PROCESS_CALLBACK process; | ||
352 | public DSP_SETPOSITIONCALLBACK setposition; | ||
353 | |||
354 | public int numparameters; | ||
355 | public IntPtr paramdesc; | ||
356 | public DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; | ||
357 | public DSP_SETPARAM_INT_CALLBACK setparameterint; | ||
358 | public DSP_SETPARAM_BOOL_CALLBACK setparameterbool; | ||
359 | public DSP_SETPARAM_DATA_CALLBACK setparameterdata; | ||
360 | public DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; | ||
361 | public DSP_GETPARAM_INT_CALLBACK getparameterint; | ||
362 | public DSP_GETPARAM_BOOL_CALLBACK getparameterbool; | ||
363 | public DSP_GETPARAM_DATA_CALLBACK getparameterdata; | ||
364 | public DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; | ||
365 | public IntPtr userdata; | ||
366 | |||
367 | public DSP_SYSTEM_REGISTER_CALLBACK sys_register; | ||
368 | public DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; | ||
369 | public DSP_SYSTEM_MIX_CALLBACK sys_mix; | ||
370 | } | ||
371 | |||
372 | [StructLayout(LayoutKind.Sequential)] | ||
373 | public struct DSP_STATE_DFT_FUNCTIONS | ||
374 | { | ||
375 | public DSP_DFT_FFTREAL_FUNC fftreal; | ||
376 | public DSP_DFT_IFFTREAL_FUNC inversefftreal; | ||
377 | } | ||
378 | |||
379 | [StructLayout(LayoutKind.Sequential)] | ||
380 | public struct DSP_STATE_PAN_FUNCTIONS | ||
381 | { | ||
382 | public DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix; | ||
383 | public DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix; | ||
384 | public DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix; | ||
385 | public DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix; | ||
386 | public DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix; | ||
387 | public DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain; | ||
388 | } | ||
389 | |||
390 | [StructLayout(LayoutKind.Sequential)] | ||
391 | public struct DSP_STATE_FUNCTIONS | ||
392 | { | ||
393 | public DSP_ALLOC_FUNC alloc; | ||
394 | public DSP_REALLOC_FUNC realloc; | ||
395 | public DSP_FREE_FUNC free; | ||
396 | public DSP_GETSAMPLERATE_FUNC getsamplerate; | ||
397 | public DSP_GETBLOCKSIZE_FUNC getblocksize; | ||
398 | public IntPtr dft; | ||
399 | public IntPtr pan; | ||
400 | public DSP_GETSPEAKERMODE_FUNC getspeakermode; | ||
401 | public DSP_GETCLOCK_FUNC getclock; | ||
402 | public DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes; | ||
403 | public DSP_LOG_FUNC log; | ||
404 | public DSP_GETUSERDATA_FUNC getuserdata; | ||
405 | } | ||
406 | |||
407 | [StructLayout(LayoutKind.Sequential)] | ||
408 | public struct DSP_STATE | ||
409 | { | ||
410 | public IntPtr instance; | ||
411 | public IntPtr plugindata; | ||
412 | public uint channelmask; | ||
413 | public int source_speakermode; | ||
414 | public IntPtr sidechaindata; | ||
415 | public int sidechainchannels; | ||
416 | public IntPtr functions; | ||
417 | public int systemobject; | ||
418 | } | ||
419 | |||
420 | [StructLayout(LayoutKind.Sequential)] | ||
421 | public struct DSP_METERING_INFO | ||
422 | { | ||
423 | public int numsamples; | ||
424 | [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] | ||
425 | public float[] peaklevel; | ||
426 | [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] | ||
427 | public float[] rmslevel; | ||
428 | public short numchannels; | ||
429 | } | ||
430 | |||
431 | /* | ||
432 | ============================================================================================================== | ||
433 | |||
434 | FMOD built in effect parameters. | ||
435 | Use DSP::setParameter with these enums for the 'index' parameter. | ||
436 | |||
437 | ============================================================================================================== | ||
438 | */ | ||
439 | |||
440 | public enum DSP_OSCILLATOR : int | ||
441 | { | ||
442 | TYPE, | ||
443 | RATE | ||
444 | } | ||
445 | |||
446 | public enum DSP_LOWPASS : int | ||
447 | { | ||
448 | CUTOFF, | ||
449 | RESONANCE | ||
450 | } | ||
451 | |||
452 | public enum DSP_ITLOWPASS : int | ||
453 | { | ||
454 | CUTOFF, | ||
455 | RESONANCE | ||
456 | } | ||
457 | |||
458 | public enum DSP_HIGHPASS : int | ||
459 | { | ||
460 | CUTOFF, | ||
461 | RESONANCE | ||
462 | } | ||
463 | |||
464 | public enum DSP_ECHO : int | ||
465 | { | ||
466 | DELAY, | ||
467 | FEEDBACK, | ||
468 | DRYLEVEL, | ||
469 | WETLEVEL | ||
470 | } | ||
471 | |||
472 | public enum DSP_FADER : int | ||
473 | { | ||
474 | GAIN, | ||
475 | OVERALL_GAIN, | ||
476 | } | ||
477 | |||
478 | public enum DSP_DELAY : int | ||
479 | { | ||
480 | CH0, | ||
481 | CH1, | ||
482 | CH2, | ||
483 | CH3, | ||
484 | CH4, | ||
485 | CH5, | ||
486 | CH6, | ||
487 | CH7, | ||
488 | CH8, | ||
489 | CH9, | ||
490 | CH10, | ||
491 | CH11, | ||
492 | CH12, | ||
493 | CH13, | ||
494 | CH14, | ||
495 | CH15, | ||
496 | MAXDELAY, | ||
497 | } | ||
498 | |||
499 | public enum DSP_FLANGE : int | ||
500 | { | ||
501 | MIX, | ||
502 | DEPTH, | ||
503 | RATE | ||
504 | } | ||
505 | |||
506 | public enum DSP_TREMOLO : int | ||
507 | { | ||
508 | FREQUENCY, | ||
509 | DEPTH, | ||
510 | SHAPE, | ||
511 | SKEW, | ||
512 | DUTY, | ||
513 | SQUARE, | ||
514 | PHASE, | ||
515 | SPREAD | ||
516 | } | ||
517 | |||
518 | public enum DSP_DISTORTION : int | ||
519 | { | ||
520 | LEVEL | ||
521 | } | ||
522 | |||
523 | public enum DSP_NORMALIZE : int | ||
524 | { | ||
525 | FADETIME, | ||
526 | THRESHOLD, | ||
527 | MAXAMP | ||
528 | } | ||
529 | |||
530 | public enum DSP_LIMITER : int | ||
531 | { | ||
532 | RELEASETIME, | ||
533 | CEILING, | ||
534 | MAXIMIZERGAIN, | ||
535 | MODE, | ||
536 | } | ||
537 | |||
538 | public enum DSP_PARAMEQ : int | ||
539 | { | ||
540 | CENTER, | ||
541 | BANDWIDTH, | ||
542 | GAIN | ||
543 | } | ||
544 | |||
545 | public enum DSP_MULTIBAND_EQ : int | ||
546 | { | ||
547 | A_FILTER, | ||
548 | A_FREQUENCY, | ||
549 | A_Q, | ||
550 | A_GAIN, | ||
551 | B_FILTER, | ||
552 | B_FREQUENCY, | ||
553 | B_Q, | ||
554 | B_GAIN, | ||
555 | C_FILTER, | ||
556 | C_FREQUENCY, | ||
557 | C_Q, | ||
558 | C_GAIN, | ||
559 | D_FILTER, | ||
560 | D_FREQUENCY, | ||
561 | D_Q, | ||
562 | D_GAIN, | ||
563 | E_FILTER, | ||
564 | E_FREQUENCY, | ||
565 | E_Q, | ||
566 | E_GAIN, | ||
567 | } | ||
568 | |||
569 | public enum DSP_MULTIBAND_EQ_FILTER_TYPE : int | ||
570 | { | ||
571 | DISABLED, | ||
572 | LOWPASS_12DB, | ||
573 | LOWPASS_24DB, | ||
574 | LOWPASS_48DB, | ||
575 | HIGHPASS_12DB, | ||
576 | HIGHPASS_24DB, | ||
577 | HIGHPASS_48DB, | ||
578 | LOWSHELF, | ||
579 | HIGHSHELF, | ||
580 | PEAKING, | ||
581 | BANDPASS, | ||
582 | NOTCH, | ||
583 | ALLPASS, | ||
584 | } | ||
585 | |||
586 | public enum DSP_PITCHSHIFT : int | ||
587 | { | ||
588 | PITCH, | ||
589 | FFTSIZE, | ||
590 | OVERLAP, | ||
591 | MAXCHANNELS | ||
592 | } | ||
593 | |||
594 | public enum DSP_CHORUS : int | ||
595 | { | ||
596 | MIX, | ||
597 | RATE, | ||
598 | DEPTH, | ||
599 | } | ||
600 | |||
601 | public enum DSP_ITECHO : int | ||
602 | { | ||
603 | WETDRYMIX, | ||
604 | FEEDBACK, | ||
605 | LEFTDELAY, | ||
606 | RIGHTDELAY, | ||
607 | PANDELAY | ||
608 | } | ||
609 | |||
610 | public enum DSP_COMPRESSOR : int | ||
611 | { | ||
612 | THRESHOLD, | ||
613 | RATIO, | ||
614 | ATTACK, | ||
615 | RELEASE, | ||
616 | GAINMAKEUP, | ||
617 | USESIDECHAIN, | ||
618 | LINKED | ||
619 | } | ||
620 | |||
621 | public enum DSP_SFXREVERB : int | ||
622 | { | ||
623 | DECAYTIME, | ||
624 | EARLYDELAY, | ||
625 | LATEDELAY, | ||
626 | HFREFERENCE, | ||
627 | HFDECAYRATIO, | ||
628 | DIFFUSION, | ||
629 | DENSITY, | ||
630 | LOWSHELFFREQUENCY, | ||
631 | LOWSHELFGAIN, | ||
632 | HIGHCUT, | ||
633 | EARLYLATEMIX, | ||
634 | WETLEVEL, | ||
635 | DRYLEVEL | ||
636 | } | ||
637 | |||
638 | public enum DSP_LOWPASS_SIMPLE : int | ||
639 | { | ||
640 | CUTOFF | ||
641 | } | ||
642 | |||
643 | public enum DSP_SEND : int | ||
644 | { | ||
645 | RETURNID, | ||
646 | LEVEL, | ||
647 | } | ||
648 | |||
649 | public enum DSP_RETURN : int | ||
650 | { | ||
651 | ID, | ||
652 | INPUT_SPEAKER_MODE | ||
653 | } | ||
654 | |||
655 | public enum DSP_HIGHPASS_SIMPLE : int | ||
656 | { | ||
657 | CUTOFF | ||
658 | } | ||
659 | |||
660 | public enum DSP_PAN_2D_STEREO_MODE_TYPE : int | ||
661 | { | ||
662 | DISTRIBUTED, | ||
663 | DISCRETE | ||
664 | } | ||
665 | |||
666 | public enum DSP_PAN_MODE_TYPE : int | ||
667 | { | ||
668 | MONO, | ||
669 | STEREO, | ||
670 | SURROUND | ||
671 | } | ||
672 | |||
673 | public enum DSP_PAN_3D_ROLLOFF_TYPE : int | ||
674 | { | ||
675 | LINEARSQUARED, | ||
676 | LINEAR, | ||
677 | INVERSE, | ||
678 | INVERSETAPERED, | ||
679 | CUSTOM | ||
680 | } | ||
681 | |||
682 | public enum DSP_PAN_3D_EXTENT_MODE_TYPE : int | ||
683 | { | ||
684 | AUTO, | ||
685 | USER, | ||
686 | OFF | ||
687 | } | ||
688 | |||
689 | public enum DSP_PAN : int | ||
690 | { | ||
691 | MODE, | ||
692 | _2D_STEREO_POSITION, | ||
693 | _2D_DIRECTION, | ||
694 | _2D_EXTENT, | ||
695 | _2D_ROTATION, | ||
696 | _2D_LFE_LEVEL, | ||
697 | _2D_STEREO_MODE, | ||
698 | _2D_STEREO_SEPARATION, | ||
699 | _2D_STEREO_AXIS, | ||
700 | ENABLED_SPEAKERS, | ||
701 | _3D_POSITION, | ||
702 | _3D_ROLLOFF, | ||
703 | _3D_MIN_DISTANCE, | ||
704 | _3D_MAX_DISTANCE, | ||
705 | _3D_EXTENT_MODE, | ||
706 | _3D_SOUND_SIZE, | ||
707 | _3D_MIN_EXTENT, | ||
708 | _3D_PAN_BLEND, | ||
709 | LFE_UPMIX_ENABLED, | ||
710 | OVERALL_GAIN, | ||
711 | SURROUND_SPEAKER_MODE, | ||
712 | _2D_HEIGHT_BLEND, | ||
713 | ATTENUATION_RANGE, | ||
714 | OVERRIDE_RANGE | ||
715 | } | ||
716 | |||
717 | public enum DSP_THREE_EQ_CROSSOVERSLOPE_TYPE : int | ||
718 | { | ||
719 | _12DB, | ||
720 | _24DB, | ||
721 | _48DB | ||
722 | } | ||
723 | |||
724 | public enum DSP_THREE_EQ : int | ||
725 | { | ||
726 | LOWGAIN, | ||
727 | MIDGAIN, | ||
728 | HIGHGAIN, | ||
729 | LOWCROSSOVER, | ||
730 | HIGHCROSSOVER, | ||
731 | CROSSOVERSLOPE | ||
732 | } | ||
733 | |||
734 | public enum DSP_FFT_WINDOW : int | ||
735 | { | ||
736 | RECT, | ||
737 | TRIANGLE, | ||
738 | HAMMING, | ||
739 | HANNING, | ||
740 | BLACKMAN, | ||
741 | BLACKMANHARRIS | ||
742 | } | ||
743 | |||
744 | public enum DSP_FFT : int | ||
745 | { | ||
746 | WINDOWSIZE, | ||
747 | WINDOWTYPE, | ||
748 | SPECTRUMDATA, | ||
749 | DOMINANT_FREQ | ||
750 | } | ||
751 | |||
752 | |||
753 | public enum DSP_LOUDNESS_METER : int | ||
754 | { | ||
755 | STATE, | ||
756 | WEIGHTING, | ||
757 | INFO | ||
758 | } | ||
759 | |||
760 | |||
761 | public enum DSP_LOUDNESS_METER_STATE_TYPE : int | ||
762 | { | ||
763 | RESET_INTEGRATED = -3, | ||
764 | RESET_MAXPEAK = -2, | ||
765 | RESET_ALL = -1, | ||
766 | PAUSED = 0, | ||
767 | ANALYZING = 1 | ||
768 | } | ||
769 | |||
770 | public enum DSP_ENVELOPEFOLLOWER : int | ||
771 | { | ||
772 | ATTACK, | ||
773 | RELEASE, | ||
774 | ENVELOPE, | ||
775 | USESIDECHAIN | ||
776 | } | ||
777 | |||
778 | public enum DSP_CONVOLUTION_REVERB : int | ||
779 | { | ||
780 | IR, | ||
781 | WET, | ||
782 | DRY, | ||
783 | LINKED | ||
784 | } | ||
785 | |||
786 | public enum DSP_CHANNELMIX_OUTPUT : int | ||
787 | { | ||
788 | DEFAULT, | ||
789 | ALLMONO, | ||
790 | ALLSTEREO, | ||
791 | ALLQUAD, | ||
792 | ALL5POINT1, | ||
793 | ALL7POINT1, | ||
794 | ALLLFE, | ||
795 | ALL7POINT1POINT4 | ||
796 | } | ||
797 | |||
798 | public enum DSP_CHANNELMIX : int | ||
799 | { | ||
800 | OUTPUTGROUPING, | ||
801 | GAIN_CH0, | ||
802 | GAIN_CH1, | ||
803 | GAIN_CH2, | ||
804 | GAIN_CH3, | ||
805 | GAIN_CH4, | ||
806 | GAIN_CH5, | ||
807 | GAIN_CH6, | ||
808 | GAIN_CH7, | ||
809 | GAIN_CH8, | ||
810 | GAIN_CH9, | ||
811 | GAIN_CH10, | ||
812 | GAIN_CH11, | ||
813 | GAIN_CH12, | ||
814 | GAIN_CH13, | ||
815 | GAIN_CH14, | ||
816 | GAIN_CH15, | ||
817 | GAIN_CH16, | ||
818 | GAIN_CH17, | ||
819 | GAIN_CH18, | ||
820 | GAIN_CH19, | ||
821 | GAIN_CH20, | ||
822 | GAIN_CH21, | ||
823 | GAIN_CH22, | ||
824 | GAIN_CH23, | ||
825 | GAIN_CH24, | ||
826 | GAIN_CH25, | ||
827 | GAIN_CH26, | ||
828 | GAIN_CH27, | ||
829 | GAIN_CH28, | ||
830 | GAIN_CH29, | ||
831 | GAIN_CH30, | ||
832 | GAIN_CH31, | ||
833 | OUTPUT_CH0, | ||
834 | OUTPUT_CH1, | ||
835 | OUTPUT_CH2, | ||
836 | OUTPUT_CH3, | ||
837 | OUTPUT_CH4, | ||
838 | OUTPUT_CH5, | ||
839 | OUTPUT_CH6, | ||
840 | OUTPUT_CH7, | ||
841 | OUTPUT_CH8, | ||
842 | OUTPUT_CH9, | ||
843 | OUTPUT_CH10, | ||
844 | OUTPUT_CH11, | ||
845 | OUTPUT_CH12, | ||
846 | OUTPUT_CH13, | ||
847 | OUTPUT_CH14, | ||
848 | OUTPUT_CH15, | ||
849 | OUTPUT_CH16, | ||
850 | OUTPUT_CH17, | ||
851 | OUTPUT_CH18, | ||
852 | OUTPUT_CH19, | ||
853 | OUTPUT_CH20, | ||
854 | OUTPUT_CH21, | ||
855 | OUTPUT_CH22, | ||
856 | OUTPUT_CH23, | ||
857 | OUTPUT_CH24, | ||
858 | OUTPUT_CH25, | ||
859 | OUTPUT_CH26, | ||
860 | OUTPUT_CH27, | ||
861 | OUTPUT_CH28, | ||
862 | OUTPUT_CH29, | ||
863 | OUTPUT_CH30, | ||
864 | OUTPUT_CH31, | ||
865 | } | ||
866 | |||
867 | public enum DSP_TRANSCEIVER_SPEAKERMODE : int | ||
868 | { | ||
869 | AUTO = -1, | ||
870 | MONO = 0, | ||
871 | STEREO, | ||
872 | SURROUND, | ||
873 | } | ||
874 | |||
875 | public enum DSP_TRANSCEIVER : int | ||
876 | { | ||
877 | TRANSMIT, | ||
878 | GAIN, | ||
879 | CHANNEL, | ||
880 | TRANSMITSPEAKERMODE | ||
881 | } | ||
882 | |||
883 | public enum DSP_OBJECTPAN : int | ||
884 | { | ||
885 | _3D_POSITION, | ||
886 | _3D_ROLLOFF, | ||
887 | _3D_MIN_DISTANCE, | ||
888 | _3D_MAX_DISTANCE, | ||
889 | _3D_EXTENT_MODE, | ||
890 | _3D_SOUND_SIZE, | ||
891 | _3D_MIN_EXTENT, | ||
892 | OVERALL_GAIN, | ||
893 | OUTPUTGAIN, | ||
894 | ATTENUATION_RANGE, | ||
895 | OVERRIDE_RANGE | ||
896 | } | ||
897 | } | ||
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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Core API - DSP header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header if you are wanting to develop your own DSP plugin to use with FMODs */ | ||
6 | /* dsp system. With this header you can make your own DSP plugin that FMOD can */ | ||
7 | /* register and use. See the documentation and examples on how to make a working plugin. */ | ||
8 | /* */ | ||
9 | /* For more detail visit: */ | ||
10 | /* https://fmod.com/resources/documentation-api?version=2.0&page=plugin-api-dsp.html */ | ||
11 | /* =========================================================================================*/ | ||
12 | #ifndef _FMOD_DSP_H | ||
13 | #define _FMOD_DSP_H | ||
14 | |||
15 | #include "fmod_dsp_effects.h" | ||
16 | |||
17 | typedef struct FMOD_DSP_STATE FMOD_DSP_STATE; | ||
18 | typedef struct FMOD_DSP_BUFFER_ARRAY FMOD_DSP_BUFFER_ARRAY; | ||
19 | typedef struct FMOD_COMPLEX FMOD_COMPLEX; | ||
20 | |||
21 | /* | ||
22 | DSP Constants | ||
23 | */ | ||
24 | #define FMOD_PLUGIN_SDK_VERSION 110 | ||
25 | #define FMOD_DSP_GETPARAM_VALUESTR_LENGTH 32 | ||
26 | |||
27 | typedef enum | ||
28 | { | ||
29 | FMOD_DSP_PROCESS_PERFORM, | ||
30 | FMOD_DSP_PROCESS_QUERY | ||
31 | } FMOD_DSP_PROCESS_OPERATION; | ||
32 | |||
33 | typedef enum FMOD_DSP_PAN_SURROUND_FLAGS | ||
34 | { | ||
35 | FMOD_DSP_PAN_SURROUND_DEFAULT = 0, | ||
36 | FMOD_DSP_PAN_SURROUND_ROTATION_NOT_BIASED = 1, | ||
37 | |||
38 | FMOD_DSP_PAN_SURROUND_FLAGS_FORCEINT = 65536 | ||
39 | } FMOD_DSP_PAN_SURROUND_FLAGS; | ||
40 | |||
41 | typedef enum | ||
42 | { | ||
43 | FMOD_DSP_PARAMETER_TYPE_FLOAT, | ||
44 | FMOD_DSP_PARAMETER_TYPE_INT, | ||
45 | FMOD_DSP_PARAMETER_TYPE_BOOL, | ||
46 | FMOD_DSP_PARAMETER_TYPE_DATA, | ||
47 | |||
48 | FMOD_DSP_PARAMETER_TYPE_MAX, | ||
49 | FMOD_DSP_PARAMETER_TYPE_FORCEINT = 65536 | ||
50 | } FMOD_DSP_PARAMETER_TYPE; | ||
51 | |||
52 | typedef enum | ||
53 | { | ||
54 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR, | ||
55 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, | ||
56 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, | ||
57 | |||
58 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_FORCEINT = 65536 | ||
59 | } FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE; | ||
60 | |||
61 | typedef enum | ||
62 | { | ||
63 | FMOD_DSP_PARAMETER_DATA_TYPE_USER = 0, | ||
64 | FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, | ||
65 | FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, | ||
66 | FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, | ||
67 | FMOD_DSP_PARAMETER_DATA_TYPE_FFT = -4, | ||
68 | FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, | ||
69 | FMOD_DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE = -6, | ||
70 | } FMOD_DSP_PARAMETER_DATA_TYPE; | ||
71 | |||
72 | /* | ||
73 | DSP Callbacks | ||
74 | */ | ||
75 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_CREATE_CALLBACK) (FMOD_DSP_STATE *dsp_state); | ||
76 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_RELEASE_CALLBACK) (FMOD_DSP_STATE *dsp_state); | ||
77 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_RESET_CALLBACK) (FMOD_DSP_STATE *dsp_state); | ||
78 | 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); | ||
79 | 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); | ||
80 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPOSITION_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int pos); | ||
81 | 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); | ||
82 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float value); | ||
83 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int value); | ||
84 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL value); | ||
85 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void *data, unsigned int length); | ||
86 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr); | ||
87 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int *value, char *valuestr); | ||
88 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL *value, char *valuestr); | ||
89 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void **data, unsigned int *length, char *valuestr); | ||
90 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_REGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state); | ||
91 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state); | ||
92 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_MIX_CALLBACK) (FMOD_DSP_STATE *dsp_state, int stage); | ||
93 | |||
94 | /* | ||
95 | DSP Functions | ||
96 | */ | ||
97 | typedef void * (F_CALL *FMOD_DSP_ALLOC_FUNC) (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr); | ||
98 | typedef void * (F_CALL *FMOD_DSP_REALLOC_FUNC) (void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr); | ||
99 | typedef void (F_CALL *FMOD_DSP_FREE_FUNC) (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr); | ||
100 | typedef void (F_CALL *FMOD_DSP_LOG_FUNC) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...); | ||
101 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETSAMPLERATE_FUNC) (FMOD_DSP_STATE *dsp_state, int *rate); | ||
102 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETBLOCKSIZE_FUNC) (FMOD_DSP_STATE *dsp_state, unsigned int *blocksize); | ||
103 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETSPEAKERMODE_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE *speakermode_mixer, FMOD_SPEAKERMODE *speakermode_output); | ||
104 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETCLOCK_FUNC) (FMOD_DSP_STATE *dsp_state, unsigned long long *clock, unsigned int *offset, unsigned int *length); | ||
105 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETLISTENERATTRIBUTES_FUNC) (FMOD_DSP_STATE *dsp_state, int *numlisteners, FMOD_3D_ATTRIBUTES *attributes); | ||
106 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETUSERDATA_FUNC) (FMOD_DSP_STATE *dsp_state, void **userdata); | ||
107 | 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); | ||
108 | 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); | ||
109 | typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMMONOMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE sourceSpeakerMode, float lowFrequencyGain, float overallGain, float *matrix); | ||
110 | 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); | ||
111 | 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); | ||
112 | 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); | ||
113 | 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); | ||
114 | 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); | ||
115 | |||
116 | /* | ||
117 | DSP Structures | ||
118 | */ | ||
119 | struct FMOD_DSP_BUFFER_ARRAY | ||
120 | { | ||
121 | int numbuffers; | ||
122 | int *buffernumchannels; | ||
123 | FMOD_CHANNELMASK *bufferchannelmask; | ||
124 | float **buffers; | ||
125 | FMOD_SPEAKERMODE speakermode; | ||
126 | }; | ||
127 | |||
128 | struct FMOD_COMPLEX | ||
129 | { | ||
130 | float real; | ||
131 | float imag; | ||
132 | }; | ||
133 | |||
134 | typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR | ||
135 | { | ||
136 | int numpoints; | ||
137 | float *pointparamvalues; | ||
138 | float *pointpositions; | ||
139 | } FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR; | ||
140 | |||
141 | typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING | ||
142 | { | ||
143 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE type; | ||
144 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; | ||
145 | } FMOD_DSP_PARAMETER_FLOAT_MAPPING; | ||
146 | |||
147 | typedef struct FMOD_DSP_PARAMETER_DESC_FLOAT | ||
148 | { | ||
149 | float min; | ||
150 | float max; | ||
151 | float defaultval; | ||
152 | FMOD_DSP_PARAMETER_FLOAT_MAPPING mapping; | ||
153 | } FMOD_DSP_PARAMETER_DESC_FLOAT; | ||
154 | |||
155 | typedef struct FMOD_DSP_PARAMETER_DESC_INT | ||
156 | { | ||
157 | int min; | ||
158 | int max; | ||
159 | int defaultval; | ||
160 | FMOD_BOOL goestoinf; | ||
161 | const char* const* valuenames; | ||
162 | } FMOD_DSP_PARAMETER_DESC_INT; | ||
163 | |||
164 | typedef struct FMOD_DSP_PARAMETER_DESC_BOOL | ||
165 | { | ||
166 | FMOD_BOOL defaultval; | ||
167 | const char* const* valuenames; | ||
168 | } FMOD_DSP_PARAMETER_DESC_BOOL; | ||
169 | |||
170 | typedef struct FMOD_DSP_PARAMETER_DESC_DATA | ||
171 | { | ||
172 | int datatype; | ||
173 | } FMOD_DSP_PARAMETER_DESC_DATA; | ||
174 | |||
175 | typedef struct FMOD_DSP_PARAMETER_DESC | ||
176 | { | ||
177 | FMOD_DSP_PARAMETER_TYPE type; | ||
178 | char name[16]; | ||
179 | char label[16]; | ||
180 | const char *description; | ||
181 | |||
182 | union | ||
183 | { | ||
184 | FMOD_DSP_PARAMETER_DESC_FLOAT floatdesc; | ||
185 | FMOD_DSP_PARAMETER_DESC_INT intdesc; | ||
186 | FMOD_DSP_PARAMETER_DESC_BOOL booldesc; | ||
187 | FMOD_DSP_PARAMETER_DESC_DATA datadesc; | ||
188 | }; | ||
189 | } FMOD_DSP_PARAMETER_DESC; | ||
190 | |||
191 | typedef struct FMOD_DSP_PARAMETER_OVERALLGAIN | ||
192 | { | ||
193 | float linear_gain; | ||
194 | float linear_gain_additive; | ||
195 | } FMOD_DSP_PARAMETER_OVERALLGAIN; | ||
196 | |||
197 | typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES | ||
198 | { | ||
199 | FMOD_3D_ATTRIBUTES relative; | ||
200 | FMOD_3D_ATTRIBUTES absolute; | ||
201 | } FMOD_DSP_PARAMETER_3DATTRIBUTES; | ||
202 | |||
203 | typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI | ||
204 | { | ||
205 | int numlisteners; | ||
206 | FMOD_3D_ATTRIBUTES relative[FMOD_MAX_LISTENERS]; | ||
207 | float weight[FMOD_MAX_LISTENERS]; | ||
208 | FMOD_3D_ATTRIBUTES absolute; | ||
209 | } FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI; | ||
210 | |||
211 | typedef struct FMOD_DSP_PARAMETER_ATTENUATION_RANGE | ||
212 | { | ||
213 | float min; | ||
214 | float max; | ||
215 | } FMOD_DSP_PARAMETER_ATTENUATION_RANGE; | ||
216 | |||
217 | typedef struct FMOD_DSP_PARAMETER_SIDECHAIN | ||
218 | { | ||
219 | FMOD_BOOL sidechainenable; | ||
220 | } FMOD_DSP_PARAMETER_SIDECHAIN; | ||
221 | |||
222 | typedef struct FMOD_DSP_PARAMETER_FFT | ||
223 | { | ||
224 | int length; | ||
225 | int numchannels; | ||
226 | float *spectrum[32]; | ||
227 | } FMOD_DSP_PARAMETER_FFT; | ||
228 | |||
229 | typedef struct FMOD_DSP_DESCRIPTION | ||
230 | { | ||
231 | unsigned int pluginsdkversion; | ||
232 | char name[32]; | ||
233 | unsigned int version; | ||
234 | int numinputbuffers; | ||
235 | int numoutputbuffers; | ||
236 | FMOD_DSP_CREATE_CALLBACK create; | ||
237 | FMOD_DSP_RELEASE_CALLBACK release; | ||
238 | FMOD_DSP_RESET_CALLBACK reset; | ||
239 | FMOD_DSP_READ_CALLBACK read; | ||
240 | FMOD_DSP_PROCESS_CALLBACK process; | ||
241 | FMOD_DSP_SETPOSITION_CALLBACK setposition; | ||
242 | |||
243 | int numparameters; | ||
244 | FMOD_DSP_PARAMETER_DESC **paramdesc; | ||
245 | FMOD_DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; | ||
246 | FMOD_DSP_SETPARAM_INT_CALLBACK setparameterint; | ||
247 | FMOD_DSP_SETPARAM_BOOL_CALLBACK setparameterbool; | ||
248 | FMOD_DSP_SETPARAM_DATA_CALLBACK setparameterdata; | ||
249 | FMOD_DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; | ||
250 | FMOD_DSP_GETPARAM_INT_CALLBACK getparameterint; | ||
251 | FMOD_DSP_GETPARAM_BOOL_CALLBACK getparameterbool; | ||
252 | FMOD_DSP_GETPARAM_DATA_CALLBACK getparameterdata; | ||
253 | FMOD_DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; | ||
254 | void *userdata; | ||
255 | |||
256 | FMOD_DSP_SYSTEM_REGISTER_CALLBACK sys_register; | ||
257 | FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; | ||
258 | FMOD_DSP_SYSTEM_MIX_CALLBACK sys_mix; | ||
259 | |||
260 | } FMOD_DSP_DESCRIPTION; | ||
261 | |||
262 | typedef struct FMOD_DSP_STATE_DFT_FUNCTIONS | ||
263 | { | ||
264 | FMOD_DSP_DFT_FFTREAL_FUNC fftreal; | ||
265 | FMOD_DSP_DFT_IFFTREAL_FUNC inversefftreal; | ||
266 | } FMOD_DSP_STATE_DFT_FUNCTIONS; | ||
267 | |||
268 | typedef struct FMOD_DSP_STATE_PAN_FUNCTIONS | ||
269 | { | ||
270 | FMOD_DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix; | ||
271 | FMOD_DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix; | ||
272 | FMOD_DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix; | ||
273 | FMOD_DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix; | ||
274 | FMOD_DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix; | ||
275 | FMOD_DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain; | ||
276 | } FMOD_DSP_STATE_PAN_FUNCTIONS; | ||
277 | |||
278 | typedef struct FMOD_DSP_STATE_FUNCTIONS | ||
279 | { | ||
280 | FMOD_DSP_ALLOC_FUNC alloc; | ||
281 | FMOD_DSP_REALLOC_FUNC realloc; | ||
282 | FMOD_DSP_FREE_FUNC free; | ||
283 | FMOD_DSP_GETSAMPLERATE_FUNC getsamplerate; | ||
284 | FMOD_DSP_GETBLOCKSIZE_FUNC getblocksize; | ||
285 | FMOD_DSP_STATE_DFT_FUNCTIONS *dft; | ||
286 | FMOD_DSP_STATE_PAN_FUNCTIONS *pan; | ||
287 | FMOD_DSP_GETSPEAKERMODE_FUNC getspeakermode; | ||
288 | FMOD_DSP_GETCLOCK_FUNC getclock; | ||
289 | FMOD_DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes; | ||
290 | FMOD_DSP_LOG_FUNC log; | ||
291 | FMOD_DSP_GETUSERDATA_FUNC getuserdata; | ||
292 | } FMOD_DSP_STATE_FUNCTIONS; | ||
293 | |||
294 | struct FMOD_DSP_STATE | ||
295 | { | ||
296 | void *instance; | ||
297 | void *plugindata; | ||
298 | FMOD_CHANNELMASK channelmask; | ||
299 | FMOD_SPEAKERMODE source_speakermode; | ||
300 | float *sidechaindata; | ||
301 | int sidechainchannels; | ||
302 | FMOD_DSP_STATE_FUNCTIONS *functions; | ||
303 | int systemobject; | ||
304 | }; | ||
305 | |||
306 | typedef struct FMOD_DSP_METERING_INFO | ||
307 | { | ||
308 | int numsamples; | ||
309 | float peaklevel[32]; | ||
310 | float rmslevel[32]; | ||
311 | short numchannels; | ||
312 | } FMOD_DSP_METERING_INFO; | ||
313 | |||
314 | /* | ||
315 | DSP Macros | ||
316 | */ | ||
317 | #define FMOD_DSP_INIT_PARAMDESC_FLOAT(_paramstruct, _name, _label, _description, _min, _max, _defaultval) \ | ||
318 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \ | ||
319 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \ | ||
320 | strncpy((_paramstruct).name, _name, 15); \ | ||
321 | strncpy((_paramstruct).label, _label, 15); \ | ||
322 | (_paramstruct).description = _description; \ | ||
323 | (_paramstruct).floatdesc.min = _min; \ | ||
324 | (_paramstruct).floatdesc.max = _max; \ | ||
325 | (_paramstruct).floatdesc.defaultval = _defaultval; \ | ||
326 | (_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO; | ||
327 | |||
328 | #define FMOD_DSP_INIT_PARAMDESC_FLOAT_WITH_MAPPING(_paramstruct, _name, _label, _description, _defaultval, _values, _positions); \ | ||
329 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \ | ||
330 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \ | ||
331 | strncpy((_paramstruct).name, _name , 15); \ | ||
332 | strncpy((_paramstruct).label, _label, 15); \ | ||
333 | (_paramstruct).description = _description; \ | ||
334 | (_paramstruct).floatdesc.min = _values[0]; \ | ||
335 | (_paramstruct).floatdesc.max = _values[sizeof(_values) / sizeof(float) - 1]; \ | ||
336 | (_paramstruct).floatdesc.defaultval = _defaultval; \ | ||
337 | (_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR; \ | ||
338 | (_paramstruct).floatdesc.mapping.piecewiselinearmapping.numpoints = sizeof(_values) / sizeof(float); \ | ||
339 | (_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointparamvalues = _values; \ | ||
340 | (_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointpositions = _positions; | ||
341 | |||
342 | #define FMOD_DSP_INIT_PARAMDESC_INT(_paramstruct, _name, _label, _description, _min, _max, _defaultval, _goestoinf, _valuenames) \ | ||
343 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \ | ||
344 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \ | ||
345 | strncpy((_paramstruct).name, _name , 15); \ | ||
346 | strncpy((_paramstruct).label, _label, 15); \ | ||
347 | (_paramstruct).description = _description; \ | ||
348 | (_paramstruct).intdesc.min = _min; \ | ||
349 | (_paramstruct).intdesc.max = _max; \ | ||
350 | (_paramstruct).intdesc.defaultval = _defaultval; \ | ||
351 | (_paramstruct).intdesc.goestoinf = _goestoinf; \ | ||
352 | (_paramstruct).intdesc.valuenames = _valuenames; | ||
353 | |||
354 | #define FMOD_DSP_INIT_PARAMDESC_INT_ENUMERATED(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \ | ||
355 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \ | ||
356 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \ | ||
357 | strncpy((_paramstruct).name, _name , 15); \ | ||
358 | strncpy((_paramstruct).label, _label, 15); \ | ||
359 | (_paramstruct).description = _description; \ | ||
360 | (_paramstruct).intdesc.min = 0; \ | ||
361 | (_paramstruct).intdesc.max = sizeof(_valuenames) / sizeof(char*) - 1; \ | ||
362 | (_paramstruct).intdesc.defaultval = _defaultval; \ | ||
363 | (_paramstruct).intdesc.goestoinf = false; \ | ||
364 | (_paramstruct).intdesc.valuenames = _valuenames; | ||
365 | |||
366 | #define FMOD_DSP_INIT_PARAMDESC_BOOL(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \ | ||
367 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \ | ||
368 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_BOOL; \ | ||
369 | strncpy((_paramstruct).name, _name , 15); \ | ||
370 | strncpy((_paramstruct).label, _label, 15); \ | ||
371 | (_paramstruct).description = _description; \ | ||
372 | (_paramstruct).booldesc.defaultval = _defaultval; \ | ||
373 | (_paramstruct).booldesc.valuenames = _valuenames; | ||
374 | |||
375 | #define FMOD_DSP_INIT_PARAMDESC_DATA(_paramstruct, _name, _label, _description, _datatype) \ | ||
376 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \ | ||
377 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_DATA; \ | ||
378 | strncpy((_paramstruct).name, _name , 15); \ | ||
379 | strncpy((_paramstruct).label, _label, 15); \ | ||
380 | (_paramstruct).description = _description; \ | ||
381 | (_paramstruct).datadesc.datatype = _datatype; | ||
382 | |||
383 | #define FMOD_DSP_ALLOC(_state, _size) \ | ||
384 | (_state)->functions->alloc(_size, FMOD_MEMORY_NORMAL, __FILE__) | ||
385 | #define FMOD_DSP_REALLOC(_state, _ptr, _size) \ | ||
386 | (_state)->functions->realloc(_ptr, _size, FMOD_MEMORY_NORMAL, __FILE__) | ||
387 | #define FMOD_DSP_FREE(_state, _ptr) \ | ||
388 | (_state)->functions->free(_ptr, FMOD_MEMORY_NORMAL, __FILE__) | ||
389 | #define FMOD_DSP_LOG(_state, _level, _location, _format, ...) \ | ||
390 | (_state)->functions->log(_level, __FILE__, __LINE__, _location, _format, __VA_ARGS__) | ||
391 | #define FMOD_DSP_GETSAMPLERATE(_state, _rate) \ | ||
392 | (_state)->functions->getsamplerate(_state, _rate) | ||
393 | #define FMOD_DSP_GETBLOCKSIZE(_state, _blocksize) \ | ||
394 | (_state)->functions->getblocksize(_state, _blocksize) | ||
395 | #define FMOD_DSP_GETSPEAKERMODE(_state, _speakermodemix, _speakermodeout) \ | ||
396 | (_state)->functions->getspeakermode(_state, _speakermodemix, _speakermodeout) | ||
397 | #define FMOD_DSP_GETCLOCK(_state, _clock, _offset, _length) \ | ||
398 | (_state)->functions->getclock(_state, _clock, _offset, _length) | ||
399 | #define FMOD_DSP_GETLISTENERATTRIBUTES(_state, _numlisteners, _attributes) \ | ||
400 | (_state)->functions->getlistenerattributes(_state, _numlisteners, _attributes) | ||
401 | #define FMOD_DSP_GETUSERDATA(_state, _userdata) \ | ||
402 | (_state)->functions->getuserdata(_state, _userdata) | ||
403 | #define FMOD_DSP_DFT_FFTREAL(_state, _size, _signal, _dft, _window, _signalhop) \ | ||
404 | (_state)->functions->dft->fftreal(_state, _size, _signal, _dft, _window, _signalhop) | ||
405 | #define FMOD_DSP_DFT_IFFTREAL(_state, _size, _dft, _signal, _window, _signalhop) \ | ||
406 | (_state)->functions->dft->inversefftreal(_state, _size, _dft, _signal, _window, _signalhop) | ||
407 | #define FMOD_DSP_PAN_SUMMONOMATRIX(_state, _sourcespeakermode, _lowfrequencygain, _overallgain, _matrix) \ | ||
408 | (_state)->functions->pan->summonomatrix(_state, _sourcespeakermode, _lowfrequencygain, _overallgain, _matrix) | ||
409 | #define FMOD_DSP_PAN_SUMSTEREOMATRIX(_state, _sourcespeakermode, _pan, _lowfrequencygain, _overallgain, _matrixhop, _matrix) \ | ||
410 | (_state)->functions->pan->sumstereomatrix(_state, _sourcespeakermode, _pan, _lowfrequencygain, _overallgain, _matrixhop, _matrix) | ||
411 | #define FMOD_DSP_PAN_SUMSURROUNDMATRIX(_state, _sourcespeakermode, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, _matrixhop, _matrix, _flags) \ | ||
412 | (_state)->functions->pan->sumsurroundmatrix(_state, _sourcespeakermode, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, _matrixhop, _matrix, _flags) | ||
413 | #define FMOD_DSP_PAN_SUMMONOTOSURROUNDMATRIX(_state, _targetspeakermode, _direction, _extent, _lowfrequencygain, _overallgain, _matrixhop, _matrix) \ | ||
414 | (_state)->functions->pan->summonotosurroundmatrix(_state, _targetspeakermode, _direction, _extent, _lowfrequencygain, _overallgain, _matrixhop, _matrix) | ||
415 | #define FMOD_DSP_PAN_SUMSTEREOTOSURROUNDMATRIX(_state, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, matrixhop, _matrix) \ | ||
416 | (_state)->functions->pan->sumstereotosurroundmatrix(_state, _targetspeakermode, _direction, _extent, _rotation, _lowfrequencygain, _overallgain, matrixhop, _matrix) | ||
417 | #define FMOD_DSP_PAN_GETROLLOFFGAIN(_state, _rolloff, _distance, _mindistance, _maxdistance, _gain) \ | ||
418 | (_state)->functions->pan->getrolloffgain(_state, _rolloff, _distance, _mindistance, _maxdistance, _gain) | ||
419 | |||
420 | #endif | ||
421 | |||
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 @@ | |||
1 | /* ============================================================================================================= */ | ||
2 | /* FMOD Core API - Built-in effects header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* In this header you can find parameter structures for FMOD system registered DSP effects */ | ||
6 | /* and generators. */ | ||
7 | /* */ | ||
8 | /* For more detail visit: */ | ||
9 | /* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common-dsp-effects.html#fmod_dsp_type */ | ||
10 | /* ============================================================================================================= */ | ||
11 | |||
12 | #ifndef _FMOD_DSP_EFFECTS_H | ||
13 | #define _FMOD_DSP_EFFECTS_H | ||
14 | |||
15 | typedef enum | ||
16 | { | ||
17 | FMOD_DSP_TYPE_UNKNOWN, | ||
18 | FMOD_DSP_TYPE_MIXER, | ||
19 | FMOD_DSP_TYPE_OSCILLATOR, | ||
20 | FMOD_DSP_TYPE_LOWPASS, | ||
21 | FMOD_DSP_TYPE_ITLOWPASS, | ||
22 | FMOD_DSP_TYPE_HIGHPASS, | ||
23 | FMOD_DSP_TYPE_ECHO, | ||
24 | FMOD_DSP_TYPE_FADER, | ||
25 | FMOD_DSP_TYPE_FLANGE, | ||
26 | FMOD_DSP_TYPE_DISTORTION, | ||
27 | FMOD_DSP_TYPE_NORMALIZE, | ||
28 | FMOD_DSP_TYPE_LIMITER, | ||
29 | FMOD_DSP_TYPE_PARAMEQ, | ||
30 | FMOD_DSP_TYPE_PITCHSHIFT, | ||
31 | FMOD_DSP_TYPE_CHORUS, | ||
32 | FMOD_DSP_TYPE_VSTPLUGIN, | ||
33 | FMOD_DSP_TYPE_WINAMPPLUGIN, | ||
34 | FMOD_DSP_TYPE_ITECHO, | ||
35 | FMOD_DSP_TYPE_COMPRESSOR, | ||
36 | FMOD_DSP_TYPE_SFXREVERB, | ||
37 | FMOD_DSP_TYPE_LOWPASS_SIMPLE, | ||
38 | FMOD_DSP_TYPE_DELAY, | ||
39 | FMOD_DSP_TYPE_TREMOLO, | ||
40 | FMOD_DSP_TYPE_LADSPAPLUGIN, | ||
41 | FMOD_DSP_TYPE_SEND, | ||
42 | FMOD_DSP_TYPE_RETURN, | ||
43 | FMOD_DSP_TYPE_HIGHPASS_SIMPLE, | ||
44 | FMOD_DSP_TYPE_PAN, | ||
45 | FMOD_DSP_TYPE_THREE_EQ, | ||
46 | FMOD_DSP_TYPE_FFT, | ||
47 | FMOD_DSP_TYPE_LOUDNESS_METER, | ||
48 | FMOD_DSP_TYPE_ENVELOPEFOLLOWER, | ||
49 | FMOD_DSP_TYPE_CONVOLUTIONREVERB, | ||
50 | FMOD_DSP_TYPE_CHANNELMIX, | ||
51 | FMOD_DSP_TYPE_TRANSCEIVER, | ||
52 | FMOD_DSP_TYPE_OBJECTPAN, | ||
53 | FMOD_DSP_TYPE_MULTIBAND_EQ, | ||
54 | |||
55 | FMOD_DSP_TYPE_MAX, | ||
56 | FMOD_DSP_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ | ||
57 | } FMOD_DSP_TYPE; | ||
58 | |||
59 | /* | ||
60 | =================================================================================================== | ||
61 | |||
62 | FMOD built in effect parameters. | ||
63 | Use DSP::setParameter with these enums for the 'index' parameter. | ||
64 | |||
65 | =================================================================================================== | ||
66 | */ | ||
67 | |||
68 | typedef enum | ||
69 | { | ||
70 | FMOD_DSP_OSCILLATOR_TYPE, | ||
71 | FMOD_DSP_OSCILLATOR_RATE | ||
72 | } FMOD_DSP_OSCILLATOR; | ||
73 | |||
74 | |||
75 | typedef enum | ||
76 | { | ||
77 | FMOD_DSP_LOWPASS_CUTOFF, | ||
78 | FMOD_DSP_LOWPASS_RESONANCE | ||
79 | } FMOD_DSP_LOWPASS; | ||
80 | |||
81 | |||
82 | typedef enum | ||
83 | { | ||
84 | FMOD_DSP_ITLOWPASS_CUTOFF, | ||
85 | FMOD_DSP_ITLOWPASS_RESONANCE | ||
86 | } FMOD_DSP_ITLOWPASS; | ||
87 | |||
88 | |||
89 | typedef enum | ||
90 | { | ||
91 | FMOD_DSP_HIGHPASS_CUTOFF, | ||
92 | FMOD_DSP_HIGHPASS_RESONANCE | ||
93 | } FMOD_DSP_HIGHPASS; | ||
94 | |||
95 | |||
96 | typedef enum | ||
97 | { | ||
98 | FMOD_DSP_ECHO_DELAY, | ||
99 | FMOD_DSP_ECHO_FEEDBACK, | ||
100 | FMOD_DSP_ECHO_DRYLEVEL, | ||
101 | FMOD_DSP_ECHO_WETLEVEL | ||
102 | } FMOD_DSP_ECHO; | ||
103 | |||
104 | |||
105 | typedef enum FMOD_DSP_FADER | ||
106 | { | ||
107 | FMOD_DSP_FADER_GAIN, | ||
108 | FMOD_DSP_FADER_OVERALL_GAIN, | ||
109 | } FMOD_DSP_FADER; | ||
110 | |||
111 | |||
112 | typedef enum | ||
113 | { | ||
114 | FMOD_DSP_FLANGE_MIX, | ||
115 | FMOD_DSP_FLANGE_DEPTH, | ||
116 | FMOD_DSP_FLANGE_RATE | ||
117 | } FMOD_DSP_FLANGE; | ||
118 | |||
119 | |||
120 | typedef enum | ||
121 | { | ||
122 | FMOD_DSP_DISTORTION_LEVEL | ||
123 | } FMOD_DSP_DISTORTION; | ||
124 | |||
125 | |||
126 | typedef enum | ||
127 | { | ||
128 | FMOD_DSP_NORMALIZE_FADETIME, | ||
129 | FMOD_DSP_NORMALIZE_THRESHOLD, | ||
130 | FMOD_DSP_NORMALIZE_MAXAMP | ||
131 | } FMOD_DSP_NORMALIZE; | ||
132 | |||
133 | |||
134 | typedef enum | ||
135 | { | ||
136 | FMOD_DSP_LIMITER_RELEASETIME, | ||
137 | FMOD_DSP_LIMITER_CEILING, | ||
138 | FMOD_DSP_LIMITER_MAXIMIZERGAIN, | ||
139 | FMOD_DSP_LIMITER_MODE, | ||
140 | } FMOD_DSP_LIMITER; | ||
141 | |||
142 | |||
143 | typedef enum | ||
144 | { | ||
145 | FMOD_DSP_PARAMEQ_CENTER, | ||
146 | FMOD_DSP_PARAMEQ_BANDWIDTH, | ||
147 | FMOD_DSP_PARAMEQ_GAIN | ||
148 | } FMOD_DSP_PARAMEQ; | ||
149 | |||
150 | |||
151 | typedef enum FMOD_DSP_MULTIBAND_EQ | ||
152 | { | ||
153 | FMOD_DSP_MULTIBAND_EQ_A_FILTER, | ||
154 | FMOD_DSP_MULTIBAND_EQ_A_FREQUENCY, | ||
155 | FMOD_DSP_MULTIBAND_EQ_A_Q, | ||
156 | FMOD_DSP_MULTIBAND_EQ_A_GAIN, | ||
157 | FMOD_DSP_MULTIBAND_EQ_B_FILTER, | ||
158 | FMOD_DSP_MULTIBAND_EQ_B_FREQUENCY, | ||
159 | FMOD_DSP_MULTIBAND_EQ_B_Q, | ||
160 | FMOD_DSP_MULTIBAND_EQ_B_GAIN, | ||
161 | FMOD_DSP_MULTIBAND_EQ_C_FILTER, | ||
162 | FMOD_DSP_MULTIBAND_EQ_C_FREQUENCY, | ||
163 | FMOD_DSP_MULTIBAND_EQ_C_Q, | ||
164 | FMOD_DSP_MULTIBAND_EQ_C_GAIN, | ||
165 | FMOD_DSP_MULTIBAND_EQ_D_FILTER, | ||
166 | FMOD_DSP_MULTIBAND_EQ_D_FREQUENCY, | ||
167 | FMOD_DSP_MULTIBAND_EQ_D_Q, | ||
168 | FMOD_DSP_MULTIBAND_EQ_D_GAIN, | ||
169 | FMOD_DSP_MULTIBAND_EQ_E_FILTER, | ||
170 | FMOD_DSP_MULTIBAND_EQ_E_FREQUENCY, | ||
171 | FMOD_DSP_MULTIBAND_EQ_E_Q, | ||
172 | FMOD_DSP_MULTIBAND_EQ_E_GAIN, | ||
173 | } FMOD_DSP_MULTIBAND_EQ; | ||
174 | |||
175 | |||
176 | typedef enum FMOD_DSP_MULTIBAND_EQ_FILTER_TYPE | ||
177 | { | ||
178 | FMOD_DSP_MULTIBAND_EQ_FILTER_DISABLED, | ||
179 | FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_12DB, | ||
180 | FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_24DB, | ||
181 | FMOD_DSP_MULTIBAND_EQ_FILTER_LOWPASS_48DB, | ||
182 | FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_12DB, | ||
183 | FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_24DB, | ||
184 | FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHPASS_48DB, | ||
185 | FMOD_DSP_MULTIBAND_EQ_FILTER_LOWSHELF, | ||
186 | FMOD_DSP_MULTIBAND_EQ_FILTER_HIGHSHELF, | ||
187 | FMOD_DSP_MULTIBAND_EQ_FILTER_PEAKING, | ||
188 | FMOD_DSP_MULTIBAND_EQ_FILTER_BANDPASS, | ||
189 | FMOD_DSP_MULTIBAND_EQ_FILTER_NOTCH, | ||
190 | FMOD_DSP_MULTIBAND_EQ_FILTER_ALLPASS, | ||
191 | } FMOD_DSP_MULTIBAND_EQ_FILTER_TYPE; | ||
192 | |||
193 | |||
194 | typedef enum | ||
195 | { | ||
196 | FMOD_DSP_PITCHSHIFT_PITCH, | ||
197 | FMOD_DSP_PITCHSHIFT_FFTSIZE, | ||
198 | FMOD_DSP_PITCHSHIFT_OVERLAP, | ||
199 | FMOD_DSP_PITCHSHIFT_MAXCHANNELS | ||
200 | } FMOD_DSP_PITCHSHIFT; | ||
201 | |||
202 | |||
203 | typedef enum | ||
204 | { | ||
205 | FMOD_DSP_CHORUS_MIX, | ||
206 | FMOD_DSP_CHORUS_RATE, | ||
207 | FMOD_DSP_CHORUS_DEPTH, | ||
208 | } FMOD_DSP_CHORUS; | ||
209 | |||
210 | |||
211 | typedef enum | ||
212 | { | ||
213 | FMOD_DSP_ITECHO_WETDRYMIX, | ||
214 | FMOD_DSP_ITECHO_FEEDBACK, | ||
215 | FMOD_DSP_ITECHO_LEFTDELAY, | ||
216 | FMOD_DSP_ITECHO_RIGHTDELAY, | ||
217 | FMOD_DSP_ITECHO_PANDELAY | ||
218 | } FMOD_DSP_ITECHO; | ||
219 | |||
220 | typedef enum | ||
221 | { | ||
222 | FMOD_DSP_COMPRESSOR_THRESHOLD, | ||
223 | FMOD_DSP_COMPRESSOR_RATIO, | ||
224 | FMOD_DSP_COMPRESSOR_ATTACK, | ||
225 | FMOD_DSP_COMPRESSOR_RELEASE, | ||
226 | FMOD_DSP_COMPRESSOR_GAINMAKEUP, | ||
227 | FMOD_DSP_COMPRESSOR_USESIDECHAIN, | ||
228 | FMOD_DSP_COMPRESSOR_LINKED | ||
229 | } FMOD_DSP_COMPRESSOR; | ||
230 | |||
231 | typedef enum | ||
232 | { | ||
233 | FMOD_DSP_SFXREVERB_DECAYTIME, | ||
234 | FMOD_DSP_SFXREVERB_EARLYDELAY, | ||
235 | FMOD_DSP_SFXREVERB_LATEDELAY, | ||
236 | FMOD_DSP_SFXREVERB_HFREFERENCE, | ||
237 | FMOD_DSP_SFXREVERB_HFDECAYRATIO, | ||
238 | FMOD_DSP_SFXREVERB_DIFFUSION, | ||
239 | FMOD_DSP_SFXREVERB_DENSITY, | ||
240 | FMOD_DSP_SFXREVERB_LOWSHELFFREQUENCY, | ||
241 | FMOD_DSP_SFXREVERB_LOWSHELFGAIN, | ||
242 | FMOD_DSP_SFXREVERB_HIGHCUT, | ||
243 | FMOD_DSP_SFXREVERB_EARLYLATEMIX, | ||
244 | FMOD_DSP_SFXREVERB_WETLEVEL, | ||
245 | FMOD_DSP_SFXREVERB_DRYLEVEL | ||
246 | } FMOD_DSP_SFXREVERB; | ||
247 | |||
248 | typedef enum | ||
249 | { | ||
250 | FMOD_DSP_LOWPASS_SIMPLE_CUTOFF | ||
251 | } FMOD_DSP_LOWPASS_SIMPLE; | ||
252 | |||
253 | |||
254 | typedef enum | ||
255 | { | ||
256 | FMOD_DSP_DELAY_CH0, | ||
257 | FMOD_DSP_DELAY_CH1, | ||
258 | FMOD_DSP_DELAY_CH2, | ||
259 | FMOD_DSP_DELAY_CH3, | ||
260 | FMOD_DSP_DELAY_CH4, | ||
261 | FMOD_DSP_DELAY_CH5, | ||
262 | FMOD_DSP_DELAY_CH6, | ||
263 | FMOD_DSP_DELAY_CH7, | ||
264 | FMOD_DSP_DELAY_CH8, | ||
265 | FMOD_DSP_DELAY_CH9, | ||
266 | FMOD_DSP_DELAY_CH10, | ||
267 | FMOD_DSP_DELAY_CH11, | ||
268 | FMOD_DSP_DELAY_CH12, | ||
269 | FMOD_DSP_DELAY_CH13, | ||
270 | FMOD_DSP_DELAY_CH14, | ||
271 | FMOD_DSP_DELAY_CH15, | ||
272 | FMOD_DSP_DELAY_MAXDELAY | ||
273 | } FMOD_DSP_DELAY; | ||
274 | |||
275 | |||
276 | typedef enum | ||
277 | { | ||
278 | FMOD_DSP_TREMOLO_FREQUENCY, | ||
279 | FMOD_DSP_TREMOLO_DEPTH, | ||
280 | FMOD_DSP_TREMOLO_SHAPE, | ||
281 | FMOD_DSP_TREMOLO_SKEW, | ||
282 | FMOD_DSP_TREMOLO_DUTY, | ||
283 | FMOD_DSP_TREMOLO_SQUARE, | ||
284 | FMOD_DSP_TREMOLO_PHASE, | ||
285 | FMOD_DSP_TREMOLO_SPREAD | ||
286 | } FMOD_DSP_TREMOLO; | ||
287 | |||
288 | |||
289 | typedef enum | ||
290 | { | ||
291 | FMOD_DSP_SEND_RETURNID, | ||
292 | FMOD_DSP_SEND_LEVEL, | ||
293 | } FMOD_DSP_SEND; | ||
294 | |||
295 | |||
296 | typedef enum | ||
297 | { | ||
298 | FMOD_DSP_RETURN_ID, | ||
299 | FMOD_DSP_RETURN_INPUT_SPEAKER_MODE | ||
300 | } FMOD_DSP_RETURN; | ||
301 | |||
302 | |||
303 | typedef enum | ||
304 | { | ||
305 | FMOD_DSP_HIGHPASS_SIMPLE_CUTOFF | ||
306 | } FMOD_DSP_HIGHPASS_SIMPLE; | ||
307 | |||
308 | |||
309 | typedef enum | ||
310 | { | ||
311 | FMOD_DSP_PAN_2D_STEREO_MODE_DISTRIBUTED, | ||
312 | FMOD_DSP_PAN_2D_STEREO_MODE_DISCRETE | ||
313 | } FMOD_DSP_PAN_2D_STEREO_MODE_TYPE; | ||
314 | |||
315 | |||
316 | typedef enum | ||
317 | { | ||
318 | FMOD_DSP_PAN_MODE_MONO, | ||
319 | FMOD_DSP_PAN_MODE_STEREO, | ||
320 | FMOD_DSP_PAN_MODE_SURROUND | ||
321 | } FMOD_DSP_PAN_MODE_TYPE; | ||
322 | |||
323 | |||
324 | typedef enum | ||
325 | { | ||
326 | FMOD_DSP_PAN_3D_ROLLOFF_LINEARSQUARED, | ||
327 | FMOD_DSP_PAN_3D_ROLLOFF_LINEAR, | ||
328 | FMOD_DSP_PAN_3D_ROLLOFF_INVERSE, | ||
329 | FMOD_DSP_PAN_3D_ROLLOFF_INVERSETAPERED, | ||
330 | FMOD_DSP_PAN_3D_ROLLOFF_CUSTOM | ||
331 | } FMOD_DSP_PAN_3D_ROLLOFF_TYPE; | ||
332 | |||
333 | |||
334 | typedef enum | ||
335 | { | ||
336 | FMOD_DSP_PAN_3D_EXTENT_MODE_AUTO, | ||
337 | FMOD_DSP_PAN_3D_EXTENT_MODE_USER, | ||
338 | FMOD_DSP_PAN_3D_EXTENT_MODE_OFF | ||
339 | } FMOD_DSP_PAN_3D_EXTENT_MODE_TYPE; | ||
340 | |||
341 | |||
342 | typedef enum | ||
343 | { | ||
344 | FMOD_DSP_PAN_MODE, | ||
345 | FMOD_DSP_PAN_2D_STEREO_POSITION, | ||
346 | FMOD_DSP_PAN_2D_DIRECTION, | ||
347 | FMOD_DSP_PAN_2D_EXTENT, | ||
348 | FMOD_DSP_PAN_2D_ROTATION, | ||
349 | FMOD_DSP_PAN_2D_LFE_LEVEL, | ||
350 | FMOD_DSP_PAN_2D_STEREO_MODE, | ||
351 | FMOD_DSP_PAN_2D_STEREO_SEPARATION, | ||
352 | FMOD_DSP_PAN_2D_STEREO_AXIS, | ||
353 | FMOD_DSP_PAN_ENABLED_SPEAKERS, | ||
354 | FMOD_DSP_PAN_3D_POSITION, | ||
355 | FMOD_DSP_PAN_3D_ROLLOFF, | ||
356 | FMOD_DSP_PAN_3D_MIN_DISTANCE, | ||
357 | FMOD_DSP_PAN_3D_MAX_DISTANCE, | ||
358 | FMOD_DSP_PAN_3D_EXTENT_MODE, | ||
359 | FMOD_DSP_PAN_3D_SOUND_SIZE, | ||
360 | FMOD_DSP_PAN_3D_MIN_EXTENT, | ||
361 | FMOD_DSP_PAN_3D_PAN_BLEND, | ||
362 | FMOD_DSP_PAN_LFE_UPMIX_ENABLED, | ||
363 | FMOD_DSP_PAN_OVERALL_GAIN, | ||
364 | FMOD_DSP_PAN_SURROUND_SPEAKER_MODE, | ||
365 | FMOD_DSP_PAN_2D_HEIGHT_BLEND, | ||
366 | FMOD_DSP_PAN_ATTENUATION_RANGE, | ||
367 | FMOD_DSP_PAN_OVERRIDE_RANGE | ||
368 | } FMOD_DSP_PAN; | ||
369 | |||
370 | |||
371 | typedef enum | ||
372 | { | ||
373 | FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_12DB, | ||
374 | FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_24DB, | ||
375 | FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_48DB | ||
376 | } FMOD_DSP_THREE_EQ_CROSSOVERSLOPE_TYPE; | ||
377 | |||
378 | |||
379 | typedef enum | ||
380 | { | ||
381 | FMOD_DSP_THREE_EQ_LOWGAIN, | ||
382 | FMOD_DSP_THREE_EQ_MIDGAIN, | ||
383 | FMOD_DSP_THREE_EQ_HIGHGAIN, | ||
384 | FMOD_DSP_THREE_EQ_LOWCROSSOVER, | ||
385 | FMOD_DSP_THREE_EQ_HIGHCROSSOVER, | ||
386 | FMOD_DSP_THREE_EQ_CROSSOVERSLOPE | ||
387 | } FMOD_DSP_THREE_EQ; | ||
388 | |||
389 | |||
390 | typedef enum | ||
391 | { | ||
392 | FMOD_DSP_FFT_WINDOW_RECT, | ||
393 | FMOD_DSP_FFT_WINDOW_TRIANGLE, | ||
394 | FMOD_DSP_FFT_WINDOW_HAMMING, | ||
395 | FMOD_DSP_FFT_WINDOW_HANNING, | ||
396 | FMOD_DSP_FFT_WINDOW_BLACKMAN, | ||
397 | FMOD_DSP_FFT_WINDOW_BLACKMANHARRIS | ||
398 | } FMOD_DSP_FFT_WINDOW; | ||
399 | |||
400 | |||
401 | typedef enum | ||
402 | { | ||
403 | FMOD_DSP_FFT_WINDOWSIZE, | ||
404 | FMOD_DSP_FFT_WINDOWTYPE, | ||
405 | FMOD_DSP_FFT_SPECTRUMDATA, | ||
406 | FMOD_DSP_FFT_DOMINANT_FREQ | ||
407 | } FMOD_DSP_FFT; | ||
408 | |||
409 | #define FMOD_DSP_LOUDNESS_METER_HISTOGRAM_SAMPLES 66 | ||
410 | |||
411 | typedef enum | ||
412 | { | ||
413 | FMOD_DSP_LOUDNESS_METER_STATE, | ||
414 | FMOD_DSP_LOUDNESS_METER_WEIGHTING, | ||
415 | FMOD_DSP_LOUDNESS_METER_INFO | ||
416 | } FMOD_DSP_LOUDNESS_METER; | ||
417 | |||
418 | |||
419 | typedef enum | ||
420 | { | ||
421 | FMOD_DSP_LOUDNESS_METER_STATE_RESET_INTEGRATED = -3, | ||
422 | FMOD_DSP_LOUDNESS_METER_STATE_RESET_MAXPEAK = -2, | ||
423 | FMOD_DSP_LOUDNESS_METER_STATE_RESET_ALL = -1, | ||
424 | FMOD_DSP_LOUDNESS_METER_STATE_PAUSED = 0, | ||
425 | FMOD_DSP_LOUDNESS_METER_STATE_ANALYZING = 1 | ||
426 | } FMOD_DSP_LOUDNESS_METER_STATE_TYPE; | ||
427 | |||
428 | typedef struct FMOD_DSP_LOUDNESS_METER_INFO_TYPE | ||
429 | { | ||
430 | float momentaryloudness; | ||
431 | float shorttermloudness; | ||
432 | float integratedloudness; | ||
433 | float loudness10thpercentile; | ||
434 | float loudness95thpercentile; | ||
435 | float loudnesshistogram[FMOD_DSP_LOUDNESS_METER_HISTOGRAM_SAMPLES]; | ||
436 | float maxtruepeak; | ||
437 | float maxmomentaryloudness; | ||
438 | } FMOD_DSP_LOUDNESS_METER_INFO_TYPE; | ||
439 | |||
440 | typedef struct FMOD_DSP_LOUDNESS_METER_WEIGHTING_TYPE | ||
441 | { | ||
442 | float channelweight[32]; | ||
443 | } FMOD_DSP_LOUDNESS_METER_WEIGHTING_TYPE; | ||
444 | |||
445 | |||
446 | typedef enum | ||
447 | { | ||
448 | FMOD_DSP_ENVELOPEFOLLOWER_ATTACK, | ||
449 | FMOD_DSP_ENVELOPEFOLLOWER_RELEASE, | ||
450 | FMOD_DSP_ENVELOPEFOLLOWER_ENVELOPE, | ||
451 | FMOD_DSP_ENVELOPEFOLLOWER_USESIDECHAIN | ||
452 | } FMOD_DSP_ENVELOPEFOLLOWER; | ||
453 | |||
454 | typedef enum | ||
455 | { | ||
456 | FMOD_DSP_CONVOLUTION_REVERB_PARAM_IR, | ||
457 | FMOD_DSP_CONVOLUTION_REVERB_PARAM_WET, | ||
458 | FMOD_DSP_CONVOLUTION_REVERB_PARAM_DRY, | ||
459 | FMOD_DSP_CONVOLUTION_REVERB_PARAM_LINKED | ||
460 | } FMOD_DSP_CONVOLUTION_REVERB; | ||
461 | |||
462 | typedef enum | ||
463 | { | ||
464 | FMOD_DSP_CHANNELMIX_OUTPUT_DEFAULT, | ||
465 | FMOD_DSP_CHANNELMIX_OUTPUT_ALLMONO, | ||
466 | FMOD_DSP_CHANNELMIX_OUTPUT_ALLSTEREO, | ||
467 | FMOD_DSP_CHANNELMIX_OUTPUT_ALLQUAD, | ||
468 | FMOD_DSP_CHANNELMIX_OUTPUT_ALL5POINT1, | ||
469 | FMOD_DSP_CHANNELMIX_OUTPUT_ALL7POINT1, | ||
470 | FMOD_DSP_CHANNELMIX_OUTPUT_ALLLFE, | ||
471 | FMOD_DSP_CHANNELMIX_OUTPUT_ALL7POINT1POINT4 | ||
472 | } FMOD_DSP_CHANNELMIX_OUTPUT; | ||
473 | |||
474 | typedef enum | ||
475 | { | ||
476 | FMOD_DSP_CHANNELMIX_OUTPUTGROUPING, | ||
477 | FMOD_DSP_CHANNELMIX_GAIN_CH0, | ||
478 | FMOD_DSP_CHANNELMIX_GAIN_CH1, | ||
479 | FMOD_DSP_CHANNELMIX_GAIN_CH2, | ||
480 | FMOD_DSP_CHANNELMIX_GAIN_CH3, | ||
481 | FMOD_DSP_CHANNELMIX_GAIN_CH4, | ||
482 | FMOD_DSP_CHANNELMIX_GAIN_CH5, | ||
483 | FMOD_DSP_CHANNELMIX_GAIN_CH6, | ||
484 | FMOD_DSP_CHANNELMIX_GAIN_CH7, | ||
485 | FMOD_DSP_CHANNELMIX_GAIN_CH8, | ||
486 | FMOD_DSP_CHANNELMIX_GAIN_CH9, | ||
487 | FMOD_DSP_CHANNELMIX_GAIN_CH10, | ||
488 | FMOD_DSP_CHANNELMIX_GAIN_CH11, | ||
489 | FMOD_DSP_CHANNELMIX_GAIN_CH12, | ||
490 | FMOD_DSP_CHANNELMIX_GAIN_CH13, | ||
491 | FMOD_DSP_CHANNELMIX_GAIN_CH14, | ||
492 | FMOD_DSP_CHANNELMIX_GAIN_CH15, | ||
493 | FMOD_DSP_CHANNELMIX_GAIN_CH16, | ||
494 | FMOD_DSP_CHANNELMIX_GAIN_CH17, | ||
495 | FMOD_DSP_CHANNELMIX_GAIN_CH18, | ||
496 | FMOD_DSP_CHANNELMIX_GAIN_CH19, | ||
497 | FMOD_DSP_CHANNELMIX_GAIN_CH20, | ||
498 | FMOD_DSP_CHANNELMIX_GAIN_CH21, | ||
499 | FMOD_DSP_CHANNELMIX_GAIN_CH22, | ||
500 | FMOD_DSP_CHANNELMIX_GAIN_CH23, | ||
501 | FMOD_DSP_CHANNELMIX_GAIN_CH24, | ||
502 | FMOD_DSP_CHANNELMIX_GAIN_CH25, | ||
503 | FMOD_DSP_CHANNELMIX_GAIN_CH26, | ||
504 | FMOD_DSP_CHANNELMIX_GAIN_CH27, | ||
505 | FMOD_DSP_CHANNELMIX_GAIN_CH28, | ||
506 | FMOD_DSP_CHANNELMIX_GAIN_CH29, | ||
507 | FMOD_DSP_CHANNELMIX_GAIN_CH30, | ||
508 | FMOD_DSP_CHANNELMIX_GAIN_CH31, | ||
509 | FMOD_DSP_CHANNELMIX_OUTPUT_CH0, | ||
510 | FMOD_DSP_CHANNELMIX_OUTPUT_CH1, | ||
511 | FMOD_DSP_CHANNELMIX_OUTPUT_CH2, | ||
512 | FMOD_DSP_CHANNELMIX_OUTPUT_CH3, | ||
513 | FMOD_DSP_CHANNELMIX_OUTPUT_CH4, | ||
514 | FMOD_DSP_CHANNELMIX_OUTPUT_CH5, | ||
515 | FMOD_DSP_CHANNELMIX_OUTPUT_CH6, | ||
516 | FMOD_DSP_CHANNELMIX_OUTPUT_CH7, | ||
517 | FMOD_DSP_CHANNELMIX_OUTPUT_CH8, | ||
518 | FMOD_DSP_CHANNELMIX_OUTPUT_CH9, | ||
519 | FMOD_DSP_CHANNELMIX_OUTPUT_CH10, | ||
520 | FMOD_DSP_CHANNELMIX_OUTPUT_CH11, | ||
521 | FMOD_DSP_CHANNELMIX_OUTPUT_CH12, | ||
522 | FMOD_DSP_CHANNELMIX_OUTPUT_CH13, | ||
523 | FMOD_DSP_CHANNELMIX_OUTPUT_CH14, | ||
524 | FMOD_DSP_CHANNELMIX_OUTPUT_CH15, | ||
525 | FMOD_DSP_CHANNELMIX_OUTPUT_CH16, | ||
526 | FMOD_DSP_CHANNELMIX_OUTPUT_CH17, | ||
527 | FMOD_DSP_CHANNELMIX_OUTPUT_CH18, | ||
528 | FMOD_DSP_CHANNELMIX_OUTPUT_CH19, | ||
529 | FMOD_DSP_CHANNELMIX_OUTPUT_CH20, | ||
530 | FMOD_DSP_CHANNELMIX_OUTPUT_CH21, | ||
531 | FMOD_DSP_CHANNELMIX_OUTPUT_CH22, | ||
532 | FMOD_DSP_CHANNELMIX_OUTPUT_CH23, | ||
533 | FMOD_DSP_CHANNELMIX_OUTPUT_CH24, | ||
534 | FMOD_DSP_CHANNELMIX_OUTPUT_CH25, | ||
535 | FMOD_DSP_CHANNELMIX_OUTPUT_CH26, | ||
536 | FMOD_DSP_CHANNELMIX_OUTPUT_CH27, | ||
537 | FMOD_DSP_CHANNELMIX_OUTPUT_CH28, | ||
538 | FMOD_DSP_CHANNELMIX_OUTPUT_CH29, | ||
539 | FMOD_DSP_CHANNELMIX_OUTPUT_CH30, | ||
540 | FMOD_DSP_CHANNELMIX_OUTPUT_CH31 | ||
541 | } FMOD_DSP_CHANNELMIX; | ||
542 | |||
543 | typedef enum | ||
544 | { | ||
545 | FMOD_DSP_TRANSCEIVER_SPEAKERMODE_AUTO = -1, | ||
546 | FMOD_DSP_TRANSCEIVER_SPEAKERMODE_MONO = 0, | ||
547 | FMOD_DSP_TRANSCEIVER_SPEAKERMODE_STEREO, | ||
548 | FMOD_DSP_TRANSCEIVER_SPEAKERMODE_SURROUND, | ||
549 | } FMOD_DSP_TRANSCEIVER_SPEAKERMODE; | ||
550 | |||
551 | |||
552 | typedef enum | ||
553 | { | ||
554 | FMOD_DSP_TRANSCEIVER_TRANSMIT, | ||
555 | FMOD_DSP_TRANSCEIVER_GAIN, | ||
556 | FMOD_DSP_TRANSCEIVER_CHANNEL, | ||
557 | FMOD_DSP_TRANSCEIVER_TRANSMITSPEAKERMODE | ||
558 | } FMOD_DSP_TRANSCEIVER; | ||
559 | |||
560 | |||
561 | typedef enum | ||
562 | { | ||
563 | FMOD_DSP_OBJECTPAN_3D_POSITION, | ||
564 | FMOD_DSP_OBJECTPAN_3D_ROLLOFF, | ||
565 | FMOD_DSP_OBJECTPAN_3D_MIN_DISTANCE, | ||
566 | FMOD_DSP_OBJECTPAN_3D_MAX_DISTANCE, | ||
567 | FMOD_DSP_OBJECTPAN_3D_EXTENT_MODE, | ||
568 | FMOD_DSP_OBJECTPAN_3D_SOUND_SIZE, | ||
569 | FMOD_DSP_OBJECTPAN_3D_MIN_EXTENT, | ||
570 | FMOD_DSP_OBJECTPAN_OVERALL_GAIN, | ||
571 | FMOD_DSP_OBJECTPAN_OUTPUTGAIN, | ||
572 | FMOD_DSP_OBJECTPAN_ATTENUATION_RANGE, | ||
573 | FMOD_DSP_OBJECTPAN_OVERRIDE_RANGE | ||
574 | } FMOD_DSP_OBJECTPAN; | ||
575 | |||
576 | #endif | ||
577 | |||
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 @@ | |||
1 | /* ============================================================================================== */ | ||
2 | /* FMOD Core / Studio API - Error string header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header if you want to store or display a string version / english explanation */ | ||
6 | /* of the FMOD error codes. */ | ||
7 | /* */ | ||
8 | /* For more detail visit: */ | ||
9 | /* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#fmod_result */ | ||
10 | /* =============================================================================================== */ | ||
11 | |||
12 | namespace FMOD | ||
13 | { | ||
14 | public class Error | ||
15 | { | ||
16 | public static string String(FMOD.RESULT errcode) | ||
17 | { | ||
18 | switch (errcode) | ||
19 | { | ||
20 | case FMOD.RESULT.OK: return "No errors."; | ||
21 | 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)."; | ||
22 | case FMOD.RESULT.ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel."; | ||
23 | case FMOD.RESULT.ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound."; | ||
24 | case FMOD.RESULT.ERR_DMA: return "DMA Failure. See debug output for more information."; | ||
25 | case FMOD.RESULT.ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts."; | ||
26 | 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."; | ||
27 | 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."; | ||
28 | 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."; | ||
29 | case FMOD.RESULT.ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified."; | ||
30 | case FMOD.RESULT.ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system."; | ||
31 | 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."; | ||
32 | case FMOD.RESULT.ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type."; | ||
33 | case FMOD.RESULT.ERR_FILE_BAD: return "Error loading file."; | ||
34 | 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."; | ||
35 | case FMOD.RESULT.ERR_FILE_DISKEJECTED: return "Media was ejected while reading."; | ||
36 | case FMOD.RESULT.ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?)."; | ||
37 | case FMOD.RESULT.ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data."; | ||
38 | case FMOD.RESULT.ERR_FILE_NOTFOUND: return "File not found."; | ||
39 | case FMOD.RESULT.ERR_FORMAT: return "Unsupported file or audio format."; | ||
40 | 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."; | ||
41 | case FMOD.RESULT.ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere."; | ||
42 | case FMOD.RESULT.ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden."; | ||
43 | case FMOD.RESULT.ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource."; | ||
44 | case FMOD.RESULT.ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred."; | ||
45 | case FMOD.RESULT.ERR_HTTP_TIMEOUT: return "The HTTP request timed out."; | ||
46 | case FMOD.RESULT.ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function."; | ||
47 | case FMOD.RESULT.ERR_INITIALIZED: return "Cannot call this command after System::init."; | ||
48 | case FMOD.RESULT.ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support."; | ||
49 | case FMOD.RESULT.ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float."; | ||
50 | case FMOD.RESULT.ERR_INVALID_HANDLE: return "An invalid object handle was used."; | ||
51 | case FMOD.RESULT.ERR_INVALID_PARAM: return "An invalid parameter was passed to this function."; | ||
52 | case FMOD.RESULT.ERR_INVALID_POSITION: return "An invalid seek position was passed to this function."; | ||
53 | case FMOD.RESULT.ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode."; | ||
54 | case FMOD.RESULT.ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle."; | ||
55 | case FMOD.RESULT.ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported."; | ||
56 | case FMOD.RESULT.ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular."; | ||
57 | case FMOD.RESULT.ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup."; | ||
58 | case FMOD.RESULT.ERR_MEMORY: return "Not enough memory or resources."; | ||
59 | 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."; | ||
60 | case FMOD.RESULT.ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound."; | ||
61 | case FMOD.RESULT.ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support."; | ||
62 | case FMOD.RESULT.ERR_NET_CONNECT: return "Couldn't connect to the specified host."; | ||
63 | case FMOD.RESULT.ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere."; | ||
64 | case FMOD.RESULT.ERR_NET_URL: return "The specified URL couldn't be resolved."; | ||
65 | case FMOD.RESULT.ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately."; | ||
66 | case FMOD.RESULT.ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready."; | ||
67 | 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."; | ||
68 | case FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer."; | ||
69 | 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."; | ||
70 | case FMOD.RESULT.ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format."; | ||
71 | case FMOD.RESULT.ERR_OUTPUT_INIT: return "Error initializing output device."; | ||
72 | 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."; | ||
73 | case FMOD.RESULT.ERR_PLUGIN: return "An unspecified error has been returned from a plugin."; | ||
74 | case FMOD.RESULT.ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available."; | ||
75 | case FMOD.RESULT.ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)"; | ||
76 | case FMOD.RESULT.ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version."; | ||
77 | case FMOD.RESULT.ERR_RECORD: return "An error occurred trying to initialize the recording device."; | ||
78 | case FMOD.RESULT.ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection."; | ||
79 | 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."; | ||
80 | 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."; | ||
81 | 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."; | ||
82 | 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."; | ||
83 | case FMOD.RESULT.ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags."; | ||
84 | 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."; | ||
85 | case FMOD.RESULT.ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated."; | ||
86 | case FMOD.RESULT.ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!"; | ||
87 | case FMOD.RESULT.ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called."; | ||
88 | case FMOD.RESULT.ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified."; | ||
89 | case FMOD.RESULT.ERR_VERSION: return "The version number of this file format is not supported."; | ||
90 | case FMOD.RESULT.ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded."; | ||
91 | case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected."; | ||
92 | 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."; | ||
93 | case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out."; | ||
94 | case FMOD.RESULT.ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found."; | ||
95 | case FMOD.RESULT.ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized."; | ||
96 | case FMOD.RESULT.ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded."; | ||
97 | case FMOD.RESULT.ERR_INVALID_STRING: return "An invalid string was passed to this function."; | ||
98 | case FMOD.RESULT.ERR_ALREADY_LOCKED: return "The specified resource is already locked."; | ||
99 | case FMOD.RESULT.ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked."; | ||
100 | case FMOD.RESULT.ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected."; | ||
101 | case FMOD.RESULT.ERR_TOOMANYSAMPLES: return "The length provided exceed the allowable limit."; | ||
102 | default: return "Unknown error."; | ||
103 | } | ||
104 | } | ||
105 | } | ||
106 | } | ||
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 @@ | |||
1 | /* ============================================================================================== */ | ||
2 | /* FMOD Core / Studio API - Error string header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header if you want to store or display a string version / english explanation */ | ||
6 | /* of the FMOD error codes. */ | ||
7 | /* */ | ||
8 | /* For more detail visit: */ | ||
9 | /* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#fmod_result */ | ||
10 | /* =============================================================================================== */ | ||
11 | #ifndef _FMOD_ERRORS_H | ||
12 | #define _FMOD_ERRORS_H | ||
13 | |||
14 | #include "fmod.h" | ||
15 | |||
16 | #ifdef __GNUC__ | ||
17 | static const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused)); | ||
18 | #endif | ||
19 | |||
20 | static const char *FMOD_ErrorString(FMOD_RESULT errcode) | ||
21 | { | ||
22 | switch (errcode) | ||
23 | { | ||
24 | case FMOD_OK: return "No errors."; | ||
25 | 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)."; | ||
26 | case FMOD_ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel."; | ||
27 | case FMOD_ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound."; | ||
28 | case FMOD_ERR_DMA: return "DMA Failure. See debug output for more information."; | ||
29 | case FMOD_ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts."; | ||
30 | 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."; | ||
31 | 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."; | ||
32 | case FMOD_ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released."; | ||
33 | case FMOD_ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified."; | ||
34 | case FMOD_ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system."; | ||
35 | 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."; | ||
36 | case FMOD_ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type."; | ||
37 | case FMOD_ERR_FILE_BAD: return "Error loading file."; | ||
38 | case FMOD_ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format."; | ||
39 | case FMOD_ERR_FILE_DISKEJECTED: return "Media was ejected while reading."; | ||
40 | case FMOD_ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?)."; | ||
41 | case FMOD_ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data."; | ||
42 | case FMOD_ERR_FILE_NOTFOUND: return "File not found."; | ||
43 | case FMOD_ERR_FORMAT: return "Unsupported file or audio format."; | ||
44 | 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."; | ||
45 | case FMOD_ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere."; | ||
46 | case FMOD_ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden."; | ||
47 | case FMOD_ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource."; | ||
48 | case FMOD_ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred."; | ||
49 | case FMOD_ERR_HTTP_TIMEOUT: return "The HTTP request timed out."; | ||
50 | case FMOD_ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function."; | ||
51 | case FMOD_ERR_INITIALIZED: return "Cannot call this command after System::init."; | ||
52 | case FMOD_ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support."; | ||
53 | case FMOD_ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float."; | ||
54 | case FMOD_ERR_INVALID_HANDLE: return "An invalid object handle was used."; | ||
55 | case FMOD_ERR_INVALID_PARAM: return "An invalid parameter was passed to this function."; | ||
56 | case FMOD_ERR_INVALID_POSITION: return "An invalid seek position was passed to this function."; | ||
57 | case FMOD_ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode."; | ||
58 | case FMOD_ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle."; | ||
59 | case FMOD_ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported."; | ||
60 | case FMOD_ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular."; | ||
61 | case FMOD_ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup."; | ||
62 | case FMOD_ERR_MEMORY: return "Not enough memory or resources."; | ||
63 | 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."; | ||
64 | case FMOD_ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound."; | ||
65 | case FMOD_ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support."; | ||
66 | case FMOD_ERR_NET_CONNECT: return "Couldn't connect to the specified host."; | ||
67 | case FMOD_ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere."; | ||
68 | case FMOD_ERR_NET_URL: return "The specified URL couldn't be resolved."; | ||
69 | case FMOD_ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately."; | ||
70 | case FMOD_ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready."; | ||
71 | case FMOD_ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused."; | ||
72 | case FMOD_ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer."; | ||
73 | 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."; | ||
74 | case FMOD_ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format."; | ||
75 | case FMOD_ERR_OUTPUT_INIT: return "Error initializing output device."; | ||
76 | 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."; | ||
77 | case FMOD_ERR_PLUGIN: return "An unspecified error has been returned from a plugin."; | ||
78 | case FMOD_ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available."; | ||
79 | case FMOD_ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)"; | ||
80 | case FMOD_ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version."; | ||
81 | case FMOD_ERR_RECORD: return "An error occurred trying to initialize the recording device."; | ||
82 | case FMOD_ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection."; | ||
83 | 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."; | ||
84 | 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."; | ||
85 | 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."; | ||
86 | 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."; | ||
87 | case FMOD_ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags."; | ||
88 | 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."; | ||
89 | case FMOD_ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated."; | ||
90 | case FMOD_ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!"; | ||
91 | case FMOD_ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called."; | ||
92 | case FMOD_ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified."; | ||
93 | case FMOD_ERR_VERSION: return "The version number of this file format is not supported."; | ||
94 | case FMOD_ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded."; | ||
95 | case FMOD_ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected."; | ||
96 | case FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool."; | ||
97 | case FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out."; | ||
98 | case FMOD_ERR_EVENT_NOTFOUND: return "The requested event, parameter, bus or vca could not be found."; | ||
99 | case FMOD_ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized."; | ||
100 | case FMOD_ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded."; | ||
101 | case FMOD_ERR_INVALID_STRING: return "An invalid string was passed to this function."; | ||
102 | case FMOD_ERR_ALREADY_LOCKED: return "The specified resource is already locked."; | ||
103 | case FMOD_ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked."; | ||
104 | case FMOD_ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected."; | ||
105 | case FMOD_ERR_TOOMANYSAMPLES: return "The length provided exceeds the allowable limit."; | ||
106 | default : return "Unknown error."; | ||
107 | }; | ||
108 | } | ||
109 | |||
110 | #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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Core API - output development header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header if you are wanting to develop your own output plugin to use with */ | ||
6 | /* FMOD's output system. With this header you can make your own output plugin that FMOD */ | ||
7 | /* can register and use. See the documentation and examples on how to make a working */ | ||
8 | /* plugin. */ | ||
9 | /* */ | ||
10 | /* For more detail visit: */ | ||
11 | /* https://fmod.com/resources/documentation-api?version=2.0&page=plugin-api-output.html */ | ||
12 | /* ======================================================================================== */ | ||
13 | #ifndef _FMOD_OUTPUT_H | ||
14 | #define _FMOD_OUTPUT_H | ||
15 | |||
16 | typedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE; | ||
17 | typedef struct FMOD_OUTPUT_OBJECT3DINFO FMOD_OUTPUT_OBJECT3DINFO; | ||
18 | |||
19 | /* | ||
20 | Output constants | ||
21 | */ | ||
22 | #define FMOD_OUTPUT_PLUGIN_VERSION 5 | ||
23 | |||
24 | typedef unsigned int FMOD_OUTPUT_METHOD; | ||
25 | #define FMOD_OUTPUT_METHOD_MIX_DIRECT 0 | ||
26 | #define FMOD_OUTPUT_METHOD_MIX_BUFFERED 1 | ||
27 | |||
28 | /* | ||
29 | Output callbacks | ||
30 | */ | ||
31 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *numdrivers); | ||
32 | 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); | ||
33 | 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); | ||
34 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_START_CALLBACK) (FMOD_OUTPUT_STATE *output_state); | ||
35 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_STOP_CALLBACK) (FMOD_OUTPUT_STATE *output_state); | ||
36 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_CLOSE_CALLBACK) (FMOD_OUTPUT_STATE *output_state); | ||
37 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_UPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state); | ||
38 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_GETHANDLE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **handle); | ||
39 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_MIXER_CALLBACK) (FMOD_OUTPUT_STATE *output_state); | ||
40 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *maxhardwareobjects); | ||
41 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **object3d); | ||
42 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OBJECT3DFREE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *object3d); | ||
43 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *object3d, const FMOD_OUTPUT_OBJECT3DINFO *info); | ||
44 | 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); | ||
45 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_CLOSEPORT_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int portId); | ||
46 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_DEVICELISTCHANGED_CALLBACK)(FMOD_OUTPUT_STATE *output_state); | ||
47 | |||
48 | /* | ||
49 | Output functions | ||
50 | */ | ||
51 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_READFROMMIXER_FUNC) (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length); | ||
52 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_COPYPORT_FUNC) (FMOD_OUTPUT_STATE *output_state, int portId, void *buffer, unsigned int length); | ||
53 | typedef FMOD_RESULT (F_CALL *FMOD_OUTPUT_REQUESTRESET_FUNC) (FMOD_OUTPUT_STATE *output_state); | ||
54 | typedef void * (F_CALL *FMOD_OUTPUT_ALLOC_FUNC) (unsigned int size, unsigned int align, const char *file, int line); | ||
55 | typedef void (F_CALL *FMOD_OUTPUT_FREE_FUNC) (void *ptr, const char *file, int line); | ||
56 | typedef void (F_CALL *FMOD_OUTPUT_LOG_FUNC) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...); | ||
57 | |||
58 | /* | ||
59 | Output structures | ||
60 | */ | ||
61 | typedef struct FMOD_OUTPUT_DESCRIPTION | ||
62 | { | ||
63 | unsigned int apiversion; | ||
64 | const char *name; | ||
65 | unsigned int version; | ||
66 | FMOD_OUTPUT_METHOD method; | ||
67 | FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK getnumdrivers; | ||
68 | FMOD_OUTPUT_GETDRIVERINFO_CALLBACK getdriverinfo; | ||
69 | FMOD_OUTPUT_INIT_CALLBACK init; | ||
70 | FMOD_OUTPUT_START_CALLBACK start; | ||
71 | FMOD_OUTPUT_STOP_CALLBACK stop; | ||
72 | FMOD_OUTPUT_CLOSE_CALLBACK close; | ||
73 | FMOD_OUTPUT_UPDATE_CALLBACK update; | ||
74 | FMOD_OUTPUT_GETHANDLE_CALLBACK gethandle; | ||
75 | FMOD_OUTPUT_MIXER_CALLBACK mixer; | ||
76 | FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK object3dgetinfo; | ||
77 | FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK object3dalloc; | ||
78 | FMOD_OUTPUT_OBJECT3DFREE_CALLBACK object3dfree; | ||
79 | FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK object3dupdate; | ||
80 | FMOD_OUTPUT_OPENPORT_CALLBACK openport; | ||
81 | FMOD_OUTPUT_CLOSEPORT_CALLBACK closeport; | ||
82 | FMOD_OUTPUT_DEVICELISTCHANGED_CALLBACK devicelistchanged; | ||
83 | } FMOD_OUTPUT_DESCRIPTION; | ||
84 | |||
85 | struct FMOD_OUTPUT_STATE | ||
86 | { | ||
87 | void *plugindata; | ||
88 | FMOD_OUTPUT_READFROMMIXER_FUNC readfrommixer; | ||
89 | FMOD_OUTPUT_ALLOC_FUNC alloc; | ||
90 | FMOD_OUTPUT_FREE_FUNC free; | ||
91 | FMOD_OUTPUT_LOG_FUNC log; | ||
92 | FMOD_OUTPUT_COPYPORT_FUNC copyport; | ||
93 | FMOD_OUTPUT_REQUESTRESET_FUNC requestreset; | ||
94 | }; | ||
95 | |||
96 | struct FMOD_OUTPUT_OBJECT3DINFO | ||
97 | { | ||
98 | float *buffer; | ||
99 | unsigned int bufferlength; | ||
100 | FMOD_VECTOR position; | ||
101 | float gain; | ||
102 | float spread; | ||
103 | float priority; | ||
104 | }; | ||
105 | |||
106 | /* | ||
107 | Output macros | ||
108 | */ | ||
109 | #define FMOD_OUTPUT_READFROMMIXER(_state, _buffer, _length) \ | ||
110 | (_state)->readfrommixer(_state, _buffer, _length) | ||
111 | #define FMOD_OUTPUT_ALLOC(_state, _size, _align) \ | ||
112 | (_state)->alloc(_size, _align, __FILE__, __LINE__) | ||
113 | #define FMOD_OUTPUT_FREE(_state, _ptr) \ | ||
114 | (_state)->free(_ptr, __FILE__, __LINE__) | ||
115 | #define FMOD_OUTPUT_LOG(_state, _level, _location, _format, ...) \ | ||
116 | (_state)->log(_level, __FILE__, __LINE__, _location, _format, __VA_ARGS__) | ||
117 | #define FMOD_OUTPUT_COPYPORT(_state, _id, _buffer, _length) \ | ||
118 | (_state)->copyport(_state, _id, _buffer, _length) | ||
119 | #define FMOD_OUTPUT_REQUESTRESET(_state) \ | ||
120 | (_state)->requestreset(_state) | ||
121 | |||
122 | #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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Studio API - C# wrapper. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* For more detail visit: */ | ||
6 | /* https://fmod.com/resources/documentation-api?version=2.0&page=page=studio-api.html */ | ||
7 | /* ======================================================================================== */ | ||
8 | |||
9 | using System; | ||
10 | using System.Text; | ||
11 | using System.Runtime.InteropServices; | ||
12 | using System.Collections; | ||
13 | |||
14 | namespace FMOD.Studio | ||
15 | { | ||
16 | public partial class STUDIO_VERSION | ||
17 | { | ||
18 | #if !UNITY_2019_4_OR_NEWER | ||
19 | public const string dll = "fmodstudio"; | ||
20 | #endif | ||
21 | } | ||
22 | |||
23 | public enum STOP_MODE : int | ||
24 | { | ||
25 | ALLOWFADEOUT, | ||
26 | IMMEDIATE, | ||
27 | } | ||
28 | |||
29 | public enum LOADING_STATE : int | ||
30 | { | ||
31 | UNLOADING, | ||
32 | UNLOADED, | ||
33 | LOADING, | ||
34 | LOADED, | ||
35 | ERROR, | ||
36 | } | ||
37 | |||
38 | [StructLayout(LayoutKind.Sequential)] | ||
39 | public struct PROGRAMMER_SOUND_PROPERTIES | ||
40 | { | ||
41 | public StringWrapper name; | ||
42 | public IntPtr sound; | ||
43 | public int subsoundIndex; | ||
44 | } | ||
45 | |||
46 | [StructLayout(LayoutKind.Sequential)] | ||
47 | public struct TIMELINE_MARKER_PROPERTIES | ||
48 | { | ||
49 | public StringWrapper name; | ||
50 | public int position; | ||
51 | } | ||
52 | |||
53 | [StructLayout(LayoutKind.Sequential)] | ||
54 | public struct TIMELINE_BEAT_PROPERTIES | ||
55 | { | ||
56 | public int bar; | ||
57 | public int beat; | ||
58 | public int position; | ||
59 | public float tempo; | ||
60 | public int timesignatureupper; | ||
61 | public int timesignaturelower; | ||
62 | } | ||
63 | |||
64 | [StructLayout(LayoutKind.Sequential)] | ||
65 | public struct TIMELINE_NESTED_BEAT_PROPERTIES | ||
66 | { | ||
67 | public GUID eventid; | ||
68 | public TIMELINE_BEAT_PROPERTIES properties; | ||
69 | } | ||
70 | |||
71 | [StructLayout(LayoutKind.Sequential)] | ||
72 | public struct ADVANCEDSETTINGS | ||
73 | { | ||
74 | public int cbsize; | ||
75 | public int commandqueuesize; | ||
76 | public int handleinitialsize; | ||
77 | public int studioupdateperiod; | ||
78 | public int idlesampledatapoolsize; | ||
79 | public int streamingscheduledelay; | ||
80 | public IntPtr encryptionkey; | ||
81 | } | ||
82 | |||
83 | [StructLayout(LayoutKind.Sequential)] | ||
84 | public struct CPU_USAGE | ||
85 | { | ||
86 | public float update; | ||
87 | } | ||
88 | |||
89 | [StructLayout(LayoutKind.Sequential)] | ||
90 | public struct BUFFER_INFO | ||
91 | { | ||
92 | public int currentusage; | ||
93 | public int peakusage; | ||
94 | public int capacity; | ||
95 | public int stallcount; | ||
96 | public float stalltime; | ||
97 | } | ||
98 | |||
99 | [StructLayout(LayoutKind.Sequential)] | ||
100 | public struct BUFFER_USAGE | ||
101 | { | ||
102 | public BUFFER_INFO studiocommandqueue; | ||
103 | public BUFFER_INFO studiohandle; | ||
104 | } | ||
105 | |||
106 | [StructLayout(LayoutKind.Sequential)] | ||
107 | public struct BANK_INFO | ||
108 | { | ||
109 | public int size; | ||
110 | public IntPtr userdata; | ||
111 | public int userdatalength; | ||
112 | public FILE_OPEN_CALLBACK opencallback; | ||
113 | public FILE_CLOSE_CALLBACK closecallback; | ||
114 | public FILE_READ_CALLBACK readcallback; | ||
115 | public FILE_SEEK_CALLBACK seekcallback; | ||
116 | } | ||
117 | |||
118 | [Flags] | ||
119 | public enum SYSTEM_CALLBACK_TYPE : uint | ||
120 | { | ||
121 | PREUPDATE = 0x00000001, | ||
122 | POSTUPDATE = 0x00000002, | ||
123 | BANK_UNLOAD = 0x00000004, | ||
124 | LIVEUPDATE_CONNECTED = 0x00000008, | ||
125 | LIVEUPDATE_DISCONNECTED = 0x00000010, | ||
126 | ALL = 0xFFFFFFFF, | ||
127 | } | ||
128 | |||
129 | public delegate RESULT SYSTEM_CALLBACK(IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata, IntPtr userdata); | ||
130 | |||
131 | public enum PARAMETER_TYPE : int | ||
132 | { | ||
133 | GAME_CONTROLLED, | ||
134 | AUTOMATIC_DISTANCE, | ||
135 | AUTOMATIC_EVENT_CONE_ANGLE, | ||
136 | AUTOMATIC_EVENT_ORIENTATION, | ||
137 | AUTOMATIC_DIRECTION, | ||
138 | AUTOMATIC_ELEVATION, | ||
139 | AUTOMATIC_LISTENER_ORIENTATION, | ||
140 | AUTOMATIC_SPEED, | ||
141 | AUTOMATIC_SPEED_ABSOLUTE, | ||
142 | AUTOMATIC_DISTANCE_NORMALIZED, | ||
143 | MAX | ||
144 | } | ||
145 | |||
146 | [Flags] | ||
147 | public enum PARAMETER_FLAGS : uint | ||
148 | { | ||
149 | READONLY = 0x00000001, | ||
150 | AUTOMATIC = 0x00000002, | ||
151 | GLOBAL = 0x00000004, | ||
152 | DISCRETE = 0x00000008, | ||
153 | LABELED = 0x00000010, | ||
154 | } | ||
155 | |||
156 | [StructLayout(LayoutKind.Sequential)] | ||
157 | public struct PARAMETER_ID | ||
158 | { | ||
159 | public uint data1; | ||
160 | public uint data2; | ||
161 | } | ||
162 | |||
163 | [StructLayout(LayoutKind.Sequential)] | ||
164 | public struct PARAMETER_DESCRIPTION | ||
165 | { | ||
166 | public StringWrapper name; | ||
167 | public PARAMETER_ID id; | ||
168 | public float minimum; | ||
169 | public float maximum; | ||
170 | public float defaultvalue; | ||
171 | public PARAMETER_TYPE type; | ||
172 | public PARAMETER_FLAGS flags; | ||
173 | public GUID guid; | ||
174 | } | ||
175 | |||
176 | // This is only need for loading memory and given our C# wrapper LOAD_MEMORY_POINT isn't feasible anyway | ||
177 | enum LOAD_MEMORY_MODE : int | ||
178 | { | ||
179 | LOAD_MEMORY, | ||
180 | LOAD_MEMORY_POINT, | ||
181 | } | ||
182 | |||
183 | enum LOAD_MEMORY_ALIGNMENT : int | ||
184 | { | ||
185 | VALUE = 32 | ||
186 | } | ||
187 | |||
188 | [StructLayout(LayoutKind.Sequential)] | ||
189 | public struct SOUND_INFO | ||
190 | { | ||
191 | public IntPtr name_or_data; | ||
192 | public MODE mode; | ||
193 | public CREATESOUNDEXINFO exinfo; | ||
194 | public int subsoundindex; | ||
195 | |||
196 | public string name | ||
197 | { | ||
198 | get | ||
199 | { | ||
200 | using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) | ||
201 | { | ||
202 | return ((mode & (MODE.OPENMEMORY | MODE.OPENMEMORY_POINT)) == 0) ? encoding.stringFromNative(name_or_data) : String.Empty; | ||
203 | } | ||
204 | } | ||
205 | } | ||
206 | } | ||
207 | |||
208 | public enum USER_PROPERTY_TYPE : int | ||
209 | { | ||
210 | INTEGER, | ||
211 | BOOLEAN, | ||
212 | FLOAT, | ||
213 | STRING, | ||
214 | } | ||
215 | |||
216 | [StructLayout(LayoutKind.Sequential)] | ||
217 | public struct USER_PROPERTY | ||
218 | { | ||
219 | public StringWrapper name; | ||
220 | public USER_PROPERTY_TYPE type; | ||
221 | private Union_IntBoolFloatString value; | ||
222 | |||
223 | public int intValue() { return (type == USER_PROPERTY_TYPE.INTEGER) ? value.intvalue : -1; } | ||
224 | public bool boolValue() { return (type == USER_PROPERTY_TYPE.BOOLEAN) ? value.boolvalue : false; } | ||
225 | public float floatValue() { return (type == USER_PROPERTY_TYPE.FLOAT) ? value.floatvalue : -1; } | ||
226 | public string stringValue() { return (type == USER_PROPERTY_TYPE.STRING) ? value.stringvalue : ""; } | ||
227 | }; | ||
228 | |||
229 | [StructLayout(LayoutKind.Explicit)] | ||
230 | struct Union_IntBoolFloatString | ||
231 | { | ||
232 | [FieldOffset(0)] | ||
233 | public int intvalue; | ||
234 | [FieldOffset(0)] | ||
235 | public bool boolvalue; | ||
236 | [FieldOffset(0)] | ||
237 | public float floatvalue; | ||
238 | [FieldOffset(0)] | ||
239 | public StringWrapper stringvalue; | ||
240 | } | ||
241 | |||
242 | [Flags] | ||
243 | public enum INITFLAGS : uint | ||
244 | { | ||
245 | NORMAL = 0x00000000, | ||
246 | LIVEUPDATE = 0x00000001, | ||
247 | ALLOW_MISSING_PLUGINS = 0x00000002, | ||
248 | SYNCHRONOUS_UPDATE = 0x00000004, | ||
249 | DEFERRED_CALLBACKS = 0x00000008, | ||
250 | LOAD_FROM_UPDATE = 0x00000010, | ||
251 | MEMORY_TRACKING = 0x00000020, | ||
252 | } | ||
253 | |||
254 | [Flags] | ||
255 | public enum LOAD_BANK_FLAGS : uint | ||
256 | { | ||
257 | NORMAL = 0x00000000, | ||
258 | NONBLOCKING = 0x00000001, | ||
259 | DECOMPRESS_SAMPLES = 0x00000002, | ||
260 | UNENCRYPTED = 0x00000004, | ||
261 | } | ||
262 | |||
263 | [Flags] | ||
264 | public enum COMMANDCAPTURE_FLAGS : uint | ||
265 | { | ||
266 | NORMAL = 0x00000000, | ||
267 | FILEFLUSH = 0x00000001, | ||
268 | SKIP_INITIAL_STATE = 0x00000002, | ||
269 | } | ||
270 | |||
271 | [Flags] | ||
272 | public enum COMMANDREPLAY_FLAGS : uint | ||
273 | { | ||
274 | NORMAL = 0x00000000, | ||
275 | SKIP_CLEANUP = 0x00000001, | ||
276 | FAST_FORWARD = 0x00000002, | ||
277 | SKIP_BANK_LOAD = 0x00000004, | ||
278 | } | ||
279 | |||
280 | public enum PLAYBACK_STATE : int | ||
281 | { | ||
282 | PLAYING, | ||
283 | SUSTAINING, | ||
284 | STOPPED, | ||
285 | STARTING, | ||
286 | STOPPING, | ||
287 | } | ||
288 | |||
289 | public enum EVENT_PROPERTY : int | ||
290 | { | ||
291 | CHANNELPRIORITY, | ||
292 | SCHEDULE_DELAY, | ||
293 | SCHEDULE_LOOKAHEAD, | ||
294 | MINIMUM_DISTANCE, | ||
295 | MAXIMUM_DISTANCE, | ||
296 | COOLDOWN, | ||
297 | MAX | ||
298 | }; | ||
299 | |||
300 | [StructLayout(LayoutKind.Sequential)] | ||
301 | public struct PLUGIN_INSTANCE_PROPERTIES | ||
302 | { | ||
303 | public IntPtr name; | ||
304 | public IntPtr dsp; | ||
305 | } | ||
306 | |||
307 | [Flags] | ||
308 | public enum EVENT_CALLBACK_TYPE : uint | ||
309 | { | ||
310 | CREATED = 0x00000001, | ||
311 | DESTROYED = 0x00000002, | ||
312 | STARTING = 0x00000004, | ||
313 | STARTED = 0x00000008, | ||
314 | RESTARTED = 0x00000010, | ||
315 | STOPPED = 0x00000020, | ||
316 | START_FAILED = 0x00000040, | ||
317 | CREATE_PROGRAMMER_SOUND = 0x00000080, | ||
318 | DESTROY_PROGRAMMER_SOUND = 0x00000100, | ||
319 | PLUGIN_CREATED = 0x00000200, | ||
320 | PLUGIN_DESTROYED = 0x00000400, | ||
321 | TIMELINE_MARKER = 0x00000800, | ||
322 | TIMELINE_BEAT = 0x00001000, | ||
323 | SOUND_PLAYED = 0x00002000, | ||
324 | SOUND_STOPPED = 0x00004000, | ||
325 | REAL_TO_VIRTUAL = 0x00008000, | ||
326 | VIRTUAL_TO_REAL = 0x00010000, | ||
327 | START_EVENT_COMMAND = 0x00020000, | ||
328 | NESTED_TIMELINE_BEAT = 0x00040000, | ||
329 | |||
330 | ALL = 0xFFFFFFFF, | ||
331 | } | ||
332 | |||
333 | public delegate RESULT EVENT_CALLBACK(EVENT_CALLBACK_TYPE type, IntPtr _event, IntPtr parameters); | ||
334 | |||
335 | public delegate RESULT COMMANDREPLAY_FRAME_CALLBACK(IntPtr replay, int commandindex, float currenttime, IntPtr userdata); | ||
336 | public delegate RESULT COMMANDREPLAY_LOAD_BANK_CALLBACK(IntPtr replay, int commandindex, GUID bankguid, IntPtr bankfilename, LOAD_BANK_FLAGS flags, out IntPtr bank, IntPtr userdata); | ||
337 | public delegate RESULT COMMANDREPLAY_CREATE_INSTANCE_CALLBACK(IntPtr replay, int commandindex, IntPtr eventdescription, out IntPtr instance, IntPtr userdata); | ||
338 | |||
339 | public enum INSTANCETYPE : int | ||
340 | { | ||
341 | NONE, | ||
342 | SYSTEM, | ||
343 | EVENTDESCRIPTION, | ||
344 | EVENTINSTANCE, | ||
345 | PARAMETERINSTANCE, | ||
346 | BUS, | ||
347 | VCA, | ||
348 | BANK, | ||
349 | COMMANDREPLAY, | ||
350 | } | ||
351 | |||
352 | [StructLayout(LayoutKind.Sequential)] | ||
353 | public struct COMMAND_INFO | ||
354 | { | ||
355 | public StringWrapper commandname; | ||
356 | public int parentcommandindex; | ||
357 | public int framenumber; | ||
358 | public float frametime; | ||
359 | public INSTANCETYPE instancetype; | ||
360 | public INSTANCETYPE outputtype; | ||
361 | public UInt32 instancehandle; | ||
362 | public UInt32 outputhandle; | ||
363 | } | ||
364 | |||
365 | [StructLayout(LayoutKind.Sequential)] | ||
366 | public struct MEMORY_USAGE | ||
367 | { | ||
368 | public int exclusive; | ||
369 | public int inclusive; | ||
370 | public int sampledata; | ||
371 | } | ||
372 | |||
373 | public struct Util | ||
374 | { | ||
375 | public static RESULT parseID(string idString, out GUID id) | ||
376 | { | ||
377 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
378 | { | ||
379 | return FMOD_Studio_ParseID(encoder.byteFromStringUTF8(idString), out id); | ||
380 | } | ||
381 | } | ||
382 | |||
383 | #region importfunctions | ||
384 | [DllImport(STUDIO_VERSION.dll)] | ||
385 | private static extern RESULT FMOD_Studio_ParseID(byte[] idString, out GUID id); | ||
386 | #endregion | ||
387 | } | ||
388 | |||
389 | public struct System | ||
390 | { | ||
391 | // Initialization / system functions. | ||
392 | public static RESULT create(out System system) | ||
393 | { | ||
394 | return FMOD_Studio_System_Create(out system.handle, VERSION.number); | ||
395 | } | ||
396 | public RESULT setAdvancedSettings(ADVANCEDSETTINGS settings) | ||
397 | { | ||
398 | settings.cbsize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); | ||
399 | return FMOD_Studio_System_SetAdvancedSettings(this.handle, ref settings); | ||
400 | } | ||
401 | public RESULT setAdvancedSettings(ADVANCEDSETTINGS settings, string encryptionKey) | ||
402 | { | ||
403 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
404 | { | ||
405 | IntPtr userKey = settings.encryptionkey; | ||
406 | settings.encryptionkey = encoder.intptrFromStringUTF8(encryptionKey); | ||
407 | FMOD.RESULT result = setAdvancedSettings(settings); | ||
408 | settings.encryptionkey = userKey; | ||
409 | return result; | ||
410 | } | ||
411 | } | ||
412 | public RESULT getAdvancedSettings(out ADVANCEDSETTINGS settings) | ||
413 | { | ||
414 | settings.cbsize = MarshalHelper.SizeOf(typeof(ADVANCEDSETTINGS)); | ||
415 | return FMOD_Studio_System_GetAdvancedSettings(this.handle, out settings); | ||
416 | } | ||
417 | public RESULT initialize(int maxchannels, INITFLAGS studioflags, FMOD.INITFLAGS flags, IntPtr extradriverdata) | ||
418 | { | ||
419 | return FMOD_Studio_System_Initialize(this.handle, maxchannels, studioflags, flags, extradriverdata); | ||
420 | } | ||
421 | public RESULT release() | ||
422 | { | ||
423 | return FMOD_Studio_System_Release(this.handle); | ||
424 | } | ||
425 | public RESULT update() | ||
426 | { | ||
427 | return FMOD_Studio_System_Update(this.handle); | ||
428 | } | ||
429 | public RESULT getCoreSystem(out FMOD.System coresystem) | ||
430 | { | ||
431 | return FMOD_Studio_System_GetCoreSystem(this.handle, out coresystem.handle); | ||
432 | } | ||
433 | public RESULT getEvent(string path, out EventDescription _event) | ||
434 | { | ||
435 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
436 | { | ||
437 | return FMOD_Studio_System_GetEvent(this.handle, encoder.byteFromStringUTF8(path), out _event.handle); | ||
438 | } | ||
439 | } | ||
440 | public RESULT getBus(string path, out Bus bus) | ||
441 | { | ||
442 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
443 | { | ||
444 | return FMOD_Studio_System_GetBus(this.handle, encoder.byteFromStringUTF8(path), out bus.handle); | ||
445 | } | ||
446 | } | ||
447 | public RESULT getVCA(string path, out VCA vca) | ||
448 | { | ||
449 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
450 | { | ||
451 | return FMOD_Studio_System_GetVCA(this.handle, encoder.byteFromStringUTF8(path), out vca.handle); | ||
452 | } | ||
453 | } | ||
454 | public RESULT getBank(string path, out Bank bank) | ||
455 | { | ||
456 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
457 | { | ||
458 | return FMOD_Studio_System_GetBank(this.handle, encoder.byteFromStringUTF8(path), out bank.handle); | ||
459 | } | ||
460 | } | ||
461 | |||
462 | public RESULT getEventByID(GUID id, out EventDescription _event) | ||
463 | { | ||
464 | return FMOD_Studio_System_GetEventByID(this.handle, ref id, out _event.handle); | ||
465 | } | ||
466 | public RESULT getBusByID(GUID id, out Bus bus) | ||
467 | { | ||
468 | return FMOD_Studio_System_GetBusByID(this.handle, ref id, out bus.handle); | ||
469 | } | ||
470 | public RESULT getVCAByID(GUID id, out VCA vca) | ||
471 | { | ||
472 | return FMOD_Studio_System_GetVCAByID(this.handle, ref id, out vca.handle); | ||
473 | } | ||
474 | public RESULT getBankByID(GUID id, out Bank bank) | ||
475 | { | ||
476 | return FMOD_Studio_System_GetBankByID(this.handle, ref id, out bank.handle); | ||
477 | } | ||
478 | public RESULT getSoundInfo(string key, out SOUND_INFO info) | ||
479 | { | ||
480 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
481 | { | ||
482 | return FMOD_Studio_System_GetSoundInfo(this.handle, encoder.byteFromStringUTF8(key), out info); | ||
483 | } | ||
484 | } | ||
485 | public RESULT getParameterDescriptionByName(string name, out PARAMETER_DESCRIPTION parameter) | ||
486 | { | ||
487 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
488 | { | ||
489 | return FMOD_Studio_System_GetParameterDescriptionByName(this.handle, encoder.byteFromStringUTF8(name), out parameter); | ||
490 | } | ||
491 | } | ||
492 | public RESULT getParameterDescriptionByID(PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter) | ||
493 | { | ||
494 | return FMOD_Studio_System_GetParameterDescriptionByID(this.handle, id, out parameter); | ||
495 | } | ||
496 | public RESULT getParameterLabelByName(string name, int labelindex, out string label) | ||
497 | { | ||
498 | label = null; | ||
499 | |||
500 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
501 | { | ||
502 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
503 | int retrieved = 0; | ||
504 | byte[] nameBytes = encoder.byteFromStringUTF8(name); | ||
505 | RESULT result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, 256, out retrieved); | ||
506 | |||
507 | if (result == RESULT.ERR_TRUNCATED) | ||
508 | { | ||
509 | Marshal.FreeHGlobal(stringMem); | ||
510 | result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, IntPtr.Zero, 0, out retrieved); | ||
511 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
512 | result = FMOD_Studio_System_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, retrieved, out retrieved); | ||
513 | } | ||
514 | |||
515 | if (result == RESULT.OK) | ||
516 | { | ||
517 | label = encoder.stringFromNative(stringMem); | ||
518 | } | ||
519 | Marshal.FreeHGlobal(stringMem); | ||
520 | return result; | ||
521 | } | ||
522 | } | ||
523 | public RESULT getParameterLabelByID(PARAMETER_ID id, int labelindex, out string label) | ||
524 | { | ||
525 | label = null; | ||
526 | |||
527 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
528 | { | ||
529 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
530 | int retrieved = 0; | ||
531 | RESULT result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, stringMem, 256, out retrieved); | ||
532 | |||
533 | if (result == RESULT.ERR_TRUNCATED) | ||
534 | { | ||
535 | Marshal.FreeHGlobal(stringMem); | ||
536 | result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, IntPtr.Zero, 0, out retrieved); | ||
537 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
538 | result = FMOD_Studio_System_GetParameterLabelByID(this.handle, id, labelindex, stringMem, retrieved, out retrieved); | ||
539 | } | ||
540 | |||
541 | if (result == RESULT.OK) | ||
542 | { | ||
543 | label = encoder.stringFromNative(stringMem); | ||
544 | } | ||
545 | Marshal.FreeHGlobal(stringMem); | ||
546 | return result; | ||
547 | } | ||
548 | } | ||
549 | public RESULT getParameterByID(PARAMETER_ID id, out float value) | ||
550 | { | ||
551 | float finalValue; | ||
552 | return getParameterByID(id, out value, out finalValue); | ||
553 | } | ||
554 | public RESULT getParameterByID(PARAMETER_ID id, out float value, out float finalvalue) | ||
555 | { | ||
556 | return FMOD_Studio_System_GetParameterByID(this.handle, id, out value, out finalvalue); | ||
557 | } | ||
558 | public RESULT setParameterByID(PARAMETER_ID id, float value, bool ignoreseekspeed = false) | ||
559 | { | ||
560 | return FMOD_Studio_System_SetParameterByID(this.handle, id, value, ignoreseekspeed); | ||
561 | } | ||
562 | public RESULT setParameterByIDWithLabel(PARAMETER_ID id, string label, bool ignoreseekspeed = false) | ||
563 | { | ||
564 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
565 | { | ||
566 | return FMOD_Studio_System_SetParameterByIDWithLabel(this.handle, id, encoder.byteFromStringUTF8(label), ignoreseekspeed); | ||
567 | } | ||
568 | } | ||
569 | public RESULT setParametersByIDs(PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed = false) | ||
570 | { | ||
571 | return FMOD_Studio_System_SetParametersByIDs(this.handle, ids, values, count, ignoreseekspeed); | ||
572 | } | ||
573 | public RESULT getParameterByName(string name, out float value) | ||
574 | { | ||
575 | float finalValue; | ||
576 | return getParameterByName(name, out value, out finalValue); | ||
577 | } | ||
578 | public RESULT getParameterByName(string name, out float value, out float finalvalue) | ||
579 | { | ||
580 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
581 | { | ||
582 | return FMOD_Studio_System_GetParameterByName(this.handle, encoder.byteFromStringUTF8(name), out value, out finalvalue); | ||
583 | } | ||
584 | } | ||
585 | public RESULT setParameterByName(string name, float value, bool ignoreseekspeed = false) | ||
586 | { | ||
587 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
588 | { | ||
589 | return FMOD_Studio_System_SetParameterByName(this.handle, encoder.byteFromStringUTF8(name), value, ignoreseekspeed); | ||
590 | } | ||
591 | } | ||
592 | public RESULT setParameterByNameWithLabel(string name, string label, bool ignoreseekspeed = false) | ||
593 | { | ||
594 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper(), | ||
595 | labelEncoder = StringHelper.GetFreeHelper()) | ||
596 | { | ||
597 | return FMOD_Studio_System_SetParameterByNameWithLabel(this.handle, encoder.byteFromStringUTF8(name), labelEncoder.byteFromStringUTF8(label), ignoreseekspeed); | ||
598 | } | ||
599 | } | ||
600 | public RESULT lookupID(string path, out GUID id) | ||
601 | { | ||
602 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
603 | { | ||
604 | return FMOD_Studio_System_LookupID(this.handle, encoder.byteFromStringUTF8(path), out id); | ||
605 | } | ||
606 | } | ||
607 | public RESULT lookupPath(GUID id, out string path) | ||
608 | { | ||
609 | path = null; | ||
610 | |||
611 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
612 | { | ||
613 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
614 | int retrieved = 0; | ||
615 | RESULT result = FMOD_Studio_System_LookupPath(this.handle, ref id, stringMem, 256, out retrieved); | ||
616 | |||
617 | if (result == RESULT.ERR_TRUNCATED) | ||
618 | { | ||
619 | Marshal.FreeHGlobal(stringMem); | ||
620 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
621 | result = FMOD_Studio_System_LookupPath(this.handle, ref id, stringMem, retrieved, out retrieved); | ||
622 | } | ||
623 | |||
624 | if (result == RESULT.OK) | ||
625 | { | ||
626 | path = encoder.stringFromNative(stringMem); | ||
627 | } | ||
628 | Marshal.FreeHGlobal(stringMem); | ||
629 | return result; | ||
630 | } | ||
631 | } | ||
632 | public RESULT getNumListeners(out int numlisteners) | ||
633 | { | ||
634 | return FMOD_Studio_System_GetNumListeners(this.handle, out numlisteners); | ||
635 | } | ||
636 | public RESULT setNumListeners(int numlisteners) | ||
637 | { | ||
638 | return FMOD_Studio_System_SetNumListeners(this.handle, numlisteners); | ||
639 | } | ||
640 | public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes) | ||
641 | { | ||
642 | return FMOD_Studio_System_GetListenerAttributes(this.handle, listener, out attributes, IntPtr.Zero); | ||
643 | } | ||
644 | public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes, out VECTOR attenuationposition) | ||
645 | { | ||
646 | return FMOD_Studio_System_GetListenerAttributes(this.handle, listener, out attributes, out attenuationposition); | ||
647 | } | ||
648 | public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes) | ||
649 | { | ||
650 | return FMOD_Studio_System_SetListenerAttributes(this.handle, listener, ref attributes, IntPtr.Zero); | ||
651 | } | ||
652 | public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes, VECTOR attenuationposition) | ||
653 | { | ||
654 | return FMOD_Studio_System_SetListenerAttributes(this.handle, listener, ref attributes, ref attenuationposition); | ||
655 | } | ||
656 | public RESULT getListenerWeight(int listener, out float weight) | ||
657 | { | ||
658 | return FMOD_Studio_System_GetListenerWeight(this.handle, listener, out weight); | ||
659 | } | ||
660 | public RESULT setListenerWeight(int listener, float weight) | ||
661 | { | ||
662 | return FMOD_Studio_System_SetListenerWeight(this.handle, listener, weight); | ||
663 | } | ||
664 | public RESULT loadBankFile(string filename, LOAD_BANK_FLAGS flags, out Bank bank) | ||
665 | { | ||
666 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
667 | { | ||
668 | return FMOD_Studio_System_LoadBankFile(this.handle, encoder.byteFromStringUTF8(filename), flags, out bank.handle); | ||
669 | } | ||
670 | } | ||
671 | public RESULT loadBankMemory(byte[] buffer, LOAD_BANK_FLAGS flags, out Bank bank) | ||
672 | { | ||
673 | // Manually pin the byte array. It's what the marshaller should do anyway but don't leave it to chance. | ||
674 | GCHandle pinnedArray = GCHandle.Alloc(buffer, GCHandleType.Pinned); | ||
675 | IntPtr pointer = pinnedArray.AddrOfPinnedObject(); | ||
676 | RESULT result = FMOD_Studio_System_LoadBankMemory(this.handle, pointer, buffer.Length, LOAD_MEMORY_MODE.LOAD_MEMORY, flags, out bank.handle); | ||
677 | pinnedArray.Free(); | ||
678 | return result; | ||
679 | } | ||
680 | public RESULT loadBankCustom(BANK_INFO info, LOAD_BANK_FLAGS flags, out Bank bank) | ||
681 | { | ||
682 | info.size = MarshalHelper.SizeOf(typeof(BANK_INFO)); | ||
683 | return FMOD_Studio_System_LoadBankCustom(this.handle, ref info, flags, out bank.handle); | ||
684 | } | ||
685 | public RESULT unloadAll() | ||
686 | { | ||
687 | return FMOD_Studio_System_UnloadAll(this.handle); | ||
688 | } | ||
689 | public RESULT flushCommands() | ||
690 | { | ||
691 | return FMOD_Studio_System_FlushCommands(this.handle); | ||
692 | } | ||
693 | public RESULT flushSampleLoading() | ||
694 | { | ||
695 | return FMOD_Studio_System_FlushSampleLoading(this.handle); | ||
696 | } | ||
697 | public RESULT startCommandCapture(string filename, COMMANDCAPTURE_FLAGS flags) | ||
698 | { | ||
699 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
700 | { | ||
701 | return FMOD_Studio_System_StartCommandCapture(this.handle, encoder.byteFromStringUTF8(filename), flags); | ||
702 | } | ||
703 | } | ||
704 | public RESULT stopCommandCapture() | ||
705 | { | ||
706 | return FMOD_Studio_System_StopCommandCapture(this.handle); | ||
707 | } | ||
708 | public RESULT loadCommandReplay(string filename, COMMANDREPLAY_FLAGS flags, out CommandReplay replay) | ||
709 | { | ||
710 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
711 | { | ||
712 | return FMOD_Studio_System_LoadCommandReplay(this.handle, encoder.byteFromStringUTF8(filename), flags, out replay.handle); | ||
713 | } | ||
714 | } | ||
715 | public RESULT getBankCount(out int count) | ||
716 | { | ||
717 | return FMOD_Studio_System_GetBankCount(this.handle, out count); | ||
718 | } | ||
719 | public RESULT getBankList(out Bank[] array) | ||
720 | { | ||
721 | array = null; | ||
722 | |||
723 | RESULT result; | ||
724 | int capacity; | ||
725 | result = FMOD_Studio_System_GetBankCount(this.handle, out capacity); | ||
726 | if (result != RESULT.OK) | ||
727 | { | ||
728 | return result; | ||
729 | } | ||
730 | if (capacity == 0) | ||
731 | { | ||
732 | array = new Bank[0]; | ||
733 | return result; | ||
734 | } | ||
735 | |||
736 | IntPtr[] rawArray = new IntPtr[capacity]; | ||
737 | int actualCount; | ||
738 | result = FMOD_Studio_System_GetBankList(this.handle, rawArray, capacity, out actualCount); | ||
739 | if (result != RESULT.OK) | ||
740 | { | ||
741 | return result; | ||
742 | } | ||
743 | if (actualCount > capacity) // More items added since we queried just now? | ||
744 | { | ||
745 | actualCount = capacity; | ||
746 | } | ||
747 | array = new Bank[actualCount]; | ||
748 | for (int i = 0; i < actualCount; ++i) | ||
749 | { | ||
750 | array[i].handle = rawArray[i]; | ||
751 | } | ||
752 | return RESULT.OK; | ||
753 | } | ||
754 | public RESULT getParameterDescriptionCount(out int count) | ||
755 | { | ||
756 | return FMOD_Studio_System_GetParameterDescriptionCount(this.handle, out count); | ||
757 | } | ||
758 | public RESULT getParameterDescriptionList(out PARAMETER_DESCRIPTION[] array) | ||
759 | { | ||
760 | array = null; | ||
761 | |||
762 | int capacity; | ||
763 | RESULT result = FMOD_Studio_System_GetParameterDescriptionCount(this.handle, out capacity); | ||
764 | if (result != RESULT.OK) | ||
765 | { | ||
766 | return result; | ||
767 | } | ||
768 | if (capacity == 0) | ||
769 | { | ||
770 | array = new PARAMETER_DESCRIPTION[0]; | ||
771 | return RESULT.OK; | ||
772 | } | ||
773 | |||
774 | PARAMETER_DESCRIPTION[] tempArray = new PARAMETER_DESCRIPTION[capacity]; | ||
775 | int actualCount; | ||
776 | result = FMOD_Studio_System_GetParameterDescriptionList(this.handle, tempArray, capacity, out actualCount); | ||
777 | if (result != RESULT.OK) | ||
778 | { | ||
779 | return result; | ||
780 | } | ||
781 | |||
782 | if (actualCount != capacity) | ||
783 | { | ||
784 | Array.Resize(ref tempArray, actualCount); | ||
785 | } | ||
786 | |||
787 | array = tempArray; | ||
788 | |||
789 | return RESULT.OK; | ||
790 | } | ||
791 | public RESULT getCPUUsage(out CPU_USAGE usage, out FMOD.CPU_USAGE usage_core) | ||
792 | { | ||
793 | return FMOD_Studio_System_GetCPUUsage(this.handle, out usage, out usage_core); | ||
794 | } | ||
795 | public RESULT getBufferUsage(out BUFFER_USAGE usage) | ||
796 | { | ||
797 | return FMOD_Studio_System_GetBufferUsage(this.handle, out usage); | ||
798 | } | ||
799 | public RESULT resetBufferUsage() | ||
800 | { | ||
801 | return FMOD_Studio_System_ResetBufferUsage(this.handle); | ||
802 | } | ||
803 | |||
804 | public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) | ||
805 | { | ||
806 | return FMOD_Studio_System_SetCallback(this.handle, callback, callbackmask); | ||
807 | } | ||
808 | |||
809 | public RESULT getUserData(out IntPtr userdata) | ||
810 | { | ||
811 | return FMOD_Studio_System_GetUserData(this.handle, out userdata); | ||
812 | } | ||
813 | |||
814 | public RESULT setUserData(IntPtr userdata) | ||
815 | { | ||
816 | return FMOD_Studio_System_SetUserData(this.handle, userdata); | ||
817 | } | ||
818 | |||
819 | public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) | ||
820 | { | ||
821 | return FMOD_Studio_System_GetMemoryUsage(this.handle, out memoryusage); | ||
822 | } | ||
823 | |||
824 | #region importfunctions | ||
825 | [DllImport(STUDIO_VERSION.dll)] | ||
826 | private static extern RESULT FMOD_Studio_System_Create (out IntPtr system, uint headerversion); | ||
827 | [DllImport(STUDIO_VERSION.dll)] | ||
828 | private static extern bool FMOD_Studio_System_IsValid (IntPtr system); | ||
829 | [DllImport(STUDIO_VERSION.dll)] | ||
830 | private static extern RESULT FMOD_Studio_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); | ||
831 | [DllImport(STUDIO_VERSION.dll)] | ||
832 | private static extern RESULT FMOD_Studio_System_GetAdvancedSettings (IntPtr system, out ADVANCEDSETTINGS settings); | ||
833 | [DllImport(STUDIO_VERSION.dll)] | ||
834 | private static extern RESULT FMOD_Studio_System_Initialize (IntPtr system, int maxchannels, INITFLAGS studioflags, FMOD.INITFLAGS flags, IntPtr extradriverdata); | ||
835 | [DllImport(STUDIO_VERSION.dll)] | ||
836 | private static extern RESULT FMOD_Studio_System_Release (IntPtr system); | ||
837 | [DllImport(STUDIO_VERSION.dll)] | ||
838 | private static extern RESULT FMOD_Studio_System_Update (IntPtr system); | ||
839 | [DllImport(STUDIO_VERSION.dll)] | ||
840 | private static extern RESULT FMOD_Studio_System_GetCoreSystem (IntPtr system, out IntPtr coresystem); | ||
841 | [DllImport(STUDIO_VERSION.dll)] | ||
842 | private static extern RESULT FMOD_Studio_System_GetEvent (IntPtr system, byte[] path, out IntPtr _event); | ||
843 | [DllImport(STUDIO_VERSION.dll)] | ||
844 | private static extern RESULT FMOD_Studio_System_GetBus (IntPtr system, byte[] path, out IntPtr bus); | ||
845 | [DllImport(STUDIO_VERSION.dll)] | ||
846 | private static extern RESULT FMOD_Studio_System_GetVCA (IntPtr system, byte[] path, out IntPtr vca); | ||
847 | [DllImport(STUDIO_VERSION.dll)] | ||
848 | private static extern RESULT FMOD_Studio_System_GetBank (IntPtr system, byte[] path, out IntPtr bank); | ||
849 | [DllImport(STUDIO_VERSION.dll)] | ||
850 | private static extern RESULT FMOD_Studio_System_GetEventByID (IntPtr system, ref GUID id, out IntPtr _event); | ||
851 | [DllImport(STUDIO_VERSION.dll)] | ||
852 | private static extern RESULT FMOD_Studio_System_GetBusByID (IntPtr system, ref GUID id, out IntPtr bus); | ||
853 | [DllImport(STUDIO_VERSION.dll)] | ||
854 | private static extern RESULT FMOD_Studio_System_GetVCAByID (IntPtr system, ref GUID id, out IntPtr vca); | ||
855 | [DllImport(STUDIO_VERSION.dll)] | ||
856 | private static extern RESULT FMOD_Studio_System_GetBankByID (IntPtr system, ref GUID id, out IntPtr bank); | ||
857 | [DllImport(STUDIO_VERSION.dll)] | ||
858 | private static extern RESULT FMOD_Studio_System_GetSoundInfo (IntPtr system, byte[] key, out SOUND_INFO info); | ||
859 | [DllImport(STUDIO_VERSION.dll)] | ||
860 | private static extern RESULT FMOD_Studio_System_GetParameterDescriptionByName(IntPtr system, byte[] name, out PARAMETER_DESCRIPTION parameter); | ||
861 | [DllImport(STUDIO_VERSION.dll)] | ||
862 | private static extern RESULT FMOD_Studio_System_GetParameterDescriptionByID(IntPtr system, PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter); | ||
863 | [DllImport(STUDIO_VERSION.dll)] | ||
864 | private static extern RESULT FMOD_Studio_System_GetParameterLabelByName (IntPtr system, byte[] name, int labelindex, IntPtr label, int size, out int retrieved); | ||
865 | [DllImport(STUDIO_VERSION.dll)] | ||
866 | private static extern RESULT FMOD_Studio_System_GetParameterLabelByID (IntPtr system, PARAMETER_ID id, int labelindex, IntPtr label, int size, out int retrieved); | ||
867 | [DllImport(STUDIO_VERSION.dll)] | ||
868 | private static extern RESULT FMOD_Studio_System_GetParameterByID (IntPtr system, PARAMETER_ID id, out float value, out float finalvalue); | ||
869 | [DllImport(STUDIO_VERSION.dll)] | ||
870 | private static extern RESULT FMOD_Studio_System_SetParameterByID (IntPtr system, PARAMETER_ID id, float value, bool ignoreseekspeed); | ||
871 | [DllImport(STUDIO_VERSION.dll)] | ||
872 | private static extern RESULT FMOD_Studio_System_SetParameterByIDWithLabel (IntPtr system, PARAMETER_ID id, byte[] label, bool ignoreseekspeed); | ||
873 | [DllImport(STUDIO_VERSION.dll)] | ||
874 | private static extern RESULT FMOD_Studio_System_SetParametersByIDs (IntPtr system, PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed); | ||
875 | [DllImport(STUDIO_VERSION.dll)] | ||
876 | private static extern RESULT FMOD_Studio_System_GetParameterByName (IntPtr system, byte[] name, out float value, out float finalvalue); | ||
877 | [DllImport(STUDIO_VERSION.dll)] | ||
878 | private static extern RESULT FMOD_Studio_System_SetParameterByName (IntPtr system, byte[] name, float value, bool ignoreseekspeed); | ||
879 | [DllImport(STUDIO_VERSION.dll)] | ||
880 | private static extern RESULT FMOD_Studio_System_SetParameterByNameWithLabel (IntPtr system, byte[] name, byte[] label, bool ignoreseekspeed); | ||
881 | [DllImport(STUDIO_VERSION.dll)] | ||
882 | private static extern RESULT FMOD_Studio_System_LookupID (IntPtr system, byte[] path, out GUID id); | ||
883 | [DllImport(STUDIO_VERSION.dll)] | ||
884 | private static extern RESULT FMOD_Studio_System_LookupPath (IntPtr system, ref GUID id, IntPtr path, int size, out int retrieved); | ||
885 | [DllImport(STUDIO_VERSION.dll)] | ||
886 | private static extern RESULT FMOD_Studio_System_GetNumListeners (IntPtr system, out int numlisteners); | ||
887 | [DllImport(STUDIO_VERSION.dll)] | ||
888 | private static extern RESULT FMOD_Studio_System_SetNumListeners (IntPtr system, int numlisteners); | ||
889 | [DllImport(STUDIO_VERSION.dll)] | ||
890 | private static extern RESULT FMOD_Studio_System_GetListenerAttributes (IntPtr system, int listener, out ATTRIBUTES_3D attributes, IntPtr zero); | ||
891 | [DllImport(STUDIO_VERSION.dll)] | ||
892 | private static extern RESULT FMOD_Studio_System_GetListenerAttributes (IntPtr system, int listener, out ATTRIBUTES_3D attributes, out VECTOR attenuationposition); | ||
893 | [DllImport(STUDIO_VERSION.dll)] | ||
894 | private static extern RESULT FMOD_Studio_System_SetListenerAttributes (IntPtr system, int listener, ref ATTRIBUTES_3D attributes, IntPtr zero); | ||
895 | [DllImport(STUDIO_VERSION.dll)] | ||
896 | private static extern RESULT FMOD_Studio_System_SetListenerAttributes (IntPtr system, int listener, ref ATTRIBUTES_3D attributes, ref VECTOR attenuationposition); | ||
897 | [DllImport(STUDIO_VERSION.dll)] | ||
898 | private static extern RESULT FMOD_Studio_System_GetListenerWeight (IntPtr system, int listener, out float weight); | ||
899 | [DllImport(STUDIO_VERSION.dll)] | ||
900 | private static extern RESULT FMOD_Studio_System_SetListenerWeight (IntPtr system, int listener, float weight); | ||
901 | [DllImport(STUDIO_VERSION.dll)] | ||
902 | private static extern RESULT FMOD_Studio_System_LoadBankFile (IntPtr system, byte[] filename, LOAD_BANK_FLAGS flags, out IntPtr bank); | ||
903 | [DllImport(STUDIO_VERSION.dll)] | ||
904 | 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); | ||
905 | [DllImport(STUDIO_VERSION.dll)] | ||
906 | private static extern RESULT FMOD_Studio_System_LoadBankCustom (IntPtr system, ref BANK_INFO info, LOAD_BANK_FLAGS flags, out IntPtr bank); | ||
907 | [DllImport(STUDIO_VERSION.dll)] | ||
908 | private static extern RESULT FMOD_Studio_System_UnloadAll (IntPtr system); | ||
909 | [DllImport(STUDIO_VERSION.dll)] | ||
910 | private static extern RESULT FMOD_Studio_System_FlushCommands (IntPtr system); | ||
911 | [DllImport(STUDIO_VERSION.dll)] | ||
912 | private static extern RESULT FMOD_Studio_System_FlushSampleLoading (IntPtr system); | ||
913 | [DllImport(STUDIO_VERSION.dll)] | ||
914 | private static extern RESULT FMOD_Studio_System_StartCommandCapture (IntPtr system, byte[] filename, COMMANDCAPTURE_FLAGS flags); | ||
915 | [DllImport(STUDIO_VERSION.dll)] | ||
916 | private static extern RESULT FMOD_Studio_System_StopCommandCapture (IntPtr system); | ||
917 | [DllImport(STUDIO_VERSION.dll)] | ||
918 | private static extern RESULT FMOD_Studio_System_LoadCommandReplay (IntPtr system, byte[] filename, COMMANDREPLAY_FLAGS flags, out IntPtr replay); | ||
919 | [DllImport(STUDIO_VERSION.dll)] | ||
920 | private static extern RESULT FMOD_Studio_System_GetBankCount (IntPtr system, out int count); | ||
921 | [DllImport(STUDIO_VERSION.dll)] | ||
922 | private static extern RESULT FMOD_Studio_System_GetBankList (IntPtr system, IntPtr[] array, int capacity, out int count); | ||
923 | [DllImport(STUDIO_VERSION.dll)] | ||
924 | private static extern RESULT FMOD_Studio_System_GetParameterDescriptionCount(IntPtr system, out int count); | ||
925 | [DllImport(STUDIO_VERSION.dll)] | ||
926 | private static extern RESULT FMOD_Studio_System_GetParameterDescriptionList(IntPtr system, [Out] PARAMETER_DESCRIPTION[] array, int capacity, out int count); | ||
927 | [DllImport(STUDIO_VERSION.dll)] | ||
928 | private static extern RESULT FMOD_Studio_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage, out FMOD.CPU_USAGE usage_core); | ||
929 | [DllImport(STUDIO_VERSION.dll)] | ||
930 | private static extern RESULT FMOD_Studio_System_GetBufferUsage (IntPtr system, out BUFFER_USAGE usage); | ||
931 | [DllImport(STUDIO_VERSION.dll)] | ||
932 | private static extern RESULT FMOD_Studio_System_ResetBufferUsage (IntPtr system); | ||
933 | [DllImport(STUDIO_VERSION.dll)] | ||
934 | private static extern RESULT FMOD_Studio_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); | ||
935 | [DllImport(STUDIO_VERSION.dll)] | ||
936 | private static extern RESULT FMOD_Studio_System_GetUserData (IntPtr system, out IntPtr userdata); | ||
937 | [DllImport(STUDIO_VERSION.dll)] | ||
938 | private static extern RESULT FMOD_Studio_System_SetUserData (IntPtr system, IntPtr userdata); | ||
939 | [DllImport(STUDIO_VERSION.dll)] | ||
940 | private static extern RESULT FMOD_Studio_System_GetMemoryUsage (IntPtr system, out MEMORY_USAGE memoryusage); | ||
941 | #endregion | ||
942 | |||
943 | #region wrapperinternal | ||
944 | |||
945 | public IntPtr handle; | ||
946 | |||
947 | public System(IntPtr ptr) { this.handle = ptr; } | ||
948 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
949 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
950 | |||
951 | public bool isValid() | ||
952 | { | ||
953 | return hasHandle() && FMOD_Studio_System_IsValid(this.handle); | ||
954 | } | ||
955 | |||
956 | #endregion | ||
957 | } | ||
958 | |||
959 | public struct EventDescription | ||
960 | { | ||
961 | public RESULT getID(out GUID id) | ||
962 | { | ||
963 | return FMOD_Studio_EventDescription_GetID(this.handle, out id); | ||
964 | } | ||
965 | public RESULT getPath(out string path) | ||
966 | { | ||
967 | path = null; | ||
968 | |||
969 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
970 | { | ||
971 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
972 | int retrieved = 0; | ||
973 | RESULT result = FMOD_Studio_EventDescription_GetPath(this.handle, stringMem, 256, out retrieved); | ||
974 | |||
975 | if (result == RESULT.ERR_TRUNCATED) | ||
976 | { | ||
977 | Marshal.FreeHGlobal(stringMem); | ||
978 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
979 | result = FMOD_Studio_EventDescription_GetPath(this.handle, stringMem, retrieved, out retrieved); | ||
980 | } | ||
981 | |||
982 | if (result == RESULT.OK) | ||
983 | { | ||
984 | path = encoder.stringFromNative(stringMem); | ||
985 | } | ||
986 | Marshal.FreeHGlobal(stringMem); | ||
987 | return result; | ||
988 | } | ||
989 | } | ||
990 | public RESULT getParameterDescriptionCount(out int count) | ||
991 | { | ||
992 | return FMOD_Studio_EventDescription_GetParameterDescriptionCount(this.handle, out count); | ||
993 | } | ||
994 | public RESULT getParameterDescriptionByIndex(int index, out PARAMETER_DESCRIPTION parameter) | ||
995 | { | ||
996 | return FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(this.handle, index, out parameter); | ||
997 | } | ||
998 | public RESULT getParameterDescriptionByName(string name, out PARAMETER_DESCRIPTION parameter) | ||
999 | { | ||
1000 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1001 | { | ||
1002 | return FMOD_Studio_EventDescription_GetParameterDescriptionByName(this.handle, encoder.byteFromStringUTF8(name), out parameter); | ||
1003 | } | ||
1004 | } | ||
1005 | public RESULT getParameterDescriptionByID(PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter) | ||
1006 | { | ||
1007 | return FMOD_Studio_EventDescription_GetParameterDescriptionByID(this.handle, id, out parameter); | ||
1008 | } | ||
1009 | public RESULT getParameterLabelByIndex(int index, int labelindex, out string label) | ||
1010 | { | ||
1011 | label = null; | ||
1012 | |||
1013 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1014 | { | ||
1015 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
1016 | int retrieved = 0; | ||
1017 | RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, stringMem, 256, out retrieved); | ||
1018 | |||
1019 | if (result == RESULT.ERR_TRUNCATED) | ||
1020 | { | ||
1021 | Marshal.FreeHGlobal(stringMem); | ||
1022 | result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, IntPtr.Zero, 0, out retrieved); | ||
1023 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
1024 | result = FMOD_Studio_EventDescription_GetParameterLabelByIndex(this.handle, index, labelindex, stringMem, retrieved, out retrieved); | ||
1025 | } | ||
1026 | |||
1027 | if (result == RESULT.OK) | ||
1028 | { | ||
1029 | label = encoder.stringFromNative(stringMem); | ||
1030 | } | ||
1031 | Marshal.FreeHGlobal(stringMem); | ||
1032 | return result; | ||
1033 | } | ||
1034 | } | ||
1035 | public RESULT getParameterLabelByName(string name, int labelindex, out string label) | ||
1036 | { | ||
1037 | label = null; | ||
1038 | |||
1039 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1040 | { | ||
1041 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
1042 | int retrieved = 0; | ||
1043 | byte[] nameBytes = encoder.byteFromStringUTF8(name); | ||
1044 | RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, 256, out retrieved); | ||
1045 | |||
1046 | if (result == RESULT.ERR_TRUNCATED) | ||
1047 | { | ||
1048 | Marshal.FreeHGlobal(stringMem); | ||
1049 | result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, IntPtr.Zero, 0, out retrieved); | ||
1050 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
1051 | result = FMOD_Studio_EventDescription_GetParameterLabelByName(this.handle, nameBytes, labelindex, stringMem, retrieved, out retrieved); | ||
1052 | } | ||
1053 | |||
1054 | if (result == RESULT.OK) | ||
1055 | { | ||
1056 | label = encoder.stringFromNative(stringMem); | ||
1057 | } | ||
1058 | Marshal.FreeHGlobal(stringMem); | ||
1059 | return result; | ||
1060 | } | ||
1061 | } | ||
1062 | public RESULT getParameterLabelByID(PARAMETER_ID id, int labelindex, out string label) | ||
1063 | { | ||
1064 | label = null; | ||
1065 | |||
1066 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1067 | { | ||
1068 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
1069 | int retrieved = 0; | ||
1070 | RESULT result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, stringMem, 256, out retrieved); | ||
1071 | |||
1072 | if (result == RESULT.ERR_TRUNCATED) | ||
1073 | { | ||
1074 | Marshal.FreeHGlobal(stringMem); | ||
1075 | result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, IntPtr.Zero, 0, out retrieved); | ||
1076 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
1077 | result = FMOD_Studio_EventDescription_GetParameterLabelByID(this.handle, id, labelindex, stringMem, retrieved, out retrieved); | ||
1078 | } | ||
1079 | |||
1080 | if (result == RESULT.OK) | ||
1081 | { | ||
1082 | label = encoder.stringFromNative(stringMem); | ||
1083 | } | ||
1084 | Marshal.FreeHGlobal(stringMem); | ||
1085 | return result; | ||
1086 | } | ||
1087 | } | ||
1088 | public RESULT getUserPropertyCount(out int count) | ||
1089 | { | ||
1090 | return FMOD_Studio_EventDescription_GetUserPropertyCount(this.handle, out count); | ||
1091 | } | ||
1092 | public RESULT getUserPropertyByIndex(int index, out USER_PROPERTY property) | ||
1093 | { | ||
1094 | return FMOD_Studio_EventDescription_GetUserPropertyByIndex(this.handle, index, out property); | ||
1095 | } | ||
1096 | public RESULT getUserProperty(string name, out USER_PROPERTY property) | ||
1097 | { | ||
1098 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1099 | { | ||
1100 | return FMOD_Studio_EventDescription_GetUserProperty(this.handle, encoder.byteFromStringUTF8(name), out property); | ||
1101 | } | ||
1102 | } | ||
1103 | public RESULT getLength(out int length) | ||
1104 | { | ||
1105 | return FMOD_Studio_EventDescription_GetLength(this.handle, out length); | ||
1106 | } | ||
1107 | public RESULT getMinMaxDistance(out float min, out float max) | ||
1108 | { | ||
1109 | return FMOD_Studio_EventDescription_GetMinMaxDistance(this.handle, out min, out max); | ||
1110 | } | ||
1111 | public RESULT getSoundSize(out float size) | ||
1112 | { | ||
1113 | return FMOD_Studio_EventDescription_GetSoundSize(this.handle, out size); | ||
1114 | } | ||
1115 | public RESULT isSnapshot(out bool snapshot) | ||
1116 | { | ||
1117 | return FMOD_Studio_EventDescription_IsSnapshot(this.handle, out snapshot); | ||
1118 | } | ||
1119 | public RESULT isOneshot(out bool oneshot) | ||
1120 | { | ||
1121 | return FMOD_Studio_EventDescription_IsOneshot(this.handle, out oneshot); | ||
1122 | } | ||
1123 | public RESULT isStream(out bool isStream) | ||
1124 | { | ||
1125 | return FMOD_Studio_EventDescription_IsStream(this.handle, out isStream); | ||
1126 | } | ||
1127 | public RESULT is3D(out bool is3D) | ||
1128 | { | ||
1129 | return FMOD_Studio_EventDescription_Is3D(this.handle, out is3D); | ||
1130 | } | ||
1131 | public RESULT isDopplerEnabled(out bool doppler) | ||
1132 | { | ||
1133 | return FMOD_Studio_EventDescription_IsDopplerEnabled(this.handle, out doppler); | ||
1134 | } | ||
1135 | public RESULT hasSustainPoint(out bool sustainPoint) | ||
1136 | { | ||
1137 | return FMOD_Studio_EventDescription_HasSustainPoint(this.handle, out sustainPoint); | ||
1138 | } | ||
1139 | |||
1140 | public RESULT createInstance(out EventInstance instance) | ||
1141 | { | ||
1142 | return FMOD_Studio_EventDescription_CreateInstance(this.handle, out instance.handle); | ||
1143 | } | ||
1144 | |||
1145 | public RESULT getInstanceCount(out int count) | ||
1146 | { | ||
1147 | return FMOD_Studio_EventDescription_GetInstanceCount(this.handle, out count); | ||
1148 | } | ||
1149 | public RESULT getInstanceList(out EventInstance[] array) | ||
1150 | { | ||
1151 | array = null; | ||
1152 | |||
1153 | RESULT result; | ||
1154 | int capacity; | ||
1155 | result = FMOD_Studio_EventDescription_GetInstanceCount(this.handle, out capacity); | ||
1156 | if (result != RESULT.OK) | ||
1157 | { | ||
1158 | return result; | ||
1159 | } | ||
1160 | if (capacity == 0) | ||
1161 | { | ||
1162 | array = new EventInstance[0]; | ||
1163 | return result; | ||
1164 | } | ||
1165 | |||
1166 | IntPtr[] rawArray = new IntPtr[capacity]; | ||
1167 | int actualCount; | ||
1168 | result = FMOD_Studio_EventDescription_GetInstanceList(this.handle, rawArray, capacity, out actualCount); | ||
1169 | if (result != RESULT.OK) | ||
1170 | { | ||
1171 | return result; | ||
1172 | } | ||
1173 | if (actualCount > capacity) // More items added since we queried just now? | ||
1174 | { | ||
1175 | actualCount = capacity; | ||
1176 | } | ||
1177 | array = new EventInstance[actualCount]; | ||
1178 | for (int i = 0; i < actualCount; ++i) | ||
1179 | { | ||
1180 | array[i].handle = rawArray[i]; | ||
1181 | } | ||
1182 | return RESULT.OK; | ||
1183 | } | ||
1184 | |||
1185 | public RESULT loadSampleData() | ||
1186 | { | ||
1187 | return FMOD_Studio_EventDescription_LoadSampleData(this.handle); | ||
1188 | } | ||
1189 | |||
1190 | public RESULT unloadSampleData() | ||
1191 | { | ||
1192 | return FMOD_Studio_EventDescription_UnloadSampleData(this.handle); | ||
1193 | } | ||
1194 | |||
1195 | public RESULT getSampleLoadingState(out LOADING_STATE state) | ||
1196 | { | ||
1197 | return FMOD_Studio_EventDescription_GetSampleLoadingState(this.handle, out state); | ||
1198 | } | ||
1199 | |||
1200 | public RESULT releaseAllInstances() | ||
1201 | { | ||
1202 | return FMOD_Studio_EventDescription_ReleaseAllInstances(this.handle); | ||
1203 | } | ||
1204 | public RESULT setCallback(EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL) | ||
1205 | { | ||
1206 | return FMOD_Studio_EventDescription_SetCallback(this.handle, callback, callbackmask); | ||
1207 | } | ||
1208 | |||
1209 | public RESULT getUserData(out IntPtr userdata) | ||
1210 | { | ||
1211 | return FMOD_Studio_EventDescription_GetUserData(this.handle, out userdata); | ||
1212 | } | ||
1213 | |||
1214 | public RESULT setUserData(IntPtr userdata) | ||
1215 | { | ||
1216 | return FMOD_Studio_EventDescription_SetUserData(this.handle, userdata); | ||
1217 | } | ||
1218 | |||
1219 | #region importfunctions | ||
1220 | [DllImport(STUDIO_VERSION.dll)] | ||
1221 | private static extern bool FMOD_Studio_EventDescription_IsValid (IntPtr eventdescription); | ||
1222 | [DllImport(STUDIO_VERSION.dll)] | ||
1223 | private static extern RESULT FMOD_Studio_EventDescription_GetID (IntPtr eventdescription, out GUID id); | ||
1224 | [DllImport(STUDIO_VERSION.dll)] | ||
1225 | private static extern RESULT FMOD_Studio_EventDescription_GetPath (IntPtr eventdescription, IntPtr path, int size, out int retrieved); | ||
1226 | [DllImport(STUDIO_VERSION.dll)] | ||
1227 | private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionCount(IntPtr eventdescription, out int count); | ||
1228 | [DllImport(STUDIO_VERSION.dll)] | ||
1229 | private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(IntPtr eventdescription, int index, out PARAMETER_DESCRIPTION parameter); | ||
1230 | [DllImport(STUDIO_VERSION.dll)] | ||
1231 | private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByName(IntPtr eventdescription, byte[] name, out PARAMETER_DESCRIPTION parameter); | ||
1232 | [DllImport(STUDIO_VERSION.dll)] | ||
1233 | private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByID(IntPtr eventdescription, PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter); | ||
1234 | [DllImport(STUDIO_VERSION.dll)] | ||
1235 | private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByIndex(IntPtr eventdescription, int index, int labelindex, IntPtr label, int size, out int retrieved); | ||
1236 | [DllImport(STUDIO_VERSION.dll)] | ||
1237 | private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByName(IntPtr eventdescription, byte[] name, int labelindex, IntPtr label, int size, out int retrieved); | ||
1238 | [DllImport(STUDIO_VERSION.dll)] | ||
1239 | private static extern RESULT FMOD_Studio_EventDescription_GetParameterLabelByID (IntPtr eventdescription, PARAMETER_ID id, int labelindex, IntPtr label, int size, out int retrieved); | ||
1240 | [DllImport(STUDIO_VERSION.dll)] | ||
1241 | private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyCount (IntPtr eventdescription, out int count); | ||
1242 | [DllImport(STUDIO_VERSION.dll)] | ||
1243 | private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyByIndex(IntPtr eventdescription, int index, out USER_PROPERTY property); | ||
1244 | [DllImport(STUDIO_VERSION.dll)] | ||
1245 | private static extern RESULT FMOD_Studio_EventDescription_GetUserProperty (IntPtr eventdescription, byte[] name, out USER_PROPERTY property); | ||
1246 | [DllImport(STUDIO_VERSION.dll)] | ||
1247 | private static extern RESULT FMOD_Studio_EventDescription_GetLength (IntPtr eventdescription, out int length); | ||
1248 | [DllImport(STUDIO_VERSION.dll)] | ||
1249 | private static extern RESULT FMOD_Studio_EventDescription_GetMinMaxDistance (IntPtr eventdescription, out float min, out float max); | ||
1250 | [DllImport(STUDIO_VERSION.dll)] | ||
1251 | private static extern RESULT FMOD_Studio_EventDescription_GetSoundSize (IntPtr eventdescription, out float size); | ||
1252 | [DllImport(STUDIO_VERSION.dll)] | ||
1253 | private static extern RESULT FMOD_Studio_EventDescription_IsSnapshot (IntPtr eventdescription, out bool snapshot); | ||
1254 | [DllImport(STUDIO_VERSION.dll)] | ||
1255 | private static extern RESULT FMOD_Studio_EventDescription_IsOneshot (IntPtr eventdescription, out bool oneshot); | ||
1256 | [DllImport(STUDIO_VERSION.dll)] | ||
1257 | private static extern RESULT FMOD_Studio_EventDescription_IsStream (IntPtr eventdescription, out bool isStream); | ||
1258 | [DllImport(STUDIO_VERSION.dll)] | ||
1259 | private static extern RESULT FMOD_Studio_EventDescription_Is3D (IntPtr eventdescription, out bool is3D); | ||
1260 | [DllImport(STUDIO_VERSION.dll)] | ||
1261 | private static extern RESULT FMOD_Studio_EventDescription_IsDopplerEnabled (IntPtr eventdescription, out bool doppler); | ||
1262 | [DllImport(STUDIO_VERSION.dll)] | ||
1263 | private static extern RESULT FMOD_Studio_EventDescription_HasSustainPoint (IntPtr eventdescription, out bool sustainPoint); | ||
1264 | [DllImport(STUDIO_VERSION.dll)] | ||
1265 | private static extern RESULT FMOD_Studio_EventDescription_CreateInstance (IntPtr eventdescription, out IntPtr instance); | ||
1266 | [DllImport(STUDIO_VERSION.dll)] | ||
1267 | private static extern RESULT FMOD_Studio_EventDescription_GetInstanceCount (IntPtr eventdescription, out int count); | ||
1268 | [DllImport(STUDIO_VERSION.dll)] | ||
1269 | private static extern RESULT FMOD_Studio_EventDescription_GetInstanceList (IntPtr eventdescription, IntPtr[] array, int capacity, out int count); | ||
1270 | [DllImport(STUDIO_VERSION.dll)] | ||
1271 | private static extern RESULT FMOD_Studio_EventDescription_LoadSampleData (IntPtr eventdescription); | ||
1272 | [DllImport(STUDIO_VERSION.dll)] | ||
1273 | private static extern RESULT FMOD_Studio_EventDescription_UnloadSampleData (IntPtr eventdescription); | ||
1274 | [DllImport(STUDIO_VERSION.dll)] | ||
1275 | private static extern RESULT FMOD_Studio_EventDescription_GetSampleLoadingState (IntPtr eventdescription, out LOADING_STATE state); | ||
1276 | [DllImport(STUDIO_VERSION.dll)] | ||
1277 | private static extern RESULT FMOD_Studio_EventDescription_ReleaseAllInstances (IntPtr eventdescription); | ||
1278 | [DllImport(STUDIO_VERSION.dll)] | ||
1279 | private static extern RESULT FMOD_Studio_EventDescription_SetCallback (IntPtr eventdescription, EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask); | ||
1280 | [DllImport(STUDIO_VERSION.dll)] | ||
1281 | private static extern RESULT FMOD_Studio_EventDescription_GetUserData (IntPtr eventdescription, out IntPtr userdata); | ||
1282 | [DllImport(STUDIO_VERSION.dll)] | ||
1283 | private static extern RESULT FMOD_Studio_EventDescription_SetUserData (IntPtr eventdescription, IntPtr userdata); | ||
1284 | #endregion | ||
1285 | #region wrapperinternal | ||
1286 | |||
1287 | public IntPtr handle; | ||
1288 | |||
1289 | public EventDescription(IntPtr ptr) { this.handle = ptr; } | ||
1290 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
1291 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
1292 | |||
1293 | public bool isValid() | ||
1294 | { | ||
1295 | return hasHandle() && FMOD_Studio_EventDescription_IsValid(this.handle); | ||
1296 | } | ||
1297 | |||
1298 | #endregion | ||
1299 | } | ||
1300 | |||
1301 | public struct EventInstance | ||
1302 | { | ||
1303 | public RESULT getDescription(out EventDescription description) | ||
1304 | { | ||
1305 | return FMOD_Studio_EventInstance_GetDescription(this.handle, out description.handle); | ||
1306 | } | ||
1307 | public RESULT getVolume(out float volume) | ||
1308 | { | ||
1309 | return FMOD_Studio_EventInstance_GetVolume(this.handle, out volume, IntPtr.Zero); | ||
1310 | } | ||
1311 | public RESULT getVolume(out float volume, out float finalvolume) | ||
1312 | { | ||
1313 | return FMOD_Studio_EventInstance_GetVolume(this.handle, out volume, out finalvolume); | ||
1314 | } | ||
1315 | public RESULT setVolume(float volume) | ||
1316 | { | ||
1317 | return FMOD_Studio_EventInstance_SetVolume(this.handle, volume); | ||
1318 | } | ||
1319 | public RESULT getPitch(out float pitch) | ||
1320 | { | ||
1321 | return FMOD_Studio_EventInstance_GetPitch(this.handle, out pitch, IntPtr.Zero); | ||
1322 | } | ||
1323 | public RESULT getPitch(out float pitch, out float finalpitch) | ||
1324 | { | ||
1325 | return FMOD_Studio_EventInstance_GetPitch(this.handle, out pitch, out finalpitch); | ||
1326 | } | ||
1327 | public RESULT setPitch(float pitch) | ||
1328 | { | ||
1329 | return FMOD_Studio_EventInstance_SetPitch(this.handle, pitch); | ||
1330 | } | ||
1331 | public RESULT get3DAttributes(out ATTRIBUTES_3D attributes) | ||
1332 | { | ||
1333 | return FMOD_Studio_EventInstance_Get3DAttributes(this.handle, out attributes); | ||
1334 | } | ||
1335 | public RESULT set3DAttributes(ATTRIBUTES_3D attributes) | ||
1336 | { | ||
1337 | return FMOD_Studio_EventInstance_Set3DAttributes(this.handle, ref attributes); | ||
1338 | } | ||
1339 | public RESULT getListenerMask(out uint mask) | ||
1340 | { | ||
1341 | return FMOD_Studio_EventInstance_GetListenerMask(this.handle, out mask); | ||
1342 | } | ||
1343 | public RESULT setListenerMask(uint mask) | ||
1344 | { | ||
1345 | return FMOD_Studio_EventInstance_SetListenerMask(this.handle, mask); | ||
1346 | } | ||
1347 | public RESULT getProperty(EVENT_PROPERTY index, out float value) | ||
1348 | { | ||
1349 | return FMOD_Studio_EventInstance_GetProperty(this.handle, index, out value); | ||
1350 | } | ||
1351 | public RESULT setProperty(EVENT_PROPERTY index, float value) | ||
1352 | { | ||
1353 | return FMOD_Studio_EventInstance_SetProperty(this.handle, index, value); | ||
1354 | } | ||
1355 | public RESULT getReverbLevel(int index, out float level) | ||
1356 | { | ||
1357 | return FMOD_Studio_EventInstance_GetReverbLevel(this.handle, index, out level); | ||
1358 | } | ||
1359 | public RESULT setReverbLevel(int index, float level) | ||
1360 | { | ||
1361 | return FMOD_Studio_EventInstance_SetReverbLevel(this.handle, index, level); | ||
1362 | } | ||
1363 | public RESULT getPaused(out bool paused) | ||
1364 | { | ||
1365 | return FMOD_Studio_EventInstance_GetPaused(this.handle, out paused); | ||
1366 | } | ||
1367 | public RESULT setPaused(bool paused) | ||
1368 | { | ||
1369 | return FMOD_Studio_EventInstance_SetPaused(this.handle, paused); | ||
1370 | } | ||
1371 | public RESULT start() | ||
1372 | { | ||
1373 | return FMOD_Studio_EventInstance_Start(this.handle); | ||
1374 | } | ||
1375 | public RESULT stop(STOP_MODE mode) | ||
1376 | { | ||
1377 | return FMOD_Studio_EventInstance_Stop(this.handle, mode); | ||
1378 | } | ||
1379 | public RESULT getTimelinePosition(out int position) | ||
1380 | { | ||
1381 | return FMOD_Studio_EventInstance_GetTimelinePosition(this.handle, out position); | ||
1382 | } | ||
1383 | public RESULT setTimelinePosition(int position) | ||
1384 | { | ||
1385 | return FMOD_Studio_EventInstance_SetTimelinePosition(this.handle, position); | ||
1386 | } | ||
1387 | public RESULT getPlaybackState(out PLAYBACK_STATE state) | ||
1388 | { | ||
1389 | return FMOD_Studio_EventInstance_GetPlaybackState(this.handle, out state); | ||
1390 | } | ||
1391 | public RESULT getChannelGroup(out FMOD.ChannelGroup group) | ||
1392 | { | ||
1393 | return FMOD_Studio_EventInstance_GetChannelGroup(this.handle, out group.handle); | ||
1394 | } | ||
1395 | public RESULT getMinMaxDistance(out float min, out float max) | ||
1396 | { | ||
1397 | return FMOD_Studio_EventInstance_GetMinMaxDistance(this.handle, out min, out max); | ||
1398 | } | ||
1399 | public RESULT release() | ||
1400 | { | ||
1401 | return FMOD_Studio_EventInstance_Release(this.handle); | ||
1402 | } | ||
1403 | public RESULT isVirtual(out bool virtualstate) | ||
1404 | { | ||
1405 | return FMOD_Studio_EventInstance_IsVirtual(this.handle, out virtualstate); | ||
1406 | } | ||
1407 | public RESULT getParameterByID(PARAMETER_ID id, out float value) | ||
1408 | { | ||
1409 | float finalvalue; | ||
1410 | return getParameterByID(id, out value, out finalvalue); | ||
1411 | } | ||
1412 | public RESULT getParameterByID(PARAMETER_ID id, out float value, out float finalvalue) | ||
1413 | { | ||
1414 | return FMOD_Studio_EventInstance_GetParameterByID(this.handle, id, out value, out finalvalue); | ||
1415 | } | ||
1416 | public RESULT setParameterByID(PARAMETER_ID id, float value, bool ignoreseekspeed = false) | ||
1417 | { | ||
1418 | return FMOD_Studio_EventInstance_SetParameterByID(this.handle, id, value, ignoreseekspeed); | ||
1419 | } | ||
1420 | public RESULT setParameterByIDWithLabel(PARAMETER_ID id, string label, bool ignoreseekspeed = false) | ||
1421 | { | ||
1422 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1423 | { | ||
1424 | return FMOD_Studio_EventInstance_SetParameterByIDWithLabel(this.handle, id, encoder.byteFromStringUTF8(label), ignoreseekspeed); | ||
1425 | } | ||
1426 | } | ||
1427 | public RESULT setParametersByIDs(PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed = false) | ||
1428 | { | ||
1429 | return FMOD_Studio_EventInstance_SetParametersByIDs(this.handle, ids, values, count, ignoreseekspeed); | ||
1430 | } | ||
1431 | public RESULT getParameterByName(string name, out float value) | ||
1432 | { | ||
1433 | float finalValue; | ||
1434 | return getParameterByName(name, out value, out finalValue); | ||
1435 | } | ||
1436 | public RESULT getParameterByName(string name, out float value, out float finalvalue) | ||
1437 | { | ||
1438 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1439 | { | ||
1440 | return FMOD_Studio_EventInstance_GetParameterByName(this.handle, encoder.byteFromStringUTF8(name), out value, out finalvalue); | ||
1441 | } | ||
1442 | } | ||
1443 | public RESULT setParameterByName(string name, float value, bool ignoreseekspeed = false) | ||
1444 | { | ||
1445 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1446 | { | ||
1447 | return FMOD_Studio_EventInstance_SetParameterByName(this.handle, encoder.byteFromStringUTF8(name), value, ignoreseekspeed); | ||
1448 | } | ||
1449 | } | ||
1450 | public RESULT setParameterByNameWithLabel(string name, string label, bool ignoreseekspeed = false) | ||
1451 | { | ||
1452 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper(), | ||
1453 | labelEncoder = StringHelper.GetFreeHelper()) | ||
1454 | { | ||
1455 | return FMOD_Studio_EventInstance_SetParameterByNameWithLabel(this.handle, encoder.byteFromStringUTF8(name), labelEncoder.byteFromStringUTF8(label), ignoreseekspeed); | ||
1456 | } | ||
1457 | } | ||
1458 | public RESULT keyOff() | ||
1459 | { | ||
1460 | return FMOD_Studio_EventInstance_KeyOff(this.handle); | ||
1461 | } | ||
1462 | public RESULT setCallback(EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL) | ||
1463 | { | ||
1464 | return FMOD_Studio_EventInstance_SetCallback(this.handle, callback, callbackmask); | ||
1465 | } | ||
1466 | public RESULT getUserData(out IntPtr userdata) | ||
1467 | { | ||
1468 | return FMOD_Studio_EventInstance_GetUserData(this.handle, out userdata); | ||
1469 | } | ||
1470 | public RESULT setUserData(IntPtr userdata) | ||
1471 | { | ||
1472 | return FMOD_Studio_EventInstance_SetUserData(this.handle, userdata); | ||
1473 | } | ||
1474 | public RESULT getCPUUsage(out uint exclusive, out uint inclusive) | ||
1475 | { | ||
1476 | return FMOD_Studio_EventInstance_GetCPUUsage(this.handle, out exclusive, out inclusive); | ||
1477 | } | ||
1478 | public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) | ||
1479 | { | ||
1480 | return FMOD_Studio_EventInstance_GetMemoryUsage(this.handle, out memoryusage); | ||
1481 | } | ||
1482 | #region importfunctions | ||
1483 | [DllImport(STUDIO_VERSION.dll)] | ||
1484 | private static extern bool FMOD_Studio_EventInstance_IsValid (IntPtr _event); | ||
1485 | [DllImport(STUDIO_VERSION.dll)] | ||
1486 | private static extern RESULT FMOD_Studio_EventInstance_GetDescription (IntPtr _event, out IntPtr description); | ||
1487 | [DllImport(STUDIO_VERSION.dll)] | ||
1488 | private static extern RESULT FMOD_Studio_EventInstance_GetVolume (IntPtr _event, out float volume, IntPtr zero); | ||
1489 | [DllImport(STUDIO_VERSION.dll)] | ||
1490 | private static extern RESULT FMOD_Studio_EventInstance_GetVolume (IntPtr _event, out float volume, out float finalvolume); | ||
1491 | [DllImport(STUDIO_VERSION.dll)] | ||
1492 | private static extern RESULT FMOD_Studio_EventInstance_SetVolume (IntPtr _event, float volume); | ||
1493 | [DllImport(STUDIO_VERSION.dll)] | ||
1494 | private static extern RESULT FMOD_Studio_EventInstance_GetPitch (IntPtr _event, out float pitch, IntPtr zero); | ||
1495 | [DllImport(STUDIO_VERSION.dll)] | ||
1496 | private static extern RESULT FMOD_Studio_EventInstance_GetPitch (IntPtr _event, out float pitch, out float finalpitch); | ||
1497 | [DllImport(STUDIO_VERSION.dll)] | ||
1498 | private static extern RESULT FMOD_Studio_EventInstance_SetPitch (IntPtr _event, float pitch); | ||
1499 | [DllImport(STUDIO_VERSION.dll)] | ||
1500 | private static extern RESULT FMOD_Studio_EventInstance_Get3DAttributes (IntPtr _event, out ATTRIBUTES_3D attributes); | ||
1501 | [DllImport(STUDIO_VERSION.dll)] | ||
1502 | private static extern RESULT FMOD_Studio_EventInstance_Set3DAttributes (IntPtr _event, ref ATTRIBUTES_3D attributes); | ||
1503 | [DllImport(STUDIO_VERSION.dll)] | ||
1504 | private static extern RESULT FMOD_Studio_EventInstance_GetListenerMask (IntPtr _event, out uint mask); | ||
1505 | [DllImport(STUDIO_VERSION.dll)] | ||
1506 | private static extern RESULT FMOD_Studio_EventInstance_SetListenerMask (IntPtr _event, uint mask); | ||
1507 | [DllImport(STUDIO_VERSION.dll)] | ||
1508 | private static extern RESULT FMOD_Studio_EventInstance_GetProperty (IntPtr _event, EVENT_PROPERTY index, out float value); | ||
1509 | [DllImport(STUDIO_VERSION.dll)] | ||
1510 | private static extern RESULT FMOD_Studio_EventInstance_SetProperty (IntPtr _event, EVENT_PROPERTY index, float value); | ||
1511 | [DllImport(STUDIO_VERSION.dll)] | ||
1512 | private static extern RESULT FMOD_Studio_EventInstance_GetReverbLevel (IntPtr _event, int index, out float level); | ||
1513 | [DllImport(STUDIO_VERSION.dll)] | ||
1514 | private static extern RESULT FMOD_Studio_EventInstance_SetReverbLevel (IntPtr _event, int index, float level); | ||
1515 | [DllImport(STUDIO_VERSION.dll)] | ||
1516 | private static extern RESULT FMOD_Studio_EventInstance_GetPaused (IntPtr _event, out bool paused); | ||
1517 | [DllImport(STUDIO_VERSION.dll)] | ||
1518 | private static extern RESULT FMOD_Studio_EventInstance_SetPaused (IntPtr _event, bool paused); | ||
1519 | [DllImport(STUDIO_VERSION.dll)] | ||
1520 | private static extern RESULT FMOD_Studio_EventInstance_Start (IntPtr _event); | ||
1521 | [DllImport(STUDIO_VERSION.dll)] | ||
1522 | private static extern RESULT FMOD_Studio_EventInstance_Stop (IntPtr _event, STOP_MODE mode); | ||
1523 | [DllImport(STUDIO_VERSION.dll)] | ||
1524 | private static extern RESULT FMOD_Studio_EventInstance_GetTimelinePosition (IntPtr _event, out int position); | ||
1525 | [DllImport(STUDIO_VERSION.dll)] | ||
1526 | private static extern RESULT FMOD_Studio_EventInstance_SetTimelinePosition (IntPtr _event, int position); | ||
1527 | [DllImport(STUDIO_VERSION.dll)] | ||
1528 | private static extern RESULT FMOD_Studio_EventInstance_GetPlaybackState (IntPtr _event, out PLAYBACK_STATE state); | ||
1529 | [DllImport(STUDIO_VERSION.dll)] | ||
1530 | private static extern RESULT FMOD_Studio_EventInstance_GetChannelGroup (IntPtr _event, out IntPtr group); | ||
1531 | [DllImport(STUDIO_VERSION.dll)] | ||
1532 | private static extern RESULT FMOD_Studio_EventInstance_GetMinMaxDistance (IntPtr _event, out float min, out float max); | ||
1533 | [DllImport(STUDIO_VERSION.dll)] | ||
1534 | private static extern RESULT FMOD_Studio_EventInstance_Release (IntPtr _event); | ||
1535 | [DllImport(STUDIO_VERSION.dll)] | ||
1536 | private static extern RESULT FMOD_Studio_EventInstance_IsVirtual (IntPtr _event, out bool virtualstate); | ||
1537 | [DllImport(STUDIO_VERSION.dll)] | ||
1538 | private static extern RESULT FMOD_Studio_EventInstance_GetParameterByName (IntPtr _event, byte[] name, out float value, out float finalvalue); | ||
1539 | [DllImport(STUDIO_VERSION.dll)] | ||
1540 | private static extern RESULT FMOD_Studio_EventInstance_SetParameterByName (IntPtr _event, byte[] name, float value, bool ignoreseekspeed); | ||
1541 | [DllImport(STUDIO_VERSION.dll)] | ||
1542 | private static extern RESULT FMOD_Studio_EventInstance_SetParameterByNameWithLabel (IntPtr _event, byte[] name, byte[] label, bool ignoreseekspeed); | ||
1543 | [DllImport(STUDIO_VERSION.dll)] | ||
1544 | private static extern RESULT FMOD_Studio_EventInstance_GetParameterByID (IntPtr _event, PARAMETER_ID id, out float value, out float finalvalue); | ||
1545 | [DllImport(STUDIO_VERSION.dll)] | ||
1546 | private static extern RESULT FMOD_Studio_EventInstance_SetParameterByID (IntPtr _event, PARAMETER_ID id, float value, bool ignoreseekspeed); | ||
1547 | [DllImport(STUDIO_VERSION.dll)] | ||
1548 | private static extern RESULT FMOD_Studio_EventInstance_SetParameterByIDWithLabel (IntPtr _event, PARAMETER_ID id, byte[] label, bool ignoreseekspeed); | ||
1549 | [DllImport(STUDIO_VERSION.dll)] | ||
1550 | private static extern RESULT FMOD_Studio_EventInstance_SetParametersByIDs (IntPtr _event, PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed); | ||
1551 | [DllImport(STUDIO_VERSION.dll)] | ||
1552 | private static extern RESULT FMOD_Studio_EventInstance_KeyOff (IntPtr _event); | ||
1553 | [DllImport(STUDIO_VERSION.dll)] | ||
1554 | private static extern RESULT FMOD_Studio_EventInstance_SetCallback (IntPtr _event, EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask); | ||
1555 | [DllImport (STUDIO_VERSION.dll)] | ||
1556 | private static extern RESULT FMOD_Studio_EventInstance_GetUserData (IntPtr _event, out IntPtr userdata); | ||
1557 | [DllImport (STUDIO_VERSION.dll)] | ||
1558 | private static extern RESULT FMOD_Studio_EventInstance_SetUserData (IntPtr _event, IntPtr userdata); | ||
1559 | [DllImport (STUDIO_VERSION.dll)] | ||
1560 | private static extern RESULT FMOD_Studio_EventInstance_GetCPUUsage (IntPtr _event, out uint exclusive, out uint inclusive); | ||
1561 | [DllImport(STUDIO_VERSION.dll)] | ||
1562 | private static extern RESULT FMOD_Studio_EventInstance_GetMemoryUsage (IntPtr _event, out MEMORY_USAGE memoryusage); | ||
1563 | #endregion | ||
1564 | |||
1565 | #region wrapperinternal | ||
1566 | |||
1567 | public IntPtr handle; | ||
1568 | |||
1569 | public EventInstance(IntPtr ptr) { this.handle = ptr; } | ||
1570 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
1571 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
1572 | |||
1573 | public bool isValid() | ||
1574 | { | ||
1575 | return hasHandle() && FMOD_Studio_EventInstance_IsValid(this.handle); | ||
1576 | } | ||
1577 | |||
1578 | #endregion | ||
1579 | } | ||
1580 | |||
1581 | public struct Bus | ||
1582 | { | ||
1583 | public RESULT getID(out GUID id) | ||
1584 | { | ||
1585 | return FMOD_Studio_Bus_GetID(this.handle, out id); | ||
1586 | } | ||
1587 | public RESULT getPath(out string path) | ||
1588 | { | ||
1589 | path = null; | ||
1590 | |||
1591 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1592 | { | ||
1593 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
1594 | int retrieved = 0; | ||
1595 | RESULT result = FMOD_Studio_Bus_GetPath(this.handle, stringMem, 256, out retrieved); | ||
1596 | |||
1597 | if (result == RESULT.ERR_TRUNCATED) | ||
1598 | { | ||
1599 | Marshal.FreeHGlobal(stringMem); | ||
1600 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
1601 | result = FMOD_Studio_Bus_GetPath(this.handle, stringMem, retrieved, out retrieved); | ||
1602 | } | ||
1603 | |||
1604 | if (result == RESULT.OK) | ||
1605 | { | ||
1606 | path = encoder.stringFromNative(stringMem); | ||
1607 | } | ||
1608 | Marshal.FreeHGlobal(stringMem); | ||
1609 | return result; | ||
1610 | } | ||
1611 | |||
1612 | } | ||
1613 | public RESULT getVolume(out float volume) | ||
1614 | { | ||
1615 | float finalVolume; | ||
1616 | return getVolume(out volume, out finalVolume); | ||
1617 | } | ||
1618 | public RESULT getVolume(out float volume, out float finalvolume) | ||
1619 | { | ||
1620 | return FMOD_Studio_Bus_GetVolume(this.handle, out volume, out finalvolume); | ||
1621 | } | ||
1622 | public RESULT setVolume(float volume) | ||
1623 | { | ||
1624 | return FMOD_Studio_Bus_SetVolume(this.handle, volume); | ||
1625 | } | ||
1626 | public RESULT getPaused(out bool paused) | ||
1627 | { | ||
1628 | return FMOD_Studio_Bus_GetPaused(this.handle, out paused); | ||
1629 | } | ||
1630 | public RESULT setPaused(bool paused) | ||
1631 | { | ||
1632 | return FMOD_Studio_Bus_SetPaused(this.handle, paused); | ||
1633 | } | ||
1634 | public RESULT getMute(out bool mute) | ||
1635 | { | ||
1636 | return FMOD_Studio_Bus_GetMute(this.handle, out mute); | ||
1637 | } | ||
1638 | public RESULT setMute(bool mute) | ||
1639 | { | ||
1640 | return FMOD_Studio_Bus_SetMute(this.handle, mute); | ||
1641 | } | ||
1642 | public RESULT stopAllEvents(STOP_MODE mode) | ||
1643 | { | ||
1644 | return FMOD_Studio_Bus_StopAllEvents(this.handle, mode); | ||
1645 | } | ||
1646 | public RESULT lockChannelGroup() | ||
1647 | { | ||
1648 | return FMOD_Studio_Bus_LockChannelGroup(this.handle); | ||
1649 | } | ||
1650 | public RESULT unlockChannelGroup() | ||
1651 | { | ||
1652 | return FMOD_Studio_Bus_UnlockChannelGroup(this.handle); | ||
1653 | } | ||
1654 | public RESULT getChannelGroup(out FMOD.ChannelGroup group) | ||
1655 | { | ||
1656 | return FMOD_Studio_Bus_GetChannelGroup(this.handle, out group.handle); | ||
1657 | } | ||
1658 | public RESULT getCPUUsage(out uint exclusive, out uint inclusive) | ||
1659 | { | ||
1660 | return FMOD_Studio_Bus_GetCPUUsage(this.handle, out exclusive, out inclusive); | ||
1661 | } | ||
1662 | public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) | ||
1663 | { | ||
1664 | return FMOD_Studio_Bus_GetMemoryUsage(this.handle, out memoryusage); | ||
1665 | } | ||
1666 | public RESULT getPortIndex(out ulong index) | ||
1667 | { | ||
1668 | return FMOD_Studio_Bus_GetPortIndex(this.handle, out index); | ||
1669 | } | ||
1670 | public RESULT setPortIndex(ulong index) | ||
1671 | { | ||
1672 | return FMOD_Studio_Bus_SetPortIndex(this.handle, index); | ||
1673 | } | ||
1674 | |||
1675 | #region importfunctions | ||
1676 | [DllImport(STUDIO_VERSION.dll)] | ||
1677 | private static extern bool FMOD_Studio_Bus_IsValid (IntPtr bus); | ||
1678 | [DllImport(STUDIO_VERSION.dll)] | ||
1679 | private static extern RESULT FMOD_Studio_Bus_GetID (IntPtr bus, out GUID id); | ||
1680 | [DllImport(STUDIO_VERSION.dll)] | ||
1681 | private static extern RESULT FMOD_Studio_Bus_GetPath (IntPtr bus, IntPtr path, int size, out int retrieved); | ||
1682 | [DllImport(STUDIO_VERSION.dll)] | ||
1683 | private static extern RESULT FMOD_Studio_Bus_GetVolume (IntPtr bus, out float volume, out float finalvolume); | ||
1684 | [DllImport(STUDIO_VERSION.dll)] | ||
1685 | private static extern RESULT FMOD_Studio_Bus_SetVolume (IntPtr bus, float volume); | ||
1686 | [DllImport(STUDIO_VERSION.dll)] | ||
1687 | private static extern RESULT FMOD_Studio_Bus_GetPaused (IntPtr bus, out bool paused); | ||
1688 | [DllImport(STUDIO_VERSION.dll)] | ||
1689 | private static extern RESULT FMOD_Studio_Bus_SetPaused (IntPtr bus, bool paused); | ||
1690 | [DllImport(STUDIO_VERSION.dll)] | ||
1691 | private static extern RESULT FMOD_Studio_Bus_GetMute (IntPtr bus, out bool mute); | ||
1692 | [DllImport(STUDIO_VERSION.dll)] | ||
1693 | private static extern RESULT FMOD_Studio_Bus_SetMute (IntPtr bus, bool mute); | ||
1694 | [DllImport(STUDIO_VERSION.dll)] | ||
1695 | private static extern RESULT FMOD_Studio_Bus_StopAllEvents (IntPtr bus, STOP_MODE mode); | ||
1696 | [DllImport(STUDIO_VERSION.dll)] | ||
1697 | private static extern RESULT FMOD_Studio_Bus_LockChannelGroup (IntPtr bus); | ||
1698 | [DllImport(STUDIO_VERSION.dll)] | ||
1699 | private static extern RESULT FMOD_Studio_Bus_UnlockChannelGroup (IntPtr bus); | ||
1700 | [DllImport(STUDIO_VERSION.dll)] | ||
1701 | private static extern RESULT FMOD_Studio_Bus_GetChannelGroup (IntPtr bus, out IntPtr group); | ||
1702 | [DllImport(STUDIO_VERSION.dll)] | ||
1703 | private static extern RESULT FMOD_Studio_Bus_GetCPUUsage (IntPtr bus, out uint exclusive, out uint inclusive); | ||
1704 | [DllImport(STUDIO_VERSION.dll)] | ||
1705 | private static extern RESULT FMOD_Studio_Bus_GetMemoryUsage (IntPtr bus, out MEMORY_USAGE memoryusage); | ||
1706 | [DllImport(STUDIO_VERSION.dll)] | ||
1707 | private static extern RESULT FMOD_Studio_Bus_GetPortIndex (IntPtr bus, out ulong index); | ||
1708 | [DllImport(STUDIO_VERSION.dll)] | ||
1709 | private static extern RESULT FMOD_Studio_Bus_SetPortIndex (IntPtr bus, ulong index); | ||
1710 | #endregion | ||
1711 | |||
1712 | #region wrapperinternal | ||
1713 | |||
1714 | public IntPtr handle; | ||
1715 | |||
1716 | public Bus(IntPtr ptr) { this.handle = ptr; } | ||
1717 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
1718 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
1719 | |||
1720 | public bool isValid() | ||
1721 | { | ||
1722 | return hasHandle() && FMOD_Studio_Bus_IsValid(this.handle); | ||
1723 | } | ||
1724 | |||
1725 | #endregion | ||
1726 | } | ||
1727 | |||
1728 | public struct VCA | ||
1729 | { | ||
1730 | public RESULT getID(out GUID id) | ||
1731 | { | ||
1732 | return FMOD_Studio_VCA_GetID(this.handle, out id); | ||
1733 | } | ||
1734 | public RESULT getPath(out string path) | ||
1735 | { | ||
1736 | path = null; | ||
1737 | |||
1738 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1739 | { | ||
1740 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
1741 | int retrieved = 0; | ||
1742 | RESULT result = FMOD_Studio_VCA_GetPath(this.handle, stringMem, 256, out retrieved); | ||
1743 | |||
1744 | if (result == RESULT.ERR_TRUNCATED) | ||
1745 | { | ||
1746 | Marshal.FreeHGlobal(stringMem); | ||
1747 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
1748 | result = FMOD_Studio_VCA_GetPath(this.handle, stringMem, retrieved, out retrieved); | ||
1749 | } | ||
1750 | |||
1751 | if (result == RESULT.OK) | ||
1752 | { | ||
1753 | path = encoder.stringFromNative(stringMem); | ||
1754 | } | ||
1755 | Marshal.FreeHGlobal(stringMem); | ||
1756 | return result; | ||
1757 | } | ||
1758 | } | ||
1759 | public RESULT getVolume(out float volume) | ||
1760 | { | ||
1761 | float finalVolume; | ||
1762 | return getVolume(out volume, out finalVolume); | ||
1763 | } | ||
1764 | public RESULT getVolume(out float volume, out float finalvolume) | ||
1765 | { | ||
1766 | return FMOD_Studio_VCA_GetVolume(this.handle, out volume, out finalvolume); | ||
1767 | } | ||
1768 | public RESULT setVolume(float volume) | ||
1769 | { | ||
1770 | return FMOD_Studio_VCA_SetVolume(this.handle, volume); | ||
1771 | } | ||
1772 | |||
1773 | #region importfunctions | ||
1774 | [DllImport(STUDIO_VERSION.dll)] | ||
1775 | private static extern bool FMOD_Studio_VCA_IsValid (IntPtr vca); | ||
1776 | [DllImport(STUDIO_VERSION.dll)] | ||
1777 | private static extern RESULT FMOD_Studio_VCA_GetID (IntPtr vca, out GUID id); | ||
1778 | [DllImport(STUDIO_VERSION.dll)] | ||
1779 | private static extern RESULT FMOD_Studio_VCA_GetPath (IntPtr vca, IntPtr path, int size, out int retrieved); | ||
1780 | [DllImport(STUDIO_VERSION.dll)] | ||
1781 | private static extern RESULT FMOD_Studio_VCA_GetVolume (IntPtr vca, out float volume, out float finalvolume); | ||
1782 | [DllImport(STUDIO_VERSION.dll)] | ||
1783 | private static extern RESULT FMOD_Studio_VCA_SetVolume (IntPtr vca, float volume); | ||
1784 | #endregion | ||
1785 | |||
1786 | #region wrapperinternal | ||
1787 | |||
1788 | public IntPtr handle; | ||
1789 | |||
1790 | public VCA(IntPtr ptr) { this.handle = ptr; } | ||
1791 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
1792 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
1793 | |||
1794 | public bool isValid() | ||
1795 | { | ||
1796 | return hasHandle() && FMOD_Studio_VCA_IsValid(this.handle); | ||
1797 | } | ||
1798 | |||
1799 | #endregion | ||
1800 | } | ||
1801 | |||
1802 | public struct Bank | ||
1803 | { | ||
1804 | // Property access | ||
1805 | |||
1806 | public RESULT getID(out GUID id) | ||
1807 | { | ||
1808 | return FMOD_Studio_Bank_GetID(this.handle, out id); | ||
1809 | } | ||
1810 | public RESULT getPath(out string path) | ||
1811 | { | ||
1812 | path = null; | ||
1813 | |||
1814 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1815 | { | ||
1816 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
1817 | int retrieved = 0; | ||
1818 | RESULT result = FMOD_Studio_Bank_GetPath(this.handle, stringMem, 256, out retrieved); | ||
1819 | |||
1820 | if (result == RESULT.ERR_TRUNCATED) | ||
1821 | { | ||
1822 | Marshal.FreeHGlobal(stringMem); | ||
1823 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
1824 | result = FMOD_Studio_Bank_GetPath(this.handle, stringMem, retrieved, out retrieved); | ||
1825 | } | ||
1826 | |||
1827 | if (result == RESULT.OK) | ||
1828 | { | ||
1829 | path = encoder.stringFromNative(stringMem); | ||
1830 | } | ||
1831 | Marshal.FreeHGlobal(stringMem); | ||
1832 | return result; | ||
1833 | } | ||
1834 | } | ||
1835 | public RESULT unload() | ||
1836 | { | ||
1837 | return FMOD_Studio_Bank_Unload(this.handle); | ||
1838 | } | ||
1839 | public RESULT loadSampleData() | ||
1840 | { | ||
1841 | return FMOD_Studio_Bank_LoadSampleData(this.handle); | ||
1842 | } | ||
1843 | public RESULT unloadSampleData() | ||
1844 | { | ||
1845 | return FMOD_Studio_Bank_UnloadSampleData(this.handle); | ||
1846 | } | ||
1847 | public RESULT getLoadingState(out LOADING_STATE state) | ||
1848 | { | ||
1849 | return FMOD_Studio_Bank_GetLoadingState(this.handle, out state); | ||
1850 | } | ||
1851 | public RESULT getSampleLoadingState(out LOADING_STATE state) | ||
1852 | { | ||
1853 | return FMOD_Studio_Bank_GetSampleLoadingState(this.handle, out state); | ||
1854 | } | ||
1855 | |||
1856 | // Enumeration | ||
1857 | public RESULT getStringCount(out int count) | ||
1858 | { | ||
1859 | return FMOD_Studio_Bank_GetStringCount(this.handle, out count); | ||
1860 | } | ||
1861 | public RESULT getStringInfo(int index, out GUID id, out string path) | ||
1862 | { | ||
1863 | path = null; | ||
1864 | id = new GUID(); | ||
1865 | |||
1866 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
1867 | { | ||
1868 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
1869 | int retrieved = 0; | ||
1870 | RESULT result = FMOD_Studio_Bank_GetStringInfo(this.handle, index, out id, stringMem, 256, out retrieved); | ||
1871 | |||
1872 | if (result == RESULT.ERR_TRUNCATED) | ||
1873 | { | ||
1874 | Marshal.FreeHGlobal(stringMem); | ||
1875 | stringMem = Marshal.AllocHGlobal(retrieved); | ||
1876 | result = FMOD_Studio_Bank_GetStringInfo(this.handle, index, out id, stringMem, retrieved, out retrieved); | ||
1877 | } | ||
1878 | |||
1879 | if (result == RESULT.OK) | ||
1880 | { | ||
1881 | path = encoder.stringFromNative(stringMem); | ||
1882 | } | ||
1883 | Marshal.FreeHGlobal(stringMem); | ||
1884 | return result; | ||
1885 | } | ||
1886 | } | ||
1887 | |||
1888 | public RESULT getEventCount(out int count) | ||
1889 | { | ||
1890 | return FMOD_Studio_Bank_GetEventCount(this.handle, out count); | ||
1891 | } | ||
1892 | public RESULT getEventList(out EventDescription[] array) | ||
1893 | { | ||
1894 | array = null; | ||
1895 | |||
1896 | RESULT result; | ||
1897 | int capacity; | ||
1898 | result = FMOD_Studio_Bank_GetEventCount(this.handle, out capacity); | ||
1899 | if (result != RESULT.OK) | ||
1900 | { | ||
1901 | return result; | ||
1902 | } | ||
1903 | if (capacity == 0) | ||
1904 | { | ||
1905 | array = new EventDescription[0]; | ||
1906 | return result; | ||
1907 | } | ||
1908 | |||
1909 | IntPtr[] rawArray = new IntPtr[capacity]; | ||
1910 | int actualCount; | ||
1911 | result = FMOD_Studio_Bank_GetEventList(this.handle, rawArray, capacity, out actualCount); | ||
1912 | if (result != RESULT.OK) | ||
1913 | { | ||
1914 | return result; | ||
1915 | } | ||
1916 | if (actualCount > capacity) // More items added since we queried just now? | ||
1917 | { | ||
1918 | actualCount = capacity; | ||
1919 | } | ||
1920 | array = new EventDescription[actualCount]; | ||
1921 | for (int i = 0; i < actualCount; ++i) | ||
1922 | { | ||
1923 | array[i].handle = rawArray[i]; | ||
1924 | } | ||
1925 | return RESULT.OK; | ||
1926 | } | ||
1927 | public RESULT getBusCount(out int count) | ||
1928 | { | ||
1929 | return FMOD_Studio_Bank_GetBusCount(this.handle, out count); | ||
1930 | } | ||
1931 | public RESULT getBusList(out Bus[] array) | ||
1932 | { | ||
1933 | array = null; | ||
1934 | |||
1935 | RESULT result; | ||
1936 | int capacity; | ||
1937 | result = FMOD_Studio_Bank_GetBusCount(this.handle, out capacity); | ||
1938 | if (result != RESULT.OK) | ||
1939 | { | ||
1940 | return result; | ||
1941 | } | ||
1942 | if (capacity == 0) | ||
1943 | { | ||
1944 | array = new Bus[0]; | ||
1945 | return result; | ||
1946 | } | ||
1947 | |||
1948 | IntPtr[] rawArray = new IntPtr[capacity]; | ||
1949 | int actualCount; | ||
1950 | result = FMOD_Studio_Bank_GetBusList(this.handle, rawArray, capacity, out actualCount); | ||
1951 | if (result != RESULT.OK) | ||
1952 | { | ||
1953 | return result; | ||
1954 | } | ||
1955 | if (actualCount > capacity) // More items added since we queried just now? | ||
1956 | { | ||
1957 | actualCount = capacity; | ||
1958 | } | ||
1959 | array = new Bus[actualCount]; | ||
1960 | for (int i = 0; i < actualCount; ++i) | ||
1961 | { | ||
1962 | array[i].handle = rawArray[i]; | ||
1963 | } | ||
1964 | return RESULT.OK; | ||
1965 | } | ||
1966 | public RESULT getVCACount(out int count) | ||
1967 | { | ||
1968 | return FMOD_Studio_Bank_GetVCACount(this.handle, out count); | ||
1969 | } | ||
1970 | public RESULT getVCAList(out VCA[] array) | ||
1971 | { | ||
1972 | array = null; | ||
1973 | |||
1974 | RESULT result; | ||
1975 | int capacity; | ||
1976 | result = FMOD_Studio_Bank_GetVCACount(this.handle, out capacity); | ||
1977 | if (result != RESULT.OK) | ||
1978 | { | ||
1979 | return result; | ||
1980 | } | ||
1981 | if (capacity == 0) | ||
1982 | { | ||
1983 | array = new VCA[0]; | ||
1984 | return result; | ||
1985 | } | ||
1986 | |||
1987 | IntPtr[] rawArray = new IntPtr[capacity]; | ||
1988 | int actualCount; | ||
1989 | result = FMOD_Studio_Bank_GetVCAList(this.handle, rawArray, capacity, out actualCount); | ||
1990 | if (result != RESULT.OK) | ||
1991 | { | ||
1992 | return result; | ||
1993 | } | ||
1994 | if (actualCount > capacity) // More items added since we queried just now? | ||
1995 | { | ||
1996 | actualCount = capacity; | ||
1997 | } | ||
1998 | array = new VCA[actualCount]; | ||
1999 | for (int i = 0; i < actualCount; ++i) | ||
2000 | { | ||
2001 | array[i].handle = rawArray[i]; | ||
2002 | } | ||
2003 | return RESULT.OK; | ||
2004 | } | ||
2005 | |||
2006 | public RESULT getUserData(out IntPtr userdata) | ||
2007 | { | ||
2008 | return FMOD_Studio_Bank_GetUserData(this.handle, out userdata); | ||
2009 | } | ||
2010 | |||
2011 | public RESULT setUserData(IntPtr userdata) | ||
2012 | { | ||
2013 | return FMOD_Studio_Bank_SetUserData(this.handle, userdata); | ||
2014 | } | ||
2015 | |||
2016 | #region importfunctions | ||
2017 | [DllImport(STUDIO_VERSION.dll)] | ||
2018 | private static extern bool FMOD_Studio_Bank_IsValid (IntPtr bank); | ||
2019 | [DllImport(STUDIO_VERSION.dll)] | ||
2020 | private static extern RESULT FMOD_Studio_Bank_GetID (IntPtr bank, out GUID id); | ||
2021 | [DllImport(STUDIO_VERSION.dll)] | ||
2022 | private static extern RESULT FMOD_Studio_Bank_GetPath (IntPtr bank, IntPtr path, int size, out int retrieved); | ||
2023 | [DllImport(STUDIO_VERSION.dll)] | ||
2024 | private static extern RESULT FMOD_Studio_Bank_Unload (IntPtr bank); | ||
2025 | [DllImport(STUDIO_VERSION.dll)] | ||
2026 | private static extern RESULT FMOD_Studio_Bank_LoadSampleData (IntPtr bank); | ||
2027 | [DllImport(STUDIO_VERSION.dll)] | ||
2028 | private static extern RESULT FMOD_Studio_Bank_UnloadSampleData (IntPtr bank); | ||
2029 | [DllImport(STUDIO_VERSION.dll)] | ||
2030 | private static extern RESULT FMOD_Studio_Bank_GetLoadingState (IntPtr bank, out LOADING_STATE state); | ||
2031 | [DllImport(STUDIO_VERSION.dll)] | ||
2032 | private static extern RESULT FMOD_Studio_Bank_GetSampleLoadingState (IntPtr bank, out LOADING_STATE state); | ||
2033 | [DllImport(STUDIO_VERSION.dll)] | ||
2034 | private static extern RESULT FMOD_Studio_Bank_GetStringCount (IntPtr bank, out int count); | ||
2035 | [DllImport(STUDIO_VERSION.dll)] | ||
2036 | private static extern RESULT FMOD_Studio_Bank_GetStringInfo (IntPtr bank, int index, out GUID id, IntPtr path, int size, out int retrieved); | ||
2037 | [DllImport(STUDIO_VERSION.dll)] | ||
2038 | private static extern RESULT FMOD_Studio_Bank_GetEventCount (IntPtr bank, out int count); | ||
2039 | [DllImport(STUDIO_VERSION.dll)] | ||
2040 | private static extern RESULT FMOD_Studio_Bank_GetEventList (IntPtr bank, IntPtr[] array, int capacity, out int count); | ||
2041 | [DllImport(STUDIO_VERSION.dll)] | ||
2042 | private static extern RESULT FMOD_Studio_Bank_GetBusCount (IntPtr bank, out int count); | ||
2043 | [DllImport(STUDIO_VERSION.dll)] | ||
2044 | private static extern RESULT FMOD_Studio_Bank_GetBusList (IntPtr bank, IntPtr[] array, int capacity, out int count); | ||
2045 | [DllImport(STUDIO_VERSION.dll)] | ||
2046 | private static extern RESULT FMOD_Studio_Bank_GetVCACount (IntPtr bank, out int count); | ||
2047 | [DllImport(STUDIO_VERSION.dll)] | ||
2048 | private static extern RESULT FMOD_Studio_Bank_GetVCAList (IntPtr bank, IntPtr[] array, int capacity, out int count); | ||
2049 | [DllImport(STUDIO_VERSION.dll)] | ||
2050 | private static extern RESULT FMOD_Studio_Bank_GetUserData (IntPtr bank, out IntPtr userdata); | ||
2051 | [DllImport(STUDIO_VERSION.dll)] | ||
2052 | private static extern RESULT FMOD_Studio_Bank_SetUserData (IntPtr bank, IntPtr userdata); | ||
2053 | #endregion | ||
2054 | |||
2055 | #region wrapperinternal | ||
2056 | |||
2057 | public IntPtr handle; | ||
2058 | |||
2059 | public Bank(IntPtr ptr) { this.handle = ptr; } | ||
2060 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
2061 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
2062 | |||
2063 | public bool isValid() | ||
2064 | { | ||
2065 | return hasHandle() && FMOD_Studio_Bank_IsValid(this.handle); | ||
2066 | } | ||
2067 | |||
2068 | #endregion | ||
2069 | } | ||
2070 | |||
2071 | public struct CommandReplay | ||
2072 | { | ||
2073 | // Information query | ||
2074 | public RESULT getSystem(out System system) | ||
2075 | { | ||
2076 | return FMOD_Studio_CommandReplay_GetSystem(this.handle, out system.handle); | ||
2077 | } | ||
2078 | |||
2079 | public RESULT getLength(out float length) | ||
2080 | { | ||
2081 | return FMOD_Studio_CommandReplay_GetLength(this.handle, out length); | ||
2082 | } | ||
2083 | public RESULT getCommandCount(out int count) | ||
2084 | { | ||
2085 | return FMOD_Studio_CommandReplay_GetCommandCount(this.handle, out count); | ||
2086 | } | ||
2087 | public RESULT getCommandInfo(int commandIndex, out COMMAND_INFO info) | ||
2088 | { | ||
2089 | return FMOD_Studio_CommandReplay_GetCommandInfo(this.handle, commandIndex, out info); | ||
2090 | } | ||
2091 | |||
2092 | public RESULT getCommandString(int commandIndex, out string buffer) | ||
2093 | { | ||
2094 | buffer = null; | ||
2095 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
2096 | { | ||
2097 | int stringLength = 256; | ||
2098 | IntPtr stringMem = Marshal.AllocHGlobal(256); | ||
2099 | RESULT result = FMOD_Studio_CommandReplay_GetCommandString(this.handle, commandIndex, stringMem, stringLength); | ||
2100 | |||
2101 | while (result == RESULT.ERR_TRUNCATED) | ||
2102 | { | ||
2103 | Marshal.FreeHGlobal(stringMem); | ||
2104 | stringLength *= 2; | ||
2105 | stringMem = Marshal.AllocHGlobal(stringLength); | ||
2106 | result = FMOD_Studio_CommandReplay_GetCommandString(this.handle, commandIndex, stringMem, stringLength); | ||
2107 | } | ||
2108 | |||
2109 | if (result == RESULT.OK) | ||
2110 | { | ||
2111 | buffer = encoder.stringFromNative(stringMem); | ||
2112 | } | ||
2113 | Marshal.FreeHGlobal(stringMem); | ||
2114 | return result; | ||
2115 | } | ||
2116 | } | ||
2117 | public RESULT getCommandAtTime(float time, out int commandIndex) | ||
2118 | { | ||
2119 | return FMOD_Studio_CommandReplay_GetCommandAtTime(this.handle, time, out commandIndex); | ||
2120 | } | ||
2121 | // Playback | ||
2122 | public RESULT setBankPath(string bankPath) | ||
2123 | { | ||
2124 | using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) | ||
2125 | { | ||
2126 | return FMOD_Studio_CommandReplay_SetBankPath(this.handle, encoder.byteFromStringUTF8(bankPath)); | ||
2127 | } | ||
2128 | } | ||
2129 | public RESULT start() | ||
2130 | { | ||
2131 | return FMOD_Studio_CommandReplay_Start(this.handle); | ||
2132 | } | ||
2133 | public RESULT stop() | ||
2134 | { | ||
2135 | return FMOD_Studio_CommandReplay_Stop(this.handle); | ||
2136 | } | ||
2137 | public RESULT seekToTime(float time) | ||
2138 | { | ||
2139 | return FMOD_Studio_CommandReplay_SeekToTime(this.handle, time); | ||
2140 | } | ||
2141 | public RESULT seekToCommand(int commandIndex) | ||
2142 | { | ||
2143 | return FMOD_Studio_CommandReplay_SeekToCommand(this.handle, commandIndex); | ||
2144 | } | ||
2145 | public RESULT getPaused(out bool paused) | ||
2146 | { | ||
2147 | return FMOD_Studio_CommandReplay_GetPaused(this.handle, out paused); | ||
2148 | } | ||
2149 | public RESULT setPaused(bool paused) | ||
2150 | { | ||
2151 | return FMOD_Studio_CommandReplay_SetPaused(this.handle, paused); | ||
2152 | } | ||
2153 | public RESULT getPlaybackState(out PLAYBACK_STATE state) | ||
2154 | { | ||
2155 | return FMOD_Studio_CommandReplay_GetPlaybackState(this.handle, out state); | ||
2156 | } | ||
2157 | public RESULT getCurrentCommand(out int commandIndex, out float currentTime) | ||
2158 | { | ||
2159 | return FMOD_Studio_CommandReplay_GetCurrentCommand(this.handle, out commandIndex, out currentTime); | ||
2160 | } | ||
2161 | // Release | ||
2162 | public RESULT release() | ||
2163 | { | ||
2164 | return FMOD_Studio_CommandReplay_Release(this.handle); | ||
2165 | } | ||
2166 | // Callbacks | ||
2167 | public RESULT setFrameCallback(COMMANDREPLAY_FRAME_CALLBACK callback) | ||
2168 | { | ||
2169 | return FMOD_Studio_CommandReplay_SetFrameCallback(this.handle, callback); | ||
2170 | } | ||
2171 | public RESULT setLoadBankCallback(COMMANDREPLAY_LOAD_BANK_CALLBACK callback) | ||
2172 | { | ||
2173 | return FMOD_Studio_CommandReplay_SetLoadBankCallback(this.handle, callback); | ||
2174 | } | ||
2175 | public RESULT setCreateInstanceCallback(COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback) | ||
2176 | { | ||
2177 | return FMOD_Studio_CommandReplay_SetCreateInstanceCallback(this.handle, callback); | ||
2178 | } | ||
2179 | public RESULT getUserData(out IntPtr userdata) | ||
2180 | { | ||
2181 | return FMOD_Studio_CommandReplay_GetUserData(this.handle, out userdata); | ||
2182 | } | ||
2183 | public RESULT setUserData(IntPtr userdata) | ||
2184 | { | ||
2185 | return FMOD_Studio_CommandReplay_SetUserData(this.handle, userdata); | ||
2186 | } | ||
2187 | |||
2188 | #region importfunctions | ||
2189 | [DllImport(STUDIO_VERSION.dll)] | ||
2190 | private static extern bool FMOD_Studio_CommandReplay_IsValid (IntPtr replay); | ||
2191 | [DllImport(STUDIO_VERSION.dll)] | ||
2192 | private static extern RESULT FMOD_Studio_CommandReplay_GetSystem (IntPtr replay, out IntPtr system); | ||
2193 | [DllImport(STUDIO_VERSION.dll)] | ||
2194 | private static extern RESULT FMOD_Studio_CommandReplay_GetLength (IntPtr replay, out float length); | ||
2195 | [DllImport(STUDIO_VERSION.dll)] | ||
2196 | private static extern RESULT FMOD_Studio_CommandReplay_GetCommandCount (IntPtr replay, out int count); | ||
2197 | [DllImport(STUDIO_VERSION.dll)] | ||
2198 | private static extern RESULT FMOD_Studio_CommandReplay_GetCommandInfo (IntPtr replay, int commandindex, out COMMAND_INFO info); | ||
2199 | [DllImport(STUDIO_VERSION.dll)] | ||
2200 | private static extern RESULT FMOD_Studio_CommandReplay_GetCommandString (IntPtr replay, int commandIndex, IntPtr buffer, int length); | ||
2201 | [DllImport(STUDIO_VERSION.dll)] | ||
2202 | private static extern RESULT FMOD_Studio_CommandReplay_GetCommandAtTime (IntPtr replay, float time, out int commandIndex); | ||
2203 | [DllImport(STUDIO_VERSION.dll)] | ||
2204 | private static extern RESULT FMOD_Studio_CommandReplay_SetBankPath (IntPtr replay, byte[] bankPath); | ||
2205 | [DllImport(STUDIO_VERSION.dll)] | ||
2206 | private static extern RESULT FMOD_Studio_CommandReplay_Start (IntPtr replay); | ||
2207 | [DllImport(STUDIO_VERSION.dll)] | ||
2208 | private static extern RESULT FMOD_Studio_CommandReplay_Stop (IntPtr replay); | ||
2209 | [DllImport(STUDIO_VERSION.dll)] | ||
2210 | private static extern RESULT FMOD_Studio_CommandReplay_SeekToTime (IntPtr replay, float time); | ||
2211 | [DllImport(STUDIO_VERSION.dll)] | ||
2212 | private static extern RESULT FMOD_Studio_CommandReplay_SeekToCommand (IntPtr replay, int commandIndex); | ||
2213 | [DllImport(STUDIO_VERSION.dll)] | ||
2214 | private static extern RESULT FMOD_Studio_CommandReplay_GetPaused (IntPtr replay, out bool paused); | ||
2215 | [DllImport(STUDIO_VERSION.dll)] | ||
2216 | private static extern RESULT FMOD_Studio_CommandReplay_SetPaused (IntPtr replay, bool paused); | ||
2217 | [DllImport(STUDIO_VERSION.dll)] | ||
2218 | private static extern RESULT FMOD_Studio_CommandReplay_GetPlaybackState (IntPtr replay, out PLAYBACK_STATE state); | ||
2219 | [DllImport(STUDIO_VERSION.dll)] | ||
2220 | private static extern RESULT FMOD_Studio_CommandReplay_GetCurrentCommand (IntPtr replay, out int commandIndex, out float currentTime); | ||
2221 | [DllImport(STUDIO_VERSION.dll)] | ||
2222 | private static extern RESULT FMOD_Studio_CommandReplay_Release (IntPtr replay); | ||
2223 | [DllImport(STUDIO_VERSION.dll)] | ||
2224 | private static extern RESULT FMOD_Studio_CommandReplay_SetFrameCallback (IntPtr replay, COMMANDREPLAY_FRAME_CALLBACK callback); | ||
2225 | [DllImport(STUDIO_VERSION.dll)] | ||
2226 | private static extern RESULT FMOD_Studio_CommandReplay_SetLoadBankCallback (IntPtr replay, COMMANDREPLAY_LOAD_BANK_CALLBACK callback); | ||
2227 | [DllImport(STUDIO_VERSION.dll)] | ||
2228 | private static extern RESULT FMOD_Studio_CommandReplay_SetCreateInstanceCallback(IntPtr replay, COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback); | ||
2229 | [DllImport(STUDIO_VERSION.dll)] | ||
2230 | private static extern RESULT FMOD_Studio_CommandReplay_GetUserData (IntPtr replay, out IntPtr userdata); | ||
2231 | [DllImport(STUDIO_VERSION.dll)] | ||
2232 | private static extern RESULT FMOD_Studio_CommandReplay_SetUserData (IntPtr replay, IntPtr userdata); | ||
2233 | #endregion | ||
2234 | |||
2235 | #region wrapperinternal | ||
2236 | |||
2237 | public IntPtr handle; | ||
2238 | |||
2239 | public CommandReplay(IntPtr ptr) { this.handle = ptr; } | ||
2240 | public bool hasHandle() { return this.handle != IntPtr.Zero; } | ||
2241 | public void clearHandle() { this.handle = IntPtr.Zero; } | ||
2242 | |||
2243 | public bool isValid() | ||
2244 | { | ||
2245 | return hasHandle() && FMOD_Studio_CommandReplay_IsValid(this.handle); | ||
2246 | } | ||
2247 | |||
2248 | #endregion | ||
2249 | } | ||
2250 | } // 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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Studio API - C header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header in conjunction with fmod_studio_common.h (which contains all the */ | ||
6 | /* constants / callbacks) to develop using the C language. */ | ||
7 | /* */ | ||
8 | /* For more detail visit: */ | ||
9 | /* https://fmod.com/resources/documentation-api?version=2.0&page=page=studio-api.html */ | ||
10 | /* ======================================================================================== */ | ||
11 | #ifndef FMOD_STUDIO_H | ||
12 | #define FMOD_STUDIO_H | ||
13 | |||
14 | #include "fmod_studio_common.h" | ||
15 | |||
16 | #ifdef __cplusplus | ||
17 | extern "C" | ||
18 | { | ||
19 | #endif | ||
20 | |||
21 | /* | ||
22 | Global | ||
23 | */ | ||
24 | FMOD_RESULT F_API FMOD_Studio_ParseID(const char *idstring, FMOD_GUID *id); | ||
25 | FMOD_RESULT F_API FMOD_Studio_System_Create(FMOD_STUDIO_SYSTEM **system, unsigned int headerversion); | ||
26 | |||
27 | /* | ||
28 | System | ||
29 | */ | ||
30 | FMOD_BOOL F_API FMOD_Studio_System_IsValid(FMOD_STUDIO_SYSTEM *system); | ||
31 | FMOD_RESULT F_API FMOD_Studio_System_SetAdvancedSettings(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_ADVANCEDSETTINGS *settings); | ||
32 | FMOD_RESULT F_API FMOD_Studio_System_GetAdvancedSettings(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_ADVANCEDSETTINGS *settings); | ||
33 | FMOD_RESULT F_API FMOD_Studio_System_Initialize(FMOD_STUDIO_SYSTEM *system, int maxchannels, FMOD_STUDIO_INITFLAGS studioflags, FMOD_INITFLAGS flags, void *extradriverdata); | ||
34 | FMOD_RESULT F_API FMOD_Studio_System_Release(FMOD_STUDIO_SYSTEM *system); | ||
35 | FMOD_RESULT F_API FMOD_Studio_System_Update(FMOD_STUDIO_SYSTEM *system); | ||
36 | FMOD_RESULT F_API FMOD_Studio_System_GetCoreSystem(FMOD_STUDIO_SYSTEM *system, FMOD_SYSTEM **coresystem); | ||
37 | FMOD_RESULT F_API FMOD_Studio_System_GetEvent(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_EVENTDESCRIPTION **event); | ||
38 | FMOD_RESULT F_API FMOD_Studio_System_GetBus(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_BUS **bus); | ||
39 | FMOD_RESULT F_API FMOD_Studio_System_GetVCA(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_VCA **vca); | ||
40 | FMOD_RESULT F_API FMOD_Studio_System_GetBank(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_BANK **bank); | ||
41 | FMOD_RESULT F_API FMOD_Studio_System_GetEventByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_EVENTDESCRIPTION **event); | ||
42 | FMOD_RESULT F_API FMOD_Studio_System_GetBusByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_BUS **bus); | ||
43 | FMOD_RESULT F_API FMOD_Studio_System_GetVCAByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_VCA **vca); | ||
44 | FMOD_RESULT F_API FMOD_Studio_System_GetBankByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_BANK **bank); | ||
45 | FMOD_RESULT F_API FMOD_Studio_System_GetSoundInfo(FMOD_STUDIO_SYSTEM *system, const char *key, FMOD_STUDIO_SOUND_INFO *info); | ||
46 | FMOD_RESULT F_API FMOD_Studio_System_GetParameterDescriptionByName(FMOD_STUDIO_SYSTEM *system, const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); | ||
47 | FMOD_RESULT F_API FMOD_Studio_System_GetParameterDescriptionByID(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); | ||
48 | FMOD_RESULT F_API FMOD_Studio_System_GetParameterLabelByName(FMOD_STUDIO_SYSTEM *system, const char *name, int labelindex, char *label, int size, int *retrieved); | ||
49 | 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); | ||
50 | FMOD_RESULT F_API FMOD_Studio_System_GetParameterByID(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, float *value, float *finalvalue); | ||
51 | FMOD_RESULT F_API FMOD_Studio_System_SetParameterByID(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, float value, FMOD_BOOL ignoreseekspeed); | ||
52 | FMOD_RESULT F_API FMOD_Studio_System_SetParameterByIDWithLabel(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_ID id, const char *label, FMOD_BOOL ignoreseekspeed); | ||
53 | 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); | ||
54 | FMOD_RESULT F_API FMOD_Studio_System_GetParameterByName(FMOD_STUDIO_SYSTEM *system, const char *name, float *value, float *finalvalue); | ||
55 | FMOD_RESULT F_API FMOD_Studio_System_SetParameterByName(FMOD_STUDIO_SYSTEM *system, const char *name, float value, FMOD_BOOL ignoreseekspeed); | ||
56 | FMOD_RESULT F_API FMOD_Studio_System_SetParameterByNameWithLabel(FMOD_STUDIO_SYSTEM *system, const char *name, const char *label, FMOD_BOOL ignoreseekspeed); | ||
57 | FMOD_RESULT F_API FMOD_Studio_System_LookupID(FMOD_STUDIO_SYSTEM *system, const char *path, FMOD_GUID *id); | ||
58 | FMOD_RESULT F_API FMOD_Studio_System_LookupPath(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, char *path, int size, int *retrieved); | ||
59 | FMOD_RESULT F_API FMOD_Studio_System_GetNumListeners(FMOD_STUDIO_SYSTEM *system, int *numlisteners); | ||
60 | FMOD_RESULT F_API FMOD_Studio_System_SetNumListeners(FMOD_STUDIO_SYSTEM *system, int numlisteners); | ||
61 | FMOD_RESULT F_API FMOD_Studio_System_GetListenerAttributes(FMOD_STUDIO_SYSTEM *system, int index, FMOD_3D_ATTRIBUTES *attributes, FMOD_VECTOR *attenuationposition); | ||
62 | FMOD_RESULT F_API FMOD_Studio_System_SetListenerAttributes(FMOD_STUDIO_SYSTEM *system, int index, const FMOD_3D_ATTRIBUTES *attributes, const FMOD_VECTOR *attenuationposition); | ||
63 | FMOD_RESULT F_API FMOD_Studio_System_GetListenerWeight(FMOD_STUDIO_SYSTEM *system, int index, float *weight); | ||
64 | FMOD_RESULT F_API FMOD_Studio_System_SetListenerWeight(FMOD_STUDIO_SYSTEM *system, int index, float weight); | ||
65 | 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); | ||
66 | 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); | ||
67 | 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); | ||
68 | FMOD_RESULT F_API FMOD_Studio_System_RegisterPlugin(FMOD_STUDIO_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description); | ||
69 | FMOD_RESULT F_API FMOD_Studio_System_UnregisterPlugin(FMOD_STUDIO_SYSTEM *system, const char *name); | ||
70 | FMOD_RESULT F_API FMOD_Studio_System_UnloadAll(FMOD_STUDIO_SYSTEM *system); | ||
71 | FMOD_RESULT F_API FMOD_Studio_System_FlushCommands(FMOD_STUDIO_SYSTEM *system); | ||
72 | FMOD_RESULT F_API FMOD_Studio_System_FlushSampleLoading(FMOD_STUDIO_SYSTEM *system); | ||
73 | FMOD_RESULT F_API FMOD_Studio_System_StartCommandCapture(FMOD_STUDIO_SYSTEM *system, const char *filename, FMOD_STUDIO_COMMANDCAPTURE_FLAGS flags); | ||
74 | FMOD_RESULT F_API FMOD_Studio_System_StopCommandCapture(FMOD_STUDIO_SYSTEM *system); | ||
75 | FMOD_RESULT F_API FMOD_Studio_System_LoadCommandReplay(FMOD_STUDIO_SYSTEM *system, const char *filename, FMOD_STUDIO_COMMANDREPLAY_FLAGS flags, FMOD_STUDIO_COMMANDREPLAY **replay); | ||
76 | FMOD_RESULT F_API FMOD_Studio_System_GetBankCount(FMOD_STUDIO_SYSTEM *system, int *count); | ||
77 | FMOD_RESULT F_API FMOD_Studio_System_GetBankList(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_BANK **array, int capacity, int *count); | ||
78 | FMOD_RESULT F_API FMOD_Studio_System_GetParameterDescriptionCount(FMOD_STUDIO_SYSTEM *system, int *count); | ||
79 | FMOD_RESULT F_API FMOD_Studio_System_GetParameterDescriptionList(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_PARAMETER_DESCRIPTION *array, int capacity, int *count); | ||
80 | FMOD_RESULT F_API FMOD_Studio_System_GetCPUUsage(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_CPU_USAGE *usage, FMOD_CPU_USAGE *usage_core); | ||
81 | FMOD_RESULT F_API FMOD_Studio_System_GetBufferUsage(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_BUFFER_USAGE *usage); | ||
82 | FMOD_RESULT F_API FMOD_Studio_System_ResetBufferUsage(FMOD_STUDIO_SYSTEM *system); | ||
83 | FMOD_RESULT F_API FMOD_Studio_System_SetCallback(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_SYSTEM_CALLBACK callback, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE callbackmask); | ||
84 | FMOD_RESULT F_API FMOD_Studio_System_SetUserData(FMOD_STUDIO_SYSTEM *system, void *userdata); | ||
85 | FMOD_RESULT F_API FMOD_Studio_System_GetUserData(FMOD_STUDIO_SYSTEM *system, void **userdata); | ||
86 | FMOD_RESULT F_API FMOD_Studio_System_GetMemoryUsage(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_MEMORY_USAGE *memoryusage); | ||
87 | |||
88 | /* | ||
89 | EventDescription | ||
90 | */ | ||
91 | FMOD_BOOL F_API FMOD_Studio_EventDescription_IsValid(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription); | ||
92 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetID(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_GUID *id); | ||
93 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetPath(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, char *path, int size, int *retrieved); | ||
94 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterDescriptionCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count); | ||
95 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int index, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); | ||
96 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterDescriptionByName(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); | ||
97 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterDescriptionByID(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_PARAMETER_ID id, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter); | ||
98 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterLabelByIndex(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int index, int labelindex, char *label, int size, int *retrieved); | ||
99 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterLabelByName(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, const char *name, int labelindex, char *label, int size, int *retrieved); | ||
100 | 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); | ||
101 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserPropertyCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count); | ||
102 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserPropertyByIndex(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int index, FMOD_STUDIO_USER_PROPERTY *property); | ||
103 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserProperty(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, const char *name, FMOD_STUDIO_USER_PROPERTY *property); | ||
104 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetLength(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *length); | ||
105 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetMinMaxDistance(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, float *min, float *max); | ||
106 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetSoundSize(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, float *size); | ||
107 | FMOD_RESULT F_API FMOD_Studio_EventDescription_IsSnapshot(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *snapshot); | ||
108 | FMOD_RESULT F_API FMOD_Studio_EventDescription_IsOneshot(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *oneshot); | ||
109 | FMOD_RESULT F_API FMOD_Studio_EventDescription_IsStream(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *isStream); | ||
110 | FMOD_RESULT F_API FMOD_Studio_EventDescription_Is3D(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *is3D); | ||
111 | FMOD_RESULT F_API FMOD_Studio_EventDescription_IsDopplerEnabled(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *doppler); | ||
112 | FMOD_RESULT F_API FMOD_Studio_EventDescription_HasSustainPoint(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *sustainPoint); | ||
113 | FMOD_RESULT F_API FMOD_Studio_EventDescription_CreateInstance(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENTINSTANCE **instance); | ||
114 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetInstanceCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count); | ||
115 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetInstanceList(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENTINSTANCE **array, int capacity, int *count); | ||
116 | FMOD_RESULT F_API FMOD_Studio_EventDescription_LoadSampleData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription); | ||
117 | FMOD_RESULT F_API FMOD_Studio_EventDescription_UnloadSampleData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription); | ||
118 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetSampleLoadingState(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_LOADING_STATE *state); | ||
119 | FMOD_RESULT F_API FMOD_Studio_EventDescription_ReleaseAllInstances(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription); | ||
120 | FMOD_RESULT F_API FMOD_Studio_EventDescription_SetCallback(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask); | ||
121 | FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, void **userdata); | ||
122 | FMOD_RESULT F_API FMOD_Studio_EventDescription_SetUserData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, void *userdata); | ||
123 | |||
124 | /* | ||
125 | EventInstance | ||
126 | */ | ||
127 | FMOD_BOOL F_API FMOD_Studio_EventInstance_IsValid(FMOD_STUDIO_EVENTINSTANCE *eventinstance); | ||
128 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetDescription(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENTDESCRIPTION **description); | ||
129 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetVolume(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float *volume, float *finalvolume); | ||
130 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetVolume(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float volume); | ||
131 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPitch(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float *pitch, float *finalpitch); | ||
132 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetPitch(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float pitch); | ||
133 | FMOD_RESULT F_API FMOD_Studio_EventInstance_Get3DAttributes(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_3D_ATTRIBUTES *attributes); | ||
134 | FMOD_RESULT F_API FMOD_Studio_EventInstance_Set3DAttributes(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_3D_ATTRIBUTES *attributes); | ||
135 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetListenerMask(FMOD_STUDIO_EVENTINSTANCE *eventinstance, unsigned int *mask); | ||
136 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetListenerMask(FMOD_STUDIO_EVENTINSTANCE *eventinstance, unsigned int mask); | ||
137 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetProperty(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_PROPERTY index, float *value); | ||
138 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetProperty(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_PROPERTY index, float value); | ||
139 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetReverbLevel(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int index, float *level); | ||
140 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetReverbLevel(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int index, float level); | ||
141 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPaused(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL *paused); | ||
142 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetPaused(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL paused); | ||
143 | FMOD_RESULT F_API FMOD_Studio_EventInstance_Start(FMOD_STUDIO_EVENTINSTANCE *eventinstance); | ||
144 | FMOD_RESULT F_API FMOD_Studio_EventInstance_Stop(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_STOP_MODE mode); | ||
145 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetTimelinePosition(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int *position); | ||
146 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetTimelinePosition(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int position); | ||
147 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPlaybackState(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PLAYBACK_STATE *state); | ||
148 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetChannelGroup(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_CHANNELGROUP **group); | ||
149 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetMinMaxDistance(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float *min, float *max); | ||
150 | FMOD_RESULT F_API FMOD_Studio_EventInstance_Release(FMOD_STUDIO_EVENTINSTANCE *eventinstance); | ||
151 | FMOD_RESULT F_API FMOD_Studio_EventInstance_IsVirtual(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL *virtualstate); | ||
152 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetParameterByName(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, float *value, float *finalvalue); | ||
153 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterByName(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, float value, FMOD_BOOL ignoreseekspeed); | ||
154 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterByNameWithLabel(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, const char *label, FMOD_BOOL ignoreseekspeed); | ||
155 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetParameterByID(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PARAMETER_ID id, float *value, float *finalvalue); | ||
156 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterByID(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PARAMETER_ID id, float value, FMOD_BOOL ignoreseekspeed); | ||
157 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterByIDWithLabel(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PARAMETER_ID id, const char *label, FMOD_BOOL ignoreseekspeed); | ||
158 | 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); | ||
159 | FMOD_RESULT F_API FMOD_Studio_EventInstance_KeyOff(FMOD_STUDIO_EVENTINSTANCE *eventinstance); | ||
160 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetCallback(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask); | ||
161 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetUserData(FMOD_STUDIO_EVENTINSTANCE *eventinstance, void **userdata); | ||
162 | FMOD_RESULT F_API FMOD_Studio_EventInstance_SetUserData(FMOD_STUDIO_EVENTINSTANCE *eventinstance, void *userdata); | ||
163 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetCPUUsage(FMOD_STUDIO_EVENTINSTANCE *eventinstance, unsigned int *exclusive, unsigned int *inclusive); | ||
164 | FMOD_RESULT F_API FMOD_Studio_EventInstance_GetMemoryUsage(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_MEMORY_USAGE *memoryusage); | ||
165 | |||
166 | /* | ||
167 | Bus | ||
168 | */ | ||
169 | FMOD_BOOL F_API FMOD_Studio_Bus_IsValid(FMOD_STUDIO_BUS *bus); | ||
170 | FMOD_RESULT F_API FMOD_Studio_Bus_GetID(FMOD_STUDIO_BUS *bus, FMOD_GUID *id); | ||
171 | FMOD_RESULT F_API FMOD_Studio_Bus_GetPath(FMOD_STUDIO_BUS *bus, char *path, int size, int *retrieved); | ||
172 | FMOD_RESULT F_API FMOD_Studio_Bus_GetVolume(FMOD_STUDIO_BUS *bus, float *volume, float *finalvolume); | ||
173 | FMOD_RESULT F_API FMOD_Studio_Bus_SetVolume(FMOD_STUDIO_BUS *bus, float volume); | ||
174 | FMOD_RESULT F_API FMOD_Studio_Bus_GetPaused(FMOD_STUDIO_BUS *bus, FMOD_BOOL *paused); | ||
175 | FMOD_RESULT F_API FMOD_Studio_Bus_SetPaused(FMOD_STUDIO_BUS *bus, FMOD_BOOL paused); | ||
176 | FMOD_RESULT F_API FMOD_Studio_Bus_GetMute(FMOD_STUDIO_BUS *bus, FMOD_BOOL *mute); | ||
177 | FMOD_RESULT F_API FMOD_Studio_Bus_SetMute(FMOD_STUDIO_BUS *bus, FMOD_BOOL mute); | ||
178 | FMOD_RESULT F_API FMOD_Studio_Bus_StopAllEvents(FMOD_STUDIO_BUS *bus, FMOD_STUDIO_STOP_MODE mode); | ||
179 | FMOD_RESULT F_API FMOD_Studio_Bus_GetPortIndex(FMOD_STUDIO_BUS *bus, FMOD_PORT_INDEX *index); | ||
180 | FMOD_RESULT F_API FMOD_Studio_Bus_SetPortIndex(FMOD_STUDIO_BUS *bus, FMOD_PORT_INDEX index); | ||
181 | FMOD_RESULT F_API FMOD_Studio_Bus_LockChannelGroup(FMOD_STUDIO_BUS *bus); | ||
182 | FMOD_RESULT F_API FMOD_Studio_Bus_UnlockChannelGroup(FMOD_STUDIO_BUS *bus); | ||
183 | FMOD_RESULT F_API FMOD_Studio_Bus_GetChannelGroup(FMOD_STUDIO_BUS *bus, FMOD_CHANNELGROUP **group); | ||
184 | FMOD_RESULT F_API FMOD_Studio_Bus_GetCPUUsage(FMOD_STUDIO_BUS *bus, unsigned int *exclusive, unsigned int *inclusive); | ||
185 | FMOD_RESULT F_API FMOD_Studio_Bus_GetMemoryUsage(FMOD_STUDIO_BUS *bus, FMOD_STUDIO_MEMORY_USAGE *memoryusage); | ||
186 | |||
187 | /* | ||
188 | VCA | ||
189 | */ | ||
190 | FMOD_BOOL F_API FMOD_Studio_VCA_IsValid(FMOD_STUDIO_VCA *vca); | ||
191 | FMOD_RESULT F_API FMOD_Studio_VCA_GetID(FMOD_STUDIO_VCA *vca, FMOD_GUID *id); | ||
192 | FMOD_RESULT F_API FMOD_Studio_VCA_GetPath(FMOD_STUDIO_VCA *vca, char *path, int size, int *retrieved); | ||
193 | FMOD_RESULT F_API FMOD_Studio_VCA_GetVolume(FMOD_STUDIO_VCA *vca, float *volume, float *finalvolume); | ||
194 | FMOD_RESULT F_API FMOD_Studio_VCA_SetVolume(FMOD_STUDIO_VCA *vca, float volume); | ||
195 | |||
196 | /* | ||
197 | Bank | ||
198 | */ | ||
199 | FMOD_BOOL F_API FMOD_Studio_Bank_IsValid(FMOD_STUDIO_BANK *bank); | ||
200 | FMOD_RESULT F_API FMOD_Studio_Bank_GetID(FMOD_STUDIO_BANK *bank, FMOD_GUID *id); | ||
201 | FMOD_RESULT F_API FMOD_Studio_Bank_GetPath(FMOD_STUDIO_BANK *bank, char *path, int size, int *retrieved); | ||
202 | FMOD_RESULT F_API FMOD_Studio_Bank_Unload(FMOD_STUDIO_BANK *bank); | ||
203 | FMOD_RESULT F_API FMOD_Studio_Bank_LoadSampleData(FMOD_STUDIO_BANK *bank); | ||
204 | FMOD_RESULT F_API FMOD_Studio_Bank_UnloadSampleData(FMOD_STUDIO_BANK *bank); | ||
205 | FMOD_RESULT F_API FMOD_Studio_Bank_GetLoadingState(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_LOADING_STATE *state); | ||
206 | FMOD_RESULT F_API FMOD_Studio_Bank_GetSampleLoadingState(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_LOADING_STATE *state); | ||
207 | FMOD_RESULT F_API FMOD_Studio_Bank_GetStringCount(FMOD_STUDIO_BANK *bank, int *count); | ||
208 | FMOD_RESULT F_API FMOD_Studio_Bank_GetStringInfo(FMOD_STUDIO_BANK *bank, int index, FMOD_GUID *id, char *path, int size, int *retrieved); | ||
209 | FMOD_RESULT F_API FMOD_Studio_Bank_GetEventCount(FMOD_STUDIO_BANK *bank, int *count); | ||
210 | FMOD_RESULT F_API FMOD_Studio_Bank_GetEventList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_EVENTDESCRIPTION **array, int capacity, int *count); | ||
211 | FMOD_RESULT F_API FMOD_Studio_Bank_GetBusCount(FMOD_STUDIO_BANK *bank, int *count); | ||
212 | FMOD_RESULT F_API FMOD_Studio_Bank_GetBusList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_BUS **array, int capacity, int *count); | ||
213 | FMOD_RESULT F_API FMOD_Studio_Bank_GetVCACount(FMOD_STUDIO_BANK *bank, int *count); | ||
214 | FMOD_RESULT F_API FMOD_Studio_Bank_GetVCAList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_VCA **array, int capacity, int *count); | ||
215 | FMOD_RESULT F_API FMOD_Studio_Bank_GetUserData(FMOD_STUDIO_BANK *bank, void **userdata); | ||
216 | FMOD_RESULT F_API FMOD_Studio_Bank_SetUserData(FMOD_STUDIO_BANK *bank, void *userdata); | ||
217 | |||
218 | /* | ||
219 | Command playback information | ||
220 | */ | ||
221 | FMOD_BOOL F_API FMOD_Studio_CommandReplay_IsValid(FMOD_STUDIO_COMMANDREPLAY *replay); | ||
222 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetSystem(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_SYSTEM **system); | ||
223 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetLength(FMOD_STUDIO_COMMANDREPLAY *replay, float *length); | ||
224 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandCount(FMOD_STUDIO_COMMANDREPLAY *replay, int *count); | ||
225 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandInfo(FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex, FMOD_STUDIO_COMMAND_INFO *info); | ||
226 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandString(FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex, char *buffer, int length); | ||
227 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandAtTime(FMOD_STUDIO_COMMANDREPLAY *replay, float time, int *commandindex); | ||
228 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetBankPath(FMOD_STUDIO_COMMANDREPLAY *replay, const char *bankPath); | ||
229 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_Start(FMOD_STUDIO_COMMANDREPLAY *replay); | ||
230 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_Stop(FMOD_STUDIO_COMMANDREPLAY *replay); | ||
231 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_SeekToTime(FMOD_STUDIO_COMMANDREPLAY *replay, float time); | ||
232 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_SeekToCommand(FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex); | ||
233 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetPaused(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_BOOL *paused); | ||
234 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetPaused(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_BOOL paused); | ||
235 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetPlaybackState(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_PLAYBACK_STATE *state); | ||
236 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCurrentCommand(FMOD_STUDIO_COMMANDREPLAY *replay, int *commandindex, float *currenttime); | ||
237 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_Release(FMOD_STUDIO_COMMANDREPLAY *replay); | ||
238 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetFrameCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK callback); | ||
239 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetLoadBankCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK callback); | ||
240 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetCreateInstanceCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback); | ||
241 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetUserData(FMOD_STUDIO_COMMANDREPLAY *replay, void **userdata); | ||
242 | FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetUserData(FMOD_STUDIO_COMMANDREPLAY *replay, void *userdata); | ||
243 | |||
244 | #ifdef __cplusplus | ||
245 | } | ||
246 | #endif | ||
247 | |||
248 | #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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Studio API - C++ header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* Use this header in conjunction with fmod_studio_common.h (which contains all the */ | ||
6 | /* constants / callbacks) to develop using the C++ language. */ | ||
7 | /* */ | ||
8 | /* For more detail visit: */ | ||
9 | /* https://fmod.com/resources/documentation-api?version=2.0&page=page=studio-api.html */ | ||
10 | /* ======================================================================================== */ | ||
11 | #ifndef FMOD_STUDIO_HPP | ||
12 | #define FMOD_STUDIO_HPP | ||
13 | |||
14 | #include "fmod_studio_common.h" | ||
15 | #include "fmod_studio.h" | ||
16 | |||
17 | #include "fmod.hpp" | ||
18 | |||
19 | namespace FMOD | ||
20 | { | ||
21 | |||
22 | namespace Studio | ||
23 | { | ||
24 | typedef FMOD_GUID ID; // Deprecated. Please use FMOD_GUID type. | ||
25 | |||
26 | class System; | ||
27 | class EventDescription; | ||
28 | class EventInstance; | ||
29 | class Bus; | ||
30 | class VCA; | ||
31 | class Bank; | ||
32 | class CommandReplay; | ||
33 | |||
34 | inline FMOD_RESULT parseID(const char *idstring, FMOD_GUID *id) { return FMOD_Studio_ParseID(idstring, id); } | ||
35 | |||
36 | class System | ||
37 | { | ||
38 | private: | ||
39 | // Constructor made private so user cannot statically instance a System class. System::create must be used. | ||
40 | System(); | ||
41 | System(const System &); | ||
42 | |||
43 | public: | ||
44 | static FMOD_RESULT F_API create(System **system, unsigned int headerversion = FMOD_VERSION); | ||
45 | FMOD_RESULT F_API setAdvancedSettings(FMOD_STUDIO_ADVANCEDSETTINGS *settings); | ||
46 | FMOD_RESULT F_API getAdvancedSettings(FMOD_STUDIO_ADVANCEDSETTINGS *settings); | ||
47 | FMOD_RESULT F_API initialize(int maxchannels, FMOD_STUDIO_INITFLAGS studioflags, FMOD_INITFLAGS flags, void *extradriverdata); | ||
48 | FMOD_RESULT F_API release(); | ||
49 | |||
50 | // Handle validity | ||
51 | bool F_API isValid() const; | ||
52 | |||
53 | // Update processing | ||
54 | FMOD_RESULT F_API update(); | ||
55 | FMOD_RESULT F_API flushCommands(); | ||
56 | FMOD_RESULT F_API flushSampleLoading(); | ||
57 | |||
58 | // Low-level API access | ||
59 | FMOD_RESULT F_API getCoreSystem(FMOD::System **system) const; | ||
60 | |||
61 | // Asset retrieval | ||
62 | FMOD_RESULT F_API getEvent(const char *path, EventDescription **event) const; | ||
63 | FMOD_RESULT F_API getBus(const char *path, Bus **bus) const; | ||
64 | FMOD_RESULT F_API getVCA(const char *path, VCA **vca) const; | ||
65 | FMOD_RESULT F_API getBank(const char *path, Bank **bank) const; | ||
66 | FMOD_RESULT F_API getEventByID(const FMOD_GUID *id, EventDescription **event) const; | ||
67 | FMOD_RESULT F_API getBusByID(const FMOD_GUID *id, Bus **bus) const; | ||
68 | FMOD_RESULT F_API getVCAByID(const FMOD_GUID *id, VCA **vca) const; | ||
69 | FMOD_RESULT F_API getBankByID(const FMOD_GUID *id, Bank **bank) const; | ||
70 | FMOD_RESULT F_API getSoundInfo(const char *key, FMOD_STUDIO_SOUND_INFO *info) const; | ||
71 | FMOD_RESULT F_API getParameterDescriptionByName(const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; | ||
72 | FMOD_RESULT F_API getParameterDescriptionByID(FMOD_STUDIO_PARAMETER_ID id, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; | ||
73 | FMOD_RESULT F_API getParameterLabelByName(const char *name, int labelindex, char *label, int size, int *retrieved) const; | ||
74 | FMOD_RESULT F_API getParameterLabelByID(FMOD_STUDIO_PARAMETER_ID id, int labelindex, char *label, int size, int *retrieved) const; | ||
75 | |||
76 | // Global parameter control | ||
77 | FMOD_RESULT F_API getParameterByID(FMOD_STUDIO_PARAMETER_ID id, float *value, float *finalvalue = 0) const; | ||
78 | FMOD_RESULT F_API setParameterByID(FMOD_STUDIO_PARAMETER_ID id, float value, bool ignoreseekspeed = false); | ||
79 | FMOD_RESULT F_API setParameterByIDWithLabel(FMOD_STUDIO_PARAMETER_ID id, const char *label, bool ignoreseekspeed = false); | ||
80 | FMOD_RESULT F_API setParametersByIDs(const FMOD_STUDIO_PARAMETER_ID *ids, float *values, int count, bool ignoreseekspeed = false); | ||
81 | FMOD_RESULT F_API getParameterByName(const char *name, float *value, float *finalvalue = 0) const; | ||
82 | FMOD_RESULT F_API setParameterByName(const char *name, float value, bool ignoreseekspeed = false); | ||
83 | FMOD_RESULT F_API setParameterByNameWithLabel(const char *name, const char *label, bool ignoreseekspeed = false); | ||
84 | |||
85 | // Path lookup | ||
86 | FMOD_RESULT F_API lookupID(const char *path, FMOD_GUID *id) const; | ||
87 | FMOD_RESULT F_API lookupPath(const FMOD_GUID *id, char *path, int size, int *retrieved) const; | ||
88 | |||
89 | // Listener control | ||
90 | FMOD_RESULT F_API getNumListeners(int *numlisteners); | ||
91 | FMOD_RESULT F_API setNumListeners(int numlisteners); | ||
92 | FMOD_RESULT F_API getListenerAttributes(int listener, FMOD_3D_ATTRIBUTES *attributes, FMOD_VECTOR *attenuationposition = 0) const; | ||
93 | FMOD_RESULT F_API setListenerAttributes(int listener, const FMOD_3D_ATTRIBUTES *attributes, const FMOD_VECTOR *attenuationposition = 0); | ||
94 | FMOD_RESULT F_API getListenerWeight(int listener, float *weight); | ||
95 | FMOD_RESULT F_API setListenerWeight(int listener, float weight); | ||
96 | |||
97 | // Bank control | ||
98 | FMOD_RESULT F_API loadBankFile(const char *filename, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank); | ||
99 | FMOD_RESULT F_API loadBankMemory(const char *buffer, int length, FMOD_STUDIO_LOAD_MEMORY_MODE mode, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank); | ||
100 | FMOD_RESULT F_API loadBankCustom(const FMOD_STUDIO_BANK_INFO *info, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank); | ||
101 | FMOD_RESULT F_API unloadAll(); | ||
102 | |||
103 | // General functionality | ||
104 | FMOD_RESULT F_API getBufferUsage(FMOD_STUDIO_BUFFER_USAGE *usage) const; | ||
105 | FMOD_RESULT F_API resetBufferUsage(); | ||
106 | FMOD_RESULT F_API registerPlugin(const FMOD_DSP_DESCRIPTION *description); | ||
107 | FMOD_RESULT F_API unregisterPlugin(const char *name); | ||
108 | |||
109 | // Enumeration | ||
110 | FMOD_RESULT F_API getBankCount(int *count) const; | ||
111 | FMOD_RESULT F_API getBankList(Bank **array, int capacity, int *count) const; | ||
112 | FMOD_RESULT F_API getParameterDescriptionCount(int *count) const; | ||
113 | FMOD_RESULT F_API getParameterDescriptionList(FMOD_STUDIO_PARAMETER_DESCRIPTION *array, int capacity, int *count) const; | ||
114 | |||
115 | // Command capture and replay | ||
116 | FMOD_RESULT F_API startCommandCapture(const char *filename, FMOD_STUDIO_COMMANDCAPTURE_FLAGS flags); | ||
117 | FMOD_RESULT F_API stopCommandCapture(); | ||
118 | FMOD_RESULT F_API loadCommandReplay(const char *filename, FMOD_STUDIO_COMMANDREPLAY_FLAGS flags, CommandReplay **replay); | ||
119 | |||
120 | // Callbacks | ||
121 | FMOD_RESULT F_API setCallback(FMOD_STUDIO_SYSTEM_CALLBACK callback, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_STUDIO_SYSTEM_CALLBACK_ALL); | ||
122 | FMOD_RESULT F_API getUserData(void **userdata) const; | ||
123 | FMOD_RESULT F_API setUserData(void *userdata); | ||
124 | |||
125 | // Monitoring | ||
126 | FMOD_RESULT F_API getCPUUsage(FMOD_STUDIO_CPU_USAGE *usage, FMOD_CPU_USAGE *usage_core) const; | ||
127 | FMOD_RESULT F_API getMemoryUsage(FMOD_STUDIO_MEMORY_USAGE *memoryusage) const; | ||
128 | }; | ||
129 | |||
130 | class EventDescription | ||
131 | { | ||
132 | private: | ||
133 | // Constructor made private so user cannot statically instance the class. | ||
134 | EventDescription(); | ||
135 | EventDescription(const EventDescription &); | ||
136 | |||
137 | public: | ||
138 | // Handle validity | ||
139 | bool F_API isValid() const; | ||
140 | |||
141 | // Property access | ||
142 | FMOD_RESULT F_API getID(FMOD_GUID *id) const; | ||
143 | FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const; | ||
144 | FMOD_RESULT F_API getParameterDescriptionCount(int *count) const; | ||
145 | FMOD_RESULT F_API getParameterDescriptionByIndex(int index, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; | ||
146 | FMOD_RESULT F_API getParameterDescriptionByName(const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; | ||
147 | FMOD_RESULT F_API getParameterDescriptionByID(FMOD_STUDIO_PARAMETER_ID id, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const; | ||
148 | FMOD_RESULT F_API getParameterLabelByIndex(int index, int labelindex, char *label, int size, int *retrieved) const; | ||
149 | FMOD_RESULT F_API getParameterLabelByName(const char *name, int labelindex, char *label, int size, int *retrieved) const; | ||
150 | FMOD_RESULT F_API getParameterLabelByID(FMOD_STUDIO_PARAMETER_ID id, int labelindex, char *label, int size, int *retrieved) const; | ||
151 | FMOD_RESULT F_API getUserPropertyCount(int *count) const; | ||
152 | FMOD_RESULT F_API getUserPropertyByIndex(int index, FMOD_STUDIO_USER_PROPERTY *property) const; | ||
153 | FMOD_RESULT F_API getUserProperty(const char *name, FMOD_STUDIO_USER_PROPERTY *property) const; | ||
154 | FMOD_RESULT F_API getLength(int *length) const; | ||
155 | FMOD_RESULT F_API getMinMaxDistance(float *min, float *max) const; | ||
156 | FMOD_RESULT F_API getSoundSize(float *size) const; | ||
157 | |||
158 | FMOD_RESULT F_API isSnapshot(bool *snapshot) const; | ||
159 | FMOD_RESULT F_API isOneshot(bool *oneshot) const; | ||
160 | FMOD_RESULT F_API isStream(bool *isStream) const; | ||
161 | FMOD_RESULT F_API is3D(bool *is3d) const; | ||
162 | FMOD_RESULT F_API isDopplerEnabled(bool *doppler) const; | ||
163 | FMOD_RESULT F_API hasSustainPoint(bool *sustainPoint) const; | ||
164 | |||
165 | // Playback control | ||
166 | FMOD_RESULT F_API createInstance(EventInstance **instance) const; | ||
167 | FMOD_RESULT F_API getInstanceCount(int *count) const; | ||
168 | FMOD_RESULT F_API getInstanceList(EventInstance **array, int capacity, int *count) const; | ||
169 | |||
170 | // Sample data loading control | ||
171 | FMOD_RESULT F_API loadSampleData(); | ||
172 | FMOD_RESULT F_API unloadSampleData(); | ||
173 | FMOD_RESULT F_API getSampleLoadingState(FMOD_STUDIO_LOADING_STATE *state) const; | ||
174 | |||
175 | // Convenience functions | ||
176 | FMOD_RESULT F_API releaseAllInstances(); | ||
177 | |||
178 | // Callbacks | ||
179 | FMOD_RESULT F_API setCallback(FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL); | ||
180 | FMOD_RESULT F_API getUserData(void **userdata) const; | ||
181 | FMOD_RESULT F_API setUserData(void *userdata); | ||
182 | }; | ||
183 | |||
184 | class EventInstance | ||
185 | { | ||
186 | private: | ||
187 | // Constructor made private so user cannot statically instance the class. | ||
188 | EventInstance(); | ||
189 | EventInstance(const EventInstance &); | ||
190 | |||
191 | public: | ||
192 | // Handle validity | ||
193 | bool F_API isValid() const; | ||
194 | |||
195 | // Property access | ||
196 | FMOD_RESULT F_API getDescription(EventDescription **description) const; | ||
197 | |||
198 | // Playback control | ||
199 | FMOD_RESULT F_API getVolume(float *volume, float *finalvolume = 0) const; | ||
200 | FMOD_RESULT F_API setVolume(float volume); | ||
201 | |||
202 | FMOD_RESULT F_API getPitch(float *pitch, float *finalpitch = 0) const; | ||
203 | FMOD_RESULT F_API setPitch(float pitch); | ||
204 | |||
205 | FMOD_RESULT F_API get3DAttributes(FMOD_3D_ATTRIBUTES *attributes) const; | ||
206 | FMOD_RESULT F_API set3DAttributes(const FMOD_3D_ATTRIBUTES *attributes); | ||
207 | |||
208 | FMOD_RESULT F_API getListenerMask(unsigned int *mask) const; | ||
209 | FMOD_RESULT F_API setListenerMask(unsigned int mask); | ||
210 | |||
211 | FMOD_RESULT F_API getProperty(FMOD_STUDIO_EVENT_PROPERTY index, float *value) const; | ||
212 | FMOD_RESULT F_API setProperty(FMOD_STUDIO_EVENT_PROPERTY index, float value); | ||
213 | |||
214 | FMOD_RESULT F_API getReverbLevel(int index, float *level) const; | ||
215 | FMOD_RESULT F_API setReverbLevel(int index, float level); | ||
216 | |||
217 | FMOD_RESULT F_API getPaused(bool *paused) const; | ||
218 | FMOD_RESULT F_API setPaused(bool paused); | ||
219 | |||
220 | FMOD_RESULT F_API start(); | ||
221 | FMOD_RESULT F_API stop(FMOD_STUDIO_STOP_MODE mode); | ||
222 | |||
223 | FMOD_RESULT F_API getTimelinePosition(int *position) const; | ||
224 | FMOD_RESULT F_API setTimelinePosition(int position); | ||
225 | |||
226 | FMOD_RESULT F_API getPlaybackState(FMOD_STUDIO_PLAYBACK_STATE *state) const; | ||
227 | |||
228 | FMOD_RESULT F_API getChannelGroup(ChannelGroup **group) const; | ||
229 | |||
230 | FMOD_RESULT F_API getMinMaxDistance(float *min, float *max) const; | ||
231 | |||
232 | FMOD_RESULT F_API release(); | ||
233 | |||
234 | FMOD_RESULT F_API isVirtual(bool *virtualstate) const; | ||
235 | |||
236 | FMOD_RESULT F_API getParameterByID(FMOD_STUDIO_PARAMETER_ID id, float *value, float *finalvalue = 0) const; | ||
237 | FMOD_RESULT F_API setParameterByID(FMOD_STUDIO_PARAMETER_ID id, float value, bool ignoreseekspeed = false); | ||
238 | FMOD_RESULT F_API setParameterByIDWithLabel(FMOD_STUDIO_PARAMETER_ID id, const char* label, bool ignoreseekspeed = false); | ||
239 | FMOD_RESULT F_API setParametersByIDs(const FMOD_STUDIO_PARAMETER_ID *ids, float *values, int count, bool ignoreseekspeed = false); | ||
240 | |||
241 | FMOD_RESULT F_API getParameterByName(const char *name, float *value, float *finalvalue = 0) const; | ||
242 | FMOD_RESULT F_API setParameterByName(const char *name, float value, bool ignoreseekspeed = false); | ||
243 | FMOD_RESULT F_API setParameterByNameWithLabel(const char *name, const char* label, bool ignoreseekspeed = false); | ||
244 | |||
245 | FMOD_RESULT F_API keyOff(); | ||
246 | |||
247 | // Monitoring | ||
248 | FMOD_RESULT F_API getCPUUsage(unsigned int *exclusive, unsigned int *inclusive) const; | ||
249 | FMOD_RESULT F_API getMemoryUsage(FMOD_STUDIO_MEMORY_USAGE *memoryusage) const; | ||
250 | |||
251 | // Callbacks | ||
252 | FMOD_RESULT F_API setCallback(FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL); | ||
253 | FMOD_RESULT F_API getUserData(void **userdata) const; | ||
254 | FMOD_RESULT F_API setUserData(void *userdata); | ||
255 | }; | ||
256 | |||
257 | class Bus | ||
258 | { | ||
259 | private: | ||
260 | // Constructor made private so user cannot statically instance the class. | ||
261 | Bus(); | ||
262 | Bus(const Bus &); | ||
263 | |||
264 | public: | ||
265 | // Handle validity | ||
266 | bool F_API isValid() const; | ||
267 | |||
268 | // Property access | ||
269 | FMOD_RESULT F_API getID(FMOD_GUID *id) const; | ||
270 | FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const; | ||
271 | |||
272 | // Playback control | ||
273 | FMOD_RESULT F_API getVolume(float *volume, float *finalvolume = 0) const; | ||
274 | FMOD_RESULT F_API setVolume(float volume); | ||
275 | |||
276 | FMOD_RESULT F_API getPaused(bool *paused) const; | ||
277 | FMOD_RESULT F_API setPaused(bool paused); | ||
278 | |||
279 | FMOD_RESULT F_API getMute(bool *mute) const; | ||
280 | FMOD_RESULT F_API setMute(bool mute); | ||
281 | |||
282 | FMOD_RESULT F_API stopAllEvents(FMOD_STUDIO_STOP_MODE mode); | ||
283 | |||
284 | // Output port | ||
285 | FMOD_RESULT F_API getPortIndex(FMOD_PORT_INDEX *index) const; | ||
286 | FMOD_RESULT F_API setPortIndex(FMOD_PORT_INDEX index); | ||
287 | |||
288 | // Low-level API access | ||
289 | FMOD_RESULT F_API lockChannelGroup(); | ||
290 | FMOD_RESULT F_API unlockChannelGroup(); | ||
291 | FMOD_RESULT F_API getChannelGroup(FMOD::ChannelGroup **group) const; | ||
292 | |||
293 | // Monitoring | ||
294 | FMOD_RESULT F_API getCPUUsage(unsigned int *exclusive, unsigned int *inclusive) const; | ||
295 | FMOD_RESULT F_API getMemoryUsage(FMOD_STUDIO_MEMORY_USAGE *memoryusage) const; | ||
296 | }; | ||
297 | |||
298 | class VCA | ||
299 | { | ||
300 | private: | ||
301 | // Constructor made private so user cannot statically instance the class. | ||
302 | VCA(); | ||
303 | VCA(const VCA &); | ||
304 | |||
305 | public: | ||
306 | // Handle validity | ||
307 | bool F_API isValid() const; | ||
308 | |||
309 | // Property access | ||
310 | FMOD_RESULT F_API getID(FMOD_GUID *id) const; | ||
311 | FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const; | ||
312 | |||
313 | // Playback control | ||
314 | FMOD_RESULT F_API getVolume(float *volume, float *finalvolume = 0) const; | ||
315 | FMOD_RESULT F_API setVolume(float volume); | ||
316 | }; | ||
317 | |||
318 | class Bank | ||
319 | { | ||
320 | private: | ||
321 | // Constructor made private so user cannot statically instance the class. | ||
322 | Bank(); | ||
323 | Bank(const Bank &); | ||
324 | |||
325 | public: | ||
326 | // Handle validity | ||
327 | bool F_API isValid() const; | ||
328 | |||
329 | // Property access | ||
330 | FMOD_RESULT F_API getID(FMOD_GUID *id) const; | ||
331 | FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const; | ||
332 | |||
333 | // Loading control | ||
334 | FMOD_RESULT F_API unload(); | ||
335 | FMOD_RESULT F_API loadSampleData(); | ||
336 | FMOD_RESULT F_API unloadSampleData(); | ||
337 | |||
338 | FMOD_RESULT F_API getLoadingState(FMOD_STUDIO_LOADING_STATE *state) const; | ||
339 | FMOD_RESULT F_API getSampleLoadingState(FMOD_STUDIO_LOADING_STATE *state) const; | ||
340 | |||
341 | // Enumeration | ||
342 | FMOD_RESULT F_API getStringCount(int *count) const; | ||
343 | FMOD_RESULT F_API getStringInfo(int index, FMOD_GUID *id, char *path, int size, int *retrieved) const; | ||
344 | FMOD_RESULT F_API getEventCount(int *count) const; | ||
345 | FMOD_RESULT F_API getEventList(EventDescription **array, int capacity, int *count) const; | ||
346 | FMOD_RESULT F_API getBusCount(int *count) const; | ||
347 | FMOD_RESULT F_API getBusList(Bus **array, int capacity, int *count) const; | ||
348 | FMOD_RESULT F_API getVCACount(int *count) const; | ||
349 | FMOD_RESULT F_API getVCAList(VCA **array, int capacity, int *count) const; | ||
350 | |||
351 | FMOD_RESULT F_API getUserData(void **userdata) const; | ||
352 | FMOD_RESULT F_API setUserData(void *userdata); | ||
353 | }; | ||
354 | |||
355 | class CommandReplay | ||
356 | { | ||
357 | private: | ||
358 | // Constructor made private so user cannot statically instance the class. | ||
359 | CommandReplay(); | ||
360 | CommandReplay(const CommandReplay &); | ||
361 | |||
362 | public: | ||
363 | // Handle validity | ||
364 | bool F_API isValid() const; | ||
365 | |||
366 | // Information query | ||
367 | FMOD_RESULT F_API getSystem(System **system) const; | ||
368 | FMOD_RESULT F_API getLength(float *length) const; | ||
369 | |||
370 | FMOD_RESULT F_API getCommandCount(int *count) const; | ||
371 | FMOD_RESULT F_API getCommandInfo(int commandindex, FMOD_STUDIO_COMMAND_INFO *info) const; | ||
372 | FMOD_RESULT F_API getCommandString(int commandindex, char *buffer, int length) const; | ||
373 | FMOD_RESULT F_API getCommandAtTime(float time, int *commandindex) const; | ||
374 | |||
375 | // Playback | ||
376 | FMOD_RESULT F_API setBankPath(const char *bankPath); | ||
377 | FMOD_RESULT F_API start(); | ||
378 | FMOD_RESULT F_API stop(); | ||
379 | FMOD_RESULT F_API seekToTime(float time); | ||
380 | FMOD_RESULT F_API seekToCommand(int commandindex); | ||
381 | FMOD_RESULT F_API getPaused(bool *paused) const; | ||
382 | FMOD_RESULT F_API setPaused(bool paused); | ||
383 | FMOD_RESULT F_API getPlaybackState(FMOD_STUDIO_PLAYBACK_STATE *state) const; | ||
384 | FMOD_RESULT F_API getCurrentCommand(int *commandindex, float *currenttime) const; | ||
385 | |||
386 | // Release | ||
387 | FMOD_RESULT F_API release(); | ||
388 | |||
389 | // Callbacks | ||
390 | FMOD_RESULT F_API setFrameCallback(FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK callback); | ||
391 | FMOD_RESULT F_API setLoadBankCallback(FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK callback); | ||
392 | FMOD_RESULT F_API setCreateInstanceCallback(FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback); | ||
393 | |||
394 | FMOD_RESULT F_API getUserData(void **userdata) const; | ||
395 | FMOD_RESULT F_API setUserData(void *userdata); | ||
396 | }; | ||
397 | |||
398 | } // namespace Studio | ||
399 | |||
400 | } // namespace FMOD | ||
401 | |||
402 | #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 @@ | |||
1 | /* ======================================================================================== */ | ||
2 | /* FMOD Studio API - Common C/C++ header file. */ | ||
3 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */ | ||
4 | /* */ | ||
5 | /* This header defines common enumerations, structs and callbacks that are shared between */ | ||
6 | /* the C and C++ interfaces. */ | ||
7 | /* */ | ||
8 | /* For more detail visit: */ | ||
9 | /* https://fmod.com/resources/documentation-api?version=2.0&page=page=studio-api.html */ | ||
10 | /* ======================================================================================== */ | ||
11 | #ifndef FMOD_STUDIO_COMMON_H | ||
12 | #define FMOD_STUDIO_COMMON_H | ||
13 | |||
14 | #include "fmod.h" | ||
15 | |||
16 | /* | ||
17 | FMOD Studio types. | ||
18 | */ | ||
19 | typedef struct FMOD_STUDIO_SYSTEM FMOD_STUDIO_SYSTEM; | ||
20 | typedef struct FMOD_STUDIO_EVENTDESCRIPTION FMOD_STUDIO_EVENTDESCRIPTION; | ||
21 | typedef struct FMOD_STUDIO_EVENTINSTANCE FMOD_STUDIO_EVENTINSTANCE; | ||
22 | typedef struct FMOD_STUDIO_BUS FMOD_STUDIO_BUS; | ||
23 | typedef struct FMOD_STUDIO_VCA FMOD_STUDIO_VCA; | ||
24 | typedef struct FMOD_STUDIO_BANK FMOD_STUDIO_BANK; | ||
25 | typedef struct FMOD_STUDIO_COMMANDREPLAY FMOD_STUDIO_COMMANDREPLAY; | ||
26 | |||
27 | /* | ||
28 | FMOD Studio constants | ||
29 | */ | ||
30 | #define FMOD_STUDIO_LOAD_MEMORY_ALIGNMENT 32 | ||
31 | |||
32 | typedef unsigned int FMOD_STUDIO_INITFLAGS; | ||
33 | #define FMOD_STUDIO_INIT_NORMAL 0x00000000 | ||
34 | #define FMOD_STUDIO_INIT_LIVEUPDATE 0x00000001 | ||
35 | #define FMOD_STUDIO_INIT_ALLOW_MISSING_PLUGINS 0x00000002 | ||
36 | #define FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE 0x00000004 | ||
37 | #define FMOD_STUDIO_INIT_DEFERRED_CALLBACKS 0x00000008 | ||
38 | #define FMOD_STUDIO_INIT_LOAD_FROM_UPDATE 0x00000010 | ||
39 | #define FMOD_STUDIO_INIT_MEMORY_TRACKING 0x00000020 | ||
40 | |||
41 | typedef unsigned int FMOD_STUDIO_PARAMETER_FLAGS; | ||
42 | #define FMOD_STUDIO_PARAMETER_READONLY 0x00000001 | ||
43 | #define FMOD_STUDIO_PARAMETER_AUTOMATIC 0x00000002 | ||
44 | #define FMOD_STUDIO_PARAMETER_GLOBAL 0x00000004 | ||
45 | #define FMOD_STUDIO_PARAMETER_DISCRETE 0x00000008 | ||
46 | #define FMOD_STUDIO_PARAMETER_LABELED 0x00000010 | ||
47 | |||
48 | typedef unsigned int FMOD_STUDIO_SYSTEM_CALLBACK_TYPE; | ||
49 | #define FMOD_STUDIO_SYSTEM_CALLBACK_PREUPDATE 0x00000001 | ||
50 | #define FMOD_STUDIO_SYSTEM_CALLBACK_POSTUPDATE 0x00000002 | ||
51 | #define FMOD_STUDIO_SYSTEM_CALLBACK_BANK_UNLOAD 0x00000004 | ||
52 | #define FMOD_STUDIO_SYSTEM_CALLBACK_LIVEUPDATE_CONNECTED 0x00000008 | ||
53 | #define FMOD_STUDIO_SYSTEM_CALLBACK_LIVEUPDATE_DISCONNECTED 0x00000010 | ||
54 | #define FMOD_STUDIO_SYSTEM_CALLBACK_ALL 0xFFFFFFFF | ||
55 | |||
56 | typedef unsigned int FMOD_STUDIO_EVENT_CALLBACK_TYPE; | ||
57 | #define FMOD_STUDIO_EVENT_CALLBACK_CREATED 0x00000001 | ||
58 | #define FMOD_STUDIO_EVENT_CALLBACK_DESTROYED 0x00000002 | ||
59 | #define FMOD_STUDIO_EVENT_CALLBACK_STARTING 0x00000004 | ||
60 | #define FMOD_STUDIO_EVENT_CALLBACK_STARTED 0x00000008 | ||
61 | #define FMOD_STUDIO_EVENT_CALLBACK_RESTARTED 0x00000010 | ||
62 | #define FMOD_STUDIO_EVENT_CALLBACK_STOPPED 0x00000020 | ||
63 | #define FMOD_STUDIO_EVENT_CALLBACK_START_FAILED 0x00000040 | ||
64 | #define FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND 0x00000080 | ||
65 | #define FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND 0x00000100 | ||
66 | #define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED 0x00000200 | ||
67 | #define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED 0x00000400 | ||
68 | #define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER 0x00000800 | ||
69 | #define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT 0x00001000 | ||
70 | #define FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED 0x00002000 | ||
71 | #define FMOD_STUDIO_EVENT_CALLBACK_SOUND_STOPPED 0x00004000 | ||
72 | #define FMOD_STUDIO_EVENT_CALLBACK_REAL_TO_VIRTUAL 0x00008000 | ||
73 | #define FMOD_STUDIO_EVENT_CALLBACK_VIRTUAL_TO_REAL 0x00010000 | ||
74 | #define FMOD_STUDIO_EVENT_CALLBACK_START_EVENT_COMMAND 0x00020000 | ||
75 | #define FMOD_STUDIO_EVENT_CALLBACK_NESTED_TIMELINE_BEAT 0x00040000 | ||
76 | #define FMOD_STUDIO_EVENT_CALLBACK_ALL 0xFFFFFFFF | ||
77 | |||
78 | typedef unsigned int FMOD_STUDIO_LOAD_BANK_FLAGS; | ||
79 | #define FMOD_STUDIO_LOAD_BANK_NORMAL 0x00000000 | ||
80 | #define FMOD_STUDIO_LOAD_BANK_NONBLOCKING 0x00000001 | ||
81 | #define FMOD_STUDIO_LOAD_BANK_DECOMPRESS_SAMPLES 0x00000002 | ||
82 | #define FMOD_STUDIO_LOAD_BANK_UNENCRYPTED 0x00000004 | ||
83 | |||
84 | typedef unsigned int FMOD_STUDIO_COMMANDCAPTURE_FLAGS; | ||
85 | #define FMOD_STUDIO_COMMANDCAPTURE_NORMAL 0x00000000 | ||
86 | #define FMOD_STUDIO_COMMANDCAPTURE_FILEFLUSH 0x00000001 | ||
87 | #define FMOD_STUDIO_COMMANDCAPTURE_SKIP_INITIAL_STATE 0x00000002 | ||
88 | |||
89 | typedef unsigned int FMOD_STUDIO_COMMANDREPLAY_FLAGS; | ||
90 | #define FMOD_STUDIO_COMMANDREPLAY_NORMAL 0x00000000 | ||
91 | #define FMOD_STUDIO_COMMANDREPLAY_SKIP_CLEANUP 0x00000001 | ||
92 | #define FMOD_STUDIO_COMMANDREPLAY_FAST_FORWARD 0x00000002 | ||
93 | #define FMOD_STUDIO_COMMANDREPLAY_SKIP_BANK_LOAD 0x00000004 | ||
94 | |||
95 | typedef enum FMOD_STUDIO_LOADING_STATE | ||
96 | { | ||
97 | FMOD_STUDIO_LOADING_STATE_UNLOADING, | ||
98 | FMOD_STUDIO_LOADING_STATE_UNLOADED, | ||
99 | FMOD_STUDIO_LOADING_STATE_LOADING, | ||
100 | FMOD_STUDIO_LOADING_STATE_LOADED, | ||
101 | FMOD_STUDIO_LOADING_STATE_ERROR, | ||
102 | |||
103 | FMOD_STUDIO_LOADING_STATE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ | ||
104 | } FMOD_STUDIO_LOADING_STATE; | ||
105 | |||
106 | typedef enum FMOD_STUDIO_LOAD_MEMORY_MODE | ||
107 | { | ||
108 | FMOD_STUDIO_LOAD_MEMORY, | ||
109 | FMOD_STUDIO_LOAD_MEMORY_POINT, | ||
110 | |||
111 | FMOD_STUDIO_LOAD_MEMORY_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ | ||
112 | } FMOD_STUDIO_LOAD_MEMORY_MODE; | ||
113 | |||
114 | typedef enum FMOD_STUDIO_PARAMETER_TYPE | ||
115 | { | ||
116 | FMOD_STUDIO_PARAMETER_GAME_CONTROLLED, | ||
117 | FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE, | ||
118 | FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_CONE_ANGLE, | ||
119 | FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION, | ||
120 | FMOD_STUDIO_PARAMETER_AUTOMATIC_DIRECTION, | ||
121 | FMOD_STUDIO_PARAMETER_AUTOMATIC_ELEVATION, | ||
122 | FMOD_STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION, | ||
123 | FMOD_STUDIO_PARAMETER_AUTOMATIC_SPEED, | ||
124 | FMOD_STUDIO_PARAMETER_AUTOMATIC_SPEED_ABSOLUTE, | ||
125 | FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE_NORMALIZED, | ||
126 | |||
127 | FMOD_STUDIO_PARAMETER_MAX, | ||
128 | FMOD_STUDIO_PARAMETER_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ | ||
129 | } FMOD_STUDIO_PARAMETER_TYPE; | ||
130 | |||
131 | typedef enum FMOD_STUDIO_USER_PROPERTY_TYPE | ||
132 | { | ||
133 | FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER, | ||
134 | FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN, | ||
135 | FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT, | ||
136 | FMOD_STUDIO_USER_PROPERTY_TYPE_STRING, | ||
137 | |||
138 | FMOD_STUDIO_USER_PROPERTY_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ | ||
139 | } FMOD_STUDIO_USER_PROPERTY_TYPE; | ||
140 | |||
141 | typedef enum FMOD_STUDIO_EVENT_PROPERTY | ||
142 | { | ||
143 | FMOD_STUDIO_EVENT_PROPERTY_CHANNELPRIORITY, | ||
144 | FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY, | ||
145 | FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD, | ||
146 | FMOD_STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE, | ||
147 | FMOD_STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE, | ||
148 | FMOD_STUDIO_EVENT_PROPERTY_COOLDOWN, | ||
149 | FMOD_STUDIO_EVENT_PROPERTY_MAX, | ||
150 | |||
151 | FMOD_STUDIO_EVENT_PROPERTY_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ | ||
152 | } FMOD_STUDIO_EVENT_PROPERTY; | ||
153 | |||
154 | typedef enum FMOD_STUDIO_PLAYBACK_STATE | ||
155 | { | ||
156 | FMOD_STUDIO_PLAYBACK_PLAYING, | ||
157 | FMOD_STUDIO_PLAYBACK_SUSTAINING, | ||
158 | FMOD_STUDIO_PLAYBACK_STOPPED, | ||
159 | FMOD_STUDIO_PLAYBACK_STARTING, | ||
160 | FMOD_STUDIO_PLAYBACK_STOPPING, | ||
161 | |||
162 | FMOD_STUDIO_PLAYBACK_FORCEINT = 65536 | ||
163 | } FMOD_STUDIO_PLAYBACK_STATE; | ||
164 | |||
165 | typedef enum FMOD_STUDIO_STOP_MODE | ||
166 | { | ||
167 | FMOD_STUDIO_STOP_ALLOWFADEOUT, | ||
168 | FMOD_STUDIO_STOP_IMMEDIATE, | ||
169 | |||
170 | FMOD_STUDIO_STOP_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ | ||
171 | } FMOD_STUDIO_STOP_MODE; | ||
172 | |||
173 | typedef enum FMOD_STUDIO_INSTANCETYPE | ||
174 | { | ||
175 | FMOD_STUDIO_INSTANCETYPE_NONE, | ||
176 | FMOD_STUDIO_INSTANCETYPE_SYSTEM, | ||
177 | FMOD_STUDIO_INSTANCETYPE_EVENTDESCRIPTION, | ||
178 | FMOD_STUDIO_INSTANCETYPE_EVENTINSTANCE, | ||
179 | FMOD_STUDIO_INSTANCETYPE_PARAMETERINSTANCE, | ||
180 | FMOD_STUDIO_INSTANCETYPE_BUS, | ||
181 | FMOD_STUDIO_INSTANCETYPE_VCA, | ||
182 | FMOD_STUDIO_INSTANCETYPE_BANK, | ||
183 | FMOD_STUDIO_INSTANCETYPE_COMMANDREPLAY, | ||
184 | |||
185 | FMOD_STUDIO_INSTANCETYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */ | ||
186 | } FMOD_STUDIO_INSTANCETYPE; | ||
187 | |||
188 | /* | ||
189 | FMOD Studio structures | ||
190 | */ | ||
191 | typedef struct FMOD_STUDIO_BANK_INFO | ||
192 | { | ||
193 | int size; | ||
194 | void *userdata; | ||
195 | int userdatalength; | ||
196 | FMOD_FILE_OPEN_CALLBACK opencallback; | ||
197 | FMOD_FILE_CLOSE_CALLBACK closecallback; | ||
198 | FMOD_FILE_READ_CALLBACK readcallback; | ||
199 | FMOD_FILE_SEEK_CALLBACK seekcallback; | ||
200 | } FMOD_STUDIO_BANK_INFO; | ||
201 | |||
202 | typedef struct FMOD_STUDIO_PARAMETER_ID | ||
203 | { | ||
204 | unsigned int data1; | ||
205 | unsigned int data2; | ||
206 | } FMOD_STUDIO_PARAMETER_ID; | ||
207 | |||
208 | typedef struct FMOD_STUDIO_PARAMETER_DESCRIPTION | ||
209 | { | ||
210 | const char *name; | ||
211 | FMOD_STUDIO_PARAMETER_ID id; | ||
212 | float minimum; | ||
213 | float maximum; | ||
214 | float defaultvalue; | ||
215 | FMOD_STUDIO_PARAMETER_TYPE type; | ||
216 | FMOD_STUDIO_PARAMETER_FLAGS flags; | ||
217 | FMOD_GUID guid; | ||
218 | } FMOD_STUDIO_PARAMETER_DESCRIPTION; | ||
219 | |||
220 | typedef struct FMOD_STUDIO_USER_PROPERTY | ||
221 | { | ||
222 | const char *name; | ||
223 | FMOD_STUDIO_USER_PROPERTY_TYPE type; | ||
224 | |||
225 | union | ||
226 | { | ||
227 | int intvalue; | ||
228 | FMOD_BOOL boolvalue; | ||
229 | float floatvalue; | ||
230 | const char *stringvalue; | ||
231 | }; | ||
232 | } FMOD_STUDIO_USER_PROPERTY; | ||
233 | |||
234 | typedef struct FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES | ||
235 | { | ||
236 | const char *name; | ||
237 | FMOD_SOUND *sound; | ||
238 | int subsoundIndex; | ||
239 | } FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES; | ||
240 | |||
241 | typedef struct FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES | ||
242 | { | ||
243 | const char *name; | ||
244 | FMOD_DSP *dsp; | ||
245 | } FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES; | ||
246 | |||
247 | typedef struct FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES | ||
248 | { | ||
249 | const char *name; | ||
250 | int position; | ||
251 | } FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES; | ||
252 | |||
253 | typedef struct FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES | ||
254 | { | ||
255 | int bar; | ||
256 | int beat; | ||
257 | int position; | ||
258 | float tempo; | ||
259 | int timesignatureupper; | ||
260 | int timesignaturelower; | ||
261 | } FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES; | ||
262 | |||
263 | typedef struct FMOD_STUDIO_TIMELINE_NESTED_BEAT_PROPERTIES | ||
264 | { | ||
265 | FMOD_GUID eventid; | ||
266 | FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES properties; | ||
267 | } FMOD_STUDIO_TIMELINE_NESTED_BEAT_PROPERTIES; | ||
268 | |||
269 | typedef struct FMOD_STUDIO_ADVANCEDSETTINGS | ||
270 | { | ||
271 | int cbsize; | ||
272 | unsigned int commandqueuesize; | ||
273 | unsigned int handleinitialsize; | ||
274 | int studioupdateperiod; | ||
275 | int idlesampledatapoolsize; | ||
276 | unsigned int streamingscheduledelay; | ||
277 | const char* encryptionkey; | ||
278 | } FMOD_STUDIO_ADVANCEDSETTINGS; | ||
279 | |||
280 | typedef struct FMOD_STUDIO_CPU_USAGE | ||
281 | { | ||
282 | float update; | ||
283 | } FMOD_STUDIO_CPU_USAGE; | ||
284 | |||
285 | typedef struct FMOD_STUDIO_BUFFER_INFO | ||
286 | { | ||
287 | int currentusage; | ||
288 | int peakusage; | ||
289 | int capacity; | ||
290 | int stallcount; | ||
291 | float stalltime; | ||
292 | } FMOD_STUDIO_BUFFER_INFO; | ||
293 | |||
294 | typedef struct FMOD_STUDIO_BUFFER_USAGE | ||
295 | { | ||
296 | FMOD_STUDIO_BUFFER_INFO studiocommandqueue; | ||
297 | FMOD_STUDIO_BUFFER_INFO studiohandle; | ||
298 | } FMOD_STUDIO_BUFFER_USAGE; | ||
299 | |||
300 | typedef struct FMOD_STUDIO_SOUND_INFO | ||
301 | { | ||
302 | const char *name_or_data; | ||
303 | FMOD_MODE mode; | ||
304 | FMOD_CREATESOUNDEXINFO exinfo; | ||
305 | int subsoundindex; | ||
306 | } FMOD_STUDIO_SOUND_INFO; | ||
307 | |||
308 | typedef struct FMOD_STUDIO_COMMAND_INFO | ||
309 | { | ||
310 | const char *commandname; | ||
311 | int parentcommandindex; | ||
312 | int framenumber; | ||
313 | float frametime; | ||
314 | FMOD_STUDIO_INSTANCETYPE instancetype; | ||
315 | FMOD_STUDIO_INSTANCETYPE outputtype; | ||
316 | unsigned int instancehandle; | ||
317 | unsigned int outputhandle; | ||
318 | } FMOD_STUDIO_COMMAND_INFO; | ||
319 | |||
320 | typedef struct FMOD_STUDIO_MEMORY_USAGE | ||
321 | { | ||
322 | int exclusive; | ||
323 | int inclusive; | ||
324 | int sampledata; | ||
325 | } FMOD_STUDIO_MEMORY_USAGE; | ||
326 | |||
327 | /* | ||
328 | FMOD Studio callbacks. | ||
329 | */ | ||
330 | typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_SYSTEM_CALLBACK) (FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE type, void *commanddata, void *userdata); | ||
331 | typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_EVENT_CALLBACK) (FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE *event, void *parameters); | ||
332 | typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK) (FMOD_STUDIO_COMMANDREPLAY *replay, int commandindex, float currenttime, void *userdata); | ||
333 | 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); | ||
334 | 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); | ||
335 | |||
336 | #endif // FMOD_STUDIO_COMMON_H | ||