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