doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
eax2.h
Go to the documentation of this file.
1 /******************************************************************
2 *
3 * EAX.H - DirectSound3D Environmental Audio Extensions version 2.0
4 * Updated July 8, 1999
5 *
6 *******************************************************************
7 */
8 
9 #ifndef EAX20_H_INCLUDED
10 #define EAX20_H_INCLUDED
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif // __cplusplus
15 
16 #pragma pack(push, 4)
17 
18 /*
19 * EAX 2.0 listener property set {0306A6A8-B224-11d2-99E5-0000E8D8C722}
20 */
21 DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties,
22  0x306a6a8,
23  0xb224,
24  0x11d2,
25  0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22);
26 
27 typedef enum
28 {
46 
47 // OR these flags with property id
48 #define DSPROPERTY_EAX20LISTENER_IMMEDIATE 0x00000000 // changes take effect immediately
49 #define DSPROPERTY_EAX20LISTENER_DEFERRED 0x80000000 // changes take effect later
50 #define DSPROPERTY_EAX20LISTENER_COMMITDEFERREDSETTINGS (DSPROPERTY_EAX20LISTENER_NONE | \
51  DSPROPERTY_EAX20LISTENER_IMMEDIATE)
52 
53 // Use this structure for DSPROPERTY_EAX20LISTENER_ALLPARAMETERS
54 // - all levels are hundredths of decibels
55 // - all times are in seconds
56 // - the reference for high frequency controls is 5 kHz
57 //
58 // NOTE: This structure may change in future EAX versions.
59 // It is recommended to initialize fields by name:
60 // myListener.lRoom = -1000;
61 // myListener.lRoomHF = -100;
62 // ...
63 // myListener.dwFlags = myFlags /* see EAXLISTENERFLAGS below */ ;
64 // instead of:
65 // myListener = { -1000, -100, ... , 0x00000009 };
66 // If you want to save and load presets in binary form, you
67 // should define your own structure to insure future compatibility.
68 //
70 {
71  long lRoom; // room effect level at low frequencies
72  long lRoomHF; // room effect high-frequency level re. low frequency level
73  float flRoomRolloffFactor; // like DS3D flRolloffFactor but for room effect
74  float flDecayTime; // reverberation decay time at low frequencies
75  float flDecayHFRatio; // high-frequency to low-frequency decay time ratio
76  long lReflections; // early reflections level relative to room effect
77  float flReflectionsDelay; // initial reflection delay time
78  long lReverb; // late reverberation level relative to room effect
79  float flReverbDelay; // late reverberation delay time relative to initial reflection
80  unsigned long dwEnvironment; // sets all listener properties
81  float flEnvironmentSize; // environment size in meters
82  float flEnvironmentDiffusion; // environment diffusion
83  float flAirAbsorptionHF; // change in level per meter at 5 kHz
84  unsigned long dwFlags; // modifies the behavior of properties
86 
87 // used by DSPROPERTY_EAX20LISTENER_ENVIRONMENT
88 enum
89 {
116 
118 };
119 
120 // Used by DS20PROPERTY_EAXLISTENER_FLAGS
121 //
122 // Note: The number and order of flags may change in future EAX versions.
123 // It is recommended to use the flag defines as follows:
124 // myFlags = EAXLISTENERFLAGS_DECAYTIMESCALE | EAXLISTENERFLAGS_REVERBSCALE;
125 // instead of:
126 // myFlags = 0x00000009;
127 //
128 // These flags determine what properties are affected by environment size.
129 #define EAX20LISTENERFLAGS_DECAYTIMESCALE 0x00000001 // reverberation decay time
130 #define EAX20LISTENERFLAGS_REFLECTIONSSCALE 0x00000002 // reflection level
131 #define EAX20LISTENERFLAGS_REFLECTIONSDELAYSCALE 0x00000004 // initial reflection delay time
132 #define EAX20LISTENERFLAGS_REVERBSCALE 0x00000008 // reflections level
133 #define EAX20LISTENERFLAGS_REVERBDELAYSCALE 0x00000010 // late reverberation delay time
134 
135 // This flag limits high-frequency decay time according to air absorption.
136 #define EAX20LISTENERFLAGS_DECAYHFLIMIT 0x00000020
137 
138 #define EAX20LISTENERFLAGS_RESERVED 0xFFFFFFC0 // reserved future use
139 
140 // property ranges and defaults:
141 
142 #define EAX20LISTENER_MINROOM (-10000)
143 #define EAX20LISTENER_MAXROOM 0
144 #define EAX20LISTENER_DEFAULTROOM (-1000)
145 
146 #define EAX20LISTENER_MINROOMHF (-10000)
147 #define EAX20LISTENER_MAXROOMHF 0
148 #define EAX20LISTENER_DEFAULTROOMHF (-100)
149 
150 #define EAX20LISTENER_MINROOMROLLOFFFACTOR 0.0f
151 #define EAX20LISTENER_MAXROOMROLLOFFFACTOR 10.0f
152 #define EAX20LISTENER_DEFAULTROOMROLLOFFFACTOR 0.0f
153 
154 #define EAX20LISTENER_MINDECAYTIME 0.1f
155 #define EAX20LISTENER_MAXDECAYTIME 20.0f
156 #define EAX20LISTENER_DEFAULTDECAYTIME 1.49f
157 
158 #define EAX20LISTENER_MINDECAYHFRATIO 0.1f
159 #define EAX20LISTENER_MAXDECAYHFRATIO 2.0f
160 #define EAX20LISTENER_DEFAULTDECAYHFRATIO 0.83f
161 
162 #define EAX20LISTENER_MINREFLECTIONS (-10000)
163 #define EAX20LISTENER_MAXREFLECTIONS 1000
164 #define EAX20LISTENER_DEFAULTREFLECTIONS (-2602)
165 
166 #define EAX20LISTENER_MINREFLECTIONSDELAY 0.0f
167 #define EAX20LISTENER_MAXREFLECTIONSDELAY 0.3f
168 #define EAX20LISTENER_DEFAULTREFLECTIONSDELAY 0.007f
169 
170 #define EAX20LISTENER_MINREVERB (-10000)
171 #define EAX20LISTENER_MAXREVERB 2000
172 #define EAX20LISTENER_DEFAULTREVERB 200
173 
174 #define EAX20LISTENER_MINREVERBDELAY 0.0f
175 #define EAX20LISTENER_MAXREVERBDELAY 0.1f
176 #define EAX20LISTENER_DEFAULTREVERBDELAY 0.011f
177 
178 #define EAX20LISTENER_MINENVIRONMENT 0
179 #define EAX20LISTENER_MAXENVIRONMENT (EAX_ENVIRONMENT_COUNT-1)
180 #define EAX20LISTENER_DEFAULTENVIRONMENT EAX_ENVIRONMENT_GENERIC
181 
182 #define EAX20LISTENER_MINENVIRONMENTSIZE 1.0f
183 #define EAX20LISTENER_MAXENVIRONMENTSIZE 100.0f
184 #define EAX20LISTENER_DEFAULTENVIRONMENTSIZE 7.5f
185 
186 #define EAX20LISTENER_MINENVIRONMENTDIFFUSION 0.0f
187 #define EAX20LISTENER_MAXENVIRONMENTDIFFUSION 1.0f
188 #define EAX20LISTENER_DEFAULTENVIRONMENTDIFFUSION 1.0f
189 
190 #define EAX20LISTENER_MINAIRABSORPTIONHF (-100.0f)
191 #define EAX20LISTENER_MAXAIRABSORPTIONHF 0.0f
192 #define EAX20LISTENER_DEFAULTAIRABSORPTIONHF (-5.0f)
193 
194 #define EAX20LISTENER_DEFAULTFLAGS (EAX20LISTENERFLAGS_DECAYTIMESCALE | \
195  EAX20LISTENERFLAGS_REFLECTIONSSCALE | \
196  EAX20LISTENERFLAGS_REFLECTIONSDELAYSCALE | \
197  EAX20LISTENERFLAGS_REVERBSCALE | \
198  EAX20LISTENERFLAGS_REVERBDELAYSCALE | \
199  EAX20LISTENERFLAGS_DECAYHFLIMIT)
200 
201 
202 
203 /*
204 * EAX 2.0 buffer property set {0306A6A7-B224-11d2-99E5-0000E8D8C722}
205 */
207  0x306a6a7,
208  0xb224,
209  0x11d2,
210  0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22);
211 
212 // For compatibility with future EAX versions:
213 #define DSPROPSETID_EAX20_BufferProperties DSPROPSETID_EAX20_BufferProperties
214 
215 typedef enum
216 {
233 
234 // OR these flags with property id
235 #define DSPROPERTY_EAX20BUFFER_IMMEDIATE 0x00000000 // changes take effect immediately
236 #define DSPROPERTY_EAX20BUFFER_DEFERRED 0x80000000 // changes take effect later
237 #define DSPROPERTY_EAX20BUFFER_COMMITDEFERREDSETTINGS (DSPROPERTY_EAX20BUFFER_NONE | \
238  DSPROPERTY_EAX20BUFFER_IMMEDIATE)
239 
240 // Use this structure for DSPROPERTY_EAX20BUFFER_ALLPARAMETERS
241 // - all levels are hundredths of decibels
242 //
243 // NOTE: This structure may change in future EAX versions.
244 // It is recommended to initialize fields by name:
245 // myBuffer.lDirect = 0;
246 // myBuffer.lDirectHF = -200;
247 // ...
248 // myBuffer.dwFlags = myFlags /* see EAXBUFFERFLAGS below */ ;
249 // instead of:
250 // myBuffer = { 0, -200, ... , 0x00000003 };
251 //
253 {
254  long lDirect; // direct path level
255  long lDirectHF; // direct path level at high frequencies
256  long lRoom; // room effect level
257  long lRoomHF; // room effect level at high frequencies
258  float flRoomRolloffFactor; // like DS3D flRolloffFactor but for room effect
259  long lObstruction; // main obstruction control (attenuation at high frequencies)
260  float flObstructionLFRatio; // obstruction low-frequency level re. main control
261  long lOcclusion; // main occlusion control (attenuation at high frequencies)
262  float flOcclusionLFRatio; // occlusion low-frequency level re. main control
263  float flOcclusionRoomRatio; // occlusion room effect level re. main control
264  long lOutsideVolumeHF; // outside sound cone level at high frequencies
265  float flAirAbsorptionFactor; // multiplies DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF
266  unsigned long dwFlags; // modifies the behavior of properties
268 
269 // Used by DSPROPERTY_EAX20BUFFER_FLAGS
270 // TRUE: value is computed automatically - property is an offset
271 // FALSE: value is used directly
272 //
273 // Note: The number and order of flags may change in future EAX versions.
274 // To insure future compatibility, use flag defines as follows:
275 // myFlags = EAXBUFFERFLAGS_DIRECTHFAUTO | EAXBUFFERFLAGS_ROOMAUTO;
276 // instead of:
277 // myFlags = 0x00000003;
278 //
279 #define EAX20BUFFERFLAGS_DIRECTHFAUTO 0x00000001 // affects DSPROPERTY_EAXBUFFER_DIRECTHF
280 #define EAX20BUFFERFLAGS_ROOMAUTO 0x00000002 // affects DSPROPERTY_EAXBUFFER_ROOM
281 #define EAX20BUFFERFLAGS_ROOMHFAUTO 0x00000004 // affects DSPROPERTY_EAXBUFFER_ROOMHF
282 
283 #define EAX20BUFFERFLAGS_RESERVED 0xFFFFFFF8 // reserved future use
284 
285 // property ranges and defaults:
286 
287 #define EAX20BUFFER_MINDIRECT (-10000)
288 #define EAX20BUFFER_MAXDIRECT 1000
289 #define EAX20BUFFER_DEFAULTDIRECT 0
290 
291 #define EAX20BUFFER_MINDIRECTHF (-10000)
292 #define EAX20BUFFER_MAXDIRECTHF 0
293 #define EAX20BUFFER_DEFAULTDIRECTHF 0
294 
295 #define EAX20BUFFER_MINROOM (-10000)
296 #define EAX20BUFFER_MAXROOM 1000
297 #define EAX20BUFFER_DEFAULTROOM 0
298 
299 #define EAX20BUFFER_MINROOMHF (-10000)
300 #define EAX20BUFFER_MAXROOMHF 0
301 #define EAX20BUFFER_DEFAULTROOMHF 0
302 
303 #define EAX20BUFFER_MINROOMROLLOFFFACTOR 0.0f
304 #define EAX20BUFFER_MAXROOMROLLOFFFACTOR 10.f
305 #define EAX20BUFFER_DEFAULTROOMROLLOFFFACTOR 0.0f
306 
307 #define EAX20BUFFER_MINOBSTRUCTION (-10000)
308 #define EAX20BUFFER_MAXOBSTRUCTION 0
309 #define EAX20BUFFER_DEFAULTOBSTRUCTION 0
310 
311 #define EAX20BUFFER_MINOBSTRUCTIONLFRATIO 0.0f
312 #define EAX20BUFFER_MAXOBSTRUCTIONLFRATIO 1.0f
313 #define EAX20BUFFER_DEFAULTOBSTRUCTIONLFRATIO 0.0f
314 
315 #define EAX20BUFFER_MINOCCLUSION (-10000)
316 #define EAX20BUFFER_MAXOCCLUSION 0
317 #define EAX20BUFFER_DEFAULTOCCLUSION 0
318 
319 #define EAX20BUFFER_MINOCCLUSIONLFRATIO 0.0f
320 #define EAX20BUFFER_MAXOCCLUSIONLFRATIO 1.0f
321 #define EAX20BUFFER_DEFAULTOCCLUSIONLFRATIO 0.25f
322 
323 #define EAX20BUFFER_MINOCCLUSIONROOMRATIO 0.0f
324 #define EAX20BUFFER_MAXOCCLUSIONROOMRATIO 10.0f
325 #define EAX20BUFFER_DEFAULTOCCLUSIONROOMRATIO 0.5f
326 
327 #define EAX20BUFFER_MINOUTSIDEVOLUMEHF (-10000)
328 #define EAX20BUFFER_MAXOUTSIDEVOLUMEHF 0
329 #define EAX20BUFFER_DEFAULTOUTSIDEVOLUMEHF 0
330 
331 #define EAX20BUFFER_MINAIRABSORPTIONFACTOR 0.0f
332 #define EAX20BUFFER_MAXAIRABSORPTIONFACTOR 10.0f
333 #define EAX20BUFFER_DEFAULTAIRABSORPTIONFACTOR 1.0f
334 
335 #define EAX20BUFFER_DEFAULTFLAGS (EAX20BUFFERFLAGS_DIRECTHFAUTO | \
336  EAX20BUFFERFLAGS_ROOMAUTO | \
337  EAX20BUFFERFLAGS_ROOMHFAUTO)
338 
339 #pragma pack(pop)
340 
341 #ifdef __cplusplus
342 }
343 #endif // __cplusplus
344 
345 #endif
float flEnvironmentDiffusion
Definition: eax2.h:82
struct _EAX20BUFFERPROPERTIES EAX20BUFFERPROPERTIES
DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties, 0x306a6a8, 0xb224, 0x11d2, 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22)
float flEnvironmentSize
Definition: eax2.h:81
float flReflectionsDelay
Definition: eax2.h:77
unsigned long dwFlags
Definition: eax2.h:84
float flOcclusionLFRatio
Definition: eax2.h:262
DSPROPERTY_EAX20_LISTENERPROPERTY
Definition: eax2.h:27
float flRoomRolloffFactor
Definition: eax2.h:258
float flOcclusionRoomRatio
Definition: eax2.h:263
#define DSPROPSETID_EAX20_BufferProperties
Definition: eax2.h:213
unsigned long dwEnvironment
Definition: eax2.h:80
struct _EAX20BUFFERPROPERTIES * LPEAX20BUFFERPROPERTIES
float flRoomRolloffFactor
Definition: eax2.h:73
unsigned long dwFlags
Definition: eax2.h:266
struct _EAX20LISTENERPROPERTIES EAX20LISTENERPROPERTIES
float flAirAbsorptionHF
Definition: eax2.h:83
float flAirAbsorptionFactor
Definition: eax2.h:265
float flObstructionLFRatio
Definition: eax2.h:260
DSPROPERTY_EAX20_BUFFERPROPERTY
Definition: eax2.h:215
struct _EAX20LISTENERPROPERTIES * LPEAX20LISTENERPROPERTIES