AudioHardwareDeprecated.pas 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  1. {==================================================================================================
  2. File: CoreAudio/AudioHardwareDeprecated.h
  3. Copyright: (c) 1985-2011 by Apple, Inc., all rights reserved.
  4. Bugs?: For bug reports, consult the following page on
  5. the World Wide Web:
  6. http://www.freepascal.org/bugs.html
  7. ==================================================================================================}
  8. { Initial Pascal Translation: Jonas Maebe, <[email protected]>, October 2012 }
  9. {
  10. Modified for use with Free Pascal
  11. Version 308
  12. Please report any bugs to <[email protected]>
  13. }
  14. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  15. {$mode macpas}
  16. {$packenum 1}
  17. {$macro on}
  18. {$inline on}
  19. {$calling mwpascal}
  20. unit AudioHardwareDeprecated;
  21. interface
  22. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  23. {$setc GAP_INTERFACES_VERSION := $0308}
  24. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  25. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  26. {$endc}
  27. {$ifc defined CPUPOWERPC and defined CPUI386}
  28. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  29. {$endc}
  30. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  31. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  32. {$endc}
  33. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  34. {$setc __ppc__ := 1}
  35. {$elsec}
  36. {$setc __ppc__ := 0}
  37. {$endc}
  38. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  39. {$setc __ppc64__ := 1}
  40. {$elsec}
  41. {$setc __ppc64__ := 0}
  42. {$endc}
  43. {$ifc not defined __i386__ and defined CPUI386}
  44. {$setc __i386__ := 1}
  45. {$elsec}
  46. {$setc __i386__ := 0}
  47. {$endc}
  48. {$ifc not defined __x86_64__ and defined CPUX86_64}
  49. {$setc __x86_64__ := 1}
  50. {$elsec}
  51. {$setc __x86_64__ := 0}
  52. {$endc}
  53. {$ifc not defined __arm__ and defined CPUARM}
  54. {$setc __arm__ := 1}
  55. {$elsec}
  56. {$setc __arm__ := 0}
  57. {$endc}
  58. {$ifc defined cpu64}
  59. {$setc __LP64__ := 1}
  60. {$elsec}
  61. {$setc __LP64__ := 0}
  62. {$endc}
  63. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  64. {$error Conflicting definitions for __ppc__ and __i386__}
  65. {$endc}
  66. {$ifc defined __ppc__ and __ppc__}
  67. {$setc TARGET_CPU_PPC := TRUE}
  68. {$setc TARGET_CPU_PPC64 := FALSE}
  69. {$setc TARGET_CPU_X86 := FALSE}
  70. {$setc TARGET_CPU_X86_64 := FALSE}
  71. {$setc TARGET_CPU_ARM := FALSE}
  72. {$setc TARGET_OS_MAC := TRUE}
  73. {$setc TARGET_OS_IPHONE := FALSE}
  74. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  75. {$setc TARGET_OS_EMBEDDED := FALSE}
  76. {$elifc defined __ppc64__ and __ppc64__}
  77. {$setc TARGET_CPU_PPC := FALSE}
  78. {$setc TARGET_CPU_PPC64 := TRUE}
  79. {$setc TARGET_CPU_X86 := FALSE}
  80. {$setc TARGET_CPU_X86_64 := FALSE}
  81. {$setc TARGET_CPU_ARM := FALSE}
  82. {$setc TARGET_OS_MAC := TRUE}
  83. {$setc TARGET_OS_IPHONE := FALSE}
  84. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  85. {$setc TARGET_OS_EMBEDDED := FALSE}
  86. {$elifc defined __i386__ and __i386__}
  87. {$setc TARGET_CPU_PPC := FALSE}
  88. {$setc TARGET_CPU_PPC64 := FALSE}
  89. {$setc TARGET_CPU_X86 := TRUE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$ifc defined(iphonesim)}
  93. {$setc TARGET_OS_MAC := FALSE}
  94. {$setc TARGET_OS_IPHONE := TRUE}
  95. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  96. {$elsec}
  97. {$setc TARGET_OS_MAC := TRUE}
  98. {$setc TARGET_OS_IPHONE := FALSE}
  99. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  100. {$endc}
  101. {$setc TARGET_OS_EMBEDDED := FALSE}
  102. {$elifc defined __x86_64__ and __x86_64__}
  103. {$setc TARGET_CPU_PPC := FALSE}
  104. {$setc TARGET_CPU_PPC64 := FALSE}
  105. {$setc TARGET_CPU_X86 := FALSE}
  106. {$setc TARGET_CPU_X86_64 := TRUE}
  107. {$setc TARGET_CPU_ARM := FALSE}
  108. {$setc TARGET_OS_MAC := TRUE}
  109. {$setc TARGET_OS_IPHONE := FALSE}
  110. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  111. {$setc TARGET_OS_EMBEDDED := FALSE}
  112. {$elifc defined __arm__ and __arm__}
  113. {$setc TARGET_CPU_PPC := FALSE}
  114. {$setc TARGET_CPU_PPC64 := FALSE}
  115. {$setc TARGET_CPU_X86 := FALSE}
  116. {$setc TARGET_CPU_X86_64 := FALSE}
  117. {$setc TARGET_CPU_ARM := TRUE}
  118. { will require compiler define when/if other Apple devices with ARM cpus ship }
  119. {$setc TARGET_OS_MAC := FALSE}
  120. {$setc TARGET_OS_IPHONE := TRUE}
  121. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  122. {$setc TARGET_OS_EMBEDDED := TRUE}
  123. {$elsec}
  124. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  125. {$endc}
  126. {$ifc defined __LP64__ and __LP64__ }
  127. {$setc TARGET_CPU_64 := TRUE}
  128. {$elsec}
  129. {$setc TARGET_CPU_64 := FALSE}
  130. {$endc}
  131. {$ifc defined FPC_BIG_ENDIAN}
  132. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  133. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  134. {$elifc defined FPC_LITTLE_ENDIAN}
  135. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  136. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  137. {$elsec}
  138. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  139. {$endc}
  140. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  141. {$setc CALL_NOT_IN_CARBON := FALSE}
  142. {$setc OLDROUTINENAMES := FALSE}
  143. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  144. {$setc OPAQUE_UPP_TYPES := TRUE}
  145. {$setc OTCARBONAPPLICATION := TRUE}
  146. {$setc OTKERNEL := FALSE}
  147. {$setc PM_USE_SESSION_APIS := TRUE}
  148. {$setc TARGET_API_MAC_CARBON := TRUE}
  149. {$setc TARGET_API_MAC_OS8 := FALSE}
  150. {$setc TARGET_API_MAC_OSX := TRUE}
  151. {$setc TARGET_CARBON := TRUE}
  152. {$setc TARGET_CPU_68K := FALSE}
  153. {$setc TARGET_CPU_MIPS := FALSE}
  154. {$setc TARGET_CPU_SPARC := FALSE}
  155. {$setc TARGET_OS_UNIX := FALSE}
  156. {$setc TARGET_OS_WIN32 := FALSE}
  157. {$setc TARGET_RT_MAC_68881 := FALSE}
  158. {$setc TARGET_RT_MAC_CFM := FALSE}
  159. {$setc TARGET_RT_MAC_MACHO := TRUE}
  160. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  161. {$setc TYPE_BOOL := FALSE}
  162. {$setc TYPE_EXTENDED := FALSE}
  163. {$setc TYPE_LONGLONG := TRUE}
  164. uses MacTypes, CFRunLoop, CoreAudioTypes, AudioHardwareBase, AudioHardware;
  165. {$endc} {not MACOSALLINCLUDE}
  166. {$ALIGN POWER}
  167. //==================================================================================================
  168. // Includes
  169. //==================================================================================================
  170. //==================================================================================================
  171. //#pragma mark -
  172. //#pragma mark Property Support Constants
  173. {!
  174. @enum Property Address Constants
  175. @abstract The valid values for the scope in a property address.
  176. @constant kAudioDevicePropertyScopeInput
  177. The AudioObjectPropertyScope for properties that apply to the input side of
  178. an object.
  179. @constant kAudioDevicePropertyScopeOutput
  180. The AudioObjectPropertyScope for properties that apply to the output side of
  181. an object.
  182. @constant kAudioDevicePropertyScopePlayThrough
  183. The AudioObjectPropertyScope for properties that apply to the play through
  184. side of an object.
  185. }
  186. const
  187. kAudioDevicePropertyScopeInput = kAudioObjectPropertyScopeInput;
  188. kAudioDevicePropertyScopeOutput = kAudioObjectPropertyScopeOutput;
  189. kAudioDevicePropertyScopePlayThrough = kAudioObjectPropertyScopePlayThrough;
  190. {!
  191. @enum Property Wildcard Constants
  192. @abstract Constants that are used as wildcards in an AudioObjectPropertyAddress.
  193. @discussion Wildcards match any and all values for there associated type. They are
  194. especially useful for registering listener procs to receive notifications and
  195. for querying an AudioObject's list of AudioControls.
  196. @constant kAudioPropertyWildcardPropertyID
  197. A synonym for kAudioObjectPropertySelectorWildcard.
  198. @constant kAudioPropertyWildcardSection
  199. The wildcard value for the isInput argument of AudioDeviceGetPropertyInfo(),
  200. AudioDeviceGetProperty(), and AudioDeviceSetProperty().
  201. @constant kAudioPropertyWildcardChannel
  202. A synonym for kAudioObjectPropertyElementWildcard.
  203. }
  204. const
  205. kAudioPropertyWildcardPropertyID = kAudioObjectPropertySelectorWildcard;
  206. kAudioPropertyWildcardSection = $FF;
  207. kAudioPropertyWildcardChannel = kAudioObjectPropertyElementWildcard;
  208. //==================================================================================================
  209. //#pragma mark -
  210. //#pragma mark AudioControl Constants
  211. {!
  212. @enum AudioBooleanControl Subclass IDs
  213. @abstract The four char codes that identify the various standard subclasses of
  214. AudioBooleanControl.
  215. @constant kAudioISubOwnerClassID
  216. An AudioBooleanControl where true means that the AudioDevice that
  217. ultimately owns the control also owns any iSub attached to the CPU.
  218. }
  219. const
  220. kAudioISubOwnerControlClassID = FourCharCode('atch');
  221. //==================================================================================================
  222. //#pragma mark AudioControl Properties
  223. {!
  224. @enum AudioLevelControl Properties
  225. @abstract AudioObjectPropertySelector values that apply to all AudioLevelControls.
  226. @discussion AudioLevelControl is a subclass of AudioControl and has only the single scope,
  227. kAudioObjectPropertyScopeGlobal, and only a master element.
  228. @constant kAudioLevelControlPropertyDecibelsToScalarTransferFunction
  229. A UInt32 whose value indicates the transfer function the HAL uses to convert
  230. between decibel values and scalar values.
  231. }
  232. const
  233. kAudioLevelControlPropertyDecibelsToScalarTransferFunction = FourCharCode('lctf');
  234. {!
  235. @enum Values for kAudioLevelControlPropertyDecibelsToScalarTransferFunction
  236. @abstract The following constants are the only supported values for a volume control's
  237. transfer function.
  238. @discussion The transfer function implemented in the volume control works by raising the
  239. scalar value to an exponent to map it into the decibel range. The constants
  240. in this enum express the exponent used in the name as a quotient. For example,
  241. kAudioLevelControlTranferFunction3Over4 represents the exponent 0.75.
  242. }
  243. const
  244. kAudioLevelControlTranferFunctionLinear = 0;
  245. kAudioLevelControlTranferFunction1Over3 = 1;
  246. kAudioLevelControlTranferFunction1Over2 = 2;
  247. kAudioLevelControlTranferFunction3Over4 = 3;
  248. kAudioLevelControlTranferFunction3Over2 = 4;
  249. kAudioLevelControlTranferFunction2Over1 = 5;
  250. kAudioLevelControlTranferFunction3Over1 = 6;
  251. kAudioLevelControlTranferFunction4Over1 = 7;
  252. kAudioLevelControlTranferFunction5Over1 = 8;
  253. kAudioLevelControlTranferFunction6Over1 = 9;
  254. kAudioLevelControlTranferFunction7Over1 = 10;
  255. kAudioLevelControlTranferFunction8Over1 = 11;
  256. kAudioLevelControlTranferFunction9Over1 = 12;
  257. kAudioLevelControlTranferFunction10Over1 = 13;
  258. kAudioLevelControlTranferFunction11Over1 = 14;
  259. kAudioLevelControlTranferFunction12Over1 = 15;
  260. //==================================================================================================
  261. //#pragma mark -
  262. //#pragma mark AudioSystemObject Types
  263. {!
  264. @typedef AudioHardwarePropertyID
  265. @abstract An AudioHardwarePropertyID is a integer that identifies a specific piece of
  266. information about the AudioSystemObject.
  267. }
  268. type
  269. AudioHardwarePropertyID = AudioObjectPropertySelector;
  270. {!
  271. @typedef AudioHardwarePropertyListenerProc
  272. @abstract Clients register an AudioHardwarePropertyListenerProc with the AudioSystemObject
  273. in order to receive notifications when the properties of the object change.
  274. @discussion Note that the same functionality is provided by AudioObjectPropertyListenerProc.
  275. @param inPropertyID
  276. The AudioHardwarePropertyID of the property that changed.
  277. @param inClientData
  278. A pointer to client data established when the listener proc was registered
  279. with the AudioSystemObject.
  280. @result The return value is currently unused and should always be 0.
  281. }
  282. type
  283. AudioHardwarePropertyListenerProc = function( inPropertyID: AudioHardwarePropertyID; inClientData: UnivPtr ): OSStatus;
  284. //==================================================================================================
  285. //#pragma mark AudioSystemObject Constants
  286. {!
  287. @defined kAudioHardwareRunLoopMode
  288. @discussion The name of the run loop mode to which only HAL run loop sources and sources
  289. added via AudioHardwareAddRunLoopSource() belong. This is the mode in which to
  290. task a run loop in order to ensure that just HAL related events are handled.
  291. }
  292. const
  293. kAudioHardwareRunLoopMode = 'com.apple.audio.CoreAudio';
  294. //==================================================================================================
  295. //#pragma mark AudioSystemObject Properties
  296. {!
  297. @enum AudioSystemObject Properties
  298. @abstract AudioObjectPropertySelector values that apply to the AudioSystemObject.
  299. @discussion The AudioSystemObject has one scope, kAudioObjectPropertyScopeGlobal, and only a
  300. master element.
  301. @constant kAudioHardwarePropertyRunLoop
  302. The CFRunLoopRef the HAL is currently attaching all of it's system
  303. notification handlers to. In 10.6 and later, the HAL will use the process's
  304. run loop (as defined by CFRunLoopGetMain()) for this task. Whereas in
  305. previous releases, the HAL created and managed it's own thread for the task.
  306. Clients can set this property to tell the HAL to use a thread of the
  307. client's choosing. If the value for this property is set to NULL, the HAL
  308. will return to it's pre-10.6 behavior of creating and managing it's own
  309. thread for notifications. The caller is responsible for releasing the
  310. returned CFObject.
  311. @constant kAudioHardwarePropertyDeviceForUID
  312. Using an AudioValueTranslation structure, this property translates the input
  313. CFStringRef containing a UID into the AudioDeviceID that refers to the
  314. AudioDevice with that UID. This property will return kAudioDeviceUnknown if
  315. the given UID does not match any currently available AudioDevice.
  316. }
  317. const
  318. kAudioHardwarePropertyRunLoop = FourCharCode('rnlp');
  319. kAudioHardwarePropertyDeviceForUID = FourCharCode('duid');
  320. {!
  321. @enum AudioSystemObject Properties Implemented via AudioControl objects
  322. @abstract AudioObjectPropertySelector values for AudioSystemObject properties that are
  323. implemented by AudioControl objects.
  324. @discussion These properties are also accessible by locating the AudioControl object
  325. attached to the AudioSystemObject and using that object to access the properties
  326. of the control.
  327. @constant kAudioHardwarePropertyBootChimeVolumeScalar
  328. A Float32 that represents the value of the boot chime volume control. The
  329. range is between 0.0 and 1.0 (inclusive). This property is implemented by an
  330. AudioControl object that is a subclass of AudioBootChimeVolumeControl.
  331. @constant kAudioHardwarePropertyBootChimeVolumeDecibels
  332. A Float32 that represents the value of the boot chime volume control in dB.
  333. This property is implemented by an AudioControl object that is a subclass
  334. of AudioBootChimeVolumeControl.
  335. @constant kAudioHardwarePropertyBootChimeVolumeRangeDecibels
  336. An AudioValueRange that contains the minimum and maximum dB values the
  337. boot chime control can have. This property is implemented by an AudioControl
  338. object that is a subclass of AudioBootChimeVolumeControl.
  339. @constant kAudioHardwarePropertyBootChimeVolumeScalarToDecibels
  340. A Float32 that on input contains a scalar volume value for the boot chime
  341. and on exit contains the equivalent dB value. This property is implemented
  342. by an AudioControl object that is a subclass of AudioBootChimeVolumeControl.
  343. @constant kAudioHardwarePropertyBootChimeVolumeDecibelsToScalar
  344. A Float32 that on input contains a dB volume value for the boot chime and on
  345. exit contains the equivalent scalar value. This property is implemented by
  346. an AudioControl object that is a subclass of AudioBootChimeVolumeControl.
  347. @constant kAudioHardwarePropertyBootChimeVolumeDecibelsToScalarTransferFunction
  348. A UInt32 whose value indicates the transfer function the HAL uses to convert
  349. between decibel values and scalar values. This property is implemented by an
  350. AudioControl object that is a subclass of AudioBootChimeVolumeControl.
  351. }
  352. const
  353. kAudioHardwarePropertyBootChimeVolumeScalar = FourCharCode('bbvs');
  354. kAudioHardwarePropertyBootChimeVolumeDecibels = FourCharCode('bbvd');
  355. kAudioHardwarePropertyBootChimeVolumeRangeDecibels = FourCharCode('bbd#');
  356. kAudioHardwarePropertyBootChimeVolumeScalarToDecibels = FourCharCode('bv2d');
  357. kAudioHardwarePropertyBootChimeVolumeDecibelsToScalar = FourCharCode('bd2v');
  358. kAudioHardwarePropertyBootChimeVolumeDecibelsToScalarTransferFunction = FourCharCode('bvtf');
  359. //==================================================================================================
  360. //#pragma mark AudioSystemObject Functions
  361. {!
  362. @functiongroup AudioSystemObject
  363. }
  364. {!
  365. @function AudioHardwareAddRunLoopSource
  366. @abstract Add the given CFRunLoopSource to the the HAL's notification CFRunLoop.
  367. @discussion The CFRunLoop the HAL uses for notifications is specified by
  368. kAudioHardwarePropertyRunLoop. If kAudioHardwarePropertyRunLoop changes,
  369. CFRunLoopSources added with this function will automatically be transferred to
  370. the new CFRunLoop.
  371. Usage of the HAL's notification run loop is deprecated. Please use libdispatch
  372. instead.
  373. @param inRunLoopSource
  374. The CFRunLoopSource to add.
  375. @result An OSStatus indicating success or failure.
  376. }
  377. function AudioHardwareAddRunLoopSource( inRunLoopSource: CFRunLoopSourceRef ): OSStatus; external name '_AudioHardwareAddRunLoopSource';
  378. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_7, __IPHONE_2_0, __IPHONE_4_1) *)
  379. {!
  380. @function AudioHardwareRemoveRunLoopSource
  381. @abstract Remove the given CFRunLoopSource from the the HAL's notification CFRunLoop.
  382. @discussion The CFRunLoop the HAL uses for notifications is specified by
  383. kAudioHardwarePropertyRunLoop.
  384. Usage of the HAL's notification run loop is deprecated. Please use libdispatch
  385. instead.
  386. @param inRunLoopSource
  387. The CFRunLoopSource to remove.
  388. @result An OSStatus indicating success or failure.
  389. }
  390. function AudioHardwareRemoveRunLoopSource( inRunLoopSource: CFRunLoopSourceRef ): OSStatus; external name '_AudioHardwareRemoveRunLoopSource';
  391. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_7, __IPHONE_2_0, __IPHONE_4_1) *)
  392. {!
  393. @function AudioHardwareGetPropertyInfo
  394. @abstract Retrieve information about the given property.
  395. @discussion Note that the same functionality is provided by the functions
  396. AudioObjectHasProperty(), AudioObjectIsPropertySettable(), and
  397. AudioObjectGetPropertyDataSize().
  398. @param inPropertyID
  399. The AudioHardwarePropertyID of the property to query.
  400. @param outSize
  401. A pointer to a UInt32 that receives the size of the property data in bytes
  402. on exit. This can be NULL if the size information is not being requested.
  403. @param outWritable
  404. A pointer to a Boolean that receives indication of whether or not the given
  405. property can be set. This can be NULL if the writability is not being
  406. requested.
  407. @result An OSStatus indicating success or failure.
  408. }
  409. function AudioHardwareGetPropertyInfo( inPropertyID: AudioHardwarePropertyID; outSize: UInt32Ptr; outWritable: BooleanPtr ): OSStatus; external name '_AudioHardwareGetPropertyInfo';
  410. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  411. {!
  412. @function AudioHardwareGetProperty
  413. @abstract Queries an the AudioSystemObject to get the data of the given property and
  414. places it in the provided buffer.
  415. @discussion Note that the same functionality is provided by the function
  416. AudioObjectGetPropertyData().
  417. @param inPropertyID
  418. The AudioHardwarePropertyID of the property to query.
  419. @param ioDataSize
  420. A UInt32 which on entry indicates the size of the buffer pointed to by
  421. outData and on exit indicates how much of the buffer was used.
  422. @param outData
  423. The buffer into which the AudioSystemObject will put the data for the given
  424. property.
  425. @result An OSStatus indicating success or failure.
  426. }
  427. function AudioHardwareGetProperty( inPropertyID: AudioHardwarePropertyID; var ioPropertyDataSize: UInt32; outPropertyData: UnivPtr ): OSStatus; external name '_AudioHardwareGetProperty';
  428. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  429. {!
  430. @function AudioHardwareSetProperty
  431. @abstract Tells the AudioSystemObject to change the value of the given property using the
  432. provided data.
  433. @discussion Note that the value of the property should not be considered changed until the
  434. HAL has called the listeners as many properties values are changed
  435. asynchronously. Also note that the same functionality is provided by the
  436. function AudioObjectGetPropertyData().
  437. @param inPropertyID
  438. The AudioHardwarePropertyID of the property to change.
  439. @param inDataSize
  440. A UInt32 indicating the size of the buffer pointed to by inData.
  441. @param inData
  442. The buffer containing the data to be used to change the property's value.
  443. @result An OSStatus indicating success or failure.
  444. }
  445. function AudioHardwareSetProperty( inPropertyID: AudioHardwarePropertyID; inPropertyDataSize: UInt32; inPropertyData: {const} UnivPtr ): OSStatus; external name '_AudioHardwareSetProperty';
  446. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  447. {!
  448. @function AudioHardwareAddPropertyListener
  449. @abstract Registers the given AudioHardwarePropertyListenerProc to receive notifications
  450. when the given property changes.
  451. @discussion Note that the same functionality is provided by AudioObjectAddPropertyListener
  452. in conjunction with AudioObjectPropertyListenerProc.
  453. @param inPropertyID
  454. The AudioHardwarePropertyID of the property to listen to.
  455. @param inProc
  456. AudioHardwarePropertyListenerProc to call.
  457. @param inClientData
  458. A pointer to client data that is passed to the listener when it is called.
  459. @result An OSStatus indicating success or failure.
  460. }
  461. function AudioHardwareAddPropertyListener( inPropertyID: AudioHardwarePropertyID; inProc: AudioHardwarePropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioHardwareAddPropertyListener';
  462. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  463. {!
  464. @function AudioHardwareRemovePropertyListener
  465. @abstract Unregisters the given AudioHardwarePropertyListenerProc from receive
  466. notifications when the given property changes.
  467. @discussion Note that the same functionality is provided by
  468. AudioObjectRemovePropertyListener in conjunction with
  469. AudioObjectPropertyListenerProc.
  470. @param inPropertyID
  471. The AudioHardwarePropertyID of the property to stop listening to.
  472. @param inProc
  473. AudioHardwarePropertyListenerProc to unregister.
  474. @result An OSStatus indicating success or failure.
  475. }
  476. function AudioHardwareRemovePropertyListener( inPropertyID: AudioHardwarePropertyID; inProc: AudioHardwarePropertyListenerProc ): OSStatus; external name '_AudioHardwareRemovePropertyListener';
  477. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  478. //==================================================================================================
  479. //#pragma mark -
  480. //#pragma mark AudioDevice Types
  481. {!
  482. @typedef AudioDeviceID
  483. @abstract AudioDevice is the base class for all objects that represent an audio device.
  484. @discussion AudioDevice is a subclass of AudioObject. AudioDevices normally contain
  485. AudioStreams and AudioControls, but may contain other things depending on the
  486. kind of AudioDevice (e.g. aggregate devices contain other AudioDevices).
  487. }
  488. type
  489. AudioDeviceID = AudioObjectID;
  490. {!
  491. @typedef AudioDevicePropertyID
  492. @abstract An AudioDevicePropertyID is an integer that identifies a specific piece of
  493. information about the object.
  494. }
  495. type
  496. AudioDevicePropertyID = AudioObjectPropertySelector;
  497. {!
  498. @typedef AudioDevicePropertyListenerProc
  499. @abstract Clients register an AudioDevicePropertyListenerProc with the AudioDevice object
  500. in order to receive notifications when the properties of the object change.
  501. @discussion Note that the same functionality is provided by AudioObjectPropertyListenerProc.
  502. @param inDevice
  503. The AudioDevice whose property has changed.
  504. @param inChannel
  505. The channel of the property that changed where 0 is the master channel.
  506. @param isInput
  507. Which section of the AudioDevice changed.
  508. @param inPropertyID
  509. The AudioDevicePropertyID of the property that changed.
  510. @param inClientData
  511. A pointer to client data established when the listener proc was registered
  512. with the object.
  513. @result The return value is currently unused and should always be 0.
  514. }
  515. type
  516. AudioDevicePropertyListenerProc = function( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; inClientData: UnivPtr ): OSStatus;
  517. //==================================================================================================
  518. //#pragma mark AudioDevice Constants
  519. {!
  520. @enum AudioDevice Class Constants
  521. @abstract Various constants related to AudioDevices.
  522. @constant kAudioDeviceUnknown
  523. The AudioObjectID for a nonexistent AudioObject.
  524. }
  525. const
  526. kAudioDeviceUnknown = kAudioObjectUnknown;
  527. //==================================================================================================
  528. //#pragma mark AudioDevice Properties
  529. {!
  530. @enum AudioDevice Properties Implemented via AudioControl objects
  531. @abstract AudioObjectPropertySelector values for AudioDevice properties that are
  532. implemented by AudioControl objects.
  533. @discussion These properties are also accessible by locating the AudioControl object
  534. attached to the AudioDevice and using that object to access the properties of
  535. the control.
  536. @constant kAudioDevicePropertyVolumeDecibelsToScalarTransferFunction
  537. A UInt32 whose value indicates the transfer function the HAL uses to convert
  538. between decibel values and scalar values. This property is implemented by an
  539. AudioControl object that is a subclass of AudioVolumeControl.
  540. @constant kAudioDevicePropertyPlayThruVolumeDecibelsToScalarTransferFunction
  541. A UInt32 whose value indicates the transfer function the HAL uses to convert
  542. between decibel values and scalar values. This property is implemented by an
  543. AudioControl object that is a subclass of AudioVolumeControl. Further, the
  544. control that implements this property is only available through
  545. kAudioDevicePropertyScopePlayThrough.
  546. @constant kAudioDevicePropertyDriverShouldOwniSub
  547. A UInt32 where a value of 0 means that the AudioDevice should not claim
  548. ownership of any attached iSub and a value of 1 means that it should. Note
  549. that this property is only available for built-in devices and for USB Audio
  550. devices that use the standard class compliant driver. This property is
  551. implemented by an AudioControl object that is a subclass of
  552. AudioISubOwnerControl.
  553. @constant kAudioDevicePropertySubVolumeDecibelsToScalarTransferFunction
  554. A UInt32 whose value indicates the transfer function the HAL uses to convert
  555. between decibel values and scalar values. This property is implemented by an
  556. AudioControl object that is a subclass of AudioLFEVolumeControl.
  557. }
  558. const
  559. kAudioDevicePropertyVolumeDecibelsToScalarTransferFunction = FourCharCode('vctf');
  560. kAudioDevicePropertyPlayThruVolumeDecibelsToScalarTransferFunction = FourCharCode('mvtf');
  561. kAudioDevicePropertyDriverShouldOwniSub = FourCharCode('isub');
  562. kAudioDevicePropertySubVolumeDecibelsToScalarTransferFunction = FourCharCode('svtf');
  563. {!
  564. @enum AudioDevice Properties That Ought To Some Day Be Deprecated
  565. @abstract AudioObjectPropertySelector values whose functionality is better provided by
  566. other selectors.
  567. @discussion These selectors are still provided for backward compatibility. The description
  568. of the property will indicate in parentheses the better selectors to use and
  569. why.
  570. @constant kAudioDevicePropertyDeviceName
  571. A C-string that contains the human readable name of the AudioDevice.
  572. (kAudioObjectPropertyName: CFStrings are better for localization.)
  573. @constant kAudioDevicePropertyDeviceNameCFString
  574. A CFStringRef that contains the human readable name of the AudioDevice. The
  575. caller is responsible for releasing the returned CFObject.
  576. (kAudioObjectPropertyName: This is just another name for the inherited
  577. selector.)
  578. @constant kAudioDevicePropertyDeviceManufacturer
  579. A C-string that contains the human readable name of the manufacturer of the
  580. AudioDevice.
  581. (kAudioObjectPropertyManufacturer: CFStrings are better for localization.)
  582. @constant kAudioDevicePropertyDeviceManufacturerCFString
  583. A CFString that contains the human readable name of the manufacturer of the
  584. AudioDevice. The caller is responsible for releasing the returned CFObject.
  585. (kAudioObjectPropertyManufacturer: This is just another name for the
  586. inherited selector.)
  587. @constant kAudioDevicePropertyRegisterBufferList
  588. This property allows clients to register a fully populated AudioBufferList
  589. that matches the topology described by
  590. kAudioDevicePropertyStreamConfiguration for doing input using
  591. AudioDeviceRead(). The AudioBufferList will be registered with the call the
  592. AudioDeviceSetProperty() and will be unregistered with the call to
  593. AudioDeviceGetProperty(). If this property isn't implemented by the
  594. AudioDevice, it implies that the AudioDevice also doesn't support
  595. AudioDeviceRead().
  596. (Aggregate devices make AudioDeviceRead() obsolete for the most part.)
  597. @constant kAudioDevicePropertyBufferSize
  598. A UInt32 containing the size in bytes of the IO buffer for the AudioStream
  599. containing the element.
  600. (kAudioDevicePropertyBufferFrameSize: with multiple AudioStreams and the
  601. requirement that all streams' buffers represent the same amount of time, it
  602. doesn't make sense to set the buffer size in bytes since it will be
  603. different for each stream.)
  604. @constant kAudioDevicePropertyBufferSizeRange
  605. An AudioValueRange specifying the minimum and maximum bytes size for the
  606. IO buffer for the AudioStream containing the given element.
  607. (kAudioDevicePropertyBufferFrameSizeRange: see
  608. kAudioDevicePropertyBufferSize.)
  609. @constant kAudioDevicePropertyChannelName
  610. A C-string that contains a human readable name for the given element in the
  611. given scope. The caller is responsible for releasing the returned CFObject.
  612. (kAudioObjectPropertyElementName: CFStrings are better for
  613. localization.)
  614. @constant kAudioDevicePropertyChannelNameCFString
  615. A CFString that contains a human readable name for the given element in the
  616. given scope. The caller is responsible for releasing the returned CFObject.
  617. (kAudioObjectPropertyElementName: This is just another name for the
  618. inherited selector.)
  619. @constant kAudioDevicePropertyChannelCategoryName
  620. A C-string that contains a human readable name for the category of the given
  621. element in the given scope. The caller is responsible for releasing the
  622. returned CFObject.
  623. (kAudioObjectPropertyElementCategoryName: CFStrings are better for
  624. localization.)
  625. @constant kAudioDevicePropertyChannelCategoryNameCFString
  626. A CFString that contains a human readable name for the category of the given
  627. element in the given scope. The caller is responsible for releasing the
  628. returned CFObject.
  629. (kAudioObjectPropertyElementCategoryName: This is just another name for the
  630. inherited selector.)
  631. @constant kAudioDevicePropertyChannelNumberName
  632. A C-string that contains a human readable name for the number of the given
  633. element in the given scope. The caller is responsible for releasing the
  634. returned CFObject.
  635. (kAudioObjectPropertyElementNumberName: CFStrings are better for
  636. localization.)
  637. @constant kAudioDevicePropertyChannelNumberNameCFString
  638. A CFString that contains a human readable name for the number of the given
  639. element in the given scope. The caller is responsible for releasing the
  640. returned CFObject.
  641. (kAudioObjectPropertyElementNumberName: This is just another name for the
  642. inherited selector.)
  643. @constant kAudioDevicePropertySupportsMixing
  644. A UInt32 where a value of 1 means the AudioDevice supports mixing and a
  645. value of 0 means that it doesn't and that all IO is performed in each
  646. AudioStream's current physical format. This property is changed indirectly
  647. by changing to a format that doesn't support mixing, such as AC-3. (The HAL
  648. now vends it's format information with a flag indicating the mixability in
  649. order to better support devices with streams that are both mixable and non-
  650. mixable.)
  651. @constant kAudioDevicePropertyStreamFormat
  652. An AudioStreamBasicDescription that describes the current data format for
  653. the AudioStream that contains the channel referred to by the element number.
  654. (kAudioStreamPropertyVirtualFormat: Managing format information is
  655. inherently an operation on AudioStreams, rather than AudioDevices. It is
  656. confusing for the client to work with formats at the AudioDevice level and
  657. has been shown to lead to programming mistakes by clients when working with
  658. devices that have multiple streams.)
  659. @constant kAudioDevicePropertyStreamFormats
  660. An array of AudioStreamBasicDescriptions that describe the available data
  661. formats for the AudioStream that contains the channel referred to by the
  662. element number.
  663. (kAudioStreamPropertyAvailableVirtualFormats: Managing format information is
  664. inherently an operation on AudioStreams, rather than AudioDevices. It is
  665. confusing for the client to work with formats at the AudioDevice level and
  666. has been shown to lead to programming mistakes by clients when working with
  667. devices that have multiple streams.)
  668. @constant kAudioDevicePropertyStreamFormatSupported
  669. An AudioStreamBasicDescription is passed in to query whether or not the
  670. format is supported. A kAudioDeviceUnsupportedFormatError will be returned
  671. if the format is not supported and kAudioHardwareNoError will be returned if
  672. it is supported. AudioStreamBasicDescription fields set to 0 will be ignored
  673. in the query, but otherwise values must match exactly.
  674. (kAudioStreamPropertyAvailableVirtualFormats: The proper and most robust way
  675. to find a format that the AudioStream can support is to get the list of
  676. available formats and look through that rather than using this property.)
  677. @constant kAudioDevicePropertyStreamFormatMatch
  678. An AudioStreamBasicDescription is passed in and the AudioStream will modify
  679. it to describe the best match, in the AudioDevice's opinion, for the given
  680. format.
  681. (kAudioStreamPropertyAvailableVirtualFormats: The proper and most robust way
  682. to find a format that the AudioStream can support is to get the list of
  683. available formats and look through that rather than using this property.)
  684. @constant kAudioDevicePropertyDataSourceNameForID
  685. This property translates the given data source item ID into a human readable
  686. name using an AudioValueTranslation structure. The input data is the UInt32
  687. holding the item ID to be translated and the output data is a buffer to hold
  688. the name as a null terminated C-string.
  689. (kAudioDevicePropertyDataSourceNameForIDCFString: CFStrings are better for
  690. localization.)
  691. @constant kAudioDevicePropertyClockSourceNameForID
  692. This property translates the given clock source item ID into a human
  693. readable name using an AudioValueTranslation structure. The input data is
  694. the UInt32 holding the item ID to be translated and the output data is a
  695. buffer to hold the name as a null terminated C-string.
  696. (kAudioDevicePropertyClockSourceNameForIDCFString: CFStrings are better for
  697. localization.)
  698. @constant kAudioDevicePropertyPlayThruDestinationNameForID
  699. This property translates the given play through destination item ID into a
  700. human readable name using an AudioValueTranslation structure. The input data
  701. is the UInt32 holding the item ID to be translated and the output data is a
  702. buffer to hold the name as a null terminated C-string.
  703. (kAudioDevicePropertyPlayThruDestinationNameForIDCFString: CFStrings are
  704. better for localization.)
  705. @constant kAudioDevicePropertyChannelNominalLineLevelNameForID
  706. This property translates the given nominal line level item ID into a human
  707. readable name using an AudioValueTranslation structure. The input data is
  708. the UInt32 holding the item ID to be translated and the output data is a
  709. buffer to hold the name as a null terminated C-string.
  710. (kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString: CFStrings are
  711. better for localization.)
  712. @constant kAudioDevicePropertyHighPassFilterSettingNameForID
  713. This property translates the given high pass filter setting item ID into a
  714. human readable name using an AudioValueTranslation structure. The input data
  715. is the UInt32 holding the item ID to be translated and the output data is a
  716. buffer to hold the name as a null terminated C-string.
  717. (kAudioDevicePropertyHighPassFilterSettingNameForIDCFString: CFStrings are
  718. better for localization.)
  719. }
  720. const
  721. kAudioDevicePropertyDeviceName = FourCharCode('name');
  722. kAudioDevicePropertyDeviceNameCFString = kAudioObjectPropertyName;
  723. kAudioDevicePropertyDeviceManufacturer = FourCharCode('makr');
  724. kAudioDevicePropertyDeviceManufacturerCFString = kAudioObjectPropertyManufacturer;
  725. kAudioDevicePropertyRegisterBufferList = FourCharCode('rbuf');
  726. kAudioDevicePropertyBufferSize = FourCharCode('bsiz');
  727. kAudioDevicePropertyBufferSizeRange = FourCharCode('bsz#');
  728. kAudioDevicePropertyChannelName = FourCharCode('chnm');
  729. kAudioDevicePropertyChannelNameCFString = kAudioObjectPropertyElementName;
  730. kAudioDevicePropertyChannelCategoryName = FourCharCode('ccnm');
  731. kAudioDevicePropertyChannelCategoryNameCFString = kAudioObjectPropertyElementCategoryName;
  732. kAudioDevicePropertyChannelNumberName = FourCharCode('cnnm');
  733. kAudioDevicePropertyChannelNumberNameCFString = kAudioObjectPropertyElementNumberName;
  734. kAudioDevicePropertySupportsMixing = FourCharCode('mix?');
  735. kAudioDevicePropertyStreamFormat = FourCharCode('sfmt');
  736. kAudioDevicePropertyStreamFormats = FourCharCode('sfm#');
  737. kAudioDevicePropertyStreamFormatSupported = FourCharCode('sfm?');
  738. kAudioDevicePropertyStreamFormatMatch = FourCharCode('sfmm');
  739. kAudioDevicePropertyDataSourceNameForID = FourCharCode('sscn');
  740. kAudioDevicePropertyClockSourceNameForID = FourCharCode('cscn');
  741. kAudioDevicePropertyPlayThruDestinationNameForID = FourCharCode('mddn');
  742. kAudioDevicePropertyChannelNominalLineLevelNameForID = FourCharCode('cnlv');
  743. kAudioDevicePropertyHighPassFilterSettingNameForID = FourCharCode('chip');
  744. //==================================================================================================
  745. //#pragma mark AudioDevice Functions
  746. {!
  747. @functiongroup AudioDevice
  748. }
  749. {!
  750. @function AudioDeviceAddIOProc
  751. @abstract Registers the given AudioDeviceIOProc with the AudioDevice.
  752. @discussion A client may have multiple IOProcs for a given device, but the device is free to
  753. only accept as many as it can handle. Note that it is not recommended for
  754. clients to have more than a single IOProc registered at a time as this can be
  755. wasteful of system resources. Rather, it is recommended that the client do any
  756. necessary mixing itself so that only one IOProc is necessary.
  757. This routine has been deprecated in favor of AudioDeviceCreateIOProcID().
  758. @param inDevice
  759. The AudioDevice to register the IOProc with.
  760. @param inProc
  761. The AudioDeviceIOProc to register.
  762. @param inClientData
  763. A pointer to client data that is passed back to the IOProc when it is
  764. called.
  765. @result An OSStatus indicating success or failure.
  766. }
  767. function AudioDeviceAddIOProc( inDevice: AudioDeviceID; inProc: AudioDeviceIOProc; inClientData: UnivPtr ): OSStatus; external name '_AudioDeviceAddIOProc';
  768. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0) *)
  769. {!
  770. @function AudioDeviceRemoveIOProc
  771. @abstract Unregisters the given AudioDeviceIOProc from the AudioDevice.
  772. This routine has been deprecated in favor of AudioDeviceDestroyIOProcID().
  773. @param inDevice
  774. The AudioDevice to unregister the IOProc from.
  775. @param inProc
  776. The AudioDeviceIOProc to unregister.
  777. @result An OSStatus indicating success or failure.
  778. }
  779. function AudioDeviceRemoveIOProc( inDevice: AudioDeviceID; inProc: AudioDeviceIOProc ): OSStatus; external name '_AudioDeviceRemoveIOProc';
  780. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0) *)
  781. {!
  782. @function AudioDeviceRead
  783. @abstract Read some data from an AudioDevice starting at the given time.
  784. @discussion With the advent of aggregate devices, the need for AudioDeviceRead has gone
  785. away. Consequently, this function is now deprecated.
  786. @param inDevice
  787. The AudioDevice to read from.
  788. @param inStartTime
  789. An AudioTimeStamp indicating the time from which to read the data. In
  790. general, the valid range of time (in frames) is from the current time minus
  791. the maximum IO buffer size to the current time minus the safety offset.
  792. @param outData
  793. An AudioBufferList that must be the same size and shape as that returned by
  794. kAudioDevicePropertyStreamConfiguration. Further, the AudioBufferList must
  795. have been previously registered with the device via
  796. kAudioDevicePropertyRegisterBufferList. On exit, the mDataSize fields will
  797. be updated with the amount of data read.
  798. @result An OSStatus indicating success or failure.
  799. kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
  800. not support direct reading.
  801. }
  802. function AudioDeviceRead( inDevice: AudioDeviceID; const (*var*) inStartTime: AudioTimeStamp; var outData: AudioBufferList ): OSStatus; external name '_AudioDeviceRead';
  803. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0) *)
  804. {!
  805. @function AudioDeviceGetPropertyInfo
  806. @abstract Retrieve information about the given property of an AudioDevice.
  807. @discussion Note that the same functionality is provided by the functions
  808. AudioObjectHasProperty(), AudioObjectIsPropertySettable(), and
  809. AudioObjectGetPropertyDataSize().
  810. @param inDevice
  811. The AudioDevice to query.
  812. @param inChannel
  813. The channel of the property to query where 0 is the master channel.
  814. @param isInput
  815. Which section of the AudioDevice to query.
  816. @param inPropertyID
  817. The AudioDevicePropertyID of the property to query.
  818. @param outSize
  819. A pointer to a UInt32 that receives the size of the property data in bytes
  820. on exit. This can be NULL if the size information is not being requested.
  821. @param outWritable
  822. A pointer to a Boolean that receives indication of whether or not the given
  823. property can be set. This can be NULL if the writability is not being
  824. requested.
  825. @result An OSStatus indicating success or failure.
  826. }
  827. function AudioDeviceGetPropertyInfo( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; outSize: {can be NULL} UInt32Ptr; outWritable: {can be NULL} BooleanPtr ): OSStatus; external name '_AudioDeviceGetPropertyInfo';
  828. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  829. {!
  830. @function AudioDeviceGetProperty
  831. @abstract Queries an the AudioDevice object to get the data of the given property and
  832. places it in the provided buffer.
  833. @discussion Note that the same functionality is provided by the function
  834. AudioObjectGetPropertyData().
  835. @param inDevice
  836. The AudioDevice to query.
  837. @param inChannel
  838. The channel of the property to query where 0 is the master channel.
  839. @param isInput
  840. Which section of the AudioDevice to query.
  841. @param inPropertyID
  842. The AudioDevicePropertyID of the property to query.
  843. @param ioPropertyDataSize
  844. A UInt32 which on entry indicates the size of the buffer pointed to by
  845. outData and on exit indicates how much of the buffer was used.
  846. @param outPropertyData
  847. The buffer into which the object will put the data for the given property.
  848. @result An OSStatus indicating success or failure.
  849. }
  850. function AudioDeviceGetProperty( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; var ioPropertyDataSize: UInt32; outPropertyData: UnivPtr ): OSStatus; external name '_AudioDeviceGetProperty';
  851. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  852. {!
  853. @function AudioDeviceSetProperty
  854. @abstract Tells the AudioDevice object to change the value of the given property using the
  855. provided data.
  856. @discussion Note that the value of the property should not be considered changed until the
  857. HAL has called the listeners as many properties values are changed
  858. asynchronously. Also note that the same functionality is provided by the
  859. function AudioObjectSetPropertyData().
  860. @param inDevice
  861. The AudioDevice to change.
  862. @param inWhen
  863. A pointer to an AudioTimeStamp that says when to change the property's value
  864. relative to the device's time base. NULL means execute the change
  865. immediately.
  866. @param inChannel
  867. The channel of the property to change where 0 is the master channel.
  868. @param isInput
  869. Which section of the AudioDevice to change.
  870. @param inPropertyID
  871. The AudioDevicePropertyID of the property to change.
  872. @param inPropertyDataSize
  873. A UInt32 indicating the size of the buffer pointed to by inData.
  874. @param inPropertyData
  875. The buffer containing the data to be used to change the property's value.
  876. @result An OSStatus indicating success or failure.
  877. }
  878. function AudioDeviceSetProperty( inDevice: AudioDeviceID; {const} inWhen: {can be NULL} AudioTimeStampPtr; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; inPropertyDataSize: UInt32; inPropertyData: {const} UnivPtr ): OSStatus; external name '_AudioDeviceSetProperty';
  879. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  880. {!
  881. @function AudioDeviceAddPropertyListener
  882. @abstract Registers the given AudioDevicePropertyListenerProc to receive notifications
  883. when the given property changes.
  884. @discussion Note that the same functionality is provided by AudioObjectAddPropertyListener
  885. in conjunction with AudioObjectPropertyListenerProc.
  886. @param inDevice
  887. The AudioDevice with whom to register the listener.
  888. @param inChannel
  889. The channel of the property to listen to.
  890. @param isInput
  891. Which section of the AudioDevice to listen to.
  892. @param inPropertyID
  893. The AudioDevicePropertyID of the property to listen to.
  894. @param inProc
  895. AudioDevicePropertyListenerProc to call.
  896. @param inClientData
  897. A pointer to client data that is passed to the listener when it is called.
  898. @result An OSStatus indicating success or failure.
  899. }
  900. function AudioDeviceAddPropertyListener( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; inProc: AudioDevicePropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioDeviceAddPropertyListener';
  901. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  902. {!
  903. @function AudioDeviceRemovePropertyListener
  904. @abstract Unregisters the given AudioDevicePropertyListenerProc from receiving
  905. notifications when the given property changes.
  906. @discussion Note that the same functionality is provided by
  907. AudioObjectRemovePropertyListener in conjunction with
  908. AudioObjectPropertyListenerProc.
  909. @param inDevice
  910. The AudioDevice with whom to unregister the listener.
  911. @param inChannel
  912. The channel of the property to unregister from.
  913. @param isInput
  914. Which section of the AudioDevice to unregister from.
  915. @param inPropertyID
  916. The AudioDevicePropertyID of the property to stop listening to.
  917. @param inProc
  918. AudioDevicePropertyListenerProc to unregister.
  919. @result An OSStatus indicating success or failure.
  920. }
  921. function AudioDeviceRemovePropertyListener( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; inProc: AudioDevicePropertyListenerProc ): OSStatus; external name '_AudioDeviceRemovePropertyListener';
  922. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  923. //==================================================================================================
  924. //#pragma mark -
  925. //#pragma mark AudioStream Types
  926. {!
  927. @typedef AudioStreamID
  928. @abstract AudioStream is the base class for all objects that represent a stream of data on
  929. an audio device.
  930. @discussion AudioStream is a subclass of AudioObject and can contain AudioControls.
  931. }
  932. type
  933. AudioStreamID = AudioObjectID;
  934. {!
  935. @typedef AudioStreamPropertyListenerProc
  936. @abstract Clients register an AudioStreamPropertyListenerProc with the AudioStream object
  937. in order to receive notifications when the properties of the object change.
  938. @discussion Note that the same functionality is provided by AudioObjectPropertyListenerProc.
  939. @param inStream
  940. The AudioStream whose property has changed.
  941. @param inChannel
  942. The channel of the property that changed where 0 is the master channel.
  943. @param inPropertyID
  944. The AudioDevicePropertyID of the property that changed.
  945. @param inClientData
  946. A pointer to client data established when the listener proc was registered
  947. with the object.
  948. @result The return value is currently unused and should always be 0.
  949. }
  950. type
  951. AudioStreamPropertyListenerProc = function( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; inClientData: UnivPtr ): OSStatus;
  952. //==================================================================================================
  953. //#pragma mark AudioStream Constants
  954. {!
  955. @enum AudioStream Class Constants
  956. @abstract Various constants related to AudioStreams.
  957. @constant kAudioStreamUnknown
  958. The AudioObjectID for a nonexistent AudioObject.
  959. }
  960. const
  961. kAudioStreamUnknown = kAudioObjectUnknown;
  962. //==================================================================================================
  963. //#pragma mark AudioStream Properties
  964. {!
  965. @enum AudioStream Properties That Ought To Some Day Be Deprecated
  966. @abstract AudioObjectPropertySelector values whose functionality is better provided by
  967. other selectors.
  968. @discussion These selectors are still provided for backward compatibility. The description
  969. of the property will indicate in parentheses the better selectors to use and
  970. why.
  971. @constant kAudioStreamPropertyOwningDevice
  972. The AudioObjectID of the AudioDevice of which this AudioStream is a part.
  973. (kAudioObjectPropertyOwner: This is just another name for the inherited
  974. selector.)
  975. @constant kAudioStreamPropertyPhysicalFormats
  976. An array of AudioStreamBasicDescriptions that describe the available data
  977. formats for the AudioStream. The physical format refers to the data format
  978. in which the hardware for the owning AudioDevice performs it's IO
  979. transactions.
  980. (kAudioStreamPropertyAvailablePhysicalFormats: The new name for this
  981. property is much clearer for readers of the API to see what is meant and the
  982. AudioStreamRangedDescription structure provides better information.)
  983. @constant kAudioStreamPropertyPhysicalFormatSupported
  984. An AudioStreamBasicDescription is passed in to query whether or not the
  985. format is supported. A kAudioDeviceUnsupportedFormatError will be returned
  986. if the format is not supported and kAudioHardwareNoError will be returned if
  987. it is supported. AudioStreamBasicDescription fields set to 0 will be ignored
  988. in the query, but otherwise values must match exactly. The physical format
  989. refers to the data format in which the hardware for the owning AudioDevice
  990. performs it's IO transactions.
  991. (kAudioStreamPropertyAvailablePhysicalFormats: The proper and most robust
  992. way to find a format that the AudioStream can support is to get the list of
  993. available formats and look through that rather than using this property.)
  994. @constant kAudioStreamPropertyPhysicalFormatMatch
  995. An AudioStreamBasicDescription is passed in and the AudioStream will modify
  996. it to describe the best match, in the AudioDevice's opinion, for the given
  997. format. The physical format refers to the data format in which the hardware
  998. for the owning AudioDevice performs it's IO transactions.
  999. (kAudioStreamPropertyAvailablePhysicalFormats: The proper and most robust
  1000. way to find a format that the AudioStream can support is to get the list of
  1001. available formats and look through that rather than using this property.)
  1002. }
  1003. const
  1004. kAudioStreamPropertyOwningDevice = kAudioObjectPropertyOwner;
  1005. kAudioStreamPropertyPhysicalFormats = FourCharCode('pft#');
  1006. kAudioStreamPropertyPhysicalFormatSupported = FourCharCode('pft?');
  1007. kAudioStreamPropertyPhysicalFormatMatch = FourCharCode('pftm');
  1008. //==================================================================================================
  1009. //#pragma mark AudioStream Functions
  1010. {!
  1011. @functiongroup AudioStream
  1012. }
  1013. {!
  1014. @function AudioStreamGetPropertyInfo
  1015. @abstract Retrieve information about the given property of an AudioStream.
  1016. @param inStream
  1017. The AudioStream to query.
  1018. @param inChannel
  1019. The channel of the property to query where 0 is the master channel.
  1020. @param inPropertyID
  1021. The AudioDevicePropertyID of the property to query.
  1022. @param outSize
  1023. A pointer to a UInt32 that receives the size of the property data in bytes
  1024. on exit. This can be NULL if the size information is not being requested.
  1025. @param outWritable
  1026. A pointer to a Boolean that receives indication of whether or not the given
  1027. property can be set. This can be NULL if the writability is not being
  1028. requested.
  1029. @result An OSStatus indicating success or failure.
  1030. }
  1031. function AudioStreamGetPropertyInfo( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; outSize: {can be NULL} UInt32Ptr; outWritable: {can be NULL} BooleanPtr ): OSStatus; external name '_AudioStreamGetPropertyInfo';
  1032. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  1033. {!
  1034. @function AudioStreamGetProperty
  1035. @abstract Queries an the AudioStream object to get the data of the given property and
  1036. places it in the provided buffer.
  1037. @discussion Note that the same functionality is provided by the function
  1038. AudioObjectGetPropertyData().
  1039. @param inStream
  1040. The AudioStream to query.
  1041. @param inChannel
  1042. The channel of the property to query where 0 is the master channel.
  1043. @param inPropertyID
  1044. The AudioDevicePropertyID of the property to query.
  1045. @param ioPropertyDataSize
  1046. A UInt32 which on entry indicates the size of the buffer pointed to by
  1047. outData and on exit indicates how much of the buffer was used.
  1048. @param outPropertyData
  1049. The buffer into which the object will put the data for the given property.
  1050. @result An OSStatus indicating success or failure.
  1051. }
  1052. function AudioStreamGetProperty( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; var ioPropertyDataSize: UInt32; outPropertyData: UnivPtr ): OSStatus; external name '_AudioStreamGetProperty';
  1053. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  1054. {!
  1055. @function AudioStreamSetProperty
  1056. @abstract Tells the AudioStream object to change the value of the given property using the
  1057. provided data.
  1058. @discussion Note that the value of the property should not be considered changed until the
  1059. HAL has called the listeners as many properties values are changed
  1060. asynchronously. Also note that the same functionality is provided by the
  1061. function AudioObjectSetPropertyData().
  1062. @param inStream
  1063. The AudioStream to change.
  1064. @param inWhen
  1065. A pointer to an AudioTimeStamp that says when to change the property's value
  1066. relative to the device's time base. NULL means execute the change
  1067. immediately.
  1068. @param inChannel
  1069. The channel of the property to change where 0 is the master channel.
  1070. @param inPropertyID
  1071. The AudioDevicePropertyID of the property to change.
  1072. @param inPropertyDataSize
  1073. A UInt32 indicating the size of the buffer pointed to by inData.
  1074. @param inPropertyData
  1075. The buffer containing the data to be used to change the property's value.
  1076. @result An OSStatus indicating success or failure.
  1077. }
  1078. function AudioStreamSetProperty( inStream: AudioStreamID; {const} inWhen: {can be NULL} AudioTimeStampPtr; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; inPropertyDataSize: UInt32; inPropertyData: {const} UnivPtr ): OSStatus; external name '_AudioStreamSetProperty';
  1079. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  1080. {!
  1081. @function AudioStreamAddPropertyListener
  1082. @abstract Registers the given AudioStreamPropertyListenerProc to receive notifications
  1083. when the given property changes.
  1084. @discussion Note that the same functionality is provided by AudioObjectAddPropertyListener
  1085. in conjunction with AudioObjectPropertyListenerProc.
  1086. @param inStream
  1087. The AudioStream with whom to register the listener.
  1088. @param inChannel
  1089. The channel of the property to listen to.
  1090. @param inPropertyID
  1091. The AudioDevicePropertyID of the property to listen to.
  1092. @param inProc
  1093. AudioStreamPropertyListenerProc to call.
  1094. @param inClientData
  1095. A pointer to client data that is passed to the listener when it is called.
  1096. @result An OSStatus indicating success or failure.
  1097. }
  1098. function AudioStreamAddPropertyListener( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; inProc: AudioStreamPropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioStreamAddPropertyListener';
  1099. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  1100. {!
  1101. @function AudioStreamRemovePropertyListener
  1102. @abstract Unregisters the given AudioStreamPropertyListenerProc from receiving
  1103. notifications when the given property changes.
  1104. @discussion Note that the same functionality is provided by
  1105. AudioObjectRemovePropertyListener in conjunction with
  1106. AudioObjectPropertyListenerProc.
  1107. @param inStream
  1108. The AudioStream with whom to unregister the listener.
  1109. @param inChannel
  1110. The channel of the property to unregister from.
  1111. @param inPropertyID
  1112. The AudioDevicePropertyID of the property to stop listening to.
  1113. @param inProc
  1114. AudioStreamPropertyListenerProc to unregister.
  1115. @result An OSStatus indicating success or failure.
  1116. }
  1117. function AudioStreamRemovePropertyListener( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; inProc: AudioStreamPropertyListenerProc ): OSStatus; external name '_AudioStreamRemovePropertyListener';
  1118. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) *)
  1119. //==================================================================================================
  1120. //#pragma mark -
  1121. //#pragma mark AudioControl Constants
  1122. {!
  1123. @enum AudioControl Base Class IDs
  1124. @abstract The AudioClassIDs that identify the various AudioControl base classes.
  1125. @constant kAudioBootChimeVolumeControlClassID
  1126. An AudioLevelControl for the boot chime of the CPU.
  1127. }
  1128. const
  1129. kAudioBootChimeVolumeControlClassID = FourCharCode('pram');
  1130. //==================================================================================================
  1131. //#pragma mark AudioControl Properties
  1132. {!
  1133. @enum AudioControl Properties
  1134. @abstract AudioObjectPropertySelector values that apply to all AudioControls.
  1135. @discussion AudioControl is a subclass of AudioObject and has only the single scope,
  1136. kAudioObjectPropertyScopeGlobal, and only a master element.
  1137. @constant kAudioControlPropertyVariant
  1138. A UInt32 that identifies the specific variant of an AudioControl. This
  1139. allows the owning AudioObject to support controls that are of the same basic
  1140. class (that is, the values of kAudioObjectPropertyClass are the same) but
  1141. may control a part of the object for which the standard controls do not
  1142. control.
  1143. }
  1144. const
  1145. kAudioControlPropertyVariant = FourCharCode('cvar');
  1146. {!
  1147. @enum AudioClockSourceControl Properties
  1148. @abstract AudioObjectPropertySelector values that apply only to AudioClockSourceControls.
  1149. @discussion These properties supplement the regular AudioSelectorControl Properties.
  1150. @constant kAudioClockSourceControlPropertyItemKind
  1151. This property returns a UInt32 that identifies the kind of clock source
  1152. the item ID refers to. The qualifier contains the ID of the item. Note that
  1153. this property is a synonym for kAudioSelectorControlPropertyItemKind.
  1154. }
  1155. const
  1156. kAudioClockSourceControlPropertyItemKind = kAudioSelectorControlPropertyItemKind;
  1157. //==================================================================================================
  1158. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1159. end.
  1160. {$endc} {not MACOSALLINCLUDE}