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