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