AudioHardware.pas 162 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671
  1. {==================================================================================================
  2. File: CoreAudio/AudioHardware.h
  3. Contains: API for communicating with audio hardware.
  4. Version: Technology: Mac OS X
  5. Release: Mac OS X
  6. Copyright: (c) 1985-2005 by Apple Computer, Inc., all rights reserved.
  7. ==================================================================================================}
  8. { Pascal Translation: Gale R Paeper, <[email protected]>, 2006 }
  9. {
  10. Modified for use with Free Pascal
  11. Version 200
  12. Please report any bugs to <[email protected]>
  13. }
  14. {$mode macpas}
  15. {$packenum 1}
  16. {$macro on}
  17. {$inline on}
  18. {$CALLING MWPASCAL}
  19. unit AudioHardware;
  20. interface
  21. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  22. {$setc GAP_INTERFACES_VERSION := $0200}
  23. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  24. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  25. {$endc}
  26. {$ifc defined CPUPOWERPC and defined CPUI386}
  27. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  28. {$endc}
  29. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  30. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  31. {$endc}
  32. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  33. {$setc __ppc__ := 1}
  34. {$elsec}
  35. {$setc __ppc__ := 0}
  36. {$endc}
  37. {$ifc not defined __i386__ and defined CPUI386}
  38. {$setc __i386__ := 1}
  39. {$elsec}
  40. {$setc __i386__ := 0}
  41. {$endc}
  42. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  43. {$error Conflicting definitions for __ppc__ and __i386__}
  44. {$endc}
  45. {$ifc defined __ppc__ and __ppc__}
  46. {$setc TARGET_CPU_PPC := TRUE}
  47. {$setc TARGET_CPU_X86 := FALSE}
  48. {$elifc defined __i386__ and __i386__}
  49. {$setc TARGET_CPU_PPC := FALSE}
  50. {$setc TARGET_CPU_X86 := TRUE}
  51. {$elsec}
  52. {$error Neither __ppc__ nor __i386__ is defined.}
  53. {$endc}
  54. {$setc TARGET_CPU_PPC_64 := FALSE}
  55. {$ifc defined FPC_BIG_ENDIAN}
  56. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  57. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  58. {$elifc defined FPC_LITTLE_ENDIAN}
  59. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  60. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  61. {$elsec}
  62. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  63. {$endc}
  64. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  65. {$setc CALL_NOT_IN_CARBON := FALSE}
  66. {$setc OLDROUTINENAMES := FALSE}
  67. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  68. {$setc OPAQUE_UPP_TYPES := TRUE}
  69. {$setc OTCARBONAPPLICATION := TRUE}
  70. {$setc OTKERNEL := FALSE}
  71. {$setc PM_USE_SESSION_APIS := TRUE}
  72. {$setc TARGET_API_MAC_CARBON := TRUE}
  73. {$setc TARGET_API_MAC_OS8 := FALSE}
  74. {$setc TARGET_API_MAC_OSX := TRUE}
  75. {$setc TARGET_CARBON := TRUE}
  76. {$setc TARGET_CPU_68K := FALSE}
  77. {$setc TARGET_CPU_MIPS := FALSE}
  78. {$setc TARGET_CPU_SPARC := FALSE}
  79. {$setc TARGET_OS_MAC := TRUE}
  80. {$setc TARGET_OS_UNIX := FALSE}
  81. {$setc TARGET_OS_WIN32 := FALSE}
  82. {$setc TARGET_RT_MAC_68881 := FALSE}
  83. {$setc TARGET_RT_MAC_CFM := FALSE}
  84. {$setc TARGET_RT_MAC_MACHO := TRUE}
  85. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  86. {$setc TYPE_BOOL := FALSE}
  87. {$setc TYPE_EXTENDED := FALSE}
  88. {$setc TYPE_LONGLONG := TRUE}
  89. uses MacTypes, CFRunLoop, CoreAudioTypes;
  90. {$ALIGN POWER}
  91. //==================================================================================================
  92. //#pragma mark Overview
  93. {!
  94. @header AudioHardware
  95. The audio HAL provides an abstraction through which applications can access audio hardware. To
  96. do this, the HAL provides a small set of AudioObjects that provide access to the various pieces
  97. of the system.
  98. AudioObjects all have a set of properties that describe and manipulate their state. A property
  99. is accessed via an ordered triple. The first ordinate is the selector which describes the
  100. property. The other two ordinates are the scope and element that identify the particular part of
  101. the object in which to look for the selector. The AudioObjectPropertyAddress structure
  102. encapsulates the property address. The value of a property is an untyped block of data whose
  103. content depends on the specifics of the selector. Some selectors also require the use of a
  104. qualifier when querying. The qualifier allows for additional information to be provided to be
  105. used in the manipulation of the property. Changing the value of a property is always considered
  106. asynchronous.
  107. Applications use the routines AudioObjectHasProperty(), AudioObjectIsPropertySettable() and
  108. AudioObjectGetPropertyDataSize() to find useful meta-information about the property. Apps use
  109. AudioObjectGetPropertyData() and AudioObjectSetPropertyData() to manipulate the value of the
  110. property. Apps use AudioObjectAddPropertyListener() and AudioObjectRemovePropertyListener() to
  111. register/unregister a function that is to be called when a given property's value changes.
  112. The class of an AudioObject determines the basic functionality of the object in terms of what
  113. functions will operate on it as well as the set of properties that can be expected to be
  114. implemented by the object. The set of available classes for objects is limited to those defined
  115. here. There are no other classes. The set of classes is arranged in a hierarchy such that one
  116. class inherits the properties/routines of it's super class.
  117. The base class for all AudioObjects is the class AudioObject. As such, each AudioObject will
  118. provide basic properties such as it's class, it's human readable name, and the other
  119. AudioObjects it contains. Other important classes include AudioSystemObject, AudioDevice, and
  120. AudioStream.
  121. The AudioObjects in the HAL are arranged in a containment hierarchy. The root of the hierarchy
  122. is the one and only instance of the AudioSystemObject class. The properties of the
  123. AudioSystemObject describe the process global settings such as the various default devices and
  124. the notification run loop. The AudioSystemObject also contains all the AudioDevices that are
  125. available.
  126. Instances of the AudioDevice class encapsulate individual audio devices. An AudioDevice serves
  127. as the basic unit of IO. It provides a single IO cycle, a timing source based on it, and all the
  128. buffers synchronized to it. The IO cycle presents all the synchronized buffers to the client in
  129. the same call out along with time stamps that specify the current time, when the input data was
  130. acquired and when the output data will be presented.
  131. AudioDevices contain instances of the AudioStream class. An AudioStream represents a single
  132. buffer of data for transferring across the user/kernel boundary. As such, AudioStreams are the
  133. gatekeepers of format information. Each has it's own format and list of available formats.
  134. AudioStreams can provide data in any format, including encoded formats and non-audio formats. If
  135. the format is a linear PCM format, the data will always be presented as 32 bit, native endian
  136. floating point. All conversions to and from the true physical format of the hardware is handled
  137. by the device's driver.
  138. Both AudioDevices and AudioStreams can contain instances of the AudioControl class or it's many
  139. subclasses. An AudioControl provides properties that describe/manipulate a particular aspect of
  140. the object such as gain, mute, data source selection, etc. Many common controls are also
  141. also available as properties on the AudioDevice or AudioStream.
  142. }
  143. //==================================================================================================
  144. //#pragma mark Error Constants
  145. {!
  146. @enum Error Constants
  147. @abstract The error constants unique to the HAL.
  148. @discussion These are the error constants that are unique to the HAL. Note that the HAL's
  149. functions can and will return other codes that are not listed here. While these
  150. constants give a general idea of what might have gone wrong during the execution
  151. of an API call, if an API call returns anything other than kAudioHardwareNoError
  152. it is to be viewed as the same failure regardless of what constant is actually
  153. returned.
  154. @constant kAudioHardwareNoError
  155. The function call completed successfully.
  156. @constant kAudioHardwareNotRunningError
  157. The function call requires that the hardware be running but it isn't.
  158. @constant kAudioHardwareUnspecifiedError
  159. The function call failed while doing something that doesn't provide any
  160. error messages.
  161. @constant kAudioHardwareUnknownPropertyError
  162. The AudioObject doesn't know about the property at the given address.
  163. @constant kAudioHardwareBadPropertySizeError
  164. An improperly sized buffer was provided when accessing the data of a
  165. property.
  166. @constant kAudioHardwareIllegalOperationError
  167. The requested operation couldn't be completed.
  168. @constant kAudioHardwareBadObjectError
  169. The AudioObjectID passed to the function doesn't map to a valid AudioObject.
  170. @constant kAudioHardwareBadDeviceError
  171. The AudioDeviceID passed to the function doesn't map to a valid AudioDevice.
  172. @constant kAudioHardwareBadStreamError
  173. The AudioStreamID passed to the function doesn't map to a valid AudioStream.
  174. @constant kAudioHardwareUnsupportedOperationError
  175. The AudioObject doesn't support the requested operation.
  176. @constant kAudioDeviceUnsupportedFormatError
  177. The AudioStream doesn't support the requested format.
  178. @constant kAudioDevicePermissionsError
  179. The requested operation can't be completed because the process doesn't have
  180. permission.
  181. }
  182. const
  183. kAudioHardwareNoError = 0;
  184. kAudioHardwareNotRunningError = $73746F70 (* 'stop' *);
  185. kAudioHardwareUnspecifiedError = $77686174 (* 'what' *);
  186. kAudioHardwareUnknownPropertyError = $77686F3F (* 'who?' *);
  187. kAudioHardwareBadPropertySizeError = $2173697A (* '!siz' *);
  188. kAudioHardwareIllegalOperationError = $6E6F7065 (* 'nope' *);
  189. kAudioHardwareBadObjectError = $216F626A (* '!obj' *);
  190. kAudioHardwareBadDeviceError = $21646576 (* '!dev' *);
  191. kAudioHardwareBadStreamError = $21737472 (* '!str' *);
  192. kAudioHardwareUnsupportedOperationError = $756E6F70 (* 'unop' *);
  193. kAudioDeviceUnsupportedFormatError = $21646174 (* '!dat' *);
  194. kAudioDevicePermissionsError = $21686F67 (* '!hog' *);
  195. //==================================================================================================
  196. //#pragma mark Property Support Types
  197. {!
  198. @typedef AudioObjectPropertySelector
  199. @abstract An AudioObjectPropertySelector is a four char code that identifies, along with
  200. the AudioObjectPropertyScope and AudioObjectPropertyElement, a specific piece of
  201. information about an AudioObject.
  202. @discussion The property selector specifies the general classification of the property such
  203. as volume, stream format, latency, etc. Note that each class has a different set
  204. of selectors. A subclass inherits it's super class's set of selectors, although
  205. it may not implement them all.
  206. }
  207. type
  208. AudioObjectPropertySelector = UInt32;
  209. {!
  210. @typedef AudioObjectPropertyScope
  211. @abstract An AudioObjectPropertyScope is a four char code that identifies, along with the
  212. AudioObjectPropertySelector and AudioObjectPropertyElement, a specific piece of
  213. information about an AudioObject.
  214. @discussion The scope specifies the section of the object in which to look for the property,
  215. such as input, output, global, etc. Note that each class has a different set of
  216. scopes. A subclass inherits it's superclass's set of scopes.
  217. }
  218. type
  219. AudioObjectPropertyScope = UInt32;
  220. {!
  221. @typedef AudioObjectPropertyElement
  222. @abstract An AudioObjectPropertyElement is an integer that identifies, along with the
  223. AudioObjectPropertySelector and AudioObjectPropertyScope, a specific piece of
  224. information about an AudioObject.
  225. @discussion The element selects one of possibly many items in the section of the object in
  226. which to look for the property. Elements are number sequentially where 0
  227. represents the master element. Elements are particular to an instance of a
  228. class, meaning that two instances can have different numbers of elements in the
  229. same scope. There is no inheritance of elements.
  230. }
  231. type
  232. AudioObjectPropertyElement = UInt32;
  233. {!
  234. @struct AudioObjectPropertyAddress
  235. @abstract An AudioObjectPropertyAddress collects the three parts that identify a specific
  236. property together in a struct for easy transmission.
  237. @field mSelector
  238. The AudioObjectPropertySelector for the property.
  239. @field mScope
  240. The AudioObjectPropertyScope for the property.
  241. @field mElement
  242. The AudioObjectPropertyElement for the property.
  243. }
  244. type
  245. AudioObjectPropertyAddress = record
  246. mSelector: AudioObjectPropertySelector;
  247. mScope: AudioObjectPropertyScope;
  248. mElement: AudioObjectPropertyElement;
  249. end;
  250. AudioObjectPropertyAddressPtr = ^AudioObjectPropertyAddress;
  251. //==================================================================================================
  252. //#pragma mark Property Support Constants
  253. {!
  254. @enum Property Wildcard Constants
  255. @abstract Constants that are used as wildcards in an AudioObjectPropertyAddress.
  256. @discussion Wildcards match any and all values for there associated type. They are
  257. especially useful for registering listener procs to receive notifications and
  258. for querying an AudioObject's list of AudioControls.
  259. @constant kAudioObjectPropertySelectorWildcard
  260. The wildcard value for AudioObjectPropertySelectors.
  261. @constant kAudioObjectPropertyScopeWildcard
  262. The wildcard value for AudioObjectPropertyScopes.
  263. @constant kAudioObjectPropertyElementWildcard
  264. The wildcard value for AudioObjectPropertyElements.
  265. @constant kAudioPropertyWildcardPropertyID
  266. A synonym for kAudioObjectPropertySelectorWildcard.
  267. @constant kAudioPropertyWildcardSection
  268. The wildcard value for the isInput argument of AudioDeviceGetPropertyInfo(),
  269. AudioDeviceGetProperty(), and AudioDeviceSetProperty().
  270. @constant kAudioPropertyWildcardChannel
  271. A synonym for kAudioObjectPropertyElementWildcard.
  272. }
  273. const
  274. kAudioObjectPropertySelectorWildcard = $2A2A2A2A (* '****' *);
  275. kAudioObjectPropertyScopeWildcard = $2A2A2A2A (* '****' *);
  276. kAudioObjectPropertyElementWildcard = $FFFFFFFF;
  277. kAudioPropertyWildcardPropertyID = kAudioObjectPropertySelectorWildcard;
  278. kAudioPropertyWildcardSection = $FF;
  279. kAudioPropertyWildcardChannel = kAudioObjectPropertyElementWildcard;
  280. //==================================================================================================
  281. //#pragma mark AudioObject Types
  282. {!
  283. @typedef AudioClassID
  284. @abstract AudioClassIDs are used to identify the class of an AudioObject.
  285. }
  286. type
  287. AudioClassID = UInt32;
  288. {!
  289. @typedef AudioObjectID
  290. @abstract AudioObject is the base class for all the objects in the HAL.
  291. @discussion AudioObjects have properties and can contain other AudioObjects.
  292. }
  293. type
  294. AudioObjectID = UInt32;
  295. {!
  296. @typedef AudioObjectPropertyListenerProc
  297. @abstract Clients register an AudioObjectPropertyListenerProc with an AudioObject in order
  298. to receive notifications when the properties of the object change.
  299. @discussion Listeners will be called when possibly many properties have changed.
  300. Consequently, the implementation of a listener must go through the array of
  301. addresses to see what exactly has changed. Note that the array of addresses will
  302. always have at least one address in it for which the listener is signed up to
  303. receive notifications about but may contain addresses for properties for which
  304. the listener is not signed up to receive notifications.
  305. @param inObjectID
  306. The AudioObject whose properties have changed.
  307. @param inNumberAddresses
  308. The number of elements in the inAddresses array.
  309. @param inAddresses
  310. An array of AudioObjectPropertyAddresses indicating which properties
  311. changed.
  312. @param inClientData
  313. A pointer to client data established when the listener proc was registered
  314. with the AudioObject.
  315. @result The return value is currently unused and should always be 0.
  316. }
  317. type
  318. AudioObjectPropertyListenerProc = function( inObjectID: AudioObjectID; inNumberAddresses: UInt32; {const} inAddresses: {variable-size-array} AudioObjectPropertyAddressPtr; inClientData: UnivPtr ): OSStatus;
  319. //==================================================================================================
  320. //#pragma mark AudioObject Constants
  321. {!
  322. @enum AudioObject Class Constants
  323. @abstract Various constants related to AudioObjects.
  324. @constant kAudioObjectPropertyScopeGlobal
  325. The AudioObjectPropertyScope for properties that apply to the object as a
  326. whole. All AudioObjects have a global scope and for some it is their only
  327. scope.
  328. @constant kAudioObjectPropertyElementMaster
  329. The AudioObjectPropertyElement value for properties that apply to the master
  330. element or to the entire scope.
  331. @constant kAudioObjectClassID
  332. The AudioClassID that identifies the AudioObject class.
  333. @constant kAudioObjectClassIDWildcard
  334. The wildcard value for AudioClassIDs.
  335. @constant kAudioObjectUnknown
  336. The AudioObjectID for a non-existant AudioObject.
  337. }
  338. const
  339. kAudioObjectPropertyScopeGlobal = $676C6F62 (* 'glob' *);
  340. kAudioObjectPropertyElementMaster = 0;
  341. kAudioObjectClassID = $616F626A (* 'aobj' *);
  342. kAudioObjectClassIDWildcard = $2A2A2A2A (* '****' *);
  343. kAudioObjectUnknown = 0;
  344. //==================================================================================================
  345. //#pragma mark AudioObject Properties
  346. {!
  347. @enum AudioObject Property Selectors
  348. @abstract AudioObjectPropertySelector values that apply to all AudioObjects.
  349. @constant kAudioObjectPropertyClass
  350. An AudioClassID that identifies the class of the AudioObject.
  351. @constant kAudioObjectPropertyOwner
  352. An AudioObjectID that identifies the the AudioObject that owns the given
  353. AudioObject. Note that all AudioObjects are owned by some other AudioObject.
  354. The only exception is the AudioSystemObject, for which the value of this
  355. property is kAudioObjectUnknown.
  356. @constant kAudioObjectPropertyCreator
  357. A CFString that contains the bundle ID of the plug-in that instantiated the
  358. object.
  359. @constant kAudioObjectPropertyObjectName
  360. A CFString that contains the human readable name of the object. The caller
  361. is responsible for releasing the returned CFObject.
  362. @constant kAudioObjectPropertyManufacturer
  363. A CFString that contains the human readable name of the manufacturer of the
  364. hardware the AudioObject is a part of. The caller is responsible for
  365. releasing the returned CFObject.
  366. @constant kAudioObjectPropertyElementName
  367. A CFString that contains a human readable name for the given element in the
  368. given scope. The caller is responsible for releasing the returned CFObject.
  369. @constant kAudioObjectPropertyElementCategoryName
  370. A CFString that contains a human readable name for the category of the given
  371. element in the given scope. The caller is responsible for releasing the
  372. returned CFObject.
  373. @constant kAudioObjectPropertyElementNumberName
  374. A CFString that contains a human readable name for the number of the given
  375. element in the given scope. The caller is responsible for releasing the
  376. returned CFObject.
  377. @constant kAudioObjectPropertyOwnedObjects
  378. An array of AudioObjectIDs that represent all the AudioObjects owned by the
  379. given object. The qualifier is an array of AudioClassIDs. If it is
  380. non-empty, the returned array of AudioObjectIDs will only refer to objects
  381. whose class is in the qualifier array or whose is a subclass of one in the
  382. qualifier array.
  383. @constant kAudioObjectPropertyListenerAdded
  384. An AudioObjectPropertyAddress indicating the address to which a new listener
  385. was added. Note that this property is not for applications to use. Rather,
  386. this property is for the HAL shell to notify AudioObjects implemented by an
  387. AudioPlugIn when a listener is added.
  388. @constant kAudioObjectPropertyListenerRemoved
  389. An AudioObjectPropertyAddress indicating the address to which a listener was
  390. removed. Note that this property is not for applications to use. Rather,
  391. this property is for the HAL shell to notify AudioObjects implemented by an
  392. AudioPlugIn when a listener is removed.
  393. }
  394. const
  395. kAudioObjectPropertyClass = $636C6173 (* 'clas' *);
  396. kAudioObjectPropertyOwner = $73746476 (* 'stdv' *);
  397. kAudioObjectPropertyCreator = $6F706C67 (* 'oplg' *);
  398. kAudioObjectPropertyName = $6C6E616D (* 'lnam' *);
  399. kAudioObjectPropertyManufacturer = $6C6D616B (* 'lmak' *);
  400. kAudioObjectPropertyElementName = $6C63686E (* 'lchn' *);
  401. kAudioObjectPropertyElementCategoryName = $6C63636E (* 'lccn' *);
  402. kAudioObjectPropertyElementNumberName = $6C636E6E (* 'lcnn' *);
  403. kAudioObjectPropertyOwnedObjects = $6F776E64 (* 'ownd' *);
  404. kAudioObjectPropertyListenerAdded = $6C697361 (* 'lisa' *);
  405. kAudioObjectPropertyListenerRemoved = $6C697372 (* 'lisr' *);
  406. //==================================================================================================
  407. //#pragma mark AudioObject Functions
  408. {!
  409. @functiongroup AudioObject
  410. }
  411. {!
  412. @function AudioObjectShow
  413. @abstract Prints to standard out a textural description of the AudioObject.
  414. @param inObjectID
  415. The AudioObject to show.
  416. }
  417. procedure AudioObjectShow( inObjectID: AudioObjectID ); external name '_AudioObjectShow';
  418. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  419. {!
  420. @function AudioObjectHasProperty
  421. @abstract Queries an AudioObject about whether or not it has the given property.
  422. @param inObjectID
  423. The AudioObject to query.
  424. @param inAddress
  425. An AudioObjectPropertyAddress indicating which property is being queried.
  426. @result A Boolean indicating whether or not the AudioObject has the given property.
  427. }
  428. function AudioObjectHasProperty( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress ): Boolean; external name '_AudioObjectHasProperty';
  429. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  430. {!
  431. @function AudioObjectIsPropertySettable
  432. @abstract Queries an AudioObject about whether or not the given property can be set using
  433. AudioObjectSetPropertyData.
  434. @param inObjectID
  435. The AudioObject to query.
  436. @param inAddress
  437. An AudioObjectPropertyAddress indicating which property is being queried.
  438. @param outIsSettable
  439. A Boolean indicating whether or not the property can be set.
  440. @result An OSStatus indicating success or failure.
  441. }
  442. function AudioObjectIsPropertySettable( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; var outIsSettable: Boolean ): OSStatus; external name '_AudioObjectIsPropertySettable';
  443. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  444. {!
  445. @function AudioObjectGetPropertyDataSize
  446. @abstract Queries an AudioObject to find the size of the data for the given property.
  447. @param inObjectID
  448. The AudioObject to query.
  449. @param inAddress
  450. An AudioObjectPropertyAddress indicating which property is being queried.
  451. @param inQualifierDataSize
  452. A UInt32 indicating the size of the buffer pointed to by inQualifierData.
  453. Note that not all properties require qualification, in which case this
  454. value will be 0.
  455. @param inQualifierData,
  456. A buffer of data to be used in determining the data of the property being
  457. queried. Note that not all properties require qualification, in which case
  458. this value will be NULL.
  459. @param outDataSize
  460. A UInt32 indicating how many bytes the data for the given property occupies.
  461. @result An OSStatus indicating success or failure.
  462. }
  463. function AudioObjectGetPropertyDataSize( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inQualifierDataSize: UInt32; inQualifierData: {const} UnivPtr; var outDataSize: UInt32 ): OSStatus; external name '_AudioObjectGetPropertyDataSize';
  464. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  465. {!
  466. @function AudioObjectGetPropertyData
  467. @abstract Queries an AudioObject to get the data of the given property and places it in
  468. the provided buffer.
  469. @param inObjectID
  470. The AudioObject to query.
  471. @param inAddress
  472. An AudioObjectPropertyAddress indicating which property is being queried.
  473. @param inQualifierDataSize
  474. A UInt32 indicating the size of the buffer pointed to by inQualifierData.
  475. Note that not all properties require qualification, in which case this
  476. value will be 0.
  477. @param inQualifierData,
  478. A buffer of data to be used in determining the data of the property being
  479. queried. Note that not all properties require qualification, in which case
  480. this value will be NULL.
  481. @param ioDataSize
  482. A UInt32 which on entry indicates the size of the buffer pointed to by
  483. outData and on exit indicates how much of the buffer was used.
  484. @param outData
  485. The buffer into which the AudioObject will put the data for the given
  486. property.
  487. @result An OSStatus indicating success or failure.
  488. }
  489. function AudioObjectGetPropertyData( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inQualifierDataSize: UInt32; inQualifierData: {const} UnivPtr; var ioDataSize: UInt32; outData: UnivPtr ): OSStatus; external name '_AudioObjectGetPropertyData';
  490. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  491. {!
  492. @function AudioObjectSetPropertyData
  493. @abstract Tells an AudioObject to change the value of the given property using the
  494. provided data.
  495. @discussion Note that the value of the property should not be considered changed until the
  496. HAL has called the listeners as many properties values are changed
  497. asynchronously.
  498. @param inObjectID
  499. The AudioObject to change.
  500. @param inAddress
  501. An AudioObjectPropertyAddress indicating which property is being changed.
  502. @param inQualifierDataSize
  503. A UInt32 indicating the size of the buffer pointed to by inQualifierData.
  504. Note that not all properties require qualification, in which case this
  505. value will be 0.
  506. @param inQualifierData,
  507. A buffer of data to be used in determining the data of the property being
  508. queried. Note that not all properties require qualification, in which case
  509. this value will be NULL.
  510. @param inDataSize
  511. A UInt32 indicating the size of the buffer pointed to by inData.
  512. @param inData
  513. The buffer containing the data to be used to change the property's value.
  514. @result An OSStatus indicating success or failure.
  515. }
  516. function AudioObjectSetPropertyData( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inQualifierDataSize: UInt32; inQualifierData: {const} UnivPtr; inDataSize: UInt32; inData: {const} UnivPtr ): OSStatus; external name '_AudioObjectSetPropertyData';
  517. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  518. {!
  519. @function AudioObjectAddPropertyListener
  520. @abstract Registers the given AudioObjectPropertyListenerProc to receive notifications
  521. when the given properties change.
  522. @param inObjectID
  523. The AudioObject to register the listener with.
  524. @param inAddress
  525. The AudioObjectPropertyAddresses indicating which property the listener
  526. should be notified about.
  527. @param inListener
  528. The AudioObjectPropertyListenerProc to call.
  529. @param inClientData
  530. A pointer to client data that is passed to the listener when it is called.
  531. @result An OSStatus indicating success or failure.
  532. }
  533. function AudioObjectAddPropertyListener( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inListener: AudioObjectPropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioObjectAddPropertyListener';
  534. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  535. {!
  536. @function AudioObjectRemovePropertyListener
  537. @abstract Unregisters the given AudioObjectPropertyListenerProc from receiving
  538. notifications when the given properties change.
  539. @param inObjectID
  540. The AudioObject to unregister the listener from.
  541. @param inNumberAddresses
  542. The number of elements in the inAddresses array.
  543. @param inAddresses
  544. The AudioObjectPropertyAddress indicating which property the listener should
  545. be removed from.
  546. @param inListener
  547. The AudioObjectPropertyListenerProc being removed.
  548. @param inClientData
  549. A pointer to client data that is passed to the listener when it is called.
  550. @result An OSStatus indicating success or failure.
  551. }
  552. function AudioObjectRemovePropertyListener( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inListener: AudioObjectPropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioObjectRemovePropertyListener';
  553. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  554. //==================================================================================================
  555. //#pragma mark AudioControl Constants
  556. {!
  557. @enum AudioControl Base Class IDs
  558. @abstract The AudioClassIDs that identify the various AudioControl base classes.
  559. @constant kAudioControlClassID
  560. The AudioClassID that identifies the AudioControl class.
  561. @constant kAudioLevelControlClassID
  562. The AudioClassID that identifies the AudioLevelControl class which is a
  563. subclass of AudioControl. AudioLevelControls manipulate gain/attenuation
  564. stages in the hardware.
  565. @constant kAudioBooleanControlClassID
  566. The AudioClassID that identifies the AudioBooleanControl class which is a
  567. subclass of AudioControl. AudioBooleanControls manipulate on/off switches
  568. in the hardware.
  569. @constant kAudioSelectorControlClassID
  570. The AudioClassID that identifies the AudioSelectorControl class which is a
  571. subclass of AudioControl. AudioSelectorControls manipulate controls that
  572. have multiple, but discreet values.
  573. @constant kAudioStereoPanControlClassID
  574. The AudioClassID that identifies the AudioStereoPanControl class which is
  575. a subclass of AudioControl. AudioStereoPanControls manipulate the pot for
  576. panning a mono signal between a left/right pair of outputs.
  577. }
  578. const
  579. kAudioControlClassID = $6163746C (* 'actl' *);
  580. kAudioLevelControlClassID = $6C65766C (* 'levl' *);
  581. kAudioBooleanControlClassID = $746F676C (* 'togl' *);
  582. kAudioSelectorControlClassID = $736C6374 (* 'slct' *);
  583. kAudioStereoPanControlClassID = $7370616E (* 'span' *);
  584. {!
  585. @enum AudioLevelControl Subclass IDs
  586. @abstract The four char codes that identify the various standard subclasses of
  587. AudioLevelControl.
  588. @constant kAudioVolumeControlClassID
  589. An AudioLevelControl for a general gain/attenuation stage.
  590. @constant kAudioLFEVolumeControlClassID
  591. An AudioLevelControl for an LFE channel that results from bass management
  592. such as the iSub. Note that LFE channels that are represented as normal
  593. audio channels (in other words, real data is being fed them in an IOProc)
  594. will use kAudioVolumeControlClassID to manipulate the level.
  595. @constant kAudioBootChimeVolumeControlClassID
  596. An AudioLevelControl for the boot chime of the CPU.
  597. }
  598. const
  599. kAudioVolumeControlClassID = $766C6D65 (* 'vlme' *);
  600. kAudioLFEVolumeControlClassID = $73756276 (* 'subv' *);
  601. kAudioBootChimeVolumeControlClassID = $7072616D (* 'pram' *);
  602. {!
  603. @enum AudioBooleanControl Subclass IDs
  604. @abstract The four char codes that identify the various standard subclasses of
  605. AudioBooleanControl.
  606. @constant kAudioMuteControlClassID
  607. An AudioBooleanControl where a true value means that mute is enabled making
  608. that element inaudible.
  609. @constant kAudioSoloControlClassID
  610. An AudioBooleanControl where a true value means that solo is enabled making
  611. just that element audible and the other elements inaudible.
  612. @constant kAudioJackControlClassID
  613. An AudioBooleanControl where a true value means something is plugged into
  614. that element.
  615. @constant kAudioLFEMuteControlClassID
  616. An AudioBooleanControl where true means that mute is enabled make that LFE
  617. element inaudible. This control is for LFE channels that result from bass
  618. management such as the iSub. Note that LFE channels that are represented as
  619. normal audio channels (in other words, real data is being fed them in an
  620. IOProc) will use kAudioVolumeControlClassID to manipulate mute.
  621. @constant kAudioISubOwnerClassID
  622. An AudioBooleanControl where true means that the AudioDevice that
  623. ultimately owns the control also owns any iSub attached to the CPU.
  624. }
  625. const
  626. kAudioMuteControlClassID = $6D757465 (* 'mute' *);
  627. kAudioSoloControlClassID = $736F6C6F (* 'solo' *);
  628. kAudioJackControlClassID = $6A61636B (* 'jack' *);
  629. kAudioLFEMuteControlClassID = $7375626D (* 'subm' *);
  630. kAudioISubOwnerControlClassID = $61746368 (* 'atch' *);
  631. {!
  632. @enum AudioSelectorControl Subclass IDs
  633. @abstract The four char codes that identify the various standard subclasses of
  634. AudioSelectorControl.
  635. @constant kAudioDataSourceControlClassID
  636. An AudioSelectorControl that identifies where the data for the element is
  637. coming from.
  638. @constant kAudioDataDestinationControlClassID
  639. An AudioSelectorControl that identifies where the data for the element is
  640. going.
  641. @constant kAudioClockSourceControlClassID
  642. An AudioSelectorControl that identifies where the timing info for the object
  643. is coming from.
  644. @constant kAudioLineLevelControlClassID
  645. An AudioSelectorControl that identifies the nominal line level for the
  646. element. Note that this is not a gain stage but rather indicating the
  647. voltage standard (if any) used for the element, such as +4dBu, -10dBV,
  648. instrument, etc.
  649. }
  650. const
  651. kAudioDataSourceControlClassID = $64737263 (* 'dsrc' *);
  652. kAudioDataDestinationControlClassID = $64657374 (* 'dest' *);
  653. kAudioClockSourceControlClassID = $636C636B (* 'clck' *);
  654. kAudioLineLevelControlClassID = $6E6C766C (* 'nlvl' *);
  655. //==================================================================================================
  656. //#pragma mark AudioControl Properties
  657. {!
  658. @enum AudioControl Properties
  659. @abstract AudioObjectPropertySelector values that apply to all AudioControls.
  660. @discussion AudioControl is a subclass of AudioObject and has only the single scope,
  661. kAudioObjectPropertyScopeGlobal, and only a master element.
  662. @constant kAudioControlPropertyScope
  663. The AudioObjectPropertyScope in the owning AudioObject that contains the
  664. AudioControl.
  665. @constant kAudioControlPropertyElement
  666. The AudioObjectPropertyElement in the owning AudioObject that contains the
  667. AudioControl.
  668. @constant kAudioControlPropertyVariant
  669. A UInt32 that identifies the specific variant of an AudioControl. This
  670. allows the owning AudioObject to support controls that are of the same basic
  671. class (that is, the values of kAudioObjectPropertyClass are the same) but
  672. may control a part of the object for which the standard controls do not
  673. control.
  674. }
  675. const
  676. kAudioControlPropertyScope = $63736370 (* 'cscp' *);
  677. kAudioControlPropertyElement = $63656C6D (* 'celm' *);
  678. kAudioControlPropertyVariant = $63766172 (* 'cvar' *);
  679. {!
  680. @enum AudioLevelControl Properties
  681. @abstract AudioObjectPropertySelector values that apply to all AudioLevelControls.
  682. @discussion AudioLevelControl is a subclass of AudioControl and has only the single scope,
  683. kAudioObjectPropertyScopeGlobal, and only a master element.
  684. @constant kAudioLevelControlPropertyScalarValue
  685. A Float32 that represents the value of the boot chime volume control. The
  686. range is between 0.0 and 1.0 (inclusive).
  687. @constant kAudioLevelControlPropertyDecibelValue
  688. A Float32 that represents the value of the boot chime volume control in dB.
  689. @constant kAudioLevelControlPropertyDecibelRange
  690. An AudioValueRange that contains the minimum and maximum dB values the
  691. boot chime control can have.
  692. @constant kAudioLevelControlPropertyConvertScalarToDecibels
  693. A Float32 that on input contains a scalar volume value for the boot chime
  694. and on exit contains the equivalent dB value.
  695. @constant kAudioLevelControlPropertyConvertDecibelsToScalar
  696. A Float32 that on input contains a dB volume value for the boot chime and on
  697. exit contains the equivalent scalar value.
  698. }
  699. const
  700. kAudioLevelControlPropertyScalarValue = $6C637376 (* 'lcsv' *);
  701. kAudioLevelControlPropertyDecibelValue = $6C636476 (* 'lcdv' *);
  702. kAudioLevelControlPropertyDecibelRange = $6C636472 (* 'lcdr' *);
  703. kAudioLevelControlPropertyConvertScalarToDecibels = $6C637364 (* 'lcsd' *);
  704. kAudioLevelControlPropertyConvertDecibelsToScalar = $6C636473 (* 'lcds' *);
  705. {!
  706. @enum AudioBooleanControl Properties
  707. @abstract AudioObjectPropertySelector values that apply to all AudioBooleanControls.
  708. @discussion AudioBooleanControl is a subclass of AudioControl and has only the single scope,
  709. kAudioObjectPropertyScopeGlobal, and only a master element.
  710. @constant kAudioBooleanControlPropertyValue
  711. A UInt32 where 0 means false and 1 means true.
  712. }
  713. const
  714. kAudioBooleanControlPropertyValue = $6263766C (* 'bcvl' *);
  715. {!
  716. @enum AudioSelectorControl Properties
  717. @abstract AudioObjectPropertySelector values that apply to all AudioSelectorControls.
  718. @discussion AudioSelectorControl is a subclass of AudioControl and has only the single
  719. scope, kAudioObjectPropertyScopeGlobal, and only a master element.
  720. @constant kAudioSelectorControlPropertyCurrentItem
  721. A UInt32 that is the ID of the item currently selected.
  722. @constant kAudioSelectorControlPropertyAvailableItems
  723. An array of UInt32s that represent the IDs of all the items available.
  724. @constant kAudioSelectorControlPropertyItemName
  725. This property translates the given item ID into a human readable name. The
  726. qualifier contains the ID of the item to be translated and name is returned
  727. as a CFString as the property data. The caller is responsible for releasing
  728. the returned CFObject.
  729. }
  730. const
  731. kAudioSelectorControlPropertyCurrentItem = $73636369 (* 'scci' *);
  732. kAudioSelectorControlPropertyAvailableItems = $73636169 (* 'scai' *);
  733. kAudioSelectorControlPropertyItemName = $7363696E (* 'scin' *);
  734. {!
  735. @enum AudioClockSourceControl Properties
  736. @abstract AudioObjectPropertySelector values that apply only to AudioClockSourceControls.
  737. @discussion These properties supplement the regular AudioSelectorControl Properties.
  738. @constant kAudioClockSourceControlPropertyItemKind
  739. This property returns a UInt32 that identifies the kind of clock source
  740. the item ID refers to. The qualifier contains the ID of the item. Values for
  741. this property are defined in <IOAudio/audio/IOAudioTypes.h>.
  742. }
  743. const
  744. kAudioClockSourceControlPropertyItemKind = $636C6B6B (* 'clkk' *);
  745. {!
  746. @enum AudioStereoPanControl Properties
  747. @abstract AudioObjectPropertySelector values that apply to all AudioStereoPanControls.
  748. @discussion AudioStereoPanControl is a subclass of AudioControl and has only the single
  749. scope, kAudioObjectPropertyScopeGlobal, and only a master element.
  750. @constant kAudioStereoPanControlPropertyValue
  751. A Float32 where 0.0 is full left, 1.0 is full right, and 0.5 is center.
  752. @constant kAudioStereoPanControlPropertyPanningChannels
  753. An array of two UInt32s that indicate which elements of the owning object
  754. the signal is being panned between.
  755. }
  756. const
  757. kAudioStereoPanControlPropertyValue = $73706376 (* 'spcv' *);
  758. kAudioStereoPanControlPropertyPanningChannels = $73706363 (* 'spcc' *);
  759. //==================================================================================================
  760. //#pragma mark AudioSystemObject Types
  761. {!
  762. @typedef AudioHardwarePropertyID
  763. @abstract An AudioHardwarePropertyID is a integer that identifies a specific piece of
  764. information about the AudioSystemObject.
  765. }
  766. type
  767. AudioHardwarePropertyID = AudioObjectPropertySelector;
  768. {!
  769. @typedef AudioHardwarePropertyListenerProc
  770. @abstract Clients register an AudioHardwarePropertyListenerProc with the AudioSystemObject
  771. in order to receive notifications when the properties of the object change.
  772. @discussion Note that the same functionality is provided by AudioObjectPropertyListenerProc.
  773. @param inPropertyID
  774. The AudioHardwarePropertyID of the property that changed.
  775. @param inClientData
  776. A pointer to client data established when the listener proc was registered
  777. with the AudioSystemObject.
  778. @result The return value is currently unused and should always be 0.
  779. }
  780. type
  781. AudioHardwarePropertyListenerProc = function( inPropertyID: AudioHardwarePropertyID; inClientData: UnivPtr ): OSStatus;
  782. //==================================================================================================
  783. //#pragma mark AudioSystemObject Constants
  784. {!
  785. @enum AudioSystemObject Class Constants
  786. @abstract Various constants related to the AudioSystemObject.
  787. @constant kAudioSystemObjectClassID
  788. The AudioClassID that identifies the AudioSystemObject class.
  789. @constant kAudioObjectSystemObject
  790. The AudioObjectID that always refers to the one and only instance of the
  791. AudioSystemObject.
  792. }
  793. const
  794. kAudioSystemObjectClassID = $61737973 (* 'asys' *);
  795. kAudioObjectSystemObject = 1;
  796. //==================================================================================================
  797. //#pragma mark AudioSystemObject Properties
  798. {!
  799. @enum AudioSystemObject Properties
  800. @abstract AudioObjectPropertySelector values that apply to the AudioSystemObject.
  801. @discussion The AudioSystemObject has one scope, kAudioObjectPropertyScopeGlobal, and only a
  802. master element.
  803. @constant kAudioHardwarePropertyProcessIsMaster
  804. A UInt32 where 1 means that the current process contains the master instance
  805. of the HAL. The master instance of the HAL is the only instance in which
  806. plug-ins should save/restore their devices' settings.
  807. @constant kAudioHardwarePropertyIsInitingOrExiting
  808. A UInt32 whose value will be non-zero if the HAL is either in the midst of
  809. initializing or in the midst of exiting the process.
  810. @constant kAudioHardwarePropertyDevices
  811. An array of the AudioDeviceIDs that represent all the devices currently
  812. available to the system.
  813. @constant kAudioHardwarePropertyDefaultInputDevice
  814. The AudioDeviceID of the default input AudioDevice.
  815. @constant kAudioHardwarePropertyDefaultOutputDevice
  816. The AudioDeviceID of the default output AudioDevice.
  817. @constant kAudioHardwarePropertyDefaultOutputDevice
  818. The AudioDeviceID of the output AudioDevice to use for system related sound
  819. from the alert sound to digital call progress.
  820. @constant kAudioHardwarePropertyDeviceForUID
  821. Using an AudioValueTranslation structure, this property translates the input
  822. CFStringRef containing a UID into the AudioDeviceID that refers to the
  823. AudioDevice with that UID. This property will return kAudioDeviceUnknown if
  824. the given UID does not match any currently available AudioDevice.
  825. @constant kAudioHardwarePropertySleepingIsAllowed
  826. A UInt32 where 1 means that the process will allow the CPU to idle sleep
  827. even if there is audio IO in progress. A 0 means that the CPU will not be
  828. allowed to idle sleep. Note that this property won't affect when the CPU is
  829. forced to sleep.
  830. @constant kAudioHardwarePropertyUnloadingIsAllowed
  831. A UInt32 where 1 means that this process wants the HAL to unload itself
  832. after a period of inactivity where there are no IOProcs and no listeners
  833. registered with any AudioObject.
  834. @constant kAudioHardwarePropertyHogModeIsAllowed
  835. A UInt32 where 1 means that this process wants the HAL to automatically take
  836. hog mode and 0 means that the HAL should not automatically take hog mode on
  837. behalf of the process. Processes that only ever use the default device are
  838. the sort of that should set this property's value to 0.
  839. @constant kAudioHardwarePropertyRunLoop
  840. The CFRunLoopRef the HAL is currently attaching all of it's system
  841. notification handlers to. By default, the HAL will create and manage it's
  842. own thread for this job. Clients can set this property to tell the HAL to
  843. use a thread of the client's choosing. The caller is responsible for
  844. releasing the returned CFObject.
  845. @constant kAudioHardwarePropertyPlugInForBundleID
  846. Using an AudioValueTranslation structure, this property translates the input
  847. CFString containing a bundle ID into the AudioObjectID of the AudioPlugIn
  848. that corresponds to it. This property will return kAudioObjectUnkown if the
  849. given bundle ID doesn't match any AudioPlugIns.
  850. }
  851. const
  852. kAudioHardwarePropertyProcessIsMaster = $6D617374 (* 'mast' *);
  853. kAudioHardwarePropertyIsInitingOrExiting = $696E6F74 (* 'inot' *);
  854. kAudioHardwarePropertyDevices = $64657623 (* 'dev#' *);
  855. kAudioHardwarePropertyDefaultInputDevice = $64496E20 (* 'dIn ' *);
  856. kAudioHardwarePropertyDefaultOutputDevice = $644F7574 (* 'dOut' *);
  857. kAudioHardwarePropertyDefaultSystemOutputDevice = $734F7574 (* 'sOut' *);
  858. kAudioHardwarePropertyDeviceForUID = $64756964 (* 'duid' *);
  859. kAudioHardwarePropertySleepingIsAllowed = $736C6570 (* 'slep' *);
  860. kAudioHardwarePropertyUnloadingIsAllowed = $756E6C64 (* 'unld' *);
  861. kAudioHardwarePropertyHogModeIsAllowed = $686F6772 (* 'hogr' *);
  862. kAudioHardwarePropertyRunLoop = $726E6C70 (* 'rnlp' *);
  863. kAudioHardwarePropertyPlugInForBundleID = $70696269 (* 'pibi' *);
  864. {!
  865. @enum AudioSystemObject Properties Implemented via AudioControl objects
  866. @abstract AudioObjectPropertySelector values for AudioSystemObject properties that are
  867. implemented by AudioControl objects.
  868. @discussion These properties are also accessible by locating the AudioControl object
  869. attached to the AudioSystemObject and using that object to access the properties
  870. of the control.
  871. @constant kAudioHardwarePropertyBootChimeVolumeScalar
  872. A Float32 that represents the value of the boot chime volume control. The
  873. range is between 0.0 and 1.0 (inclusive). This property is implemented by an
  874. AudioControl object that is a subclass of AudioBootChimeVolumeControl.
  875. @constant kAudioHardwarePropertyBootChimeVolumeDecibels
  876. A Float32 that represents the value of the boot chime volume control in dB.
  877. This property is implemented by an AudioControl object that is a subclass
  878. of AudioBootChimeVolumeControl.
  879. @constant kAudioHardwarePropertyBootChimeVolumeRangeDecibels
  880. An AudioValueRange that contains the minimum and maximum dB values the
  881. boot chime control can have. This property is implemented by an AudioControl
  882. object that is a subclass of AudioBootChimeVolumeControl.
  883. @constant kAudioHardwarePropertyBootChimeVolumeScalarToDecibels
  884. A Float32 that on input contains a scalar volume value for the boot chime
  885. and on exit contains the equivalent dB value. This property is implemented
  886. by an AudioControl object that is a subclass of AudioBootChimeVolumeControl.
  887. @constant kAudioHardwarePropertyBootChimeVolumeDecibelsToScalar
  888. A Float32 that on input contains a dB volume value for the boot chime and on
  889. exit contains the equivalent scalar value. This property is implemented by
  890. an AudioControl object that is a subclass of AudioBootChimeVolumeControl.
  891. }
  892. const
  893. kAudioHardwarePropertyBootChimeVolumeScalar = $62627673 (* 'bbvs' *);
  894. kAudioHardwarePropertyBootChimeVolumeDecibels = $62627664 (* 'bbvd' *);
  895. kAudioHardwarePropertyBootChimeVolumeRangeDecibels = $62626423 (* 'bbd#' *);
  896. kAudioHardwarePropertyBootChimeVolumeScalarToDecibels = $62763264 (* 'bv2d' *);
  897. kAudioHardwarePropertyBootChimeVolumeDecibelsToScalar = $62643276 (* 'bd2v' *);
  898. //==================================================================================================
  899. //#pragma mark AudioSystemObject Functions
  900. {!
  901. @functiongroup AudioSystemObject
  902. }
  903. {!
  904. @function AudioHardwareAddRunLoopSource
  905. @abstract Add the given CFRunLoopSource to the the HAL's notification CFRunLoop.
  906. @discussion The CFRunLoop the HAL uses for notifications is specified by
  907. kAudioHardwarePropertyRunLoop. If kAudioHardwarePropertyRunLoop changes,
  908. CFRunLoopSources added with this function will automatically be transferred to
  909. the new CFRunLoop.
  910. @param inRunLoopSource
  911. The CFRunLoopSource to add.
  912. @result An OSStatus indicating success or failure.
  913. }
  914. function AudioHardwareAddRunLoopSource( inRunLoopSource: CFRunLoopSourceRef ): OSStatus; external name '_AudioHardwareAddRunLoopSource';
  915. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  916. {!
  917. @function AudioHardwareRemoveRunLoopSource
  918. @abstract Remove the given CFRunLoopSource from the the HAL's notification CFRunLoop.
  919. @discussion The CFRunLoop the HAL uses for notifications is specified by
  920. kAudioHardwarePropertyRunLoop.
  921. @param inRunLoopSource
  922. The CFRunLoopSource to remove.
  923. @result An OSStatus indicating success or failure.
  924. }
  925. function AudioHardwareRemoveRunLoopSource( inRunLoopSource: CFRunLoopSourceRef ): OSStatus; external name '_AudioHardwareRemoveRunLoopSource';
  926. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  927. {!
  928. @function AudioHardwareUnload
  929. @abstract When this routine is called, all IO on all devices within a process will be
  930. terminated and all resources capable of being released will be released. This
  931. routine essentially returns the HAL to it's uninitialized state.
  932. @result An OSStatus indicating success or failure.
  933. }
  934. function AudioHardwareUnload: OSStatus; external name '_AudioHardwareUnload';
  935. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  936. {!
  937. @function AudioHardwareGetPropertyInfo
  938. @abstract Retrieve information about the given property.
  939. @discussion Note that the same functionality is provided by the functions
  940. AudioObjectHasProperty(), AudioObjectIsPropertySettable(), and
  941. AudioObjectGetPropertyDataSize().
  942. @param inPropertyID
  943. The AudioHardwarePropertyID of the property to query.
  944. @param outSize
  945. A pointer to a UInt32 that receives the size of the property data in bytes
  946. on exit. This can be NULL if the size information is not being requested.
  947. @param outWritable
  948. A pointer to a Boolean that receives indication of whether or not the given
  949. property can be set. This can be NULL if the writability is not being
  950. requested.
  951. @result An OSStatus indicating success or failure.
  952. }
  953. function AudioHardwareGetPropertyInfo( inPropertyID: AudioHardwarePropertyID; outSize: UInt32Ptr; outWritable: BooleanPtr ): OSStatus; external name '_AudioHardwareGetPropertyInfo';
  954. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  955. {!
  956. @function AudioHardwareGetProperty
  957. @abstract Queries an the AudioSystemObject to get the data of the given property and
  958. places it in the provided buffer.
  959. @discussion Note that the same functionality is provided by the function
  960. AudioObjectGetPropertyData().
  961. @param inPropertyID
  962. The AudioHardwarePropertyID of the property to query.
  963. @param ioDataSize
  964. A UInt32 which on entry indicates the size of the buffer pointed to by
  965. outData and on exit indicates how much of the buffer was used.
  966. @param outData
  967. The buffer into which the AudioSystemObject will put the data for the given
  968. property.
  969. @result An OSStatus indicating success or failure.
  970. }
  971. function AudioHardwareGetProperty( inPropertyID: AudioHardwarePropertyID; var ioPropertyDataSize: UInt32; outPropertyData: UnivPtr ): OSStatus; external name '_AudioHardwareGetProperty';
  972. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  973. {!
  974. @function AudioHardwareSetProperty
  975. @abstract Tells the AudioSystemObject to change the value of the given property using the
  976. provided data.
  977. @discussion Note that the value of the property should not be considered changed until the
  978. HAL has called the listeners as many properties values are changed
  979. asynchronously. Also note that the same functionality is provided by the
  980. function AudioObjectGetPropertyData().
  981. @param inPropertyID
  982. The AudioHardwarePropertyID of the property to change.
  983. @param inDataSize
  984. A UInt32 indicating the size of the buffer pointed to by inData.
  985. @param inData
  986. The buffer containing the data to be used to change the property's value.
  987. @result An OSStatus indicating success or failure.
  988. }
  989. function AudioHardwareSetProperty( inPropertyID: AudioHardwarePropertyID; inPropertyDataSize: UInt32; inPropertyData: {const} UnivPtr ): OSStatus; external name '_AudioHardwareSetProperty';
  990. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  991. {!
  992. @function AudioHardwareAddPropertyListener
  993. @abstract Registers the given AudioHardwarePropertyListenerProc to receive notifications
  994. when the given property changes.
  995. @discussion Note that the same functionality is provided by AudioObjectAddPropertyListener
  996. in conjunction with AudioObjectPropertyListenerProc.
  997. @param inPropertyID
  998. The AudioHardwarePropertyID of the property to listen to.
  999. @param inProc
  1000. AudioHardwarePropertyListenerProc to call.
  1001. @param inClientData
  1002. A pointer to client data that is passed to the listener when it is called.
  1003. @result An OSStatus indicating success or failure.
  1004. }
  1005. function AudioHardwareAddPropertyListener( inPropertyID: AudioHardwarePropertyID; inProc: AudioHardwarePropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioHardwareAddPropertyListener';
  1006. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1007. {!
  1008. @function AudioHardwareRemovePropertyListener
  1009. @abstract Unregisters the given AudioHardwarePropertyListenerProc from receive
  1010. notifications when the given property changes.
  1011. @discussion Note that the same functionality is provided by
  1012. AudioObjectRemovePropertyListener in conjunction with
  1013. AudioObjectPropertyListenerProc.
  1014. @param inPropertyID
  1015. The AudioHardwarePropertyID of the property to stop listening to.
  1016. @param inProc
  1017. AudioHardwarePropertyListenerProc to unregister.
  1018. @result An OSStatus indicating success or failure.
  1019. }
  1020. function AudioHardwareRemovePropertyListener( inPropertyID: AudioHardwarePropertyID; inProc: AudioHardwarePropertyListenerProc ): OSStatus; external name '_AudioHardwareRemovePropertyListener';
  1021. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1022. //==================================================================================================
  1023. //#pragma mark AudioPlugIn Constants
  1024. {!
  1025. @enum AudioPlugIn Class Constants
  1026. @abstract Various constants related to AudioPlugIns.
  1027. @constant kAudioPlugInClassID
  1028. The AudioClassID that identifies the AudioPlugIn class.
  1029. }
  1030. const
  1031. kAudioPlugInClassID = $61706C67 (* 'aplg' *);
  1032. //==================================================================================================
  1033. //#pragma mark AudioPlugIn Properties
  1034. {!
  1035. @enum AudioPlugIn Properties
  1036. @abstract AudioObjectPropertySelector values that apply to AudioPlugIns.
  1037. @discussion AudioPlugIn is a subclass of AudioObject that represents a plug-in loaded by the
  1038. HAL that conforms to the API in <CoreAudio/AudioHardwarePlugIn.h>. AudioPlugIns
  1039. have one scope, kAudioObjectPropertyScopeGlobal, and only a master element.
  1040. @constant kAudioPlugInPropertyBundleID
  1041. A CFString that contains the bundle identifier for the AudioPlugIn. The
  1042. caller is responsible for releasing the returned CFObject.
  1043. @constant kAudioPlugInCreateAggregateDevice
  1044. This property is used to tell a plug-in to create a new
  1045. AudioAggregateDevice. It's value is only read. The qualifier data for this
  1046. property is a CFDictionary containing a description of the
  1047. AudioAggregateDevice to create. The keys for the CFDictionary are defined in
  1048. the AudioAggregateDevice Constants section. The value of the property that
  1049. gets returned is the AudioObjectID of the newly created device.
  1050. @constant kAudioPlugInDestroyAggregateDevice
  1051. This property is used to tell a plug-in to destroy an AudioAggregateDevice.
  1052. Like kAudioPlugInCreateAggregateDevice, this property is read only. The
  1053. value of the property is the AudioObjectID of the AudioAggregateDevice to
  1054. destroy.
  1055. }
  1056. const
  1057. kAudioPlugInPropertyBundleID = $70696964 (* 'piid' *);
  1058. kAudioPlugInCreateAggregateDevice = $63616767 (* 'cagg' *);
  1059. kAudioPlugInDestroyAggregateDevice = $64616767 (* 'dagg' *);
  1060. //==================================================================================================
  1061. //#pragma mark AudioDevice Types
  1062. {!
  1063. @typedef AudioDeviceID
  1064. @abstract AudioDevice is the base class for all objects that represent an audio device.
  1065. @discussion AudioDevice is a subclass of AudioObject. AudioDevices normally contain
  1066. AudioStreams and AudioControls, but may contain other things depending on the
  1067. kind of AudioDevice (e.g. aggregate devices contain other AudioDevices).
  1068. }
  1069. type
  1070. AudioDeviceID = AudioObjectID;
  1071. {!
  1072. @typedef AudioDevicePropertyID
  1073. @abstract An AudioDevicePropertyID is an integer that identifies a specific piece of
  1074. information about the object.
  1075. }
  1076. type
  1077. AudioDevicePropertyID = AudioObjectPropertySelector;
  1078. {!
  1079. @struct AudioHardwareIOProcStreamUsage
  1080. @abstract This structure describes which streams a given AudioDeviceIOProc will use. It is
  1081. used in conjunction with kAudioDevicePropertyIOProcStreamUsage.
  1082. @field mIOProc
  1083. The IOProc whose stream usage is being specified.
  1084. @field mNumberStreams
  1085. The number of streams being specified.
  1086. @field mStreamIsOn
  1087. An array of UInt32's whose length is specified by mNumberStreams. Each
  1088. element of the array corresponds to a stream. A value of 0 means the stream
  1089. is not to be enabled. Any other value means the stream is to be used.
  1090. }
  1091. type
  1092. AudioHardwareIOProcStreamUsage = record
  1093. mIOProc: UnivPtr;
  1094. mNumberStreams: UInt32;
  1095. mStreamIsOn: array[0..0] of UInt32;
  1096. end;
  1097. {!
  1098. @typedef AudioDeviceIOProc
  1099. @abstract An AudioDeviceIOProc is called by an AudioDevice to provide input data read from
  1100. the device and collect output data to be written to the device for the current
  1101. IO cycle.
  1102. @param inDevice
  1103. The AudioDevice doing the IO.
  1104. @param inNow
  1105. An AudioTimeStamp that indicates the IO cycle started. Note that this time
  1106. includes any scheduling latency that may have been incurred waking the
  1107. thread on which IO is being done.
  1108. @param inInputData
  1109. An AudioBufferList containing the input data for the current IO cycle. For
  1110. streams that are disabled, the AudioBuffer's mData field will be NULL but
  1111. the mDataByteSize field will still say how much data would have been there
  1112. if it was enabled. Note that the contents of this structure should never be
  1113. modified.
  1114. @param inInputTime
  1115. An AudioTimeStamp that indicates the time at which the first frame in the
  1116. data was acquired from the hardware. If the device has no input streams, the
  1117. time stamp will be zeroed out.
  1118. @param outOutputData
  1119. An AudioBufferList in which the output data for the current IO cycle is to
  1120. be placed. On entry, each AudioBuffer's mDataByteSize field indicates the
  1121. maximum amount of data that can be placed in the buffer and the buffer's
  1122. memory has been zeroed out. For formats where the number of bytes per packet
  1123. can vary (as with AC-3, for example), the client has to fill out on exit
  1124. each mDataByteSize field in each AudioBuffer with the amount of data that
  1125. was put in the buffer. Otherwise, the mDataByteSize field should not be
  1126. changed. For streams that are disabled, the AudioBuffer's mData field will
  1127. be NULL but the mDataByteSize field will still say how much data would have
  1128. been there if it was enabled. Except as noted above, the contents of this
  1129. structure should not other wise be modified.
  1130. @param inOutputTime
  1131. An AudioTimeStamp that indicates the time at which the first frame in the
  1132. data will be passed to the hardware. If the device has no output streams,
  1133. the time stamp will be zeroed out.
  1134. @param inClientData
  1135. A pointer to client data established when the AudioDeviceIOProc was
  1136. registered with the AudioDevice.
  1137. @result The return value is currently unused and should always be 0.
  1138. }
  1139. type
  1140. AudioDeviceIOProc = function( inDevice: AudioDeviceID; const (*var*) inNow: AudioTimeStamp; const (*var*) inInputData: AudioBufferList; const (*var*) inInputTime: AudioTimeStamp; var outOutputData: AudioBufferList; const (*var*) inOutputTime: AudioTimeStamp; inClientData: UnivPtr ): OSStatus;
  1141. {!
  1142. @typedef AudioDevicePropertyListenerProc
  1143. @abstract Clients register an AudioDevicePropertyListenerProc with the AudioDevice object
  1144. in order to receive notifications when the properties of the object change.
  1145. @discussion Note that the same functionality is provided by AudioObjectPropertyListenerProc.
  1146. @param inDevice
  1147. The AudioDevice whose property has changed.
  1148. @param inChannel
  1149. The channel of the property that changed where 0 is the master channel.
  1150. @param isInput
  1151. Which section of the AudioDevice changed.
  1152. @param inPropertyID
  1153. The AudioDevicePropertyID of the property that changed.
  1154. @param inClientData
  1155. A pointer to client data established when the listener proc was registered
  1156. with the object.
  1157. @result The return value is currently unused and should always be 0.
  1158. }
  1159. type
  1160. AudioDevicePropertyListenerProc = function( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; inClientData: UnivPtr ): OSStatus;
  1161. //==================================================================================================
  1162. //#pragma mark AudioDevice Constants
  1163. {!
  1164. @enum AudioDevice Class Constants
  1165. @abstract Various constants related to AudioDevices.
  1166. @constant kAudioDevicePropertyScopeInput
  1167. The AudioObjectPropertyScope for properties that apply to the input signal
  1168. paths of the AudioDevice.
  1169. @constant kAudioDevicePropertyScopeOutput
  1170. The AudioObjectPropertyScope for properties that apply to the output signal
  1171. paths of the AudioDevice.
  1172. @constant kAudioDevicePropertyScopePlayThrough
  1173. The AudioObjectPropertyScope for properties that apply to the play through
  1174. signal paths of the AudioDevice.
  1175. @constant kAudioDeviceClassID
  1176. The AudioClassID that identifies the AudioDevice class.
  1177. @constant kAudioDeviceUnknown
  1178. The AudioObjectID for a nonexistent AudioObject.
  1179. }
  1180. const
  1181. kAudioDevicePropertyScopeInput = $696E7074 (* 'inpt' *);
  1182. kAudioDevicePropertyScopeOutput = $6F757470 (* 'outp' *);
  1183. kAudioDevicePropertyScopePlayThrough = $70747275 (* 'ptru' *);
  1184. kAudioDeviceClassID = $61646576 (* 'adev' *);
  1185. kAudioDeviceUnknown = kAudioObjectUnknown;
  1186. {!
  1187. @enum StartAtTime/GetNearestStartTime Flags
  1188. @abstract The flags that can be passed to control the behavior of AudioDeviceStartAtTime()
  1189. andAudioDeviceGetNearestStartTime().
  1190. @constant kAudioDeviceStartTimeIsInputFlag
  1191. Set to indicate that the requested time refers to an input time. Clear to
  1192. indicate that it is an output time.
  1193. @constant kAudioDeviceStartTimeDontConsultDeviceFlag
  1194. Set to indicate that the device should not be consulted when determining the
  1195. start time. Clear to indicate that the device should be consulted. This flag
  1196. cannot be set if kAudioDeviceStartTimeDontConsultHALFlag is set.
  1197. @constant kAudioDeviceStartTimeDontConsultHALFlag
  1198. Set to indicate that the HAL should not be consulted when determining the
  1199. start time. Clear to indicate that the HAL should be consulted. This flag
  1200. cannot be set if kAudioDeviceStartTimeDontConsultDeviceFlag is set.
  1201. }
  1202. const
  1203. kAudioDeviceStartTimeIsInputFlag = 1 shl 0;
  1204. kAudioDeviceStartTimeDontConsultDeviceFlag = 1 shl 1;
  1205. kAudioDeviceStartTimeDontConsultHALFlag = 1 shl 2;
  1206. //==================================================================================================
  1207. //#pragma mark AudioDevice Properties
  1208. {!
  1209. @enum AudioDevice Properties
  1210. @abstract AudioObjectPropertySelector values that apply to AudioDevice objects.
  1211. @discussion AudioDevices have four scopes: kAudioDevicePropertyScopeGlobal,
  1212. kAudioDevicePropertyScopeInput, kAudioDevicePropertyScopeOutput, and
  1213. kAudioDevicePropertyScopePlayThrough. They have a master element and an element
  1214. for each channel in each stream numbered according to the starting channel
  1215. number of each stream.
  1216. @constant kAudioDevicePropertyPlugIn
  1217. An OSStatus that contains any error codes generated by loading the IOAudio
  1218. driver plug-in for the AudioDevice or kAudioHardwareNoError if the plug-in
  1219. loaded successfully. This property only exists for IOAudio-based
  1220. AudioDevices whose driver has specified a plug-in to load.
  1221. @constant kAudioDevicePropertyConfigurationApplication
  1222. A CFString that contains the bundle ID for an application that provides a
  1223. GUI for configuring the AudioDevice. By default, the value of this property
  1224. is the bundle ID for Audio MIDI Setup. The caller is responsible for
  1225. releasing the returned CFObject.
  1226. @constant kAudioDevicePropertyDeviceUID
  1227. A CFString that contains a persistent identifier for the AudioDevice. An
  1228. AudioDevice's UID is persistent across boots. The content of the UID string
  1229. is a black box and may contain information that is unique to a particular
  1230. instance of an AudioDevice's hardware or unique to the CPU. Therefore they
  1231. are not suitable for passing between CPUs or for identifying similar models
  1232. of hardware.
  1233. @constant kAudioDevicePropertyModelUID
  1234. A CFString that contains a persistent identifier for the model of an
  1235. AudioDevice. The identifier is unique such that the identifier from two
  1236. AudioDevices are equal if and only if the two AudioDevices are the exact
  1237. same model from the same manufacturer. Further, the identifier has to be the
  1238. same no matter on what machine the AudioDevice appears.
  1239. @constant kAudioDevicePropertyTransportType
  1240. A UInt32 whose value indicates how the AudioDevice is connected to the CPU.
  1241. Constants for some of the values for this property can be found in
  1242. <IOKit/audio/IOAudioTypes.h>.
  1243. @constant kAudioDevicePropertyRelatedDevices
  1244. An array of AudioDeviceIDs for devices related to the AudioDevice. For
  1245. IOAudio-based devices, a AudioDevices are related if they share the same
  1246. IOAudioDevice object.
  1247. @constant kAudioDevicePropertyClockDomain
  1248. A UInt32 whose value indicates the clock domain to which this AudioDevice
  1249. belongs. AudioDevices that have the same value for this property are able to
  1250. be synchronized in hardware. However, a value of 0 indicates that the clock
  1251. domain for the device is unspecified and should be assumed to be separate
  1252. from every other device's clock domain, even if they have the value of 0 as
  1253. their clock domain as well.
  1254. @constant kAudioDevicePropertyDeviceIsAlive
  1255. A UInt32 where a value of 1 means the device is ready and available and 0
  1256. means the device is usable and will most likely go away shortly.
  1257. @constant kAudioDevicePropertyDeviceHasChanged
  1258. The type of this property is a UInt32, but it's value has no meaning. This
  1259. property exists so that clients can listen to it and be told when the
  1260. configuration of the AudioDevice has changed in ways that cannot otherwise
  1261. be conveyed through other notifications. In response to this notification,
  1262. clients should re-evaluate everything they need to know about the device,
  1263. particularly the layout and values of the controls.
  1264. @constant kAudioDevicePropertyDeviceIsRunning
  1265. A UInt32 where a value of 0 means the AudioDevice is not performing IO and
  1266. a value of 1 means that it is. Note that the device can be running even if
  1267. there are no active IOProcs such as by calling AudioDeviceStart() and
  1268. passing a NULL IOProc. Note that the notification for this property is
  1269. usually sent from the AudioDevice's IO thread.
  1270. @constant kAudioDevicePropertyDeviceIsRunningSomewhere
  1271. A UInt32 where 1 means that the AudioDevice is running in at least one
  1272. process on the system and 0 means that it isn't running at all.
  1273. @constant kAudioDevicePropertyDeviceCanBeDefaultDevice
  1274. A UInt32 where 1 means that the AudioDevice is a possible selection for
  1275. kAudioHardwarePropertyDefaultInputDevice or
  1276. kAudioHardwarePropertyDefaultOutputDevice depending on the scope.
  1277. @constant kAudioDevicePropertyDeviceCanBeDefaultSystemDevice
  1278. A UInt32 where 1 means that the AudioDevice is a possible selection for
  1279. kAudioHardwarePropertyDefaultSystemOutputDevice.
  1280. @constant kAudioDeviceProcessorOverload
  1281. A UInt32 where the value has no meaning. This property exists so that
  1282. clients can be notified when the AudioDevice detects that an IO cycle has
  1283. run past it's deadline. Note that the notification for this property is
  1284. usually sent from the AudioDevice's IO thread.
  1285. @constant kAudioDevicePropertyHogMode
  1286. A pid_t indicating the process that currently owns exclusive access to the
  1287. AudioDevice or a value of -1 indicating that the device is currently
  1288. available to all processes. If the AudioDevice is in a non-mixable mode,
  1289. the HAL will automatically take hog mode on behalf of the first process to
  1290. start an IOProc.
  1291. @constant kAudioDevicePropertyLatency
  1292. A UInt32 containing the number of frames of latency in the AudioDevice. Note
  1293. that input and output latency may differ. Further, the AudioDevice's
  1294. AudioStreams may have additional latency so they should be queried as well.
  1295. If both the device and the stream say they have latency, then the total
  1296. latency for the stream is the device latency summed with the stream latency.
  1297. @constant kAudioDevicePropertyBufferFrameSize
  1298. A UInt32 whose value indicates the number of frames in the IO buffers.
  1299. @constant kAudioDevicePropertyBufferFrameSizeRange
  1300. An AudioValueRange indicating the minimum and maximum values, inclusive, for
  1301. kAudioDevicePropertyBufferFrameSize.
  1302. @constant kAudioDevicePropertyUsesVariableBufferFrameSizes
  1303. A UInt32 that, if implemented by a device, indicates that the sizes of the
  1304. buffers passed to an IOProc will vary by a small amount. The value of this
  1305. property will indicate the largest buffer that will be passed and
  1306. kAudioDevicePropertyBufferFrameSize will indicate the smallest buffer that
  1307. will get passed to the IOProc. The usage of this property is narrowed to
  1308. only allow for devices whose buffer sizes vary by small amounts greater than
  1309. kAudioDevicePropertyBufferFrameSize. It is not intended to be a license for
  1310. devices to be able to send buffers however they please. Rather, it is
  1311. intended to allow for hardware whose natural rhythms lead to this necessity.
  1312. @constant kAudioDevicePropertyStreams
  1313. An array of AudioStreamIDs that represent the AudioStreams of the
  1314. AudioDevice. Note that if a notification is received for this property, any
  1315. cached AudioStreamIDs for the device become invalid and need to be
  1316. re-fetched.
  1317. @constant kAudioDevicePropertySafetyOffset
  1318. A UInt32 whose value indicates the number for frames in ahead (for output)
  1319. or behind (for input the current hardware position that is safe to do IO.
  1320. @constant kAudioDevicePropertyIOCycleUsage
  1321. A Float32 whose range is from 0 to 1. This value indicates how much of the
  1322. client portion of the IO cycle the process will use. The client portion of
  1323. the IO cycle is the portion of the cycle in which the device calls the
  1324. IOProcs so this property does not the apply to the duration of the entire
  1325. cycle.
  1326. @constant kAudioDevicePropertyStreamConfiguration
  1327. This property returns the stream configuration of the device in an
  1328. AudioBufferList (with the buffer pointers set to NULL) which describes the
  1329. list of streams and the number of channels in each stream. This corresponds
  1330. to what will be passed into the IOProc.
  1331. @constant kAudioDevicePropertyIOProcStreamUsage
  1332. An AudioHardwareIOProcStreamUsage structure which details the stream usage
  1333. of a given IO proc. If a stream is marked as not being used, the given
  1334. IOProc will see a corresponding NULL buffer pointer in the AudioBufferList
  1335. passed to it's IO proc. Note that the number of streams detailed in the
  1336. AudioHardwareIOProcStreamUsage must include all the streams of that
  1337. direction on the device. Also, when getting the value of the property, one
  1338. must fill out the mIOProc field of the AudioHardwareIOProcStreamUsage with
  1339. the address of the of the IOProc whose stream usage is to be retrieved.
  1340. @constant kAudioDevicePropertyPreferredChannelsForStereo
  1341. An array of two UInt32s, the first for the left channel, the second for the
  1342. right channel, that indicate the channel numbers to use for stereo IO on the
  1343. device. The value of this property can be different for input and output and
  1344. there are no restrictions on the channel numbers that can be used.
  1345. @constant kAudioDevicePropertyPreferredChannelLayout
  1346. An AudioChannelLayout that indicates how each channel of the AudioDevice
  1347. should be used.
  1348. @constant kAudioDevicePropertyNominalSampleRate
  1349. A Float64 that indicates the current nominal sample rate of the AudioDevice.
  1350. @constant kAudioDevicePropertyAvailableNominalSampleRates
  1351. An array of AudioValueRange structs that indicates the valid ranges for the
  1352. nominal sample rate of the AudioDevice.
  1353. @constant kAudioDevicePropertyActualSampleRate
  1354. A Float64 that indicates the current actual sample rate of the AudioDevice
  1355. as measured by it's time stamps.
  1356. }
  1357. const
  1358. kAudioDevicePropertyPlugIn = $706C7567 (* 'plug' *);
  1359. kAudioDevicePropertyConfigurationApplication = $63617070 (* 'capp' *);
  1360. kAudioDevicePropertyDeviceUID = $75696420 (* 'uid ' *);
  1361. kAudioDevicePropertyModelUID = $6D756964 (* 'muid' *);
  1362. kAudioDevicePropertyTransportType = $7472616E (* 'tran' *);
  1363. kAudioDevicePropertyRelatedDevices = $616B696E (* 'akin' *);
  1364. kAudioDevicePropertyClockDomain = $636C6B64 (* 'clkd' *);
  1365. kAudioDevicePropertyDeviceIsAlive = $6C69766E (* 'livn' *);
  1366. kAudioDevicePropertyDeviceHasChanged = $64696666 (* 'diff' *);
  1367. kAudioDevicePropertyDeviceIsRunning = $676F696E (* 'goin' *);
  1368. kAudioDevicePropertyDeviceIsRunningSomewhere = $676F6E65 (* 'gone' *);
  1369. kAudioDevicePropertyDeviceCanBeDefaultDevice = $64666C74 (* 'dflt' *);
  1370. kAudioDevicePropertyDeviceCanBeDefaultSystemDevice = $73666C74 (* 'sflt' *);
  1371. kAudioDeviceProcessorOverload = $6F766572 (* 'over' *);
  1372. kAudioDevicePropertyHogMode = $6F696E6B (* 'oink' *);
  1373. kAudioDevicePropertyLatency = $6C746E63 (* 'ltnc' *);
  1374. kAudioDevicePropertyBufferFrameSize = $6673697A (* 'fsiz' *);
  1375. kAudioDevicePropertyBufferFrameSizeRange = $66737A23 (* 'fsz#' *);
  1376. kAudioDevicePropertyUsesVariableBufferFrameSizes = $7666737A (* 'vfsz' *);
  1377. kAudioDevicePropertyStreams = $73746D23 (* 'stm#' *);
  1378. kAudioDevicePropertySafetyOffset = $73616674 (* 'saft' *);
  1379. kAudioDevicePropertyIOCycleUsage = $6E637963 (* 'ncyc' *);
  1380. kAudioDevicePropertyStreamConfiguration = $736C6179 (* 'slay' *);
  1381. kAudioDevicePropertyIOProcStreamUsage = $73757365 (* 'suse' *);
  1382. kAudioDevicePropertyPreferredChannelsForStereo = $64636832 (* 'dch2' *);
  1383. kAudioDevicePropertyPreferredChannelLayout = $73726E64 (* 'srnd' *);
  1384. kAudioDevicePropertyNominalSampleRate = $6E737274 (* 'nsrt' *);
  1385. kAudioDevicePropertyAvailableNominalSampleRates = $6E737223 (* 'nsr#' *);
  1386. kAudioDevicePropertyActualSampleRate = $61737274 (* 'asrt' *);
  1387. {!
  1388. @enum AudioDevice Properties Implemented via AudioControl objects
  1389. @abstract AudioObjectPropertySelector values for AudioDevice properties that are
  1390. implemented by AudioControl objects.
  1391. @discussion These properties are also accessible by locating the AudioControl object
  1392. attached to the AudioDevice and using that object to access the properties of
  1393. the control.
  1394. @constant kAudioDevicePropertyJackIsConnected
  1395. A UInt32 where a value of 0 means that there isn't anything plugged into the
  1396. jack associated withe given element and scope. This property is implemented
  1397. by an AudioJackControl, a subclass of AudioBooleanControl.
  1398. @constant kAudioDevicePropertyVolumeScalar
  1399. A Float32 that represents the value of the volume control. The range is
  1400. between 0.0 and 1.0 (inclusive). This property is implemented by an
  1401. AudioControl object that is a subclass of AudioVolumeControl.
  1402. @constant kAudioDevicePropertyVolumeDecibels
  1403. A Float32 that represents the value of the volume control in dB. This
  1404. property is implemented by an AudioControl object that is a subclass of
  1405. AudioVolumeControl.
  1406. @constant kAudioDevicePropertyVolumeRangeDecibels
  1407. An AudioValueRange that contains the minimum and maximum dB values the
  1408. control can have. This property is implemented by an AudioControl object
  1409. that is a subclass of AudioVolumeControl.
  1410. @constant kAudioDevicePropertyVolumeScalarToDecibels
  1411. A Float32 that on input contains a scalar volume value for the and on exit
  1412. contains the equivalent dB value. This property is implemented by an
  1413. AudioControl object that is a subclass of AudioVolumeControl.
  1414. @constant kAudioDevicePropertyVolumeDecibelsToScalar
  1415. A Float32 that on input contains a dB volume value for the and on exit
  1416. contains the equivalent scalar value. This property is implemented by an
  1417. AudioControl object that is a subclass of AudioVolumeControl.
  1418. @constant kAudioDevicePropertyStereoPan
  1419. A Float32 where 0.0 is full left, 1.0 is full right, and 0.5 is center. This
  1420. property is implemented by an AudioControl object that is a subclass of
  1421. AudioStereoPanControl.
  1422. @constant kAudioDevicePropertyStereoPanChannels
  1423. An array of two UInt32s that indicate which elements of the owning object
  1424. the signal is being panned between. This property is implemented by an
  1425. AudioControl object that is a subclass of AudioStereoPanControl.
  1426. @constant kAudioDevicePropertyMute
  1427. A UInt32 where a value of 1 means that mute is enabled making that element
  1428. inaudible. The property is implemented by an AudioControl object that is a
  1429. subclass of AudioMuteControl.
  1430. @constant kAudioDevicePropertySolo
  1431. A UInt32 where a value of 1 means that just that element is audible and the
  1432. other elements are inaudible. The property is implemented by an AudioControl
  1433. object that is a subclass of AudioSoloControl.
  1434. @constant kAudioDevicePropertyDataSource
  1435. A UInt32 whose value is the item ID for the currently selected data source.
  1436. This property is implemented by an AudioControl object that is a subclass of
  1437. AudioDataSourceControl.
  1438. @constant kAudioDevicePropertyDataSources
  1439. An array of UInt32s that are represent all the IDs of all the data sources
  1440. currently available. This property is implemented by an AudioControl object
  1441. that is a subclass of AudioDataSourceControl.
  1442. @constant kAudioDevicePropertyDataSourceNameForIDCFString
  1443. This property translates the given data source item ID into a human readable
  1444. name using an AudioValueTranslation structure. The input data is the UInt32
  1445. containing the item ID to translated and the output data is a CFString. The
  1446. caller is responsible for releasing the returned CFObject. This property is
  1447. implemented by an AudioControl object that is a subclass of
  1448. AudioDataSourceControl.
  1449. @constant kAudioDevicePropertyClockSource
  1450. A UInt32 whose value is the item ID for the currently selected clock source.
  1451. This property is implemented by an AudioControl object that is a subclass of
  1452. AudioClockControl.
  1453. @constant kAudioDevicePropertyClockSources
  1454. An array of UInt32s that are represent all the IDs of all the clock sources
  1455. currently available. This property is implemented by an AudioControl object
  1456. that is a subclass of AudioClockControl.
  1457. @constant kAudioDevicePropertyClockSourceNameForIDCFString
  1458. This property translates the given clock source item ID into a human
  1459. readable name using an AudioValueTranslation structure. The input data is
  1460. the UInt32 containing the item ID to translated and the output data is a
  1461. CFString. The caller is responsible for releasing the returned CFObject.
  1462. This property is implemented by an AudioControl object that is a subclass of
  1463. AudioClockControl.
  1464. @constant kAudioDevicePropertyClockSourceKindForID
  1465. This property returns a UInt32 that identifies the kind of clock source
  1466. the item ID refers to using an AudioValueTranslation structure. The input
  1467. data is the UInt32 containing the item ID and the output data is the UInt32.
  1468. Values for this property are defined in <IOAudio/audio/IOAudioTypes.h>.
  1469. @constant kAudioDevicePropertyPlayThru
  1470. A UInt32 where a value of 0 means that play through is off and a value of 1
  1471. means that it is on. This property is implemented by an AudioControl object
  1472. that is a subclass of AudioMuteControl. Further, the control that implements
  1473. this property is only available through
  1474. kAudioDevicePropertyScopePlayThrough.
  1475. @constant kAudioDevicePropertyPlayThruSolo
  1476. A UInt32 where a value of 1 means that just that play through element is
  1477. audible and the other elements are inaudible. The property is implemented by
  1478. an AudioControl object that is a subclass of AudioSoloControl. Further, the
  1479. control that implements this property is only available through
  1480. kAudioDevicePropertyScopePlayThrough.
  1481. @constant kAudioDevicePropertyPlayThruVolumeScalar
  1482. A Float32 that represents the value of the volume control. The range is
  1483. between 0.0 and 1.0 (inclusive). This property is implemented by an
  1484. AudioControl object that is a subclass of AudioVolumeControl.Further, the
  1485. control that implements this property is only available through
  1486. kAudioDevicePropertyScopePlayThrough.
  1487. @constant kAudioDevicePropertyPlayThruVolumeDecibels
  1488. A Float32 that represents the value of the volume control in dB. This
  1489. property is implemented by an AudioControl object that is a subclass of
  1490. AudioVolumeControl. Further, the control that implements this property is
  1491. only available through kAudioDevicePropertyScopePlayThrough.
  1492. @constant kAudioDevicePropertyPlayThruVolumeRangeDecibels
  1493. An AudioValueRange that contains the minimum and maximum dB values the
  1494. control can have. This property is implemented by an AudioControl object
  1495. that is a subclass of AudioVolumeControl. Further, the control that
  1496. implements this property is only available through
  1497. kAudioDevicePropertyScopePlayThrough.
  1498. @constant kAudioDevicePropertyPlayThruVolumeScalarToDecibels
  1499. A Float32 that on input contains a scalar volume value for the and on exit
  1500. contains the equivalent dB value. This property is implemented by an
  1501. AudioControl object that is a subclass of AudioVolumeControl. Further, the
  1502. control that implements this property is only available through
  1503. kAudioDevicePropertyScopePlayThrough.
  1504. @constant kAudioDevicePropertyPlayThruVolumeDecibelsToScalar
  1505. A Float32 that on input contains a dB volume value for the and on exit
  1506. contains the equivalent scalar value. This property is implemented by an
  1507. AudioControl object that is a subclass of AudioVolumeControl. Further, the
  1508. control that implements this property is only available through
  1509. kAudioDevicePropertyScopePlayThrough.
  1510. @constant kAudioDevicePropertyPlayThruStereoPan
  1511. A Float32 where 0.0 is full left, 1.0 is full right, and 0.5 is center. This
  1512. property is implemented by an AudioControl object that is a subclass of
  1513. AudioStereoPanControl. Further, the control that implements this property is
  1514. only available through kAudioDevicePropertyScopePlayThrough.
  1515. @constant kAudioDevicePropertyPlayThruStereoPanChannels
  1516. An array of two UInt32s that indicate which elements of the owning object
  1517. the signal is being panned between. This property is implemented by an
  1518. AudioControl object that is a subclass of AudioStereoPanControl. Further,
  1519. the control that implements this property is only available through
  1520. kAudioDevicePropertyScopePlayThrough.
  1521. @constant kAudioDevicePropertyPlayThruDestination
  1522. A UInt32 whose value is the item ID for the currently selected play through
  1523. data destination. This property is implemented by an AudioControl object
  1524. that is a subclass of AudioDataDestinationControl. Further, the control that
  1525. implements this property is only available through
  1526. kAudioDevicePropertyScopePlayThrough.
  1527. @constant kAudioDevicePropertyPlayThruDestinations
  1528. An array of UInt32s that are represent all the IDs of all the play through
  1529. data destinations currently available. This property is implemented by an
  1530. AudioControl object that is a subclass of AudioDataDestinationControl.
  1531. Further, the control that implements this property is only available through
  1532. kAudioDevicePropertyScopePlayThrough.
  1533. @constant kAudioDevicePropertyPlayThruDestinationNameForIDCFString
  1534. This property translates the given play through data destination item ID
  1535. into a human readable name using an AudioValueTranslation structure. The
  1536. input data is the UInt32 containing the item ID to translated and the output
  1537. data is a CFString. The caller is responsible for releasing the returned
  1538. CFObject. This property is implemented by an AudioControl object that is a
  1539. subclass of AudioDataDestinationControl. Further, the control that
  1540. implements this property is only available through
  1541. kAudioDevicePropertyScopePlayThrough.
  1542. @constant kAudioDevicePropertyChannelNominalLineLevel
  1543. A UInt32 whose value is the item ID for the currently selected nominal line
  1544. level. This property is implemented by an AudioControl object that is a
  1545. subclass of AudioLineLevelControl.
  1546. @constant kAudioDevicePropertyChannelNominalLineLevels
  1547. An array of UInt32s that represent all the IDs of all the nominal line
  1548. levels currently available. This property is implemented by an AudioControl
  1549. object that is a subclass of AudioLineLevelControl.
  1550. @constant kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString
  1551. This property translates the given nominal line level item ID into a human
  1552. readable name using an AudioValueTranslation structure. The input data is
  1553. the UInt32 containing the item ID to be translated and the output data is a
  1554. CFString. The caller is responsible for releasing the returned CFObject.
  1555. This property is implemented by an AudioCOntrol object that is a subclass of
  1556. AudioLineLevelControl.
  1557. @constant kAudioDevicePropertyDriverShouldOwniSub
  1558. A UInt32 where a value of 0 means that the AudioDevice should not claim
  1559. ownership of any attached iSub and a value of 1 means that it should. Note
  1560. that this property is only available for built-in devices and for USB Audio
  1561. devices that use the standard class compliant driver. This property is
  1562. implemented by an AudioControl object that is a subclass of
  1563. AudioISubOwnerControl.
  1564. @constant kAudioDevicePropertySubVolumeScalar
  1565. A Float32 that represents the value of the LFE volume control. The range is
  1566. between 0.0 and 1.0 (inclusive). This property is implemented by an
  1567. AudioControl object that is a subclass of AudioLFEVolumeControl.
  1568. @constant kAudioDevicePropertySubVolumeDecibels
  1569. A Float32 that represents the value of the LFE volume control in dB. This
  1570. property is implemented by an AudioControl object that is a subclass of
  1571. AudioLFE VolumeControl.
  1572. @constant kAudioDevicePropertySubVolumeRangeDecibels
  1573. An AudioValueRange that contains the minimum and maximum dB values the
  1574. control can have. This property is implemented by an AudioControl object
  1575. that is a subclass of AudioLFEVolumeControl.
  1576. @constant kAudioDevicePropertySubVolumeScalarToDecibels
  1577. A Float32 that on input contains a scalar volume value for the and on exit
  1578. contains the equivalent dB value. This property is implemented by an
  1579. AudioControl object that is a subclass of AudioLFEVolumeControl.
  1580. @constant kAudioDevicePropertySubVolumeDecibelsToScalar
  1581. A Float32 that on input contains a dB volume value for the and on exit
  1582. contains the equivalent scalar value. This property is implemented by an
  1583. AudioControl object that is a subclass of AudioLFEVolumeControl.
  1584. @constant kAudioDevicePropertySubMute
  1585. A UInt32 where a value of 1 means that mute is enabled making the LFE on
  1586. that element inaudible. The property is implemented by an AudioControl
  1587. object that is a subclass of AudioLFEMuteControl.
  1588. }
  1589. const
  1590. kAudioDevicePropertyJackIsConnected = $6A61636B (* 'jack' *);
  1591. kAudioDevicePropertyVolumeScalar = $766F6C6D (* 'volm' *);
  1592. kAudioDevicePropertyVolumeDecibels = $766F6C64 (* 'vold' *);
  1593. kAudioDevicePropertyVolumeRangeDecibels = $76646223 (* 'vdb#' *);
  1594. kAudioDevicePropertyVolumeScalarToDecibels = $76326462 (* 'v2db' *);
  1595. kAudioDevicePropertyVolumeDecibelsToScalar = $64623276 (* 'db2v' *);
  1596. kAudioDevicePropertyStereoPan = $7370616E (* 'span' *);
  1597. kAudioDevicePropertyStereoPanChannels = $73706E23 (* 'spn#' *);
  1598. kAudioDevicePropertyMute = $6D757465 (* 'mute' *);
  1599. kAudioDevicePropertySolo = $736F6C6F (* 'solo' *);
  1600. kAudioDevicePropertyDataSource = $73737263 (* 'ssrc' *);
  1601. kAudioDevicePropertyDataSources = $73736323 (* 'ssc#' *);
  1602. kAudioDevicePropertyDataSourceNameForIDCFString = $6C73636E (* 'lscn' *);
  1603. kAudioDevicePropertyClockSource = $63737263 (* 'csrc' *);
  1604. kAudioDevicePropertyClockSources = $63736323 (* 'csc#' *);
  1605. kAudioDevicePropertyClockSourceNameForIDCFString = $6C63736E (* 'lcsn' *);
  1606. kAudioDevicePropertyClockSourceKindForID = $6373636B (* 'csck' *);
  1607. kAudioDevicePropertyPlayThru = $74687275 (* 'thru' *);
  1608. kAudioDevicePropertyPlayThruSolo = $74687273 (* 'thrs' *);
  1609. kAudioDevicePropertyPlayThruVolumeScalar = $6D767363 (* 'mvsc' *);
  1610. kAudioDevicePropertyPlayThruVolumeDecibels = $6D766462 (* 'mvdb' *);
  1611. kAudioDevicePropertyPlayThruVolumeRangeDecibels = $6D766423 (* 'mvd#' *);
  1612. kAudioDevicePropertyPlayThruVolumeScalarToDecibels = $6D763264 (* 'mv2d' *);
  1613. kAudioDevicePropertyPlayThruVolumeDecibelsToScalar = $6D763273 (* 'mv2s' *);
  1614. kAudioDevicePropertyPlayThruStereoPan = $6D73706E (* 'mspn' *);
  1615. kAudioDevicePropertyPlayThruStereoPanChannels = $6D737023 (* 'msp#' *);
  1616. kAudioDevicePropertyPlayThruDestination = $6D646473 (* 'mdds' *);
  1617. kAudioDevicePropertyPlayThruDestinations = $6D646423 (* 'mdd#' *);
  1618. kAudioDevicePropertyPlayThruDestinationNameForIDCFString = $6D646463 (* 'mddc' *);
  1619. kAudioDevicePropertyChannelNominalLineLevel = $6E6C766C (* 'nlvl' *);
  1620. kAudioDevicePropertyChannelNominalLineLevels = $6E6C7623 (* 'nlv#' *);
  1621. kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString = $6C636E6C (* 'lcnl' *);
  1622. kAudioDevicePropertyDriverShouldOwniSub = $69737562 (* 'isub' *);
  1623. kAudioDevicePropertySubVolumeScalar = $73766C6D (* 'svlm' *);
  1624. kAudioDevicePropertySubVolumeDecibels = $73766C64 (* 'svld' *);
  1625. kAudioDevicePropertySubVolumeRangeDecibels = $73766423 (* 'svd#' *);
  1626. kAudioDevicePropertySubVolumeScalarToDecibels = $73763264 (* 'sv2d' *);
  1627. kAudioDevicePropertySubVolumeDecibelsToScalar = $73643276 (* 'sd2v' *);
  1628. kAudioDevicePropertySubMute = $736D7574 (* 'smut' *);
  1629. {!
  1630. @enum AudioDevice Properties That Ought To Some Day Be Deprecated
  1631. @abstract AudioObjectPropertySelector values whose functionality is better provided by
  1632. other selectors.
  1633. @discussion These selectors are still provided for backward compatibility. The description
  1634. of the property will indicate in parentheses the better selectors to use and
  1635. why.
  1636. @constant kAudioDevicePropertyDeviceName
  1637. A C-string that contains the human readable name of the AudioDevice.
  1638. (kAudioObjectPropertyName: CFStrings are better for localization.)
  1639. @constant kAudioDevicePropertyDeviceNameCFString
  1640. A CFStringRef that contains the human readable name of the AudioDevice. The
  1641. caller is responsible for releasing the returned CFObject.
  1642. (kAudioObjectPropertyName: This is just another name for the inherited
  1643. selector.)
  1644. @constant kAudioDevicePropertyDeviceManufacturer
  1645. A C-string that contains the human readable name of the manufacturer of the
  1646. AudioDevice.
  1647. (kAudioObjectPropertyManufacturer: CFStrings are better for localization.)
  1648. @constant kAudioDevicePropertyDeviceManufacturerCFString
  1649. A CFString that contains the human readable name of the manufacturer of the
  1650. AudioDevice. The caller is responsible for releasing the returned CFObject.
  1651. (kAudioObjectPropertyManufacturer: This is just another name for the
  1652. inherited selector.)
  1653. @constant kAudioDevicePropertyRegisterBufferList
  1654. This property allows clients to register a fully populated AudioBufferList
  1655. that matches the topology described by
  1656. kAudioDevicePropertyStreamConfiguration for doing input using
  1657. AudioDeviceRead(). The AudioBufferList will be registered with the call the
  1658. AudioDeviceSetProperty() and will be unregistered with the call to
  1659. AudioDeviceGetProperty(). If this property isn't implemented by the
  1660. AudioDevice, it implies that the AudioDevice also doesn't support
  1661. AudioDeviceRead().
  1662. (Aggregate devices make AudioDeviceRead() obsolete for the most part.)
  1663. @constant kAudioDevicePropertyBufferSize
  1664. A UInt32 containing the size in bytes of the IO buffer for the AudioStream
  1665. containing the element.
  1666. (kAudioDevicePropertyBufferFrameSize: with multiple AudioStreams and the
  1667. requirement that all streams' buffers represent the same amount of time, it
  1668. doesn't make sense to set the buffer size in bytes since it will be
  1669. different for each stream.)
  1670. @constant kAudioDevicePropertyBufferSizeRange
  1671. An AudioValueRange specifying the minimum and maximum bytes size for the
  1672. IO buffer for the AudioStream containing the given element.
  1673. (kAudioDevicePropertyBufferFrameSizeRange: see
  1674. kAudioDevicePropertyBufferSize.)
  1675. @constant kAudioDevicePropertyChannelName
  1676. A CFString that contains a human readable name for the given element in the
  1677. given scope. The caller is responsible for releasing the returned CFObject.
  1678. (kAudioObjectPropertyElementName: CFStrings are better for
  1679. localization.)
  1680. @constant kAudioDevicePropertyChannelNameCFString
  1681. A CFString that contains a human readable name for the given element in the
  1682. given scope. The caller is responsible for releasing the returned CFObject.
  1683. (kAudioObjectPropertyElementName: This is just another name for the
  1684. inherited selector.)
  1685. @constant kAudioDevicePropertyChannelCategoryName
  1686. A CFString that contains a human readable name for the category of the given
  1687. element in the given scope. The caller is responsible for releasing the
  1688. returned CFObject.
  1689. (kAudioObjectPropertyElementCategoryName: CFStrings are better for
  1690. localization.)
  1691. @constant kAudioDevicePropertyChannelCategoryNameCFString
  1692. A CFString that contains a human readable name for the category of the given
  1693. element in the given scope. The caller is responsible for releasing the
  1694. returned CFObject.
  1695. (kAudioObjectPropertyElementCategoryName: This is just another name for the
  1696. inherited selector.)
  1697. @constant kAudioDevicePropertyChannelNumberName
  1698. A CFString that contains a human readable name for the number of the given
  1699. element in the given scope. The caller is responsible for releasing the
  1700. returned CFObject.
  1701. (kAudioObjectPropertyElementNumberName: CFStrings are better for
  1702. localization.)
  1703. @constant kAudioDevicePropertyChannelNumberNameCFString
  1704. A CFString that contains a human readable name for the number of the given
  1705. element in the given scope. The caller is responsible for releasing the
  1706. returned CFObject.
  1707. (kAudioObjectPropertyElementNumberName: This is just another name for the
  1708. inherited selector.)
  1709. @constant kAudioDevicePropertySupportsMixing
  1710. A UInt32 where a value of 1 means the AudioDevice supports mixing and a
  1711. value of 0 means that it doesn't and that all IO is performed in each
  1712. AudioStream's current physical format. This property is changed indirectly
  1713. by changing to a format that doesn't support mixing, such as AC-3. (The HAL
  1714. now vends it's format information with a flag indicating the mixability in
  1715. order to better support devices with streams that are both mixable and non-
  1716. mixable.)
  1717. @constant kAudioDevicePropertyStreamFormat
  1718. An AudioStreamBasicDescription that describes the current data format for
  1719. the AudioStream that contains the channel referred to by the element number.
  1720. (kAudioStreamPropertyVirtualFormat: Managing format information is
  1721. inherently an operation on AudioStreams, rather than AudioDevices. It is
  1722. confusing for the client to work with formats at the AudioDevice level and
  1723. has been shown to lead to programming mistakes by clients when working with
  1724. devices that have multiple streams.)
  1725. @constant kAudioDevicePropertyStreamFormats
  1726. An array of AudioStreamBasicDescriptions that describe the available data
  1727. formats for the AudioStream that contains the channel referred to by the
  1728. element number.
  1729. (kAudioStreamPropertyAvailableVirtualFormats: Managing format information is
  1730. inherently an operation on AudioStreams, rather than AudioDevices. It is
  1731. confusing for the client to work with formats at the AudioDevice level and
  1732. has been shown to lead to programming mistakes by clients when working with
  1733. devices that have multiple streams.)
  1734. @constant kAudioDevicePropertyStreamFormatSupported
  1735. An AudioStreamBasicDescription is passed in to query whether or not the
  1736. format is supported. A kAudioDeviceUnsupportedFormatError will be returned
  1737. if the format is not supported and kAudioHardwareNoError will be returned if
  1738. it is supported. AudioStreamBasicDescription fields set to 0 will be ignored
  1739. in the query, but otherwise values must match exactly.
  1740. (kAudioStreamPropertyAvailableVirtualFormats: The proper and most robust way
  1741. to find a format that the AudioStream can support is to get the list of
  1742. available formats and look through that rather than using this property.)
  1743. @constant kAudioDevicePropertyStreamFormatMatch
  1744. An AudioStreamBasicDescription is passed in and the AudioStream will modify
  1745. it to describe the best match, in the AudioDevice's opinion, for the given
  1746. format.
  1747. (kAudioStreamPropertyAvailableVirtualFormats: The proper and most robust way
  1748. to find a format that the AudioStream can support is to get the list of
  1749. available formats and look through that rather than using this property.)
  1750. @constant kAudioDevicePropertyDataSourceNameForID
  1751. This property translates the given data source item ID into a human readable
  1752. name using an AudioValueTranslation structure. The input data is the UInt32
  1753. holding the item ID to be translated and the output data is a buffer to hold
  1754. the name as a null terminated c-string.
  1755. (kAudioDevicePropertyDataSourceNameForIDCFString: CFStrings are better for
  1756. localization.)
  1757. @constant kAudioDevicePropertyClockSourceNameForID
  1758. This property translates the given clock source item ID into a human
  1759. readable name using an AudioValueTranslation structure. The input data is
  1760. the UInt32 holding the item ID to be translated and the output data is a
  1761. buffer to hold the name as a null terminated c-string.
  1762. (kAudioDevicePropertyClockSourceNameForIDCFString: CFStrings are better for
  1763. localization.)
  1764. @constant kAudioDevicePropertyPlayThruDestinationNameForID
  1765. This property translates the given play through destination item ID into a
  1766. human readable name using an AudioValueTranslation structure. The input data
  1767. is the UInt32 holding the item ID to be translated and the output data is a
  1768. buffer to hold the name as a null terminated c-string.
  1769. (kAudioDevicePropertyPlayThruDestinationNameForIDCFString: CFStrings are
  1770. better for localization.)
  1771. @constant kAudioDevicePropertyChannelNominalLineLevelNameForID
  1772. This property translates the given nominal line level item ID into a human
  1773. readable name using an AudioValueTranslation structure. The input data is
  1774. the UInt32 holding the item ID to be translated and the output data is a
  1775. buffer to hold the name as a null terminated c-string.
  1776. (kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString: CFStrings are
  1777. better for localization.)
  1778. }
  1779. const
  1780. kAudioDevicePropertyDeviceName = $6E616D65 (* 'name' *);
  1781. kAudioDevicePropertyDeviceNameCFString = kAudioObjectPropertyName;
  1782. kAudioDevicePropertyDeviceManufacturer = $6D616B72 (* 'makr' *);
  1783. kAudioDevicePropertyDeviceManufacturerCFString = kAudioObjectPropertyManufacturer;
  1784. kAudioDevicePropertyRegisterBufferList = $72627566 (* 'rbuf' *);
  1785. kAudioDevicePropertyBufferSize = $6273697A (* 'bsiz' *);
  1786. kAudioDevicePropertyBufferSizeRange = $62737A23 (* 'bsz#' *);
  1787. kAudioDevicePropertyChannelName = $63686E6D (* 'chnm' *);
  1788. kAudioDevicePropertyChannelNameCFString = kAudioObjectPropertyElementName;
  1789. kAudioDevicePropertyChannelCategoryName = $63636E6D (* 'ccnm' *);
  1790. kAudioDevicePropertyChannelCategoryNameCFString = kAudioObjectPropertyElementCategoryName;
  1791. kAudioDevicePropertyChannelNumberName = $636E6E6D (* 'cnnm' *);
  1792. kAudioDevicePropertyChannelNumberNameCFString = kAudioObjectPropertyElementNumberName;
  1793. kAudioDevicePropertySupportsMixing = $6D69783F (* 'mix?' *);
  1794. kAudioDevicePropertyStreamFormat = $73666D74 (* 'sfmt' *);
  1795. kAudioDevicePropertyStreamFormats = $73666D23 (* 'sfm#' *);
  1796. kAudioDevicePropertyStreamFormatSupported = $73666D3F (* 'sfm?' *);
  1797. kAudioDevicePropertyStreamFormatMatch = $73666D6D (* 'sfmm' *);
  1798. kAudioDevicePropertyDataSourceNameForID = $7373636E (* 'sscn' *);
  1799. kAudioDevicePropertyClockSourceNameForID = $6373636E (* 'cscn' *);
  1800. kAudioDevicePropertyPlayThruDestinationNameForID = $6D64646E (* 'mddn' *);
  1801. kAudioDevicePropertyChannelNominalLineLevelNameForID = $636E6C76 (* 'cnlv' *);
  1802. //==================================================================================================
  1803. //#pragma mark AudioDevice Functions
  1804. {!
  1805. @functiongroup AudioDevice
  1806. }
  1807. {!
  1808. @function AudioDeviceAddIOProc
  1809. @abstract Registers the given AudioDeviceIOProc with the AudioDevice.
  1810. @discussion A client may have multiple IOProcs for a given device, but the device is free to
  1811. only accept as many as it can handle. Note that it is not recommended for
  1812. clients to have more than a single IOProc registered at a time as this can be
  1813. wasteful of system resources. Rather, it is recommended that the client do any
  1814. necessary mixing itself so that only one IOProc is necessary.
  1815. @param inDevice
  1816. The AudioDevice to register the IOProc with.
  1817. @param inProc
  1818. The AudioDeviceIOProc to register.
  1819. @param inClientData
  1820. A pointer to client data that is passed back to the IOProc when it is
  1821. called.
  1822. @result An OSStatus indicating success or failure.
  1823. }
  1824. function AudioDeviceAddIOProc( inDevice: AudioDeviceID; inProc: AudioDeviceIOProc; inClientData: UnivPtr ): OSStatus; external name '_AudioDeviceAddIOProc';
  1825. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1826. {!
  1827. @function AudioDeviceRemoveIOProc
  1828. @abstract Unregisters the given AudioDeviceIOProc from the AudioDevice.
  1829. @param inDevice
  1830. The AudioDevice to unregister the IOProc from.
  1831. @param inProc
  1832. The AudioDeviceIOProc to unregister.
  1833. @result An OSStatus indicating success or failure.
  1834. }
  1835. function AudioDeviceRemoveIOProc( inDevice: AudioDeviceID; inProc: AudioDeviceIOProc ): OSStatus; external name '_AudioDeviceRemoveIOProc';
  1836. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1837. {!
  1838. @function AudioDeviceStart
  1839. @abstract Starts IO for the given AudioDeviceIOProc.
  1840. @param inDevice
  1841. The AudioDevice to start the IOProc on.
  1842. @param inProc
  1843. The AudioDeviceIOProc to start. Note that this can be NULL, which starts the
  1844. hardware regardless of whether or not there are any IOProcs registered. This
  1845. is necessary if any of the AudioDevice's timing services are to be used. A
  1846. balancing call to AudioDeviceStop with a NULL IOProc is required to stop the
  1847. hardware.
  1848. @result An OSStatus indicating success or failure.
  1849. }
  1850. function AudioDeviceStart( inDevice: AudioDeviceID; inProc: AudioDeviceIOProc ): OSStatus; external name '_AudioDeviceStart';
  1851. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1852. {!
  1853. @function AudioDeviceStartAtTime
  1854. @abstract Starts IO for the given AudioDeviceIOProc and aligns the IO cycle of the
  1855. AudioDevice with the given time.
  1856. @param inDevice
  1857. The AudioDevice to start the IOProc on.
  1858. @param inProc
  1859. The AudioDeviceIOProc to start. Note that this can be NULL, which starts the
  1860. hardware regardless of whether or not there are any IOProcs registered.
  1861. @param ioRequestedStartTime
  1862. A pointer to an AudioTimeStamp that, on entry, is the requested time to
  1863. start the IOProc. On exit, it will be the actual time the IOProc will start.
  1864. @param inFlags
  1865. A UInt32 containing flags that modify how this function behaves.
  1866. @result An OSStatus indicating success or failure.
  1867. kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
  1868. not support starting at a specific time and inProc and ioRequestedStartTime are
  1869. not NULL.
  1870. }
  1871. function AudioDeviceStartAtTime( inDevice: AudioDeviceID; inProc: AudioDeviceIOProc; ioRequestedStartTime: AudioTimeStampPtr; inFlags: UInt32 ): OSStatus; external name '_AudioDeviceStartAtTime';
  1872. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1873. {!
  1874. @function AudioDeviceStop
  1875. @abstract Stops IO for the given AudioDeviceIOProc.
  1876. @param inDevice
  1877. The AudioDevice to stop the IOProc on.
  1878. @param inProc
  1879. The AudioDeviceIOProc to stop.
  1880. @result An OSStatus indicating success or failure.
  1881. }
  1882. function AudioDeviceStop( inDevice: AudioDeviceID; inProc: AudioDeviceIOProc ): OSStatus; external name '_AudioDeviceStop';
  1883. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1884. {!
  1885. @function AudioDeviceRead
  1886. @abstract Read some data from an AudioDevice starting at the given time.
  1887. @discussion With the advent of aggregate devices, the need for AudioDeviceRead has gone
  1888. away. Consequently, this function is a good candidate for deprecation some day.
  1889. @param inDevice
  1890. The AudioDevice to read from.
  1891. @param inStartTime
  1892. An AudioTimeStamp indicating the time from which to read the data. In
  1893. general, the valid range of time (in frames) is from the current time minus
  1894. the maximum IO buffer size to the current time minus the safety offset.
  1895. @param outData
  1896. An AudioBufferList that must be the same size and shape as that returned by
  1897. kAudioDevicePropertyStreamConfiguration. Further, the AudioBufferList must
  1898. have been previously registered with the device via
  1899. kAudioDevicePropertyRegisterBufferList. On exit, the mDataSize fields will
  1900. be updated with the amount of data read.
  1901. @result An OSStatus indicating success or failure.
  1902. kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
  1903. not support direct reading.
  1904. }
  1905. function AudioDeviceRead( inDevice: AudioDeviceID; const (*var*) inStartTime: AudioTimeStamp; var outData: AudioBufferList ): OSStatus; external name '_AudioDeviceRead';
  1906. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  1907. {!
  1908. @function AudioDeviceGetCurrentTime
  1909. @abstract Retrieves the current time from an AudioDevice. Note that the device has to be
  1910. running.
  1911. @param inDevice
  1912. The AudioDevice to from which to get the time.
  1913. @param outTime
  1914. An AudioTimeStamp into which the current time is put.
  1915. @result An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
  1916. returned if the AudioDevice isn't running.
  1917. }
  1918. function AudioDeviceGetCurrentTime( inDevice: AudioDeviceID; var outTime: AudioTimeStamp ): OSStatus; external name '_AudioDeviceGetCurrentTime';
  1919. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1920. {!
  1921. @function AudioDeviceTranslateTime
  1922. @abstract Translates the time in the AudioDevice's time base from one representation to
  1923. another. Note that the device has to be running
  1924. @param inDevice
  1925. The AudioDevice whose time base governs the translation.
  1926. @param inTime
  1927. An AudioTimeStamp containing the time to be translated.
  1928. @param outTime
  1929. An AudioTimeStamp into which the translated time is put. On entry, the
  1930. mFlags field specifies which representations to translate the input time
  1931. into. Because not every device supports all time representations, on exit,
  1932. the mFlags field will indicate which translations were actually done.
  1933. @result An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
  1934. returned if the AudioDevice isn't running.
  1935. }
  1936. function AudioDeviceTranslateTime( inDevice: AudioDeviceID; const (*var*) inTime: AudioTimeStamp; var outTime: AudioTimeStamp ): OSStatus; external name '_AudioDeviceTranslateTime';
  1937. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1938. {!
  1939. @function AudioDeviceGetNearestStartTime
  1940. @abstract Query an AudioDevice to get a time equal to or later than the given time that is
  1941. the best time to start IO.
  1942. @discussion The time that is returned is dictated by the constraints of the device and the
  1943. system. For instance, the driver of a device that provides both audio and video
  1944. data may only allow start times that coincide with the edge of a video frame.
  1945. Also, if the device already has one or more active IOProcs, the start time will
  1946. be shifted to the beginning of the next IO cycle so as not to cause
  1947. discontinuities in the existing IOProcs. Another reason the start time may shift
  1948. is to allow for aligning the buffer accesses in an optimal fashion. Note that
  1949. the device must be running to use this function.
  1950. @param inDevice
  1951. The AudioDevice to query.
  1952. @param ioRequestedStartTime
  1953. A pointer to an AudioTimeStamp that, on entry, is the requested start time.
  1954. On exit, it will have the a time equal to or later than the requested time,
  1955. as dictated by the device's constraints.
  1956. @param inFlags
  1957. A UInt32 containing flags that modify how this function behaves.
  1958. @result An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
  1959. returned if the AudioDevice isn't running.
  1960. kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
  1961. not support starting at a specific time.
  1962. }
  1963. function AudioDeviceGetNearestStartTime( inDevice: AudioDeviceID; var ioRequestedStartTime: AudioTimeStamp; inFlags: UInt32 ): OSStatus; external name '_AudioDeviceGetNearestStartTime';
  1964. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1965. {!
  1966. @function AudioDeviceGetPropertyInfo
  1967. @abstract Retrieve information about the given property of an AudioDevice.
  1968. @discussion Note that the same functionality is provided by the functions
  1969. AudioObjectHasProperty(), AudioObjectIsPropertySettable(), and
  1970. AudioObjectGetPropertyDataSize().
  1971. @param inDevice
  1972. The AudioDevice to query.
  1973. @param inChannel
  1974. The channel of the property to query where 0 is the master channel.
  1975. @param isInput
  1976. Which section of the AudioDevice to query.
  1977. @param inPropertyID
  1978. The AudioDevicePropertyID of the property to query.
  1979. @param outSize
  1980. A pointer to a UInt32 that receives the size of the property data in bytes
  1981. on exit. This can be NULL if the size information is not being requested.
  1982. @param outWritable
  1983. A pointer to a Boolean that receives indication of whether or not the given
  1984. property can be set. This can be NULL if the writability is not being
  1985. requested.
  1986. @result An OSStatus indicating success or failure.
  1987. }
  1988. function AudioDeviceGetPropertyInfo( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; outSize: UInt32Ptr; outWritable: BooleanPtr ): OSStatus; external name '_AudioDeviceGetPropertyInfo';
  1989. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1990. {!
  1991. @function AudioDeviceGetProperty
  1992. @abstract Queries an the AudioDevice object to get the data of the given property and
  1993. places it in the provided buffer.
  1994. @discussion Note that the same functionality is provided by the function
  1995. AudioObjectGetPropertyData().
  1996. @param inDevice
  1997. The AudioDevice to query.
  1998. @param inChannel
  1999. The channel of the property to query where 0 is the master channel.
  2000. @param isInput
  2001. Which section of the AudioDevice to query.
  2002. @param inPropertyID
  2003. The AudioDevicePropertyID of the property to query.
  2004. @param ioPropertyDataSize
  2005. A UInt32 which on entry indicates the size of the buffer pointed to by
  2006. outData and on exit indicates how much of the buffer was used.
  2007. @param outPropertyData
  2008. The buffer into which the object will put the data for the given property.
  2009. @result An OSStatus indicating success or failure.
  2010. }
  2011. function AudioDeviceGetProperty( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; var ioPropertyDataSize: UInt32; outPropertyData: UnivPtr ): OSStatus; external name '_AudioDeviceGetProperty';
  2012. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  2013. {!
  2014. @function AudioDeviceSetProperty
  2015. @abstract Tells the AudioDevice object to change the value of the given property using the
  2016. provided data.
  2017. @discussion Note that the value of the property should not be considered changed until the
  2018. HAL has called the listeners as many properties values are changed
  2019. asynchronously. Also note that the same functionality is provided by the
  2020. function AudioObjectGetPropertyData().
  2021. @param inDevice
  2022. The AudioDevice to change.
  2023. @param inWhen
  2024. A pointer to an AudioTimeStamp that says when to change the property's value
  2025. relative to the device's time base. NULL means execute the change
  2026. immediately.
  2027. @param inChannel
  2028. The channel of the property to change where 0 is the master channel.
  2029. @param isInput
  2030. Which section of the AudioDevice to change.
  2031. @param inPropertyID
  2032. The AudioDevicePropertyID of the property to change.
  2033. @param inPropertyDataSize
  2034. A UInt32 indicating the size of the buffer pointed to by inData.
  2035. @param inPropertyData
  2036. The buffer containing the data to be used to change the property's value.
  2037. @result An OSStatus indicating success or failure.
  2038. }
  2039. function AudioDeviceSetProperty( inDevice: AudioDeviceID; inWhen: {const} AudioTimeStampPtr; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; inPropertyDataSize: UInt32; inPropertyData: {const} UnivPtr ): OSStatus; external name '_AudioDeviceSetProperty';
  2040. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  2041. {!
  2042. @function AudioDeviceAddPropertyListener
  2043. @abstract Registers the given AudioDevicePropertyListenerProc to receive notifications
  2044. when the given property changes.
  2045. @discussion Note that the same functionality is provided by AudioObjectAddPropertyListener
  2046. in conjunction with AudioObjectPropertyListenerProc.
  2047. @param inDevice
  2048. The AudioDevice with whom to register the listener.
  2049. @param inChannel
  2050. The channel of the property to listen to.
  2051. @param isInput
  2052. Which section of the AudioDevice to listen to.
  2053. @param inPropertyID
  2054. The AudioDevicePropertyID of the property to listen to.
  2055. @param inProc
  2056. AudioDevicePropertyListenerProc to call.
  2057. @param inClientData
  2058. A pointer to client data that is passed to the listener when it is called.
  2059. @result An OSStatus indicating success or failure.
  2060. }
  2061. function AudioDeviceAddPropertyListener( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; inProc: AudioDevicePropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioDeviceAddPropertyListener';
  2062. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  2063. {!
  2064. @function AudioDeviceRemovePropertyListener
  2065. @abstract Unregisters the given AudioDevicePropertyListenerProc from receiving
  2066. notifications when the given property changes.
  2067. @discussion Note that the same functionality is provided by
  2068. AudioObjectRemovePropertyListener in conjunction with
  2069. AudioObjectPropertyListenerProc.
  2070. @param inDevice
  2071. The AudioDevice with whom to unregister the listener.
  2072. @param inChannel
  2073. The channel of the property to unregister from.
  2074. @param isInput
  2075. Which section of the AudioDevice to unregister from.
  2076. @param inPropertyID
  2077. The AudioDevicePropertyID of the property to stop listening to.
  2078. @param inProc
  2079. AudioDevicePropertyListenerProc to unregister.
  2080. @result An OSStatus indicating success or failure.
  2081. }
  2082. function AudioDeviceRemovePropertyListener( inDevice: AudioDeviceID; inChannel: UInt32; isInput: Boolean; inPropertyID: AudioDevicePropertyID; inProc: AudioDevicePropertyListenerProc ): OSStatus; external name '_AudioDeviceRemovePropertyListener';
  2083. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  2084. //==================================================================================================
  2085. //#pragma mark AudioStream Types
  2086. {!
  2087. @typedef AudioStreamID
  2088. @abstract AudioStream is the base class for all objects that represent a stream of data on
  2089. an audio device.
  2090. @discussion AudioStream is a subclass of AudioObject and can contain AudioControls.
  2091. }
  2092. type
  2093. AudioStreamID = AudioObjectID;
  2094. {!
  2095. @struct AudioStreamRangedDescription
  2096. @abstract This structure allows a specific sample rate range to be associated with an
  2097. AudioStreamBasicDescription that specifies it's sample rate as
  2098. kAudioStreamAnyRate.
  2099. @discussion Note that this structure is only used to desicribe the the available formats
  2100. for a stream. It is not used for the current format.
  2101. @field mFormat
  2102. The AudioStreamBasicDescription that describes the format of the stream.
  2103. Note that the mSampleRate field of the structure will be the same as the
  2104. the values in mSampleRateRange when only a single sample rate is supported.
  2105. It will be kAudioStreamAnyRate when there is a range with more elements.
  2106. @field mSampleRateRange
  2107. The AudioValueRange that describes the minimum and maximum sample rate for
  2108. the stream. If the mSampleRate field of mFormat is kAudioStreamAnyRate the
  2109. format supports the range of sample rates described by this structure.
  2110. Otherwise, the minimum will be the same as the maximum which will be the
  2111. same as the mSampleRate field of mFormat.
  2112. }
  2113. type
  2114. AudioStreamRangedDescription = record
  2115. mFormat: AudioStreamBasicDescription;
  2116. mSampleRateRange: AudioValueRange;
  2117. end;
  2118. {!
  2119. @typedef AudioStreamPropertyListenerProc
  2120. @abstract Clients register an AudioStreamPropertyListenerProc with the AudioStream object
  2121. in order to receive notifications when the properties of the object change.
  2122. @discussion Note that the same functionality is provided by AudioObjectPropertyListenerProc.
  2123. @param inStream
  2124. The AudioStream whose property has changed.
  2125. @param inChannel
  2126. The channel of the property that changed where 0 is the master channel.
  2127. @param inPropertyID
  2128. The AudioDevicePropertyID of the property that changed.
  2129. @param inClientData
  2130. A pointer to client data established when the listener proc was registered
  2131. with the object.
  2132. @result The return value is currently unused and should always be 0.
  2133. }
  2134. type
  2135. AudioStreamPropertyListenerProc = function( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; inClientData: UnivPtr ): OSStatus;
  2136. //==================================================================================================
  2137. //#pragma mark AudioStream Constants
  2138. {!
  2139. @enum AudioStream Class Constants
  2140. @abstract Various constants related to AudioStreams.
  2141. @constant kAudioStreamClassID
  2142. The AudioClassID that identifies the AudioStream class.
  2143. @constant kAudioStreamUnknown
  2144. The AudioObjectID for a nonexistent AudioObject.
  2145. }
  2146. const
  2147. kAudioStreamClassID = $61737472 (* 'astr' *);
  2148. kAudioStreamUnknown = kAudioObjectUnknown;
  2149. //==================================================================================================
  2150. //#pragma mark AudioStream Properties
  2151. {!
  2152. @enum AudioStream Properties
  2153. @abstract AudioObjectPropertySelector values that apply to all AudioStreams.
  2154. @discussion AudioStream is a subclass of AudioObject and has only the single scope,
  2155. kAudioObjectPropertyScopeGlobal. They have a master element and an element for
  2156. each channel in the stream numbered upward from 1. Note that AudioStream objects
  2157. share AudioControl objects with their owning AudioDevice. Consequently, all the
  2158. standard AudioControl related property selectors implemented by AudioDevices are
  2159. also implemented by AudioStreams. The same constants are to be used for such
  2160. properties.
  2161. @constant kAudioStreamPropertyDirection
  2162. A UInt32 where a value of 0 means that this AudioStream is an output stream
  2163. and a value of 1 means that it is an input stream.
  2164. @constant kAudioStreamPropertyTerminalType
  2165. A UInt32 whose value describes the general kind of functionality attached
  2166. to the AudioStream. Constants that describe some of the values of this
  2167. property are defined in <IOKit/audio/IOAudioTypes.h>
  2168. @constant kAudioStreamPropertyStartingChannel
  2169. A UInt32 that specifies the first element in the owning device that
  2170. corresponds to element one of this stream.
  2171. @constant kAudioStreamPropertyLatency
  2172. A UInt32 containing the number of frames of latency in the AudioStream. Note
  2173. that the owning AudioDevice may have additional latency so it should be
  2174. queried as well. If both the device and the stream say they have latency,
  2175. then the total latency for the stream is the device latency summed with the
  2176. stream latency.
  2177. @constant kAudioStreamPropertyVirtualFormat
  2178. An AudioStreamBasicDescription that describes the current data format for
  2179. the AudioStream. The virtual format refers to the data format in which all
  2180. IOProcs for the owning AudioDevice will perform IO transactions.
  2181. @constant kAudioStreamPropertyAvailableVirtualFormats
  2182. An array of AudioStreamRangedDescriptions that describe the available data
  2183. formats for the AudioStream. The virtual format refers to the data format in
  2184. which all IOProcs for the owning AudioDevice will perform IO transactions.
  2185. @constant kAudioStreamPropertyPhysicalFormat
  2186. An AudioStreamBasicDescription that describes the current data format for
  2187. the AudioStream. The physical format refers to the data format in which the
  2188. hardware for the owning AudioDevice performs it's IO transactions.
  2189. @constant kAudioStreamPropertyAvailablePhysicalFormats
  2190. An array of AudioStreamRangedDescriptions that describe the available data
  2191. formats for the AudioStream. The physical format refers to the data format
  2192. in which the hardware for the owning AudioDevice performs it's IO
  2193. transactions.
  2194. }
  2195. const
  2196. kAudioStreamPropertyDirection = $73646972 (* 'sdir' *);
  2197. kAudioStreamPropertyTerminalType = $7465726D (* 'term' *);
  2198. kAudioStreamPropertyStartingChannel = $7363686E (* 'schn' *);
  2199. kAudioStreamPropertyLatency = kAudioDevicePropertyLatency;
  2200. kAudioStreamPropertyVirtualFormat = $73666D74 (* 'sfmt' *);
  2201. kAudioStreamPropertyAvailableVirtualFormats = $73666D61 (* 'sfma' *);
  2202. kAudioStreamPropertyPhysicalFormat = $70667420 (* 'pft ' *);
  2203. kAudioStreamPropertyAvailablePhysicalFormats = $70667461 (* 'pfta' *);
  2204. {!
  2205. @enum AudioStream Properties That Ought To Some Day Be Deprecated
  2206. @abstract AudioObjectPropertySelector values whose functionality is better provided by
  2207. other selectors.
  2208. @discussion These selectors are still provided for backward compatibility. The description
  2209. of the property will indicate in parentheses the better selectors to use and
  2210. why.
  2211. @constant kAudioStreamPropertyOwningDevice
  2212. The AudioObjectID of the AudioDevice of which this AudioStream is a part.
  2213. (kAudioObjectPropertyOwner: This is just another name for the inherited
  2214. selector.)
  2215. @constant kAudioStreamPropertyPhysicalFormats
  2216. An array of AudioStreamBasicDescriptions that describe the available data
  2217. formats for the AudioStream. The physical format refers to the data format
  2218. in which the hardware for the owning AudioDevice performs it's IO
  2219. transactions.
  2220. (kAudioStreamPropertyAvailablePhysicalFormats: The new name for this
  2221. property is much clearer for readers of the API to see what is meant and the
  2222. AudioStreamRangedDescription structure provides better information.)
  2223. @constant kAudioStreamPropertyPhysicalFormatSupported
  2224. An AudioStreamBasicDescription is passed in to query whether or not the
  2225. format is supported. A kAudioDeviceUnsupportedFormatError will be returned
  2226. if the format is not supported and kAudioHardwareNoError will be returned if
  2227. it is supported. AudioStreamBasicDescription fields set to 0 will be ignored
  2228. in the query, but otherwise values must match exactly. The physical format
  2229. refers to the data format in which the hardware for the owning AudioDevice
  2230. performs it's IO transactions.
  2231. (kAudioStreamPropertyAvailablePhysicalFormats: The proper and most robust
  2232. way to find a format that the AudioStream can support is to get the list of
  2233. available formats and look through that rather than using this property.)
  2234. @constant kAudioStreamPropertyPhysicalFormatMatch
  2235. An AudioStreamBasicDescription is passed in and the AudioStream will modify
  2236. it to describe the best match, in the AudioDevice's opinion, for the given
  2237. format. The physical format refers to the data format in which the hardware
  2238. for the owning AudioDevice performs it's IO transactions.
  2239. (kAudioStreamPropertyAvailablePhysicalFormats: The proper and most robust
  2240. way to find a format that the AudioStream can support is to get the list of
  2241. available formats and look through that rather than using this property.)
  2242. }
  2243. const
  2244. kAudioStreamPropertyOwningDevice = kAudioObjectPropertyOwner;
  2245. kAudioStreamPropertyPhysicalFormats = $70667423 (* 'pft#' *);
  2246. kAudioStreamPropertyPhysicalFormatSupported = $7066743F (* 'pft?' *);
  2247. kAudioStreamPropertyPhysicalFormatMatch = $7066746D (* 'pftm' *);
  2248. //==================================================================================================
  2249. //#pragma mark AudioStream Functions
  2250. {!
  2251. @functiongroup AudioStream
  2252. }
  2253. {!
  2254. @function AudioStreamGetPropertyInfo
  2255. @abstract Retrieve information about the given property of an AudioStream.
  2256. @param inStream
  2257. The AudioStream to query.
  2258. @param inChannel
  2259. The channel of the property to query where 0 is the master channel.
  2260. @param inPropertyID
  2261. The AudioDevicePropertyID of the property to query.
  2262. @param outSize
  2263. A pointer to a UInt32 that receives the size of the property data in bytes
  2264. on exit. This can be NULL if the size information is not being requested.
  2265. @param outWritable
  2266. A pointer to a Boolean that receives indication of whether or not the given
  2267. property can be set. This can be NULL if the writability is not being
  2268. requested.
  2269. @result An OSStatus indicating success or failure.
  2270. }
  2271. function AudioStreamGetPropertyInfo( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; var outSize: UInt32; var outWritable: Boolean ): OSStatus; external name '_AudioStreamGetPropertyInfo';
  2272. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  2273. {!
  2274. @function AudioStreamGetProperty
  2275. @abstract Queries an the AudioStream object to get the data of the given property and
  2276. places it in the provided buffer.
  2277. @discussion Note that the same functionality is provided by the function
  2278. AudioObjectGetPropertyData().
  2279. @param inStream
  2280. The AudioStream to query.
  2281. @param inChannel
  2282. The channel of the property to query where 0 is the master channel.
  2283. @param inPropertyID
  2284. The AudioDevicePropertyID of the property to query.
  2285. @param ioPropertyDataSize
  2286. A UInt32 which on entry indicates the size of the buffer pointed to by
  2287. outData and on exit indicates how much of the buffer was used.
  2288. @param outPropertyData
  2289. The buffer into which the object will put the data for the given property.
  2290. @result An OSStatus indicating success or failure.
  2291. }
  2292. function AudioStreamGetProperty( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; var ioPropertyDataSize: UInt32; outPropertyData: UnivPtr ): OSStatus; external name '_AudioStreamGetProperty';
  2293. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  2294. {!
  2295. @function AudioStreamSetProperty
  2296. @abstract Tells the AudioStream object to change the value of the given property using the
  2297. provided data.
  2298. @discussion Note that the value of the property should not be considered changed until the
  2299. HAL has called the listeners as many properties values are changed
  2300. asynchronously. Also note that the same functionality is provided by the
  2301. function AudioObjectGetPropertyData().
  2302. @param inStream
  2303. The AudioStream to change.
  2304. @param inWhen
  2305. A pointer to an AudioTimeStamp that says when to change the property's value
  2306. relative to the device's time base. NULL means execute the change
  2307. immediately.
  2308. @param inChannel
  2309. The channel of the property to change where 0 is the master channel.
  2310. @param inPropertyID
  2311. The AudioDevicePropertyID of the property to change.
  2312. @param inPropertyDataSize
  2313. A UInt32 indicating the size of the buffer pointed to by inData.
  2314. @param inPropertyData
  2315. The buffer containing the data to be used to change the property's value.
  2316. @result An OSStatus indicating success or failure.
  2317. }
  2318. function AudioStreamSetProperty( inStream: AudioStreamID; inWhen: AudioTimeStampPtr; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; inPropertyDataSize: UInt32; inPropertyData: {const} UnivPtr ): OSStatus; external name '_AudioStreamSetProperty';
  2319. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  2320. {!
  2321. @function AudioStreamAddPropertyListener
  2322. @abstract Registers the given AudioStreamPropertyListenerProc to receive notifications
  2323. when the given property changes.
  2324. @discussion Note that the same functionality is provided by AudioObjectAddPropertyListener
  2325. in conjunction with AudioObjectPropertyListenerProc.
  2326. @param inStream
  2327. The AudioStream with whom to register the listener.
  2328. @param inChannel
  2329. The channel of the property to listen to.
  2330. @param inPropertyID
  2331. The AudioDevicePropertyID of the property to listen to.
  2332. @param inProc
  2333. AudioStreamPropertyListenerProc to call.
  2334. @param inClientData
  2335. A pointer to client data that is passed to the listener when it is called.
  2336. @result An OSStatus indicating success or failure.
  2337. }
  2338. function AudioStreamAddPropertyListener( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; inProc: AudioStreamPropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioStreamAddPropertyListener';
  2339. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  2340. {!
  2341. @function AudioStreamRemovePropertyListener
  2342. @abstract Unregisters the given AudioStreamPropertyListenerProc from receiving
  2343. notifications when the given property changes.
  2344. @discussion Note that the same functionality is provided by
  2345. AudioObjectRemovePropertyListener in conjunction with
  2346. AudioObjectPropertyListenerProc.
  2347. @param inStream
  2348. The AudioStream with whom to unregister the listener.
  2349. @param inChannel
  2350. The channel of the property to unregister from.
  2351. @param inPropertyID
  2352. The AudioDevicePropertyID of the property to stop listening to.
  2353. @param inProc
  2354. AudioStreamPropertyListenerProc to unregister.
  2355. @result An OSStatus indicating success or failure.
  2356. }
  2357. function AudioStreamRemovePropertyListener( inStream: AudioStreamID; inChannel: UInt32; inPropertyID: AudioDevicePropertyID; inProc: AudioStreamPropertyListenerProc ): OSStatus; external name '_AudioStreamRemovePropertyListener';
  2358. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  2359. //==================================================================================================
  2360. //#pragma mark AudioAggregateDevice Constants
  2361. {!
  2362. @enum AudioAggregateDevice Class Constants
  2363. @abstract Various constants related to AudioAggregateDevices.
  2364. @constant kAudioAggregateDeviceClassID
  2365. The AudioClassID that identifies the AudioAggregateDevice class.
  2366. @constant kAudioDeviceTransportTypeAggregate
  2367. The transport type ID (see kAudioDevicePropertyTransportType) for aggregate
  2368. devices.
  2369. @constant kAudioDeviceTransportTypeAutoAggregate
  2370. The transport type ID (see kAudioDevicePropertyTransportType) for
  2371. automatically generated aggregate devices.
  2372. }
  2373. const
  2374. kAudioAggregateDeviceClassID = $61616767 (* 'aagg' *);
  2375. kAudioDeviceTransportTypeAggregate = $67727570 (* 'grup' *);
  2376. kAudioDeviceTransportTypeAutoAggregate = $66677270 (* 'fgrp' *);
  2377. {!
  2378. @defined kAudioAggregateDeviceUIDKey
  2379. @discussion The key used in a CFDictionary that describes the composition of an
  2380. AudioAggregateDevice. The value for this key is a CFString that contains the UID
  2381. of the AudioAggregateDevice.
  2382. }
  2383. const
  2384. kAudioAggregateDeviceUIDKey = 'uid';
  2385. {!
  2386. @defined kAudioAggregateDeviceNameKey
  2387. @discussion The key used in a CFDictionary that describes the composition of an
  2388. AudioAggregateDevice. The value for this key is a CFString that contains the
  2389. human readable name of the AudioAggregateDevice.
  2390. }
  2391. const
  2392. kAudioAggregateDeviceNameKey = 'name';
  2393. {!
  2394. @defined kAudioAggregateDeviceSubDeviceListKey
  2395. @discussion The key used in a CFDictionary that describes the composition of an
  2396. AudioAggregateDevice. The value for this key is a CFArray of CFDictionaries that
  2397. describe each sub-device in the AudioAggregateDevice. The keys for this
  2398. CFDictionary are defined in the AudioSubDevice section.
  2399. }
  2400. const
  2401. kAudioAggregateDeviceSubDeviceListKey = 'subdevices';
  2402. {!
  2403. @defined kAudioAggregateDeviceMasterSubDeviceKey
  2404. @discussion The key used in a CFDictionary that describes the composition of an
  2405. AudioAggregateDevice. The value for this key is a CFString that contains the
  2406. UID for the sub-device that is the master time source for the
  2407. AudioAggregateDevice.
  2408. }
  2409. const
  2410. kAudioAggregateDeviceMasterSubDeviceKey = 'master';
  2411. {!
  2412. @defined kAudioAggregateDeviceIsPrivateKey
  2413. @discussion The key used in a CFDictionary that describes the composition of an
  2414. AudioAggregateDevice. The value for this key is a CFNumber where a value of 0
  2415. means that the AudioAggregateDevice is to be published to the entire system and
  2416. a value of 1 means that the AudioAggregateDevice is private to the process that
  2417. created it. Note that a private AudioAggregateDevice is not persistent across
  2418. launches of the process that created it. Note that if this key is not present,
  2419. it implies that the AudioAggregateDevice is published to the entire system.
  2420. }
  2421. const
  2422. kAudioAggregateDeviceIsPrivateKey = 'private';
  2423. //==================================================================================================
  2424. //#pragma mark AudioAggregateDevice Properties
  2425. {!
  2426. @enum AudioAggregateDevice Properties
  2427. @abstract AudioObjectPropertySelector values that apply to all AudioAggregateDevices.
  2428. @discussion AudioAggregateDevice is a subclass of AudioDevice.
  2429. @constant kAudioAggregateDevicePropertyFullSubDeviceList
  2430. A CFArray of CFStrings that contain the UIDs of all the devices, active or
  2431. inactive, contained in the AudioAggregateDevice. The order of the items in
  2432. the array is significant and is used to determine the order of the streams
  2433. of the AudioAggregateDevice. The caller is responsible for releasing the
  2434. returned CFObject.
  2435. @constant kAudioAggregateDevicePropertyActiveSubDeviceList
  2436. An array of AudioObjectIDs for all the active sub-devices in the aggregate
  2437. device.
  2438. @constant kAudioAggregateDevicePropertyComposition
  2439. A CFDictionary that describes the composition of the AudioAggregateDevice.
  2440. The keys for this CFDicitionary are defined in the AudioAggregateDevice
  2441. Constants section.
  2442. }
  2443. const
  2444. kAudioAggregateDevicePropertyFullSubDeviceList = $67727570 (* 'grup' *);
  2445. kAudioAggregateDevicePropertyActiveSubDeviceList = $61677270 (* 'agrp' *);
  2446. kAudioAggregateDevicePropertyComposition = $61636F6D (* 'acom' *);
  2447. {!
  2448. @enum AudioAggregateDevice Properties Implemented via AudioControl objects
  2449. @abstract AudioObjectPropertySelector values for AudioAggregateDevice properties that are
  2450. implemented by AudioControl objects.
  2451. @discussion These properties are also accessible by locating the AudioControl object
  2452. attached to the AudioAggregateDevice and using that object to access the
  2453. properties of the control.
  2454. @constant kAudioAggregateDevicePropertyMasterSubDevice
  2455. A CFString that contains the UID for the AudioDevice that is currently
  2456. serving as the master time base of the aggregate device. This property is
  2457. also implemented by the AudioClockSourceControl on the master element of the
  2458. global scope of the AudioAggregateDevice.
  2459. }
  2460. const
  2461. kAudioAggregateDevicePropertyMasterSubDevice = $616D7374 (* 'amst' *);
  2462. //==================================================================================================
  2463. //#pragma mark AudioSubDevice Constants
  2464. {!
  2465. @enum AudioSubDevice Class Constants
  2466. @abstract Various constants related to AudioSubDevices.
  2467. @constant kAudioSubDeviceClassID
  2468. The AudioClassID that identifies the AudioSubDevice class.
  2469. }
  2470. const
  2471. kAudioSubDeviceClassID = $61737562 (* 'asub' *);
  2472. {!
  2473. @enum AudioSubDevice Clock Drift Compensation Methods
  2474. @abstract Constants that describe the range of values the property
  2475. kAudioSubDevicePropertyDriftCompensation. It is a continuous range from
  2476. kAudioSubDeviceDriftCompensationMinQuality to
  2477. kAudioSubDeviceDriftCompensationMaxQuality, with some commonly used settings
  2478. called out.
  2479. }
  2480. const
  2481. kAudioSubDeviceDriftCompensationMinQuality = 0;
  2482. kAudioSubDeviceDriftCompensationLowQuality = $20;
  2483. kAudioSubDeviceDriftCompensationMediumQuality = $40;
  2484. kAudioSubDeviceDriftCompensationHighQuality = $60;
  2485. kAudioSubDeviceDriftCompensationMaxQuality = $7F;
  2486. {!
  2487. @defined kAudioSubDeviceUIDKey
  2488. @discussion The key used in a CFDictionary that describes the state of an AudioSubDevice.
  2489. The value for this key is a CFString that contains the UID for the
  2490. AudioSubDevice.
  2491. }
  2492. const
  2493. kAudioSubDeviceUIDKey = 'uid';
  2494. //==================================================================================================
  2495. //#pragma mark AudioSubDevice Properties
  2496. {!
  2497. @enum AudioSubDevice Properties
  2498. @abstract AudioObjectPropertySelector values that apply to all AudioSubDevices.
  2499. @discussion AudioSubDevice is a subclass of AudioDevice that is collected together with
  2500. other sub-devices in an AudioAggregateDevice. AudioSubDevice objects do not
  2501. implement an IO path nor any AudioDevice properties associated with the IO path.
  2502. They also don't have any streams.
  2503. @constant kAudioSubDevicePropertyExtraLatency
  2504. A Float64 indicating the number of sample frames to add to or subtract from
  2505. the latency compensation used for this AudioSubDevice.
  2506. @constant kAudioSubDevicePropertyDriftCompensation
  2507. A UInt32 where a value of 0 indicates that no drift compensation should be
  2508. done for this AudioSubDevice and a value of 1 means that it should.
  2509. @constant kAudioSubDevicePropertyDriftCompensationQuality
  2510. A UInt32 that controls the trade-off between quality and CPU load in the
  2511. drift compensation. The range of values is from 0 to 128, where the lower
  2512. the number, the worse the quality but also the less CPU is used to do the
  2513. compensation.
  2514. }
  2515. const
  2516. kAudioSubDevicePropertyExtraLatency = $786C7463 (* 'xltc' *);
  2517. kAudioSubDevicePropertyDriftCompensation = $64726674 (* 'drft' *);
  2518. kAudioSubDevicePropertyDriftCompensationQuality = $64726671 (* 'drfq' *);
  2519. //==================================================================================================
  2520. end.