0
|
1 #pragma once
|
|
2 #include "OSAPI.h"
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10 #pragma pack(push, 1)
|
|
11 struct _PROVIDER {char unk_0;};
|
|
12 struct _SAMPLE {char unk_0;};
|
|
13 //struct _STREAM {char unk_0;};
|
|
14 struct _REDBOOK {char unk_0;};
|
|
15 struct _DIG_DRIVER {char unk_0;};
|
|
16 struct _SEQUENCE {char unk_0;};
|
|
17 #pragma pack(pop)
|
|
18
|
|
19
|
|
20
|
|
21 /* 22 */
|
|
22 #pragma pack(push, 1)
|
|
23 struct AudioPlayer_3DSample
|
|
24 {
|
|
25 inline AudioPlayer_3DSample()
|
|
26 {
|
|
27 hSample = 0;
|
|
28 field_4 = 0;
|
|
29 field_8 = 0;
|
|
30 field_C = 0;
|
|
31 }
|
|
32
|
|
33 void *hSample;
|
|
34 int field_4;
|
|
35 int field_8;
|
|
36 int field_C;
|
|
37 };
|
|
38 #pragma pack(pop)
|
|
39
|
|
40
|
|
41
|
|
42
|
|
43 /* 26 */
|
|
44 #pragma pack(push, 1)
|
|
45 struct SoundHeader
|
|
46 {
|
|
47 char pSoundName[40];
|
|
48 unsigned int uFileOffset;
|
|
49 unsigned int uCompressedSize;
|
|
50 unsigned int uDecompressedSize;
|
|
51 };
|
|
52 #pragma pack(pop)
|
|
53
|
|
54 /* 27 */
|
|
55 #pragma pack(push, 1)
|
|
56 struct MixerChannel
|
|
57 {
|
|
58 inline MixerChannel():
|
|
59 hSample(nullptr), dword_000004(0), uSourceTrackIdx(0), uSourceTrackID(0)
|
|
60 {}
|
|
61
|
|
62 _SAMPLE *hSample;
|
|
63 int dword_000004;
|
|
64 unsigned int uSourceTrackIdx;
|
|
65 unsigned int uSourceTrackID;
|
|
66 };
|
|
67 #pragma pack(pop)
|
|
68
|
|
69
|
|
70
|
|
71
|
|
72
|
|
73 /* 308 */
|
|
74 enum SoundID
|
|
75 {
|
|
76 SOUND_0 = 0,
|
|
77 SOUND_EnteringAHouse = 0x6,
|
|
78 SOUND_8 = 0x8,
|
|
79 SOUND_27 = 0x1B,
|
187
|
80 SOUND_Button = 66,
|
295
|
81 SOUND_67 = 67,
|
|
82 SOUND_71 = 71,
|
|
83 SOUND_78 = 78,
|
|
84 SOUND_80 = 80,
|
|
85 SOUND_81 = 81,
|
|
86 SOUND_83 = 83,
|
|
87 SOUND_84 = 84,
|
|
88 SOUND_85 = 85,
|
0
|
89 SOUND_Arcomage_LoseResources = 0x78,
|
|
90 SOUND_Arcomage_AddResources = 0x79,
|
|
91 SOUND_Arcomage_TowerWallDamage = 0x7A,
|
|
92 SOUND_Arcomage_DrawCard = 0x7B,
|
|
93 SOUND_Arcomage_ProductionDamage = 0x7D,
|
|
94 SOUND_Arcomage_ProductionUpgrade = 0x7E,
|
|
95 SOUND_Arcomage_127 = 0x7F,
|
|
96 SOUND_Arcomage_128 = 0x80,
|
|
97 SOUND_Arcomage_TowerUpgrade = 0x81,
|
|
98 SOUND_Arcomage_WallUpgrade = 0x84,
|
|
99 SOUND_GoldReceived = 0xC8,
|
|
100 SOUND_PlayerCantCastSpell = 0xD1,
|
|
101 SOUND_Bell = 0xD9,
|
|
102 SOUND_20001 = 0x4E21,
|
|
103 };
|
|
104
|
|
105
|
|
106 enum MusicID: unsigned __int32
|
|
107 {
|
|
108 MUSIC_Credits = 15
|
|
109 };
|
|
110
|
|
111 /* 20 */
|
|
112 #pragma pack(push, 1)
|
|
113 struct AudioPlayer
|
|
114 {
|
|
115 //----- (004A9669) --------------------------------------------------------
|
|
116 AudioPlayer():
|
|
117 bPlayerReady(false), b3DSoundInitialized(false),
|
|
118 hAILRedbook(nullptr), hStream(nullptr)
|
|
119 {
|
|
120 /*AudioPlayer_3DSample *v0; //ecx@1
|
|
121 signed int v1; //edi@1
|
|
122
|
|
123 v0 = p3DSamples;
|
|
124 v1 = 32;
|
|
125 do
|
|
126 {
|
|
127 v0->field_4 = 0;
|
|
128 v0->field_8 = 0;
|
|
129 v0->field_C = 0;
|
|
130 v0->hSample = 0;
|
|
131 ++v0;
|
|
132 --v1;
|
|
133 }
|
|
134 while (v1);*/
|
|
135 uMixerChannels = 16;
|
|
136 field_2D0_time_left = 256;
|
|
137 uNumRedbookTracks = 0;
|
|
138 uCurrentMusicTrackLength = 0;
|
|
139 field_2D4 = 0;
|
|
140 s3DSoundVolume = 127;
|
|
141 }
|
|
142
|
|
143 void SetMusicVolume(int vol);
|
328
|
144 void SetMasterVolume(float fVolume);
|
0
|
145 void _4AA258(int a2);
|
|
146 void PlaySound(SoundID eSoundID, signed int a3, unsigned int uNumRepeats, signed int a5, signed int a6, int a7, unsigned int uVolume, int sPlaybackRate);
|
|
147 void _4AAFCF();
|
|
148 void StopChannels(int uStartChannel, int uEndChannel);
|
|
149 void LoadAudioSnd();
|
|
150 void Initialize(HWND hWnd);
|
|
151 LSTATUS CheckA3DSupport(char a2);
|
|
152 void Release();
|
|
153 void _4ABE55(MixerChannel *pChannel);
|
|
154 void _4ABF23(AudioPlayer_3DSample *a2);
|
|
155 void SetEAXPreferences();
|
|
156 void SetMapEAX();
|
|
157 int _4AC0A2();
|
|
158 void PlayMusicTrack(enum MusicID eTrack);
|
|
159 void __cdecl MessWithChannels();
|
|
160
|
|
161
|
|
162 unsigned int bEAXSupported;
|
|
163 unsigned int b3DSoundInitialized;
|
|
164 int s3DSoundVolume;
|
|
165 struct _PROVIDER *h3DSoundProvider;
|
|
166 int uNum3DSamples;
|
|
167 struct AudioPlayer_3DSample p3DSamples[32];
|
|
168 int field_214;
|
|
169 int sRedbookVolume;
|
|
170 char p3DSoundProvider[128];
|
|
171 unsigned int bPlayerReady;
|
|
172 HWND hWindow;
|
|
173 struct _REDBOOK *hAILRedbook;
|
|
174 struct _DIG_DRIVER *hDigDriver;
|
|
175 int dword_0002AC;
|
|
176 struct _SEQUENCE *hSequence;
|
|
177 int dword_0002B4;
|
|
178 struct SoundHeader *pSoundHeaders;
|
|
179 HANDLE hAudioSnd;
|
|
180 unsigned int uNumSoundHeaders;
|
|
181 unsigned int uMasterVolume;
|
|
182 int dword_0002C8;
|
|
183 int dword_0002CC;
|
|
184 int field_2D0_time_left;
|
|
185 int field_2D4;
|
|
186 unsigned int uCurrentMusicTrackLength;
|
|
187 unsigned int uNumRedbookTracks;
|
|
188 unsigned int uCurrentMusicTrackStartMS;
|
|
189 unsigned int uCurrentMusicTrackEndMS;
|
|
190 struct MixerChannel pMixerChannels[16];
|
|
191 int uMixerChannels;
|
|
192 int field_3EC;
|
|
193 char pDeviceNames[16][128];
|
|
194 int array_000BF0[16];
|
|
195 int array_000C30[16];
|
|
196 unsigned int uNumDevices;
|
|
197 struct _STREAM *hStream;
|
|
198 char field_C78[8];
|
|
199 int cGameCDDriveLetter;
|
|
200 };
|
|
201 #pragma pack(pop)
|
|
202
|
|
203
|
|
204
|
|
205
|
|
206
|
|
207
|
|
208
|
|
209
|
|
210 /* 325 */
|
|
211 enum SOUND_DESC_TYPE : __int32
|
|
212 {
|
|
213 SOUND_DESC_LEVEL = 0x0,
|
|
214 SOUND_DESC_SYSTEM = 0x1,
|
|
215 SOUND_DESC_SWAP = 0x2,
|
|
216 SOUND_DESC_3 = 0x3,
|
|
217 SOUND_DESC_LOCK = 0x4,
|
|
218 };
|
|
219
|
|
220 /* 326 */
|
|
221 enum SOUND_DESC_FLAGS
|
|
222 {
|
|
223 SOUND_DESC_LOCKED = 0x1,
|
|
224 SOUND_DESC_3D = 0x2,
|
|
225 };
|
|
226
|
|
227
|
|
228
|
|
229
|
|
230 #pragma pack(push, 1)
|
|
231 struct SoundData
|
|
232 {
|
|
233 unsigned int uDataSize;
|
|
234 char pData[1];
|
|
235 };
|
|
236
|
|
237 struct SoundDesc
|
|
238 {
|
|
239 char pSoundName[32];
|
|
240 unsigned int uSoundID;
|
|
241 SOUND_DESC_TYPE eType;
|
|
242 int uFlags;
|
|
243 SoundData *pSoundData[17];
|
|
244 void *p3DSound;
|
|
245 int bDecompressed;
|
|
246 };
|
|
247 #pragma pack(pop)
|
|
248
|
|
249
|
|
250
|
|
251 #pragma pack(push, 1)
|
|
252 struct SoundList
|
|
253 {
|
|
254 inline SoundList():
|
|
255 uNumSounds(0), pSounds(nullptr), uTotalLoadedSoundSize(0)
|
|
256 {}
|
|
257
|
|
258 void Initialize();
|
|
259 __int16 LoadSound(int a1, unsigned int a3);
|
|
260 int LoadSound(unsigned int a2, LPVOID lpBuffer, int uBufferSizeLeft, int *pOutSoundSize, int a6);
|
|
261 SoundDesc *Release();
|
|
262 void _4A9D79(int a2);
|
|
263 void _4A9DCD(unsigned int uSoundID, char a3);
|
|
264 void ToFile();
|
|
265 void *FromFile(void *pSerialized);
|
|
266 int FromFileTxt(const char *Args);
|
|
267
|
|
268 unsigned int uNumSounds;
|
|
269 SoundDesc *pSounds;
|
|
270 unsigned int uTotalLoadedSoundSize;
|
|
271 };
|
|
272 #pragma pack(pop)
|
|
273
|
|
274
|
|
275
|
|
276
|
|
277
|
|
278 /* 241 */
|
|
279 #pragma pack(push, 1)
|
|
280 struct Sound
|
|
281 {
|
|
282 unsigned int uID;
|
24
|
283 char SoundName[120];
|
0
|
284 SoundData *pSoundData;
|
|
285 };
|
|
286 #pragma pack(pop)
|
|
287
|
|
288
|
|
289
|
|
290
|
|
291 extern int Aureal3D_SplashScreen;
|
|
292 extern int Aureal3D_SplashAudio;
|
|
293 extern int uFindSound_BinSearch_ResultID; // weak
|
|
294 extern int uLastLoadedSoundID; // weak
|
|
295 extern int sLastTrackLengthMS;
|
|
296 extern Sound pSounds[3000];
|
|
297 extern AudioPlayer *pAudioPlayer;
|
|
298 extern SoundList *pSoundList;
|
|
299
|
|
300 extern unsigned __int8 uSoundVolumeMultiplier;
|
|
301 extern unsigned __int8 uVoicesVolumeMultiplier;
|
|
302 extern unsigned __int8 uMusicVolimeMultiplier;
|
|
303 extern int bWalkSound; // idb
|
|
304
|
|
305 extern float pSoundVolumeLevels[10]; // idb
|
|
306
|
|
307
|
|
308
|
|
309
|
|
310
|
|
311
|
|
312
|
|
313
|
|
314 /* 379 */
|
|
315 #pragma pack(push, 1)
|
|
316 struct stru339_spell_sound
|
|
317 {
|
|
318 int _494836(int uSoundID, int a6);
|
|
319
|
|
320 char pSounds[44744];
|
|
321 int field_AEC8[45];
|
|
322 int field_AF7C[18];
|
|
323 int field_AFC4;
|
|
324 int pSoundsSizes[2];
|
|
325 int pSoundsOffsets[2];
|
|
326 };
|
|
327 #pragma pack(pop)
|
|
328 extern stru339_spell_sound stru_A750F8[4];
|
|
329 extern stru339_spell_sound stru_AA1058[4];
|