1 /*-------------------------------------------------------------------------
2   Moddified by CaptainCPS for use with MinGW / GCC 4.6.1
3 
4   Thanks to PortAudio for their 'sal.h' compatible with MinGW !
5 -------------------------------------------------------------------------*/
6 
7 /**************************************************************************
8  *
9  * Copyright (c) Microsoft Corporation.  All rights reserved.
10  *
11  * File:    xaudio2fx.h
12  * Content: Declarations for the audio effects included with XAudio2.
13  *
14  **************************************************************************/
15 
16 #ifndef __XAUDIO2FX_INCLUDED__
17 #define __XAUDIO2FX_INCLUDED__
18 
19 #if __GNUC__ >=3
20 #pragma GCC system_header
21 #endif
22 
23 /**************************************************************************
24  *
25  * XAudio2 effect class IDs.
26  *
27  **************************************************************************/
28 
29 //#include "comdecl.h"        // For DEFINE_CLSID and DEFINE_IID
30 
31 // XAudio 2.0 (March 2008 SDK)
32 //DEFINE_CLSID(AudioVolumeMeter, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, E2);
33 //DEFINE_CLSID(AudioVolumeMeter_Debug, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, DB);
34 //DEFINE_CLSID(AudioReverb, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, 63);
35 //DEFINE_CLSID(AudioReverb_Debug, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, DB);
36 
37 // XAudio 2.1 (June 2008 SDK)
38 //DEFINE_CLSID(AudioVolumeMeter, c1e3f122, a2ea, 442c, 85, 4f, 20, d9, 8f, 83, 57, a1);
39 //DEFINE_CLSID(AudioVolumeMeter_Debug, 6d97a461, b02d, 48ae, b5, 43, 82, bc, 35, fd, fa, e2);
40 //DEFINE_CLSID(AudioReverb, f4769300, b949, 4df9, b3, 33, 00, d3, 39, 32, e9, a6);
41 //DEFINE_CLSID(AudioReverb_Debug, aea2cabc, 8c7c, 46aa, ba, 44, 0e, 6d, 75, 88, a1, f2);
42 
43 // XAudio 2.2 (August 2008 SDK)
44 //DEFINE_CLSID(AudioVolumeMeter, f5ca7b34, 8055, 42c0, b8, 36, 21, 61, 29, eb, 7e, 30);
45 //DEFINE_CLSID(AudioVolumeMeter_Debug, f796f5f7, 6059, 4a9f, 98, 2d, 61, ee, c2, ed, 67, ca);
46 //DEFINE_CLSID(AudioReverb, 629cf0de, 3ecc, 41e7, 99, 26, f7, e4, 3e, eb, ec, 51);
47 //DEFINE_CLSID(AudioReverb_Debug, 4aae4299, 3260, 46d4, 97, cc, 6c, c7, 60, c8, 53, 29);
48 
49 // XAudio 2.3 (November 2008 SDK)
50 //DEFINE_CLSID(AudioVolumeMeter, e180344b, ac83, 4483, 95, 9e, 18, a5, c5, 6a, 5e, 19);
51 //DEFINE_CLSID(AudioVolumeMeter_Debug, 922a0a56, 7d13, 40ae, a4, 81, 3c, 6c, 60, f1, 14, 01);
52 //DEFINE_CLSID(AudioReverb, 9cab402c, 1d37, 44b4, 88, 6d, fa, 4f, 36, 17, 0a, 4c);
53 //DEFINE_CLSID(AudioReverb_Debug, eadda998, 3be6, 4505, 84, be, ea, 06, 36, 5d, b9, 6b);
54 
55 // XAudio 2.4 (March 2009 SDK)
56 //DEFINE_CLSID(AudioVolumeMeter, c7338b95, 52b8, 4542, aa, 79, 42, eb, 01, 6c, 8c, 1c);
57 //DEFINE_CLSID(AudioVolumeMeter_Debug, 524bd872, 5c0b, 4217, bd, b8, 0a, 86, 81, 83, 0b, a5);
58 //DEFINE_CLSID(AudioReverb, 8bb7778b, 645b, 4475, 9a, 73, 1d, e3, 17, 0b, d3, af);
59 //DEFINE_CLSID(AudioReverb_Debug, da7738a2, cd0c, 4367, 9a, ac, d7, ea, d7, c6, 4f, 98);
60 
61 // XAudio 2.5 (March 2009 SDK)
62 //DEFINE_CLSID(AudioVolumeMeter, 2139e6da, c341, 4774, 9a, c3, b4, e0, 26, 34, 7f, 64);
63 //DEFINE_CLSID(AudioVolumeMeter_Debug, a5cc4e13, ca00, 416b, a6, ee, 49, fe, e7, b5, 43, d0);
64 //DEFINE_CLSID(AudioReverb, d06df0d0, 8518, 441e, 82, 2f, 54, 51, d5, c5, 95, b8);
65 //DEFINE_CLSID(AudioReverb_Debug, 613604ec, 304c, 45ec, a4, ed, 7a, 1c, 61, 2e, 9e, 72);
66 
67 // XAudio 2.6 (February 2010 SDK)
68 //DEFINE_CLSID(AudioVolumeMeter, e48c5a3f, 93ef, 43bb, a0, 92, 2c, 7c, eb, 94, 6f, 27);
69 //DEFINE_CLSID(AudioVolumeMeter_Debug, 9a9eaef7, a9e0, 4088, 9b, 1b, 9c, a0, 3a, 1a, ec, d4);
70 //DEFINE_CLSID(AudioReverb, cecec95a, d894, 491a, be, e3, 5e, 10, 6f, b5, 9f, 2d);
71 //DEFINE_CLSID(AudioReverb_Debug, 99a1c72e, 364c, 4c1b, 96, 23, fd, 5c, 8a, bd, 90, c7);
72 
73 // XAudio 2.7 (June 2010 SDK)
74 DEFINE_GUID(CLSID_AudioVolumeMeter, 0xcac1105f, 0x619b, 0x4d04, 0x83, 0x1a, 0x44, 0xe1, 0xcb, 0xf1, 0x2d, 0x57);
75 DEFINE_GUID(CLSID_AudioVolumeMeter_Debug, 0x2d9a0f9c, 0xe67b, 0x4b24, 0xab, 0x44, 0x92, 0xb3, 0xe7, 0x70, 0xc0, 0x20);
76 DEFINE_GUID(CLSID_AudioReverb, 0x6a93130e, 0x1d53, 0x41d1, 0xa9, 0xcf, 0xe7, 0x58, 0x80, 0x0b, 0xb1, 0x79);
77 DEFINE_GUID(CLSID_AudioReverb_Debug, 0xc4f82dd4, 0xcb4e, 0x4ce1, 0x8b, 0xdb, 0xee, 0x32, 0xd4, 0x19, 0x82, 0x69);
78 
79 // Ignore the rest of this header if only the GUID definitions were requested
80 #ifndef GUID_DEFS_ONLY
81 
82 #ifdef _XBOX
83     #include <xobjbase.h>   // Xbox COM declarations (IUnknown, etc)
84 #else
85     #include <objbase.h>    // Windows COM declarations
86 #endif
87 #include <math.h>           // For log10()
88 
89 // All structures defined in this file should use tight packing
90 #pragma pack(push, 1)
91 
92 
93 /**************************************************************************
94  *
95  * Effect creation functions.  On Windows, these are just inline functions
96  * that call CoCreateInstance and Initialize; the XAUDIO2FX_DEBUG flag can
97  * be used to select the debug version of the effects.  On Xbox, these map
98  * to real functions included in xaudio2.lib, and the XAUDIO2FX_DEBUG flag
99  * is ignored; the application must link with the debug library to use the
100  * debug functionality.
101  *
102  **************************************************************************/
103 
104 // Use default values for some parameters if building C++ code
105 #ifdef __cplusplus
106     #define DEFAULT(x) =x
107 #else
108     #define DEFAULT(x)
109 #endif
110 
111 #define XAUDIO2FX_DEBUG 1   // To select the debug version of an effect
112 
113 #ifdef _XBOX
114 
115     STDAPI CreateAudioVolumeMeter(__deref_out IUnknown** ppApo);
116     STDAPI CreateAudioReverb(__deref_out IUnknown** ppApo);
117 
118     __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0))
119     {
120         return CreateAudioVolumeMeter(ppApo);
121     }
122 
123     __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0))
124     {
125         return CreateAudioReverb(ppApo);
126     }
127 
128 #else // Windows
129 
130     __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0))
131     {
132         #ifdef __cplusplus
133             return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? CLSID_AudioVolumeMeter_Debug
134                                                               : CLSID_AudioVolumeMeter,
135                                     NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)ppApo);
136         #else
137             return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioVolumeMeter_Debug
138                                                               : &CLSID_AudioVolumeMeter,
139                                     NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo);
140         #endif
141     }
142 
143     __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0))
144     {
145         #ifdef __cplusplus
146             return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? CLSID_AudioReverb_Debug
147                                                               : CLSID_AudioReverb,
148                                     NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)ppApo);
149         #else
150             return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioReverb_Debug
151                                                               : &CLSID_AudioReverb,
152                                     NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo);
153         #endif
154     }
155 
156 #endif // #ifdef _XBOX
157 
158 
159 
160 /**************************************************************************
161  *
162  * Volume meter parameters.
163  * The volume meter supports FLOAT32 audio formats and must be used in-place.
164  *
165  **************************************************************************/
166 
167 // XAUDIO2FX_VOLUMEMETER_LEVELS: Receives results from GetEffectParameters().
168 // The user is responsible for allocating pPeakLevels, pRMSLevels, and
169 // initializing ChannelCount accordingly.
170 // The volume meter does not support SetEffectParameters().
171 typedef struct XAUDIO2FX_VOLUMEMETER_LEVELS
172 {
173     float* pPeakLevels;  // Peak levels table: receives maximum absolute level for each channel
174                          // over a processing pass; may be NULL if pRMSLevls != NULL,
175                          // otherwise must have at least ChannelCount elements.
176     float* pRMSLevels;   // Root mean square levels table: receives RMS level for each channel
177                          // over a processing pass; may be NULL if pPeakLevels != NULL,
178                          // otherwise must have at least ChannelCount elements.
179     UINT32 ChannelCount; // Number of channels being processed by the volume meter APO
180 } XAUDIO2FX_VOLUMEMETER_LEVELS;
181 
182 
183 
184 /**************************************************************************
185  *
186  * Reverb parameters.
187  * The reverb supports only FLOAT32 audio with the following channel
188  * configurations:
189  *     Input: Mono   Output: Mono
190  *     Input: Mono   Output: 5.1
191  *     Input: Stereo Output: Stereo
192  *     Input: Stereo Output: 5.1
193  * The framerate must be within [20000, 48000] Hz.
194  *
195  * When using mono input, delay filters associated with the right channel
196  * are not executed.  In this case, parameters such as PositionRight and
197  * PositionMatrixRight have no effect.  This also means the reverb uses
198  * less CPU when hosted in a mono submix.
199  *
200  **************************************************************************/
201 
202 #define XAUDIO2FX_REVERB_MIN_FRAMERATE 20000
203 #define XAUDIO2FX_REVERB_MAX_FRAMERATE 48000
204 
205 // XAUDIO2FX_REVERB_PARAMETERS: Native parameter set for the reverb effect
206 
207 typedef struct XAUDIO2FX_REVERB_PARAMETERS
208 {
209     // ratio of wet (processed) signal to dry (original) signal
210     float WetDryMix;            // [0, 100] (percentage)
211 
212     // Delay times
213     UINT32 ReflectionsDelay;    // [0, 300] in ms
214     BYTE ReverbDelay;           // [0, 85] in ms
215     BYTE RearDelay;             // [0, 5] in ms
216 
217     // Indexed parameters
218     BYTE PositionLeft;          // [0, 30] no units
219     BYTE PositionRight;         // [0, 30] no units, ignored when configured to mono
220     BYTE PositionMatrixLeft;    // [0, 30] no units
221     BYTE PositionMatrixRight;   // [0, 30] no units, ignored when configured to mono
222     BYTE EarlyDiffusion;        // [0, 15] no units
223     BYTE LateDiffusion;         // [0, 15] no units
224     BYTE LowEQGain;             // [0, 12] no units
225     BYTE LowEQCutoff;           // [0, 9] no units
226     BYTE HighEQGain;            // [0, 8] no units
227     BYTE HighEQCutoff;          // [0, 14] no units
228 
229     // Direct parameters
230     float RoomFilterFreq;       // [20, 20000] in Hz
231     float RoomFilterMain;       // [-100, 0] in dB
232     float RoomFilterHF;         // [-100, 0] in dB
233     float ReflectionsGain;      // [-100, 20] in dB
234     float ReverbGain;           // [-100, 20] in dB
235     float DecayTime;            // [0.1, inf] in seconds
236     float Density;              // [0, 100] (percentage)
237     float RoomSize;             // [1, 100] in feet
238 } XAUDIO2FX_REVERB_PARAMETERS;
239 
240 
241 // Maximum, minimum and default values for the parameters above
242 #define XAUDIO2FX_REVERB_MIN_WET_DRY_MIX            0.0f
243 #define XAUDIO2FX_REVERB_MIN_REFLECTIONS_DELAY      0
244 #define XAUDIO2FX_REVERB_MIN_REVERB_DELAY           0
245 #define XAUDIO2FX_REVERB_MIN_REAR_DELAY             0
246 #define XAUDIO2FX_REVERB_MIN_POSITION               0
247 #define XAUDIO2FX_REVERB_MIN_DIFFUSION              0
248 #define XAUDIO2FX_REVERB_MIN_LOW_EQ_GAIN            0
249 #define XAUDIO2FX_REVERB_MIN_LOW_EQ_CUTOFF          0
250 #define XAUDIO2FX_REVERB_MIN_HIGH_EQ_GAIN           0
251 #define XAUDIO2FX_REVERB_MIN_HIGH_EQ_CUTOFF         0
252 #define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_FREQ       20.0f
253 #define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_MAIN       -100.0f
254 #define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_HF         -100.0f
255 #define XAUDIO2FX_REVERB_MIN_REFLECTIONS_GAIN       -100.0f
256 #define XAUDIO2FX_REVERB_MIN_REVERB_GAIN            -100.0f
257 #define XAUDIO2FX_REVERB_MIN_DECAY_TIME             0.1f
258 #define XAUDIO2FX_REVERB_MIN_DENSITY                0.0f
259 #define XAUDIO2FX_REVERB_MIN_ROOM_SIZE              0.0f
260 
261 #define XAUDIO2FX_REVERB_MAX_WET_DRY_MIX            100.0f
262 #define XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY      300
263 #define XAUDIO2FX_REVERB_MAX_REVERB_DELAY           85
264 #define XAUDIO2FX_REVERB_MAX_REAR_DELAY             5
265 #define XAUDIO2FX_REVERB_MAX_POSITION               30
266 #define XAUDIO2FX_REVERB_MAX_DIFFUSION              15
267 #define XAUDIO2FX_REVERB_MAX_LOW_EQ_GAIN            12
268 #define XAUDIO2FX_REVERB_MAX_LOW_EQ_CUTOFF          9
269 #define XAUDIO2FX_REVERB_MAX_HIGH_EQ_GAIN           8
270 #define XAUDIO2FX_REVERB_MAX_HIGH_EQ_CUTOFF         14
271 #define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_FREQ       20000.0f
272 #define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_MAIN       0.0f
273 #define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_HF         0.0f
274 #define XAUDIO2FX_REVERB_MAX_REFLECTIONS_GAIN       20.0f
275 #define XAUDIO2FX_REVERB_MAX_REVERB_GAIN            20.0f
276 #define XAUDIO2FX_REVERB_MAX_DENSITY                100.0f
277 #define XAUDIO2FX_REVERB_MAX_ROOM_SIZE              100.0f
278 
279 #define XAUDIO2FX_REVERB_DEFAULT_WET_DRY_MIX        100.0f
280 #define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_DELAY  5
281 #define XAUDIO2FX_REVERB_DEFAULT_REVERB_DELAY       5
282 #define XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY         5
283 #define XAUDIO2FX_REVERB_DEFAULT_POSITION           6
284 #define XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX    27
285 #define XAUDIO2FX_REVERB_DEFAULT_EARLY_DIFFUSION    8
286 #define XAUDIO2FX_REVERB_DEFAULT_LATE_DIFFUSION     8
287 #define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_GAIN        8
288 #define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_CUTOFF      4
289 #define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_GAIN       8
290 #define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_CUTOFF     4
291 #define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_FREQ   5000.0f
292 #define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_MAIN   0.0f
293 #define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_HF     0.0f
294 #define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_GAIN   0.0f
295 #define XAUDIO2FX_REVERB_DEFAULT_REVERB_GAIN        0.0f
296 #define XAUDIO2FX_REVERB_DEFAULT_DECAY_TIME         1.0f
297 #define XAUDIO2FX_REVERB_DEFAULT_DENSITY            100.0f
298 #define XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE          100.0f
299 
300 
301 // XAUDIO2FX_REVERB_I3DL2_PARAMETERS: Parameter set compliant with the I3DL2 standard
302 
303 typedef struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS
304 {
305     // ratio of wet (processed) signal to dry (original) signal
306     float WetDryMix;            // [0, 100] (percentage)
307 
308     // Standard I3DL2 parameters
309     INT32 Room;                 // [-10000, 0] in mB (hundredths of decibels)
310     INT32 RoomHF;               // [-10000, 0] in mB (hundredths of decibels)
311     float RoomRolloffFactor;    // [0.0, 10.0]
312     float DecayTime;            // [0.1, 20.0] in seconds
313     float DecayHFRatio;         // [0.1, 2.0]
314     INT32 Reflections;          // [-10000, 1000] in mB (hundredths of decibels)
315     float ReflectionsDelay;     // [0.0, 0.3] in seconds
316     INT32 Reverb;               // [-10000, 2000] in mB (hundredths of decibels)
317     float ReverbDelay;          // [0.0, 0.1] in seconds
318     float Diffusion;            // [0.0, 100.0] (percentage)
319     float Density;              // [0.0, 100.0] (percentage)
320     float HFReference;          // [20.0, 20000.0] in Hz
321 } XAUDIO2FX_REVERB_I3DL2_PARAMETERS;
322 
323 
324 // ReverbConvertI3DL2ToNative: Utility function to map from I3DL2 to native parameters
325 
ReverbConvertI3DL2ToNative(__in const XAUDIO2FX_REVERB_I3DL2_PARAMETERS * pI3DL2,__out XAUDIO2FX_REVERB_PARAMETERS * pNative)326 __inline void ReverbConvertI3DL2ToNative
327 (
328     __in const XAUDIO2FX_REVERB_I3DL2_PARAMETERS* pI3DL2,
329     __out XAUDIO2FX_REVERB_PARAMETERS* pNative
330 )
331 {
332     float reflectionsDelay;
333     float reverbDelay;
334 
335     // RoomRolloffFactor is ignored
336 
337     // These parameters have no equivalent in I3DL2
338     pNative->RearDelay = XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY; // 5
339     pNative->PositionLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6
340     pNative->PositionRight = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6
341     pNative->PositionMatrixLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27
342     pNative->PositionMatrixRight = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27
343     pNative->RoomSize = XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE; // 100
344     pNative->LowEQCutoff = 4;
345     pNative->HighEQCutoff = 6;
346 
347     // The rest of the I3DL2 parameters map to the native property set
348     pNative->RoomFilterMain = (float)pI3DL2->Room / 100.0f;
349     pNative->RoomFilterHF = (float)pI3DL2->RoomHF / 100.0f;
350 
351     if (pI3DL2->DecayHFRatio >= 1.0f)
352     {
353         INT32 index = (INT32)(-4.0 * log10(pI3DL2->DecayHFRatio));
354         if (index < -8) index = -8;
355         pNative->LowEQGain = (BYTE)((index < 0) ? index + 8 : 8);
356         pNative->HighEQGain = 8;
357         pNative->DecayTime = pI3DL2->DecayTime * pI3DL2->DecayHFRatio;
358     }
359     else
360     {
361         INT32 index = (INT32)(4.0 * log10(pI3DL2->DecayHFRatio));
362         if (index < -8) index = -8;
363         pNative->LowEQGain = 8;
364         pNative->HighEQGain = (BYTE)((index < 0) ? index + 8 : 8);
365         pNative->DecayTime = pI3DL2->DecayTime;
366     }
367 
368     reflectionsDelay = pI3DL2->ReflectionsDelay * 1000.0f;
369     if (reflectionsDelay >= XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY) // 300
370     {
371         reflectionsDelay = (float)(XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY - 1);
372     }
373     else if (reflectionsDelay <= 1)
374     {
375         reflectionsDelay = 1;
376     }
377     pNative->ReflectionsDelay = (UINT32)reflectionsDelay;
378 
379     reverbDelay = pI3DL2->ReverbDelay * 1000.0f;
380     if (reverbDelay >= XAUDIO2FX_REVERB_MAX_REVERB_DELAY) // 85
381     {
382         reverbDelay = (float)(XAUDIO2FX_REVERB_MAX_REVERB_DELAY - 1);
383     }
384     pNative->ReverbDelay = (BYTE)reverbDelay;
385 
386     pNative->ReflectionsGain = pI3DL2->Reflections / 100.0f;
387     pNative->ReverbGain = pI3DL2->Reverb / 100.0f;
388     pNative->EarlyDiffusion = (BYTE)(15.0f * pI3DL2->Diffusion / 100.0f);
389     pNative->LateDiffusion = pNative->EarlyDiffusion;
390     pNative->Density = pI3DL2->Density;
391     pNative->RoomFilterFreq = pI3DL2->HFReference;
392 
393     pNative->WetDryMix = pI3DL2->WetDryMix;
394 }
395 
396 
397 /**************************************************************************
398  *
399  * Standard I3DL2 reverb presets (100% wet).
400  *
401  **************************************************************************/
402 
403 #define XAUDIO2FX_I3DL2_PRESET_DEFAULT         {100,-10000,    0,0.0f, 1.00f,0.50f,-10000,0.020f,-10000,0.040f,100.0f,100.0f,5000.0f}
404 #define XAUDIO2FX_I3DL2_PRESET_GENERIC         {100, -1000, -100,0.0f, 1.49f,0.83f, -2602,0.007f,   200,0.011f,100.0f,100.0f,5000.0f}
405 #define XAUDIO2FX_I3DL2_PRESET_PADDEDCELL      {100, -1000,-6000,0.0f, 0.17f,0.10f, -1204,0.001f,   207,0.002f,100.0f,100.0f,5000.0f}
406 #define XAUDIO2FX_I3DL2_PRESET_ROOM            {100, -1000, -454,0.0f, 0.40f,0.83f, -1646,0.002f,    53,0.003f,100.0f,100.0f,5000.0f}
407 #define XAUDIO2FX_I3DL2_PRESET_BATHROOM        {100, -1000,-1200,0.0f, 1.49f,0.54f,  -370,0.007f,  1030,0.011f,100.0f, 60.0f,5000.0f}
408 #define XAUDIO2FX_I3DL2_PRESET_LIVINGROOM      {100, -1000,-6000,0.0f, 0.50f,0.10f, -1376,0.003f, -1104,0.004f,100.0f,100.0f,5000.0f}
409 #define XAUDIO2FX_I3DL2_PRESET_STONEROOM       {100, -1000, -300,0.0f, 2.31f,0.64f,  -711,0.012f,    83,0.017f,100.0f,100.0f,5000.0f}
410 #define XAUDIO2FX_I3DL2_PRESET_AUDITORIUM      {100, -1000, -476,0.0f, 4.32f,0.59f,  -789,0.020f,  -289,0.030f,100.0f,100.0f,5000.0f}
411 #define XAUDIO2FX_I3DL2_PRESET_CONCERTHALL     {100, -1000, -500,0.0f, 3.92f,0.70f, -1230,0.020f,    -2,0.029f,100.0f,100.0f,5000.0f}
412 #define XAUDIO2FX_I3DL2_PRESET_CAVE            {100, -1000,    0,0.0f, 2.91f,1.30f,  -602,0.015f,  -302,0.022f,100.0f,100.0f,5000.0f}
413 #define XAUDIO2FX_I3DL2_PRESET_ARENA           {100, -1000, -698,0.0f, 7.24f,0.33f, -1166,0.020f,    16,0.030f,100.0f,100.0f,5000.0f}
414 #define XAUDIO2FX_I3DL2_PRESET_HANGAR          {100, -1000,-1000,0.0f,10.05f,0.23f,  -602,0.020f,   198,0.030f,100.0f,100.0f,5000.0f}
415 #define XAUDIO2FX_I3DL2_PRESET_CARPETEDHALLWAY {100, -1000,-4000,0.0f, 0.30f,0.10f, -1831,0.002f, -1630,0.030f,100.0f,100.0f,5000.0f}
416 #define XAUDIO2FX_I3DL2_PRESET_HALLWAY         {100, -1000, -300,0.0f, 1.49f,0.59f, -1219,0.007f,   441,0.011f,100.0f,100.0f,5000.0f}
417 #define XAUDIO2FX_I3DL2_PRESET_STONECORRIDOR   {100, -1000, -237,0.0f, 2.70f,0.79f, -1214,0.013f,   395,0.020f,100.0f,100.0f,5000.0f}
418 #define XAUDIO2FX_I3DL2_PRESET_ALLEY           {100, -1000, -270,0.0f, 1.49f,0.86f, -1204,0.007f,    -4,0.011f,100.0f,100.0f,5000.0f}
419 #define XAUDIO2FX_I3DL2_PRESET_FOREST          {100, -1000,-3300,0.0f, 1.49f,0.54f, -2560,0.162f,  -613,0.088f, 79.0f,100.0f,5000.0f}
420 #define XAUDIO2FX_I3DL2_PRESET_CITY            {100, -1000, -800,0.0f, 1.49f,0.67f, -2273,0.007f, -2217,0.011f, 50.0f,100.0f,5000.0f}
421 #define XAUDIO2FX_I3DL2_PRESET_MOUNTAINS       {100, -1000,-2500,0.0f, 1.49f,0.21f, -2780,0.300f, -2014,0.100f, 27.0f,100.0f,5000.0f}
422 #define XAUDIO2FX_I3DL2_PRESET_QUARRY          {100, -1000,-1000,0.0f, 1.49f,0.83f,-10000,0.061f,   500,0.025f,100.0f,100.0f,5000.0f}
423 #define XAUDIO2FX_I3DL2_PRESET_PLAIN           {100, -1000,-2000,0.0f, 1.49f,0.50f, -2466,0.179f, -2514,0.100f, 21.0f,100.0f,5000.0f}
424 #define XAUDIO2FX_I3DL2_PRESET_PARKINGLOT      {100, -1000,    0,0.0f, 1.65f,1.50f, -1363,0.008f, -1153,0.012f,100.0f,100.0f,5000.0f}
425 #define XAUDIO2FX_I3DL2_PRESET_SEWERPIPE       {100, -1000,-1000,0.0f, 2.81f,0.14f,   429,0.014f,   648,0.021f, 80.0f, 60.0f,5000.0f}
426 #define XAUDIO2FX_I3DL2_PRESET_UNDERWATER      {100, -1000,-4000,0.0f, 1.49f,0.10f,  -449,0.007f,  1700,0.011f,100.0f,100.0f,5000.0f}
427 #define XAUDIO2FX_I3DL2_PRESET_SMALLROOM       {100, -1000, -600,0.0f, 1.10f,0.83f,  -400,0.005f,   500,0.010f,100.0f,100.0f,5000.0f}
428 #define XAUDIO2FX_I3DL2_PRESET_MEDIUMROOM      {100, -1000, -600,0.0f, 1.30f,0.83f, -1000,0.010f,  -200,0.020f,100.0f,100.0f,5000.0f}
429 #define XAUDIO2FX_I3DL2_PRESET_LARGEROOM       {100, -1000, -600,0.0f, 1.50f,0.83f, -1600,0.020f, -1000,0.040f,100.0f,100.0f,5000.0f}
430 #define XAUDIO2FX_I3DL2_PRESET_MEDIUMHALL      {100, -1000, -600,0.0f, 1.80f,0.70f, -1300,0.015f,  -800,0.030f,100.0f,100.0f,5000.0f}
431 #define XAUDIO2FX_I3DL2_PRESET_LARGEHALL       {100, -1000, -600,0.0f, 1.80f,0.70f, -2000,0.030f, -1400,0.060f,100.0f,100.0f,5000.0f}
432 #define XAUDIO2FX_I3DL2_PRESET_PLATE           {100, -1000, -200,0.0f, 1.30f,0.90f,     0,0.002f,     0,0.010f,100.0f, 75.0f,5000.0f}
433 
434 
435 // Undo the #pragma pack(push, 1) at the top of this file
436 #pragma pack(pop)
437 
438 #endif // #ifndef GUID_DEFS_ONLY
439 #endif // #ifndef __XAUDIO2FX_INCLUDED__
440