forked from Phobos-developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Audio.h
185 lines (156 loc) · 3.25 KB
/
Audio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#ifndef AUDIO_H_
#define AUDIO_H_
#include <GeneralDefinitions.h>
class RawFileClass;
class CCFileClass;
class AudioIDXHeader {
unsigned int Magic;
unsigned int Version;
unsigned int numSamples;
};
class AudioIDXEntry { // assert (IDXHeader.version != 1);
char Name[16];
unsigned int Offset;
unsigned int Size;
unsigned int SampleRate;
unsigned int Flags;
unsigned int ChunkSize;
};
class AudioIDXData {
public:
static AudioIDXData * &IDX;
static AudioIDXData* __fastcall Create(const char *Filename, const char *extra)
{ JMP_STD(0x4011C0); };
~AudioIDXData()
{ JMP_THIS(0x401580); }
unsigned int __fastcall FindSampleIndex(const char *SoundName)
{ JMP_STD(0x4015C0); }
const char * __fastcall GetSampleName(unsigned int SoundIndex)
{ JMP_STD(0x401600); }
unsigned int __fastcall GetSampleSize(unsigned int SoundIndex)
{ JMP_STD(0x401620); }
AudioIDXEntry *Samples;
unsigned int cntSamples;
DWORD field_08;
DWORD field_0C;
DWORD field_10;
DWORD field_14;
DWORD field_18;
DWORD field_1C;
DWORD field_20;
DWORD field_24;
DWORD field_28;
DWORD field_2C;
DWORD field_30;
DWORD field_34;
DWORD field_38;
DWORD field_3C;
DWORD field_40;
DWORD field_44;
DWORD field_48;
DWORD field_4C;
DWORD field_50;
DWORD field_54;
DWORD field_58;
DWORD field_5C;
DWORD field_60;
DWORD field_64;
DWORD field_68;
DWORD field_6C;
DWORD field_70;
DWORD field_74;
DWORD field_78;
DWORD field_7C;
DWORD field_80;
DWORD field_84;
DWORD field_88;
DWORD field_8C;
DWORD field_90;
DWORD field_94;
DWORD field_98;
DWORD field_9C;
DWORD field_A0;
DWORD field_A4;
DWORD field_A8;
DWORD field_AC;
DWORD field_B0;
DWORD field_B4;
DWORD field_B8;
DWORD field_BC;
DWORD field_C0;
DWORD field_C4;
DWORD field_C8;
DWORD field_CC;
DWORD field_D0;
DWORD field_D4;
DWORD field_D8;
DWORD field_DC;
DWORD field_E0;
DWORD field_E4;
DWORD field_E8;
DWORD field_EC;
DWORD field_F0;
DWORD field_F4;
DWORD field_F8;
DWORD field_FC;
DWORD field_100;
DWORD field_104;
DWORD field_108;
CCFileClass *File;
DWORD field_110; // something with a vtable
DWORD field_114;
DWORD field_118;
DWORD field_11C;
DWORD field_120;
};
class Audio {
public:
static bool __fastcall ReadWAVFile(RawFileClass *file, void *AudioSample, int *result)
{ JMP_STD(0x408610); }
};
class AudioStream {
public:
static AudioStream* &Instance;
bool __fastcall PlayWAV(const char * filename, bool bUnk)
{ JMP_STD(0x407B60); }
};
struct TauntDataStruct {
DWORD tauntIdx: 4;
DWORD countryIdx :4;
};
struct AudioController
{
static DWORD * &Audio_IDX_Container;
DWORD f_0;
DWORD f_4;
DWORD f_8;
DWORD *f_C;
DWORD f_10;
AudioController()
{
this->f_0 = this->f_4 = this->f_8 = 0;
this->f_C = Audio_IDX_Container;
}
// no idea how these differ really
void DTOR_0()
{ JMP_THIS(0x405C00); }
void DTOR_1()
{ JMP_THIS(0x405D40); }
void DTOR_2()
{ JMP_THIS(0x405FD0); }
void ShutUp()
{ JMP_THIS(0x406060); }
void __fastcall sub_4060F0(int a1, int a2)
{ JMP_STD(0x4060F0); }
void sub_406130()
{ JMP_THIS(0x406130); }
void sub_406170()
{ JMP_THIS(0x406170); }
void __fastcall sub_4061D0(unsigned int arg)
{ JMP_STD(0x4061D0); }
void __fastcall sub_406270(unsigned int arg)
{ JMP_THIS(0x406270); }
void sub_406310()
{ JMP_THIS(0x406310); }
};
#endif