mmio.pas 70 KB

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