mmio.pas 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648
  1. {
  2. Copyright (c) 1990-1993 International Business Machines Corporation
  3. Copyright (c) 2002 by Andry Svirgunov ([email protected])
  4. Copyright (c) 2002-2003 by Yuri Prokushev ([email protected])
  5. OS/2 2.0 Multimedia Extensions Input/Output Manager
  6. This program is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU Library General Public License (LGPL) as
  8. published by the Free Software Foundation; either version 2 of the
  9. License, or (at your option) any later version. This program is
  10. distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE.
  13. See the GNU Library General Public License for more details. You should
  14. have received a copy of the GNU Library General Public License along
  15. with this program; if not, write to the Free Software Foundation, Inc.,
  16. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. **********************************************************************}
  18. {
  19. @abstract(OS/2 2.0 Multimedia Extensions Input/Output Manager)
  20. @author(Andry Svirgunov ([email protected]))
  21. @author(Yuri Prokushev ([email protected]))
  22. @created(17 Dec 2002)
  23. @lastmod(19 Jan 2003)
  24. OS/2 2.0 Multimedia Extensions Input/Output Manager
  25. Warning: This code is alfa. Future versions of this unit will propably
  26. not be compatible.
  27. }
  28. Unit MMIO;
  29. Interface
  30. Uses
  31. MMBase;
  32. Const
  33. LibName='MMPM'; // !!TODO!! Subject to replace by MMIO
  34. // MS compat defines.
  35. Type
  36. HPSTR = PChar;
  37. Hwnd = LongInt;
  38. PFourCC = ^FourCC;
  39. HMMCF = hmmIO;
  40. HMODULE = LongInt;
  41. PHModule = ^Hmodule;
  42. pLong = ^LongInt;
  43. // Define MMIO public data structures.
  44. mmCkInfo = record
  45. ckid : FourCC; // Chunk id (FourCC)
  46. ckSize : LongInt; // Chunk Size (bytes)
  47. fccType : FourCC; // FourCC Type (if ckid RIFF or LIST)
  48. ulDataOffset : LongInt; // File Offset of data portion of chunk
  49. ulFlags : LongInt; // MMIO_DIRTY (if new chunk)
  50. end;
  51. pmmCkInfo = ^mmCkInfo;
  52. lpmmckinfo = pmmckinfo; // MS compat define */
  53. mmIOProc = function( pmmIOInfo: Pointer; usMsg: Word; lp1, lp2: LongInt): LongInt;
  54. pmmIOProc = mmIOProc;
  55. pCodecProc = mmIOProc;
  56. ppmmioproc = mmIOProc;
  57. LPMMIOProc = pmmIOProc;
  58. mmIOInfo = record
  59. ulFlags : LongInt; // Open flags
  60. fccIOProc : FourCC; // FourCC of the IOProc to use
  61. pIOProc : mmIOProc; // Function Pointer to IOProc to use
  62. ulErrorRet : LongInt; // Extended Error return code
  63. cchBuffer : LongInt; // I/O buff size (if used), Fsize if MEM
  64. pchBuffer : pChar; // Start of I/O buff
  65. pchNext : pChar; // Next char to read or write in buff
  66. pchEndRead : pChar; // Last char in buff can be read + 1
  67. pchEndWrite : pChar; // Last char in buff can be written + 1
  68. lBufOffset : LongInt; // Offset in buff to pchNext
  69. lDiskOffset : LongInt; // Disk offset in file
  70. aulInfo : Array[0..3] of LongInt; // IOProc specific fields
  71. lLogicalFilePos : LongInt; // Actual file position, buffered or not
  72. ulTranslate : LongInt; // Translation field
  73. fccChildIOProc : FourCC; // FourCC of Child IOProc
  74. pExtraInfoStruct : Pointer; // Pointer to a structure of related data
  75. mmio : hmmIO; // Handle to media element
  76. end;
  77. pmmIOInfo = ^mmIOInfo;
  78. lpmmIOInfo = pmmIOInfo;
  79. mmCfInfo = record
  80. ulHeaderSize : LongInt; // CTOC header size
  81. ulEntriesTotal : LongInt; // Num of CTOC table entries
  82. ulEntriesDeleted : LongInt; // Num of CTOC table entries deleted
  83. ulEntriesUnused : LongInt; // Num of unused CTOC entries
  84. ulBytesTotal : LongInt; // Combined byte size of all CGRP elements
  85. ulBytesDeleted : LongInt; // Byte size of all deleted CGRP elements
  86. ulHeaderFlags : LongInt; // Info about entire compound file (CF)
  87. usEntrySize : Word; // Size of each CTOC table entry
  88. usNameSize : Word; // Size of name field in entry, default 13
  89. usExHdrFields : Word; // Num CTOC header extra fields
  90. usExEntFields : Word; // Num CTOC entry extra fields
  91. end;
  92. // Note: The are variable length DWORD arrays that may be present
  93. // at the end of the MMCFINFO structure.
  94. // DWORD (*adwExHdrFldUsage)[]; */ // Array of header extra usage fields */
  95. // DWORD (*adwExtEntFldUsage)[]; */ // Array of entry extra usage fields */
  96. // DWORD (*adwExHdrField)[]; */ // Array of header extra fields */
  97. pmmCfInfo = ^mmCfInfo;
  98. lpmmCfInfo = pmmcfInfo;
  99. mmCtocEntry = record
  100. ulOffset : LongInt; // Offset of element within CGRP
  101. ulSize : LongInt; // Size of element
  102. ulMedType : LongInt; // Fourcc of element
  103. ulMedUsage : LongInt; // Possible sub type
  104. ulCompressTech : LongInt; // Compression technique used
  105. ulUncompressBytes : LongInt; // Actual size of uncompressed element
  106. end;
  107. // Note: A variable length name field and possibly a DWORD array may
  108. // be present at the end of the MMCTOCENTRY structure.
  109. // DWORD (*adwExEntField)[]; */ // Array of entry extra fields */
  110. // PSZ pszElementName[]; */ // Name of element, variable length */
  111. pmmCtocEntry = ^mmCtocEntry;
  112. lpmmCtocEntry = pmmCtocEntry;
  113. // Conversion Flags/Data Structures:
  114. const
  115. // Conversion Flags/Data Structures:
  116. MMIO_MEDIATYPE_IMAGE = $00000001; // Image media
  117. MMIO_MEDIATYPE_AUDIO = $00000002; // Audio media
  118. MMIO_MEDIATYPE_MIDI = $00000004; // MIDI media
  119. MMIO_MEDIATYPE_COMPOUND = $00000008; // Cmpd media
  120. MMIO_MEDIATYPE_OTHER = $00000010; // Other media
  121. MMIO_MEDIATYPE_UNKNOWN = $00000020; // Unknown media
  122. MMIO_MEDIATYPE_DIGITALVIDEO = $00000040; // Digital Video
  123. MMIO_MEDIATYPE_ANIMATION = $00000080; // Future: Not Supported
  124. MMIO_MEDIATYPE_MOVIE = $00000100; // Movie File
  125. MMIO_CANREADTRANSLATED = $00000001; //IOProc Cpbilty Flgs
  126. MMIO_CANWRITETRANSLATED = $00000002; // " " "
  127. MMIO_CANREADWRITETRANSLATED = $00000004; // " " "
  128. MMIO_CANREADUNTRANSLATED = $00000008; // " " "
  129. MMIO_CANWRITEUNTRANSLATED = $00000010; // " " "
  130. MMIO_CANREADWRITEUNTRANSLATED = $00000020; // " " "
  131. MMIO_CANSEEKTRANSLATED = $00000040; // " " "
  132. MMIO_CANSEEKUNTRANSLATED = $00000080; // " " "
  133. MMIO_CANINSERTUNTRANSLATED = $00000100; // " " "
  134. MMIO_CANSAVEUNTRANSLATED = $00000200; // " " "
  135. MMIO_CANINSERTTRANSLATED = $00000400; // " " "
  136. MMIO_CANSAVETRANSLATED = $00000800; // " " "
  137. MMIO_CANMULTITRACKREADTRANSLATED = $00001000; // " " "
  138. MMIO_CANMULTITRACKREADUNTRANSLATED = $00002000; // " " "
  139. MMIO_CANMULTITRACKWRITETRANSLATED = $00004000; // " " "
  140. MMIO_CANMULTITRACKWRITEUNTRANSLATED = $00008000; // " " "
  141. MMIO_CANTRACKSEEKTRANSLATED = $00010000; // " " "
  142. MMIO_CANTRACKSEEKUNTRANSLATED = $00020000; // " " "
  143. MMIO_CANTRACKREADTRANSLATED = $00040000; // " " "
  144. MMIO_CANTRACKREADUNTRANSLATED = $00080000; // " " "
  145. MMIO_CANTRACKWRITETRANSLATED = $00100000; // " " "
  146. MMIO_CANTRACKWRITEUNTRANSLATED = $00200000; // " " "
  147. MMIO_IOPROC_STORAGESYSTEM = $00000001; // IOProc Types
  148. MMIO_IOPROC_FILEFORMAT = $00000002;
  149. MMIO_IOPROC_DATAFORMAT = $00000004;
  150. Type
  151. mmFormatInfo = record
  152. ulStructLen : LongInt; // Length of this structure
  153. fccIOProc : FourCC; // IOProc identifier
  154. ulIOProcType : LongInt; // Type of IOProc
  155. ulMediaType : LongInt; // Media Type
  156. ulFlags : LongInt; // IOProc capability flags
  157. szDefaultFormatExt : Array[0..Sizeof(FourCC)] of Char;
  158. // Default extension 4 + null
  159. ulCodePage : LongInt; // Code Page
  160. ulLanguage : LongInt; // Language
  161. lNameLength : LongInt; // length of identifier string
  162. end;
  163. pmmFormatInfo = ^mmFormatInfo;
  164. Const
  165. MMIO_IMAGE_UNKNOWN = $00000000; // Unknown image content
  166. MMIO_IMAGE_DRAWING = $00000001; // Simple drawing
  167. MMIO_IMAGE_GRAPH = $00000002; // Graphs & Cartoons
  168. MMIO_IMAGE_PHOTO = $00000004; // Varying Color & Shades
  169. MAX_PALETTE = 256;
  170. //*********************************************
  171. // *
  172. // * GENPAL - Generic Header Palette
  173. // *
  174. // **********************************************/
  175. Type
  176. RGB2 = record
  177. bBlue: Byte; { Blue component of the color definition }
  178. bGreen: Byte; { Green component of the color definition}
  179. bRed: Byte; { Red component of the color definition }
  180. fcOptions: Byte; { Reserved, must be zero }
  181. end;
  182. PRGB2 = ^RGB2;
  183. Type
  184. GENPAL = RECORD // genpal */
  185. ulStartIndex:LongInt; // starting RGB index */
  186. ulNumColors:LongInt; // number of following entries */
  187. prgb2Entries:PRGB2; // 256 RGB entries */
  188. end;
  189. PGENPAL = ^GENPAL; // Ptr to a generic palette */
  190. Type
  191. BitMapInfoHeader2 = record
  192. cbFix: LongInt; { Length of structure }
  193. cx: LongInt; { Bit-map width in pels }
  194. cy: LongInt; { Bit-map height in pels }
  195. cPlanes: Word; { Number of bit planes }
  196. cBitCount: Word; { Number of bits per pel within a plane }
  197. ulCompression: Longint; { Compression scheme used to store the bitmap }
  198. cbImage: Longint; { Length of bit-map storage data in bytes}
  199. cxResolution: Longint; { x resolution of target device }
  200. cyResolution: Longint; { y resolution of target device }
  201. cclrUsed: Longint; { Number of color indices used }
  202. cclrImportant: Longint; { Number of important color indices }
  203. usUnits: Word; { Units of measure }
  204. usReserved: Word; { Reserved }
  205. usRecording: Word; { Recording algorithm }
  206. usRendering: Word; { Halftoning algorithm }
  207. cSize1: Longint; { Size value 1 }
  208. cSize2: Longint; { Size value 2 }
  209. ulColorEncoding: Longint; { Color encoding }
  210. ulIdentifier: Longint; { Reserved for application use }
  211. end;
  212. pbitmapinfoheader2=^bitmapinfoheader2;
  213. xdibHdr_Prefix = record
  214. ulMemSize : LongInt; // Length of bitmap
  215. ulPelFormat : LongInt;
  216. usTransType : Word;
  217. ulTransVal : LongInt;
  218. end;
  219. mmxdibHeader = record // XDIB Header
  220. XDIBHeaderPrefix : XDIBHDR_PREFIX;
  221. BMPInfoHeader2 : BITMAPINFOHEADER2;
  222. end;
  223. pmmxdibHeader = ^mmxdibHeader;
  224. mmImageHeader = record
  225. ulHeaderLength : LongInt; // Length in Bytes
  226. ulContentType : LongInt; // Image content
  227. ulMediaType : LongInt; // Media Type
  228. mmXDIBHeader : mmXDIBHeader; // OS/2 2.0 PM compat header
  229. bmiColors : Array[0..MAX_PALETTE-1] of RGB2; // PM compatible palette
  230. end;
  231. pmmImageHeader = ^mmImageHeader;
  232. Const
  233. MMIO_AUDIO_UNKNOWN = $00000000; // Unknown image content
  234. MMIO_AUDIO_VOICE = $00000001; // Limited Range
  235. MMIO_AUDIO_MUSIC = $00000002; // FM Radio or equivalent
  236. MMIO_AUDIO_HIFI = $00000004; // High quality recording
  237. Type
  238. Wave_Header = record
  239. usFormatTag : Word; // Type of wave format
  240. usChannels : Word; // Number of channels
  241. ulSamplesPerSec : LongInt; // Sampling rate
  242. ulAvgBytesPerSec : LongInt; // Avg bytes per sec
  243. usBlockAlign : Word; // Block Alignment in bytes
  244. usBitsPerSample : Word; // Bits per sample
  245. end;
  246. xWav_HeaderInfo = record
  247. ulAudioLengthInMS : LongInt; // Audio data in millisecs
  248. ulAudioLengthInBytes : LongInt; // Audio data in bytes
  249. pAdditionalInformation : Pointer;
  250. end;
  251. mmxWav_Header = record
  252. WAVEHeader : WAVE_HEADER; // Per RIFF WAVE Definition
  253. XWAVHeaderInfo : XWAV_HEADERINFO; // Extended wave definition
  254. end;
  255. mmAudioHeader = record
  256. ulHeaderLength : LongInt; // Length in Bytes
  257. ulContentType : LongInt; // Image content
  258. ulMediaType : LongInt; // Media Type
  259. mmXWAVHeader : MMXWAV_HEADER; // header
  260. end;
  261. pmmAudioHeader = ^mmAudioHeader;
  262. Const
  263. MMIO_MIDI_UNKNOWN = $00000000; // Unknown midi content
  264. MMIO_MIDI_VOICE = $00000001; // Limited Range
  265. MMIO_MIDI_MUSIC = $00000002; // FM Radio or equivalent
  266. MMIO_MIDI_HIFI = $00000004; // High quality recording
  267. // MMPMMMIO.INI file structure and definitions.
  268. CCHMAXPATH = 260;
  269. DLLNAME_SIZE = CCHMAXPATH;
  270. PROCNAME_SIZE = 32;
  271. MAX_EXTENSION_NAME = 4;
  272. Type
  273. mmIniFileInfo = record
  274. fccIOProc : FourCC; // IOProc identifier
  275. szDLLName : Array[0..DLLName_Size-1] of Char; // DLL name string
  276. szProcName : Array[0..ProcName_Size-1] of Char; // Procedure name string
  277. ulFlags : LongInt; // Flags for Preload
  278. ulExtendLen : LongInt; // Length of ext fields
  279. ulMediaType : LongInt; // Media type
  280. ulIOProcType : LongInt; // Type of IOProc
  281. szDefExt : Array[0..Max_Extension_Name] of Char;
  282. end;
  283. pmmIniFileInfo = ^mmIniFileInfo;
  284. // CODEC Structures and type definitions for Rel. 1.1
  285. Const
  286. CODEC_INFO_SIZE = 8;
  287. CODEC_HW_NAME_SIZE = 32;
  288. Type
  289. CodecIniFileInfo = record
  290. ulStructLen : LongInt; // length of this structure
  291. fcc : FourCC; // File Format ID
  292. szDLLName : Array[0..DLLName_Size-1] of Char; // DLL name string
  293. szProcName : Array[0..ProcName_Size-1] of Char; // Procedure name string
  294. ulCompressType : LongInt; // Compression Type
  295. ulCompressSubType : LongInt; // Compression SubType
  296. ulMediaType : LongInt; // Media type
  297. ulCapsFlags : LongInt; // capabilities flags
  298. ulFlags : LongInt; // flags
  299. szHWID : Array[0..Codec_HW_Name_Size-1] of Char; // specific information
  300. ulMaxSrcBufLen : LongInt; // max source buffer length
  301. ulSyncMethod : LongInt; // Synchronization method
  302. fccPreferredFormat: LongInt; // Preferred output format
  303. ulXalignment : LongInt; // x alignment - video only
  304. ulYalignment : LongInt; // y alignment - video only
  305. ulSpecInfo : Array[0..Codec_Info_Size-1] of LongInt; // specific information
  306. end;
  307. pCodecIniFileInfo = ^CodecIniFileInfo;
  308. Const
  309. // CODECINIFILEINFO synchronization method (ulSyncMethod) values.
  310. CODEC_SYNC_METHOD_NO_DROP_FRAMES = 0;
  311. CODEC_SYNC_METHOD_DROP_FRAMES_IMMEDIATELY = 1;
  312. CODEC_SYNC_METHOD_DROP_FRAMES_PRECEDING_KEY = 2;
  313. CODEC_SYNC_METHOD_HARDWARE = 3;
  314. // CODECINIFILEINFO capabilities (ulCapsFlags) values.
  315. CODEC_COMPRESS = $00000001;
  316. CODEC_DECOMPRESS = $00000002;
  317. CODEC_WINDOW_CLIPPING = $00000004;
  318. CODEC_PALETTE_TRANS = $00000008;
  319. CODEC_SELFHEAL = $00000010;
  320. CODEC_SCALE_PEL_DOUBLE = $00000020;
  321. CODEC_SCALE_PEL_HALVED = $00000040;
  322. CODEC_SCALE_CONTINUOUS = $00000080;
  323. CODEC_MULAPERTURE = $00000100;
  324. CODEC_4_BIT_COLOR = $00000200;
  325. CODEC_8_BIT_COLOR = $00000400;
  326. CODEC_16_BIT_COLOR = $00000800;
  327. CODEC_24_BIT_COLOR = $00001000;
  328. CODEC_HARDWARE = $00002000;
  329. CODEC_SYMMETRIC = $00004000;
  330. CODEC_ASYMMETRIC = $00008000;
  331. CODEC_DIRECT_DISPLAY = $00010000;
  332. CODEC_DEFAULT = $00020000;
  333. CODEC_ORIGIN_LOWERLEFT = $00040000;
  334. CODEC_ORIGIN_UPPERLEFT = $00080000;
  335. CODEC_SET_QUALITY = $00100000; // quality level is settable
  336. CODEC_DATA_CONSTRAINT = $00200000; // data constraint supported
  337. CODEC_HW_OVERLAY = $00400000;
  338. CODEC_MULTI_BUFFER = $00800000;
  339. CODEC_DITHER_OUTPUT = $01000000;
  340. // Audio related flags
  341. CODEC_COMP_REALTIME = $00020000;
  342. CODEC_DECOMP_REALTIME = $00040000;
  343. // CODECINIFILEINFO Flag Values (ulFlags) values.
  344. // Bit definitions for mmioSet()
  345. MMIO_SET_EXTENDEDINFO = $0001;
  346. MMIO_QUERY_EXTENDEDINFO_BASE = $0002;
  347. MMIO_QUERY_EXTENDEDINFO_ALL = $0004;
  348. Type
  349. // CODECASSOC structure
  350. CodecAssoc = record
  351. pCodecOpen : Pointer; // codec specific open header
  352. pCODECIniInfo : PCodecIniFileInfo; // codecinifileinfo
  353. end;
  354. pCodecAssoc = ^CodecAssoc;
  355. // MMEXTENDINFO structure
  356. mmExtendInfo = record
  357. ulStructLen : LongInt; // length of this structure
  358. ulBufSize : LongInt; // total buffer size
  359. ulFlags : LongInt; // flags
  360. ulTrackID : LongInt; // track ID
  361. ulNumCODECs : LongInt; // number of codec entries
  362. pCODECAssoc : PCodecAssoc; // pointer to codec info array
  363. end;
  364. pmmExtendInfo = ^mmExtendInfo;
  365. const
  366. // MMEXTENDINFO operation (ulFlags) values.
  367. MMIO_TRACK = $00000001;
  368. MMIO_NORMAL_READ = $00000002;
  369. MMIO_SCAN_READ = $00000004;
  370. MMIO_REVERSE_READ = $00000008;
  371. MMIO_CODEC_ASSOC = $00000100;
  372. // Audio Related defines
  373. MMIO_REALTIME_CODEC = $00000200;
  374. MMIO_RESETTRACKS = -1; // Turns off the active track number.
  375. CODEC_START = $0EC0;
  376. CODEC_END = $0EFF;
  377. MMIOM_CODEC_CLOSE = CODEC_START + 1;
  378. MMIOM_CODEC_OPEN = CODEC_START + 2;
  379. MMIOM_CODEC_QUERYNAME = CODEC_START + 3;
  380. MMIOM_CODEC_QUERYNAMELENGTH = CODEC_START + 4;
  381. MMIOM_CODEC_COMPRESS = CODEC_START + 5;
  382. MMIOM_CODEC_DECOMPRESS = CODEC_START + 6;
  383. MMIOMP_CODEC_HW_CONTROL_STOP_DISCARD =0;
  384. MMIOMP_CODEC_HW_CONTROL_STOP_FLUSH =1;
  385. MMIOMP_CODEC_HW_CONTROL_STOP_PAUSE =2;
  386. MMIOMP_CODEC_HW_CONTROL_DATATYPE =3;
  387. // Flags:
  388. MMIO_CREATE = $00000001; // Open
  389. MMIO_CTOCFIRST = $00000002; // Open
  390. MMIO_READ = $00000004; // Open
  391. MMIO_WRITE = $00000008; // Open
  392. MMIO_READWRITE = $00000010; // Open
  393. MMIO_COMPAT = $00000020; // Open
  394. MMIO_EXCLUSIVE = $00000040; // Open
  395. MMIO_DENYWRITE = $00000080; // Open
  396. MMIO_DENYREAD = $00000100; // Open
  397. MMIO_DENYNONE = $00000200; // Open
  398. MMIO_ALLOCBUF = $00000400; // Open
  399. MMIO_DELETE = $00000800; // Open
  400. MMIO_USE_TEMP = $00001000; // Open/Close/Save
  401. MMIO_INSERTON = $00000001; // Insert
  402. MMIO_INSERTOFF = $00000002; // Insert
  403. MMIO_RWMODE = $00001000; // Open
  404. MMIO_SHAREMODE = $00002000; // Open
  405. MMIO_DIRTY = $00004000; // Write
  406. MMIO_VERTBAR = $00008000; // Open
  407. MMIO_BUFSHARED = $00010000; // Open
  408. MMIO_APPEND = $00020000; // Open
  409. MMIO_NOIDENTIFY = $00040000; // Open
  410. MMIO_FINDFIRST = $00000001; // CF Find Entry
  411. MMIO_FINDNEXT = $00000002; // CF Find Entry
  412. MMIO_FINDUNUSED = $00000004; // CF Find Entry
  413. MMIO_FINDDELETED = $00000008; // CF Find Entry
  414. MMIO_CHANGEDELETED = $0001; // CF Change Entry
  415. MMIO_CF_FQNAME = $0001; // CF Compact
  416. MMIO_FHOPEN = $0001; // Close
  417. MMIO_EMPTYBUF = $0001; // Flush
  418. MMIO_CREATERIFF = $0001; // CreateChunk
  419. MMIO_CREATELIST = $0002; // CreateChunk
  420. MMIO_FINDCHUNK = $0004; // Descend
  421. MMIO_FINDRIFF = $0008; // Descend
  422. MMIO_FINDLIST = $0010; // Descend
  423. CTOC_HF_SEQUENTIAL = $00000001; // CTOC ulHeaderFlags
  424. CTOC_HF_MEDSUBTYPE = $00000002; // CTOC ulHeaderFlags
  425. CTOC_EFU_UNUSED = $00000000; // CTOC extra usage code
  426. CTOC_EFU_LASTMODTIME = $00000001; // CTOC extra usage code
  427. CTOC_EFU_CODEPAGE = $00000002; // CTOC extra usage code
  428. CTOC_EFU_LANGUAGE = $00000003; // CTOC extra usage code
  429. CTOC_EFU_COMPRESSPARAM0 = $00000005; // CTOC extra usage code
  430. CTOC_EFU_COMPRESSPARAM1 = $00000006; // CTOC extra usage code
  431. CTOC_EFU_COMPRESSPARAM2 = $00000007; // CTOC extra usage code
  432. CTOC_EFU_COMPRESSPARAM3 = $00000008; // CTOC extra usage code
  433. CTOC_EFU_COMPRESSPARAM4 = $00000009; // CTOC extra usage code
  434. CTOC_EFU_COMPRESSPARAM5 = $0000000A; // CTOC extra usage code
  435. CTOC_EFU_COMPRESSPARAM6 = $0000000B; // CTOC extra usage code
  436. CTOC_EFU_COMPRESSPARAM7 = $0000000C; // CTOC extra usage code
  437. CTOC_EFU_COMPRESSPARAM8 = $0000000D; // CTOC extra usage code
  438. CTOC_EFU_COMPRESSPARAM9 = $0000000E; // CTOC extra usage code
  439. CTOC_CharSET_STANDARD = $00000000; // CTOC charset value
  440. MMIO_INSTALLPROC = $00000001; // Install IO Proc
  441. MMIO_REMOVEPROC = $00000002; // Install IO Proc
  442. MMIO_FINDPROC = $00000004; // Install IO Proc
  443. MMIO_MATCHFIRST = $00000010; // Ini File Handler
  444. MMIO_MATCHNEXT = $00000020; // Ini File Handler
  445. MMIO_MATCHFourCC = $00000040; // Ini File Handler
  446. MMIO_MATCHDLL = $00000080; // Ini File Handler
  447. MMIO_MATCHPROCEDURENAME = $00000100; // Ini File Handler
  448. MMIO_FULLPATH = $00000200; // Ini File Handler
  449. MMIO_NOVERIFY = $00000400; // Ini File Handler
  450. MMIO_MATCHCOMPRESSTYPE = $00000800; // Ini File Handler
  451. MMIO_EXTENDED_STRUCT = $00001000; // Ini File ulFlags
  452. MMIO_MATCHCOMPRESSSUBTYPE = $00002000; // Ini File Handler
  453. MMIO_MATCHHWID = $00004000; // Ini File Handler
  454. MMIO_MATCHCAPSFLAGS = $00008000; // Ini File Handler
  455. MMIO_SKIPMATCH = $00010000; // Ini/Load Handler
  456. MMIO_TOUPPER = $0001; // StringToFourcc
  457. MMIO_CF_ENTRY_EXISTS = $00000001; // Add CGRP element
  458. MMIO_FORCE_IDENTIFY_SS = $00000001; // Identify
  459. MMIO_FORCE_IDENTIFY_FF = $00000002; // Identify
  460. MMIO_NOTRANSLATE = $00000000; // Translation
  461. MMIO_TRANSLATEDATA = $00000001; // Translation
  462. MMIO_TRANSLATEHEADER = $00000002; // Translation
  463. MMIO_DECOMPRESS = $00000004; // CODEC Decompress
  464. MMIO_DEFAULTBUFFER = 8192; // two pages under OS/2 2.0
  465. MMIO_SEEK_IFRAME = $00010000; // Seek to nearest previous IFRAME
  466. // Messages :
  467. MMIOM_START = $0E00;
  468. MMIOM_END = $0EFF;
  469. MMIOM_GETCF = MMIOM_START + 1;
  470. MMIOM_GETCFENTRY = MMIOM_START + 2;
  471. MMIOM_CLOSE = MMIOM_START + 3;
  472. MMIOM_OPEN = MMIOM_START + 4;
  473. MMIOM_READ = MMIOM_START + 5;
  474. MMIOM_SEEK = MMIOM_START + 6;
  475. MMIOM_WRITE = MMIOM_START + 7;
  476. MMIOM_IDENTIFYFILE = MMIOM_START + 8;
  477. MMIOM_GETHEADER = MMIOM_START + 9;
  478. MMIOM_SETHEADER = MMIOM_START + 10;
  479. MMIOM_QUERYHEADERLENGTH = MMIOM_START + 11;
  480. MMIOM_GETFORMATNAME = MMIOM_START + 12;
  481. MMIOM_GETFORMATINFO = MMIOM_START + 13;
  482. MMIOM_SEEKBYTIME = MMIOM_START + 14;
  483. MMIOM_TEMPCHANGE = MMIOM_START + 15;
  484. MMIOM_BEGININSERT = MMIOM_START + 16;
  485. MMIOM_ENDINSERT = MMIOM_START + 17;
  486. MMIOM_SAVE = MMIOM_START + 18;
  487. MMIOM_SET = MMIOM_START + 19;
  488. MMIOM_COMPRESS = MMIOM_START + 20;
  489. MMIOM_DECOMPRESS = MMIOM_START + 21;
  490. MMIOM_MULTITRACKREAD = MMIOM_START + 22;
  491. MMIOM_MULTITRACKWRITE = MMIOM_START + 23;
  492. MMIOM_DELETE = MMIOM_START + 24;
  493. MMIOM_BEGINGROUP = MMIOM_START + 25;
  494. MMIOM_ENDGROUP = MMIOM_START + 26;
  495. MMIOM_UNDO = MMIOM_START + 27;
  496. MMIOM_REDO = MMIOM_START + 28;
  497. MMIOM_BEGINSTREAM = MMIOM_START + 29;
  498. MMIOM_ENDSTREAM = MMIOM_START + 30;
  499. MMIOM_CUT = MMIOM_START + 31;
  500. MMIOM_COPY = MMIOM_START + 32;
  501. MMIOM_PASTE = MMIOM_START + 33;
  502. MMIOM_CLEAR = MMIOM_START + 34;
  503. MMIOM_STATUS = MMIOM_START + 35;
  504. MMIOM_WINMSG = MMIOM_START + 36;
  505. MMIOM_BEGINRECORD = MMIOM_START + 37;
  506. MMIOM_ENDRECORD = MMIOM_START + 38;
  507. // These 3 new messages were added with feature 11710
  508. MMIOM_QUERYIMAGE = MMIOM_START + 39;
  509. MMIOM_QUERYIMAGECOUNT = MMIOM_START + 40;
  510. MMIOM_SETIMAGE = MMIOM_START + 41;
  511. MMIO_REALTIME = $00000001;
  512. MMIO_NONREALTIME = $00000002;
  513. MMIOM_USER = $0F00;
  514. MMIOM_USER_END = $0FFF;
  515. Type
  516. // Parameter structure for MMIOM_STATUS
  517. mmIO_Status_Parms = record
  518. hwndWindow : hwnd; // Some items require a window handle
  519. ulReturn : LongInt; // Return field
  520. ulItem : LongInt; // Use MCI_STATUS_... flags here
  521. ulValue : LongInt; // Status value field
  522. ulType : LongInt; // MCI_FORMAT_... of ulReturn
  523. end;
  524. pmmIO_Status_Parms = ^mmIO_Status_Parms;
  525. // Parameter structure for MMIOM_COPY, MMIOM_CUT, MMIOM_CLEAR and MMIOM_PASTE
  526. uSec = LongInt; // microsecond time format
  527. mmIO_mEdit_Parms = record
  528. ulStrucLen : LongInt; // length of this structure
  529. hwndWindow : hwnd; // window handle
  530. ulStartTime : uSec; // starting time in usec
  531. ulDuration : uSec; // duration in usec
  532. ulCurrentFilePosition : LongInt; // current file position in usec
  533. ulNewFilePosition : LongInt; // returned by IO proc in usec, MCD will issue a seek
  534. ulNewFileLength : LongInt; // return by IO proc in usec, MCD updates its headers
  535. pBuffer : Pointer; // optional buffer
  536. ulBufferLength : LongInt; // optional buffer's length
  537. pHeader : Pointer; // optional pointer to header for buffer
  538. end;
  539. pmmIO_mEdit_Parms = ^mmIO_mEdit_Parms;
  540. // Parameter structure for MMIOM_WINMSG
  541. mmIO_WinMsg = record
  542. hwndWindow : hwnd; // these are the parameters
  543. usMessage : Word; // ... passed to the
  544. pParam1 : Pointer; // ... window procedure
  545. pParam2 : Pointer; // ... by PM
  546. end;
  547. pmmIO_WinMsg = ^mmIO_WinMsg;
  548. // JPEG IOproc specific structure
  549. Const
  550. YUV_YVU =$0080; //v013 Compressed data is YUV///
  551. DST_Y =20;
  552. DST_YY =25;
  553. Type
  554. jpegoptions = record // this comment needed by h2inc ///
  555. ulStructLen:Longint; // size of this sturcture ///
  556. usQuantization:Array [0..4] of word; // Each number may be 1 - 65535 ///
  557. usScale:Word; // 1 (1/8 Size) - 8 (Full Size; default) ///
  558. ulColorOrder:LongInt; // YUV_YVU (Default) or ~YUV_YVU ///
  559. usColorSpaceOut:Word; // DST_YY (Default) or DST_Y ///
  560. end;
  561. pJpegOptions = ^JpegOptions;
  562. // Include error codes for MMIO only.
  563. Const
  564. MMIO_SUCCESS = 0;
  565. MMIO_WARNING = 2;
  566. MMIO_ERROR = -1;
  567. MMIOERR_UNSUPPORTED_MESSAGE = -2;
  568. MMIO_CF_SUCCESS = 0;
  569. MMIO_CF_FAILURE = 1;
  570. MMIO_NLS_CharSET_INFO = 8000; // RCDATA Name ID for NLS
  571. MMIO_IOPROC_NAME_TABLE = 8500; // RCDATA Name ID for string table
  572. MMIO_CODEC_NAME_TABLE = 9000; // RCDATA Name ID for Codec table
  573. // Numeric equivalents of fourcc's. These are needed for the resource
  574. // compiler.
  575. HEX_FourCC_DOS = $20534f44;
  576. HEX_FourCC_MEM = $204d454d;
  577. HEX_FourCC_BND = $20444e42;
  578. HEX_FourCC_CF = $20204643;
  579. // Country codes (CC), languages (LC), and dialects (DC).
  580. MMIO_DEFAULT_CODE_PAGE = 437;
  581. MMIO_CC_NONE = 000;
  582. MMIO_CC_USA = 001;
  583. MMIO_CC_CANADA = 002;
  584. MMIO_CC_LATIN_AMERICA = 003;
  585. MMIO_CC_GREECE = 030;
  586. MMIO_CC_NETHERLANDS = 031;
  587. MMIO_CC_BELGIUM = 032;
  588. MMIO_CC_FRANCE = 033;
  589. MMIO_CC_SPAIN = 034;
  590. MMIO_CC_ITALY = 039;
  591. MMIO_CC_SWITZERLAND = 041;
  592. MMIO_CC_AUSTRIA = 043;
  593. MMIO_CC_UNITED_KINGDOM = 044;
  594. MMIO_CC_DENMARK = 045;
  595. MMIO_CC_SWEDEN = 046;
  596. MMIO_CC_NORWAY = 047;
  597. MMIO_CC_WEST_GERMANY = 049;
  598. MMIO_CC_MEXICO = 052;
  599. MMIO_CC_BRAZIL = 055;
  600. MMIO_CC_AUSTRALIA = 061;
  601. MMIO_CC_NEW_ZEALAND = 064;
  602. MMIO_CC_JAPAN = 081;
  603. MMIO_CC_KOREA = 082;
  604. MMIO_CC_CHINA = 086;
  605. MMIO_CC_TAIWAN = 088;
  606. MMIO_CC_TURKEY = 090;
  607. MMIO_CC_PORTUGAL = 351;
  608. MMIO_CC_LUXEMBOURG = 352;
  609. MMIO_CC_ICELAND = 354;
  610. MMIO_CC_FINLAND = 358;
  611. MMIO_LC_NONE = 0;
  612. MMIO_DC_NONE = 0;
  613. MMIO_LC_ARABIC = 1;
  614. MMIO_DC_ARABIC = 1;
  615. MMIO_LC_BULGARIAN = 2;
  616. MMIO_DC_BULGARIAN = 1;
  617. MMIO_LC_CATALAN = 3;
  618. MMIO_DC_CATALAN = 1;
  619. MMIO_LC_TRADITIONAL_CHINESE = 4;
  620. MMIO_DC_TRADITIONAL_CHINESE = 1;
  621. MMIO_LC_SIMPLE_CHINESE = 4;
  622. MMIO_DC_SIMPLE_CHINESE = 2;
  623. MMIO_LC_CZECH = 5;
  624. MMIO_DC_CZECH = 1;
  625. MMIO_LC_DANISH = 6;
  626. MMIO_DC_DANISH = 1;
  627. MMIO_LC_GERMAN = 7;
  628. MMIO_DC_GERMAN = 1;
  629. MMIO_LC_SWISS_GERMAN = 7;
  630. MMIO_DC_SWISS_GERMAN = 2;
  631. MMIO_LC_GREEK = 8;
  632. MMIO_DC_GREEK = 1;
  633. MMIO_LC_US_ENGLISH = 9;
  634. MMIO_DC_US_ENGLISH = 1;
  635. MMIO_LC_UK_ENGLISH = 9;
  636. MMIO_DC_UK_ENGLISH = 2;
  637. MMIO_LC_SPANISH = 10;
  638. MMIO_DC_SPANISH = 1;
  639. MMIO_LC_SPANISH_MEXICAN = 10;
  640. MMIO_DC_SPANISH_MEXICAN = 2;
  641. MMIO_LC_FINNISH = 11;
  642. MMIO_DC_FINNISH = 1;
  643. MMIO_LC_FRENCH = 12;
  644. MMIO_DC_FRENCH = 1;
  645. MMIO_LC_BELGIAN_FRENCH = 12;
  646. MMIO_DC_BELGIAN_FRENCH = 2;
  647. MMIO_LC_CANADIAN_FRENCH = 12;
  648. MMIO_DC_CANADIAN_FRENCH = 3;
  649. MMIO_LC_SWISS_FRENCH = 12;
  650. MMIO_DC_SWISS_FRENCH = 4;
  651. MMIO_LC_HEBREW = 13;
  652. MMIO_DC_HEBREW = 1;
  653. MMIO_LC_HUNGARIAN = 14;
  654. MMIO_DC_HUNGARIAN = 1;
  655. MMIO_LC_ICELANDIC = 15;
  656. MMIO_DC_ICELANDIC = 1;
  657. MMIO_LC_ITALIAN = 16;
  658. MMIO_DC_ITALIAN = 1;
  659. MMIO_LC_SWISS_ITALIAN = 16;
  660. MMIO_DC_SWISS_ITALIAN = 2;
  661. MMIO_LC_JAPANESE = 17;
  662. MMIO_DC_JAPANESE = 1;
  663. MMIO_LC_KOREAN = 18;
  664. MMIO_DC_KOREAN = 1;
  665. MMIO_LC_DUTCH = 19;
  666. MMIO_DC_DUTCH = 1;
  667. MMIO_LC_BELGIAN_DUTCH = 19;
  668. MMIO_DC_BELGIAN_DUTCH = 2;
  669. MMIO_LC_NORWEGIAN_BOKMAL = 20;
  670. MMIO_DC_NORWEGIAN_BOKMAL = 1;
  671. MMIO_LC_NORWEGIAN_NYNORSK = 20;
  672. MMIO_DC_NORWEGIAN_NYNORSK = 2;
  673. MMIO_LC_POLISH = 21;
  674. MMIO_DC_POLISH = 1;
  675. MMIO_LC_BRAZILIAN_PORTUGUESE = 22;
  676. MMIO_DC_BRAZILIAN_PORTUGUESE = 1;
  677. MMIO_LC_PORTUGUESE = 22;
  678. MMIO_DC_PORTUGUESE = 2;
  679. MMIO_LC_RHAETO_ROMANIC = 23;
  680. MMIO_DC_RHAETO_ROMANIC = 1;
  681. MMIO_LC_ROMANIAN = 24;
  682. MMIO_DC_ROMANIAN = 1;
  683. MMIO_LC_RUSSIAN = 25;
  684. MMIO_DC_RUSSIAN = 1;
  685. MMIO_LC_SERBO_CROATIAN_LATIN = 26;
  686. MMIO_DC_SERBO_CROATIAN_LATIN = 1;
  687. MMIO_LC_SERBO_CROATIAN_CYRILLIC = 26;
  688. MMIO_DC_SERBO_CROATIAN_CYRILLIC = 2;
  689. MMIO_LC_SLOVAK = 27;
  690. MMIO_DC_SLOVAK = 1;
  691. MMIO_LC_ALBANIAN = 28;
  692. MMIO_DC_ALBANIAN = 1;
  693. MMIO_LC_SWEDISH = 29;
  694. MMIO_DC_SWEDISH = 1;
  695. MMIO_LC_THAI = 30;
  696. MMIO_DC_THAI = 1;
  697. MMIO_LC_TURKISH = 31;
  698. MMIO_DC_TURKISH = 1;
  699. MMIO_LC_URDU = 32;
  700. MMIO_DC_URDU = 1;
  701. MMIO_LC_BAHASA = 33;
  702. MMIO_DC_BAHASA = 1;
  703. // Ultimotion CODEC type for CODECINIFILEINFO ulCompressType */
  704. //#define FOURCC_ULTI mmioFOURCC('U', 'L', 'T', 'I')
  705. Const
  706. // FOURCC_ULTI:FOURCC=0;
  707. HEX_FOURCC_ULTI=$49544C55; // ITLU */
  708. // Indeo CODEC type for CODECINIFILEINFO ulCompressType */
  709. //#define FOURCC_RT21 mmioFOURCC('R', 'T', '2', '1')
  710. // FOURCC_RT21:FOURCC=0;
  711. HEX_FOURCC_RT21=$31325452; // 12TR */
  712. // Mondo CODEC type for CODECINIFILEINFO ulCompressType */
  713. //#define FOURCC_DIB mmioFOURCC('D', 'I', 'B', ' ')
  714. // FOURCC_DIB:FOURCC=0;
  715. HEX_FOURCC_DIB=$20424944; // BID */
  716. // CODECVIDEOHEADER - CODEC video Header
  717. Type
  718. TCODECVIDEOHEADER=record // codecvidhdr */
  719. ulStructLen:LongInt;
  720. cx:LongInt;
  721. cy:LongInt;
  722. cPlanes:Integer;
  723. cBitCount:Integer;
  724. ulColorEncoding:LongInt;
  725. genpal:GENPAL;
  726. end;
  727. PCodecVideoHeader=^TCODECVIDEOHEADER;
  728. // ulColorEncoding defines: */
  729. Const
  730. MMIO_RGB_5_6_5 =$0001; // Each pixel is a RGB_5_6_5 datatype */
  731. MMIO_RGB_24 =$0002; // Each pixel is a RGB_24 datatype */
  732. MMIO_YUV_4_1_1 =$0004; // Each pixel is a YUV_4_1_1 datatype */
  733. MMIO_COMPRESSED =$0008; // The data is compressed */
  734. MMIO_YUV_24 =$0010; // Each pixel is a YUV_24 datatype */
  735. MMIO_PALETTIZED =$0020; // The data is palettized */
  736. MMIO_OS2_BITMAP24 =$0020; // The data is palettized */
  737. //*********************************************
  738. // *
  739. // * MMVIDEOOPEN - Video Open Structure
  740. // *
  741. // * This structure is passed on the CODEC open
  742. // * message when video compression is being done
  743. // * to indicate information such as quality,
  744. // * frame rate, data rate, and key frame rate.
  745. // *
  746. // * Quality:
  747. // *
  748. // * The ulQuality field specifies a scalar value
  749. // * in the range 0 - 10000, where 0 is the lowest
  750. // * quality and 10000 is the highest quality. A
  751. // * value of -1 specifies the default quality level,
  752. // * and the default quality level (e.g. 5000) is
  753. // * returned in the ulQuality field.
  754. // *
  755. // *
  756. // * Key Frame rate:
  757. //*
  758. // * The ulKeyFrameRate structure specifies the key
  759. // * frame (aka I-frame, reference frame) frequency.
  760. // * Every Nth frame is a key frame as specified.
  761. // * A value of zero specifies that no periodic key
  762. // * are to be compressed. Additional key frames may
  763. // * be inserted at any point by specifying
  764. // * MMIO_IS_KEY_FRAME in the MMCOMPRESS structure.
  765. // *
  766. // * example: ulKeyFrameRate = 5 results in:
  767. //*
  768. //* key delta delta delta delta key delta delta delta delta key delta...
  769. // *
  770. //*
  771. // * Frame rate:
  772. // *
  773. // * Rate = number of time units per second
  774. // * Scale = number of time units per frame
  775. // *
  776. // * examples: Rate = 30 Scale = 1 => 30 FPS
  777. // * Rate = 15 Scale = 1 => 15 FPS
  778. // * Rate = 25 Scale = 2 => 12.5 FPS
  779. // *
  780. // *
  781. // * Data Constraint:
  782. // *
  783. // * Compressors which are capable of constraining the
  784. // * resultant compressed video data rate use the
  785. // * information in the ulDataConstraint and
  786. // * ulConstraintInterval fields. A non-zero value
  787. //* in ulDataConstraint specifies the number of bytes
  788. // * which is not to be exceeded over an interval of
  789. // * frames in the output data stream, regardless of
  790. // * the requested quality level. This value only
  791. // * considers video data, i.e. audio data and file format
  792. // * overhead must be considered seperately when determining
  793. // * the final output file data rate. The interval of
  794. // * frames over which the data is constrained is specified
  795. //* in ulConstraintInterval. A value of zero for
  796. // * ulDataContraint specifies that the data rate is not
  797. // * to be constrained and is compressed according to
  798. // * the requested quality level.
  799. // *
  800. // * example 1: ulDataConstraint = 150000 ulConstraintInterval = 15
  801. // *
  802. // * This results in an output stream wherein the sizes of any 15
  803. // * consecutive frames does not exceed 150000 bytes. If the
  804. // * frame rate is 15 FPS, the resultant data rate will not
  805. // * exceed 150000 bytes per second.
  806. // *
  807. // * example 2: ulDataConstraint = 10000 ulConstraintInterval = 1
  808. // *
  809. // * This results in an output stream wherein any single frame
  810. // * does not exceed 10000 bytes. If the frame rate is 15 FPS,
  811. // * the resultant data rate will not exceed 150000 bytes per
  812. // * second. Note the difference between this case and example 1
  813. // * where individual frames may exceed 10000 bytes (the average)
  814. // * so long other frames in any 15 frame sequence are sufficiently
  815. // * smaller to satisfy the constraint within the constraint interval.
  816. // *
  817. // **********************************************/
  818. TYPE _MMVIDEOOPEN = RECORD // mmvidopen */
  819. ulStructLen:LongInt;
  820. ulQuality:LongInt;
  821. ulKeyFrameRate:LongInt;
  822. ulScale:LongInt;
  823. ulRate:LongInt;
  824. ulDataConstraint:LongInt;
  825. ulConstraintInterval:LongInt;
  826. end;
  827. TYPE PMMVIDEOOPEN = ^_MMVIDEOOPEN;
  828. TYPE _MMAUDIOOPEN = RECORD
  829. ulStructLen:LongInt; // Length of struct */
  830. ulSamplesPerBlock:LongInt; // Samples in each block of compressed data */
  831. ulBytesPerBlock:LongInt; // uncompressed bytes in each block */
  832. ulFlags:LongInt; // Compression flags */
  833. ulBestGuess:LongInt; // Guess at avg. compression ratio */
  834. ulBlockAlignment:LongInt; // Block alignment of codec */
  835. ulLength:LongInt; // Length of the file */
  836. hCodec:LongInt; // Codec handle */
  837. pfnCodec:PCodecProc;
  838. end;
  839. TYPE PMMAUDIOOPEN = ^_MMAUDIOOPEN;
  840. // defines for the ulFlags field of the BUFER_INFORMATION */
  841. CONST
  842. BLOCK_ORIENTED =$00000001;
  843. NON_LINEAR =$00000002;
  844. INIT_CODEC =$00000004;
  845. //*********************************************
  846. // *
  847. // * CODECOPEN - CODEC open structure
  848. // *
  849. // **********************************************/
  850. TYPE _CODECOPEN = RECORD // codecopen */
  851. ulFlags:LongInt; // flags & events - Refer to ulCapsFlags in CODECINIFILEINFO */
  852. pControlHdr:Pointer; // control header - (codec specific) */
  853. pSrcHdr:Pointer; // source header - Ptr CODECVIDEOHEADER */
  854. pDstHdr:Pointer; // destination header - Ptr CODECVIDEOHEADER */
  855. pOtherInfo:Pointer; // other information - Ptr MMVIDEOOPEN/MMAUDIOOPEN */
  856. end;
  857. TYPE PCODECOPEN = ^_CODECOPEN;
  858. const
  859. // CODECINIFILEINFO capabilities (ulCapsFlags) values.
  860. Valid_CodecOpen_InputFlags = CODEC_DECOMPRESS or
  861. CODEC_WINDOW_CLIPPING or
  862. CODEC_PALETTE_TRANS or
  863. CODEC_SELFHEAL or
  864. CODEC_SCALE_PEL_DOUBLE or
  865. CODEC_SCALE_PEL_HALVED or
  866. CODEC_SCALE_CONTINUOUS or
  867. CODEC_MULAPERTURE or
  868. CODEC_HARDWARE or
  869. CODEC_DIRECT_DISPLAY;
  870. // Stream handler communication */
  871. TYPE _AUDIO_CODEC_INFO = RECORD
  872. ulStructLen:LongInt; // Length of struct */
  873. ulBytesPerBlock:LongInt; // uncompressed bytes in each block */
  874. ulBlockAlignment:LongInt; // Block alignment of codec */
  875. hCodec:LongInt; // Codec handle */
  876. pfnCodec:PCODECPROC;
  877. // LONG (* APIENTRY pfnCodec) (PVOID, SHORT, LONG, LONG); */
  878. end;
  879. CONST
  880. AUDIO_CODEC_INF =1000;
  881. //*********************************************
  882. // *
  883. // * MMCOMPRESS - Compress structure
  884. // *
  885. // **********************************************/
  886. TYPE _MMCOMPRESS = RECORD // mmcomp */
  887. ulStructLen:LongInt; // length of this structure */
  888. ulFlags:LongInt; // command and status flags */
  889. ulSrcBufLen:LongInt; // source buffer size */
  890. pSrcBuf:Pointer; // source buffer */
  891. ulDstBufLen:LongInt; // destination buffer length */
  892. pDstBuf:Pointer; // destination buffer */
  893. pRunTimeInfo:Pointer; // control information */
  894. end;
  895. TYPE PMMCOMPRESS = ^_MMCOMPRESS;
  896. // ulFlags Input values for MMCOMPRESS structure: */
  897. // Note: MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined */
  898. // below, but are listed here for information purposes only. */
  899. // MMIO_IS_KEY_FRAME This bit is set by the application */
  900. // to instruct the IOProc to compress */
  901. // the pSrcBuf into a key or reference */
  902. // frame. If the bit is not set, a */
  903. // delta frame is compressed. */
  904. // MMIO_IS_PALETTE A video palette is provided. This */
  905. // is set by the application. */
  906. //*********************************************
  907. // *
  908. // * MMVIDEOCOMPRESS - Video Compress structure
  909. // *
  910. // **********************************************/
  911. TYPE _MMVIDEOCOMPRESS = RECORD // mmvidcomp */
  912. ulStructLen:LongInt; // Structure length */
  913. genpalVideo:GENPAL; // Video stream palette */
  914. pControlHdr:Pointer; // control header (codec specific) */
  915. end;
  916. TYPE PMMVIDEOCOMPRESS = ^_MMVIDEOCOMPRESS;
  917. CONST
  918. START_DECOMPRESSION =$00000001;
  919. CONTINUE_DECOMPRESSION =$00000002;
  920. START_SEEK =$00000004;
  921. CONTINUE_SEEK =$00000008;
  922. //*********************************************
  923. // *
  924. // * MMDECOMPRESS - Decompress Structure
  925. // *
  926. // **********************************************/
  927. TYPE _MMDECOMPRESS = Record // mmdec */
  928. ulStructLen:LongInt; // length of this structure */
  929. ulFlags:LongInt; // command and status flags */
  930. ulSrcBufLen:LongInt; // source buffer size */
  931. pSrcBuf:Pointer; // source buffer */
  932. ulDstBufLen:LongInt; // destination buffer length */
  933. pDstBuf:pointer; // destination buffer */
  934. pRunTimeInfo:Pointer; // control information Ptr to MMVIDEODECOMPRESS */
  935. end;
  936. TYPE PMMDECOMPRESS = ^_MMDECOMPRESS;
  937. // ulFlags defines: */
  938. CONST
  939. MMIO_DROP_DELTA_FRAME =$0001; // Input/Output - Tells the IOProc to drop the delta */
  940. // frame if the pSrcBuf contains a delta */
  941. // frame. On return, the bit is reset */
  942. // if the delta frame is dropped. */
  943. MMIO_IS_KEY_FRAME =$0002; // Output - This bit is set by the IOProc when */
  944. // the data contained in the pSrcBuf is */
  945. // a key or reference frame. */
  946. MMIO_IS_PALETTE =$0004; // Output - A video palette has been found. */
  947. // This is set by the IOProc. */
  948. MMIO_PALETTE_CHANGE =$0008; // Input - The physical palette has been changed */
  949. // in... This is set by the application. */
  950. MMIO_ORIGIN_LOWERLEFT =$0010; // Input - The video frame origin */
  951. MMIO_RECTL_CHANGE =$0020; // Input - The valid rectl list has changed. */
  952. MMIO_ORIGIN_UPPERLEFT =$0040; // Input - The video frame origin */
  953. MMIO_DROP_FRAME_DECODE=$0080; // Input - Tells the IOProc to drop decoding */
  954. MMIO_HIGH_QUALITY =$0100; // Input - Tells Codec to render best */
  955. // quality image - not time critical */
  956. MMIO_IGNORE_CLIPPING =$0200; // Ignore clipping rectangles used for bitmap capture */
  957. // high performance */
  958. MMIO_OUTPUT_FULL_IMAGE=$0400; // Output a complete image on decompress, even if this*/
  959. // is a delta frame */
  960. // of the frame. */
  961. VALID_DECOMPRESS_INPUTFLAGS = MMIO_DROP_DELTA_FRAME or
  962. MMIO_PALETTE_CHANGE or
  963. MMIO_ORIGIN_LOWERLEFT or
  964. MMIO_RECTL_CHANGE or
  965. MMIO_DROP_FRAME_DECODE or
  966. MMIO_ORIGIN_UPPERLEFT or
  967. MMIO_HIGH_QUALITY or
  968. MMIO_IGNORE_CLIPPING or
  969. MMIO_OUTPUT_FULL_IMAGE;
  970. START_COMPRESSION =$00000001;
  971. CONTINUE_COMPRESSION =$00000002;
  972. SOURCE_UNUSED =$00000004;
  973. TARGET_UNUSED =$00000008;
  974. //*********************************************
  975. // *
  976. // * MMVIDEODECOMPRESS - Video Decompress structure
  977. // *
  978. // **********************************************/
  979. TYPE RectL = record
  980. xLeft: Longint;
  981. yBottom: Longint;
  982. xRight: Longint;
  983. yTop: Longint;
  984. end;
  985. TYPE PRECTL = ^RECTL;
  986. TYPE _MMVIDEODECOMPRESS = Record // mmviddec */
  987. ulStructLen:LongInt; // Structure length */
  988. ulRectlCount:LongInt; // Valid rectangle count - for clipping */
  989. prectl:PRECTL; // Valid rectangle array - for clipping */
  990. ulSkipLength:LongInt; // Skipped line length */
  991. ulDecodeLines:LongInt; // Num of lines to decompress */
  992. genpalPhysical:GENPAL; // Physical palette */
  993. genpalVideo:GENPAL; // Video stream palette */
  994. rectlSrc:RECTL; // Source window rectangle */
  995. rectlDst:RECTL; // Destination window rectangle */
  996. ulDeltaCount:LongInt; // Number of remaining delta frames before the next I-Frame */
  997. ulParm1:LongInt; // Codec specific parm */
  998. ulParm2:Longint; // Codec specific parm */
  999. ulParm3:LongInt; // Codec specific parm */
  1000. ulParm4:LongInt; // Codec specific parm */
  1001. end;
  1002. TYPE PMMVIDEODECOMPRESS = ^_MMVIDEODECOMPRESS;
  1003. //************************************************
  1004. // *
  1005. // * RECORDTAB - Record table
  1006. // *
  1007. // * NOTE: This structure maps to ESRCBUFTAB in ssm.h
  1008. // *************************************************/
  1009. TYPE _RECORDTAB = record // recordtab */
  1010. ulReserved1:LongInt; // reserved for system */
  1011. pRecord:Pointer; // ptr to record in buffer */
  1012. ulLength:LongInt; // length of record */
  1013. ulReserved2:LongInt; // reserved for system */
  1014. ulReserved3:LongInt; // reserved for system */
  1015. ulParm1:LongInt; // Record specific data */
  1016. ulParm2:LongInt; // Record specific data */
  1017. end;
  1018. TYPE PRECORDTAB=^_RECORDTAB; // Ptr to a buffer entry */
  1019. //**************************************************
  1020. // *
  1021. // * RECORDTABWRITE - Record table for video write
  1022. // *
  1023. // * NOTE: This structure maps to ETGTBUFTAB in ssm.h
  1024. // ***************************************************/
  1025. TYPE _RECORDTABWRITE=RECORD // recordtab */
  1026. pRecord:Pointer; // ptr to record in buffer */
  1027. ulReserved1:Longint; // reserved for system */
  1028. ulLength:Longint; // length of record */
  1029. ulReserved2:longint; // reserved for system */
  1030. ulReserved3:longint; // reserved for system */
  1031. ulParm1:longint; // Record specific data */
  1032. ulParm2:longint; // Record specific data */
  1033. end;
  1034. type precordtabwrite=^_recordtabwrite;// Ptr to a buffer entry */
  1035. // ulParm1 Return values for MULTITRACK_READ only: */
  1036. // Note: MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined */
  1037. // above, but are listed here for information purposes only */
  1038. // as they are valid ulParm1 Return values for MULTITRACK_READ. */
  1039. // MMIO_IS_KEY_FRAME Frame is a Key frame */
  1040. // MMIO_IS_PALETTE Buffer contains a video palette */
  1041. CONST
  1042. MMIO_INVISIBLE_FRAME =$1000; // Indicates a invisible video frame */
  1043. MMIO_NULL_FRAME =$2000; // Indicates a null video frame (zero length) */
  1044. // ulParm2 Return values for MULTITRACK_READ only: */
  1045. // This field contains the frame number for this video frame */
  1046. // if this track is a video track. */
  1047. // ulParm1 Input values for MULTITRACK_WRITE only: */
  1048. // Note: MMIO_IS_KEY_FRAME and MMIO_IS_PALETTE are defined */
  1049. // above, but are listed here for information purposes only */
  1050. // as they are valid ulParm1 Input values for MULTITRACK_WRITE. */
  1051. // MMIO_IS_KEY_FRAME Frame is a Key frame */
  1052. // MMIO_IS_PALETTE Buffer contains a video palette */
  1053. // ulParm2 Input values for MULTITRACK_WRITE only: */
  1054. // This field contains the number of null frames */
  1055. // that should be inserted before this frame */
  1056. // (this recordtab entry). */
  1057. //***********************************************
  1058. // *
  1059. // * TRACKMAP - This structure maps a track to
  1060. // * a record table.
  1061. // *
  1062. // ************************************************/
  1063. TYPE _TRACKMAP = RECORD // trackmap */
  1064. ulTrackID:LongInt; // Input - track ID */
  1065. ulNumEntries:LongInt; // Input - number of record entries */
  1066. pRecordTabList:PRecordTab; // Input/Output - Ptr to a record table */
  1067. end;
  1068. TYPE PTRACKMAP=^_TRACKMAP; // Ptr to a track map table entry */
  1069. //*********************************************
  1070. // *
  1071. // * MMMULTITRACKREAD - Multiple Track Read
  1072. // *
  1073. // **********************************************/
  1074. TYPE _MMMULTITRACKREAD=RECORD // mtread */
  1075. ulLength:LongInt; // Input - Size of buffer to read. The IO should be performed on this size of */
  1076. // buffer. The actual buffer size may be bigger and is given in the */
  1077. // ulBufferLength field below. Video frames can span pBuffer+ulLength */
  1078. // as long as the frame is less than the ulBufferLength in size. */
  1079. // The purpose of this is to break the IO reads into smaller sizes */
  1080. // while still allowing large frame sizes. */
  1081. pBuffer:Pointer; // Input - ptr to read buffer */
  1082. ulFlags:LongInt; // Input/Output - read flags */
  1083. ulNumTracks:LongInt; // Input - number of track entries */
  1084. pTrackMapList:PTRACKMAP; // Input - ptr to track-to-record list */
  1085. // End of old MMMULTITRACKREAD structure */
  1086. ulBufferLength:LongInt; // Input - Actual length of read buffer */
  1087. ulReserved:longInt; // Input - Reserved (must be 0) */
  1088. end;
  1089. TYPE PMMMULTITRACKREAD=^_MMMULTITRACKREAD;
  1090. // ulFlags Input Values: */
  1091. CONST
  1092. MULTITRACKREAD_EXTENDED =$0004; // Indicates that the new extended multitrack */
  1093. // read structure is passed from caller instead */
  1094. // of the previous multitrack read structure. */
  1095. // ulFlags Return Values: */
  1096. MULTITRACKREAD_NOTDONE =$0001; // Read is not done. Another read of the same */
  1097. // buffer is necessary. There were not enough record */
  1098. // entries in the record table passed to this api. */
  1099. MULTITRACKREAD_EOF =$0002; // End of File. Used because # bytes read may not */
  1100. // match the length of the buffer in cases of a */
  1101. // record that spans in the next buffer. */
  1102. //*********************************************
  1103. // *
  1104. // * MMMULTITRACKWRITE - Multiple Track Write
  1105. // *
  1106. // **********************************************/
  1107. TYPE _MMMULTITRACKWRITE=RECORD // mtwrite */
  1108. ulNumTracks:LongInt; // Input - number of track entries */
  1109. pTrackMapList:PTRACKMAP; // Input - ptr to track-to-record list */
  1110. ulFlags:LongInt; // Input - write flags (Default = 0) */
  1111. ulReserved:LongInt; // Input - Reserved (must be 0) */
  1112. end;
  1113. TYPE PMMMULTITRACKWRITE=^_MMMULTITRACKWRITE;
  1114. // ulFlags Input Values: */
  1115. CONST
  1116. MULTITRACKWRITE_MERGE =$0001; // Attempt to interleave the data on the write. */
  1117. // The default (without this flag set) is to */
  1118. // write all records for each track then write */
  1119. // all records of the next track and so on. */
  1120. //*********************************************
  1121. // *
  1122. // * MMMOVIEHEADER - standard movie header data
  1123. // *
  1124. // **********************************************/
  1125. TYPE MMTrackInfo = record
  1126. ulTrackID : Longint; // track identifier
  1127. ulMediaType : Longint; // media type
  1128. ulCountry : Longint; // country code for the track
  1129. ulCodePage : Longint; // country code page for the track
  1130. ulReserved1 : Longint; // reserved must be 0
  1131. ulReserved2 : Longint; // reserved must be 0
  1132. end;
  1133. //TYPE pMMTrackInfo = ^MMTrackInfo;
  1134. //TYPE
  1135. // PSZ = PChar;
  1136. TYPE _MMMOVIEHEADER=RECORD // mmhdr */
  1137. ulStructLen:LongInt; // length of this structure */
  1138. ulContentType:LongInt; // movie content type */
  1139. ulMediaType:LongInt; // video media type */
  1140. ulMovieCapsFlags:LongInt; // capabilities */
  1141. ulMaxBytesPerSec:LongInt; // maximum transfer rate */
  1142. ulPaddingGranularity:LongInt;// pad to a multiple of this size */
  1143. ulSuggestedBufferSize:LongInt;
  1144. ulStart:LongInt; // delay time marking beginning or start of movie */
  1145. ulLength:LongInt;
  1146. ulNextTrackID:LongInt; // next available track id */
  1147. ulNumEntries:LongInt; // number of track entries */
  1148. pmmTrackInfoList:PMMTRACKINFO; // track information */
  1149. pszMovieTitle:PSZ; // movie title */
  1150. ulCountry:LongInt; // country code for the title string */
  1151. ulCodePage:LongInt; // country code page the title string */
  1152. ulAvgBytesPerSec:LongInt; // average transfer rate */
  1153. end;
  1154. TYPE PMMMOVIEHEADER=^_MMMOVIEHEADER;
  1155. // ulMovieCapsFlags Defines: */
  1156. CONST
  1157. MOVIE_HAS_VIDEO =$0001; // The movie contains video. */
  1158. MOVIE_HAS_AUDIO =$0002; // The movie contains audio. */
  1159. MOVIE_CAN_SEEK =$0004; // The movie can seek. */
  1160. MOVIE_CAN_SCAN =$0008; // The movie can fast scan. */
  1161. MOVIE_HAS_COPYRIGHT =$0010; // The movie contains copyrighted data. */
  1162. MOVIE_WAS_CAPTUREFILE =$0020; // The movie is a specially allocated */
  1163. // file used for capturing real-time */
  1164. // video. Applications should warn */
  1165. // the user before writing over a file */
  1166. // with this flag set because the user */
  1167. // probably defragmented this file. */
  1168. // If this flag is set, then there is a chance */
  1169. // that not all of the records will be written */
  1170. // on the call. Caller must check for this whether */
  1171. // this flag is set or not. */
  1172. //*********************************************
  1173. // *
  1174. // * MMVIDEOHEADER - Movie Video Track Header
  1175. // *
  1176. // **********************************************/
  1177. TYPE _MMVIDEOHEADER=RECORD // mmvhdr */
  1178. ulStructLen:LongInt; // length of this structure */
  1179. ulContentType:LongInt; // video content type */
  1180. ulMediaType:LongInt; // video media type */
  1181. ulVideoCapsFlags:LongInt; // capabilities */
  1182. ulWidth:LongInt; // video width in pels */
  1183. ulHeight:LongInt; // video height in pels */
  1184. ulScale:LongInt;
  1185. ulRate:LongInt; // Rate / Scale == frames/second */
  1186. ulStart:LongInt; // delay time marking beginning or start of stream */
  1187. ulLength:LongInt;
  1188. ulTotalFrames:LongInt; // total number of video frames */
  1189. ulInitialFrames:LongInt;
  1190. mmtimePerFrame:MMTIME; // frame display time or 0L */
  1191. ulSuggestedBufferSize:LongInt;
  1192. genpalVideo:GENPAL; // palette */
  1193. pmmXDIBHeader:PMMXDIBHEADER; // windows DIB compatible header */
  1194. ulHHRWidth:LongInt; // Actual width of HHR video */
  1195. fHHR:Boolean; // HHR flag */
  1196. end;
  1197. TYPE PMMVIDEOHEADER=_MMVIDEOHEADER;
  1198. // ulContentType Defines: */
  1199. CONST
  1200. MMIO_VIDEO_UNKNOWN =$00000000; // Unknown video content */
  1201. MMIO_VIDEO_DATA =$00000001; // Video */
  1202. //
  1203. // Base function prototypes:
  1204. ///
  1205. function mmioAdvance( mmIO: hmmio; Info: pmmioinfo; usFlags: Word ): Word; cdecl;
  1206. function mmioAscend( mmIO: hmmio; pckinfo: pmmCkInfo; usFlags: Word ): Word; cdecl;
  1207. function mmioClose( mmIO: hmmio; usFlags: Word ): Word; cdecl;
  1208. function mmioCreateChunk( mmio: hmmio; pckinfo: pmmCkInfo; usFlags: Word ): Word; cdecl;
  1209. function mmioDescend( mmIO: hmmio; pckinfo, pckinfoParent: pMMCkInfo; usFlags: Word ): Word; cdecl;
  1210. function mmioFlush( mmIO: hmmio; usFlags: Word ): Word; cdecl;
  1211. function mmioGetInfo( mmIO: hmmio; Info: pmmioinfo; usFlags: Word ): Word; cdecl;
  1212. function mmioGetLastError( mmIO: hmmio ): Longint; cdecl;
  1213. function mmioInstallIOProc( fccIOProc: FourCC; pIOProc: pMMIOProc; ulFlags: Longint ): pmmIOProc; cdecl;
  1214. function mmioOpen( pszFileName: pChar; mmIOInfo: pmmioinfo; ulOpenFlags: Longint ): hMMIO; cdecl;
  1215. function mmioRead( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint ): Longint; cdecl;
  1216. function mmioSeek( mmIO: hmmio; lOffset, lOrigin: Longint ): Longint; cdecl;
  1217. function mmioSendMessage( mmIO: hmmio; usMsg: Word; lParam1, lParam2: Longint ): Longint; cdecl;
  1218. function mmioSetBuffer( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint; usFlags: Word ): Word; cdecl;
  1219. function mmioSetInfo( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: Word ): Word; cdecl;
  1220. function mmioStringToFourCC( pszString: pChar; usFlags: Word ): FourCC; cdecl;
  1221. function mmioWrite( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint ): Longint; cdecl;
  1222. //
  1223. // Compound File function prototypes:
  1224. ///
  1225. function mmioCFOpen( pszFileName: pChar; CfInfo, IOInfo: pmmcfinfo; ulFlags: Longint ): hMMCF; cdecl;
  1226. function mmioCFClose( mmCf: hmmcf; ulFlags: Longint ): Longint; cdecl;
  1227. function mmioCFGetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: Longint ): Longint; cdecl;
  1228. function mmioCFSetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: Longint ): Longint; cdecl;
  1229. function mmioCFFindEntry( mmCf: hmmcf; ctocEntry: mmctocentry; ulFlags: Longint ): Longint; cdecl;
  1230. function mmioCFAddEntry( mmCf: hmmcf; cTocEntry: mmctocentry; ulFlags: Longint ): Longint; cdecl;
  1231. function mmioCFChangeEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: Longint ): Longint; cdecl;
  1232. function mmioCFDeleteEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: Longint ): Longint; cdecl;
  1233. function mmioCFAddElement( mmCf: hmmcf; pszElementName: pChar; fccType: FourCC;
  1234. pchBuffer: pChar; cchBytes: LongInt; ulFlags: Longint ): Longint; cdecl;
  1235. function mmioCFCopy( mmCfSource: hmmcf; pszDestFileName: pChar; ulFlags: Longint ): Longint; cdecl;
  1236. //
  1237. // Conversion Utility function prototypes:
  1238. ///
  1239. function mmioQueryFormatCount( FormatInfo: pmmformatinfo;
  1240. plNumFormats: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1241. function mmioGetFormats( FormatInfo: pmmformatinfo;
  1242. lNumFormats: LongInt; pFormatInfoList: Pointer; plFormatsRead: pLong;
  1243. ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1244. function mmioGetFormatName( FormatInfo: pmmformatinfo; pszFormatName: pChar;
  1245. plBytesRead: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1246. function mmioIdentifyFile( pszFileName: pChar; MMIoInfo: pmmioinfo;
  1247. FormatInfo: pmmformatinfo; pfccStorageSystem: pFourCC; ulReserved: Longint;
  1248. ulFlags: Longint ): Longint; cdecl;
  1249. function mmioQueryHeaderLength( mmIO: hmmio; plHeaderLength: pLong;
  1250. ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1251. function mmioGetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: LongInt;
  1252. plBytesRead: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1253. function mmioSetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: LongInt;
  1254. plBytesWritten: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1255. function mmioIniFileHandler( IniFileInfo: pmminifileinfo; ulFlags: Longint ): Longint; cdecl;
  1256. function mmioIdentifyStorageSystem( pszFileName: pChar;
  1257. MMIoInfo: pmmioinfo; pfccStorageSystem: pFourCC ): Longint; cdecl;
  1258. function mmioDetermineSSIOProc( pszFileName: pChar; MMIoInfo: pmmioinfo;
  1259. pfccStorageSystem: pFourCC; pszParsedRemainder: pChar ): Longint; cdecl;
  1260. function mmioQueryIOProcModuleHandle( IOProc: pMMIOProc;
  1261. IOProcModule: phModule ): Longint; cdecl;
  1262. function mmioCFCompact( pszFileName: pChar; ulFlags: Longint ): Longint; cdecl;
  1263. //
  1264. // MMPMMMIO.INI file migration utility
  1265. ///
  1266. function mmioMigrateIniFile( ulFlags: Longint ): Longint; cdecl;
  1267. //
  1268. // MMIO CODEC APIs
  1269. ///
  1270. function mmioIniFileCODEC( IniFile: pCODECIniFileInfo; ulFlags: Longint ): Longint; cdecl;
  1271. function mmioSet( mmIO: hmmio; ExtendInfo: pmmExtendInfo; ulFlags: Longint): Longint; cdecl;
  1272. function mmioQueryCODECName( IniInfo: pCODECIniFileinfo;
  1273. pszCODECName: pChar; pulBytesRead: pLongint ): Longint; cdecl;
  1274. function mmioQueryCODECNameLength( IniInfo: pCODECIniFileinfo;
  1275. pulNameLength: pLongint ): Longint; cdecl;
  1276. function mmioLoadCODECProc( IniInfo: pCODECIniFileInfo;
  1277. Module: phModule; ulFlags: Longint ): pCodecProc; cdecl;
  1278. function mmioGetData( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: Word ): Word; cdecl;
  1279. Implementation
  1280. //-------
  1281. function mmioAdvance( mmIO: hmmio; Info: pmmioinfo; usFlags: Word ): Word; cdecl;
  1282. external LibName index 55;
  1283. function mmioAscend( mmIO: hmmio; pckinfo: pmmCkInfo; usFlags: Word ): Word; cdecl;
  1284. external LibName index 49;
  1285. function mmioClose( mmIO: hmmio; usFlags: Word ): Word; cdecl;
  1286. external LibName index 45;
  1287. function mmioCreateChunk( mmio: hmmio; pckinfo: pmmCkInfo; usFlags: Word ): Word; cdecl;
  1288. external LibName index 51;
  1289. function mmioDescend( mmIO: hmmio; pckinfo, pckinfoParent: pMMCkInfo; usFlags: Word ): Word; cdecl;
  1290. external LibName index 50;
  1291. function mmioFlush( mmIO: hmmio; usFlags: Word ): Word; cdecl;
  1292. external LibName index 44;
  1293. function mmioGetInfo( mmIO: hmmio; Info: pmmioinfo; usFlags: Word ): Word; cdecl;
  1294. external LibName index 52;
  1295. function mmioGetLastError( mmIO: hmmio ): Longint; cdecl;
  1296. external LibName index 38;
  1297. function mmioInstallIOProc( fccIOProc: FourCC; pIOProc: pMMIOProc; ulFlags: Longint ): pmmIOProc; cdecl;
  1298. external LibName index 39;
  1299. function mmioOpen( pszFileName: pChar; mmIOInfo: pmmioinfo; ulOpenFlags: Longint ): hMMIO; cdecl;
  1300. external LibName index 40;
  1301. function mmioRead( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint ): Longint; cdecl;
  1302. external LibName index 41;
  1303. function mmioSeek( mmIO: hmmio; lOffset, lOrigin: Longint ): Longint; cdecl;
  1304. external LibName index 43;
  1305. function mmioSendMessage( mmIO: hmmio; usMsg: Word; lParam1, lParam2: Longint ): Longint; cdecl;
  1306. external LibName index 54;
  1307. function mmioSetBuffer( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint; usFlags: Word ): Word; cdecl;
  1308. external LibName index 56;
  1309. function mmioSetInfo( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: Word ): Word; cdecl;
  1310. external LibName index 53;
  1311. function mmioStringToFourCC( pszString: pChar; usFlags: Word ): FourCC; cdecl;
  1312. external LibName index 37;
  1313. function mmioWrite( mmIO: hmmio; pchBuffer: pChar; cBytes: Longint ): Longint; cdecl;
  1314. external LibName index 42;
  1315. function mmioCFOpen( pszFileName: pChar; CfInfo, IOInfo: pmmcfinfo; ulFlags: Longint ): hMMCF; cdecl;
  1316. external LibName index 57;
  1317. function mmioCFClose( mmCf: hmmcf; ulFlags: Longint ): Longint; cdecl;
  1318. external LibName index 58;
  1319. function mmioCFGetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: Longint ): Longint; cdecl;
  1320. external LibName index 64;
  1321. function mmioCFSetInfo( mmCf: hmmcf; CfInfo: pmmcfinfo; cBytes: Longint ): Longint; cdecl;
  1322. external LibName index 65;
  1323. function mmioCFFindEntry( mmCf: hmmcf; ctocEntry: mmctocentry; ulFlags: Longint ): Longint; cdecl;
  1324. external LibName index 62;
  1325. function mmioCFAddEntry( mmCf: hmmcf; cTocEntry: mmctocentry; ulFlags: Longint ): Longint; cdecl;
  1326. external LibName index 59;
  1327. function mmioCFChangeEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: Longint ): Longint; cdecl;
  1328. external LibName index 61;
  1329. function mmioCFDeleteEntry( mmCf: hmmcf; CTocEntry: pmmctocentry; ulFlags: Longint ): Longint; cdecl;
  1330. external LibName index 60;
  1331. function mmioCFAddElement( mmCf: hmmcf; pszElementName: pChar; fccType: FourCC;
  1332. pchBuffer: pChar; cchBytes: LongInt; ulFlags: Longint ): Longint; cdecl;
  1333. external LibName index 63;
  1334. function mmioCFCopy( mmCfSource: hmmcf; pszDestFileName: pChar; ulFlags: Longint ): Longint; cdecl;
  1335. external LibName index 66;
  1336. function mmioQueryFormatCount( FormatInfo: pmmformatinfo;
  1337. plNumFormats: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1338. external LibName index 87;
  1339. function mmioGetFormats( FormatInfo: pmmformatinfo;
  1340. lNumFormats: LongInt; pFormatInfoList: Pointer; plFormatsRead: pLong;
  1341. ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1342. external LibName index 88;
  1343. function mmioGetFormatName( FormatInfo: pmmformatinfo; pszFormatName: pChar;
  1344. plBytesRead: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1345. external LibName index 93;
  1346. function mmioIdentifyFile( pszFileName: pChar; MMIoInfo: pmmioinfo;
  1347. FormatInfo: pmmformatinfo; pfccStorageSystem: pFourCC; ulReserved: Longint;
  1348. ulFlags: Longint ): Longint; cdecl;
  1349. external LibName index 92;
  1350. function mmioQueryHeaderLength( mmIO: hmmio; plHeaderLength: pLong;
  1351. ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1352. external LibName index 89;
  1353. function mmioGetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: LongInt;
  1354. plBytesRead: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1355. external LibName index 90;
  1356. function mmioSetHeader( mmIO: hmmio; pHeader: Pointer; lHeaderLength: LongInt;
  1357. plBytesWritten: pLong; ulReserved: Longint; ulFlags: Longint ): Longint; cdecl;
  1358. external LibName index 91;
  1359. function mmioIniFileHandler( IniFileInfo: pmminifileinfo; ulFlags: Longint ): Longint; cdecl;
  1360. external LibName index 98;
  1361. function mmioIdentifyStorageSystem( pszFileName: pChar;
  1362. MMIoInfo: pmmioinfo; pfccStorageSystem: pFourCC ): Longint; cdecl;
  1363. external LibName index 100;
  1364. function mmioDetermineSSIOProc( pszFileName: pChar; MMIoInfo: pmmioinfo;
  1365. pfccStorageSystem: pFourCC; pszParsedRemainder: pChar ): Longint; cdecl;
  1366. external LibName index 101;
  1367. function mmioQueryIOProcModuleHandle( IOProc: pMMIOProc;
  1368. IOProcModule: phModule ): Longint; cdecl;
  1369. external LibName index 106;
  1370. function mmioCFCompact( pszFileName: pChar; ulFlags: Longint ): Longint; cdecl;
  1371. external LibName index 113;
  1372. //--------
  1373. function mmioMigrateIniFile( ulFlags: Longint ): Longint; cdecl;
  1374. external LibName index 111;
  1375. //
  1376. // MMIO CODEC APIs
  1377. ///
  1378. function mmioIniFileCODEC( IniFile: pCODECIniFileInfo; ulFlags: Longint ): Longint; cdecl;
  1379. external LibName index 112;
  1380. function mmioSet( mmIO: hmmio; ExtendInfo: pmmExtendInfo; ulFlags: Longint): Longint; cdecl;
  1381. external LibName index 114;
  1382. function mmioQueryCODECName( IniInfo: pCODECIniFileinfo;
  1383. pszCODECName: pChar; pulBytesRead: pLongint ): Longint; cdecl;
  1384. external LibName index 115;
  1385. function mmioQueryCODECNameLength( IniInfo: pCODECIniFileinfo;
  1386. pulNameLength: pLongint ): Longint; cdecl;
  1387. external LibName index 118;
  1388. function mmioLoadCODECProc( IniInfo: pCODECIniFileInfo;
  1389. Module: phModule; ulFlags: Longint ): pCodecProc; cdecl;
  1390. external LibName index 117;
  1391. function mmioGetData( mmIO: hmmio; mmIOInfo: pmmioinfo; usFlags: Word ): Word; cdecl;
  1392. external LibName index 119;
  1393. end.