1 {
2     Copyright (c) 1990-1993 International Business Machines Corporation
3     Copyright (c) 2002 by Andry Svirgunov (cool2@ngs.ru)
4     Copyright (c) 2002-2003 by Yuri Prokushev (prokushev@freemail.ru)
5 
6     OS/2 Multimedia structures and definitions
7 
8     This program is free software; you can redistribute it and/or modify it
9     under the terms of the GNU Library General Public License (LGPL) as
10     published by the Free Software Foundation; either version 2 of the
11     License, or (at your option) any later version. This program is
12     distributed in the hope that it will be useful, but WITHOUT ANY
13     WARRANTY; without even the implied warranty of MERCHANTABILITY or
14     FITNESS FOR A PARTICULAR PURPOSE.
15 
16     See the GNU Library General Public License for more details. You should
17     have received a copy of the GNU Library General Public License along
18     with this program; if not, write to the Free Software Foundation, Inc.,
19     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  **********************************************************************}
22 
23 {
24 @abstract(Multimedia structures and definitions)
25 @author(Andry Svirgunov (cool2@ngs.ru))
26 @author(Yuri Prokushev (prokushev@freemail.ru))
27 @created(17 Dec 2002)
28 @lastmod(19 Jan 2003)
29 OS/2 Multimedia structures and definitions
30 Warning: This code is alfa. Future versions of this unit will propably
31 not be compatible.
32 }
33 //****************************************************************************/
34 //*                                                                          */
35 //* Module Name: MMBase.pas                                                  */
36 //*                                                                          */
37 //* OS/2 2.0 Multimedia Extensions Base Definitions                          */
38 //*                                                                          */
39 //* Copyright (c) International Business Machines Corporation 1991, 1992     */
40 //*                        All Rights Reserved                               */
41 //*                                                                          */
42 //*------------------------------------------------------------------------- */
43 //* Converted by Andry Svirgunov. Email: cool2@ngs.ru                        */
44 //* 14.11.2002.                                                              */
45 //* Revised by Yuri Prokushev (prokushev@freemail.ru)                        */
46 //****************************************************************************/
47 
48 Unit mmbase;
49 
50 {$MODE ObjFPC}
51 
52 Interface
53 
54 Uses Os2Def;
55 
56 Type
57         VERSION = WORD;
58         LPSTR = ^Char;
59         LPTR = Pointer;
60         LPRECT = Pointer;
61         HANDLE = HWND;
62         PW = ^Word;
63         PAW = ^Word;
64         PFN = Pointer ;
65         PPFN = ^PFN;
66 
67 type
arnull68   FNMCI=Function(var p,w:Word;a,b,c:LongInt):Longint;
69 
70 TYPE
71         PFNMCI = ^FNMCI;
72         SZ = Char;              //* ASCIIZ char string type*/
73         MMTIME = LongInt;       //* universal Chinatown time (1/3000 second)*/
74         PMMTIME = ^MMTIME;      //* Ptr to MMTIME unit*/
75         HMMIO = LongInt;        //* Handle to an MMIO object*/
76         PHMMIO = ^HMMIO;        //* Handle to an MMIO object*/
77 
78 
79 TYPE
80   FOURCC=Cardinal;
81 
82 //**********************************************
83 //*
84 //* SPCBKEY - Stream Protocol Key
85 //*
86 //**********************************************/
87 Type _SPCBKEY = record                  //* spcbkey SPCB key (Stream data type) */
88         ulDataType : LongInt;
89         ulDataSubType : LongInt;
90         ulIntKey : LongInt;             //* generated internal key            */
91         end;
92 TYPE PSPCBKEY = ^_SPCBKEY;
93 
94 Const
95 
96         _SPCBKEY_DEFINED = 1;
97 
98 //**********************************************
99 // *
100 // * MMTRACKINFO - This structure is used to
101 // *            represent a video, audio or
102 // *            some other type of track
103 // *            within a digital video movie
104 // *            file.
105 // *
106 // **********************************************/
107 TYPE _MMTRACKINFO = record      //* mmtrackinfo */
108         ulTrackID : LongInt;    //* track identifier */
109         ulMediaType : LongInt;  //* media type */
110         ulCountry : LongInt;    //* country code for the track */
111         ulCodePage : LongInt;   //* country code page for the track */
112         ulReserved1: LongInt;   //* reserved must be 0 */
113         ulReserved2 : LongInt;  //* reserved must be 0 */
114         end;
115 
116 TYPE PMMTRACKINFO = ^_MMTRACKINFO; //* Ptr to a track table entry */
117 
118 //************************
119 // * Clipboard formats
120 // ************************/
121 CONST
122         CF_RMID = 10;
123         CF_RIFF = 11;
124         CF_WAVE = 12;
125         CF_AVI = 13;
126 //************************
127 // * Resource formats
128 // ************************/
129         RT_RMID = 100;
130         RT_RIFF = 101;
131         RT_WAVE = 102;
132         RT_AVI = 103;
133         RT_AVS = 104;
134 
135 
136 //************************
137 // * Drag formats
138 // ************************/
139         DRT_WAVE = 'DIGITAL AUDIO';
140         DRT_AVI = 'DIGITAL VIDEO';
141         DRT_MIDI = 'MIDI';
142 
143 
144 //************************
145 // * Sampling Rate
146 // ************************/
147         HZ_8000 = 8000;         //* 8.0 kHz*/
148         HZ_11025 = 11025;       //* 11.025 kHz*/
149         HZ_14700 = 14700;       //* 14.700 kHz (SPV/2)*/
150         HZ_18900 = 18900;       //* 18.900 kHz (CD/XA LVL C)*/
151         HZ_22050 = 22050;       //* 22.050 kHz*/
152         HZ_37800 = 37800;       //* 37.800 kHz (CD/XA LVL B)*/
153         HZ_44100 = 44100;       //* 44.100 kHz*/
154 
155 //************************
156 // * Bits per Sample
157 // ************************/
158         BPS_4 = 4;              //* 4 bits/sample (ADPCM)*/
159         BPS_8 = 8;              //* 8 bits/sample (PCM)*/
160         BPS_16 =16;             //* 16 bits/sample(PCM)*/
161 
162 //************************
163 //* Channels
164 //************************/
165         CH_1 = 1;               //* Mono*//
166         CH_2 = 2;               //* Stereo*//
167         CH_4 = 4;               //* Quad*//
168 
169 
170 //*************************************************************************
171 // * Multimedia Datatypes (spcbkey values)
172 // *************************************************************************/
173 
174 
175 ///****************
176 // * NULL datatype
177 // ****************/
178         DATATYPE_NULL = $0000;  //* NULL stream data type (NULL)*/
179         SUBTYPE_NONE = $0000;   //* No subtype for this data type*/
180 
181 //*********************
182 // * WAVEFORM datatypes
183 // *********************/
184         DATATYPE_WAVEFORM = $0001; //* WAVEFORM audio (PCM)*/
185 
186 
187 //* Subtypes for DATATYPE_WAVEFORM:*/
188         WAVE_FORMAT_1M08 = $0001;       //* 11.025kHz, Mono  , 8-bit*/
189         WAVE_FORMAT_1S08 = $0002;       //* 11.025kHz, Stereo, 8-bit*/
190         WAVE_FORMAT_1M16 = $0003;       //* 11.025kHz, Mono  , 16-bit*/
191         WAVE_FORMAT_1S16 = $0004;       //* 11.025kHz, Stereo, 16-bit*/
192         WAVE_FORMAT_2M08 = $0005;       //* 22.05kHz , Mono  , 8-bit*/
193         WAVE_FORMAT_2S08 = $0006;       //* 22.05kHz , Stereo, 8-bit*/
194         WAVE_FORMAT_2M16 = $0007;       //* 22.05kHz , Mono  , 16-bit*/
195         WAVE_FORMAT_2S16 = $0008;       //* 22.05kHz , Stereo, 16-bit*/
196         WAVE_FORMAT_4M08 = $0009;       //* 44.1kHz  , Mono  , 8-bit*/
197         WAVE_FORMAT_4S08 = $000A;       //* 44.1kHz  , Stereo, 8-bit*/
198         WAVE_FORMAT_4M16 = $000B;       //* 44.1kHz  , Mono  , 16-bit*/
199         WAVE_FORMAT_4S16 = $000C;       //* 44.1kHz  , Stereo, 16-bit*/
200         WAVE_FORMAT_8M08 = $000D;       //*  8.0kHz  , Mono  , 8-bit*/
201         WAVE_FORMAT_8S08 = $000E;       //*  8.0kHz  , Stereo, 8-bit*/
202         WAVE_FORMAT_8M16 = $000F;       //*  8.0kHz  , Mono  , 16-bit*/
203         WAVE_FORMAT_8S16 = $0010;       //*  8.0kHz  , Stereo, 16-bit*/
204 
205 //*********************
206 // * DIGVIDEO datatypes
207 // *********************/
208         DATATYPE_DIGVIDEO = $0002;      //* Digital Video */
209 
210 //* Subtypes for DATATYPE_DIGVIDEO:*/
211         DIGVIDEO_PHOTOM = $544F4850;    //* Photmotion video, FOURCC value for phio */
212         DIGVIDEO_ULTIM = $49544C55;     //* Ultimotion video, FOURCC value for ulio */
213         DIGVIDEO_AVI = $20495641;       //* AVI video, FOURCC value for avio */
214         DIGVIDEO_MONITOR = $206E6FD;    //* MONITOR video, FOURCC value for monitoring */
215         DIGVIDEO_FLC = $63696C66;       //* FLIC video, FOURCC value for flic */
216         DIGVIDEO_MPEG = $4745504D;      //* MPEG video, FOURCC value for MPEG */
217 
218 //******************
219 // * MuLaw datatypes
220 //******************/
221         DATATYPE_MULAW = $0101;         //* MuLaw*/
222         DATATYPE_RIFF_MULAW = $0007;    //* MuLaw*/
223 
224 //* Subtypes for DATATYPE_MULAW:*/
225 
226         MULAW_8B8KS = $0001;            //* 8bit 8kHz stereo*/
227         MULAW_8B11KS = $0002;           //* 8bit 11kHz stereo*/
228         MULAW_8B22KS = $0003;           //* 8bit 22kHz stereo*/
229         MULAW_8B44KS = $0004;           //* 8bit 44kHz stereo*/
230         MULAW_8B8KM = $0005;            //* 8bit 8kHz mono*/
231         MULAW_8B11KM = $0006;           //* 8bit 11kHz mono*/
232         MULAW_8B22KM = $0007;           //* 8bit 22kHz mono*/
233         MULAW_8644KM = $0008;           //* 8bit 44kHz mono*/
234 
235 //*****************
236 // * ALaw datatypes
237 // *****************/
238         DATATYPE_ALAW = $0102;          //* ALaw*/
239         DATATYPE_RIFF_ALAW = $0006;     //* ALaw*/
240 
241 //* Subtypes for DATATYPE_ALAW:*/
242         ALAW_8B8KS = $0001;             //* 8bit 8kHz stereo*/
243         ALAW_8B11KS = $0002;            //* 8bit 11kHz stereo*/
244         ALAW_8B22KS = $0003;            //* 8bit 22kHz stereo*/
245         ALAW_8B44KS = $0004;            //* 8bit 44kHz stereo*/
246         ALAW_8B8KM = $0005;             //* 8bit 8kHz mono*/
247         ALAW_8B11KM = $0006;            //* 8bit 11kHz mono*/
248         ALAW_8B22KM = $0007;            //* 8bit 22kHz mono*/
249         ALAW_8B44KM = $0008;            //* 8bit 44kHz mono*/
250 
251 //*******************************
252 // * AVC ADPCM WAVEFORM datatypes
253 // *******************************/
254         DATATYPE_ADPCM_AVC = $0103;     //* ADPCM audio*/
255 
256 //* Subtypes for DATATYPE_ADPCM_AVC:*/
257         ADPCM_AVC_VOICE = $0001;
258         ADPCM_AVC_MUSIC = $0002;
259         ADPCM_AVC_STEREO = $0003;
260         ADPCM_AVC_HQ = $0004;
261 
262 //******************
263 // * CT_ADPCM datatypes
264 // ******************/
265         DATATYPE_CT_ADPCM = $0200;      //* Creative technologies */
266 
267 //* Subtypes for DATATYPE_CT_ADPCM:*/
268 
269         CD_ADPCM_16B8KS = $0001;        //* 16bit 8kHz stereo*/
270         CD_ADPCM_16B11KS = $0002;       //* 16bit 11kHz stereo*/
271         CD_ADPCM_16B22KS = $0003;       //* 16bit 22kHz stereo*/
272         CD_ADPCM_16B44KS = $0004;       //* 16bit 44kHz stereo*/
273         CD_ADPCM_16B8KM = $0005;        //* 16bit 8kHz mono*/
274         CD_ADPCM_16B11KM = $0006;       //* 16bit 11kHz mono*/
275         CD_ADPCM_16B22KM = $0007;       //* 16bit 22kHz mono*/
276         CD_ADPCM_16B44KM = $0008;       //* 16bit 44kHz mono*/
277 
278 //****************
279 // * MIDI datatype
280 // ****************/
281 
282         DATATYPE_MIDI = $0201;          //* MIDI*/
283 //*         SUBTYPE_NONE            0x0000L      No subtype for this data type*/
284 
285 
286 //********************
287 // * GENERIC datatypes
288 // ********************/
289         DATATYPE_GENERIC = $0202;       //* Generic for files / memory. This*/
290                                         //* datatype will match any other*/
291                                         //* datatype at stream creation time.*/
292 
293 //**************************
294 // * Speech Viewer datatypes
295 // **************************/
296 
297         DATATYPE_SPV2 = $0203;          //* Speech Viewer*/
298 
299 //* Subtypes for DATATYPE_SPV2:*/
300 
301         SPV2_BPCM = $0001;
302         SPV2_PCM = $0002;
303         SPV2_NONE = $0003;
304 
305 //******************
306 // * CD-XA datatypes
307 // ******************/
308 
309         DATATYPE_CDXA_VIDEO = $0204;    //* CD-XA Video datatype*/
310         DATATYPE_CDXA_DATA = $0205;     //* CD-XA sub-band data datatype*/
311         DATATYPE_CDXA_AUDIO = $0206;    //* CD-XA ADPCM Audio datatype*/
312         DATATYPE_CDXA_AUDIO_HD = $0207; //* CD-XA ADPCM Audio with Headers*/
313         DATATYPE_CDXA_HEADERS = $0208;  //* CD-XA Headers and Subheaders*/
314 
315 //* Subtypes for DATATYPE_CDXA_AUDIO:*/
316 
317         DATATYPE_LEVELB = $0000;        //* LEVEL B Audio Stereo*/
318         DATATYPE_LEVELC = $0001;        //* LEVEL C Audio Stereo*/
319         DATATYPE_LEVELB_MONO = $0002;   //* LEVEL B Audio Mono*/
320         DATATYPE_LEVELC_MONO = $0003;   //* LEVEL C Audio Mono*/
321 
322 //*********************
323 // * DIGISPEECH datatype
324 // *********************/
325         DATATYPE_DIGISPEECH = $0208;    //* DIGISPEECH */
326         DATATYPE_NATIVE = $0001;        //* Native digispeech */
327 
328 //*********************
329 // * MPEG-1 Audio datatypes
330 // *********************/
331         DATATYPE_MPEG1AUDIO = $0050;    //* MPEG-1 Audio */
332 
333 //* Subtypes for DATATYPE_MPEG1AUDIO:*/
334         MPEG1_FORMAT_3M16 = $0001;      //* 32.000kHz,  Mono  , 16-bit*/
335         MPEG1_FORMAT_3S16 = $0002;      //* 32.000kHz,  Stereo, 16-bit*/
336         MPEG1_FORMAT_4M16 = $0003;      //* 44.1/48kHz, Mono  , 16-bit*/
337         MPEG1_FORMAT_4S16 = $0004;      //* 44.1/48kHz, Stereo, 16-bit*/
338 
339 //*******************
340 // * UNKNOWN datatype
341 // *******************/
342         DATATYPE_UNKNOWN = $FFFFFFFF;   //* Unknown datatype */
343 
344 //*         SUBTYPE_NONE            0x0000L      No subtype for this data type*/
345 
346 
347 // ERROR CODES
348 
349 CONST
350 
351 NO_ERROR = 0;
352 //*****************************************/
353 //* MCI Device Manager Error Return codes */
354 //*****************************************/
355 
356 CONST
357 MCIERR_BASE                     = 5000;
358 MCIERR_SUCCESS                  = 0;
359 MCIERR_INVALID_DEVICE_ID        =(MCIERR_BASE + 1);
360 MCIERR_NO_MASTER                =(MCIERR_BASE + 2);
361 MCIERR_UNRECOGNIZED_KEYWORD     =(MCIERR_BASE + 3);
362 MCIERR_MASTER_CONFLICT          =(MCIERR_BASE + 4);
363 MCIERR_UNRECOGNIZED_COMMAND     =(MCIERR_BASE + 5);
364 MCIERR_HARDWARE                 =(MCIERR_BASE + 6);
365 MCIERR_INVALID_DEVICE_NAME      =(MCIERR_BASE + 7);
366 MCIERR_OUT_OF_MEMORY            =(MCIERR_BASE + 8);
367 MCIERR_DEVICE_OPEN              =(MCIERR_BASE + 9);
368 MCIERR_CANNOT_LOAD_DRIVER       =(MCIERR_BASE + 10);
369 MCIERR_MISSING_COMMAND_STRING   =(MCIERR_BASE + 11);
370 MCIERR_PARAM_OVERFLOW           =(MCIERR_BASE + 12);
371 MCIERR_MISSING_STRING_ARGUMENT  =(MCIERR_BASE + 13);
372 MCIERR_BAD_INTEGER              =(MCIERR_BASE + 14);
373 MCIERR_PARSER_INTERNAL          =(MCIERR_BASE + 15);
374 MCIERR_DRIVER_INTERNAL          =(MCIERR_BASE + 16);
375 MCIERR_MISSING_PARAMETER        =(MCIERR_BASE + 17);
376 MCIERR_UNSUPPORTED_FUNCTION     =(MCIERR_BASE + 18);
377 MCIERR_FILE_NOT_FOUND           =(MCIERR_BASE + 19);
378 MCIERR_DEVICE_NOT_READY         =(MCIERR_BASE + 20);
379 MCIERR_INTERNAL                 =(MCIERR_BASE + 21);
380 MCIERR_DRIVER                   =(MCIERR_BASE + 22);
381 MCIERR_CANNOT_USE_ALL           =(MCIERR_BASE + 23);
382 MCIERR_MULTIPLE                 =(MCIERR_BASE + 24);
383 MCIERR_EXTENSION_NOT_FOUND      =(MCIERR_BASE + 25);
384 MCIERR_OUTOFRANGE               =(MCIERR_BASE + 26);
385 MCIERR_CANNOT_ADD_ALIAS         =(MCIERR_BASE + 27);
386 MCIERR_FLAGS_NOT_COMPATIBLE     =(MCIERR_BASE + 28);
387 MCIERR_CANNOT_USE_NOUNLOAD      =(MCIERR_BASE + 29);
388 MCIERR_FILE_NOT_SAVED           =(MCIERR_BASE + 30);
389 MCIERR_DEVICE_TYPE_REQUIRED     =(MCIERR_BASE + 31);
390 MCIERR_DEVICE_LOCKED            =(MCIERR_BASE + 32);
391 MCIERR_DUPLICATE_ALIAS          =(MCIERR_BASE + 33);
392 MCIERR_INSTANCE_INACTIVE        =(MCIERR_BASE + 34);
393 
394 MCIERR_COMMAND_TABLE            =(MCIERR_BASE + 35);
395 MCIERR_INI_FILE_LOCKED          =(MCIERR_BASE + 37);
396 
397 MCIERR_NO_AUDIO_SUPPORT         =(MCIERR_BASE + 40);
398 MCIERR_NOT_IN_PM_SESSION        =(MCIERR_BASE + 41);
399 MCIERR_DUPLICATE_KEYWORD        =(MCIERR_BASE + 42);
400 MCIERR_COMMAND_STRING_OVERFLOW  =(MCIERR_BASE + 43);
401 MCIERR_DRIVER_PROC_NOT_FOUND    =(MCIERR_BASE + 44);
402 MCIERR_INVALID_DEVICE_TYPE      =(MCIERR_BASE + 45);
403 MCIERR_INVALID_DEVICE_ORDINAL   =(MCIERR_BASE + 46);
404 MCIERR_HEADPHONES_NOT_SET       =(MCIERR_BASE + 47);
405 MCIERR_SPEAKERS_NOT_SET         =(MCIERR_BASE + 48);
406 MCIERR_SOUND_NOT_SET            =(MCIERR_BASE + 49);
407 MCIERR_INVALID_BUFFER           =(MCIERR_BASE + 50);
408 MCIERR_INVALID_MEDIA_TYPE       =(MCIERR_BASE + 51);
409 MCIERR_INVALID_CONNECTOR_INDEX  =(MCIERR_BASE + 52);
410 MCIERR_NO_CONNECTION            =(MCIERR_BASE + 53);
411 MCIERR_INVALID_FLAG             =(MCIERR_BASE + 54);
412 MCIERR_CANNOT_LOAD_DSP_MOD      =(MCIERR_BASE + 55);
413 MCIERR_ALREADY_CONNECTED        =(MCIERR_BASE + 56);
414 MCIERR_INVALID_CALLBACK_HANDLE  =(MCIERR_BASE + 57);
415 MCIERR_DRIVER_NOT_FOUND         =(MCIERR_BASE + 58);
416 MCIERR_DUPLICATE_DRIVER         =(MCIERR_BASE + 59);
417 MCIERR_INI_FILE                 =(MCIERR_BASE + 60);
418 MCIERR_INVALID_GROUP_ID         =(MCIERR_BASE + 61);
419 MCIERR_ID_ALREADY_IN_GROUP      =(MCIERR_BASE + 62);
420 MCIERR_MEDIA_CHANGED            =(MCIERR_BASE + 63);
421 MCIERR_MISSING_FLAG             =(MCIERR_BASE + 64);
422 MCIERR_UNSUPPORTED_FLAG         =(MCIERR_BASE + 65);
423 MCIERR_DRIVER_NOT_LOADED        =(MCIERR_BASE + 66);
424 MCIERR_INVALID_MODE             =(MCIERR_BASE + 67);
425 MCIERR_INVALID_ITEM_FLAG        =(MCIERR_BASE + 68);
426 MCIERR_INVALID_TIME_FORMAT_FLAG =(MCIERR_BASE + 69);
427 MCIERR_SPEED_FORMAT_FLAG        =(MCIERR_BASE + 70);
428 MCIERR_INVALID_AUDIO_FLAG       =(MCIERR_BASE + 71);
429 MCIERR_NODEFAULT_DEVICE         =(MCIERR_BASE + 72);
430 MCIERR_DUPLICATE_EXTENSION      =(MCIERR_BASE + 73);
431 MCIERR_FILE_ATTRIBUTE           =(MCIERR_BASE + 74);
432 MCIERR_DUPLICATE_CUEPOINT       =(MCIERR_BASE + 75);
433 MCIERR_INVALID_CUEPOINT         =(MCIERR_BASE + 76);
434 MCIERR_CUEPOINT_LIMIT_REACHED   =(MCIERR_BASE + 77);
435 MCIERR_MISSING_ITEM             =(MCIERR_BASE + 78);
436 MCIERR_MISSING_TIME_FORMAT      =(MCIERR_BASE + 79);
437 MCIERR_MISSING_SPEED_FORMAT     =(MCIERR_BASE + 80);
438 MCIERR_INVALID_CONNECTOR_TYPE   =(MCIERR_BASE + 81);
439 MCIERR_TARGET_DEVICE_FULL       =(MCIERR_BASE + 82);
440 MCIERR_UNSUPPORTED_CONN_TYPE    =(MCIERR_BASE + 83);
441 MCIERR_CANNOT_MODIFY_CONNECTOR  =(MCIERR_BASE + 84);
442 MCIERR_RECORD_ABORTED           =(MCIERR_BASE + 85);
443 MCIERR_GROUP_COMMAND            =(MCIERR_BASE + 86);
444 MCIERR_DEVICE_NOT_FOUND         =(MCIERR_BASE + 87);
445 MCIERR_RESOURCE_NOT_AVAILABLE   =(MCIERR_BASE + 88);
446 MCIERR_INVALID_IO_PROC          =(MCIERR_BASE + 89);
447 
448 MCIERR_WAVE_OUTPUTSINUSE        =(MCIERR_BASE + 90);
449 MCIERR_WAVE_SETOUTPUTINUSE      =(MCIERR_BASE + 91);
450 MCIERR_WAVE_INPUTSINUSE         =(MCIERR_BASE + 92);
451 MCIERR_WAVE_SETINPUTINUSE       =(MCIERR_BASE + 93);
452 MCIERR_WAVE_OUTPUTUNSPECIFIED   =(MCIERR_BASE + 94);
453 MCIERR_WAVE_INPUTUNSPECIFIED    =(MCIERR_BASE + 95);
454 MCIERR_WAVE_OUTPUTSUNSUITABLE   =(MCIERR_BASE + 96);
455 MCIERR_WAVE_SETOUTPUTUNSUITABLE =(MCIERR_BASE + 97);
456 MCIERR_WAVE_INPUTSUNSUITABLE    =(MCIERR_BASE + 98);
457 MCIERR_WAVE_SETINPUTUNSUITABLE  =(MCIERR_BASE + 99);
458 
459 MCIERR_SEQ_DIV_INCOMPATIBLE     =(MCIERR_BASE + 100);
460 MCIERR_SEQ_PORT_INUSE           =(MCIERR_BASE + 101);
461 MCIERR_SEQ_PORT_NONEXISTENT     =(MCIERR_BASE + 102);
462 MCIERR_SEQ_PORT_MAPNODEVICE     =(MCIERR_BASE + 103);
463 MCIERR_SEQ_PORT_MISCERROR       =(MCIERR_BASE + 104);
464 MCIERR_SEQ_TIMER                =(MCIERR_BASE + 105);
465 
466 MCIERR_VDP_COMMANDCANCELLED     =(MCIERR_BASE + 106);
467 MCIERR_VDP_COMMANDFAILURE       =(MCIERR_BASE + 107);
468 MCIERR_VDP_NOTSPUNUP            =(MCIERR_BASE + 108);
469 MCIERR_VDP_NOCHAPTER            =(MCIERR_BASE + 109);
470 MCIERR_VDP_NOSIDE               =(MCIERR_BASE + 110);
471 MCIERR_VDP_NOSIZE               =(MCIERR_BASE + 111);
472 MCIERR_VDP_INVALID_TIMEFORMAT   =(MCIERR_BASE + 112);
473 
474 MCIERR_CLIPBOARD_ERROR          =(MCIERR_BASE + 114);
475 MCIERR_CANNOT_CONVERT           =(MCIERR_BASE + 115);
476 MCIERR_CANNOT_REDO              =(MCIERR_BASE + 116);
477 MCIERR_CANNOT_UNDO              =(MCIERR_BASE + 117);
478 MCIERR_CLIPBOARD_EMPTY          =(MCIERR_BASE + 118);
479 
480 MCIERR_INVALID_WORKPATH         =(MCIERR_BASE + 119);
481 MCIERR_INDETERMINATE_LENGTH     =(MCIERR_BASE + 120);
482 MCIERR_DUPLICATE_EA             =(MCIERR_BASE + 121);
483 MCIERR_INVALID_CONNECTION       =(MCIERR_BASE + 122);
484 MCIERR_CHANNEL_OFF              =(MCIERR_BASE + 123);
485 MCIERR_CANNOT_CHANGE_CHANNEL    =(MCIERR_BASE + 124);
486 MCIERR_FILE_IO                  =(MCIERR_BASE + 125);
487 MCIERR_SYSTEM_FILE              =(MCIERR_BASE + 126);
488 MCIERR_DISPLAY_RESOLUTION       =(MCIERR_BASE + 127);
489 MCIERR_NO_ASYNC_PLAY_ACTIVE     =(MCIERR_BASE + 128);
490 
491 MCIERR_UNSUPP_FORMAT_TAG        =(MCIERR_BASE + 129);
492 MCIERR_UNSUPP_SAMPLESPERSEC     =(MCIERR_BASE + 130);
493 MCIERR_UNSUPP_BITSPERSAMPLE     =(MCIERR_BASE + 131);
494 MCIERR_UNSUPP_CHANNELS          =(MCIERR_BASE + 132);
495 MCIERR_UNSUPP_FORMAT_MODE       =(MCIERR_BASE + 133);
496 MCIERR_NO_DEVICE_DRIVER         =(MCIERR_BASE + 134);
497 MCIERR_CODEC_NOT_SUPPORTED      =(MCIERR_BASE + 135);
498 
499 MCIERR_TUNER_NO_HW              =(MCIERR_BASE + 136);
500 MCIERR_TUNER_NO_AFC             =(MCIERR_BASE + 137);
501 MCIERR_TUNER_AFC_ON             =(MCIERR_BASE + 138);
502 MCIERR_TUNER_CHANNEL_SKIPPED    =(MCIERR_BASE + 139);
503 MCIERR_TUNER_CHANNEL_TOO_LOW    =(MCIERR_BASE + 140);
504 MCIERR_TUNER_CHANNEL_TOO_HIGH   =(MCIERR_BASE + 141);
505 MCIERR_AUD_CHANNEL_OUTOFRANGE   =(MCIERR_BASE + 142);
506 MCIERR_TUNER_INVALID_REGION     =(MCIERR_BASE + 143);
507 MCIERR_SIGNAL_INVALID           =(MCIERR_BASE + 144);
508 MCIERR_TUNER_MODE               =(MCIERR_BASE + 145);
509 MCIERR_TUNER_REGION_NOT_SET     =(MCIERR_BASE + 146);
510 MCIERR_TUNER_CHANNEL_NOT_SET    =(MCIERR_BASE + 147);
511 MCIERR_UNSUPP_CLASS             =(MCIERR_BASE + 148);
512 MCIERR_UNSUPPORTED_ATTRIBUTE    =(MCIERR_BASE + 149);
513 
514 MCIERR_CUSTOM_DRIVER_BASE       =(MCIERR_BASE + 256);
515 
516 //******************************************/
517 //* Sync/Stream Manager Error Return codes */
518 //******************************************/
519 
520 MEBASE                          =(MCIERR_BASE + 500);
521 ERROR_INVALID_STREAM            =(MEBASE + 1);
522 ERROR_INVALID_HID               =(MEBASE + 2);
523 ERROR_INVALID_NETWORK           =(MEBASE + 3);
524 ERROR_INVALID_OBJTYPE           =(MEBASE + 4);
525 ERROR_INVALID_FLAG              =(MEBASE + 5);
526 ERROR_INVALID_EVCB              =(MEBASE + 6);
527 ERROR_INVALID_EVENT             =(MEBASE + 7);
528 ERROR_INVALID_MMTIME            =(MEBASE + 8);
529 ERROR_INVALID_NUMSLAVES         =(MEBASE + 9);
530 ERROR_INVALID_REQUEST           =(MEBASE + 10);
531 ERROR_INVALID_SPCBKEY           =(MEBASE + 11);
532 ERROR_INVALID_HNDLR_NAME        =(MEBASE + 12);
533 ERROR_INVALID_PROTOCOL          =(MEBASE + 13);
534 ERROR_INVALID_BUFFER_SIZE       =(MEBASE + 14);
535 ERROR_INVALID_BUFFER_RETURNED   =(MEBASE + 15);
536 ERROR_INVALID_ACB               =(MEBASE + 16);
537 ERROR_INVALID_RECORD_RETURNED   =(MEBASE + 17);
538 ERROR_INVALID_MESSAGE           =(MEBASE + 18);
539 
540 ERROR_STREAM_NOT_OWNER          =(MEBASE + 99);
541 ERROR_STREAM_USED               =(MEBASE + 100);
542 ERROR_STREAM_CREATION           =(MEBASE + 101);
543 ERROR_STREAM_NOTMASTER          =(MEBASE + 102);
544 ERROR_STREAM_NOT_STOP           =(MEBASE + 103);
545 ERROR_STREAM_OPERATION          =(MEBASE + 104);
546 ERROR_STREAM_STOP_PENDING       =(MEBASE + 105);
547 ERROR_STREAM_ALREADY_STOP       =(MEBASE + 106);
548 ERROR_STREAM_ALREADY_PAUSE      =(MEBASE + 107);
549 ERROR_STREAM_NOT_STARTED        =(MEBASE + 108);
550 ERROR_STREAM_NOT_ACTIVE         =(MEBASE + 109);
551 ERROR_START_STREAM              =(MEBASE + 110);
552 ERROR_MASTER_USED               =(MEBASE + 111);
553 ERROR_SPCBKEY_MISMATCH          =(MEBASE + 112);
554 ERROR_INSUFF_BUFFER             =(MEBASE + 113);
555 ERROR_ALLOC_RESOURCES           =(MEBASE + 114);
556 ERROR_ACCESS_OBJECT             =(MEBASE + 115);
557 ERROR_HNDLR_REGISTERED          =(MEBASE + 116);
558 ERROR_DATA_ITEM_NOT_SPECIFIED   =(MEBASE + 117);
559 ERROR_INVALID_SEQUENCE          =(MEBASE + 118);
560 ERROR_INITIALIZATION            =(MEBASE + 119);
561 ERROR_READING_INI               =(MEBASE + 120);
562 ERROR_LOADING_HNDLR             =(MEBASE + 121);
563 ERROR_HNDLR_NOT_FOUND           =(MEBASE + 122);
564 ERROR_SPCB_NOT_FOUND            =(MEBASE + 123);
565 ERROR_DEVICE_NOT_FOUND          =(MEBASE + 124);
566 ERROR_TOO_MANY_EVENTS           =(MEBASE + 125);
567 ERROR_DEVICE_OVERRUN            =(MEBASE + 126);
568 ERROR_DEVICE_UNDERRUN           =(MEBASE + 127);
569 ERROR_HNDLR_NOT_IN_INI          =(MEBASE + 128);
570 ERROR_QUERY_STREAM_TIME         =(MEBASE + 129);
571 ERROR_DATA_ITEM_NOT_SEEKABLE    =(MEBASE + 130);
572 ERROR_NOT_SEEKABLE_BY_TIME      =(MEBASE + 131);
573 ERROR_NOT_SEEKABLE_BY_BYTES     =(MEBASE + 132);
574 ERROR_STREAM_NOT_SEEKABLE       =(MEBASE + 133);
575 ERROR_PLAYLIST_STACK_OVERFLOW   =(MEBASE + 135);
576 ERROR_PLAYLIST_STACK_UNDERFLOW  =(MEBASE + 136);
577 ERROR_LOCKING_BUFFER            =(MEBASE + 137);
578 ERROR_UNLOCKING_BUFFER          =(MEBASE + 138);
579 ERROR_SEEK_PAST_END             =(MEBASE + 139);
580 ERROR_SEEK_BACK_NOT_SUPPORTED   =(MEBASE + 140);
581 ERROR_INTERNAL_ERROR            =(MEBASE + 141);
582 ERROR_INTERNAL_CORRUPT          =(MEBASE + 142);
583 ERROR_INSUFF_MEM                =(MEBASE + 143);
584 ERROR_LARGE_SEEK_BY_TIME        =(MEBASE + 144);
585 ERROR_STREAM_PREROLLING         =(MEBASE + 145);
586 ERROR_INI_FILE                  =(MEBASE + 146);
587 ERROR_SEEK_BEFORE_BEGINNING     =(MEBASE + 147);
588 ERROR_TOO_MANY_HANDLERS         =(MEBASE + 148);
589 ERROR_ALLOC_HEAP                =(MEBASE + 149);
590 ERROR_END_OF_PLAYLIST           =(MEBASE + 150);
591 ERROR_TOO_MANY_STREAMS          =(MEBASE + 151);
592 ERROR_FILE_FORMAT_INCORRECT     =(MEBASE + 152);
593 ERROR_DESTROY_STREAM            =(MEBASE + 153);
594 ERROR_INVALID_NUMMASTERS        =(MEBASE + 154);
595 ERROR_MASTER_CONFLICT           =(MEBASE + 155);
596 ERROR_NO_MASTER                 =(MEBASE + 156);
597 ERROR_NO_SYNC                   =(MEBASE + 157);
598 ERROR_STREAM_ALREADY_IN_NETWORK =(MEBASE + 158);
599 ERROR_NO_STREAMS_IN_NETWORK     =(MEBASE + 159);
600 ERROR_MISSING_EVENT_ROUTINE     =(MEBASE + 160);
601 ERROR_CAN_NOT_REMOVE_STREAM     =(MEBASE + 161);
602 
603 ERROR_BUFFER_NOT_AVAILABLE      =(MEBASE + 400);
604 ERROR_TOO_MANY_BUFFERS          =(MEBASE + 401);
605 ERROR_TOO_MANY_RECORDS          =(MEBASE + 402);
606 
607 
608 //*----- ERROR_INVALID_PROTOCOL ulErrorStatus defines -----*/
609 //*----- Refer to SHC_NEGOTIATE_RESULT api.*/
610 PROTOCOL_SPCBLENGTH            =1;
611 PROTOCOL_SPCBKEY               =2;
612 PROTOCOL_DATAFLAG              =3;
613 PROTOCOL_NUMRECORDS            =4;
614 PROTOCOL_BLOCKSIZE             =5;
615 PROTOCOL_BUFFERSIZE            =6;
616 PROTOCOL_MINNUMBUFFERS         =7;
617 PROTOCOL_MAXNUMBUFFERS         =8;
618 PROTOCOL_SOURCESTART           =9;
619 PROTOCOL_TARGETSTART           =10;
620 PROTOCOL_BUFFERFLAG            =11;
621 PROTOCOL_HANDLERFLAG           =12;
622 PROTOCOL_SYNCTOLERANCE         =13;
623 PROTOCOL_SYNCINTERVAL          =14;
624 PROTOCOL_INTERNALERROR         =-1;
625 
626 //***********************************/
627 //* MMIO Manager Error Return codes */
628 //***********************************/
629 
630 MMIOERR_BASE                   =(MEBASE + 1000);
631 MMIOERR_UNBUFFERED             =(MMIOERR_BASE + 1);
632 MMIOERR_CANNOTWRITE            =(MMIOERR_BASE + 2);
633 MMIOERR_CHUNKNOTFOUND          =(MMIOERR_BASE + 3);
634 
635 MMIOERR_INVALID_HANDLE         =(MMIOERR_BASE + 4);
636 MMIOERR_INVALID_PARAMETER      =(MMIOERR_BASE + 5);
637 MMIOERR_INTERNAL_SYSTEM        =(MMIOERR_BASE + 6);
638 MMIOERR_NO_CORE                =(MMIOERR_BASE + 7);
639 
640 MMIOERR_INI_OPEN               =(MMIOERR_BASE + 8);
641 MMIOERR_INI_READ               =(MMIOERR_BASE + 9);
642 
643 MMIOERR_INVALID_BUFFER_LENGTH  =(MMIOERR_BASE + 10);
644 MMIOERR_NO_BUFFER_ALLOCATED    =(MMIOERR_BASE + 11);
645 MMIOERR_NO_FLUSH_FOR_MEM_FILE  =(MMIOERR_BASE + 12);
646 MMIOERR_NO_FLUSH_NEEDED        =(MMIOERR_BASE + 13);
647 MMIOERR_READ_ONLY_FILE         =(MMIOERR_BASE + 14);
648 MMIOERR_WRITE_ONLY_FILE        =(MMIOERR_BASE + 15);
649 MMIOERR_INSTALL_PROC_FAILED    =(MMIOERR_BASE + 16);
650 MMIOERR_READ_FAILED            =(MMIOERR_BASE + 17);
651 MMIOERR_WRITE_FAILED           =(MMIOERR_BASE + 18);
652 MMIOERR_SEEK_FAILED            =(MMIOERR_BASE + 19);
653 MMIOERR_CANNOTEXPAND           =(MMIOERR_BASE + 20);
654 MMIOERR_FREE_FAILED            =(MMIOERR_BASE + 21);
655 MMIOERR_EOF_SEEN               =(MMIOERR_BASE + 22);
656 MMIOERR_INVALID_ACCESS_FLAG    =(MMIOERR_BASE + 23);
657 MMIOERR_INVALID_STRUCTURE      =(MMIOERR_BASE + 24);
658 MMIOERR_INVALID_SIZE           =(MMIOERR_BASE + 25);
659 MMIOERR_INVALID_FILENAME       =(MMIOERR_BASE + 26);
660 
661 MMIOERR_CF_DUPLICATE_SEEN      =(MMIOERR_BASE + 27);
662 MMIOERR_CF_ENTRY_NO_CORE       =(MMIOERR_BASE + 28);
663 MMIOERR_CF_WO_UNSUPPORTED      =(MMIOERR_BASE + 29);
664 MMIOERR_CF_ELEMENTS_OPEN       =(MMIOERR_BASE + 30);
665 MMIOERR_CF_NON_BND_FILE        =(MMIOERR_BASE + 31);
666 MMIOERR_CF_ENTRY_NOT_FOUND     =(MMIOERR_BASE + 32);
667 
668 MMIOERR_DELETE_FAILED          =(MMIOERR_BASE + 33);
669 MMIOERR_OUTOFMEMORY            =(MMIOERR_BASE + 34);
670 
671 MMIOERR_INVALID_DLLNAME        =(MMIOERR_BASE + 35);
672 MMIOERR_INVALID_PROCEDURENAME  =(MMIOERR_BASE + 36);
673 MMIOERR_MATCH_NOT_FOUND        =(MMIOERR_BASE + 37);
674 
675 MMIOERR_SEEK_BEFORE_BEGINNING  =(MMIOERR_BASE + 38);
676 MMIOERR_INVALID_FILE           =(MMIOERR_BASE + 39);
677 MMIOERR_QOSUNAVAILABLE         =(MMIOERR_BASE + 40);
678 MMIOERR_MEDIA_NOT_FOUND        =(MMIOERR_BASE + 41);
679 
680 MMIOERR_ERROR_IN_FRAME_DATA    =(MMIOERR_BASE + 42);
681 MMIOERR_INVALID_DIM_ALIGN      =(MMIOERR_BASE + 43);
682 MMIOERR_CODEC_NOT_SUPPORTED    =(MMIOERR_BASE + 44);
683 
684 MMIOERR_UNSUPPORTED_FUNCTION   =(MMIOERR_BASE + 45);
685 MMIOERR_CLIPBRD_ERROR          =(MMIOERR_BASE + 46);
686 MMIOERR_CLIPBRD_ACTIVE         =(MMIOERR_BASE + 47);
687 MMIOERR_CLIPBRD_EMPTY          =(MMIOERR_BASE + 48);
688 MMIOERR_NEED_NEW_FILENAME      =(MMIOERR_BASE + 49);
689 MMIOERR_INVALID_TRACK_OPERATION=(MMIOERR_BASE + 50);
690 MMIOERR_INCOMPATIBLE_DATA      =(MMIOERR_BASE + 51);
691 MMIOERR_ACCESS_DENIED          =(MMIOERR_BASE + 52);
692 MMIOERR_MISSING_FLAG           =(MMIOERR_BASE + 53);
693 MMIOERR_INVALID_ITEM_FLAG      =(MMIOERR_BASE + 54);
694 
695 //*************************************/
696 //* Real-Time MIDI Error Return Codes */
697 //*************************************/
698 
699 MIDIERR_BASE                     =(MMIOERR_BASE + 500);
700 
701 MIDIERR_DUPLICATE_INSTANCE_NAME  =(MIDIERR_BASE + 1);
702 MIDIERR_HARDWARE_FAILED          =(MIDIERR_BASE + 2);
703 MIDIERR_INTERNAL_SYSTEM          =(MIDIERR_BASE + 3);
704 MIDIERR_INVALID_BUFFER_LENGTH    =(MIDIERR_BASE + 4);
705 MIDIERR_INVALID_CLASS_NUMBER     =(MIDIERR_BASE + 5);
706 MIDIERR_INVALID_CONFIG_DATA      =(MIDIERR_BASE + 6);
707 MIDIERR_INVALID_FLAG             =(MIDIERR_BASE + 7);
708 MIDIERR_INVALID_INSTANCE_NAME    =(MIDIERR_BASE + 8);
709 MIDIERR_INVALID_INSTANCE_NUMBER  =(MIDIERR_BASE + 9);
710 MIDIERR_INVALID_PARAMETER        =(MIDIERR_BASE + 10);
711 MIDIERR_INVALID_SETUP            =(MIDIERR_BASE + 11);
712 MIDIERR_NO_DRIVER                =(MIDIERR_BASE + 12);
713 MIDIERR_NO_DEFAULT_HW_NODE       =(MIDIERR_BASE + 13);
714 MIDIERR_NOT_ALLOWED              =(MIDIERR_BASE + 14);
715 MIDIERR_NOTIFY_MISSED            =(MIDIERR_BASE + 15);
716 MIDIERR_RESOURCE_NOT_AVAILABLE   =(MIDIERR_BASE + 16);
717 MIDIERR_SENDONLY                 =(MIDIERR_BASE + 17);
718 MIDIERR_RECEIVEONLY              =(MIDIERR_BASE + 18);
719 
720 TIMERERR_BASE                    =(MIDIERR_BASE + 100);
721 
722 TIMERERR_INVALID_PARAMETER       =(TIMERERR_BASE + 1);
723 TIMERERR_INTERNAL_SYSTEM         =(TIMERERR_BASE + 2);
724 
725 
726 //***********************************/
727 //* User defined Error Return codes */
728 //***********************************/
729 
730 USERERR_BASE                     =(MMIOERR_BASE + 1000);
731 
732 Const
733   FOURCC_ULTI:FOURCC=0;
734   FOURCC_RT21:FOURCC=0;
735   FOURCC_DIB :FOURCC=0;
736   FOURCC_R565:FOURCC=0;
737   FOURCC_R555:FOURCC=0;
738   FOURCC_R664:FOURCC=0;
739   FOURCC_RGB3:FOURCC=0;
740   FOURCC_BGR3:FOURCC=0;
741   FOURCC_RGB4:FOURCC=0;
742   FOURCC_BGR4:FOURCC=0;
743   FOURCC_LUT8:FOURCC=0;
744   FOURCC_LT12:FOURCC=0;
745   FOURCC_GREY:FOURCC=0;
746   FOURCC_GY16:FOURCC=0;
747   FOURCC_Y888:FOURCC=0;
748   FOURCC_Y2X2:FOURCC=0;
749   FOURCC_Y4X4:FOURCC=0;
750   FOURCC_YUV9:FOURCC=0;
751   FOURCC_Y644:FOURCC=0;
752   FOURCC_MONO:FOURCC=0;
753   FOURCC_Y422:FOURCC=0;
754   FOURCC_Y42B:FOURCC=0;
755   FOURCC_Y42D:FOURCC=0;
756   FOURCC_Y411:FOURCC=0;
757   FOURCC_VGA :FOURCC=0;
758 
759 Const
760   // FourCCs will be initialized in Initialization section
761   FourCC_RIFF                   : FourCC = 0;
762   FourCC_LIST                   : FourCC = 0;
763   FourCC_MEM                    : FourCC = 0;
764   FourCC_DOS                    : FourCC = 0;
765   FourCC_BND                    : FourCC = 0;
766   FourCC_FREE                   : FourCC = 0;
767   FourCC_DEL                    : FourCC = 0;
768   FourCC_CTOC                   : FourCC = 0;
769   FourCC_CGRP                   : FourCC = 0;
770   FourCC_CF                     : FourCC = 0;
771 
772 
773 //****************************************************************************/
774 //*                                                                          */
775 //* Module Name: AUDIO.H                                                     */
776 //*                                                                          */
777 //* OS/2 2.0 Multimedia Extensions Audio Structures and definitions.         */
778 //*                                                                          */
779 //* Copyright (c) International Business Machines Corporation 1991, 1992     */
780 //*                        All Rights Reserved                               */
781 //*                                                                          */
782 //* Ported to FPC: CooL/2 Aka Andy Svirgunov.                                */
783 //****************************************************************************/
784 
785 //*-------------------------------------------------------------------------*
786 //* AUDIODD version level
787 //-------------------------------------------------------------------------*/
788 
789 CONST
790          CURRENT_VERSION=$01020000;
791 
792 //*-------------------------------------------------------------------------*
793 //* Control definitions
794 //*-------------------------------------------------------------------------*/
795 
796         AUDIO_IOCTL_CAT   =$80;
797         AUDIO_INIT        =$40;
798         AUDIO_STATUS      =$41;
799         AUDIO_CONTROL     =$42;
800         AUDIO_BUFFER      =$43;
801         AUDIO_LOAD        =$44;
802         AUDIO_WAIT        =$45;
803         AUDIO_HPI         =$46;
804         AUDIO_CAPABILITY  =$48;
805 
806         MIX_GETCONNECTIONS=$60;
807         MIX_SETCONNECTIONS=$61;
808         MIX_GETLINEINFO   =$62;
809         MIX_GETCONTROL    =$63;
810         MIX_SETCONTROL    =$64;
811 
812 //*-------------------------------------------------------------------------*
813 //* AUDIO_INIT declarations and defines
814 //*-------------------------------------------------------------------------*/
815 
816         LOAD_PATH = 260;
817 
818 //* Values for AUDIO_INIT.sMode  */
819 
820         ADPCM     =1;     //* AVC type ADPCM                */
821         PCM       =2;     //* Pulse Coded Modulation        */
822         MU_LAW    =3;     //* mu-law                        */
823         MIDI      =4;     //* MIDI data                     */
824         A_LAW     =5;     //* a-law                         */
825         SOURCE_MIX=6;     //* External audio source         */
826         SPV2      =7;     //* Speech Viewer/2               */
827         ADPCMXA   =8;     //* XA CD ROM                     */
828         SPV2BCPCM =25;    //* Speech Viewer/2               */
829         SPV2PCM   =26;
830         SPV2NONE  =27;
831         IDLE      =999;
832         CLAIM_HDWR=32000; //* Serialize access to hardware  */
833 
834 //* Values for AUDIO_INIT.ulFlags        */
835 
836         FIXED             =$00000001;    // Fixed length data             */
837         LEFT_ALIGNED      =$00000002;    // Left align bits on byte bndry */
838         RIGHT_ALIGNED     =$00000004;    // Right align bits on byte bndry*/
839         TWOS_COMPLEMENT   =$00000008;    // 2's complement data           */
840         SIGNED            =$00000010;    // Signed data                   */
841         BIG_ENDIAN        =$00000020;    // MSB's first (motorola format) */
842         RIFF_DATATYPE     =$00000040;    // sMode contains a RIFF datatype*/
843         PITCH             =$00100000;    // Pitch control is supported    */
844         INPUT             =$00200000;    // Input select is supported     */
845         OUTPUT            =$00400000;    // Output select is supported    */
846         MONITOR           =$00800000;    // Monitor is supported          */
847         VOLUME            =$01000000;    // Volume control is supported   */
848         VOLUME_DELAY      =$02000000;    // Volume delay is supported     */
849         BALANCE           =$04000000;    // Balance control is supported  */
850         BALANCE_DELAY     =$08000000;    // Balance delay is supported    */
851         TREBLE            =$10000000;    // Treble control is supported   */
852         BASS              =$20000000;    // Bass control supported        */
853         BESTFIT_PROVIDED  =$40000000;    // bestfit returned              */
854         LOAD_CODE         =$80000000;    // DSP load needed               */
855 
856 //* Values for AUDIO_INIT.ulOperation    */
857 
858         OPERATION_PLAY    =1;
859         OPERATION_RECORD  =2;
860         PLAY_AND_RECORD   =3;
861         ANALYSIS          =6;             // Speech Viewer/2               */
862         DISTANCE          =7;             // Speech Viewer/2               */
863         MIGRATION         =8;             // Speech Viewer/2               */
864 
865 //* Values for AUDIO_INIT.sReturnCode    */
866 
867         NO_PLAY                      =1;
868         NO_RECORD                    =2;
869         NO_RECORD_AND_PLAY           =3;
870         INVALID_REQUEST              =4;
871         CONFLICT                     =5;
872         OVERLOADED                   =6;
873         DOWNLEVEL_DD                 =7; // DD is down level from appl.   */
874         DSP_LOAD_PENDING_ON_OTHER_TRK=8; // Other trk hasn't loaded dsp   */
875 
876         AUDIO_IGNORE                 =-1;
877 
878 //* Values for AUDIO_INIT.sDeviceID      */
879 
880         MINIDD                 =0;
881         ACPA                   =1;
882         MACPA                  =2;
883         MPU401                 =3;
884         SOUND_BLASTER          =4;
885         IMF                    =5;
886         PS1                    =6;
887         PAS16                  =7;
888 
889 //* AUDIO_INIT structure declaration     */
890 
891 TYPE MCI_AUDIO_INIT = RECORD
892         lSRate:LongInt;
893         lBitsPerSRate:Longint;
894         lBsize:LongInt;
895         sMode:Integer;
896         sChannels:Integer;
897         lResolution:LongInt;
898         abLoadPath:ARRAY [0..LOAD_PATH] of CHAR;
899         ulFlags:LongInt;
900         ulOperation:LongInt;
901         sReturnCode:Integer;
902         sSlotNumber:Integer;
903         sDeviceID:Integer;
904         pvReserved:Pointer;       //* MMPM2 uses this to pass back sysfilenum */
905         ulVersionLevel:LongInt;
906         end;
907 TYPE PMCI_AUDIO_INIT = ^MCI_AUDIO_INIT;
908 
909 //*-------------------------------------------------------------------------*
910 //* AUDIO_DEVID declarations and defines
911 //*-------------------------------------------------------------------------*/
912 
913 TYPE _MCI_AUDIO_DEVID = RECORD
914         ulDevType:LongInt;
915         ulDevNum:LongInt;
916         end;
917 
918 TYPE PMCI_AUDIO_DEVID = ^_MCI_AUDIO_DEVID;
919 
920 //* Input devices        */
921 
922 CONST
923 
924         NULL_INPUT              =0;
925         STEREO_LINE_INPUT       =1;
926         LEFT_LINE_INPUT         =2;
927         RIGHT_LINE_INPUT        =3;
928         MIC_INPUT               =4;
929         BOOSTED_MIC_INPUT       =5;
930         PHONE_LINE_INPUT        =6;
931         HANDSET_INPUT           =7;
932         SYNTH_INPUT             =8;
933         DIGITAL_PHONE_LINE_INPUT=9;
934         DIGITAL_HANDSET_INPUT   =10;
935         MIDI_IN_PORT            =11;
936         LOOPBACK                =11;
937         DEFAULT_INPUT           =$FFFFFFFF;
938 
939 
940 //* Output devices       */
941 
942         NULL_OUTPUT              = 0;
943         STEREO_LINE_OUTPUT       = 1;
944         LEFT_LINE_OUTPUT         = 2;
945         RIGHT_LINE_OUTPUT        = 3;
946         SPEAKER_OUTPUT           = 4;
947         HEADSET_OUTPUT           = 5;
948         PHONE_LINE_OUTPUT        = 6;
949         HANDSET_OUTPUT           = 7;
950         SYNTH_OUTPUT             = 8;
951         DIGITAL_PHONE_LINE_OUTPUT= 9;
952         DIGITAL_HANDSET_OUTPUT   = 10;
953         MIDI_OUT_PORT            = 11;
954         DEFAULT_OUTPUT           = $FFFFFFFF;
955 
956 //* Defined values for DevNum    */
957 
958         DEFAULT_DEVICE      = 0;
959         DEVICE_1            = 1;
960         DEVICE_2            = 2;
961 
962 
963 //*-------------------------------------------------------------------------*
964 //* Valid Return codes for the ulSupport field of MCI_AUDIO_CAPS
965 //*-------------------------------------------------------------------------*/
966         SUPPORT_SUCCESS         =$00000000;
967         UNSUPPORTED_RATE        =$00000001;
968         UNSUPPORTED_CHANNELS    =$00000002;
969         UNSUPPORTED_BPS         =$00000004;
970         UNSUPPORTED_DATATYPE    =$00000008;
971         UNSUPPORTED_OPERATION   =$00000010;
972 
973 
974 TYPE _MCI_AUDIO_CAPS = RECORD
975     ulLength:LongInt;                 // in     Structure length                    */
976     ulSamplingRate:LongInt;           // in out Sampling rate to query              */
977     ulChannels:LongInt;               // in out Channels to query                   */
978     ulBitsPerSample:LongInt;          // in out BPS to query                        */
979     ulDataType:LongInt;               // in out RIFF Datatype to query              */
980     ulOperation:LongInt;              // in out OPERATION_PLAY or OPERATION_RECORD  */
981     ulSupport:LongInt;                //    out BOOLEAN-does DD support this mode   */
982     ulDataSubType:LongInt;            //    out Data-subtype to use                 */
983     ulResourceUnits:LongInt;          //    out Resource units this mode            */
984     ulResourceClass:LongInt;          //    out Resource class for this mode        */
985     ulBlockAlign:LongInt;             //    out Block alignment for this mode.      */
986     fCanRecord:LongInt;               //    out Is recording possbile - this mode   */
987     ulFlags:LongInt;                  //    out                                     */
988     ulCapability:LongInt;             //    out Capability of the device.           */
989     end;
990 
991 TYPE PAUDIO_CAPS=^_MCI_AUDIO_CAPS;
992 
993 
994 //*-------------------------------------------------------------------------*
995 //* Valid Return codes for the ul field of MCI_AUDIO_CAPS
996 //*-------------------------------------------------------------------------*/
997 
998 CONST
999 
1000 SUPPORT_MIX                 =$00000001;// supports mixer functions           */
1001 SUPPORT_RIFF_MODES          =$00000002;// supports RIFF modes for AUDIO_INIT */
1002 SUPPORT_CAP                 =$80000000;// Capability IOCTL supported         */
1003 
1004 
1005 //*-------------------------------------------------------------------------*
1006 //* AUDIO_CHANGE declarations and defines
1007 //*-------------------------------------------------------------------------*/
1008 
1009 //* Values for AUDIO_CHANGE.lMonitor     */
1010 
1011 MONITOR_OFF                    =0;
1012 MONITOR_UNCOMPRESSED           =1;
1013 MONITOR_COMPRESSED             =2;
1014 
1015 //* Values for AUDIO_CHANGE.lInput       */
1016 
1017 HIGH_GAIN_MIC          = 0;
1018 LINE_1                 = 1;
1019 LINE_2                 = 2;
1020 LINES_1AND2            = 3;
1021 LOW_GAIN_MIC           = 4;
1022 ALL_LINES              = $FFFF;
1023 INPUTS_LISTED          = $5555;
1024 
1025 //* Values for AUDIO_CHANGE.lOutput      */
1026 
1027 EXTERNAL_SPEAKER        =1;
1028 INTERNAL_SPEAKER        =2;
1029 OUTPUT_1                =4;
1030 OUTPUTS_LISTED          =$5555;
1031 
1032 //* AUDIO_CHANGE structure declaration   */
1033 
1034 TYPE _MCI_AUDIO_CHANGE = RECORD
1035 
1036         pvDevInfo:Pointer;
1037         lInput:LongInt;
1038         lOutput:LongInt;
1039         lMonitor:LongInt;
1040         lVolume:LongInt;
1041         lVolumeDelay:LongInt;
1042         lBalance:LongInt;
1043         lBalanceDelay:LongInt;
1044         lTreble:LongInt;
1045         lBass:LongInt;
1046         lPitch:LongInt;
1047         rInputList:ARRAY[0..8] OF _MCI_AUDIO_DEVID;
1048         rOutputList:ARRAY[0..8] OF _MCI_AUDIO_DEVID;
1049 
1050         prMoreInputs:PMCI_AUDIO_DEVID;
1051         prMoreOutputs:PMCI_AUDIO_DEVID;
1052         lGain:LongInt;
1053         pvModeInfo:Pointer;
1054         end;
1055 
1056 TYPE PMCI_AUDIO_CHANGE=^_MCI_AUDIO_CHANGE;
1057 
1058 TYPE MIDI_INFO = RECORD
1059       sTempo:Integer;
1060       sCPQN:Integer;
1061       sMidiSwitches:Integer;
1062       sReserved:ARRAY[0..5] OF Integer;
1063       end;
1064 
1065 //*************************************************************************
1066 //*  MIDI Switches
1067 //**************************************************************************/
1068 
1069 CONST
1070 
1071         MIDI_THRU_THRU =0;
1072         MIDI_THRU_OUT  =1;
1073 
1074 
1075 //*-------------------------------------------------------------------------*
1076 //* AUDIO_STATUS declarations and defines
1077 //*-------------------------------------------------------------------------*/
1078 
1079 //* Values for AUDIO_STATUS.ulOperation  */
1080 
1081         STOPPED                 =0;
1082         PLAYING                 =1;
1083         RECORDING               =2;
1084         PLAYING_AND_RECORDING   =3;
1085         UNITIALIZED             =$FFFFFFFF;
1086 
1087 //* AUDIO_STATUS structure declaration   */
1088 
1089 TYPE MCI_AUDIO_STATUS = RECORD
1090         lSRate:LongInt;
1091         lBitsPerSRate:LongInt;
1092         lBsize:LongInt;
1093         sMode:Integer;
1094         sChannels:Integer;
1095         ulFlags:longInt;
1096         ulOperation:LongInt;
1097         rAudioChange:_MCI_AUDIO_CHANGE;
1098         end;
1099 
1100 TYPE PMCI_AUDIO_STATUS = MCI_AUDIO_STATUS;
1101 
1102 //*-------------------------------------------------------------------------*
1103 //* AUDIO_CONTROL declarations and defines
1104 //*-------------------------------------------------------------------------*/
1105 
1106 //* Values for AUDIO_CONTROL.usIOCtlRequest      */
1107 
1108 CONST
1109 
1110         AUDIO_CHANGE            =0;
1111         AUDIO_START             =1;
1112         AUDIO_STOP              =2;
1113         AUDIO_PAUSE             =3;
1114         AUDIO_RESUME            =4;
1115 
1116 //* Values for AUDIO_CONTROL.sReturnCode */
1117 
1118 AC_UNINITED         = 1;       // Device must be init'ed or loaded first    */
1119 FULL_QUEUE          = 2;       // Maximum # requests exceeded        */
1120 AC_UNPAUSED         = 3;       // Resume issued, but dev not paused  */
1121 AC_UNSTARTED        = 5;       // Device must be started first       */
1122 INVALID_INPUT_LIST  = 7;       // invalid change.input_list entry    */
1123 INVALID_OUTPUT_LIST = 8;       // invalid change.output_list entry   */
1124 
1125 //* AUDIO_CONTROL structure declaration  */
1126 
1127 TYPE MCI_AUDIO_CONTROL = RECORD
1128         usIOCtlRequest:Integer;
1129         pbRequestInfo:Pointer;
1130         ulPosition:LongInt;
1131         sReturnCode:Integer;
1132         end;
1133 
1134 TYPE PMCI_AUDIO_CONTROL = MCI_AUDIO_CONTROL;
1135 
1136 //*-------------------------------------------------------------------------*
1137 //* AUDIO_BUFFER declarations and defines
1138 //*-------------------------------------------------------------------------*/
1139 
1140 //* Values for AUDIO_BUFFER.ulFlags      */
1141 
1142 CONST
1143 
1144         AUDIO_UNDERRUN  =1;
1145         AUDIO_OVERRUN   =2;
1146 
1147 //* Values for AUDIO_BUFFER.ulPositionType       */
1148 
1149         POS_MSECS       =0;
1150         MIDI_CLOCKS     =1;
1151         SMPTE_24        =24;
1152         SMPTE_25        =25;
1153         SMPTE_30DF      =29;
1154         SMPTE_30        =30;
1155 
1156 TYPE MCI_AUDIO_BUFFER = RECORD
1157         ulFlags:LongInt;
1158         ulReadBufSize:LongInt;
1159         ulWriteBufSize:LongInt;
1160         ulReadBufTime:LongInt;
1161         ulWriteBufTime:LongInt;
1162         ulReadBufMax:LongInt;
1163         ulWriteBufMax:LongInt;
1164         ulPosition:LongInt;
1165         ulPositionType:LongInt;
1166         lReadBufCap:LongInt;
1167         lWriteBufCap:LongInt;
1168         lRequestBufCap:LongInt;
1169         end;
1170 
1171 TYPE PMCI_AUDIO_BUFFER =^MCI_AUDIO_BUFFER;
1172 
1173 //*-------------------------------------------------------------------------*
1174 //* AUDIO_LOAD declarations and defines
1175 //*-------------------------------------------------------------------------*/
1176 
1177 //* Values for AUDIO_LOAD.ulFlags        */
1178 
1179 CONST
1180 
1181         LOAD_START              =$01;
1182         LOAD_END                =$02;
1183         LOAD_32BIT              =$10;
1184 
1185 
1186 TYPE MCI_AUDIO_LOAD = RECORD
1187         pbBuffer:^Char;
1188         ulSize:LongInt;
1189         ulFlags:LongInt;
1190         end;
1191 
1192 TYPE PMCI_AUDIO_LOAD = MCI_AUDIO_LOAD;
1193 
1194 //*-------------------------------------------------------------------------*
1195 //* Track info declarations and defines
1196 //*-------------------------------------------------------------------------*/
1197 
1198 //* Track Info structure declaration     */
1199 
1200 TYPE MCI_TRACK_INFO = RECORD
1201         usMasterVolume:Integer;
1202         usDitherPct:Integer; //* Percent of a bit dither during record  */
1203         usMasterVolumeDelay:Integer;
1204         usMasterBalance:Integer;
1205         usMasterBalanceDelay:Integer;
1206         end;
1207 
1208 TYPE PMCI_TRACK_INFO = ^MCI_TRACK_INFO;
1209 
1210 
1211 //*-------------------------------------------------------------------------*
1212 //* IOBUFFER declarations and defines
1213 //*-------------------------------------------------------------------------*/
1214 
1215 CONST
1216 
1217         STARTED  =1;
1218         PAUSED   =2;
1219 
1220 TYPE _MCI_AUDIO_IOBUFFER = RECORD
1221         lSize:LongInt;
1222         pHead:^Char;
1223         pTail:^Char;
1224         lCount:LongInt;
1225         ulPosition:LongInt;
1226         lDelay:LongInt;
1227         usRunFlags:Integer;
1228         usSelInc:Integer;
1229         pBuffer:^Char;
1230         end;
1231 
1232 TYPE PMCI_AUDIO_IOBUFFER = ^_MCI_AUDIO_IOBUFFER;
1233 
1234 //*-------------------------------------------------------------------------*
1235 //* AUDIO_HPI declarations and defines
1236 //-------------------------------------------------------------------------*/
1237 
1238 CONST
1239 
1240         CBXMIT  =1;
1241         CBREC   =2;
1242         CRTIMER =4;
1243 
1244         EP_OPEN         =0;
1245         EP_CLOSE        =1;
1246         EP_READ         =2;
1247         EP_WRITE        =3;
1248         EP_INIT         =4;
1249         EP_STATUS       =5;
1250         EP_CONTROL      =6;
1251         EP_BUFFER       =7;
1252         EP_LOAD         =8;
1253         EP_WAIT         =9;
1254 
1255 
1256 
1257 TYPE MCI_AUDIO_HPI = RECORD
1258         pvEntry :procedure;
1259         pvCallBack:procedure;
1260 //        VOID (FAR *pvEntry)();
1261 //        VOID (FAR *pvCallBack)();
1262         prXBuff:PMCI_AUDIO_IOBUFFER;
1263         prRBuff:PMCI_AUDIO_IOBUFFER;
1264         usFlags:Integer;
1265         end;
1266 
1267 TYPE PMCI_AUDIO_HPI = ^MCI_AUDIO_HPI;
1268 
1269 //**************************/
1270 //* AUDIO_UPDATE Structure */
1271 //**************************/
1272 TYPE AUDIO_UPDATE = RECORD
1273 
1274   iobuf_type:Char;              //* 0 - XMITIO, 1 - RECIO to be updated      */
1275   buffer_address:^Char;     //* address to buffer to be added to array   */
1276   buffer_length:LongInt;          //* length of buffer to be added             */
1277   rc:Integer;                    //* return code                              */
1278   reserved:Pointer;           //* future use                               */
1279   end;
1280 
1281 TYPE UPDATE = ^AUDIO_UPDATE;
1282 
1283 //* audio_update.iobuf_type definitions                                      */
1284 
1285 CONST
1286 
1287         XMIT_IOBUF =0;
1288         REC_IOBUF  =1;
1289 
1290 //* audio_update.rc definitions                                              */
1291         MAX_NUM_BUFFERS_REACHED =9;
1292         UPDATE_GENERAL_FAILURE  =10;
1293         INVALID_BUFFER_LENGTH   =11;
1294 
1295 
1296 //****************************************************************************/
1297 //*                                                                          */
1298 //* Module Name:  CDAUDIO.H                                                  */
1299 //*                                                                          */
Thisnull1300 //* FUNCTION:  This file contains the macro definition and common record     */
1301 //*            structures used between the CD Audio MCI Driver, its VSDs     */
1302 //*            (Vendor Specific Drivers), and the CD look-up table,          */
1303 //*            MMPMCD.INI.                                                   */
1304 //*                                                                          */
1305 //* Copyright (c) International Business Machines Corporation 1991 - 1993    */
1306 //*                        All Rights Reserved                               */
1307 //****************************************************************************/
1308 //*                                                                          */
1309 //* Ported to FPC: CooL/2 Aka Andy Svirgunov.                                */
1310 //*                                                                          */
1311 //****************************************************************************/
1312 
1313 //*******************************************************************/
1314 //* CD MCD and VSD values and inter-modual communications           */
1315 //*******************************************************************/
1316 
1317 
1318 //**********************************/
1319 //* Macro Definitions              */
1320 //**********************************/
1321 
1322 Const
1323 
1324 UPC_SIZE             = 7;     //* UPC code size, CD serial number */
1325 CDMCD_CUEPOINT_MAX   = 20;     //* maximum number of cuepoints */
1326 CDROM_SPEC_START     = 6000;     //* 2 seconds, greatest min start address */
1327 MCI_INTERNAL_MESSAGES_START = 1000;
1328 
1329 //*************************************************************************/
1330 //* Internal messages between the MCI Driver and the VSD.                 */
1331 //*************************************************************************/
1332 
1333 MCIDRV_REGISTER_DISC    =MCI_INTERNAL_MESSAGES_START + 1;
1334 MCIDRV_REGISTER_DRIVE   =MCI_INTERNAL_MESSAGES_START + 2;
1335 MCIDRV_REGISTER_TRACKS  =MCI_INTERNAL_MESSAGES_START + 3;
1336 MCIDRV_CD_READ_LONG     =MCI_INTERNAL_MESSAGES_START + 4;
1337 MCIDRV_CD_SET_VERIFY    =MCI_INTERNAL_MESSAGES_START + 5;
1338 MCIDRV_CD_STATUS_CVOL   =MCI_INTERNAL_MESSAGES_START + 6;
1339 
1340 
1341 //*************************************************************************/
1342 //* Internal callback routine from the VSD to the MCI Driver.             */
1343 //*************************************************************************/
1344 
1345 //typedef VOID (*PFNCDMCD) (DWORD, DWORD, DWORD);
1346 
1347 
1348 //***********************************/
1349 //* CDAudRegister record structures */
1350 //***********************************/
1351 
1352 TYPE MCI_CD_ID = Record   //* ID a disc, used to verify a disc change                 */
1353                 //* must stay at 8 bytes to equal size of UPC               */
1354    Mode:byte;                           //* mode, 0=UPC, 1=ID              */
1355    wTrack1:word;                        //* address of track one in MMTIME */
1356    NumTracks:byte;                      //* number of tracks               */
1357    dwLeadOut:word;                      //* address of lead out track      */
1358    end;
1359 
1360 TYPE MCI_CD_REGDRIVE_PARMS=RECORD //* CD-ROM Drive information, determines capabilities */
1361 
1362    wCaps:WORD;                          //* capabilities                   */
1363    dwPrerollType:WORD;                  //* preroll type                   */
1364    dwPrerollTime:WORD;                  //* preroll time                   */
1365    dwMinStartTime:WORD;                 //* minimum starting time          */
1366    dwCDMCDID:WORD;                      //* CD MCD ID for instance         */
1367 //   pCDMCDReturn:PFNCDMCD;                //* addr of CD MCD Return function */
1368    end;
1369 
1370 //*************************************************/
1371 //* These flags are valid for the wCaps Field     */
1372 //*************************************************/
1373 CONST
1374 
1375 CDVSD_CAP_CAN_RECORD  =$0001;   //* Can record audio               */
1376 CDVSD_CAP_HAS_AUDIO   =$0002;   //* Can play audio                 */
1377 CDVSD_CAP_HAS_VIDEO   =$0004;    //* Can play video                 */
1378 CDVSD_CAP_CAN_CLSDOOR =$0008;    //* Can retract tray/close door    */
1379 CDVSD_CAP_CAN_EJECT   =$0010;    //* Can eject disc                 */
1380 CDVSD_CAP_CAN_STREAM  =$0020;    //* Can stream                     */
1381 CDVSD_CAP_HAS_DAC     =$0040;    //* Can process internal           */
1382 CDVSD_CAP_CAN_LOCK    =$0080;    //* Can disable manual eject       */
1383 CDVSD_CAP_CAN_VOLUME  =$0100;    //* Can manipulate volume settings */
1384 CDVSD_CAP_CAN_REVERSE =$0200;    //* Can play in reverse            */
1385 CDVSD_CAP_CAN_V_SPEED =$0400;    //* Can vary play speed            */
1386 CDVSD_CAP_CAN_CUE     =$0800;    //* Can read sequent. after break  */
1387                                         //* Used for Cue, Pause, and Seek  */
1388 
1389 
1390 TYPE MCI_CD_REGDISC_PARMS = RECORD //* Information about the disc  */
1391 
1392    LowestTrackNum:BYTE;                 //* lowest track number  */
1393    HighestTrackNum:BYTE;                //* highest track number */
1394    UPC:ARRAY [0..UPC_SIZE] of BYTE;                  //* upc, 13 BCD + 4bit 0 */
1395    DiscID:MCI_CD_ID;                      //* Disc ID              */
1396    end;
1397 
1398 TYPE MCI_CD_REGTRACK_REC=RECORD //* Information about each track */
1399 
1400    TrackNum:BYTE;                       //* track number               */
1401    dwStartAddr:WORD;                    //* starting address in MMTIME */
1402    dwEndAddr:WORD;                      //* ending address             */
1403    TrackControl:BYTE;                   //* track control information  */
1404    end;
1405 
1406 TYPE MCI_CD_REGTRACKS_PARMS=RECORD //* Track information, used to verify address */
1407    TrackRecArr:^MCI_CD_REGTRACK_REC;     //* ptr to array of track recs  */
1408    dwBufSize:WORD;                      //* size of buffer              */
1409    end;
1410 
1411 //********************************************/
1412 //* Environment settings to save and restore */
1413 //********************************************/
1414 
1415 TYPE MCIDRV_CD_SAVE_PARMS=RECORD
1416    dwPosition:WORD;                      //* current position in MMTIME       */
1417    dwEndPlay:WORD;                       //* end play position                */
1418    dwMode:WORD;                          //* Play mode: playing, paused, etc. */
1419    dwLevel:WORD;                         //* volume levels                    */
1420    dwVSDData:WORD;                       //* Extra VSD data storage area      */
1421    end;
1422 
1423 //********************************************/
1424 //* Read Long (2352-Byte) Sectors            */
1425 //********************************************/
1426 
1427 //**************************************************************************/
1428 //* Flag for the MCIDRV_CD_READ_LONG message                               */
1429 //*   Default addressing mode for the dwFrom field is Hardware Red Book.   */
1430 //*   Absolute sector addressing for ISO-9660, or High Sierra Group        */
1431 //*   requires a flag, as does an MMTIME address.                          */
1432 //**************************************************************************/
1433 
1434 CONST
1435 
1436 MCI_CD_READLONG_HSG          =$00000100;
1437 MCI_CD_READLONG_MMTIME       =$00000200;
1438 
1439 TYPE MCI_CD_READLONG_PARMS=RECORD
1440    dwFrom:WORD;                        //* read from this position   */
1441    wCount:WORD;                        //* Number of sectors to read */
1442    lpstrReturn:^CHAR;                  //* Pointer to return buffer  */
1443    dwRetSize:WORD;                     //* Return buffer size        */
1444    end;
1445 
1446 
1447 
1448 //*******************************************************************/
1449 //* CD Table INI file, MMPMCD.INI, values                           */
1450 //*******************************************************************/
1451 
1452 //*******************************************************************/
1453 //* Capability Flags I from the CD drive look-up table, MMPMCD.INI  */
1454 //*******************************************************************/
1455 
1456 CONST
1457 
1458 CDHW_CAP_CAN_EJECT    =$00000001; //* Can software eject disc         */
1459 CDHW_CAP_CAN_LOCK     =$00000002; //* Can lock drive/disable eject    */
1460 CDHW_CAP_READS_RAW    =$00000004; //* Can read raw sectors            */
1461 CDHW_CAP_CAN_WRITE    =$00000008; //* Can write to disc               */
1462 CDHW_CAP_CAN_PLAY     =$00000010; //* Can play CD-DA tracks           */
1463 CDHW_CAP_CAN_INTERLEV =$00000020; //* Supports ISO-9660 interleaving  */
1464 CDHW_CAP_CAN_PREFETCH =$00000080; //* Can prefetch internally         */
1465 CDHW_CAP_MANIP_AUDIO  =$00000100; //* Can manipulte audio channels    */
1466 CDHW_CAP_USES_REDBOOK =$00000200; //* Can use Red Book mode           */
1467 CDHW_CAP_READS_XA     =$00000400; //* Can read CD-ROM/XA data         */
1468 CDHW_CAP_CONT_READS   =$00000800; //* Continues to read DA after stop */
1469 CDHW_CAP_CAN_REVERSE  =$00001000; //* Can play in reverse             */
1470 CDHW_CAP_READS_CDDA   =$40000000; //* Can read CD-DA audio tracks     */
1471 
1472 
1473 //*******************************************************************/
1474 //* Capability Flags II from the CD drive look-up table, MMPMCD.INI */
1475 //*******************************************************************/
1476 
1477 CDHW_VOL_DEP_MASK     =$00000007; //* Volume dependency mask        */
1478 CDHW_VOL_DEP_NONE     =        0; //* Volume without dependency     */
1479 CDHW_VOL_DEP_HIGH     =        2; //* Volume is highest value       */
1480 CDHW_VOL_DEP_LOW      =        3; //* Volume is lowest value        */
1481 CDHW_VOL_DEP_LEFT     =        4; //* Volume is left volume         */
1482 CDHW_VOL_DEP_RIGHT    =        5; //* Volume is right volume        */
1483 CDHW_VOL_INDEP_MUTE   =$00000008; //* Mute has no dependency        */
1484 CDHW_CAP_LOCK_MOUNT   =$00000010; //* Can only lock when mounted    */
1485 CDHW_CAP_PLAY_VIDEO   =$00000020; //* Can play video                */
1486 CDHW_CAP_MODAL_ONLY   =$00000040; //* Stop req to interrupt PLAY    */
1487 CDHW_CAP_SUP_SEEK     =$00000080; //* Supports SEEK IOCTL           */
1488 CDHW_CAP_SUP_UPC      =$00000100; //* Supports UPC IOCTL            */
1489 CDHW_CAP_SUP_SUBCHAN  =$00000200; //* Supports sub-channel IOCTL    */
1490 CDHW_CAP_CAN_CLS_TRAY =$00000400; //* Can close door/retract caddy  */
1491 CDHW_CAP_NO_STREAM    =$00001000; //* Cannot stream CD-DA when PDD  */
1492                                          //*   says it can                 */
1493 CDHW_CAP_VAR_PLAY     =$80000000;  //* Supports variable speeds      */
1494 
1495 //* INI file record structure */
1496 CDINI_APPSIZE              =   8;  //* Application name size    */
1497 CDINI_KEYSIZE              =  16;  //* Key name size            */
1498 CDINI_VSD_NAME_SIZE        =   8;  //* size of file name        */
1499 VOLUME_CONTROL             = 101;  //* num of values, 0% - 100% */
1500 
1501 
1502 TYPE MMPMCD_REC=RECORD
1503  usEntryVer:INTEGER;                     //* Entry version                 */
1504  ulCaps1:LONGINT;                        //* Capability flag I             */
1505  ulCaps2:LONGINT;                        //* Capability flag II            */
1506  VSDName:ARRAY [0..CDINI_VSD_NAME_SIZE] of CHAR;   //* DLL name for VSD              */
1507  ulMinStart:LONGINT;                     //* Min starting addr, 0x00MMSSFF */
1508  usVolCnt:INTEGER;                       //* volume level counter          */
1509  ausVolValues:ARRAY [0..VOLUME_CONTROL] of INTEGER;  //* volume control values         */
1510  end;
1511 
1512 //*************************START OF SPECIFICATIONS **************************/
1513 //                                                                          */
1514 // Module NAME:  VIDEO.H                                                    */
1515 //                                                                          */
1516 // OS/2 2.0 Multimedia Extensions Video structures and definitions          */
1517 //                                                                          */
1518 // Copyright (c) International Business Machines Corporation 1993           */
1519 //                         All Rights Reserved                              */
1520 //***************************************************************************/
1521 // Converted by Andry Svirgunov. Email: cool2@ngs.ru                        */
1522 // 14.11.2002                                                               */
1523 //                                                                          */
1524 //************************* END OF SPECIFICATIONS ***************************/
1525 
1526 TYPE _VIDEO_FRAME_HDR = RECORD          // vfh  */
1527         FrameNumber   : LongInt;        // relative frame number       */
1528         FramesSkipped : LongInt;        // no. frames skipped between this and last frames */
1529         StreamTime    : LongInt;        // stream time in milliseconds */
1530         FrameSize     : LongInt;        // size in bytes               */
1531         SHparm1       : LongInt;        // used by stream handler      */
1532         reserved3     : LongInt;        // unused                      */
1533         reserved2     : LongInt;        // unused                      */
1534         reserved1     : LongInt;        // unused                      */
1535         end;
1536 
1537 TYPE PVIDEO_FRAME_HDR = ^_VIDEO_FRAME_HDR;
1538 
1539 //*************************START OF SPECIFICATIONS **************************/
1540 //                                                                          */
1541 // COPYRIGHT:     IBM - International Business Machines                     */
1542 //              Copyright (c) IBM Corporation  1991, 1992, 1993             */
1543 //                        All Rights Reserved                               */
1544 //                                                                          */
1545 //                                                                          */
1546 // SOURCE FILE NAME:  UMFORMAT.H                                            */
1547 //                                                                          */
1548 // DESCRIPTIVE NAME: Ultimotion File Format Headers (Beta)                  */
1549 //                                                                          */
1550 //   An Ultimotion file consists of interlevaed audio and video and text    */
1551 //   chunks within the data list chunk.                                     */
1552 //                                                                          */
1553 //   A file may contain interleaved audio chunks or the soundtrack may      */
1554 //   be contained in a seperate file specified in the header chunk, or      */
1555 //   there may be no associated soundtrack (a silent movie).  Multiple      */
1556 //   audio tracks are supported by this file format, either interleaved     */
1557 //   or in seperate files.  Only one video track, track 0, is supported in  */
1558 //   a single file.  Audio tracks are identified by a track number, with    */
1559 //   the first audio track being track 1.                                   */
1560 //                                                                          */
1561 //   If a file specifies both interleaved audio tracks and external         */
1562 //   audio tracks (.WAV files), the external audio tracks are numbered      */
1563 //   consecutively following the interleaved audio tracks.  For             */
1564 //   example, if a file specifies two interleaved audio tracks and two      */
1565 //   external audio tracks, the interleaved audio tracks will be tracks     */
1566 //   0 and 1, and the external audio tracks will be tracks 2 and 3.         */
1567 //   Note that tracks can carry distinct audio information such as          */
1568 //   multiple languages, and that stereo audio can be carried in a          */
1569 //   single track.                                                          */
1570 //                                                                          */
1571 //************************* END OF SPECIFICATIONS ***************************/
1572 
1573 // The hex fourcc value is also the SPCBKEY.ulDataSubType value for the */
1574 // Ultimotion file format - OS2MEDEF.H                                  */
1575 //***************************************************************************/
1576 // Ultimotion File Format:                                                  */
1577 //                                                                          */
1578 //                                                                          */
1579 //    Conventions used in this format:                                      */
1580 //                                                                          */
1581 //    - A file is a collection of chunks                                    */
1582 //    - The first ULONG in a chunk is the chunk type (chunk ID)             */
1583 //    - The second ULONG in a chunk is the length of the chunk,             */
1584 //         including the header and the data, but excluding the chunk       */
1585 //         ID and chunk length.                                             */
1586 //    - For each interleaved audio track there is one audio frame that      */
1587 //         corresponds to each video frame                                  */
1588 //    - An audio frame has the same duration as its corresponding video     */
1589 //         frame                                                            */
1590 //    - Audio frames always follow their corresponding video frame, and     */
1591 //         as such preceed the next video frame                             */
1592 //                                                                          */
1593 // Legend:                                                                  */
1594 //     [<element name>]      optional                                       */
1595 //     <element name>        1                                              */
1596 //     <element name>...     1 or more                                      */
1597 //     [<element name>]...   0 or more                                      */
1598 //                                                                          */
1599 //                                                                          */
1600 //                                                                          */
1601 //  SMV form                                                                */
1602 //  ---------                                                               */
1603 //                                                                          */
1604 // <RIFF( 'ummv'                                                            */
1605 //       <LIST( 'umhl'                             - Header LIST            */
1606 //             <Videoheader-ck>                    - Video header chunk     */
1607 //             <videotitle-ck>...                  - Video title chunk(s)   */
1608 //                                                 -                        */
1609 //             [<LIST( 'umal'                      - Audio LIST(s)          */
1610 //                    {<extaudiofilename-ck> |     - Ext. WAV files         */
1611 //                     <audioheader-ck>}           - Audio header           */
1612 //                    <audiotitle-ck>...)>]...     - Audio title            */
1613 //                                                 -                        */
1614 //             [<LIST( 'umtl'                      - Text LIST              */
1615 //                     <textheader-ck>...)>])>     - Text header            */
1616 //                                                 -                        */
1617 //       <LIST( 'umfd'                             - Frame data LIST        */
1618 //             <LIST( 'umcd' {                     - Chapter data LIST      */
1619 //                   <videoframe-ck>               - Video frame            */
1620 //                   [<audioframe-ck>]             - Audio frame            */
1621 //                   [<textframe-ck>]}...)>...)    - Text frame             */
1622 //                                                 -                        */
1623 //        [<LIST( 'umci'                           - Chap index table LIST  */
1624 //               <LIST( 'umce'                     - Chap index entry LIST  */
1625 //                     <chapterheader-ck>          - Chapter index hdr      */
1626 //                     <chapttitle-ck>...          - Chapter title          */
1627 //                     <frameindex-ck>)>...)>])>   - frame index            */
1628 //                                                 -  table                 */
1629 //                                                                          */
1630 //***************************************************************************/
1631 CONST
1632 
1633  UMAUDIOFILENAMELENGTH   =60;
1634  SIZEOF_FORM             =4;
1635 
1636 // ULTIMOTION FORMS */
1637         UMFORM_MOVIE                  = 'ummv';
1638         UMFORM_HEADERLIST             = 'umhl';
1639         UMFORM_AUDIOHDRLIST           = 'umal';
1640         UMFORM_TEXTHDRLIST            = 'umtl';
1641         UMFORM_FRAMEDATALIST          = 'umfd';
1642         UMFORM_CHAPTERDATALIST        = 'umcd';
1643         UMFORM_CHAPTERTABLELIST       = 'umci';
1644         UMFORM_CHAPTERENTRYLIST       = 'umce';
1645 
1646 // byte swapped hex defines for ulong assignments... */
1647         HEX_UMFORM_MOVIE               =$766d6d75;     // vmmu */
1648         HEX_UMFORM_HEADERLIST          =$6c686d75;     // lhmu */
1649         HEX_UMFORM_AUDIOHDRLIST        =$6c616d75;     // lamu */
1650         HEX_UMFORM_TEXTHDRLIST         =$6c746d75;     // ltmu */
1651         HEX_UMFORM_FRAMEDATALIST       =$64666d75;     // dfmu */
1652         HEX_UMFORM_CHAPTERDATALIST     =$64636d75;     // dcmu */
1653         HEX_UMFORM_CHAPTERTABLELIST    =$69636d75;     // icmu */
1654         HEX_UMFORM_CHAPTERENTRYLIST    =$65636d75;     // ecmu */
1655 
1656 // ULTIMOTION CHUNK IDS */
1657         UMID_VIDEOHEADER               ='umvh';
1658         UMID_EXTAUDIONAME              ='umea';
1659         UMID_AUDIOHEADER               ='umah';
1660         UMID_TEXTHEADER                ='umth';
1661         UMID_VIDEOTITLE                ='umvt';
1662         UMID_AUDIOTITLE                ='umat';
1663         UMID_TEXTFRAME                 ='umtf';
1664         UMID_VIDEOFRAME                ='umvf';
1665         UMID_AUDIOFRAME                ='umaf';
1666         UMID_CHAPTERHEADER             ='umch';
1667         UMID_CHAPTERTITLE              ='umct';
1668         UMID_FRAMETABLE                ='umfi';
1669 
1670 // byte swapped hex defines for ulong assignments... */
1671         HEX_UMID_VIDEOHEADER           =$68766d75;      // hvmu */
1672         HEX_UMID_EXTAUDIONAME          =$61656d75;      // aemu */
1673         HEX_UMID_AUDIOHEADER           =$68616d75;      // hamu */
1674         HEX_UMID_TEXTHEADER            =$68746d75;      // htmu */
1675         HEX_UMID_VIDEOTITLE            =$74766d75;      // tvmu */
1676         HEX_UMID_AUDIOTITLE            =$74616d75;      // tamu */
1677         HEX_UMID_TEXTFRAME             =$66746d75;      // ftmu */
1678         HEX_UMID_VIDEOFRAME            =$66766d75;      // fvmu */
1679         HEX_UMID_AUDIOFRAME            =$66616d75;      // famu */
1680         HEX_UMID_CHAPTERHEADER         =$68636d75;      // hcmu */
1681         HEX_UMID_CHAPTERTITLE          =$74636d75;      // tcmu */
1682         HEX_UMID_FRAMETABLE            =$69666d75;      // ifmu */
1683 
1684 
1685 
1686 //***************************************************************************/
1687 // CHUNK HEADER STRUCTURE - APPEARS AT START OF EACH CHUNK                  */
1688 //***************************************************************************/
1689 type UMCHUNKHEADER =record  // umch */
1690    ulChunkID:LongInt;              // ID for this chunk                   */
1691    ulChunkLength:LongInt;          // Length of chunk that follows        */
1692    end;
1693  PUMCHUNKHEADER=^UmChunkHeader;   // pumch */
1694 
1695 
1696 //***************************************************************************/
1697 // VIDEO HEADER CHUNK -                                                     */
1698 //                                                                          */
1699 // The UMVIDEOHEADER structure is followed by a list of                     */
1700 // usInterleavedTracks null-terminated external audio (.WAV) file           */
1701 // names.  The audio file name fields are fixed size to better enable       */
1702 // changing the file names without re-writing the file.                     */
1703 //***************************************************************************/
1704    UMVIDEOHEADER = record   // umvh */
1705    ulTotalDuration:LongInt;        // Video duration in MMTIME            */
1706    ulMaxFrameSize:LongInt;         // Max video frame size in bytes       */
1707    ulMaxAvgDataRate:LongInt;       // Max avergage data rate              */
1708    ulMaxBurstInterval:LongInt;     // Max interval for max data rate      */
1709    ulCompressionRatioX100:LongInt; // Compression ratio                   */
1710    ulPosterFrameOffset:LongInt;    // Poster for video (from beginning)   */
1711    usMaxFrameX:Word;            // Max horizontal frame size           */
1712    usMaxFrameY:Word;            // Max vertical frame size             */
1713    usNomFrameDuration:Word;     // Nominal recorded frame duration     */
1714    usNomIFrameInterval:word;    // I-frame every this many frames      */
1715    usNumCompressionTypes:Word;  // number of different CODECS used in file */
1716    aulCompressionTypes:Array [0..20] of LongInt;// List of CODECs found in this file */
1717    Reserved:Array [0..16] of LongInt;           // Reserved space */
1718    end;
1719    PUMVIDEOHEADER=^UMVIDEOHEADER;  // pumvh */
1720 
1721 
1722 //***************************************************************************/
1723 // EXTERNAL AUDIO FILE NAME CHUNK                                           */
1724 //***************************************************************************/
1725    EXTAUDIONAME = record    // umea */
1726      usTrackNumber:Word;          // Audio track number for this format  */
1727      szFileName:Array [0..UMAUDIOFILENAMELENGTH] of Char;
1728    end;
1729   PEXTAUDIONAME=^EXTAUDIONAME;  // pumea */
1730 
1731 
1732 //***************************************************************************/
1733 // INTERLEAVED AUDIO TRACK HEADER CHUNK                                     */
1734 //***************************************************************************/
1735    AUDIOHEADER = record   // umah */
1736            usTrackNumber:Word;          // Audio track number for this format  */
1737            usFormatTag:Word;            // Type of wave format                 */
1738            usChannels:Word;             // Number of channels (1=mono 2=stereo)*/
1739            ulSamplesPerSec:LongInt;        // Sampling rate                       */
1740            ulAvgBytesPerSec:LongInt;       // Avg bytes per sec                   */
1741            usBlockAlign:Word;           // Block alignment in bytes            */
1742            usBitsPerSample:Word;        // Bits per sample                     */
1743            usCountryCode:Word;          // Country code for this title         */
1744    end;
1745    PAUDIOHEADER=^AUDIOHEADER; // pumah */
1746 
1747 
1748 //***************************************************************************/
1749 // INTERLEAVED TEXT TRACK HEADER CHUNK                                      */
1750 //***************************************************************************/
1751    TEXTHEADER = record   // umth */
1752            usTrackNumber:Word;          // Audio track number for this format  */
1753            usCountryCode:Word;          // Country code for this title         */
1754    end;
1755    PTEXTHEADER=^TEXTHEADER; // pumth */
1756 
1757 
1758 //***************************************************************************/
1759 // TITLE CHUNK                                                              */
1760 //***************************************************************************/
1761    TITLE =record  // ttl */
1762            usCountryCode:Word;         // Country code for this title         */
1763            szTitle:Array [0..1] of Char;            // Video title null-terminated         */
1764    end;
1765    PTITLE=^TITLE; // pttl */
1766 
1767 
1768 //***************************************************************************/
1769 // AUDIO FRAME CHUNK                                                        */
1770 //***************************************************************************/
1771    AUDIOFRAME =record // umaf */
1772           usTrackNumber:Word;         // audio track number                  */
1773           bData:Array [0..1] of Byte;
1774    end;
1775    PAUDIOFRAME=^AUDIOFRAME; // pumaf */
1776 
1777 
1778 //***************************************************************************/
1779 // TEXT FRAME CHUNK                                                         */
1780 //***************************************************************************/
1781    TEXTFRAME =record  // umtf */
1782            usTrackNumber:Word;         // Text track number                   */
1783            szText:Array [0..1] of Char;             // Text null-terminated                */
1784    end;
1785 
1786 
1787 //***************************************************************************/
1788 // VIDEO FRAME CHUNK                                                        */
1789 //***************************************************************************/
1790    VIDEOFRAME = record // umvf */
1791           usTrackNumber:Word;         // Video track number  (0L only for now) */
1792           ulDuration:LongInt;            // Frame duration in MMTIME            */
1793           ulFrameFlags:LongInt;          // Frame flags                         */
1794           ulCompressionType:LongInt;     // Compression type                    */
1795           bData:Array [0..1] of Byte;
1796    end;
1797   PVIDEOFRAME =^VIDEOFRAME; // pumvf */
1798 
1799 // ulCompressionType defines: */
1800 CONST
1801 
1802 UM_VIDEO_COMPRESSION_TYPE_RAWRGB565        =1;
1803 UM_VIDEO_COMPRESSION_TYPE_RAWUVY556        =2;
1804 UM_VIDEO_COMPRESSION_TYPE_RAWYUV411        =3;
1805 UM_VIDEO_COMPRESSION_TYPE_BH146           =10;   // BETA-RGB16 */
1806 UM_VIDEO_COMPRESSION_TYPE_BH211SCS4       =11;   // 1.1 YUV16 subsampled chroma sub4 */
1807 UM_VIDEO_COMPRESSION_TYPE_BH211UCS4       =12;   // unique chroma sub4 */
1808 
1809 // ulVideoFrameFlags defines: */
1810   UM_VIDEO_FRAME_FLAG_DELTAFRAME   =$1;   // 1: delta frame, 0: I frame */
1811   UM_VIDEO_FRAME_FLAG_SCENECHANGE  =$2;
1812 
1813 
1814 //***************************************************************************/
1815 // CHAPTER INDEX HEADER (header for each entry in chapter index LIST        */
1816 //***************************************************************************/
1817  TYPE UMCHAPTERINDEX = record  // umch */
1818        ulChapterOffset:LongInt;            // Offset from beginning of file       */
1819        ulChapterDuration:LongInt;          // Duration of chapter in MMTIME       */
1820        ulPosterFrameOffset:LongInt;        // Poster for chapter (offset from chapter)*/
1821   end;
1822   PUMCHAPTERINDEX =^UMCHAPTERINDEX;  // pumch */
1823 
1824 
1825 //***************************************************************************/
1826 // FRAME INDEX ENTRY                                                        */
1827 //***************************************************************************/
1828    UMFRAMEINDEX = record  // umfi */
1829            ulFrameOffsets:LongInt;         // Offset from beginning of chapter    */
1830            ulFrameFlags:LongInt;           // Frame flags (Refer to frame header) */
1831    end;
1832     PUMFRAMEINDEX =^UMFRAMEINDEX;  // pumfi */
1833 
1834 
1835 //***************************************************************************/
1836 //                                                                          */
1837 // Module Name: SPCB.H                                                      */
1838 //                                                                          */
1839 // OS/2 2.0 Multimedia Extensions Sync/Stream Manager Stream Protocol       */
1840 // Control Block Definitions.                                               */
1841 //                                                                          */
1842 // Copyright (c) International Business Machines Corporation 1991, 1992     */
1843 //                        All Rights Reserved                               */
1844 //--------------------------------------------------------------------------*/
1845 // Converted by Andry Svirgunov. Email: cool2@ngs.ru                        */
1846 // 14.11.2002                                                               */
1847 //                                                                          */
1848 //***************************************************************************/
1849 
1850 //*********************************************
1851 // *
1852 // * SPCBKEY - Stream Protocol Key
1853 // *
1854 // **********************************************/
1855 //TYPE
1856 //        MMTIME = Cardinal;
1857 
1858   spcbKey = record
1859     ulDataType    : LongInt;
1860     ulDataSubType : LongInt;
1861     ulIntKey      : LongInt;              // Generated internal key
1862   end;
1863 //  pspcbKey = ^spcbKey;
1864 
1865 //*********************************************
1866 // *
1867 // * SPCB - Stream Protocol Control Block
1868 // *
1869 // **********************************************/
1870   _spcb = record
1871    ulSPCBLen       : LongInt;       // SPCB struture length
1872    spcbkey         : SPCBKEY;
1873    ulDataFlags     : LongInt;       // Data type flags
1874    ulNumRec        : LongInt;       // Max # records/buffer (Only used for Split streams)
1875    ulBlockSize     : LongInt;       // Block alignment in bytes.
1876    ulBufSize       : LongInt;       // Buffer size (SSM allocated buffers) must be
1877                                   //  a multiple of Block size
1878    ulMinBuf        : LongInt;       // Minimum number of buffers needed to stream
1879    ulMaxBuf        : LongInt;       // Maximum number of buffers needed to stream
1880    ulSrcStart      : LongInt;       // # of EMPTY buffers required to start Source
1881    ulTgtStart      : LongInt;       // # of FULL buffers required to start Target
1882    ulBufFlags      : LongInt;       // Handler Protocol negotiation flags
1883    ulHandFlags     : LongInt;       // Handler Protocol flags
1884    mmtimeTolerance : mmTime;      // Sync tolerance value...Used as check by SSM
1885                                   //  to determine whether to send a sync pulse
1886                                   //  to this specific slave Stream Handler.
1887                                   //  Algorithm:
1888                                   //   diff = abs(master time - slave time)
1889                                   //   if  diff >= tolerance
1890                                   //     then send sync pulse
1891                                   // (Valid only for Slave stream handlers)
1892    mmtimeSync      : mmTime;      // Used to save sync pulse generation granularity
1893                                   //  if the master uses the Stream Manager Timer.
1894                                   //  if SpiSetSync passed NULL value for sync gran
1895                                   //   then use this default value. (since hardware
1896                                   //   must have it's own interrupt time interval.
1897                                   // (Valid only for Master stream handlers)
1898    ulBytesPerUnit  : LongInt;       // Bytes/unit of time. This is used to do seeks
1899                                   // on linear data that is not compressed or
1900                                   // of variable length.
1901    mmtimePerUnit   : mmTime;      // The amount of mmtime each unit represents.
1902                                   // A unit can be a second, minute or whatever.
1903   end;
1904   pspcb = ^_spcb;
1905 
1906 const
1907   spcb_max_buf_Size        = 1024*1024;  // Largest buffer size in bytes
1908 
1909 
1910 //******************
1911 // * SPCB_ulDataFlags:
1912 // *******************/
1913 
1914   // SPCB_ulDataFlags:
1915   spcbData_CueTime         = $0002; // This data type can support time cue points
1916   spcbData_CueData         = $0004; // This data type can support data cue points
1917 
1918   spcbData_Seek            = $0000; // Seeks can be performed on this data type.
1919   spcbData_NoSeek          = $0008; // NO seeks can be performed on this data type.
1920   spcbData_YieldTime       = $0010; // The ulBytes per unit field is used for a millisecond value
1921                                     // It represents the amount of yield time between reads of
1922                                     // each buffer. If this bit is set, the value of ulBytesPerUnit
1923                                     // is used as input to DosSleep to yield for that period of time
1924   ValidDataFlags           = spcbData_CueTime OR spcbData_CueData OR
1925                              spcbData_YieldTime OR spcbData_NoSeek;
1926 
1927 
1928 //*******************
1929 //* SPCB_ulBufFlags:
1930 //********************/
1931 
1932   // SPCB_ulBufFlags:
1933   spcbBuf_USERPROVIDED     = $0001; // User provides buffers for stream
1934                                     // SSMgr will not allocate buffers,
1935                                     // but must lock down provided buffers,
1936                                     // so this will affect performance!!
1937                                     // (Source Handler only)
1938   spcbBuf_FIXEDBUF         = $0002; // Buffer size is fixed for this data type
1939                                     //  in this handler. Can not be used
1940                                     //  with the spcbBuf_USERPROVIDED flags.
1941   spcbBuf_NONCONTIGUOUS    = $0004; // Buffer do not need to be contiguous
1942                                     //  in physical memory.
1943   spcbBuf_INTERLEAVED      = $0008; // Stream buffers can be interleaved.
1944                                     //  Can not be use with the
1945                                     //  spcbBuf_USERPROVIDED flag.
1946                                     //  (Source Handler only)
1947   spcbBuf_MAXSIZE          = $0010; // ulBufSize is the maximum size that
1948                                     //  can be used by this stream handler
1949   spcbBuf_16MEG            = $0020; // The Stream buffers may be allocated
1950                                     //  above the 16 Meg line. This is used
1951                                     //  by stream handlers that can support
1952                                     //  greater than 16 Megabyte addresses.
1953   spcbBuf_FIXEDBLOCK       = $0040; // Use the ulBlockSize field to represent
1954                                     // the size of the IO reads that should
1955                                     // be performed (Interleaved streams)
1956   ValidBufFlags            = spcbBuf_UserProvided OR spcbBuf_FixedBuf OR
1957                              spcbBuf_NonContiguous OR spcbBuf_Interleaved OR
1958                              spcbBuf_16Meg OR spcbBuf_FixedBlock OR
1959                              spcbBuf_MaxSize;
1960 
1961 //******************
1962 // * SPCB_ulHandFlags:
1963 // *******************/
1964   // SPCB_ulHandFlags:
1965   spcbHand_genSync         = $0001; // (INPUT FROM HANDLER ONLY)
1966                                     // This handler can generate sync pulses
1967                                     // if it is the master.
1968   spcbHand_RcvSync         = $0002; // (INPUT FROM HANDLER ONLY)
1969                                     // This handler can receive sync pulses
1970                                     // if it is a slave
1971   spcbHand_Timer           = $0004; // Use Stream Manager Timer for Sync
1972   spcbHand_NonStream       = $0008; // Stream Handler is non-streaming
1973   spcbHand_GenTime         = $0010; // This handler contains real
1974                                     // stream time. The handler that
1975                                     // supports the SpiGetTime, data/time
1976                                     // cue point calls for this stream.
1977   spcbHand_NoPreRoll       = $0020; // This stream can not be prerolled.
1978                                     // (i.e. recording streams)
1979   spcbHand_NoSync          = $0040; // This stream can be group into a
1980                                     // sync group, but does not send or
1981                                     // receive sync pulses.
1982   spcbHand_Phys_Seek       = $0080; // This handler does a seek to a physical
1983                                     // device or memory not just a time adjustment.
1984                                     // (ssm will always call this handler first on
1985                                     //  an SpiSeekStream call).
1986 
1987   ValidHandFlags           = spcbHand_GenSync OR spcbHand_RcvSync OR
1988                              spcbHand_Timer OR spcbHand_NonStream OR
1989                              spcbHand_GenTime OR spcbHand_NoPreRoll OR
1990                              spcbHand_NoSync OR spcbHand_Phys_Seek;
1991 
1992 //**************************************************************************\
1993 //
1994 // Module Name: SHDD.H
1995 //
1996 // OS/2 2.0 Multimedia Extensions Stream Handler Device Driver Interfaces
1997 // Block defintions.
1998 //
1999 // Copyright (c) International Business Machines Corporation 1990,1991
2000 //                         All Rights Reserved
2001 // -------------------------
2002 // Ported by Andry Svirgunov
2003 //
2004 //**************************************************************************/
2005 
2006 //***************************************************************************/
2007 //                         D E F I N E S                                    */
2008 //***************************************************************************/
2009 
2010 // Multimedia Extensions Stream Handler Device Driver Interfaces
2011 // Block defintions.
2012 
2013 type
2014   shdfn   = pointer;
2015   ddcmdfn = pointer;
2016   hstream = Longint;
2017   hevent  = LongInt;
2018   hID     = LongInt;
2019 //  MMTIME  = Cardinal;
2020 type
2021   time_evcb = record
2022     ulType         : LongInt;            // Event_CUE_TIME
2023     ulSubType      : LongInt;            // Not used
2024     ulFlags        : LongInt;            // Single/Recurring(input/output)
2025     hstream        : HSTREAM;          // handle to stream for this event (input/output)
2026     hid            : hID;              // handler Id (input/output)
2027     ulStatus       : LongInt;            // Event status/error return code (output)
2028     mmtimeStream   : MMTIME;           // Stream time (input/output)
2029     unused1        : LongInt;            // 0 (input)
2030     unused2        : LongInt;            // 0 (input)
2031   end;
2032   ptime_evcb = ^time_evcb;
2033 (*type
2034   spcbKey = record
2035     ulDataType    : LongInt;
2036     ulDataSubType : LongInt;
2037     ulIntKey      : LongInt;              // Generated internal key
2038   end;*)
2039 //  pspcbKey = ^spcbKey;
2040 
2041 //***************************************************************************/
2042 //                       S T R U C T U R E S                                */
2043 //***************************************************************************/
2044 
2045 
2046 //***************************************************************************/
2047 //***   DDCMD Interface                                                    **/
2048 //***************************************************************************/
2049 
2050 const
2051   // DDCMD Defines
2052   DDCMD_SETUP                   = 0;
2053   DDCMD_READ                    = 1;
2054   DDCMD_WRITE                   = 2;
2055   DDCMD_STATUS                  = 3;
2056   DDCMD_CONTROL                 = 4;
2057   DDCMD_REG_STREAM              = 5;
2058   DDCMD_DEREG_STREAM            = 6;
2059 
2060 type
2061   ddCmdCommon = record
requestednull2062     ulFunction        : LongInt;                 // Function requested by SH
2063     Stream            : hStream;               // data stream instance
2064   end;
2065   pddCmdCommon = ^ddCmdCommon;
2066 
2067   ddCmd_Setup_parm = record
requestednull2068     ulFunction        : LongInt;                 // Function requested by SH
2069     hStream           : HSTREAM;
2070     pSetupParm        : Pointer;               // see SETUP_PARM struct
2071     ulSetupParmSize   : LongInt;                 // see SETUP_PARM struct
2072   end;
2073   pddCmdSetup = ^ddCmd_Setup_parm;
2074 
2075 
2076                 //*********************************************/
2077                 // SETUP_PARM structure                       */
2078                 //*********************************************/
2079   // SETUP_PARM structure
2080   Setup_Parm = record                          //  DDCMDSETUP parameter block
2081     ulStreamTime      : LongInt;                 // stream time in milliseconds
2082     ulFlags           : LongInt;                 // various flags (input/output)
2083     // NOTE: new fields will be added here
2084   end;
2085   pSetup_Parm = ^Setup_Parm;
2086 
2087                 //*********************************************/
2088                 // ulFlag defines                             */
2089                 //*********************************************/
2090 const
2091   // ulFlag defines
2092   SETUP_RECURRING_EVENTS        = $00000001;
2093                 // the device driver sets this flag on return from the
2094                 // DDCMD_SETUP command if the device driver assumes events
2095                 // are recurring events---in this case, the stream handler
2096                 // will not have to re-enable a recurring event each time
2097                 // the event occurs by sending a DDCMD_CONTROL command to
2098                 // the device driver.  this is useful when CUE_TIME or
2099                 // DATA_CUE events are expected to be used as RECURRING
2100 
2101 type
2102   ccCmdReadWrite = record
requestednull2103     ulFunction        : LongInt;                 // Function requested by SH
2104     hStream           : HSTREAM;
2105     pBuffer           : Pointer;
2106     ulBufferSize      : LongInt;
2107     pProcessLin       : Pointer;
2108     fEOS              : Boolean;
2109     ulParm1           : LongInt;
2110     ulParm2           : LongInt;
2111     ulLength          : LongInt;
2112   end;
2113   pccCmdReadWrite = ^ccCmdReadWrite;
2114   ppccCmdReadWrite = ^pccCmdReadWrite;
2115 
2116   ccCmdStatus = record
requestednull2117     ulFunction        : LongInt;                 // Function requested by SH
2118     hStream           : HSTREAM;
2119     pStatus           : Pointer;               // (output)ptr to current position time
2120     ulStatusSize      : LongInt;                 // (output)size of position time
2121   end;
2122   pccCmdStatus = ^ccCmdStatus;
2123 
2124                 //*********************************************/
2125                 // STATUS_PARM structure                      */
2126                 //*********************************************/
2127   // STATUS_PARM structure
2128   Status_Parm = record                         // DDCMDSTATUS parameter block
2129     ulTime            : LongInt;                 // current position time in milliseconds
2130     // NOTE: new fields will be added here
2131   end;
2132   pStatus_Parm = ^Status_Parm;
2133 
2134   ddCmdControl = record
requestednull2135     ulFunction        : LongInt;                 // Function requested by SH
2136     hStream           : HSTREAM;
2137     hEvent            : hEvent;                // used for EVENTS only
2138     ulCmd             : LongInt;
2139     pParm             : Pointer;               // see CONTROL_PARM structure
2140     ulParmSize        : LongInt;                 // see CONTROL_PARM structure
2141   end;
2142   pddCmdControl = ^ddCmdControl;
2143                 //*********************************************/
2144                 // ulCmd defines                              */
2145                 //*********************************************/
2146 const
2147   // ulCmd defines
2148   DDCMD_START                   = 1;           // start device
2149   DDCMD_STOP                    = 2;           // stop device and return current position in pParm
2150   DDCMD_PAUSE                   = 3;           // pause device and return current position in pParm
2151   DDCMD_RESUME                  = 4;           // resume device
2152   DDCMD_ENABLE_EVENT            = 5;           // ask PDD to create this event
2153   DDCMD_DISABLE_EVENT           = 6;           // ask PDD to purge this event
2154   DDCMD_PAUSE_TIME              = 7;           // pause time keeping, but not the stream
2155   DDCMD_RESUME_TIME             = 8;           // resume time keeping.
2156 
2157                 //*********************************************/
2158                 // CONTROL_PARM structure                     */
2159                 //*********************************************/
2160 type
2161   // CONTROL_PARM structure
2162   Control_Parm = record                        // DDCMDCONTROL parameter block
2163     ulTime            : LongInt;                 // time in milliseconds
2164                                                // SH sets cuetime when ulCmd is ENABLE_EVENT
2165                                                // PDD returns current time for STOP, PAUSE
2166     evcb              : TIME_EVCB;
2167   end;
2168   pControl_Parm = ^Control_Parm;
2169 
2170                 //******************************************************************************/
2171                 // This structure is filled in by the amp mixer based on the instance          */
2172                 // data.                                                                       */
2173                 //******************************************************************************/
2174 TYPE AUDIOMODE = record    // audio mode fields for DDCMDRegister */
2175         lSRate:LongInt;            // sample rate              */
2176         lBitsPerSRate:LongInt;     // bits per sample          */
2177         sChannels:Integer;        // Channels                 */
2178         end;
2179 TYPE PAUDIOMODE=^AUDIOMODE;
2180 
2181 
2182 TYPE  ddCmdRegister = record
requestednull2183     ulFunction        : LongInt;                 // Function requested by SH
2184     hStream           : HSTREAM;               // Stream handle needed @ interrupt time
2185     ulSysFileNum      : LongInt;                 // Device Handle so pdd can map device instance to hstream
2186     pSHDEntryPoint    : SHDFN;                 // Stream handler entry point
2187     ulStreamOperation : LongInt;                 // SH input Record or play
2188     spcbkey           : SPCBKEY;
2189     ulBufSize         : LongInt;                 // PDD output (optional) buffer size in bytes for SPCB
2190     ulNumBufs         : LongInt;                 // PDD output (optional) # of buffers for SPCB
2191     ulAddressType     : LongInt;                 // PDD output (required) addr ptr type to data buffer
2192     ulBytesPerUnit    : LongInt;                 // PDD output (required)
2193     mmtimePerUnit     : MMTIME;                // PDD output (required)
2194     AudioMode         : AUDIOMODE;                 // SH input Device Control Block
2195     hid               : HID;                   // SH input stream handler id
2196   end;
2197   pddCmdRegister = ^ddCmdRegister;
2198 
2199                 //****************************/
2200                 // ulStreamOperation  defines*/
2201                 //****************************/
2202 const
2203   // ulStreamOperation  defines
2204   STREAM_OPERATION_MASK         = $C000;
2205   STREAM_OPERATION_CONSUME      = $8000;
2206   STREAM_OPERATION_PRODUCE      = $C000;
2207 
2208                 //******************************************************************************/
2209                 // ulAddressType  defines                                                      */
2210                 // The PDD will tell the SH what type of address ptr it expects the data buffer*/
2211                 // to be.  The SH will then request this address type to the SSM, so that the  */
2212                 // SSM will send the correct type of each buffer request.                      */
2213                 //******************************************************************************/
2214   ADDRESS_TYPE_VIRTUAL          = 0;
2215   ADDRESS_TYPE_PHYSICAL         = 1;              //default
2216   ADDRESS_TYPE_LINEAR           = 2;
2217 
2218 type
2219   ddCmdDeregister = record
requestednull2220     ulFunction        : LongInt;                 // Function requested by SH
2221     Stream            : hStream;               // Stream handle needed @ interrupt time
2222   end;
2223   pddCmdDeregister = ^ddCmdDeregister;
2224 
2225 
2226 //***************************************************************************/
2227 //*** RING 0 Stream Handler SHD Interfaces                                ***/
2228 //***************************************************************************/
2229 
2230 const
2231   // RING 0 Stream Handler  SHD's:
2232   SHD_REPORT_INT                = 0;           // PDD reports interrupt has arrived
2233   SHD_REPORT_EVENT              = 1;           // PDD reports cuetime has arrived
2234 
2235 type
2236   shd_Common = record
2237     ulFunction        : LongInt;                 // Function requested by PDD
2238     Stream            : hStream;               // Stream handle needed @ interrupt time
2239   end;
2240   pshd_Common = ^shd_Common;
2241 
2242 type shd_ReportInt = record
2243     ulFunction        : LongInt;                 // Function requested by PDD
2244     hStream           : HSTREAM;               // so SH knows which stream to process
2245     pBuffer           : Pointer;               // return ptr to last used buffer
2246     ulFlag            : LongInt;                 // reason for interrupt
2247     ulStatus          : LongInt;                 // rc or bytes read/written
2248     ulStreamTime      : LongInt;                 // time in milliseconds of stream position
2249   end;
2250   pshd_ReportInt = ^shd_ReportInt;
2251 
2252                 //******************/
2253                 // ulFlag settings */
2254                 //******************/
2255 const
2256   // ulFlag settings
2257   ERROR                         = $80;
2258   STREAM_STOP_NOW               = $40;
2259   SHD_READ_COMPLETE             = 1;
2260   SHD_WRITE_COMPLETE            = 2;
2261 
2262 type
2263   shd_ReportEvent = record
2264     ulFunction        : LongInt;                 // Function requested by PDD
2265     hStream           : HSTREAM;               // so SH knows which stream to process
2266     hEvent            : hEvent;                // event handle pass back to stream handler
2267     ulStreamTime      : LongInt;                 // time in milliseconds of stream position
2268   end;
2269   pshd_ReportEvent = ^shd_ReportEvent;
2270 
2271 
2272 
2273 //***************************************************************************/
2274 //*** RING 3 Stream Handler SHD Interfaces                                ***/
2275 //***************************************************************************/
2276 
2277 //*** RING 3 Stream Handler SHD Interfaces                                **
2278 
2279 const
2280   // RING 3 Stream Handler  SHD's: (Uses SpiSendMsg as interface)
2281   SHC_REPORT_INT                = $80000000;   // ulMsgType for SHD_REPORT_INT
2282   SHC_REPORT_EVENT              = $80000001;   // ulMsgType for SHD_REPORT_EVENT
2283 
2284 
2285 //*********************************************
2286 // *
2287 // * MSG_REPORTINT Control Block.
2288 // *  pMsg field of SpiSendMsg api
2289 // *
2290 // **********************************************/
2291 type
2292   // MSG_REPORTINT Control Block.
2293   // pMsg field of SpiSendMsg api
2294   msg_ReportInt = record
2295     ulMsgLen          : LongInt;                 // Length of structure
2296     pBuffer           : Pointer;               // return ptr to last used buffer
2297     ulFlag            : LongInt;                 // reason for interrupt
2298     ulStatus          : LongInt;                 // rc or bytes read/written
2299     ulStreamTime      : LongInt;                 // time in milliseconds of stream position
2300   end;
2301   pmsg_ReportInt = ^msg_ReportInt;
2302 
2303    // For ulFlag defines, refer to the _shd_reportint_parm structure */
2304 
2305 
2306 
2307 //*********************************************
2308 // *
2309 // * MSG_REPORTEVENT Control Block.
2310 // *  pMsg field of SpiSendMsg api
2311 // *
2312 // **********************************************/
2313 type
2314   // MSG_REPORTEVENT Control Block.
2315   //  pMsg field of SpiSendMsg api
2316   msg_ReportEvent = record
2317     ulMsgLen          : LongInt;                 // Length of structure
2318     hevent            : hEvent;                // event handle pass back to stream handler
2319     ulStreamTime      : LongInt;                 // time in milliseconds of stream position
2320   end;
2321 type   pmsg_ReportEvent = ^msg_ReportEvent;
2322 
2323 //***************************************************************************/
2324 //              F U N C T I O N   P R O T O T Y P E S                       */
2325 //***************************************************************************/
2326 
2327 //RC  FAR         SHDEntryPoint(PSHD_COMMON pCommon);
2328 //RC  FAR         DDCMDEntryPoint(PDDCMDCOMMON pCommon);
2329 
2330 //***************************************************************************\
2331 //*                                                                           *
2332 //*    Multimedia Mixer Software Development Kit Include File                 *
2333 //*                                                                           *
2334 //*                                                                           *
2335 //***************************************************************************/
2336 // Converted by Andry Svirgunov. Email: cool2@ngs.ru                        */
2337 // 14.11.2002                                                               */
2338 //                                                                          */
2339 //***************************************************************************/
2340 
2341         TYPE HMIXER = longint;
2342         TYPE PHMIXER = ^HMIXER;
2343 
2344 
2345 TYPE _MIXERLINEINFO = RECORD
2346         ulLength : LongInt;             //length of the struct */
2347         ulNumChannels : LongInt;        // number of channels on input */
2348         ulSupport : LongInt;            // supported functionality (MIXLINEINFO) */
2349         ulConnectionsPossible : LongInt;// lines connectable to */
2350         ulLine : LongInt;               // which line to operate on */
2351         end;
2352 
2353 TYPE PMIXERLINEINFO = ^_MIXERLINEINFO;
2354 
2355 TYPE _LINECONNECTIONS = RECORD
2356         ulLength : Longint;             // length of the struct */
2357         ulConnection : LongInt;
2358         ulLine : Longint;
2359         ulFlags : LongInt;
2360         end;
2361 
2362 TYPE PLINECONNECTIONS = ^_LINECONNECTIONS;
2363 
2364 // flags for MIXERCONTROL ulFlags field */
2365 CONST
2366         MIX_MASTER = $000000001;        // indicates that this is master effect for the control */
2367 
2368 TYPE _MIXERCONTROL = RECORD
2369         ulLength : LongInt;             // length of the struct */
2370         ulLine : LongInt;
2371         ulControl : LongInt;
2372         ulSettings : LongInt;
2373         ulFlags : LongInt;
2374         end;
2375 
2376 TYPE PMIXERCONTROL = ^_MIXERCONTROL;
2377 // -- need masteraudio command for the following. */
2378 
2379 
2380 // flags for MIXERLINEINFO ulSupport field */
2381 CONST
2382         MIX_BALANCE       = $00100000;  // separate balance volume control */
2383         MIX_ALC           = $00000004;  // supports Auto Level Control */
2384         MIX_MONITOR       = $00000002;  // supports Monitor Control */
2385         MIX_CROSSOVER     = $00000010;  // supports crossover change */
2386         MIX_LOUDNESS      = $00000020;  // supports loudness equalization */
2387         MIX_MUTE          = $00000040;  // supports channel mute */
2388         MIX_REVERB        = $00000080;  // supports reverb */
2389         MIX_STEREOENHANCE = $00000100;  // supports stereo enhance */
2390         MIX_CUSTOM1       = $00000200;  // supports custom effect #1 */
2391         MIX_CUSTOM2       = $00000400;  // supports custom effect #2 */
2392         MIX_CUSTOM3       = $00000800;  // supports custom effect #3 */
2393         MIX_LRVOLUME      = $00001000;  // separate left-right volume control */
2394         MIX_BASS          = $00800000;  // supports Bass */
2395         MIX_MID           = $00020000;  // supports Mid */
2396         MIX_TREBLE        = $00400000;  // supports Treble */
2397         MIX_PITCH         = $00200000;  // supports pitch modifications */
2398         MIX_GAIN          = $01000000;  // supports gain modifications */
2399         MIX_CHORUS        = $00004000;  // supports Bass */
2400         MIX_VOLUME        = 000800000;  // supports volume controls */
2401 
2402 
2403         MIX_STEREO_OFF    = $00000000;
2404         MIX_STEREO_STUDIO = $40004000;
2405         MIX_STEREO_HALL   = $80008000;
2406         MIX_STEREO_STADIUM= $C000C000;
2407 
2408         MCI_STEREO_OFF    = $00000000;
2409         MCI_STEREO_STUDIO = $00000001;
2410         MCI_STEREO_HALL   = $00000002;
2411         MCI_STEREO_STADIUM= $00000004;
2412 
2413         MIX_LOUDNESS_OFF  = $00000000;
2414         MIX_LOUDNESS_ON   = $FFFFFFFF;
2415 
2416         MCI_LOUDNESS_OFF  = $00000000;
2417         MCI_LOUDNESS_ON   = $FFFFFFFF;
2418 
2419 
2420 // ERROR MESSAGES */
2421 CONST
2422         MIXERR_BASE = 512;
2423         MIXERR_NOERR = 0;
2424         MIXERR_INVALIDHANDLE = MIXERR_BASE+0;
2425         MIXERR_INVALIDINPUT  = MIXERR_BASE+1;
2426         MIXERR_INVALIDOUTPUT = MIXERR_BASE+2;
2427         MIXERR_NOTSUPPORTED  = MIXERR_BASE+7;
2428 
2429 
2430 // INPUT LINES */
2431 // SOURCES */
2432         IN_SYNTHESIZER = 0;
2433         IN_MIXER = 1;
2434         IN_EXTERNAL = 2;
2435         IN_INTERNAL = 3;
2436         IN_MICROPHONE = 4;
2437         IN_PCM = 5;
2438         IN_PC_SPEAKER = 6;
2439 
2440 // SINKS */
2441         OUT_AMPLIFIER = 0;
2442         OUT_PCM = 1;
2443 
2444 
2445 // SOURCES */
2446         SOURCE_SYNTHESIZER    = $000000001;
2447         SOURCE_LINE           = $000000002;
2448         SOURCE_INTERNAL_AUDIO = $000000004;
2449         SOURCE_MICROPHONE     = $000000008;
2450         SOURCE_WAVE           = $000000010;
2451         SOURCE_PC_SPEAKER     = $000000020;
2452         SOURCE_NULL           = $000000040;
2453         SOURCE_MIDI           = $000000080;
2454 
2455 // SINKS */
2456 // lad--these defines are invalid. */
2457         SINK_LINE_OUT   = $000100000;
2458         SINK_SPEAKER    = $000200000;
2459         SINK_HEADPHONES = $000400000;
2460         SINK_NULL       = $000800000;
2461         SINK_ALL        = $001000000;
2462 
2463 // lad--wpos addition */
2464         SINK_WAVE       = $002000000;
2465         SINK_MIDI       = $004000000;
2466 
2467 //*************************START OF SPECIFICATIONS **************************/
2468 //                                                                          */
2469 // Module NAME:  MCD.H                                                      */
2470 //                                                                          */
2471 //                                                                          */
2472 // OS/2 2.0 Multimedia Extensions MCD structures and definitions            */
2473 //                                                                          */
2474 // Copyright (c) International Business Machines Corporation 1990,1991      */
2475 //                         All Rights Reserved                              */
2476 //*--------------------------------------------------------------------------*/
2477 //* Converted by Andry Svirgunov. Email: cool2@ngs.ru                        */
2478 //* 14.11.2002                                                               */
2479 //*                                                                          */
2480 //************************//END OF SPECIFICATIONS ***************************/
2481 
2482 CONST
2483 
2484         LIST_LEN=8;
2485 
2486         LINE_IN_ON  =$00000001;
2487         MIC_ON      =$00000002;
2488         LINE_OUT_ON =$00000004;
2489 
2490 TYPE
2491         PSZ = PChar;
2492         SHandle = Word;
2493         HFile = SHandle;
2494 //        HMTX = Longint;
2495 
2496 //-------------------------------------------------------------------------*
2497 //RIFF to ACPA Mode conversion Table
2498 //------------------------------------------------------------------------*/
2499 
2500 TYPE RIFFTABLE = Record
2501         ulDataType:LongInt;
2502         ulAUDIODDMode:LongInt;
2503         end;
2504 
2505 TYPE _MCI_PORT_LIST = Record   // devid */
2506       ulDevType:LongInt;
2507       ulDevNum:LongInt;
2508         end;
2509 //-------------------------------------------------------------------------*
2510 //Amp/Mixer instance structure declaration
2511 //------------------------------------------------------------------------*/
2512 
2513 TYPE _MCI_AMP_INSTANCE = Record
2514         szDeviceName:Array [0..128] of char;
2515         szDriverName:Array [0..15] of char;
2516         hFile:HFile;
2517         usDeviceID:Integer;
2518         ulGlobalFile:LongInt;
2519 
2520         usMasterVolume:Integer;
2521         lLeftVolume:LongInt;
2522         lRightVolume:LongInt;
2523         lVolumeDelay:LongInt;
2524         lBalance:LongInt;
2525 
2526         lBalanceDelay:LongInt;
2527         lBass:LongInt;
2528 
2529         lTreble:LongInt;
2530 
2531         lPitch:LongInt;
2532         lGain:LongInt;
2533 
2534         lSRate:LongInt;
2535         lBitsPerSRate:LongInt;
2536         lBsize:LongInt;
2537         sMode:Integer;
2538         sChannels:Integer;
2539         ulFlags:LongInt;
2540         lMonitor:LongInt;
2541         lInput:LongInt;
2542         lOutput:LongInt;
2543         ulOperation:LongInt;
2544         ulGainLevel:LongInt;
2545 
2546         ulStoreRVolume:LongInt;
2547         ulStoreLVolume:LongInt;
2548 
2549 
2550         ulDosOpened:LongInt;
2551         ulInitOpen:LongInt;
2552         ulMasterVolume:LongInt;
2553         ulActive:LongInt;
2554         lStoreSRate:LongInt;
2555         lStoreBitsPerSRate:LongInt;
2556         ulStoreOperation:LongInt;
2557         sStoreMode:Integer;
2558         sStoreChannels:Integer;
2559         ulSetAmpDefaults:LongInt;
2560         ulDefaultsSet:LongInt;
2561 
2562         ulOutputDev:LongInt;
2563         ulInputDev:LongInt;
2564         ulResourcesUsed:LongInt;
2565         ulRestoreNotify:LongInt;
2566         ulCallback:LongInt;
2567         sUserParm:Integer;
2568         lNotifyFlag:LongInt;
2569 //        LONG  ( //APIENTRY pfnAUDIOIF) ( PVOID, LONG, LONG, LONG, LONG);
2570         hmtxInstanceSem:HMTX;
2571         ulClass:LongInt;
2572         ulBlockAlignment:LongInt;
2573         ulHardwareMode:LongInt;
2574         rInputList:Array [0.. LIST_LEN ] of _MCI_PORT_LIST;
2575         rOutputList:Array [0.. LIST_LEN ] of _MCI_PORT_LIST;
2576         ulNumInputs:LongInt;
2577         ulNumOutputs:LongInt;
2578 
2579         ulDataType:LongInt;
2580         ulSubType:LongInt;
2581         ulBytesPerBlock:LongInt;
2582         ulMMTimePerBlock:LongInt;
2583 
2584 //-------------------------------------------------------------------------*
2585 //New resource management stuff
2586 //------------------------------------------------------------------------*/
2587 
2588 
2589 
2590         pAudioModeData:Pointer;      // ptr to dev. specific resource data */
2591         pResourceDLL:Array [0.. 128 ] of Char;
2592 
2593         pProdInfo:PSZ;         // pointer to the product name        */
2594         ulDeviceID:LongInt;        // pointer to the device id.          */
2595         ulNumMappingRows:LongInt;  // num of RIFF->AUDIODD mapping modes */
2596         ulMatch:LongInt;
2597         pMapTable:^RIFFTABLE;        // additional RIFF->AUDIODD mappings  */
2598 
2599         ulNumDataTypes:LongInt;    // number of datatypes to check       */
2600         pDataTypeTable:Pointer;
2601         fMute:Boolean;
2602         ulResourceID:LongInt;      // offset in the resource dll to use  */
2603         ulConnDefaults:LongInt;    // Default values for connectors      */
2604 
2605         end;
2606 TYPE PMCI_AMP_INSTANCE = ^_MCI_AMP_INSTANCE;
2607 
2608 
2609 const
2610   MIDINAMESIZE                  = 40;
2611   MIDIPATCHNUM                  = 128;
2612   MIDITYPEAPPNAME               = 'MidiTypes';    // Appname in MIDITYPE.INI
2613 
2614 //*******************************************************************/
2615 // These structures describe the format of the MIDI maps that are   */
2616 // located in the MIDITYPE.INI file.                                */
2617 //*******************************************************************/
2618 
2619 type
2620   // These structures describe the format of the MIDI maps that are
2621   // located in the MIDITYPE.INI file.
2622   MidiTypeEntry = record
2623     uGenMidiPatchNumber  : Integer;             // Device To General Midi Conversion
2624     uDevMidiPatchNumber  : Integer;             // General Midi to Device Conversion
2625     uVolumePercent       : Integer;             // Channel Patch Volume Scaler
2626     uGenMidiKeyNumber    : Integer;             // Device To General Midi Perc. Key Conversion
2627     uDevMidiKeyNumber    : Integer;             // General Midi to Device Perc. Key Conversion
2628   end;
2629   pMidiTypeEntry = ^MidiTypeEntry;
2630 
2631   _MidiType = record
2632     uStyle            : Integer;                // Midi Style
2633     uDrums10          : Integer;                // Patch 10 Drums if Perckey not supported
2634     uDrums16          : Integer;                // Patch 16 Drums if Perckey not supported
2635     ulReserved        : LongInt;                 // Reserved
2636     MidiTypeEntry     : array[0..midiPatchNum-1] of MIDITYPEENTRY;
2637                                                // Array of MIDITYPEENTRYs
2638     szPatchAndPercKeyName: array[0..2*MIDIPATCHNUM*MIDINAMESIZE-1] of char;
2639                                                // List of 128 Patch Names
2640                                                // that are null terminated, then a
2641                                                // list of 128 Percussion key names that
2642                                                // are double null terminated
2643                                                // Each item is null terminated
2644   end;
2645   MidiTpye=_MidiType;
2646   pMidiType = ^_MidiType;
2647 
2648 const
2649   // Style Flags
2650   MT_PERCUSSIONKEYS             = $1;          // Percussion Keys are supported
2651   MT_MAPPERCKEYPATCHES          = $2;          // Map Percussion Key Patches
2652 
2653 
2654 CONST
2655         STATUS_BIT = $80;
2656 
2657         TRACK_OFF = 0;
2658         TRACK_ON = 1;
2659 
2660         NORMAL_SYSEX = $F0;
2661         ESCAPE_SYSEX = $F7;
2662 
2663         // User defined messages for IO PROC
2664         MMIOM_START = $0E00;
2665         MMIOM_USER = $0F00;
2666         MMIOM_GETHEADER = MMIOM_START + 9;
2667         META = $FF;
2668 // Meta stuff */
2669 // user defined messages for IO PROC */
2670         MMIO_SEQ = MMIOM_USER + 1;
2671         MMIO_MERGE = MMIOM_USER + 2;
2672         MMIO_FROM_SEQ = MMIOM_USER + 3;
2673         MMIO_TIMED_READ = MMIOM_USER + 4;
2674         MMIO_SET_TRACKS = MMIOM_USER + 5;
2675         MMIO_FORMAT_O = MMIOM_USER + 6;
2676         MMIO_GETHEADER = MMIOM_GETHEADER;
2677         MMIO_GETFILELENTH = MMIOM_USER +10;
2678         MMIO_GETTRACKLENGTH = MMIOM_USER + 11;
2679 
2680 
2681 type
2682   MidiHeader = record // midi header //
2683     chHeaderChunk               : array[0..3] of Char;
2684     case Boolean of
2685     true: (
2686         dwHeaderLength : Dword;
2687         wFormat : Word;
2688         wNumTracks : Word;
2689         wDivision : Word;
2690         vpAdditionalInformation_ : ^LongInt;
2691         );
2692         false: (
2693     ulHeaderLength              : LongInt;
2694     usFormat                    : Integer;
2695     usNumTracks                 : Integer;
2696     usDivision                  : Integer;
2697     vpAdditionalInformation     : Pointer;
2698     )
2699   end;
2700   pMidiHeader = ^MidiHeader;
2701 
2702   mmMidiHeader = record
2703     case boolean of
2704     true: (
2705     ulHeaderLength    : LongInt;                 // Length in Bytes
2706     ulContentType     : LongInt;                 // Image content
2707     ulMediaType       : LongInt;                 // type of media
2708     midiheader        : MidiHeader;            // header
2709     );
2710     false: (
2711         dwHeaderLength : DWORD;         // Length in Bytes */
2712         dwContentType : DWORD;          // Image content */
2713         dwMediaType : DWORD;            // type of media */
2714         midiheader_ : MIDIHEADER;       // header */
2715         )
2716   end;
2717   pmmMidiHeader = ^mmMidiHeader;
2718 
2719 //***************************************************************************/
2720 //                                                                          */
2721 // Module Name: EVCB.H                                                      */
2722 //                                                                          */
2723 // OS/2 2.0 Multimedia Extensions Sync/Stream Manager Event Control         */
2724 // Block defintitions.                                                      */
2725 //                                                                          */
2726 // Copyright (c) International Business Machines Corporation 1991, 1992     */
2727 //                        All Rights Reserved                               */
2728 //***************************************************************************/
2729 // Converted by Andry Svirgunov. Email: cool2@ngs.ru                        */
2730 // 14.11.2002                                                               */
2731 //                                                                          */
2732 //***************************************************************************/
2733 
2734 //*********************************************
2735 // * List of Implicit events:
2736 // *    EVENT_EOS                 - Use IMPL_EVCB
2737 // *    EVENT_ERROR               - Use IMPL_EVCB
2738 // *    EVENT_STREAM_STOPPED      - Use IMPL_EVCB
2739 // *    EVENT_SYNC_PREROLLED      - Use IMPL_EVCB
2740 // *    EVENT_PLAYLISTMESSAGE     - Use PLAYL_EVCB
2741 // *    EVENT_PLAYLISTCUEPOINT    - Use PLAYL_EVCB
2742 // *    EVENT_QUEUE_OVERFLOW      - Use IMPL_EVCB
2743 // **********************************************/
2744 
2745 //*********************************************
2746 // * List of Explicit events:
2747 // *    EVENT_SYNCOVERRUN         - Use OVRU_EVCB
2748 // *    EVENT_CUE_TIME            - Use TIME_EVCB
2749 // *    EVENT_CUE_DATA            - Use DATA_EVCB
2750 // *    EVENT_DATAUNDERRUN        - Use EVCB
2751 // *    EVENT_DATAOVERRUN         - Use EVCB
2752 // *    EVENT_CUE_TIME_PAUSE      - Use TIME_EVCB
2753 // **********************************************/
2754 CONST
2755 
2756         EVENT_SYNCOVERRUN       =$4;
2757         EVENT_CUE_TIME          =$5;       // Cue point in terms of stream time*/
2758         EVENT_CUE_DATA          =$6;       // Cue point in terms of data items */
2759         EVENT_DATAUNDERRUN      =$7;       // data underrun event from SH    */
2760         EVENT_DATAOVERRUN       =$8;       // data underrun event from SH    */
2761         EVENT_CUE_TIME_PAUSE    =$9;       // Pause when cue-point reached.  */
2762         EVENT_STATUS_LEVEL      =$10;      // Report status level            */
2763 
2764 
2765 
2766 //*********************************************
2767 // * SYNC_EVCB - Sync Pulse Event Control Block
2768 // *             (This event is only seen by
2769 // *              stream handlers)
2770 // **********************************************/
2771         EVENT_SYNC              =$1;     // Synchronization point in stream  */
2772 
2773 TYPE _SYNC_EVCB = RECORD         // syevcb                                     */
2774    ulType:LongInt;                     // EVENT_SYNC                       */
2775    ulSubType:LongInt;                  // Not used                         */
2776    ulSyncFlags:LongInt;                // 0 (input),status (output)        */
2777    hstream:LongInt;                    // handle to stream for this event  */
2778    hid:LongInt;                        // Handler id                       */
2779    ulStatus:LongInt;                   // Event status (output)            */
2780    mmtimeStart:MMTIME;                 // Filled in by Sync/Stream manager */
2781                                        //  at SpiEnableSync time. (input)  */
2782    mmtimeMaster:MMTIME;                // Filled in by Master SH (input)   */
2783    mmtimeSlave:MMTIME;                 // Filled in by slave SH. (output)  */
2784    end;
2785 
2786 TYPE PSYNC_EVCB = ^_SYNC_EVCB;         // Ptr to a  EVCB       */
2787 
2788 // ulSyncFlags:
2789 CONST
2790 
2791         SYNCOVERRUN        =$0001;    // Set by SSM if sync pulse comes in before    */
2792                                       //  a has processed the current sync pulse.    */
2793         SYNCPOLLING        =$0002;    // SSM set this after filling the handler EVCB.*/
2794                                       //  Handler resets it after it processes the   */
2795                                       //  contents of EVCB. The SSM must check this  */
2796                                       //  bit before modifying EVCB. If bit already  */
2797                                       //  set, set the SYNC overrun bit.             */
2798 
2799 
2800         EVENT_RESERVED     =$2;       // RESERVED                         */
2801 
2802 
2803 //*********************************************
2804 // * IMPL_EVCB - Implicit Event Control Block
2805 // *             (This is a parameter on the
2806 // *              SpiCreatStrem API)
2807 // **********************************************/
2808         EVENT_IMPLICIT_TYPE=$3;     // These events are always supported*/
2809 
2810 
2811 TYPE _IMPL_EVCB = RECORD         // imevcb                                     */
2812    ulType:LongInt;                     // EVENT_IMPLICIT_TYPE              */
2813    ulSubType:LongInt;                  // One of the implicit events (input) */
2814    ulFlags:LongInt;                    // 0 (Input), status (Output)         */
2815    hstream:LongInt;                    // handle to stream for this event (input/output) */
2816    hid:LongInt;                        // 0 (input), handler Id (output)     */
2817    ulStatus:LongInt;                   // Event status/error return code (output) */
2818    unused1:LongInt;                    // 0 (input)                        */
2819    unused2:LongInt;                    // 0 (input)                        */
2820    unused3:LongInt;                    // 0 (input)                        */
2821    end;
2822 TYPE PIMPL_EVCB = ^_IMPL_EVCB;
2823 
2824 // ulSubtype:                                                              */
2825 
2826 CONST
2827 
2828         EVENT_EOS               =$1;     // End of Stream                    */
2829         EVENT_ERROR             =$2;     // Error in Stream handler or device driver        */
2830         EVENT_STREAM_STOPPED    =$3;     // Stream is in a stopped state (Discard or Flush) */
2831         EVENT_SYNC_PREROLLED    =$4;     // All streams are prerolled (buffers   */
2832                                          //  have been filled by the Source SH's.*/
2833         EVENT_PLAYLISTMESSAGE   =$5;     // Memory SH playlist message event     */
2834         EVENT_PLAYLISTCUEPOINT  =$6;     // Memory SH playlist cue point         */
2835         EVENT_QUEUE_OVERFLOW    =$7;     // Event Queue overflow. Indicates lost */
2836                                          //  events. Application must use this   */
2837                                          //  to clear any waiting conditions.    */
2838         EVENT_START             =$8;     // Start stream                         */
2839 
2840 
2841 //*********************************************
2842 // * PLAYL_EVCB - Playlist Message Event Control Block
2843 // **********************************************/
2844 // (IMPLICIT EVENT)                                                        */
2845 TYPE _PLAYL_EVCB=RECORD       // plevcb                                    */
2846    ulType:LongInt;                     // EVENT_IMPLICIT_TYPE              */
2847    ulSubType:LongInt;                  // EVENT_PLAYLISTMESSAGE or EVENT_PLAYLISTCUEPOINT */
2848    ulFlags:LongInt;                    // 0 (input), status (output)                      */
2849    hstream:LongInt;                    // handle to stream for this event (input/output)  */
2850    hid:LongInt;                        // 0 (input), handler Id (output)                  */
2851    ulStatus:LongInt;                   // Playlist Instruction number (output)            */
2852    ulMessageParm:LongInt;              // 0 (input), Message from playlist (output)       */
2853    unused1:LongInt;                    // 0 (input)                        */
2854    unused2:LongInt;                    // 0 (input)                        */
2855    end;
2856 TYPE PPLAYL_EVCB = ^_PLAYL_EVCB;             // Ptr to a  EVCB       */
2857 
2858 
2859 //*********************************************
2860 // * OVRU_EVCB - Sync Overrun Event Control Block
2861 // *             (Applications can request to be
2862 // *              notified whenever a Sync overrun
2863 // *              occurs.
2864 // **********************************************/
2865 TYPE _OVRU_EVCB = RECORD     // ovevcb */
2866    ulType:LongInt;                     // EVENT_SYNCOVERRUN                */
2867    ulSubType:LongInt;                  // Not used                         */
2868    ulFlags:LongInt;                    // 0 (input), status (output)       */
2869    hstream:LongInt;                    // handle to stream for this event (input/output) */
2870    hid:LongInt;                        // handler Id (input/output)        */
2871    ulStatus:LongInt;                   // Event status/error return code (output) */
2872    mmtimeSlave:MMTIME;                // 0 (input), Slave stream time (output)   */
2873    mmtimeStart:MMTIME;                // 0 (input), Slave start offset (offset)  */
2874    mmtimeMaster:MMTIME;               // 0 (input), Master stream time (output)  */
2875    end;
2876 
2877 TYPE POVRU_EVCB = ^_OVRU_EVCB;             // Ptr to a  EVCB       */
2878 
2879 
2880 //*********************************************
2881 // * TIME_EVCB - Cue Time Event Control Block
2882 // *             (Applications can request to be
2883 // *              notified for a time cue point)
2884 // **********************************************/
2885 
2886 TYPE _TIME_EVCB = RECORD     // tievcb                                     */
2887    ulType:LongInt;                     // EVENT_CUE_TIME                   */
2888    ulSubType:LongInt;                  // Not used                         */
2889    ulFlags:LongInt;                    // Single/Recurring(input/output)   */
2890    hstream:LongInt;                    // handle to stream for this event (input/output)*/
2891    hid:LongInt;                        // handler Id (input/output)                     */
2892    ulStatus:LongInt;                   // Event status/error return code (output)       */
2893    mmtimeStream:MMTIME;               // Stream time (input/output)       */
2894    unused1:LongInt;                    // 0 (input)                        */
2895    unused2:LongInt;                    // 0 (input)                        */
2896    end;
2897 
2898 //TYPE PTIME_EVCB = ^_TIME_EVCB;             // Ptr to a  EVCB       */
2899 
2900 //                                                                         */
2901 // ulFlags:                                                                */
2902 CONST
2903 
2904         EVENT_SINGLE            =$0;     // This is single one time event    */
2905         EVENT_RECURRING         =$1;     // This is recurring event          */
2906 
2907 
2908 //*********************************************
2909 // * DATA_EVCB - Cue Data Event Control Block
2910 // *             (Applications can request to be
2911 // *              notified for a data cue point)
2912 // **********************************************/
2913 
2914 TYPE _DATA_EVCB = RECORD     // daevcb                                     */
2915    ulType:LongInt;                     // EVENT_CUE_DATA                   */
2916    ulSubType:LongInt;                  // Event SubType                    */
2917    ulFlags:LongInt;                    // Single/Recurring(input/output)   */
2918    hstream:LongInt;                    // handle to stream for this event (input/output) */
2919    hid:LongInt;                        // handler Id (input/output)                      */
2920    ulStatus:LongInt;                   // Event status/error return code (output)        */
2921    mmtimeStream:MMTIME;                // Stream time (input/output)                     */
2922    ulEventParm1:LongInt;               // Data to Cue on (input/output)                  */
2923                                        //  This is interpreted by the stream handler     */
2924    ulEventParm2:LongInt;               // Length of data cue buffer (input/output)       */
2925    end;
2926 TYPE PDATA_EVCB = ^_DATA_EVCB;         // Ptr to a  EVCB       */
2927 
2928 // ulFlags:                                                                */
2929 //#define EVENT_SINGLE          0L        This is single one time event    */
2930 //#define EVENT_RECURRING       1L        This is recurring event          */
2931 
2932 CONST
2933 
2934         EVENT_DATAPTR           =$2;   // ulEventParm1 if ptr to buffer and*/
2935                                        //  ulEventParm2 is a length of buffer, */
2936                                        //  else ulEventParm1 is data.          */
2937 
2938 
2939 //*****************
2940 // * EVCB_ulType:  (Stream Handler defined types)
2941 // ******************/
2942         SH_TYPE           =$80000000;  // Stream Handler defined types must */
2943                                        // have the high order bit set in the*/
2944                                        // ulType field.                     */
2945                                        // events: 0H - 7FFFFFFFH are reserved!*/
2946 
2947 //*********************************************
2948 // * EVCB - Generic Event Control Block (Use the
2949 // *        specific one in the SSM.H if possible)
2950 // **********************************************/
2951 TYPE _EVCB = RECORD     // evcb */
2952    ulType:LongInt;                     // Event type (input)               */
2953    ulSubType:LongInt;                  // Event SubType (input)            */
2954    ulFlags:LongInt;                    // 0 (Input), status (Output)       */
2955    hstream:LongInt;                    // handle to stream for this event  */
2956    hid:LongInt;                        // handler Id (input/output)        */
2957    ulStatus:LongInt;                   // Event status (output)            */
2958    ulEventParm1:LongInt;               // Event parameters (input), HID if implicit event */
2959    ulEventParm2:LongInt;               // Event parameters (input)         */
2960    ulEventParm3:LongInt;               // Event parameters (input)         */
2961    end;
2962 TYPE PEVCB = ^_EVCB;             // Ptr to a  EVCB       */
2963 
2964 //*********************************************
2965 // * STATUS_LEVEL_EVCB - Status Level Event Control Block
2966 // **********************************************/
2967 TYPE _STATUS_LEVEL_EVCB = RECORD   // stevcb */
2968    // standard part */
2969    ulType:LongInt;                     // Event type (input)               */
2970    ulSubType:LongInt;                  // Event SubType (input)            */
2971    pMCDInstance:LongInt;               // for MCD use */
2972    hstream:LongInt;                    // handle to stream for this event  */
2973    hid:LongInt;                        // handler Id (input/output)        */
2974    // custom part */
2975    ulSample:ARRAY [0..4] OF LongInt;                // Samples */
2976    end;
2977 TYPE PSTATUS_EVCB = ^_STATUS_LEVEL_EVCB;     // Ptr to a  EVCB       */
2978 
2979 //***************************************************************************/
2980 //                                                                          */
2981 // Module Name: DCB.H                                                       */
2982 //                                                                          */
2983 // OS/2 2.0 Multimedia Extensions Sync/Stream Manager Device Control        */
2984 // Block defintitions.                                                      */
2985 //                                                                          */
2986 // Copyright (c) International Business Machines Corporation 1991, 1992     */
2987 //                        All Rights Reserved                               */
2988 //***************************************************************************/
2989 // Converted by Andry Svirgunov. Email: cool2@ngs.ru                        */
2990 // 14.11.2002                                                               */
2991 //                                                                          */
2992 //***************************************************************************/
2993 
2994 CONST MAX_SPI_NAME = 9;
2995 
2996 //**************************************************************************
2997 // *
2998 // * DCB - Common Device Control Block
2999 // *               (*** PACKED STRUCTURE ***)
3000 // ***************************************************************************/
3001 TYPE _DCB = RECORD              // dcb  -  Device Control Block                      */
3002         ulDCBLen : LongInt;     // length of structure                 */
3003         szDevName: Array [0..MAX_SPI_NAME] of char;// device driver name                  */
3004         end;
3005 TYPE PDCB = ^_DCB;
3006 
3007 
3008 //**************************************************************************
3009 // *
3010 // * E_DCB - Extended Device Control Block
3011 // *
3012 // *         This structure will grow over time as new fields are added
3013 // *         to the end of the structure.  If you manipulate the structure,
3014 // *         be sure to check the length field.
3015 // *
3016 // *               (*** PACKED STRUCTURE ***)
3017 // ***************************************************************************/
3018 
3019 TYPE E_DCB = RECORD             // e_dcb  -  Extended Device Control Block          */
3020         ulDCBLen : LongInt;     // length of structure                 */
3021         szDevName: Array [0..MAX_SPI_NAME] of char;// device driver name                  */
3022         ulSysFileNum: LongInt;  // file handle number                  */
3023         end;
3024 TYPE PE_DCB = ^E_DCB;
3025 TYPE PDCB_AUDIOSH = ^E_DCB;
3026 
3027 
3028 //**************************************************************************
3029 // *
3030 // * VSD_DCB - VSD Device Control Block
3031 // *
3032 // *         This structure will allow stream handlers to use the VSD DLL
3033 // *         by using by the additional fields in the structure.
3034 // *
3035 // *               (*** PACKED STRUCTURE ***)
3036 // ***************************************************************************/
3037 TYPE _VSD_DCB = RECORD          // vsd_dcb - VSD Device Control Block            */
3038         ulDCBLen : Longint;     // length of structure                 */
3039         szDevName: Array [0..MAX_SPI_NAME] of char;// device driver name                  */
3040         ulSysFileNum: LongInt;  // file handle number                  */
3041         hvsd : LongInt;         // Handle to VSD instance              */
3042         pfnEntryPoint : ^PFN;   // Address of VSD entry point          */
3043         ulReserved1 : LongInt;  // Reserved for system                 */
3044         ulReserved2 : LongInt;  // Reserved for system                 */
3045         end;
3046 TYPE PVSD_DCB = ^_VSD_DCB;
3047 
3048 //****************************************************************************/
3049 //*                                                                          */
3050 //* Module Name: ACB.H                                                       */
3051 //*                                                                          */
3052 //* OS/2 2.0 Multimedia Extensions Sync/Stream Manager Associate             */
3053 //* Control Block Definitions.                                               */
3054 //*                                                                          */
3055 //* Copyright (c) International Business Machines Corporation 1991, 1992     */
3056 //*                        All Rights Reserved                               */
3057 //*--------------------------------------------------------------------------*/
3058 //* Converted by Andry Svirgunov. Email: cool2@ngs.ru                        */
3059 //* 14.11.2002                                                               */
3060 //*                                                                          */
3061 //****************************************************************************/
3062 CONST
3063 
3064         MAX_PORT_NAME=40;           // Max port name length         */
3065         MAX_PORTS    =16;           // Max number ports             */
3066 
3067 
3068 //**********************************************
3069 // *
3070 // * ACB - Associate Control Block
3071 // *
3072 // *       Each stream handler must define the
3073 // *       ACB for each data object type that
3074 // *       expect ACB's from the application.
3075 // *
3076 // **********************************************/
3077 TYPE _ACB = RECORD              //* acb  -  Assoc. Control Block  */
3078         ulACBLen : LongInt;     //* length of structure */
3079         ulObjType : LongInt;
3080         ulParm1 : LongInt;
3081         ulParm2 : LongInt;
3082         end;
3083 TYPE PACB = ^_ACB;              //* Ptr to an ACB        */
3084 
3085 
3086 //******************************************************
3087 // * FSSH - File system stream handler MMIO Object ACB
3088 // ******************************************************/
3089 CONST
3090 
3091         ACBTYPE_MMIO=$0001;  //* MMIO object                      */
3092 
3093 TYPE _ACB_MMIO = RECORD         //* acbmmio  - MMIO Assoc. Control Block       */
3094         ulACBLen : LongInt;     //* length of structure                   */
3095         ulObjType : LongInt;    //* ACBTYPE_MMIO                          */
3096         hmmio : HMMIO ;         //* Handle of media element mgr obj       */
3097         end;
3098 TYPE PACB_MMIO = ^_ACB_MMIO;    //* Ptr to an ACB  */
3099 
3100 
3101 //******************************************************
3102 // * MSH - Memory stream handler Playlist Object ACB
3103 // ******************************************************/
3104 CONST
3105         ACBTYPE_MEM_PLAYL=$0003;  //* Memory playlist object           */
3106 
3107 TYPE _ACB_MEM_PLAYL = RECORD    //* acbplyl - File system Assoc. Control Block */
3108         ulACBLen : LongInt;     //* length of structure                   */
3109         ulObjType : LongInt;    //* ACBTYPE_MEM_PLAYL                     */
3110         pMemoryAddr : Pointer;  //* Starting address of memory obj        */
3111         end;
3112 TYPE PACB_MEM_PLAYL = ^_ACB_MEM_PLAYL;  //* Ptr to an ACB  */
3113 
3114 
3115 //******************************************************
3116 // * CDDASH - CD DA stream handler Object ACB
3117 // ******************************************************/
3118 CONST
3119         ACBTYPE_CDDA=$0004;  //*  Compact disk - digital audio obj*/
3120 
3121 
3122 TYPE _ACB_CDDA = RECORD         //* acbcdda - CD Assoc. Control Block          */
3123         ulACBLen : LongInt;     //* length of structure                   */
3124         ulObjType : LongInt;    //* ACBTYPE_CDDA                          */
3125         bCDDrive : Char;        //* CD drive letter                       */
3126         end;
3127 TYPE PACB_CDDA = ^_ACB_CDDA;    //* Ptr to an ACB  */
3128 
3129 //******************************************************
3130 // * MISH - MIDI stream handler port-stream table ACB
3131 // ******************************************************/
3132 CONST
3133         ACBTYPE_MISH=$0005;      //* MIDI port-stream table       */
3134 
3135 TYPE _ACB_MISH = RECORD         //* acbmish - MIDI Assoc. Control Block          */
3136         ulACBLen : LongInt;     //* length of structure          */
3137         ulObjType: LongInt;     //* ACBTYPE_MISH                 */
3138         hStreamDefault : Longint;//* Default hstream to use when mapper */
3139                                  //* is turned off.               */
3140         ulDeviceTypeID : LongInt;//* device type id               */
3141         ulpMapperPorts : LongInt;//* pointer to mapper port table */
3142         ulNumInStreams : LongInt;
3143         hStreamIn : Array [0..MAX_PORTS] of Longint;//* Array of Input streams       */
3144         ulNumOutStreams : LongInt;
3145         hStreamsOut : Array [0..MAX_PORTS] of Longint;//* Array of Output streams      */
3146                                                       //* The index into the array is  */
3147                                                       //* the source channel for that  */
3148                                                       //* stream.                      */
3149 
3150         end;
3151 TYPE PACB_MISH = ^_ACB_MISH;    //* Ptr to MIDI associate control block */
3152 
3153 //******************************************************
3154 // * MISH - MIDI stream handler SET ACB
3155 // ******************************************************/
3156 CONST
3157         ACBTYPE_SET=$0006;      //* MIDI set function            */
3158 
3159 TYPE _ACB_SET = RECORD          //* acbset - Set Assoc. Control Block             */
3160         ulACBLen :LongInt;      //* length of structure          */
3161         ulObjType : LongInt;    //* ACBTYPE_SET                  */
3162         ulFlags : LongInt;      //* Set flags                    */
3163         ulReserved : Longint;   //* Reserved                     */
3164         end;
3165 TYPE PACB_SET = ^_ACB_SET;      //* Ptr to set associate control block */
3166 
3167 //* ulFlags defines:                                                        */
3168 CONST
3169 
onnull3170         MIDI_MAP_ON =$0000;      //* turn mapping function on in MISH   */
offnull3171         MIDI_MAP_OFF=$0001;      //* turn mapping function off in MISH  */
3172 
3173 
3174 //******************************************************
3175 // * NULLSH - Null stream handler user ACB
3176 // ******************************************************/
3177         ACBTYPE_NULLSH=$0007;  //* User od Null stream handler      */
3178 
3179 TYPE _ACB_NULISH = RECORD       //* acbnullsh - NULLSH Assoc. Control Block    */
3180         ulACBLen : LongInt;     //* length of structure                   */
3181         ulObjType : LongInt;    //* ACBTYPE_NULLSH                        */
3182         pfnEntry : PFN ;        //* user callback entry point             */
3183         ulReserved : LongInt;   //* Reserved                              */
3184         end;
3185 TYPE PACB_NULISH = ^_ACB_NULISH;//* Ptr to an ACB  */
3186 
3187 //******************************************************
3188 // * MTSH - MultiTrack Stream Handler Object ACB
3189 // ******************************************************/
3190 CONST
3191 
3192         ACBTYPE_MTSH=$0008;  //* MTSH object                      */
3193 
3194 TYPE _ACB_MTSH = RECORD                 //* acbmtsh  - MTSH Assoc. Control Block       */
3195         ulACBLen : LongInt;             //* length of structure                   */
3196         ulObjType : Longint;            //* ACBTYPE_MTSH                          */
3197         hmmio : HMMIO;                  //* Handle of media element mgr obj       */
3198         mmtrackinfo : _MMTRACKINFO;     //* track for this stream                 */
3199         ulFlags : LongInt;              //* flags                                 */
3200         ulMaxBytesPerSec : LongInt;     //* Max bytes per second                  */
3201         ulAvgBytesPerSec : Longint;     //* Avg bytes per second                  */
3202         mmtimePerFrame : MMTIME;        //* frame display time or 0L              */
3203         ulTotalFrames : LongInt;        //* total number of video frames          */
3204         end;
3205 TYPE PACB_MTSH = ^_ACB_MTSH;            //* Ptr to an ACB  */
3206 
3207 //* ulFlags defines:                                                        */
3208 CONST
3209         TRACK_ACTIVATE   =$0000;    //* Activate track in stream handler  */
3210         TRACK_DEACTIVATE =$0001;    //* Deactivate track in stream handler  */
3211 
3212 
3213 //******************************************************
3214 // * CSH - CODEC stream handler Object ACB
3215 // ******************************************************/
3216         ACBTYPE_CODECSH=$0009;      //* CODEC object                 */
3217 TYPE _ACB_CODECSH = RECORD      //* acbcodecsh - CODEC SH acb                 */
3218         ulACBLen : Longint;     //* length of structure          */
3219         ulObjType : Longint;    //* ACBTYPE_CODECSH              */
3220         hstreamToPair : LongInt;//* 2nd stream of pair           */
3221         pMmioInfo : Longint;    //* info for IO Proc             */
3222         ulInfoLength : Longint; //* length of MmioInfo           */
3223         pCodecControl : Longint;//* CODEC control info           */
3224         ulControlLength : Longint;//* length of CodecControl       */
3225         end;
3226 TYPE PACB_CODECSH = ^_ACB_CODECSH;//* Ptr to associate control block */
3227 
3228 
3229 Implementation
3230 
mmioFOURCCnull3231 Function mmioFOURCC(ch0,ch1,ch2,ch3:Char): Cardinal;
3232 begin
3233   mmioFOURCC:=Cardinal(ord(ch0)) or (Cardinal(ord(ch1)) shl 8) or
3234               (Cardinal(ord(ch2)) shl 16) or (Cardinal(ord(ch3)) shl 24);
3235 end;
3236 
3237 Begin
3238   FOURCC_R565:=mmioFOURCC( 'R', '5', '6', '5' );
3239   FOURCC_R555:=mmioFOURCC( 'R', '5', '5', '5' );
3240   FOURCC_R664:=mmioFOURCC( 'R', '6', '6', '4' );
3241   FOURCC_RGB3:=mmioFOURCC( 'R', 'G', 'B', '3' );
3242   FOURCC_BGR3:=mmioFOURCC( 'B', 'G', 'R', '3' );
3243   FOURCC_RGB4:=mmioFOURCC( 'R', 'G', 'B', '4' );
3244   FOURCC_BGR4:=mmioFOURCC( 'B', 'G', 'R', '4' );
3245   FOURCC_LUT8:=mmioFOURCC( 'L', 'U', 'T', '8' );
3246   FOURCC_LT12:=mmioFOURCC( 'L', 'T', '1', '2' );
3247   FOURCC_GREY:=mmioFOURCC( 'G', 'R', 'E', 'Y' );
3248   FOURCC_GY16:=mmioFOURCC( 'G', 'Y', '1', '6' );
3249   FOURCC_Y888:=mmioFOURCC( 'Y', '8', '8', '8' );
3250   FOURCC_Y2X2:=mmioFOURCC( 'Y', '2', 'X', '2' );
3251   FOURCC_Y4X4:=mmioFOURCC( 'Y', '4', 'X', '4' );
3252   FOURCC_YUV9:=mmioFOURCC( 'Y', 'U', 'V', '9' );
3253   FOURCC_Y644:=mmioFOURCC( 'Y', '6', '4', '4' );
3254   FOURCC_MONO:=mmioFOURCC( 'M', 'O', 'N', 'O' );
3255   FOURCC_Y422:=mmioFOURCC( 'Y', '4', '2', '2' );
3256   FOURCC_Y42B:=mmioFOURCC( 'Y', '4', '2', 'B' );
3257   FOURCC_Y42D:=mmioFOURCC( 'Y', '4', '2', 'D' );
3258   FOURCC_Y411:=mmioFOURCC( 'Y', '4', '1', '1' );
3259   FOURCC_VGA :=mmioFOURCC( 'V', 'G', 'A', ' ' );
3260 
3261   FOURCC_ULTI:=mmioFOURCC('U', 'L', 'T', 'I');
3262   FOURCC_RT21:=mmioFOURCC('R', 'T', '2', '1');
3263   FOURCC_DIB :=mmioFOURCC('D', 'I', 'B', ' ');
3264 
3265   FOURCC_RIFF:=mmioFOURCC( 'R', 'I', 'F', 'F' );
3266   FOURCC_LIST:=mmioFOURCC( 'L', 'I', 'S', 'T' );
3267   FOURCC_MEM :=mmioFOURCC( 'M', 'E', 'M', ' ' );
3268   FOURCC_DOS :=mmioFOURCC( 'D', 'O', 'S', ' ' );
3269   FOURCC_BND :=mmioFOURCC( 'B', 'N', 'D', ' ' );
3270   FOURCC_FREE:=mmioFOURCC( 'F', 'R', 'E', 'E' );
3271   FOURCC_DEL :=mmioFOURCC( 'D', 'E', 'L', ' ' );
3272   FOURCC_CTOC:=mmioFOURCC( 'C', 'T', 'O', 'C' );
3273   FOURCC_CGRP:=mmioFOURCC( 'C', 'G', 'R', 'P' );
3274   FOURCC_CF  :=mmioFOURCC( 'C', 'F', ' ', ' ' );
3275 End.
3276