summary refs log tree commit diff stats
path: root/vendor/fmod/inc/fmod_dsp.h
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/fmod/inc/fmod_dsp.h')
-rw-r--r--vendor/fmod/inc/fmod_dsp.h421
1 files changed, 421 insertions, 0 deletions
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
17typedef struct FMOD_DSP_STATE FMOD_DSP_STATE;
18typedef struct FMOD_DSP_BUFFER_ARRAY FMOD_DSP_BUFFER_ARRAY;
19typedef 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
27typedef enum
28{
29 FMOD_DSP_PROCESS_PERFORM,
30 FMOD_DSP_PROCESS_QUERY
31} FMOD_DSP_PROCESS_OPERATION;
32
33typedef 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
41typedef 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
52typedef 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
61typedef 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*/
75typedef FMOD_RESULT (F_CALL *FMOD_DSP_CREATE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
76typedef FMOD_RESULT (F_CALL *FMOD_DSP_RELEASE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
77typedef FMOD_RESULT (F_CALL *FMOD_DSP_RESET_CALLBACK) (FMOD_DSP_STATE *dsp_state);
78typedef FMOD_RESULT (F_CALL *FMOD_DSP_READ_CALLBACK) (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels);
79typedef 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);
80typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPOSITION_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int pos);
81typedef 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);
82typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float value);
83typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int value);
84typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL value);
85typedef FMOD_RESULT (F_CALL *FMOD_DSP_SETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void *data, unsigned int length);
86typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);
87typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int *value, char *valuestr);
88typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL *value, char *valuestr);
89typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void **data, unsigned int *length, char *valuestr);
90typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_REGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
91typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
92typedef FMOD_RESULT (F_CALL *FMOD_DSP_SYSTEM_MIX_CALLBACK) (FMOD_DSP_STATE *dsp_state, int stage);
93
94/*
95 DSP Functions
96*/
97typedef void * (F_CALL *FMOD_DSP_ALLOC_FUNC) (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
98typedef void * (F_CALL *FMOD_DSP_REALLOC_FUNC) (void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);
99typedef void (F_CALL *FMOD_DSP_FREE_FUNC) (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr);
100typedef void (F_CALL *FMOD_DSP_LOG_FUNC) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...);
101typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETSAMPLERATE_FUNC) (FMOD_DSP_STATE *dsp_state, int *rate);
102typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETBLOCKSIZE_FUNC) (FMOD_DSP_STATE *dsp_state, unsigned int *blocksize);
103typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETSPEAKERMODE_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE *speakermode_mixer, FMOD_SPEAKERMODE *speakermode_output);
104typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETCLOCK_FUNC) (FMOD_DSP_STATE *dsp_state, unsigned long long *clock, unsigned int *offset, unsigned int *length);
105typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETLISTENERATTRIBUTES_FUNC) (FMOD_DSP_STATE *dsp_state, int *numlisteners, FMOD_3D_ATTRIBUTES *attributes);
106typedef FMOD_RESULT (F_CALL *FMOD_DSP_GETUSERDATA_FUNC) (FMOD_DSP_STATE *dsp_state, void **userdata);
107typedef 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);
108typedef 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);
109typedef FMOD_RESULT (F_CALL *FMOD_DSP_PAN_SUMMONOMATRIX_FUNC) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE sourceSpeakerMode, float lowFrequencyGain, float overallGain, float *matrix);
110typedef 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);
111typedef 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);
112typedef 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);
113typedef 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);
114typedef 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*/
119struct FMOD_DSP_BUFFER_ARRAY
120{
121 int numbuffers;
122 int *buffernumchannels;
123 FMOD_CHANNELMASK *bufferchannelmask;
124 float **buffers;
125 FMOD_SPEAKERMODE speakermode;
126};
127
128struct FMOD_COMPLEX
129{
130 float real;
131 float imag;
132};
133
134typedef 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
141typedef 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
147typedef 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
155typedef 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
164typedef struct FMOD_DSP_PARAMETER_DESC_BOOL
165{
166 FMOD_BOOL defaultval;
167 const char* const* valuenames;
168} FMOD_DSP_PARAMETER_DESC_BOOL;
169
170typedef struct FMOD_DSP_PARAMETER_DESC_DATA
171{
172 int datatype;
173} FMOD_DSP_PARAMETER_DESC_DATA;
174
175typedef 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
191typedef struct FMOD_DSP_PARAMETER_OVERALLGAIN
192{
193 float linear_gain;
194 float linear_gain_additive;
195} FMOD_DSP_PARAMETER_OVERALLGAIN;
196
197typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES
198{
199 FMOD_3D_ATTRIBUTES relative;
200 FMOD_3D_ATTRIBUTES absolute;
201} FMOD_DSP_PARAMETER_3DATTRIBUTES;
202
203typedef 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
211typedef struct FMOD_DSP_PARAMETER_ATTENUATION_RANGE
212{
213 float min;
214 float max;
215} FMOD_DSP_PARAMETER_ATTENUATION_RANGE;
216
217typedef struct FMOD_DSP_PARAMETER_SIDECHAIN
218{
219 FMOD_BOOL sidechainenable;
220} FMOD_DSP_PARAMETER_SIDECHAIN;
221
222typedef struct FMOD_DSP_PARAMETER_FFT
223{
224 int length;
225 int numchannels;
226 float *spectrum[32];
227} FMOD_DSP_PARAMETER_FFT;
228
229typedef 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
262typedef 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
268typedef 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
278typedef 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
294struct 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
306typedef 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