annotate Media/Audio/AudioPlayer.h @ 2527:8f12e6a1fcc2

Party creation arrow fix
author a.parshin
date Mon, 13 Oct 2014 14:58:54 +0300
parents 9b96a51011fb
children 1bcadc6dd203
rev   line source
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
1 #pragma once
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
2 #include "OSAPI.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
3 #include "Media/MediaPlayer.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
4
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
5
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
6
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
7
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
8
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
9
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
10 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
11 struct _PROVIDER {char unk_0;};
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
12 struct _SAMPLE {char unk_0;};
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
13 //struct _STREAM {char unk_0;};
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
14 struct _REDBOOK {char unk_0;};
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
15 struct _DIG_DRIVER {char unk_0;};
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
16 struct _SEQUENCE {char unk_0;};
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
17 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
18
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
19
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
20
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
21 /* 22 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
22 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
23 struct AudioPlayer_3DSample
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
24 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
25 inline AudioPlayer_3DSample()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
26 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
27 hSample = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
28 field_4 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
29 field_8 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
30 field_C = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
31 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
32
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
33 void *hSample;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
34 int field_4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
35 int field_8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
36 int field_C;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
37 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
38 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
39
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
40
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
41
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
42
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
43 /* 26 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
44 /*#pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
45 struct SoundHeader
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
46 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
47 char pSoundName[40];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
48 unsigned int uFileOffset;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
49 unsigned int uCompressedSize;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
50 unsigned int uDecompressedSize;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
51 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
52 #pragma pack(pop)*/
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
53
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
54 /* 27 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
55 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
56 struct MixerChannel
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
57 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
58 inline MixerChannel():
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
59 hSample(nullptr), source_pid(0), uSourceTrackIdx(0), uSourceTrackID(0)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
60 {}
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
61
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
62 _SAMPLE *hSample;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
63 int source_pid;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
64 unsigned int uSourceTrackIdx;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
65 unsigned int uSourceTrackID;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
66 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
67 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
68
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
69
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
70
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
71
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
72
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
73 /* 308 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
74 enum SoundID
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
75 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
76 SOUND_Invalid = 0,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
77 SOUND_EnteringAHouse = 6,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
78 SOUND_WoodDRClose = 7,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
79 SOUND_Explosion = 0x8,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
80 SOUND_20 = 0x14,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
81 SOUND_21 = 0x15,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
82 SOUND_23 = 0x17,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
83 SOUND_24 = 0x18,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
84 SOUND_error = 27,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
85 SOUND_47 = 0x2F,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
86 SOUND_48 = 0x30,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
87 SOUND_50 = 50,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
88 SOUND_RunAlongWater = 63,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
89 SOUND_RunAlong3DModel = 64,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
90 SOUND_Button = 66,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
91 SOUND_67 = 67,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
92 SOUND_71 = 71,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
93 SOUND_StartMainChoice02 = 75,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
94 SOUND_78 = 78,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
95 SOUND_80 = 80,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
96 SOUND_81 = 81,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
97 SOUND_83 = 83,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
98 SOUND_84 = 84,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
99 SOUND_85 = 85,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
100 SOUND_89 = 89,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
101 SOUND_WalkAlongWater = 102,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
102 SOUND_WalkAlong3DModel = 103,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
103 SOUND_Arcomage_LoseResources = 0x78,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
104 SOUND_Arcomage_AddResources = 0x79,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
105 SOUND_Arcomage_TowerWallDamage = 0x7A,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
106 SOUND_Arcomage_DrawCard = 0x7B,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
107 SOUND_Arcomage_124 = 0x7C,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
108 SOUND_Arcomage_ProductionDamage = 0x7D,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
109 SOUND_Arcomage_ProductionUpgrade = 0x7E,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
110 SOUND_Arcomage_127 = 0x7F,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
111 SOUND_Arcomage_128 = 0x80,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
112 SOUND_Arcomage_TowerUpgrade = 0x81,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
113 SOUND_Arcomage_130 = 0x82,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
114 SOUND_Arcomage_131 = 0x83,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
115 SOUND_Arcomage_WallUpgrade = 0x84,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
116 SOUND_PlayLute = 133, // 85
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
117 SOUND_PlayFaeriePipes = 134, // 86
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
118 SOUND_PlayGryphonheartsTrumpet = 135, // 87
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
119 SOUND_GoldReceived = 0xC8,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
120 SOUND_203 = 203,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
121 SOUND_204 = 204,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
122 SOUND_206 = 206,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
123 SOUND_207 = 207,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
124 SOUND_OpenChest = 208,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
125 SOUND_PlayerCantCastSpell = 0xD1,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
126 SOUND_210 = 0xD2,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
127 SOUND_EatApple = 211, // D3
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
128 SOUND_215 = 0xD7,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
129 SOUND_Bell = 0xD9,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
130 SOUND_shurch = 0xDA, //218
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
131 SOUND_219 = 0xDB,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
132 SOUND_221 = 0xDD,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
133 SOUND_222 = 0xDE,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
134 SOUND_224 = 0xE0,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
135 SOUND_225 = 0xE1,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
136 SOUND_226 = 0xE2,
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
137 SOUND_227 = 0xE3,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
138 SOUND_OpenBook = 230,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
139 SOUND_CloseBook = 231,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
140 SOUND_hf445a = 0x169C,
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
141 SOUND_11090 = 11090,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
142 SOUND_12040 = 12040,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
143 SOUND_Arena_Welcome = 14060,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
144 SOUND_20001 = 0x4E21,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
145 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
146
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
147
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
148 enum MusicID: unsigned __int32
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
149 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
150 MUSIC_Credits = 15
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
151 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
152
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
153 /* 20 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
154 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
155 struct AudioPlayer
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
156 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
157 //----- (004A9669) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
158 AudioPlayer():
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
159 bPlayerReady(false), b3DSoundInitialized(false),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
160 hAILRedbook(nullptr), hStream(nullptr)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
161 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
162 /*AudioPlayer_3DSample *v0; //ecx@1
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
163 signed int v1; //edi@1
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
164
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
165 v0 = p3DSamples;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
166 v1 = 32;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
167 do
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
168 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
169 v0->field_4 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
170 v0->field_8 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
171 v0->field_C = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
172 v0->hSample = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
173 ++v0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
174 --v1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
175 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
176 while (v1);*/
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
177 uMixerChannels = 16;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
178 field_2D0_time_left = 256;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
179 uNumRedbookTracks = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
180 uCurrentMusicTrackLength = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
181 field_2D4 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
182 s3DSoundVolume = 127;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
183 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
184 inline ~AudioPlayer(){ Release(); };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
185 void SetMusicVolume(int vol);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
186 void SetMasterVolume(float fVolume);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
187 void _4AA258(int a2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
188 void PlaySound(SoundID eSoundID, signed int a3, unsigned int uNumRepeats, signed int a5, signed int a6, int a7, float uVolume, int sPlaybackRate);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
189 void UpdateSounds();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
190 void StopChannels(int uStartChannel, int uEndChannel);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
191 void LoadAudioSnd();//
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
192 void Initialize();//
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
193 void CheckA3DSupport(bool query);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
194 void Release();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
195 void FreeChannel(MixerChannel *pChannel);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
196 void _4ABF23(AudioPlayer_3DSample *a2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
197 void SetEAXPreferences();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
198 void SetMapEAX();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
199 int _4AC0A2();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
200 void PlayMusicTrack(enum MusicID eTrack);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
201 void MessWithChannels();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
202
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
203
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
204 unsigned int bEAXSupported;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
205 unsigned int b3DSoundInitialized;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
206 int s3DSoundVolume;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
207 struct _PROVIDER *h3DSoundProvider;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
208 int uNum3DSamples;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
209 struct AudioPlayer_3DSample p3DSamples[32];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
210 int field_214;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
211 int sRedbookVolume;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
212 char p3DSoundProvider[128];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
213 unsigned int bPlayerReady;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
214 //HWND hWindow;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
215 class OSWindow *window;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
216 struct _REDBOOK *hAILRedbook;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
217 struct _DIG_DRIVER *hDigDriver;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
218 int dword_0002AC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
219 struct _SEQUENCE *hSequence;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
220 int dword_0002B4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
221 struct SoundHeader *pSoundHeaders;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
222 HANDLE hAudioSnd;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
223 unsigned int uNumSoundHeaders;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
224 unsigned int uMasterVolume;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
225 int dword_0002C8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
226 int dword_0002CC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
227 int field_2D0_time_left;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
228 int field_2D4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
229 unsigned int uCurrentMusicTrackLength;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
230 unsigned int uNumRedbookTracks;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
231 unsigned int uCurrentMusicTrackStartMS;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
232 unsigned int uCurrentMusicTrackEndMS;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
233 struct MixerChannel pMixerChannels[16];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
234 int uMixerChannels;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
235 int field_3EC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
236 char pDeviceNames[16][128];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
237 int array_000BF0[16];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
238 int array_000C30[16];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
239 unsigned int uNumDevices;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
240 struct _STREAM *hStream;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
241 char field_C78[8];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
242 int cGameCDDriveLetter;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
243 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
244 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
245
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
246
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
247
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
248
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
249
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
250
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
251
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
252
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
253 /* 325 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
254 enum SOUND_DESC_TYPE : __int32
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
255 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
256 SOUND_DESC_LEVEL = 0x0,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
257 SOUND_DESC_SYSTEM = 0x1,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
258 SOUND_DESC_SWAP = 0x2,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
259 SOUND_DESC_3 = 0x3,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
260 SOUND_DESC_LOCK = 0x4,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
261 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
262
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
263 struct TSearchRec
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
264 {
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
265 int Time;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
266 int Size;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
267 int Attr;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
268 char Name[32];
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
269 int ExcludeAttr;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
270 int FindHandle;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
271 _WIN32_FIND_DATAA FindData;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
272 } ;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
273
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
274 /* 326 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
275 enum SOUND_DESC_FLAGS
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
276 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
277 SOUND_DESC_LOCKED = 0x1,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
278 SOUND_DESC_3D = 0x2,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
279 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
280
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
281
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
282 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
283 struct SoundData
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
284 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
285 unsigned int uDataSize;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
286 char pData[1];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
287 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
288
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
289 struct SoundDesc_mm6
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
290 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
291 inline bool Is3D() {return (uFlags & SOUND_DESC_3D) != 0;}
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
292
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
293 char pSoundName[32];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
294 unsigned int uSoundID;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
295 SOUND_DESC_TYPE eType;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
296 int uFlags;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
297 SoundData *pSoundData[17];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
298 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
299
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
300 struct SoundDesc: public SoundDesc_mm6
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
301 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
302 void *p3DSound;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
303 int bDecompressed;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
304 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
305 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
306
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
307
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
308
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
309 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
310 struct SoundList
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
311 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
312 inline SoundList():
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
313 sNumSounds(0), pSL_Sounds(nullptr), uTotalLoadedSoundSize(0)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
314 {}
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
315
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
316 void Initialize();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
317 __int16 LoadSound(int a1, unsigned int a3);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
318 int LoadSound(unsigned int a2, LPVOID lpBuffer, int uBufferSizeLeft, int *pOutSoundSize, int a6);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
319 SoundDesc *Release();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
320 void _4A9D79(int a2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
321 void UnloadSound(unsigned int uSoundID, char a3);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
322 void ToFile();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
323 void FromFile(void *data_mm6, void *data_mm7, void *data_mm8);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
324 int FromFileTxt(const char *Args);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
325
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
326 signed int sNumSounds;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
327 SoundDesc *pSL_Sounds;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
328 unsigned int uTotalLoadedSoundSize;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
329 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
330 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
331
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
332
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
333
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
334
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
335
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
336 /* 241 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
337 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
338 struct Sound
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
339 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
340 unsigned int uID;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
341 char SoundName[120];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
342 SoundData *pSoundData;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
343 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
344 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
345
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
346
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
347
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
348
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
349 extern int Aureal3D_SplashScreen;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
350 extern int Aureal3D_SplashAudio;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
351 extern int uFindSound_BinSearch_ResultID; // weak
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
352 extern int uLastLoadedSoundID; // weak
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
353 extern int sLastTrackLengthMS;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
354 extern std::array<Sound, 3000> pSounds;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
355 extern AudioPlayer *pAudioPlayer;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
356 extern SoundList *pSoundList;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
357
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
358 extern unsigned __int8 uSoundVolumeMultiplier;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
359 extern unsigned __int8 uVoicesVolumeMultiplier;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
360 extern unsigned __int8 uMusicVolimeMultiplier;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
361 extern int bWalkSound; // idb
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
362
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
363 extern std::array<float, 10> pSoundVolumeLevels; // idb
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
364
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
365
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
366
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
367
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
368
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
369
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
370
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
371
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
372 /* 379 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
373 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
374 struct stru339_spell_sound
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
375 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
376 int AddPartySpellSound(int uSoundID, int a6);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
377
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
378 char pSounds[44744];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
379 int field_AEC8[45];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
380 int field_AF7C[18];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
381 int field_AFC4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
382 int pSoundsSizes[2];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
383 int pSoundsOffsets[2];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
384 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
385 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
386 extern std::array<stru339_spell_sound, 4> stru_A750F8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
387 extern std::array<stru339_spell_sound, 4> AA1058_PartyQuickSpellSound;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
388
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
389 struct SoundHeader *FindSound_BinSearch(unsigned int uStart, unsigned int uEnd, const char *pName);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
390 struct SoundData *LoadSound(const char *pSoundName, struct SoundData *pOutBuff, unsigned int uID);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
391 int __fastcall sub_4AB66C(int, int); // weak
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
392 int GetSoundStrengthByDistanceFromParty(int x, int y, int z);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
393 void PlayLevelMusic();