RavEngine
Loading...
Searching...
No Matches
fmod.h
1/*
2Copyright 2018 Google Inc. All Rights Reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS-IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#ifndef RESONANCE_AUDIO_PLATFORM_FMOD_FMOD_H_
18#define RESONANCE_AUDIO_PLATFORM_FMOD_FMOD_H_
19
20#include "api/core/inc/fmod.hpp"
21
22namespace vraudio {
23namespace fmod {
24
25// Listener Callbacks.
26
27// Callback to be called on creation of a listener plugin instance.
28FMOD_RESULT F_CALLBACK ListenerCreateCallback(FMOD_DSP_STATE* dsp_state);
29
30// Callback to be called on release of a listener plugin instance.
31FMOD_RESULT F_CALLBACK ListenerReleaseCallback(FMOD_DSP_STATE* dsp_state);
32
33// Callback to be called when a listener plugin instance is reset.
34FMOD_RESULT F_CALLBACK ListenerResetCallback(FMOD_DSP_STATE* dsp_state);
35
36// Callback to be called to process the next output buffer.
37FMOD_RESULT F_CALLBACK ListenerProcessCallback(
38 FMOD_DSP_STATE* dsp_state, unsigned int length,
39 const FMOD_DSP_BUFFER_ARRAY* in_buffer_array,
40 FMOD_DSP_BUFFER_ARRAY* out_buffer_array, FMOD_BOOL inputs_idle,
41 FMOD_DSP_PROCESS_OPERATION operation);
42
43// Callback to be called on update of the listener plugin's float parameters.
44FMOD_RESULT F_CALLBACK ListenerSetParamFloatCallback(FMOD_DSP_STATE* dsp_state,
45 int index, float value);
46
47// Callback to be called on update to the listener plugin's room data.
48FMOD_RESULT F_CALLBACK ListenerSetParamDataCallback(FMOD_DSP_STATE* dsp_state,
49 int index, void* data,
50 unsigned int length);
51
52// Callback to be called on request for the listener plugin's float parameters.
53FMOD_RESULT F_CALLBACK ListenerGetParamFloatCallback(FMOD_DSP_STATE* dsp_state,
54 int index, float* value,
55 char* value_string);
56
57// Callback to be called on registration of the listener plugin.
58FMOD_RESULT F_CALLBACK ListenerSysRegisterCallback(FMOD_DSP_STATE* dsp_state);
59
60// Callback to be called on deregistration of the listener plugin.
61FMOD_RESULT F_CALLBACK ListenerSysDeregisterCallback(FMOD_DSP_STATE* dsp_state);
62
63// Soundfield Callbacks.
64
65// Callback to be called on creation of a soundfield plugin instance.
66FMOD_RESULT F_CALLBACK SoundfieldCreateCallback(FMOD_DSP_STATE* dsp_state);
67
68// Callback to be called on release of a soundfield plugin instance.
69FMOD_RESULT F_CALLBACK SoundfieldReleaseCallback(FMOD_DSP_STATE* dsp_state);
70
71// Callback to be called when a soundfield plugin instance is reset.
72FMOD_RESULT F_CALLBACK SoundfieldResetCallback(FMOD_DSP_STATE* dsp_state);
73
74// Callback to be called on each buffer loop. Adds audio data to the Google VR
75// audio graph.
76FMOD_RESULT F_CALLBACK SoundfieldProcessCallback(
77 FMOD_DSP_STATE* dsp_state, unsigned int length,
78 const FMOD_DSP_BUFFER_ARRAY* in_buffer_array,
79 FMOD_DSP_BUFFER_ARRAY* out_buffer_array, FMOD_BOOL inputs_idle,
80 FMOD_DSP_PROCESS_OPERATION operation);
81
82// Callback to be called on update to the soundfield plugin's float parameters.
83FMOD_RESULT F_CALLBACK SoundfieldSetParamFloatCallback(
84 FMOD_DSP_STATE* dsp_state, int index, float value);
85
86// Callback to be called on update to the soundfield plugin's transform data.
87FMOD_RESULT F_CALLBACK SoundfieldSetParamDataCallback(FMOD_DSP_STATE* dsp_state,
88 int index, void* data,
89 unsigned int length);
90
91// Callback to be called on request for the soundfield plugin's float
92// parameters.
93FMOD_RESULT F_CALLBACK SoundfieldGetParamFloatCallback(
94 FMOD_DSP_STATE* dsp_state, int index, float* value, char* value_string);
95
96// Callback to be called on request for the soundfield plugin's data parameters.
97FMOD_RESULT F_CALLBACK SoundfieldGetParamDataCallback(
98 FMOD_DSP_STATE* dsp_state, int index, void **value,
99 unsigned int *length, char* value_string);
100
101// Source Callbacks.
102
103// Callback to be called on creation of a source plugin instance.
104FMOD_RESULT F_CALLBACK SourceCreateCallback(FMOD_DSP_STATE* dsp_state);
105
106// Callback to be called on release of a source plugin instance.
107FMOD_RESULT F_CALLBACK SourceReleaseCallback(FMOD_DSP_STATE* dsp_state);
108
109// Callback to be called when a source plugin instance is reset.
110FMOD_RESULT F_CALLBACK SourceResetCallback(FMOD_DSP_STATE* dsp_state);
111
112// Callback to be called on each buffer loop. Adds audio data to the Google VR
113// audio graph.
114FMOD_RESULT F_CALLBACK SourceProcessCallback(
115 FMOD_DSP_STATE* dsp_state, unsigned int length,
116 const FMOD_DSP_BUFFER_ARRAY* in_buffer_array,
117 FMOD_DSP_BUFFER_ARRAY* out_buffer_array, FMOD_BOOL inputs_idle,
118 FMOD_DSP_PROCESS_OPERATION operation);
119
120// Callback to be called on update to the source plugin's float parameters.
121FMOD_RESULT F_CALLBACK SourceSetParamFloatCallback(FMOD_DSP_STATE* dsp_state,
122 int index, float value);
123
124// Callback to be called on update to the source plugin's int parameters.
125FMOD_RESULT F_CALLBACK SourceSetParamIntCallback(FMOD_DSP_STATE* dsp_state,
126 int index, int value);
127
128// Callback to be called on update to the source plugin's bool parameters.
129FMOD_RESULT F_CALLBACK SourceSetParamBoolCallback(FMOD_DSP_STATE* dsp_state,
130 int index, FMOD_BOOL value);
131
132// Callback to be called on update to the source plugin's transform data.
133FMOD_RESULT F_CALLBACK SourceSetParamDataCallback(FMOD_DSP_STATE* dsp_state,
134 int index, void* data,
135 unsigned int length);
136
137// Callback to be called on request for the source plugin's float parameters.
138FMOD_RESULT F_CALLBACK SourceGetParamFloatCallback(FMOD_DSP_STATE* dsp_state,
139 int index, float* value,
140 char* value_string);
141
142// Callback to be called on request for the source plugin's int parameters.
143FMOD_RESULT F_CALLBACK SourceGetParamIntCallback(FMOD_DSP_STATE* dsp_state,
144 int index, int* value,
145 char* value_string);
146
147// Callback to be called on request for the source plugin's bool parameters.
148FMOD_RESULT F_CALLBACK SourceGetParamBoolCallback(FMOD_DSP_STATE* dsp_state,
149 int index, FMOD_BOOL* value,
150 char* value_string);
151
152// Callback to be called on request for the soundfield plugin's data parameters.
153FMOD_RESULT F_CALLBACK SourceGetParamDataCallback(FMOD_DSP_STATE* dsp_state,
154 int index, void **value, unsigned int *length,
155 char* value_string);
156
157extern "C" {
158
159// Returns an FMOD_PLUGINLIST containing pointers to the DSP plugin descriptions
160// for both the listener and source plugins.
161F_EXPORT FMOD_PLUGINLIST* F_CALL FMODGetPluginDescriptionList();
162
163} // extern C
164
165} // namespace fmod
166} // namespace vraudio
167
168#if defined(TARGET_OS_IPHONE) && defined(__APPLE__)
169extern "C" {
170
171// Returns plugin descriptions indivdually for each of the three Resonance Audio
172// plugins This is necessary on iOS as FMOD do not support
173// FMODGetPluginDescriptionList for static libraries.
174F_EXPORT FMOD_DSP_DESCRIPTION* F_CALL
175FMOD_ResonanceAudioListener_GetDSPDescription();
176
177F_EXPORT FMOD_DSP_DESCRIPTION* F_CALL
178FMOD_ResonanceAudioSoundfield_GetDSPDescription();
179
180F_EXPORT FMOD_DSP_DESCRIPTION* F_CALL
181FMOD_ResonanceAudioSource_GetDSPDescription();
182
183} // extern C
184#endif // defined(TARGET_OS_IPHONE) && defined(__APPLE__)
185
186#endif // RESONANCE_AUDIO_PLATFORM_FMOD_FMOD_H_
GLM_FUNC_DECL vec< L, T, Q > fmod(vec< L, T, Q > const &v)