1 {==================================================================================================
2      File:       CoreAudio/AudioHardware.h
3 
4      Contains:   API for communicating with audio hardware.
5 
6      Copyright:  (c) 1985-2011 by Apple, Inc., all rights reserved.
7 
8      Bugs?:      For bug reports, consult the following page on
9                  the World Wide Web:
10 
11                      http://bugs.freepascal.org
12 
13 ==================================================================================================}
14 {  Pascal Translation:  Gale R Paeper, <gpaeper@empirenet.com>, 2006 }
15 {  Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2009 }
16 {  Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, October 2012 }
17 {
18     Modified for use with Free Pascal
19     Version 308
20     Please report any bugs to <gpc@microbizz.nl>
21 }
22 
23 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
24 {$mode macpas}
25 {$modeswitch cblocks}
26 {$packenum 1}
27 {$macro on}
28 {$inline on}
29 {$calling mwpascal}
30 
31 unit AudioHardware;
32 interface
33 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
34 {$setc GAP_INTERFACES_VERSION := $0308}
35 
36 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
37     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
38 {$endc}
39 
40 {$ifc defined CPUPOWERPC and defined CPUI386}
41 	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
42 {$endc}
43 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
44 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
45 {$endc}
46 
47 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
48 	{$setc __ppc__ := 1}
49 {$elsec}
50 	{$setc __ppc__ := 0}
51 {$endc}
52 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
53 	{$setc __ppc64__ := 1}
54 {$elsec}
55 	{$setc __ppc64__ := 0}
56 {$endc}
57 {$ifc not defined __i386__ and defined CPUI386}
58 	{$setc __i386__ := 1}
59 {$elsec}
60 	{$setc __i386__ := 0}
61 {$endc}
62 {$ifc not defined __x86_64__ and defined CPUX86_64}
63 	{$setc __x86_64__ := 1}
64 {$elsec}
65 	{$setc __x86_64__ := 0}
66 {$endc}
67 {$ifc not defined __arm__ and defined CPUARM}
68 	{$setc __arm__ := 1}
69 {$elsec}
70 	{$setc __arm__ := 0}
71 {$endc}
72 {$ifc not defined __arm64__ and defined CPUAARCH64}
73   {$setc __arm64__ := 1}
74 {$elsec}
75   {$setc __arm64__ := 0}
76 {$endc}
77 
78 {$ifc defined cpu64}
79   {$setc __LP64__ := 1}
80 {$elsec}
81   {$setc __LP64__ := 0}
82 {$endc}
83 
84 
85 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
86 	{$error Conflicting definitions for __ppc__ and __i386__}
87 {$endc}
88 
89 {$ifc defined __ppc__ and __ppc__}
90 	{$setc TARGET_CPU_PPC := TRUE}
91 	{$setc TARGET_CPU_PPC64 := FALSE}
92 	{$setc TARGET_CPU_X86 := FALSE}
93 	{$setc TARGET_CPU_X86_64 := FALSE}
94 	{$setc TARGET_CPU_ARM := FALSE}
95 	{$setc TARGET_CPU_ARM64 := FALSE}
96 	{$setc TARGET_OS_MAC := TRUE}
97 	{$setc TARGET_OS_IPHONE := FALSE}
98 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
99 	{$setc TARGET_OS_EMBEDDED := FALSE}
100 {$elifc defined __ppc64__ and __ppc64__}
101 	{$setc TARGET_CPU_PPC := FALSE}
102 	{$setc TARGET_CPU_PPC64 := TRUE}
103 	{$setc TARGET_CPU_X86 := FALSE}
104 	{$setc TARGET_CPU_X86_64 := FALSE}
105 	{$setc TARGET_CPU_ARM := FALSE}
106 	{$setc TARGET_CPU_ARM64 := FALSE}
107 	{$setc TARGET_OS_MAC := TRUE}
108 	{$setc TARGET_OS_IPHONE := FALSE}
109 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
110 	{$setc TARGET_OS_EMBEDDED := FALSE}
111 {$elifc defined __i386__ and __i386__}
112 	{$setc TARGET_CPU_PPC := FALSE}
113 	{$setc TARGET_CPU_PPC64 := FALSE}
114 	{$setc TARGET_CPU_X86 := TRUE}
115 	{$setc TARGET_CPU_X86_64 := FALSE}
116 	{$setc TARGET_CPU_ARM := FALSE}
117 	{$setc TARGET_CPU_ARM64 := FALSE}
118 {$ifc defined iphonesim}
119  	{$setc TARGET_OS_MAC := FALSE}
120 	{$setc TARGET_OS_IPHONE := TRUE}
121 	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
122 {$elsec}
123 	{$setc TARGET_OS_MAC := TRUE}
124 	{$setc TARGET_OS_IPHONE := FALSE}
125 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
126 {$endc}
127 	{$setc TARGET_OS_EMBEDDED := FALSE}
128 {$elifc defined __x86_64__ and __x86_64__}
129 	{$setc TARGET_CPU_PPC := FALSE}
130 	{$setc TARGET_CPU_PPC64 := FALSE}
131 	{$setc TARGET_CPU_X86 := FALSE}
132 	{$setc TARGET_CPU_X86_64 := TRUE}
133 	{$setc TARGET_CPU_ARM := FALSE}
134 	{$setc TARGET_CPU_ARM64 := FALSE}
135 {$ifc defined iphonesim}
136  	{$setc TARGET_OS_MAC := FALSE}
137 	{$setc TARGET_OS_IPHONE := TRUE}
138 	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
139 {$elsec}
140 	{$setc TARGET_OS_MAC := TRUE}
141 	{$setc TARGET_OS_IPHONE := FALSE}
142 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
143 {$endc}
144 	{$setc TARGET_OS_EMBEDDED := FALSE}
145 {$elifc defined __arm__ and __arm__}
146 	{$setc TARGET_CPU_PPC := FALSE}
147 	{$setc TARGET_CPU_PPC64 := FALSE}
148 	{$setc TARGET_CPU_X86 := FALSE}
149 	{$setc TARGET_CPU_X86_64 := FALSE}
150 	{$setc TARGET_CPU_ARM := TRUE}
151 	{$setc TARGET_CPU_ARM64 := FALSE}
152 	{$setc TARGET_OS_MAC := FALSE}
153 	{$setc TARGET_OS_IPHONE := TRUE}
154 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
155 	{$setc TARGET_OS_EMBEDDED := TRUE}
156 {$elifc defined __arm64__ and __arm64__}
157 	{$setc TARGET_CPU_PPC := FALSE}
158 	{$setc TARGET_CPU_PPC64 := FALSE}
159 	{$setc TARGET_CPU_X86 := FALSE}
160 	{$setc TARGET_CPU_X86_64 := FALSE}
161 	{$setc TARGET_CPU_ARM := FALSE}
162 	{$setc TARGET_CPU_ARM64 := TRUE}
163 {$ifc defined ios}
164 	{$setc TARGET_OS_MAC := FALSE}
165 	{$setc TARGET_OS_IPHONE := TRUE}
166 	{$setc TARGET_OS_EMBEDDED := TRUE}
167 {$elsec}
168 	{$setc TARGET_OS_MAC := TRUE}
169 	{$setc TARGET_OS_IPHONE := FALSE}
170 	{$setc TARGET_OS_EMBEDDED := FALSE}
171 {$endc}
172 	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
173 {$elsec}
174 	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
175 {$endc}
176 
177 {$ifc defined __LP64__ and __LP64__ }
178   {$setc TARGET_CPU_64 := TRUE}
179 {$elsec}
180   {$setc TARGET_CPU_64 := FALSE}
181 {$endc}
182 
183 {$ifc defined FPC_BIG_ENDIAN}
184 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
185 	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
186 {$elifc defined FPC_LITTLE_ENDIAN}
187 	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
188 	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
189 {$elsec}
190 	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
191 {$endc}
192 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
193 {$setc CALL_NOT_IN_CARBON := FALSE}
194 {$setc OLDROUTINENAMES := FALSE}
195 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
196 {$setc OPAQUE_UPP_TYPES := TRUE}
197 {$setc OTCARBONAPPLICATION := TRUE}
198 {$setc OTKERNEL := FALSE}
199 {$setc PM_USE_SESSION_APIS := TRUE}
200 {$setc TARGET_API_MAC_CARBON := TRUE}
201 {$setc TARGET_API_MAC_OS8 := FALSE}
202 {$setc TARGET_API_MAC_OSX := TRUE}
203 {$setc TARGET_CARBON := TRUE}
204 {$setc TARGET_CPU_68K := FALSE}
205 {$setc TARGET_CPU_MIPS := FALSE}
206 {$setc TARGET_CPU_SPARC := FALSE}
207 {$setc TARGET_OS_UNIX := FALSE}
208 {$setc TARGET_OS_WIN32 := FALSE}
209 {$setc TARGET_RT_MAC_68881 := FALSE}
210 {$setc TARGET_RT_MAC_CFM := FALSE}
211 {$setc TARGET_RT_MAC_MACHO := TRUE}
212 {$setc TYPED_FUNCTION_POINTERS := TRUE}
213 {$setc TYPE_BOOL := FALSE}
214 {$setc TYPE_EXTENDED := FALSE}
215 {$setc TYPE_LONGLONG := TRUE}
216 uses MacTypes, CFRunLoop, CoreAudioTypes, AudioHardwareBase;
217 {$endc} {not MACOSALLINCLUDE}
218 
219 
220 {$ALIGN POWER}
221 
222 //==================================================================================================
223 //#pragma mark    Overview
224 {!
225     @header AudioHardware
226     The audio HAL provides an abstraction through which applications can access audio hardware. To
227     do this, the HAL provides a small set of AudioObjects that provide access to the various pieces
228     of the system.
229 
230     AudioObjects all have a set of properties that describe and manipulate their state. A property
231     is accessed via an ordered triple. The first ordinate is the selector which describes the
232     property. The other two ordinates are the scope and element that identify the particular part of
233     the object in which to look for the selector. The AudioObjectPropertyAddress structure
234     encapsulates the property address. The value of a property is an untyped block of data whose
235     content depends on the specifics of the selector. Some selectors also require the use of a
236     qualifier when querying. The qualifier allows for additional information to be provided to be
237     used in the manipulation of the property. Changing the value of a property is always considered
238     asynchronous.
239 
240     Applications use the routines AudioObjectHasProperty(), AudioObjectIsPropertySettable() and
241     AudioObjectGetPropertyDataSize() to find useful meta-information about the property. Apps use
242     AudioObjectGetPropertyData() and AudioObjectSetPropertyData() to manipulate the value of the
243     property. Apps use AudioObjectAddPropertyListener() and AudioObjectRemovePropertyListener() to
244     register/unregister a function that is to be called when a given property's value changes.
245 
246     The class of an AudioObject determines the basic functionality of the object in terms of what
247     functions will operate on it as well as the set of properties that can be expected to be
248     implemented by the object. The set of available classes for objects is limited to those defined
249     here. There are no other classes. The set of classes is arranged in a hierarchy such that one
250     class inherits the properties/routines of it's super class.
251 
252     The base class for all AudioObjects is the class AudioObject. As such, each AudioObject will
253     provide basic properties such as it's class, it's human readable name, and the other
254     AudioObjects it contains. Other important classes include AudioSystemObject, AudioDevice, and
255     AudioStream.
256 
257     The AudioObjects in the HAL are arranged in a containment hierarchy. The root of the hierarchy
258     is the one and only instance of the AudioSystemObject class. The properties of the
259     AudioSystemObject describe the process global settings such as the various default devices and
260     the notification run loop. The AudioSystemObject also contains all the AudioDevices that are
261     available.
262 
263     Instances of the AudioDevice class encapsulate individual audio devices. An AudioDevice serves
264     as the basic unit of IO. It provides a single IO cycle, a timing source based on it, and all the
265     buffers synchronized to it. The IO cycle presents all the synchronized buffers to the client in
266     the same call out along with time stamps that specify the current time, when the input data was
267     acquired and when the output data will be presented.
268 
269     AudioDevices contain instances of the AudioStream class. An AudioStream represents a single
270     buffer of data for transferring across the user/kernel boundary. As such, AudioStreams are the
271     gatekeepers of format information. Each has it's own format and list of available formats.
272     AudioStreams can provide data in any format, including encoded formats and non-audio formats. If
273     the format is a linear PCM format, the data will always be presented as 32 bit, native endian
274     floating point. All conversions to and from the true physical format of the hardware is handled
275     by the device's driver.
276 
277     Both AudioDevices and AudioStreams can contain instances of the AudioControl class or it's many
278     subclasses. An AudioControl provides properties that describe/manipulate a particular aspect of
279     the object such as gain, mute, data source selection, etc. Many common controls are also
280     also available as properties on the AudioDevice or AudioStream.
281 }
282 
283 //==================================================================================================
284 //  Includes
285 
286 
287 //==================================================================================================
288 
289 //#if PRAGMA_ENUM_ALWAYSINT
290 //    #pragma enumsalwaysint off
291 //#endif
292 
293 
294 //==================================================================================================
295 //#pragma mark Basic Constants
296 
297 {!
298     @enum           Predefined AudioObjectID values
299     @abstract       ObjectIDs that are always the same
300     @constant       kAudioObjectSystemObject
301                         The AudioObjectID that always refers to the one and only instance of the
302                         AudioSystemObject class.
303 }
304 const
305 	kAudioObjectSystemObject = 1;
306 
307 //==================================================================================================
308 //#pragma mark -
309 //#pragma mark AudioObject Types
310 
311 {!
312     @typedef        AudioObjectPropertyListenerProc
313     @abstract       Clients register an AudioObjectPropertyListenerProc with an AudioObject in order
314                     to receive notifications when the properties of the object change.
315     @discussion     Listeners will be called when possibly many properties have changed.
316                     Consequently, the implementation of a listener must go through the array of
317                     addresses to see what exactly has changed. Note that the array of addresses will
318                     always have at least one address in it for which the listener is signed up to
319                     receive notifications about but may contain addresses for properties for which
320                     the listener is not signed up to receive notifications.
321     @param          inObjectID
322                         The AudioObject whose properties have changed.
323     @param          inNumberAddresses
324                         The number of elements in the inAddresses array.
325     @param          inAddresses
326                         An array of AudioObjectPropertyAddresses indicating which properties
327                         changed.
328     @param          inClientData
329                         A pointer to client data established when the listener proc was registered
330                         with the AudioObject.
331     @result         The return value is currently unused and should always be 0.
332 }
333 type
inObjectIDnull334 	AudioObjectPropertyListenerProc = function( inObjectID: AudioObjectID; inNumberAddresses: UInt32; {const} inAddresses: {variable-size-array} AudioObjectPropertyAddressPtr; inClientData: UnivPtr ): OSStatus;
335 
336 
337 //==================================================================================================
338 //#pragma mark    AudioObject Properties
339 
340 {!
341     @enum           AudioObject Property Selectors
342     @abstract       AudioObjectPropertySelector values provided by objects of the AudioObject class.
343     @discussion     The AudioObject class is the base class for all classes. As such, all classes
344                     inherit this set of properties.
345     @constant       kAudioObjectPropertyCreator
346                         A CFString that contains the bundle ID of the plug-in that instantiated the
347                         object. The caller is responsible for releasing the returned CFObject.
348     @constant       kAudioObjectPropertyListenerAdded
349                         An AudioObjectPropertyAddress indicating the address to which a new listener
350                         was added. Note that this property is not for applications to use. Rather,
351                         this property is for the HAL shell to notify AudioObjects implemented by an
352                         AudioPlugIn when a listener is added.
353     @constant       kAudioObjectPropertyListenerRemoved
354                         An AudioObjectPropertyAddress indicating the address to which a listener was
355                         removed. Note that this property is not for applications to use. Rather,
356                         this property is for the HAL shell to notify AudioObjects implemented by an
357                         AudioPlugIn when a listener is removed.
358 }
359 const
360 	kAudioObjectPropertyCreator = FourCharCode('oplg');
361 	kAudioObjectPropertyListenerAdded = FourCharCode('lisa');
362 	kAudioObjectPropertyListenerRemoved = FourCharCode('lisr');
363 
364 //==================================================================================================
365 //#pragma mark    AudioObject Functions
366 
367 {!
368     @functiongroup  AudioObject
369 }
370 
371 {!
372     @function       AudioObjectShow
373     @abstract       Prints to standard out a textural description of the AudioObject.
374     @param          inObjectID
375                         The AudioObject to show.
376 }
377 procedure AudioObjectShow( inObjectID: AudioObjectID ); external name '_AudioObjectShow';
378 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
379 
380 {!
381     @function       AudioObjectHasProperty
382     @abstract       Queries an AudioObject about whether or not it has the given property.
383     @param          inObjectID
384                         The AudioObject to query.
385     @param          inAddress
386                         An AudioObjectPropertyAddress indicating which property is being queried.
387     @result         A Boolean indicating whether or not the AudioObject has the given property.
388 }
AudioObjectHasPropertynull389 function AudioObjectHasProperty( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress ): Boolean; external name '_AudioObjectHasProperty';
390 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
391 
392 {!
393     @function       AudioObjectIsPropertySettable
394     @abstract       Queries an AudioObject about whether or not the given property can be set using
395                     AudioObjectSetPropertyData.
396     @param          inObjectID
397                         The AudioObject to query.
398     @param          inAddress
399                         An AudioObjectPropertyAddress indicating which property is being queried.
400     @param          outIsSettable
401                         A Boolean indicating whether or not the property can be set.
402     @result         An OSStatus indicating success or failure.
403 }
AudioObjectIsPropertySettablenull404 function AudioObjectIsPropertySettable( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; var outIsSettable: Boolean ): OSStatus; external name '_AudioObjectIsPropertySettable';
405 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
406 
407 {!
408     @function       AudioObjectGetPropertyDataSize
409     @abstract       Queries an AudioObject to find the size of the data for the given property.
410     @param          inObjectID
411                         The AudioObject to query.
412     @param          inAddress
413                         An AudioObjectPropertyAddress indicating which property is being queried.
414     @param          inQualifierDataSize
415                         A UInt32 indicating the size of the buffer pointed to by inQualifierData.
416                         Note that not all properties require qualification, in which case this
417                         value will be 0.
418     @param          inQualifierData,
419                         A buffer of data to be used in determining the data of the property being
420                         queried. Note that not all properties require qualification, in which case
421                         this value will be NULL.
422     @param          outDataSize
423                         A UInt32 indicating how many bytes the data for the given property occupies.
424     @result         An OSStatus indicating success or failure.
425 }
AudioObjectGetPropertyDataSizenull426 function AudioObjectGetPropertyDataSize( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inQualifierDataSize: UInt32; inQualifierData: {const} UnivPtr; var outDataSize: UInt32 ): OSStatus; external name '_AudioObjectGetPropertyDataSize';
427 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
428 
429 {!
430     @function       AudioObjectGetPropertyData
431     @abstract       Queries an AudioObject to get the data of the given property and places it in
432                     the provided buffer.
433     @param          inObjectID
434                         The AudioObject to query.
435     @param          inAddress
436                         An AudioObjectPropertyAddress indicating which property is being queried.
437     @param          inQualifierDataSize
438                         A UInt32 indicating the size of the buffer pointed to by inQualifierData.
439                         Note that not all properties require qualification, in which case this
440                         value will be 0.
441     @param          inQualifierData,
442                         A buffer of data to be used in determining the data of the property being
443                         queried. Note that not all properties require qualification, in which case
444                         this value will be NULL.
445     @param          ioDataSize
446                         A UInt32 which on entry indicates the size of the buffer pointed to by
447                         outData and on exit indicates how much of the buffer was used.
448     @param          outData
449                         The buffer into which the AudioObject will put the data for the given
450                         property.
451     @result         An OSStatus indicating success or failure.
452 }
AudioObjectGetPropertyDatanull453 function AudioObjectGetPropertyData( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inQualifierDataSize: UInt32; inQualifierData: {const} UnivPtr; var ioDataSize: UInt32; outData: UnivPtr ): OSStatus; external name '_AudioObjectGetPropertyData';
454 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
455 
456 {!
457     @function       AudioObjectSetPropertyData
458     @abstract       Tells an AudioObject to change the value of the given property using the
459                     provided data.
460     @discussion     Note that the value of the property should not be considered changed until the
461                     HAL has called the listeners as many properties values are changed
462                     asynchronously.
463     @param          inObjectID
464                         The AudioObject to change.
465     @param          inAddress
466                         An AudioObjectPropertyAddress indicating which property is being changed.
467     @param          inQualifierDataSize
468                         A UInt32 indicating the size of the buffer pointed to by inQualifierData.
469                         Note that not all properties require qualification, in which case this
470                         value will be 0.
471     @param          inQualifierData,
472                         A buffer of data to be used in determining the data of the property being
473                         queried. Note that not all properties require qualification, in which case
474                         this value will be NULL.
475     @param          inDataSize
476                         A UInt32 indicating the size of the buffer pointed to by inData.
477     @param          inData
478                         The buffer containing the data to be used to change the property's value.
479     @result         An OSStatus indicating success or failure.
480 }
AudioObjectSetPropertyDatanull481 function AudioObjectSetPropertyData( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inQualifierDataSize: UInt32; inQualifierData: {const} UnivPtr; inDataSize: UInt32; inData: {const} UnivPtr ): OSStatus; external name '_AudioObjectSetPropertyData';
482 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
483 
484 {!
485     @function       AudioObjectAddPropertyListener
486     @abstract       Registers the given AudioObjectPropertyListenerProc to receive notifications
487                     when the given properties change.
488     @param          inObjectID
489                         The AudioObject to register the listener with.
490     @param          inAddress
491                         The AudioObjectPropertyAddresses indicating which property the listener
492                         should be notified about.
493     @param          inListener
494                         The AudioObjectPropertyListenerProc to call.
495     @param          inClientData
496                         A pointer to client data that is passed to the listener when it is called.
497     @result         An OSStatus indicating success or failure.
498 }
AudioObjectAddPropertyListenernull499 function AudioObjectAddPropertyListener( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inListener: AudioObjectPropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioObjectAddPropertyListener';
500 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
501 
502 {!
503     @function       AudioObjectRemovePropertyListener
504     @abstract       Unregisters the given AudioObjectPropertyListenerProc from receiving
505                     notifications when the given properties change.
506     @param          inObjectID
507                         The AudioObject to unregister the listener from.
508     @param          inNumberAddresses
509                         The number of elements in the inAddresses array.
510     @param          inAddresses
511                         The AudioObjectPropertyAddress indicating which property the listener should
512                         be removed from.
513     @param          inListener
514                         The AudioObjectPropertyListenerProc being removed.
515     @param          inClientData
516                         A pointer to client data that is passed to the listener when it is called.
517     @result         An OSStatus indicating success or failure.
518 }
AudioObjectRemovePropertyListenernull519 function AudioObjectRemovePropertyListener( inObjectID: AudioObjectID; const (*var*) inAddress: AudioObjectPropertyAddress; inListener: AudioObjectPropertyListenerProc; inClientData: UnivPtr ): OSStatus; external name '_AudioObjectRemovePropertyListener';
520 (* __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
521 
522 
523 //==================================================================================================
524 //#pragma mark    AudioSystemObject Constants
525 
526 {!
527     @enum           AudioSystemObject Class Constants
528     @abstract       Various constants related to the AudioSystemObject class.
529     @discussion     Note that there is only ever one instance of the AudioSystemObject class and it
530                     is available via the AudioObjectID, kAudioObjectSystemObject.
531     @constant       kAudioSystemObjectClassID
532                         The AudioClassID that identifies the AudioSystemObject class.
533 }
534 const
535 	kAudioSystemObjectClassID = FourCharCode('asys');
536 
537 //==================================================================================================
538 //#pragma mark    AudioSystemObject Properties
539 
540 {!
541     @enum           AudioSystemObject Properties
542     @abstract       AudioObjectPropertySelector values provided by the AudioSystemObject class.
543     @discussion     The AudioSystemObject class is a subclass of the AudioObject class. the class
544                     has just the global scope, kAudioObjectPropertyScopeGlobal, and only a master element.
545     @constant       kAudioHardwarePropertyDevices
546                         An array of the AudioObjectIDs that represent all the devices currently
547                         available to the system.
548     @constant       kAudioHardwarePropertyDefaultInputDevice
549                         The AudioObjectID of the default input AudioDevice.
550     @constant       kAudioHardwarePropertyDefaultOutputDevice
551                         The AudioObjectID of the default output AudioDevice.
552     @constant       kAudioHardwarePropertyDefaultSystemOutputDevice
553                         The AudioObjectID of the output AudioDevice to use for system related sound
554                         from the alert sound to digital call progress.
555     @constant       kAudioHardwarePropertyTranslateUIDToDevice
556                         This property fetches the AudioObjectID that corresponds to the AudioDevice
557                         that has the given UID. The UID is passed in via the qualifier as a CFString
558                         while the AudioObjectID for the AudioDevice is returned to the caller as the
559                         property's data. Note that an error is not returned if the UID doesn't refer
560                         to any AudioDevices. Rather, this property will return kAudioObjectUnknown
561                         as the value of the property.
562     @constant       kAudioHardwarePropertyMixStereoToMono
563                         A UInt32 where a value other than 0 indicates that AudioDevices should mix
564                         stereo signals down to mono. Note that the two channels on the device that
565                         comprise the stereo signal are defined on the device by
566                         kAudioDevicePropertyPreferredChannelsForStereo.
567     @constant       kAudioHardwarePropertyTransportManagerList
568                         An array of the AudioObjectIDs for all the AudioTransportManager objects.
569     @constant       kAudioHardwarePropertyTranslateBundleIDToTransportManager
570                         This property fetches the AudioObjectID that corresponds to the
571                         AudioTransportManager whose bundle has the given bundle ID. The bundle ID is
572                         passed in via the qualifier as a CFString while the AudioObjectID for the
573                         AudioTransportManager is returned to the caller as the property's data. Note
574                         that an error is not returned if the bundle ID doesn't refer to any
575                         AudioTransportManagers. Rather, this property will return
576                         kAudioObjectUnknown as the value of the property.
577     @constant       kAudioHardwarePropertyProcessIsMaster
578                         A UInt32 where 1 means that the current process contains the master instance
579                         of the HAL. The master instance of the HAL is the only instance in which
580                         plug-ins should save/restore their devices' settings.
581     @constant       kAudioHardwarePropertyIsInitingOrExiting
582                         A UInt32 whose value will be non-zero if the HAL is either in the midst of
583                         initializing or in the midst of exiting the process.
584     @constant       kAudioHardwarePropertyUserIDChanged
585                         This property exists so that clients can tell the HAL when they are changing
586                         the effective user ID of the process. The way it works is that a client will
587                         set the value of this property and the HAL will flush all its cached per-
588                         user preferences such as the default devices. The value of this property is
589                         a UInt32, but it's value has no currently defined meaning and clients may
590                         pass any value when setting it to trigger the cache flush.
591     @constant       kAudioHardwarePropertyProcessIsAudible
592                         A UInt32 where a non-zero value indicates that the audio of the process will
593                         be heard. A value of 0 indicates that all audio in the process will not be
594                         heard.
595     @constant       kAudioHardwarePropertySleepingIsAllowed
596                         A UInt32 where 1 means that the process will allow the CPU to idle sleep
597                         even if there is audio IO in progress. A 0 means that the CPU will not be
598                         allowed to idle sleep. Note that this property won't affect when the CPU is
599                         forced to sleep.
600     @constant       kAudioHardwarePropertyUnloadingIsAllowed
601                         A UInt32 where 1 means that this process wants the HAL to unload itself
602                         after a period of inactivity where there are no IOProcs and no listeners
603                         registered with any AudioObject.
604     @constant       kAudioHardwarePropertyHogModeIsAllowed
605                         A UInt32 where 1 means that this process wants the HAL to automatically take
606                         hog mode and 0 means that the HAL should not automatically take hog mode on
607                         behalf of the process. Processes that only ever use the default device are
608                         the sort of that should set this property's value to 0.
609     @constant       kAudioHardwarePropertyPlugInForBundleID
610                         Using an AudioValueTranslation structure, this property translates the input
611                         CFString containing a bundle ID into the AudioObjectID of the AudioPlugIn
612                         that corresponds to it. This property will return kAudioObjectUnkown if the
613                         given bundle ID doesn't match any AudioPlugIns.
614     @constant       kAudioHardwarePropertyUserSessionIsActiveOrHeadless
615                         A UInt32 where a value other than 0 indicates that the login session of the
616                         user of the process is either an active console session or a headless
617                         session.
618     @constant       kAudioHardwarePropertyServiceRestarted
619                         A UInt32 whose value has no meaning. Rather, this property exists so that
620                         clients can be informed when the service has been reset for some reason.
621                         When a reset happens, any state the client has , such as cached data or
622                         added listeners, must be re-established by the client.
623 }
624 const
625 	kAudioHardwarePropertyDevices = FourCharCode('dev#');
626 	kAudioHardwarePropertyDefaultInputDevice = FourCharCode('dIn ');
627 	kAudioHardwarePropertyDefaultOutputDevice = FourCharCode('dOut');
628 	kAudioHardwarePropertyDefaultSystemOutputDevice = FourCharCode('sOut');
629 	kAudioHardwarePropertyTranslateUIDToDevice = FourCharCode('uidd');
630 	kAudioHardwarePropertyMixStereoToMono = FourCharCode('stmo');
631 	kAudioHardwarePropertyTransportManagerList = FourCharCode('tmg#');
632 	kAudioHardwarePropertyTranslateBundleIDToTransportManager = FourCharCode('tmbi');
633 	kAudioHardwarePropertyProcessIsMaster = FourCharCode('mast');
634 	kAudioHardwarePropertyIsInitingOrExiting = FourCharCode('inot');
635 	kAudioHardwarePropertyUserIDChanged = FourCharCode('euid');
636 	kAudioHardwarePropertyProcessIsAudible = FourCharCode('pmut');
637 	kAudioHardwarePropertySleepingIsAllowed = FourCharCode('slep');
638 	kAudioHardwarePropertyUnloadingIsAllowed = FourCharCode('unld');
639 	kAudioHardwarePropertyHogModeIsAllowed = FourCharCode('hogr');
640 	kAudioHardwarePropertyPlugInForBundleID = FourCharCode('pibi');
641 	kAudioHardwarePropertyUserSessionIsActiveOrHeadless = FourCharCode('user');
642 	kAudioHardwarePropertyServiceRestarted = FourCharCode('srst');
643 
644 //==================================================================================================
645 //#pragma mark    AudioSystemObject Functions
646 
647 {!
648     @functiongroup  AudioSystemObject
649 }
650 
651 {!
652     @function       AudioHardwareUnload
653     @abstract       When this routine is called, all IO on all devices within a process will be
654                     terminated and all resources capable of being released will be released. This
655                     routine essentially returns the HAL to its uninitialized state.
656     @result         An OSStatus indicating success or failure.
657 }
AudioHardwareUnloadnull658 function AudioHardwareUnload: OSStatus; external name '_AudioHardwareUnload';
659 (* __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0) *)
660 
661 //==================================================================================================
662 //#pragma mark    AudioPlugIn Properties
663 
664 {!
665     @enum           AudioPlugIn Properties
666     @abstract       AudioObjectPropertySelector values provided by the AudioPlugIn class.
667     @discussion     The AudioPlugIn class is a subclass of the AudioObject class. the class has just
668                     the global scope, kAudioObjectPropertyScopeGlobal, and only a master element.
669     @constant       kAudioPlugInCreateAggregateDevice
670                         This property is used to tell a plug-in to create a new
671                         AudioAggregateDevice. It's value is only read. The qualifier data for this
672                         property is a CFDictionary containing a description of the
673                         AudioAggregateDevice to create. The keys for the CFDictionary are defined in
674                         the AudioAggregateDevice Constants section. The value of the property that
675                         gets returned is the AudioObjectID of the newly created device.
676     @constant       kAudioPlugInDestroyAggregateDevice
677                         This property is used to tell a plug-in to destroy an AudioAggregateDevice.
678                         Like kAudioPlugInCreateAggregateDevice, this property is read only. The
679                         value of the property is the AudioObjectID of the AudioAggregateDevice to
680                         destroy.
681 }
682 const
683 	kAudioPlugInCreateAggregateDevice = FourCharCode('cagg');
684 	kAudioPlugInDestroyAggregateDevice = FourCharCode('dagg');
685 
686 //==================================================================================================
687 //#pragma mark    AudioDevice Types
688 
689 {!
690     @enum           AudioTransportManager Properties
691     @abstract       AudioObjectPropertySelector values provided by the AudioTransportManager class.
692     @discussion     The AudioTransportManager class is a subclass of the AudioPlugIn class. The
693                     class has just the global scope, kAudioObjectPropertyScopeGlobal, and only a
694                     master element.
695     @constant       kAudioTransportManagerCreateEndPointDevice
696                         This property is used to tell a transport manager to create a new
697                         AudioDevice. It's value is only read. The qualifier data for this
698                         property is a CFDictionary containing a description of the
699                         AudioDevice to create. The standard keys for the CFDictionary are defined in
700                         the AudioEndPointDevice Constants section. The value of the property that
701                         gets returned is the AudioObjectID of the newly created device.
702     @constant       kAudioTransportManagerDestroyEndPointDevice
703                         This property is used to tell a transport manager to destroy an AudioDevice.
704                         Like kAudioTransportManagerCreateDevice, this property is read only. The
705                         value of the property is the AudioObjectID of the AudioAggregateDevice to
706                         destroy.
707 }
708 const
709 	kAudioTransportManagerCreateEndPointDevice = FourCharCode('cdev');
710 	kAudioTransportManagerDestroyEndPointDevice = FourCharCode('ddev');
711 
712 //==================================================================================================
713 //#pragma mark -
714 //#pragma mark AudioDevice Types
715 
716 {!
717     @typedef        AudioDeviceIOProc
718     @abstract       An AudioDeviceIOProc is called by an AudioDevice to provide input data read from
719                     the device and collect output data to be written to the device for the current
720                     IO cycle.
721     @param          inDevice
722                         The AudioDevice doing the IO.
723     @param          inNow
724                         An AudioTimeStamp that indicates the IO cycle started. Note that this time
725                         includes any scheduling latency that may have been incurred waking the
726                         thread on which IO is being done.
727     @param          inInputData
728                         An AudioBufferList containing the input data for the current IO cycle. For
729                         streams that are disabled, the AudioBuffer's mData field will be NULL but
730                         the mDataByteSize field will still say how much data would have been there
731                         if it was enabled. Note that the contents of this structure should never be
732                         modified.
733     @param          inInputTime
734                         An AudioTimeStamp that indicates the time at which the first frame in the
735                         data was acquired from the hardware. If the device has no input streams, the
736                         time stamp will be zeroed out.
737     @param          outOutputData
738                         An AudioBufferList in which the output data for the current IO cycle is to
739                         be placed. On entry, each AudioBuffer's mDataByteSize field indicates the
740                         maximum amount of data that can be placed in the buffer and the buffer's
741                         memory has been zeroed out. For formats where the number of bytes per packet
742                         can vary (as with AC-3, for example), the client has to fill out on exit
743                         each mDataByteSize field in each AudioBuffer with the amount of data that
744                         was put in the buffer. Otherwise, the mDataByteSize field should not be
745                         changed. For streams that are disabled, the AudioBuffer's mData field will
746                         be NULL but the mDataByteSize field will still say how much data would have
747                         been there if it was enabled. Except as noted above, the contents of this
748                         structure should not other wise be modified.
749     @param          inOutputTime
750                         An AudioTimeStamp that indicates the time at which the first frame in the
751                         data will be passed to the hardware. If the device has no output streams,
752                         the time stamp will be zeroed out.
753     @param          inClientData
754                         A pointer to client data established when the AudioDeviceIOProc was
755                         registered with the AudioDevice.
756     @result         The return value is currently unused and should always be 0.
757 }
758 type
inDevicenull759 	AudioDeviceIOProc = function( inDevice: AudioObjectID; const (*var*) inNow: AudioTimeStamp; const (*var*) inInputData: AudioBufferList; const (*var*) inInputTime: AudioTimeStamp; var outOutputData: AudioBufferList; const (*var*) inOutputTime: AudioTimeStamp; inClientData: UnivPtr ): OSStatus;
760 
761 
762 {!
763     @typedef        AudioDeviceIOProcID
764     @abstract       An AudioDeviceIOProcID represents both an IOProc and the client data that goes
765                     with it. Once created, an AudioDeviceIOProcID can be used everywhere one would
766                     use a regular IOProc. The purpose for an AudioDeviceIOProcID is to allow a
767                     client to register the same function pointer as an IOProc with a device multiple
768                     times provided
769 }
770 type
771 	AudioDeviceIOProcID = AudioDeviceIOProc;
772 
773 {!
774     @struct         AudioHardwareIOProcStreamUsage
775     @abstract       This structure describes which streams a given AudioDeviceIOProc will use. It is
776                     used in conjunction with kAudioDevicePropertyIOProcStreamUsage.
777     @field          mIOProc
778                         The IOProc whose stream usage is being specified.
779     @field          mNumberStreams
780                         The number of streams being specified.
781     @field          mStreamIsOn
782                         An array of UInt32's whose length is specified by mNumberStreams. Each
783                         element of the array corresponds to a stream. A value of 0 means the stream
784                         is not to be enabled. Any other value means the stream is to be used.
785 }
786 type
787 	AudioHardwareIOProcStreamUsage = record
788 		mIOProc: UnivPtr;
789 		mNumberStreams: UInt32;
790 		mStreamIsOn: array[0..0] of UInt32;
791 	end;
792 
793 //==================================================================================================
794 //#pragma mark AudioDevice Constants
795 
796 {!
797     @enum           StartAtTime/GetNearestStartTime Flags
798     @abstract       The flags that can be passed to control the behavior of AudioDeviceStartAtTime()
799                     andAudioDeviceGetNearestStartTime().
800     @constant       kAudioDeviceStartTimeIsInputFlag
801                         Set to indicate that the requested time refers to an input time. Clear to
802                         indicate that it is an output time.
803     @constant       kAudioDeviceStartTimeDontConsultDeviceFlag
804                         Set to indicate that the device should not be consulted when determining the
805                         start time. Clear to indicate that the device should be consulted. This flag
806                         cannot be set if kAudioDeviceStartTimeDontConsultHALFlag is set.
807     @constant       kAudioDeviceStartTimeDontConsultHALFlag
808                         Set to indicate that the HAL should not be consulted when determining the
809                         start time. Clear to indicate that the HAL should be consulted. This flag
810                         cannot be set if kAudioDeviceStartTimeDontConsultDeviceFlag is set.
811 }
812 const
813 	kAudioDeviceStartTimeIsInputFlag = 1 shl 0;
814 	kAudioDeviceStartTimeDontConsultDeviceFlag = 1 shl 1;
815 	kAudioDeviceStartTimeDontConsultHALFlag = 1 shl 2;
816 
817 //==================================================================================================
818 //#pragma mark    AudioDevice Properties
819 
820 {!
821     @enum           AudioDevice Properties
822     @abstract       AudioObjectPropertySelector values provided by the AudioDevice class.
823     @discussion     The AudioDevice class is a subclass of the AudioObjectClass. The class has four
824                     scopes, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyScopeInput,
825                     kAudioObjectPropertyScopeOutput, and kAudioObjectPropertyScopePlayThrough. The
826                     class has a master element and an element for each channel in each stream
827                     numbered according to the starting channel number of each stream.
828     @constant       kAudioDevicePropertyPlugIn
829                         An OSStatus that contains any error codes generated by loading the IOAudio
830                         driver plug-in for the AudioDevice or kAudioHardwareNoError if the plug-in
831                         loaded successfully. This property only exists for IOAudio-based
832                         AudioDevices whose driver has specified a plug-in to load.
833     @constant       kAudioDevicePropertyDeviceHasChanged
834                         The type of this property is a UInt32, but it's value has no meaning. This
835                         property exists so that clients can listen to it and be told when the
836                         configuration of the AudioDevice has changed in ways that cannot otherwise
837                         be conveyed through other notifications. In response to this notification,
838                         clients should re-evaluate everything they need to know about the device,
839                         particularly the layout and values of the controls.
840     @constant       kAudioDevicePropertyDeviceIsRunningSomewhere
841                         A UInt32 where 1 means that the AudioDevice is running in at least one
842                         process on the system and 0 means that it isn't running at all.
843     @constant       kAudioDeviceProcessorOverload
844                         A UInt32 where the value has no meaning. This property exists so that
845                         clients can be notified when the AudioDevice detects that an IO cycle has
846                         run past it's deadline. Note that the notification for this property is
847                         usually sent from the AudioDevice's IO thread.
848     @constant       kAudioDevicePropertyHogMode
849                         A pid_t indicating the process that currently owns exclusive access to the
850                         AudioDevice or a value of -1 indicating that the device is currently
851                         available to all processes. If the AudioDevice is in a non-mixable mode,
852                         the HAL will automatically take hog mode on behalf of the first process to
853                         start an IOProc.
854                         Note that when setting this property, the value passed in is ignored. If
855                         another process owns exclusive access, that remains unchanged. If the
856                         current process owns exclusive access, it is released and made available to
857                         all processes again. If no process has exclusive access (meaning the current
858                         value is -1), this process gains ownership of exclusive access.  On return,
859                         the pid_t pointed to by inPropertyData will contain the new value of the
860                         property.
861     @constant       kAudioDevicePropertyBufferFrameSize
862                         A UInt32 whose value indicates the number of frames in the IO buffers.
863     @constant       kAudioDevicePropertyBufferFrameSizeRange
864                         An AudioValueRange indicating the minimum and maximum values, inclusive, for
865                         kAudioDevicePropertyBufferFrameSize.
866     @constant       kAudioDevicePropertyUsesVariableBufferFrameSizes
867                         A UInt32 that, if implemented by a device, indicates that the sizes of the
868                         buffers passed to an IOProc will vary by a small amount. The value of this
869                         property will indicate the largest buffer that will be passed and
870                         kAudioDevicePropertyBufferFrameSize will indicate the smallest buffer that
871                         will get passed to the IOProc. The usage of this property is narrowed to
872                         only allow for devices whose buffer sizes vary by small amounts greater than
873                         kAudioDevicePropertyBufferFrameSize. It is not intended to be a license for
874                         devices to be able to send buffers however they please. Rather, it is
875                         intended to allow for hardware whose natural rhythms lead to this necessity.
876     @constant       kAudioDevicePropertyIOCycleUsage
877                         A Float32 whose range is from 0 to 1. This value indicates how much of the
878                         client portion of the IO cycle the process will use. The client portion of
879                         the IO cycle is the portion of the cycle in which the device calls the
880                         IOProcs so this property does not the apply to the duration of the entire
881                         cycle.
882     @constant       kAudioDevicePropertyStreamConfiguration
883                         This property returns the stream configuration of the device in an
884                         AudioBufferList (with the buffer pointers set to NULL) which describes the
885                         list of streams and the number of channels in each stream. This corresponds
886                         to what will be passed into the IOProc.
887     @constant       kAudioDevicePropertyIOProcStreamUsage
888                         An AudioHardwareIOProcStreamUsage structure which details the stream usage
889                         of a given IO proc. If a stream is marked as not being used, the given
890                         IOProc will see a corresponding NULL buffer pointer in the AudioBufferList
891                         passed to it's IO proc. Note that the number of streams detailed in the
892                         AudioHardwareIOProcStreamUsage must include all the streams of that
893                         direction on the device. Also, when getting the value of the property, one
894                         must fill out the mIOProc field of the AudioHardwareIOProcStreamUsage with
895                         the address of the of the IOProc whose stream usage is to be retrieved.
896     @constant       kAudioDevicePropertyActualSampleRate
897                         A Float64 that indicates the current actual sample rate of the AudioDevice
898                         as measured by it's time stamps.
899 }
900 const
901 	kAudioDevicePropertyPlugIn = FourCharCode('plug');
902 	kAudioDevicePropertyDeviceHasChanged = FourCharCode('diff');
903 	kAudioDevicePropertyDeviceIsRunningSomewhere = FourCharCode('gone');
904 	kAudioDeviceProcessorOverload = FourCharCode('over');
905 	kAudioDevicePropertyHogMode = FourCharCode('oink');
906 	kAudioDevicePropertyBufferFrameSize = FourCharCode('fsiz');
907 	kAudioDevicePropertyBufferFrameSizeRange = FourCharCode('fsz#');
908 	kAudioDevicePropertyUsesVariableBufferFrameSizes = FourCharCode('vfsz');
909 	kAudioDevicePropertyIOCycleUsage = FourCharCode('ncyc');
910 	kAudioDevicePropertyStreamConfiguration = FourCharCode('slay');
911 	kAudioDevicePropertyIOProcStreamUsage = FourCharCode('suse');
912 	kAudioDevicePropertyActualSampleRate = FourCharCode('asrt');
913 
914 {!
915     @enum           AudioDevice Properties Implemented via AudioControl objects
916     @abstract       AudioObjectPropertySelector values for AudioDevice properties that are
917                     implemented by AudioControl objects.
918     @discussion     These properties are also accessible by locating the AudioControl object
919                     attached to the AudioDevice and using that object to access the properties of
920                     the control.
921     @constant       kAudioDevicePropertyJackIsConnected
922                         A UInt32 where a value of 0 means that there isn't anything plugged into the
923                         jack associated withe given element and scope. This property is implemented
924                         by an AudioJackControl, a subclass of AudioBooleanControl.
925     @constant       kAudioDevicePropertyVolumeScalar
926                         A Float32 that represents the value of the volume control. The range is
927                         between 0.0 and 1.0 (inclusive). Note that the set of all Float32 values
928                         between 0.0 and 1.0 inclusive is much larger than the set of actual values
929                         that the hardware can select. This means that the Float32 range has a many
930                         to one mapping with the underlying hardware values. As such, setting a
931                         scalar value will result in the control taking on the value nearest to what
932                         was set. This property is implemented by an AudioControl object that is a
933                         subclass of AudioVolumeControl.
934     @constant       kAudioDevicePropertyVolumeDecibels
935                         A Float32 that represents the value of the volume control in dB. Note that
936                         the set of all Float32 values in the dB range for the control is much larger
937                         than the set of actual values that the hardware can select. This means that
938                         the Float32 range has a many to one mapping with the underlying hardware
939                         values. As such, setting a dB value will result in the control taking on the
940                         value nearest to what was set. This property is implemented by an
941                         AudioControl object that is a subclass of AudioVolumeControl.
942     @constant       kAudioDevicePropertyVolumeRangeDecibels
943                         An AudioValueRange that contains the minimum and maximum dB values the
944                         control can have. This property is implemented by an AudioControl object
945                         that is a subclass of AudioVolumeControl.
946     @constant       kAudioDevicePropertyVolumeScalarToDecibels
947                         A Float32 that on input contains a scalar volume value for the and on exit
948                         contains the equivalent dB value. This property is implemented by an
949                         AudioControl object that is a subclass of AudioVolumeControl.
950     @constant       kAudioDevicePropertyVolumeDecibelsToScalar
951                         A Float32 that on input contains a dB volume value for the and on exit
952                         contains the equivalent scalar value. This property is implemented by an
953                         AudioControl object that is a subclass of AudioVolumeControl.
954     @constant       kAudioDevicePropertyStereoPan
955                         A Float32 where 0.0 is full left, 1.0 is full right, and 0.5 is center. This
956                         property is implemented by an AudioControl object that is a subclass of
957                         AudioStereoPanControl.
958     @constant       kAudioDevicePropertyStereoPanChannels
959                         An array of two UInt32s that indicate which elements of the owning object
960                         the signal is being panned between. This property is implemented by an
961                         AudioControl object that is a subclass of AudioStereoPanControl.
962     @constant       kAudioDevicePropertyMute
963                         A UInt32 where a value of 1 means that mute is enabled making that element
964                         inaudible. The property is implemented by an AudioControl object that is a
965                         subclass of AudioMuteControl.
966     @constant       kAudioDevicePropertySolo
967                         A UInt32 where a value of 1 means that just that element is audible and the
968                         other elements are inaudible. The property is implemented by an AudioControl
969                         object that is a subclass of AudioSoloControl.
970     @constant       kAudioDevicePropertyPhantomPower
971                         A UInt32 where a value of 1 means that the AudioDevice has enabled phantom
972                         power for the given element. The property is implemented by an AudioControl
973                         object that is a subclass of AudioPhantomPowerControl.
974     @constant       kAudioDevicePropertyPhaseInvert
975                         A UInt32 where a value of 1 means that phase of the signal for the given
976                         element has been flipped 180 degrees. The property is implemented by an
977                         AudioControl object that is a subclass of AudioPhaseInvertControl.
978     @constant       kAudioDevicePropertyClipLight
979                         A UInt32 where a value of 1 means that the signal for the element has
980                         exceeded the sample range. Once a clip light is turned on, it is to stay on
981                         until either the value of the control is set to false or the current IO
982                         session stops and a new IO session starts. The property is implemented by an
983                         AudioControl object that is a subclass of AudioClipLightControl.
984     @constant       kAudioDevicePropertyTalkback
985                         A UInt32 where a value of 1 means that the talkback channel is enabled. The
986                         property is implemented by an AudioControl object that is a subclass of
987                         AudioTalkbackControl.
988     @constant       kAudioDevicePropertyListenback
989                         A UInt32 where a value of 1 means that the listenback channel is enabled.
990                         The property is implemented by an AudioControl object that is a subclass of
991                         AudioListenbackControl.
992     @constant       kAudioDevicePropertyDataSource
993                         An array of UInt32s whose values are the item IDs for the currently selected
994                         data sources. This property is implemented by an AudioControl object that is
995                         a subclass of AudioDataSourceControl.
996     @constant       kAudioDevicePropertyDataSources
997                         An array of UInt32s that are represent all the IDs of all the data sources
998                         currently available. This property is implemented by an AudioControl object
999                         that is a subclass of AudioDataSourceControl.
1000     @constant       kAudioDevicePropertyDataSourceNameForIDCFString
1001                         This property translates the given data source item ID into a human readable
1002                         name using an AudioValueTranslation structure. The input data is the UInt32
1003                         containing the item ID to translated and the output data is a CFString. The
1004                         caller is responsible for releasing the returned CFObject. This property is
1005                         implemented by an AudioControl object that is a subclass of
1006                         AudioDataSourceControl.
1007     @constant       kAudioDevicePropertyDataSourceKindForID
1008                         This property returns a UInt32 that identifies the kind of data source
1009                         the item ID refers to using an AudioValueTranslation structure. The input
1010                         data is the UInt32 containing the item ID and the output data is the UInt32.
1011     @constant       kAudioDevicePropertyClockSource
1012                         An array of UInt32s whose values are the item IDs for the currently selected
1013                         clock sources. This property is implemented by an AudioControl object that
1014                         is a subclass of AudioClockControl.
1015     @constant       kAudioDevicePropertyClockSources
1016                         An array of UInt32s that are represent all the IDs of all the clock sources
1017                         currently available. This property is implemented by an AudioControl object
1018                         that is a subclass of AudioClockControl.
1019     @constant       kAudioDevicePropertyClockSourceNameForIDCFString
1020                         This property translates the given clock source item ID into a human
1021                         readable name using an AudioValueTranslation structure. The input data is
1022                         the UInt32 containing the item ID to translated and the output data is a
1023                         CFString. The caller is responsible for releasing the returned CFObject.
1024                         This property is implemented by an AudioControl object that is a subclass of
1025                         AudioClockControl.
1026     @constant       kAudioDevicePropertyClockSourceKindForID
1027                         This property returns a UInt32 that identifies the kind of clock source
1028                         the item ID refers to using an AudioValueTranslation structure. The input
1029                         data is the UInt32 containing the item ID and the output data is the UInt32.
1030     @constant       kAudioDevicePropertyPlayThru
1031                         A UInt32 where a value of 0 means that play through is off and a value of 1
1032                         means that it is on. This property is implemented by an AudioControl object
1033                         that is a subclass of AudioMuteControl. Further, the control that implements
1034                         this property is only available through
1035                         kAudioDevicePropertyScopePlayThrough.
1036     @constant       kAudioDevicePropertyPlayThruSolo
1037                         A UInt32 where a value of 1 means that just that play through element is
1038                         audible and the other elements are inaudible. The property is implemented by
1039                         an AudioControl object that is a subclass of AudioSoloControl. Further, the
1040                         control that implements this property is only available through
1041                         kAudioDevicePropertyScopePlayThrough.
1042     @constant       kAudioDevicePropertyPlayThruVolumeScalar
1043                         A Float32 that represents the value of the volume control. The range is
1044                         between 0.0 and 1.0 (inclusive). Note that the set of all Float32 values
1045                         between 0.0 and 1.0 inclusive is much larger than the set of actual values
1046                         that the hardware can select. This means that the Float32 range has a many
1047                         to one mapping with the underlying hardware values. As such, setting a
1048                         scalar value will result in the control taking on the value nearest to what
1049                         was set. This property is implemented by an AudioControl object that is a
1050                         subclass of AudioVolumeControl.Further, the control that implements this
1051                         property is only available through kAudioDevicePropertyScopePlayThrough.
1052     @constant       kAudioDevicePropertyPlayThruVolumeDecibels
1053                         A Float32 that represents the value of the volume control in dB. Note that
1054                         the set of all Float32 values in the dB range for the control is much larger
1055                         than the set of actual values that the hardware can select. This means that
1056                         the Float32 range has a many to one mapping with the underlying hardware
1057                         values. As such, setting a dB value will result in the control taking on the
1058                         value nearest to what was set. This property is implemented by an
1059                         AudioControl object that is a subclass of AudioVolumeControl. Further, the
1060                         control that implements this property is only available through
1061                         kAudioDevicePropertyScopePlayThrough.
1062     @constant       kAudioDevicePropertyPlayThruVolumeRangeDecibels
1063                         An AudioValueRange that contains the minimum and maximum dB values the
1064                         control can have. This property is implemented by an AudioControl object
1065                         that is a subclass of AudioVolumeControl. Further, the control that
1066                         implements this property is only available through
1067                         kAudioDevicePropertyScopePlayThrough.
1068     @constant       kAudioDevicePropertyPlayThruVolumeScalarToDecibels
1069                         A Float32 that on input contains a scalar volume value for the and on exit
1070                         contains the equivalent dB value. This property is implemented by an
1071                         AudioControl object that is a subclass of AudioVolumeControl. Further, the
1072                         control that implements this property is only available through
1073                         kAudioDevicePropertyScopePlayThrough.
1074     @constant       kAudioDevicePropertyPlayThruVolumeDecibelsToScalar
1075                         A Float32 that on input contains a dB volume value for the and on exit
1076                         contains the equivalent scalar value. This property is implemented by an
1077                         AudioControl object that is a subclass of AudioVolumeControl. Further, the
1078                         control that implements this property is only available through
1079                         kAudioDevicePropertyScopePlayThrough.
1080     @constant       kAudioDevicePropertyPlayThruStereoPan
1081                         A Float32 where 0.0 is full left, 1.0 is full right, and 0.5 is center. This
1082                         property is implemented by an AudioControl object that is a subclass of
1083                         AudioStereoPanControl. Further, the control that implements this property is
1084                         only available through kAudioDevicePropertyScopePlayThrough.
1085     @constant       kAudioDevicePropertyPlayThruStereoPanChannels
1086                         An array of two UInt32s that indicate which elements of the owning object
1087                         the signal is being panned between. This property is implemented by an
1088                         AudioControl object that is a subclass of AudioStereoPanControl. Further,
1089                         the control that implements this property is only available through
1090                         kAudioDevicePropertyScopePlayThrough.
1091     @constant       kAudioDevicePropertyPlayThruDestination
1092                         An array of UInt32s whose values are the item IDs for the currently selected
1093                         play through data destinations. This property is implemented by an
1094                         AudioControl object that is a subclass of AudioDataDestinationControl.
1095                         Further, the control that implements this property is only available through
1096                         kAudioDevicePropertyScopePlayThrough.
1097     @constant       kAudioDevicePropertyPlayThruDestinations
1098                         An array of UInt32s that are represent all the IDs of all the play through
1099                         data destinations currently available. This property is implemented by an
1100                         AudioControl object that is a subclass of AudioDataDestinationControl.
1101                         Further, the control that implements this property is only available through
1102                         kAudioDevicePropertyScopePlayThrough.
1103     @constant       kAudioDevicePropertyPlayThruDestinationNameForIDCFString
1104                         This property translates the given play through data destination item ID
1105                         into a human readable name using an AudioValueTranslation structure. The
1106                         input data is the UInt32 containing the item ID to translated and the output
1107                         data is a CFString. The caller is responsible for releasing the returned
1108                         CFObject. This property is implemented by an AudioControl object that is a
1109                         subclass of AudioDataDestinationControl. Further, the control that
1110                         implements this property is only available through
1111                         kAudioDevicePropertyScopePlayThrough.
1112     @constant       kAudioDevicePropertyChannelNominalLineLevel
1113                         An array of UInt32s whose values are the item IDs for the currently selected
1114                         nominal line levels. This property is implemented by an AudioControl object
1115                         that is a subclass of AudioLineLevelControl.
1116     @constant       kAudioDevicePropertyChannelNominalLineLevels
1117                         An array of UInt32s that represent all the IDs of all the nominal line
1118                         levels currently available. This property is implemented by an AudioControl
1119                         object that is a subclass of AudioLineLevelControl.
1120     @constant       kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString
1121                         This property translates the given nominal line level item ID into a human
1122                         readable name using an AudioValueTranslation structure. The input data is
1123                         the UInt32 containing the item ID to be translated and the output data is a
1124                         CFString. The caller is responsible for releasing the returned CFObject.
1125                         This property is implemented by an AudioControl object that is a subclass of
1126                         AudioLineLevelControl.
1127     @constant       kAudioDevicePropertyHighPassFilterSetting
1128                         An array of UInt32s whose values are the item IDs for the currently selected
1129                         high pass filter setting. This property is implemented by an AudioControl
1130                         object that is a subclass of AudioHighPassFilterControl.
1131     @constant       kAudioDevicePropertyHighPassFilterSettings
1132                         An array of UInt32s that represent all the IDs of all the high pass filter
1133                         settings currently available. This property is implemented by an
1134                         AudioControl object that is a subclass of AudioHighPassFilterControl.
1135     @constant       kAudioDevicePropertyHighPassFilterSettingNameForIDCFString
1136                         This property translates the given high pass filter setting item ID into a
1137                         human readable name using an AudioValueTranslation structure. The input data
1138                         is the UInt32 containing the item ID to be translated and the output data is
1139                         a CFString. The caller is responsible for releasing the returned CFObject.
1140                         This property is implemented by an AudioControl object that is a subclass of
1141                         AudioHighPassFilterControl.
1142     @constant       kAudioDevicePropertySubVolumeScalar
1143                         A Float32 that represents the value of the LFE volume control. The range is
1144                         between 0.0 and 1.0 (inclusive). Note that the set of all Float32 values
1145                         between 0.0 and 1.0 inclusive is much larger than the set of actual values
1146                         that the hardware can select. This means that the Float32 range has a many
1147                         to one mapping with the underlying hardware values. As such, setting a
1148                         scalar value will result in the control taking on the value nearest to what
1149                         was set. This property is implemented by an AudioControl object that is a
1150                         subclass of AudioLFEVolumeControl.
1151     @constant       kAudioDevicePropertySubVolumeDecibels
1152                         A Float32 that represents the value of the LFE volume control in dB. Note
1153                         that the set of all Float32 values in the dB range for the control is much
1154                         larger than the set of actual values that the hardware can select. This
1155                         means that the Float32 range has a many to one mapping with the underlying
1156                         hardware values. As such, setting a dB value will result in the control
1157                         taking on the value nearest to what was set. This property is implemented by
1158                         an AudioControl object that is a subclass of AudioLFE VolumeControl.
1159     @constant       kAudioDevicePropertySubVolumeRangeDecibels
1160                         An AudioValueRange that contains the minimum and maximum dB values the
1161                         control can have. This property is implemented by an AudioControl object
1162                         that is a subclass of AudioLFEVolumeControl.
1163     @constant       kAudioDevicePropertySubVolumeScalarToDecibels
1164                         A Float32 that on input contains a scalar volume value for the and on exit
1165                         contains the equivalent dB value. This property is implemented by an
1166                         AudioControl object that is a subclass of AudioLFEVolumeControl.
1167     @constant       kAudioDevicePropertySubVolumeDecibelsToScalar
1168                         A Float32 that on input contains a dB volume value for the and on exit
1169                         contains the equivalent scalar value. This property is implemented by an
1170                         AudioControl object that is a subclass of AudioLFEVolumeControl.
1171     @constant       kAudioDevicePropertySubMute
1172                         A UInt32 where a value of 1 means that mute is enabled making the LFE on
1173                         that element inaudible. The property is implemented by an AudioControl
1174                         object that is a subclass of AudioLFEMuteControl.
1175 }
1176 const
1177 	kAudioDevicePropertyJackIsConnected = FourCharCode('jack');
1178 	kAudioDevicePropertyVolumeScalar = FourCharCode('volm');
1179 	kAudioDevicePropertyVolumeDecibels = FourCharCode('vold');
1180 	kAudioDevicePropertyVolumeRangeDecibels = FourCharCode('vdb#');
1181 	kAudioDevicePropertyVolumeScalarToDecibels = FourCharCode('v2db');
1182 	kAudioDevicePropertyVolumeDecibelsToScalar = FourCharCode('db2v');
1183 	kAudioDevicePropertyStereoPan = FourCharCode('span');
1184 	kAudioDevicePropertyStereoPanChannels = FourCharCode('spn#');
1185 	kAudioDevicePropertyMute = FourCharCode('mute');
1186 	kAudioDevicePropertySolo = FourCharCode('solo');
1187 	kAudioDevicePropertyPhantomPower = FourCharCode('phan');
1188 	kAudioDevicePropertyPhaseInvert = FourCharCode('phsi');
1189 	kAudioDevicePropertyClipLight = FourCharCode('clip');
1190 	kAudioDevicePropertyTalkback = FourCharCode('talb');
1191 	kAudioDevicePropertyListenback = FourCharCode('lsnb');
1192 	kAudioDevicePropertyDataSource = FourCharCode('ssrc');
1193 	kAudioDevicePropertyDataSources = FourCharCode('ssc#');
1194 	kAudioDevicePropertyDataSourceNameForIDCFString = FourCharCode('lscn');
1195 	kAudioDevicePropertyDataSourceKindForID = FourCharCode('ssck');
1196 	kAudioDevicePropertyClockSource = FourCharCode('csrc');
1197 	kAudioDevicePropertyClockSources = FourCharCode('csc#');
1198 	kAudioDevicePropertyClockSourceNameForIDCFString = FourCharCode('lcsn');
1199 	kAudioDevicePropertyClockSourceKindForID = FourCharCode('csck');
1200 	kAudioDevicePropertyPlayThru = FourCharCode('thru');
1201 	kAudioDevicePropertyPlayThruSolo = FourCharCode('thrs');
1202 	kAudioDevicePropertyPlayThruVolumeScalar = FourCharCode('mvsc');
1203 	kAudioDevicePropertyPlayThruVolumeDecibels = FourCharCode('mvdb');
1204 	kAudioDevicePropertyPlayThruVolumeRangeDecibels = FourCharCode('mvd#');
1205 	kAudioDevicePropertyPlayThruVolumeScalarToDecibels = FourCharCode('mv2d');
1206 	kAudioDevicePropertyPlayThruVolumeDecibelsToScalar = FourCharCode('mv2s');
1207 	kAudioDevicePropertyPlayThruStereoPan = FourCharCode('mspn');
1208 	kAudioDevicePropertyPlayThruStereoPanChannels = FourCharCode('msp#');
1209 	kAudioDevicePropertyPlayThruDestination = FourCharCode('mdds');
1210 	kAudioDevicePropertyPlayThruDestinations = FourCharCode('mdd#');
1211 	kAudioDevicePropertyPlayThruDestinationNameForIDCFString = FourCharCode('mddc');
1212 	kAudioDevicePropertyChannelNominalLineLevel = FourCharCode('nlvl');
1213 	kAudioDevicePropertyChannelNominalLineLevels = FourCharCode('nlv#');
1214 	kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString = FourCharCode('lcnl');
1215 	kAudioDevicePropertyHighPassFilterSetting = FourCharCode('hipf');
1216 	kAudioDevicePropertyHighPassFilterSettings = FourCharCode('hip#');
1217 	kAudioDevicePropertyHighPassFilterSettingNameForIDCFString = FourCharCode('hipl');
1218 	kAudioDevicePropertySubVolumeScalar = FourCharCode('svlm');
1219 	kAudioDevicePropertySubVolumeDecibels = FourCharCode('svld');
1220 	kAudioDevicePropertySubVolumeRangeDecibels = FourCharCode('svd#');
1221 	kAudioDevicePropertySubVolumeScalarToDecibels = FourCharCode('sv2d');
1222 	kAudioDevicePropertySubVolumeDecibelsToScalar = FourCharCode('sd2v');
1223 	kAudioDevicePropertySubMute = FourCharCode('smut');
1224 
1225 //==================================================================================================
1226 //#pragma mark    AudioDevice Functions
1227 
1228 {!
1229     @functiongroup  AudioDevice
1230 }
1231 
1232 {!
1233     @function       AudioDeviceCreateIOProcID
1234     @abstract       Creates an AudioDeviceIOProcID from an AudioDeviceIOProc and a client data
1235                     pointer.
1236     @discussion     AudioDeviceIOProcIDs allow for the client to register the same function pointer
1237                     with a device multiple times
1238     @param          inDevice
1239                         The AudioDevice to register the IOProc with.
1240     @param          inProc
1241                         The AudioDeviceIOProc to register.
1242     @param          inClientData
1243                         A pointer to client data that is passed back to the IOProc when it is
1244                         called.
1245     @param          outIOProcID
1246                         The newly created AudioDeviceIOProcID.
1247     @result         An OSStatus indicating success or failure.
1248 }
AudioDeviceCreateIOProcIDnull1249 function AudioDeviceCreateIOProcID( inDevice: AudioObjectID; inProc: AudioDeviceIOProc; inClientData: UnivPtr; var outIOProcID: AudioDeviceIOProcID ): OSStatus; external name '_AudioDeviceCreateIOProcID';
1250 (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
1251 
1252 
1253 {!
1254     @function       AudioDeviceDestroyIOProcID
1255     @abstract       Destroys an AudioDeviceIOProcID.
1256     @discussion     AudioDeviceIOProcIDs allow for the client to register the same function pointer
1257                     with a device multiple times
1258     @param          inDevice
1259                         The AudioDevice from which the ID came.
1260     @param          inIOProcID
1261                         The AudioDeviceIOProcID to get rid of.
1262     @result         An OSStatus indicating success or failure.
1263 }
AudioDeviceDestroyIOProcIDnull1264 function AudioDeviceDestroyIOProcID( inDevice: AudioObjectID; inIOProcID: AudioDeviceIOProcID ): OSStatus; external name '_AudioDeviceDestroyIOProcID';
1265 (* __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
1266 
1267 {!
1268     @function       AudioDeviceStart
1269     @abstract       Starts IO for the given AudioDeviceIOProcID.
1270     @param          inDevice
1271                         The AudioDevice to start the IOProc on.
1272     @param          inProcID
1273                         The AudioDeviceIOProcID to start. Note that this can be NULL, which starts
1274                         the hardware regardless of whether or not there are any IOProcs registered.
1275                         This is necessary if any of the AudioDevice's timing services are to be
1276                         used. A balancing call to AudioDeviceStop with a NULL IOProc is required to
1277                         stop the hardware.
1278     @result         An OSStatus indicating success or failure.
1279 }
AudioDeviceStartnull1280 function AudioDeviceStart( inDevice: AudioObjectID; inProcID: AudioDeviceIOProcID ): OSStatus; external name '_AudioDeviceStart';
1281 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
1282 
1283 {!
1284     @function       AudioDeviceStartAtTime
1285     @abstract       Starts IO for the given AudioDeviceIOProcID and aligns the IO cycle of the
1286                     AudioDevice with the given time.
1287     @param          inDevice
1288                         The AudioDevice to start the IOProc on.
1289     @param          inProcID
1290                         The AudioDeviceIOProcID to start. Note that this can be NULL, which starts
1291                         the hardware regardless of whether or not there are any IOProcs registered.
1292     @param          ioRequestedStartTime
1293                         A pointer to an AudioTimeStamp that, on entry, is the requested time to
1294                         start the IOProc. On exit, it will be the actual time the IOProc will start.
1295     @param          inFlags
1296                         A UInt32 containing flags that modify how this function behaves.
1297     @result         An OSStatus indicating success or failure.
1298                     kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
1299                     not support starting at a specific time and inProc and ioRequestedStartTime are
1300                     not NULL.
1301 }
AudioDeviceStartAtTimenull1302 function AudioDeviceStartAtTime( inDevice: AudioObjectID; inProcID: AudioDeviceIOProcID; ioRequestedStartTime: AudioTimeStampPtr; inFlags: UInt32 ): OSStatus; external name '_AudioDeviceStartAtTime';
1303 (* __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0) *)
1304 
1305 {!
1306     @function       AudioDeviceStop
1307     @abstract       Stops IO for the given AudioDeviceIOProcID.
1308     @param          inDevice
1309                         The AudioDevice to stop the IOProc on.
1310     @param          inProcID
1311                         The AudioDeviceIOProcID to stop.
1312     @result         An OSStatus indicating success or failure.
1313 }
AudioDeviceStopnull1314 function AudioDeviceStop( inDevice: AudioObjectID; inProcID: AudioDeviceIOProcID ): OSStatus; external name '_AudioDeviceStop';
1315 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
1316 
1317 {!
1318     @function       AudioDeviceGetCurrentTime
1319     @abstract       Retrieves the current time from an AudioDevice. Note that the device has to be
1320                     running.
1321     @param          inDevice
1322                         The AudioDevice to from which to get the time.
1323     @param          outTime
1324                         An AudioTimeStamp into which the current time is put.
1325     @result         An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1326                     returned if the AudioDevice isn't running.
1327 }
AudioDeviceGetCurrentTimenull1328 function AudioDeviceGetCurrentTime( inDevice: AudioObjectID; var outTime: AudioTimeStamp ): OSStatus; external name '_AudioDeviceGetCurrentTime';
1329 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
1330 
1331 {!
1332     @function       AudioDeviceTranslateTime
1333     @abstract       Translates the time in the AudioDevice's time base from one representation to
1334                     another. Note that the device has to be running
1335     @param          inDevice
1336                         The AudioDevice whose time base governs the translation.
1337     @param          inTime
1338                         An AudioTimeStamp containing the time to be translated.
1339     @param          outTime
1340                         An AudioTimeStamp into which the translated time is put. On entry, the
1341                         mFlags field specifies which representations to translate the input time
1342                         into. Because not every device supports all time representations, on exit,
1343                         the mFlags field will indicate which translations were actually done.
1344     @result         An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1345                     returned if the AudioDevice isn't running.
1346 }
AudioDeviceTranslateTimenull1347 function AudioDeviceTranslateTime( inDevice: AudioObjectID; const (*var*) inTime: AudioTimeStamp; var outTime: AudioTimeStamp ): OSStatus; external name '_AudioDeviceTranslateTime';
1348 (* __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
1349 
1350 {!
1351     @function       AudioDeviceGetNearestStartTime
1352     @abstract       Query an AudioDevice to get a time equal to or later than the given time that is
1353                     the best time to start IO.
1354     @discussion     The time that is returned is dictated by the constraints of the device and the
1355                     system. For instance, the driver of a device that provides both audio and video
1356                     data may only allow start times that coincide with the edge of a video frame.
1357                     Also, if the device already has one or more active IOProcs, the start time will
1358                     be shifted to the beginning of the next IO cycle so as not to cause
1359                     discontinuities in the existing IOProcs. Another reason the start time may shift
1360                     is to allow for aligning the buffer accesses in an optimal fashion. Note that
1361                     the device must be running to use this function.
1362     @param          inDevice
1363                         The AudioDevice to query.
1364     @param          ioRequestedStartTime
1365                         A pointer to an AudioTimeStamp that, on entry, is the requested start time.
1366                         On exit, it will have the a time equal to or later than the requested time,
1367                         as dictated by the device's constraints.
1368     @param          inFlags
1369                         A UInt32 containing flags that modify how this function behaves.
1370     @result         An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1371                     returned if the AudioDevice isn't running.
1372                     kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
1373                     not support starting at a specific time.
1374 }
AudioDeviceGetNearestStartTimenull1375 function AudioDeviceGetNearestStartTime( inDevice: AudioObjectID; var ioRequestedStartTime: AudioTimeStamp; inFlags: UInt32 ): OSStatus; external name '_AudioDeviceGetNearestStartTime';
1376 (* __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0) *)
1377 
1378 //==================================================================================================
1379 //#pragma mark    AudioAggregateDevice Constants
1380 
1381 {!
1382     @enum           AudioAggregateDevice Class Constants
1383     @abstract       Various constants related to the AudioAggregateDevice class.
1384     @constant       kAudioAggregateDeviceClassID
1385                         The AudioClassID that identifies the AudioAggregateDevice class.
1386 }
1387 const
1388 	kAudioAggregateDeviceClassID = FourCharCode('aagg');
1389 
1390 {!
1391     @defined        kAudioAggregateDeviceUIDKey
1392     @discussion     The key used in a CFDictionary that describes the composition of an
1393                     AudioAggregateDevice. The value for this key is a CFString that contains the UID
1394                     of the AudioAggregateDevice.
1395 }
1396 const
1397 	kAudioAggregateDeviceUIDKey = 'uid';
1398 
1399 {!
1400     @defined        kAudioAggregateDeviceNameKey
1401     @discussion     The key used in a CFDictionary that describes the composition of an
1402                     AudioAggregateDevice. The value for this key is a CFString that contains the
1403                     human readable name of the AudioAggregateDevice.
1404 }
1405 const
1406 	kAudioAggregateDeviceNameKey = 'name';
1407 
1408 {!
1409     @defined        kAudioAggregateDeviceSubDeviceListKey
1410     @discussion     The key used in a CFDictionary that describes the composition of an
1411                     AudioAggregateDevice. The value for this key is a CFArray of CFDictionaries that
1412                     describe each sub-device in the AudioAggregateDevice. The keys for this
1413                     CFDictionary are defined in the AudioSubDevice section.
1414 }
1415 const
1416 	kAudioAggregateDeviceSubDeviceListKey = 'subdevices';
1417 
1418 {!
1419     @defined        kAudioAggregateDeviceMasterSubDeviceKey
1420     @discussion     The key used in a CFDictionary that describes the composition of an
1421                     AudioAggregateDevice. The value for this key is a CFString that contains the
1422                     UID for the sub-device that is the master time source for the
1423                     AudioAggregateDevice.
1424 }
1425 const
1426 	kAudioAggregateDeviceMasterSubDeviceKey = 'master';
1427 
1428 {!
1429     @defined        kAudioAggregateDeviceIsPrivateKey
1430     @discussion     The key used in a CFDictionary that describes the composition of an
1431                     AudioAggregateDevice. The value for this key is a CFNumber where a value of 0
1432                     means that the AudioAggregateDevice is to be published to the entire system and
1433                     a value of 1 means that the AudioAggregateDevice is private to the process that
1434                     created it. Note that a private AudioAggregateDevice is not persistent across
1435                     launches of the process that created it. Note that if this key is not present,
1436                     it implies that the AudioAggregateDevice is published to the entire system.
1437 }
1438 const
1439 	kAudioAggregateDeviceIsPrivateKey = 'private';
1440 
1441 {!
1442     @defined        kAudioAggregateDeviceIsStackedKey
1443     @discussion     The key used in a CFDictionary that describes the composition of an
1444                     AudioAggregateDevice. The value for this key is a CFNumber where a value of 0
1445                     means that the sub-devices of the AudioAggregateDevice are arranged such that
1446                     the output streams are all fed the same data.
1447  }
1448 const
1449 	kAudioAggregateDeviceIsStackedKey = 'stacked';
1450 
1451 //==================================================================================================
1452 //#pragma mark    AudioAggregateDevice Properties
1453 
1454 {!
1455     @enum           AudioAggregateDevice Properties
1456     @abstract       AudioObjectPropertySelector values provided by the AudioAggregateDevice class.
1457     @discussion     AudioAggregateDevice is a subclass of AudioDevice and has the same scope and
1458                     element structure.
1459     @constant       kAudioAggregateDevicePropertyFullSubDeviceList
1460                         A CFArray of CFStrings that contain the UIDs of all the devices, active or
1461                         inactive, contained in the AudioAggregateDevice. The order of the items in
1462                         the array is significant and is used to determine the order of the streams
1463                         of the AudioAggregateDevice. The caller is responsible for releasing the
1464                         returned CFObject.
1465     @constant       kAudioAggregateDevicePropertyActiveSubDeviceList
1466                         An array of AudioObjectIDs for all the active sub-devices in the aggregate
1467                         device.
1468     @constant       kAudioAggregateDevicePropertyComposition
1469                         A CFDictionary that describes the composition of the AudioAggregateDevice.
1470                         The keys for this CFDicitionary are defined in the AudioAggregateDevice
1471                         Constants section. The caller is responsible for releasing the returned
1472                         CFObject.
1473     @constant       kAudioAggregateDevicePropertyMasterSubDevice
1474                         A CFString that contains the UID for the AudioDevice that is currently
1475                         serving as the master time base of the aggregate device. The caller is
1476                         responsible for releasing the returned CFObject.
1477 }
1478 const
1479 	kAudioAggregateDevicePropertyFullSubDeviceList = FourCharCode('grup');
1480 	kAudioAggregateDevicePropertyActiveSubDeviceList = FourCharCode('agrp');
1481 	kAudioAggregateDevicePropertyComposition = FourCharCode('acom');
1482 	kAudioAggregateDevicePropertyMasterSubDevice = FourCharCode('amst');
1483 
1484 //==================================================================================================
1485 //#pragma mark    AudioSubDevice Constants
1486 
1487 {!
1488     @enum           AudioSubDevice Class Constants
1489     @abstract       Various constants related to the AudioSubDevice class.
1490     @constant       kAudioSubDeviceClassID
1491                         The AudioClassID that identifies the AudioSubDevice class.
1492 }
1493 const
1494 	kAudioSubDeviceClassID = FourCharCode('asub');
1495 
1496 {!
1497     @enum           AudioSubDevice Clock Drift Compensation Methods
1498     @abstract       Constants that describe the range of values the property
1499                     kAudioSubDevicePropertyDriftCompensation. It is a continuous range from
1500                     kAudioSubDeviceDriftCompensationMinQuality to
1501                     kAudioSubDeviceDriftCompensationMaxQuality, with some commonly used settings
1502                     called out.
1503 }
1504 const
1505 	kAudioSubDeviceDriftCompensationMinQuality = 0;
1506 	kAudioSubDeviceDriftCompensationLowQuality = $20;
1507 	kAudioSubDeviceDriftCompensationMediumQuality = $40;
1508 	kAudioSubDeviceDriftCompensationHighQuality = $60;
1509 	kAudioSubDeviceDriftCompensationMaxQuality = $7F;
1510 
1511 {!
1512     @defined        kAudioSubDeviceUIDKey
1513     @discussion     The key used in a CFDictionary that describes the state of an AudioSubDevice.
1514                     The value for this key is a CFString that contains the UID for the
1515                     AudioSubDevice.
1516 }
1517 const
1518 	kAudioSubDeviceUIDKey = 'uid';
1519 
1520 {!
1521     @defined        kAudioAggregateDeviceSubDeviceNameKey
1522     @discussion     The key used in a CFDictionary that describes the state of an AudioSubDevice.
1523                     The value for this key is a CFString that contains the human readable
1524                     name of the AudioSubDevice.
1525 }
1526 const
1527 	kAudioSubDeviceNameKey = 'name';
1528 
1529 {!
1530     @defined        kAudioSubDeviceInputChannelsKey
1531     @discussion     The key used in a CFDictionary that describes the state of an AudioSubDevice.
1532                     The value for this key is a CFNumber that indicates the total number of input
1533                     channels for the AudioSubDevice.
1534 }
1535 const
1536 	kAudioSubDeviceInputChannelsKey = 'channels-in';
1537 
1538 {!
1539     @defined        kAudioSubDeviceOutputChannelsKey
1540     @discussion     The key used in a CFDictionary that describes the state of an AudioSubDevice.
1541                     The value for this key is a CFNumber that indicates the total number of output
1542                     channels for the AudioSubDevice.
1543 }
1544 const
1545 	kAudioSubDeviceOutputChannelsKey = 'channels-out';
1546 
1547 {!
1548     @defined        kAudioSubDeviceExtraInputLatencyKey
1549     @discussion     The key used in a CFDictionary that describes the state of an AudioSubDevice.
1550                     The value for this key is a CFNumber that indicates the total number of frames
1551                     of additional latency that will be added to the input side of the
1552                     AudioSubDevice.
1553 }
1554 const
1555 	kAudioSubDeviceExtraInputLatencyKey = 'latency-in';
1556 
1557 {!
1558     @defined        kAudioSubDeviceExtraOutputLatencyKey
1559     @discussion     The key used in a CFDictionary that describes the state of an AudioSubDevice.
1560                     The value for this key is a CFNumber that indicates the total number of frames
1561                     of additional latency that will be added to the output side of the
1562                     AudioSubDevice.
1563 }
1564 const
1565 	kAudioSubDeviceExtraOutputLatencyKey = 'latency-out';
1566 
1567 {!
1568     @defined        kAudioSubDeviceDriftCompensationKey
1569     @discussion     The key used in a CFDictionary that describes the state of an AudioSubDevice.
1570                     The value for this key is a CFNumber where a non-zero value indicates that drift
1571                     compensation is enabled for the AudioSubDevice
1572 }
1573 const
1574 	kAudioSubDeviceDriftCompensationKey = 'drift';
1575 
1576 {!
1577     @defined        kAudioSubDeviceDriftCompensationQualityKey
1578     @discussion     The key used in a CFDictionary that describes the state of an AudioSubDevice.
1579                     The value for this key is a CFNumber that indicates the quality of the drifty
1580                     compensation for the AudioSubDevice
1581 }
1582 const
1583 	kAudioSubDeviceDriftCompensationQualityKey = 'drift quality';
1584 
1585 //==================================================================================================
1586 //#pragma mark    AudioSubDevice Properties
1587 
1588 {!
1589     @enum           AudioSubDevice Properties
1590     @abstract       AudioObjectPropertySelector values provided by the AudioSubDevice class.
1591     @discussion     The AudioSubDevice class is a subclass of AudioDevice class and has the same
1592                     scope and element structure. However, AudioSubDevice objects do not implement an
1593                     IO path of their own and as such do not implmenent any  AudioDevice properties
1594                     associated with the IO path. They also don't have any streams.
1595     @constant       kAudioSubDevicePropertyExtraLatency
1596                         A Float64 indicating the number of sample frames to add to or subtract from
1597                         the latency compensation used for this AudioSubDevice.
1598     @constant       kAudioSubDevicePropertyDriftCompensation
1599                         A UInt32 where a value of 0 indicates that no drift compensation should be
1600                         done for this AudioSubDevice and a value of 1 means that it should.
1601     @constant       kAudioSubDevicePropertyDriftCompensationQuality
1602                         A UInt32 that controls the trade-off between quality and CPU load in the
1603                         drift compensation. The range of values is from 0 to 128, where the lower
1604                         the number, the worse the quality but also the less CPU is used to do the
1605                         compensation.
1606 }
1607 const
1608 	kAudioSubDevicePropertyExtraLatency = FourCharCode('xltc');
1609 	kAudioSubDevicePropertyDriftCompensation = FourCharCode('drft');
1610 	kAudioSubDevicePropertyDriftCompensationQuality = FourCharCode('drfq');
1611 
1612 //==================================================================================================
1613 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
1614 
1615 end.
1616 {$endc} {not MACOSALLINCLUDE}
1617