0
|
1 #pragma once
|
|
2 #include "OSAPI.h"
|
|
3
|
|
4
|
|
5
|
|
6 /* 252 */
|
|
7 enum AILFILETYPE : __int32
|
|
8 {
|
|
9 AILFILETYPE_UNKNOWN = 0x0,
|
|
10 AILFILETYPE_PCM_WAV = 0x1,
|
|
11 AILFILETYPE_ADPCM_WAV = 0x2,
|
|
12 AILFILETYPE_OTHER_WAV = 0x3,
|
|
13 AILFILETYPE_VOC = 0x4,
|
|
14 AILFILETYPE_MIDI = 0x5,
|
|
15 AILFILETYPE_XMIDI = 0x6,
|
|
16 AILFILETYPE_7 = 0x7,
|
|
17 AILFILETYPE_XMIDI_MLS = 0x8,
|
|
18 AILFILETYPE_DLS = 0x9,
|
|
19 AILFILETYPE_MLS = 0xA,
|
|
20 AILFILETYPE_MPEG_L1_AUDIO = 0xB,
|
|
21 AILFILETYPE_MPEG_L2_AUDIO = 0xC,
|
|
22 AILFILETYPE_MPEG_L3_AUDIO = 0xD,
|
|
23 AILFILETYPE_OTHER_ASI_WAV = 0xE,
|
|
24 AILFILETYPE_OTHER_ASI_F = 0xF,
|
|
25 };
|
|
26
|
|
27
|
|
28
|
|
29 /* 253 */
|
|
30 #pragma pack(push, 1)
|
|
31 struct AILSOUNDINFO
|
|
32 {
|
|
33 int uFormat;
|
|
34 void *pData;
|
|
35 unsigned int uDataSize;
|
|
36 unsigned int uRate;
|
|
37 int uBits;
|
|
38 int uChannels;
|
|
39 unsigned int uSamples;
|
|
40 unsigned int uBlockSize;
|
|
41 void *pInitial;
|
|
42 };
|
|
43 #pragma pack(pop)
|
|
44
|
|
45
|
|
46
|
|
47
|
|
48 //Bink
|
|
49 typedef struct _BINK *HBINK;
|
|
50 typedef struct _BINKBUF *HBINKBUF;
|
|
51 //Smacker & AIL types
|
|
52 typedef struct _DIG_DRIVER *HDIGDRIVER;
|
|
53 typedef struct _SMACK *HSMACK;
|
|
54 typedef struct _SMACKBLIT *HSMACKBLIT;
|
|
55 typedef struct _SMACKBUF *HSMACKBUF;
|
|
56 //AIL
|
|
57 typedef struct _REDBOOK *HREDBOOK;
|
|
58 typedef struct _SAMPLE *HSAMPLE;
|
|
59 typedef struct _PROVIDER *HPROVIDER;
|
|
60 typedef struct _SEQUENCE *HSEQUENCE;
|
|
61 typedef struct _STREAM *HSTREAM;
|
|
62 typedef __int32 HATTRIB;
|
|
63 typedef __int32 HASISTREAM; // Handle to stream being managed by ASI codec
|
|
64
|
|
65
|
|
66
|
|
67 void MSS32_DLL_Initialize();
|
|
68
|
|
69 #define AILCALL __stdcall
|
|
70 #define AILCALLBACK __stdcall
|
|
71
|
|
72
|
|
73 typedef __int32 (AILCALLBACK FAR * AILASIFETCHCB) (unsigned __int32 user, // User value passed to ASI_open_stream()
|
|
74 void FAR *dest, // Location to which stream data should be copied by app
|
|
75 __int32 bytes_requested, // # of bytes requested by ASI codec
|
|
76 __int32 offset); // If not -1, application should seek to this point in stream
|
|
77
|
|
78 typedef HASISTREAM (AILCALL FAR *ASI_STREAM_OPEN) (unsigned __int32 user, // User value passed to fetch callback
|
|
79 AILASIFETCHCB fetch_CB, // Source data fetch handler
|
|
80 unsigned __int32 total_size); // Total size for %-done calculations (0=unknown)
|
|
81 typedef __int32 (AILCALL FAR *ASI_STREAM_PROCESS) (HASISTREAM stream, // Handle of stream
|
|
82 void FAR *buffer, // Destination for processed data
|
|
83 __int32 buffer_size); // # of bytes to return in buffer
|
|
84 typedef __int32 (AILCALL FAR *ASI_STREAM_SEEK) (HASISTREAM stream,
|
|
85 __int32 stream_offset);
|
|
86 typedef __int32 (AILCALL FAR *ASI_STREAM_CLOSE) (HASISTREAM stream);
|
|
87 typedef __int32 (AILCALL FAR *ASI_STREAM_ATTRIBUTE) (HASISTREAM stream,
|
|
88 HATTRIB attrib);
|
|
89 typedef __int32 (AILCALL FAR *ASI_STREAM_SET_PREFERENCE) (HASISTREAM stream,
|
|
90 HATTRIB preference,
|
|
91 void const FAR * value);
|
|
92
|
|
93 typedef struct
|
|
94 {
|
|
95 ASI_STREAM_OPEN ASI_stream_open;
|
|
96 ASI_STREAM_PROCESS ASI_stream_process;
|
|
97 ASI_STREAM_SEEK ASI_stream_seek;
|
|
98 ASI_STREAM_CLOSE ASI_stream_close;
|
|
99 ASI_STREAM_ATTRIBUTE ASI_stream_attribute;
|
|
100 ASI_STREAM_SET_PREFERENCE ASI_stream_set_preference;
|
|
101
|
|
102 HATTRIB INPUT_BIT_RATE;
|
|
103 HATTRIB INPUT_SAMPLE_RATE;
|
|
104 HATTRIB INPUT_BITS;
|
|
105 HATTRIB INPUT_CHANNELS;
|
|
106 HATTRIB OUTPUT_BIT_RATE;
|
|
107 HATTRIB OUTPUT_SAMPLE_RATE;
|
|
108 HATTRIB OUTPUT_BITS;
|
|
109 HATTRIB OUTPUT_CHANNELS;
|
|
110 HATTRIB POSITION;
|
|
111 HATTRIB PERCENT_DONE;
|
|
112 HATTRIB MIN_INPUT_BLOCK_SIZE;
|
|
113 HATTRIB RAW_RATE;
|
|
114 HATTRIB RAW_BITS;
|
|
115 HATTRIB RAW_CHANNELS;
|
|
116 HATTRIB REQUESTED_RATE;
|
|
117 HATTRIB REQUESTED_BITS;
|
|
118 HATTRIB REQUESTED_CHANS;
|
|
119
|
|
120 HASISTREAM stream;
|
|
121 }
|
|
122 ASISTAGE;
|
|
123
|
|
124
|
|
125
|
|
126
|
|
127 typedef void (AILCALLBACK FAR* AILSTREAMCB)(HSTREAM stream);
|
|
128 typedef struct _STREAM {
|
|
129
|
|
130 __int32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream
|
|
131 __int32 using_ASI; // 1 if using ASI decoder to uncompress stream data
|
|
132 ASISTAGE FAR *ASI; // handy pointer to our ASI coded
|
|
133
|
|
134 HSAMPLE samp; // the sample handle
|
|
135
|
|
136 unsigned __int32 fileh; // the open file handle
|
|
137
|
|
138 unsigned __int8 FAR* bufs[3]; // the data buffers
|
|
139 unsigned __int32 bufsizes[3]; // the size of each buffer
|
|
140 __int32 reset_ASI[3]; // should we reset the ASI at the end of the buffer?
|
|
141 __int32 bufstart[3]; // offset of where this buffer started
|
|
142 void FAR* asyncs[3];// async read structures
|
|
143
|
|
144 __int32 loadedbufstart[2]; // offset of where the loaded buffer started
|
|
145 __int32 loadedorder[2]; // order of the buffers as they were loaded
|
|
146 __int32 loadorder; // incremented as each buffer is loaded
|
|
147
|
|
148 __int32 bufsize; // size of each buffer
|
|
149 __int32 readsize; // size of each read block
|
|
150
|
|
151 unsigned __int32 buf1; // 0,1,2 (current buffer that we are reading into)
|
|
152 __int32 size1; // holds the current amount of data read
|
|
153
|
|
154 unsigned __int32 buf2; // 0,1,2 (the next buffer that we are reading into)
|
|
155 __int32 size2; // next buffer loaded up to
|
|
156
|
|
157 unsigned __int32 buf3; // 0,1,2 (the next buffer that we are reading into)
|
|
158 __int32 size3; // next buffer loaded up to
|
|
159
|
|
160 unsigned __int32 datarate; // datarate in bytes per second
|
|
161 __int32 filerate; // original datarate of the file
|
|
162 __int32 filetype; // file format type
|
|
163 unsigned __int32 fileflags; // file format flags (signed or unsigned)
|
|
164 __int32 totallen; // total length of the sound data
|
|
165
|
|
166 __int32 substart; // subblock loop start
|
|
167 __int32 sublen; // subblock loop len
|
|
168 __int32 subpadding; // amount to pad the final block
|
|
169
|
|
170 unsigned __int32 blocksize; // ADPCM block size
|
|
171 __int32 padding; // padding to be done
|
|
172 __int32 padded; // padding done
|
|
173
|
|
174 __int32 loadedsome; // have we done any loads?
|
|
175
|
|
176 unsigned __int32 startpos; // point that the sound data begins
|
|
177 unsigned __int32 totalread; // total bytes read from the disk
|
|
178
|
|
179 unsigned __int32 loopsleft; // how many loops are left
|
|
180
|
|
181 unsigned __int32 error; // read error has occurred
|
|
182
|
|
183 __int32 preload; // preload the file into the first buffer
|
|
184 unsigned __int32 preloadpos; // position to use in preload
|
|
185 __int32 noback; // no background processing
|
|
186 __int32 alldone; // alldone
|
|
187 __int32 primeamount; // amount to load after a seek
|
|
188 __int32 readatleast; // forced amount to read on next service
|
|
189
|
|
190 __int32 playcontrol; // control: 0=stopped, 1=started, |8=paused, |16=sample paused
|
|
191
|
|
192 AILSTREAMCB callback; // end of stream callback
|
|
193
|
|
194 __int32 user_data[8]; // Miscellaneous user data
|
|
195 void FAR* next; // pointer to next stream
|
|
196
|
|
197 #if defined(IS_WINDOWS) || defined(IS_MAC)
|
|
198 __int32 autostreaming; // are we autostreaming this stream
|
|
199 #endif
|
|
200
|
|
201 #ifdef IS_WINDOWS
|
|
202 __int32 cb_IsWin32s; // Is the callback win32s?
|
|
203 #endif
|
|
204 __int32 docallback; // set when it time to poll for a callback
|
|
205 #ifdef IS_MAC
|
|
206 IOParam stream_param;
|
|
207 __int32 donext;
|
|
208 __int32 donext1;
|
|
209 unsigned __int32 fillup;
|
|
210 unsigned __int32 session;
|
|
211 unsigned __int32 tamt;
|
|
212 unsigned __int32 buf;
|
|
213 __int32* size;
|
|
214 __int32* done;
|
|
215 __int32 done1;
|
|
216 __int32 done2;
|
|
217 __int32 done3;
|
|
218 Boolean force_quit;
|
|
219 #endif
|
|
220
|
|
221 } MSTREAM_TYPE;
|
|
222
|
|
223
|
|
224
|
|
225
|
|
226
|
|
227
|
|
228
|
|
229
|
|
230 int __stdcall AIL_startup();
|
|
231 HREDBOOK __stdcall AIL_redbook_open_drive(long drive);
|
3
|
232 HREDBOOK __stdcall AIL_redbook_open(int);
|
0
|
233 int __stdcall AIL_set_preference(unsigned int number, int value);
|
|
234 int __stdcall AIL_waveOutOpen(HDIGDRIVER *drv, HWAVEOUT *phWaveOut, int wDeviceID, WAVEFORMAT *pFormat);
|
|
235 int __stdcall AIL_get_preference(unsigned int number);
|
|
236 int __stdcall AIL_digital_configuration(HDIGDRIVER drv, int *rate, int *format, char *string);
|
|
237 HSAMPLE __stdcall AIL_allocate_sample_handle(HDIGDRIVER hDrv);
|
|
238 unsigned int __stdcall AIL_redbook_tracks(HREDBOOK hRedbook);
|
|
239 int __stdcall AIL_redbook_volume(HREDBOOK hRedbook);
|
|
240 unsigned int __stdcall AIL_redbook_stop(HREDBOOK hRedbook);
|
|
241 void __stdcall AIL_set_digital_master_volume(HDIGDRIVER hDrv, float master_volume);
|
|
242 int __stdcall AIL_redbook_set_volume(HREDBOOK hRedbook, int volume);
|
|
243 unsigned int __stdcall AIL_redbook_pause(HREDBOOK hRedbook);
|
|
244 void __stdcall AIL_redbook_track_info(HREDBOOK hRedbook, unsigned int uTrackNum, unsigned int *pStartMS, unsigned int *pEndMS);
|
|
245 unsigned int __stdcall AIL_redbook_play(HREDBOOK hRedbook, unsigned int uStartMS, unsigned int uEndMS);
|
|
246 unsigned int __stdcall AIL_redbook_resume(HREDBOOK);
|
|
247 int __stdcall AIL_enumerate_3D_providers(int *a1, HPROVIDER *pOutProv, char **pOutName);
|
|
248 DWORD __stdcall AIL_open_3D_provider(HPROVIDER a2);
|
|
249 int __stdcall AIL_3D_provider_attribute(HPROVIDER a1, const char *a2, int *a3);
|
|
250 int __stdcall AIL_set_3D_provider_preference(HPROVIDER a1, const char *a2, int *a3);
|
|
251 int __stdcall AIL_waveOutClose(_DIG_DRIVER *);
|
|
252 int __stdcall AIL_allocate_3D_sample_handle(HPROVIDER);
|
|
253 int __stdcall AIL_set_3D_sample_float_distances(void *a1, long a2, long a3, long a4, long a5);
|
|
254 int __stdcall AIL_set_3D_sample_volume(void *a1, long a2);
|
|
255 int __stdcall AIL_release_sample_handle(void *a1);
|
|
256 int __stdcall AIL_3D_position(void *a1, int *a2, float *a3, long *a4);
|
|
257 int __stdcall AIL_set_3D_sample_file(long a1, void *a2);
|
|
258 int __stdcall AIL_set_3D_sample_loop_count(long a1, long a2);
|
|
259 int __stdcall AIL_start_3D_sample(long a1);
|
|
260 int __stdcall AIL_set_3D_position(void *hSample, long a2, long a3, long a4);
|
|
261 int __stdcall AIL_set_3D_orientation(void *hSample, long a2, long a3, long a4, long a5, long a6, long a7);
|
|
262 int __stdcall AIL_release_3D_sample_handle(void *hHandle);
|
|
263
|
|
264 int __stdcall AIL_close_3D_provider(HPROVIDER);
|
|
265 int __stdcall AIL_redbook_close(HREDBOOK);
|
|
266
|
|
267 // sub_4D8344: using guessed type int __stdcall AIL_shutdown();
|
|
268 int __stdcall AIL_shutdown();
|
|
269
|
|
270 int __stdcall AIL_end_sample(HSAMPLE a1);
|
|
271 int __stdcall AIL_end_3D_sample(void *a1);
|
|
272 void __stdcall AIL_end_sequence(HSEQUENCE a1);
|
|
273 void __stdcall AIL_pause_stream(HSTREAM a1, int onoff);
|
|
274 int __stdcall AIL_set_sample_file(HSAMPLE, const void *file_image, int block);
|
|
275 void __stdcall AIL_start_sample(HSAMPLE);
|
|
276 void __stdcall AIL_set_sample_playback_rate(HSAMPLE, int rate);
|
|
277 void __stdcall AIL_sample_ms_position(HSAMPLE, int *pTotalMS, int *pCurrentMS);
|
|
278 int __stdcall AIL_3D_sample_status(void *a1);
|
|
279
|
|
280
|
|
281 namespace AIL
|
|
282 {
|
|
283 namespace Sample
|
|
284 {
|
|
285 enum Status
|
|
286 {
|
|
287 Free = 1, // Sample is available for allocation
|
|
288 Done = 2, // Sample has finished playing, or has never been started
|
|
289 Playing = 4, // Sample is playing
|
|
290 Stopped = 8, // Sample has been stopped
|
|
291 PlayingButReleased = 16 // Sample is playing, but digital handle has been temporarily released
|
|
292 };
|
|
293 };
|
|
294 };
|
|
295 AIL::Sample::Status __stdcall AIL_sample_status(HSAMPLE a1);
|
|
296
|
|
297
|
|
298 void __stdcall AIL_set_sample_loop_count(HSAMPLE, int);
|
|
299 int __stdcall AIL_set_sample_volume(HSAMPLE a1, long a2);
|
|
300
|
|
301
|
|
302 int __stdcall AIL_sample_volume(HSAMPLE);
|
|
303 void __stdcall AIL_init_sample(HSAMPLE);
|
|
304 int __stdcall AIL_set_sample_pan(HSAMPLE, long a2);
|
|
305 AILFILETYPE __stdcall AIL_file_type(void *pSoundBytes, int numBytes);
|
|
306 int __stdcall AIL_WAV_info(void *pSoundBytes, AILSOUNDINFO *pInfo);
|
|
307 int __stdcall AIL_decompress_ADPCM(AILSOUNDINFO *pInfo, void *a2, void *a3);
|
|
308 int __stdcall AIL_mem_free_lock(void *a1);
|
|
309
|
|
310
|
|
311
|
|
312
|
|
313
|
|
314
|
|
315
|
|
316
|
|
317
|
|
318
|