/packages/univint/src/MIDISetup.pas

https://github.com/slibre/freepascal · Pascal · 599 lines · 26 code · 43 blank · 530 comment · 0 complexity · bdb8dcbcb33a924227d64f7776a0c934 MD5 · raw file

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