mcidrv.pas 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. {
  2. $Id$
  3. Copyright (c) 1991, 1992 by International Business Machines Corporation
  4. Copyright (c) 2002 by Andry Svirgunov ([email protected])
  5. Copyright (c) 2002-2003 by Yuri Prokushev ([email protected])
  6. MCI drivers interface
  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(MCI drivers interface)
  21. @author(Andry Svirgunov ([email protected]))
  22. @author(Yuri Prokushev ([email protected]))
  23. @created(01 Oct 2002)
  24. @lastmod(19 Jan 2003)
  25. MCI drivers interface
  26. Warning: This code is alfa. Future versions of this unit will propably
  27. not be compatible.
  28. }
  29. Unit mcidrv;
  30. Interface
  31. Type
  32. GID=Integer;
  33. ///**************************************************************************/
  34. // MCI Driver message identifiers */
  35. ///**************************************************************************/
  36. const
  37. MCIDRV_SAVE = 900;
  38. MCIDRV_RESTORE = 901;
  39. MCIDRV_SYNC = 902;
  40. MCIDRV_CHANGERESOURCE = 903;
  41. MCIDRV_CONNECT = 904;
  42. MCIDRV_ASSOCIATE = 905;
  43. MCIDRV_DISCONNECT = 906;
  44. MCIDRV_TEST_CONNECTION = 907;
  45. MCIDRV_START = 908;
  46. MCIDRV_SEEK = 909;
  47. MCIDRV_STOP = 910;
  48. MCIDRV_MODIFY_CONNECTION = 911;
  49. MCIDRV_INIT_CONNECTION = 912;
  50. MCIDRV_DEINIT_CONNECTION = 913;
  51. MCIDRV_ENABLE_EVENT = 915;
  52. MCIDRV_GETTIME = 917;
  53. ///*******************************************************************/
  54. // The following messages are used by the MCIDRV_CONNECT message */
  55. ///*******************************************************************/
  56. MCIDRV_CONNECT_TARGET = $00010000;
  57. MCIDRV_CONNECT_SOURCE = $00020000;
  58. MCIDRV_SET_CONNNECTOR_TYPE = $00040000;
  59. MCIDRV_CHANGE_SEM = $00080000;
  60. ///*******************************************************************/
  61. // The following messages are used by MCIDRV_MODIFY_CONNECTION */
  62. ///*******************************************************************/
  63. MCIDRV_MODIFY_10 =$00100000; // back level MCI driver.
  64. MCIDRV_MIX_STANDALONE =$00200000;
  65. ///*******************************************************************/
  66. // The following messages are used by MCIDRV_START */
  67. ///*******************************************************************/
  68. MCIDRV_CUE_PLAYBACK = $00010000;
  69. MCIDRV_CUE_RECORD = $00020000;
  70. MCIDRV_START_PLAYBACK = $00040000;
  71. MCIDRV_START_RECORD = $00080000;
  72. MCIDRV_START_PREROLL = $00100000;
  73. ///*******************************************************************/
  74. // The following messages are used by MCIDRV_ASSOCIATE */
  75. ///*******************************************************************/
  76. MCIDRV_OUTPUT = $00010000;
  77. MCIDRV_INPUT = $00020000;
  78. ///*******************************************************************/
  79. // The following messages are used by MCIDRV_STOP */
  80. ///*******************************************************************/
  81. MCIDRV_PAUSE_STREAM_NETWORK = $00010000;
  82. MCIDRV_FLUSH_STREAM_NETWORK = $00020000;
  83. MCIDRV_DISCARD_STREAM_NETWORK = $00040000;
  84. ///*******************************************************************/
  85. // The following messages are used by MCIDRV_DEINIT_CONNECTION */
  86. ///*******************************************************************/
  87. MCIDRV_MODIFY_HANDLER =$00010000;
  88. ///*******************************************************************/
  89. // The following range of message ID's are reserved for internal use */
  90. // by MCI drivers */
  91. ///*******************************************************************/
  92. MCI_INTERNAL_MESSAGES_START = 1000;
  93. MCI_INTERNAL_MESSAGES_END = 1999;
  94. ///*******************************************************************/
  95. // Flags used by the string parser for command tables */
  96. // NOTE: All flags must have an "L" suffix in order to be parsed as */
  97. // DWORDs by the resource compiler */
  98. ///*******************************************************************/
  99. MCI_COMMAND_HEAD = $00000001;
  100. MCI_END_COMMAND = $00000002;
  101. MCI_END_COMMAND_LIST = $00000003;
  102. MCI_RETURN = $00000004;
  103. MCI_STRING = $00000005;
  104. MCI_FLAG = $00000006;
  105. MCI_INTEGER = $00000007;
  106. MCI_CONSTANT = $00000008;
  107. MCI_CONSTANT_INTEGER = $00000009;
  108. MCI_CONSTANT_STRING = $0000000A;
  109. MCI_END_CONSTANT = $0000000B;
  110. MCI_DEFAULT_STRING = $0000000C;
  111. MCI_DEFAULT_INTEGER = $0000000D;
  112. MCI_RETURN_TYPE = $0000000E;
  113. MCI_RETURN_TYPE_STRING = $0000000F;
  114. MCI_END_RETURN_TYPE = $00000010;
  115. MCI_CONSTANT_2 = $00000011;
  116. MCI_END_CONSTANT_2 = $00000012;
  117. MCI_CONSTANT_PAIR = $00000013;
  118. MCI_END_CONSTANT_PAIR = $00000014;
  119. MCI_CONSTANT_INTEGER_PAIR = $00000015;
  120. MCI_CONSTANT_STRING_PAIR = $00000016;
  121. MCI_RECTL = $00000017;
  122. MCI_CONSTANT_4 = $00000018;
  123. MCI_END_CONSTANT_4 = $00000019;
  124. MCI_FOURCC = $0000001A;
  125. MCI_OR = $0000001B;
  126. MCI_END_OR = $0000001C;
  127. MCI_STRING_LIST = $0000001D;
  128. ///*******************************************************************/
  129. // Return types supported by mciSendString */
  130. // Values 0x0000 -> 0xFF00 are reserved by MMPM2 */
  131. // Values 0xFF01 -> 0xFFFF are user definable */
  132. ///*******************************************************************/
  133. MCI_INTEGER_RETURNED = $1000;
  134. MCI_COLONIZED2_RETURN = $2000;
  135. MCI_COLONIZED3_RETURN = $3000;
  136. MCI_COLONIZED4_RETURN = $4000;
  137. MCI_TRUE_FALSE_RETURN = $5000;
  138. MCI_ON_OFF_RETURN = $6000;
  139. MCI_DEVICENAME_RETURN = $7000;
  140. MCI_TIME_FORMAT_RETURN = $8000;
  141. MCI_SPEED_FORMAT_RETURN = $9000;
  142. MCI_MODE_RETURN = $A000;
  143. MCI_MEDIA_TYPE_RETURN = $B000;
  144. MCI_TRACK_TYPE_RETURN = $C000;
  145. MCI_CONNECTOR_TYPE_RETURN = $D000;
  146. MCI_CDXA_CHANNEL_DESTINATION_RETURN = $E000;
  147. MCI_PREROLL_TYPE_RETURN = $F000;
  148. MCI_FORMAT_TAG_RETURN = $F100;
  149. MCI_SEQ_SYNCHRONIZATION_RETURN = $F200;
  150. MCI_VIDEO_QUALITY_RETURN = $F300;
  151. MCI_AUDIO_QUALITY_RETURN = $F400;
  152. MCI_IMAGE_QUALITY_RETURN = $F500;
  153. MCI_VIDEO_COMPRESSION_RETURN = $F600;
  154. MCI_AUDIO_COMPRESSION_RETURN = $F700;
  155. MCI_IMAGE_COMPRESSION_RETURN = $F800;
  156. MCI_RECTL_RETURN = $F900;
  157. MCI_FOURCC_RETURN = $FA00;
  158. MCI_IMAGE_PELFORMAT_RETURN = $FB00;
  159. MCI_DIRECTION_RETURN = $FC00;
  160. MCI_SIGNED_INTEGER_RETURN = $FD00;
  161. MCI_USER_RETURN = $FF01;
  162. ///*******************************************************************/
  163. // End of msg text used by mciGetErrorString */
  164. ///*******************************************************************/
  165. MCIERR_BASE = 5000;
  166. MCIERR_MSG_TABLE_END = MCIERR_BASE + 7000;
  167. ///*******************************************************************/
  168. // */
  169. // MCI DEVICE shareability categories */
  170. // */
  171. ///*******************************************************************/
  172. FIXEDSINGLECONTEXT = $0001;
  173. DYNAMICSINGLECONTEXT = $0002;
  174. LIMITEDMULTIPLECONTEXT = $0003;
  175. UNLIMITEDMULTIPLECONTEXT = $0004;
  176. ///*******************************************************************/
  177. // MCI driver flag for close during exit list processing */
  178. ///*******************************************************************/
  179. MCI_CLOSE_EXIT = $10000000;
  180. ///*******************************************************************/
  181. // MCI driver specific error table resource number base */
  182. ///*******************************************************************/
  183. MMERROR_TABLE_BASE = 500;
  184. ///*******************************************************************/
  185. // */
  186. // MCIDRV_CHANGERESOURCE message flags */
  187. // */
  188. ///*******************************************************************/
  189. Type
  190. mciDrv_ChangeResource_Parms = record
  191. pInstance : Pointer; // pointer to device instance
  192. usResourceUnits : Integer; // required resource units
  193. usResourceClass : Integer; // resource class
  194. usResourcePriority : Integer; // resource priority
  195. end;
  196. pmciDrv_ChangeResource_Parms = ^mciDrv_ChangeResource_Parms;
  197. ///*******************************************************************/
  198. // */
  199. // MCIDRV_ENABLE_EVENT message flags */
  200. // */
  201. ///*******************************************************************/
  202. Type
  203. HSTREAM=LongInt;
  204. hID=LongInt;
  205. hEvent = LongInt; // Event Handle
  206. phEvent = ^hEvent; // Pointer to Event Handle
  207. HWND = LongInt;
  208. MMTIME = LongInt;
  209. Type
  210. evcb = record
  211. ulType : LongInt; // Event type (input)
  212. ulSubType : LongInt; // Event SubType (input)
  213. ulFlags : LongInt; // 0 (Input), status (Output)
  214. hstream : HSTREAM; // handle to stream for this event
  215. hid : hID; // handler Id (input/output)
  216. ulStatus : LongInt; // Event status (output)
  217. ulEventParm1 : LongInt; // Event parameters (input), hID if implicit event
  218. ulEventParm2 : LongInt; // Event parameters (input)
  219. ulEventParm3 : LongInt; // Event parameters (input)
  220. end;
  221. pevcb = ^evcb;
  222. Type
  223. MCIDRV_EVENT_PARMS = record
  224. ulLength:LongInt; // Length of event parms */
  225. pevcb:PEVCB; // pointer to event control block */
  226. phevent:PHEVENT; // pointer to the event to enable in network */
  227. end;
  228. PMCIDRV_EVENT_PARMS=^MCIDRV_EVENT_PARMS;
  229. ///*******************************************************************/
  230. // */
  231. // MCIDRV_SYNC message flags */
  232. // */
  233. ///*******************************************************************/
  234. Const
  235. MCIDRV_SYNC_ENABLE = $00000100;
  236. MCIDRV_SYNC_DISABLE = $00000200;
  237. MCIDRV_SYNC_REC_PULSE = $00000400;
  238. MCIDRV_SYNC_MASTER = $00000800;
  239. MCIDRV_SYNC_SET_MASTER = $00001000;
  240. Type
  241. sync_evcb = record
  242. ulType : LongInt; // Event_SYNC
  243. ulSubType : LongInt; // Not used
  244. ulSyncFlags : LongInt; // 0 (input),status (output)
  245. hstream : HStream; // handle to stream for this event
  246. hid : hID; // Handler id
  247. ulStatus : LongInt; // Event status (output)
  248. mmtimeStart : mmTime; // Filled in by Sync/Stream manager
  249. // at SpiEnableSync time. (input)
  250. mmtimeMaster : mmTime; // Filled in by Master SH (input)
  251. mmtimeSlave : mmTime; // Filled in by slave SH. (output)
  252. end;
  253. pSync_evcb = ^sync_Evcb;
  254. Type
  255. mciDrv_Sync_Parms = record
  256. hStreams : ^hStream; // Pointer to list of stream IDs
  257. ulNumStreams : LongInt; // number of stream IDs
  258. mmTime : mmTime; // Sync Pulse Time
  259. NonStreamMaster : Boolean; // TRUE if this device can be master
  260. pevcbSyncPulse : pSync_evcb; // pointer to EVCB address (output)
  261. hidMaster : hID; // Master NULL sh ID (valid only on
  262. // MCIDRV_SYNC_MASTER
  263. ulReserved1 : LongInt; // Reserved field
  264. ulReserved2 : LongInt; // Reserved field
  265. end;
  266. pmciDrv_Sync_Parms = ^mciDrv_Sync_Parms;
  267. //*******************************************************************/
  268. // contains information for open message for MCI drivers */
  269. //*******************************************************************/
  270. Type
  271. mmDrv_Open_Parms = record
  272. hwndCallback : hwnd; // call back handle
  273. usDeviceID : Integer; // The device ID assigned to this instance
  274. usDeviceType : Integer; // The device type number
  275. usDeviceOrd : Integer; // The device ordinal number
  276. pInstance : Pointer; // pointer to the instance structure allocated
  277. // initialized by the driver. The MCI driver
  278. // will fill in this parameter.
  279. szDevDLLName : Array[0..259] of Char; // Character string containing the device
  280. // specific DLL name to call for the open.
  281. // (ie. ACPA.DLL)
  282. pszElementName : pChar; // typically a file name or NULL
  283. usDevParmLen : Integer; // Device parameters data block length.
  284. pDevParm : Pointer; // Device parameters data block. This data
  285. // block is unique to each type of device.
  286. // (ie. LVD "COM1 9600 N 7 1").
  287. Reserved0 : Pointer;
  288. usResourceUnitsRequired : Integer; // number of resource units this instance
  289. // requires.
  290. usResourceClass : Integer; // resource class this instance belongs to
  291. usResourcePriority : Integer; // resource priority for this instance
  292. ulParam2 : LongInt; // Pointer to MCI_OPEN structure
  293. end;
  294. pmmDrv_Open_Parms = ^mmDrv_Open_Parms;
  295. ///*******************************************************************/
  296. // */
  297. // MCIDRV_RESTORE message flags */
  298. // */
  299. ///*******************************************************************/
  300. Type
  301. MCIDRV_RESTORE_PARMS = record
  302. ulLength:longint; // Length of restore parms */
  303. ulMasterVolume:longint; // Master volume value */
  304. end;
  305. PMCIDRV_RESTORE_PARMS=^MCIDRV_RESTORE_PARMS;
  306. function mdmDriverNotify( usDeviceID: Integer; wnd: Hwnd; usMsgType: Integer;
  307. usUserParm: Integer; ulMsgParm: LongInt): LongInt; cdecl;
  308. Implementation
  309. function mdmDriverNotify( usDeviceID: Integer; wnd: Hwnd; usMsgType: Integer;
  310. usUserParm: Integer; ulMsgParm: LongInt): LongInt; cdecl; external 'MDM' index 17;
  311. End.
  312. {
  313. $Log$
  314. Revision 1.3 2003-02-15 18:44:55 hajny
  315. * mmtk directory corrected to lowercase
  316. Revision 1.1 2003/02/15 16:59:09 hajny
  317. * mmtk directory corrected to lowercase
  318. Revision 1.1 2003/02/09 13:49:06 hajny
  319. + mmtk added
  320. }