annotate Media/Audio/AudioPlayer.h @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents d87bfbd3bb3b
children
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,
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
77 SOUND_enter = 6,
2540
a.parshin
parents: 2534
diff changeset
78 SOUND_WoodDoorClosing = 7,
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
79 SOUND_fireBall = 0x8,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
80 SOUND_ClickMinus = 0x14,//20
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
81 SOUND_ClickMovingSelector = 0x15,//21
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
82 SOUND_ClickPlus = 0x17,//23
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
83 SOUND_ClickSkill = 0x18,//24
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
84 SOUND_error = 27,
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
85 SOUND_metal_vs_metal03h = 47,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
86 SOUND_48 = 0x30,
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
87 SOUND_RunBadlands = 49,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
88 SOUND_RunCarpet = 50,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
89 SOUND_RunCooledLava = 51,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
90 SOUND_RunDesert = 52,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
91 SOUND_RunDirt = 53,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
92 SOUND_RunGrass = 54,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
93 SOUND_RunRoad = 57,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
94 SOUND_RunSnow = 58,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
95 SOUND_RunSwamp = 61,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
96 SOUND_RunWater = 62,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
97 SOUND_RunWaterIndoor = 63,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
98 SOUND_RunWood = 64,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
99 SOUND_SelectingANewCharacter = 66,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
100 SOUND_shoot_blaster01 = 67,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
101 SOUND_shoot_bow01 = 71,
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
102 SOUND_StartMainChoice02 = 75,
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
103 SOUND_swing_with_axe01 = 78,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
104 SOUND_swing_with_axe03 = 80,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
105 SOUND_swing_with_blunt_weapon01 = 81,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
106 SOUND_swing_with_blunt_weapon03 = 83,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
107 SOUND_swing_with_sword01 = 84,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
108 SOUND_swing_with_sword02 = 85,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
109 SOUND_WalkBadlands = 88,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
110 SOUND_WalkCarpet = 89,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
111 SOUND_WalkCooledLava = 90,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
112 SOUND_WalkDesert = 91,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
113 SOUND_WalkDirt = 92,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
114 SOUND_WalkGrass = 93,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
115 SOUND_WalkRoad = 96,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
116 SOUND_WalkSnow = 97,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
117 SOUND_WalkSwamp = 100,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
118 SOUND_WalkWater = 101,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
119 SOUND_WalkWaterIndoor = 102,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
120 SOUND_WalkWood = 103,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
121 SOUND_bricks_down = 0x78,//120
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
122 SOUND_bricks_up = 0x79,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
123 SOUND_damage = 0x7A,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
124 SOUND_deal = 0x7B,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
125 SOUND_defeat = 0x7C,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
126 SOUND_querry_up = 0x7D,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
127 SOUND_querry_down = 0x7E,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
128 SOUND_shuffle = 0x7F,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
129 SOUND_title = 0x80,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
130 SOUND_tower_up = 0x81,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
131 SOUND_typing = 0x82,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
132 SOUND_victory = 0x83,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
133 SOUND_wall_up = 0x84,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
134 SOUND_luteguitar = 133, // 85
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
135 SOUND_panflute = 134, // 86
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
136 SOUND_trumpet = 135, // 87
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
137 SOUND_gold01 = 0xC8,//200
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
138 SOUND_heal = 202,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
139 SOUND_fizzle = 203,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
140 SOUND_TurnPageU = 204,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
141 SOUND_batlleen = 206,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
142 SOUND_batllest = 207,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
143 SOUND_openchest0101 = 208,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
144 SOUND_spellfail0201 = 0xD1,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
145 SOUND_drink = 0xD2,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
146 SOUND_eat = 211, // D3
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
147 SOUND_gong = 0xD7,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
148 SOUND_hurp = 0xD9,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
149 SOUND_church = 0xDA, //218
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
150 SOUND_chimes = 0xDB,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
151 SOUND_splash = 220,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
152 SOUND_star1 = 0xDD,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
153 SOUND_star2 = 0xDE,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
154 SOUND_star4 = 0xE0,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
155 SOUND_eradicate = 0xE1,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
156 SOUND_eleccircle = 0xE2,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
157 SOUND_encounter = 0xE3,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
158 SOUND_openbook = 230,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
159 SOUND_closebook = 231,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
160 SOUND_hf445a = 5788,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
161 SOUND_Haste = 10040,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
162 SOUND_21fly03 = 11090,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
163 SOUND_WaterWalk = 12040,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
164 SOUND_Stoneskin = 13040,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
165 SOUND_Bless = 14010,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
166 SOUND_Fate = 14020,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
167 SOUND_51heroism03 = 14060,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
168 SOUND_94dayofprotection03 = 17070,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
169 SOUND_9armageddon01 = 17080,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
170 SOUND_Sacrifice2 = 18060,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
171 SOUND_quest = 20001,
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
172
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
173 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
174
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
175
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
176 enum MusicID: unsigned __int32
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
177 {
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2540
diff changeset
178 MUSIC_MainMenu = 14,
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2540
diff changeset
179 MUSIC_Credits = 15
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
180 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
181
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
182 /* 20 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
183 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
184 struct AudioPlayer
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
185 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
186 //----- (004A9669) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
187 AudioPlayer():
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
188 bPlayerReady(false), b3DSoundInitialized(false),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
189 hAILRedbook(nullptr), hStream(nullptr)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
190 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
191 /*AudioPlayer_3DSample *v0; //ecx@1
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
192 signed int v1; //edi@1
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
193
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
194 v0 = p3DSamples;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
195 v1 = 32;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
196 do
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
197 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
198 v0->field_4 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
199 v0->field_8 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
200 v0->field_C = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
201 v0->hSample = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
202 ++v0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
203 --v1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
204 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
205 while (v1);*/
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
206 uMixerChannels = 16;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
207 field_2D0_time_left = 256;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
208 uNumRedbookTracks = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
209 uCurrentMusicTrackLength = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
210 field_2D4 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
211 s3DSoundVolume = 127;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
212 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
213 inline ~AudioPlayer(){ Release(); };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
214 void SetMusicVolume(int vol);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
215 void SetMasterVolume(float fVolume);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
216 void _4AA258(int a2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
217 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
218 void UpdateSounds();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
219 void StopChannels(int uStartChannel, int uEndChannel);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
220 void LoadAudioSnd();//
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
221 void Initialize();//
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
222 void CheckA3DSupport(bool query);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
223 void Release();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
224 void FreeChannel(MixerChannel *pChannel);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
225 void _4ABF23(AudioPlayer_3DSample *a2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
226 void SetEAXPreferences();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
227 void SetMapEAX();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
228 int _4AC0A2();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
229 void PlayMusicTrack(enum MusicID eTrack);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
230 void MessWithChannels();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
231
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
232
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
233 unsigned int bEAXSupported;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
234 unsigned int b3DSoundInitialized;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
235 int s3DSoundVolume;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
236 struct _PROVIDER *h3DSoundProvider;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
237 int uNum3DSamples;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
238 struct AudioPlayer_3DSample p3DSamples[32];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
239 int field_214;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
240 int sRedbookVolume;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
241 char p3DSoundProvider[128];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
242 unsigned int bPlayerReady;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
243 //HWND hWindow;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
244 class OSWindow *window;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
245 struct _REDBOOK *hAILRedbook;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
246 struct _DIG_DRIVER *hDigDriver;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
247 int dword_0002AC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
248 struct _SEQUENCE *hSequence;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
249 int dword_0002B4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
250 struct SoundHeader *pSoundHeaders;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
251 HANDLE hAudioSnd;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
252 unsigned int uNumSoundHeaders;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
253 unsigned int uMasterVolume;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
254 int dword_0002C8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
255 int dword_0002CC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
256 int field_2D0_time_left;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
257 int field_2D4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
258 unsigned int uCurrentMusicTrackLength;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
259 unsigned int uNumRedbookTracks;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
260 unsigned int uCurrentMusicTrackStartMS;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
261 unsigned int uCurrentMusicTrackEndMS;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
262 struct MixerChannel pMixerChannels[16];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
263 int uMixerChannels;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
264 int field_3EC;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
265 char pDeviceNames[16][128];
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2506
diff changeset
266 int pFrequency[16];
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
267 int array_000C30[16];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
268 unsigned int uNumDevices;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
269 struct _STREAM *hStream;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
270 char field_C78[8];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
271 int cGameCDDriveLetter;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
272 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
273 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
274
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
275
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
276
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
277
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
278
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 /* 325 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
283 enum SOUND_DESC_TYPE : __int32
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
284 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
285 SOUND_DESC_LEVEL = 0x0,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
286 SOUND_DESC_SYSTEM = 0x1,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
287 SOUND_DESC_SWAP = 0x2,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
288 SOUND_DESC_3 = 0x3,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
289 SOUND_DESC_LOCK = 0x4,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
290 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
291
2506
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
292 struct TSearchRec
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
293 {
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
294 int Time;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
295 int Size;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
296 int Attr;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
297 char Name[32];
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
298 int ExcludeAttr;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
299 int FindHandle;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
300 _WIN32_FIND_DATAA FindData;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
301 } ;
9b96a51011fb for sound
Ritor1
parents: 2502
diff changeset
302
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
303 /* 326 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
304 enum SOUND_DESC_FLAGS
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
305 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
306 SOUND_DESC_LOCKED = 0x1,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
307 SOUND_DESC_3D = 0x2,
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
308 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
309
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
310
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
311 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
312 struct SoundData
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
313 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
314 unsigned int uDataSize;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
315 char pData[1];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
316 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
317
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
318 struct SoundDesc_mm6
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
319 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
320 inline bool Is3D() {return (uFlags & SOUND_DESC_3D) != 0;}
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
321
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
322 char pSoundName[32];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
323 unsigned int uSoundID;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
324 SOUND_DESC_TYPE eType;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
325 int uFlags;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
326 SoundData *pSoundData[17];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
327 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
328
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
329 struct SoundDesc: public SoundDesc_mm6
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
330 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
331 void *p3DSound;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
332 int bDecompressed;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
333 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
334 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
335
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
336
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
337
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
338 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
339 struct SoundList
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
340 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
341 inline SoundList():
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
342 sNumSounds(0), pSL_Sounds(nullptr), uTotalLoadedSoundSize(0)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
343 {}
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
344
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
345 void Initialize();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
346 __int16 LoadSound(int a1, unsigned int a3);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
347 int LoadSound(unsigned int a2, LPVOID lpBuffer, int uBufferSizeLeft, int *pOutSoundSize, int a6);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
348 SoundDesc *Release();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
349 void _4A9D79(int a2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
350 void UnloadSound(unsigned int uSoundID, char a3);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
351 void ToFile();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
352 void FromFile(void *data_mm6, void *data_mm7, void *data_mm8);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
353 int FromFileTxt(const char *Args);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
354
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
355 signed int sNumSounds;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
356 SoundDesc *pSL_Sounds;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
357 unsigned int uTotalLoadedSoundSize;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
358 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
359 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
360
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
361
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
362
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
363
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
364
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
365 /* 241 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
366 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
367 struct Sound
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
368 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
369 unsigned int uID;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
370 char SoundName[120];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
371 SoundData *pSoundData;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
372 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
373 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
374
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
375
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
376
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
377
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
378 extern int Aureal3D_SplashScreen;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
379 extern int Aureal3D_SplashAudio;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
380 extern int uFindSound_BinSearch_ResultID; // weak
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
381 extern int uLastLoadedSoundID; // weak
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
382 extern int sLastTrackLengthMS;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
383 extern std::array<Sound, 3000> pSounds;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
384 extern AudioPlayer *pAudioPlayer;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
385 extern SoundList *pSoundList;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
386
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
387 extern unsigned __int8 uSoundVolumeMultiplier;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
388 extern unsigned __int8 uVoicesVolumeMultiplier;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
389 extern unsigned __int8 uMusicVolimeMultiplier;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
390 extern int bWalkSound; // idb
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
391
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
392 extern std::array<float, 10> pSoundVolumeLevels; // idb
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
393
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
394
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
395
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
396
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
397
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
398
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
399
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
400
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
401 /* 379 */
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
402 #pragma pack(push, 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
403 struct stru339_spell_sound
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
404 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
405 int AddPartySpellSound(int uSoundID, int a6);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
406
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
407 char pSounds[44744];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
408 int field_AEC8[45];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
409 int field_AF7C[18];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
410 int field_AFC4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
411 int pSoundsSizes[2];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
412 int pSoundsOffsets[2];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
413 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
414 #pragma pack(pop)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
415 extern std::array<stru339_spell_sound, 4> stru_A750F8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
416 extern std::array<stru339_spell_sound, 4> AA1058_PartyQuickSpellSound;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
417
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
418 struct SoundHeader *FindSound_BinSearch(unsigned int uStart, unsigned int uEnd, const char *pName);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
419 struct SoundData *LoadSound(const char *pSoundName, struct SoundData *pOutBuff, unsigned int uID);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
420 int __fastcall sub_4AB66C(int, int); // weak
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
421 int GetSoundStrengthByDistanceFromParty(int x, int y, int z);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
422 void PlayLevelMusic();