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