AudioHardwareDeprecated.pas 71 KB

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