objc2_core_audio/generated/
AudioHardware.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 = "dispatch2")]
6use dispatch2::*;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9#[cfg(feature = "objc2-core-audio-types")]
10use objc2_core_audio_types::*;
11use objc2_core_foundation::*;
12#[cfg(feature = "objc2-foundation")]
13use objc2_foundation::*;
14
15use crate::*;
16
17/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdeviceuidkey?language=objc)
18pub const kAudioEndPointDeviceUIDKey: &CStr =
19    unsafe { CStr::from_bytes_with_nul_unchecked(b"uid\0") };
20/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdevicenamekey?language=objc)
21pub const kAudioEndPointDeviceNameKey: &CStr =
22    unsafe { CStr::from_bytes_with_nul_unchecked(b"name\0") };
23/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdeviceendpointlistkey?language=objc)
24pub const kAudioEndPointDeviceEndPointListKey: &CStr =
25    unsafe { CStr::from_bytes_with_nul_unchecked(b"endpoints\0") };
26/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdevicemainendpointkey?language=objc)
27pub const kAudioEndPointDeviceMainEndPointKey: &CStr =
28    unsafe { CStr::from_bytes_with_nul_unchecked(b"main\0") };
29/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdevicemasterendpointkey?language=objc)
30pub const kAudioEndPointDeviceMasterEndPointKey: &CStr =
31    unsafe { CStr::from_bytes_with_nul_unchecked(b"master\0") };
32/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdeviceisprivatekey?language=objc)
33pub const kAudioEndPointDeviceIsPrivateKey: &CStr =
34    unsafe { CStr::from_bytes_with_nul_unchecked(b"private\0") };
35/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointuidkey?language=objc)
36pub const kAudioEndPointUIDKey: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"uid\0") };
37/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointnamekey?language=objc)
38pub const kAudioEndPointNameKey: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"name\0") };
39/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointinputchannelskey?language=objc)
40pub const kAudioEndPointInputChannelsKey: &CStr =
41    unsafe { CStr::from_bytes_with_nul_unchecked(b"channels-in\0") };
42/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointoutputchannelskey?language=objc)
43pub const kAudioEndPointOutputChannelsKey: &CStr =
44    unsafe { CStr::from_bytes_with_nul_unchecked(b"channels-out\0") };
45/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedeviceuidkey?language=objc)
46pub const kAudioAggregateDeviceUIDKey: &CStr =
47    unsafe { CStr::from_bytes_with_nul_unchecked(b"uid\0") };
48/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicenamekey?language=objc)
49pub const kAudioAggregateDeviceNameKey: &CStr =
50    unsafe { CStr::from_bytes_with_nul_unchecked(b"name\0") };
51/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicesubdevicelistkey?language=objc)
52pub const kAudioAggregateDeviceSubDeviceListKey: &CStr =
53    unsafe { CStr::from_bytes_with_nul_unchecked(b"subdevices\0") };
54/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicemainsubdevicekey?language=objc)
55pub const kAudioAggregateDeviceMainSubDeviceKey: &CStr =
56    unsafe { CStr::from_bytes_with_nul_unchecked(b"master\0") };
57/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedeviceclockdevicekey?language=objc)
58pub const kAudioAggregateDeviceClockDeviceKey: &CStr =
59    unsafe { CStr::from_bytes_with_nul_unchecked(b"clock\0") };
60/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedeviceisprivatekey?language=objc)
61pub const kAudioAggregateDeviceIsPrivateKey: &CStr =
62    unsafe { CStr::from_bytes_with_nul_unchecked(b"private\0") };
63/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedeviceisstackedkey?language=objc)
64pub const kAudioAggregateDeviceIsStackedKey: &CStr =
65    unsafe { CStr::from_bytes_with_nul_unchecked(b"stacked\0") };
66/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicetaplistkey?language=objc)
67pub const kAudioAggregateDeviceTapListKey: &CStr =
68    unsafe { CStr::from_bytes_with_nul_unchecked(b"taps\0") };
69/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicetapautostartkey?language=objc)
70pub const kAudioAggregateDeviceTapAutoStartKey: &CStr =
71    unsafe { CStr::from_bytes_with_nul_unchecked(b"tapautostart\0") };
72/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdeviceuidkey?language=objc)
73pub const kAudioSubDeviceUIDKey: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"uid\0") };
74/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicenamekey?language=objc)
75pub const kAudioSubDeviceNameKey: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"name\0") };
76/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdeviceinputchannelskey?language=objc)
77pub const kAudioSubDeviceInputChannelsKey: &CStr =
78    unsafe { CStr::from_bytes_with_nul_unchecked(b"channels-in\0") };
79/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdeviceoutputchannelskey?language=objc)
80pub const kAudioSubDeviceOutputChannelsKey: &CStr =
81    unsafe { CStr::from_bytes_with_nul_unchecked(b"channels-out\0") };
82/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdeviceextrainputlatencykey?language=objc)
83pub const kAudioSubDeviceExtraInputLatencyKey: &CStr =
84    unsafe { CStr::from_bytes_with_nul_unchecked(b"latency-in\0") };
85/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdeviceextraoutputlatencykey?language=objc)
86pub const kAudioSubDeviceExtraOutputLatencyKey: &CStr =
87    unsafe { CStr::from_bytes_with_nul_unchecked(b"latency-out\0") };
88/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationkey?language=objc)
89pub const kAudioSubDeviceDriftCompensationKey: &CStr =
90    unsafe { CStr::from_bytes_with_nul_unchecked(b"drift\0") };
91/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationqualitykey?language=objc)
92pub const kAudioSubDeviceDriftCompensationQualityKey: &CStr =
93    unsafe { CStr::from_bytes_with_nul_unchecked(b"drift quality\0") };
94/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtapuidkey?language=objc)
95pub const kAudioSubTapUIDKey: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"uid\0") };
96/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtapextrainputlatencykey?language=objc)
97pub const kAudioSubTapExtraInputLatencyKey: &CStr =
98    unsafe { CStr::from_bytes_with_nul_unchecked(b"latency-in\0") };
99/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtapextraoutputlatencykey?language=objc)
100pub const kAudioSubTapExtraOutputLatencyKey: &CStr =
101    unsafe { CStr::from_bytes_with_nul_unchecked(b"latency-out\0") };
102/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtapdriftcompensationkey?language=objc)
103pub const kAudioSubTapDriftCompensationKey: &CStr =
104    unsafe { CStr::from_bytes_with_nul_unchecked(b"drift\0") };
105/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtapdriftcompensationqualitykey?language=objc)
106pub const kAudioSubTapDriftCompensationQualityKey: &CStr =
107    unsafe { CStr::from_bytes_with_nul_unchecked(b"drift quality\0") };
108/// A UInt32 that provides a handle on a specific AudioObject.
109///
110/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioobjectid?language=objc)
111pub type AudioObjectID = u32;
112
113/// AudioClassIDs are used to identify the class of an AudioObject.
114///
115/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioclassid?language=objc)
116pub type AudioClassID = u32;
117
118/// An AudioObjectPropertySelector is a four char code that identifies, along with
119/// the AudioObjectPropertyScope and AudioObjectPropertyElement, a specific piece of
120/// information about an AudioObject.
121///
122/// The property selector specifies the general classification of the property such
123/// as volume, stream format, latency, etc. Note that each class has a different set
124/// of selectors. A subclass inherits its super class's set of selectors, although
125/// it may not implement them all.
126///
127/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioobjectpropertyselector?language=objc)
128pub type AudioObjectPropertySelector = u32;
129
130/// An AudioObjectPropertyScope is a four char code that identifies, along with the
131/// AudioObjectPropertySelector and AudioObjectPropertyElement, a specific piece of
132/// information about an AudioObject.
133///
134/// The scope specifies the section of the object in which to look for the property,
135/// such as input, output, global, etc. Note that each class has a different set of
136/// scopes. A subclass inherits its superclass's set of scopes.
137///
138/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioobjectpropertyscope?language=objc)
139pub type AudioObjectPropertyScope = u32;
140
141/// An AudioObjectPropertyElement is an integer that identifies, along with the
142/// AudioObjectPropertySelector and AudioObjectPropertyScope, a specific piece of
143/// information about an AudioObject.
144///
145/// The element selects one of possibly many items in the section of the object in
146/// which to look for the property. Elements are number sequentially where 0
147/// represents the main element. Elements are particular to an instance of a
148/// class, meaning that two instances can have different numbers of elements in the
149/// same scope. There is no inheritance of elements.
150///
151/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioobjectpropertyelement?language=objc)
152pub type AudioObjectPropertyElement = u32;
153
154/// An AudioObjectPropertyAddress collects the three parts that identify a specific
155/// property together in a struct for easy transmission.
156/// Field: mSelector
157/// The AudioObjectPropertySelector for the property.
158/// Field: mScope
159/// The AudioObjectPropertyScope for the property.
160/// Field: mElement
161/// The AudioObjectPropertyElement for the property.
162///
163/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioobjectpropertyaddress?language=objc)
164#[repr(C)]
165#[derive(Clone, Copy, Debug, PartialEq)]
166pub struct AudioObjectPropertyAddress {
167    pub mSelector: AudioObjectPropertySelector,
168    pub mScope: AudioObjectPropertyScope,
169    pub mElement: AudioObjectPropertyElement,
170}
171
172#[cfg(feature = "objc2")]
173unsafe impl Encode for AudioObjectPropertyAddress {
174    const ENCODING: Encoding = Encoding::Struct(
175        "AudioObjectPropertyAddress",
176        &[
177            <AudioObjectPropertySelector>::ENCODING,
178            <AudioObjectPropertyScope>::ENCODING,
179            <AudioObjectPropertyElement>::ENCODING,
180        ],
181    );
182}
183
184#[cfg(feature = "objc2")]
185unsafe impl RefEncode for AudioObjectPropertyAddress {
186    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
187}
188
189/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarenoerror?language=objc)
190pub const kAudioHardwareNoError: OSStatus = 0;
191/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarenotrunningerror?language=objc)
192pub const kAudioHardwareNotRunningError: OSStatus = 0x73746f70;
193/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwareunspecifiederror?language=objc)
194pub const kAudioHardwareUnspecifiedError: OSStatus = 0x77686174;
195/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwareunknownpropertyerror?language=objc)
196pub const kAudioHardwareUnknownPropertyError: OSStatus = 0x77686f3f;
197/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarebadpropertysizeerror?language=objc)
198pub const kAudioHardwareBadPropertySizeError: OSStatus = 0x2173697a;
199/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwareillegaloperationerror?language=objc)
200pub const kAudioHardwareIllegalOperationError: OSStatus = 0x6e6f7065;
201/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarebadobjecterror?language=objc)
202pub const kAudioHardwareBadObjectError: OSStatus = 0x216f626a;
203/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarebaddeviceerror?language=objc)
204pub const kAudioHardwareBadDeviceError: OSStatus = 0x21646576;
205/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarebadstreamerror?language=objc)
206pub const kAudioHardwareBadStreamError: OSStatus = 0x21737472;
207/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwareunsupportedoperationerror?language=objc)
208pub const kAudioHardwareUnsupportedOperationError: OSStatus = 0x756e6f70;
209/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarenotreadyerror?language=objc)
210pub const kAudioHardwareNotReadyError: OSStatus = 0x6e726479;
211/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodeviceunsupportedformaterror?language=objc)
212pub const kAudioDeviceUnsupportedFormatError: OSStatus = 0x21646174;
213/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepermissionserror?language=objc)
214pub const kAudioDevicePermissionsError: OSStatus = 0x21686f67;
215
216/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectunknown?language=objc)
217pub const kAudioObjectUnknown: AudioObjectID = 0;
218
219/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyscopeglobal?language=objc)
220pub const kAudioObjectPropertyScopeGlobal: AudioObjectPropertyScope = 0x676c6f62;
221/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyscopeinput?language=objc)
222pub const kAudioObjectPropertyScopeInput: AudioObjectPropertyScope = 0x696e7074;
223/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyscopeoutput?language=objc)
224pub const kAudioObjectPropertyScopeOutput: AudioObjectPropertyScope = 0x6f757470;
225/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyscopeplaythrough?language=objc)
226pub const kAudioObjectPropertyScopePlayThrough: AudioObjectPropertyScope = 0x70747275;
227/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyelementmain?language=objc)
228pub const kAudioObjectPropertyElementMain: AudioObjectPropertyScope = 0;
229/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyelementmaster?language=objc)
230#[deprecated]
231pub const kAudioObjectPropertyElementMaster: AudioObjectPropertyScope =
232    kAudioObjectPropertyElementMain;
233
234/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyselectorwildcard?language=objc)
235pub const kAudioObjectPropertySelectorWildcard: AudioObjectPropertySelector = 0x2a2a2a2a;
236
237/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyscopewildcard?language=objc)
238pub const kAudioObjectPropertyScopeWildcard: AudioObjectPropertyScope = 0x2a2a2a2a;
239
240/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyelementwildcard?language=objc)
241pub const kAudioObjectPropertyElementWildcard: AudioObjectPropertyElement = 0xFFFFFFFF;
242
243/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectclassidwildcard?language=objc)
244pub const kAudioObjectClassIDWildcard: AudioClassID = 0x2a2a2a2a;
245
246/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectclassid?language=objc)
247pub const kAudioObjectClassID: AudioClassID = 0x616f626a;
248
249/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertybaseclass?language=objc)
250pub const kAudioObjectPropertyBaseClass: AudioObjectPropertySelector = 0x62636c73;
251/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyclass?language=objc)
252pub const kAudioObjectPropertyClass: AudioObjectPropertySelector = 0x636c6173;
253/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyowner?language=objc)
254pub const kAudioObjectPropertyOwner: AudioObjectPropertySelector = 0x73746476;
255/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyname?language=objc)
256pub const kAudioObjectPropertyName: AudioObjectPropertySelector = 0x6c6e616d;
257/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertymodelname?language=objc)
258pub const kAudioObjectPropertyModelName: AudioObjectPropertySelector = 0x6c6d6f64;
259/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertymanufacturer?language=objc)
260pub const kAudioObjectPropertyManufacturer: AudioObjectPropertySelector = 0x6c6d616b;
261/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyelementname?language=objc)
262pub const kAudioObjectPropertyElementName: AudioObjectPropertySelector = 0x6c63686e;
263/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyelementcategoryname?language=objc)
264pub const kAudioObjectPropertyElementCategoryName: AudioObjectPropertySelector = 0x6c63636e;
265/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyelementnumbername?language=objc)
266pub const kAudioObjectPropertyElementNumberName: AudioObjectPropertySelector = 0x6c636e6e;
267/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyownedobjects?language=objc)
268pub const kAudioObjectPropertyOwnedObjects: AudioObjectPropertySelector = 0x6f776e64;
269/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyidentify?language=objc)
270pub const kAudioObjectPropertyIdentify: AudioObjectPropertySelector = 0x6964656e;
271/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyserialnumber?language=objc)
272pub const kAudioObjectPropertySerialNumber: AudioObjectPropertySelector = 0x736e756d;
273/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertyfirmwareversion?language=objc)
274pub const kAudioObjectPropertyFirmwareVersion: AudioObjectPropertySelector = 0x6677766e;
275
276/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginclassid?language=objc)
277pub const kAudioPlugInClassID: AudioClassID = 0x61706c67;
278
279/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginpropertybundleid?language=objc)
280pub const kAudioPlugInPropertyBundleID: AudioObjectPropertySelector = 0x70696964;
281/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginpropertydevicelist?language=objc)
282pub const kAudioPlugInPropertyDeviceList: AudioObjectPropertySelector = 0x64657623;
283/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginpropertytranslateuidtodevice?language=objc)
284pub const kAudioPlugInPropertyTranslateUIDToDevice: AudioObjectPropertySelector = 0x75696464;
285/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginpropertyboxlist?language=objc)
286pub const kAudioPlugInPropertyBoxList: AudioObjectPropertySelector = 0x626f7823;
287/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginpropertytranslateuidtobox?language=objc)
288pub const kAudioPlugInPropertyTranslateUIDToBox: AudioObjectPropertySelector = 0x75696462;
289/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginpropertyclockdevicelist?language=objc)
290pub const kAudioPlugInPropertyClockDeviceList: AudioObjectPropertySelector = 0x636c6b23;
291/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginpropertytranslateuidtoclockdevice?language=objc)
292pub const kAudioPlugInPropertyTranslateUIDToClockDevice: AudioObjectPropertySelector = 0x75696463;
293
294/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotransportmanagerclassid?language=objc)
295pub const kAudioTransportManagerClassID: AudioClassID = 0x7472706d;
296
297/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotransportmanagerpropertyendpointlist?language=objc)
298pub const kAudioTransportManagerPropertyEndPointList: AudioObjectPropertySelector = 0x656e6423;
299/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotransportmanagerpropertytranslateuidtoendpoint?language=objc)
300pub const kAudioTransportManagerPropertyTranslateUIDToEndPoint: AudioObjectPropertySelector =
301    0x75696465;
302/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotransportmanagerpropertytransporttype?language=objc)
303pub const kAudioTransportManagerPropertyTransportType: AudioObjectPropertySelector = 0x7472616e;
304
305/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxclassid?language=objc)
306pub const kAudioBoxClassID: AudioClassID = 0x61626f78;
307
308/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertyboxuid?language=objc)
309pub const kAudioBoxPropertyBoxUID: AudioObjectPropertySelector = 0x62756964;
310/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertytransporttype?language=objc)
311pub const kAudioBoxPropertyTransportType: AudioObjectPropertySelector = 0x7472616e;
312/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertyhasaudio?language=objc)
313pub const kAudioBoxPropertyHasAudio: AudioObjectPropertySelector = 0x62686175;
314/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertyhasvideo?language=objc)
315pub const kAudioBoxPropertyHasVideo: AudioObjectPropertySelector = 0x62687669;
316/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertyhasmidi?language=objc)
317pub const kAudioBoxPropertyHasMIDI: AudioObjectPropertySelector = 0x62686d69;
318/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertyisprotected?language=objc)
319pub const kAudioBoxPropertyIsProtected: AudioObjectPropertySelector = 0x6270726f;
320/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertyacquired?language=objc)
321pub const kAudioBoxPropertyAcquired: AudioObjectPropertySelector = 0x62786f6e;
322/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertyacquisitionfailed?language=objc)
323pub const kAudioBoxPropertyAcquisitionFailed: AudioObjectPropertySelector = 0x62786f66;
324/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertydevicelist?language=objc)
325pub const kAudioBoxPropertyDeviceList: AudioObjectPropertySelector = 0x62647623;
326/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioboxpropertyclockdevicelist?language=objc)
327pub const kAudioBoxPropertyClockDeviceList: AudioObjectPropertySelector = 0x62636c23;
328
329/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodeviceclassid?language=objc)
330pub const kAudioDeviceClassID: AudioClassID = 0x61646576;
331
332/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypeunknown?language=objc)
333pub const kAudioDeviceTransportTypeUnknown: u32 = 0;
334/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypebuiltin?language=objc)
335pub const kAudioDeviceTransportTypeBuiltIn: u32 = 0x626c746e;
336/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypeaggregate?language=objc)
337pub const kAudioDeviceTransportTypeAggregate: u32 = 0x67727570;
338/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypevirtual?language=objc)
339pub const kAudioDeviceTransportTypeVirtual: u32 = 0x76697274;
340/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypepci?language=objc)
341pub const kAudioDeviceTransportTypePCI: u32 = 0x70636920;
342/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypeusb?language=objc)
343pub const kAudioDeviceTransportTypeUSB: u32 = 0x75736220;
344/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypefirewire?language=objc)
345pub const kAudioDeviceTransportTypeFireWire: u32 = 0x31333934;
346/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypebluetooth?language=objc)
347pub const kAudioDeviceTransportTypeBluetooth: u32 = 0x626c7565;
348/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypebluetoothle?language=objc)
349pub const kAudioDeviceTransportTypeBluetoothLE: u32 = 0x626c6561;
350/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypehdmi?language=objc)
351pub const kAudioDeviceTransportTypeHDMI: u32 = 0x68646d69;
352/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypedisplayport?language=objc)
353pub const kAudioDeviceTransportTypeDisplayPort: u32 = 0x64707274;
354/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypeairplay?language=objc)
355pub const kAudioDeviceTransportTypeAirPlay: u32 = 0x61697270;
356/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypeavb?language=objc)
357pub const kAudioDeviceTransportTypeAVB: u32 = 0x65617662;
358/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypethunderbolt?language=objc)
359pub const kAudioDeviceTransportTypeThunderbolt: u32 = 0x7468756e;
360/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypecontinuitycapturewired?language=objc)
361pub const kAudioDeviceTransportTypeContinuityCaptureWired: u32 = 0x63637764;
362/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypecontinuitycapturewireless?language=objc)
363pub const kAudioDeviceTransportTypeContinuityCaptureWireless: u32 = 0x6363776c;
364/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicetransporttypecontinuitycapture?language=objc)
365#[deprecated = "Please use kAudioDeviceTransportTypeContinuityCaptureWired and kAudioDeviceTransportTypeContinuityCaptureWireless to describe Continuity Capture devices."]
366pub const kAudioDeviceTransportTypeContinuityCapture: u32 = 0x63636170;
367
368/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyconfigurationapplication?language=objc)
369pub const kAudioDevicePropertyConfigurationApplication: AudioObjectPropertySelector = 0x63617070;
370/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydeviceuid?language=objc)
371pub const kAudioDevicePropertyDeviceUID: AudioObjectPropertySelector = 0x75696420;
372/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertymodeluid?language=objc)
373pub const kAudioDevicePropertyModelUID: AudioObjectPropertySelector = 0x6d756964;
374/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertytransporttype?language=objc)
375pub const kAudioDevicePropertyTransportType: AudioObjectPropertySelector = 0x7472616e;
376/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyrelateddevices?language=objc)
377pub const kAudioDevicePropertyRelatedDevices: AudioObjectPropertySelector = 0x616b696e;
378/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclockdomain?language=objc)
379pub const kAudioDevicePropertyClockDomain: AudioObjectPropertySelector = 0x636c6b64;
380/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydeviceisalive?language=objc)
381pub const kAudioDevicePropertyDeviceIsAlive: AudioObjectPropertySelector = 0x6c69766e;
382/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydeviceisrunning?language=objc)
383pub const kAudioDevicePropertyDeviceIsRunning: AudioObjectPropertySelector = 0x676f696e;
384/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydevicecanbedefaultdevice?language=objc)
385pub const kAudioDevicePropertyDeviceCanBeDefaultDevice: AudioObjectPropertySelector = 0x64666c74;
386/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydevicecanbedefaultsystemdevice?language=objc)
387pub const kAudioDevicePropertyDeviceCanBeDefaultSystemDevice: AudioObjectPropertySelector =
388    0x73666c74;
389/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertylatency?language=objc)
390pub const kAudioDevicePropertyLatency: AudioObjectPropertySelector = 0x6c746e63;
391/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystreams?language=objc)
392pub const kAudioDevicePropertyStreams: AudioObjectPropertySelector = 0x73746d23;
393/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertycontrollist?language=objc)
394pub const kAudioObjectPropertyControlList: AudioObjectPropertySelector = 0x6374726c;
395/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysafetyoffset?language=objc)
396pub const kAudioDevicePropertySafetyOffset: AudioObjectPropertySelector = 0x73616674;
397/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertynominalsamplerate?language=objc)
398pub const kAudioDevicePropertyNominalSampleRate: AudioObjectPropertySelector = 0x6e737274;
399/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyavailablenominalsamplerates?language=objc)
400pub const kAudioDevicePropertyAvailableNominalSampleRates: AudioObjectPropertySelector = 0x6e737223;
401/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyicon?language=objc)
402pub const kAudioDevicePropertyIcon: AudioObjectPropertySelector = 0x69636f6e;
403/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyishidden?language=objc)
404pub const kAudioDevicePropertyIsHidden: AudioObjectPropertySelector = 0x6869646e;
405/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertypreferredchannelsforstereo?language=objc)
406pub const kAudioDevicePropertyPreferredChannelsForStereo: AudioObjectPropertySelector = 0x64636832;
407/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertypreferredchannellayout?language=objc)
408pub const kAudioDevicePropertyPreferredChannelLayout: AudioObjectPropertySelector = 0x73726e64;
409
410/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdeviceclassid?language=objc)
411pub const kAudioClockDeviceClassID: AudioObjectPropertySelector = 0x61636c6b;
412
413/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertydeviceuid?language=objc)
414pub const kAudioClockDevicePropertyDeviceUID: AudioObjectPropertySelector = 0x63756964;
415/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertytransporttype?language=objc)
416pub const kAudioClockDevicePropertyTransportType: AudioObjectPropertySelector = 0x7472616e;
417/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertyclockdomain?language=objc)
418pub const kAudioClockDevicePropertyClockDomain: AudioObjectPropertySelector = 0x636c6b64;
419/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertydeviceisalive?language=objc)
420pub const kAudioClockDevicePropertyDeviceIsAlive: AudioObjectPropertySelector = 0x6c69766e;
421/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertydeviceisrunning?language=objc)
422pub const kAudioClockDevicePropertyDeviceIsRunning: AudioObjectPropertySelector = 0x676f696e;
423/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertylatency?language=objc)
424pub const kAudioClockDevicePropertyLatency: AudioObjectPropertySelector = 0x6c746e63;
425/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertycontrollist?language=objc)
426pub const kAudioClockDevicePropertyControlList: AudioObjectPropertySelector = 0x6374726c;
427/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertynominalsamplerate?language=objc)
428pub const kAudioClockDevicePropertyNominalSampleRate: AudioObjectPropertySelector = 0x6e737274;
429/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclockdevicepropertyavailablenominalsamplerates?language=objc)
430pub const kAudioClockDevicePropertyAvailableNominalSampleRates: AudioObjectPropertySelector =
431    0x6e737223;
432
433/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdeviceclassid?language=objc)
434pub const kAudioEndPointDeviceClassID: AudioClassID = 0x65646576;
435
436/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdevicepropertycomposition?language=objc)
437pub const kAudioEndPointDevicePropertyComposition: AudioObjectPropertySelector = 0x61636f6d;
438/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdevicepropertyendpointlist?language=objc)
439pub const kAudioEndPointDevicePropertyEndPointList: AudioObjectPropertySelector = 0x61677270;
440/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointdevicepropertyisprivate?language=objc)
441pub const kAudioEndPointDevicePropertyIsPrivate: AudioObjectPropertySelector = 0x70726976;
442
443/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioendpointclassid?language=objc)
444pub const kAudioEndPointClassID: AudioClassID = 0x656e6470;
445
446/// This structure allows a specific sample rate range to be associated with an
447/// AudioStreamBasicDescription that specifies its sample rate as
448/// kAudioStreamAnyRate.
449///
450/// Note that this structure is only used to describe the the available formats
451/// for a stream. It is not used for the current format.
452/// Field: mFormat
453/// The AudioStreamBasicDescription that describes the format of the stream.
454/// Note that the mSampleRate field of the structure will be the same as the
455/// the values in mSampleRateRange when only a single sample rate is supported.
456/// It will be kAudioStreamAnyRate when there is a range with more elements.
457/// Field: mSampleRateRange
458/// The AudioValueRange that describes the minimum and maximum sample rate for
459/// the stream. If the mSampleRate field of mFormat is kAudioStreamAnyRate the
460/// format supports the range of sample rates described by this structure.
461/// Otherwise, the minimum will be the same as the maximum which will be the
462/// same as the mSampleRate field of mFormat.
463///
464/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiostreamrangeddescription?language=objc)
465#[cfg(feature = "objc2-core-audio-types")]
466#[repr(C)]
467#[derive(Clone, Copy, Debug, PartialEq)]
468pub struct AudioStreamRangedDescription {
469    pub mFormat: AudioStreamBasicDescription,
470    pub mSampleRateRange: AudioValueRange,
471}
472
473#[cfg(all(feature = "objc2", feature = "objc2-core-audio-types"))]
474unsafe impl Encode for AudioStreamRangedDescription {
475    const ENCODING: Encoding = Encoding::Struct(
476        "AudioStreamRangedDescription",
477        &[
478            <AudioStreamBasicDescription>::ENCODING,
479            <AudioValueRange>::ENCODING,
480        ],
481    );
482}
483
484#[cfg(all(feature = "objc2", feature = "objc2-core-audio-types"))]
485unsafe impl RefEncode for AudioStreamRangedDescription {
486    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
487}
488
489/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamclassid?language=objc)
490pub const kAudioStreamClassID: AudioClassID = 0x61737472;
491
492/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypeunknown?language=objc)
493pub const kAudioStreamTerminalTypeUnknown: u32 = 0;
494/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypeline?language=objc)
495pub const kAudioStreamTerminalTypeLine: u32 = 0x6c696e65;
496/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypedigitalaudiointerface?language=objc)
497pub const kAudioStreamTerminalTypeDigitalAudioInterface: u32 = 0x73706466;
498/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypespeaker?language=objc)
499pub const kAudioStreamTerminalTypeSpeaker: u32 = 0x73706b72;
500/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypeheadphones?language=objc)
501pub const kAudioStreamTerminalTypeHeadphones: u32 = 0x68647068;
502/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypelfespeaker?language=objc)
503pub const kAudioStreamTerminalTypeLFESpeaker: u32 = 0x6c666573;
504/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypereceiverspeaker?language=objc)
505pub const kAudioStreamTerminalTypeReceiverSpeaker: u32 = 0x7273706b;
506/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypemicrophone?language=objc)
507pub const kAudioStreamTerminalTypeMicrophone: u32 = 0x6d696372;
508/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypeheadsetmicrophone?language=objc)
509pub const kAudioStreamTerminalTypeHeadsetMicrophone: u32 = 0x686d6963;
510/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypereceivermicrophone?language=objc)
511pub const kAudioStreamTerminalTypeReceiverMicrophone: u32 = 0x726d6963;
512/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypetty?language=objc)
513pub const kAudioStreamTerminalTypeTTY: u32 = 0x7474795f;
514/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypehdmi?language=objc)
515pub const kAudioStreamTerminalTypeHDMI: u32 = 0x68646d69;
516/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreamterminaltypedisplayport?language=objc)
517pub const kAudioStreamTerminalTypeDisplayPort: u32 = 0x64707274;
518
519/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyisactive?language=objc)
520pub const kAudioStreamPropertyIsActive: AudioObjectPropertySelector = 0x73616374;
521/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertydirection?language=objc)
522pub const kAudioStreamPropertyDirection: AudioObjectPropertySelector = 0x73646972;
523/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyterminaltype?language=objc)
524pub const kAudioStreamPropertyTerminalType: AudioObjectPropertySelector = 0x7465726d;
525/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertystartingchannel?language=objc)
526pub const kAudioStreamPropertyStartingChannel: AudioObjectPropertySelector = 0x7363686e;
527/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertylatency?language=objc)
528pub const kAudioStreamPropertyLatency: AudioObjectPropertySelector = kAudioDevicePropertyLatency;
529/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyvirtualformat?language=objc)
530pub const kAudioStreamPropertyVirtualFormat: AudioObjectPropertySelector = 0x73666d74;
531/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyavailablevirtualformats?language=objc)
532pub const kAudioStreamPropertyAvailableVirtualFormats: AudioObjectPropertySelector = 0x73666d61;
533/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyphysicalformat?language=objc)
534pub const kAudioStreamPropertyPhysicalFormat: AudioObjectPropertySelector = 0x70667420;
535/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostreampropertyavailablephysicalformats?language=objc)
536pub const kAudioStreamPropertyAvailablePhysicalFormats: AudioObjectPropertySelector = 0x70667461;
537
538/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiocontrolclassid?language=objc)
539pub const kAudioControlClassID: AudioClassID = 0x6163746c;
540
541/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiocontrolpropertyscope?language=objc)
542pub const kAudioControlPropertyScope: AudioObjectPropertySelector = 0x63736370;
543/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiocontrolpropertyelement?language=objc)
544pub const kAudioControlPropertyElement: AudioObjectPropertySelector = 0x63656c6d;
545
546/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioslidercontrolclassid?language=objc)
547pub const kAudioSliderControlClassID: AudioClassID = 0x736c6472;
548
549/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioslidercontrolpropertyvalue?language=objc)
550pub const kAudioSliderControlPropertyValue: AudioObjectPropertySelector = 0x73647276;
551/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioslidercontrolpropertyrange?language=objc)
552pub const kAudioSliderControlPropertyRange: AudioObjectPropertySelector = 0x73647272;
553
554/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolevelcontrolclassid?language=objc)
555pub const kAudioLevelControlClassID: AudioClassID = 0x6c65766c;
556/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiovolumecontrolclassid?language=objc)
557pub const kAudioVolumeControlClassID: AudioClassID = 0x766c6d65;
558/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolfevolumecontrolclassid?language=objc)
559pub const kAudioLFEVolumeControlClassID: AudioClassID = 0x73756276;
560
561/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolevelcontrolpropertyscalarvalue?language=objc)
562pub const kAudioLevelControlPropertyScalarValue: AudioObjectPropertySelector = 0x6c637376;
563/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolevelcontrolpropertydecibelvalue?language=objc)
564pub const kAudioLevelControlPropertyDecibelValue: AudioObjectPropertySelector = 0x6c636476;
565/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolevelcontrolpropertydecibelrange?language=objc)
566pub const kAudioLevelControlPropertyDecibelRange: AudioObjectPropertySelector = 0x6c636472;
567/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolevelcontrolpropertyconvertscalartodecibels?language=objc)
568pub const kAudioLevelControlPropertyConvertScalarToDecibels: AudioObjectPropertySelector =
569    0x6c637364;
570/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolevelcontrolpropertyconvertdecibelstoscalar?language=objc)
571pub const kAudioLevelControlPropertyConvertDecibelsToScalar: AudioObjectPropertySelector =
572    0x6c636473;
573
574/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiobooleancontrolclassid?language=objc)
575pub const kAudioBooleanControlClassID: AudioClassID = 0x746f676c;
576/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiomutecontrolclassid?language=objc)
577pub const kAudioMuteControlClassID: AudioClassID = 0x6d757465;
578/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosolocontrolclassid?language=objc)
579pub const kAudioSoloControlClassID: AudioClassID = 0x736f6c6f;
580/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiojackcontrolclassid?language=objc)
581pub const kAudioJackControlClassID: AudioClassID = 0x6a61636b;
582/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolfemutecontrolclassid?language=objc)
583pub const kAudioLFEMuteControlClassID: AudioClassID = 0x7375626d;
584/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiophantompowercontrolclassid?language=objc)
585pub const kAudioPhantomPowerControlClassID: AudioClassID = 0x7068616e;
586/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiophaseinvertcontrolclassid?language=objc)
587pub const kAudioPhaseInvertControlClassID: AudioClassID = 0x70687369;
588/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiocliplightcontrolclassid?language=objc)
589pub const kAudioClipLightControlClassID: AudioClassID = 0x636c6970;
590/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotalkbackcontrolclassid?language=objc)
591pub const kAudioTalkbackControlClassID: AudioClassID = 0x74616c62;
592/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolistenbackcontrolclassid?language=objc)
593pub const kAudioListenbackControlClassID: AudioClassID = 0x6c736e62;
594
595/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiobooleancontrolpropertyvalue?language=objc)
596pub const kAudioBooleanControlPropertyValue: AudioObjectPropertySelector = 0x6263766c;
597
598/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioselectorcontrolclassid?language=objc)
599pub const kAudioSelectorControlClassID: AudioClassID = 0x736c6374;
600/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodatasourcecontrolclassid?language=objc)
601pub const kAudioDataSourceControlClassID: AudioClassID = 0x64737263;
602/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodatadestinationcontrolclassid?language=objc)
603pub const kAudioDataDestinationControlClassID: AudioClassID = 0x64657374;
604/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclocksourcecontrolclassid?language=objc)
605pub const kAudioClockSourceControlClassID: AudioClassID = 0x636c636b;
606/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiolinelevelcontrolclassid?language=objc)
607pub const kAudioLineLevelControlClassID: AudioClassID = 0x6e6c766c;
608/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohighpassfiltercontrolclassid?language=objc)
609pub const kAudioHighPassFilterControlClassID: AudioClassID = 0x68697066;
610
611/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioselectorcontrolpropertycurrentitem?language=objc)
612pub const kAudioSelectorControlPropertyCurrentItem: AudioObjectPropertySelector = 0x73636369;
613/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioselectorcontrolpropertyavailableitems?language=objc)
614pub const kAudioSelectorControlPropertyAvailableItems: AudioObjectPropertySelector = 0x73636169;
615/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioselectorcontrolpropertyitemname?language=objc)
616pub const kAudioSelectorControlPropertyItemName: AudioObjectPropertySelector = 0x7363696e;
617/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioselectorcontrolpropertyitemkind?language=objc)
618pub const kAudioSelectorControlPropertyItemKind: AudioObjectPropertySelector = 0x636c6b6b;
619
620/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioselectorcontrolitemkindspacer?language=objc)
621pub const kAudioSelectorControlItemKindSpacer: u32 = 0x73706372;
622
623/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioclocksourceitemkindinternal?language=objc)
624pub const kAudioClockSourceItemKindInternal: u32 = 0x696e7420;
625
626/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostereopancontrolclassid?language=objc)
627pub const kAudioStereoPanControlClassID: AudioClassID = 0x7370616e;
628
629/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostereopancontrolpropertyvalue?language=objc)
630pub const kAudioStereoPanControlPropertyValue: AudioObjectPropertySelector = 0x73706376;
631/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiostereopancontrolpropertypanningchannels?language=objc)
632pub const kAudioStereoPanControlPropertyPanningChannels: AudioObjectPropertySelector = 0x73706363;
633
634/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectsystemobject?language=objc)
635pub const kAudioObjectSystemObject: c_int = 1;
636
637/// Clients register an AudioObjectPropertyListenerProc with an AudioObject in order
638/// to receive notifications when the properties of the object change.
639///
640/// Listeners will be called when possibly many properties have changed.
641/// Consequently, the implementation of a listener must go through the array of
642/// addresses to see what exactly has changed. Note that the array of addresses will
643/// always have at least one address in it for which the listener is signed up to
644/// receive notifications about but may contain addresses for properties for which
645/// the listener is not signed up to receive notifications.
646///
647/// Parameter `inObjectID`: The AudioObject whose properties have changed.
648///
649/// Parameter `inNumberAddresses`: The number of elements in the inAddresses array.
650///
651/// Parameter `inAddresses`: An array of AudioObjectPropertyAddresses indicating which properties
652/// changed.
653///
654/// Parameter `inClientData`: A pointer to client data established when the listener proc was registered
655/// with the AudioObject.
656///
657/// Returns: The return value is currently unused and should always be 0.
658///
659/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioobjectpropertylistenerproc?language=objc)
660pub type AudioObjectPropertyListenerProc = Option<
661    unsafe extern "C-unwind" fn(
662        AudioObjectID,
663        u32,
664        NonNull<AudioObjectPropertyAddress>,
665        *mut c_void,
666    ) -> OSStatus,
667>;
668
669/// Clients register an AudioObjectPropertyListenerBlock with an AudioObject in
670/// order to receive notifications when the properties of the object change.
671///
672/// Listeners will be called when possibly many properties have changed.
673/// Consequently, the implementation of a listener must go through the array of
674/// addresses to see what exactly has changed. Note that the array of addresses will
675/// always have at least one address in it for which the listener is signed up to
676/// receive notifications about but may contain addresses for properties for which
677/// the listener is not signed up to receive notifications.
678///
679/// Parameter `inNumberAddresses`: The number of elements in the inAddresses array.
680///
681/// Parameter `inAddresses`: An array of AudioObjectPropertyAddresses indicating which properties
682/// changed.
683///
684/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioobjectpropertylistenerblock?language=objc)
685#[cfg(feature = "block2")]
686pub type AudioObjectPropertyListenerBlock =
687    *mut block2::DynBlock<dyn Fn(u32, NonNull<AudioObjectPropertyAddress>)>;
688
689/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertycreator?language=objc)
690pub const kAudioObjectPropertyCreator: AudioObjectPropertySelector = 0x6f706c67;
691/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertylisteneradded?language=objc)
692pub const kAudioObjectPropertyListenerAdded: AudioObjectPropertySelector = 0x6c697361;
693/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertylistenerremoved?language=objc)
694pub const kAudioObjectPropertyListenerRemoved: AudioObjectPropertySelector = 0x6c697372;
695
696extern "C-unwind" {
697    /// Prints to standard out a textural description of the AudioObject.
698    ///
699    /// Parameter `inObjectID`: The AudioObject to show.
700    pub fn AudioObjectShow(in_object_id: AudioObjectID);
701}
702
703/// Queries an AudioObject about whether or not it has the given property.
704///
705/// Parameter `inObjectID`: The AudioObject to query.
706///
707/// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being queried.
708///
709/// Returns: A Boolean indicating whether or not the AudioObject has the given property.
710///
711/// # Safety
712///
713/// `in_address` must be a valid pointer.
714#[inline]
715pub unsafe extern "C-unwind" fn AudioObjectHasProperty(
716    in_object_id: AudioObjectID,
717    in_address: NonNull<AudioObjectPropertyAddress>,
718) -> bool {
719    extern "C-unwind" {
720        fn AudioObjectHasProperty(
721            in_object_id: AudioObjectID,
722            in_address: NonNull<AudioObjectPropertyAddress>,
723        ) -> Boolean;
724    }
725    let ret = unsafe { AudioObjectHasProperty(in_object_id, in_address) };
726    ret != 0
727}
728
729extern "C-unwind" {
730    /// Queries an AudioObject about whether or not the given property can be set using
731    /// AudioObjectSetPropertyData.
732    ///
733    /// Parameter `inObjectID`: The AudioObject to query.
734    ///
735    /// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being queried.
736    ///
737    /// Parameter `outIsSettable`: A Boolean indicating whether or not the property can be set.
738    ///
739    /// Returns: An OSStatus indicating success or failure.
740    ///
741    /// # Safety
742    ///
743    /// - `in_address` must be a valid pointer.
744    /// - `out_is_settable` must be a valid pointer.
745    pub fn AudioObjectIsPropertySettable(
746        in_object_id: AudioObjectID,
747        in_address: NonNull<AudioObjectPropertyAddress>,
748        out_is_settable: NonNull<Boolean>,
749    ) -> OSStatus;
750}
751
752extern "C-unwind" {
753    /// Queries an AudioObject to find the size of the data for the given property.
754    ///
755    /// Parameter `inObjectID`: The AudioObject to query.
756    ///
757    /// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being queried.
758    ///
759    /// Parameter `inQualifierDataSize`: A UInt32 indicating the size of the buffer pointed to by inQualifierData.
760    /// Note that not all properties require qualification, in which case this
761    /// value will be 0.
762    ///
763    /// Parameter `inQualifierData`: A buffer of data to be used in determining the data of the property being
764    /// queried. Note that not all properties require qualification, in which case
765    /// this value will be NULL.
766    ///
767    /// Parameter `outDataSize`: A UInt32 indicating how many bytes the data for the given property occupies.
768    ///
769    /// Returns: An OSStatus indicating success or failure.
770    ///
771    /// # Safety
772    ///
773    /// - `in_address` must be a valid pointer.
774    /// - `in_qualifier_data` must be a valid pointer or null.
775    /// - `out_data_size` must be a valid pointer.
776    pub fn AudioObjectGetPropertyDataSize(
777        in_object_id: AudioObjectID,
778        in_address: NonNull<AudioObjectPropertyAddress>,
779        in_qualifier_data_size: u32,
780        in_qualifier_data: *const c_void,
781        out_data_size: NonNull<u32>,
782    ) -> OSStatus;
783}
784
785extern "C-unwind" {
786    /// Queries an AudioObject to get the data of the given property and places it in
787    /// the provided buffer.
788    ///
789    /// Parameter `inObjectID`: The AudioObject to query.
790    ///
791    /// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being queried.
792    ///
793    /// Parameter `inQualifierDataSize`: A UInt32 indicating the size of the buffer pointed to by inQualifierData.
794    /// Note that not all properties require qualification, in which case this
795    /// value will be 0.
796    ///
797    /// Parameter `inQualifierData`: A buffer of data to be used in determining the data of the property being
798    /// queried. Note that not all properties require qualification, in which case
799    /// this value will be NULL.
800    ///
801    /// Parameter `ioDataSize`: A UInt32 which on entry indicates the size of the buffer pointed to by
802    /// outData and on exit indicates how much of the buffer was used.
803    ///
804    /// Parameter `outData`: The buffer into which the AudioObject will put the data for the given
805    /// property.
806    ///
807    /// Returns: An OSStatus indicating success or failure.
808    ///
809    /// # Safety
810    ///
811    /// - `in_address` must be a valid pointer.
812    /// - `in_qualifier_data` must be a valid pointer or null.
813    /// - `io_data_size` must be a valid pointer.
814    /// - `out_data` must be a valid pointer.
815    pub fn AudioObjectGetPropertyData(
816        in_object_id: AudioObjectID,
817        in_address: NonNull<AudioObjectPropertyAddress>,
818        in_qualifier_data_size: u32,
819        in_qualifier_data: *const c_void,
820        io_data_size: NonNull<u32>,
821        out_data: NonNull<c_void>,
822    ) -> OSStatus;
823}
824
825extern "C-unwind" {
826    /// Tells an AudioObject to change the value of the given property using the
827    /// provided data.
828    ///
829    /// Note that the value of the property should not be considered changed until the
830    /// HAL has called the listeners as many properties values are changed
831    /// asynchronously.
832    ///
833    /// Parameter `inObjectID`: The AudioObject to change.
834    ///
835    /// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being changed.
836    ///
837    /// Parameter `inQualifierDataSize`: A UInt32 indicating the size of the buffer pointed to by inQualifierData.
838    /// Note that not all properties require qualification, in which case this
839    /// value will be 0.
840    ///
841    /// Parameter `inQualifierData`: A buffer of data to be used in determining the data of the property being
842    /// queried. Note that not all properties require qualification, in which case
843    /// this value will be NULL.
844    ///
845    /// Parameter `inDataSize`: A UInt32 indicating the size of the buffer pointed to by inData.
846    ///
847    /// Parameter `inData`: The buffer containing the data to be used to change the property's value.
848    ///
849    /// Returns: An OSStatus indicating success or failure.
850    ///
851    /// # Safety
852    ///
853    /// - `in_address` must be a valid pointer.
854    /// - `in_qualifier_data` must be a valid pointer or null.
855    /// - `in_data` must be a valid pointer.
856    pub fn AudioObjectSetPropertyData(
857        in_object_id: AudioObjectID,
858        in_address: NonNull<AudioObjectPropertyAddress>,
859        in_qualifier_data_size: u32,
860        in_qualifier_data: *const c_void,
861        in_data_size: u32,
862        in_data: NonNull<c_void>,
863    ) -> OSStatus;
864}
865
866extern "C-unwind" {
867    /// Registers the given AudioObjectPropertyListenerProc to receive notifications
868    /// when the given properties change.
869    ///
870    /// Parameter `inObjectID`: The AudioObject to register the listener with.
871    ///
872    /// Parameter `inAddress`: The AudioObjectPropertyAddresses indicating which property the listener
873    /// should be notified about.
874    ///
875    /// Parameter `inListener`: The AudioObjectPropertyListenerProc to call.
876    ///
877    /// Parameter `inClientData`: A pointer to client data that is passed to the listener when it is called.
878    ///
879    /// Returns: An OSStatus indicating success or failure.
880    ///
881    /// # Safety
882    ///
883    /// - `in_address` must be a valid pointer.
884    /// - `in_listener` must be implemented correctly.
885    /// - `in_client_data` must be a valid pointer or null.
886    pub fn AudioObjectAddPropertyListener(
887        in_object_id: AudioObjectID,
888        in_address: NonNull<AudioObjectPropertyAddress>,
889        in_listener: AudioObjectPropertyListenerProc,
890        in_client_data: *mut c_void,
891    ) -> OSStatus;
892}
893
894extern "C-unwind" {
895    /// Unregisters the given AudioObjectPropertyListenerProc from receiving
896    /// notifications when the given properties change.
897    ///
898    /// Parameter `inObjectID`: The AudioObject to unregister the listener from.
899    ///
900    /// Parameter `inAddress`: The AudioObjectPropertyAddress indicating from which property the listener
901    /// should be removed.
902    ///
903    /// Parameter `inListener`: The AudioObjectPropertyListenerProc being removed.
904    ///
905    /// Parameter `inClientData`: A pointer to client data that is passed to the listener when it is called.
906    ///
907    /// Returns: An OSStatus indicating success or failure.
908    ///
909    /// # Safety
910    ///
911    /// - `in_address` must be a valid pointer.
912    /// - `in_listener` must be implemented correctly.
913    /// - `in_client_data` must be a valid pointer or null.
914    pub fn AudioObjectRemovePropertyListener(
915        in_object_id: AudioObjectID,
916        in_address: NonNull<AudioObjectPropertyAddress>,
917        in_listener: AudioObjectPropertyListenerProc,
918        in_client_data: *mut c_void,
919    ) -> OSStatus;
920}
921
922extern "C-unwind" {
923    /// Registers the given AudioObjectPropertyListenerBlock to receive notifications
924    /// when the given properties change.
925    ///
926    /// Parameter `inObjectID`: The AudioObject to register the listener with.
927    ///
928    /// Parameter `inAddress`: The AudioObjectPropertyAddresses indicating which property the listener
929    /// should be notified about.
930    ///
931    /// Parameter `inDispatchQueue`: The dispatch queue on which the listener block will be dispatched. All
932    /// listener blocks will be dispatched asynchronously save for those dispatched
933    /// from the IO context (of which kAudioDevicePropertyDeviceIsRunning and
934    /// kAudioDeviceProcessorOverload are the only examples) which will be
935    /// dispatched synchronously. Note that this dispatch queue will be retained
936    /// until a matching call to AudioObjectRemovePropertyListenerBlock is made. If
937    /// this value is NULL, then the block will be directly invoked.
938    ///
939    /// Parameter `inListener`: The AudioObjectPropertyListenerBlock to call. Note that this block will be
940    /// Block_copy'd and the reference maintained until a matching call to
941    /// AudioObjectRemovePropertyListenerBlock is made.
942    ///
943    /// Returns: An OSStatus indicating success or failure.
944    ///
945    /// # Safety
946    ///
947    /// - `in_address` must be a valid pointer.
948    /// - `in_dispatch_queue` possibly has additional threading requirements.
949    /// - `in_listener` must be a valid pointer.
950    #[cfg(all(feature = "block2", feature = "dispatch2"))]
951    pub fn AudioObjectAddPropertyListenerBlock(
952        in_object_id: AudioObjectID,
953        in_address: NonNull<AudioObjectPropertyAddress>,
954        in_dispatch_queue: Option<&DispatchQueue>,
955        in_listener: AudioObjectPropertyListenerBlock,
956    ) -> OSStatus;
957}
958
959extern "C-unwind" {
960    /// Unregisters the given AudioObjectPropertyListenerBlock from receiving
961    /// notifications when the given properties change.
962    ///
963    /// Parameter `inObjectID`: The AudioObject to unregister the listener from.
964    ///
965    /// Parameter `inAddress`: The AudioObjectPropertyAddress indicating from which property the listener
966    /// should be removed.
967    ///
968    /// Parameter `inDispatchQueue`: The dispatch queue on which the listener block was being dispatched to.
969    ///
970    /// Parameter `inListener`: The AudioObjectPropertyListenerBlock being removed.
971    ///
972    /// Returns: An OSStatus indicating success or failure.
973    ///
974    /// # Safety
975    ///
976    /// - `in_address` must be a valid pointer.
977    /// - `in_dispatch_queue` possibly has additional threading requirements.
978    /// - `in_listener` must be a valid pointer.
979    #[cfg(all(feature = "block2", feature = "dispatch2"))]
980    pub fn AudioObjectRemovePropertyListenerBlock(
981        in_object_id: AudioObjectID,
982        in_address: NonNull<AudioObjectPropertyAddress>,
983        in_dispatch_queue: Option<&DispatchQueue>,
984        in_listener: AudioObjectPropertyListenerBlock,
985    ) -> OSStatus;
986}
987
988/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosystemobjectclassid?language=objc)
989pub const kAudioSystemObjectClassID: AudioClassID = 0x61737973;
990
991/// The values for kAudioHardwarePropertyPowerHint
992///
993/// The system object property, kAudioHardwarePropertyPowerHint, allows a process to
994/// to indicate how aggressive the system can be with optimizations that save power.
995/// Note that the value of this property can be set in an application's info.plist
996/// using the key, "AudioHardwarePowerHint". The values for this key are the strings
997/// that correspond to the values in the enum.
998///
999/// This is the default value and it indicates that the system will not make any
1000/// power optimizations that compromise latency or quality in order to save
1001/// power. The info.plist value is "None" or the "AudioHardwarePowerHint" entry
1002/// can be omitted entirely.
1003///
1004/// The system will choose to save power even at the expense of latency. The
1005/// info.plist value is "Favor Saving Power"
1006///
1007/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiohardwarepowerhint?language=objc)
1008// NS_ENUM
1009#[repr(transparent)]
1010#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1011pub struct AudioHardwarePowerHint(pub u32);
1012impl AudioHardwarePowerHint {
1013    #[doc(alias = "kAudioHardwarePowerHintNone")]
1014    pub const None: Self = Self(0);
1015    #[doc(alias = "kAudioHardwarePowerHintFavorSavingPower")]
1016    pub const FavorSavingPower: Self = Self(1);
1017}
1018
1019#[cfg(feature = "objc2")]
1020unsafe impl Encode for AudioHardwarePowerHint {
1021    const ENCODING: Encoding = u32::ENCODING;
1022}
1023
1024#[cfg(feature = "objc2")]
1025unsafe impl RefEncode for AudioHardwarePowerHint {
1026    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1027}
1028
1029/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydevices?language=objc)
1030pub const kAudioHardwarePropertyDevices: AudioObjectPropertySelector = 0x64657623;
1031/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydefaultinputdevice?language=objc)
1032pub const kAudioHardwarePropertyDefaultInputDevice: AudioObjectPropertySelector = 0x64496e20;
1033/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydefaultoutputdevice?language=objc)
1034pub const kAudioHardwarePropertyDefaultOutputDevice: AudioObjectPropertySelector = 0x644f7574;
1035/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydefaultsystemoutputdevice?language=objc)
1036pub const kAudioHardwarePropertyDefaultSystemOutputDevice: AudioObjectPropertySelector = 0x734f7574;
1037/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslateuidtodevice?language=objc)
1038pub const kAudioHardwarePropertyTranslateUIDToDevice: AudioObjectPropertySelector = 0x75696464;
1039/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertymixstereotomono?language=objc)
1040pub const kAudioHardwarePropertyMixStereoToMono: AudioObjectPropertySelector = 0x73746d6f;
1041/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertypluginlist?language=objc)
1042pub const kAudioHardwarePropertyPlugInList: AudioObjectPropertySelector = 0x706c6723;
1043/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslatebundleidtoplugin?language=objc)
1044pub const kAudioHardwarePropertyTranslateBundleIDToPlugIn: AudioObjectPropertySelector = 0x62696470;
1045/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytransportmanagerlist?language=objc)
1046pub const kAudioHardwarePropertyTransportManagerList: AudioObjectPropertySelector = 0x746d6723;
1047/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslatebundleidtotransportmanager?language=objc)
1048pub const kAudioHardwarePropertyTranslateBundleIDToTransportManager: AudioObjectPropertySelector =
1049    0x746d6269;
1050/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyboxlist?language=objc)
1051pub const kAudioHardwarePropertyBoxList: AudioObjectPropertySelector = 0x626f7823;
1052/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslateuidtobox?language=objc)
1053pub const kAudioHardwarePropertyTranslateUIDToBox: AudioObjectPropertySelector = 0x75696462;
1054/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyclockdevicelist?language=objc)
1055pub const kAudioHardwarePropertyClockDeviceList: AudioObjectPropertySelector = 0x636c6b23;
1056/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslateuidtoclockdevice?language=objc)
1057pub const kAudioHardwarePropertyTranslateUIDToClockDevice: AudioObjectPropertySelector = 0x75696463;
1058/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessismain?language=objc)
1059pub const kAudioHardwarePropertyProcessIsMain: AudioObjectPropertySelector = 0x6d61696e;
1060/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyisinitingorexiting?language=objc)
1061pub const kAudioHardwarePropertyIsInitingOrExiting: AudioObjectPropertySelector = 0x696e6f74;
1062/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyuseridchanged?language=objc)
1063pub const kAudioHardwarePropertyUserIDChanged: AudioObjectPropertySelector = 0x65756964;
1064/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessinputmute?language=objc)
1065pub const kAudioHardwarePropertyProcessInputMute: AudioObjectPropertySelector = 0x706d696e;
1066/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessisaudible?language=objc)
1067pub const kAudioHardwarePropertyProcessIsAudible: AudioObjectPropertySelector = 0x706d7574;
1068/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertysleepingisallowed?language=objc)
1069pub const kAudioHardwarePropertySleepingIsAllowed: AudioObjectPropertySelector = 0x736c6570;
1070/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyunloadingisallowed?language=objc)
1071pub const kAudioHardwarePropertyUnloadingIsAllowed: AudioObjectPropertySelector = 0x756e6c64;
1072/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyhogmodeisallowed?language=objc)
1073pub const kAudioHardwarePropertyHogModeIsAllowed: AudioObjectPropertySelector = 0x686f6772;
1074/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyusersessionisactiveorheadless?language=objc)
1075pub const kAudioHardwarePropertyUserSessionIsActiveOrHeadless: AudioObjectPropertySelector =
1076    0x75736572;
1077/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyservicerestarted?language=objc)
1078pub const kAudioHardwarePropertyServiceRestarted: AudioObjectPropertySelector = 0x73727374;
1079/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertypowerhint?language=objc)
1080pub const kAudioHardwarePropertyPowerHint: AudioObjectPropertySelector = 0x706f7768;
1081/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessobjectlist?language=objc)
1082pub const kAudioHardwarePropertyProcessObjectList: AudioObjectPropertySelector = 0x70727323;
1083/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslatepidtoprocessobject?language=objc)
1084pub const kAudioHardwarePropertyTranslatePIDToProcessObject: AudioObjectPropertySelector =
1085    0x69643270;
1086/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytaplist?language=objc)
1087pub const kAudioHardwarePropertyTapList: AudioObjectPropertySelector = 0x74707323;
1088/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslateuidtotap?language=objc)
1089pub const kAudioHardwarePropertyTranslateUIDToTap: AudioObjectPropertySelector = 0x75696474;
1090
1091extern "C-unwind" {
1092    /// When this routine is called, all IO on all devices within a process will be
1093    /// terminated and all resources capable of being released will be released. This
1094    /// routine essentially returns the HAL to its uninitialized state.
1095    ///
1096    /// Returns: An OSStatus indicating success or failure.
1097    pub fn AudioHardwareUnload() -> OSStatus;
1098}
1099
1100extern "C-unwind" {
1101    /// This routine creates a new AudioAggregateDevice using the provided description.
1102    ///
1103    /// Parameter `inDescription`: The CFDictionary that specifies how to build the AudioAggregateDevice. The
1104    /// supported keys are described in the AudioAggregateDevice Constants section.
1105    ///
1106    /// Parameter `outDeviceID`: The AudioObjectID of the newly created AudioAggregateDevice.
1107    ///
1108    /// Returns: An OSStatus indicating success or failure.
1109    ///
1110    /// # Safety
1111    ///
1112    /// - `in_description` generics must be of the correct type.
1113    /// - `out_device_id` must be a valid pointer.
1114    pub fn AudioHardwareCreateAggregateDevice(
1115        in_description: &CFDictionary,
1116        out_device_id: NonNull<AudioObjectID>,
1117    ) -> OSStatus;
1118}
1119
1120extern "C-unwind" {
1121    /// This routine destroys the given AudioAggregateDevice.
1122    ///
1123    /// The actual destruction of the device is asynchronous and may take place after
1124    /// the call to this routine has returned.
1125    ///
1126    /// Parameter `inDeviceID`: The AudioObjectID of the AudioAggregateDevice to destroy.
1127    ///
1128    /// Returns: An OSStatus indicating success or failure.
1129    pub fn AudioHardwareDestroyAggregateDevice(in_device_id: AudioObjectID) -> OSStatus;
1130}
1131
1132/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioplugincreateaggregatedevice?language=objc)
1133pub const kAudioPlugInCreateAggregateDevice: AudioObjectPropertySelector = 0x63616767;
1134/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioplugindestroyaggregatedevice?language=objc)
1135pub const kAudioPlugInDestroyAggregateDevice: AudioObjectPropertySelector = 0x64616767;
1136
1137/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotransportmanagercreateendpointdevice?language=objc)
1138pub const kAudioTransportManagerCreateEndPointDevice: AudioObjectPropertySelector = 0x63646576;
1139/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotransportmanagerdestroyendpointdevice?language=objc)
1140pub const kAudioTransportManagerDestroyEndPointDevice: AudioObjectPropertySelector = 0x64646576;
1141
1142/// An AudioDeviceIOProc is called by an AudioDevice to provide input data read from
1143/// the device and collect output data to be written to the device for the current
1144/// IO cycle.
1145///
1146/// Parameter `inDevice`: The AudioDevice doing the IO.
1147///
1148/// Parameter `inNow`: An AudioTimeStamp that indicates the IO cycle started. Note that this time
1149/// includes any scheduling latency that may have been incurred waking the
1150/// thread on which IO is being done.
1151///
1152/// Parameter `inInputData`: An AudioBufferList containing the input data for the current IO cycle. For
1153/// streams that are disabled, the AudioBuffer's mData field will be NULL but
1154/// the mDataByteSize field will still say how much data would have been there
1155/// if it was enabled. Note that the contents of this structure should never be
1156/// modified.
1157///
1158/// Parameter `inInputTime`: An AudioTimeStamp that indicates the time at which the first frame in the
1159/// data was acquired from the hardware. If the device has no input streams, the
1160/// time stamp will be zeroed out.
1161///
1162/// Parameter `outOutputData`: An AudioBufferList in which the output data for the current IO cycle is to
1163/// be placed. On entry, each AudioBuffer's mDataByteSize field indicates the
1164/// maximum amount of data that can be placed in the buffer and the buffer's
1165/// memory has been zeroed out. For formats where the number of bytes per packet
1166/// can vary (as with AC-3, for example), the client has to fill out on exit
1167/// each mDataByteSize field in each AudioBuffer with the amount of data that
1168/// was put in the buffer. Otherwise, the mDataByteSize field should not be
1169/// changed. For streams that are disabled, the AudioBuffer's mData field will
1170/// be NULL but the mDataByteSize field will still say how much data would have
1171/// been there if it was enabled. Except as noted above, the contents of this
1172/// structure should not other wise be modified.
1173///
1174/// Parameter `inOutputTime`: An AudioTimeStamp that indicates the time at which the first frame in the
1175/// data will be passed to the hardware. If the device has no output streams,
1176/// the time stamp will be zeroed out.
1177///
1178/// Parameter `inClientData`: A pointer to client data established when the AudioDeviceIOProc was
1179/// registered with the AudioDevice.
1180///
1181/// Returns: The return value is currently unused and should always be 0.
1182///
1183/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodeviceioproc?language=objc)
1184#[cfg(feature = "objc2-core-audio-types")]
1185pub type AudioDeviceIOProc = Option<
1186    unsafe extern "C-unwind" fn(
1187        AudioObjectID,
1188        NonNull<AudioTimeStamp>,
1189        NonNull<AudioBufferList>,
1190        NonNull<AudioTimeStamp>,
1191        NonNull<AudioBufferList>,
1192        NonNull<AudioTimeStamp>,
1193        *mut c_void,
1194    ) -> OSStatus,
1195>;
1196
1197/// An AudioDeviceIOBlock is called by an AudioDevice to provide input data read
1198/// from the device and collect output data to be written to the device for the
1199/// current IO cycle.
1200///
1201/// Parameter `inNow`: An AudioTimeStamp that indicates the IO cycle started. Note that this time
1202/// includes any scheduling latency that may have been incurred waking the
1203/// thread on which IO is being done.
1204///
1205/// Parameter `inInputData`: An AudioBufferList containing the input data for the current IO cycle. For
1206/// streams that are disabled, the AudioBuffer's mData field will be NULL but
1207/// the mDataByteSize field will still say how much data would have been there
1208/// if it was enabled. Note that the contents of this structure should never be
1209/// modified.
1210///
1211/// Parameter `inInputTime`: An AudioTimeStamp that indicates the time at which the first frame in the
1212/// data was acquired from the hardware. If the device has no input streams, the
1213/// time stamp will be zeroed out.
1214///
1215/// Parameter `outOutputData`: An AudioBufferList in which the output data for the current IO cycle is to
1216/// be placed. On entry, each AudioBuffer's mDataByteSize field indicates the
1217/// maximum amount of data that can be placed in the buffer and the buffer's
1218/// memory has been zeroed out. For formats where the number of bytes per packet
1219/// can vary (as with AC-3, for example), the client has to fill out on exit
1220/// each mDataByteSize field in each AudioBuffer with the amount of data that
1221/// was put in the buffer. Otherwise, the mDataByteSize field should not be
1222/// changed. For streams that are disabled, the AudioBuffer's mData field will
1223/// be NULL but the mDataByteSize field will still say how much data would have
1224/// been there if it was enabled. Except as noted above, the contents of this
1225/// structure should not other wise be modified.
1226///
1227/// Parameter `inOutputTime`: An AudioTimeStamp that indicates the time at which the first frame in the
1228/// data will be passed to the hardware. If the device has no output streams,
1229/// the time stamp will be zeroed out.
1230///
1231/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodeviceioblock?language=objc)
1232#[cfg(all(feature = "block2", feature = "objc2-core-audio-types"))]
1233pub type AudioDeviceIOBlock = *mut block2::DynBlock<
1234    dyn Fn(
1235        NonNull<AudioTimeStamp>,
1236        NonNull<AudioBufferList>,
1237        NonNull<AudioTimeStamp>,
1238        NonNull<AudioBufferList>,
1239        NonNull<AudioTimeStamp>,
1240    ),
1241>;
1242
1243/// An AudioDeviceIOProcID represents both an IOProc and the client data that goes
1244/// with it. Once created, an AudioDeviceIOProcID can be used everywhere one would
1245/// use a regular IOProc. The purpose for an AudioDeviceIOProcID is to allow a
1246/// client to register the same function pointer as an IOProc with a device multiple
1247/// times provided
1248///
1249/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodeviceioprocid?language=objc)
1250#[cfg(feature = "objc2-core-audio-types")]
1251pub type AudioDeviceIOProcID = AudioDeviceIOProc;
1252
1253/// This structure describes which streams a given AudioDeviceIOProc will use. It is
1254/// used in conjunction with kAudioDevicePropertyIOProcStreamUsage.
1255/// Field: mIOProc
1256/// The IOProc whose stream usage is being specified.
1257/// Field: mNumberStreams
1258/// The number of streams being specified.
1259/// Field: mStreamIsOn
1260/// An array of UInt32's whose length is specified by mNumberStreams. Each
1261/// element of the array corresponds to a stream. A value of 0 means the stream
1262/// is not to be enabled. Any other value means the stream is to be used.
1263///
1264/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiohardwareioprocstreamusage?language=objc)
1265#[repr(C)]
1266#[derive(Clone, Copy, Debug, PartialEq)]
1267pub struct AudioHardwareIOProcStreamUsage {
1268    pub mIOProc: NonNull<c_void>,
1269    pub mNumberStreams: u32,
1270    pub mStreamIsOn: [u32; 1],
1271}
1272
1273#[cfg(feature = "objc2")]
1274unsafe impl Encode for AudioHardwareIOProcStreamUsage {
1275    const ENCODING: Encoding = Encoding::Struct(
1276        "AudioHardwareIOProcStreamUsage",
1277        &[
1278            <NonNull<c_void>>::ENCODING,
1279            <u32>::ENCODING,
1280            <[u32; 1]>::ENCODING,
1281        ],
1282    );
1283}
1284
1285#[cfg(feature = "objc2")]
1286unsafe impl RefEncode for AudioHardwareIOProcStreamUsage {
1287    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1288}
1289
1290/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicestarttimeisinputflag?language=objc)
1291pub const kAudioDeviceStartTimeIsInputFlag: u32 = 1 << 0;
1292/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicestarttimedontconsultdeviceflag?language=objc)
1293pub const kAudioDeviceStartTimeDontConsultDeviceFlag: u32 = 1 << 1;
1294/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicestarttimedontconsulthalflag?language=objc)
1295pub const kAudioDeviceStartTimeDontConsultHALFlag: u32 = 1 << 2;
1296
1297/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplugin?language=objc)
1298pub const kAudioDevicePropertyPlugIn: AudioObjectPropertySelector = 0x706c7567;
1299/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydevicehaschanged?language=objc)
1300pub const kAudioDevicePropertyDeviceHasChanged: AudioObjectPropertySelector = 0x64696666;
1301/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydeviceisrunningsomewhere?language=objc)
1302pub const kAudioDevicePropertyDeviceIsRunningSomewhere: AudioObjectPropertySelector = 0x676f6e65;
1303/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodeviceprocessoroverload?language=objc)
1304pub const kAudioDeviceProcessorOverload: AudioObjectPropertySelector = 0x6f766572;
1305/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyiostoppedabnormally?language=objc)
1306pub const kAudioDevicePropertyIOStoppedAbnormally: AudioObjectPropertySelector = 0x73747064;
1307/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhogmode?language=objc)
1308pub const kAudioDevicePropertyHogMode: AudioObjectPropertySelector = 0x6f696e6b;
1309/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertybufferframesize?language=objc)
1310pub const kAudioDevicePropertyBufferFrameSize: AudioObjectPropertySelector = 0x6673697a;
1311/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertybufferframesizerange?language=objc)
1312pub const kAudioDevicePropertyBufferFrameSizeRange: AudioObjectPropertySelector = 0x66737a23;
1313/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyusesvariablebufferframesizes?language=objc)
1314pub const kAudioDevicePropertyUsesVariableBufferFrameSizes: AudioObjectPropertySelector =
1315    0x7666737a;
1316/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyiocycleusage?language=objc)
1317pub const kAudioDevicePropertyIOCycleUsage: AudioObjectPropertySelector = 0x6e637963;
1318/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystreamconfiguration?language=objc)
1319pub const kAudioDevicePropertyStreamConfiguration: AudioObjectPropertySelector = 0x736c6179;
1320/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyioprocstreamusage?language=objc)
1321pub const kAudioDevicePropertyIOProcStreamUsage: AudioObjectPropertySelector = 0x73757365;
1322/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyactualsamplerate?language=objc)
1323pub const kAudioDevicePropertyActualSampleRate: AudioObjectPropertySelector = 0x61737274;
1324/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclockdevice?language=objc)
1325pub const kAudioDevicePropertyClockDevice: AudioObjectPropertySelector = 0x61706364;
1326/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyiothreadosworkgroup?language=objc)
1327pub const kAudioDevicePropertyIOThreadOSWorkgroup: AudioObjectPropertySelector = 0x6f737767;
1328/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyprocessmute?language=objc)
1329pub const kAudioDevicePropertyProcessMute: AudioObjectPropertySelector = 0x6170706d;
1330
1331/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyjackisconnected?language=objc)
1332pub const kAudioDevicePropertyJackIsConnected: AudioObjectPropertySelector = 0x6a61636b;
1333/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumescalar?language=objc)
1334pub const kAudioDevicePropertyVolumeScalar: AudioObjectPropertySelector = 0x766f6c6d;
1335/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumedecibels?language=objc)
1336pub const kAudioDevicePropertyVolumeDecibels: AudioObjectPropertySelector = 0x766f6c64;
1337/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumerangedecibels?language=objc)
1338pub const kAudioDevicePropertyVolumeRangeDecibels: AudioObjectPropertySelector = 0x76646223;
1339/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumescalartodecibels?language=objc)
1340pub const kAudioDevicePropertyVolumeScalarToDecibels: AudioObjectPropertySelector = 0x76326462;
1341/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumedecibelstoscalar?language=objc)
1342pub const kAudioDevicePropertyVolumeDecibelsToScalar: AudioObjectPropertySelector = 0x64623276;
1343/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystereopan?language=objc)
1344pub const kAudioDevicePropertyStereoPan: AudioObjectPropertySelector = 0x7370616e;
1345/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystereopanchannels?language=objc)
1346pub const kAudioDevicePropertyStereoPanChannels: AudioObjectPropertySelector = 0x73706e23;
1347/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertymute?language=objc)
1348pub const kAudioDevicePropertyMute: AudioObjectPropertySelector = 0x6d757465;
1349/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysolo?language=objc)
1350pub const kAudioDevicePropertySolo: AudioObjectPropertySelector = 0x736f6c6f;
1351/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyphantompower?language=objc)
1352pub const kAudioDevicePropertyPhantomPower: AudioObjectPropertySelector = 0x7068616e;
1353/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyphaseinvert?language=objc)
1354pub const kAudioDevicePropertyPhaseInvert: AudioObjectPropertySelector = 0x70687369;
1355/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertycliplight?language=objc)
1356pub const kAudioDevicePropertyClipLight: AudioObjectPropertySelector = 0x636c6970;
1357/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertytalkback?language=objc)
1358pub const kAudioDevicePropertyTalkback: AudioObjectPropertySelector = 0x74616c62;
1359/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertylistenback?language=objc)
1360pub const kAudioDevicePropertyListenback: AudioObjectPropertySelector = 0x6c736e62;
1361/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasource?language=objc)
1362pub const kAudioDevicePropertyDataSource: AudioObjectPropertySelector = 0x73737263;
1363/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasources?language=objc)
1364pub const kAudioDevicePropertyDataSources: AudioObjectPropertySelector = 0x73736323;
1365/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasourcenameforidcfstring?language=objc)
1366pub const kAudioDevicePropertyDataSourceNameForIDCFString: AudioObjectPropertySelector = 0x6c73636e;
1367/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasourcekindforid?language=objc)
1368pub const kAudioDevicePropertyDataSourceKindForID: AudioObjectPropertySelector = 0x7373636b;
1369/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksource?language=objc)
1370pub const kAudioDevicePropertyClockSource: AudioObjectPropertySelector = 0x63737263;
1371/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksources?language=objc)
1372pub const kAudioDevicePropertyClockSources: AudioObjectPropertySelector = 0x63736323;
1373/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksourcenameforidcfstring?language=objc)
1374pub const kAudioDevicePropertyClockSourceNameForIDCFString: AudioObjectPropertySelector =
1375    0x6c63736e;
1376/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksourcekindforid?language=objc)
1377pub const kAudioDevicePropertyClockSourceKindForID: AudioObjectPropertySelector = 0x6373636b;
1378/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythru?language=objc)
1379pub const kAudioDevicePropertyPlayThru: AudioObjectPropertySelector = 0x74687275;
1380/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrusolo?language=objc)
1381pub const kAudioDevicePropertyPlayThruSolo: AudioObjectPropertySelector = 0x74687273;
1382/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumescalar?language=objc)
1383pub const kAudioDevicePropertyPlayThruVolumeScalar: AudioObjectPropertySelector = 0x6d767363;
1384/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumedecibels?language=objc)
1385pub const kAudioDevicePropertyPlayThruVolumeDecibels: AudioObjectPropertySelector = 0x6d766462;
1386/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumerangedecibels?language=objc)
1387pub const kAudioDevicePropertyPlayThruVolumeRangeDecibels: AudioObjectPropertySelector = 0x6d766423;
1388/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumescalartodecibels?language=objc)
1389pub const kAudioDevicePropertyPlayThruVolumeScalarToDecibels: AudioObjectPropertySelector =
1390    0x6d763264;
1391/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumedecibelstoscalar?language=objc)
1392pub const kAudioDevicePropertyPlayThruVolumeDecibelsToScalar: AudioObjectPropertySelector =
1393    0x6d763273;
1394/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrustereopan?language=objc)
1395pub const kAudioDevicePropertyPlayThruStereoPan: AudioObjectPropertySelector = 0x6d73706e;
1396/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrustereopanchannels?language=objc)
1397pub const kAudioDevicePropertyPlayThruStereoPanChannels: AudioObjectPropertySelector = 0x6d737023;
1398/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrudestination?language=objc)
1399pub const kAudioDevicePropertyPlayThruDestination: AudioObjectPropertySelector = 0x6d646473;
1400/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrudestinations?language=objc)
1401pub const kAudioDevicePropertyPlayThruDestinations: AudioObjectPropertySelector = 0x6d646423;
1402/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrudestinationnameforidcfstring?language=objc)
1403pub const kAudioDevicePropertyPlayThruDestinationNameForIDCFString: AudioObjectPropertySelector =
1404    0x6d646463;
1405/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnominallinelevel?language=objc)
1406pub const kAudioDevicePropertyChannelNominalLineLevel: AudioObjectPropertySelector = 0x6e6c766c;
1407/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnominallinelevels?language=objc)
1408pub const kAudioDevicePropertyChannelNominalLineLevels: AudioObjectPropertySelector = 0x6e6c7623;
1409/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnominallinelevelnameforidcfstring?language=objc)
1410pub const kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString:
1411    AudioObjectPropertySelector = 0x6c636e6c;
1412/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhighpassfiltersetting?language=objc)
1413pub const kAudioDevicePropertyHighPassFilterSetting: AudioObjectPropertySelector = 0x68697066;
1414/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhighpassfiltersettings?language=objc)
1415pub const kAudioDevicePropertyHighPassFilterSettings: AudioObjectPropertySelector = 0x68697023;
1416/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhighpassfiltersettingnameforidcfstring?language=objc)
1417pub const kAudioDevicePropertyHighPassFilterSettingNameForIDCFString: AudioObjectPropertySelector =
1418    0x6869706c;
1419/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumescalar?language=objc)
1420pub const kAudioDevicePropertySubVolumeScalar: AudioObjectPropertySelector = 0x73766c6d;
1421/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumedecibels?language=objc)
1422pub const kAudioDevicePropertySubVolumeDecibels: AudioObjectPropertySelector = 0x73766c64;
1423/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumerangedecibels?language=objc)
1424pub const kAudioDevicePropertySubVolumeRangeDecibels: AudioObjectPropertySelector = 0x73766423;
1425/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumescalartodecibels?language=objc)
1426pub const kAudioDevicePropertySubVolumeScalarToDecibels: AudioObjectPropertySelector = 0x73763264;
1427/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumedecibelstoscalar?language=objc)
1428pub const kAudioDevicePropertySubVolumeDecibelsToScalar: AudioObjectPropertySelector = 0x73643276;
1429/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubmute?language=objc)
1430pub const kAudioDevicePropertySubMute: AudioObjectPropertySelector = 0x736d7574;
1431/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvoiceactivitydetectionenable?language=objc)
1432pub const kAudioDevicePropertyVoiceActivityDetectionEnable: AudioObjectPropertySelector =
1433    0x7641642b;
1434/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvoiceactivitydetectionstate?language=objc)
1435pub const kAudioDevicePropertyVoiceActivityDetectionState: AudioObjectPropertySelector = 0x76416453;
1436/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertywantscontrolsrestored?language=objc)
1437pub const kAudioDevicePropertyWantsControlsRestored: AudioObjectPropertySelector = 0x72657363;
1438/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertywantsstreamformatsrestored?language=objc)
1439pub const kAudioDevicePropertyWantsStreamFormatsRestored: AudioObjectPropertySelector = 0x72657366;
1440
1441extern "C-unwind" {
1442    /// Creates an AudioDeviceIOProcID from an AudioDeviceIOProc and a client data
1443    /// pointer.
1444    ///
1445    /// AudioDeviceIOProcIDs allow for the client to register the same function pointer
1446    /// with a device multiple times
1447    ///
1448    /// Parameter `inDevice`: The AudioDevice to register the IOProc with.
1449    ///
1450    /// Parameter `inProc`: The AudioDeviceIOProc to register.
1451    ///
1452    /// Parameter `inClientData`: A pointer to client data that is passed back to the IOProc when it is
1453    /// called.
1454    ///
1455    /// Parameter `outIOProcID`: The newly created AudioDeviceIOProcID.
1456    ///
1457    /// Returns: An OSStatus indicating success or failure.
1458    ///
1459    /// # Safety
1460    ///
1461    /// - `in_proc` must be implemented correctly.
1462    /// - `in_client_data` must be a valid pointer or null.
1463    /// - `out_io_proc_id` must be a valid pointer.
1464    #[cfg(feature = "objc2-core-audio-types")]
1465    pub fn AudioDeviceCreateIOProcID(
1466        in_device: AudioObjectID,
1467        in_proc: AudioDeviceIOProc,
1468        in_client_data: *mut c_void,
1469        out_io_proc_id: NonNull<AudioDeviceIOProcID>,
1470    ) -> OSStatus;
1471}
1472
1473extern "C-unwind" {
1474    /// Creates an AudioDeviceIOProcID from an AudioDeviceIOBlock
1475    ///
1476    /// Parameter `outIOProcID`: The newly created AudioDeviceIOProcID.
1477    ///
1478    /// Parameter `inDevice`: The AudioDevice to register the Block with.
1479    ///
1480    /// Parameter `inDispatchQueue`: The dispatch queue on which the IOBlock will be dispatched. All
1481    /// IOBlocks are dispatched synchronously. Note that this dispatch queue will be
1482    /// retained until a matching call to AudioDeviceDestroyIOProcID is made. If
1483    /// this value is NULL, then the IOBlock will be directly invoked.
1484    ///
1485    /// Parameter `inIOBlock`: The AudioDeviceIOBlock to register.  Note that this block will be
1486    /// Block_copy'd and the reference maintained until a matching call to
1487    /// AudioDeviceDestroyIOProcID is made.
1488    ///
1489    /// Returns: An OSStatus indicating success or failure.
1490    ///
1491    /// # Safety
1492    ///
1493    /// - `out_io_proc_id` must be a valid pointer.
1494    /// - `in_dispatch_queue` possibly has additional threading requirements.
1495    /// - `in_io_block` must be a valid pointer.
1496    #[cfg(all(
1497        feature = "block2",
1498        feature = "dispatch2",
1499        feature = "objc2-core-audio-types"
1500    ))]
1501    pub fn AudioDeviceCreateIOProcIDWithBlock(
1502        out_io_proc_id: NonNull<AudioDeviceIOProcID>,
1503        in_device: AudioObjectID,
1504        in_dispatch_queue: Option<&DispatchQueue>,
1505        in_io_block: AudioDeviceIOBlock,
1506    ) -> OSStatus;
1507}
1508
1509extern "C-unwind" {
1510    /// Destroys an AudioDeviceIOProcID.
1511    ///
1512    /// AudioDeviceIOProcIDs allow for the client to register the same function pointer
1513    /// with a device multiple times
1514    ///
1515    /// Parameter `inDevice`: The AudioDevice from which the ID came.
1516    ///
1517    /// Parameter `inIOProcID`: The AudioDeviceIOProcID to get rid of.
1518    ///
1519    /// Returns: An OSStatus indicating success or failure.
1520    ///
1521    /// # Safety
1522    ///
1523    /// `in_io_proc_id` must be implemented correctly.
1524    #[cfg(feature = "objc2-core-audio-types")]
1525    pub fn AudioDeviceDestroyIOProcID(
1526        in_device: AudioObjectID,
1527        in_io_proc_id: AudioDeviceIOProcID,
1528    ) -> OSStatus;
1529}
1530
1531extern "C-unwind" {
1532    /// Starts IO for the given AudioDeviceIOProcID.
1533    ///
1534    /// Parameter `inDevice`: The AudioDevice to start the IOProc on.
1535    ///
1536    /// Parameter `inProcID`: The AudioDeviceIOProcID to start. Note that this can be NULL, which starts
1537    /// the hardware regardless of whether or not there are any IOProcs registered.
1538    /// This is necessary if any of the AudioDevice's timing services are to be
1539    /// used. A balancing call to AudioDeviceStop with a NULL IOProc is required to
1540    /// stop the hardware.
1541    ///
1542    /// Returns: An OSStatus indicating success or failure.
1543    ///
1544    /// # Safety
1545    ///
1546    /// `in_proc_id` must be implemented correctly.
1547    #[cfg(feature = "objc2-core-audio-types")]
1548    pub fn AudioDeviceStart(in_device: AudioObjectID, in_proc_id: AudioDeviceIOProcID) -> OSStatus;
1549}
1550
1551extern "C-unwind" {
1552    /// Starts IO for the given AudioDeviceIOProcID and aligns the IO cycle of the
1553    /// AudioDevice with the given time.
1554    ///
1555    /// Parameter `inDevice`: The AudioDevice to start the IOProc on.
1556    ///
1557    /// Parameter `inProcID`: The AudioDeviceIOProcID to start. Note that this can be NULL, which starts
1558    /// the hardware regardless of whether or not there are any IOProcs registered.
1559    ///
1560    /// Parameter `ioRequestedStartTime`: A pointer to an AudioTimeStamp that, on entry, is the requested time to
1561    /// start the IOProc. On exit, it will be the actual time the IOProc will start.
1562    ///
1563    /// Parameter `inFlags`: A UInt32 containing flags that modify how this function behaves.
1564    ///
1565    /// Returns: An OSStatus indicating success or failure.
1566    /// kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
1567    /// not support starting at a specific time and inProc and ioRequestedStartTime are
1568    /// not NULL.
1569    ///
1570    /// # Safety
1571    ///
1572    /// - `in_proc_id` must be implemented correctly.
1573    /// - `io_requested_start_time` must be a valid pointer.
1574    #[cfg(feature = "objc2-core-audio-types")]
1575    pub fn AudioDeviceStartAtTime(
1576        in_device: AudioObjectID,
1577        in_proc_id: AudioDeviceIOProcID,
1578        io_requested_start_time: NonNull<AudioTimeStamp>,
1579        in_flags: u32,
1580    ) -> OSStatus;
1581}
1582
1583extern "C-unwind" {
1584    /// Stops IO for the given AudioDeviceIOProcID.
1585    ///
1586    /// Parameter `inDevice`: The AudioDevice to stop the IOProc on.
1587    ///
1588    /// Parameter `inProcID`: The AudioDeviceIOProcID to stop.
1589    ///
1590    /// Returns: An OSStatus indicating success or failure.
1591    ///
1592    /// # Safety
1593    ///
1594    /// `in_proc_id` must be implemented correctly.
1595    #[cfg(feature = "objc2-core-audio-types")]
1596    pub fn AudioDeviceStop(in_device: AudioObjectID, in_proc_id: AudioDeviceIOProcID) -> OSStatus;
1597}
1598
1599extern "C-unwind" {
1600    /// Retrieves the current time from an AudioDevice. Note that the device has to be
1601    /// running.
1602    ///
1603    /// Parameter `inDevice`: The AudioDevice to from which to get the time.
1604    ///
1605    /// Parameter `outTime`: An AudioTimeStamp into which the current time is put. On entry, the
1606    /// mFlags field specifies which representations to provide. Because not every
1607    /// device supports all time representations, on exit, the mFlags field will
1608    /// indicate what values are actually valid.
1609    ///
1610    /// Returns: An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1611    /// returned if the AudioDevice isn't running.
1612    ///
1613    /// # Safety
1614    ///
1615    /// `out_time` must be a valid pointer.
1616    #[cfg(feature = "objc2-core-audio-types")]
1617    pub fn AudioDeviceGetCurrentTime(
1618        in_device: AudioObjectID,
1619        out_time: NonNull<AudioTimeStamp>,
1620    ) -> OSStatus;
1621}
1622
1623extern "C-unwind" {
1624    /// Translates the time in the AudioDevice's time base from one representation to
1625    /// another. Note that the device has to be running
1626    ///
1627    /// Parameter `inDevice`: The AudioDevice whose time base governs the translation.
1628    ///
1629    /// Parameter `inTime`: An AudioTimeStamp containing the time to be translated.
1630    ///
1631    /// Parameter `outTime`: An AudioTimeStamp into which the translated time is put. On entry, the
1632    /// mFlags field specifies which representations to translate the input time
1633    /// into. Because not every device supports all time representations, on exit,
1634    /// the mFlags field will indicate which translations were actually done.
1635    ///
1636    /// Returns: An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1637    /// returned if the AudioDevice isn't running.
1638    ///
1639    /// # Safety
1640    ///
1641    /// - `in_time` must be a valid pointer.
1642    /// - `out_time` must be a valid pointer.
1643    #[cfg(feature = "objc2-core-audio-types")]
1644    pub fn AudioDeviceTranslateTime(
1645        in_device: AudioObjectID,
1646        in_time: NonNull<AudioTimeStamp>,
1647        out_time: NonNull<AudioTimeStamp>,
1648    ) -> OSStatus;
1649}
1650
1651extern "C-unwind" {
1652    /// Query an AudioDevice to get a time equal to or later than the given time that is
1653    /// the best time to start IO.
1654    ///
1655    /// The time that is returned is dictated by the constraints of the device and the
1656    /// system. For instance, the driver of a device that provides both audio and video
1657    /// data may only allow start times that coincide with the edge of a video frame.
1658    /// Also, if the device already has one or more active IOProcs, the start time will
1659    /// be shifted to the beginning of the next IO cycle so as not to cause
1660    /// discontinuities in the existing IOProcs. Another reason the start time may shift
1661    /// is to allow for aligning the buffer accesses in an optimal fashion. Note that
1662    /// the device must be running to use this function.
1663    ///
1664    /// Parameter `inDevice`: The AudioDevice to query.
1665    ///
1666    /// Parameter `ioRequestedStartTime`: A pointer to an AudioTimeStamp that, on entry, is the requested start time.
1667    /// On exit, it will have the a time equal to or later than the requested time,
1668    /// as dictated by the device's constraints.
1669    ///
1670    /// Parameter `inFlags`: A UInt32 containing flags that modify how this function behaves.
1671    ///
1672    /// Returns: An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1673    /// returned if the AudioDevice isn't running.
1674    /// kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
1675    /// not support starting at a specific time.
1676    ///
1677    /// # Safety
1678    ///
1679    /// `io_requested_start_time` must be a valid pointer.
1680    #[cfg(feature = "objc2-core-audio-types")]
1681    pub fn AudioDeviceGetNearestStartTime(
1682        in_device: AudioObjectID,
1683        io_requested_start_time: NonNull<AudioTimeStamp>,
1684        in_flags: u32,
1685    ) -> OSStatus;
1686}
1687
1688/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedeviceclassid?language=objc)
1689pub const kAudioAggregateDeviceClassID: AudioClassID = 0x61616767;
1690
1691/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertyfullsubdevicelist?language=objc)
1692pub const kAudioAggregateDevicePropertyFullSubDeviceList: AudioObjectPropertySelector = 0x67727570;
1693/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertyactivesubdevicelist?language=objc)
1694pub const kAudioAggregateDevicePropertyActiveSubDeviceList: AudioObjectPropertySelector =
1695    0x61677270;
1696/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertycomposition?language=objc)
1697pub const kAudioAggregateDevicePropertyComposition: AudioObjectPropertySelector = 0x61636f6d;
1698/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertymainsubdevice?language=objc)
1699pub const kAudioAggregateDevicePropertyMainSubDevice: AudioObjectPropertySelector = 0x616d7374;
1700/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertyclockdevice?language=objc)
1701pub const kAudioAggregateDevicePropertyClockDevice: AudioObjectPropertySelector = 0x61706364;
1702/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertytaplist?language=objc)
1703pub const kAudioAggregateDevicePropertyTapList: AudioObjectPropertySelector = 0x74617023;
1704/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertysubtaplist?language=objc)
1705pub const kAudioAggregateDevicePropertySubTapList: AudioObjectPropertySelector = 0x61746170;
1706
1707/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationminquality?language=objc)
1708pub const kAudioAggregateDriftCompensationMinQuality: u32 = 0;
1709/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationlowquality?language=objc)
1710pub const kAudioAggregateDriftCompensationLowQuality: u32 = 0x20;
1711/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationmediumquality?language=objc)
1712pub const kAudioAggregateDriftCompensationMediumQuality: u32 = 0x40;
1713/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationhighquality?language=objc)
1714pub const kAudioAggregateDriftCompensationHighQuality: u32 = 0x60;
1715/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationmaxquality?language=objc)
1716pub const kAudioAggregateDriftCompensationMaxQuality: u32 = 0x7F;
1717
1718/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdeviceclassid?language=objc)
1719pub const kAudioSubDeviceClassID: AudioClassID = 0x61737562;
1720
1721/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationminquality?language=objc)
1722#[deprecated]
1723pub const kAudioSubDeviceDriftCompensationMinQuality: u32 = 0;
1724/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationlowquality?language=objc)
1725#[deprecated]
1726pub const kAudioSubDeviceDriftCompensationLowQuality: u32 = 0x20;
1727/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationmediumquality?language=objc)
1728#[deprecated]
1729pub const kAudioSubDeviceDriftCompensationMediumQuality: u32 = 0x40;
1730/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationhighquality?language=objc)
1731#[deprecated]
1732pub const kAudioSubDeviceDriftCompensationHighQuality: u32 = 0x60;
1733/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationmaxquality?language=objc)
1734#[deprecated]
1735pub const kAudioSubDeviceDriftCompensationMaxQuality: u32 = 0x7F;
1736
1737/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicepropertyextralatency?language=objc)
1738pub const kAudioSubDevicePropertyExtraLatency: AudioObjectPropertySelector = 0x786c7463;
1739/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicepropertydriftcompensation?language=objc)
1740pub const kAudioSubDevicePropertyDriftCompensation: AudioObjectPropertySelector = 0x64726674;
1741/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicepropertydriftcompensationquality?language=objc)
1742pub const kAudioSubDevicePropertyDriftCompensationQuality: AudioObjectPropertySelector = 0x64726671;
1743
1744/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtapclassid?language=objc)
1745pub const kAudioSubTapClassID: AudioClassID = 0x73746170;
1746
1747/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtappropertyextralatency?language=objc)
1748pub const kAudioSubTapPropertyExtraLatency: AudioObjectPropertySelector = 0x786c7463;
1749/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtappropertydriftcompensation?language=objc)
1750pub const kAudioSubTapPropertyDriftCompensation: AudioObjectPropertySelector = 0x64726674;
1751/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtappropertydriftcompensationquality?language=objc)
1752pub const kAudioSubTapPropertyDriftCompensationQuality: AudioObjectPropertySelector = 0x64726671;
1753
1754/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocessclassid?language=objc)
1755pub const kAudioProcessClassID: AudioClassID = 0x636c6e74;
1756
1757/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertypid?language=objc)
1758pub const kAudioProcessPropertyPID: AudioObjectPropertySelector = 0x70706964;
1759/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertybundleid?language=objc)
1760pub const kAudioProcessPropertyBundleID: AudioObjectPropertySelector = 0x70626964;
1761/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertydevices?language=objc)
1762pub const kAudioProcessPropertyDevices: AudioObjectPropertySelector = 0x70647623;
1763/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertyisrunning?language=objc)
1764pub const kAudioProcessPropertyIsRunning: AudioObjectPropertySelector = 0x7069723f;
1765/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertyisrunninginput?language=objc)
1766pub const kAudioProcessPropertyIsRunningInput: AudioObjectPropertySelector = 0x70697269;
1767/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertyisrunningoutput?language=objc)
1768pub const kAudioProcessPropertyIsRunningOutput: AudioObjectPropertySelector = 0x7069726f;
1769
1770/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotapclassid?language=objc)
1771pub const kAudioTapClassID: AudioClassID = 0x74636c73;
1772
1773/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotappropertyuid?language=objc)
1774pub const kAudioTapPropertyUID: AudioObjectPropertySelector = 0x74756964;
1775/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotappropertydescription?language=objc)
1776pub const kAudioTapPropertyDescription: AudioObjectPropertySelector = 0x74647363;
1777/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotappropertyformat?language=objc)
1778pub const kAudioTapPropertyFormat: AudioObjectPropertySelector = 0x74666d74;
1779
1780extern "C-unwind" {
1781    /// This routine creates a new Tap using the provided description.
1782    ///
1783    /// Parameter `inDescription`: The CATapDescription that specifies how to build the Tap.
1784    ///
1785    /// Parameter `outTapID`: The AudioObjectID of the newly created Tap.
1786    ///
1787    /// Returns: An OSStatus indicating success or failure.
1788    ///
1789    /// # Safety
1790    ///
1791    /// - `in_description` might not allow `None`.
1792    /// - `out_tap_id` must be a valid pointer.
1793    #[cfg(feature = "objc2")]
1794    pub fn AudioHardwareCreateProcessTap(
1795        in_description: Option<&CATapDescription>,
1796        out_tap_id: *mut AudioObjectID,
1797    ) -> OSStatus;
1798}
1799
1800extern "C-unwind" {
1801    /// This routine destroys the given Tap.
1802    ///
1803    /// Parameter `inTapID`: The AudioObjectID of the Tap to destroy.
1804    ///
1805    /// Returns: An OSStatus indicating success or failure.
1806    pub fn AudioHardwareDestroyProcessTap(in_tap_id: AudioObjectID) -> OSStatus;
1807}
1808
1809/// CATapMuteBehavior describes the playback behavior of the process being tapped. The default value is CATapUnmuted.
1810///
1811/// Audio is captured by the tap and also sent to the audio hardware
1812///
1813/// Audio is captured by the tap but no audio is sent from the process to the audio hardware
1814///
1815/// Audio is captured by the tap and also sent to the audio hardware until the tap is read by another audio client.
1816/// For the duration of the read activity on the tap no audio is sent to the audio hardware.
1817///
1818/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/catapmutebehavior?language=objc)
1819// NS_ENUM
1820#[cfg(feature = "objc2")]
1821#[repr(transparent)]
1822#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1823pub struct CATapMuteBehavior(pub NSInteger);
1824#[cfg(feature = "objc2")]
1825impl CATapMuteBehavior {
1826    #[doc(alias = "CATapUnmuted")]
1827    pub const Unmuted: Self = Self(0);
1828    #[doc(alias = "CATapMuted")]
1829    pub const Muted: Self = Self(1);
1830    #[doc(alias = "CATapMutedWhenTapped")]
1831    pub const MutedWhenTapped: Self = Self(2);
1832}
1833
1834#[cfg(feature = "objc2")]
1835unsafe impl Encode for CATapMuteBehavior {
1836    const ENCODING: Encoding = NSInteger::ENCODING;
1837}
1838
1839#[cfg(feature = "objc2")]
1840unsafe impl RefEncode for CATapMuteBehavior {
1841    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1842}
1843
1844#[cfg(feature = "objc2")]
1845extern_class!(
1846    /// This class describes a tap object that contains an input stream.  The input stream is a mix of all of the specified processes output audio.
1847    ///
1848    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/catapdescription?language=objc)
1849    #[unsafe(super(NSObject))]
1850    #[derive(Debug, PartialEq, Eq, Hash)]
1851    #[cfg(feature = "objc2")]
1852    pub struct CATapDescription;
1853);
1854
1855#[cfg(feature = "objc2")]
1856extern_conformance!(
1857    unsafe impl NSObjectProtocol for CATapDescription {}
1858);
1859
1860#[cfg(feature = "objc2")]
1861impl CATapDescription {
1862    extern_methods!(
1863        #[unsafe(method(init))]
1864        #[unsafe(method_family = init)]
1865        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1866
1867        #[cfg(feature = "objc2-foundation")]
1868        /// Mix all given process audio streams down to stereo.  Mono sources will be duplicated in
1869        /// both right and left channels.
1870        ///
1871        /// Parameter `processesObjectIDsToIncludeInTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to include in the tap
1872        #[unsafe(method(initStereoMixdownOfProcesses:))]
1873        #[unsafe(method_family = init)]
1874        pub unsafe fn initStereoMixdownOfProcesses(
1875            this: Allocated<Self>,
1876            processes_object_i_ds_to_include_in_tap: &NSArray<NSNumber>,
1877        ) -> Retained<Self>;
1878
1879        #[cfg(feature = "objc2-foundation")]
1880        /// Mix all processes to a stereo stream except the given processes.  Mono sources will be
1881        /// duplicated in both right and left channels.
1882        ///
1883        /// Parameter `processesObjectIDsToExcludeFromTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to exclude from the tap.
1884        /// All other processes that output audio will be included in the tap.
1885        #[unsafe(method(initStereoGlobalTapButExcludeProcesses:))]
1886        #[unsafe(method_family = init)]
1887        pub unsafe fn initStereoGlobalTapButExcludeProcesses(
1888            this: Allocated<Self>,
1889            processes_object_i_ds_to_exclude_from_tap: &NSArray<NSNumber>,
1890        ) -> Retained<Self>;
1891
1892        #[cfg(feature = "objc2-foundation")]
1893        /// Mix all given process audio streams audio to mono.
1894        ///
1895        /// Parameter `processesObjectIDsToIncludeInTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to include in the tap
1896        #[unsafe(method(initMonoMixdownOfProcesses:))]
1897        #[unsafe(method_family = init)]
1898        pub unsafe fn initMonoMixdownOfProcesses(
1899            this: Allocated<Self>,
1900            processes_object_i_ds_to_include_in_tap: &NSArray<NSNumber>,
1901        ) -> Retained<Self>;
1902
1903        #[cfg(feature = "objc2-foundation")]
1904        /// Mix all processes to a mono stream except the given processes
1905        ///
1906        /// Parameter `processesObjectIDsToExcludeFromTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to exclude from the tap.
1907        /// All other processes that output audio will be included in the tap.
1908        #[unsafe(method(initMonoGlobalTapButExcludeProcesses:))]
1909        #[unsafe(method_family = init)]
1910        pub unsafe fn initMonoGlobalTapButExcludeProcesses(
1911            this: Allocated<Self>,
1912            processes_object_i_ds_to_exclude_from_tap: &NSArray<NSNumber>,
1913        ) -> Retained<Self>;
1914
1915        #[cfg(feature = "objc2-foundation")]
1916        /// Mix all given process audio streams destined for the selected device stream
1917        ///
1918        /// Parameter `processesObjectIDsToIncludeInTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to exclude from the tap.
1919        /// All other processes that output audio will be included in the tap.
1920        ///
1921        /// Parameter `deviceUID`: The device UID of the output device whose audio will be captured
1922        ///
1923        /// Parameter `stream`: NSInteger that represents the index of the stream on the device whose audio will be captured. The format of the tap
1924        /// will match the format of this stream.
1925        #[unsafe(method(initWithProcesses:andDeviceUID:withStream:))]
1926        #[unsafe(method_family = init)]
1927        pub unsafe fn initWithProcesses_andDeviceUID_withStream(
1928            this: Allocated<Self>,
1929            processes_object_i_ds_to_include_in_tap: &NSArray<NSNumber>,
1930            device_uid: &NSString,
1931            stream: NSInteger,
1932        ) -> Retained<Self>;
1933
1934        #[cfg(feature = "objc2-foundation")]
1935        /// Mix all process audio streams destined for the selected device stream except the given processes
1936        ///
1937        /// Parameter `processesObjectIDsToExcludeFromTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to exclude from the tap.
1938        /// All other processes that output audio will be included in the tap.
1939        ///
1940        /// Parameter `deviceUID`: The device UID of the output device whose audio will be captured
1941        ///
1942        /// Parameter `stream`: NSInteger that represents the index of the stream on the device whose audio will be captured. The format of the tap
1943        /// will match the format of this stream.
1944        #[unsafe(method(initExcludingProcesses:andDeviceUID:withStream:))]
1945        #[unsafe(method_family = init)]
1946        pub unsafe fn initExcludingProcesses_andDeviceUID_withStream(
1947            this: Allocated<Self>,
1948            processes_object_i_ds_to_exclude_from_tap: &NSArray<NSNumber>,
1949            device_uid: &NSString,
1950            stream: NSInteger,
1951        ) -> Retained<Self>;
1952
1953        #[cfg(feature = "objc2-foundation")]
1954        /// Human readable name of this tap.
1955        #[unsafe(method(name))]
1956        #[unsafe(method_family = none)]
1957        pub unsafe fn name(&self) -> Retained<NSString>;
1958
1959        #[cfg(feature = "objc2-foundation")]
1960        /// Setter for [`name`][Self::name].
1961        ///
1962        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1963        #[unsafe(method(setName:))]
1964        #[unsafe(method_family = none)]
1965        pub unsafe fn setName(&self, name: &NSString);
1966
1967        #[cfg(feature = "objc2-foundation")]
1968        /// UID of this tap.
1969        #[unsafe(method(UUID))]
1970        #[unsafe(method_family = none)]
1971        pub unsafe fn UUID(&self) -> Retained<NSUUID>;
1972
1973        #[cfg(feature = "objc2-foundation")]
1974        /// Setter for [`UUID`][Self::UUID].
1975        ///
1976        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1977        #[unsafe(method(setUUID:))]
1978        #[unsafe(method_family = none)]
1979        pub unsafe fn setUUID(&self, uuid: &NSUUID);
1980
1981        #[cfg(feature = "objc2-foundation")]
1982        /// An NSArray of NSNumbers where each NSNumber holds the AudioObjectID of a process object to tap or exclude.
1983        #[unsafe(method(processes))]
1984        #[unsafe(method_family = none)]
1985        pub unsafe fn processes(&self) -> Retained<NSArray<NSNumber>>;
1986
1987        #[cfg(feature = "objc2-foundation")]
1988        /// Setter for [`processes`][Self::processes].
1989        ///
1990        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1991        #[unsafe(method(setProcesses:))]
1992        #[unsafe(method_family = none)]
1993        pub unsafe fn setProcesses(&self, processes: &NSArray<NSNumber>);
1994
1995        #[cfg(feature = "objc2-foundation")]
1996        /// An Array of Strings where each String holds the bundle ID of a process to tap or exclude.
1997        #[unsafe(method(bundleIDs))]
1998        #[unsafe(method_family = none)]
1999        pub unsafe fn bundleIDs(&self) -> Retained<NSArray<NSString>>;
2000
2001        #[cfg(feature = "objc2-foundation")]
2002        /// Setter for [`bundleIDs`][Self::bundleIDs].
2003        ///
2004        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
2005        #[unsafe(method(setBundleIDs:))]
2006        #[unsafe(method_family = none)]
2007        pub unsafe fn setBundleIDs(&self, bundle_i_ds: &NSArray<NSString>);
2008
2009        /// True if this description is a mono mixdown of channels.
2010        #[unsafe(method(isMono))]
2011        #[unsafe(method_family = none)]
2012        pub unsafe fn isMono(&self) -> bool;
2013
2014        /// Setter for [`isMono`][Self::isMono].
2015        #[unsafe(method(setMono:))]
2016        #[unsafe(method_family = none)]
2017        pub unsafe fn setMono(&self, mono: bool);
2018
2019        /// True if this description should tap all processes except the process listed in the 'processes' property.
2020        #[unsafe(method(isExclusive))]
2021        #[unsafe(method_family = none)]
2022        pub unsafe fn isExclusive(&self) -> bool;
2023
2024        /// Setter for [`isExclusive`][Self::isExclusive].
2025        #[unsafe(method(setExclusive:))]
2026        #[unsafe(method_family = none)]
2027        pub unsafe fn setExclusive(&self, exclusive: bool);
2028
2029        /// True if this description is a mono or stereo mix of the tapped device's channels.
2030        #[unsafe(method(isMixdown))]
2031        #[unsafe(method_family = none)]
2032        pub unsafe fn isMixdown(&self) -> bool;
2033
2034        /// Setter for [`isMixdown`][Self::isMixdown].
2035        #[unsafe(method(setMixdown:))]
2036        #[unsafe(method_family = none)]
2037        pub unsafe fn setMixdown(&self, mixdown: bool);
2038
2039        /// True if this tap is only visible to the client process that created the tap.
2040        #[unsafe(method(isPrivate))]
2041        #[unsafe(method_family = none)]
2042        pub unsafe fn isPrivate(&self) -> bool;
2043
2044        /// Setter for [`isPrivate`][Self::isPrivate].
2045        #[unsafe(method(setPrivate:))]
2046        #[unsafe(method_family = none)]
2047        pub unsafe fn setPrivate(&self, private_tap: bool);
2048
2049        /// True if this tap should save tapped processes by bundle ID when they exit, and restore them to the tap when they start up again.
2050        #[unsafe(method(isProcessRestoreEnabled))]
2051        #[unsafe(method_family = none)]
2052        pub unsafe fn isProcessRestoreEnabled(&self) -> bool;
2053
2054        /// Setter for [`isProcessRestoreEnabled`][Self::isProcessRestoreEnabled].
2055        #[unsafe(method(setProcessRestoreEnabled:))]
2056        #[unsafe(method_family = none)]
2057        pub unsafe fn setProcessRestoreEnabled(&self, process_restore_enabled: bool);
2058
2059        /// Set the tap's mute behavior. See CATapMuteBehavior above.
2060        #[unsafe(method(isMuted))]
2061        #[unsafe(method_family = none)]
2062        pub unsafe fn isMuted(&self) -> CATapMuteBehavior;
2063
2064        /// Setter for [`isMuted`][Self::isMuted].
2065        #[unsafe(method(setMuteBehavior:))]
2066        #[unsafe(method_family = none)]
2067        pub unsafe fn setMuteBehavior(&self, mute_behavior: CATapMuteBehavior);
2068
2069        #[cfg(feature = "objc2-foundation")]
2070        /// An optional deviceUID that will have a value if this tap only taps a specific hardware device
2071        #[unsafe(method(deviceUID))]
2072        #[unsafe(method_family = none)]
2073        pub unsafe fn deviceUID(&self) -> Option<Retained<NSString>>;
2074
2075        #[cfg(feature = "objc2-foundation")]
2076        /// Setter for [`deviceUID`][Self::deviceUID].
2077        ///
2078        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
2079        #[unsafe(method(setDeviceUID:))]
2080        #[unsafe(method_family = none)]
2081        pub unsafe fn setDeviceUID(&self, device_uid: Option<&NSString>);
2082
2083        #[cfg(feature = "objc2-foundation")]
2084        /// An optional NSNumber that will have a value if this tap taps a specific device stream.
2085        /// The value represents the index of the hardware stream.
2086        #[unsafe(method(stream))]
2087        #[unsafe(method_family = none)]
2088        pub unsafe fn stream(&self) -> Option<Retained<NSNumber>>;
2089
2090        #[cfg(feature = "objc2-foundation")]
2091        /// Setter for [`stream`][Self::stream].
2092        ///
2093        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
2094        #[unsafe(method(setStream:))]
2095        #[unsafe(method_family = none)]
2096        pub unsafe fn setStream(&self, stream: Option<&NSNumber>);
2097    );
2098}
2099
2100/// Methods declared on superclass `NSObject`.
2101#[cfg(feature = "objc2")]
2102impl CATapDescription {
2103    extern_methods!(
2104        #[unsafe(method(new))]
2105        #[unsafe(method_family = new)]
2106        pub unsafe fn new() -> Retained<Self>;
2107    );
2108}