MIDISetup.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. {
  2. File: CoreMIDI/MIDISetup.h
  3. Contains: Specialized configuration-editing routines for CoreMIDI.
  4. Copyright: (c) 2000-2008 by Apple Inc., all rights reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://bugs.freepascal.org
  8. }
  9. { Pascal Translation: Gorazd Krosl <[email protected]>, October 2009 }
  10. { Pascal Translation Update: Jonas Maebe <[email protected]>, October 2012 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 308
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  17. {$mode macpas}
  18. {$modeswitch cblocks}
  19. {$packenum 1}
  20. {$macro on}
  21. {$inline on}
  22. {$calling mwpascal}
  23. unit MIDISetup;
  24. interface
  25. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  26. {$setc GAP_INTERFACES_VERSION := $0308}
  27. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  28. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  29. {$endc}
  30. {$ifc defined CPUPOWERPC and defined CPUI386}
  31. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  32. {$endc}
  33. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  34. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  35. {$endc}
  36. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  37. {$setc __ppc__ := 1}
  38. {$elsec}
  39. {$setc __ppc__ := 0}
  40. {$endc}
  41. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  42. {$setc __ppc64__ := 1}
  43. {$elsec}
  44. {$setc __ppc64__ := 0}
  45. {$endc}
  46. {$ifc not defined __i386__ and defined CPUI386}
  47. {$setc __i386__ := 1}
  48. {$elsec}
  49. {$setc __i386__ := 0}
  50. {$endc}
  51. {$ifc not defined __x86_64__ and defined CPUX86_64}
  52. {$setc __x86_64__ := 1}
  53. {$elsec}
  54. {$setc __x86_64__ := 0}
  55. {$endc}
  56. {$ifc not defined __arm__ and defined CPUARM}
  57. {$setc __arm__ := 1}
  58. {$elsec}
  59. {$setc __arm__ := 0}
  60. {$endc}
  61. {$ifc not defined __arm64__ and defined CPUAARCH64}
  62. {$setc __arm64__ := 1}
  63. {$elsec}
  64. {$setc __arm64__ := 0}
  65. {$endc}
  66. {$ifc defined cpu64}
  67. {$setc __LP64__ := 1}
  68. {$elsec}
  69. {$setc __LP64__ := 0}
  70. {$endc}
  71. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  72. {$error Conflicting definitions for __ppc__ and __i386__}
  73. {$endc}
  74. {$ifc defined __ppc__ and __ppc__}
  75. {$setc TARGET_CPU_PPC := TRUE}
  76. {$setc TARGET_CPU_PPC64 := FALSE}
  77. {$setc TARGET_CPU_X86 := FALSE}
  78. {$setc TARGET_CPU_X86_64 := FALSE}
  79. {$setc TARGET_CPU_ARM := FALSE}
  80. {$setc TARGET_CPU_ARM64 := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_IPHONE := FALSE}
  83. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  84. {$setc TARGET_OS_EMBEDDED := FALSE}
  85. {$elifc defined __ppc64__ and __ppc64__}
  86. {$setc TARGET_CPU_PPC := FALSE}
  87. {$setc TARGET_CPU_PPC64 := TRUE}
  88. {$setc TARGET_CPU_X86 := FALSE}
  89. {$setc TARGET_CPU_X86_64 := FALSE}
  90. {$setc TARGET_CPU_ARM := FALSE}
  91. {$setc TARGET_CPU_ARM64 := FALSE}
  92. {$setc TARGET_OS_MAC := TRUE}
  93. {$setc TARGET_OS_IPHONE := FALSE}
  94. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  95. {$setc TARGET_OS_EMBEDDED := FALSE}
  96. {$elifc defined __i386__ and __i386__}
  97. {$setc TARGET_CPU_PPC := FALSE}
  98. {$setc TARGET_CPU_PPC64 := FALSE}
  99. {$setc TARGET_CPU_X86 := TRUE}
  100. {$setc TARGET_CPU_X86_64 := FALSE}
  101. {$setc TARGET_CPU_ARM := FALSE}
  102. {$setc TARGET_CPU_ARM64 := FALSE}
  103. {$ifc defined(iphonesim)}
  104. {$setc TARGET_OS_MAC := FALSE}
  105. {$setc TARGET_OS_IPHONE := TRUE}
  106. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  107. {$elsec}
  108. {$setc TARGET_OS_MAC := TRUE}
  109. {$setc TARGET_OS_IPHONE := FALSE}
  110. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  111. {$endc}
  112. {$setc TARGET_OS_EMBEDDED := FALSE}
  113. {$elifc defined __x86_64__ and __x86_64__}
  114. {$setc TARGET_CPU_PPC := FALSE}
  115. {$setc TARGET_CPU_PPC64 := FALSE}
  116. {$setc TARGET_CPU_X86 := FALSE}
  117. {$setc TARGET_CPU_X86_64 := TRUE}
  118. {$setc TARGET_CPU_ARM := FALSE}
  119. {$setc TARGET_CPU_ARM64 := FALSE}
  120. {$ifc defined(iphonesim)}
  121. {$setc TARGET_OS_MAC := FALSE}
  122. {$setc TARGET_OS_IPHONE := TRUE}
  123. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  124. {$elsec}
  125. {$setc TARGET_OS_MAC := TRUE}
  126. {$setc TARGET_OS_IPHONE := FALSE}
  127. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  128. {$endc}
  129. {$setc TARGET_OS_EMBEDDED := FALSE}
  130. {$elifc defined __arm__ and __arm__}
  131. {$setc TARGET_CPU_PPC := FALSE}
  132. {$setc TARGET_CPU_PPC64 := FALSE}
  133. {$setc TARGET_CPU_X86 := FALSE}
  134. {$setc TARGET_CPU_X86_64 := FALSE}
  135. {$setc TARGET_CPU_ARM := TRUE}
  136. {$setc TARGET_CPU_ARM64 := FALSE}
  137. { will require compiler define when/if other Apple devices with ARM cpus ship }
  138. {$setc TARGET_OS_MAC := FALSE}
  139. {$setc TARGET_OS_IPHONE := TRUE}
  140. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  141. {$setc TARGET_OS_EMBEDDED := TRUE}
  142. {$elifc defined __arm64__ and __arm64__}
  143. {$setc TARGET_CPU_PPC := FALSE}
  144. {$setc TARGET_CPU_PPC64 := FALSE}
  145. {$setc TARGET_CPU_X86 := FALSE}
  146. {$setc TARGET_CPU_X86_64 := FALSE}
  147. {$setc TARGET_CPU_ARM := FALSE}
  148. {$setc TARGET_CPU_ARM64 := TRUE}
  149. { will require compiler define when/if other Apple devices with ARM cpus ship }
  150. {$setc TARGET_OS_MAC := FALSE}
  151. {$setc TARGET_OS_IPHONE := TRUE}
  152. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  153. {$setc TARGET_OS_EMBEDDED := TRUE}
  154. {$elsec}
  155. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  156. {$endc}
  157. {$ifc defined __LP64__ and __LP64__ }
  158. {$setc TARGET_CPU_64 := TRUE}
  159. {$elsec}
  160. {$setc TARGET_CPU_64 := FALSE}
  161. {$endc}
  162. {$ifc defined FPC_BIG_ENDIAN}
  163. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  164. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  165. {$elifc defined FPC_LITTLE_ENDIAN}
  166. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  167. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  168. {$elsec}
  169. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  170. {$endc}
  171. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  172. {$setc CALL_NOT_IN_CARBON := FALSE}
  173. {$setc OLDROUTINENAMES := FALSE}
  174. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  175. {$setc OPAQUE_UPP_TYPES := TRUE}
  176. {$setc OTCARBONAPPLICATION := TRUE}
  177. {$setc OTKERNEL := FALSE}
  178. {$setc PM_USE_SESSION_APIS := TRUE}
  179. {$setc TARGET_API_MAC_CARBON := TRUE}
  180. {$setc TARGET_API_MAC_OS8 := FALSE}
  181. {$setc TARGET_API_MAC_OSX := TRUE}
  182. {$setc TARGET_CARBON := TRUE}
  183. {$setc TARGET_CPU_68K := FALSE}
  184. {$setc TARGET_CPU_MIPS := FALSE}
  185. {$setc TARGET_CPU_SPARC := FALSE}
  186. {$setc TARGET_OS_UNIX := FALSE}
  187. {$setc TARGET_OS_WIN32 := FALSE}
  188. {$setc TARGET_RT_MAC_68881 := FALSE}
  189. {$setc TARGET_RT_MAC_CFM := FALSE}
  190. {$setc TARGET_RT_MAC_MACHO := TRUE}
  191. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  192. {$setc TYPE_BOOL := FALSE}
  193. {$setc TYPE_EXTENDED := FALSE}
  194. {$setc TYPE_LONGLONG := TRUE}
  195. uses MacTypes,CFBase,CFData,CFArray,MIDIServices;
  196. {$endc} {not MACOSALLINCLUDE}
  197. {$ifc TARGET_OS_MAC}
  198. {$ALIGN POWER}
  199. // -----------------------------------------------------------------------------
  200. {!
  201. @header MIDISetup.h
  202. This header defines functions that manipulate and customize the global
  203. state of the MIDI system. These functions are generally only needed by
  204. applications which wish to allow the user some flexibility in how
  205. the MIDI system's state is presented, and by MIDI drivers, which may
  206. dynamically modify the system state as hardware is connected and
  207. disconnected.
  208. }
  209. // -----------------------------------------------------------------------------
  210. {!
  211. @typedef MIDISetupRef
  212. @discussion Derives from MIDIObjectRef, does not have an owner object.
  213. This represents the global state of the MIDI system,
  214. containing lists of the MIDI devices and serial port
  215. owners.
  216. Generally, only MIDI drivers and specialized configuration
  217. editors will need to manipulate MIDISetup objects, not the
  218. average MIDI client application. As of CoreMIDI 1.1, the
  219. MIDIServer maintains a single global MIDISetupRef, stored
  220. persistently in a preference file.
  221. }
  222. //#if __LP64__
  223. {$ifc not undefined TARGET_CPU_64 and TARGET_CPU_64}
  224. type
  225. MIDISetupRef = MIDIObjectRef;
  226. {$elsec}
  227. type
  228. MIDISetupRef = ^OpaqueMIDISetup; { an opaque type }
  229. OpaqueMIDISetup = record end;
  230. {$endif}
  231. // ______________________________________________________________________________
  232. // MIDISetup
  233. // ______________________________________________________________________________
  234. // -----------------------------------------------------------------------------
  235. {!
  236. @function MIDISetupCreate
  237. @abstract Interrogates drivers, to discover what hardware is present.
  238. As of CoreMIDI 1.1, it is usually not necessary to call
  239. this function, as CoreMIDI manages a single persistent
  240. MIDISetup itself.
  241. @param outSetup
  242. On successful return, points to a newly-created MIDISetup
  243. object. The caller is responsible for disposing it,
  244. or transferring ownership of the object back to the
  245. system, with MIDISetupInstall.
  246. @result An OSStatus result code.
  247. }
  248. function MIDISetupCreate( var outSetup: MIDISetupRef ): OSStatus; external name '_MIDISetupCreate';
  249. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  250. // -----------------------------------------------------------------------------
  251. {!
  252. @function MIDISetupDispose
  253. @abstract Dispose a MIDISetup object.
  254. As of CoreMIDI 1.1, it is usually not necessary to call
  255. this function, as CoreMIDI manages a single persistent
  256. MIDISetup itself.
  257. @param setup
  258. The MIDISetup to be disposed.
  259. @result An OSStatus result code.
  260. }
  261. function MIDISetupDispose( setup: MIDISetupRef ): OSStatus; external name '_MIDISetupDispose';
  262. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  263. // -----------------------------------------------------------------------------
  264. {!
  265. @function MIDISetupInstall
  266. @abstract Install a MIDISetup as the system's current state.
  267. A client can create a MIDISetup object using
  268. MIDISetupCreate, or MIDISetupFromData. This function will
  269. install this state as the current state of the system,
  270. possibly changing the devices visible to clients.
  271. As of CoreMIDI 1.1, it is usually not necessary to call
  272. this function, as CoreMIDI manages a single persistent
  273. MIDISetup itself.
  274. @param setup
  275. The MIDISetup object to install. Ownership of this
  276. object is transferred from the client to the system; the
  277. client must <b>not</b> dispose of this MIDISetup.
  278. @result An OSStatus result code.
  279. }
  280. function MIDISetupInstall( setup: MIDISetupRef ): OSStatus; external name '_MIDISetupInstall';
  281. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  282. // -----------------------------------------------------------------------------
  283. {!
  284. @function MIDISetupGetCurrent
  285. @abstract Return the system's current MIDISetup.
  286. As of CoreMIDI 1.1, it is usually not necessary to call
  287. this function, as CoreMIDI manages a single persistent
  288. MIDISetup itself.
  289. @param outSetup
  290. On successful return, points to the system's most
  291. recently installed MIDISetup. The system retains
  292. ownership of the object; the client must <b>not</b>
  293. dispose of this MIDISetup.
  294. @result An OSStatus result code.
  295. }
  296. function MIDISetupGetCurrent( var outSetup: MIDISetupRef ): OSStatus; external name '_MIDISetupGetCurrent';
  297. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  298. // -----------------------------------------------------------------------------
  299. {!
  300. @function MIDISetupToData
  301. @abstract Create an XML representation of a MIDISetup object.
  302. As of CoreMIDI 1.1, it is usually not necessary to call
  303. this function, as CoreMIDI manages a single persistent
  304. MIDISetup itself.
  305. @param setup
  306. The MIDISetup object whose XML representation is to be
  307. returned.
  308. @param outData
  309. On successful return, points to a newly-created CFDataRef
  310. containing the XML text. The client is responsible for
  311. releasing this CFData object when done with it.
  312. @result An OSStatus result code.
  313. }
  314. function MIDISetupToData( setup: MIDISetupRef; var outData: CFDataRef ): OSStatus; external name '_MIDISetupToData';
  315. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  316. // -----------------------------------------------------------------------------
  317. {!
  318. @function MIDISetupFromData
  319. @abstract Create a MIDISetup object from an XML stream.
  320. As of CoreMIDI 1.1, it is usually not necessary to call
  321. this function, as CoreMIDI manages a single persistent
  322. MIDISetup itself.
  323. @param data
  324. The XML text from which a MIDISetup object is to be built.
  325. @param outSetup
  326. On successful return, points to a newly-created MIDISetup
  327. object. The caller is responsible for disposing it, or
  328. transferring ownership of the object back to the system,
  329. with MIDISetupInstall.
  330. @result An OSStatus result code.
  331. }
  332. function MIDISetupFromData( data: CFDataRef; var outSetup: MIDISetupRef ): OSStatus; external name '_MIDISetupFromData';
  333. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  334. // -----------------------------------------------------------------------------
  335. {!
  336. @function MIDIDeviceAddEntity
  337. @discussion Drivers call this function to specify one of the entities that
  338. comprise a device.
  339. Non-drivers may call this function as of CoreMIDI 1.1, to
  340. add entities to external devices.
  341. @param device
  342. The device to which an entity is to be added.
  343. @param name
  344. The name of the new entity.
  345. @param embedded
  346. True if this entity is inside the device, false if the
  347. entity simply consists of external connectors to which
  348. other devices can be attached.
  349. @param numSourceEndpoints
  350. The number of source endpoints the entity has.
  351. @param numDestinationEndpoints
  352. The number of destination endpoints the entity has.
  353. @param newEntity
  354. On successful return, points to the newly-created entity.
  355. @result An OSStatus result code.
  356. }
  357. function MIDIDeviceAddEntity( device: MIDIDeviceRef; name: CFStringRef; embedded: Boolean; numSourceEndpoints: ItemCount; numDestinationEndpoints: ItemCount; var newEntity: MIDIEntityRef ): OSStatus; external name '_MIDIDeviceAddEntity';
  358. (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
  359. // -----------------------------------------------------------------------------
  360. {!
  361. @function MIDIDeviceRemoveEntity
  362. @discussion Drivers may call this function to remove one of a device's
  363. entities.
  364. New for CoreMIDI 1.1.
  365. @param device
  366. The device from which an entity is to be removed.
  367. @param entity
  368. The entity to be removed.
  369. @result An OSStatus result code.
  370. }
  371. function MIDIDeviceRemoveEntity( device: MIDIDeviceRef; entity: MIDIEntityRef ): OSStatus; external name '_MIDIDeviceRemoveEntity';
  372. (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
  373. // -----------------------------------------------------------------------------
  374. {!
  375. @function MIDIEntityAddOrRemoveEndpoints
  376. @discussion Drivers and configuration editors may call this function to add to
  377. or remove an entity's endpoints.
  378. New for CoreMIDI 1.3.
  379. @param entity
  380. The entity whose endpoints are to be manipulated.
  381. @param numSourceEndpoints
  382. The desired new number of source endpoints.
  383. @param numDestinationEndpoints
  384. The desired new number of destination endpoints.
  385. @result An OSStatus result code.
  386. }
  387. function MIDIEntityAddOrRemoveEndpoints( entity: MIDIEntityRef; numSourceEndpoints: ItemCount; numDestinationEndpoints: ItemCount ): OSStatus; external name '_MIDIEntityAddOrRemoveEndpoints';
  388. (* __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_NA) *)
  389. // -----------------------------------------------------------------------------
  390. {!
  391. @function MIDISetupAddDevice
  392. @abstract Adds a driver-owner MIDI device to the current MIDISetup
  393. @discussion Only MIDI drivers may make this call; it is in this header
  394. file only for consistency with MIDISetupRemoveDevice.
  395. New for CoreMIDI 1.1.
  396. @param device
  397. The device to be added.
  398. }
  399. function MIDISetupAddDevice( device: MIDIDeviceRef ): OSStatus; external name '_MIDISetupAddDevice';
  400. (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
  401. // -----------------------------------------------------------------------------
  402. {!
  403. @function MIDISetupRemoveDevice
  404. @abstract Removes a driver-owned MIDI device from the current MIDISetup
  405. @discussion Generally this should only be called from a studio configuration
  406. editor, to remove a device which is offline and which the user
  407. has specified as being permanently missing.
  408. Instead of removing devices from the setup, drivers should
  409. set the device's kMIDIPropertyOffline to 1 so that if the
  410. device reappears later, none of its properties are lost.
  411. New for CoreMIDI 1.1.
  412. @param device
  413. The device to be added.
  414. }
  415. function MIDISetupRemoveDevice( device: MIDIDeviceRef ): OSStatus; external name '_MIDISetupRemoveDevice';
  416. (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
  417. // -----------------------------------------------------------------------------
  418. {!
  419. @function MIDISetupAddExternalDevice
  420. @abstract Adds an external MIDI device to the current MIDISetup
  421. @discussion Useful for a studio configuration editor. New for CoreMIDI 1.1.
  422. @param device
  423. The device to be added.
  424. }
  425. function MIDISetupAddExternalDevice( device: MIDIDeviceRef ): OSStatus; external name '_MIDISetupAddExternalDevice';
  426. (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
  427. // -----------------------------------------------------------------------------
  428. {!
  429. @function MIDISetupRemoveExternalDevice
  430. @abstract Removes an external MIDI device from the current MIDISetup
  431. @discussion Useful for a studio configuration editor. New for CoreMIDI 1.1.
  432. @param device
  433. The device to be removed.
  434. }
  435. function MIDISetupRemoveExternalDevice( device: MIDIDeviceRef ): OSStatus; external name '_MIDISetupRemoveExternalDevice';
  436. (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
  437. // -----------------------------------------------------------------------------
  438. {!
  439. @function MIDIGetSerialPortOwner
  440. @abstract Returns the MIDI driver that owns a serial port.
  441. @discussion The current MIDISetup tracks ownership of serial ports
  442. to one of the MIDI drivers installed in the system.
  443. Serial ports can be enumerated using IOServiceMatching(
  444. kIOSerialBSDServiceValue). The port's unique name is
  445. the IOService's kIOTTYDeviceKey property.
  446. New for CoreMIDI 1.1.
  447. A previous version of this documentation specified an incorrect
  448. key for obtaining the port's unique name (IOTTYBaseName).
  449. @param portName
  450. The name of a serial port.
  451. @param outDriverName
  452. On exit, the name of the driver owning the port,
  453. or NULL if no driver owns it.
  454. @result An OSStatus result code.
  455. }
  456. function MIDIGetSerialPortOwner( portName: CFStringRef; var outDriverName: CFStringRef ): OSStatus; external name '_MIDIGetSerialPortOwner';
  457. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  458. // -----------------------------------------------------------------------------
  459. {!
  460. @function MIDISetSerialPortOwner
  461. @abstract Specifies the MIDI driver that owns a serial port.
  462. @discussion Use this to assign ownership of a serial port
  463. to one of the MIDI drivers installed in the system.
  464. New for CoreMIDI 1.1.
  465. @param portName
  466. The name of a serial port.
  467. @param driverName
  468. The name of the driver that owns the serial port,
  469. or NULL to specify that no driver owns it.
  470. @result An OSStatus result code.
  471. }
  472. function MIDISetSerialPortOwner( portName: CFStringRef; driverName: CFStringRef ): OSStatus; external name '_MIDISetSerialPortOwner';
  473. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  474. // -----------------------------------------------------------------------------
  475. {!
  476. @function MIDIGetSerialPortDrivers
  477. @abstract Returns a list of installed MIDI drivers for serial port
  478. MIDI devices.
  479. @discussion Use this to determine which of the installed MIDI drivers
  480. are for devices which may attach to serial ports.
  481. New for CoreMIDI 1.1.
  482. @param outDriverNames
  483. On exit, a CFArrayRef containing a list of CFStringRef's
  484. which are the names of the serial port MIDI drivers.
  485. The array should be released by the caller.
  486. @result An OSStatus result code.
  487. }
  488. function MIDIGetSerialPortDrivers( var outDriverNames: CFArrayRef ): OSStatus; external name '_MIDIGetSerialPortDrivers';
  489. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_NA, __IPHONE_NA) *)
  490. // -----------------------------------------------------------------------------
  491. {!
  492. @function MIDIExternalDeviceCreate
  493. @abstract Create a new external MIDI device.
  494. @discussion Non-drivers may call this function as of CoreMIDI 1.1, to
  495. create external devices.
  496. The new device is not added to the current MIDISetupRef;
  497. to do this, use MIDISetupAddExternalDevice.
  498. @param name
  499. The name of the new device.
  500. @param manufacturer
  501. The name of the device's manufacturer.
  502. @param model
  503. The device's model name.
  504. @param outDevice
  505. On successful return, points to the newly-created device.
  506. @result An OSStatus result code.
  507. }
  508. function MIDIExternalDeviceCreate( name: CFStringRef; manufacturer: CFStringRef; model: CFStringRef; var outDevice: MIDIDeviceRef ): OSStatus; external name '_MIDIExternalDeviceCreate';
  509. (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_NA) *)
  510. {$endc} { TARGET_OS_MAC }{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  511. end.
  512. {$endc} {not MACOSALLINCLUDE}