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