mcidrv.pas 16 KB

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