home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / ORTLSRC.RAR / OS2MM.PAS < prev    next >
Pascal/Delphi Source File  |  2000-08-15  |  328KB  |  7,206 lines

  1. //█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█
  2. //█                                                       █
  3. //█      Virtual Pascal Runtime Library.  Version 2.1.    █
  4. //█      OS/2 MultiMedia API interface                    █
  5. //█      ─────────────────────────────────────────────────█
  6. //█      Copyright (C) 1996-2000 vpascal.com              █
  7. //█                                                       █
  8. //▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  9.  
  10. Unit Os2MM;
  11.  
  12. {$Cdecl+,AlignRec+,OrgName+,T-,Delphi+,Use32+}
  13.  
  14. interface
  15.  
  16. uses Os2Def, Os2PmApi;
  17.  
  18. {----[ OS2MEDEF ]----}
  19.  
  20. type
  21.   pVoid = Pointer;
  22.   Short = SmallWord;
  23.  
  24.   Handle  = hwnd;
  25.  
  26.   mmTime  = Cardinal;
  27.   pmmTime = ^mmTime;
  28.  
  29.   hmmIO   = uLong;
  30.   phmmIO  = ^hmmIO;
  31.  
  32.   // spcbKey - Stream protocol Key
  33.   spcbKey = record
  34.     ulDataType    : uLong;
  35.     ulDataSubType : uLong;
  36.     ulIntKey      : uLong;              // Generated internal key
  37.   end;
  38.   pspcbKey = ^spcbKey;
  39.  
  40.   // MMTRACKINFO - This structure is used to represent a video, audio or
  41.   // some other type of track within a digital video movie file.
  42.   MMTrackInfo = record
  43.     ulTrackID     : uLong;              // track identifier
  44.     ulMediaType   : uLong;              // media type
  45.     ulCountry     : uLong;              // country code for the track
  46.     ulCodePage    : uLong;              // country code page for the track
  47.     ulReserved1   : uLong;              // reserved must be 0
  48.     ulReserved2   : uLong;              // reserved must be 0
  49.   end;
  50.   pMMTrackInfo = ^MMTrackInfo;
  51.  
  52. const
  53.   // Bits Per Sample
  54.   BPS_4     =  4;
  55.   BPS_8     =  8;
  56.   BPS_16    = 16;
  57.  
  58.   // Clipboard formats
  59.   CF_RMID   = 10;
  60.   CF_RIFF   = 11;
  61.   CF_WAVE   = 12;
  62.   CF_AVI    = 13;
  63.  
  64.   // Channels
  65.   CH_1      = 1;          // Mono
  66.   CH_2      = 2;          // Stereo
  67.   CH_4      = 4;          // Quad
  68.  
  69.   // Sampling Rates
  70.   HZ_8000   =  8000;
  71.   HZ_11025  = 11025;
  72.   HZ_14700  = 14700;      // SPV/2
  73.   HZ_18900  = 18900;      // CD/XA Lvl C
  74.   HZ_22050  = 22050;
  75.   HZ_37800  = 37800;      // CD/XA Lvl B
  76.   HZ_44100  = 44100;
  77.  
  78.   // Resource Formats
  79.   RT_RMID   = 100;
  80.   RT_RIFF   = 101;
  81.   RT_WAVE   = 102;
  82.   RT_AVI    = 103;
  83.   RT_AVS    = 104;
  84.  
  85. const
  86.   // Multimedia Datatypes (spcbKey values)
  87.   DATATYPE_NULL           = $0000;
  88.   SUBTYPE_NONE            = $0000;
  89.  
  90.   // WaveForm datatype
  91.   DATATYPE_WAVEFORM       = $0001;
  92.   // SubTypes for WaveForm
  93.   WAVE_FORMAT_1M08        = $0001;
  94.   WAVE_FORMAT_1S08        = $0002;
  95.   WAVE_FORMAT_1M16        = $0003;
  96.   WAVE_FORMAT_1S16        = $0004;
  97.   WAVE_FORMAT_2M08        = $0005;
  98.   WAVE_FORMAT_2S08        = $0006;
  99.   WAVE_FORMAT_2M16        = $0007;
  100.   WAVE_FORMAT_2S16        = $0008;
  101.   WAVE_FORMAT_4M08        = $0009;
  102.   WAVE_FORMAT_4S08        = $000a;
  103.   WAVE_FORMAT_4M16        = $000b;
  104.   WAVE_FORMAT_4S16        = $000c;
  105.   WAVE_FORMAT_8M08        = $000d;
  106.   WAVE_FORMAT_8S08        = $000e;
  107.   WAVE_FORMAT_8M16        = $000f;
  108.   WAVE_FORMAT_8S16        = $0010;
  109.  
  110.   // DigVideo datatypes
  111.   DATATYPE_DIGVIDEO       = $0002;
  112.   // Subtypes
  113.   DIGVIDEO_PHOTOM         = $544F4850;  // Photmotion video, FOURCC value for phio
  114.   DIGVIDEO_ULTIM          = $49544c55;  // Ultimotion video, FOURCC value for ulio
  115.   DIGVIDEO_AVI            = $20495641;  // AVI video, FOURCC value for avio
  116.   DIGVIDEO_MONITOR        = $206E6F6D;  // MONITOR video, FOURCC value for monitoring
  117.   DIGVIDEO_FLC            = $63696C66;  // FLIC video, FOURCC value for flic
  118.   DIGVIDEO_MPEG           = $4745504D;  // MPEG video, FOURCC value for MPEG
  119.  
  120.   // MuLaw datatypes
  121.   DATATYPE_MULAW          = $0101;
  122.   DATATYPE_RIFF_MULAW     = $0007;
  123.   // SubTypes
  124.   MULAW_8B8KS             = $0001;      // 8bit 8kHz stereo
  125.   MULAW_8B11KS            = $0002;      // 8bit 11kHz stereo
  126.   MULAW_8B22KS            = $0003;      // 8bit 22kHz stereo
  127.   MULAW_8B44KS            = $0004;      // 8bit 44kHz stereo
  128.   MULAW_8B8KM             = $0005;      // 8bit 8kHz mono
  129.   MULAW_8B11KM            = $0006;      // 8bit 11kHz mono
  130.   MULAW_8B22KM            = $0007;      // 8bit 22kHz mono
  131.   MULAW_8B44KM            = $0008;      // 8bit 44kHz mono
  132.  
  133.   // ALaw datatypes
  134.   DATATYPE_ALAW           = $0102;
  135.   DATATYPE_RIFF_ALAW      = $0006;
  136.   // Subtypes
  137.   ALAW_8B8KS              = $0001;      // 8bit 8kHz stereo
  138.   ALAW_8B11KS             = $0002;      // 8bit 11kHz stereo
  139.   ALAW_8B22KS             = $0003;      // 8bit 22kHz stereo
  140.   ALAW_8B44KS             = $0004;      // 8bit 44kHz stereo
  141.   ALAW_8B8KM              = $0005;      // 8bit 8kHz mono
  142.   ALAW_8B11KM             = $0006;      // 8bit 11kHz mono
  143.   ALAW_8B22KM             = $0007;      // 8bit 22kHz mono
  144.   ALAW_8B44KM             = $0008;      // 8bit 44kHz mono
  145.  
  146.   // ADPCM datatypes
  147.   DATATYPE_ADPCM_AVC      = $0103;
  148.   // Subtypes
  149.   ADPCM_AVC_VOICE         = $0001;
  150.   ADPCM_AVC_MUSIC         = $0002;
  151.   ADPCM_AVC_STEREO        = $0003;
  152.   ADPCM_AVC_HQ            = $0004;
  153.  
  154.  
  155.   // CT_ADPCM datatypes
  156.   DATATYPE_CT_ADPCM       = $0200;      // Creative Technologies
  157.   // Subtypes
  158.   CT_ADPCM_16B8KS         = $0001;      // 16bit 8kHz stereo
  159.   CT_ADPCM_16B11KS        = $0002;      // 16bit 11kHz stereo
  160.   CT_ADPCM_16B22KS        = $0003;      // 16bit 22kHz stereo
  161.   CT_ADPCM_16B44KS        = $0004;      // 16bit 44kHz stereo
  162.   CT_ADPCM_16B8KM         = $0005;      // 16bit 8kHz mono
  163.   CT_ADPCM_16B11KM        = $0006;      // 16bit 11kHz mono
  164.   CT_ADPCM_16B22KM        = $0007;      // 16bit 22kHz mono
  165.   CT_ADPCM_16B44KM        = $0008;      // 16bit 44kHz mono
  166.  
  167.   // MIDI datatype
  168.   DATATYPE_MIDI           = $0201;
  169.  
  170.   // Generic datatype
  171.   DATATYPE_GENERIC        = $0202;
  172.  
  173.   // Speech Viewer Datatypes
  174.   DATATYPE_SPV2           = $0203;
  175.   // SubTypes
  176.   SPV2_BPCM               = $0001;
  177.   SPV2_PCM                = $0002;
  178.   SPV2_NONE               = $0003;
  179.  
  180.  
  181.   // CD-XA datatypes
  182.   DATATYPE_CDXA_VIDEO     = $0204;      // CD-XA Video datatype
  183.   DATATYPE_CDXA_DATA      = $0205;      // CD-XA sub-band data datatype
  184.   DATATYPE_CDXA_AUDIO     = $0206;      // CD-XA ADPCM Audio datatype
  185.   DATATYPE_CDXA_AUDIO_HD  = $0207;      // CD-XA ADPCM Audio with Headers
  186.   DATATYPE_CDXA_HEADERS   = $0208;      // CD-XA Headers and Subheaders
  187.   // Subtypes
  188.   CDXA_LEVELB             = $0000;      // LEVEL B Audio Stereo
  189.   CDXA_LEVELC             = $0001;      // LEVEL C Audio Stereo
  190.   CDXA_LEVELB_MONO        = $0002;      // LEVEL B Audio Mono
  191.   CDXA_LEVELC_MONO        = $0003;      // LEVEL C Audio Mono
  192.  
  193.   // Digispeech datatype
  194.   DATATYPE_DIGISPEECH     = $0208;
  195.   // Subtyoes
  196.   DIGISPEECH_NATIVE       = $0001;
  197.  
  198.   // MPE>G-1 Audio Datatypes
  199.   DATATYPE_MPEG1AUDIO     = $0050;
  200.   // Subtypes
  201.   MPEG1_FORMAT_3M16       = $0001;      // 32.000kHz,  Mono  , 16-bit
  202.   MPEG1_FORMAT_3S16       = $0002;      // 32.000kHz,  Stereo, 16-bit
  203.   MPEG1_FORMAT_4M16       = $0003;      // 44.1/48kHz, Mono  , 16-bit
  204.   MPEG1_FORMAT_4S16       = $0004;      // 44.1/48kHz, Stereo, 16-bit
  205.  
  206.   // Unknown datatype
  207.   DATATYPE_UNKNOWN        = $FFFFFFFF;
  208.  
  209. {----[ MEERROR ]----}
  210.  
  211. const
  212.   // MCI Device Manager Error Return Codes
  213.   MCIERR_BASE                       = 5000;
  214.   MCIERR_SUCCESS                    = 0;
  215.   MCIERR_INVALID_DEVICE_ID          = (MCIERR_BASE +   1);
  216.   MCIERR_NO_MASTER                  = (MCIERR_BASE +   2);
  217.   MCIERR_UNRECOGNIZED_KEYWORD       = (MCIERR_BASE +   3);
  218.   MCIERR_MASTER_CONFLICT            = (MCIERR_BASE +   4);
  219.   MCIERR_UNRECOGNIZED_COMMAND       = (MCIERR_BASE +   5);
  220.   MCIERR_HARDWARE                   = (MCIERR_BASE +   6);
  221.   MCIERR_INVALID_DEVICE_NAME        = (MCIERR_BASE +   7);
  222.   MCIERR_OUT_OF_MEMORY              = (MCIERR_BASE +   8);
  223.   MCIERR_DEVICE_OPEN                = (MCIERR_BASE +   9);
  224.   MCIERR_CANNOT_LOAD_DRIVER         = (MCIERR_BASE +  10);
  225.   MCIERR_MISSING_COMMAND_STRING     = (MCIERR_BASE +  11);
  226.   MCIERR_PARAM_OVERFLOW             = (MCIERR_BASE +  12);
  227.   MCIERR_MISSING_STRING_ARGUMENT    = (MCIERR_BASE +  13);
  228.   MCIERR_BAD_INTEGER                = (MCIERR_BASE +  14);
  229.   MCIERR_PARSER_INTERNAL            = (MCIERR_BASE +  15);
  230.   MCIERR_DRIVER_INTERNAL            = (MCIERR_BASE +  16);
  231.   MCIERR_MISSING_PARAMETER          = (MCIERR_BASE +  17);
  232.   MCIERR_UNSUPPORTED_FUNCTION       = (MCIERR_BASE +  18);
  233.   MCIERR_FILE_NOT_FOUND             = (MCIERR_BASE +  19);
  234.   MCIERR_DEVICE_NOT_READY           = (MCIERR_BASE +  20);
  235.   MCIERR_INTERNAL                   = (MCIERR_BASE +  21);
  236.   MCIERR_DRIVER                     = (MCIERR_BASE +  22);
  237.   MCIERR_CANNOT_USE_ALL             = (MCIERR_BASE +  23);
  238.   MCIERR_MULTIPLE                   = (MCIERR_BASE +  24);
  239.   MCIERR_EXTENSION_NOT_FOUND        = (MCIERR_BASE +  25);
  240.   MCIERR_OUTOFRANGE                 = (MCIERR_BASE +  26);
  241.   MCIERR_CANNOT_ADD_ALIAS           = (MCIERR_BASE +  27);
  242.   MCIERR_FLAGS_NOT_COMPATIBLE       = (MCIERR_BASE +  28);
  243.   MCIERR_CANNOT_USE_NOUNLOAD        = (MCIERR_BASE +  29);
  244.   MCIERR_FILE_NOT_SAVED             = (MCIERR_BASE +  30);
  245.   MCIERR_DEVICE_TYPE_REQUIRED       = (MCIERR_BASE +  31);
  246.   MCIERR_DEVICE_LOCKED              = (MCIERR_BASE +  32);
  247.   MCIERR_DUPLICATE_ALIAS            = (MCIERR_BASE +  33);
  248.   MCIERR_INSTANCE_INACTIVE          = (MCIERR_BASE +  34);
  249.   MCIERR_COMMAND_TABLE              = (MCIERR_BASE +  35);
  250.   MCIERR_INI_FILE_LOCKED            = (MCIERR_BASE +  37);
  251.   MCIERR_NO_AUDIO_SUPPORT           = (MCIERR_BASE +  40);
  252.   MCIERR_NOT_IN_PM_SESSION          = (MCIERR_BASE +  41);
  253.   MCIERR_DUPLICATE_KEYWORD          = (MCIERR_BASE +  42);
  254.   MCIERR_COMMAND_STRING_OVERFLOW    = (MCIERR_BASE +  43);
  255.   MCIERR_DRIVER_PROC_NOT_FOUND      = (MCIERR_BASE +  44);
  256.   MCIERR_INVALID_DEVICE_TYPE        = (MCIERR_BASE +  45);
  257.   MCIERR_INVALID_DEVICE_ORDINAL     = (MCIERR_BASE +  46);
  258.   MCIERR_HEADPHONES_NOT_SET         = (MCIERR_BASE +  47);
  259.   MCIERR_SPEAKERS_NOT_SET           = (MCIERR_BASE +  48);
  260.   MCIERR_SOUND_NOT_SET              = (MCIERR_BASE +  49);
  261.   MCIERR_INVALID_BUFFER             = (MCIERR_BASE +  50);
  262.   MCIERR_INVALID_MEDIA_TYPE         = (MCIERR_BASE +  51);
  263.   MCIERR_INVALID_CONNECTOR_INDEX    = (MCIERR_BASE +  52);
  264.   MCIERR_NO_CONNECTION              = (MCIERR_BASE +  53);
  265.   MCIERR_INVALID_FLAG               = (MCIERR_BASE +  54);
  266.   MCIERR_CANNOT_LOAD_DSP_MOD        = (MCIERR_BASE +  55);
  267.   MCIERR_ALREADY_CONNECTED          = (MCIERR_BASE +  56);
  268.   MCIERR_INVALID_CALLBACK_HANDLE    = (MCIERR_BASE +  57);
  269.   MCIERR_DRIVER_NOT_FOUND           = (MCIERR_BASE +  58);
  270.   MCIERR_DUPLICATE_DRIVER           = (MCIERR_BASE +  59);
  271.   MCIERR_INI_FILE                   = (MCIERR_BASE +  60);
  272.   MCIERR_INVALID_GROUP_ID           = (MCIERR_BASE +  61);
  273.   MCIERR_ID_ALREADY_IN_GROUP        = (MCIERR_BASE +  62);
  274.   MCIERR_MEDIA_CHANGED              = (MCIERR_BASE +  63);
  275.   MCIERR_MISSING_FLAG               = (MCIERR_BASE +  64);
  276.   MCIERR_UNSUPPORTED_FLAG           = (MCIERR_BASE +  65);
  277.   MCIERR_DRIVER_NOT_LOADED          = (MCIERR_BASE +  66);
  278.   MCIERR_INVALID_MODE               = (MCIERR_BASE +  67);
  279.   MCIERR_INVALID_ITEM_FLAG          = (MCIERR_BASE +  68);
  280.   MCIERR_INVALID_TIME_FORMAT_FLAG   = (MCIERR_BASE +  69);
  281.   MCIERR_SPEED_FORMAT_FLAG          = (MCIERR_BASE +  70);
  282.   MCIERR_INVALID_AUDIO_FLAG         = (MCIERR_BASE +  71);
  283.   MCIERR_NODEFAULT_DEVICE           = (MCIERR_BASE +  72);
  284.   MCIERR_DUPLICATE_EXTENSION        = (MCIERR_BASE +  73);
  285.   MCIERR_FILE_ATTRIBUTE             = (MCIERR_BASE +  74);
  286.   MCIERR_DUPLICATE_CUEPOINT         = (MCIERR_BASE +  75);
  287.   MCIERR_INVALID_CUEPOINT           = (MCIERR_BASE +  76);
  288.   MCIERR_CUEPOINT_LIMIT_REACHED     = (MCIERR_BASE +  77);
  289.   MCIERR_MISSING_ITEM               = (MCIERR_BASE +  78);
  290.   MCIERR_MISSING_TIME_FORMAT        = (MCIERR_BASE +  79);
  291.   MCIERR_MISSING_SPEED_FORMAT       = (MCIERR_BASE +  80);
  292.   MCIERR_INVALID_CONNECTOR_TYPE     = (MCIERR_BASE +  81);
  293.   MCIERR_TARGET_DEVICE_FULL         = (MCIERR_BASE +  82);
  294.   MCIERR_UNSUPPORTED_CONN_TYPE      = (MCIERR_BASE +  83);
  295.   MCIERR_CANNOT_MODIFY_CONNECTOR    = (MCIERR_BASE +  84);
  296.   MCIERR_RECORD_ABORTED             = (MCIERR_BASE +  85);
  297.   MCIERR_GROUP_COMMAND              = (MCIERR_BASE +  86);
  298.   MCIERR_DEVICE_NOT_FOUND           = (MCIERR_BASE +  87);
  299.   MCIERR_RESOURCE_NOT_AVAILABLE     = (MCIERR_BASE +  88);
  300.   MCIERR_INVALID_IO_PROC            = (MCIERR_BASE +  89);
  301.   MCIERR_WAVE_OUTPUTSINUSE          = (MCIERR_BASE +  90);
  302.   MCIERR_WAVE_SETOUTPUTINUSE        = (MCIERR_BASE +  91);
  303.   MCIERR_WAVE_INPUTSINUSE           = (MCIERR_BASE +  92);
  304.   MCIERR_WAVE_SETINPUTINUSE         = (MCIERR_BASE +  93);
  305.   MCIERR_WAVE_OUTPUTUNSPECIFIED     = (MCIERR_BASE +  94);
  306.   MCIERR_WAVE_INPUTUNSPECIFIED      = (MCIERR_BASE +  95);
  307.   MCIERR_WAVE_OUTPUTSUNSUITABLE     = (MCIERR_BASE +  96);
  308.   MCIERR_WAVE_SETOUTPUTUNSUITABLE   = (MCIERR_BASE +  97);
  309.   MCIERR_WAVE_INPUTSUNSUITABLE      = (MCIERR_BASE +  98);
  310.   MCIERR_WAVE_SETINPUTUNSUITABLE    = (MCIERR_BASE +  99);
  311.   MCIERR_SEQ_DIV_INCOMPATIBLE       = (MCIERR_BASE + 100);
  312.   MCIERR_SEQ_PORT_INUSE             = (MCIERR_BASE + 101);
  313.   MCIERR_SEQ_PORT_NONEXISTENT       = (MCIERR_BASE + 102);
  314.   MCIERR_SEQ_PORT_MAPNODEVICE       = (MCIERR_BASE + 103);
  315.   MCIERR_SEQ_PORT_MISCERROR         = (MCIERR_BASE + 104);
  316.   MCIERR_SEQ_TIMER                  = (MCIERR_BASE + 105);
  317.   MCIERR_VDP_COMMANDCANCELLED       = (MCIERR_BASE + 106);
  318.   MCIERR_VDP_COMMANDFAILURE         = (MCIERR_BASE + 107);
  319.   MCIERR_VDP_NOTSPUNUP              = (MCIERR_BASE + 108);
  320.   MCIERR_VDP_NOCHAPTER              = (MCIERR_BASE + 109);
  321.   MCIERR_VDP_NOSIDE                 = (MCIERR_BASE + 110);
  322.   MCIERR_VDP_NOSIZE                 = (MCIERR_BASE + 111);
  323.   MCIERR_VDP_INVALID_TIMEFORMAT     = (MCIERR_BASE + 112);
  324.   MCIERR_CLIPBOARD_ERROR            = (MCIERR_BASE + 114);
  325.   MCIERR_CANNOT_CONVERT             = (MCIERR_BASE + 115);
  326.   MCIERR_CANNOT_REDO                = (MCIERR_BASE + 116);
  327.   MCIERR_CANNOT_UNDO                = (MCIERR_BASE + 117);
  328.   MCIERR_CLIPBOARD_EMPTY            = (MCIERR_BASE + 118);
  329.   MCIERR_INVALID_WORKPATH           = (MCIERR_BASE + 119);
  330.   MCIERR_INDETERMINATE_LENGTH       = (MCIERR_BASE + 120);
  331.   MCIERR_DUPLICATE_EA               = (MCIERR_BASE + 121);
  332.   MCIERR_INVALID_CONNECTION         = (MCIERR_BASE + 122);
  333.   MCIERR_CHANNEL_OFF                = (MCIERR_BASE + 123);
  334.   MCIERR_CANNOT_CHANGE_CHANNEL      = (MCIERR_BASE + 124);
  335.   MCIERR_FILE_IO                    = (MCIERR_BASE + 125);
  336.   MCIERR_SYSTEM_FILE                = (MCIERR_BASE + 126);
  337.   MCIERR_DISPLAY_RESOLUTION         = (MCIERR_BASE + 127);
  338.   MCIERR_NO_ASYNC_PLAY_ACTIVE       = (MCIERR_BASE + 128);
  339.   MCIERR_UNSUPP_FORMAT_TAG          = (MCIERR_BASE + 129);
  340.   MCIERR_UNSUPP_SAMPLESPERSEC       = (MCIERR_BASE + 130);
  341.   MCIERR_UNSUPP_BITSPERSAMPLE       = (MCIERR_BASE + 131);
  342.   MCIERR_UNSUPP_CHANNELS            = (MCIERR_BASE + 132);
  343.   MCIERR_UNSUPP_FORMAT_MODE         = (MCIERR_BASE + 133);
  344.   MCIERR_NO_DEVICE_DRIVER           = (MCIERR_BASE + 134);
  345.   MCIERR_CODEC_NOT_SUPPORTED        = (MCIERR_BASE + 135);
  346.   MCIERR_TUNER_NO_HW                = (MCIERR_BASE + 136);
  347.   MCIERR_TUNER_NO_AFC               = (MCIERR_BASE + 137);
  348.   MCIERR_TUNER_AFC_ON               = (MCIERR_BASE + 138);
  349.   MCIERR_TUNER_CHANNEL_SKIPPED      = (MCIERR_BASE + 139);
  350.   MCIERR_TUNER_CHANNEL_TOO_LOW      = (MCIERR_BASE + 140);
  351.   MCIERR_TUNER_CHANNEL_TOO_HIGH     = (MCIERR_BASE + 141);
  352.   MCIERR_AUD_CHANNEL_OUTOFRANGE     = (MCIERR_BASE + 142);
  353.   MCIERR_TUNER_INVALID_REGION       = (MCIERR_BASE + 143);
  354.   MCIERR_SIGNAL_INVALID             = (MCIERR_BASE + 144);
  355.   MCIERR_TUNER_MODE                 = (MCIERR_BASE + 145);
  356.   MCIERR_TUNER_REGION_NOT_SET       = (MCIERR_BASE + 146);
  357.   MCIERR_TUNER_CHANNEL_NOT_SET      = (MCIERR_BASE + 147);
  358.   MCIERR_CUSTOM_DRIVER_BASE         = (MCIERR_BASE + 256);
  359.  
  360.   // Sync/Stream Manager Error Return codes
  361.   MEBASE                            = (MCIERR_BASE + 500);
  362.   ERROR_INVALID_STREAM              = (MEBASE +   1);
  363.   ERROR_INVALID_hID                 = (MEBASE +   2);
  364.   ERROR_INVALID_OBJTYPE             = (MEBASE +   4);
  365.   ERROR_INVALID_FLAG                = (MEBASE +   5);
  366.   ERROR_INVALID_EVCB                = (MEBASE +   6);
  367.   ERROR_INVALID_EVENT               = (MEBASE +   7);
  368.   ERROR_INVALID_MMTIME              = (MEBASE +   8);
  369.   ERROR_INVALID_NUMSLAVES           = (MEBASE +   9);
  370.   ERROR_INVALID_REQUEST             = (MEBASE +  10);
  371.   ERROR_INVALID_SPCBKEY             = (MEBASE +  11);
  372.   ERROR_INVALID_HNDLR_NAME          = (MEBASE +  12);
  373.   ERROR_INVALID_PROTOCOL            = (MEBASE +  13);
  374.   ERROR_INVALID_BUFFER_SIZE         = (MEBASE +  14);
  375.   ERROR_INVALID_BUFFER_RETURNED     = (MEBASE +  15);
  376.   ERROR_INVALID_ACB                 = (MEBASE +  16);
  377.   ERROR_INVALID_RECORD_RETURNED     = (MEBASE +  17);
  378.   ERROR_INVALID_MESSAGE             = (MEBASE +  18);
  379.   ERROR_STREAM_NOT_OWNER            = (MEBASE +  99);
  380.   ERROR_STREAM_USED                 = (MEBASE + 100);
  381.   ERROR_STREAM_CREATION             = (MEBASE + 101);
  382.   ERROR_STREAM_NOTMASTER            = (MEBASE + 102);
  383.   ERROR_STREAM_NOT_STOP             = (MEBASE + 103);
  384.   ERROR_STREAM_OPERATION            = (MEBASE + 104);
  385.   ERROR_STREAM_STOP_PENDING         = (MEBASE + 105);
  386.   ERROR_STREAM_ALREADY_STOP         = (MEBASE + 106);
  387.   ERROR_STREAM_ALREADY_PAUSE        = (MEBASE + 107);
  388.   ERROR_STREAM_NOT_STARTED          = (MEBASE + 108);
  389.   ERROR_STREAM_NOT_ACTIVE           = (MEBASE + 109);
  390.   ERROR_START_STREAM                = (MEBASE + 110);
  391.   ERROR_MASTER_USED                 = (MEBASE + 111);
  392.   ERROR_SPCBKEY_MISMATCH            = (MEBASE + 112);
  393.   ERROR_INSUFF_BUFFER               = (MEBASE + 113);
  394.   ERROR_ALLOC_RESOURCES             = (MEBASE + 114);
  395.   ERROR_ACCESS_OBJECT               = (MEBASE + 115);
  396.   ERROR_HNDLR_REGISTERED            = (MEBASE + 116);
  397.   ERROR_DATA_ITEM_NOT_SPECIFIED     = (MEBASE + 117);
  398.   ERROR_INVALID_SEQUENCE            = (MEBASE + 118);
  399.   ERROR_INITIALIZATION              = (MEBASE + 119);
  400.   ERROR_READING_INI                 = (MEBASE + 120);
  401.   ERROR_LOADING_HNDLR               = (MEBASE + 121);
  402.   ERROR_HNDLR_NOT_FOUND             = (MEBASE + 122);
  403.   ERROR_SPCB_NOT_FOUND              = (MEBASE + 123);
  404.   ERROR_DEVICE_NOT_FOUND            = (MEBASE + 124);
  405.   ERROR_TOO_MANY_EVENTS             = (MEBASE + 125);
  406.   ERROR_DEVICE_OVERRUN              = (MEBASE + 126);
  407.   ERROR_DEVICE_UNDERRUN             = (MEBASE + 127);
  408.   ERROR_HNDLR_NOT_IN_INI            = (MEBASE + 128);
  409.   ERROR_QUERY_STREAM_TIME           = (MEBASE + 129);
  410.   ERROR_DATA_ITEM_NOT_SEEKABLE      = (MEBASE + 130);
  411.   ERROR_NOT_SEEKABLE_BY_TIME        = (MEBASE + 131);
  412.   ERROR_NOT_SEEKABLE_BY_BYTES       = (MEBASE + 132);
  413.   ERROR_STREAM_NOT_SEEKABLE         = (MEBASE + 133);
  414.   ERROR_PLAYLIST_STACK_OVERFLOW     = (MEBASE + 135);
  415.   ERROR_PLAYLIST_STACK_UNDERFLOW    = (MEBASE + 136);
  416.   ERROR_LOCKING_BUFFER              = (MEBASE + 137);
  417.   ERROR_UNLOCKING_BUFFER            = (MEBASE + 138);
  418.   ERROR_SEEK_PAST_END               = (MEBASE + 139);
  419.   ERROR_SEEK_BACK_NOT_SUPPORTED     = (MEBASE + 140);
  420.   ERROR_INTERNAL_ERROR              = (MEBASE + 141);
  421.   ERROR_INTERNAL_CORRUPT            = (MEBASE + 142);
  422.   ERROR_INSUFF_MEM                  = (MEBASE + 143);
  423.   ERROR_LARGE_SEEK_BY_TIME          = (MEBASE + 144);
  424.   ERROR_STREAM_PREROLLING           = (MEBASE + 145);
  425.   ERROR_INI_FILE                    = (MEBASE + 146);
  426.   ERROR_SEEK_BEFORE_BEGINNING       = (MEBASE + 147);
  427.   ERROR_TOO_MANY_HANDLERS           = (MEBASE + 148);
  428.   ERROR_ALLOC_HEAP                  = (MEBASE + 149);
  429.   ERROR_END_OF_PLAYLIST             = (MEBASE + 150);
  430.   ERROR_TOO_MANY_STREAMS            = (MEBASE + 151);
  431.   ERROR_FILE_FORMAT_INCORRECT       = (MEBASE + 152);
  432.   ERROR_DESTROY_STREAM              = (MEBASE + 153);
  433.   ERROR_INVALID_NUMMASTERS          = (MEBASE + 154);
  434.   ERROR_MASTER_CONFLICT             = (MEBASE + 155);
  435.   ERROR_NO_MASTER                   = (MEBASE + 156);
  436.   ERROR_NO_SYNC                     = (MEBASE + 157);
  437.   ERROR_BUFFER_NOT_AVAILABLE        = (MEBASE + 400);
  438.   ERROR_TOO_MANY_BUFFERS            = (MEBASE + 401);
  439.   ERROR_TOO_MANY_RECORDS            = (MEBASE + 402);
  440.  
  441.   // ERROR_INVALID_PROTOCOL ulErrorStatus Defines
  442.   // Refer to SHC_NEGOTIATE_RESULT api function
  443.   PROTOCOL_SPCBLENGTH               =  1;
  444.   PROTOCOL_SPCBKEY                  =  2;
  445.   PROTOCOL_DATAFLAG                 =  3;
  446.   PROTOCOL_NUMRECORDS               =  4;
  447.   PROTOCOL_BLOCKSIZE                =  5;
  448.   PROTOCOL_BUFFERSIZE               =  6;
  449.   PROTOCOL_MINNUMBUFFERS            =  7;
  450.   PROTOCOL_MAXNUMBUFFERS            =  8;
  451.   PROTOCOL_SOURCESTART              =  9;
  452.   PROTOCOL_TARGETSTART              = 10;
  453.   PROTOCOL_BUFFERFLAG               = 11;
  454.   PROTOCOL_HANDLERFLAG              = 12;
  455.   PROTOCOL_SYNCTOLERANCE            = 13;
  456.   PROTOCOL_SYNCINTERVAL             = 14;
  457.   PROTOCOL_INTERNALERROR            = -1;
  458.  
  459.   // MMIO Manager error return codes
  460.   MMIOERR_BASE                      = (MEBASE + 1000);
  461.   MMIOERR_UNBUFFERED                = (MMIOERR_BASE +  1);
  462.   MMIOERR_CANNOTWRITE               = (MMIOERR_BASE +  2);
  463.   MMIOERR_CHUNKNOTFOUND             = (MMIOERR_BASE +  3);
  464.   MMIOERR_INVALID_HANDLE            = (MMIOERR_BASE +  4);
  465.   MMIOERR_INVALID_PARAMETER         = (MMIOERR_BASE +  5);
  466.   MMIOERR_INTERNAL_SYSTEM           = (MMIOERR_BASE +  6);
  467.   MMIOERR_NO_CORE                   = (MMIOERR_BASE +  7);
  468.   MMIOERR_INI_OPEN                  = (MMIOERR_BASE +  8);
  469.   MMIOERR_INI_READ                  = (MMIOERR_BASE +  9);
  470.   MMIOERR_INVALID_BUFFER_LENGTH     = (MMIOERR_BASE + 10);
  471.   MMIOERR_NO_BUFFER_ALLOCATED       = (MMIOERR_BASE + 11);
  472.   MMIOERR_NO_FLUSH_FOR_MEM_FILE     = (MMIOERR_BASE + 12);
  473.   MMIOERR_NO_FLUSH_NEEDED           = (MMIOERR_BASE + 13);
  474.   MMIOERR_READ_ONLY_FILE            = (MMIOERR_BASE + 14);
  475.   MMIOERR_WRITE_ONLY_FILE           = (MMIOERR_BASE + 15);
  476.   MMIOERR_INSTALL_PROC_FAILED       = (MMIOERR_BASE + 16);
  477.   MMIOERR_READ_FAILED               = (MMIOERR_BASE + 17);
  478.   MMIOERR_WRITE_FAILED              = (MMIOERR_BASE + 18);
  479.   MMIOERR_SEEK_FAILED               = (MMIOERR_BASE + 19);
  480.   MMIOERR_CANNOTEXPAND              = (MMIOERR_BASE + 20);
  481.   MMIOERR_FREE_FAILED               = (MMIOERR_BASE + 21);
  482.   MMIOERR_EOF_SEEN                  = (MMIOERR_BASE + 22);
  483.   MMIOERR_INVALID_ACCESS_FLAG       = (MMIOERR_BASE + 23);
  484.   MMIOERR_INVALID_STRUCTURE         = (MMIOERR_BASE + 24);
  485.   MMIOERR_INVALID_SIZE              = (MMIOERR_BASE + 25);
  486.   MMIOERR_INVALID_FILENAME          = (MMIOERR_BASE + 26);
  487.   MMIOERR_CF_DUPLICATE_SEEN         = (MMIOERR_BASE + 27);
  488.   MMIOERR_CF_ENTRY_NO_CORE          = (MMIOERR_BASE + 28);
  489.   MMIOERR_CF_WO_UNSUPPORTED         = (MMIOERR_BASE + 29);
  490.   MMIOERR_CF_ELEMENTS_OPEN          = (MMIOERR_BASE + 30);
  491.   MMIOERR_CF_NON_BND_FILE           = (MMIOERR_BASE + 31);
  492.   MMIOERR_CF_ENTRY_NOT_FOUND        = (MMIOERR_BASE + 32);
  493.   MMIOERR_DELETE_FAILED             = (MMIOERR_BASE + 33);
  494.   MMIOERR_OUTOFMEMORY               = (MMIOERR_BASE + 34);
  495.   MMIOERR_INVALID_DLLNAME           = (MMIOERR_BASE + 35);
  496.   MMIOERR_INVALID_PROCEDURENAME     = (MMIOERR_BASE + 36);
  497.   MMIOERR_MATCH_NOT_FOUND           = (MMIOERR_BASE + 37);
  498.   MMIOERR_SEEK_BEFORE_BEGINNING     = (MMIOERR_BASE + 38);
  499.   MMIOERR_INVALID_FILE              = (MMIOERR_BASE + 39);
  500.   MMIOERR_QOSUNAVAILABLE            = (MMIOERR_BASE + 40);
  501.   MMIOERR_MEDIA_NOT_FOUND           = (MMIOERR_BASE + 41);
  502.   MMIOERR_ERROR_IN_FRAME_DATA       = (MMIOERR_BASE + 42);
  503.   MMIOERR_INVALID_DIM_ALIGN         = (MMIOERR_BASE + 43);
  504.   MMIOERR_CODEC_NOT_SUPPORTED       = (MMIOERR_BASE + 44);
  505.  
  506.   MMIOERR_UNSUPPORTED_FUNCTION      = (MMIOERR_BASE + 45);
  507.   MMIOERR_CLIPBRD_ERROR             = (MMIOERR_BASE + 46);
  508.   MMIOERR_CLIPBRD_ACTIVE            = (MMIOERR_BASE + 47);
  509.   MMIOERR_CLIPBRD_EMPTY             = (MMIOERR_BASE + 48);
  510.   MMIOERR_NEED_NEW_FILENAME         = (MMIOERR_BASE + 49);
  511.   MMIOERR_INVALID_TRACK_OPERATION   = (MMIOERR_BASE + 50);
  512.   MMIOERR_INCOMPATIBLE_DATA         = (MMIOERR_BASE + 51);
  513.   MMIOERR_ACCESS_DENIED             = (MMIOERR_BASE + 52);
  514.   MMIOERR_MISSING_FLAG              = (MMIOERR_BASE + 53);
  515.   MMIOERR_INVALID_ITEM_FLAG         = (MMIOERR_BASE + 54);
  516.  
  517.   // User defined error return codes
  518.   USERERR_BASE                      = (MMIOERR_BASE + 1000);
  519.  
  520. {-----[ MCIAPI ]----}
  521.  
  522. function mciPlayFile(hwndOwner: HWnd;           // Ownerwindow
  523.                      pszFile: PChar;            // File
  524.                      ulFlags: uLong;            // Flags
  525.                      pszTitle: PChar;           // Title
  526.                      hwndViewport: HWnd): ULong;// Viewport Window
  527.  
  528. function mciPlayResource(hwndOwner: HWnd;       // Owner Window
  529.                          hmod: hModule;         // Module
  530.                          resType: uLong;        // Resource Type
  531.                          resID: uLong;          // Resource ID
  532.                          ulFlags: uLong;        // Flags
  533.                          pszTitle: pChar;       // Title
  534.                          hwndViewport: HWnd): ULong;   // Viewport Window
  535.  
  536. function mciRecordAudioFile(hwndOwner: HWnd; pszFile, pszTitle: pCHar;
  537.   ulFlags: uLong): uLong;
  538.  
  539. // Audio Macro Service Routines
  540. function mmioRemoveElement(pszFileElement: pChar; ulFlag: uLong): Ulong;
  541.  
  542. function mmioFindElement(ulCode: ULong;         // Find Code
  543.                          pszElement: pChar;     // Element
  544.                          ulElementLen: uLong;   // Element Buffer Length
  545.                          pszFile: pChar;
  546.                          ulReserved: ULong)     // Compound File
  547.                                             : uLong;
  548.  
  549. const
  550.   MMIO_FE_FINDFIRST        = 1;
  551.   MMIO_FE_FINDNEXT         = 2;
  552.   MMIO_FE_FINDEND          = 3;
  553.   MMIO_FE_FINDELEMENT      = 4;
  554.  
  555.   MMIO_RE_COMPACT          = 1;
  556.  
  557.   // Flags for mciPlayFile
  558.   MCI_OWNERISPARENT        = $0001;      // digital and overlay
  559.   MCI_STOPACTIVE           = $0002;      // stop playing whatever is playing
  560.   MCI_ASYNCRENDEZVOUS      = $0004;      // play and return immediately
  561.   MCI_RENDEZVOUS           = $0008;      // wait til prev is finished then play
  562.   MCI_ASYNC                = $0010;      // no syncup will be done
  563.  
  564. {----[ SSM ]----}
  565.  
  566. // Sync/Stream Manager Definitions
  567.  
  568. const
  569.   Max_SPI_Name             = 9;          // Maximum ASCIIZ stream handler name/class and device driver name
  570.  
  571. type
  572.   hStream = uLong;               // Stream Handle
  573.   phStream = ^hStream;           // Pointer to Stream Handle
  574.  
  575.   hEvent = uLong;                // Event Handle
  576.   phEvent = ^hEvent;             // Pointer to Event Handle
  577.  
  578.   hID = uLong;                   // Stream Handler ID
  579.   // The following define was deleted because it conflicts with an OS/2 PM define
  580.   // phID = ^hID;                // Pointer to Stream Handler ID
  581.  
  582.   LockH = record                 // Memory locking handle (used by PDD)
  583.     Lock: Array[0..15] of Byte;
  584.   end;
  585.   pLockH = ^LockH;
  586.  
  587.   rc = uLong;                    // Used for all return codes
  588.  
  589.   Slave = record
  590.    hstreamSlave: hStream;        // Handle for this slave
  591.    mmtimeStart: mmTime;          // Offset in master stream time to start this slave
  592.   end;
  593.   pSlave = ^Slave;
  594.  
  595.   Master = record
  596.     hstreamMaster: hStream;        // Handle for this master
  597.   end;
  598.   pMaster = ^Master;
  599.  
  600.   Hand = record
  601.     szHandlerClass: Array[0..MAX_SPI_NAME-1] of char; // Stream handler class
  602.     szHandlerName:  Array[0..MAX_SPI_NAME-1] of char; // Stream handler name
  603.   end;
  604.   pHand = ^Hand;
  605.  
  606. {----[ SSM / SPCB ]----}
  607.  
  608. // Control Block Definitions
  609.  
  610. type
  611.   // SPCB - Stream Protocol Control Block
  612.   spcb = record
  613.    ulSPCBLen       : uLong;       // SPCB struture length
  614.    spcbkey         : SPCBKEY;
  615.    ulDataFlags     : uLong;       // Data type flags
  616.    ulNumRec        : uLong;       // Max # records/buffer (Only used for Split streams)
  617.    ulBlockSize     : uLong;       // Block alignment in bytes.
  618.    ulBufSize       : uLong;       // Buffer size (SSM allocated buffers) must be
  619.                                   //  a multiple of Block size
  620.    ulMinBuf        : uLong;       // Minimum number of buffers needed to stream
  621.    ulMaxBuf        : uLong;       // Maximum number of buffers needed to stream
  622.    ulSrcStart      : uLong;       // # of EMPTY buffers required to start Source
  623.    ulTgtStart      : uLong;       // # of FULL buffers required to start Target
  624.    ulBufFlags      : uLong;       // Handler Protocol negotiation flags
  625.    ulHandFlags     : uLong;       // Handler Protocol flags
  626.    mmtimeTolerance : mmTime;      // Sync tolerance value...Used as check by SSM
  627.                                   //  to determine whether to send a sync pulse
  628.                                   //  to this specific slave Stream Handler.
  629.                                   //  Algorithm:
  630.                                   //   diff = abs(master time - slave time)
  631.                                   //   if  diff >= tolerance
  632.                                   //     then send sync pulse
  633.                                   // (Valid only for Slave stream handlers)
  634.    mmtimeSync      : mmTime;      // Used to save sync pulse generation granularity
  635.                                   //  if the master uses the Stream Manager Timer.
  636.                                   //  if SpiSetSync passed NULL value for sync gran
  637.                                   //   then use this default value. (since hardware
  638.                                   //   must have it's own interrupt time interval.
  639.                                   // (Valid only for Master stream handlers)
  640.    ulBytesPerUnit  : uLong;       // Bytes/unit of time. This is used to do seeks
  641.                                   // on linear data that is not compressed or
  642.                                   // of variable length.
  643.    mmtimePerUnit   : mmTime;      // The amount of mmtime each unit represents.
  644.                                   // A unit can be a second, minute or whatever.
  645.   end;
  646.   pspcb = ^spcb;
  647.  
  648. const
  649.   spcb_max_buf_Size        = 1024*1024;  // Largest buffer size in bytes
  650.  
  651.   // SPCB_ulDataFlags:
  652.   spcbData_CueTime         = $0002; // This data type can support time cue points
  653.   spcbData_CueData         = $0004; // This data type can support data cue points
  654.  
  655.   spcbData_Seek            = $0000; // Seeks can be performed on this data type.
  656.   spcbData_NoSeek          = $0008; // NO seeks can be performed on this data type.
  657.   spcbData_YieldTime       = $0010; // The ulBytes per unit field is used for a millisecond value
  658.                                     // It represents the amount of yield time between reads of
  659.                                     // each buffer. If this bit is set, the value of ulBytesPerUnit
  660.                                     // is used as input to DosSleep to yield for that period of time
  661.   ValidDataFlags           = spcbData_CueTime OR spcbData_CueData OR
  662.                              spcbData_YieldTime OR spcbData_NoSeek;
  663.  
  664.   // SPCB_ulBufFlags:
  665.   spcbBuf_USERPROVIDED     = $0001; // User provides buffers for stream
  666.                                     // SSMgr will not allocate buffers,
  667.                                     // but must lock down provided buffers,
  668.                                     // so this will affect performance!!
  669.                                     // (Source Handler only)
  670.   spcbBuf_FIXEDBUF         = $0002; // Buffer size is fixed for this data type
  671.                                     //  in this handler. Can not be used
  672.                                     //  with the spcbBuf_USERPROVIDED flags.
  673.   spcbBuf_NONCONTIGUOUS    = $0004; // Buffer do not need to be contiguous
  674.                                     //  in physical memory.
  675.   spcbBuf_INTERLEAVED      = $0008; // Stream buffers can be interleaved.
  676.                                     //  Can not be use with the
  677.                                     //  spcbBuf_USERPROVIDED flag.
  678.                                     //  (Source Handler only)
  679.   spcbBuf_MAXSIZE          = $0010; // ulBufSize is the maximum size that
  680.                                     //  can be used by this stream handler
  681.   spcbBuf_16MEG            = $0020; // The Stream buffers may be allocated
  682.                                     //  above the 16 Meg line. This is used
  683.                                     //  by stream handlers that can support
  684.                                     //  greater than 16 Megabyte addresses.
  685.   spcbBuf_FIXEDBLOCK       = $0040; // Use the ulBlockSize field to represent
  686.                                     // the size of the IO reads that should
  687.                                     // be performed (Interleaved streams)
  688.   ValidBufFlags            = spcbBuf_UserProvided OR spcbBuf_FixedBuf OR
  689.                              spcbBuf_NonContiguous OR spcbBuf_Interleaved OR
  690.                              spcbBuf_16Meg OR spcbBuf_FixedBlock OR
  691.                              spcbBuf_MaxSize;
  692.  
  693.   // SPCB_ulHandFlags:
  694.   spcbHand_genSync         = $0001; // (INPUT FROM HANDLER ONLY)
  695.                                     // This handler can generate sync pulses
  696.                                     // if it is the master.
  697.   spcbHand_RcvSync         = $0002; // (INPUT FROM HANDLER ONLY)
  698.                                     // This handler can receive sync pulses
  699.                                     // if it is a slave
  700.   spcbHand_Timer           = $0004; // Use Stream Manager Timer for Sync
  701.   spcbHand_NonStream       = $0008; // Stream Handler is non-streaming
  702.   spcbHand_GenTime         = $0010; // This handler contains real
  703.                                     // stream time. The handler that
  704.                                     // supports the SpiGetTime, data/time
  705.                                     // cue point calls for this stream.
  706.   spcbHand_NoPreRoll       = $0020; // This stream can not be prerolled.
  707.                                     // (i.e. recording streams)
  708.   spcbHand_NoSync          = $0040; // This stream can be group into a
  709.                                     // sync group, but does not send or
  710.                                     // receive sync pulses.
  711.   spcbHand_Phys_Seek       = $0080; // This handler does a seek to a physical
  712.                                     // device or memory not just a time adjustment.
  713.                                     // (ssm will always call this handler first on
  714.                                     //  an SpiSeekStream call).
  715.  
  716.   ValidHandFlags           = spcbHand_GenSync OR spcbHand_RcvSync OR
  717.                              spcbHand_Timer OR spcbHand_NonStream OR
  718.                              spcbHand_GenTime OR spcbHand_NoPreRoll OR
  719.                              spcbHand_NoSync OR spcbHand_Phys_Seek;
  720.  
  721.  
  722. {----[ SSM / EVCB ]----}
  723.  
  724. // Block definitions
  725.  
  726. { *********************************************
  727.   * List of Implicit events:
  728.   *    EVENT_EOS                 - Use IMPL_EVCB
  729.   *    EVENT_ERROR               - Use IMPL_EVCB
  730.   *    EVENT_STREAM_STOPPED      - Use IMPL_EVCB
  731.   *    EVENT_SYNC_PREROLLED      - Use IMPL_EVCB
  732.   *    EVENT_PLAYLISTMESSAGE     - Use PLAYL_EVCB
  733.   *    EVENT_PLAYLISTCUEPOINT    - Use PLAYL_EVCB
  734.   *    EVENT_QUEUE_OVERFLOW      - Use IMPL_EVCB
  735.   ********************************************* }
  736.  
  737. { *********************************************
  738.   * List of Explicit events:
  739.   *    EVENT_SYNCOVERRUN         - Use OVRU_EVCB
  740.   *    EVENT_CUE_TIME            - Use TIME_EVCB
  741.   *    EVENT_CUE_DATA            - Use DATA_EVCB
  742.   *    EVENT_DATAUNDERRUN        - Use EVCB
  743.   *    EVENT_DATAOVERRUN         - Use EVCB
  744.   *    EVENT_CUE_TIME_PAUSE      - Use TIME_EVCB
  745.   ********************************************* }
  746.  
  747. const
  748.   Event_SYNCOVERRUN        = 4;
  749.   Event_CUE_TIME           = 5;       // Cue point in terms of stream time
  750.   Event_CUE_DATA           = 6;       // Cue point in terms of data items
  751.   Event_DATAUNDERRUN       = 7;       // data underrun event from SH
  752.   Event_DATAOVERRUN        = 8;       // data underrun event from SH
  753.   Event_CUE_TIME_PAUSE     = 9;       // Pause when cue-point reached.
  754.   Event_STATUS_LEVEL       = 10;      // Report status level
  755.  
  756. {*********************************************
  757.  * SYNC_EVCB - Sync Pulse Event Control Block
  758.  *             (This event is only seen by
  759.  *              stream handlers)
  760.  *********************************************}
  761.   Event_SYNC               = 1;       // Synchronization point in stream
  762. type
  763.   sync_evcb = record
  764.     ulType       : uLong;             // Event_SYNC
  765.     ulSubType    : uLong;             // Not used
  766.     ulSyncFlags  : uLong;             // 0 (input),status (output)
  767.     hstream      : HStream;           // handle to stream for this event
  768.     hid          : hID;               // Handler id
  769.     ulStatus     : uLong;             // Event status (output)
  770.     mmtimeStart  : mmTime;            // Filled in by Sync/Stream manager
  771.                                       //  at SpiEnableSync time. (input)
  772.     mmtimeMaster : mmTime;            // Filled in by Master SH (input)
  773.     mmtimeSlave  : mmTime;            // Filled in by slave SH. (output)
  774.   end;
  775.   pSync_evcb = ^sync_Evcb;
  776.  
  777. const
  778.   // ulSyncFlags
  779.   SyncOverrun              = $0001;   // Set by SSM if sync pulse comes in before
  780.                                       //  a has processed the current sync pulse.
  781.   SyncPolling              = $0002;   // SSM set this after filling the handler EVCB.
  782.                                       //  Handler resets it after it processes the
  783.                                       //  contents of EVCB. The SSM must check this
  784.                                       //  bit before modifying EVCB. If bit already
  785.                                       //  set, set the SYNC overrun bit.
  786.  
  787.   Event_Reserved           = 2;       // RESERVED
  788.  
  789.  
  790. {*********************************************
  791.  * IMPL_EVCB - Implicit Event Control Block
  792.  *             (This is a parameter on the
  793.  *              SpiCreatStrem API)
  794.  *********************************************}
  795.   Event_Implicit_Type      = 3;      // These events are always supported
  796.  
  797. type
  798.   impl_evcb = record
  799.     ulType     : uLong;              // Event_IMPLICIT_TYPE
  800.     ulSubType  : uLong;              // One of the implicit events (input)
  801.     ulFlags    : uLong;              // 0 (Input), status (Output)
  802.     hstream    : hStream;            // handle to stream for this event (input/output)
  803.     hid        : hID;                // 0 (input), handler Id (output)
  804.     ulStatus   : uLong;              // Event status/error return code (output)
  805.     unused1    : uLong;              // 0 (input)
  806.     unused2    : uLong;              // 0 (input)
  807.     unused3    : uLong;              // 0 (input)
  808.   end;
  809.   pImpl_evcb = ^impl_evcb;
  810.  
  811. const
  812.   // ulSubtype
  813.  Event_EOS                 = 1;      // End of Stream
  814.  Event_ERROR               = 2;      // Error in Stream handler or device driver
  815.  Event_STREAM_STOPPED      = 3;      // Stream is in a stopped state (Discard or Flush)
  816.  Event_SYNC_PREROLLED      = 4;      // All streams are prerolled (buffers
  817.                                      //  have been filled by the Source SH's.
  818.  Event_PLAYLISTMESSAGE     = 5;      // Memory SH playlist message event
  819.  Event_PLAYLISTCUEPOINT    = 6;      // Memory SH playlist cue point
  820.  Event_QUEUE_OVERFLOW      = 7;      // Event Queue overflow. Indicates lost
  821.                                      //  events. Application must use this
  822.                                      //  to clear any waiting conditions.
  823.  
  824. {*********************************************
  825.  * PLAYL_EVCB - Playlist Message Event Control Block
  826.  *********************************************}
  827. type
  828.   // (IMPLICIT EVENT)
  829.   PlayL_evcb = record
  830.     ulType         : uLong;             // Event_IMPLICIT_TYPE
  831.     ulSubType      : uLong;             // Event_PLAYLISTMESSAGE or Event_PLAYLISTCUEPOINT
  832.     ulFlags        : uLong;             // 0 (input), status (output)
  833.     hstream        : hStream;           // handle to stream for this event (input/output)
  834.     hid            : hID;               // 0 (input), handler Id (output)
  835.     ulStatus       : uLong;             // Playlist Instruction number (output)
  836.     ulMessageParm  : uLong;             // 0 (input), Message from playlist (output)
  837.     unused1        : uLong;             // 0 (input)
  838.     unused2        : uLong;             // 0 (input)
  839.   end;
  840.   pPlayL_evcb = ^PlayL_evcb;
  841.  
  842. {*********************************************
  843.  * OVRU_EVCB - Sync Overrun Event Control Block
  844.  *             (Applications can request to be
  845.  *              notified whenever a Sync overrun
  846.  *              occurs.
  847.  *********************************************}
  848.   Ovru_evcb = record
  849.     ulType        : uLong;             // Event_SYNCOVERRUN
  850.     ulSubType     : uLong;             // Not used
  851.     ulFlags       : uLong;             // 0 (input), status (output)
  852.     hstream       : hStream;           // handle to stream for this event (input/output)
  853.     hid           : hID;               // handler Id (input/output)
  854.     ulStatus      : uLong;             // Event status/error return code (output)
  855.     mmtimeSlave   : mmTime;            // 0 (input), Slave stream time (output)
  856.     mmtimeStart   : mmTime;            // 0 (input), Slave start offset (offset)
  857.     mmtimeMaster  : mmTime;            // 0 (input), Master stream time (output)
  858.   end;
  859.   pOvru_evcb = ^Ovru_evcb;
  860.  
  861. {*********************************************
  862.  * TIME_EVCB - Cue Time Event Control Block
  863.  *             (Applications can request to be
  864.  *              notified for a time cue point)
  865.  *********************************************}
  866.   time_evcb = record
  867.     ulType         : uLong;            // Event_CUE_TIME
  868.     ulSubType      : uLong;            // Not used
  869.     ulFlags        : uLong;            // Single/Recurring(input/output)
  870.     hstream        : HSTREAM;          // handle to stream for this event (input/output)
  871.     hid            : hID;              // handler Id (input/output)
  872.     ulStatus       : uLong;            // Event status/error return code (output)
  873.     mmtimeStream   : MMTIME;           // Stream time (input/output)
  874.     unused1        : uLong;            // 0 (input)
  875.     unused2        : uLong;            // 0 (input)
  876.   end;
  877.   ptime_evcb = ^time_evcb;
  878.  
  879. const
  880.   // ulFlags:
  881.   Event_SINGLE             = 0;        // This is single one time event
  882.   Event_RECURRING          = 1;        // This is recurring event
  883.  
  884. {*********************************************
  885.  * DATA_EVCB - Cue Data Event Control Block
  886.  *             (Applications can request to be
  887.  *              notified for a data cue point)
  888.  *********************************************}
  889. type
  890.   data_evcb = record
  891.     ulType        : uLong;             // Event_CUE_DATA
  892.     ulSubType     : uLong;             // Event SubType
  893.     ulFlags       : uLong;             // Single/Recurring(input/output)
  894.     hstream       : HSTREAM;           // handle to stream for this event (input/output)
  895.     hid           : hID;               // handler Id (input/output)
  896.     ulStatus      : uLong;             // Event status/error return code (output)
  897.     mmtimeStream  : mmTime;            // Stream time (input/output)
  898.     ulEventParm1  : uLong;             // Data to Cue on (input/output)
  899.                                        //  This is interpreted by the stream handler
  900.     ulEventParm2  : uLong;             // Length of data cue buffer (input/output)
  901.   end;
  902.   pdata_evcb = ^data_evcb;
  903.  
  904. const
  905.   // ulFlags:
  906.   Event_DATAPTR            = 2;        // ulEventParm1 if ptr to buffer and
  907.                                        //  ulEventParm2 is a length of buffer,
  908.                                        //  else ulEventParm1 is data.
  909.  
  910. {*****************
  911.  * EVCB_ulType:  (Stream Handler defined types)
  912.  *****************}
  913.   sh_Type                  = $80000000;// Stream Handler defined types must
  914.                                        // have the high order bit set in the
  915.                                        // ulType field.
  916.                                        // events: 0H - 7FFFFFFFH are reserved!
  917.  
  918. {*********************************************
  919.  * EVCB - Generic Event Control Block (Use the
  920.  *        specific one in the SSM.H if possible)
  921.  *********************************************}
  922. type
  923.   evcb = record
  924.     ulType       : uLong;              // Event type (input)
  925.     ulSubType    : uLong;              // Event SubType (input)
  926.     ulFlags      : uLong;              // 0 (Input), status (Output)
  927.     hstream      : HSTREAM;            // handle to stream for this event
  928.     hid          : hID;                // handler Id (input/output)
  929.     ulStatus     : uLong;              // Event status (output)
  930.     ulEventParm1 : uLong;              // Event parameters (input), hID if implicit event
  931.     ulEventParm2 : uLong;              // Event parameters (input)
  932.     ulEventParm3 : uLong;              // Event parameters (input)
  933.   end;
  934.   pevcb = ^evcb;
  935.  
  936. {*********************************************
  937.  * STATUS_LEVEL_EVCB - Status Level Event Control Block
  938.  *********************************************}
  939.   Status_Level_evcb = record
  940.     // standard part
  941.     ulType          : uLong;            // Event type (input)
  942.     ulSubType       : uLong;            // Event SubType (input)
  943.     pMCDInstance    : uLong;            // for MCD use
  944.     hstream         : hStream;          // handle to stream for this event
  945.     hid             : hID;              // handler Id (input/output)
  946.     // custom part
  947.     ulSample        : Array[0..3] of uLong; // Samples
  948.   end;
  949.   pStatus_Level_evcb = ^Status_Level_evcb;
  950.  
  951. {----[ SSM / ACB ]----}
  952.  
  953. // Associate Control Block Definitions
  954.  
  955. const
  956.   Max_Port_Name            = 40;        // Max port name length
  957.   Max_Ports                = 16;        // Max number ports
  958.  
  959. {**********************************************
  960.  *
  961.  * ACB - Associate Control Block
  962.  *
  963.  *       Each stream handler must define the
  964.  *       ACB for each data object type that
  965.  *       expect ACB's from the application.
  966.  *
  967.  **********************************************}
  968. type
  969.   ACB = record                          // acb  -  Assoc. Control Block
  970.     ulACBLen   : uLong;                 // length of structure
  971.     ulObjType  : uLong;
  972.     ulParm1    : uLong;
  973.     ulParm2    : uLong;
  974.   end;
  975.   pACB = ^ACB;
  976.  
  977. {*****************************************************
  978.  * FSSH - File system stream handler MMIO Object ACB
  979.  *****************************************************}
  980. const
  981.   ACBType_mmIO             = $0001;     // MMIO object
  982.  
  983. type
  984.   ACB_mmIO = record                     // acbmmio  - MMIO Assoc. Control Block
  985.     ulACBLen  : uLong;                  // length of structure
  986.     ulObjType : uLong;                  // ACBTYPE_MMIO
  987.     hmmio     : HMMIO;                  // Handle of media element mgr obj
  988.   end;
  989.   pACB_mmIO = ^ACB_mmIO;
  990.  
  991. {*****************************************************
  992.  * MSH - Memory stream handler Playlist Object ACB
  993.  *****************************************************}
  994. const
  995.   ACBType_Mem_PlayL        = $0003;     // Memory playlist object
  996.  
  997. type
  998.   ACB_Mem_PlayL = record                // acbplyl - File system Assoc. Control Block
  999.     ulACBLen    : uLong;                // length of structure
  1000.     ulObjType   : uLong;                // ACBType_MEM_PLAYL
  1001.     pMemoryAddr : Pointer;              // Starting address of memory obj
  1002.   end;
  1003.   pACB_Mem_PlayL = ^ACB_Mem_PlayL;
  1004.  
  1005. {*****************************************************
  1006.  * CDDASH - CD DA stream handler Object ACB
  1007.  *****************************************************}
  1008. const
  1009.   ACBType_CDDA             = $0004;     //  Compact disk - digital audio obj
  1010.  
  1011. type
  1012.   ACB_CDDA = record                     // acbcdda - CD Assoc. Control Block
  1013.     ulACBLen   : uLong;                 // length of structure
  1014.     ulObjType  : uLong;                 // ACBType_CDDA
  1015.     bCDDrive   : CHAR;                  // CD drive letter
  1016.   end;
  1017.   pACB_CDDA = ^ACB_CDDA;
  1018.  
  1019. {*****************************************************
  1020.  * MISH - MIDI stream handler port-stream table ACB
  1021.  *****************************************************}
  1022. const
  1023.   ACBType_MISH             = $0005;     // MIDI port-stream table
  1024.  
  1025. type
  1026.   ACB_Mish = record                     // acbmish - MIDI Assoc. Control Block
  1027.     ulACBLen        : uLong;            // length of structure
  1028.     ulObjType       : uLong;            // ACBType_MISH
  1029.     hstreamDefault  : HSTREAM;          // Default hstream to use when mapper
  1030.                                         // is turned off.
  1031.     ulDeviceTypeID  : uLong;            // device type id
  1032.     ulpMapperPorts  : uLong;            // pointer to mapper port table
  1033.     ulNumInStreams  : uLong;
  1034.     hstreamIn       : Array[1..Max_Ports] of hStream; // Array of Input streams
  1035.     ulNumOutStreams : uLong;
  1036.     hstreamOut      : Array[1..Max_Ports] of hStream; // Array of Output streams
  1037.                                         // The index into the array is
  1038.                                         // the source channel for that
  1039.                                         // stream.
  1040.   end;
  1041.   pACB_Mish = ^ACB_Mish;
  1042.  
  1043. {*****************************************************
  1044.  * MISH - MIDI stream handler SET ACB
  1045.  *****************************************************}
  1046. const
  1047.   ACBType_SET              = $0006;     // MIDI set function
  1048.  
  1049. type
  1050.   ACB_Set = record                      // acbset - Set Assoc. Control Block
  1051.     ulACBLen   : uLong;                 // length of structure
  1052.     ulObjType  : uLong;                 // ACBType_SET
  1053.     ulFlags    : uLong;                 // Set flags
  1054.     ulReserved : uLong;                 // Reserved
  1055.   end;
  1056.   pACB_Set = ^ACB_Set;
  1057.  
  1058. const
  1059.   // ulFlags defines
  1060.   MIDI_MAP_ON              = $0000;     // turn mapping function on in MISH
  1061.   MIDI_MAP_OFF             = $0001;     // turn mapping function off in MISH
  1062.  
  1063. {*****************************************************
  1064.  * NULLSH - Null stream handler user ACB
  1065.  *****************************************************}
  1066. const
  1067.   ACBType_NULLSH           = $0007;     // User od Null stream handler
  1068.  
  1069. type
  1070.   ACB_NullSH = record                   // acbnullsh - NULLSH Assoc. Control Block
  1071.     ulACBLen   : uLong;                 // length of structure
  1072.     ulObjType  : uLong;                 // ACBType_NULLSH
  1073.     pfnEntry   : PFN;                   // user callback entry point
  1074.     ulReserved : uLong;                 // Reserved
  1075.   end;
  1076.   pACB_NullSh = ^ACB_NullSh;
  1077.  
  1078. {*****************************************************
  1079.  * MTSH - MultiTrack Stream Handler Object ACB
  1080.  *****************************************************}
  1081. const
  1082.   ACBType_MTSH             = $0008;     // MTSH object
  1083.  
  1084. type
  1085.   ACB_MTSH = record                     // acbmtsh  - MTSH Assoc. Control Block
  1086.     ulACBLen         : uLong;           // length of structure
  1087.     ulObjType        : uLong;           // ACBType_MTSH
  1088.     hmmio            : HMMIO;           // Handle of media element mgr obj
  1089.     mmtrackInfo      : MMTRACKINFO;     // track for this stream
  1090.     ulFlags          : uLong;           // flags
  1091.     ulMaxBytesPerSec : uLong;           // Max bytes per second
  1092.     ulAvgBytesPerSec : uLong;           // Avg bytes per second
  1093.     mmtimePerFrame   : MMTIME;          // frame display time or 0L
  1094.     ulTotalFrames    : uLong;           // total number of video frames
  1095.   end;
  1096.   pACB_MTSH = ^ACB_MTSH;
  1097.  
  1098. const
  1099.   // ulFlags defines
  1100.   Track_ACTIVATE           = $0000;     // Activate track in stream handler
  1101.   Track_DEACTIVATE         = $0001;     // Deactivate track in stream handler
  1102.  
  1103.  
  1104. {*****************************************************
  1105.  * CSH - CODEC stream handler Object ACB
  1106.  *****************************************************}
  1107. const
  1108.   ACBType_CODECSH          = $0009;     // CODEC object
  1109.  
  1110. type
  1111.   ACB_CodecSH = record                  // acbcodecsh - CODEC SH acb
  1112.     ulACBLen        : uLong;            // length of structure
  1113.     ulObjType       : uLong;            // ACBType_CODECSH
  1114.     hstreamToPair   : HSTREAM;          // 2nd stream of pair
  1115.     pMmioInfo       : Pointer;          // info for IO Proc
  1116.     ulInfoLength    : uLong;            // length of MmioInfo
  1117.     pCodecControl   : Pointer;          // CODEC control info
  1118.     ulControlLength : uLong;            // length of CodecControl
  1119.   end;
  1120.   pACB_CodecSH = ^ACB_CodecSH;
  1121.  
  1122. {----[ SSM / DCB ]----}
  1123.  
  1124. // Device Control Block Definitions
  1125.  
  1126. {**************************************************************************
  1127.  *
  1128.  * DCB - Common Device Control Block
  1129.  *               (*** PACKED STRUCTURE ***)
  1130.  **************************************************************************}
  1131. type
  1132.   DCB = packed record                   // dcb  -  Device Control Block
  1133.     ulDCBLen  : uLong;                  // length of structure
  1134.     szDevName : Array[0..MAX_SPI_NAME-1] of Char; // device driver name
  1135.   end;
  1136.   pDCB = ^DCB;
  1137.  
  1138. {**************************************************************************
  1139.  *
  1140.  * E_DCB - Extended Device Control Block
  1141.  *
  1142.  *         This structure will grow over time as new fields are added
  1143.  *         to the end of the structure.  If you manipulate the structure,
  1144.  *         be sure to check the length field.
  1145.  *
  1146.  *               (*** PACKED STRUCTURE ***)
  1147.  **************************************************************************}
  1148.  E_DCB = packed record                  // e_dcb  -  Extended Device Control Block
  1149.    ulDCBLen     : uLong;                // length of structure
  1150.    szDevName    : Array[0..MAX_SPI_NAME-1] of char; // device driver name
  1151.    ulSysFileNum : uLong;                // file handle number
  1152.  
  1153.    //    new fields will be added here
  1154.  end;
  1155.  DCB_AudioSH = E_DCB;
  1156.  pE_DCB = ^E_DCB;
  1157.  pDCB_AudioSH = ^DCB_AudioSH;
  1158.  
  1159. {**************************************************************************
  1160.  *
  1161.  * VSD_DCB - VSD Device Control Block
  1162.  *
  1163.  *         This structure will allow stream handlers to use the VSD DLL
  1164.  *         by using by the additional fields in the structure.
  1165.  *
  1166.  *               (*** PACKED STRUCTURE ***)
  1167.  **************************************************************************}
  1168.   VSD_DCB = packed record               // vsd_dcb - VSD Device Control Block
  1169.     ulDCBLen         : uLong;           // length of structure
  1170.     szDevName        : Array[0..MAX_SPI_NAME-1] of Char; // device driver name
  1171.     ulSysFileNum     : uLong;           // file handle number
  1172.     hvsd             : uLong;           // Handle to VSD instance
  1173.     pfnvsdEntryPoint : PFN;             // Address of VSD entry point
  1174.     ulReserved1      : uLong;           // Reserved for system
  1175.     ulReserved2      : uLong;           // Reserved for system
  1176.   end;
  1177.   pVSD_DCB = ^VSD_DCB;
  1178.  
  1179. {----[ SSM, cont'd ]----}
  1180.  
  1181. {**************************************************************************
  1182.   INI file support defines
  1183.  **************************************************************************}
  1184. const
  1185.   // RCDATA defines
  1186.   SPI_RESOURCE                  = 1;    // RCDATA resource number
  1187.   SH_DLL_TYPE                   = 0;    // DLL type stream handler
  1188.   SH_PDD_TYPE                   = 1;    // PDD type stream handler
  1189.   SPCBSIZE                      = 72;   // SPCB length, the Resource compiler
  1190.                                         //   doesn't allow sizeof(SPCB).
  1191.  
  1192. (**************************************************************************
  1193. //
  1194. //  Function Prototypes for Application event entry routine, SHC entry
  1195. //  routine, SMH entry routine. All use the Pure C calling convention
  1196. //
  1197. //**************************************************************************
  1198. typedef uLong (APIENTRY EVFN) (PEVCB  pevcb);
  1199. typedef EVFN (FAR *PEVFN);
  1200.  
  1201. typedef uLong (APIENTRY SHCFN) (pVoid pParmIn);
  1202. typedef SHCFN (FAR *PSHCFN);
  1203.  
  1204. typedef uLong (APIENTRY SMHFN) (pVoid pParmIn);
  1205. typedef SMHFN (FAR *PSMHFN);*)
  1206.  
  1207. type
  1208.   pEvfn = Pointer;
  1209.   pShcfn = Pointer;
  1210.   pSmhfn = Pointer;
  1211.  
  1212. {**************************************************************************
  1213.   Function Prototypes for SPI functions
  1214.   All use Pure C calling convention
  1215.   Six major categories:
  1216.      - stream creation
  1217.      - stream control
  1218.      - event handling
  1219.      - sync handling
  1220.      - configuration
  1221.      - stream protocol programming
  1222.  **************************************************************************}
  1223.  
  1224. {**************************************************************************
  1225.   Stream Creation
  1226.  **************************************************************************}
  1227.  
  1228. function SpiAssociate ( stream: hStream; ID: hID; pac: pACB ): uLong;
  1229.  
  1230. function SpiEnumerateHandlers ( Hand: PHand; // ptr to array handler name/class
  1231.                                 NumHand: PuLong ): uLong;
  1232.  
  1233. function SpiGetHandler ( HName: pChar; var phidSrc,phidTgt: hID ): uLong;
  1234.  
  1235. function SpiCreateStream ( hidSrc: hID;        // input
  1236.                            hidTgt: hID;        // input
  1237.                            Key: pspcbkey;      // input
  1238.                            Src: PDCB;          // input - Src device info
  1239.                            Tgt: PDCB;              // input - Tgt device info
  1240.                            Evcb: PIMPL_EVCB;       // input
  1241.                            EventEntry: PEVFN;      // input
  1242.                            StreamBuf: HSTREAM;     // input
  1243.                            Stream: PHSTREAM;       // output
  1244.                            Event: PhEvent): uLong; // output - implicit hevent
  1245.  
  1246. function SpiSendMsg ( Stream: hStream; ID: hID; MsgType: uLong; Msg: pVoid): uLong;
  1247.  
  1248. // The first thing in the pMsg must be the length of the structure!
  1249. type
  1250.   Msg_Common = record
  1251.     ulMsgLen  : uLong;              // length of structure
  1252.   end;
  1253.  
  1254. //**************************************************************************
  1255. // Stream Control
  1256. //**************************************************************************
  1257.  
  1258. function SpiDestroyStream ( Stream: hStream ): uLong;
  1259. function SpiGetTime ( Stream: hStream; Time: pMMTime ): uLong;
  1260. function SpiSeekStream ( Stream: hStream; Flags: uLong; SeekPoint: Long ): uLong;
  1261.  
  1262. const
  1263.   // SpiSeekStream() Flags defines
  1264.   SPI_SEEK_ABSOLUTE             = $0000;         // Seek from beginning of stream
  1265.   SPI_SEEK_RELATIVE             = $0001;         // Seek from current location
  1266.   SPI_SEEK_FROMEND              = $0002;         // TEMP
  1267.   SPI_SEEK_SLAVES               = $0010;         // Seek all slave streams
  1268.  
  1269.   SPI_SEEK_MMTIME               = $0000;         // lSeekPoint == mmtime (default)
  1270.   SPI_SEEK_BYTES                = $0100;         // lSeekPoint == bytes
  1271.  
  1272.   SPI_SEEK_IFRAME               = $1000;         // Seek to nearest IFRAME
  1273.  
  1274.   VALIDSEEKFLAGS                = SPI_SEEK_RELATIVE OR
  1275.                                   SPI_SEEK_ABSOLUTE OR
  1276.                                   SPI_SEEK_FROMEND  OR
  1277.                                   SPI_SEEK_MMTIME OR
  1278.                                   SPI_SEEK_SLAVES OR
  1279.                                   SPI_SEEK_IFRAME OR
  1280.                                   SPI_SEEK_BYTES;
  1281.  
  1282. function SpiStartStream ( Stream: hStream; Flags: uLong ): uLong;
  1283.  
  1284. const
  1285.   // SpiStartStream() Flags defines
  1286.   SPI_START_STREAM              = $0000;         // Only start this one stream
  1287.   SPI_START_SLAVES              = $0001;         // Start this master and any slaves
  1288.   SPI_START_PREROLL             = $0002;         // Start the stream, but do preroll
  1289.  
  1290.   VALIDSTARTFLAGS               = SPI_START_STREAM OR
  1291.                                   SPI_START_SLAVES OR
  1292.                                   SPI_START_PREROLL;
  1293.  
  1294.  
  1295. function SpiStopStream ( Stream: hStream; Flags: uLong ): uLong;
  1296.  
  1297. const
  1298.   // SpiStopStream() Flags defines
  1299.   SPI_STOP_STREAM               = $0000;   // Only stop this one stream
  1300.                                            // The default is to pause the data
  1301.                                            //  stream. No change to data buffers.
  1302.                                            //  synchronous call (no event notification)
  1303.   SPI_STOP_SLAVES               = $0001;   // Stop this master and any slaves
  1304.   SPI_STOP_FLUSH                = $0002;   // Stop and flush all filled buffers.
  1305.                                            //  Stops the Src & Tgt SH, lets the
  1306.                                            //  Tgt SH run until out of buffers
  1307.                                            //  thereby, "flushing" all buffers.
  1308.                                            //  Tgt SH stops when out of buffers
  1309.                                            //  (This is a ASYNCHRONOUS call, event
  1310.                                            //   notification sent to appl when done.)
  1311.   SPI_STOP_DISCARD              = $0004;   // Stop and discard all filled buffers.
  1312.                                            //  Stops the Src & Tgt SH
  1313.                                            //  then discards all buffers current for
  1314.                                            //  this stream.
  1315.                                            //  (This is a ASYNCHRONOUS call, event
  1316.                                            //   notification sent to appl when done.)
  1317.  
  1318.   VALIDSTOPFLAGS                = SPI_STOP_STREAM OR
  1319.                                   SPI_STOP_SLAVES OR
  1320.                                   SPI_STOP_FLUSH OR
  1321.                                   SPI_STOP_DISCARD;
  1322.  
  1323. //**************************************************************************
  1324. // Event Handling
  1325. //**************************************************************************
  1326.  
  1327. function SpiDisableEvent ( Event: hEvent ): uLong;
  1328. function SpiEnableEvent ( ev: pEvcb; Event: phEvent ): uLong;
  1329.  
  1330. //**************************************************************************
  1331. // Sync Handling
  1332. //**************************************************************************
  1333.  
  1334.  
  1335. function SpiDisableSync  ( MasterStream: hStream ): uLong;
  1336. function SpiEnableSync ( MasterStream: hStream; SlaveList: pSlave;
  1337.   NumSlaves: uLong; TimeSync: mmTime ): uLong;
  1338. function SpiDetermineSyncMaster ( MasterStream: hStream; MasterList: pMaster;
  1339.   NumMasters: uLong ): uLong;
  1340.  
  1341. //**************************************************************************
  1342. // Protocol manipulation
  1343. //**************************************************************************
  1344.  
  1345. function SpiGetProtocol ( ID: hID; InKey: pspcbkey; OutKey: pspcb ): uLong;
  1346. function SpiInstallProtocol ( ID: hID; InKey: pspcbkey; InSpcb: pspcb;
  1347.   Flags: uLong ): uLong;
  1348.  
  1349. const
  1350.   // SpiInstallProtocol() Flags defines
  1351.   SPI_INSTALL_PROTOCOL          = $0000;         // Install this protocol
  1352.   SPI_DEINSTALL_PROTOCOL        = $0001;         // DeInstall this protocol
  1353.  
  1354.   VALIDINSTALLFLAGS             = SPI_INSTALL_PROTOCOL OR SPI_DEINSTALL_PROTOCOL;
  1355.  
  1356. function SpiEnumerateProtocols ( ID: hID;
  1357.                                  SPCBKeys: Pointer;            // ptr to buffer to fill with SPCB keys
  1358.                                  NumSPCBKeys: pUlong ): uLong; // # of entries buffer on input,
  1359.                                                                // # of SPCB key on output.
  1360.  
  1361. //**************************************************************************
  1362. //
  1363. //  Function Prototypes for SMH functions
  1364. //  All use Pure C calling convention
  1365. // NOTE ABOUT POINTERS:
  1366. //  0:32 linear addresses for ring 3 (DLL) stream handlers
  1367. //  16:16 selector/offset addresses for ring 0 (PDD) stream handlers
  1368. //**************************************************************************
  1369.  
  1370. type
  1371.   SMHEntryPoint = function( pParmIn: Pointer ): uLong;
  1372.   smh_Common = record             // smhfunc
  1373.     uFunction : uLong;            // SMH command function
  1374.     ID: hID;                      // handler ID
  1375.   end;
  1376.   psmh_Common = ^smh_Common;
  1377.  
  1378. const
  1379.   smh_Register                  = 0;           // (Valid only from ring 3 stream
  1380.                                                //  handler)
  1381. type
  1382.   Parm_Reg = record                            // smhreg
  1383.     ulFunction: uLong;                         // SMH command function
  1384.     pszSHName: pChar;                          // Max size = 8 characters
  1385.     phidSrc: ^hID;                             // (9 including null)
  1386.     phidTgt: ^hID;
  1387.     pshcfnEntry: PSHCFN;                       // Handler entry point for SHC's
  1388.                                                //  Only used for Ring 0 handlers.
  1389.     ulFlags: uLong;
  1390.     ulMaxNumStreams: uLong;                    // Max # of streams
  1391.     ulMaxNumEvents: uLong;                     // Max # of events/stream
  1392.   end;
  1393.   pParm_Reg = ^Parm_Reg;
  1394.  
  1395. const
  1396.   REGISTER_TGT_HNDLR            = $0001;         // This handler is Target.
  1397.   REGISTER_SRC_HNDLR            = $0002;         // This handler is Source.
  1398.                                                  // Handler can be both.
  1399.   REGISTER_NONSTREAMING         = $0004;         // Handler is non-streaming.
  1400.   VALIDREGISTERFLAGS            = REGISTER_TGT_HNDLR OR REGISTER_SRC_HNDLR OR REGISTER_NONSTREAMING;
  1401.  
  1402. // Notes:
  1403. //  - Since ring 0 (DD) stream handlers can not use the IDC interface to the
  1404. //    sync/stream manager during DD initialization time, it must use the IOCTL
  1405. //    function to perform the SMH_REGISTER function. The addresses are 16:16
  1406. //    for this IOCTl instead of 0:32, because it comes form a device driver.
  1407.   SSMDD_CATEGORY                = $0081;    // Category (For ring 0 stream handler)
  1408.   IOCTL_FUNC_SMH_REGISTER       = $0040;    // Function (For ring 0 stream handler)
  1409.  
  1410.  
  1411. //**************************************************************************
  1412.   SMH_DEREGISTER                = 1;           // SMH_Deregister()
  1413.  
  1414. type
  1415.   Parm_DeReg = record                          // smhder
  1416.     uFunction : uLong;                         // SMH command function
  1417.     pszSHName : pChar;                         // Max size = 8 char, 9 includes
  1418.   end;
  1419.   pParm_DeReg = ^Parm_DeReg;
  1420.  
  1421. //**************************************************************************
  1422. const
  1423.   SMH_REPORTEVENT               = 2;           // SMH_ReportEvent()
  1424.  
  1425. type
  1426.   Parm_Event = record                          // smhrev
  1427.     ulFunction : uLong;                        // SMH command function
  1428.     ID         : hID;
  1429.     Event      : HEvent;                       // Used only for explicit events
  1430.                                                //  Must be 0 for sync and implicit
  1431.                                                //  events (i.e. error events)
  1432.     pevcbEvent: PEVCB;                         // Event status & HSTREAM
  1433.   end;
  1434.   pParm_Event = ^Parm_Event;
  1435.  
  1436. //**************************************************************************
  1437. const
  1438.   SMH_NOTIFY                    = 3;           // SMH_Notify()
  1439.  
  1440. type
  1441.   Parm_Notify = record                         // smhnot
  1442.     ulFunction      : uLong;                   // Input - SMH command function
  1443.     hid             : hID;                     // Input
  1444.     hstream         : hStream;                 // Input
  1445.     ulFlags         : uLong;                   // Input/Output
  1446.     ulGetNumEntries : uLong;                   // Input/Output - # of entries in table
  1447.     ulRetNumEntries : uLong;                   // Input/Output - # of entries in table
  1448.     pGetBufTab      : pVoid;                   // Output - Ptr to buffer/record table
  1449.     pRetBufTab      : pVoid;                   // Input - Ptr to buffer/record table
  1450.   end;
  1451.   pParm_Notify = ^Parm_Notify;
  1452.  
  1453.   SrcBufTab = record                           // srcbuftab
  1454.     pBuffer       : pVoid;                     // Ptr to buffer
  1455.     pRecord       : pVoid;                     // Ptr to record in buffer (split-streams only)
  1456.     ulLength      : uLong;                     // Max buf length on GetEmpty, Filled
  1457.                                                // (actual) rec/buf length on ReturnFull.
  1458.     ulMessageParm : uLong;                     // Message to passed to application
  1459.     mmtimeOffset  : mmTime;                    // mmtime offset from beginning of buffer
  1460.   end;
  1461.   pSrcBufTab = ^SrcBufTab;
  1462.  
  1463.   TgtBufTab = record                           // tgtbuftab
  1464.     pBuffer       : pVoid;                     // Ptr to buffer
  1465.     ulBufId       : uLong;                     // Buffer ID. Passed to SH on GetFull, must
  1466.                                                // be passed back to SSM on ReturnEmpty.
  1467.     ulLength      : uLong;                     // Filled (actual) buffer length on GetFull,
  1468.                                                // unused on ReturnEmpty.
  1469.     ulMessageParm : uLong;                     // Message to passed to application
  1470.     mmtimeOffset  : mmTime;                    // mmtime offset from beginning of buffer
  1471.   end;
  1472.   pTgtBufTab = ^TgtBufTab;
  1473.  
  1474. // EXTENDED SMH_NOTIFY Structures
  1475.  
  1476.   Parm_Enotify = record                        // smhenot
  1477.     ulFunction      : uLong;                   // Input - SMH command function
  1478.     hid             : hID;                     // Input
  1479.     hstream         : hStream;                 // Input
  1480.     ulFlags         : uLong;                   // Input/Output
  1481.     ulGetNumEntries : uLong;                   // Input/Output - # of entries in table
  1482.     ulRetNumEntries : uLong;                   // Input/Output - # of entries in table
  1483.     pGetBufTab      : pVoid;                   // Output - Ptr to buffer/record table
  1484.     pRetBufTab      : pVoid;                   // Input - Ptr to buffer/record table
  1485.     ulParm1         : uLong;                   // Reserved for future use
  1486.     ulParm2         : uLong;                   // Reserved for future use
  1487.   end;
  1488.   pParm_Enotify = ^Parm_Enotify;
  1489.  
  1490.   ESrcBufTab = record                          // esrcbuftab
  1491.     pBuffer       : pVoid;                     // Ptr to buffer
  1492.     pRecord       : pVoid;                     // Ptr to record in buffer (split-streams only)
  1493.     ulLength      : uLong;                     // Max buf length on GetEmpty, Filled
  1494.                                                // (actual) rec/buf length on ReturnFull.
  1495.     ulMessageParm : uLong;                     // Message to passed to application
  1496.     mmtimeOffset  : mmTime;                    // mmtime offset from beginning of buffer
  1497.     ulParm1       : uLong;                     // Record or buffer specific data
  1498.     ulParm2       : uLong;                     // Record or buffer specific data
  1499.   end;
  1500.   pESrcBufTab = ^ESrcBufTab;
  1501.  
  1502.   ETgtBufTab = record                          // etgtbuftab
  1503.     pBuffer         : pVoid;                   // Ptr to buffer
  1504.     ulBufId         : uLong;                   // Buffer ID. Passed to SH on GetFull, must
  1505.                                                // be passed back to SSM on ReturnEmpty.
  1506.     ulLength        : uLong;                   // Filled (actual) buffer length on GetFull,
  1507.                                                // unused on ReturnEmpty.
  1508.     ulMessageParm   : uLong;                   // Message to passed to application
  1509.     mmtimeOffset    : mmTime;                  // mmtime offset from beginning of buffer
  1510.     ulParm1         : uLong;                   // Buffer specific data
  1511.     ulParm2         : uLong;                   // Buffer specific data
  1512.   end;
  1513.   pETgtBufTab = ^ETgtBufTab;
  1514.  
  1515.   EPSrcBufTab = record                         // epsrcbuftab
  1516.     pBuffer        : pVoid;                    // Ptr to buffer
  1517.     pRecord        : pVoid;                    // Ptr to record in buffer (split-streams only)
  1518.     ulLength       : uLong;                    // Max buf length on GetEmpty, Filled
  1519.                                                // (actual) rec/buf length on ReturnFull.
  1520.     ulMessageParm  : uLong;                    // Message to passed to application
  1521.     mmtimeOffset   : mmTime;                   // mmtime offset from beginning of buffer
  1522.     ulParm1        : uLong;                    // Record or buffer specific data
  1523.     ulParm2        : uLong;                    // Record or buffer specific data
  1524.     pProcessLin    : pVoid;                    // Process Linear record ptr
  1525.   end;
  1526.   pEPSrcBufTab = ^EPSrcBufTab;
  1527.  
  1528.   EPTgtBufTab = record                         // eptgtbuftab
  1529.     pBuffer        : pVoid;                    // Ptr to buffer
  1530.     ulBufId        : uLong;                    // Buffer ID. Passed to SH on GetFull, must
  1531.                                                // be passed back to SSM on ReturnEmpty.
  1532.     ulLength       : uLong;                    // Filled (actual) buffer length on GetFull,
  1533.                                                // unused on ReturnEmpty.
  1534.     ulMessageParm  : uLong;                    // Message to passed to application
  1535.     mmtimeOffset   : mmTime;                   // mmtime offset from beginning of buffer
  1536.     ulParm1        : uLong;                    // Buffer specific data
  1537.     ulParm2        : uLong;                    // Buffer specific data
  1538.     pProcessLin    : pVoid;                    // Process Linear buffer ptr
  1539.   end;
  1540.   pEPTgtBufTab = ^EPTgtBufTab;
  1541.  
  1542. const
  1543.   //SMH_ulFlags
  1544.   BUF_GETEMPTY                  = $00000001;   // Ptr returned in SMH_pGetBuffer
  1545.   BUF_RETURNFULL                = $00000002;   // Ptr passed in SMH_pRetBuffer
  1546.   BUF_GETFULL                   = $00000004;   // Ptr returned in SMH_pGetBuffer
  1547.   BUF_RETURNEMPTY               = $00000008;   // Ptr passed in SMH_pRetBuffer
  1548.   BUF_GIVEBUF                   = $00000010;   // Ptr passed in SMH_pRetBuffer
  1549.   BUF_EOS                       = $00000100;   // End of stream. Source sets this on
  1550.                                                //  last buffer. Target sets it after
  1551.                                                //  consuming the laset buffer.
  1552.   BUF_RECORDS                   = $00004000;   // One or more records (Split-stream)
  1553.   BUF_LASTRECORD                = $00008000;   // (BUF_RETURNFULL only) Mark
  1554.                                                // these record(s) as being the
  1555.                                                // last in the buffer. So the SSM
  1556.                                                // knows the maximum # of records
  1557.                                                // produced for this buffer.
  1558.                                                // (Split stream only)
  1559.   //SMH_ulFlags
  1560.   BUF_LINEAR                    = $00010000;   // Ptrs are Global linear
  1561.   BUF_PHYSICAL                  = $00020000;   // Ptrs are physical
  1562.                                                // (valid only for phyically
  1563.                                                //  contiguous buffers)
  1564.   BUF_RESERVED                  = $00040000;   // Reserved
  1565.   BUF_GDT                       = $00080000;   // Ptrs are GDT sel:offset
  1566.   BUF_EXTENDED                  = $80000000;   // Use Extended SMH_NOTIFY structures
  1567.   BUF_EXTENDEDPTR               = $40000000;   // Use Extendedptr SMH_NOTIFY structures
  1568.                                                //  Implies BUF_EXTENDED
  1569.  
  1570.   VALIDSOURCEFLAGS              = BUF_RETURNFULL or BUF_GETEMPTY or BUF_EOS or BUF_LASTRECORD or BUF_PHYSICAL or BUF_LINEAR or BUF_GDT or BUF_RECORDS or BUF_GIVEBUF or BUF_EXTENDED or BUF_EXTENDEDPTR;
  1571.   VALIDTARGETFLAGS              = BUF_RETURNEMPTY or BUF_GETFULL or BUF_PHYSICAL or BUF_LINEAR or BUF_GDT or BUF_EOS or BUF_EXTENDED or BUF_EXTENDEDPTR;
  1572.  
  1573.  
  1574. //**************************************************************************
  1575. const
  1576.   SMH_LOCKMEM                   = 4;              // SMH_LockMem()
  1577.  
  1578. type
  1579.   Parm_LockM = record                             // smhloc
  1580.     ulFunction  : uLong;                          // SMH command function
  1581.     pBuffer     : pVoid;
  1582.     ulBufSize   : uLong;
  1583.     lockh       : PLockH;
  1584.     Flags       : uLong;
  1585.   end;
  1586.   pParm_LockM = ^Parm_LockM;
  1587.  
  1588. const
  1589.   //SMH_ulFlags
  1590.   SSM_LOCKMEM                   = $0000;         // Lock Memory.
  1591.   SSM_UNLOCKMEM                 = $0001;         // Unlock memory.
  1592.   SSM_CONTIGLOCK                = $0002;         // Lock memory contiguously.
  1593.   SSM_LOCKMEM_RESERVED1         = $0100;         // reserved
  1594.   SSM_LOCKMEM_RESERVED2         = $0200;         // reserved
  1595. //**************************************************************************
  1596.  
  1597. //**************************************************************************
  1598. //
  1599. //  Function Prototypes for SHC functions (Stream Handler Functions)
  1600. //  All use Pure C calling convention
  1601. //
  1602. // NOTE ABOUT POINTERS:
  1603. //  0:32 linear addresses for ring 3 (DLL) stream handlers
  1604. //  16:16 selector/offset addresses for ring 0 (PDD) stream handlers
  1605. //  Use the System.SelToFlat or System.FlatToSel to convert one to the other
  1606. //**************************************************************************
  1607. type
  1608.   shc_Common = record                          // shcfunc
  1609.     uFunction  : uLong;                        // Handler command function
  1610.     ID         : hID;                          // handler ID
  1611.   end;
  1612.   pshc_Common = ^shc_Common;
  1613.  
  1614. //**************************************************************************
  1615. const
  1616.   SHC_ASSOCIATE                 = 0;
  1617.  
  1618. type
  1619.   Parm_Assoc = record                          // shcass
  1620.     ulFunction    : uLong;                     // Handler command function
  1621.     hid           : hID;                       // handler ID
  1622.     hstream       : hStream;                   // handle of stream instance
  1623.     pacb          : PACB;                      // pointer to associate control block
  1624.   end;
  1625.   pParm_Assoc = ^Parm_Assoc;
  1626.  
  1627. //**************************************************************************
  1628. const
  1629.   SHC_CLOSE                     = 1;
  1630.  
  1631. type
  1632.   Parm_Close = record                          // shcclo
  1633.     ulFunction    : uLong;                     // Handler command function
  1634.     ID            : hID;                       // handler ID
  1635.   end;
  1636.   pParm_Close = ^Parm_Close;
  1637.  
  1638. //**************************************************************************
  1639. const
  1640.   SHC_CREATE                    = 2;
  1641.  
  1642. type
  1643.   Parm_Create = record                         // shccrt
  1644.     ulFunction   :  uLong;                     // Handler command function
  1645.     ID           :  hID;                       // handler ID
  1646.     Stream       :  hStream;                   // handle of stream instance
  1647.     spcbkey      :  SPCBKEY;                   // type of stream to create
  1648.     spcb         :  PSPCB;                     // Pointer to SPCB from handler
  1649.     hstreamBuf   :  hStream;                   // Used for split streams or to associate
  1650.                                                // another stream with this stream.
  1651.     Dcb          :  PDCB;                      // pointer to device control block
  1652.   end;
  1653.   pParm_Create = ^Parm_Create;
  1654.  
  1655. //**************************************************************************
  1656. const
  1657.   SHC_DESTROY                   = 3;
  1658.  
  1659. type
  1660.   Parm_Destroy = record                        // shcdes
  1661.     ulFunction    : uLong;                     // Handler command function
  1662.     ID            : hID;                       // handler ID
  1663.     Stream        : hStream;                   // handle of stream instance
  1664.   end;
  1665.   pParm_Destroy = ^Parm_Destroy;
  1666.  
  1667. //**************************************************************************
  1668. const
  1669.   SHC_START                     = 4;
  1670.  
  1671. type
  1672.   Parm_Start = record                          // shcstr
  1673.     ulFunction    : uLong;                     // Handler command function
  1674.     ID            : hID;                       // handler ID
  1675.     Stream        : hStream;                   // handle of stream instance
  1676.     Flags         : uLong;                     // Start flags
  1677.   end;
  1678.   pParm_Start = ^Parm_Start;
  1679.  
  1680. const
  1681.   // Flags
  1682.   FLUSH_START                   = $0001;       // This start is a result of a Flush Stop command.
  1683.  
  1684. //**************************************************************************
  1685. const
  1686.   SHC_STOP                      = 5;
  1687.  
  1688. type
  1689.   Parm_Stop = record                           // shcstp
  1690.     ulFunction    : uLong;                     // Handler command function
  1691.     ID            : hID;                       // handler ID
  1692.     Stream        : hStream;                   // handle of stream instance
  1693.     Flags         : uLong;                     // Stop flags (refer to Flags defines under
  1694.                                                //  SpiStopStream() call.
  1695.   end;
  1696.   pParm_Stop = ^Parm_Stop;
  1697.  
  1698. //**************************************************************************
  1699. const
  1700.   SHC_SEEK                      = 6;
  1701.  
  1702. type
  1703.   Parm_Seek = record                           // shcsek
  1704.     ulFunction    : uLong;                     // Handler command function
  1705.     ID            : hID;                       // handler ID
  1706.     Stream        : hStream;                   // handle of stream instance
  1707.     Flags         : uLong;                     // Seek flag (refer to Flags defines under
  1708.                                                //  SpiSeekStream() call.
  1709.     SeekPoint     : Long;                      // seek to point , mmtime or other
  1710.   end;
  1711.   pParm_Seek = ^Parm_Seek;
  1712.  
  1713. //**************************************************************************
  1714. const
  1715.   SHC_ENABLE_EVENT              = 7;
  1716.  
  1717. type
  1718.   Parm_EnEvent = record                        // shceev
  1719.     ulFunction    : uLong;                     // Handler command function
  1720.     ID            : hID;                       // handler ID
  1721.     Event         : hEvent;                    // handle of event to enable
  1722.     evcbUser      : PEvcb;                     // User event information (e.g. hstream
  1723.                                                //  EventType, EventSubType)
  1724.   end;
  1725.   pParm_EnEvent = ^Parm_EnEvent;
  1726.  
  1727. //**************************************************************************
  1728. const
  1729.   SHC_DISABLE_EVENT             = 8;
  1730.  
  1731. type
  1732.   Parm_DisEvent = record                       // shcdev
  1733.     ulFunction    : uLong;                     // Handler command function
  1734.     ID            : hID;                       // handler ID
  1735.     Stream        : hStream;                   // handle of stream for this event
  1736.     Event         : hEvent;                    // handle of event to disable
  1737.   end;
  1738.   pParm_DisEvent = ^Parm_DisEvent;
  1739.  
  1740. //**************************************************************************
  1741. const
  1742.   SHC_ENABLE_SYNC               = 9;
  1743.  
  1744. type
  1745.   Parm_EnSync = record                         // shcesy
  1746.     ulFunction    : uLong;                     // Handler command function
  1747.     ID            : hID;                       // handler ID
  1748.     Stream        : hStream;                   // handle of stream instance
  1749.     Flags         : uLong;                     // Sync flags
  1750.     TimeSync      : mmTime;                    // granularity of sync interval (if null, use default)
  1751.     SyncPulse     : PSync_EVCB;                // Sync pulse EVCB information
  1752.     PulseSem      : uLong;                     // Optional 16 bit system
  1753.                                                // Semaphore for handler
  1754.   end;
  1755.   pParm_EnSync = ^Parm_EnSync;
  1756.  
  1757. const
  1758.   // Flags
  1759.   SYNC_MASTER                   = $0000;    // The handler will be a master for this sync
  1760.   SYNC_SLAVE                    = $0001;    // The handler will be a slave for this sync
  1761.  
  1762. //**************************************************************************
  1763. const
  1764.   SHC_DISABLE_SYNC              = 10;
  1765.  
  1766. type
  1767.   Parm_DisSync = record                        // shcdsy
  1768.     ulFunction    : uLong;                     // Handler command function
  1769.     ID            : hID;                       // handler ID
  1770.     Stream        : hStream;                   // handle of stream instance
  1771.   end;
  1772.   pParm_DisSync = ^Parm_DisSync;
  1773.  
  1774. //**************************************************************************
  1775. const
  1776.   SHC_GET_TIME                  = 11;
  1777.  
  1778. type
  1779.   Parm_gTime = record                          // shcgti
  1780.     ulFunction    : uLong;                     // Handler command function
  1781.     ID            : hID;                       // handler ID
  1782.     Stream        : hStream;                   // handle of stream instance
  1783.     TimeCurrent   : mmTime;                    // Returns current stream time
  1784.   end;
  1785.   pParm_gTime = ^Parm_gTime;
  1786.  
  1787. //**************************************************************************
  1788. const
  1789.   SHC_GET_PROTOCOL              = 12;
  1790.  
  1791. type
  1792.   Parm_gProt = record                          // shcgpt
  1793.     ulFunction   :  uLong;                     // Handler command function
  1794.     ID           :  hID;                       // handler ID
  1795.     spcbkey      :  SPCBKEY;                   // Key of SPCB
  1796.     spcb         :  PSPCB;                     // Pointer to SPCB (output)
  1797.   end;
  1798.   pParm_gProt = ^Parm_gProt;
  1799.  
  1800. //**************************************************************************
  1801. const
  1802.   SHC_INSTALL_PROTOCOL          = 13;
  1803.  
  1804. type
  1805.   Parm_InstProt = record                       // shcipt
  1806.     ulFunction   :  uLong;                     // Handler command function
  1807.     ID           :  hID;                       // handler ID
  1808.     spcbkey      :  SPCBKEY;                   // Key of SPCB
  1809.     spcb         :  PSPCB;                     // Pointer to SPCB to install
  1810.     Flags        :  uLong;                     // Install / Deinstall flags
  1811.   end;
  1812.   pParm_InstProt = ^Parm_InstProt;
  1813.  
  1814. //**************************************************************************
  1815. const
  1816.   SHC_ENUMERATE_PROTOCOLS       = 14;
  1817.  
  1818. type
  1819.   Parm_EnumProt = record                       // shcqpi
  1820.     ulFunction   :  uLong;                     // Handler command function
  1821.     ID           :  hID;                       // handler ID
  1822.     SPCBKeys     :  Pointer;                   // ptr to buffer to fill with SPCB keys
  1823.     NumSPCBKeys  :  pUlong;                    // # of entries buffer on input,
  1824.                                                //  # of SPCB key on output.
  1825.   end;
  1826.   pParm_EnumProt = ^Parm_EnumProt;
  1827.  
  1828. //**************************************************************************
  1829. const
  1830.   SHC_NEGOTIATE_RESULT          = 15;
  1831.  
  1832. type
  1833.   Parm_Negotiate = record                      // shcneg
  1834.     ulFunction   :  uLong;                     // Handler command function
  1835.     ID           :  hID;                       // handler ID
  1836.     Stream       :  hStream;                   // handle of stream instance
  1837.     SPCB         :  pSPCB;                     // Ptr to negotiated SPCB
  1838.     ErrorStatus  :  uLong;                     // On error, indicates which field in the
  1839.   end;
  1840.   pParm_Negotiate = ^Parm_Negotiate;
  1841.  
  1842. //**************************************************************************
  1843. const
  1844.   SHC_SENDMSG                   = 16;
  1845.  
  1846. type
  1847.   Parm_SndMsg = record                         // shcsndmsg
  1848.     ulFunction   :  uLong;                     // Handler command function
  1849.     ID           :  hID;                       // handler ID
  1850.     Stream       :  hStream;                   // handle of stream instance
  1851.     MsgType      :  uLong;                     // Stream handler message type
  1852.     Msg          :  Pointer;                   // Pointer to Message control block
  1853.   end;
  1854.   pParm_SndMsg = ^Parm_SndMsg;
  1855.  
  1856. //**************************************************************************
  1857.  
  1858. {----[ MCIOS2 ]----}
  1859.  
  1860. const
  1861.   MCI_TRUE                      = 1;
  1862.   MCI_FALSE                     = 0;
  1863.  
  1864.   // MCI command messages identifiers
  1865.   MCI_OPEN                      = 1;
  1866.   MCI_CLOSE                     = 2;
  1867.   MCI_ESCAPE                    = 3;
  1868.   MCI_PLAY                      = 4;
  1869.   MCI_SEEK                      = 5;
  1870.   MCI_STOP                      = 6;
  1871.   MCI_PAUSE                     = 7;
  1872.   MCI_INFO                      = 8;
  1873.   MCI_GETDEVCAPS                = 9;
  1874.   MCI_STATUS                    = 10;
  1875.   MCI_SPIN                      = 11;
  1876.   MCI_SET                       = 12;
  1877.   MCI_STEP                      = 13;
  1878.   MCI_RECORD                    = 14;
  1879.   MCI_SYSINFO                   = 15;
  1880.   MCI_SAVE                      = 16;
  1881.   MCI_CUE                       = 17;
  1882.   MCI_UPDATE                    = 18;
  1883.   MCI_SET_CUEPOINT              = 19;
  1884.   MCI_SET_POSITION_ADVISE       = 20;
  1885.   MCI_SET_SYNC_OFFSET           = 21;
  1886.   MCI_LOAD                      = 22;
  1887.   MCI_ACQUIREDEVICE             = 23;
  1888.   MCI_RELEASEDEVICE             = 24;
  1889.   MCI_MASTERAUDIO               = 25;
  1890.   MCI_GETTOC                    = 26;
  1891.   MCI_DEVICESETTINGS            = 27;
  1892.   MCI_CONNECTOR                 = 28;
  1893.   MCI_RESUME                    = 29;
  1894.   MCI_CONNECTORINFO             = 31;
  1895.   MCI_DEFAULT_CONNECTION        = 32;
  1896.   MCI_CONNECTION                = 33;
  1897.   MCI_GROUP                     = 34;
  1898.   MCI_CAPTURE                   = 40;
  1899.   MCI_FREEZE                    = 41;
  1900.   MCI_GETIMAGEBUFFER            = 42;
  1901.   MCI_GETIMAGEPALETTE           = 43;
  1902.   MCI_PUT                       = 44;
  1903.   MCI_REALIZE                   = 45;
  1904.   MCI_REWIND                    = 46;
  1905.   MCI_RESTORE                   = 47;
  1906.   MCI_SETIMAGEBUFFER            = 48;
  1907.   MCI_SETIMAGEPALETTE           = 49;
  1908.   MCI_UNFREEZE                  = 50;
  1909.   MCI_WHERE                     = 51;
  1910.   MCI_WINDOW                    = 52;
  1911.   MCI_DELETE                    = 53;
  1912.   MCI_CUT                       = 54;
  1913.   MCI_PASTE                     = 55;
  1914.   MCI_COPY                      = 56;
  1915.   MCI_REDO                      = 57;
  1916.   MCI_UNDO                      = 58;
  1917.   MCI_MIXNOTIFY                 = 59;
  1918.   MCI_SETTUNER                  = 60;
  1919.   MCI_MAX_COMMAND               = 60;
  1920.   MCI_USER_MESSAGES             = 2000;
  1921.  
  1922. type
  1923.   RECT = uLong;
  1924.   HDCT = uLong;
  1925.  
  1926. const
  1927.   // Special device ID for 'all'
  1928.   MCI_ALL_DEVICE_ID             = $FFFF;
  1929.  
  1930.   // MCI implementation limits
  1931.   MAX_DEVICE_NAME               = 20;
  1932.   MAX_ALIAS_NAME                = 20;
  1933.   MAX_PRODINFO                  = 40;
  1934.   MAX_EXTENSION_NAME            = 4;
  1935.   MAX_DEV_PARAMS                = 128;
  1936.   MAX_VERSION_NUMBER            = 6;
  1937.   MAX_PDD_NAME                  = 9;
  1938.   MAX_DLL_NAME                  = 260;
  1939.   MAX_CLASSES                   = 10;
  1940.   MAX_CONNECTORS                = 10;
  1941.   MAX_EXTENSIONS                = 25;
  1942.   MAX_TYPEBUFFER                = 256;
  1943.  
  1944.   // MCI Device Type Constants
  1945.   MCI_DEVTYPE_VIDEOTAPE         = 1;
  1946.   MCI_DEVTYPE_VIDEODISC         = 2;
  1947.   MCI_DEVTYPE_CD_AUDIO          = 3;
  1948.   MCI_DEVTYPE_DAT               = 4;
  1949.   MCI_DEVTYPE_AUDIO_TAPE        = 5;
  1950.   MCI_DEVTYPE_OTHER             = 6;
  1951.   MCI_DEVTYPE_WAVEFORM_AUDIO    = 7;
  1952.   MCI_DEVTYPE_SEQUENCER         = 8;
  1953.   MCI_DEVTYPE_AUDIO_AMPMIX      = 9;
  1954.   MCI_DEVTYPE_OVERLAY           = 10;
  1955.   MCI_DEVTYPE_ANIMATION         = 11;
  1956.   MCI_DEVTYPE_DIGITAL_VIDEO     = 12;
  1957.   MCI_DEVTYPE_SPEAKER           = 13;
  1958.   MCI_DEVTYPE_HEADPHONE         = 14;
  1959.   MCI_DEVTYPE_MICROPHONE        = 15;
  1960.   MCI_DEVTYPE_MONITOR           = 16;
  1961.   MCI_DEVTYPE_CDXA              = 17;
  1962.  
  1963.   // MCI Device Type Names
  1964.   MCI_DEVTYPE_VIDEOTAPE_NAME    = 'Videotape';
  1965.   MCI_DEVTYPE_VIDEODISC_NAME    = 'Videodisc';
  1966.   MCI_DEVTYPE_CD_AUDIO_NAME     = 'CDaudio';
  1967.   MCI_DEVTYPE_DAT_NAME          = 'DAT';
  1968.   MCI_DEVTYPE_AUDIO_TAPE_NAME   = 'Audiotape';
  1969.   MCI_DEVTYPE_OTHER_NAME        = 'Other';
  1970.   MCI_DEVTYPE_WAVEFORM_AUDIO_NAME = 'Waveaudio';
  1971.   MCI_DEVTYPE_SEQUENCER_NAME    = 'Sequencer';
  1972.   MCI_DEVTYPE_AUDIO_AMPMIX_NAME = 'Ampmix';
  1973.   MCI_DEVTYPE_OVERLAY_NAME      = 'Overlay';
  1974.   MCI_DEVTYPE_ANIMATION_NAME    = 'Animation';
  1975.   MCI_DEVTYPE_DIGITAL_VIDEO_NAME= 'Digitalvideo';
  1976.   MCI_DEVTYPE_SPEAKER_NAME      = 'Speaker';
  1977.   MCI_DEVTYPE_HEADPHONE_NAME    = 'Headphone';
  1978.   MCI_DEVTYPE_MICROPHONE_NAME   = 'Microphone';
  1979.   MCI_DEVTYPE_MONITOR_NAME      = 'Monitor';
  1980.   MCI_DEVTYPE_CDXA_NAME         = 'CDXA';
  1981.  
  1982.   MCI_MAX_SYSTEM_DEVICE_NAMES   = 17;
  1983.  
  1984.   // GetDevCaps, set, and status item base values
  1985.   MCI_AMP_ITEM_BASE             = $1000;
  1986.   MCI_CD_ITEM_BASE              = $2000;
  1987.   MCI_CDXA_ITEM_BASE            = $3000;
  1988.   MCI_VD_ITEM_BASE              = $4000;
  1989.   MCI_SEQ_ITEM_BASE             = $5000;
  1990.   MCI_WAVE_ITEM_BASE            = $6000;
  1991.   MCI_VID_ITEM_BASE             = $7000;
  1992.   MCI_DGV_ITEM_BASE             = $8000;
  1993.   MCI_OVLY_ITEM_BASE            = $9000;
  1994.  
  1995.   // Flags for mciDriverNotify
  1996.   MCI_NOTIFY_SUCCESSFUL         = $0000;
  1997.   MCI_NOTIFY_SUPERSEDED         = $0001;
  1998.   MCI_NOTIFY_ABORTED            = $0002;
  1999.   MCI_NOTIFY_ERROR              = $0003;
  2000.  
  2001.   // mciDriverNotify Message Types
  2002.   MM_MCINOTIFY                  = $0500;
  2003.   MM_MCIPASSDEVICE              = $0501;
  2004.   MM_MCIPOSITIONCHANGE          = $0502;
  2005.   MM_MCICUEPOINT                = $0503;
  2006.   MM_MCIPLAYLISTMESSAGE         = $0504;
  2007.   MM_MCIEVENT                   = $0505;
  2008.   MM_MCISYNCH                   = $0506;
  2009.  
  2010.   MCI_LOSING_USE                = $00000001;
  2011.   MCI_GAINING_USE               = $00000002;
  2012.  
  2013.   // Common message flags. $00000$x are reserved for common flags.
  2014.   MCI_NOTIFY                    = $00000001;
  2015.   MCI_WAIT                      = $00000002;
  2016.   MCI_FROM                      = $00000004;
  2017.   MCI_TO                        = $00000008;
  2018.   MCI_MILLISECONDS              = $00000010;
  2019.   MCI_TRACK                     = $00000020;
  2020.   MCI_OVER                      = $00000040;
  2021.   MCI_TEST                      = $00000080;
  2022.   MCI_TO_BUFFER                 = $00000100;
  2023.   MCI_FROM_BUFFER               = $00000200;
  2024.   MCI_CONVERT_FORMAT            = $00000400;
  2025.  
  2026.   // Time formats
  2027.   MCI_FORMAT_MILLISECONDS       = $00000001;
  2028.   MCI_FORMAT_mmTime             = $00000002;
  2029.   MCI_FORMAT_MSF                = $00000005;
  2030.   MCI_FORMAT_TMSF               = $00000006;
  2031.   MCI_FORMAT_CHAPTERS           = $00000007;
  2032.   MCI_FORMAT_FRAMES             = $00000008;
  2033.   MCI_FORMAT_HMS                = $00000009;
  2034.   MCI_FORMAT_TRACKS             = $0000000A;
  2035.   MCI_FORMAT_BYTES              = $0000000B;
  2036.   MCI_FORMAT_SAMPLES            = $0000000C;
  2037.   MCI_FORMAT_HMSF               = $0000000D;
  2038.   MCI_FORMAT_SET_SMPTE_24       = $0000000E;
  2039.   MCI_FORMAT_SET_SMPTE_25       = $0000000F;
  2040.   MCI_FORMAT_SET_SMPTE_30       = $00000010;
  2041.   MCI_FORMAT_SET_SMPTE_30DROP   = $00000011;
  2042.   MCI_FORMAT_SET_SONGPTR        = $00000012;
  2043.   MCI_FORMAT_uSec               = $00000013;
  2044.  
  2045.   // Speed formats
  2046.   MCI_FORMAT_PERCENTAGE         = $00000003;
  2047.   MCI_FORMAT_FPS                = $00000004;
  2048.  
  2049. // Time format conversion macros
  2050. function mSecToMM(Value: Cardinal): mmTime; inline;
  2051. begin
  2052.   If Value > $FFFFFFFF div 3 then
  2053.     Result := 0
  2054.   else
  2055.     Result := Value div 3;
  2056. end;
  2057.  
  2058. function mSecFromMM(Value: mmTime): uLong; inline;
  2059. begin
  2060.   Result := (Value+1) div 3;
  2061. end;
  2062.  
  2063. function RedBookToMM(Value: Cardinal): mmTime; inline;
  2064. begin
  2065.   Result := ( Value and $0000FF ) * 60 * 3000 +
  2066.             ( Value and $00FF00 ) * $100 * 3000 +
  2067.             ( Value and $FF0000 ) * $10000 * 3000 div 75;
  2068.  
  2069. end;
  2070.  
  2071. function fps24ToMM(Value: Cardinal): mmTime; inline;
  2072. begin
  2073.   Result := ( Value and $000000FF ) * 60 * 60 * 3000 +
  2074.             ( Value and $0000FF00 ) * $100 * 60 * 3000 +
  2075.             ( Value and $00FF0000 ) * $10000 * 3000 +
  2076.             ( Value and $FF000000 ) * $10000 * 3000 div 24;
  2077. end;
  2078.  
  2079. function fps25ToMM(Value: Cardinal): mmTime; inline;
  2080. begin
  2081.   Result := ( Value and $000000FF ) * 60 * 60 * 3000 +
  2082.             ( Value and $0000FF00 ) * $100 * 60 * 3000 +
  2083.             ( Value and $00FF0000 ) * $10000 * 3000 +
  2084.             ( Value and $FF000000 ) * $10000 * 3000 div 25;
  2085. end;
  2086.  
  2087. function fps30ToMM(Value: Cardinal): mmTime; inline;
  2088. begin
  2089.   Result := ( Value and $000000FF ) * 60 * 60 * 3000 +
  2090.             ( Value and $0000FF00 ) * $100 * 60 * 3000 +
  2091.             ( Value and $00FF0000 ) * $10000 * 3000 +
  2092.             ( Value and $FF000000 ) * $10000 * 3000 div 30;
  2093. end;
  2094.  
  2095. function HMSToMM(Value: Cardinal): mmTime; inline;
  2096. begin
  2097.   Result := ( Value and $0000FF ) * 60 * 60 * 3000 +
  2098.             ( Value and $00FF00 ) * $100 * 60 * 3000 +
  2099.             ( Value and $FF0000 ) * $10000 * 3000;
  2100.  
  2101. end;
  2102.  
  2103. // The +20 is used for rounding purposes.  It is derived by:
  2104. // 1/2 * ((300 MMTIME/SEC / (75 FRAMES/SEC)) = 20 MMTIME/HALF-FRAME
  2105. function RedBookFromMM(Value: mmTime): Cardinal; inline;
  2106. begin
  2107.   if Value+20 >= $100*60*3000 then
  2108.     Result := 0
  2109.   else
  2110.     Result := (Value+20) div (60*3000) +
  2111.               ((Value+20) mod ((60*3000) div 3000)) shl 8 +
  2112.               ((Value+20) div ((3000 div 75) mod 75)) shl 16;
  2113. end;
  2114.  
  2115. function FPS24FromMM(Value: mmTime): Cardinal; inline;
  2116. begin
  2117.   if Value+63 >= $A4CB8000 then // $100*60*60*3000 then
  2118.     Result := 0
  2119.   else
  2120.     Result := ((((Value+63) mod 3000) div (3000 div 24)) shl 24) and $FF000000 +
  2121.               ((((Value+63) div 3000) mod 60) shl 16) and $00FF0000 +
  2122.               (((((Value+63) div 3000) div 60) mod 60) shl 8) and $0000FF00 +
  2123.               ((((Value+63) div 3000) div 60) div 60) and $000000FF;
  2124. end;
  2125.  
  2126. function FPS25FromMM(value: mmTime): Cardinal; inline;
  2127. begin
  2128.   if Value+60 >= $A4CB8000 then // $100*60*60*3000
  2129.     Result := 0
  2130.   else
  2131.     Result := ((((Value+60) mod 3000) div (3000 div 25)) shl 24) and $FF000000 +
  2132.               ((((Value+60) div 3000) mod 60) shl 16) and $00FF0000 +
  2133.               (((((Value+60) div 3000) div 60) mod 60) shl 8) and $0000FF00 +
  2134.               ((((Value+60) div 3000) div 60) div 60) and $000000FF;
  2135. end;
  2136.  
  2137. function FPS30FromMM(value: mmTime): Cardinal; inline;
  2138. begin
  2139.   if Value+50 >= $A4CB8000 then // $100*60*60*3000
  2140.     Result := 0
  2141.   else
  2142.     Result := ((((Value+50) mod 3000) div (3000 div 30)) shl 24) and $FF000000 +
  2143.               ((((Value+50) div 3000) mod 60) shl 16) and $00FF0000 +
  2144.               (((((Value+50) div 3000) div 60) mod 60) shl 8) and $0000FF00 +
  2145.               ((((Value+50) div 3000) div 60) div 60) and $000000FF;
  2146. end;
  2147.  
  2148. function HMSFromMM(value: mmTime): Cardinal; inline;
  2149. begin
  2150.   if Value+50 >= $A4CB8000 then // $100*60*60*3000
  2151.     Result := 0
  2152.   else
  2153.     Result := (((( Value+50) div 3000) mod 60) shl 16) and $00FF0000 +
  2154.               (((((Value+50) div 3000) div 60) mod 60) shl 8) and $0000FF00 +
  2155.               (((( Value+50) div 3000) div 60) div 60) and $000000FF;
  2156. end;
  2157.  
  2158. function tmsf_track(time: mmTime): Byte; inline;
  2159. begin
  2160.   Result := byte(time);
  2161. end;
  2162.  
  2163. function tmsf_minute(time: mmTime): Byte; inline;
  2164. begin
  2165.   Result := pbyte(pchar(@time)+1)^;
  2166. end;
  2167.  
  2168. function tmsf_second(time: mmTime): Byte; inline;
  2169. begin
  2170.   Result := pbyte(pchar(@time)+2)^;
  2171. end;
  2172.  
  2173. function tmsf_frame(time: mmTime): Byte; inline;
  2174. begin
  2175.   Result := pbyte(pchar(@time)+3)^;
  2176. end;
  2177.  
  2178. function msf_minute(time: mmTime): Byte; inline;
  2179. begin
  2180.   Result := byte(time);
  2181. end;
  2182.  
  2183. function msf_second(time: mmTime): Byte; inline;
  2184. begin
  2185.   Result := pbyte(pchar(@time)+1)^;
  2186. end;
  2187.  
  2188. function msf_frame(time: mmTime): Byte; inline;
  2189. begin
  2190.   Result := pbyte(pchar(@time)+2)^;
  2191. end;
  2192.  
  2193. // Byte access with dWord macros
  2194. function uLong_lwlb(var ul): Byte; inline;  // Low word low byte
  2195. begin
  2196.   Result := uLong(ul);
  2197. end;
  2198.  
  2199. function uLong_lwhb(var ul): Byte; inline;  // Low word high byte
  2200. begin
  2201.   Result := pbyte(pchar(@ul)+1)^;
  2202. end;
  2203.  
  2204. function uLong_hwlb(var ul): Byte; inline;  // High word low byte
  2205. begin
  2206.   Result := pbyte(pchar(@ul)+2)^;
  2207. end;
  2208. function uLong_hwhb(var ul): Byte; inline;  // High word high byte
  2209. begin
  2210.   Result := pbyte(pchar(@ul)+3)^;
  2211. end;
  2212.  
  2213. function uLong_lowd(var ul): SmallWord; inline;  // Low word
  2214. begin
  2215.   Result := pSmallWord(pchar(@ul))^;
  2216. end;
  2217.  
  2218. function uLong_hiwd(var ul): SmallWord; inline;  // High word
  2219. begin
  2220.   Result := pSmallWord(pchar(@ul)+Sizeof(SmallWord))^;
  2221. end;
  2222.  
  2223. // Parameters for default command messages with empty parameter lists
  2224. type
  2225.   mci_Generic_Parms = record
  2226.     hwndCallback : hwnd;
  2227.   end;
  2228.   pmci_Generic_Parms = ^mci_Generic_Parms;
  2229.  
  2230. const
  2231.   // Flags for the MCI_ACQUIREDEVICE message
  2232.   //     $0000$00 are reserved for MCI_ACQUIREDEVICE flags
  2233.   MCI_EXCLUSIVE                 = $00000100;
  2234.   MCI_EXCLUSIVE_INSTANCE        = $00000200;
  2235.   MCI_ACQUIRE_QUEUE             = $00000400;
  2236.  
  2237.   // flags for the MCI_CAPTURE message
  2238.   //   $000$X00 are reserved for MCI_CAPTURE flags
  2239.   //   MCI_CONVERT is used by MCI_GETIMAGEBUFFER, MCI_SETIMAGEBUFFER
  2240.   //                          MCI_CAPTURE, and MCI_RESTORE
  2241.   MCI_CAPTURE_RECT              = $00000100;
  2242.   MCI_CONVERT                   = $00001000;
  2243.  
  2244. type
  2245.   // Parameter structure for the MCI_CAPTURE message
  2246.   mci_Capture_Parms = record
  2247.     hwndCallback : hwnd;
  2248.     Rect         : RectL;
  2249.   end;
  2250.   pmci_Capture_Parms = ^mci_Capture_Parms;
  2251.  
  2252. const
  2253.   // Flags for MCI_CONNECTOR and MCI_CONNECTION messages
  2254.   MCI_ENABLE_CONNECTOR          = $00000100;
  2255.   MCI_DISABLE_CONNECTOR         = $00000200;
  2256.   MCI_QUERY_CONNECTOR_STATUS    = $00000400;
  2257.   MCI_CONNECTOR_TYPE            = $00000800;
  2258.   MCI_CONNECTOR_INDEX           = $00001000;
  2259.   MCI_TO_CONNECTOR_INDEX        = $00002000;
  2260.   MCI_TO_CONNECTOR_TYPE         = $00004000;
  2261.   MCI_QUERY_CONNECTION          = $00008000;
  2262.   MCI_MAKE_CONNECTION           = $00010000;
  2263.   MCI_BREAK_CONNECTION          = $00020000;
  2264.   MCI_ENUMERATE_CONNECTORS      = $00040000;
  2265.   MCI_QUERY_CONNECTOR_TYPE      = $00080000;
  2266.   MCI_QUERY_VALID_CONNECTION    = $00100000;
  2267.   MCI_CONNECTOR_ALIAS           = $00200000;
  2268.  
  2269.   // Connector types
  2270.   MCI_MIDI_STREAM_CONNECTOR     = $00000001;
  2271.   MCI_CD_STREAM_CONNECTOR       = $00000002;
  2272.   MCI_WAVE_STREAM_CONNECTOR     = $00000003;
  2273.   MCI_AMP_STREAM_CONNECTOR      = $00000004;
  2274.   MCI_XA_STREAM_CONNECTOR       = $00000005;
  2275.   MCI_HEADPHONES_CONNECTOR      = $00000006;
  2276.   MCI_SPEAKERS_CONNECTOR        = $00000007;
  2277.   MCI_MICROPHONE_CONNECTOR      = $00000008;
  2278.   MCI_LINE_IN_CONNECTOR         = $00000009;
  2279.   MCI_LINE_OUT_CONNECTOR        = $0000000a;
  2280.   MCI_VIDEO_IN_CONNECTOR        = $0000000b;
  2281.   MCI_VIDEO_OUT_CONNECTOR       = $0000000c;
  2282.   MCI_PHONE_SET_CONNECTOR       = $0000000d;
  2283.   MCI_PHONE_LINE_CONNECTOR      = $0000000e;
  2284.   MCI_AUDIO_IN_CONNECTOR        = $0000000f;
  2285.   MCI_AUDIO_OUT_CONNECTOR       = $00000010;
  2286.   MCI_UNIVERSAL_CONNECTOR       = $00000011;
  2287.  
  2288. type
  2289.   // Parameter structure for the MCI_CONNECTION message
  2290.   mci_Connection_Parms = record
  2291.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2292.     ulConnectorType  : uLong;                  // Connector type
  2293.     ulConnectorIndex : uLong;                  // Connector index
  2294.     pszAlias         : pChar;                  // Connection device alias
  2295.     usToDeviceID     : uShort;                 // Connected to device ID
  2296.     usReserved0      : uShort;                 // Reserved field
  2297.     ulReserved1      : uLong;                  // Reserved field
  2298.     ulReserved2      : uLong;                  // Reserved field
  2299.   end;
  2300.   pmci_Connection_Parms = ^mci_Connection_Parms;
  2301.  
  2302.   // Parameter structure for the MCI_CONNECTOR message
  2303.   mci_Connector_Parms = record
  2304.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2305.     ulReturn         : uLong;                  // Return information
  2306.     ulConnectorType  : uLong;                  // If specified, ulConnectorIndex is relative
  2307.                                                // to the specified connector type
  2308.     ulConnectorIndex : uLong;                  // Connector number
  2309.   end;
  2310.   pmci_Connector_Parms = ^mci_Connector_Parms;
  2311.  
  2312.   // Parameter structure for the MCI_CONNECTORINFO message
  2313.   mci_ConnectorInfo_Parms = record
  2314.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2315.     ulReturn         : uLong;                  // Return information
  2316.     ulDeviceTypeID   : uLong;                  // MCI device type
  2317.     ulConnectorType  : uLong;                  // If specified, ulConnectorIndex is relative
  2318.                                                // to the specified connector type
  2319.     ulConnectorIndex : uLong;                  // Connector number
  2320.     ulToConnectorType: uLong;                  // Connector type to test if
  2321.                                                // MCI_QUERY_VALID_CONNECTION is specified
  2322.   end;
  2323.   pmci_ConnectorInfo_Parms = ^mci_ConnectorInfo_Parms;
  2324.  
  2325. const
  2326.   // Flags for the MCI_CUE message
  2327.   //  $0000$00 are reserved for MCI_CUE flags
  2328.   MCI_CUE_INPUT                 = $00000100;
  2329.   MCI_CUE_OUTPUT                = $00000200;
  2330.   // Additional flags for Wave Audio for MCI_CUE
  2331.   MCI_WAVE_INPUT                = $00001000;
  2332.   MCI_WAVE_OUTPUT               = $00002000;
  2333.  
  2334. type
  2335.   // Parameter structure for the MCI_DEFAULT_CONNECTION message
  2336.   mci_Default_Connection_Parms = record
  2337.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2338.     pszDevice        : pChar;                  // Device name
  2339.     ulConnectorType  : uLong;                  // If specified, ulConnectorIndex is relative
  2340.                                                // to the specified connector type
  2341.     ulConnectorIndex : uLong;                  // Connector number
  2342.     pszToDevice      : pChar;                  // Return device name to which the connection exists
  2343.     ulToConnectorType: uLong;                  // Connector type
  2344.     ulToConnectorIndex:uLong;                  // Connector number
  2345.   end;
  2346.   pmci_Default_Connection_Parms = ^mci_Default_Connection_Parms;
  2347.  
  2348.   // Parameter structure for the MCI_DEVICESETTINGS message
  2349.   mci_DeviceSettings_Parms = record
  2350.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2351.     hwndNotebook     : hwnd;                   // Hwhd to notebook window
  2352.     usDeviceType     : uShort;                 // Device type
  2353.     pszDeviceName    : pChar;                  // Device name
  2354.   end;
  2355.   pmci_DeviceSettings_Parms = ^mci_DeviceSettings_Parms;
  2356.  
  2357.   // Parameter structure for the MCI_CUT / COPY / DELETE / UNDO / etc.
  2358.   mci_Edit_Parms = record
  2359.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2360.     ulStructLen      : uLong;                  // Length of the Structure
  2361.     ulFrom           : uLong;                  // Beginning Point of Range
  2362.     ulTo             : uLong;                  // ending point of range
  2363.     pBuff            : Pointer;                // user buffer
  2364.     ulBufLen         : uLong;                  // length of user buffer
  2365.     pHeader          : Pointer;                // header which describes the buffer
  2366.   end;
  2367.   pmci_Edit_Parms = ^mci_Edit_Parms;
  2368.  
  2369. const
  2370.   // flags and parameter structure for the MCI_ESCAPE message
  2371.   //     $0000$00 are reserved for MCI_ESCAPE flags
  2372.   mci_Escape_String             = $00000100;
  2373.  
  2374. type
  2375.   mci_Escape_Parms = record
  2376.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2377.     pszCommand       : pChar;                  // Command to send to the device
  2378.   end;
  2379.   pmci_Escape_Parms = ^mci_Escape_Parms;
  2380.  
  2381. const
  2382.   // Flags for the MCI_FREEZE message
  2383.   //  $000$X00 are reserved for MCI_FREEZE flags
  2384.   MCI_OVLY_FREEZE_RECT          = $00000100;
  2385.   MCI_OVLY_FREEZE_RECT_OUTSIDE  = $00000200;
  2386.  
  2387.   // Flags for the MCI_GETDEVCAPS message
  2388.   //   $0$XXX00 are reserved for MCI_GETDEVCAPS flags
  2389.   MCI_GETDEVCAPS_MESSAGE        = $00000100;
  2390.   MCI_GETDEVCAPS_ITEM           = $00000200;
  2391.   MCI_GETDEVCAPS_EXTENDED       = $00000400;
  2392.  
  2393.   // General MCI_GETDEVCAPS item values
  2394.   MCI_GETDEVCAPS_CAN_EJECT                                                = $00000001;
  2395.   MCI_GETDEVCAPS_CAN_LOCKEJECT  = $00000002;
  2396.   MCI_GETDEVCAPS_CAN_PLAY       = $00000003;
  2397.   MCI_GETDEVCAPS_CAN_PROCESS_INTERNAL = $00000004;
  2398.   MCI_GETDEVCAPS_CAN_RECORD     = $00000005;
  2399.   MCI_GETDEVCAPS_CAN_RECORD_INSERT    = $00000006;
  2400.   MCI_GETDEVCAPS_CAN_SAVE       = $00000007;
  2401.   MCI_GETDEVCAPS_CAN_SETVOLUME  = $00000008;
  2402.   MCI_GETDEVCAPS_CAN_STREAM     = $00000009;
  2403.   MCI_GETDEVCAPS_DEVICE_TYPE    = $0000000A;
  2404.   MCI_GETDEVCAPS_HAS_AUDIO      = $0000000B;
  2405.   MCI_GETDEVCAPS_HAS_VIDEO      = $0000000C;
  2406.   MCI_GETDEVCAPS_PREROLL_TIME   = $0000000D;
  2407.   MCI_GETDEVCAPS_PREROLL_TYPE   = $0000000E;
  2408.   MCI_GETDEVCAPS_USES_FILES     = $0000000F;
  2409.   MCI_GETDEVCAPS_HAS_IMAGE      = $00000010;
  2410.   MCI_GETDEVCAPS_WAVE_FORMAT    = $00000011;
  2411.  
  2412.   // Return ID's for videodisc MCI_GETDEVCAPS
  2413.   MCI_VD_MEDIA_CLV=$00000001;
  2414.   MCI_VD_MEDIA_CAV=$00000002;
  2415.   MCI_VD_MEDIA_OTHER=$00000003;
  2416.  
  2417.   // MCI_GETDEVCAPS item values for video devices
  2418.   MCI_VID_GETDEVCAPS_CAN_STRETCH         = MCI_VID_ITEM_BASE;
  2419.   MCI_VID_GETDEVCAPS_CAN_DISTORT         = MCI_VID_ITEM_BASE+1;
  2420.   MCI_VID_GETDEVCAPS_VIDEO_X_EXTENT      = MCI_VID_ITEM_BASE+2;
  2421.   MCI_VID_GETDEVCAPS_VIDEO_Y_EXTENT      = MCI_VID_ITEM_BASE+3;
  2422.   MCI_VID_GETDEVCAPS_IMAGE_X_EXTENT      = MCI_VID_ITEM_BASE+4;
  2423.   MCI_VID_GETDEVCAPS_IMAGE_Y_EXTENT      = MCI_VID_ITEM_BASE+5;
  2424.   MCI_VID_GETDEVCAPS_MAX_WINDOWS         = MCI_VID_ITEM_BASE+6;
  2425.   MCI_VID_GETDEVCAPS_CAN_FREEZE          = MCI_VID_ITEM_BASE+7;
  2426.   MCI_VID_GETDEVCAPS_OVERLAY_GRAPHICS    = MCI_VID_ITEM_BASE+8;
  2427.   MCI_VID_GETDEVCAPS_CAN_REVERSE         = MCI_VID_ITEM_BASE+9;
  2428.   MCI_VID_GETDEVCAPS_FAST_RATE           = MCI_VID_ITEM_BASE+10;
  2429.   MCI_VID_GETDEVCAPS_SLOW_RATE           = MCI_VID_ITEM_BASE+11;
  2430.   MCI_VID_GETDEVCAPS_NORMAL_RATE         = MCI_VID_ITEM_BASE+12;
  2431.   MCI_VID_GETDEVCAPS_MINIMUM_RATE        = MCI_VID_ITEM_BASE+13;
  2432.   MCI_VID_GETDEVCAPS_MAXIMUM_RATE        = MCI_VID_ITEM_BASE+14;
  2433.  
  2434.   // MCI_GETDEVCAPS flag values for Videodisc
  2435.   MCI_VD_GETDEVCAPS_CLV                  = $00000400;
  2436.   MCI_VD_GETDEVCAPS_CAV                  = $00000800;
  2437.  
  2438.   // MCI_GETDEVCAPS item values for Videodisc
  2439.   MCI_VD_GETDEVCAPS_CAN_REVERSE          = MCI_VID_GETDEVCAPS_CAN_REVERSE;
  2440.   MCI_VD_GETDEVCAPS_FAST_RATE            = MCI_VID_GETDEVCAPS_FAST_RATE;
  2441.   MCI_VD_GETDEVCAPS_SLOW_RATE            = MCI_VID_GETDEVCAPS_SLOW_RATE;
  2442.   MCI_VD_GETDEVCAPS_NORMAL_RATE          = MCI_VID_GETDEVCAPS_NORMAL_RATE;
  2443.   MCI_VD_GETDEVCAPS_MINIMUM_RATE         = MCI_VID_GETDEVCAPS_MINIMUM_RATE;
  2444.   MCI_VD_GETDEVCAPS_MAXIMUM_RATE         = MCI_VID_GETDEVCAPS_MAXIMUM_RATE;
  2445.  
  2446.   // MCI_GETDEVCAPS item values for Digital Video
  2447.   MCI_DGV_GETDEVCAPS_CAN_REVERSE         = MCI_VID_GETDEVCAPS_CAN_REVERSE;
  2448.   MCI_DGV_GETDEVCAPS_CAN_STRETCH         = MCI_VID_GETDEVCAPS_CAN_STRETCH;
  2449.   MCI_DGV_GETDEVCAPS_CAN_DISTORT         = MCI_VID_GETDEVCAPS_CAN_DISTORT;
  2450.   MCI_DGV_GETDEVCAPS_FAST_RATE           = MCI_VID_GETDEVCAPS_FAST_RATE;
  2451.   MCI_DGV_GETDEVCAPS_SLOW_RATE           = MCI_VID_GETDEVCAPS_SLOW_RATE;
  2452.   MCI_DGV_GETDEVCAPS_NORMAL_RATE         = MCI_VID_GETDEVCAPS_NORMAL_RATE;
  2453.   MCI_DGV_GETDEVCAPS_MINIMUM_RATE        = MCI_VID_GETDEVCAPS_MINIMUM_RATE;
  2454.   MCI_DGV_GETDEVCAPS_MAXIMUM_RATE        = MCI_VID_GETDEVCAPS_MAXIMUM_RATE;
  2455.   MCI_DGV_GETDEVCAPS_VIDEO_X_EXTENT      = MCI_VID_GETDEVCAPS_VIDEO_X_EXTENT;
  2456.   MCI_DGV_GETDEVCAPS_VIDEO_Y_EXTENT      = MCI_VID_GETDEVCAPS_VIDEO_Y_EXTENT;
  2457.   MCI_DGV_GETDEVCAPS_IMAGE_X_EXTENT      = MCI_VID_GETDEVCAPS_IMAGE_X_EXTENT;
  2458.   MCI_DGV_GETDEVCAPS_IMAGE_Y_EXTENT      = MCI_VID_GETDEVCAPS_IMAGE_Y_EXTENT;
  2459.   MCI_DGV_GETDEVCAPS_MAX_WINDOWS         = MCI_VID_GETDEVCAPS_MAX_WINDOWS;
  2460.   MCI_DGV_GETDEVCAPS_OVERLAY_GRAPHICS    = MCI_VID_GETDEVCAPS_OVERLAY_GRAPHICS;
  2461.   MCI_DGV_GETDEVCAPS_HAS_TUNER           = MCI_DGV_ITEM_BASE;
  2462.   MCI_DGV_GETDEVCAPS_HAS_TELETEX         = MCI_DGV_ITEM_BASE+1;
  2463.   MCI_DGV_GETDEVCAPS_HAS_AFC             = MCI_DGV_ITEM_BASE+2;
  2464.  
  2465.   // MCI_GETDEVCAPS item values for Video Overlay
  2466.   MCI_OVLY_GETDEVCAPS_CAN_STRETCH        = MCI_VID_GETDEVCAPS_CAN_STRETCH;
  2467.   MCI_OVLY_GETDEVCAPS_CAN_DISTORT        = MCI_VID_GETDEVCAPS_CAN_DISTORT;
  2468.   MCI_OVLY_GETDEVCAPS_VIDEO_X_EXTENT     = MCI_VID_GETDEVCAPS_VIDEO_X_EXTENT;
  2469.   MCI_OVLY_GETDEVCAPS_VIDEO_Y_EXTENT     = MCI_VID_GETDEVCAPS_VIDEO_Y_EXTENT;
  2470.   MCI_OVLY_GETDEVCAPS_IMAGE_X_EXTENT     = MCI_VID_GETDEVCAPS_IMAGE_X_EXTENT;
  2471.   MCI_OVLY_GETDEVCAPS_IMAGE_Y_EXTENT     = MCI_VID_GETDEVCAPS_IMAGE_Y_EXTENT;
  2472.   MCI_OVLY_GETDEVCAPS_MAX_WINDOWS        = MCI_VID_GETDEVCAPS_MAX_WINDOWS;
  2473.   MCI_OVLY_GETDEVCAPS_CAN_FREEZE         = MCI_VID_GETDEVCAPS_CAN_FREEZE;
  2474.   MCI_OVLY_GETDEVCAPS_OVERLAY_GRAPHICS   = MCI_VID_GETDEVCAPS_OVERLAY_GRAPHICS;
  2475.  
  2476.   MCI_PREROLL_NOTIFIED                   = $00000001;
  2477.   MCI_PREROLL_DETERMINISTIC              = $00000002;
  2478.   MCI_PREROLL_NONE                       = $00000003;
  2479.  
  2480. type
  2481.   // Parameter structure for the MCI_GETDEVCAPS message
  2482.   mci_GetDevCaps_Parms = record
  2483.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2484.     ulReturn         : uLong;                  // Return field
  2485.     ulItem           : uLong;                  // Item field for GETDEVCAPS item to query
  2486.     usMessage        : uShort;                 // Field to hold MCI message to query
  2487.     usReserved0      : uShort;                 // Reserved field
  2488.   end;
  2489.   pmci_GetDevCaps_Parms = ^mci_GetDevCaps_Parms;
  2490.  
  2491.   // Parameter structure for the MCI_WAVE_GETDEVCAPS
  2492.   mci_Wave_GetDevCaps_Parms = record
  2493.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2494.     ulReturn         : uLong;                  // Return field
  2495.     ulItem           : uLong;                  // Item field for GETDEVCAPS item to query
  2496.     usMessage        : uShort;                 // Field to hold MCI message to query
  2497.     usReserved0      : uShort;                 // Reserved field
  2498.     ulLength         : uLong;                  // Length of structure in ULONGS
  2499.     ulBitsPerSample  : uLong;                  // Number of Bits per Sample
  2500.     ulFormatTag      : uLong;                  // Format Tag
  2501.     ulSamplesPerSec  : uLong;                  // Sampling Rate
  2502.     ulChannels       : uLong;                  // Number of channels
  2503.     ulFormatMode     : uLong;                  // Either MCI_RECORD or MCI_PLAY
  2504.   end;
  2505.   pmci_Wave_GetDevCaps_Parms = ^mci_Wave_GetDevCaps_Parms;
  2506.  
  2507. const
  2508.   // General MCI_SET item values
  2509.   MCI_SET_MONITOR                 = $00000001;
  2510.   MCI_SET_MONITOR_AUDIO           = $00000002;
  2511.   MCI_SET_MONITOR_VIDEO           = $00000003;
  2512.   MCI_SET_RECORD                  = $00000004;
  2513.  
  2514.   // MCI_SET flags for amp/mixer;
  2515.   MCI_AMP_SET_BALANCE             = $00100000;
  2516.   MCI_AMP_SET_PITCH               = $00200000;
  2517.   MCI_AMP_SET_TREBLE              = $00400000;
  2518.   MCI_AMP_SET_BASS                = $00800000;
  2519.   MCI_AMP_SET_GAIN                = $01000000;
  2520.   MCI_AMP_SET_ALC                 = $00000004;
  2521.   MCI_AMP_SET_AUDIO               = $00000008;
  2522.   MCI_AMP_SET_CROSSOVER           = $00000010;
  2523.   MCI_AMP_SET_LOUDNESS            = $00000020;
  2524.   MCI_AMP_SET_MUTE                = $00000040;
  2525.   MCI_AMP_SET_REVERB              = $00000080;
  2526.   MCI_AMP_SET_STEREOENHANCE       = $00000100;
  2527.   MCI_AMP_SET_CUSTOM1             = $00000200;
  2528.   MCI_AMP_SET_CUSTOM2             = $00000400;
  2529.   MCI_AMP_SET_CUSTOM3             = $00000800;
  2530.   MCI_AMP_SET_LRVOLUME            = $00001000;
  2531.   MCI_AMP_SET_MID                 = $00020000;
  2532.   MCI_AMP_SET_CHORUS              = $00004000;  // typo? 40000?
  2533.   MCI_AMP_SET_VOLUME              = $00080000;  // MCI_SET_VOLUME;
  2534.   MCI_AMP_SET_MONITOR             = MCI_SET_MONITOR_AUDIO;
  2535.  
  2536.   // Potential values for the ulValue field of MCI_AMP_GETDEVCAPS
  2537.   MCI_AMP_CAN_SET_MONITOR         = MCI_AMP_SET_MONITOR;
  2538.   MCI_AMP_CAN_SET_BALANCE         = MCI_AMP_SET_BALANCE;
  2539.   MCI_AMP_CAN_SET_ALC             = MCI_AMP_SET_ALC;
  2540.   MCI_AMP_CAN_SET_CROSSOVER       = MCI_AMP_SET_CROSSOVER;
  2541.   MCI_AMP_CAN_SET_LOUDNESS        = MCI_AMP_SET_LOUDNESS;
  2542.   MCI_AMP_CAN_SET_MUTE            = MCI_AMP_SET_MUTE;
  2543.   MCI_AMP_CAN_SET_REVERB          = MCI_AMP_SET_REVERB;
  2544.   MCI_AMP_CAN_SET_STEREOENHANCE   = MCI_AMP_SET_STEREOENHANCE;
  2545.   MCI_AMP_CAN_SET_CUSTOM1         = MCI_AMP_SET_CUSTOM1;
  2546.   MCI_AMP_CAN_SET_CUSTOM2         = MCI_AMP_SET_CUSTOM2;
  2547.   MCI_AMP_CAN_SET_CUSTOM3         = MCI_AMP_SET_CUSTOM3;
  2548.   MCI_AMP_CAN_SET_LRVOLUME        = MCI_AMP_SET_LRVOLUME;
  2549.   MCI_AMP_CAN_SET_BASS            = MCI_AMP_SET_BASS;
  2550.   MCI_AMP_CAN_SET_MID             = MCI_AMP_SET_MID;
  2551.   MCI_AMP_CAN_SET_TREBLE          = MCI_AMP_SET_TREBLE;
  2552.   MCI_AMP_CAN_SET_PITCH           = MCI_AMP_SET_PITCH;
  2553.   MCI_AMP_CAN_SET_GAIN            = MCI_AMP_SET_GAIN;
  2554.   MCI_AMP_CAN_SET_CHORUS          = MCI_AMP_SET_CHORUS;
  2555.   MCI_AMP_CAN_SET_VOLUME          = MCI_AMP_SET_VOLUME;
  2556.  
  2557.   // Potential values for the ulExtended field of MCI_AMP_GETDEVCAPS_PARMS
  2558.   MCI_MIXER_LINE                  = $00000001;
  2559.  
  2560. type
  2561.   // Parameter structure for the MCI_AMP_GETDEVCAPS
  2562.   mci_Amp_GetDevCaps_Parms = record
  2563.     hwndCallback  : uLong;                     // PM window handle for MCI notify message
  2564.     ulReturn      : uLong;                     // Return field
  2565.     ulItem        : uLong;                     // Item field for GETDEVCAPS item to query
  2566.     usMessage     : uShort;                    // Field to hold MCI message to query
  2567.     usReserved0   : uShort;                    // Reserved field
  2568.     ulLength      : uLong;                     // Length of structure in uLongS
  2569.     ulValue       : uLong;                     // Value to determine caps
  2570.     ulAttribute   : uLong;                     // Flags to modified the extended parms
  2571.     ulExtended    : uLong;                     // Extended flags field
  2572.   end;
  2573.   pmci_Amp_GetDevCaps_Parms = ^mci_Amp_GetDevCaps_Parms;
  2574.  
  2575. const
  2576.   // Values for the ulFlags field of MCI_MIXEVENT_PARMS
  2577.   MCI_MIX_ATTRIBUTE             = $00000001;
  2578.   MCI_MIX_CONNECTOR             = $00000002;
  2579.  
  2580.   // Values for the lParam field for mix_notify
  2581.   MCI_MIXNOTIFY_ON              = $00000004;
  2582.   MCI_MIXNOTIFY_OFF             = $00000008;
  2583.  
  2584.   // Value to indicate type of MM_MCIEVENT
  2585.   MCI_MIXEVENT                  = $00000001;
  2586.  
  2587. type
  2588.   // Parameter structure for the MCI_MIXEVENT_PARMS
  2589.   mci_MixEvent_Parms = record
  2590.     ulLength         : uLong;                  // Length of struct
  2591.     hwndMixer        : hwnd;                   // window to inform of mixer changes
  2592.     ulFlags          : uLong;                  // Either MCI_MIX_ATTRIBUTE
  2593.                                                //      or MCI_MIX_CONNECTOR
  2594.     usDeviceID       : uShort;                 // device id to notify of the change
  2595.     ulDeviceType     : uLong;                  // Device Type which generated the change
  2596.     ulDeviceOrdinal  : uLong;                  // Ordinal of device Type
  2597.     ulAttribute      : uLong;                  // Attribute that changed(volume, bass etc.)
  2598.     ulValue          : uLong;                  // new value of the attribute which changed
  2599.     ulConnectorType  : uLong;                  // Connector Type
  2600.     ulConnectorIndex : uLong;                  // Connector Index
  2601.     ulConnStatus     : uLong;                  // Is connector enabled/disabled.
  2602.   end;
  2603.   pmci_MixEvent_Parms = ^mci_MixEvent_Parms;
  2604.  
  2605. const
  2606.   // flag values for the MCI_GETIMAGEBUFFER and MCI_SETIMAGEBUFFER msg
  2607.   //   $000$X00 are reserved for MCI_GETIMAGEBUFFER and
  2608.   //     MCI_SETIMAGEBUFFER Flags
  2609.   //   MCI_CONVERT is defined by MCI_CAPTURE message as $00001000
  2610.   MCI_USE_HW_BUFFER             = $00000400;
  2611.   MCI_GET_HW_BUFFER_PTR         = $00000800;
  2612.  
  2613. type
  2614.   // parm structure for MCI_GETIMAGEBUFFER and
  2615.   //                    MCI_SETIMAGEBUFFER messages
  2616.   mci_Image_Parms = record
  2617.     hwndCallback       : hwnd;                 // PM window handle for MCI notify message
  2618.     ulPelFormat        : uLong;                // Format of the image data returned
  2619.     usBitCount         : uShort;               // Number of bitsimage data returned
  2620.     usReserved0        : uShort;               // Reserved field
  2621.     ulImageCompression : uLong;                //
  2622.     rect               : RectL;                // Image area to get/set
  2623.     pPelBuffer         : Pointer;              // Pel data buffer
  2624.     ulPelBufferHeight  : uLong;                // Number of rows in buffer
  2625.     ulPelBufferWidth   : uLong;                // Pels per row in buffer
  2626.     ulBufLen           : uLong;                // Pel data buffer length in bytes
  2627.   end;
  2628.   pmci_Image_Parms = ^mci_Image_Parms;
  2629.  
  2630. const
  2631.   // flags for the MCI_GETIMAGEPALETTE message
  2632.   //  $000$X00 are reserved for MCI_GETIMAGEPALETTE flags
  2633.   MCI_FIND_BEST_REGISTERED      = $00000100;
  2634.   MCI_QUERY_REGISTERED_MAP      = $00000200;
  2635.   MCI_QUERY_REGISTERED_MAP_SIZE = $00000400;
  2636.  
  2637. type
  2638.   // parameter structure for MCI_GETIMAGEPALETTE and
  2639.   //    MCI_SETIMAGEPALETTE messages
  2640.   mci_Palette_Parms = record
  2641.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2642.     usRegisteredMap  : uShort;                 // Id of the palette from the registed color map
  2643.     usReserved0      : uShort;                 // Reserved field
  2644.     ulPalEntries     : uLong;                  // size of the palette returned
  2645.     pPalette         : Pointer;                // pointer to the palette
  2646.   end;
  2647.   pmci_Palette_Parms = ^mci_Palette_Parms;
  2648.  
  2649.   // Parameter structure for the MCI_GETTOC message
  2650.   mci_Toc_Rec = record
  2651.     TrackNum         : BYTE;                   // Returned Track Number
  2652.     ulStartAddr      : uLong;                  // Starting address of the track in MMTIME format
  2653.     ulEndAddr        : uLong;                  // Ending address of the track in MMTIME format
  2654.     Control          : BYTE;                   // Track Control information
  2655.     usCountry        : uShort;                 // Country
  2656.     ulOwner          : uLong;                  // Owner
  2657.     ulSerialNum      : uLong;                  // Serial Number
  2658.   end;
  2659.   pTocRec = ^mci_Toc_Rec;
  2660.  
  2661.   mci_Toc_Parms = record
  2662.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2663.     pBuf             : pTocRec;                // Pointer to array MCI_TOC_REC structures to
  2664.                                                // be filled in by the mci device
  2665.     ulBufSize        : uLong;                  // Size of the array
  2666.   end;
  2667.   pmci_Toc_Parms = ^mci_Toc_Parms;
  2668.  
  2669. const
  2670.   // parameters for the MCI_GROUP message
  2671.   //     $0$XXX00 are reserved for MCI_GROUP flags
  2672.   MCI_SYNCHRONIZE               = $00000100;
  2673.   MCI_NOPIECEMEAL               = $00000200;
  2674.   MCI_GROUP_MAKE                = $00000400;
  2675.   MCI_GROUP_DELETE              = $00000800;
  2676.   MCI_GROUP_ALIAS               = $00001000;
  2677.   MCI_GROUP_MASTER              = $00002000;
  2678.   MCI_GROUP_NONE                = $00004000;   // No group!
  2679.  
  2680. type
  2681.   mci_Group_Parms = record
  2682.     hwndCallback                : hwnd;        // PM window handle for MCI notify message.
  2683.     usGroupID                   : uShort;      // GroupID
  2684.     usReserved0                 : uShort;      // RESERVED
  2685.     ulStructLength              : uLong;       // Length of Structure in ULONGS.
  2686.     usMasterID                  : uShort;      // ID of Master device in Synchrounous groups.
  2687.     usReserved1                 : uShort;      // RESERVED
  2688.     pszGroupAlias               : pChar;       // Pointer to Alias Name.
  2689.     ulNumDevices                : uLong;       // Number of Devices in group.
  2690.     paulDeviceID                : PuLong;      // Array of Device ids in the group.
  2691.   end;
  2692.   pmci_Group_Parms = ^mci_Group_Parms;
  2693.  
  2694. const
  2695.   // flags for the MCI_INFO message
  2696.   //     $0000$00 are reserved for MCI_INFO flags
  2697.   MCI_INFO_PRODUCT              = $00000100;
  2698.   MCI_INFO_FILE                 = $00000200;
  2699.  
  2700.   // CD Audio                MCI_INFO
  2701.   MCI_CD_INFO_ID                = $00010000;
  2702.   MCI_CD_INFO_UPC               = $00020000;
  2703.  
  2704.   // Videodisc               MCI_INFO
  2705.   MCI_VD_INFO_LABEL             = $00001000;
  2706.  
  2707.   // Digital Video           MCI_INFO
  2708.   MCI_DGV_INFO_VIDEO_FILE       = $00001000;
  2709.   MCI_DGV_INFO_IMAGE_FILE       = $00002000;
  2710.   MCI_DGV_INFO_REGION           = $00004000;
  2711.   MCI_DGV_INFO_REGION_TEXT      = $00008000;
  2712.   MCI_DGV_INFO_TEXT             = $00010000;
  2713.  
  2714.   // Video Overlay           MCI_INFO
  2715.   MCI_OVLY_INFO_TEXT            = $00010000;
  2716.  
  2717. type
  2718.   mci_Info_Parms = record
  2719.     hwndCallback      : hwnd;                  // PM window handle for MCI notify message
  2720.     pszReturn         : pChar;                 // Pointer to return buffer
  2721.     ulRetSize         : uLong;                 // Return buffer size
  2722.   end;
  2723.   pmci_Info_Parms = ^mci_Info_Parms;
  2724.  
  2725.   // Parameters and flags for the MCI_LOAD message
  2726.   //     $0000$00 are reserved for MCI_LOAD flags
  2727.   mci_Load_Parms = record
  2728.     hwndCallback      : hwnd;                  // PM window handle for MCI notify message
  2729.     pszElementName    : pChar;                 // File name to loads
  2730.   end;
  2731.   pmci_Load_Parms = ^mci_Load_Parms;
  2732.  
  2733. const
  2734.   // Parameters and flags for the MCI_MASTERAUDIO
  2735.   //     $00$XX00 are reserved for MCI_MASTERAUDIO flags
  2736.   MCI_ON                        = $00000100;
  2737.   MCI_OFF                       = $00000200;
  2738.   MCI_HEADPHONES                = $00000400;
  2739.   MCI_SPEAKERS                  = $00000800;
  2740.   MCI_MASTERVOL                 = $00001000;
  2741.   MCI_SAVESETTING               = $00002000;
  2742.   MCI_QUERYSAVEDSETTING         = $00004000;
  2743.   MCI_QUERYCURRENTSETTING       = $00008000;
  2744.  
  2745. type
  2746.   mci_MasterAudio_Parms = record
  2747.     hwndDummyCallback : hwnd;                  // Notify not allowed for this message
  2748.     ulReturn          : uLong;                 // Return field for query information
  2749.     ulMasterVolume    : uLong;                 // Master volume field
  2750.   end;
  2751.   pmci_MasterAudio_Parms = ^mci_MasterAudio_Parms;
  2752.  
  2753. const
  2754.   // Parameters and flags for the MCI_OPEN message
  2755.   //     $000$X00 are reserved for MCI_OPEN flags
  2756.   MCI_OPEN_ELEMENT              = $00000100;
  2757.   MCI_OPEN_ALIAS                = $00000200;
  2758.   MCI_OPEN_ELEMENT_ID           = $00000400;
  2759.   MCI_OPEN_PLAYLIST             = $00000800;
  2760.   MCI_OPEN_TYPE_ID              = $00001000;
  2761.   MCI_OPEN_SHAREABLE            = $00002000;
  2762.   MCI_OPEN_MMIO                 = $00004000;
  2763.   MCI_READONLY                  = $00008000;
  2764.  
  2765.   // Parameters and flags for the MCI_OPEN message
  2766.   // Digital Video, Video Overlay specific
  2767.   MCI_VID_OPEN_PARENT           = $01000000;
  2768.   MCI_DGV_OPEN_PARENT           = MCI_VID_OPEN_PARENT;
  2769.   MCI_OVLY_OPEN_PARENT          = MCI_VID_OPEN_PARENT;
  2770.  
  2771. type
  2772.   mci_Open_Parms = record
  2773.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2774.     usDeviceID       : uShort;                 // Device ID returned to user
  2775.     usReserved0      : uShort;                 // Reserved
  2776.     pszDeviceType    : pChar;                  // Device name from SYSTEM.INI
  2777.     pszElementName   : pChar;                  // Typically a file name or NULL
  2778.     pszAlias         : pChar;                  // Optional device alias
  2779.   end;
  2780.   pmci_Open_Parms = ^mci_Open_Parms;
  2781.  
  2782.   // Parameters for the AMP MCI_OPEN message
  2783.   mci_Amp_Open_Parms = record
  2784.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2785.     usDeviceID       : uShort;                 // Device ID returned to user
  2786.     usReserved0      : uShort;                 // Reserved field
  2787.     pszDeviceType    : pChar;                  // Device name from SYSTEM.INI
  2788.     pszElementName   : pChar;                  // Typically a file name or NULL
  2789.     pszAlias         : pChar;                  // Optional device alias
  2790.     pDevDataPtr      : Pointer;                // Pointer to device data
  2791.   end;
  2792.   pmci_Amp_Open_Parms = ^mci_Amp_Open_Parms;
  2793.  
  2794.   // Parameters for MCI_OPEN message for video devices
  2795.   mci_Vid_Open_Parms = record
  2796.     hwndCallback     : hwnd;                   // PM window handle for MCI notify message
  2797.     usDeviceID       : uShort;                 // Device ID returned to user
  2798.     usReserved0      : uShort;                 // Reserved field
  2799.     pszDeviceType    : pChar;                  // Device name from SYSTEM.INI
  2800.     pszElementName   : pChar;                  // Typically a file name or NULL
  2801.     pszAlias         : pChar;                  // Optional device alias
  2802.     hwndParent       : hwnd;                   // Parent window handle
  2803.   end;
  2804.   pmci_Vid_Open_Parms = ^mci_Vid_Open_Parms;
  2805.  
  2806.   mci_dgv_Open_Parms   = mci_Vid_Open_Parms;
  2807.   pmci_dgv_Open_Parms  = ^mci_dgv_Open_Parms;
  2808.  
  2809.   mci_Ovly_Open_Parms  = mci_Vid_Open_Parms;
  2810.   pmci_Ovly_Open_Parms = ^mci_Ovly_Open_Parms;
  2811.  
  2812. const
  2813.   // MCI_PLAY flag values for videodisc
  2814.   MCI_VD_PLAY_REVERSE           = $00001000;
  2815.   MCI_VD_PLAY_FAST              = $00002000;
  2816.   MCI_VD_PLAY_SPEED             = $00004000;
  2817.   MCI_VD_PLAY_SCAN              = $00008000;
  2818.   MCI_VD_PLAY_SLOW              = $00010000;
  2819.  
  2820.   // MCI_PLAY flag values for digital video
  2821.   MCI_DGV_PLAY_REVERSE          = $00001000;
  2822.   MCI_DGV_PLAY_FAST             = $00002000;
  2823.   MCI_DGV_PLAY_SPEED            = $00004000;
  2824.   MCI_DGV_PLAY_SCAN             = $00008000;
  2825.   MCI_DGV_PLAY_SLOW             = $00010000;
  2826.   MCI_DGV_PLAY_REPEAT           = $00020000;
  2827.  
  2828. type
  2829.   mci_Play_Parms = record
  2830.     hwndCallback      : hwnd;
  2831.     ulFrom            : uLong;
  2832.     ulTo              : uLong;
  2833.   end;
  2834.   pmci_Play_Parms = ^mci_Play_Parms;
  2835.  
  2836.   mci_VD_Play_Parms = record
  2837.     hwndCallback      : hwnd;
  2838.     ulFrom            : uLong;
  2839.     ulTo              : uLong;
  2840.     ulFactor          : uLong;
  2841.   end;
  2842.   pmci_VD_Play_Parms = ^mci_VD_Play_Parms;
  2843.  
  2844.   mci_DGV_play_Parms = record
  2845.     hwndCallback      : hwnd;
  2846.     ulFrom            : uLong;
  2847.     ulTo              : uLong;
  2848.     ulSpeed           : uLong;
  2849.   end;
  2850.   pmci_DGV_play_Parms = ^mci_DGV_play_Parms;
  2851.  
  2852. const
  2853.   // Parameters for the MCI_PUT  message
  2854.   //     $0000$00 are reserved for MCI_PUT  flags
  2855.   MCI_VID_PUT_RECT              = $00000100;
  2856.   MCI_VID_PUT_DESTINATION       = $00000200;
  2857.   MCI_VID_PUT_SOURCE            = $00000400;
  2858.   MCI_VID_PUT_WINDOW_MOVE       = $00000800;
  2859.   MCI_VID_PUT_WINDOW_SIZE       = $00001000;
  2860.  
  2861.   MCI_DGV_PUT_RECT              = MCI_VID_PUT_RECT;
  2862.   MCI_DGV_PUT_DESTINATION       = MCI_VID_PUT_DESTINATION;
  2863.   MCI_DGV_PUT_SOURCE            = MCI_VID_PUT_SOURCE;
  2864.   MCI_DGV_PUT_WINDOW_MOVE       = MCI_VID_PUT_WINDOW_MOVE;
  2865.   MCI_DGV_PUT_WINDOW_SIZE       = MCI_VID_PUT_WINDOW_SIZE;
  2866.   MCI_DGV_MONITOR               = $00010000;
  2867.   MCI_DGV_RECORD                = $00020000;
  2868.  
  2869.   MCI_OVLY_PUT_RECT             = MCI_VID_PUT_RECT;
  2870.   MCI_OVLY_PUT_DESTINATION      = MCI_VID_PUT_DESTINATION;
  2871.   MCI_OVLY_PUT_SOURCE           = MCI_VID_PUT_SOURCE;
  2872.   MCI_OVLY_PUT_WINDOW_MOVE      = MCI_VID_PUT_WINDOW_MOVE;
  2873.   MCI_OVLY_PUT_WINDOW_SIZE      = MCI_VID_PUT_WINDOW_SIZE;
  2874.  
  2875. type
  2876.   // Rectangle parameters for MCI_PUT, MCI_WHERE,
  2877.   // MCI_FREEZE, and MCI_UNFREEZE
  2878.   mci_Vid_Rect_Parms = record
  2879.     hwndCallback      : hwnd;                  // PM window handle for MCI notify message
  2880.     rc                : RectL;                 // rectangle array specifying the offset
  2881.                                                // and size of a rectangle
  2882.   end;
  2883.  
  2884.   mci_Dgv_Rect_Parms            = mci_Vid_Rect_Parms;
  2885.   pmci_Dgv_Rect_Parms           = ^mci_Dgv_Rect_Parms;
  2886.  
  2887.   mci_Ovly_Rect_Parms           = mci_Vid_Rect_Parms;
  2888.   pmci_Ovly_Rect_Parms          = ^mci_Ovly_Rect_Parms;
  2889.  
  2890. const
  2891.   // Parameters for the MCI_RECORD message
  2892.   //    $0000$00 are reserved for MCI_RECORD flags
  2893.   MCI_RECORD_INSERT             = $00000100;
  2894.   MCI_RECORD_OVERWRITE          = $00000200;
  2895.  
  2896.   MCI_DGV_RECORD_RECT           = $00000400;
  2897.  
  2898. type
  2899.   mci_Record_Parms = record
  2900.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  2901.     ulFrom                      : uLong;       // Record from position
  2902.     ulTo                        : uLong;       // Record to position
  2903.   end;
  2904.   pmci_Record_Parms = ^mci_Record_Parms;
  2905.  
  2906. const
  2907.   // Parameters for the MCI_RELEASEDEVICE message
  2908.   //     $XXXXXX00 are reserved for MCI_RELEASEDEVICE message
  2909.   MCI_RETURN_RESOURCE           = $00000100;
  2910.  
  2911.   // parameters for the MCI_RESTORE message
  2912.   //     $000$X00 are reserved for MCI_RESTORE flags
  2913.   //     MCI_CONVERT is defined by MCI_CAPTURE message as $00001000
  2914.   MCI_RESTORE_SRC_RECT          = $00000100;
  2915.   MCI_RESTORE_DEST_RECT         = $00000200;
  2916.  
  2917. type
  2918.   mci_Restore_Parms = record
  2919.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  2920.     SrcRect                     : RectL;       // Rectangle array specifying the source
  2921.                                                // area to be restored
  2922.     RestRect                    : RectL;       // Rectangle array specifying the destination
  2923.                                                // area to be restored
  2924.   end;
  2925.   pmci_Restore_Parms = ^mci_Restore_Parms;
  2926.  
  2927. const
  2928.   //  parameters for the MCI_SAVE  message
  2929.   //      $0000$00 are reserved for MCI_SAVE flags
  2930.   MCI_SAVE_FILE                 = $00000100;
  2931.  
  2932.   // Digital Video               MCI_SAVE
  2933.   MCI_DGV_SAVE_VIDEO_FILE       = $00001000;
  2934.   MCI_DGV_SAVE_IMAGE_FILE       = $00002000;
  2935.  
  2936. type
  2937.   mci_Save_Parms = record
  2938.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  2939.     pszFileName                 : pChar;       // Filename to save data to
  2940.   end;
  2941.   pmci_Save_Parms = ^mci_Save_Parms;
  2942.  
  2943. const
  2944.   // parameters for the MCI_SEEK message
  2945.   //     $0000$00 are reserved for MCI_SEEK flags
  2946.   MCI_TO_START                  = $00000100;
  2947.   MCI_TO_END                    = $00000200;
  2948.  
  2949.   // Digital Video               MCI_SEEK
  2950.  
  2951.   MCI_DGV_SEEK_TO_NEAREST_IFRAME = $00100000;
  2952.  
  2953.   // Videodisc                   MCI_SEEK
  2954.   MCI_VD_SEEK_REVERSE           = $00001000;
  2955.  
  2956. type
  2957.   mci_Seek_Parms = record
  2958.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  2959.     ulTo                        : uLong;       // Seek to this position
  2960.   end;
  2961.   pmci_Seek_Parms = ^mci_Seek_Parms;
  2962.  
  2963. const
  2964.   // Flags for the MCI_SET message
  2965.   //     $0$XXX00 are reserved for MCI_SET flags
  2966.   MCI_SET_ITEM                  = $00000100;
  2967.   MCI_SET_ON                    = $00000200;
  2968.   MCI_SET_OFF                   = $00000400;
  2969.   MCI_SET_VIDEO                 = $00000800;
  2970.   MCI_SET_AUDIO                 = $00001000;
  2971.   MCI_SET_DOOR_OPEN             = $00002000;
  2972.   MCI_SET_DOOR_CLOSED           = $00004000;
  2973.   MCI_SET_SPEED_FORMAT          = $00008000;
  2974.   MCI_SET_TIME_FORMAT           = $00010000;
  2975.   MCI_SET_DOOR_LOCK             = $00020000;
  2976.   MCI_SET_DOOR_UNLOCK           = $00040000;
  2977.   MCI_SET_VOLUME                = $00080000;
  2978.   MCI_SET_ITEM_FOURCC           = $00100000;
  2979.   MCI_SET_REVERSE               = $00200000;
  2980.  
  2981.   // Values for the ulAudio field
  2982.   MCI_SET_AUDIO_ALL             = $00000000;
  2983.   MCI_SET_AUDIO_LEFT            = $00000001;
  2984.   MCI_SET_AUDIO_RIGHT           = $00000002;
  2985.  
  2986.   // MCI_SET flags for CDXA
  2987.   MCI_CDXA_SET_CHANNEL          = $01000000;
  2988.   MCI_CDXA_AUDIO_DEVICE         = $10000000;
  2989.   MCI_CDXA_AUDIO_BUFFER         = $02000000;
  2990.   MCI_CDXA_VIDEO_BUFFER         = $04000000;
  2991.   MCI_CDXA_DATA_BUFFER          = $08000000;
  2992.  
  2993.   // MCI_SET flags for videodisc
  2994.   MCI_VD_SET_ON                 = MCI_SET_ON;
  2995.   MCI_VD_SET_OFF                = MCI_SET_OFF;
  2996.   MCI_VD_SET_VIDEO              = MCI_SET_VIDEO;
  2997.   MCI_VD_SET_CHANNEL            = $00100000;
  2998.   MCI_VD_SET_DISPLAY            = $00200000;
  2999.   MCI_VD_SET_DONTCARE           = $00400000;   // Dont care!
  3000.  
  3001.   // Generic MCI_SET item values for video devices
  3002.   MCI_VID_SET_VIDEO_COMPRESSION = MCI_VID_ITEM_BASE;
  3003.   MCI_VID_SET_IMAGE_COMPRESSION = MCI_VID_ITEM_BASE+1;
  3004.   MCI_VID_SET_IMAGE_BITSPERPEL  = MCI_VID_ITEM_BASE+2;
  3005.   MCI_VID_SET_IMAGE_PELFORMAT   = MCI_VID_ITEM_BASE+3;
  3006.   MCI_VID_SET_BRIGHTNESS        = MCI_VID_ITEM_BASE+4;
  3007.   MCI_VID_SET_CONTRAST          = MCI_VID_ITEM_BASE+5;
  3008.   MCI_VID_SET_HUE               = MCI_VID_ITEM_BASE+6;
  3009.   MCI_VID_SET_SATURATION        = MCI_VID_ITEM_BASE+7;
  3010.   MCI_VID_SET_SHARPNESS         = MCI_VID_ITEM_BASE+8;
  3011.   MCI_VID_SET_GREYSCALE         = MCI_VID_ITEM_BASE+9;
  3012.   MCI_VID_SET_IMAGE_QUALITY     = MCI_VID_ITEM_BASE+10;
  3013.   MCI_VID_SET_VIDEO_QUALITY     = MCI_VID_ITEM_BASE+11;
  3014.   MCI_VID_SET_IMAGE_COMPRESSION_METHOD = MCI_VID_ITEM_BASE+12;
  3015.   MCI_VID_SET_MINIMUM_VIDEO_REFRESH_RATE = MCI_VID_ITEM_BASE+13;
  3016.   MCI_VID_SET_IMAGE_FILE_FORMAT = MCI_VID_ITEM_BASE+14;
  3017.   MCI_VID_SET_REF_INTERVAL      = MCI_VID_ITEM_BASE+15;
  3018.   MCI_VID_SET_MAXDATARATE       = MCI_VID_ITEM_BASE+16;
  3019.   MCI_VID_SET_VIDEO_FILE_FORMAT = MCI_VID_ITEM_BASE+17;
  3020.  
  3021.   // MCI_SET item values for video overlay
  3022.   MCI_OVLY_SET_IMAGE_COMPRESSION = MCI_VID_SET_IMAGE_COMPRESSION;
  3023.   MCI_OVLY_SET_IMAGE_BITSPERPEL = MCI_VID_SET_IMAGE_BITSPERPEL;
  3024.   MCI_OVLY_SET_IMAGE_PELFORMAT  = MCI_VID_SET_IMAGE_PELFORMAT;
  3025.   MCI_OVLY_SET_BRIGHTNESS       = MCI_VID_SET_BRIGHTNESS;
  3026.   MCI_OVLY_SET_CONTRAST         = MCI_VID_SET_CONTRAST;
  3027.   MCI_OVLY_SET_HUE              = MCI_VID_SET_HUE;
  3028.   MCI_OVLY_SET_SATURATION       = MCI_VID_SET_SATURATION;
  3029.   MCI_OVLY_SET_SHARPNESS        = MCI_VID_SET_SHARPNESS;
  3030.   MCI_OVLY_SET_GREYSCALE        = MCI_VID_SET_GREYSCALE;
  3031.   MCI_OVLY_SET_IMAGE_QUALITY    = MCI_VID_SET_IMAGE_QUALITY;
  3032.   MCI_OVLY_SET_IMAGE_COMPRESSION_METHOD = MCI_VID_SET_IMAGE_COMPRESSION_METHOD;
  3033.   MCI_OVLY_SET_MINIMUM_VIDEO_REFRESH_RATE = MCI_VID_SET_MINIMUM_VIDEO_REFRESH_RATE;
  3034.   MCI_OVLY_SET_IMAGE_FILE_FORMAT = MCI_VID_SET_IMAGE_FILE_FORMAT;
  3035.  
  3036.   // MCI_SET item values for digital video
  3037.   MCI_DGV_SET_VIDEO_COMPRESSION = MCI_VID_SET_VIDEO_COMPRESSION;
  3038.   MCI_DGV_SET_IMAGE_COMPRESSION = MCI_VID_SET_IMAGE_COMPRESSION;
  3039.   MCI_DGV_SET_IMAGE_BITSPERPEL  = MCI_VID_SET_IMAGE_BITSPERPEL;
  3040.   MCI_DGV_SET_IMAGE_PELFORMAT   = MCI_VID_SET_IMAGE_PELFORMAT;
  3041.   MCI_DGV_SET_BRIGHTNESS        = MCI_VID_SET_BRIGHTNESS;
  3042.   MCI_DGV_SET_CONTRAST          = MCI_VID_SET_CONTRAST;
  3043.   MCI_DGV_SET_HUE               = MCI_VID_SET_HUE;
  3044.   MCI_DGV_SET_SATURATION        = MCI_VID_SET_SATURATION;
  3045.   MCI_DGV_SET_SHARPNESS         = MCI_VID_SET_SHARPNESS;
  3046.   MCI_DGV_SET_GREYSCALE         = MCI_VID_SET_GREYSCALE;
  3047.   MCI_DGV_SET_IMAGE_QUALITY     = MCI_VID_SET_IMAGE_QUALITY;
  3048.   MCI_DGV_SET_VIDEO_QUALITY     = MCI_VID_SET_VIDEO_QUALITY;
  3049.   MCI_DGV_SET_IMAGE_COMPRESSION_METHOD = MCI_VID_SET_IMAGE_COMPRESSION_METHOD;
  3050.   MCI_DGV_SET_MONITOR           = MCI_SET_MONITOR;
  3051.   MCI_DGV_SET_MINIMUM_VIDEO_REFRESH_RATE = MCI_VID_SET_MINIMUM_VIDEO_REFRESH_RATE;
  3052.   MCI_DGV_SET_IMAGE_FILE_FORMAT = MCI_VID_SET_IMAGE_FILE_FORMAT;
  3053.   MCI_DGV_SET_REF_INTERVAL      = MCI_VID_SET_REF_INTERVAL;
  3054.   MCI_DGV_SET_MAXDATARATE       = MCI_VID_SET_MAXDATARATE;
  3055.   MCI_DGV_SET_VIDEO_FILE_FORMAT = MCI_VID_SET_VIDEO_FILE_FORMAT;
  3056.  
  3057.   MCI_DGV_SET_AUDIO_COMPRESSION = MCI_DGV_ITEM_BASE;
  3058.   MCI_DGV_SET_AUDIO_QUALITY     = MCI_DGV_ITEM_BASE+1;
  3059.   MCI_DGV_SET_CHANNELS          = MCI_DGV_ITEM_BASE+2;
  3060.   MCI_DGV_SET_BITSPERSAMPLE     = MCI_DGV_ITEM_BASE+3;
  3061.   MCI_DGV_SET_SAMPLESPERSEC     = MCI_DGV_ITEM_BASE+4;
  3062.   MCI_DGV_SET_FORMATTAG         = MCI_DGV_ITEM_BASE+5;
  3063.   MCI_DGV_SET_BLOCKALIGN        = MCI_DGV_ITEM_BASE+6;
  3064.   MCI_DGV_SET_AVGBYTESPERSEC    = MCI_DGV_ITEM_BASE+7;
  3065.  
  3066.   MCI_DGV_SET_VIDEO_COMPRESSION_SUBTYPE = MCI_DGV_ITEM_BASE+8;
  3067.   MCI_DGV_SET_VIDEO_RECORD_RATE = MCI_DGV_ITEM_BASE+9;
  3068.   MCI_DGV_SET_VIDEO_RECORD_FRAME_DURATION = MCI_DGV_ITEM_BASE+10;
  3069.   MCI_DGV_SET_RECORD_AUDIO      = MCI_DGV_ITEM_BASE+11;
  3070.   MCI_DGV_SET_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+12;
  3071.   MCI_DGV_SET_GRAPHIC_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+12;
  3072.   MCI_DGV_SET_AUDIOSYNC         = MCI_DGV_ITEM_BASE+13;
  3073.   MCI_DGV_SET_VIDEO_TRANSPARENT_COLOR = MCI_DGV_ITEM_BASE+14;
  3074.  
  3075.   // Video file format
  3076.   MCI_VID_FILE_FORMAT_AVI       = $20495641;
  3077.  
  3078.   // Audio/video/image compression types
  3079.   MCI_AUD_COMP_ADPCM4           = $00000001;
  3080.   MCI_AUD_COMP_PCM8             = $00000002;
  3081.  
  3082.   MCI_VID_COMP_RTV_2_0          = $00000101;
  3083.   MCI_VID_COMP_RTV_2_1          = $00000102;
  3084.   MCI_VID_COMP_ULTI             = $49544C55;
  3085.   MCI_VID_COMP_RT21             = $31325452;
  3086.   MCI_VID_COMP_NONE             = $20424944;   // This is 'DIB ' now.
  3087.  
  3088.   MCI_IMG_COMP_NONE             = $00000201;
  3089.   MCI_IMG_COMP_PIC9_1_0         = $00000202;
  3090.   MCI_IMG_COMP_PIC16_1_0        = $00000203;
  3091.   MCI_IMG_COMP_JPEG9            = $00000204;
  3092.   MCI_IMG_COMP_JPEG9_1_0        = MCI_IMG_COMP_JPEG9;
  3093.   MCI_IMG_COMP_BMP_RLE4         = $00000205;
  3094.   MCI_IMG_COMP_BMP_RLE8         = $00000206;
  3095.   MCI_IMG_COMP_JPEGN            = $00000207;
  3096.  
  3097.   // PEL Formats (video/image)
  3098.   MCI_VID_PALETTE               = $00000001;
  3099.   MCI_VID_RGB                   = $00000002;
  3100.   MCI_VID_YUV                   = $00000003;
  3101.  
  3102.   MCI_IMG_PALETTE               = MCI_VID_PALETTE;
  3103.   MCI_IMG_RGB                   = MCI_VID_RGB;
  3104.   MCI_IMG_YUV                   = MCI_VID_YUV;
  3105.  
  3106.   // Audio/video/image quality levels
  3107.   MCI_AUD_QUALITY_HIGH          = $00000001;
  3108.   MCI_AUD_QUALITY_MED           = $00000002;
  3109.   MCI_AUD_QUALITY_LOW           = $00000003;
  3110.  
  3111.   MCI_VID_QUALITY_HIGH          = $00000101;
  3112.   MCI_VID_QUALITY_MED           = $00000102;
  3113.   MCI_VID_QUALITY_LOW           = $00000103;
  3114.   MCI_VID_QUALITY_BEST          = MCI_VID_QUALITY_HIGH;
  3115.   MCI_VID_QUALITY_CDROM         = MCI_VID_QUALITY_MED;
  3116.   MCI_VID_QUALITY_COMPACT       = MCI_VID_QUALITY_LOW;
  3117.   MCI_VID_QUALITY_BETTER        = MCI_VID_QUALITY_MED;
  3118.   MCI_VID_QUALITY_GOOD          = MCI_VID_QUALITY_LOW;
  3119.  
  3120.   MCI_IMG_QUALITY_HIGH          = $00000201;
  3121.   MCI_IMG_QUALITY_MED           = $00000202;
  3122.   MCI_IMG_QUALITY_LOW           = $00000203;
  3123.  
  3124.   // MCI_SET flags for wave audio
  3125.   MCI_WAVE_SET_SAMPLESPERSEC    = $01000000;
  3126.   MCI_WAVE_SET_AVGBYTESPERSEC   = $02000000;
  3127.   MCI_WAVE_SET_BLOCKALIGN       = $04000000;
  3128.   MCI_WAVE_SET_FORMATTAG        = $08000000;
  3129.   MCI_WAVE_SET_CHANNELS         = $10000000;
  3130.   MCI_WAVE_SET_BITSPERSAMPLE    = $80000000;
  3131.  
  3132.   // Wave format tag defines
  3133.   MCI_WAVE_FORMAT_PCM           = DATATYPE_WAVEFORM;
  3134.   MCI_WAVE_FORMAT_ADPCM         = $0002;
  3135.   MCI_WAVE_FORMAT_IBM_CVSD      = $0005;
  3136.   MCI_WAVE_FORMAT_ALAW          = DATATYPE_RIFF_ALAW;
  3137.   MCI_WAVE_FORMAT_MULAW         = DATATYPE_RIFF_MULAW;
  3138.   MCI_WAVE_FORMAT_OKI_ADPCM     = $0010;
  3139.   MCI_WAVE_FORMAT_DVI_ADPCM     = $0011;
  3140.   MCI_WAVE_FORMAT_DIGISTD       = $0015;
  3141.   MCI_WAVE_FORMAT_DIGIFIX       = $0016;
  3142.   MCI_WAVE_FORMAT_AVC_ADPCM     = DATATYPE_ADPCM_AVC;
  3143.   MCI_WAVE_FORMAT_IBM_ADPCM     = DATATYPE_ADPCM_AVC;
  3144.   MCI_WAVE_FORMAT_IBM_MULAW     = DATATYPE_MULAW;
  3145.   MCI_WAVE_FORMAT_IBM_ALAW      = DATATYPE_ALAW;
  3146.   MCI_WAVE_FORMAT_CT_ADPCM      = DATATYPE_CT_ADPCM;
  3147.   MCI_WAVE_FORMAT_MPEG1         = DATATYPE_MPEG1AUDIO;
  3148.  
  3149.   // MCI_SET flags for sequencer
  3150.   MCI_SEQ_SET_TEMPO             = $00100000;
  3151.   MCI_SEQ_SET_PORT              = $00200000;
  3152.   MCI_SEQ_ENABLE_PORT_MAPPER    = $00400000;
  3153.   MCI_SEQ_DISABLE_PORT_MAPPER   = $00800000;
  3154.   MCI_SEQ_SET_OFFSET            = $01000000;
  3155.   MCI_SEQ_SET_MASTER            = $02000000;
  3156.   MCI_SEQ_SET_SLAVE             = $04000000;
  3157.  
  3158.   // SEQ time formats
  3159.   MCI_SEQ_SET_SMPTE_24          = $00000100;
  3160.   MCI_SEQ_SET_SMPTE_25          = $00000200;
  3161.   MCI_SEQ_SET_SMPTE_30          = $00000300;
  3162.   MCI_SEQ_SET_SMPTE_30DROP      = $00000400;
  3163.   MCI_SEQ_SET_SONGPTR           = $00000500;
  3164.  
  3165.   // SEQ synchronization types
  3166.   MCI_SEQ_MIDI                  = $00000001;
  3167.   MCI_SEQ_SMPTE                 = $00000002;
  3168.   MCI_SEQ_FILE                  = $00000003;
  3169.   MCI_SEQ_NONE                  = $00000004;
  3170.  
  3171.   // SEQ PORT TYPES
  3172.   MCI_SET_NONE                  = $10000000;
  3173.   MIDI_MAPPER                   = $20000000;
  3174.   MCI_MIDI_MAPPER               = MIDI_MAPPER;
  3175.  
  3176. type
  3177.   mci_Set_Parms = record
  3178.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3179.     ulTimeFormat                : uLong;       // Time format to be used by the device
  3180.     ulSpeedFormat               : uLong;       // Speed format used by this device
  3181.     ulAudio                     : uLong;       // Channel number for this operation
  3182.                                                // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
  3183.                                                //  MCI_SET_AUDIO_ALL)
  3184.     ulLevel                     : uLong;       // Volume, treble or bass level as % of max.
  3185.     ulOver                      : uLong;       // Delay time for vectored change in millisecond
  3186.     ulItem                      : uLong;       // Item field for set item flags
  3187.     ulValue                     : uLong;       // Value associated with item flag
  3188.   end;
  3189.   pmci_Set_Parms = ^mci_Set_Parms;
  3190.  
  3191.   mci_Amp_Set_Parms            = mci_Set_Parms;
  3192.   pmci_Amp_Set_Parms           = ^mci_Amp_Set_Parms;
  3193.  
  3194.   mci_DGV_Set_Parms            = mci_Set_Parms;
  3195.   pmci_DGV_Set_Parms           = ^mci_DGV_Set_Parms;
  3196.  
  3197.   mci_Ovly_Set_Parms           = mci_Set_Parms;
  3198.   pmci_Ovly_Set_Parms          = ^mci_Ovly_Set_Parms;
  3199.  
  3200.   mci_CDXA_Set_Parms = record
  3201.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3202.     ulTimeFormat                : uLong;       // Time format to be used by the device
  3203.     ulSpeedFormat               : uLong;       // Speed format used by this device
  3204.     ulAudio                     : uLong;       // Channel number for this operation
  3205.                                                // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
  3206.                                                //  MCI_SET_AUDIO_ALL)
  3207.     ulLevel                     : uLong;       // Volume, treble or bass level as % of max.
  3208.     ulOver                      : uLong;       // Delay time for vectored change in milliseconds
  3209.     ulItem                      : uLong;       // Item field for set item flags
  3210.     ulValue                     : uLong;       // Value associated with item flag
  3211.     ulChannel                   : uLong;       // Channel number
  3212.     pPlayList                   : Pointer;     // Pointer to play list
  3213.     ulPlayListSize              : uLong;       // Play list size
  3214.   end;
  3215.   pmci_CDXA_Set_Parms = ^mci_CDXA_Set_Parms;
  3216.  
  3217.   mci_VD_Set_Parms = record
  3218.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3219.     ulTimeFormat                : uLong;       // Time format to be used by the device
  3220.     ulSpeedFormat               : uLong;       // Speed format used by this device
  3221.     ulAudio                     : uLong;       // Channel number for this operation
  3222.                                                // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
  3223.                                                //  MCI_SET_AUDIO_ALL)
  3224.     ulLevel                     : uLong;       // Volume, treble or bass level as % of max.
  3225.     ulOver                      : uLong;       // Delay time for vectored change in milliseconds
  3226.     ulItem                      : uLong;       // Item field for set item flags
  3227.     ulValue                     : uLong;       // Value associated with item flag
  3228.     ulChannel                   : uLong;       // Videodisc channel
  3229.   end;
  3230.   pmci_VD_Set_Parms = ^mci_VD_Set_Parms;
  3231.  
  3232.   mci_Wave_Set_Parms = record
  3233.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3234.     ulTimeFormat                : uLong;       // Time format to be used by the device
  3235.     ulSpeedFormat               : uLong;       // Speed format used by this device
  3236.     ulAudio                     : uLong;       // Channel number for this operation
  3237.                                                // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
  3238.                                                //  MCI_SET_AUDIO_ALL)
  3239.     ulLevel                     : uLong;       // Volume, trebble or bass level as % of max.
  3240.     ulOver                      : uLong;       // Delay time for vectored change in milliseconds
  3241.     ulItem                      : uLong;       // Item field for set item flags
  3242.     ulValue                     : uLong;       // Value associated with item flag
  3243.     usInput                     : uShort;      // Channel for input
  3244.     usReserved0                 : uShort;      // Reserved field
  3245.     usOutput                    : uShort;      // Channel for output
  3246.     usReserved1                 : uShort;      // Reserved field
  3247.     usFormatTag                 : uShort;      // Format tag
  3248.     usReserved2                 : uShort;      // Reserved field
  3249.     usChannels                  : uShort;      // mono(1) or stereo(2)
  3250.     usReserved3                 : uShort;      // Reserved field
  3251.     ulSamplesPerSec             : uLong;       // Samples per seconds
  3252.     ulAvgBytesPerSec            : uLong;       // Bytes per seconds
  3253.     usBlockAlign                : uShort;      // Block alignment of data
  3254.     usReserved4                 : uShort;      // Reserved field
  3255.     usBitsPerSample             : uShort;      // Bits per seconds
  3256.     usReserved5                 : uShort;      // Reserved field
  3257.   end;
  3258.   pmci_Wave_Set_Parms = ^mci_Wave_Set_Parms;
  3259.  
  3260.   mci_Seq_Set_Parms = record
  3261.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3262.     ulTimeFormat                : uLong;       // Time format to be used by the device
  3263.     ulSpeedFormat               : uLong;       // Speed format used by this device
  3264.     ulAudio                     : uLong;       // Channel number for this operation
  3265.                                                // (MCI_SET_AUDIO_LEFT, MCI_SET_AUDIO_RIGHT,
  3266.                                                //  MCI_SET_AUDIO_ALL)
  3267.     ulLevel                     : uLong;       // Volume, trebble or bass level as % of max.
  3268.     ulOver                      : uLong;       // Delay time for vectored change in millisecond
  3269.     ulItem                      : uLong;       // Item field for set item flags
  3270.     ulValue                     : uLong;       // Value associated with item flag
  3271.     ulTempo                     : uLong;       // Specified the tempo
  3272.     ulPort                      : uLong;       // Output port
  3273.     ulSlave                     : uLong;       // Unused field
  3274.     ulMaster                    : uLong;       // Unused field
  3275.     ulOffset                    : uLong;       // Specified the data offset
  3276.   end;
  3277.   pmci_Seq_Set_Parms = ^mci_Seq_Set_Parms;
  3278.  
  3279. const
  3280.   // parameters for the MCI_SET_CUEPOINT message
  3281.   //     $0000$00 are reserved for MCI_SET_CUEPOINT flags
  3282.   MCI_SET_CUEPOINT_ON           = $00000100;
  3283.   MCI_SET_CUEPOINT_OFF          = $00000200;
  3284.  
  3285. type
  3286.   mci_CuePoint_Parms = record
  3287.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3288.     ulCuepoint                  : uLong;       // Specifies the cuepoint location
  3289.     usUserParm                  : uShort;      // User parmameter returned on cuepoint
  3290.                                                // notify message
  3291.     usReserved0                 : uShort;      // Reserved field
  3292.   end;
  3293.   pmci_CuePoint_Parms = ^mci_CuePoint_Parms;
  3294.  
  3295. const
  3296.   // parameters for the MCI_SETIMAGEPALETTE message
  3297.   //   $00$XX00 are reserved for MCI_SETIMAGEPALETTE flags
  3298.   MCI_SET_REGISTERED            = $00000100;
  3299.  
  3300.   // Flags and parameter structure for the MCI_SET_POSITION_ADVISE msg
  3301.   //     $0000$00 are reserved for MCI_SET_POSITION_ADVISE flags
  3302.   MCI_SET_POSITION_ADVISE_ON    = $00000100;
  3303.   MCI_SET_POSITION_ADVISE_OFF   = $00000200;
  3304.  
  3305. type
  3306.   mci_Position_Parms = record
  3307.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3308.     ulUnits                     : uLong;       // Specifies position change notifiication
  3309.                                                // granularity
  3310.     usUserParm                  : uShort;      // User parameter returned on position change
  3311.                                                // notification message.
  3312.     Reserved0                   : uShort;      // Reserved field
  3313.     Reserved1                   : uLong;       // Reserved field
  3314.   end;
  3315.   pmci_Position_Parms = ^mci_Position_Parms;
  3316.  
  3317.   mci_Sync_Offset_Parms = record
  3318.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3319.     ulOffset                    : uLong;       // Specifies the device media position offset
  3320.                                                // in the currently specified device units.
  3321.   end;
  3322.   pmci_Sync_Offset_Parms = ^mci_Sync_Offset_Parms;
  3323.  
  3324. const
  3325.   // Flags for the MCI_SPIN message
  3326.   //     $0000$00 are reserved for MCI_SPIN flags
  3327.   MCI_SPIN_UP                   = $00000100;
  3328.   MCI_SPIN_DOWN                 = $00000200;
  3329.  
  3330.   // MCI_STATUS message flags
  3331.   //     $00$XX00 are reserved for MCI_STATUS flags
  3332.   //     MCI_VOLUME and MCI_VOLUME_DELAY are $00000100 and $00000200
  3333.   MCI_STATUS_ITEM               = $00000100;
  3334.   MCI_STATUS_START              = $00000200;
  3335.   MCI_STATUS_CONNECTOR          = $00000400;
  3336.  
  3337.   // General MCI_STATUS item values
  3338.   MCI_STATUS_CURRENT_TRACK      = $00000001;
  3339.   MCI_STATUS_LENGTH             = $00000002;
  3340.   MCI_STATUS_MODE               = $00000003;
  3341.   MCI_STATUS_NUMBER_OF_TRACKS   = $00000004;
  3342.   MCI_STATUS_POSITION           = $00000005;
  3343.   MCI_STATUS_POSITION_IN_TRACK  = $00000006;
  3344.   MCI_STATUS_MEDIA_PRESENT      = $00000007;
  3345.   MCI_STATUS_VOLUME             = $00000008;
  3346.   MCI_STATUS_READY              = $00000009;
  3347.   MCI_STATUS_TIME_FORMAT        = $0000000A;
  3348.   MCI_STATUS_SPEED_FORMAT       = $0000000B;
  3349.   MCI_STATUS_MONITOR            = $0000000C;
  3350.   MCI_STATUS_AUDIO              = $0000000D;
  3351.   MCI_STATUS_VIDEO              = $0000000E;
  3352.   MCI_STATUS_CLIPBOARD          = $0000000F;
  3353.   MCI_STATUS_CAN_PASTE          = $00000010;
  3354.   MCI_STATUS_CAN_REDO           = $00000020;
  3355.   MCI_STATUS_CAN_UNDO           = $00000030;
  3356.  
  3357.   // ulValue field values for MCI_STATUS_AUDIO
  3358.   MCI_STATUS_AUDIO_ALL          = $00000000;
  3359.   MCI_STATUS_AUDIO_LEFT         = $00000001;
  3360.   MCI_STATUS_AUDIO_RIGHT        = $00000002;
  3361.  
  3362.   // MCI_STATUS item values for amp/mixer
  3363.   MCI_AMP_STATUS_PITCH          = MCI_AMP_ITEM_BASE;
  3364.   MCI_AMP_STATUS_TREBLE         = MCI_AMP_ITEM_BASE+1;
  3365.   MCI_AMP_STATUS_BASS           = MCI_AMP_ITEM_BASE+2;
  3366.   MCI_AMP_STATUS_BALANCE        = MCI_AMP_ITEM_BASE+3;
  3367.   MCI_AMP_STATUS_GAIN           = MCI_AMP_ITEM_BASE+4;
  3368.   MCI_AMP_STATUS_MONITOR        = MCI_AMP_ITEM_BASE+5;
  3369.   MCI_AMP_STATUS_MID            = MCI_AMP_ITEM_BASE+6;
  3370.   MCI_AMP_STATUS_VOLUME         = MCI_STATUS_VOLUME;
  3371.   MCI_AMP_STATUS_LOUDNESS       = MCI_AMP_ITEM_BASE+7;
  3372.   MCI_AMP_STATUS_CROSSOVER      = MCI_AMP_ITEM_BASE+8;
  3373.   MCI_AMP_STATUS_REVERB         = MCI_AMP_ITEM_BASE+9;
  3374.   MCI_AMP_STATUS_ALC            = MCI_AMP_ITEM_BASE+10;
  3375.   MCI_AMP_STATUS_CHORUS         = MCI_AMP_ITEM_BASE+11;
  3376.   MCI_AMP_STATUS_CUSTOM1        = MCI_AMP_ITEM_BASE+12;
  3377.   MCI_AMP_STATUS_CUSTOM2        = MCI_AMP_ITEM_BASE+13;
  3378.   MCI_AMP_STATUS_CUSTOM3        = MCI_AMP_ITEM_BASE+14;
  3379.  
  3380.   // MCI_STATUS item values for cd audio
  3381.   MCI_CD_STATUS_TRACK_TYPE      = MCI_CD_ITEM_BASE;
  3382.   MCI_CD_STATUS_TRACK_COPYPERMITTED = MCI_CD_ITEM_BASE+1;
  3383.   MCI_CD_STATUS_TRACK_CHANNELS  = MCI_CD_ITEM_BASE+2;
  3384.   MCI_CD_STATUS_TRACK_PREEMPHASIS = MCI_CD_ITEM_BASE+3;
  3385.  
  3386.   // return values for CD MCI_STATUS message with
  3387.   //   MCI_CD_STATUS_TRACK_TYPE set
  3388.   MCI_CD_TRACK_AUDIO            = $00000001;
  3389.   MCI_CD_TRACK_DATA             = $00000002;
  3390.   MCI_CD_TRACK_OTHER            = $00000003;
  3391.  
  3392.   // MCI_STATUS item values for CDXA
  3393.   MCI_CDXA_STATUS_CHANNEL       = MCI_CDXA_ITEM_BASE;
  3394.  
  3395.   //returned from call for MCI_CDXA_STATUS_CHANNEL
  3396.   MCI_CDXA_NONE                 = $00000000;
  3397.  
  3398.   // MCI_STATUS item values for sequencer
  3399.   MCI_SEQ_STATUS_TEMPO          = MCI_SEQ_ITEM_BASE;
  3400.   MCI_SEQ_STATUS_OFFSET         = MCI_SEQ_ITEM_BASE+1;
  3401.   MCI_SEQ_STATUS_DIVTYPE        = MCI_SEQ_ITEM_BASE+2;
  3402.   MCI_SEQ_STATUS_MASTER         = MCI_SEQ_ITEM_BASE+3;
  3403.   MCI_SEQ_STATUS_PORT           = MCI_SEQ_ITEM_BASE+4;
  3404.   MCI_SEQ_STATUS_SLAVE          = MCI_SEQ_ITEM_BASE+5;
  3405.  
  3406.   // Return value for current division type
  3407.   MCI_SEQ_DIV_PPQN              = $00000001;
  3408.   MCI_SEQ_DIV_SMPTE_24          = $00000002;
  3409.   MCI_SEQ_DIV_SMPTE_25          = $00000003;
  3410.   MCI_SEQ_DIV_SMPTE_30DROP      = $00000004;
  3411.   MCI_SEQ_DIV_SMPTE_30          = $00000005;
  3412.  
  3413.   // MCI_STATUS items for videodisc
  3414.   MCI_VD_STATUS_SPEED           = MCI_VD_ITEM_BASE;
  3415.   MCI_VD_STATUS_FORWARD         = MCI_VD_ITEM_BASE+1;
  3416.   MCI_VD_MEDIA_TYPE             = MCI_VD_ITEM_BASE+2;
  3417.   MCI_VD_STATUS_SIDE            = MCI_VD_ITEM_BASE+3;
  3418.   MCI_VD_STATUS_DISC_SIZE       = MCI_VD_ITEM_BASE+4;
  3419.  
  3420.   // Return values for videodisc status command
  3421.   MCI_VD_SPEED_NORMAL           = $00000000;
  3422.   MCI_VD_SPEED_FAST             = $00000001;
  3423.   MCI_VD_SPEED_SLOW             = $00000002;
  3424.  
  3425.   // MCI_STATUS items for wave audio
  3426.   MCI_WAVE_STATUS_LEVEL         = MCI_WAVE_ITEM_BASE;
  3427.   MCI_WAVE_STATUS_SAMPLESPERSEC = MCI_WAVE_ITEM_BASE+1;
  3428.   MCI_WAVE_STATUS_AVGBYTESPERSEC = MCI_WAVE_ITEM_BASE+2;
  3429.   MCI_WAVE_STATUS_BLOCKALIGN    = MCI_WAVE_ITEM_BASE+3;
  3430.   MCI_WAVE_STATUS_FORMATTAG     = MCI_WAVE_ITEM_BASE+4;
  3431.   MCI_WAVE_STATUS_CHANNELS      = MCI_WAVE_ITEM_BASE+5;
  3432.   MCI_WAVE_STATUS_BITSPERSAMPLE = MCI_WAVE_ITEM_BASE+6;
  3433.  
  3434.   // Common video MCI_STATUS items
  3435.   MCI_VID_STATUS_hwnd                          = MCI_VID_ITEM_BASE;
  3436.   MCI_VID_STATUS_AUDIO_COMPRESSION             = MCI_VID_ITEM_BASE+1;
  3437.   MCI_VID_STATUS_VIDEO_COMPRESSION             = MCI_VID_ITEM_BASE+2;
  3438.   MCI_VID_STATUS_IMAGE_COMPRESSION             = MCI_VID_ITEM_BASE+3;
  3439.   MCI_VID_STATUS_AUDIO_QUALITY                 = MCI_VID_ITEM_BASE+4;
  3440.   MCI_VID_STATUS_VIDEO_QUALITY                 = MCI_VID_ITEM_BASE+5;
  3441.   MCI_VID_STATUS_IMAGE_QUALITY                 = MCI_VID_ITEM_BASE+6;
  3442.   MCI_VID_STATUS_IMAGE_BITSPERPEL              = MCI_VID_ITEM_BASE+7;
  3443.   MCI_VID_STATUS_IMAGE_PELFORMAT               = MCI_VID_ITEM_BASE+8;
  3444.   MCI_VID_STATUS_FORWARD                       = MCI_VID_ITEM_BASE+9;
  3445.   MCI_VID_STATUS_NORMAL_RATE                   = MCI_VID_ITEM_BASE+10;
  3446.   MCI_VID_STATUS_VIDEO_X_EXTENT                = MCI_VID_ITEM_BASE+11;
  3447.   MCI_VID_STATUS_VIDEO_Y_EXTENT                = MCI_VID_ITEM_BASE+12;
  3448.   MCI_VID_STATUS_IMAGE_X_EXTENT                = MCI_VID_ITEM_BASE+13;
  3449.   MCI_VID_STATUS_IMAGE_Y_EXTENT                = MCI_VID_ITEM_BASE+14;
  3450.   MCI_VID_STATUS_BRIGHTNESS                    = MCI_VID_ITEM_BASE+15;
  3451.   MCI_VID_STATUS_CONTRAST                      = MCI_VID_ITEM_BASE+16;
  3452.   MCI_VID_STATUS_HUE                           = MCI_VID_ITEM_BASE+17;
  3453.   MCI_VID_STATUS_SATURATION                    = MCI_VID_ITEM_BASE+18;
  3454.   MCI_VID_STATUS_GREYSCALE                     = MCI_VID_ITEM_BASE+19;
  3455.   MCI_VID_STATUS_SHARPNESS                     = MCI_VID_ITEM_BASE+20;
  3456.   MCI_VID_STATUS_SPEED                         = MCI_VID_ITEM_BASE+21;
  3457.   MCI_VID_STATUS_IMAGE_FILE_FORMAT             = MCI_VID_ITEM_BASE+22;
  3458.   MCI_VID_STATUS_TRANSPARENT_TYPE              = MCI_VID_ITEM_BASE+23;
  3459.   MCI_VID_STATUS_REF_INTERVAL                  = MCI_VID_ITEM_BASE+24;
  3460.   MCI_VID_STATUS_MAXDATARATE                   = MCI_VID_ITEM_BASE+25;
  3461.   MCI_VID_STATUS_VIDEO_FILE_FORMAT             = MCI_VID_ITEM_BASE+26;
  3462.  
  3463.   // Status Transparent Type returns
  3464.   // MCI_VID_PALETTE
  3465.   // MCI_VID_RGB
  3466.   // MCI_VID_YUV
  3467.   MCI_VID_STATUS_TRANSPARENT_COLOR             = MCI_VID_ITEM_BASE+24;
  3468.  
  3469.   // MCI_STATUS items for digital video
  3470.   MCI_DGV_STATUS_hwnd                          = MCI_VID_STATUS_hwnd;
  3471.   MCI_DGV_STATUS_AUDIO_COMPRESSION             = MCI_VID_STATUS_AUDIO_COMPRESSION;
  3472.   MCI_DGV_STATUS_VIDEO_COMPRESSION             = MCI_VID_STATUS_VIDEO_COMPRESSION;
  3473.   MCI_DGV_STATUS_IMAGE_COMPRESSION             = MCI_VID_STATUS_IMAGE_COMPRESSION;
  3474.   MCI_DGV_STATUS_AUDIO_QUALITY                 = MCI_VID_STATUS_AUDIO_QUALITY;
  3475.   MCI_DGV_STATUS_VIDEO_QUALITY                 = MCI_VID_STATUS_VIDEO_QUALITY;
  3476.   MCI_DGV_STATUS_IMAGE_QUALITY                 = MCI_VID_STATUS_IMAGE_QUALITY;
  3477.   MCI_DGV_STATUS_IMAGE_BITSPERPEL              = MCI_VID_STATUS_IMAGE_BITSPERPEL;
  3478.   MCI_DGV_STATUS_IMAGE_PELFORMAT               = MCI_VID_STATUS_IMAGE_PELFORMAT;
  3479.   MCI_DGV_STATUS_FORWARD                       = MCI_VID_STATUS_FORWARD;
  3480.   MCI_DGV_STATUS_NORMAL_RATE                   = MCI_VID_STATUS_NORMAL_RATE;
  3481.   MCI_DGV_STATUS_VIDEO_X_EXTENT                = MCI_VID_STATUS_VIDEO_X_EXTENT;
  3482.   MCI_DGV_STATUS_VIDEO_Y_EXTENT                = MCI_VID_STATUS_VIDEO_Y_EXTENT;
  3483.   MCI_DGV_STATUS_IMAGE_X_EXTENT                = MCI_VID_STATUS_IMAGE_X_EXTENT;
  3484.   MCI_DGV_STATUS_IMAGE_Y_EXTENT                = MCI_VID_STATUS_IMAGE_Y_EXTENT;
  3485.   MCI_DGV_STATUS_BRIGHTNESS                    = MCI_VID_STATUS_BRIGHTNESS;
  3486.   MCI_DGV_STATUS_CONTRAST                      = MCI_VID_STATUS_CONTRAST;
  3487.   MCI_DGV_STATUS_HUE                           = MCI_VID_STATUS_HUE;
  3488.   MCI_DGV_STATUS_SATURATION                    = MCI_VID_STATUS_SATURATION;
  3489.   MCI_DGV_STATUS_SPEED                         = MCI_VID_STATUS_SPEED;
  3490.   MCI_DGV_STATUS_SHARPNESS                     = MCI_VID_STATUS_SHARPNESS;
  3491.   MCI_DGV_STATUS_REF_INTERVAL                  = MCI_VID_STATUS_REF_INTERVAL;
  3492.   MCI_DGV_STATUS_MAXDATARATE                   = MCI_VID_STATUS_MAXDATARATE;
  3493.   MCI_DGV_STATUS_VIDEO_FILE_FORMAT             = MCI_VID_STATUS_VIDEO_FILE_FORMAT;
  3494.  
  3495.   MCI_DGV_STATUS_CHANNELS                      = MCI_DGV_ITEM_BASE+13;
  3496.   MCI_DGV_STATUS_BITSPERSAMPLE                 = MCI_DGV_ITEM_BASE+14;
  3497.   MCI_DGV_STATUS_SAMPLESPERSEC                 = MCI_DGV_ITEM_BASE+15;
  3498.   MCI_DGV_STATUS_FORMATTAG                     = MCI_DGV_ITEM_BASE+16;
  3499.   MCI_DGV_STATUS_BLOCKALIGN                    = MCI_DGV_ITEM_BASE+17;
  3500.   MCI_DGV_STATUS_AVGBYTESPERSEC                = MCI_DGV_ITEM_BASE+18;
  3501.   MCI_DGV_STATUS_VIDEO_COMPRESSION_SUBTYPE     = MCI_DGV_ITEM_BASE+19;
  3502.   MCI_DGV_STATUS_VIDEO_RECORD_RATE             = MCI_DGV_ITEM_BASE+20;
  3503.   MCI_DGV_STATUS_VIDEO_RECORD_FRAME_DURATION   = MCI_DGV_ITEM_BASE+21;
  3504.   MCI_DGV_STATUS_RECORD_AUDIO                  = MCI_DGV_ITEM_BASE+22;
  3505.   MCI_DGV_STATUS_TRANSPARENT_COLOR             = MCI_DGV_ITEM_BASE+23;
  3506.   MCI_DGV_STATUS_GRAPHIC_TRANSPARENT_COLOR     = MCI_DGV_ITEM_BASE+23;  // MUST BE SAME AS TRANSPARENT COLOR
  3507.   MCI_DGV_STATUS_hwnd_MONITOR                  = MCI_DGV_ITEM_BASE+24;
  3508.   MCI_DGV_STATUS_DROPPED_FRAME_PCT             = MCI_DGV_ITEM_BASE+25;
  3509.   MCI_DGV_STATUS_AUDIOSYNC                     = MCI_DGV_ITEM_BASE+26;
  3510.   MCI_DGV_STATUS_AUDIOSYNC_DIRECTION           = MCI_DGV_ITEM_BASE+27;
  3511.   MCI_DGV_STATUS_VIDEO_TRANSPARENT_COLOR       = MCI_DGV_ITEM_BASE+28;  // MUST BE SAME AS TRANSPARENT COLOR
  3512.   MCI_DGV_STATUS_TUNER_TV_CHANNEL              = MCI_DGV_ITEM_BASE+29;
  3513.   MCI_DGV_STATUS_TUNER_LOW_TV_CHANNEL          = MCI_DGV_ITEM_BASE+29;
  3514.   MCI_DGV_STATUS_TUNER_HIGH_TV_CHANNEL         = MCI_DGV_ITEM_BASE+29;
  3515.   MCI_DGV_STATUS_TUNER_REGION                  = MCI_DGV_ITEM_BASE+30;
  3516.   MCI_DGV_STATUS_TUNER_FINETUNE                = MCI_DGV_ITEM_BASE+31;
  3517.   MCI_DGV_STATUS_TUNER_FREQUENCY               = MCI_DGV_ITEM_BASE+32;
  3518.   MCI_DGV_STATUS_TUNER_AUDIO_CHANNEL           = MCI_DGV_ITEM_BASE+33;
  3519.   MCI_DGV_STATUS_TUNER_AFC                     = MCI_DGV_ITEM_BASE+34;
  3520.   MCI_DGV_STATUS_VALID_SIGNAL                  = MCI_DGV_ITEM_BASE+35;
  3521.  
  3522.   // MCI_STATUS item values for video overlay
  3523.   MCI_OVLY_STATUS_hwnd                         = MCI_VID_STATUS_hwnd;
  3524.   MCI_OVLY_STATUS_IMAGE_COMPRESSION            = MCI_VID_STATUS_IMAGE_COMPRESSION;
  3525.   MCI_OVLY_STATUS_IMAGE_BITSPERPEL             = MCI_VID_STATUS_IMAGE_BITSPERPEL;
  3526.   MCI_OVLY_STATUS_IMAGE_PELFORMAT              = MCI_VID_STATUS_IMAGE_PELFORMAT;
  3527.   MCI_OVLY_STATUS_IMAGE_X_EXTENT               = MCI_VID_STATUS_IMAGE_X_EXTENT;
  3528.   MCI_OVLY_STATUS_IMAGE_Y_EXTENT               = MCI_VID_STATUS_IMAGE_Y_EXTENT;
  3529.   MCI_OVLY_STATUS_BRIGHTNESS                   = MCI_VID_STATUS_BRIGHTNESS;
  3530.   MCI_OVLY_STATUS_CONTRAST                     = MCI_VID_STATUS_CONTRAST;
  3531.   MCI_OVLY_STATUS_HUE                          = MCI_VID_STATUS_HUE;
  3532.   MCI_OVLY_STATUS_SATURATION                   = MCI_VID_STATUS_SATURATION;
  3533.   MCI_OVLY_STATUS_GREYSCALE                    = MCI_VID_STATUS_GREYSCALE;
  3534.   MCI_OVLY_STATUS_IMAGE_QUALITY                = MCI_VID_STATUS_IMAGE_QUALITY;
  3535.   MCI_OVLY_STATUS_SHARPNESS                    = MCI_VID_STATUS_SHARPNESS;
  3536.   MCI_OVLY_STATUS_IMAGE_FILE_FORMAT            = MCI_VID_STATUS_IMAGE_FILE_FORMAT;
  3537.   MCI_OVLY_STATUS_TRANSPARENT_TYPE             = MCI_VID_STATUS_TRANSPARENT_TYPE;
  3538.   MCI_OVLY_STATUS_TRANSPARENT_COLOR            = MCI_VID_STATUS_TRANSPARENT_COLOR;
  3539.  
  3540.   // Status Mode return values
  3541.   MCI_MODE_NOT_READY            = $00000001;
  3542.   MCI_MODE_PAUSE                = $00000002;
  3543.   MCI_MODE_PLAY                 = $00000003;
  3544.   MCI_MODE_STOP                 = $00000004;
  3545.   MCI_MODE_RECORD               = $00000005;
  3546.   MCI_MODE_SEEK                 = $00000006;
  3547.  
  3548.   // Status Direction return values
  3549.   MCI_FORWARD                   = $00000000;
  3550.   MCI_REVERSE                   = $00000001;
  3551.  
  3552. type
  3553.   mci_Status_Parms = record
  3554.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3555.     ulReturn                    : uLong;       // Return field
  3556.     ulItem                      : uLong;       // Item field for STATUS item to query
  3557.     ulValue                     : uLong;       // Status value field (this used to be)
  3558.                                                //  ulTrack but was changed in Rel 1.1
  3559.                                                //  to extend the status structure.
  3560.                                                //  See the programming reference on when
  3561.                                                //  ulValue is used and how...
  3562.   end;
  3563.   pmci_Status_Parms = ^mci_Status_Parms;
  3564.  
  3565.   mci_CDXA_Status_Parms = record
  3566.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3567.     ulReturn                    : uLong;       // Return field
  3568.     ulItem                      : uLong;       // Item field for STATUS item to query
  3569.     ulValue                     : uLong;       // Status value field (this used to be)
  3570.                                                //  ulTrack but was changed in Rel 1.1
  3571.                                                //  to extend the status structure.
  3572.                                                //  See the programming reference on when
  3573.                                                //  ulValue is used and how...
  3574.     ulChannel                   : uLong;       // Channel
  3575.   end;
  3576.   pmci_CDXA_Status_Parms = ^mci_CDXA_Status_Parms;
  3577.  
  3578. const
  3579.   // flags and parameter structure for the MCI_STEP message
  3580.   //     $0000$00 are reserved for MCI_STEP flags
  3581.   MCI_STEP_FRAMES               = $00000100;
  3582.   MCI_STEP_REVERSE              = $00000200;
  3583.  
  3584. type
  3585.   mci_Step_Parms = record
  3586.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3587.     ulStep                      : uLong;       // amount to step in current time format
  3588.   end;
  3589.   pmci_Step_Parms = ^mci_Step_Parms;
  3590.  
  3591. const
  3592.   // Flags for the MCI_SYSINFO message
  3593.   //     $XXXXXX00 are reserved for MCI_SYSINFO flags
  3594.   MCI_SYSINFO_QUANTITY          = $00000100;
  3595.   MCI_SYSINFO_OPEN              = $00000200;
  3596.   MCI_SYSINFO_NAME              = $00000400;
  3597.   MCI_SYSINFO_INSTALLNAME       = $00000800;
  3598.   MCI_SYSINFO_ITEM              = $00001000;
  3599.   MCI_SYSINFO_INI_LOCK          = $00002000;
  3600.  
  3601.   // Extended SYSINFO functions
  3602.   MCI_SYSINFO_INSTALL_DRIVER    = $00000001;
  3603.   MCI_SYSINFO_QUERY_DRIVER      = $00000002;
  3604.   MCI_SYSINFO_DELETE_DRIVER     = $00000004;
  3605.   MCI_SYSINFO_SET_PARAMS        = $00000008;
  3606.   MCI_SYSINFO_QUERY_PARAMS      = $00000010;
  3607.   MCI_SYSINFO_SET_CONNECTORS    = $00000020;
  3608.   MCI_SYSINFO_QUERY_CONNECTORS  = $00000040;
  3609.   MCI_SYSINFO_SET_EXTENSIONS    = $00000080;
  3610.   MCI_SYSINFO_QUERY_EXTENSIONS  = $00000100;
  3611.   MCI_SYSINFO_SET_ALIAS         = $00000200;
  3612.   MCI_SYSINFO_QUERY_NAMES       = $00000400;
  3613.   MCI_SYSINFO_SET_DEFAULT       = $00000800;
  3614.   MCI_SYSINFO_QUERY_DEFAULT     = $00001000;
  3615.   MCI_SYSINFO_SET_TYPES         = $00002000;
  3616.   MCI_SYSINFO_QUERY_TYPES       = $00004000;
  3617.  
  3618.   // Device Flags
  3619.   MCI_SYSINFO_DEV_CONTROLLABLE  = $00000001;
  3620.   MCI_SYSINFO_DEV_NONCONTROLLABLE = $00000002;
  3621.   MCI_SYSINFO_DEVICESETTINGS    = $00000004;
  3622.  
  3623. type
  3624.   MaxDevNameChar = array [0..Max_Device_Name-1] of CHAR;
  3625.   MaxVerNumChar = array [0..Max_Version_Number-1] of CHAR;
  3626.   MaxProdInfChar = array [0..Max_ProdInfo-1] of CHAR;
  3627.   MaxPddNameChar = array [0..Max_Pdd_Name-1] of CHAR;
  3628.   MaxClsShort    = array [0..Max_Classes-1] of uShort;
  3629.   MaxClsShort2   = array [0..Max_Classes-1,0..Max_Classes-1] of uShort;
  3630.   MaxDevParmChar = array [0..Max_Dev_Params-1] of CHAR;
  3631.   // Parameter structures for the MCI_SYSINFO message
  3632.   mci_SysInfo_Parms = record
  3633.     hwndDummyCallback        : hwnd;           // NOTIFY not allowed for SYSINFO
  3634.     pszReturn                : pChar;          // Pointer to return buffer
  3635.     ulRetSize                : uLong;          // Return buffer size
  3636.     ulNumber                 : uLong;          // Ordinal Number
  3637.     usDeviceType             : uShort;         // MCI device type number
  3638.     usReserved0              : uShort;         // Reserved field
  3639.     ulItem                   : uLong;          // Used to indicate the MCI_SYSINFO
  3640.     pSysInfoParm             : Pointer;        // extended function to perform
  3641.   end;
  3642.   pmci_SysInfo_Parms = ^mci_SysInfo_Parms;
  3643.  
  3644.   mci_SysInfo_LogDevice = packed record
  3645.     szInstallName            : MaxDevNameChar; // Device install name
  3646.     usDeviceType             : uShort;         // Device type number
  3647.     ulDeviceFlag             : uLong;          // Flag indicating whether device
  3648.                                                //  device is controllable or not
  3649.     szVersionNumber          : MaxVerNumChar;  // INI file version number
  3650.     szProductInfo            : MaxProdInfChar; // Textual product description
  3651.     szMCDDriver              : MaxDevNameChar; // MCI Driver dll name
  3652.     szVSDDriver              : MaxDevNameChar; // VSD dll name
  3653.     szPDDName                : MaxPddNameChar; // Device PDD name
  3654.     szMCDTable               : MaxDevNameChar; // Device type command table
  3655.     szVSDTable               : MaxDevNameChar; // Device specific command table
  3656.     usShareType              : uShort;         // Device sharing mode
  3657.     szResourceName           : MaxDevNameChar; // Resource name
  3658.     usResourceUnits          : uShort;         // Total resource units available
  3659.                                                //  for this device
  3660.     usResourceClasses        : uShort;         // Number of resource classes for
  3661.                                                //  this device
  3662.     ausClassArray            : MaxClsShort;    // Maximum number of resource
  3663.                                                //  units for each class
  3664.     ausValidClassArray       : MaxClsShort2;   // Valid class combinations
  3665.   end;
  3666.   pmci_SysInfo_LogDevice = ^mci_SysInfo_LogDevice;
  3667.  
  3668.   mci_SysInfo_DevParams = record
  3669.     szInstallName            : MaxDevNameChar; // Device install name
  3670.     szDevParams              : MaxDevParmChar; // Device specific parameters
  3671.   end;
  3672.   pmci_SysInfo_DevParams = ^mci_SysInfo_DevParams;
  3673.  
  3674. type
  3675.   Connect = record
  3676.     usConnectType            : uShort;         // Connector type
  3677.     szToInstallName          : MaxDevNameChar; // Install name this connector
  3678.                                                //  is connected to
  3679.     usToConnectIndex         : uShort;         // Connector index this connector
  3680.                                                //  is connected to
  3681.   end;
  3682.   pConnect = ^Connect;
  3683.  
  3684.   MaxCnctCnct      = array[0..MAX_CONNECTORS-1] of Connect;
  3685.   MaxExtChar2      = array[0..MAX_EXTENSIONS-1,0..MAX_EXTENSION_NAME-1] of CHAR;
  3686.   MaxAliasNameChar = array[0..Max_Alias_Name-1] of Char;
  3687.   MaxTypeBufChar   = array[0..Max_TypeBuffer] of Char;
  3688.  
  3689.   mci_SysInfo_ConParams = record
  3690.     szInstallName            : MaxDevNameChar; // Device install name
  3691.     usNumConnectors          : uShort;         // Number of device connectors
  3692.     ConnectorList            : MaxCnctCnct;    // Connector list array
  3693.   end;
  3694.   pmci_SysInfo_ConParams = ^mci_SysInfo_ConParams;
  3695.  
  3696.   mci_SysInfo_Extension = record
  3697.     szInstallName            : MaxDevNameChar; // Device install name
  3698.     usNumExtensions          : uShort;         // Number of extensions
  3699.     szExtension              : MaxExtChar2;    // Extension name array
  3700.   end;
  3701.   pmci_SysInfo_Extension = ^mci_SysInfo_Extension;
  3702.  
  3703.   mci_SysInfo_Alias = record
  3704.     szInstallName            : MaxDevNameChar;   // Device install name
  3705.     szAliasName              : MaxAliasNameChar; // Alias name
  3706.   end;
  3707.   pmci_SysInfo_Alias = ^mci_SysInfo_Alias;
  3708.  
  3709.   mci_SysInfo_DefaultDevice = record
  3710.     szInstallName            : MaxDevNameChar; // Device install name
  3711.     usDeviceType             : uShort;         // Device type number
  3712.   end;
  3713.   pmci_SysInfo_DefaultDevice = ^mci_SysInfo_DefaultDevice;
  3714.  
  3715.   mci_SysInfo_Query_Name = record
  3716.     szInstallName            : MaxDevNameChar; // Device install name
  3717.     szLogicalName            : MaxDevNameChar; // Logical device name
  3718.     szAliasName              : MaxAliasNameChar; // Alias name
  3719.     usDeviceType             : uShort;         // Device type number
  3720.     usDeviceOrd              : uShort;         // Device type ordinal
  3721.   end;
  3722.   pmci_SysInfo_Query_Name = ^mci_SysInfo_Query_Name;
  3723.  
  3724.   mci_SysInfo_Types = record
  3725.     szInstallName            : MaxDevNameChar; // Device install name
  3726.     szTypes                  : MaxTypeBufChar; // EA types
  3727.   end;
  3728.   pmci_SysInfo_Types = ^mci_SysInfo_Types;
  3729.  
  3730.  
  3731. const
  3732.   // Flags for the MCI_UNFREEZE message
  3733.   //     $0000$00 are reserved for MCI_UNFREEZE flags
  3734.   MCI_OVLY_UNFREEZE_RECT         = $00000100;
  3735.   MCI_OVLY_UNFREEZE_RECT_OUTSIDE = $00000200;
  3736.  
  3737.   // Flags for the MCI_WHERE message
  3738.   //     $000$X00 are reserved for MCI_WHERE flags
  3739.   MCI_VID_WHERE_DESTINATION     = $00000100;
  3740.   MCI_VID_WHERE_SOURCE          = $00000200;
  3741.   MCI_VID_WHERE_WINDOW          = $00000400;
  3742.  
  3743.   MCI_DGV_WHERE_DESTINATION     = MCI_VID_WHERE_DESTINATION;
  3744.   MCI_DGV_WHERE_SOURCE          = MCI_VID_WHERE_SOURCE;
  3745.   MCI_DGV_WHERE_WINDOW          = MCI_VID_WHERE_WINDOW;
  3746.   MCI_DGV_WHERE_ADJUSTED        = $00000800;
  3747.  
  3748.   MCI_OVLY_WHERE_DESTINATION    = MCI_VID_WHERE_DESTINATION;
  3749.   MCI_OVLY_WHERE_SOURCE         = MCI_VID_WHERE_SOURCE;
  3750.   MCI_OVLY_WHERE_WINDOW         = MCI_VID_WHERE_WINDOW;
  3751.  
  3752.   // Flags and parameter structure for the MCI_WINDOW message
  3753.   //     $000$X00   are reserved for MCI_WINDOW flags
  3754.   MCI_VID_WINDOW_hwnd           = $00000100;
  3755.   MCI_VID_WINDOW_STATE          = $00000200;
  3756.   MCI_VID_WINDOW_TEXT           = $00000400;
  3757.   MCI_VID_WINDOW_DEFAULT        = $00000800;
  3758.  
  3759.   MCI_DGV_WINDOW_hwnd           = MCI_VID_WINDOW_hwnd;
  3760.   MCI_DGV_WINDOW_STATE          = MCI_VID_WINDOW_STATE;
  3761.   MCI_DGV_WINDOW_TEXT           = MCI_VID_WINDOW_TEXT;
  3762.   MCI_DGV_WINDOW_DEFAULT        = MCI_VID_WINDOW_DEFAULT;
  3763.  
  3764.   MCI_OVLY_WINDOW_hwnd          = MCI_VID_WINDOW_hwnd;
  3765.   MCI_OVLY_WINDOW_STATE         = MCI_VID_WINDOW_STATE;
  3766.   MCI_OVLY_WINDOW_TEXT          = MCI_VID_WINDOW_TEXT;
  3767.   MCI_OVLY_WINDOW_DEFAULT       = MCI_VID_WINDOW_DEFAULT;
  3768.  
  3769. type
  3770.   mci_Vid_Window_Parms = record
  3771.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3772.     hwndDest                    : hwnd;        // Handle to the client window used for
  3773.                                                // the destination of the video image
  3774.     usCmdShow                   : uShort;      // Specifies how the window is displayed
  3775.     usReserved1                 : uShort;      // Reserved
  3776.     pszText                     : pChar;       // The text to use as the window caption
  3777.     pszAlias                    : pChar;       // The window alias for the display window
  3778.   end;
  3779.   pmci_Vid_Window_Parms = ^mci_Vid_Window_Parms;
  3780.  
  3781.   mci_dgv_Window_Parms = mci_Vid_Window_Parms;
  3782.   pmci_dgv_Window_Parms = ^mci_dgv_Window_Parms;
  3783.  
  3784.   mci_Ovly_Window_Parms = mci_Vid_Window_Parms;
  3785.   pmci_Ovly_Window_Parms = ^mci_Ovly_Window_Parms;
  3786.  
  3787. const
  3788.   // flags and parameter structure for the MCI_TUNER  message
  3789.   MCI_DGV_AUDIO_CHANNEL         = $00010000;
  3790.   MCI_DGV_TV_CHANNEL            = $00020000;
  3791.   MCI_DGV_FREQUENCY             = $00040000;
  3792.   MCI_DGV_FINETUNE_PLUS         = $00080000;
  3793.   MCI_DGV_FINETUNE_MINUS        = $00100000;
  3794.   MCI_DGV_REGION                = $00200000;
  3795.   MCI_DGV_AFC_ON                = $00400000;
  3796.   MCI_DGV_AFC_OFF               = $00800000;
  3797.  
  3798. type
  3799.   mci_Dgv_Tuner_Parms = record
  3800.     hwndCallback                : hwnd;        // PM window handle for MCI notify message
  3801.     ulFrequency                 : uLong;       // Tuner Frequency
  3802.     ulReserved0                 : uLong;       // Reserved 0
  3803.     ulTVChannel                 : uLong;       // TV Channel
  3804.     lFineTune                   : Long;        // Fine tuning adjustments.
  3805.     pszRegion                   : pChar;       // TV Channel Region
  3806.     ulReserved1                 : uLong;       // Reserved 1
  3807.     ulReserved2                 : uLong;       // Reserved 2
  3808.   end;
  3809.   pmci_Dgv_Tuner_Parms = ^mci_Dgv_Tuner_Parms;
  3810.  
  3811. const
  3812.   //  MCI system value defines
  3813.   MSV_CLOSEDCAPTION             = $0;
  3814.   MSV_MASTERVOLUME              = $1;
  3815.   MSV_HEADPHONES                = $2;
  3816.   MSV_SPEAKERS                  = $3;
  3817.   MSV_WORKPATH                  = $4;
  3818.   MSV_SYSQOSVALUE               = $5;
  3819.   MSV_SYSQOSERRORFLAG           = $6;
  3820.  
  3821.   MSV_MAX                       = $7;
  3822.  
  3823.   // Playlist defines
  3824.   DATA_OPERATION                = 0;
  3825.   BRANCH_OPERATION              = 1;
  3826.   LOOP_OPERATION                = 2;
  3827.   CALL_OPERATION                = 3;
  3828.   RETURN_OPERATION              = 4;
  3829.   EXIT_OPERATION                = 5;
  3830.   NOP_OPERATION                 = 6;
  3831.   MESSAGE_OPERATION             = 7;
  3832.   CUEPOINT_OPERATION            = 8;
  3833.  
  3834. function mciSendCommand(usDeviceID: uShort; usMessage: uShort; ulParam1: uLong;
  3835.          var Param2; usUserParm: uShort): Ulong;
  3836.  
  3837. function mciSendString(pszCommandBuf: pChar; pszReturnString: pChar;
  3838.          wReturnLength: uShort; hwndCallBack: hwnd; usUserParm: uShort): Ulong;
  3839.  
  3840. function mciGetErrorString(ulError: uLong; pszBuffer: pChar; usLength: uShort): Ulong;
  3841.  
  3842. function mciMakeGroup(var usDeviceGroupID:uShort; usDeviceCount: uShort;
  3843.              var ausDeviceList: uShort; ulFlags: uLong; ulMMTime: uLong): Ulong;
  3844.  
  3845. function mciDeleteGroup(usGroupID:uShort): Ulong;
  3846.  
  3847. function mciSetSysValue(iSysValue: uShort; var Value): Bool;
  3848.  
  3849. function mciQuerySysValue(iSysValue: uShort;var Value): Bool;
  3850.  
  3851. function mciGetDeviceID(pszName: pChar): uLong;
  3852.  
  3853. {----[ MMDRVOS2 ]----}  // 13k
  3854.  
  3855. type
  3856.   gID = uShort;
  3857.  
  3858. const
  3859.   //             MCI Driver  message identifiers
  3860.   MCIDRV_SAVE                   = 900;
  3861.   MCIDRV_RESTORE                = 901;
  3862.   MCIDRV_SYNC                   = 902;
  3863.   MCIDRV_CHANGERESOURCE         = 903;
  3864.   MCIDRV_CONNECT                = 904;
  3865.   MCIDRV_ASSOCIATE              = 905;
  3866.   MCIDRV_DISCONNECT             = 906;
  3867.   MCIDRV_TEST_CONNECTION        = 907;
  3868.   MCIDRV_START                  = 908;
  3869.   MCIDRV_SEEK                   = 909;
  3870.   MCIDRV_STOP                   = 910;
  3871.   MCIDRV_MODIFY_CONNECTION      = 911;
  3872.   MCIDRV_INIT_CONNECTION        = 912;
  3873.   MCIDRV_DEINIT_CONNECTION      = 913;
  3874.  
  3875.   // The following messages are used by the MCIDRV_CONNECT message
  3876.   MCIDRV_CONNECT_TARGET         = $00010000;
  3877.   MCIDRV_CONNECT_SOURCE         = $00020000;
  3878.   MCIDRV_SET_CONNNECTOR_TYPE    = $00040000;
  3879.   MCIDRV_CHANGE_SEM             = $00080000;
  3880.  
  3881.   // The following messages are used by MCIDRV_START
  3882.   MCIDRV_CUE_PLAYBACK           = $00010000;
  3883.   MCIDRV_CUE_RECORD             = $00020000;
  3884.   MCIDRV_START_PLAYBACK         = $00040000;
  3885.   MCIDRV_START_RECORD           = $00080000;
  3886.   MCIDRV_START_PREROLL          = $00100000;
  3887.  
  3888.   // The following messages are used by MCIDRV_ASSOCIATE
  3889.   MCIDRV_OUTPUT                 = $00010000;
  3890.   MCIDRV_INPUT                  = $00020000;
  3891.  
  3892.   // The following messages are used by MCIDRV_STOP
  3893.   MCIDRV_PAUSE_STREAM_NETWORK   = $00010000;
  3894.   MCIDRV_FLUSH_STREAM_NETWORK   = $00020000;
  3895.   MCIDRV_DISCARD_STREAM_NETWORK = $00040000;
  3896.  
  3897.   // The following range of message ID's are reserved for internal use
  3898.   //  by MCI drivers
  3899.   MCI_INTERNAL_MESSAGES_START   = 1000;
  3900.   MCI_INTERNAL_MESSAGES_END     = 1999;
  3901.  
  3902.   // Flags used by the string parser for command tables
  3903.   MCI_COMMAND_HEAD              = $00000001;
  3904.   MCI_END_COMMAND               = $00000002;
  3905.   MCI_END_COMMAND_LIST          = $00000003;
  3906.   MCI_RETURN                    = $00000004;
  3907.   MCI_STRING                    = $00000005;
  3908.   MCI_FLAG                      = $00000006;
  3909.   MCI_INTEGER                   = $00000007;
  3910.   MCI_CONSTANT                  = $00000008;
  3911.   MCI_CONSTANT_INTEGER          = $00000009;
  3912.   MCI_CONSTANT_STRING           = $0000000A;
  3913.   MCI_END_CONSTANT              = $0000000B;
  3914.   MCI_DEFAULT_STRING            = $0000000C;
  3915.   MCI_DEFAULT_INTEGER           = $0000000D;
  3916.   MCI_RETURN_TYPE               = $0000000E;
  3917.   MCI_RETURN_TYPE_STRING        = $0000000F;
  3918.   MCI_END_RETURN_TYPE           = $00000010;
  3919.   MCI_CONSTANT_2                = $00000011;
  3920.   MCI_END_CONSTANT_2            = $00000012;
  3921.   MCI_CONSTANT_PAIR             = $00000013;
  3922.   MCI_END_CONSTANT_PAIR         = $00000014;
  3923.   MCI_CONSTANT_INTEGER_PAIR     = $00000015;
  3924.   MCI_CONSTANT_STRING_PAIR      = $00000016;
  3925.   MCI_RECTL                     = $00000017;
  3926.   MCI_CONSTANT_4                = $00000018;
  3927.   MCI_END_CONSTANT_4            = $00000019;
  3928.   MCI_FOURCC                    = $0000001A;
  3929.   MCI_OR                        = $0000001B;
  3930.   MCI_END_OR                    = $0000001C;
  3931.   MCI_STRING_LIST               = $0000001D;
  3932.  
  3933.   // Return types supported by mciSendString
  3934.   //   Values $0000 -> $FF00  are reserved by MMPM2
  3935.   //   Values $FF01 -> $FFFF  are user definable
  3936.   MCI_INTEGER_RETURNED          = $1000;
  3937.   MCI_COLONIZED2_RETURN         = $2000;
  3938.   MCI_COLONIZED3_RETURN         = $3000;
  3939.   MCI_COLONIZED4_RETURN         = $4000;
  3940.   MCI_TRUE_FALSE_RETURN         = $5000;
  3941.   MCI_ON_OFF_RETURN             = $6000;
  3942.   MCI_DEVICENAME_RETURN         = $7000;
  3943.   MCI_TIME_FORMAT_RETURN        = $8000;
  3944.   MCI_SPEED_FORMAT_RETURN       = $9000;
  3945.   MCI_MODE_RETURN               = $A000;
  3946.   MCI_MEDIA_TYPE_RETURN         = $B000;
  3947.   MCI_TRACK_TYPE_RETURN         = $C000;
  3948.   MCI_CONNECTOR_TYPE_RETURN     = $D000;
  3949.   MCI_CDXA_CHANNEL_DESTINATION_RETURN = $E000;
  3950.   MCI_PREROLL_TYPE_RETURN       = $F000;
  3951.   MCI_FORMAT_TAG_RETURN         = $F100;
  3952.   MCI_SEQ_SYNCHRONIZATION_RETURN = $F200;
  3953.   MCI_VIDEO_QUALITY_RETURN      = $F300;
  3954.   MCI_AUDIO_QUALITY_RETURN      = $F400;
  3955.   MCI_IMAGE_QUALITY_RETURN      = $F500;
  3956.   MCI_VIDEO_COMPRESSION_RETURN  = $F600;
  3957.   MCI_AUDIO_COMPRESSION_RETURN  = $F700;
  3958.   MCI_IMAGE_COMPRESSION_RETURN  = $F800;
  3959.   MCI_RECTL_RETURN              = $F900;
  3960.   MCI_FOURCC_RETURN             = $FA00;
  3961.   MCI_IMAGE_PELFORMAT_RETURN    = $FB00;
  3962.   MCI_DIRECTION_RETURN          = $FC00;
  3963.   MCI_SIGNED_INTEGER_RETURN     = $FD00;
  3964.  
  3965.   MCI_USER_RETURN               = $FF01;
  3966.  
  3967.   // End of msg text used by mciGetErrorString
  3968.   MCIERR_MSG_TABLE_END          = MCIERR_BASE + 7000;
  3969.  
  3970.   //  MCI DEVICE shareability categories
  3971.   FIXEDSINGLECONTEXT            = $0001;
  3972.   DYNAMICSINGLECONTEXT          = $0002;
  3973.   LIMITEDMULTIPLECONTEXT        = $0003;
  3974.   UNLIMITEDMULTIPLECONTEXT      = $0004;
  3975.  
  3976.   // MCI driver flag for close during exit list processing
  3977.   MCI_CLOSE_EXIT                = $10000000;
  3978.  
  3979.   // MCI driver specific error table resource number base
  3980.   MMERROR_TABLE_BASE            = 500;
  3981.  
  3982.   //  MCIDRV_CHANGERESOURCE  message flags
  3983. type
  3984.   mciDrv_ChangeResource_Parms = record
  3985.     pInstance                   : Pointer;     // pointer to device instance
  3986.     usResourceUnits             : uShort;      // required resource units
  3987.     usResourceClass             : uShort;      // resource class
  3988.     usResourcePriority          : uShort;      // resource priority
  3989.   end;
  3990.   pmciDrv_ChangeResource_Parms = ^mciDrv_ChangeResource_Parms;
  3991.  
  3992. const
  3993.   //  MCIDRV_SYNC  message flags
  3994.   MCIDRV_SYNC_ENABLE            = $00000100;
  3995.   MCIDRV_SYNC_DISABLE           = $00000200;
  3996.   MCIDRV_SYNC_REC_PULSE         = $00000400;
  3997.   MCIDRV_SYNC_MASTER            = $00000800;
  3998.   MCIDRV_SYNC_SET_MASTER        = $00001000;
  3999.  
  4000. type
  4001.   mciDrv_Sync_Parms = record
  4002.     hStreams                    : ^hStream;    // Pointer to list of stream IDs
  4003.     ulNumStreams                : uLong;       // number of stream IDs
  4004.     mmTime                      : mmTime;      // Sync Pulse Time
  4005.     NonStreamMaster             : Bool;        // TRUE if this device can be master
  4006.     pevcbSyncPulse              : pSync_evcb;  // pointer to EVCB address (output)
  4007.     hidMaster                   : hID;         // Master NULL sh ID (valid only on
  4008.                                                //    MCIDRV_SYNC_MASTER
  4009.     ulReserved1                 : uLong;       // Reserved field
  4010.     ulReserved2                 : uLong;       // Reserved field
  4011.   end;
  4012.   pmciDrv_Sync_Parms = ^mciDrv_Sync_Parms;
  4013.  
  4014.   // Contains information for open message for MCI drivers
  4015.   mmDrv_Open_Parms = record
  4016.     hwndCallback                : hwnd;        // call back handle
  4017.     usDeviceID                  : uShort;      // The device ID assigned to this instance
  4018.     usDeviceType                : uShort;      // The device type number
  4019.     usDeviceOrd                 : uShort;      // The device ordinal number
  4020.     pInstance                   : Pointer;     //  pointer to the instance structure allocated
  4021.                                                //  initialized by the driver. The MCI driver
  4022.                                                // will fill in this parameter.
  4023.     szDevDLLName : Array[0..259] of Char;      // Character string containing the device
  4024.                                                // specific DLL name to call for the open.
  4025.                                                // (ie. ACPA.DLL)
  4026.     pszElementName              : pChar;       //   typically a file name or NULL
  4027.     usDevParmLen                : uShort;      // Device parameters data block length.
  4028.     pDevParm                    : Pointer;     // Device parameters data block. This data
  4029.                                                // block is unique to each type of device.
  4030.                                                // (ie. LVD "COM1 9600 N 7 1").
  4031.     Reserved0                   : Pointer;
  4032.     usResourceUnitsRequired     : uShort;      // number of resource units this instance
  4033.                                                // requires.
  4034.     usResourceClass             : uShort;      // resource class this instance belongs to
  4035.     usResourcePriority          : uShort;      // resource priority for this instance
  4036.     ulParam2                    : uLong;       // Pointer to MCI_OPEN structure
  4037.   end;
  4038.   pmmDrv_Open_Parms = ^mmDrv_Open_Parms;
  4039.  
  4040.  
  4041. function mdmDriverNotify( usDeviceID: uShort; wnd: Hwnd; usMsgType: uShort;
  4042.                           usUserParm: uShort; ulMsgParm: uLong): uLong;
  4043.  
  4044. {----[ MMIOOS2 ]----}
  4045.  
  4046. type
  4047.   hmmcf = hmmIO;
  4048.   FourCC = uLong;
  4049.   pFourCC = ^FourCC;
  4050.   hPStr = pChar;
  4051.  
  4052. // Define MMIO public data structures.
  4053.   mmCkInfo = record
  4054.     ckid              : FourCC;                // Chunk id (FourCC)
  4055.     ckSize            : uLong;                 // Chunk Size (bytes)
  4056.     fccType           : FourCC;                // FourCC Type (if ckid RIFF or LIST)
  4057.     ulDataOffset      : uLong;                 // File Offset of data portion of chunk
  4058.     ulFlags           : uLong;                 // MMIO_DIRTY (if new chunk)
  4059.   end;
  4060.   pmmCkInfo = ^mmCkInfo;
  4061.  
  4062.   mmIOProc = function( pmmIOInfo: Pointer; usMsg: uShort; lp1, lp2: Long): Long;
  4063.   pmmIOProc = mmIOProc;
  4064.   pCodecProc = mmIOProc;
  4065.  
  4066.   mmIOInfo = record
  4067.     ulFlags           : uLong;                 // Open flags
  4068.     fccIOProc         : FourCC;                // FourCC of the IOProc to use
  4069.     pIOProc           : mmIOProc;              // Function Pointer to IOProc to use
  4070.     ulErrorRet        : uLong;                 // Extended Error return code
  4071.     cchBuffer         : Long;                  // I/O buff size (if used), Fsize if MEM
  4072.     pchBuffer         : pChar;                 // Start of I/O buff
  4073.     pchNext           : pChar;                 // Next char to read or write in buff
  4074.     pchEndRead        : pChar;                 // Last char in buff can be read + 1
  4075.     pchEndWrite       : pChar;                 // Last char in buff can be written + 1
  4076.     lBufOffset        : Long;                  // Offset in buff to pchNext
  4077.     lDiskOffset       : Long;                  // Disk offset in file
  4078.     aulInfo           : Array[0..3] of uLong;  // IOProc specific fields
  4079.     lLogicalFilePos   : Long;                  // Actual file position, buffered or not
  4080.     ulTranslate       : uLong;                 // Translation field
  4081.     fccChildIOProc    : FourCC;                // FourCC of Child IOProc
  4082.     pExtraInfoStruct  : Pointer;               // Pointer to a structure of related data
  4083.     mmio              : hmmIO;                 // Handle to media element
  4084.   end;
  4085.   pmmIOInfo = ^mmIOInfo;
  4086.  
  4087.   mmCfInfo = record
  4088.     ulHeaderSize      : uLong;                 // CTOC header size
  4089.     ulEntriesTotal    : uLong;                 // Num of CTOC table entries
  4090.     ulEntriesDeleted  : uLong;                 // Num of CTOC table entries deleted
  4091.     ulEntriesUnused   : uLong;                 // Num of unused CTOC entries
  4092.     ulBytesTotal      : uLong;                 // Combined byte size of all CGRP elements
  4093.     ulBytesDeleted    : uLong;                 // Byte size of all deleted CGRP elements
  4094.     ulHeaderFlags     : uLong;                 // Info about entire compound file (CF)
  4095.     usEntrySize       : uShort;                // Size of each CTOC table entry
  4096.     usNameSize        : uShort;                // Size of name field in entry, default 13
  4097.     usExHdrFields     : uShort;                // Num CTOC header extra fields
  4098.     usExEntFields     : uShort;                // Num CTOC entry extra fields
  4099.   end;
  4100.  
  4101. // Note:  These are variable length uLong arrays that may be present
  4102. //        at the end of the MMCFINFO structure.
  4103.  
  4104. //   uLong    (*aulExHdrFldUsage)[]   * Array of header extra usage fields
  4105. //   uLong    (*aulExtEntFldUsage)[]  * Array of entry extra usage fields
  4106. //   uLong    (*aulExHdrField)[]      * Array of header extra fields
  4107.  
  4108.   pmmCfInfo = ^mmCfInfo;
  4109.  
  4110.   mmCtocEntry = record
  4111.     ulOffset          : uLong;                 // Offset of element within CGRP
  4112.     ulSize            : uLong;                 // Size of element
  4113.     ulMedType         : uLong;                 // Fourcc of element
  4114.     ulMedUsage        : uLong;                 // Possible sub type
  4115.     ulCompressTech    : uLong;                 // Compression technique used
  4116.     ulUncompressBytes : uLong;                 // Actual size of uncompressed element
  4117.   end;
  4118.  
  4119. // Note:  A variable length name field and possibly a uLong array may
  4120. //        be present at the end of the MMCTOCENTRY structure.
  4121.  
  4122. //   uLong    (*aulExEntField)[];  * Array of entry extra fields
  4123. //   PSZ      pszElementName[];    * Name of element, variable length
  4124.  
  4125.   pmmCtocEntry = ^mmCtocEntry;
  4126.  
  4127.  
  4128. const
  4129.   // Conversion Flags/Data Structures:
  4130.   MMIO_MEDIATYPE_IMAGE          = $00000001;  // Image media
  4131.   MMIO_MEDIATYPE_AUDIO          = $00000002;  // Audio media
  4132.   MMIO_MEDIATYPE_MIDI           = $00000004;  // MIDI media
  4133.   MMIO_MEDIATYPE_COMPOUND       = $00000008;  // Cmpd media
  4134.   MMIO_MEDIATYPE_OTHER          = $00000010;  // Other media
  4135.   MMIO_MEDIATYPE_UNKNOWN        = $00000020;  // Unknown media
  4136.   MMIO_MEDIATYPE_DIGITALVIDEO   = $00000040;  // Digital Video
  4137.   MMIO_MEDIATYPE_ANIMATION      = $00000080;  // Future: Not Supported
  4138.   MMIO_MEDIATYPE_MOVIE          = $00000100;  // Movie File
  4139.  
  4140.   MMIO_CANREADTRANSLATED        = $00000001;  //IOProc Cpbilty Flgs
  4141.   MMIO_CANWRITETRANSLATED       = $00000002;  // "       "       "
  4142.   MMIO_CANREADWRITETRANSLATED   = $00000004;  // "       "       "
  4143.   MMIO_CANREADUNTRANSLATED      = $00000008;  // "       "       "
  4144.   MMIO_CANWRITEUNTRANSLATED     = $00000010;  // "       "       "
  4145.   MMIO_CANREADWRITEUNTRANSLATED = $00000020;  // "       "       "
  4146.   MMIO_CANSEEKTRANSLATED        = $00000040;  // "       "       "
  4147.   MMIO_CANSEEKUNTRANSLATED      = $00000080;  // "       "       "
  4148.   MMIO_CANINSERTUNTRANSLATED    = $00000100;  // "       "       "
  4149.   MMIO_CANSAVEUNTRANSLATED      = $00000200;  // "       "       "
  4150.   MMIO_CANINSERTTRANSLATED      = $00000400;  // "       "       "
  4151.   MMIO_CANSAVETRANSLATED        = $00000800;  // "       "       "
  4152.   MMIO_CANMULTITRACKREADTRANSLATED = $00001000; // "       "       "
  4153.   MMIO_CANMULTITRACKREADUNTRANSLATED = $00002000; // "       "       "
  4154.   MMIO_CANMULTITRACKWRITETRANSLATED = $00004000; // "       "       "
  4155.   MMIO_CANMULTITRACKWRITEUNTRANSLATED = $00008000; // "       "       "
  4156.   MMIO_CANTRACKSEEKTRANSLATED   = $00010000;  // "       "       "
  4157.   MMIO_CANTRACKSEEKUNTRANSLATED = $00020000;  // "       "       "
  4158.   MMIO_CANTRACKREADTRANSLATED   = $00040000;  // "       "       "
  4159.   MMIO_CANTRACKREADUNTRANSLATED = $00080000;  // "       "       "
  4160.   MMIO_CANTRACKWRITETRANSLATED  = $00100000;  // "       "       "
  4161.   MMIO_CANTRACKWRITEUNTRANSLATED = $00200000; // "       "       "
  4162.  
  4163.   MMIO_IOPROC_STORAGESYSTEM     = $00000001;  // IOProc Types
  4164.   MMIO_IOPROC_FILEFORMAT        = $00000002;
  4165.   MMIO_IOPROC_DATAFORMAT        = $00000004;
  4166.  
  4167. type
  4168.   mmFormatInfo = record
  4169.     ulStructLen       : uLong;                 // Length of this structure
  4170.     fccIOProc         : FourCC;                // IOProc identifier
  4171.     ulIOProcType      : uLong;                 // Type of IOProc
  4172.     ulMediaType       : uLong;                 // Media Type
  4173.     ulFlags           : uLong;                 // IOProc capability flags
  4174.     szDefaultFormatExt : Array[0..Sizeof(FourCC)] of Char;
  4175.                                                // Default extension 4 + null
  4176.     ulCodePage        : uLong;                 // Code Page
  4177.     ulLanguage        : uLong;                 // Language
  4178.     lNameLength       : Long;                  // length of identifier string
  4179.   end;
  4180.   pmmFormatInfo = ^mmFormatInfo;
  4181.  
  4182. const
  4183.   MMIO_IMAGE_UNKNOWN            = $00000000;   // Unknown image content
  4184.   MMIO_IMAGE_DRAWING            = $00000001;   // Simple drawing
  4185.   MMIO_IMAGE_GRAPH              = $00000002;   // Graphs & Cartoons
  4186.   MMIO_IMAGE_PHOTO              = $00000004;   // Varying Color & Shades
  4187.  
  4188.   MAX_PALETTE                   = 256;
  4189.  
  4190. type
  4191.   xdibHdr_Prefix = record
  4192.     ulMemSize         : uLong;                 // Length of bitmap
  4193.     ulPelFormat       : uLong;
  4194.     usTransType       : uShort;
  4195.     ulTransVal        : uLong;
  4196.   end;
  4197.  
  4198.   mmxdibHeader = record                        // XDIB Header
  4199.     XDIBHeaderPrefix  : XDIBHDR_PREFIX;
  4200.     BMPInfoHeader2    : BITMAPINFOHEADER2;
  4201.   end;
  4202.   pmmxdibHeader = ^mmxdibHeader;
  4203.  
  4204.   mmImageHeader = record
  4205.     ulHeaderLength    : uLong;                 // Length in Bytes
  4206.     ulContentType     : uLong;                 // Image content
  4207.     ulMediaType       : uLong;                 // Media Type
  4208.     mmXDIBHeader      : mmXDIBHeader;          // OS/2 2.0 PM compat header
  4209.     bmiColors         : Array[0..MAX_PALETTE-1] of RGB2; // PM compatible palette
  4210.   end;
  4211.   pmmImageHeader = ^mmImageHeader;
  4212.  
  4213. const
  4214.   MMIO_AUDIO_UNKNOWN            = $00000000;   // Unknown image content
  4215.   MMIO_AUDIO_VOICE              = $00000001;   // Limited Range
  4216.   MMIO_AUDIO_MUSIC              = $00000002;   // FM Radio or equivalent
  4217.   MMIO_AUDIO_HIFI               = $00000004;   // High quality recording
  4218.  
  4219. type
  4220.   Wave_Header = record
  4221.     usFormatTag       : uShort;                // Type of wave format
  4222.     usChannels        : uShort;                // Number of channels
  4223.     ulSamplesPerSec   : uLong;                 // Sampling rate
  4224.     ulAvgBytesPerSec  : uLong;                 // Avg bytes per sec
  4225.     usBlockAlign      : uShort;                // Block Alignment in bytes
  4226.     usBitsPerSample   : uShort;                // Bits per sample
  4227.   end;
  4228.  
  4229.   xWav_HeaderInfo = record
  4230.     ulAudioLengthInMS      : uLong;            // Audio data in millisecs
  4231.     ulAudioLengthInBytes   : uLong;            // Audio data in bytes
  4232.     pAdditionalInformation : Pointer;
  4233.   end;
  4234.  
  4235.   mmxWav_Header = record
  4236.     WAVEHeader        : WAVE_HEADER;           // Per RIFF WAVE Definition
  4237.     XWAVHeaderInfo    : XWAV_HEADERINFO;       // Extended wave definition
  4238.   end;
  4239.  
  4240.   mmAudioHeader = record
  4241.     ulHeaderLength    : uLong;                 // Length in Bytes
  4242.     ulContentType     : uLong;                 // Image content
  4243.     ulMediaType       : uLong;                 // Media Type
  4244.     mmXWAVHeader      : MMXWAV_HEADER;         // header
  4245.   end;
  4246.   pmmAudioHeader = ^mmAudioHeader;
  4247.  
  4248. const
  4249.   MMIO_MIDI_UNKNOWN             = $00000000;  // Unknown midi content
  4250.   MMIO_MIDI_VOICE               = $00000001;  // Limited Range
  4251.   MMIO_MIDI_MUSIC               = $00000002;  // FM Radio or equivalent
  4252.   MMIO_MIDI_HIFI                = $00000004;  // High quality recording
  4253.  
  4254. // MMPMMMIO.INI file structure and definitions.
  4255.  
  4256.   DLLNAME_SIZE                  = CCHMAXPATH;
  4257.   PROCNAME_SIZE                 = 32;
  4258.  
  4259. type
  4260.   mmIniFileInfo = record
  4261.     fccIOProc         : FourCC;                // IOProc identifier
  4262.     szDLLName         : Array[0..DLLName_Size-1] of Char;  // DLL name string
  4263.     szProcName        : Array[0..ProcName_Size-1] of Char; // Procedure name string
  4264.     ulFlags           : uLong;                 // Flags for Preload
  4265.     ulExtendLen       : uLong;                 // Length of ext fields
  4266.     ulMediaType       : uLong;                 // Media type
  4267.     ulIOProcType      : uLong;                 // Type of IOProc
  4268.     szDefExt          : Array[0..Max_Extension_Name] of Char;
  4269.   end;
  4270.   pmmIniFileInfo = ^mmIniFileInfo;
  4271.  
  4272. // CODEC Structures and type definitions for Rel. 1.1
  4273.  
  4274. const
  4275.   CODEC_INFO_SIZE               = 8;
  4276.   CODEC_HW_NAME_SIZE            = 32;
  4277.  
  4278. type
  4279.   CodecIniFileInfo = record
  4280.     ulStructLen       : uLong;                 // length of this structure
  4281.     fcc               : FourCC;                // File Format ID
  4282.     szDLLName         : Array[0..DLLName_Size-1] of Char;       // DLL name string
  4283.     szProcName        : Array[0..ProcName_Size-1] of Char;      // Procedure name string
  4284.     ulCompressType    : uLong;                 // Compression Type
  4285.     ulCompressSubType : uLong;                 // Compression SubType
  4286.     ulMediaType       : uLong;                 // Media type
  4287.     ulCapsFlags       : uLong;                 // capabilities flags
  4288.     ulFlags           : uLong;                 // flags
  4289.     szHWID            : Array[0..Codec_HW_Name_Size-1] of Char; // specific information
  4290.     ulMaxSrcBufLen    : uLong;                 // max source buffer length
  4291.     ulSyncMethod      : uLong;                 // Synchronization method
  4292.     fccPreferredFormat: uLong;                 // Preferred output format
  4293.     ulXalignment      : uLong;                 // x alignment - video only
  4294.     ulYalignment      : uLong;                 // y alignment - video only
  4295.     ulSpecInfo        : Array[0..Codec_Info_Size-1] of uLong;   // specific information
  4296.   end;
  4297.   pCodecIniFileInfo = ^CodecIniFileInfo;
  4298.  
  4299. const
  4300.   // CODECINIFILEINFO synchronization method (ulSyncMethod) values.
  4301.   CODEC_SYNC_METHOD_NO_DROP_FRAMES = 0;
  4302.   CODEC_SYNC_METHOD_DROP_FRAMES_IMMEDIATELY = 1;
  4303.   CODEC_SYNC_METHOD_DROP_FRAMES_PRECEDING_KEY = 2;
  4304.   CODEC_SYNC_METHOD_HARDWARE    = 3;
  4305.  
  4306.   // CODECINIFILEINFO capabilities (ulCapsFlags) values.
  4307.   CODEC_COMPRESS                = $00000001;
  4308.   CODEC_DECOMPRESS              = $00000002;
  4309.   CODEC_WINDOW_CLIPPING         = $00000004;
  4310.   CODEC_PALETTE_TRANS           = $00000008;
  4311.   CODEC_SELFHEAL                = $00000010;
  4312.   CODEC_SCALE_PEL_DOUBLE        = $00000020;
  4313.   CODEC_SCALE_PEL_HALVED        = $00000040;
  4314.   CODEC_SCALE_CONTINUOUS        = $00000080;
  4315.   CODEC_MULAPERTURE             = $00000100;
  4316.   CODEC_4_BIT_COLOR             = $00000200;
  4317.   CODEC_8_BIT_COLOR             = $00000400;
  4318.   CODEC_16_BIT_COLOR            = $00000800;
  4319.   CODEC_24_BIT_COLOR            = $00001000;
  4320.   CODEC_HARDWARE                = $00002000;
  4321.   CODEC_SYMMETRIC               = $00004000;
  4322.   CODEC_ASYMMETRIC              = $00008000;
  4323.   CODEC_DIRECT_DISPLAY          = $00010000;
  4324.   CODEC_DEFAULT                 = $00020000;
  4325.   CODEC_ORIGIN_LOWERLEFT        = $00040000;
  4326.   CODEC_ORIGIN_UPPERLEFT        = $00080000;
  4327.   CODEC_SET_QUALITY             = $00100000;  // quality level is settable
  4328.   CODEC_DATA_CONSTRAINT         = $00200000;  // data constraint supported
  4329.   CODEC_HW_OVERLAY              = $00400000;
  4330.   CODEC_MULTI_BUFFER            = $00800000;
  4331.   CODEC_DITHER_OUTPUT           = $01000000;
  4332.  
  4333.   // Audio related flags
  4334.   CODEC_COMP_REALTIME           = $00020000;
  4335.   CODEC_DECOMP_REALTIME         = $00040000;
  4336.  
  4337. // CODECINIFILEINFO Flag Values (ulFlags) values.
  4338.  
  4339.   // Bit definitions for mmioSet()
  4340.   MMIO_SET_EXTENDEDINFO         = $0001;
  4341.   MMIO_QUERY_EXTENDEDINFO_BASE  = $0002;
  4342.   MMIO_QUERY_EXTENDEDINFO_ALL   = $0004;
  4343.  
  4344. type
  4345.   // CODECASSOC structure
  4346.   CodecAssoc = record
  4347.    pCodecOpen         : Pointer;               // codec specific open header
  4348.    pCODECIniInfo      : PCodecIniFileInfo;     // codecinifileinfo
  4349.   end;
  4350.   pCodecAssoc = ^CodecAssoc;
  4351.  
  4352.   // MMEXTENDINFO structure
  4353.   mmExtendInfo = record
  4354.     ulStructLen       : uLong;             // length of this structure
  4355.     ulBufSize         : uLong;             // total buffer size
  4356.     ulFlags           : uLong;             // flags
  4357.     ulTrackID         : uLong;             // track ID
  4358.     ulNumCODECs       : uLong;             // number of codec entries
  4359.     pCODECAssoc       : PCodecAssoc;       // pointer to codec info array
  4360.   end;
  4361.   pmmExtendInfo = ^mmExtendInfo;
  4362.  
  4363. const
  4364.   // MMEXTENDINFO operation (ulFlags) values.
  4365.   MMIO_TRACK                    = $00000001;
  4366.   MMIO_NORMAL_READ              = $00000002;
  4367.   MMIO_SCAN_READ                = $00000004;
  4368.   MMIO_REVERSE_READ             = $00000008;
  4369.   MMIO_CODEC_ASSOC              = $00000100;
  4370.  
  4371. // Audio Related defines
  4372.  
  4373.   MMIO_REALTIME_CODEC           = $00000200;
  4374.  
  4375.   MMIO_RESETTRACKS              = -1;       //  Turns off the active track number.
  4376.  
  4377.   CODEC_START                   = $0EC0;
  4378.   CODEC_END                     = $0EFF;
  4379.  
  4380.   MMIOM_CODEC_CLOSE             = CODEC_START + 1;
  4381.   MMIOM_CODEC_OPEN              = CODEC_START + 2;
  4382.   MMIOM_CODEC_QUERYNAME         = CODEC_START + 3;
  4383.   MMIOM_CODEC_QUERYNAMELENGTH   = CODEC_START + 4;
  4384.   MMIOM_CODEC_COMPRESS          = CODEC_START + 5;
  4385.   MMIOM_CODEC_DECOMPRESS        = CODEC_START + 6;
  4386.  
  4387. // End CODEC include
  4388.  
  4389.   // Flags:
  4390.   MMIO_CREATE                   = $00000001;       // Open
  4391.   MMIO_CTOCFIRST                = $00000002;       // Open
  4392.   MMIO_READ                     = $00000004;       // Open
  4393.   MMIO_WRITE                    = $00000008;       // Open
  4394.   MMIO_READWRITE                = $00000010;       // Open
  4395.   MMIO_COMPAT                   = $00000020;       // Open
  4396.   MMIO_EXCLUSIVE                = $00000040;       // Open
  4397.   MMIO_DENYWRITE                = $00000080;       // Open
  4398.   MMIO_DENYREAD                 = $00000100;       // Open
  4399.   MMIO_DENYNONE                 = $00000200;       // Open
  4400.   MMIO_ALLOCBUF                 = $00000400;       // Open
  4401.   MMIO_DELETE                   = $00000800;       // Open
  4402.  
  4403.   MMIO_USE_TEMP                 = $00001000;       // Open/Close/Save
  4404.  
  4405.   MMIO_INSERTON                 = $00000001;       // Insert
  4406.   MMIO_INSERTOFF                = $00000002;       // Insert
  4407.  
  4408.   MMIO_RWMODE                   = $00001000;       // Open
  4409.   MMIO_SHAREMODE                = $00002000;       // Open
  4410.  
  4411.   MMIO_DIRTY                    = $00004000;       // Write
  4412.  
  4413.   MMIO_VERTBAR                  = $00008000;       // Open
  4414.   MMIO_BUFSHARED                = $00010000;       // Open
  4415.   MMIO_APPEND                   = $00020000;       // Open
  4416.   MMIO_NOIDENTIFY               = $00040000;       // Open
  4417.  
  4418.   MMIO_FINDFIRST                = $00000001;       // CF Find Entry
  4419.   MMIO_FINDNEXT                 = $00000002;       // CF Find Entry
  4420.   MMIO_FINDUNUSED               = $00000004;       // CF Find Entry
  4421.   MMIO_FINDDELETED              = $00000008;       // CF Find Entry
  4422.  
  4423.   MMIO_CHANGEDELETED            = $0001;         // CF Change Entry
  4424.  
  4425.   MMIO_CF_FQNAME                = $0001;         // CF Compact
  4426.  
  4427.   MMIO_FHOPEN                   = $0001;           // Close
  4428.  
  4429.   MMIO_EMPTYBUF                 = $0001;           // Flush
  4430.  
  4431.   MMIO_CREATERIFF               = $0001;           // CreateChunk
  4432.   MMIO_CREATELIST               = $0002;           // CreateChunk
  4433.   MMIO_FINDCHUNK                = $0004;           // Descend
  4434.   MMIO_FINDRIFF                 = $0008;           // Descend
  4435.   MMIO_FINDLIST                 = $0010;           // Descend
  4436.  
  4437.   CTOC_HF_SEQUENTIAL            = $00000001;    // CTOC ulHeaderFlags
  4438.   CTOC_HF_MEDSUBTYPE            = $00000002;    // CTOC ulHeaderFlags
  4439.  
  4440.   CTOC_EFU_UNUSED               = $00000000; // CTOC extra usage code
  4441.   CTOC_EFU_LASTMODTIME          = $00000001; // CTOC extra usage code
  4442.   CTOC_EFU_CODEPAGE             = $00000002; // CTOC extra usage code
  4443.   CTOC_EFU_LANGUAGE             = $00000003; // CTOC extra usage code
  4444.   CTOC_EFU_COMPRESSPARAM0       = $00000005; // CTOC extra usage code
  4445.   CTOC_EFU_COMPRESSPARAM1       = $00000006; // CTOC extra usage code
  4446.   CTOC_EFU_COMPRESSPARAM2       = $00000007; // CTOC extra usage code
  4447.   CTOC_EFU_COMPRESSPARAM3       = $00000008; // CTOC extra usage code
  4448.   CTOC_EFU_COMPRESSPARAM4       = $00000009; // CTOC extra usage code
  4449.   CTOC_EFU_COMPRESSPARAM5       = $0000000A; // CTOC extra usage code
  4450.   CTOC_EFU_COMPRESSPARAM6       = $0000000B; // CTOC extra usage code
  4451.   CTOC_EFU_COMPRESSPARAM7       = $0000000C; // CTOC extra usage code
  4452.   CTOC_EFU_COMPRESSPARAM8       = $0000000D; // CTOC extra usage code
  4453.   CTOC_EFU_COMPRESSPARAM9       = $0000000E; // CTOC extra usage code
  4454.   CTOC_CharSET_STANDARD         = $00000000; // CTOC charset value
  4455.  
  4456.   MMIO_INSTALLPROC              = $00000001; // Install IO Proc
  4457.   MMIO_REMOVEPROC               = $00000002; // Install IO Proc
  4458.   MMIO_FINDPROC                 = $00000004; // Install IO Proc
  4459.  
  4460.   MMIO_MATCHFIRST               = $00000010; // Ini File Handler
  4461.   MMIO_MATCHNEXT                = $00000020; // Ini File Handler
  4462.   MMIO_MATCHFourCC              = $00000040; // Ini File Handler
  4463.   MMIO_MATCHDLL                 = $00000080; // Ini File Handler
  4464.   MMIO_MATCHPROCEDURENAME       = $00000100; // Ini File Handler
  4465.   MMIO_FULLPATH                 = $00000200; // Ini File Handler
  4466.   MMIO_NOVERIFY                 = $00000400; // Ini File Handler
  4467.   MMIO_MATCHCOMPRESSTYPE        = $00000800; // Ini File Handler
  4468.   MMIO_EXTENDED_STRUCT          = $00001000; // Ini File ulFlags
  4469.   MMIO_MATCHCOMPRESSSUBTYPE     = $00002000; // Ini File Handler
  4470.   MMIO_MATCHHWID                = $00004000; // Ini File Handler
  4471.   MMIO_MATCHCAPSFLAGS           = $00008000; // Ini File Handler
  4472.   MMIO_SKIPMATCH                = $00010000; // Ini/Load Handler
  4473.  
  4474.   MMIO_TOUPPER                  = $0001;      // StringToFourcc
  4475.  
  4476.   MMIO_CF_ENTRY_EXISTS          = $00000001; // Add CGRP element
  4477.  
  4478.   MMIO_FORCE_IDENTIFY_SS        = $00000001; // Identify
  4479.   MMIO_FORCE_IDENTIFY_FF        = $00000002; // Identify
  4480.  
  4481.   MMIO_NOTRANSLATE              = $00000000; // Translation
  4482.   MMIO_TRANSLATEDATA            = $00000001; // Translation
  4483.   MMIO_TRANSLATEHEADER          = $00000002; // Translation
  4484.   MMIO_DECOMPRESS               = $00000004; // CODEC Decompress
  4485.  
  4486.   MMIO_DEFAULTBUFFER            = 8192;    // two pages under OS/2 2.0
  4487.  
  4488.   MMIO_SEEK_IFRAME              = $00010000;  // Seek to nearest previous IFRAME
  4489.  
  4490.   // Messages :
  4491.   MMIOM_START                   = $0E00;
  4492.   MMIOM_END                     = $0EFF;
  4493.  
  4494.   MMIOM_GETCF                   = MMIOM_START + 1;
  4495.   MMIOM_GETCFENTRY              = MMIOM_START + 2;
  4496.  
  4497.   MMIOM_CLOSE                   = MMIOM_START + 3;
  4498.   MMIOM_OPEN                    = MMIOM_START + 4;
  4499.   MMIOM_READ                    = MMIOM_START + 5;
  4500.   MMIOM_SEEK                    = MMIOM_START + 6;
  4501.   MMIOM_WRITE                   = MMIOM_START + 7;
  4502.  
  4503.   MMIOM_IDENTIFYFILE            = MMIOM_START + 8;
  4504.   MMIOM_GETHEADER               = MMIOM_START + 9;
  4505.   MMIOM_SETHEADER               = MMIOM_START + 10;
  4506.   MMIOM_QUERYHEADERLENGTH       = MMIOM_START + 11;
  4507.   MMIOM_GETFORMATNAME           = MMIOM_START + 12;
  4508.   MMIOM_GETFORMATINFO           = MMIOM_START + 13;
  4509.   MMIOM_SEEKBYTIME              = MMIOM_START + 14;
  4510.   MMIOM_TEMPCHANGE              = MMIOM_START + 15;
  4511.   MMIOM_BEGININSERT             = MMIOM_START + 16;
  4512.   MMIOM_ENDINSERT               = MMIOM_START + 17;
  4513.   MMIOM_SAVE                    = MMIOM_START + 18;
  4514.   MMIOM_SET                     = MMIOM_START + 19;
  4515.   MMIOM_COMPRESS                = MMIOM_START + 20;
  4516.   MMIOM_DECOMPRESS              = MMIOM_START + 21;
  4517.   MMIOM_MULTITRACKREAD          = MMIOM_START + 22;
  4518.   MMIOM_MULTITRACKWRITE         = MMIOM_START + 23;
  4519.   MMIOM_DELETE                  = MMIOM_START + 24;
  4520.   MMIOM_BEGINGROUP              = MMIOM_START + 25;
  4521.   MMIOM_ENDGROUP                = MMIOM_START + 26;
  4522.   MMIOM_UNDO                    = MMIOM_START + 27;
  4523.   MMIOM_REDO                    = MMIOM_START + 28;
  4524.   MMIOM_BEGINSTREAM             = MMIOM_START + 29;
  4525.   MMIOM_ENDSTREAM               = MMIOM_START + 30;
  4526.  
  4527.  
  4528.   MMIOM_CUT                     = MMIOM_START + 31;
  4529.   MMIOM_COPY                    = MMIOM_START + 32;
  4530.   MMIOM_PASTE                   = MMIOM_START + 33;
  4531.   MMIOM_CLEAR                   = MMIOM_START + 34;
  4532.   MMIOM_STATUS                  = MMIOM_START + 35;
  4533.   MMIOM_WINMSG                  = MMIOM_START + 36;
  4534.   MMIOM_BEGINRECORD             = MMIOM_START + 37;
  4535.   MMIOM_ENDRECORD               = MMIOM_START + 38;
  4536.  
  4537.  
  4538.   // These 3 new messages were added with feature 11710
  4539.   MMIOM_QUERYIMAGE              = MMIOM_START + 39;
  4540.   MMIOM_QUERYIMAGECOUNT         = MMIOM_START + 40;
  4541.   MMIOM_SETIMAGE                = MMIOM_START + 41;
  4542.  
  4543.  
  4544.   MMIO_REALTIME                 = $00000001;
  4545.   MMIO_NONREALTIME              = $00000002;
  4546.  
  4547.   MMIOM_USER                    = $0F00;
  4548.   MMIOM_USER_END                = $0FFF;
  4549.  
  4550. type
  4551.   // Parameter structure for MMIOM_STATUS
  4552.   mmIO_Status_Parms = record
  4553.     hwndWindow        : hwnd;                  // Some items require a window handle
  4554.     ulReturn          : uLong;                 // Return field
  4555.     ulItem            : uLong;                 // Use MCI_STATUS_... flags here
  4556.     ulValue           : uLong;                 // Status value field
  4557.     ulType            : uLong;                 // MCI_FORMAT_... of ulReturn
  4558.   end;
  4559.   pmmIO_Status_Parms = ^mmIO_Status_Parms;
  4560.  
  4561. // Parameter structure for MMIOM_COPY, MMIOM_CUT, MMIOM_CLEAR and MMIOM_PASTE
  4562.  
  4563.   uSec = Long;                                 // microsecond time format
  4564.  
  4565.   mmIO_mEdit_Parms = record
  4566.     ulStrucLen        : uLong;                 // length of this structure
  4567.     hwndWindow        : hwnd;                  // window handle
  4568.     ulStartTime       : uSec;                  // starting time in usec
  4569.     ulDuration        : uSec;                  // duration in usec
  4570.     ulCurrentFilePosition : uLong;             // current file position in usec
  4571.     ulNewFilePosition : uLong;                 // returned by IO proc in usec, MCD will issue a seek
  4572.     ulNewFileLength   : uLong;                 // return by IO proc in usec, MCD updates its headers
  4573.     pBuffer           : Pointer;               // optional buffer
  4574.     ulBufferLength    : uLong;                 // optional buffer's length
  4575.     pHeader           : Pointer;               // optional pointer to header for buffer
  4576.   end;
  4577.   pmmIO_mEdit_Parms = ^mmIO_mEdit_Parms;
  4578.  
  4579.   // Parameter structure for MMIOM_WIN_MESSAGE
  4580.   mmIO_WinMsg = record
  4581.     hwndWindow        : hwnd;                  // these are the parameters
  4582.     usMessage         : uShort;                //  ... passed to the
  4583.     pParam1           : Pointer;               //  ... window procedure
  4584.     pParam2           : Pointer;               //  ... by PM
  4585.   end;
  4586.   pmmIO_WinMsg = ^mmIO_WinMsg;
  4587.  
  4588. const
  4589.   // Include error codes for MMIO
  4590.   MMIO_SUCCESS                  = 0;
  4591.   MMIO_WARNING                  = 2;
  4592.   MMIO_ERROR                    = -1;
  4593.   MMIOERR_UNSUPPORTED_MESSAGE   = -2;
  4594.  
  4595.   MMIO_CF_SUCCESS               = 0;
  4596.   MMIO_CF_FAILURE               = 1;
  4597.  
  4598. function mmioFourCC( ch0, ch1, ch2, ch3: Char ): uLong; inline;
  4599. begin
  4600.   Result := ord(ch0) or (ord(ch1) shl 8) or
  4601.             (ord(ch2) shl 16) or (ord(ch3) shl 24);
  4602. end;
  4603.  
  4604. const
  4605.   // FourCCs will be initialized in Initialization section
  4606.   FourCC_RIFF                   : FourCC = 0;
  4607.   FourCC_LIST                   : FourCC = 0;
  4608.   FourCC_MEM                    : FourCC = 0;
  4609.   FourCC_DOS                    : FourCC = 0;
  4610.   FourCC_BND                    : FourCC = 0;
  4611.   FourCC_FREE                   : FourCC = 0;
  4612.   FourCC_DEL                    : FourCC = 0;
  4613.   FourCC_CTOC                   : FourCC = 0;
  4614.   FourCC_CGRP                   : FourCC = 0;
  4615.   FourCC_CF                     : FourCC = 0;
  4616.  
  4617. const
  4618.   MMIO_NLS_CharSET_INFO         = 8000;   // RCDATA Name ID for NLS
  4619.   MMIO_IOPROC_NAME_TABLE        = 8500;   // RCDATA Name ID for string table
  4620.   MMIO_CODEC_NAME_TABLE         = 9000;   // RCDATA Name ID for Codec  table
  4621.  
  4622.   // Numeric equivalents of fourcc's.  These are needed for the resource
  4623.   // compiler.
  4624.   HEX_FourCC_DOS                = $20534f44;
  4625.   HEX_FourCC_MEM                = $204d454d;
  4626.   HEX_FourCC_BND                = $20444e42;
  4627.   HEX_FourCC_CF                 = $20204643;
  4628.  
  4629.   // Country codes (CC), languages (LC), and dialects (DC).
  4630.   MMIO_DEFAULT_CODE_PAGE        = 437;
  4631.  
  4632.   MMIO_CC_NONE                  = 000;
  4633.   MMIO_CC_USA                   = 001;
  4634.   MMIO_CC_CANADA                = 002;
  4635.   MMIO_CC_LATIN_AMERICA         = 003;
  4636.   MMIO_CC_GREECE                = 030;
  4637.   MMIO_CC_NETHERLANDS           = 031;
  4638.   MMIO_CC_BELGIUM               = 032;
  4639.   MMIO_CC_FRANCE                = 033;
  4640.   MMIO_CC_SPAIN                 = 034;
  4641.   MMIO_CC_ITALY                 = 039;
  4642.   MMIO_CC_SWITZERLAND           = 041;
  4643.   MMIO_CC_AUSTRIA               = 043;
  4644.   MMIO_CC_UNITED_KINGDOM        = 044;
  4645.   MMIO_CC_DENMARK               = 045;
  4646.   MMIO_CC_SWEDEN                = 046;
  4647.   MMIO_CC_NORWAY                = 047;
  4648.   MMIO_CC_WEST_GERMANY          = 049;
  4649.   MMIO_CC_MEXICO                = 052;
  4650.   MMIO_CC_BRAZIL                = 055;
  4651.   MMIO_CC_AUSTRALIA             = 061;
  4652.   MMIO_CC_NEW_ZEALAND           = 064;
  4653.   MMIO_CC_JAPAN                 = 081;
  4654.   MMIO_CC_KOREA                 = 082;
  4655.   MMIO_CC_CHINA                 = 086;
  4656.   MMIO_CC_TAIWAN                = 088;
  4657.   MMIO_CC_TURKEY                = 090;
  4658.   MMIO_CC_PORTUGAL              = 351;
  4659.   MMIO_CC_LUXEMBOURG            = 352;
  4660.   MMIO_CC_ICELAND               = 354;
  4661.   MMIO_CC_FINLAND               = 358;
  4662.  
  4663.   MMIO_LC_NONE                  = 0;
  4664.   MMIO_DC_NONE                  = 0;
  4665.   MMIO_LC_ARABIC                = 1;
  4666.   MMIO_DC_ARABIC                = 1;
  4667.   MMIO_LC_BULGARIAN             = 2;
  4668.   MMIO_DC_BULGARIAN             = 1;
  4669.   MMIO_LC_CATALAN               = 3;
  4670.   MMIO_DC_CATALAN               = 1;
  4671.   MMIO_LC_TRADITIONAL_CHINESE   = 4;
  4672.   MMIO_DC_TRADITIONAL_CHINESE   = 1;
  4673.   MMIO_LC_SIMPLE_CHINESE        = 4;
  4674.   MMIO_DC_SIMPLE_CHINESE        = 2;
  4675.   MMIO_LC_CZECH                 = 5;
  4676.   MMIO_DC_CZECH                 = 1;
  4677.   MMIO_LC_DANISH                = 6;
  4678.   MMIO_DC_DANISH                = 1;
  4679.   MMIO_LC_GERMAN                = 7;
  4680.   MMIO_DC_GERMAN                = 1;
  4681.   MMIO_LC_SWISS_GERMAN          = 7;
  4682.   MMIO_DC_SWISS_GERMAN          = 2;
  4683.   MMIO_LC_GREEK                 = 8;
  4684.   MMIO_DC_GREEK                 = 1;
  4685.   MMIO_LC_US_ENGLISH            = 9;
  4686.   MMIO_DC_US_ENGLISH            = 1;
  4687.   MMIO_LC_UK_ENGLISH            = 9;
  4688.   MMIO_DC_UK_ENGLISH            = 2;
  4689.   MMIO_LC_SPANISH               = 10;
  4690.   MMIO_DC_SPANISH               = 1;
  4691.   MMIO_LC_SPANISH_MEXICAN       = 10;
  4692.   MMIO_DC_SPANISH_MEXICAN       = 2;
  4693.   MMIO_LC_FINNISH               = 11;
  4694.   MMIO_DC_FINNISH               = 1;
  4695.   MMIO_LC_FRENCH                = 12;
  4696.   MMIO_DC_FRENCH                = 1;
  4697.   MMIO_LC_BELGIAN_FRENCH        = 12;
  4698.   MMIO_DC_BELGIAN_FRENCH        = 2;
  4699.   MMIO_LC_CANADIAN_FRENCH       = 12;
  4700.   MMIO_DC_CANADIAN_FRENCH       = 3;
  4701.   MMIO_LC_SWISS_FRENCH          = 12;
  4702.   MMIO_DC_SWISS_FRENCH          = 4;
  4703.   MMIO_LC_HEBREW                = 13;
  4704.   MMIO_DC_HEBREW                = 1;
  4705.   MMIO_LC_HUNGARIAN             = 14;
  4706.   MMIO_DC_HUNGARIAN             = 1;
  4707.   MMIO_LC_ICELANDIC             = 15;
  4708.   MMIO_DC_ICELANDIC             = 1;
  4709.   MMIO_LC_ITALIAN               = 16;
  4710.   MMIO_DC_ITALIAN               = 1;
  4711.   MMIO_LC_SWISS_ITALIAN         = 16;
  4712.   MMIO_DC_SWISS_ITALIAN         = 2;
  4713.   MMIO_LC_JAPANESE              = 17;
  4714.   MMIO_DC_JAPANESE              = 1;
  4715.   MMIO_LC_KOREAN                = 18;
  4716.   MMIO_DC_KOREAN                = 1;
  4717.   MMIO_LC_DUTCH                 = 19;
  4718.   MMIO_DC_DUTCH                 = 1;
  4719.   MMIO_LC_BELGIAN_DUTCH         = 19;
  4720.   MMIO_DC_BELGIAN_DUTCH         = 2;
  4721.   MMIO_LC_NORWEGIAN_BOKMAL      = 20;
  4722.   MMIO_DC_NORWEGIAN_BOKMAL      = 1;
  4723.   MMIO_LC_NORWEGIAN_NYNORSK     = 20;
  4724.   MMIO_DC_NORWEGIAN_NYNORSK     = 2;
  4725.   MMIO_LC_POLISH                = 21;
  4726.   MMIO_DC_POLISH                = 1;
  4727.   MMIO_LC_BRAZILIAN_PORTUGUESE  = 22;
  4728.   MMIO_DC_BRAZILIAN_PORTUGUESE  = 1;
  4729.   MMIO_LC_PORTUGUESE            = 22;
  4730.   MMIO_DC_PORTUGUESE            = 2;
  4731.   MMIO_LC_RHAETO_ROMANIC        = 23;
  4732.   MMIO_DC_RHAETO_ROMANIC        = 1;
  4733.   MMIO_LC_ROMANIAN              = 24;
  4734.   MMIO_DC_ROMANIAN              = 1;
  4735.   MMIO_LC_RUSSIAN               = 25;
  4736.   MMIO_DC_RUSSIAN               = 1;
  4737.   MMIO_LC_SERBO_CROATIAN_LATIN  = 26;
  4738.   MMIO_DC_SERBO_CROATIAN_LATIN  = 1;
  4739.   MMIO_LC_SERBO_CROATIAN_CYRILLIC = 26;
  4740.   MMIO_DC_SERBO_CROATIAN_CYRILLIC = 2;
  4741.   MMIO_LC_SLOVAK                = 27;
  4742.   MMIO_DC_SLOVAK                = 1;
  4743.   MMIO_LC_ALBANIAN              = 28;
  4744.   MMIO_DC_ALBANIAN              = 1;
  4745.   MMIO_LC_SWEDISH               = 29;
  4746.   MMIO_DC_SWEDISH               = 1;
  4747.   MMIO_LC_THAI                  = 30;
  4748.   MMIO_DC_THAI                  = 1;
  4749.   MMIO_LC_TURKISH               = 31;
  4750.   MMIO_DC_TURKISH               = 1;
  4751.   MMIO_LC_URDU                  = 32;
  4752.   MMIO_DC_URDU                  = 1;
  4753.   MMIO_LC_BAHASA                = 33;
  4754.   MMIO_DC_BAHASA                = 1;
  4755.  
  4756. // Base function prototypes:
  4757.  
  4758. function mmioAdvance( mmIO: hmmio; Info: pmmioinfo; usFlags: uShort ): uShort;
  4759. function mmioAscend( mmIO: hmmio; pckinfo: pmmCkInfo; usFlags: uShort ): uShort;
  4760. function mmioClose( mmIO: hmmio; usFlags: uShort ): uShort;
  4761. function mmioCreateChunk( mmio: hmmio; pckinfo: pmmCkInfo; usFlags: uShort ): uShort;
  4762. function mmioDescend( mmIO: hmmio; pckinfo, pckinfoParent: pMMCkInfo; usFlags: uShort ): uShort;
  4763. function mmioFlush( mmIO: hmmio; usFlags: uShort ): uShort;
  4764. function mmioGetInfo( mmIO: hmmio; Info: pmmioinfo; usFlags: uShort ): uShort;
  4765. function mmioGetLastError( mmIO: hmmio ): uLong;
  4766. function mmioInstallIOProc( fccIOProc: FourCC; pIOProc: pMMIOProc; ulFlags: uLong ): pmmIOProc;
  4767. function mmioIOProc( mmIOInfo: pMMioInfo; usMsg: uShort; lParam1, lParam2: Long): Long;
  4768. function mmioOpen( pszFileName: pChar; mmIOInfo: pmmioinfo; ulOpenFlags: uLong ): hMMIO;
  4769. function mmioRead( mmIO: hmmio; pchBuffer: pChar; cBytes: Long ): Long;
  4770. function mmioSeek( mmIO: hmmio; lOffset, lOrigin: Long ): Long;
  4771. function mmioSendMessage( mmIO: hmmio; usMsg: uShort; lParam1, lParam2: Long ): Long;
  4772. function mmioSetBuffer( mmIO: hmmio; pchBuffer: pChar; cBytes: Long; usFlags: uShort ): uShort;
  4773. function mmioSetInfo( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: uShort ): uSHort;
  4774. function mmioStringToFourCC( pszString: pChar; usFlags: uShort ): FourCC;
  4775. function mmioWrite( mmIO: hmmio; pchBuffer: pChar; cBytes: Long ): Long;
  4776.  
  4777. // Compound File function prototypes:
  4778.  
  4779. function mmioCFOpen( pszFileName: pChar; CfInfo, IOInfo: pmmcfinfo; ulFlags: uLong ): hMMCF;
  4780. function mmioCFClose( mmCf: hmmcf; ulFlags: uLong ): uLong;
  4781. function mmioCFGetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: uLong ): uLong;
  4782. function mmioCFSetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: uLong ): uLong;
  4783. function mmioCFFindEntry( mmCf: hmmcf; ctocEntry: mmctocentry; ulFlags: uLong ): uLong;
  4784. function mmioCFAddEntry( mmCf: hmmcf; cTocEntry: mmctocentry; ulFlags: uLong ): uLong;
  4785. function mmioCFChangeEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: uLong ): uLong;
  4786. function mmioCFDeleteEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: uLong ): uLong;
  4787. function mmioCFAddElement( mmCf: hmmcf; pszElementName: pChar; fccType: FourCC;
  4788.   pchBuffer: pChar; cchBytes: Long; ulFlags: uLong ): uLong;
  4789.  
  4790. function mmioCFCopy( mmCfSource: hmmcf; pszDestFileName: pChar; ulFlags: uLong ): uLong;
  4791.  
  4792. // Conversion Utility function prototypes:
  4793.  
  4794. function mmioQueryFormatCount( FormatInfo: pmmformatinfo;
  4795.   plNumFormats: pLong; ulReserved: uLong; ulFlags: uLong ): uLong;
  4796.  
  4797. function mmioGetFormats( FormatInfo: pmmformatinfo;
  4798.   lNumFormats: Long; pFormatInfoList: Pointer; plFormatsRead: pLong;
  4799.   ulReserved: uLong; ulFlags: uLong ): uLong;
  4800.  
  4801. function mmioGetFormatName( FormatInfo: pmmformatinfo; pszFormatName: pChar;
  4802.   plBytesRead: pLong; ulReserved: uLong; ulFlags: uLong ): uLong;
  4803.  
  4804. function mmioIdentifyFile( pszFileName: pChar; MMIoInfo: pmmioinfo;
  4805.   FormatInfo: pmmformatinfo; pfccStorageSystem: pFourCC; ulReserved: uLong;
  4806.   ulFlags: uLong ): uLong;
  4807.  
  4808. function mmioQueryHeaderLength( mmIO: hmmio; plHeaderLength: pLong;
  4809.   ulReserved: uLong; ulFlags: uLong ): uLong;
  4810.  
  4811. function mmioGetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: Long;
  4812.   plBytesRead: pLong; ulReserved: uLong; ulFlags: uLong ): uLong;
  4813.  
  4814. function mmioSetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: Long;
  4815.   plBytesWritten: pLong; ulReserved: uLong; ulFlags: uLong ): uLong;
  4816.  
  4817. function mmioIniFileHandler( IniFileInfo: pmminifileinfo; ulFlags: uLong ): uLong;
  4818.  
  4819. function mmioIdentifyStorageSystem( pszFileName: pChar;
  4820.   MMIoInfo: pmmioinfo; pfccStorageSystem: pFourCC ): uLong;
  4821.  
  4822. function mmioDetermineSSIOProc( pszFileName: pChar; MMIoInfo: pmmioinfo;
  4823.   pfccStorageSystem: pFourCC; pszParsedRemainder: pChar ): uLong;
  4824.  
  4825. function mmioQueryIOProcModuleHandle( IOProc: pMMIOProc;
  4826.   IOProcModule: phModule ): uLong;
  4827.  
  4828. function mmioCFCompact( pszFileName: pChar; ulFlags: uLong ): uLong;
  4829.  
  4830. // MMPMMMIO.INI file migration utility
  4831.  
  4832. function mmioMigrateIniFile( ulFlags: uLong ): uLong;
  4833.  
  4834. // MMIO CODEC APIs
  4835.  
  4836. function mmioIniFileCODEC( IniFile: pCODECIniFileInfo; ulFlags: uLong ): uLong;
  4837. function mmioSet( mmIO: hmmio; ExtendInfo: pmmExtendInfo; ulFlags: uLong): uLong;
  4838. function mmioQueryCODECName( IniInfo: pCODECIniFileinfo;
  4839.   pszCODECName: pChar; pulBytesRead: pUlong ): uLong;
  4840.  
  4841. function mmioQueryCODECNameLength( IniInfo: pCODECIniFileinfo;
  4842.   pulNameLength: pUlong ): uLong;
  4843.  
  4844. function mmioLoadCODECProc( IniInfo: pCODECIniFileInfo;
  4845.   Module: phModule; ulFlags: uLong ): pCodecProc;
  4846.  
  4847. function mmioGetData( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: uShort ): uShort;
  4848.  
  4849. {----[ CODEC ]----}
  4850.  
  4851. const
  4852.   // Ultimotion CODEC type for CODECINIFILEINFO ulCompressType
  4853.   FOURCC_ULTI                   : FourCC = 0;
  4854.   HEX_FOURCC_ULTI               = $49544C55;    // ITLU
  4855.  
  4856. // Indeo CODEC type for CODECINIFILEINFO ulCompressType
  4857.   FOURCC_RT21                   : FourCC = 0;
  4858.   HEX_FOURCC_RT21               = $31325452;     // 12TR
  4859.  
  4860.   // Mondo CODEC type for CODECINIFILEINFO ulCompressType
  4861.   FOURCC_DIB                    : FourCC = 0;
  4862.   HEX_FOURCC_DIB                = $20424944;     //  BID
  4863.  
  4864. type
  4865.   // GENPAL - Generic Header Palette
  4866.   GenPal = record
  4867.     ulStartIndex      : uLong;                 // starting RGB index
  4868.     ulNumColors       : uLong;                 // number of following entries
  4869.     prgb2Entries      : pRGB2;                 // 256 RGB entries
  4870.   end;
  4871.   pGenPal = ^GenPal;
  4872.  
  4873.   // CODECVIDEOHEADER - CODEC video Header
  4874.   CodecVideoHeader = record
  4875.     ulStructLen       : uLong;
  4876.     cx                : uLong;
  4877.     cy                : uLong;
  4878.     cPlanes           : uShort;
  4879.     cBitCount         : uShort;
  4880.     ulColorEncoding   : uLong;
  4881.     genpal            : GenPal;
  4882.   end;
  4883.   pCodecVideoHeader = ^CodecVideoHeader;
  4884.  
  4885. const
  4886.   // ulColorEncoding defines:
  4887.   MMIO_RGB_5_6_5                = $0001;  // Each pixel is a RGB_5_6_5 datatype
  4888.   MMIO_RGB_24                   = $0002;  // Each pixel is a RGB_24 datatype
  4889.   MMIO_YUV_4_1_1                = $0004;  // Each pixel is a YUV_4_1_1 datatype
  4890.   MMIO_COMPRESSED               = $0008;  // The data is compressed
  4891.   MMIO_YUV_24                   = $0010;  // Each pixel is a YUV_24 datatype
  4892.   MMIO_PALETTIZED               = $0020;  // The data is palettized
  4893.   MMIO_OS2_BITMAP24             = $0020;  // The data is palettized
  4894.  
  4895.  
  4896. {*********************************************
  4897.  *
  4898.  * MMVIDEOOPEN - Video Open Structure
  4899.  *
  4900.  * This structure is passed on the CODEC open
  4901.  * message when video compression is being done
  4902.  * to indicate information such as quality,
  4903.  * frame rate, data rate, and key frame rate.
  4904.  *
  4905.  * Quality:
  4906.  *
  4907.  * The ulQuality field specifies a scalar value
  4908.  * in the range 0 - 10000, where 0 is the lowest
  4909.  * quality and 10000 is the highest quality.  A
  4910.  * value of -1 specifies the default quality level,
  4911.  * and the default quality level (e.g. 5000) is
  4912.  * returned in the ulQuality field.
  4913.  *
  4914.  *
  4915.  * Key Frame rate:
  4916.  *
  4917.  * The ulKeyFrameRate structure specifies the key
  4918.  * frame (aka I-frame, reference frame) frequency.
  4919.  * Every Nth frame is a key frame as specified.
  4920.  * A value of zero specifies that no periodic key
  4921.  * are to be compressed.  Additional key frames may
  4922.  * be inserted at any point by specifying
  4923.  * MMIO_IS_KEY_FRAME in the MMCOMPRESS structure.
  4924.  *
  4925.  * example:  ulKeyFrameRate = 5  results in:
  4926.  *
  4927.  *    key delta delta delta delta key delta delta delta delta key delta...
  4928.  *
  4929.  *
  4930.  * Frame rate:
  4931.  *
  4932.  * Rate = number of time units per second
  4933.  * Scale = number of time units per frame
  4934.  *
  4935.  * examples:  Rate = 30  Scale = 1     =>    30 FPS
  4936.  *            Rate = 15  Scale = 1     =>    15 FPS
  4937.  *            Rate = 25  Scale = 2     =>    12.5 FPS
  4938.  *
  4939.  *
  4940.  * Data Constraint:
  4941.  *
  4942.  * Compressors which are capable of constraining the
  4943.  * resultant compressed video data rate use the
  4944.  * information in the ulDataConstraint and
  4945.  * ulConstraintInterval fields.  A non-zero value
  4946.  * in ulDataConstraint specifies the number of bytes
  4947.  * which is not to be exceeded over an interval of
  4948.  * frames in the output data stream, regardless of
  4949.  * the requested quality level.  This value only
  4950.  * considers video data, i.e. audio data and file format
  4951.  * overhead must be considered seperately when determining
  4952.  * the final output file data rate.  The interval of
  4953.  * frames over which the data is constrained is specified
  4954.  * in ulConstraintInterval.  A value of zero for
  4955.  * ulDataContraint specifies that the data rate is not
  4956.  * to be constrained and is compressed according to
  4957.  * the requested quality level.
  4958.  *
  4959.  * example 1:  ulDataConstraint = 150000   ulConstraintInterval = 15
  4960.  *
  4961.  *             This results in an output stream wherein the sizes of any 15
  4962.  *             consecutive frames does not exceed 150000 bytes.  If the
  4963.  *             frame rate is 15 FPS, the resultant data rate will not
  4964.  *             exceed 150000 bytes per second.
  4965.  *
  4966.  * example 2:  ulDataConstraint = 10000    ulConstraintInterval = 1
  4967.  *
  4968.  *             This results in an output stream wherein any single frame
  4969.  *             does not exceed 10000 bytes.  If the frame rate is 15 FPS,
  4970.  *             the resultant data rate will not exceed 150000 bytes per
  4971.  *             second.  Note the difference between this case and example 1
  4972.  *             where individual frames may exceed 10000 bytes (the average)
  4973.  *             so long other frames in any 15 frame sequence are sufficiently
  4974.  *             smaller to satisfy the constraint within the constraint interval.
  4975.  *
  4976.  *********************************************}
  4977.  
  4978. type
  4979.   mmVideoOpen = record
  4980.     ulStructLen          : uLong;
  4981.     ulQuality            : uLong;
  4982.     ulKeyFrameRate       : uLong;
  4983.     ulScale              : uLong;
  4984.     ulRate               : uLong;
  4985.     ulDataConstraint     : uLong;
  4986.     ulConstraintInterval : uLong;
  4987.   end;
  4988.   pmmVideoOpen = ^mmVideoOpen;
  4989.  
  4990.   mmAudioOpen = record
  4991.     ulStructLen          : uLong;              // Length of struct
  4992.     ulSamplesPerBlock    : uLong;              // Samples in each block of compressed data
  4993.     ulBytesPerBlock      : uLong;              // uncompressed bytes in each block
  4994.     ulFlags              : uLong;              // Compression flags
  4995.     ulBestGuess          : uLong;              // Guess at avg. compression ratio
  4996.     ulBlockAlignment     : uLong;              // Block alignment of codec
  4997.     ulLength             : uLong;              // Length of the file
  4998.     hCodec               : uLong;              // Codec handle
  4999.     pfnCodec             : PCODECPROC;
  5000.   end;
  5001.   pmmAudioOpen = ^mmAudioOpen;
  5002.  
  5003. const
  5004.   // defines for the ulFlags field of the BUFER_INFORMATION
  5005.   BLOCK_ORIENTED                = $00000001;
  5006.   NON_LINEAR                    = $00000002;
  5007.   INIT_CODEC                    = $00000004;
  5008.  
  5009. type
  5010.   // CODECOPEN - CODEC open structure
  5011.   CodecOpen = record
  5012.     ulFlags           : uLong;                 // flags & events - Refer to ulCapsFlags in CODECINIFILEINFO
  5013.     pControlHdr       : Pointer;               // control header - (codec specific)
  5014.     pSrcHdr           : Pointer;               // source header - Ptr CODECVIDEOHEADER
  5015.     pDstHdr           : Pointer;               // destination header - Ptr CODECVIDEOHEADER
  5016.     pOtherInfo        : Pointer;               // other information - Ptr MMVIDEOOPEN/MMAUDIOOPEN
  5017.   end;
  5018.   pCodecOpen = ^CodecOpen;
  5019.  
  5020. const
  5021.   Valid_CodecOpen_InputFlags = CODEC_DECOMPRESS or
  5022.                                CODEC_WINDOW_CLIPPING or
  5023.                                CODEC_PALETTE_TRANS or
  5024.                                CODEC_SELFHEAL or
  5025.                                CODEC_SCALE_PEL_DOUBLE or
  5026.                                CODEC_SCALE_PEL_HALVED or
  5027.                                CODEC_SCALE_CONTINUOUS or
  5028.                                CODEC_MULAPERTURE or
  5029.                                CODEC_HARDWARE or
  5030.                                CODEC_DIRECT_DISPLAY;
  5031.  
  5032. type
  5033.   // Stream handler communication
  5034.   Audio_Codec_Info = record
  5035.     ulStructLen       : uLong;       // Length of struct
  5036.     ulBytesPerBlock   : uLong;       // uncompressed bytes in each block
  5037.     ulBlockAlignment  : uLong;       // Block alignment of codec
  5038.     hCodec            : uLong;       // Codec handle
  5039.     pfnCodec          : PCODECPROC;  //  LONG (* APIENTRY pfnCodec) (Pointer, SHORT, LONG, LONG);
  5040.   end;
  5041.  
  5042. const
  5043.   AUDIO_CODEC_INF               = 1000;
  5044.  
  5045. type
  5046.   // MMCOMPRESS - Compress structure
  5047.   mmCompress = record
  5048.     ulStructLen       : uLong;                 // length of this structure
  5049.     ulFlags           : uLong;                 // command and status flags
  5050.     ulSrcBufLen       : uLong;                 // source buffer size
  5051.     pSrcBuf           : Pointer;               // source buffer
  5052.     ulDstBufLen       : uLong;                 // destination buffer length
  5053.     pDstBuf           : Pointer;               // destination buffer
  5054.     pRunTimeInfo      : Pointer;               // control information
  5055.   end;
  5056.   pmmCompress = ^mmCompress;
  5057.  
  5058. // ulFlags Input values for MMCOMPRESS structure:
  5059. // Note:  MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined
  5060. // below, but are listed here for information purposes only.
  5061. // MMIO_IS_KEY_FRAME         This bit is set by the application
  5062. //                           to instruct the IOProc to compress
  5063. //                           the pSrcBuf into a key or reference
  5064. //                           frame.  If the bit is not set, a
  5065. //                           delta frame is compressed.
  5066. // MMIO_IS_PALETTE           A video palette is provided.  This
  5067. //                           is set by the application.
  5068.  
  5069. type
  5070.   // MMVIDEOCOMPRESS - Video Compress structure
  5071.   mmVideoCompress = record
  5072.     ulStructLen       : uLong;                 // Structure length
  5073.     genpalVideo       : GENPAL;                // Video stream palette
  5074.     pControlHdr       : Pointer;               // control header (codec specific)
  5075.   end;
  5076.   pmmVideoCompress = ^mmVideoCompress;
  5077.  
  5078. const
  5079.   START_DECOMPRESSION           = $00000001;
  5080.   CONTINUE_DECOMPRESSION        = $00000002;
  5081.   START_SEEK                    = $00000004;
  5082.   CONTINUE_SEEK                 = $00000008;
  5083.  
  5084. type
  5085.   //MMDECOMPRESS - Decompress Structure
  5086.   mmDecompress = record
  5087.     ulStructLen       : uLong;                 // length of this structure
  5088.     ulFlags           : uLong;                 // command and status flags
  5089.     ulSrcBufLen       : uLong;                 // source buffer size
  5090.     pSrcBuf           : Pointer;               // source buffer
  5091.     ulDstBufLen       : uLong;                 // destination buffer length
  5092.     pDstBuf           : Pointer;               // destination buffer
  5093.     pRunTimeInfo      : Pointer;               // control information Ptr to MMVIDEODECOMPRESS
  5094.   end;
  5095.   pmmDecompress = ^mmDecompress;
  5096.  
  5097. const
  5098.   // ulFlags defines:
  5099.   MMIO_DROP_DELTA_FRAME         = $0001; // Input/Output - Tells the IOProc to drop the delta
  5100.                                          // frame if the pSrcBuf contains a delta
  5101.                                          // frame.  On return, the bit is reset
  5102.                                          // if the delta frame is dropped.
  5103.   MMIO_IS_KEY_FRAME             = $0002; // Output - This bit is set by the IOProc when
  5104.                                          // the data contained in the pSrcBuf is
  5105.                                          // a key or reference frame.
  5106.   MMIO_IS_PALETTE               = $0004; // Output - A video palette has been found.
  5107.                                          // This is set by the IOProc.
  5108.   MMIO_PALETTE_CHANGE           = $0008; // Input - The physical palette has been changed
  5109.                                          // in...  This is set by the application.
  5110.   MMIO_ORIGIN_LOWERLEFT         = $0010; // Input - The video frame origin
  5111.   MMIO_RECTL_CHANGE             = $0020; // Input - The valid rectl list has changed.
  5112.   MMIO_ORIGIN_UPPERLEFT         = $0040; // Input - The video frame origin
  5113.   MMIO_DROP_FRAME_DECODE        = $0080; // Input - Tells the IOProc to drop decoding
  5114.   MMIO_HIGH_QUALITY             = $0100; // Input - Tells Codec to render best
  5115.                                          // quality image - not time critical
  5116.   MMIO_IGNORE_CLIPPING          = $0200; // Ignore clipping rectangles used for bitmap capture
  5117.                                          // high performance
  5118.   MMIO_OUTPUT_FULL_IMAGE        = $0400; // Output a complete image on decompress, even if this
  5119.                                          // is a delta frame
  5120.                                          // of the frame.
  5121.  
  5122.   VALID_DECOMPRESS_INPUTFLAGS   = MMIO_DROP_DELTA_FRAME or
  5123.                                   MMIO_PALETTE_CHANGE or
  5124.                                   MMIO_ORIGIN_LOWERLEFT or
  5125.                                   MMIO_RECTL_CHANGE or
  5126.                                   MMIO_DROP_FRAME_DECODE or
  5127.                                   MMIO_ORIGIN_UPPERLEFT or
  5128.                                   MMIO_HIGH_QUALITY or
  5129.                                   MMIO_IGNORE_CLIPPING or
  5130.                                   MMIO_OUTPUT_FULL_IMAGE;
  5131.  
  5132.   START_COMPRESSION             = $00000001;
  5133.   CONTINUE_COMPRESSION          = $00000002;
  5134.   SOURCE_UNUSED                 = $00000004;
  5135.   TARGET_UNUSED                 = $00000008;
  5136.  
  5137. type
  5138.   // MMVIDEODECOMPRESS - Video Decompress structure
  5139.   mmVideoDeCompress = record
  5140.     ulStructLen       : uLong;                 // Structure length
  5141.     ulRectlCount      : uLong;                 // Valid rectangle count - for clipping
  5142.     prectl            : pRectL;                // Valid rectangle array - for clipping
  5143.     ulSkipLength      : uLong;                 // Skipped line length
  5144.     ulDecodeLines     : uLong;                 // Num of lines to decompress
  5145.     genpalPhysical    : GenPal;                // Physical palette
  5146.     genpalVideo       : GenPal;                // Video stream palette
  5147.     rectlSrc          : RectL;                 // Source window rectangle
  5148.     rectlDst          : RectL;                 // Destination window rectangle
  5149.     ulDeltaCount      : uLong;                 // Number of remaining delta frames before the next I-Frame
  5150.     ulParm1           : uLong;                 // Codec specific parm
  5151.     ulParm2           : uLong;                 // Codec specific parm
  5152.     ulParm3           : uLong;                 // Codec specific parm
  5153.     ulParm4           : uLong;                 // Codec specific parm
  5154.   end;
  5155.   pmmVideoDeCompress = ^mmVideoDeCompress;
  5156.  
  5157. // RECORDTAB - Record table
  5158. // NOTE: This structure maps to ESRCBUFTAB
  5159.   RecordTab = record
  5160.     ulReserved1       : uLong;                 // reserved for system
  5161.     pRecord           : Pointer;               // ptr to record in buffer
  5162.     ulLength          : uLong;                 // length of record
  5163.     ulReserved2       : uLong;                 // reserved for system
  5164.     ulReserved3       : uLong;                 // reserved for system
  5165.     ulParm1           : uLong;                 // Record specific data
  5166.     ulParm2           : uLong;                 // Record specific data
  5167.   end;
  5168.   pRecordTab = ^RecordTab;
  5169.  
  5170. // RECORDTABWRITE - Record table for video write
  5171. // NOTE: This structure maps to ETGTBUFTAB
  5172.   RecordTabWrite = record
  5173.     pRecord           : Pointer;               // ptr to record in buffer
  5174.     ulReserved1       : uLong;                 // reserved for system
  5175.     ulLength          : uLong;                 // length of record
  5176.     ulReserved2       : uLong;                 // reserved for system
  5177.     ulReserved3       : uLong;                 // reserved for system
  5178.     ulParm1           : uLong;                 // Record specific data
  5179.     ulParm2           : uLong;                 // Record specific data
  5180.   end;
  5181.   pRecordTabWrite = ^RecordTabWrite;
  5182.  
  5183. const
  5184.   // ulParm1 Return values for MULTITRACK_READ only:
  5185.   // Note:  MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined
  5186.   // above, but are listed here for information purposes only
  5187.   // as they are valid ulParm1 Return values for MULTITRACK_READ.
  5188.   // MMIO_IS_KEY_FRAME         Frame is a Key frame
  5189.   // MMIO_IS_PALETTE           Buffer contains a video palette
  5190.   MMIO_INVISIBLE_FRAME          = $1000;       // Indicates a invisible video frame
  5191.   MMIO_NULL_FRAME               = $2000;       // Indicates a null video frame (zero length)
  5192.  
  5193.   // ulParm2 Return values for MULTITRACK_READ only:
  5194.   //    This field contains the frame number for this video frame
  5195.   //    if this track is a video track.
  5196.  
  5197.   // ulParm1 Input values for MULTITRACK_WRITE only:
  5198.   // Note:  MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined
  5199.   // above, but are listed here for information purposes only
  5200.   // as they are valid ulParm1 Input values for MULTITRACK_WRITE.
  5201.   // MMIO_IS_KEY_FRAME         Frame is a Key frame
  5202.   // MMIO_IS_PALETTE           Buffer contains a video palette
  5203.  
  5204.   // ulParm2 Input values for MULTITRACK_WRITE only:
  5205.   //    This field contains the number of null frames
  5206.   //    that should be inserted before this frame
  5207.   //    (this recordtab entry).
  5208.  
  5209. type
  5210.   // TRACKMAP - This structure maps a track to a record table.
  5211.   TrackMap = record
  5212.     ulTrackID         : uLong;                 // Input - track ID
  5213.     ulNumEntries      : uLong;                 // Input - number of record entries
  5214.     pRecordTabList    : pRecordTab;            // Input/Output - Ptr to a record table
  5215.   end;
  5216.   pTrackMap = ^TrackMap;
  5217.  
  5218.   // MMMULTITRACKREAD - Multiple Track Read
  5219.   mmMultiTrackRead = record
  5220.     ulLength          : uLong;                 // Input - Size of buffer to read.  The IO should be performed on this size of
  5221.                                                //          buffer.  The actual buffer size may be bigger and is given in the
  5222.                                                //          ulBufferLength field below.  Video frames can span pBuffer+ulLength
  5223.                                                //          as long as the frame is less than the ulBufferLength in size.
  5224.                                                //          The purpose of this is to break the IO reads into smaller sizes
  5225.                                                //          while still allowing large frame sizes.
  5226.     pBuffer           : Pointer;               // Input - ptr to read buffer
  5227.     ulFlags           : uLong;                 // Input/Output - read flags
  5228.     ulNumTracks       : uLong;                 // Input - number of track entries
  5229.     pTrackMapList     : pTrackMap;             // Input - ptr to track-to-record list
  5230.     ulBufferLength    : uLong;                 // Input - Actual length of read buffer
  5231.     ulReserved        : uLong;                 // Input - Reserved (must be 0)
  5232.   end;
  5233.   pmmMultiTrackRead = ^mmMultiTrackRead;
  5234.  
  5235. const
  5236.   // ulFlags Input Values:
  5237.   MULTITRACKREAD_EXTENDED       = $0004;       // Indicates that the new extended multitrack
  5238.                                                // read structure is passed from caller instead
  5239.                                                // of the previous multitrack read structure.
  5240.  
  5241.   // ulFlags Return Values:
  5242.   MULTITRACKREAD_NOTDONE        = $0001;       // Read is not done.  Another read of the same
  5243.                                                // buffer is necessary.  There were not enough record
  5244.                                                // entries in the record table passed to this api.
  5245.   MULTITRACKREAD_EOF            = $0002;       // End of File.  Used because # bytes read may not
  5246.                                                // match the length of the buffer in cases of a
  5247.                                                // record that spans in the next buffer.
  5248.  
  5249. type
  5250.   // MMMULTITRACKWRITE - Multiple Track Write
  5251.   mmMultiTrackWrite = record
  5252.     ulNumTracks       : uLong;                 // Input - number of track entries
  5253.     pTrackMapList     : pTrackMap;             // Input - ptr to track-to-record list
  5254.     ulFlags           : uLong;                 // Input - write flags (Default = 0)
  5255.     ulReserved        : uLong;                 // Input - Reserved (must be 0)
  5256.   end;
  5257.   pmmMultiTrackWrite = ^mmMultiTrackWrite;
  5258.  
  5259. const
  5260.   // ulFlags Input Values:
  5261.   MULTITRACKWRITE_MERGE         = $0001;       // Attempt to interleave the data on the write.
  5262.                                                // The default (without this flag set) is to
  5263.                                                // write all records for each track then write
  5264.                                                // all records of the next track and so on.
  5265.  
  5266. type
  5267.   // MMMOVIEHEADER - standard movie header data
  5268.   mmMovieHeader = record
  5269.     ulStructLen           : uLong;             // length of this structure
  5270.     ulContentType         : uLong;             // movie content type
  5271.     ulMediaType           : uLong;             // video media type
  5272.     ulMovieCapsFlags      : uLong;             // capabilities
  5273.     ulMaxBytesPerSec      : uLong;             // maximum transfer rate
  5274.     ulPaddingGranularity  : uLong;             // pad to a multiple of this size
  5275.     ulSuggestedBufferSize : uLong;
  5276.     ulStart               : uLong;             // delay time marking beginning or start of movie
  5277.     ulLength              : uLong;
  5278.     ulNextTrackID         : uLong;             // next available track id
  5279.     ulNumEntries          : uLong;             // number of track entries
  5280.     pmmTrackInfoList      : pmmTrackInfo;      // track information
  5281.     pszMovieTitle         : pChar;             // movie title
  5282.     ulCountry             : uLong;             // country code for the title string
  5283.     ulCodePage            : uLong;             // country code page the title string
  5284.     ulAvgBytesPerSec      : uLong;             // average transfer rate
  5285.   end;
  5286.   pmmMovieHeader = ^mmMovieHeader;
  5287.  
  5288. const
  5289.   // ulMovieCapsFlags Defines:
  5290.   MOVIE_HAS_VIDEO               = $0001;       // The movie contains video.
  5291.   MOVIE_HAS_AUDIO               = $0002;       // The movie contains audio.
  5292.   MOVIE_CAN_SEEK                = $0004;       // The movie can seek.
  5293.   MOVIE_CAN_SCAN                = $0008;       // The movie can fast scan.
  5294.   MOVIE_HAS_COPYRIGHT           = $0010;       // The movie contains copyrighted data.
  5295.   MOVIE_WAS_CAPTUREFILE         = $0020;       // The movie is a specially allocated
  5296.                                                // file used for capturing real-time
  5297.                                                // video.  Applications should warn
  5298.                                                // the user before writing over a file
  5299.                                                // with this flag set because the user
  5300.                                                // probably defragmented this file.
  5301.                                                // If this flag is set, then there is a chance
  5302.                                                // that not all of the records will be written
  5303.                                                // on the call. Caller must check for this whether
  5304.                                                // this flag is set or not.
  5305.  
  5306. type
  5307.   // MMVIDEOHEADER - Movie Video Track Header
  5308.   mmVideoHeader = record
  5309.     ulStructLen           : uLong;             // length of this structure
  5310.     ulContentType         : uLong;             // video content type
  5311.     ulMediaType           : uLong;             // video media type
  5312.     ulVideoCapsFlags      : uLong;             // capabilities
  5313.     ulWidth               : uLong;             // video width in pels
  5314.     ulHeight              : uLong;             // video height in pels
  5315.     ulScale               : uLong;
  5316.     ulRate                : uLong;             // Rate / Scale == frames/second
  5317.     ulStart               : uLong;             // delay time marking beginning or start of stream
  5318.     ulLength              : uLong;
  5319.     ulTotalFrames         : uLong;             // total number of video frames
  5320.     ulInitialFrames       : uLong;
  5321.     mmtimePerFrame        : mmTime;            // frame display time or 0L
  5322.     ulSuggestedBufferSize : uLong;
  5323.     genpalVideo           : GenPal;            // palette
  5324.     pmmXDIBHeader         : pmmXDIBHeader;     // windows DIB compatible header
  5325.   end;
  5326.   pmmVideoHeader = ^mmVideoHeader;
  5327.  
  5328. const
  5329.   // ulContentType Defines:
  5330.   MMIO_VIDEO_UNKNOWN            = $00000000;   // Unknown video content
  5331.   MMIO_VIDEO_DATA               = $00000001;   // Video
  5332.  
  5333. {----[ SW ]----}
  5334.  
  5335. // Secondary Windows and Graphic Buttons
  5336.  
  5337. const
  5338.   MAX_SMBDTEXT                  = 35;
  5339.  
  5340.   MB_ICONCUSTOM                 = $0001;
  5341.  
  5342.   SC_DEFAULTSIZE                = $c000;       // WM_COMMAND from SysMenu
  5343.  
  5344.   WM_INITSECONDARYWINDOW        = $0519;       // MP1: NULL, MP2: CreateParams
  5345.  
  5346.   QS_FRAME                      = $1;          // Flag set to query frame
  5347.   QS_DIALOG                     = $2;          // Flag set to query dialog
  5348.  
  5349. type
  5350.   smbd = record
  5351.     achText   : Array[0..MAX_SMBDTEXT] of char; // Text of the button. eg. "~Cancel"
  5352.     idButton  : uLong;                         // Button ID returned when user chooses button
  5353.     flStyle   : Long;                          // Button style or'ed with internal styles
  5354.   end;
  5355.   psmbd = ^smbd;
  5356.  
  5357.   smbInfo = record
  5358.     hIcon             : hPointer;              // Icon handle
  5359.     cButtons          : uLong;                 // Number of buttons
  5360.     flStyle           : uLong;                 // Icon style flags (MB_ICONQUESTION, etc...)
  5361.     hwndNotify        : hwnd;                  // Reserved
  5362.     psmbd             : psmbd;                 // Array of button definitions
  5363.   end;
  5364.   psmbInfo = ^smbInfo;
  5365.  
  5366. // Analogous to WinDlgBox
  5367. function WinSecondaryWindow( hwndParent: hwnd; hwndOwner: hwnd;
  5368.   pfnDlgProc: fnWp; hmod: hModule; idDlg: uLong; pCreateParams: Pointer): uLong;
  5369.  
  5370. // Analogous to WinLoadDlg
  5371. function WinLoadSecondaryWindow( hwndParent: hwnd; hwndOwner: hwnd;
  5372.   pfnDlgProc: fnWp; hmod: hModule; idDlg: uLong; pCreateParams: Pointer): hwnd;
  5373.  
  5374. // Analogous to WinProcessDlg
  5375. function WinProcessSecondaryWindow( hwndSW: hwnd ): uLong;
  5376.  
  5377. // Analogous to WinCreateDlg
  5378. function WinCreateSecondaryWindow( hwndParent: hwnd; hwndOwner: hwnd;
  5379.   pfnDlgProc: fnWp; idDlg: uLong; pCreateParams: Pointer): hwnd;
  5380.  
  5381. function WinDefaultSize( Wnd: hwnd): Bool;
  5382.  
  5383. function WinInsertDefaultSize(Wnd: hwnd; pszDefaultSize: pChar): bool;
  5384.  
  5385. function WinQuerySecondaryhwnd(Wnd: hwnd; ulFlag: uLong): hwnd;
  5386.  
  5387. //**********************************************************************
  5388. // WinSecondaryMessageBox
  5389. //
  5390. // Parameters: hwnd   hwndParent   - handle of the parent window.
  5391. //             hwnd   hwndOwner    - handle of the owner window.
  5392. //             PSZ    pszText      - message text.
  5393. //             PSZ    pszCaption   - title of the message box.
  5394. //             uLong  idWindow     - Message box id
  5395. //             PSMBINFO psmbinfo   - pointer to button/icon info
  5396. //**********************************************************************
  5397. function WinSecondaryMessageBox( hwndParent: hwnd; hwndOwner: hwnd;
  5398.   pszText: pChar; pszCaption: pChar; idWindow: uLong; smb: psmbinfo): uLong;
  5399.  
  5400. //**********************************************************************
  5401. // WinDismissSecondaryWindow
  5402. //
  5403. // This function should be called from within the dlg proc. The hwnd
  5404. // passed in MUST be the handle to the actual dialog.
  5405. //**********************************************************************
  5406. function WinDismissSecondaryWindow(hwndDlg: hwnd; ulResult: uLong): Bool;
  5407.  
  5408. //**********************************************************************
  5409. // The parameter hwnd can be either the secondary window or the actual
  5410. // dialog.
  5411. //**********************************************************************
  5412. function WinDestroySecondaryWindow(Wnd: hwnd): Bool;
  5413.  
  5414. function WinDefSecondaryWindowProc(Wnd: hwnd; msg: uLong;
  5415.   mp1: mParam; mp2: mParam): mResult;
  5416.  
  5417.  
  5418. //**********************************************************************
  5419. //                         Graphic Buttons
  5420. //**********************************************************************
  5421.  
  5422. //**********************************************************************
  5423. // Notes on Using GraphicButtons
  5424. //
  5425. // GraphicButton CONTROL DATA
  5426. //
  5427. //  The format of the control data for GraphicButtons is
  5428. //         "button Text, number of bitmaps, bitmap resource id's ..."
  5429. //
  5430. //
  5431. //  Following are two example window templates of GraphicButtons:
  5432. //
  5433. //      1)  CONTROL  "", IDD_MP_REV, 120, 10, TS_PB_WIDTH, TS_PB_HEIGHT,
  5434. //                 WC_GRAPHICBUTTON,
  5435. //                 GBS_TWOSTATE | GBS_HILITEBITMAP |
  5436. //                 WS_VISIBLE | WS_TABSTOP
  5437. //                 CTLDATA GB_RESOURCE,"~REV", 2, ID_MP_REV1, ID_MP_REV0
  5438. //
  5439. //  The above graphicbutton has id IDD_MP_REV and is of type
  5440. //  GBS_TWOSTATE and GBS_HILITEBITMAP.  The GBS_HILITEBITMAP allows
  5441. //  a different bitmap to be displayed when the button is in the
  5442. //  hilite state. The graphicbutton will be displayed with text
  5443. //  "REV" and has "R" as the mnemonic.  It has 2 bitmaps associated
  5444. //  with it.  Their resource id are ID_MP_REV1 and ID_MP_REV0.
  5445. //
  5446. //
  5447. //      2)   CONTROL  "", IDD_MP_PLAY, 175, 10, TS_PB_WIDTH,
  5448. //                        TS_PB_HEIGHT, WC_GRAPHICBUTTON,
  5449. //                        GBS_AUTOTWOSTATE | GBS_AUTOANIMATION |
  5450. //                        WS_VISIBLE | WS_TABSTOP
  5451. //                        CTLDATA GB_RESOURCE, "~PLAY", 9,
  5452. //                                ID_MP_STOP0, ID_MP_PLAY1, ID_MP_PLAY2,
  5453. //                                ID_MP_PLAY3, ID_MP_PLAY4, ID_MP_PLAY5,
  5454. //                                ID_MP_PLAY6, ID_MP_PLAY7, ID_MP_REV1
  5455. //
  5456. //  The above graphicbutton has id IDD_MP_PLAY and is of type
  5457. //  GBS_AUTOTWOSTATE and GBS_AUTOANIMATE.  When clicked upon,
  5458. //  the button will automatically toggle the state and animation.
  5459. //  The graphicbutton will be displayed with text "PLAY"
  5460. //  and mnemonic "P".  It has 9 bitmaps associated with it.
  5461. //
  5462. //
  5463. //
  5464. //  GraphicButton Painting
  5465. //
  5466. //  Due to the PM design, whenever a graphicbutton is clicked,
  5467. //  it is sent a BN_PAINT (to paint a non-hilite state) and then
  5468. //  BN_CLICKED.  Thus, for GBS_AUTO* style graphicbuttons, a paint
  5469. //  request is generated before the button has a chance to change
  5470. //  its state (BN_CLICKED).  To avoid this premature painting,
  5471. //  code was inserted to delay the painting of graphicbuttons
  5472. //  GB_PAINT_RESOLUTION milliseconds whenever the button is switching
  5473. //  FROM the hilite paint state.
  5474. //
  5475. //**********************************************************************
  5476.  
  5477. function WinRegisterGraphicButton: Boolean;
  5478.  
  5479. const
  5480.   WC_GRAPHICBUTTON              = pChar( $ffff0040 );
  5481.  
  5482.   //             GraphicButton Animation/TwoState constants
  5483.  
  5484.   //                     Graphic Button Style bits
  5485.   GBS_TWOSTATE                  = $1000;       // indicates TwoState button
  5486.   GBS_AUTOTWOSTATE              = $2000;       // will auto toggle state up/down
  5487.   GBS_ANIMATION                 = $4000;       // indicates Animatable button
  5488.   GBS_AUTOANIMATION             = $8000;       // will auto toggle anim. on/off
  5489.   GBS_DISABLEBITMAP             = $0010;       // allows a diff. bitmap when disabled
  5490.   GBS_HILITEBITMAP              = $0020;       // allows a diff. bitmap when hilited
  5491.   GBS_3D_TEXTRECESSED           = $0040;       // display text in 3-D recessed
  5492.   GBS_3D_TEXTRAISED             = $0080;       // display text in 3-D raised
  5493.   GBS_MINIBUTTON                = $0001;       // mini button style
  5494.  
  5495.   //                     Graphic Button User Constants
  5496.  
  5497.   // Codes to reference allowed GraphicButton states (or paint states)
  5498.   GB_ERROR                      = -1;          // GraphicButton Error
  5499.   GB_UP                         = 1;           // GraphicButton up (and paint) state
  5500.   GB_DOWN                       = 2;           // GraphicButton down (and paint) state
  5501.   GB_DISABLE                    = 3;           // GraphicButton disabled state
  5502.   GB_HILITE                     = 4;           // GraphicButton paint state only
  5503.   GB_OUTOFHILITE                = 5;           // Changing out of hilite paint state
  5504.  
  5505.   // Codes for various GraphicButton message function parameters
  5506.   GB_TOGGLE                     = 10;          // GraphicButton toggle
  5507.   GB_CURRENTSTATE               = 11;          // GraphicButton's current state
  5508.   GB_ANIMATIONBEGIN             = 12;          // when refering to index of anim start
  5509.   GB_ANIMATIONEND               = 13;          // when refering to index of anim end
  5510.   GB_MAXINDEX                   = 14;          // GraphicButton max. index
  5511.  
  5512.   // Codes to set/query text position relative to the bitmap
  5513.   GB_TEXTBELOW                  = 1;           // place text below bitmap
  5514.   GB_TEXTABOVE                  = 2;           // place text above bitmap
  5515.  
  5516.   // Codes used to set the animation frame with message GBM_SETBITMAPINDEX
  5517.  
  5518.   GB_INDEX_FORWARD              = -1;          // advance one frame foward
  5519.   GB_INDEX_BACKWARD             = -2;          // advance one frame backwards
  5520.   GB_INDEX_FIRST                = -3;          // set to first frame of sequence
  5521.   GB_INDEX_LAST                 = -4;          // set to last frame of sequence
  5522.  
  5523. type
  5524.   gbtnCdata = packed record
  5525.     usReserved   : uShort;
  5526.     pszText      : pChar;
  5527.     hmod         : hModule;
  5528.     cBitmaps     : uShort;
  5529.     aidBitmap    : Array[0..1] of uShort;
  5530.   end;
  5531.   pgbtnCdata = ^gbtnCdata;
  5532.  
  5533. const
  5534.   GB_RESOURCE                   = 1;
  5535.   GB_STRUCTURE                  = 0;
  5536.  
  5537.  
  5538.   //**********************************************************************
  5539.   //          Notification Messages received by GraphicButton Parent
  5540.   //*********************************************************************
  5541.   //**********************************************************************
  5542.   // GBN_BUTTONDOWN, GBN_BUTTONUP, and GBN_BUTTONHILITE
  5543.   //
  5544.   // The notification messages are passed as part of the WM_CONTROL
  5545.   // message.
  5546.   //
  5547.   // msg = WM_CONTROL
  5548.   // mp1 = MPFROM2SHORT(gpb_id, button_state)
  5549.   //         gpd_id       = identity of the displayed graphic pushbutton
  5550.   //         button_state = GBN_BUTTONUP, GBN_BUTTONDOWN, or
  5551.   //                        GBN_BUTTONHILITE
  5552.   //
  5553.   //**********************************************************************
  5554.  
  5555.   GBN_BUTTONUP                  = $0524;
  5556.   GBN_BUTTONDOWN                = $0525;
  5557.   GBN_BUTTONHILITE              = $0526;
  5558.   GBN_SETFOCUS                  = $0527;   // mp2 TRUE for gaining focus
  5559.  
  5560.   //**********************************************************************
  5561.   //          Messages to GraphicButton Windows
  5562.   //**********************************************************************
  5563.  
  5564.   //**********************************************************************
  5565.   //                             GBM_SETGRAPHICDATA
  5566.   //**********************************************************************
  5567.   // mp1 = MPFROMP((PGBTNCDATA)&gbtncdata);    Graphic button control data
  5568.   // mp2 = NULL;                               not used
  5569.   //
  5570.   // WARNING: This message resets all button parameters.
  5571.   //
  5572.   //**********************************************************************
  5573.  
  5574.   GBM_SETGRAPHICDATA            = $052A;
  5575.  
  5576.   //**********************************************************************
  5577.   //                             GBM_ANIMATE
  5578.   //**********************************************************************
  5579.   // mp1 = MPFROMSHORT(fStart)      TRUE to start animation, FALSE to stop
  5580.   // mp2 = MPFROMSHORT(fContinue)   TRUE continue anim. at currently
  5581.   //                                displayed bitmap, FALSE restart at
  5582.   //                                the beginning.
  5583.   //
  5584.   // Returns TRUE on Success
  5585.   //         FALSE on Failure
  5586.   //
  5587.   //**********************************************************************
  5588.  
  5589.   GBM_ANIMATE                   = $052B;
  5590.  
  5591.   //**********************************************************************
  5592.   //                             GBM_SETANIMATIONRATE
  5593.   //**********************************************************************
  5594.   // mp1 = MPFROMSHORT(ULmIL);      Animation rate in milliseconds
  5595.   // mp2 = NULL                     not used
  5596.   //
  5597.   //
  5598.   // Returns TRUE on Success
  5599.   //         FALSE on Failure
  5600.   //
  5601.   //**********************************************************************
  5602.  
  5603.   GBM_SETANIMATIONRATE          = $052C;
  5604.  
  5605.  
  5606.   //**********************************************************************
  5607.   //                             GBM_QUERYANIMATIONACTIVE
  5608.   //**********************************************************************
  5609.   // mp1 = NULL;                    not used
  5610.   // mp2 = NULL;                    not used
  5611.   //
  5612.   //
  5613.   // Returns TRUE if animation is active, else GB_ERROR
  5614.   //
  5615.   //
  5616.   //**********************************************************************
  5617.  
  5618.   GBM_QUERYANIMATIONACTIVE      = $052D;
  5619.  
  5620.  
  5621.   //**********************************************************************
  5622.   //                             GBM_QUERYANIMATIONRATE
  5623.   //**********************************************************************
  5624.   // mp1 = NULL;                    not used
  5625.   // mp2 = NULL;                    not used
  5626.   //
  5627.   //
  5628.   // Returns uLong sepcifying animation rate in milliseconds
  5629.   //
  5630.   //
  5631.   //**********************************************************************
  5632.  
  5633.   GBM_QUERYANIMATIONRATE        = $052E;
  5634.  
  5635.  
  5636.   //**********************************************************************
  5637.   //                             GBM_SETBITMAPINDEX
  5638.   //**********************************************************************
  5639.   // mp1 = MPFROMSHORT(usGB_State)       Bitmap index to change
  5640.   //             GB_UP,
  5641.   //             GB_DOWN,
  5642.   //             GB_DISABLE,
  5643.   //             GB_HILITE,
  5644.   //             GB_ANIMATIONBEGIN,
  5645.   //             GB_ANIMATIONEND,
  5646.   //          or GB_CURRENTSTATE    chng current state (up or down) bitmap
  5647.   // mp2 = MPFROMSHORT(sFrameCode)  Set according to code or frame desire
  5648.   //             GB_INDEX_FORWARD,  chng to next bitmap in circular array
  5649.   //             GB_INDEX_BACKWARD, "   "  prev   "    "     "       "
  5650.   //             GB_INDEX_FIRST,    "   "  first  "    "     "       "
  5651.   //             GB_INDEX_LAST,     "   "  last   "    "     "       "
  5652.   //          or desired_bitmap     otherwise desired bmp index specified
  5653.   //
  5654.   // Returns TRUE on Success, otherwise FALSE
  5655.   //
  5656.   //**********************************************************************
  5657.  
  5658.   GBM_SETBITMAPINDEX            = $052F;
  5659.  
  5660.  
  5661.   //**********************************************************************
  5662.   //                             GBM_QUERYBITMAPINDEX
  5663.   //**********************************************************************
  5664.   //  mp1 = MPFROMSHORT(usGB_State)       Query bitmap index
  5665.   //            GB_UP,
  5666.   //            GB_DOWN,
  5667.   //            GB_DISABLE,
  5668.   //            GB_HILITE,
  5669.   //            GB_ANIMATIONBEGIN,
  5670.   //            GB_ANIMATIONEND,
  5671.   //         or GB_CURRENTSTATE  query current state (up or down) bitmap
  5672.   //  mp2 = NULL;                    not used
  5673.   //
  5674.   //  Returns USHORT specifying the index
  5675.   //
  5676.   //
  5677.   //**********************************************************************
  5678.  
  5679.   GBM_QUERYBITMAPINDEX          = $0530;
  5680.  
  5681.   //**********************************************************************
  5682.   //                             GBM_SETSTATE
  5683.   //**********************************************************************
  5684.   // mp1 = MPFROMSHORT(usStateCode)   Set twostate button to specified
  5685.   //                                  state
  5686.   //             GB_UP,
  5687.   //             GB_DOWN,
  5688.   //          or GB_TOGGLE          toggle (up/down) to (down/up)
  5689.   // mp2 = MPFROMBOOL(fRepaint)     TRUE  - state changed and displayed
  5690.   //                                FALSE - state changed, not displayed
  5691.   //
  5692.   // Returns TRUE on Success
  5693.   //         FALSE on Failure
  5694.   //
  5695.   //
  5696.   //**********************************************************************
  5697.  
  5698.   GBM_SETSTATE                  = $0531;
  5699.  
  5700.   //**********************************************************************
  5701.   //                             GBM_QUERYSTATE
  5702.   //**********************************************************************
  5703.   //
  5704.   // mp1 = NULL                        not used
  5705.   // mp2 = NULL                        not used
  5706.   //
  5707.   // Returns the state (GB_UP or GB_DOWN) else GB_ERROR.
  5708.   //
  5709.   //
  5710.   //**********************************************************************
  5711.  
  5712.   GBM_QUERYSTATE                = $0532;
  5713.  
  5714.   //**********************************************************************
  5715.   //                             GBM_SETTEXTPOSITION
  5716.   //**********************************************************************
  5717.   // mp1 = MPFROMSHORT(usTextPos)   How to position text relative to
  5718.   //                                  bitmap
  5719.   //               GB_TEXTBELOW,
  5720.   //            or GB_TEXTABOVE
  5721.   //   mp2 = NULL                     not used
  5722.   //
  5723.   //   Returns TRUE on Success, otherwise FALSE
  5724.   //
  5725.   //**********************************************************************
  5726.  
  5727.   GBM_SETTEXTPOSITION           = $0533;
  5728.  
  5729.   //**********************************************************************
  5730.   //                             GBM_QUERYTEXTPOSITION
  5731.   //**********************************************************************
  5732.   //
  5733.   //  mp1 = NULL                          not used
  5734.   //  mp2 = NULL                          not used
  5735.   //
  5736.   //  Returns GB_TEXTBELOW, GB_TEXTABOVE, GB_TEXTRIGHT, GB_TEXTLEFT
  5737.   //  on success, otherwise FALSE
  5738.   //
  5739.   //**********************************************************************
  5740.  
  5741.   GBM_QUERYTEXTPOSITION         = $0534;
  5742.  
  5743.  
  5744.   //**********************************************************************
  5745.   //                             GraphicButton END
  5746.   //**********************************************************************
  5747.  
  5748.   MM_TABHELP                    = $054C;
  5749.  
  5750. {----[ DIVE ]----}
  5751.  
  5752. const
  5753.   Max_Dive_Instances = 64;
  5754.  
  5755. type
  5756.   hDive  = ULong;
  5757.  
  5758. const
  5759.   Dive_Success                     = $00000000;
  5760.   Dive_Err_Invalid_Instance        = $00001000;
  5761.   Dive_Err_Source_Format           = $00001001;
  5762.   Dive_Err_Destination_Format      = $00001002;
  5763.   Dive_Err_Blitter_Not_Ssetup      = $00001003;
  5764.   Dive_Err_Insufficient_Length     = $00001004;
  5765.   Dive_Err_Too_Many_Instances      = $00001005;
  5766.   Dive_Err_No_Direct_Access        = $00001006;
  5767.   Dive_Err_Not_Bank_Switched       = $00001007;
  5768.   Dive_Err_Invalid_Bank_Number     = $00001008;
  5769.   Dive_Err_FB_Not_Acquired         = $00001009;
  5770.   Dive_Err_FB_Already_Acquired     = $0000100a;
  5771.   Dive_Err_Acquire_Failed          = $0000100b;
  5772.   Dive_Err_Bank_Switch_Failed      = $0000100c;
  5773.   Dive_Err_DeAcquire_Failed        = $0000100d;
  5774.   Dive_Err_Invalid_Palette         = $0000100e;
  5775.   Dive_Err_Invalid_Destination_Rectl=$0000100f;
  5776.   Dive_Err_Invalid_Buffer_Number   = $00001010;
  5777.   Dive_Err_SSMDD_Not_Installed     = $00001011;
  5778.   Dive_Err_Buffer_Already_Accessed = $00001012;
  5779.   Dive_Err_Buffer_Not_Accessed     = $00001013;
  5780.   Dive_Err_Too_Many_BufferS        = $00001014;
  5781.   Dive_Err_Allocation_Error        = $00001015;
  5782.   Dive_Warn_No_Size                = $00001100;
  5783.  
  5784.   Dive_Buffer_Screen               = $00000000;
  5785.   Dive_Buffer_Graphics_Plane       = $00000001;
  5786.   Dive_Buffer_Alternate_Plane      = $00000002;
  5787.  
  5788. { Notes:
  5789.       Associated/Allocated memory buffers start at:      $00000010
  5790.  
  5791.       Specifing Dive_Buffer_GRAPHICS_PLANE results in the image being
  5792.             transferred to the graphics plane.
  5793.       Specifing Dive_Buffer_ALTERNATE_PLANE results in the image being
  5794.             transferred to the alternate (e.g. overlay) plane.  If your
  5795.             hardware doesn't support such a plane, this is an error.
  5796.       Specifing Dive_Buffer_Screen will result in the image being
  5797.             transferred to either the graphics plane buffer or the alternate
  5798.             plane buffer based on if an alternate buffer exists and based on
  5799.             the suitability the overlay plane to accelerate the scaling of
  5800.             the image.  If Dive chooses to use the alternate buffer, it
  5801.             will also paint the overlay "key" color on the graphics plane.
  5802.             This automatic painting does not occur if the alternate plane
  5803.             is explicitly specified.
  5804. }
  5805.  
  5806. type
  5807.   Dive_Caps = record
  5808.     ulStructLen           : ULong;   // Set equal to sizeof(Dive_CAPS)
  5809.     ulPlaneCount          : ULong;   // Number of defined planes.
  5810.  
  5811.     // Info returned in the following fields pertains to ulPlaneID.
  5812.     fScreenDirect         : Bool;    // TRUE if can get addressability to vram.
  5813.     fBankSwitched         : Bool;    // TRUE if vram is bank-switched.
  5814.     ulDepth               : ULong;   // Number of bits per pixel.
  5815.     ulHorizontalResolution: ULong;   // Screen width in pixels.
  5816.     ulVerticalResolution  : ULong;   // Screen height in pixels.
  5817.     ulScanLineBytes       : ULong;   // Screen scan line size in bytes.
  5818.     fccColorEncoding      : FourCC;  // Colorspace encoding of the screen.
  5819.     ulApertureSize        : ULong;   // Size of vram aperture in bytes.
  5820.  
  5821.     ulInputFormats        : ULong;   // Number of input color formats.
  5822.     ulOutputFormats       : ULong;   // Number of output color formats.
  5823.     ulFormatLength        : ULong;   // Length of format buffer.
  5824.     pFormatData           : Pointer; // Pointer to color format buffer FourCC's.
  5825.   end;
  5826.  
  5827.   pDive_Caps=^Dive_Caps;
  5828.  
  5829.  
  5830. { Notes:
  5831.       DiveSetupBlitter may be called with a structure length at any of the
  5832.       breaks below (i.e. 8, 28, 32, 52, 60, or 68):
  5833. }
  5834.  
  5835.   Setup_Blitter = record
  5836.     ulStructLen           : ULong;   // Set equal to sizeof(SETUP_Blitter)
  5837.     fInvert               : Bool;    // TRUE if we are to invert image on blit.
  5838.  
  5839.     fccSrcColorFormat     : FourCC;  // Color format of Source data.
  5840.     ulSrcWidth            : ULong;   // Source width in pixels.
  5841.     ulSrcHeight           : ULong;   // Source height in pixels.
  5842.     ulSrcPosX             : ULong;   // Source start X position.
  5843.     ulSrcPosY             : ULong;   // Source start Y position.
  5844.  
  5845.     ulDitherType          : ULong;   // Where 0 is no dither, 1 is 2x2 dither.
  5846.  
  5847.     fccDstColorFormat     : FourCC;  // Color format of destination data.
  5848.     ulDstWidth            : ULong;   // Destination width in pixels.
  5849.     ulDstHeight           : ULong;   // Destination height in pixels.
  5850.     lDstPosX              : Long;    // Destination start X position.
  5851.     lDstPosY              : Long;    // Destination start Y position.
  5852.  
  5853.     lScreenPosX           : Long;    // Destination start X position on screen.
  5854.     lScreenPosY           : Long;    // Destination start Y position on screen.
  5855.  
  5856.     ulNumDstRects         : ULong;   // Number of visible rectangles.
  5857.     pVisDstRects          : PRectl;  // Pointer to array of visible rectangles.
  5858.   end;
  5859.  
  5860.   pSetup_Blitter = ^Setup_Blitter;
  5861.  
  5862. Function DiveQueryCaps( var DiveCaps: Dive_Caps; ulPlaneBufNum: ULong): ULong;
  5863. Function DiveOpen( var hDiveInst: hDive; fNonScreenInstance: Bool;
  5864.                    var pFrameBuffer: Pointer): ULong;
  5865. Function DiveSetupBlitter( hDiveInst: hDive; pSetupBlitter: pSetup_Blitter): ULong;
  5866. Function DiveBlitImage( hDiveInst: hDive; ulSrcBufNumber: ULong;
  5867.                         ulDstBufNumber: ULong): ULong;
  5868. Function DiveClose( hDiveInst: hDive ): ULong;
  5869. Function DiveAcquireFrameBuffer( hDiveInst: ULong; var rectlDst: RectL ): ULong;
  5870. Function DiveSwitchBank( hDiveInst: hDive; ulBankNumber: ULong): ULong;
  5871. Function DiveDeacquireFrameBuffer( hDiveInst: hDive ): ULong;
  5872. Function DiveCalcFrameBufferAddress( hDiveInst: hDive;
  5873.                                      var rectlDest: RECTL;
  5874.                                      var pDestinationAddress: Pointer;
  5875.                                      var ulBankNumber: ULong;
  5876.                                      var ulRemLinesInBank: ULong): ULong;
  5877.  
  5878. { Notes on DiveAllocImageBuffer:
  5879.       If ImageBuffer is not NULL, the buffer is associated rather than
  5880.       allocated.  If ImageBuffer is not NULL and the buffer number
  5881.       pointed to by pulBufferNumber is non-zero, a new buffer pointer is
  5882.       associated with the buffer number.  Even though no memory is
  5883.       allocated by DiveAllocImageBuffer when user-allocated buffers are
  5884.       associated, DiveFreeImageBuffer should be called to release the
  5885.       buffer association to avoid using up available buffer indexes.
  5886.       The specified line size will be used if a buffer is allocated in
  5887.       system memory, or if a user buffer is associated.  If the
  5888.       specified line size is zero, the allocated line size is rounded up
  5889.       to the nearest DWORD boundary. }
  5890.  
  5891. Function DiveAllocImageBuffer( hDiveInst: hDive; var ulBufferNumber: ULong;
  5892.                                fccColorSpace: FourCC; ulWidth: ULong;
  5893.                                ulHeight: ULong; ulLineSizeBytes: ULong;
  5894.                                ImageBuffer: Pointer): ULong;
  5895. Function DiveFreeImageBuffer( hDiveInst: hDive; ulBufferNumber: ULong):ULong;
  5896. Function DiveBeginImageBufferAccess( hDiveInst: hDive; ulBufferNumber: ULong;
  5897.                                      var pbImageBuffer: Pointer;
  5898.                                      var ulBufferScanLineBytes: ULong;
  5899.                                      var ulBufferScanLines: ULong): ULong;
  5900.  
  5901. Function DiveEndImageBufferAccess( hDiveInst: hDive; ulBufferNumber: ULong): ULong;
  5902.  
  5903. { Notes on palettes:
  5904.       Neither DiveSetSourcePalette nor DiveSetDestinationPalette API's will set
  5905.       the physical palette.  If your application MUST set the PHYSICAL palette,
  5906.       try using no more than 236 entries (the middle 236: 10-245, thus leaving
  5907.       the top and bottom 10 entries for the Workplace Shell).  If your
  5908.       application MUST use ALL 256 entries, it must do so as a full-screen
  5909.       (i.e. maximized) application.  Remember, No WM_REALIZEPALETTE message
  5910.       will be sent to other running applications, meaning they will not redraw
  5911.       and their colors will be all wrong.  It is not recommended that a
  5912.       developer use these commands:
  5913.  
  5914.    To set physical palette, do the following:
  5915.             hps := WinGetPS( HWND_DESKTOP );
  5916.             hdc := GpiQueryDevice( hps );
  5917.             GpiCreateLogColorTable( hps, LCOL_PURECOLOR OR LCOL_REALIZABLE,
  5918.                            LCOLF_CONSECRGB, 0, 256, @plRGB2Entries );
  5919.             DiveSetPhysicalPalette( hDiveInst, hdc );
  5920.             Gre32EntrY3 ( hdc, 0, $000060C6L );
  5921.             WinInvalidateRect ( HWND_DESKTOP, nil, ord(TRUE) );
  5922.             WinReleasePS ( hps );
  5923.  
  5924.    To reset physical palette, do the following:
  5925.             hps := WinGetPS ( HWND_DESKTOP );
  5926.             hdc := GpiQueryDevice ( hps );
  5927.             Gre32EntrY3 ( hdc, 0, $000060C7L );
  5928.             WinInvalidateRect ( HWND_DESKTOP, nil, ord(TRUE) );
  5929.             WinReleasePS ( hps ); }
  5930.  
  5931. Function DiveSetDestinationPalette( hDiveInst: hDive; ulStartIndex: ULong;
  5932.                                     ulNumEntries: ULong; pbRGB2Entries: Pointer): ULong;
  5933.  
  5934. Function DiveSetSourcePalette( hDiveInst: hDive; ulStartIndex: ULong;
  5935.                                ulNumEntries: ULong; pbRGB2Entries: Pointer): ULong;
  5936.  
  5937. {----[ MIDIOS2 ]----}
  5938.  
  5939. // Multimedia Extensions Midi structures and definitions
  5940.  
  5941. const
  5942.   STATUS_BIT                    = $80;
  5943.  
  5944.   TRACK_OFF                     = 0;
  5945.   TRACK_ON                      = 1;
  5946.  
  5947.  
  5948.   NORMAL_SYSEX                  = $f0;
  5949.   ESCAPE_SYSEX                  = $f7;
  5950.   META                          = $ff;
  5951.  
  5952.   // user defined messages for IO PROC
  5953.   MMIO_SEQ                      = MMIOM_USER + 1;
  5954.   MMIO_MERGE                    = MMIOM_USER + 2;
  5955.   MMIO_FROM_SEQ                 = MMIOM_USER + 3;
  5956.   MMIO_TIMED_READ               = MMIOM_USER + 4;
  5957.   MMIO_SET_TRACKS               = MMIOM_USER + 5;
  5958.   MMIO_FORMAT_0                 = MMIOM_USER + 6;
  5959.   MMIO_GETHEADER                = MMIOM_GETHEADER;
  5960.   MMIOM_GETFILELENGTH           = MMIOM_USER + 10;
  5961.   MMIOM_GETTRACKLENGTH          = MMIOM_USER + 11;
  5962.  
  5963. type
  5964.   MidiHeader = record
  5965.     chHeaderChunk               : array[0..3] of Char;
  5966.     ulHeaderLength              : uLong;
  5967.     usFormat                    : uShort;
  5968.     usNumTracks                 : uShort;
  5969.     usDivision                  : uShort;
  5970.     vpAdditionalInformation     : Pointer;
  5971.   end;
  5972.   pMidiHeader = ^MidiHeader;
  5973.  
  5974.   mmMidiHeader = record
  5975.     ulHeaderLength    : uLong;                 // Length in Bytes
  5976.     ulContentType     : uLong;                 // Image content
  5977.     ulMediaType       : uLong;                 // type of media
  5978.     midiheader        : MidiHeader;            // header
  5979.   end;
  5980.   pmmMidiHeader = ^mmMidiHeader;
  5981.  
  5982. {----[ MIDITYPE2 ]----}
  5983.  
  5984. const
  5985.   MIDINAMESIZE                  = 40;
  5986.   MIDIPATCHNUM                  = 128;
  5987.   MIDITYPEAPPNAME               = 'MidiTypes';    // Appname in MIDITYPE.INI
  5988.  
  5989. type
  5990.   // These structures describe the format of the MIDI maps that are
  5991.   // located in the MIDITYPE.INI file.
  5992.   MidiTypeEntry = record
  5993.     uGenMidiPatchNumber  : uShort;             // Device To General Midi Conversion
  5994.     uDevMidiPatchNumber  : uShort;             // General Midi to Device Conversion
  5995.     uVolumePercent       : uShort;             // Channel Patch Volume Scaler
  5996.     uGenMidiKeyNumber    : uShort;             // Device To General Midi Perc. Key Conversion
  5997.     uDevMidiKeyNumber    : uShort;             // General Midi to Device Perc. Key Conversion
  5998.   end;
  5999.   pMidiTypeEntry = ^MidiTypeEntry;
  6000.  
  6001.   MidiType = record
  6002.     uStyle            : uShort;                // Midi Style
  6003.     uDrums10          : uShort;                // Patch 10 Drums if Perckey not supported
  6004.     uDrums16          : uShort;                // Patch 16 Drums if Perckey not supported
  6005.     ulReserved        : uLong;                 // Reserved
  6006.     MidiTypeEntry     : array[0..midiPatchNum-1] of MIDITYPEENTRY;
  6007.                                                // Array of MIDITYPEENTRYs
  6008.     szPatchAndPercKeyName: array[0..2*MIDIPATCHNUM*MIDINAMESIZE-1] of char;
  6009.                                                // List of 128 Patch Names
  6010.                                                // that are null terminated, then a
  6011.                                                // list of 128 Percussion key names that
  6012.                                                // are double null terminated
  6013.                                                // Each item is null terminated
  6014.   end;
  6015.   pMidiType = ^MidiType;
  6016.  
  6017. const
  6018.   // Style Flags
  6019.   MT_PERCUSSIONKEYS             = $1;          // Percussion Keys are supported
  6020.   MT_MAPPERCKEYPATCHES          = $2;          // Map Percussion Key Patches
  6021.  
  6022. {----[ AUDIO ]----}
  6023.  
  6024. // Multimedia Extensions Audio Structures and definitions.
  6025.  
  6026. const
  6027.   // * AUDIODD version level
  6028.   CURRENT_VERSION               = $01020000;
  6029.  
  6030.   // ACPA control definitions
  6031.   AUDIO_IOCTL_CAT               = $80;
  6032.  
  6033.   AUDIO_INIT                    = $40;
  6034.   AUDIO_STATUS                  = $41;
  6035.   AUDIO_CONTROL                 = $42;
  6036.   AUDIO_BUFFER                  = $43;
  6037.   AUDIO_LOAD                    = $44;
  6038.   AUDIO_WAIT                    = $45;
  6039.   AUDIO_HPI                     = $46;
  6040.   AUDIO_CAPABILITY              = $48;
  6041.  
  6042.   MIX_GETCONNECTIONS            = $60;
  6043.   MIX_SETCONNECTIONS            = $61;
  6044.   MIX_GETLINEINFO               = $62;
  6045.   MIX_GETCONTROL                = $63;
  6046.   MIX_SETCONTROL                = $64;
  6047.  
  6048.   // AUDIO_INIT declarations and defines
  6049.   LOAD_PATH                     = 260;
  6050.  
  6051.   // Values for AUDIO_INIT.sMode
  6052.   ADPCM                         = 1;           // AVC type ADPCM
  6053.   PCM                           = 2;           // Pulse Coded Modulation
  6054.   MU_LAW                        = 3;           // mu-law
  6055.   MIDI                          = 4;           // MIDI data
  6056.   A_LAW                         = 5;           // a-law
  6057.   SOURCE_MIX                    = 6;           // External audio source
  6058.   SPV2                          = 7;           // Speech Viewer/2
  6059.   ADPCMXA                       = 8;           // XA CD ROM
  6060.   SPV2BCPCM                     = 25;          // Speech Viewer/2
  6061.   SPV2PCM                       = 26;
  6062.   SPV2NONE                      = 27;
  6063.   IDLE                          = 999;
  6064.   CLAIM_HDWR                    = 32000;       // Serialize access to hardware
  6065.  
  6066.   // Values for AUDIO_INIT.ulFlags
  6067.   FIXED                         = $00000001;   // Fixed length data
  6068.   LEFT_ALIGNED                  = $00000002;   // Left align bits on byte bndry
  6069.   RIGHT_ALIGNED                 = $00000004;   // Right align bits on byte bndry
  6070.   TWOS_COMPLEMENT               = $00000008;   // 2's complement data
  6071.   SIGNED                        = $00000010;   // Signed data
  6072.   BIG_ENDIAN                    = $00000020;   // MSB's first (motorola format)
  6073.   RIFF_DATATYPE                 = $00000040;   // sMode contains a RIFF datatype
  6074.   PITCH                         = $00100000;   // Pitch control is supported
  6075.   INPUT                         = $00200000;   // Input select is supported
  6076.   OUTPUT                        = $00400000;   // Output select is supported
  6077.   MONITOR                       = $00800000;   // Monitor is supported
  6078.   VOLUME                        = $01000000;   // Volume control is supported
  6079.   VOLUME_DELAY                  = $02000000;   // Volume delay is supported
  6080.   BALANCE                       = $04000000;   // Balance control is supported
  6081.   BALANCE_DELAY                 = $08000000;   // Balance delay is supported
  6082.   TREBLE                        = $10000000;   // Treble control is supported
  6083.   BASS                          = $20000000;   // Bass control supported
  6084.   BESTFIT_PROVIDED              = $40000000;   // bestfit returned
  6085.   LOAD_CODE                     = $80000000;   // DSP load needed
  6086.  
  6087.   // Values for AUDIO_INIT.ulOperation
  6088.   OPERATION_PLAY                = 1;
  6089.   OPERATION_RECORD              = 2;
  6090.   PLAY_AND_RECORD               = 3;
  6091.   ANALYSIS                      = 6;           // Speech Viewer/2
  6092.   DISTANCE                      = 7;           // Speech Viewer/2
  6093.   MIGRATION                     = 8;           // Speech Viewer/2
  6094.  
  6095.   // Values for AUDIO_INIT.sReturnCode
  6096.   NO_PLAY                       = 1;
  6097.   NO_RECORD                     = 2;
  6098.   NO_RECORD_AND_PLAY            = 3;
  6099.   INVALID_REQUEST               = 4;
  6100.   CONFLICT                      = 5;
  6101.   OVERLOADED                    = 6;
  6102.   DOWNLEVEL_DD                  = 7;           // DD is down level from appl.
  6103.   DSP_LOAD_PENDING_ON_OTHER_TRK = 8;           // Other trk hasn't loaded dsp
  6104.  
  6105.   AUDIO_IGNORE                  = -1;
  6106.  
  6107.   // Values for AUDIO_INIT.sDeviceID
  6108.   MINIDD                        = 0;
  6109.   ACPA                          = 1;
  6110.   MACPA                         = 2;
  6111.   MPU401                        = 3;
  6112.   SOUND_BLASTER                 = 4;
  6113.   IMF                           = 5;
  6114.   PS1                           = 6;
  6115.   PAS16                         = 7;
  6116.  
  6117. type
  6118.   // AUDIO_INIT structure declaration
  6119.   mci_Audio_Init = record
  6120.     lSRate            : Long;
  6121.     lBitsPerSRate     : Long;
  6122.     lBsize            : Long;
  6123.     sMode             : Short;
  6124.     sChannels         : Short;
  6125.     lResolution       : Long;
  6126.     abLoadPath        : array[0..Load_Path-1] of Char;
  6127.     ulFlags           : uLong;
  6128.     ulOperation       : uLong;
  6129.     sReturnCode       : Short;
  6130.     sSlotNumber       : Short;
  6131.     sDeviceID         : Short;
  6132.     pvReserved        : Pointer; // MMPM2 uses this to pass back sysfilenum
  6133.     ulVersionLevel    : uLong;
  6134.   end;
  6135.   lpmci_Audio_Init = ^mci_Audio_Init;
  6136.  
  6137.   // AUDIO_DEVID declarations and defines
  6138.   mci_Audio_DevID = record
  6139.     ulDevType         : uLong;
  6140.     ulDevNum          : uLong;
  6141.   end;
  6142.   lpmci_Audio_DevID = ^mci_Audio_DevID;
  6143.  
  6144. const
  6145.   // Input devices
  6146.   NULL_INPUT                    = 0;
  6147.   STEREO_LINE_INPUT             = 1;
  6148.   LEFT_LINE_INPUT               = 2;
  6149.   RIGHT_LINE_INPUT              = 3;
  6150.   MIC_INPUT                     = 4;
  6151.   BOOSTED_MIC_INPUT             = 5;
  6152.   PHONE_LINE_INPUT              = 6;
  6153.   HANDSET_INPUT                 = 7;
  6154.   SYNTH_INPUT                   = 8;
  6155.   DIGITAL_PHONE_LINE_INPUT      = 9;
  6156.   DIGITAL_HANDSET_INPUT         = 10;
  6157.   MIDI_IN_PORT                  = 11;
  6158.   LOOPBACK                      = 11;
  6159.   DEFAULT_INPUT                 = $FFFFFFFF;
  6160.  
  6161.   // Output devices
  6162.   NULL_OUTPUT                   = 0;
  6163.   STEREO_LINE_OUTPUT            = 1;
  6164.   LEFT_LINE_OUTPUT              = 2;
  6165.   RIGHT_LINE_OUTPUT             = 3;
  6166.   SPEAKER_OUTPUT                = 4;
  6167.   HEADSET_OUTPUT                = 5;
  6168.   PHONE_LINE_OUTPUT             = 6;
  6169.   HANDSET_OUTPUT                = 7;
  6170.   SYNTH_OUTPUT                  = 8;
  6171.   DIGITAL_PHONE_LINE_OUTPUT     = 9;
  6172.   DIGITAL_HANDSET_OUTPUT        = 10;
  6173.   MIDI_OUT_PORT                 = 11;
  6174.   DEFAULT_OUTPUT                = $FFFFFFFF;
  6175.  
  6176.   // Defined values for DevNum
  6177.   DEFAULT_DEVICE                = 0;
  6178.   DEVICE_1                      = 1;
  6179.   DEVICE_2                      = 2;
  6180.  
  6181.   // Valid Return codes for the ulSupport field of MCI_AUDIO_CAPS
  6182.   SUPPORT_SUCCESS               = $00000000;
  6183.   UNSUPPORTED_RATE              = $00000001;
  6184.   UNSUPPORTED_CHANNELS          = $00000002;
  6185.   UNSUPPORTED_BPS               = $00000004;
  6186.   UNSUPPORTED_DATATYPE          = $00000008;
  6187.   UNSUPPORTED_OPERATION         = $00000010;
  6188.  
  6189. type
  6190.   mci_Audio_Caps = record
  6191.     ulLength          : uLong;                 // in     Structure length
  6192.     ulSamplingRate    : uLong;                 // in out Sampling rate to query
  6193.     ulChannels        : uLong;                 // in out Channels to query
  6194.     ulBitsPerSample   : uLong;                 // in out BPS to query
  6195.     ulDataType        : uLong;                 // in out RIFF Datatype to query
  6196.     ulOperation       : uLong;                 // in out OPERATION_PLAY or OPERATION_RECORD
  6197.     ulSupport         : uLong;                 //    out BOOLEAN-does DD support this mode
  6198.     ulDataSubType     : uLong;                 //    out Data-subtype to use
  6199.     ulResourceUnits   : uLong;                 //    out Resource units this mode
  6200.     ulResourceClass   : uLong;                 //    out Resource class for this mode
  6201.     ulBlockAlign      : uLong;                 //    out Block alignment for this mode.
  6202.     fCanRecord        : uLong;                 //    out Is recording possbile - this mode
  6203.     ulFlags           : uLong;                 //    out
  6204.     ulCapability      : uLong;                 //    out Capability of the device.
  6205.   end;
  6206.   pAudio_Caps = ^mci_Audio_Caps;
  6207.  
  6208. const
  6209.   // Valid Return codes for the ul field of MCI_AUDIO_CAPS
  6210.   SUPPORT_MIX                   = $00000001; // supports mixer functions
  6211.   SUPPORT_RIFF_MODES            = $00000002; // supports RIFF modes for AUDIO_INIT
  6212.   SUPPORT_CAP                   = $80000000; // Capability IOCTL supported
  6213.  
  6214.   // AUDIO_CHANGE declarations and defines
  6215.  
  6216.   // Values for AUDIO_CHANGE.lMonitor
  6217.   MONITOR_OFF                   = 0;
  6218.   MONITOR_UNCOMPRESSED          = 1;
  6219.   MONITOR_COMPRESSED            = 2;
  6220.  
  6221.   // Values for AUDIO_CHANGE.lInput
  6222.   HIGH_GAIN_MIC                 = 0;
  6223.   LINE_1                        = 1;
  6224.   LINE_2                        = 2;
  6225.   LINES_1AND2                   = 3;
  6226.   LOW_GAIN_MIC                  = 4;
  6227.   ALL_LINES                     = $FFFF;
  6228.   INPUTS_LISTED                 = $5555;
  6229.  
  6230.   // Values for AUDIO_CHANGE.lOutput
  6231.   EXTERNAL_SPEAKER              = 1;
  6232.   INTERNAL_SPEAKER              = 2;
  6233.   OUTPUT_1                      = 4;
  6234.   OUTPUTS_LISTED                = $5555;
  6235.  
  6236. type
  6237.   // AUDIO_CHANGE structure declaration
  6238.   mci_Audio_Change = record
  6239.     pvDevInfo         : Pointer;
  6240.     lInput            : Long;
  6241.     lOutput           : Long;
  6242.     lMonitor          : Long;
  6243.     lVolume           : Long;
  6244.     lVolumeDelay      : Long;
  6245.     lBalance          : Long;
  6246.     lBalanceDelay     : Long;
  6247.     lTreble           : Long;
  6248.     lBass             : Long;
  6249.     lPitch            : Long;
  6250.     rInputList        : array[0..7] of MCI_AUDIO_DEVID;
  6251.     rOutputList       : array[0..7] of MCI_AUDIO_DEVID;
  6252.  
  6253.     prMoreInputs      : LPMCI_AUDIO_DEVID;
  6254.     prMoreOutputs     : LPMCI_AUDIO_DEVID;
  6255.     lGain             : Long;
  6256.     pvModeInfo        : Pointer;
  6257.   end;
  6258.   lmmci_Audio_Change = ^mci_Audio_Change;
  6259.  
  6260.   Midi_Info = record
  6261.     sTempo            : Short;
  6262.     sCPQN             : Short;
  6263.     sMidiSwitches     : Short;
  6264.     sReserved         : Array[0..4] of Short;
  6265.   end;
  6266.  
  6267. const
  6268.   // MIDI Switches
  6269.   MIDI_THRU_THRU                = 0;
  6270.   MIDI_THRU_OUT                 = 1;
  6271.  
  6272.   // AUDIO_STATUS declarations and defines
  6273.  
  6274.   // Values for AUDIO_STATUS.ulOperation
  6275.   STOPPED                       = 0;
  6276.   PLAYING                       = 1;
  6277.   RECORDING                     = 2;
  6278.   PLAYING_AND_RECORDING         = 3;
  6279.   UNITIALIZED                   = $FFFFFFFF;
  6280.  
  6281. type
  6282.   // AUDIO_STATUS structure declaration
  6283.   mci_Audio_Status = record
  6284.     lSRate            : Long;
  6285.     lBitsPerSRate     : Long;
  6286.     lBsize            : Long;
  6287.     sMode             : Short;
  6288.     sChannels         : Short;
  6289.     ulFlags           : uLong;
  6290.     ulOperation       : uLong;
  6291.     rAudioChange      : MCI_AUDIO_CHANGE;
  6292.   end;
  6293.   lpmci_Audio_Status = ^mci_Audio_Status;
  6294.  
  6295. const
  6296.   // AUDIO_CONTROL declarations and defines
  6297.  
  6298.   // Values for AUDIO_CONTROL.usIOCtlRequest
  6299.   AUDIO_CHANGE                  = 0;
  6300.   AUDIO_START                   = 1;
  6301.   AUDIO_STOP                    = 2;
  6302.   AUDIO_PAUSE                   = 3;
  6303.   AUDIO_RESUME                  = 4;
  6304.  
  6305.   // Values for AUDIO_CONTROL.sReturnCode
  6306.   AC_UNINITED                   = 1;           // Device must be init'ed or loaded first
  6307.   FULL_QUEUE                    = 2;           // Maximum # requests exceeded
  6308.   AC_UNPAUSED                   = 3;           // Resume issued, but dev not paused
  6309. //  INVALID_REQUEST               = 4;           // bad audio_control.ioctl_request
  6310.   AC_UNSTARTED                  = 5;           // Device must be started first
  6311.   INVALID_INPUT_LIST            = 7;           // invalid change.input_list entry
  6312.   INVALID_OUTPUT_LIST           = 8;           // invalid change.output_list entry
  6313.  
  6314. type
  6315.   // AUDIO_CONTROL structure declaration
  6316.   mci_Audio_Control = record
  6317.     usIOCtlRequest    : uShort;
  6318.     pbRequestInfo     : Pointer;
  6319.     ulPosition        : uLong;
  6320.     sReturnCode       : Short;
  6321.   end;
  6322.   lpmci_Audio_Control = ^mci_Audio_Control;
  6323.  
  6324. const
  6325.   // AUDIO_BUFFER declarations and defines
  6326.  
  6327.   // Values for AUDIO_BUFFER.ulFlags
  6328.   AUDIO_UNDERRUN                = 1;
  6329.   AUDIO_OVERRUN                 = 2;
  6330.  
  6331.   // Values for AUDIO_BUFFER.ulPositionType
  6332.   POS_MSECS                     = 0;
  6333.   MIDI_CLOCKS                   = 1;
  6334.   SMPTE_24                      = 24;
  6335.   SMPTE_25                      = 25;
  6336.   SMPTE_30DF                    = 29;
  6337.   SMPTE_30                      = 30;
  6338.  
  6339. type
  6340.   mci_Audio_Buffer = record
  6341.     ulFlags           : uLong;
  6342.     ulReadBufSize     : uLong;
  6343.     ulWriteBufSize    : uLong;
  6344.     ulReadBufTime     : uLong;
  6345.     ulWriteBufTime    : uLong;
  6346.     ulReadBufMax      : uLong;
  6347.     ulWriteBufMax     : uLong;
  6348.     ulPosition        : uLong;
  6349.     ulPositionType    : uLong;
  6350.     lReadBufCap       : Long;
  6351.     lWriteBufCap      : Long;
  6352.     lRequestBufCap    : Long;
  6353.   end;
  6354.   lpmci_Audio_Buffer = ^mci_Audio_Buffer;
  6355.  
  6356. const
  6357.   // AUDIO_LOAD declarations and defines
  6358.  
  6359.   // Values for AUDIO_LOAD.ulFlags
  6360.   LOAD_START                    = $01;
  6361.   LOAD_END                      = $02;
  6362.   LOAD_32BIT                    = $10;
  6363.  
  6364. type
  6365.   mci_Audio_load = record
  6366.     pbBuffer          : pChar;
  6367.     ulSize            : uLong;
  6368.     ulFlags           : uLong;
  6369.   end;
  6370.   lpmci_Audio_load = ^mci_Audio_load;
  6371.  
  6372.   // Track info declarations and defines
  6373.  
  6374.   // Track Info structure declaration
  6375.   mci_Track_Info = record
  6376.      usMasterVolume        : UShort;
  6377.      usDitherPct           : UShort;   // Percent of a bit dither during record
  6378.      usMasterVolumeDelay   : UShort;
  6379.      usMasterBalance       : UShort;
  6380.      usMasterBalanceDelay  : UShort;
  6381.   end;
  6382.   lpmci_Track_Info = ^mci_Track_Info;
  6383.  
  6384. const
  6385.   // IOBUFFER declarations and defines
  6386.  
  6387.   STARTED                       = 1;
  6388.   PAUSED                        = 2;
  6389.  
  6390. type
  6391.   mci_Audio_IOBuffer = record
  6392.     lSize             : uLong;
  6393.     pHead             : pChar;
  6394.     pTail             : pChar;
  6395.     lCount            : Long;
  6396.     ulPosition        : uLong;
  6397.     lDelay            : Long;
  6398.     usRunFlags        : UShort;
  6399.     usSelInc          : UShort;
  6400.     pBuffer           : pChar;
  6401.   end;
  6402.   lpmci_Audio_IOBuffer = ^mci_Audio_IOBuffer;
  6403.  
  6404. const
  6405.   // AUDIO_HPI declarations and defines
  6406.   CBXMIT                        = 1;
  6407.   CBREC                         = 2;
  6408.   CRTIMER                       = 4;
  6409.  
  6410.   EP_OPEN                       = 0;
  6411.   EP_CLOSE                      = 1;
  6412.   EP_READ                       = 2;
  6413.   EP_WRITE                      = 3;
  6414.   EP_INIT                       = 4;
  6415.   EP_STATUS                     = 5;
  6416.   EP_CONTROL                    = 6;
  6417.   EP_BUFFER                     = 7;
  6418.   EP_LOAD                       = 8;
  6419.   EP_WAIT                       = 9;
  6420.  
  6421. type
  6422.   mci_Audio_hpi = record
  6423.     pvEntry           : procedure;             // VOID (FAR *pvEntry)();
  6424.     pvCallBack        : procedure;             // VOID (FAR *pvCallBack)();
  6425.     prXBuff           : lpmci_Audio_IOBuffer;
  6426.     prRBuff           : lpmci_Audio_IOBuffer;
  6427.     usFlags           : uShort;
  6428.   end;
  6429.   lpmci_Audio_hpi = ^mci_Audio_hpi;
  6430.  
  6431.   // AUDIO_UPDATE Structure
  6432.   Audio_Update = record
  6433.     iobuf_type        : Char;                  // 0 - XMITIO, 1 - RECIO to be updated
  6434.     buffer_address    : pChar;                 // address to buffer to be added to array
  6435.     buffer_length     : uLong;                 // length of buffer to be added
  6436.     rc                : uShort;                // return code
  6437.     reserved          : Pointer;               // future use
  6438.   end;
  6439.   Update = ^Audio_Update;
  6440.  
  6441. const
  6442.   // audio_update.iobuf_type definitions
  6443.   XMIT_IOBUF                    = 0;
  6444.   REC_IOBUF                     = 1;
  6445.  
  6446.   // audio_update.rc definitions
  6447.   MAX_NUM_BUFFERS_REACHED       = 9;
  6448.   UPDATE_GENERAL_FAILURE        = 10;
  6449.   INVALID_BUFFER_LENGTH         = 11;
  6450.  
  6451. {----[ CDAUDOS2 ]----}
  6452.  
  6453. // Macro definition and common record structures used between the
  6454. // CD Audio MCI Driver, its VSDs (Vendor Specific Drivers), and the
  6455. // CD look-up table, MMPMCD.INI.
  6456.  
  6457. // CD MCD and VSD values and inter-modual communications
  6458.  
  6459. const
  6460.   // Macro Definitions
  6461.   UPC_SIZE                      = 7;           // UPC code size, CD serial number
  6462.   CDMCD_CUEPOINT_MAX            = 20;          // maximum number of cuepoints
  6463.   CDROM_SPEC_START              = 6000;        // 2 seconds, greatest min start address
  6464.  
  6465.  
  6466.   // Internal messages between the MCI Driver and the VSD.
  6467.   MCIDRV_REGISTER_DISC          = MCI_INTERNAL_MESSAGES_START + 1;
  6468.   MCIDRV_REGISTER_DRIVE         = MCI_INTERNAL_MESSAGES_START + 2;
  6469.   MCIDRV_REGISTER_TRACKS        = MCI_INTERNAL_MESSAGES_START + 3;
  6470.   MCIDRV_CD_READ_Long           = MCI_INTERNAL_MESSAGES_START + 4;
  6471.   MCIDRV_CD_SET_VERIFY          = MCI_INTERNAL_MESSAGES_START + 5;
  6472.   MCIDRV_CD_STATUS_CVOL         = MCI_INTERNAL_MESSAGES_START + 6;
  6473.  
  6474. type
  6475.   // Internal callback routine to the VSD from the MCI Driver.
  6476.   fnCDvsd = function( a: Pointer; b: UShort; c: puLong; d: Pointer; e: UShort ): uLong;
  6477.   // (typedef ULONG (APIENTRY FNCDVSD) (PVOID, USHORT, ULONG *, PVOID, USHORT);)
  6478.  
  6479.   // Internal callback routine from the VSD to the MCI Driver.
  6480.   fnCMmcd = procedure( a,b,c: uLong );
  6481.   // (typedef VOID (*PFNCDMCD) (uLong, uLong, uLong);)
  6482.  
  6483. type
  6484.   // CDAudRegister record structures
  6485.   //** ID a disc, used to verify a disc change **
  6486.   mci_CD_ID = record                           // must stay at 8 bytes to equal size of UPC
  6487.     Mode              : Byte;                  // mode, 0=UPC, 1=ID
  6488.     usTrack1          : UShort;                // address of track one in MMTIME
  6489.     NumTracks         : Byte;                  // number of tracks
  6490.     ulLeadOut         : uLong;                 // address of lead out track
  6491.   end;
  6492.  
  6493.   //** CD-ROM Drive information, determines capabilities **
  6494.   mci_RegDrive_Parms = record
  6495.     usCaps            : UShort;                // capabilities
  6496.     ulPrerollType     : uLong;                 // preroll type
  6497.     ulPrerollTime     : uLong;                 // preroll time
  6498.     ulMinStartTime    : uLong;                 // minimum starting time
  6499.     ulCDMCDID         : uLong;                 // CD MCD ID for instance
  6500.     pCDMCDReturn      : fnCMMcd;               // addr of CD MCD Return function
  6501.   end;
  6502.  
  6503. const
  6504.   // These flags are valid for the usCaps Field
  6505.   CDVSD_CAP_CAN_RECORD          = $0001;       // Can record audio
  6506.   CDVSD_CAP_HAS_AUDIO           = $0002;       // Can play audio
  6507.   CDVSD_CAP_HAS_VIDEO           = $0004;       // Can play video
  6508.   CDVSD_CAP_CAN_EJECT           = $0010;       // Can eject disc
  6509.   CDVSD_CAP_CAN_STREAM          = $0020;       // Can stream
  6510.   CDVSD_CAP_HAS_DAC             = $0040;       // Can process internal
  6511.   CDVSD_CAP_CAN_LOCK            = $0080;       // Can disable manual eject
  6512.   CDVSD_CAP_CAN_VOLUME          = $0100;       // Can manipulate volume settings
  6513.   CDVSD_CAP_CAN_REVERSE         = $0200;       // Can play in reverse
  6514.   CDVSD_CAP_CAN_V_SPEED         = $0400;       // Can vary play speed
  6515.   CDVSD_CAP_CAN_CUE             = $0800;       // Can read sequent. after break
  6516.                                                // Used for Cue, Pause, and Seek
  6517.  
  6518. type
  6519.   //** Information about the disc **
  6520.   mci_CD_RegDisc_Parms = record
  6521.     LowestTrackNum    : Byte;                  // lowest track number
  6522.     HighestTrackNum   : Byte;                  // highest track number
  6523.     UPC               : array[0..upc_Size-1] of Byte; // upc, 13 BCD + 4bit 0
  6524.     DiscID            : mci_CD_ID;             // Disc ID
  6525.   end;
  6526.  
  6527.   //** Information about each track **
  6528.   mci_CD_RegTrack_Rec = record
  6529.     TrackNum          : Byte;                  // track number
  6530.     ulStartAddr       : uLong;                 // starting address in MMTIME
  6531.     ulEndAddr         : uLong;                 // ending address
  6532.     TrackControl      : Byte;                  // track control information
  6533.   end;
  6534.  
  6535.   //** Track information, used to verify address **
  6536.   mci_CD_RegTracks_Parms = record
  6537.    TrackRecArr        : ^mci_CD_RegTrack_Rec;  // ptr to array of track recs
  6538.    ulBufSize          : uLong;                 // size of buffer
  6539.   end;
  6540.  
  6541.   // Environment settings to save and restore
  6542.   mciDrv_CD_Save_Parms = record
  6543.     ulPosition        : uLong;                 // current position in MMTIME
  6544.     ulEndPlay         : uLong;                 // end play position
  6545.     ulMode            : uLong;                 // Play mode: playing, paused, etc.
  6546.     ulLevel           : uLong;                 // volume levels
  6547.     ulVSDData         : uLong;                 // Extra VSD data storage area
  6548.   end;
  6549.  
  6550. const
  6551.   // Read Long (2352-Byte) Sectors
  6552.  
  6553.   // Flag for the MCIDRV_CD_READ_Long message
  6554.   //   Default addressing mode for the ulFrom field is Hardware Red Book.
  6555.   //   Absolute sector addressing for ISO-9660, or High Sierra Group
  6556.   //   requires a flag, as does an MMTIME address.
  6557.  
  6558.   MCI_CD_READLong_HSG           = $00000100;
  6559.   MCI_CD_READLong_MMTIME        = $00000200;
  6560.  
  6561. type
  6562.   mci_CD_ReadLong_Parms = record
  6563.     ulFrom            : uLong;                 // read from this position
  6564.     usCount           : UShort;                // Number of sectors to read
  6565.     pReturn           : Pointer;               // Pointer to return buffer
  6566.     ulRetSize         : uLong;                 // Return buffer size
  6567.   end;
  6568.  
  6569. const
  6570.   // CD Table INI file, MMPMCD.INI, values
  6571.  
  6572.   // Capability Flags I from the CD drive look-up table, MMPMCD.INI
  6573.   CDHW_CAP_CAN_EJECT            = $00000001;  // Can software eject disc
  6574.   CDHW_CAP_CAN_LOCK             = $00000002;  // Can lock drive/disable eject
  6575.   CDHW_CAP_READS_RAW            = $00000004;  // Can read raw sectors
  6576.   CDHW_CAP_CAN_WRITE            = $00000008;  // Can write to disc
  6577.   CDHW_CAP_CAN_PLAY             = $00000010;  // Can play CD-DA tracks
  6578.   CDHW_CAP_CAN_INTERLEV         = $00000020;  // Supports ISO-9660 interleaving
  6579.   CDHW_CAP_CAN_PREFETCH         = $00000080;  // Can prefetch internally
  6580.   CDHW_CAP_MANIP_AUDIO          = $00000100;  // Can manipulte audio channels
  6581.   CDHW_CAP_USES_REDBOOK         = $00000200;  // Can use Red Book mode
  6582.   CDHW_CAP_READS_XA             = $00000400;  // Can read CD-ROM/XA data
  6583.   CDHW_CAP_CONT_READS           = $00000800;  // Continues to read DA after stop
  6584.   CDHW_CAP_CAN_REVERSE          = $00001000;  // Can play in reverse
  6585.   CDHW_CAP_READS_CDDA           = $40000000;  // Can read CD-DA audio tracks
  6586.  
  6587.   // Capability Flags II from the CD drive look-up table, MMPMCD.INI
  6588.   CDHW_VOL_DEP_MASK             = $00000007;  // Volume dependency mask
  6589.   CDHW_VOL_DEP_NONE             = 0;  // Volume without dependency
  6590.   CDHW_VOL_DEP_HIGH             = 2;  // Volume is highest value
  6591.   CDHW_VOL_DEP_LOW              = 3;  // Volume is lowest value
  6592.   CDHW_VOL_DEP_LEFT             = 4;  // Volume is left volume
  6593.   CDHW_VOL_DEP_RIGHT            = 5;  // Volume is right volume
  6594.   CDHW_VOL_INDEP_MUTE           = $00000008;  // Mute has no dependency
  6595.   CDHW_CAP_LOCK_MOUNT           = $00000010;  // Can only lock when mounted
  6596.   CDHW_CAP_PLAY_VIDEO           = $00000020;  // Can play video
  6597.   CDHW_CAP_MODAL_ONLY           = $00000040;  // Stop req to interrupt PLAY
  6598.   CDHW_CAP_SUP_SEEK             = $00000080;  // Supports SEEK IOCTL
  6599.   CDHW_CAP_SUP_UPC              = $00000100;  // Supports UPC IOCTL
  6600.   CDHW_CAP_SUP_SUBCHAN          = $00000200;  // Supports sub-channel IOCTL
  6601.   CDHW_CAP_CAN_CLS_TRAY         = $00000400;  // Can close door/retract caddy
  6602.   CDHW_CAP_NO_STREAM            = $00001000;  // Cannot stream CD-DA when PDD
  6603.                                           //   says it can
  6604.   CDHW_CAP_VAR_PLAY             = $80000000;  // Supports variable speeds
  6605.  
  6606. // INI file record structure
  6607.   CDINI_APPSIZE                 = 8;           // Application name size
  6608.   CDINI_KEYSIZE                 = 16;          // Key name size
  6609.   CDINI_VSD_NAME_SIZE           = 8;           // size of file name
  6610.   VOLUME_CONTROL                = 101;         // num of values, 0% - 100%
  6611.  
  6612. type
  6613.   mmpmCD_Rec = record
  6614.     usEntryVer        : UShort;                // Entry version
  6615.     ulCaps1           : uLong;                 // Capability flag I
  6616.     ulCaps2           : uLong;                 // Capability flag II
  6617.     VSDName           : array[0..CDINI_VSD_NAME_SIZE-1] of Char; // DLL name for VSD
  6618.     ulMinStart        : uLong;                 // Min starting addr, 0x00MMSSFF
  6619.     usVolCnt          : UShort;                // volume level counter
  6620.     ausVolValues      : array[0..Volume_Control] of UShort;  // volume control values
  6621.   end;
  6622.  
  6623. {----[ MCDOS2 ]----}
  6624.  
  6625. const
  6626.   // Multimedia Extensions MCD structures and definitions
  6627.  
  6628.   LIST_LEN                      = 8;
  6629.  
  6630.   LINE_IN_ON                    = $00000001;
  6631.   MIC_ON                        = $00000002;
  6632.   LINE_OUT_ON                   = $00000004;
  6633.  
  6634. type
  6635.   // RIFF to ACPA Mode conversion Table
  6636.   RiffTable = record
  6637.     ulDataType        : uLong;
  6638.     ulAUDIODDMode     : uLong;
  6639.   end;
  6640.  
  6641.   mci_Port_list = record
  6642.     ulDevType         : uLong;
  6643.     ulDevNum          : uLong;
  6644.   end;
  6645.  
  6646. type
  6647.   // Amp/Mixer instance structure declaration
  6648.   mci_Amp_Instance = record
  6649.     szDeviceName             : array[0..127] of Char;
  6650.     szDriverName             : array[0..15] of Char;
  6651.     hFile                    : HFILE;
  6652.     usDeviceID               : UShort;
  6653.     ulGlobalFile             : uLong;
  6654.  
  6655.     usMasterVolume           : UShort;
  6656.     lLeftVolume              : Long;
  6657.     lRightVolume             : Long;
  6658.     lVolumeDelay             : Long;
  6659.  
  6660.     lBalance                 : Long;
  6661.  
  6662.     lBalanceDelay            : Long;
  6663.  
  6664.     lBass                    : Long;
  6665.  
  6666.     lTreble                  : Long;
  6667.  
  6668.     lPitch                   : Long;
  6669.     lGain                    : Long;
  6670.  
  6671.     lSRate                   : Long;
  6672.     lBitsPerSRate            : Long;
  6673.     lBsize                   : Long;
  6674.     sMode                    : Short;
  6675.     sChannels                : Short;
  6676.     ulFlags                  : uLong;
  6677.     lMonitor                 : Long;
  6678.     lInput                   : Long;
  6679.     lOutput                  : Long;
  6680.     ulOperation              : uLong;
  6681.     ulGainLevel              : uLong;
  6682.  
  6683.  
  6684.     ulStoreRVolume           : uLong;
  6685.     ulStoreLVolume           : uLong;
  6686.  
  6687.  
  6688.     ulDosOpened              : uLong;
  6689.     ulInitOpen               : uLong;
  6690.     ulMasterVolume           : uLong;
  6691.     ulActive                 : uLong;
  6692.     lStoreSRate              : Long;
  6693.     lStoreBitsPerSRate       : Long;
  6694.     ulStoreOperation         : uLong;
  6695.     sStoreMode               : Short;
  6696.     sStoreChannels           : Short;
  6697.     ulSetAmpDefaults         : uLong;
  6698.     ulDefaultsSet            : uLong;
  6699.  
  6700.     ulOutputDev              : uLong;
  6701.     ulInputDev               : uLong;
  6702.     ulResourcesUsed          : uLong;
  6703.     ulRestoreNotify          : uLong;
  6704.     ulCallback               : uLong;
  6705.     sUserParm                : Short;
  6706.     lNotifyFlag              : Long;
  6707.  
  6708. // NEEDS THINKING!
  6709. //  Long  ( * APIENTRY pfnAUDIOIF) ( Pointer, Long, Long, Long, Long);
  6710.     hmtxInstanceSem          : HMTX;
  6711.     ulClass                  : uLong;
  6712.     ulBlockAlignment         : uLong;
  6713.     ulHardwareMode           : uLong;
  6714.     rInputList               : array[ 0..LIST_LEN ] of mci_Port_List;
  6715.     rOutputList              : array[ 0..LIST_LEN ] of mci_Port_List;
  6716.     ulNumInputs              : uLong;
  6717.     ulNumOutputs             : uLong;
  6718.  
  6719.     ulDataType               : uLong;
  6720.     ulSubType                : uLong;
  6721.     ulBytesPerBlock          : uLong;
  6722.     ulMMTimePerBlock         : uLong;
  6723.  
  6724.     // New resource management stuff
  6725.     pAudioModeData           : Pointer;      // ptr to dev. specific resource data
  6726.     pResourceDLL             : array[0..127] of Char;
  6727.  
  6728.     pProdInfo                : pChar;     // pointer to the product name
  6729.     ulDeviceID               : uLong;     // pointer to the device id.
  6730.     ulNumMappingRows         : uLong;     // num of RIFF->AUDIODD mapping modes
  6731.     ulMatch                  : uLong;
  6732.     pMapTable                : ^RiffTable; // additional RIFF->AUDIODD mappings
  6733.  
  6734.     ulNumDataTypes           : uLong;     // number of datatypes to check
  6735.     pDataTypeTable           : Pointer;
  6736.     fMute                    : Bool;
  6737.     ulResourceID             : uLong;     // offset in the resource dll to use
  6738.     ulConnDefaults           : uLong;     // Default values for connectors
  6739.   end;
  6740.   pmci_Amp_Instance = ^mci_Amp_Instance;
  6741.  
  6742. {----[ OS2MIXER ]----}
  6743.  
  6744. // Multimedia Mixer Software Development Kit Include File
  6745.  
  6746. type
  6747.   hMixer  = uLong;
  6748.   phMixer = ^hMixer;
  6749.  
  6750.   MixerLineInfo = record
  6751.     ulLength              : uLong;    //length of the struct
  6752.     ulNumChannels         : uLong;    // number of channels on input
  6753.     ulSupport             : uLong;    // supported functionality (MIXLINEINFO)
  6754.     ulConnectionsPossible : uLong;    // lines connectable to
  6755.     ulLine                : uLong;    // which line to operate on
  6756.   end;
  6757.   pMixerLineInfo = ^MixerLineInfo;
  6758.  
  6759.   LineConnections = record
  6760.     ulLength              : uLong;    // length of the struct
  6761.     ulConnection          : uLong;
  6762.     ulLine                : uLong;
  6763.     ulFlags               : uLong;
  6764.   end;
  6765.   pLineConnections = ^LineConnections;
  6766.  
  6767.   MixerControl = record
  6768.     ulLength              : uLong;    // length of the struct
  6769.     ulLine                : uLong;
  6770.     ulControl             : uLong;
  6771.     ulSetting             : uLong;
  6772.   end;
  6773.   pMixerControl = ^MixerControl;
  6774.  
  6775. const
  6776.   // -- need masteraudio command for the following.
  6777.   // flags for MIXERLINEINFO ulSupport field
  6778.   MIX_BALANCE                   = MCI_AMP_SET_BALANCE;     // separate balance volume control
  6779.   MIX_ALC                       = MCI_AMP_SET_ALC;         // supports Auto Level Control
  6780.   MIX_MONITOR                   = MCI_AMP_SET_MONITOR;     // supports Monitor Control
  6781.   MIX_CROSSOVER                 = MCI_AMP_SET_CROSSOVER;   // supports crossover change
  6782.   MIX_LOUDNESS                  = MCI_AMP_SET_LOUDNESS;    // supports loudness equalization
  6783.   MIX_MUTE                      = MCI_AMP_SET_MUTE;        // supports channel mute
  6784.   MIX_REVERB                    = MCI_AMP_SET_REVERB;      // supports reverb
  6785.   MIX_STEREOENHANCE             = MCI_AMP_SET_STEREOENHANCE;// supports stereo enhance
  6786.   MIX_CUSTOM1                   = MCI_AMP_SET_CUSTOM1;     // supports custom effect #1
  6787.   MIX_CUSTOM2                   = MCI_AMP_SET_CUSTOM2;     // supports custom effect #2
  6788.   MIX_CUSTOM3                   = MCI_AMP_SET_CUSTOM3;     // supports custom effect #3
  6789.   MIX_LRVOLUME                  = MCI_AMP_SET_LRVOLUME;    // separate left-right volume control
  6790.   MIX_BASS                      = MCI_AMP_SET_BASS;        // supports Bass
  6791.   MIX_MID                       = MCI_AMP_SET_MID;         // supports Mid
  6792.   MIX_TREBLE                    = MCI_AMP_SET_TREBLE;      // supports Treble
  6793.   MIX_PITCH                     = MCI_AMP_SET_PITCH;       // supports pitch modifications
  6794.   MIX_GAIN                      = MCI_AMP_SET_GAIN;        // supports gain modifications
  6795.   MIX_CHORUS                    = MCI_AMP_SET_CHORUS;      // supports Bass
  6796.   MIX_VOLUME                    = MCI_AMP_SET_VOLUME;      // supports volume controls
  6797.  
  6798.   MIX_STEREO_OFF                = $00000000;
  6799.   MIX_STEREO_STUDIO             = $40004000;
  6800.   MIX_STEREO_HALL               = $80008000;
  6801.   MIX_STEREO_STADIUM            = $c000c000;
  6802.  
  6803.   MCI_STEREO_OFF                = $00000000;
  6804.   MCI_STEREO_STUDIO             = $00000001;
  6805.   MCI_STEREO_HALL               = $00000002;
  6806.   MCI_STEREO_STADIUM            = $00000004;
  6807.  
  6808.  
  6809.   MIX_LOUDNESS_OFF              = $00000000;
  6810.   MIX_LOUDNESS_ON               = $FFFFFFFF;
  6811.  
  6812.   MCI_LOUDNESS_OFF              = $00000000;
  6813.   MCI_LOUDNESS_ON               = $00000001;
  6814.  
  6815.   // ERROR MESSAGES
  6816.   MIXERR_BASE                   = 512;
  6817.  
  6818.   MIXERR_NOERR                  = 0;
  6819.   MIXERR_INVALIDHANDLE          = MIXERR_BASE+0;
  6820.   MIXERR_INVALIDINPUT           = MIXERR_BASE+1;
  6821.   MIXERR_INVALIDOUTPUT          = MIXERR_BASE+2;
  6822.   MIXERR_NOTSUPPORTED           = MIXERR_BASE+7;
  6823.  
  6824.   // INPUT LINES
  6825.   // SOURCES
  6826.   IN_SYNTHESIZER                = 0;
  6827.   IN_MIXER                      = 1;
  6828.   IN_EXTERNAL                   = 2;
  6829.   IN_INTERNAL                   = 3;
  6830.   IN_MICROPHONE                 = 4;
  6831.   IN_PCM                        = 5;
  6832.   IN_PC_SPEAKER                 = 6;
  6833.  
  6834.   // SINKS
  6835.   OUT_AMPLIFIER                 = 0;
  6836.   OUT_PCM                       = 1;
  6837.  
  6838.   // SOURCES
  6839.   SOURCE_SYNTHESIZER            = $000000001;
  6840.   SOURCE_LINE                   = $000000002;
  6841.   SOURCE_INTERNAL_AUDIO         = $000000004;
  6842.   SOURCE_MICROPHONE             = $000000008;
  6843.   SOURCE_WAVE                   = $000000010;
  6844.   SOURCE_PC_SPEAKER             = $000000020;
  6845.  
  6846.   // SINKS
  6847.   SINK_LINE_OUT                 = $000000001;
  6848.   SINK_SPEAKER                  = $000000002;
  6849.   SINK_HEADPHONES               = $000000004;
  6850.   SINK_NULL                     = $000000008;
  6851.   SINK_ALL                      = $000000010;
  6852.  
  6853. {----[ SHDD ]----}
  6854.  
  6855. // Multimedia Extensions Stream Handler Device Driver Interfaces
  6856. // Block defintions.
  6857.  
  6858. type
  6859.   shdfn = pointer;
  6860.   ddcmdfn = pointer;
  6861.  
  6862. const
  6863.   // DDCMD Defines
  6864.   DDCMD_SETUP                   = 0;
  6865.   DDCMD_READ                    = 1;
  6866.   DDCMD_WRITE                   = 2;
  6867.   DDCMD_STATUS                  = 3;
  6868.   DDCMD_CONTROL                 = 4;
  6869.   DDCMD_REG_STREAM              = 5;
  6870.   DDCMD_DEREG_STREAM            = 6;
  6871.  
  6872. type
  6873.   ddCmdCommon = record
  6874.     ulFunction        : uLong;                 // Function requested by SH
  6875.     Stream            : hStream;               // data stream instance
  6876.   end;
  6877.   pddCmdCommon = ^ddCmdCommon;
  6878.  
  6879.   ddCmdSetup = record
  6880.     ulFunction        : uLong;                 // Function requested by SH
  6881.     hStream           : HSTREAM;
  6882.     pSetupParm        : Pointer;               // see SETUP_PARM struct
  6883.     ulSetupParmSize   : uLong;                 // see SETUP_PARM struct
  6884.   end;
  6885.   pddCmdSetup = ^ddCmdSetup;
  6886.  
  6887.   // SETUP_PARM structure
  6888.   Setup_Parm = record                          //  DDCMDSETUP parameter block
  6889.     ulStreamTime      : uLong;                 // stream time in milliseconds
  6890.     ulFlags           : uLong;                 // various flags (input/output)
  6891.     // NOTE: new fields will be added here
  6892.   end;
  6893.   pSetup_Parm = ^Setup_Parm;
  6894.  
  6895. const
  6896.   // ulFlag defines
  6897.   SETUP_RECURRING_EVENTS        = $00000001;
  6898.                 // the device driver sets this flag on return from the
  6899.                 // DDCMD_SETUP command if the device driver assumes events
  6900.                 // are recurring events---in this case, the stream handler
  6901.                 // will not have to re-enable a recurring event each time
  6902.                 // the event occurs by sending a DDCMD_CONTROL command to
  6903.                 // the device driver.  this is useful when CUE_TIME or
  6904.                 // DATA_CUE events are expected to be used as RECURRING
  6905.  
  6906. type
  6907.   ccCmdReadWrite = record
  6908.     ulFunction        : uLong;                 // Function requested by SH
  6909.     hStream           : HSTREAM;
  6910.     pBuffer           : Pointer;
  6911.     ulBufferSize      : uLong;
  6912.     pProcessLin       : Pointer;
  6913.   end;
  6914.   pccCmdReadWrite = ^ccCmdReadWrite;
  6915.   ppccCmdReadWrite = ^pccCmdReadWrite;
  6916.  
  6917.   ccCmdStatus = record
  6918.     ulFunction        : uLong;                 // Function requested by SH
  6919.     hStream           : HSTREAM;
  6920.     pStatus           : Pointer;               // (output)ptr to current position time
  6921.     ulStatusSize      : uLong;                 // (output)size of position time
  6922.   end;
  6923.   pccCmdStatus = ^ccCmdStatus;
  6924.  
  6925.   // STATUS_PARM structure
  6926.   Status_Parm = record                         // DDCMDSTATUS parameter block
  6927.     ulTime            : uLong;                 // current position time in milliseconds
  6928.     // NOTE: new fields will be added here
  6929.   end;
  6930.   pStatus_Parm = ^Status_Parm;
  6931.  
  6932.   ddCmdControl = record
  6933.     ulFunction        : uLong;                 // Function requested by SH
  6934.     hStream           : HSTREAM;
  6935.     hEvent            : hEvent;                // used for EVENTS only
  6936.     ulCmd             : uLong;
  6937.     pParm             : Pointer;               // see CONTROL_PARM structure
  6938.     ulParmSize        : uLong;                 // see CONTROL_PARM structure
  6939.   end;
  6940.   pddCmdControl = ^ddCmdControl;
  6941.  
  6942. const
  6943.   // ulCmd defines
  6944.   DDCMD_START                   = 1;           // start device
  6945.   DDCMD_STOP                    = 2;           // stop device and return current position in pParm
  6946.   DDCMD_PAUSE                   = 3;           // pause device and return current position in pParm
  6947.   DDCMD_RESUME                  = 4;           // resume device
  6948.   DDCMD_ENABLE_EVENT            = 5;           // ask PDD to create this event
  6949.   DDCMD_DISABLE_EVENT           = 6;           // ask PDD to purge this event
  6950.   DDCMD_PAUSE_TIME              = 7;           // pause time keeping, but not the stream
  6951.   DDCMD_RESUME_TIME             = 8;           // resume time keeping.
  6952.  
  6953. type
  6954.   // CONTROL_PARM structure
  6955.   Control_Parm = record                        // DDCMDCONTROL parameter block
  6956.     ulTime            : uLong;                 // time in milliseconds
  6957.                                                // SH sets cuetime when ulCmd is ENABLE_EVENT
  6958.                                                // PDD returns current time for STOP, PAUSE
  6959.     evcb              : TIME_EVCB;
  6960.   end;
  6961.   pControl_Parm = ^Control_Parm;
  6962.  
  6963.   ddCmdRegister = record
  6964.     ulFunction        : uLong;                 // Function requested by SH
  6965.     hStream           : HSTREAM;               // Stream handle needed @ interrupt time
  6966.     ulSysFileNum      : uLong;                 // Device Handle so pdd can map device instance to hstream
  6967.     pSHDEntryPoint    : SHDFN;                 // Stream handler entry point
  6968.     ulStreamOperation : uLong;                 // SH input Record or play
  6969.     spcbkey           : SPCBKEY;
  6970.     ulBufSize         : uLong;                 // PDD output (optional) buffer size in bytes for SPCB
  6971.     ulNumBufs         : uLong;                 // PDD output (optional) # of buffers for SPCB
  6972.     ulAddressType     : uLong;                 // PDD output (required) addr ptr type to data buffer
  6973.     ulBytesPerUnit    : uLong;                 // PDD output (required)
  6974.     mmtimePerUnit     : MMTIME;                // PDD output (required)
  6975.     dcbAudio          : E_DCB;                 // SH input Device Control Block
  6976.     hid               : HID;                   // SH input stream handler id
  6977.   end;
  6978.   pddCmdRegister = ^ddCmdRegister;
  6979.  
  6980. const
  6981.   // ulStreamOperation  defines
  6982.   STREAM_OPERATION_MASK         = $C000;
  6983.   STREAM_OPERATION_CONSUME      = $8000;
  6984.   STREAM_OPERATION_PRODUCE      = $C000;
  6985.  
  6986.   // ulAddressType  defines
  6987.   // The PDD will tell the SH what type of address ptr it expects the data buffer
  6988.   // to be.  The SH will then request this address type to the SSM, so that the
  6989.   // SSM will send the correct type of each buffer request.
  6990.   ADDRESS_TYPE_VIRTUAL          = 0;
  6991.   ADDRESS_TYPE_PHYSICAL         = 1;              //default
  6992.   ADDRESS_TYPE_LINEAR           = 2;
  6993.  
  6994. type
  6995.   ddCmdDeregister = record
  6996.     ulFunction        : uLong;                 // Function requested by SH
  6997.     Stream            : hStream;               // Stream handle needed @ interrupt time
  6998.   end;
  6999.   pddCmdDeregister = ^ddCmdDeregister;
  7000.  
  7001. //*** RING 0 Stream Handler SHD Interfaces                                **
  7002.  
  7003. const
  7004.   // RING 0 Stream Handler  SHD's:
  7005.   SHD_REPORT_INT                = 0;           // PDD reports interrupt has arrived
  7006.   SHD_REPORT_EVENT              = 1;           // PDD reports cuetime has arrived
  7007.  
  7008. type
  7009.   shd_Common = record
  7010.     ulFunction        : uLong;                 // Function requested by PDD
  7011.     Stream            : hStream;               // Stream handle needed @ interrupt time
  7012.   end;
  7013.   pshd_Common = ^shd_Common;
  7014.  
  7015.   shd_ReportInt = record
  7016.     ulFunction        : uLong;                 // Function requested by PDD
  7017.     hStream           : HSTREAM;               // so SH knows which stream to process
  7018.     pBuffer           : Pointer;               // return ptr to last used buffer
  7019.     ulFlag            : uLong;                 // reason for interrupt
  7020.     ulStatus          : uLong;                 // rc or bytes read/written
  7021.     ulStreamTime      : uLong;                 // time in milliseconds of stream position
  7022.   end;
  7023.   pshd_ReportInt = ^shd_ReportInt;
  7024.  
  7025. const
  7026.   // ulFlag settings
  7027.   ERROR                         = $80;
  7028.   STREAM_STOP_NOW               = $40;
  7029.   SHD_READ_COMPLETE             = 1;
  7030.   SHD_WRITE_COMPLETE            = 2;
  7031.  
  7032. type
  7033.   shd_ReportEvent = record
  7034.     ulFunction        : uLong;                 // Function requested by PDD
  7035.     hStream           : HSTREAM;               // so SH knows which stream to process
  7036.     hEvent            : hEvent;                // event handle pass back to stream handler
  7037.     ulStreamTime      : uLong;                 // time in milliseconds of stream position
  7038.   end;
  7039.   pshd_ReportEvent = ^shd_ReportEvent;
  7040.  
  7041.  
  7042. //*** RING 3 Stream Handler SHD Interfaces                                **
  7043.  
  7044. const
  7045.   // RING 3 Stream Handler  SHD's: (Uses SpiSendMsg as interface)
  7046.   SHC_REPORT_INT                = $80000000;   // ulMsgType for SHD_REPORT_INT
  7047.   SHC_REPORT_EVENT              = $80000001;   // ulMsgType for SHD_REPORT_EVENT
  7048.  
  7049. type
  7050.   // MSG_REPORTINT Control Block.
  7051.   // pMsg field of SpiSendMsg api
  7052.   msg_ReportInt = record
  7053.     ulMsgLen          : uLong;                 // Length of structure
  7054.     pBuffer           : Pointer;               // return ptr to last used buffer
  7055.     ulFlag            : uLong;                 // reason for interrupt
  7056.     ulStatus          : uLong;                 // rc or bytes read/written
  7057.     ulStreamTime      : uLong;                 // time in milliseconds of stream position
  7058.   end;
  7059.   pmsg_ReportInt = ^msg_ReportInt;
  7060.  
  7061.    // For ulFlag defines, refer to the _shd_reportint_parm structure
  7062.  
  7063. type
  7064.   // MSG_REPORTEVENT Control Block.
  7065.   //  pMsg field of SpiSendMsg api
  7066.   msg_ReportEvent = record
  7067.     ulMsgLen          : uLong;                 // Length of structure
  7068.     hevent            : hEvent;                // event handle pass back to stream handler
  7069.     ulStreamTime      : uLong;                 // time in milliseconds of stream position
  7070.   end;
  7071.   pmsg_ReportEvent = ^msg_ReportEvent;
  7072.  
  7073. implementation
  7074.  
  7075. function mciPlayFile;                          external;
  7076. function mciPlayResource;                      external;
  7077. function mciRecordAudioFile;                   external;
  7078. function mciSendCommand;                       external;
  7079. function mciSendString;                        external;
  7080. function mciGetErrorString;                    external;
  7081. function mciMakeGroup;                         external;
  7082. function mciDeleteGroup;                       external;
  7083. function mciSetSysValue;                       external;
  7084. function mciQuerySysValue;                     external;
  7085. function mciGetDeviceID;                       external;
  7086.  
  7087. function SpiAssociate;                         external;
  7088. function SpiEnumerateHandlers;                 external;
  7089. function SpiGetHandler;                        external;
  7090. function SpiCreateStream;                      external;
  7091. function SpiSendMsg;                           external;
  7092. function SpiDestroyStream;                     external;
  7093. function SpiGetTime;                           external;
  7094. function SpiSeekStream;                        external;
  7095. function SpiStartStream;                       external;
  7096. function SpiStopStream;                        external;
  7097. function SpiDisableEvent;                      external;
  7098. function SpiEnableEvent;                       external;
  7099. function spiDisableSync;                       external;
  7100. function spiEnableSync;                        external;
  7101. function spiDetermineSyncMaster;               external;
  7102. function spiGetProtocol;                       external;
  7103. function spiInstallProtocol;                   external;
  7104. function spiEnumerateProtocols;                external;
  7105.  
  7106. function mdmDriverNotify;                      external;
  7107.  
  7108. function mmioRemoveElement;                    external;
  7109. function mmioFindElement;                      external;
  7110. function mmioAdvance;                          external;
  7111. function mmioAscend;                           external;
  7112. function mmioClose;                            external;
  7113. function mmioCreateChunk;                      external;
  7114. function mmioDescend;                          external;
  7115. function mmioFlush;                            external;
  7116. function mmioGetInfo;                          external;
  7117. function mmioGetLastError;                     external;
  7118. function mmioInstallIOProc;                    external;
  7119. function mmioIOProc;                           external;
  7120. function mmioOpen;                             external;
  7121. function mmioRead;                             external;
  7122. function mmioSeek;                             external;
  7123. function mmioSendMessage;                      external;
  7124. function mmioSetBuffer;                        external;
  7125. function mmioSetInfo;                          external;
  7126. function mmioStringToFourCC;                   external;
  7127. function mmioWrite;                            external;
  7128.  
  7129. function mmioCFOpen;                           external;
  7130. function mmioCFClose;                          external;
  7131. function mmioCFGetInfo;                        external;
  7132. function mmioCFSetInfo;                        external;
  7133. function mmioCFFindEntry;                      external;
  7134. function mmioCFAddEntry;                       external;
  7135. function mmioCFChangeEntry;                    external;
  7136. function mmioCFDeleteEntry;                    external;
  7137. function mmioCFAddElement;                     external;
  7138. function mmioCFCopy;                           external;
  7139.  
  7140. function mmioQueryFormatCount;                 external;
  7141. function mmioGetFormats;                       external;
  7142. function mmioGetFormatName;                    external;
  7143. function mmioIdentifyFile;                     external;
  7144. function mmioQueryHeaderLength;                external;
  7145. function mmioGetHeader;                        external;
  7146. function mmioSetHeader;                        external;
  7147. function mmioIniFileHandler;                   external;
  7148. function mmioIdentifyStorageSystem;            external;
  7149. function mmioDetermineSSIOProc;                external;
  7150. function mmioQueryIOProcModuleHandle;          external;
  7151. function mmioCFCompact;                        external;
  7152. function mmioMigrateIniFile;                   external;
  7153. function mmioIniFileCODEC;                     external;
  7154. function mmioSet;                              external;
  7155. function mmioQueryCODECName;                   external;
  7156. function mmioQueryCODECNameLength;             external;
  7157. function mmioLoadCODECProc;                    external;
  7158. function mmioGetData;                          external;
  7159.  
  7160. function WinSecondaryWindow;                   external;
  7161. function WinLoadSecondaryWindow;               external;
  7162. function WinProcessSecondaryWindow;            external;
  7163. function WinCreateSecondaryWindow;             external;
  7164. function WinDefaultSize;                       external;
  7165. function WinInsertDefaultSize;                 external;
  7166. function WinQuerySecondaryhwnd;                external;
  7167. function WinSecondaryMessageBox;               external;
  7168. function WinDismissSecondaryWindow;            external;
  7169. function WinDestroySecondaryWindow;            external;
  7170. function WinDefSecondaryWindowProc;            external;
  7171.  
  7172. function WinRegisterGraphicButton;             external;
  7173.  
  7174. Function DiveQueryCaps;                        external;
  7175. Function DiveOpen;                             external;
  7176. Function DiveSetupBlitter;                     external;
  7177. Function DiveBlitImage;                        external;
  7178. Function DiveClose;                            external;
  7179. Function DiveAcquireFrameBuffer;               external;
  7180. Function DiveSwitchBank;                       external;
  7181. Function DiveDeacquireFrameBuffer;             external;
  7182. Function DiveCalcFrameBufferAddress;           external;
  7183. Function DiveAllocImageBuffer;                 external;
  7184. Function DiveFreeImageBuffer;                  external;
  7185. Function DiveBeginImageBufferAccess;           external;
  7186. Function DiveEndImageBufferAccess;             external;
  7187. Function DiveSetDestinationPalette;            external;
  7188. Function DiveSetSourcePalette;                 external;
  7189.  
  7190. initialization
  7191.   FourCC_RIFF := mmioFourCC( 'R', 'I', 'F', 'F' );
  7192.   FourCC_LIST := mmioFourCC( 'L', 'I', 'S', 'T' );
  7193.   FourCC_MEM  := mmioFourCC( 'M', 'E', 'M', ' ' );
  7194.   FourCC_DOS  := mmioFourCC( 'D', 'O', 'S', ' ' );
  7195.   FourCC_BND  := mmioFourCC( 'B', 'N', 'D', ' ' );
  7196.   FourCC_FREE := mmioFourCC( 'F', 'R', 'E', 'E' );
  7197.   FourCC_DEL  := mmioFourCC( 'D', 'E', 'L', ' ' );
  7198.   FourCC_CTOC := mmioFourCC( 'C', 'T', 'O', 'C' );
  7199.   FourCC_CGRP := mmioFourCC( 'C', 'G', 'R', 'P' );
  7200.   FourCC_CF   := mmioFourCC( 'C', 'F', ' ', ' ' );
  7201.   FOURCC_ULTI := mmioFOURCC( 'U', 'L', 'T', 'I' );
  7202.   FourCC_RT21 := mmioFOURCC( 'R', 'T', '2', '1' );
  7203.   FourCC_DIB  := mmioFOURCC( 'D', 'I', 'B', ' ' );
  7204. end.
  7205.  
  7206.