Make sure enough space is allocated for wchar-to-ansi conversion
[dsound-openal.git] / eax.h
blob1b6c89b09e1675fe32a8aa59b23742c76fcbf1d6
1 /* DirectSound
3 * Copyright 2010 Chris Robinson
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 extern const IID DSPROPSETID_EAX20_ListenerProperties;
21 typedef enum {
22 DSPROPERTY_EAXLISTENER_NONE,
23 DSPROPERTY_EAXLISTENER_ALLPARAMETERS,
24 DSPROPERTY_EAXLISTENER_ROOM,
25 DSPROPERTY_EAXLISTENER_ROOMHF,
26 DSPROPERTY_EAXLISTENER_ROOMROLLOFFFACTOR,
27 DSPROPERTY_EAXLISTENER_DECAYTIME,
28 DSPROPERTY_EAXLISTENER_DECAYHFRATIO,
29 DSPROPERTY_EAXLISTENER_REFLECTIONS,
30 DSPROPERTY_EAXLISTENER_REFLECTIONSDELAY,
31 DSPROPERTY_EAXLISTENER_REVERB,
32 DSPROPERTY_EAXLISTENER_REVERBDELAY,
33 DSPROPERTY_EAXLISTENER_ENVIRONMENT,
34 DSPROPERTY_EAXLISTENER_ENVIRONMENTSIZE,
35 DSPROPERTY_EAXLISTENER_ENVIRONMENTDIFFUSION,
36 DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF,
37 DSPROPERTY_EAXLISTENER_FLAGS
38 } DSPROPERTY_EAX_LISTENERPROPERTY;
40 /* Stores the value being set, but does not apply it */
41 #define DSPROPERTY_EAXLISTENER_DEFERRED 0x80000000
42 /* The lack of the deferred flag forces a call to CommitDeferredSettings(),
43 * applying *all* deferred settings, including the EAX property being set */
44 #define DSPROPERTY_EAXLISTENER_IMMEDIATE 0x00000000
45 /* Same as IMMEDIATE; causes a commit of deferred properties but implies no
46 * extra property being set */
47 #define DSPROPERTY_EAXLISTENER_COMMITDEFERREDSETTINGS 0x00000000
49 typedef struct _EAX20LISTENERPROPERTIES {
50 LONG lRoom;
51 LONG lRoomHF;
52 FLOAT flRoomRolloffFactor;
53 FLOAT flDecayTime;
54 FLOAT flDecayHFRatio;
55 LONG lReflections;
56 FLOAT flReflectionsDelay;
57 LONG lReverb;
58 FLOAT flReverbDelay;
59 DWORD dwEnvironment;
60 FLOAT flEnvironmentSize;
61 FLOAT flEnvironmentDiffusion;
62 FLOAT flAirAbsorptionHF;
63 DWORD dwFlags;
64 } EAX20LISTENERPROPERTIES, *LPEAX20LISTENERPROPERTIES;
66 /* These flags determine what properties are modified when the environment size
67 is changed */
68 #define EAXLISTENERFLAGS_DECAYTIMESCALE 0x00000001
69 #define EAXLISTENERFLAGS_REFLECTIONSSCALE 0x00000002
70 #define EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE 0x00000004
71 #define EAXLISTENERFLAGS_REVERBSCALE 0x00000008
72 #define EAXLISTENERFLAGS_REVERBDELAYSCALE 0x00000010
73 /* This flag limits the high frequency decay according to air absorption */
74 #define EAXLISTENERFLAGS_DECAYHFLIMIT 0x00000020
76 #define EAXLISTENERPROPERTIES EAX20LISTENERPROPERTIES
77 #define LPEAXLISTENERPROPERTIES LPEAX20LISTENERPROPERTIES
79 /* EAX environment presets */
80 /* Room RoomHF RRlOff DecTm DcHF Refl RefDel Revb RevDel Env Size Diffuse AirAbs Flags */
81 #define REVERB_PRESET_GENERIC \
82 { -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 0, 7.5f, 1.000f, -5.0f, 0x3f }
83 #define REVERB_PRESET_PADDEDCELL \
84 { -1000, -6000, 0.00f, 0.17f, 0.10f, -1204, 0.001f, 207, 0.002f, 1, 1.4f, 1.000f, -5.0f, 0x3f }
85 #define REVERB_PRESET_ROOM \
86 { -1000, -454, 0.00f, 0.40f, 0.83f, -1646, 0.002f, 53, 0.003f, 2, 1.9f, 1.000f, -5.0f, 0x3f }
87 #define REVERB_PRESET_BATHROOM \
88 { -1000, -1200, 0.00f, 1.49f, 0.54f, -370, 0.007f, 1030, 0.011f, 3, 1.4f, 1.000f, -5.0f, 0x3f }
89 #define REVERB_PRESET_LIVINGROOM \
90 { -1000, -6000, 0.00f, 0.50f, 0.10f, -1376, 0.003f, -1104, 0.004f, 4, 2.5f, 1.000f, -5.0f, 0x3f }
91 #define REVERB_PRESET_STONEROOM \
92 { -1000, -300, 0.00f, 2.31f, 0.64f, -711, 0.012f, 83, 0.017f, 5, 11.6f, 1.000f, -5.0f, 0x3f }
93 #define REVERB_PRESET_AUDITORIUM \
94 { -1000, -476, 0.00f, 4.32f, 0.59f, -789, 0.020f, -289, 0.030f, 6, 21.6f, 1.000f, -5.0f, 0x3f }
95 #define REVERB_PRESET_CONCERTHALL \
96 { -1000, -500, 0.00f, 3.92f, 0.70f, -1230, 0.020f, -2, 0.029f, 7, 19.6f, 1.000f, -5.0f, 0x3f }
97 #define REVERB_PRESET_CAVE \
98 { -1000, 0, 0.00f, 2.91f, 1.30f, -602, 0.015f, -302, 0.022f, 8, 14.6f, 1.000f, -5.0f, 0x1f }
99 #define REVERB_PRESET_ARENA \
100 { -1000, -698, 0.00f, 7.24f, 0.33f, -1166, 0.020f, 16, 0.030f, 9, 36.2f, 1.000f, -5.0f, 0x3f }
101 #define REVERB_PRESET_HANGAR \
102 { -1000, -1000, 0.00f, 10.05f, 0.23f, -602, 0.020f, 198, 0.030f, 10, 50.3f, 1.000f, -5.0f, 0x3f }
103 #define REVERB_PRESET_CARPETEDHALLWAY \
104 { -1000, -4000, 0.00f, 0.30f, 0.10f, -1831, 0.002f, -1630, 0.030f, 11, 1.9f, 1.000f, -5.0f, 0x3f }
105 #define REVERB_PRESET_HALLWAY \
106 { -1000, -300, 0.00f, 1.49f, 0.59f, -1219, 0.007f, 441, 0.011f, 12, 1.8f, 1.000f, -5.0f, 0x3f }
107 #define REVERB_PRESET_STONECORRIDOR \
108 { -1000, -237, 0.00f, 2.70f, 0.79f, -1214, 0.013f, 395, 0.020f, 13, 13.5f, 1.000f, -5.0f, 0x3f }
109 #define REVERB_PRESET_ALLEY \
110 { -1000, -270, 0.00f, 1.49f, 0.86f, -1204, 0.007f, -4, 0.011f, 14, 7.5f, 0.300f, -5.0f, 0x3f }
111 #define REVERB_PRESET_FOREST \
112 { -1000, -3300, 0.00f, 1.49f, 0.54f, -2560, 0.162f, -229, 0.088f, 15, 38.0f, 0.300f, -5.0f, 0x3f }
113 #define REVERB_PRESET_CITY \
114 { -1000, -800, 0.00f, 1.49f, 0.67f, -2273, 0.007f, -1691, 0.011f, 16, 7.5f, 0.500f, -5.0f, 0x3f }
115 #define REVERB_PRESET_MOUNTAINS \
116 { -1000, -2500, 0.00f, 1.49f, 0.21f, -2780, 0.300f, -1434, 0.100f, 17, 100.0f, 0.270f, -5.0f, 0x1f }
117 #define REVERB_PRESET_QUARRY \
118 { -1000, -1000, 0.00f, 1.49f, 0.83f, -10000, 0.061f, 500, 0.025f, 18, 17.5f, 1.000f, -5.0f, 0x3f }
119 #define REVERB_PRESET_PLAIN \
120 { -1000, -2000, 0.00f, 1.49f, 0.50f, -2466, 0.179f, -1926, 0.100f, 19, 42.5f, 0.210f, -5.0f, 0x3f }
121 #define REVERB_PRESET_PARKINGLOT \
122 { -1000, 0, 0.00f, 1.65f, 1.50f, -1363, 0.008f, -1153, 0.012f, 20, 8.3f, 1.000f, -5.0f, 0x1f }
123 #define REVERB_PRESET_SEWERPIPE \
124 { -1000, -1000, 0.00f, 2.81f, 0.14f, 429, 0.014f, 1023, 0.021f, 21, 1.7f, 0.800f, -5.0f, 0x3f }
125 #define REVERB_PRESET_UNDERWATER \
126 { -1000, -4000, 0.00f, 1.49f, 0.10f, -449, 0.007f, 1700, 0.011f, 22, 1.8f, 1.000f, -5.0f, 0x3f }
127 #define REVERB_PRESET_DRUGGED \
128 { -1000, 0, 0.00f, 8.39f, 1.39f, -115, 0.002f, 985, 0.030f, 23, 1.9f, 0.500f, -5.0f, 0x1f }
129 #define REVERB_PRESET_DIZZY \
130 { -1000, -400, 0.00f, 17.23f, 0.56f, -1713, 0.020f, -613, 0.030f, 24, 1.8f, 0.600f, -5.0f, 0x1f }
131 #define REVERB_PRESET_PSYCHOTIC \
132 { -1000, -151, 0.00f, 7.56f, 0.91f, -626, 0.020f, 774, 0.030f, 25, 1.0f, 0.500f, -5.0f, 0x1f }
134 enum {
135 EAX_ENVIRONMENT_GENERIC,
136 EAX_ENVIRONMENT_PADDEDCELL,
137 EAX_ENVIRONMENT_ROOM,
138 EAX_ENVIRONMENT_BATHROOM,
139 EAX_ENVIRONMENT_LIVINGROOM,
140 EAX_ENVIRONMENT_STONEROOM,
141 EAX_ENVIRONMENT_AUDITORIUM,
142 EAX_ENVIRONMENT_CONCERTHALL,
143 EAX_ENVIRONMENT_CAVE,
144 EAX_ENVIRONMENT_ARENA,
145 EAX_ENVIRONMENT_HANGAR,
146 EAX_ENVIRONMENT_CARPETEDHALLWAY,
147 EAX_ENVIRONMENT_HALLWAY,
148 EAX_ENVIRONMENT_STONECORRIDOR,
149 EAX_ENVIRONMENT_ALLEY,
150 EAX_ENVIRONMENT_FOREST,
151 EAX_ENVIRONMENT_CITY,
152 EAX_ENVIRONMENT_MOUNTAINS,
153 EAX_ENVIRONMENT_QUARRY,
154 EAX_ENVIRONMENT_PLAIN,
155 EAX_ENVIRONMENT_PARKINGLOT,
156 EAX_ENVIRONMENT_SEWERPIPE,
157 EAX_ENVIRONMENT_UNDERWATER,
158 EAX_ENVIRONMENT_DRUGGED,
159 EAX_ENVIRONMENT_DIZZY,
160 EAX_ENVIRONMENT_PSYCHOTIC,
162 EAX_ENVIRONMENT_COUNT,
163 EAX_MAX_ENVIRONMENT = EAX_ENVIRONMENT_COUNT-1
166 extern const EAXLISTENERPROPERTIES EnvironmentDefaults[EAX_ENVIRONMENT_COUNT];
169 extern const IID DSPROPSETID_EAX20_BufferProperties;
170 typedef enum {
171 DSPROPERTY_EAXBUFFER_NONE,
172 DSPROPERTY_EAXBUFFER_ALLPARAMETERS,
173 DSPROPERTY_EAXBUFFER_DIRECT,
174 DSPROPERTY_EAXBUFFER_DIRECTHF,
175 DSPROPERTY_EAXBUFFER_ROOM,
176 DSPROPERTY_EAXBUFFER_ROOMHF,
177 DSPROPERTY_EAXBUFFER_ROOMROLLOFFFACTOR,
178 DSPROPERTY_EAXBUFFER_OBSTRUCTION,
179 DSPROPERTY_EAXBUFFER_OBSTRUCTIONLFRATIO,
180 DSPROPERTY_EAXBUFFER_OCCLUSION,
181 DSPROPERTY_EAXBUFFER_OCCLUSIONLFRATIO,
182 DSPROPERTY_EAXBUFFER_OCCLUSIONROOMRATIO,
183 DSPROPERTY_EAXBUFFER_OUTSIDEVOLUMEHF,
184 DSPROPERTY_EAXBUFFER_AIRABSORPTIONFACTOR,
185 DSPROPERTY_EAXBUFFER_FLAGS
186 } DSPROPERTY_EAX_BUFFERPROPERTY;
188 /* Stores the value being set, but does not apply it */
189 #define DSPROPERTY_EAXBUFFER_DEFERRED 0x80000000
190 /* The lack of the deferred flag forces a call to CommitDeferredSettings(),
191 * applying *all* deferred settings, including the EAX property being set */
192 #define DSPROPERTY_EAXBUFFER_IMMEDIATE 0x00000000
193 /* Same as IMMEDIATE; causes a commit of deferred properties but implies no
194 * extra property being set */
195 #define DSPROPERTY_EAXBUFFER_COMMITDEFERREDSETTINGS 0x00000000
197 typedef struct _EAX20BUFFERPROPERTIES {
198 LONG lDirect;
199 LONG lDirectHF;
200 LONG lRoom;
201 LONG lRoomHF;
202 FLOAT flRoomRolloffFactor;
203 LONG lObstruction;
204 FLOAT flObstructionLFRatio;
205 LONG lOcclusion;
206 FLOAT flOcclusionLFRatio;
207 FLOAT flOcclusionRoomRatio;
208 LONG lOutsideVolumeHF;
209 FLOAT flAirAbsorptionFactor;
210 DWORD dwFlags;
211 } EAX20BUFFERPROPERTIES, *LPEAX20BUFFERPROPERTIES;
213 /* Flags that affect lDirectHF, lRoom, and lRoomHF */
214 #define EAXBUFFERFLAGS_DIRECTHFAUTO 0x00000001
215 #define EAXBUFFERFLAGS_ROOMAUTO 0x00000002
216 #define EAXBUFFERFLAGS_ROOMHFAUTO 0x00000004