objc2_core_audio/generated/
AudioHardwareDeprecated.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7#[cfg(feature = "objc2-core-audio-types")]
8use objc2_core_audio_types::*;
9use objc2_core_foundation::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarerunloopmode?language=objc)
14pub const kAudioHardwareRunLoopMode: &CStr =
15    unsafe { CStr::from_bytes_with_nul_unchecked(b"com.apple.audio.CoreAudio\0") };
16/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicemastersubdevicekey?language=objc)
17pub const kAudioAggregateDeviceMasterSubDeviceKey: &CStr =
18    unsafe { CStr::from_bytes_with_nul_unchecked(b"master\0") };
19/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyscopeinput?language=objc)
20#[cfg(feature = "AudioHardware")]
21pub const kAudioDevicePropertyScopeInput: AudioObjectPropertyScope = kAudioObjectPropertyScopeInput;
22/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyscopeoutput?language=objc)
23#[cfg(feature = "AudioHardware")]
24pub const kAudioDevicePropertyScopeOutput: AudioObjectPropertyScope =
25    kAudioObjectPropertyScopeOutput;
26/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyscopeplaythrough?language=objc)
27#[cfg(feature = "AudioHardware")]
28pub const kAudioDevicePropertyScopePlayThrough: AudioObjectPropertyScope =
29    kAudioObjectPropertyScopePlayThrough;
30
31/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopropertywildcardpropertyid?language=objc)
32#[cfg(feature = "AudioHardware")]
33pub const kAudioPropertyWildcardPropertyID: AudioObjectPropertySelector =
34    kAudioObjectPropertySelectorWildcard;
35
36/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopropertywildcardsection?language=objc)
37pub const kAudioPropertyWildcardSection: c_uchar = 0xFF;
38
39/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopropertywildcardchannel?language=objc)
40#[cfg(feature = "AudioHardware")]
41pub const kAudioPropertyWildcardChannel: AudioObjectPropertyElement =
42    kAudioObjectPropertyElementWildcard;
43
44/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioisubownercontrolclassid?language=objc)
45#[cfg(feature = "AudioHardware")]
46pub const kAudioISubOwnerControlClassID: AudioClassID = 0x61746368;
47
48/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolevelcontrolpropertydecibelstoscalartransferfunction?language=objc)
49#[cfg(feature = "AudioHardware")]
50pub const kAudioLevelControlPropertyDecibelsToScalarTransferFunction: AudioObjectPropertySelector =
51    0x6c637466;
52
53/// The following constants are the only supported values for a volume control's
54/// transfer function.
55///
56/// The transfer function implemented in the volume control works by raising the
57/// scalar value to an exponent to map it into the decibel range. The constants
58/// in this enum express the exponent used in the name as a quotient. For example,
59/// kAudioLevelControlTranferFunction3Over4 represents the exponent 0.75.
60///
61/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiolevelcontroltransferfunction?language=objc)
62// NS_ENUM
63#[repr(transparent)]
64#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
65pub struct AudioLevelControlTransferFunction(pub u32);
66impl AudioLevelControlTransferFunction {
67    #[doc(alias = "kAudioLevelControlTranferFunctionLinear")]
68    pub const TranferFunctionLinear: Self = Self(0);
69    #[doc(alias = "kAudioLevelControlTranferFunction1Over3")]
70    pub const TranferFunction1Over3: Self = Self(1);
71    #[doc(alias = "kAudioLevelControlTranferFunction1Over2")]
72    pub const TranferFunction1Over2: Self = Self(2);
73    #[doc(alias = "kAudioLevelControlTranferFunction3Over4")]
74    pub const TranferFunction3Over4: Self = Self(3);
75    #[doc(alias = "kAudioLevelControlTranferFunction3Over2")]
76    pub const TranferFunction3Over2: Self = Self(4);
77    #[doc(alias = "kAudioLevelControlTranferFunction2Over1")]
78    pub const TranferFunction2Over1: Self = Self(5);
79    #[doc(alias = "kAudioLevelControlTranferFunction3Over1")]
80    pub const TranferFunction3Over1: Self = Self(6);
81    #[doc(alias = "kAudioLevelControlTranferFunction4Over1")]
82    pub const TranferFunction4Over1: Self = Self(7);
83    #[doc(alias = "kAudioLevelControlTranferFunction5Over1")]
84    pub const TranferFunction5Over1: Self = Self(8);
85    #[doc(alias = "kAudioLevelControlTranferFunction6Over1")]
86    pub const TranferFunction6Over1: Self = Self(9);
87    #[doc(alias = "kAudioLevelControlTranferFunction7Over1")]
88    pub const TranferFunction7Over1: Self = Self(10);
89    #[doc(alias = "kAudioLevelControlTranferFunction8Over1")]
90    pub const TranferFunction8Over1: Self = Self(11);
91    #[doc(alias = "kAudioLevelControlTranferFunction9Over1")]
92    pub const TranferFunction9Over1: Self = Self(12);
93    #[doc(alias = "kAudioLevelControlTranferFunction10Over1")]
94    pub const TranferFunction10Over1: Self = Self(13);
95    #[doc(alias = "kAudioLevelControlTranferFunction11Over1")]
96    pub const TranferFunction11Over1: Self = Self(14);
97    #[doc(alias = "kAudioLevelControlTranferFunction12Over1")]
98    pub const TranferFunction12Over1: Self = Self(15);
99}
100
101#[cfg(feature = "objc2")]
102unsafe impl Encode for AudioLevelControlTransferFunction {
103    const ENCODING: Encoding = u32::ENCODING;
104}
105
106#[cfg(feature = "objc2")]
107unsafe impl RefEncode for AudioLevelControlTransferFunction {
108    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
109}
110
111/// An AudioHardwarePropertyID is a integer that identifies a specific piece of
112/// information about the AudioSystemObject.
113///
114/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiohardwarepropertyid?language=objc)
115#[cfg(feature = "AudioHardware")]
116pub type AudioHardwarePropertyID = AudioObjectPropertySelector;
117
118/// Clients register an AudioHardwarePropertyListenerProc with the AudioSystemObject
119/// in order to receive notifications when the properties of the object change.
120///
121/// Note that the same functionality is provided by AudioObjectPropertyListenerProc.
122///
123/// Parameter `inPropertyID`: The AudioHardwarePropertyID of the property that changed.
124///
125/// Parameter `inClientData`: A pointer to client data established when the listener proc was registered
126/// with the AudioSystemObject.
127///
128/// Returns: The return value is currently unused and should always be 0.
129///
130/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiohardwarepropertylistenerproc?language=objc)
131#[cfg(feature = "AudioHardware")]
132pub type AudioHardwarePropertyListenerProc =
133    Option<unsafe extern "C-unwind" fn(AudioHardwarePropertyID, *mut c_void) -> OSStatus>;
134
135/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyrunloop?language=objc)
136#[cfg(feature = "AudioHardware")]
137pub const kAudioHardwarePropertyRunLoop: AudioObjectPropertySelector = 0x726e6c70;
138/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydeviceforuid?language=objc)
139#[cfg(feature = "AudioHardware")]
140pub const kAudioHardwarePropertyDeviceForUID: AudioObjectPropertySelector = 0x64756964;
141/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertypluginforbundleid?language=objc)
142#[cfg(feature = "AudioHardware")]
143pub const kAudioHardwarePropertyPlugInForBundleID: AudioObjectPropertySelector = 0x70696269;
144/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessismaster?language=objc)
145#[cfg(feature = "AudioHardware")]
146#[deprecated]
147pub const kAudioHardwarePropertyProcessIsMaster: AudioObjectPropertySelector = 0x6d617374;
148
149/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertybootchimevolumescalar?language=objc)
150#[cfg(feature = "AudioHardware")]
151pub const kAudioHardwarePropertyBootChimeVolumeScalar: AudioObjectPropertySelector = 0x62627673;
152/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertybootchimevolumedecibels?language=objc)
153#[cfg(feature = "AudioHardware")]
154pub const kAudioHardwarePropertyBootChimeVolumeDecibels: AudioObjectPropertySelector = 0x62627664;
155/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertybootchimevolumerangedecibels?language=objc)
156#[cfg(feature = "AudioHardware")]
157pub const kAudioHardwarePropertyBootChimeVolumeRangeDecibels: AudioObjectPropertySelector =
158    0x62626423;
159/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertybootchimevolumescalartodecibels?language=objc)
160#[cfg(feature = "AudioHardware")]
161pub const kAudioHardwarePropertyBootChimeVolumeScalarToDecibels: AudioObjectPropertySelector =
162    0x62763264;
163/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertybootchimevolumedecibelstoscalar?language=objc)
164#[cfg(feature = "AudioHardware")]
165pub const kAudioHardwarePropertyBootChimeVolumeDecibelsToScalar: AudioObjectPropertySelector =
166    0x62643276;
167/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertybootchimevolumedecibelstoscalartransferfunction?language=objc)
168#[cfg(feature = "AudioHardware")]
169pub const kAudioHardwarePropertyBootChimeVolumeDecibelsToScalarTransferFunction:
170    AudioObjectPropertySelector = 0x62767466;
171
172extern "C-unwind" {
173    /// Add the given CFRunLoopSource to the the HAL's notification CFRunLoop.
174    ///
175    /// The CFRunLoop the HAL uses for notifications is specified by
176    /// kAudioHardwarePropertyRunLoop. If kAudioHardwarePropertyRunLoop changes,
177    /// CFRunLoopSources added with this function will automatically be transferred to
178    /// the new CFRunLoop.
179    /// Usage of the HAL's notification run loop is deprecated. Please use libdispatch
180    /// instead.
181    ///
182    /// Parameter `inRunLoopSource`: The CFRunLoopSource to add.
183    ///
184    /// Returns: An OSStatus indicating success or failure.
185    #[deprecated]
186    pub fn AudioHardwareAddRunLoopSource(in_run_loop_source: &CFRunLoopSource) -> OSStatus;
187}
188
189extern "C-unwind" {
190    /// Remove the given CFRunLoopSource from the the HAL's notification CFRunLoop.
191    ///
192    /// The CFRunLoop the HAL uses for notifications is specified by
193    /// kAudioHardwarePropertyRunLoop.
194    /// Usage of the HAL's notification run loop is deprecated. Please use libdispatch
195    /// instead.
196    ///
197    /// Parameter `inRunLoopSource`: The CFRunLoopSource to remove.
198    ///
199    /// Returns: An OSStatus indicating success or failure.
200    #[deprecated]
201    pub fn AudioHardwareRemoveRunLoopSource(in_run_loop_source: &CFRunLoopSource) -> OSStatus;
202}
203
204extern "C-unwind" {
205    /// Retrieve information about the given property.
206    ///
207    /// Note that the same functionality is provided by the functions
208    /// AudioObjectHasProperty(), AudioObjectIsPropertySettable(), and
209    /// AudioObjectGetPropertyDataSize().
210    ///
211    /// Parameter `inPropertyID`: The AudioHardwarePropertyID of the property to query.
212    ///
213    /// Parameter `outSize`: A pointer to a UInt32 that receives the size of the property data in bytes
214    /// on exit. This can be NULL if the size information is not being requested.
215    ///
216    /// Parameter `outWritable`: A pointer to a Boolean that receives indication of whether or not the given
217    /// property can be set. This can be NULL if the writability is not being
218    /// requested.
219    ///
220    /// Returns: An OSStatus indicating success or failure.
221    ///
222    /// # Safety
223    ///
224    /// - `out_size` must be a valid pointer or null.
225    /// - `out_writable` must be a valid pointer or null.
226    #[cfg(feature = "AudioHardware")]
227    #[deprecated]
228    pub fn AudioHardwareGetPropertyInfo(
229        in_property_id: AudioHardwarePropertyID,
230        out_size: *mut u32,
231        out_writable: *mut Boolean,
232    ) -> OSStatus;
233}
234
235extern "C-unwind" {
236    /// Queries an the AudioSystemObject to get the data of the given property and
237    /// places it in the provided buffer.
238    ///
239    /// Note that the same functionality is provided by the function
240    /// AudioObjectGetPropertyData().
241    ///
242    /// Parameter `inPropertyID`: The AudioHardwarePropertyID of the property to query.
243    ///
244    /// Parameter `ioPropertyDataSize`: A UInt32 which on entry indicates the size of the buffer pointed to by
245    /// outData and on exit indicates how much of the buffer was used.
246    ///
247    /// Parameter `outPropertyData`: The buffer into which the AudioSystemObject will put the data for the given
248    /// property.
249    ///
250    /// Returns: An OSStatus indicating success or failure.
251    ///
252    /// # Safety
253    ///
254    /// - `io_property_data_size` must be a valid pointer.
255    /// - `out_property_data` must be a valid pointer.
256    #[cfg(feature = "AudioHardware")]
257    #[deprecated]
258    pub fn AudioHardwareGetProperty(
259        in_property_id: AudioHardwarePropertyID,
260        io_property_data_size: NonNull<u32>,
261        out_property_data: NonNull<c_void>,
262    ) -> OSStatus;
263}
264
265extern "C-unwind" {
266    /// Tells the AudioSystemObject to change the value of the given property using the
267    /// provided data.
268    ///
269    /// Note that the value of the property should not be considered changed until the
270    /// HAL has called the listeners as many properties values are changed
271    /// asynchronously. Also note that the same functionality is provided by the
272    /// function AudioObjectGetPropertyData().
273    ///
274    /// Parameter `inPropertyID`: The AudioHardwarePropertyID of the property to change.
275    ///
276    /// Parameter `inPropertyDataSize`: A UInt32 indicating the size of the buffer pointed to by inData.
277    ///
278    /// Parameter `inPropertyData`: The buffer containing the data to be used to change the property's value.
279    ///
280    /// Returns: An OSStatus indicating success or failure.
281    ///
282    /// # Safety
283    ///
284    /// `in_property_data` must be a valid pointer.
285    #[cfg(feature = "AudioHardware")]
286    #[deprecated]
287    pub fn AudioHardwareSetProperty(
288        in_property_id: AudioHardwarePropertyID,
289        in_property_data_size: u32,
290        in_property_data: NonNull<c_void>,
291    ) -> OSStatus;
292}
293
294extern "C-unwind" {
295    /// Registers the given AudioHardwarePropertyListenerProc to receive notifications
296    /// when the given property changes.
297    ///
298    /// Note that the same functionality is provided by AudioObjectAddPropertyListener
299    /// in conjunction with AudioObjectPropertyListenerProc.
300    ///
301    /// Parameter `inPropertyID`: The AudioHardwarePropertyID of the property to listen to.
302    ///
303    /// Parameter `inProc`: AudioHardwarePropertyListenerProc to call.
304    ///
305    /// Parameter `inClientData`: A pointer to client data that is passed to the listener when it is called.
306    ///
307    /// Returns: An OSStatus indicating success or failure.
308    ///
309    /// # Safety
310    ///
311    /// - `in_proc` must be implemented correctly.
312    /// - `in_client_data` must be a valid pointer or null.
313    #[cfg(feature = "AudioHardware")]
314    #[deprecated]
315    pub fn AudioHardwareAddPropertyListener(
316        in_property_id: AudioHardwarePropertyID,
317        in_proc: AudioHardwarePropertyListenerProc,
318        in_client_data: *mut c_void,
319    ) -> OSStatus;
320}
321
322extern "C-unwind" {
323    /// Unregisters the given AudioHardwarePropertyListenerProc from receive
324    /// notifications when the given property changes.
325    ///
326    /// Note that the same functionality is provided by
327    /// AudioObjectRemovePropertyListener in conjunction with
328    /// AudioObjectPropertyListenerProc.
329    ///
330    /// Parameter `inPropertyID`: The AudioHardwarePropertyID of the property to stop listening to.
331    ///
332    /// Parameter `inProc`: AudioHardwarePropertyListenerProc to unregister.
333    ///
334    /// Returns: An OSStatus indicating success or failure.
335    ///
336    /// # Safety
337    ///
338    /// `in_proc` must be implemented correctly.
339    #[cfg(feature = "AudioHardware")]
340    #[deprecated]
341    pub fn AudioHardwareRemovePropertyListener(
342        in_property_id: AudioHardwarePropertyID,
343        in_proc: AudioHardwarePropertyListenerProc,
344    ) -> OSStatus;
345}
346
347/// AudioDevice is the base class for all objects that represent an audio device.
348///
349/// AudioDevice is a subclass of AudioObject. AudioDevices normally contain
350/// AudioStreams and AudioControls, but may contain other things depending on the
351/// kind of AudioDevice (e.g. aggregate devices contain other AudioDevices).
352///
353/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodeviceid?language=objc)
354#[cfg(feature = "AudioHardware")]
355pub type AudioDeviceID = AudioObjectID;
356
357/// An AudioDevicePropertyID is an integer that identifies a specific piece of
358/// information about the object.
359///
360/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodevicepropertyid?language=objc)
361#[cfg(feature = "AudioHardware")]
362pub type AudioDevicePropertyID = AudioObjectPropertySelector;
363
364/// Clients register an AudioDevicePropertyListenerProc with the AudioDevice object
365/// in order to receive notifications when the properties of the object change.
366///
367/// Note that the same functionality is provided by AudioObjectPropertyListenerProc.
368///
369/// Parameter `inDevice`: The AudioDevice whose property has changed.
370///
371/// Parameter `inChannel`: The channel of the property that changed where 0 is the main channel.
372///
373/// Parameter `isInput`: Which section of the AudioDevice changed.
374///
375/// Parameter `inPropertyID`: The AudioDevicePropertyID of the property that changed.
376///
377/// Parameter `inClientData`: A pointer to client data established when the listener proc was registered
378/// with the object.
379///
380/// Returns: The return value is currently unused and should always be 0.
381///
382/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodevicepropertylistenerproc?language=objc)
383#[cfg(feature = "AudioHardware")]
384pub type AudioDevicePropertyListenerProc = Option<
385    unsafe extern "C-unwind" fn(
386        AudioDeviceID,
387        u32,
388        Boolean,
389        AudioDevicePropertyID,
390        *mut c_void,
391    ) -> OSStatus,
392>;
393
394/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodeviceunknown?language=objc)
395#[cfg(feature = "AudioHardware")]
396pub const kAudioDeviceUnknown: AudioObjectID = kAudioObjectUnknown;
397
398/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypeautoaggregate?language=objc)
399pub const kAudioDeviceTransportTypeAutoAggregate: u32 = 0x66677270;
400
401/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumedecibelstoscalartransferfunction?language=objc)
402#[cfg(feature = "AudioHardware")]
403pub const kAudioDevicePropertyVolumeDecibelsToScalarTransferFunction: AudioObjectPropertySelector =
404    0x76637466;
405/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumedecibelstoscalartransferfunction?language=objc)
406#[cfg(feature = "AudioHardware")]
407pub const kAudioDevicePropertyPlayThruVolumeDecibelsToScalarTransferFunction:
408    AudioObjectPropertySelector = 0x6d767466;
409/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydrivershouldownisub?language=objc)
410#[cfg(feature = "AudioHardware")]
411pub const kAudioDevicePropertyDriverShouldOwniSub: AudioObjectPropertySelector = 0x69737562;
412/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumedecibelstoscalartransferfunction?language=objc)
413#[cfg(feature = "AudioHardware")]
414pub const kAudioDevicePropertySubVolumeDecibelsToScalarTransferFunction:
415    AudioObjectPropertySelector = 0x73767466;
416
417/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydevicename?language=objc)
418#[cfg(feature = "AudioHardware")]
419pub const kAudioDevicePropertyDeviceName: AudioObjectPropertySelector = 0x6e616d65;
420/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydevicenamecfstring?language=objc)
421#[cfg(feature = "AudioHardware")]
422pub const kAudioDevicePropertyDeviceNameCFString: AudioObjectPropertySelector =
423    kAudioObjectPropertyName;
424/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydevicemanufacturer?language=objc)
425#[cfg(feature = "AudioHardware")]
426pub const kAudioDevicePropertyDeviceManufacturer: AudioObjectPropertySelector = 0x6d616b72;
427/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydevicemanufacturercfstring?language=objc)
428#[cfg(feature = "AudioHardware")]
429pub const kAudioDevicePropertyDeviceManufacturerCFString: AudioObjectPropertySelector =
430    kAudioObjectPropertyManufacturer;
431/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyregisterbufferlist?language=objc)
432#[cfg(feature = "AudioHardware")]
433pub const kAudioDevicePropertyRegisterBufferList: AudioObjectPropertySelector = 0x72627566;
434/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertybuffersize?language=objc)
435#[cfg(feature = "AudioHardware")]
436pub const kAudioDevicePropertyBufferSize: AudioObjectPropertySelector = 0x6273697a;
437/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertybuffersizerange?language=objc)
438#[cfg(feature = "AudioHardware")]
439pub const kAudioDevicePropertyBufferSizeRange: AudioObjectPropertySelector = 0x62737a23;
440/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelname?language=objc)
441#[cfg(feature = "AudioHardware")]
442pub const kAudioDevicePropertyChannelName: AudioObjectPropertySelector = 0x63686e6d;
443/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnamecfstring?language=objc)
444#[cfg(feature = "AudioHardware")]
445pub const kAudioDevicePropertyChannelNameCFString: AudioObjectPropertySelector =
446    kAudioObjectPropertyElementName;
447/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelcategoryname?language=objc)
448#[cfg(feature = "AudioHardware")]
449pub const kAudioDevicePropertyChannelCategoryName: AudioObjectPropertySelector = 0x63636e6d;
450/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelcategorynamecfstring?language=objc)
451#[cfg(feature = "AudioHardware")]
452pub const kAudioDevicePropertyChannelCategoryNameCFString: AudioObjectPropertySelector =
453    kAudioObjectPropertyElementCategoryName;
454/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnumbername?language=objc)
455#[cfg(feature = "AudioHardware")]
456pub const kAudioDevicePropertyChannelNumberName: AudioObjectPropertySelector = 0x636e6e6d;
457/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnumbernamecfstring?language=objc)
458#[cfg(feature = "AudioHardware")]
459pub const kAudioDevicePropertyChannelNumberNameCFString: AudioObjectPropertySelector =
460    kAudioObjectPropertyElementNumberName;
461/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysupportsmixing?language=objc)
462#[cfg(feature = "AudioHardware")]
463pub const kAudioDevicePropertySupportsMixing: AudioObjectPropertySelector = 0x6d69783f;
464/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystreamformat?language=objc)
465#[cfg(feature = "AudioHardware")]
466pub const kAudioDevicePropertyStreamFormat: AudioObjectPropertySelector = 0x73666d74;
467/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystreamformats?language=objc)
468#[cfg(feature = "AudioHardware")]
469pub const kAudioDevicePropertyStreamFormats: AudioObjectPropertySelector = 0x73666d23;
470/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystreamformatsupported?language=objc)
471#[cfg(feature = "AudioHardware")]
472pub const kAudioDevicePropertyStreamFormatSupported: AudioObjectPropertySelector = 0x73666d3f;
473/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystreamformatmatch?language=objc)
474#[cfg(feature = "AudioHardware")]
475pub const kAudioDevicePropertyStreamFormatMatch: AudioObjectPropertySelector = 0x73666d6d;
476/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasourcenameforid?language=objc)
477#[cfg(feature = "AudioHardware")]
478pub const kAudioDevicePropertyDataSourceNameForID: AudioObjectPropertySelector = 0x7373636e;
479/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksourcenameforid?language=objc)
480#[cfg(feature = "AudioHardware")]
481pub const kAudioDevicePropertyClockSourceNameForID: AudioObjectPropertySelector = 0x6373636e;
482/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrudestinationnameforid?language=objc)
483#[cfg(feature = "AudioHardware")]
484pub const kAudioDevicePropertyPlayThruDestinationNameForID: AudioObjectPropertySelector =
485    0x6d64646e;
486/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnominallinelevelnameforid?language=objc)
487#[cfg(feature = "AudioHardware")]
488pub const kAudioDevicePropertyChannelNominalLineLevelNameForID: AudioObjectPropertySelector =
489    0x636e6c76;
490/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhighpassfiltersettingnameforid?language=objc)
491#[cfg(feature = "AudioHardware")]
492pub const kAudioDevicePropertyHighPassFilterSettingNameForID: AudioObjectPropertySelector =
493    0x63686970;
494
495extern "C-unwind" {
496    /// Registers the given AudioDeviceIOProc with the AudioDevice.
497    ///
498    /// A client may have multiple IOProcs for a given device, but the device is free to
499    /// only accept as many as it can handle. Note that it is not recommended for
500    /// clients to have more than a single IOProc registered at a time as this can be
501    /// wasteful of system resources. Rather, it is recommended that the client do any
502    /// necessary mixing itself so that only one IOProc is necessary.
503    /// This routine has been deprecated in favor of AudioDeviceCreateIOProcID().
504    ///
505    /// Parameter `inDevice`: The AudioDevice to register the IOProc with.
506    ///
507    /// Parameter `inProc`: The AudioDeviceIOProc to register.
508    ///
509    /// Parameter `inClientData`: A pointer to client data that is passed back to the IOProc when it is
510    /// called.
511    ///
512    /// Returns: An OSStatus indicating success or failure.
513    ///
514    /// # Safety
515    ///
516    /// - `in_proc` must be implemented correctly.
517    /// - `in_client_data` must be a valid pointer or null.
518    #[cfg(all(feature = "AudioHardware", feature = "objc2-core-audio-types"))]
519    #[deprecated]
520    pub fn AudioDeviceAddIOProc(
521        in_device: AudioDeviceID,
522        in_proc: AudioDeviceIOProc,
523        in_client_data: *mut c_void,
524    ) -> OSStatus;
525}
526
527extern "C-unwind" {
528    /// Unregisters the given AudioDeviceIOProc from the AudioDevice.
529    /// This routine has been deprecated in favor of AudioDeviceDestroyIOProcID().
530    ///
531    /// Parameter `inDevice`: The AudioDevice to unregister the IOProc from.
532    ///
533    /// Parameter `inProc`: The AudioDeviceIOProc to unregister.
534    ///
535    /// Returns: An OSStatus indicating success or failure.
536    ///
537    /// # Safety
538    ///
539    /// `in_proc` must be implemented correctly.
540    #[cfg(all(feature = "AudioHardware", feature = "objc2-core-audio-types"))]
541    #[deprecated]
542    pub fn AudioDeviceRemoveIOProc(
543        in_device: AudioDeviceID,
544        in_proc: AudioDeviceIOProc,
545    ) -> OSStatus;
546}
547
548extern "C-unwind" {
549    /// Read some data from an AudioDevice starting at the given time.
550    ///
551    /// With the advent of aggregate devices, the need for AudioDeviceRead has gone
552    /// away. Consequently, this function is now deprecated.
553    ///
554    /// Parameter `inDevice`: The AudioDevice to read from.
555    ///
556    /// Parameter `inStartTime`: An AudioTimeStamp indicating the time from which to read the data. In
557    /// general, the valid range of time (in frames) is from the current time minus
558    /// the maximum IO buffer size to the current time minus the safety offset.
559    ///
560    /// Parameter `outData`: An AudioBufferList that must be the same size and shape as that returned by
561    /// kAudioDevicePropertyStreamConfiguration. Further, the AudioBufferList must
562    /// have been previously registered with the device via
563    /// kAudioDevicePropertyRegisterBufferList. On exit, the mDataSize fields will
564    /// be updated with the amount of data read.
565    ///
566    /// Returns: An OSStatus indicating success or failure.
567    /// kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
568    /// not support direct reading.
569    ///
570    /// # Safety
571    ///
572    /// - `in_start_time` must be a valid pointer.
573    /// - `out_data` must be a valid pointer.
574    #[cfg(all(feature = "AudioHardware", feature = "objc2-core-audio-types"))]
575    #[deprecated]
576    pub fn AudioDeviceRead(
577        in_device: AudioDeviceID,
578        in_start_time: NonNull<AudioTimeStamp>,
579        out_data: NonNull<AudioBufferList>,
580    ) -> OSStatus;
581}
582
583/// Retrieve information about the given property of an AudioDevice.
584///
585/// Note that the same functionality is provided by the functions
586/// AudioObjectHasProperty(), AudioObjectIsPropertySettable(), and
587/// AudioObjectGetPropertyDataSize().
588///
589/// Parameter `inDevice`: The AudioDevice to query.
590///
591/// Parameter `inChannel`: The channel of the property to query where 0 is the main channel.
592///
593/// Parameter `isInput`: Which section of the AudioDevice to query.
594///
595/// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to query.
596///
597/// Parameter `outSize`: A pointer to a UInt32 that receives the size of the property data in bytes
598/// on exit. This can be NULL if the size information is not being requested.
599///
600/// Parameter `outWritable`: A pointer to a Boolean that receives indication of whether or not the given
601/// property can be set. This can be NULL if the writability is not being
602/// requested.
603///
604/// Returns: An OSStatus indicating success or failure.
605///
606/// # Safety
607///
608/// - `out_size` must be a valid pointer or null.
609/// - `out_writable` must be a valid pointer or null.
610#[cfg(feature = "AudioHardware")]
611#[deprecated]
612#[inline]
613pub unsafe extern "C-unwind" fn AudioDeviceGetPropertyInfo(
614    in_device: AudioDeviceID,
615    in_channel: u32,
616    is_input: bool,
617    in_property_id: AudioDevicePropertyID,
618    out_size: *mut u32,
619    out_writable: *mut Boolean,
620) -> OSStatus {
621    extern "C-unwind" {
622        fn AudioDeviceGetPropertyInfo(
623            in_device: AudioDeviceID,
624            in_channel: u32,
625            is_input: Boolean,
626            in_property_id: AudioDevicePropertyID,
627            out_size: *mut u32,
628            out_writable: *mut Boolean,
629        ) -> OSStatus;
630    }
631    unsafe {
632        AudioDeviceGetPropertyInfo(
633            in_device,
634            in_channel,
635            is_input as _,
636            in_property_id,
637            out_size,
638            out_writable,
639        )
640    }
641}
642
643/// Queries an the AudioDevice object to get the data of the given property and
644/// places it in the provided buffer.
645///
646/// Note that the same functionality is provided by the function
647/// AudioObjectGetPropertyData().
648///
649/// Parameter `inDevice`: The AudioDevice to query.
650///
651/// Parameter `inChannel`: The channel of the property to query where 0 is the main channel.
652///
653/// Parameter `isInput`: Which section of the AudioDevice to query.
654///
655/// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to query.
656///
657/// Parameter `ioPropertyDataSize`: A UInt32 which on entry indicates the size of the buffer pointed to by
658/// outData and on exit indicates how much of the buffer was used.
659///
660/// Parameter `outPropertyData`: The buffer into which the object will put the data for the given property.
661///
662/// Returns: An OSStatus indicating success or failure.
663///
664/// # Safety
665///
666/// - `io_property_data_size` must be a valid pointer.
667/// - `out_property_data` must be a valid pointer.
668#[cfg(feature = "AudioHardware")]
669#[deprecated]
670#[inline]
671pub unsafe extern "C-unwind" fn AudioDeviceGetProperty(
672    in_device: AudioDeviceID,
673    in_channel: u32,
674    is_input: bool,
675    in_property_id: AudioDevicePropertyID,
676    io_property_data_size: NonNull<u32>,
677    out_property_data: NonNull<c_void>,
678) -> OSStatus {
679    extern "C-unwind" {
680        fn AudioDeviceGetProperty(
681            in_device: AudioDeviceID,
682            in_channel: u32,
683            is_input: Boolean,
684            in_property_id: AudioDevicePropertyID,
685            io_property_data_size: NonNull<u32>,
686            out_property_data: NonNull<c_void>,
687        ) -> OSStatus;
688    }
689    unsafe {
690        AudioDeviceGetProperty(
691            in_device,
692            in_channel,
693            is_input as _,
694            in_property_id,
695            io_property_data_size,
696            out_property_data,
697        )
698    }
699}
700
701/// Tells the AudioDevice object to change the value of the given property using the
702/// provided data.
703///
704/// Note that the value of the property should not be considered changed until the
705/// HAL has called the listeners as many properties values are changed
706/// asynchronously. Also note that the same functionality is provided by the
707/// function AudioObjectSetPropertyData().
708///
709/// Parameter `inDevice`: The AudioDevice to change.
710///
711/// Parameter `inWhen`: A pointer to an AudioTimeStamp that says when to change the property's value
712/// relative to the device's time base. NULL means execute the change
713/// immediately.
714///
715/// Parameter `inChannel`: The channel of the property to change where 0 is the main channel.
716///
717/// Parameter `isInput`: Which section of the AudioDevice to change.
718///
719/// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to change.
720///
721/// Parameter `inPropertyDataSize`: A UInt32 indicating the size of the buffer pointed to by inData.
722///
723/// Parameter `inPropertyData`: The buffer containing the data to be used to change the property's value.
724///
725/// Returns: An OSStatus indicating success or failure.
726///
727/// # Safety
728///
729/// - `in_when` must be a valid pointer or null.
730/// - `in_property_data` must be a valid pointer.
731#[cfg(all(feature = "AudioHardware", feature = "objc2-core-audio-types"))]
732#[deprecated]
733#[inline]
734pub unsafe extern "C-unwind" fn AudioDeviceSetProperty(
735    in_device: AudioDeviceID,
736    in_when: *const AudioTimeStamp,
737    in_channel: u32,
738    is_input: bool,
739    in_property_id: AudioDevicePropertyID,
740    in_property_data_size: u32,
741    in_property_data: NonNull<c_void>,
742) -> OSStatus {
743    extern "C-unwind" {
744        fn AudioDeviceSetProperty(
745            in_device: AudioDeviceID,
746            in_when: *const AudioTimeStamp,
747            in_channel: u32,
748            is_input: Boolean,
749            in_property_id: AudioDevicePropertyID,
750            in_property_data_size: u32,
751            in_property_data: NonNull<c_void>,
752        ) -> OSStatus;
753    }
754    unsafe {
755        AudioDeviceSetProperty(
756            in_device,
757            in_when,
758            in_channel,
759            is_input as _,
760            in_property_id,
761            in_property_data_size,
762            in_property_data,
763        )
764    }
765}
766
767/// Registers the given AudioDevicePropertyListenerProc to receive notifications
768/// when the given property changes.
769///
770/// Note that the same functionality is provided by AudioObjectAddPropertyListener
771/// in conjunction with AudioObjectPropertyListenerProc.
772///
773/// Parameter `inDevice`: The AudioDevice with whom to register the listener.
774///
775/// Parameter `inChannel`: The channel of the property to listen to.
776///
777/// Parameter `isInput`: Which section of the AudioDevice to listen to.
778///
779/// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to listen to.
780///
781/// Parameter `inProc`: AudioDevicePropertyListenerProc to call.
782///
783/// Parameter `inClientData`: A pointer to client data that is passed to the listener when it is called.
784///
785/// Returns: An OSStatus indicating success or failure.
786///
787/// # Safety
788///
789/// - `in_proc` must be implemented correctly.
790/// - `in_client_data` must be a valid pointer or null.
791#[cfg(feature = "AudioHardware")]
792#[deprecated]
793#[inline]
794pub unsafe extern "C-unwind" fn AudioDeviceAddPropertyListener(
795    in_device: AudioDeviceID,
796    in_channel: u32,
797    is_input: bool,
798    in_property_id: AudioDevicePropertyID,
799    in_proc: AudioDevicePropertyListenerProc,
800    in_client_data: *mut c_void,
801) -> OSStatus {
802    extern "C-unwind" {
803        fn AudioDeviceAddPropertyListener(
804            in_device: AudioDeviceID,
805            in_channel: u32,
806            is_input: Boolean,
807            in_property_id: AudioDevicePropertyID,
808            in_proc: AudioDevicePropertyListenerProc,
809            in_client_data: *mut c_void,
810        ) -> OSStatus;
811    }
812    unsafe {
813        AudioDeviceAddPropertyListener(
814            in_device,
815            in_channel,
816            is_input as _,
817            in_property_id,
818            in_proc,
819            in_client_data,
820        )
821    }
822}
823
824/// Unregisters the given AudioDevicePropertyListenerProc from receiving
825/// notifications when the given property changes.
826///
827/// Note that the same functionality is provided by
828/// AudioObjectRemovePropertyListener in conjunction with
829/// AudioObjectPropertyListenerProc.
830///
831/// Parameter `inDevice`: The AudioDevice with whom to unregister the listener.
832///
833/// Parameter `inChannel`: The channel of the property to unregister from.
834///
835/// Parameter `isInput`: Which section of the AudioDevice to unregister from.
836///
837/// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to stop listening to.
838///
839/// Parameter `inProc`: AudioDevicePropertyListenerProc to unregister.
840///
841/// Returns: An OSStatus indicating success or failure.
842///
843/// # Safety
844///
845/// `in_proc` must be implemented correctly.
846#[cfg(feature = "AudioHardware")]
847#[deprecated]
848#[inline]
849pub unsafe extern "C-unwind" fn AudioDeviceRemovePropertyListener(
850    in_device: AudioDeviceID,
851    in_channel: u32,
852    is_input: bool,
853    in_property_id: AudioDevicePropertyID,
854    in_proc: AudioDevicePropertyListenerProc,
855) -> OSStatus {
856    extern "C-unwind" {
857        fn AudioDeviceRemovePropertyListener(
858            in_device: AudioDeviceID,
859            in_channel: u32,
860            is_input: Boolean,
861            in_property_id: AudioDevicePropertyID,
862            in_proc: AudioDevicePropertyListenerProc,
863        ) -> OSStatus;
864    }
865    unsafe {
866        AudioDeviceRemovePropertyListener(
867            in_device,
868            in_channel,
869            is_input as _,
870            in_property_id,
871            in_proc,
872        )
873    }
874}
875
876/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertymastersubdevice?language=objc)
877#[cfg(feature = "AudioHardware")]
878#[deprecated]
879pub const kAudioAggregateDevicePropertyMasterSubDevice: AudioObjectPropertySelector =
880    kAudioAggregateDevicePropertyMainSubDevice;
881
882/// AudioStream is the base class for all objects that represent a stream of data on
883/// an audio device.
884///
885/// AudioStream is a subclass of AudioObject and can contain AudioControls.
886///
887/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiostreamid?language=objc)
888#[cfg(feature = "AudioHardware")]
889pub type AudioStreamID = AudioObjectID;
890
891/// Clients register an AudioStreamPropertyListenerProc with the AudioStream object
892/// in order to receive notifications when the properties of the object change.
893///
894/// Note that the same functionality is provided by AudioObjectPropertyListenerProc.
895///
896/// Parameter `inStream`: The AudioStream whose property has changed.
897///
898/// Parameter `inChannel`: The channel of the property that changed where 0 is the main channel.
899///
900/// Parameter `inPropertyID`: The AudioDevicePropertyID of the property that changed.
901///
902/// Parameter `inClientData`: A pointer to client data established when the listener proc was registered
903/// with the object.
904///
905/// Returns: The return value is currently unused and should always be 0.
906///
907/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiostreampropertylistenerproc?language=objc)
908#[cfg(feature = "AudioHardware")]
909pub type AudioStreamPropertyListenerProc = Option<
910    unsafe extern "C-unwind" fn(AudioStreamID, u32, AudioDevicePropertyID, *mut c_void) -> OSStatus,
911>;
912
913/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamunknown?language=objc)
914#[cfg(feature = "AudioHardware")]
915pub const kAudioStreamUnknown: AudioObjectID = kAudioObjectUnknown;
916
917/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyowningdevice?language=objc)
918#[cfg(feature = "AudioHardware")]
919pub const kAudioStreamPropertyOwningDevice: AudioObjectPropertySelector = kAudioObjectPropertyOwner;
920/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyphysicalformats?language=objc)
921#[cfg(feature = "AudioHardware")]
922pub const kAudioStreamPropertyPhysicalFormats: AudioObjectPropertySelector = 0x70667423;
923/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyphysicalformatsupported?language=objc)
924#[cfg(feature = "AudioHardware")]
925pub const kAudioStreamPropertyPhysicalFormatSupported: AudioObjectPropertySelector = 0x7066743f;
926/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyphysicalformatmatch?language=objc)
927#[cfg(feature = "AudioHardware")]
928pub const kAudioStreamPropertyPhysicalFormatMatch: AudioObjectPropertySelector = 0x7066746d;
929
930extern "C-unwind" {
931    /// Retrieve information about the given property of an AudioStream.
932    ///
933    /// Parameter `inStream`: The AudioStream to query.
934    ///
935    /// Parameter `inChannel`: The channel of the property to query where 0 is the main channel.
936    ///
937    /// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to query.
938    ///
939    /// Parameter `outSize`: A pointer to a UInt32 that receives the size of the property data in bytes
940    /// on exit. This can be NULL if the size information is not being requested.
941    ///
942    /// Parameter `outWritable`: A pointer to a Boolean that receives indication of whether or not the given
943    /// property can be set. This can be NULL if the writability is not being
944    /// requested.
945    ///
946    /// Returns: An OSStatus indicating success or failure.
947    ///
948    /// # Safety
949    ///
950    /// - `out_size` must be a valid pointer or null.
951    /// - `out_writable` must be a valid pointer or null.
952    #[cfg(feature = "AudioHardware")]
953    #[deprecated]
954    pub fn AudioStreamGetPropertyInfo(
955        in_stream: AudioStreamID,
956        in_channel: u32,
957        in_property_id: AudioDevicePropertyID,
958        out_size: *mut u32,
959        out_writable: *mut Boolean,
960    ) -> OSStatus;
961}
962
963extern "C-unwind" {
964    /// Queries an the AudioStream object to get the data of the given property and
965    /// places it in the provided buffer.
966    ///
967    /// Note that the same functionality is provided by the function
968    /// AudioObjectGetPropertyData().
969    ///
970    /// Parameter `inStream`: The AudioStream to query.
971    ///
972    /// Parameter `inChannel`: The channel of the property to query where 0 is the main channel.
973    ///
974    /// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to query.
975    ///
976    /// Parameter `ioPropertyDataSize`: A UInt32 which on entry indicates the size of the buffer pointed to by
977    /// outData and on exit indicates how much of the buffer was used.
978    ///
979    /// Parameter `outPropertyData`: The buffer into which the object will put the data for the given property.
980    ///
981    /// Returns: An OSStatus indicating success or failure.
982    ///
983    /// # Safety
984    ///
985    /// - `io_property_data_size` must be a valid pointer.
986    /// - `out_property_data` must be a valid pointer.
987    #[cfg(feature = "AudioHardware")]
988    #[deprecated]
989    pub fn AudioStreamGetProperty(
990        in_stream: AudioStreamID,
991        in_channel: u32,
992        in_property_id: AudioDevicePropertyID,
993        io_property_data_size: NonNull<u32>,
994        out_property_data: NonNull<c_void>,
995    ) -> OSStatus;
996}
997
998extern "C-unwind" {
999    /// Tells the AudioStream object to change the value of the given property using the
1000    /// provided data.
1001    ///
1002    /// Note that the value of the property should not be considered changed until the
1003    /// HAL has called the listeners as many properties values are changed
1004    /// asynchronously. Also note that the same functionality is provided by the
1005    /// function AudioObjectSetPropertyData().
1006    ///
1007    /// Parameter `inStream`: The AudioStream to change.
1008    ///
1009    /// Parameter `inWhen`: A pointer to an AudioTimeStamp that says when to change the property's value
1010    /// relative to the device's time base. NULL means execute the change
1011    /// immediately.
1012    ///
1013    /// Parameter `inChannel`: The channel of the property to change where 0 is the main channel.
1014    ///
1015    /// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to change.
1016    ///
1017    /// Parameter `inPropertyDataSize`: A UInt32 indicating the size of the buffer pointed to by inData.
1018    ///
1019    /// Parameter `inPropertyData`: The buffer containing the data to be used to change the property's value.
1020    ///
1021    /// Returns: An OSStatus indicating success or failure.
1022    ///
1023    /// # Safety
1024    ///
1025    /// - `in_when` must be a valid pointer or null.
1026    /// - `in_property_data` must be a valid pointer.
1027    #[cfg(all(feature = "AudioHardware", feature = "objc2-core-audio-types"))]
1028    #[deprecated]
1029    pub fn AudioStreamSetProperty(
1030        in_stream: AudioStreamID,
1031        in_when: *const AudioTimeStamp,
1032        in_channel: u32,
1033        in_property_id: AudioDevicePropertyID,
1034        in_property_data_size: u32,
1035        in_property_data: NonNull<c_void>,
1036    ) -> OSStatus;
1037}
1038
1039extern "C-unwind" {
1040    /// Registers the given AudioStreamPropertyListenerProc to receive notifications
1041    /// when the given property changes.
1042    ///
1043    /// Note that the same functionality is provided by AudioObjectAddPropertyListener
1044    /// in conjunction with AudioObjectPropertyListenerProc.
1045    ///
1046    /// Parameter `inStream`: The AudioStream with whom to register the listener.
1047    ///
1048    /// Parameter `inChannel`: The channel of the property to listen to.
1049    ///
1050    /// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to listen to.
1051    ///
1052    /// Parameter `inProc`: AudioStreamPropertyListenerProc to call.
1053    ///
1054    /// Parameter `inClientData`: A pointer to client data that is passed to the listener when it is called.
1055    ///
1056    /// Returns: An OSStatus indicating success or failure.
1057    ///
1058    /// # Safety
1059    ///
1060    /// - `in_proc` must be implemented correctly.
1061    /// - `in_client_data` must be a valid pointer or null.
1062    #[cfg(feature = "AudioHardware")]
1063    #[deprecated]
1064    pub fn AudioStreamAddPropertyListener(
1065        in_stream: AudioStreamID,
1066        in_channel: u32,
1067        in_property_id: AudioDevicePropertyID,
1068        in_proc: AudioStreamPropertyListenerProc,
1069        in_client_data: *mut c_void,
1070    ) -> OSStatus;
1071}
1072
1073extern "C-unwind" {
1074    /// Unregisters the given AudioStreamPropertyListenerProc from receiving
1075    /// notifications when the given property changes.
1076    ///
1077    /// Note that the same functionality is provided by
1078    /// AudioObjectRemovePropertyListener in conjunction with
1079    /// AudioObjectPropertyListenerProc.
1080    ///
1081    /// Parameter `inStream`: The AudioStream with whom to unregister the listener.
1082    ///
1083    /// Parameter `inChannel`: The channel of the property to unregister from.
1084    ///
1085    /// Parameter `inPropertyID`: The AudioDevicePropertyID of the property to stop listening to.
1086    ///
1087    /// Parameter `inProc`: AudioStreamPropertyListenerProc to unregister.
1088    ///
1089    /// Returns: An OSStatus indicating success or failure.
1090    ///
1091    /// # Safety
1092    ///
1093    /// `in_proc` must be implemented correctly.
1094    #[cfg(feature = "AudioHardware")]
1095    #[deprecated]
1096    pub fn AudioStreamRemovePropertyListener(
1097        in_stream: AudioStreamID,
1098        in_channel: u32,
1099        in_property_id: AudioDevicePropertyID,
1100        in_proc: AudioStreamPropertyListenerProc,
1101    ) -> OSStatus;
1102}
1103
1104/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiobootchimevolumecontrolclassid?language=objc)
1105#[cfg(feature = "AudioHardware")]
1106pub const kAudioBootChimeVolumeControlClassID: AudioClassID = 0x7072616d;
1107
1108/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiocontrolpropertyvariant?language=objc)
1109#[cfg(feature = "AudioHardware")]
1110pub const kAudioControlPropertyVariant: AudioObjectPropertySelector = 0x63766172;
1111
1112/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclocksourcecontrolpropertyitemkind?language=objc)
1113#[cfg(feature = "AudioHardware")]
1114pub const kAudioClockSourceControlPropertyItemKind: AudioObjectPropertySelector =
1115    kAudioSelectorControlPropertyItemKind;