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#[inline]
711pub unsafe extern "C-unwind" fn AudioObjectHasProperty(
712 in_object_id: AudioObjectID,
713 in_address: NonNull<AudioObjectPropertyAddress>,
714) -> bool {
715 extern "C-unwind" {
716 fn AudioObjectHasProperty(
717 in_object_id: AudioObjectID,
718 in_address: NonNull<AudioObjectPropertyAddress>,
719 ) -> Boolean;
720 }
721 let ret = unsafe { AudioObjectHasProperty(in_object_id, in_address) };
722 ret != 0
723}
724
725extern "C-unwind" {
726 /// Queries an AudioObject about whether or not the given property can be set using
727 /// AudioObjectSetPropertyData.
728 ///
729 /// Parameter `inObjectID`: The AudioObject to query.
730 ///
731 /// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being queried.
732 ///
733 /// Parameter `outIsSettable`: A Boolean indicating whether or not the property can be set.
734 ///
735 /// Returns: An OSStatus indicating success or failure.
736 pub fn AudioObjectIsPropertySettable(
737 in_object_id: AudioObjectID,
738 in_address: NonNull<AudioObjectPropertyAddress>,
739 out_is_settable: NonNull<Boolean>,
740 ) -> OSStatus;
741}
742
743extern "C-unwind" {
744 /// Queries an AudioObject to find the size of the data for the given property.
745 ///
746 /// Parameter `inObjectID`: The AudioObject to query.
747 ///
748 /// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being queried.
749 ///
750 /// Parameter `inQualifierDataSize`: A UInt32 indicating the size of the buffer pointed to by inQualifierData.
751 /// Note that not all properties require qualification, in which case this
752 /// value will be 0.
753 ///
754 /// Parameter `inQualifierData`: A buffer of data to be used in determining the data of the property being
755 /// queried. Note that not all properties require qualification, in which case
756 /// this value will be NULL.
757 ///
758 /// Parameter `outDataSize`: A UInt32 indicating how many bytes the data for the given property occupies.
759 ///
760 /// Returns: An OSStatus indicating success or failure.
761 pub fn AudioObjectGetPropertyDataSize(
762 in_object_id: AudioObjectID,
763 in_address: NonNull<AudioObjectPropertyAddress>,
764 in_qualifier_data_size: u32,
765 in_qualifier_data: *const c_void,
766 out_data_size: NonNull<u32>,
767 ) -> OSStatus;
768}
769
770extern "C-unwind" {
771 /// Queries an AudioObject to get the data of the given property and places it in
772 /// the provided buffer.
773 ///
774 /// Parameter `inObjectID`: The AudioObject to query.
775 ///
776 /// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being queried.
777 ///
778 /// Parameter `inQualifierDataSize`: A UInt32 indicating the size of the buffer pointed to by inQualifierData.
779 /// Note that not all properties require qualification, in which case this
780 /// value will be 0.
781 ///
782 /// Parameter `inQualifierData`: A buffer of data to be used in determining the data of the property being
783 /// queried. Note that not all properties require qualification, in which case
784 /// this value will be NULL.
785 ///
786 /// Parameter `ioDataSize`: A UInt32 which on entry indicates the size of the buffer pointed to by
787 /// outData and on exit indicates how much of the buffer was used.
788 ///
789 /// Parameter `outData`: The buffer into which the AudioObject will put the data for the given
790 /// property.
791 ///
792 /// Returns: An OSStatus indicating success or failure.
793 pub fn AudioObjectGetPropertyData(
794 in_object_id: AudioObjectID,
795 in_address: NonNull<AudioObjectPropertyAddress>,
796 in_qualifier_data_size: u32,
797 in_qualifier_data: *const c_void,
798 io_data_size: NonNull<u32>,
799 out_data: NonNull<c_void>,
800 ) -> OSStatus;
801}
802
803extern "C-unwind" {
804 /// Tells an AudioObject to change the value of the given property using the
805 /// provided data.
806 ///
807 /// Note that the value of the property should not be considered changed until the
808 /// HAL has called the listeners as many properties values are changed
809 /// asynchronously.
810 ///
811 /// Parameter `inObjectID`: The AudioObject to change.
812 ///
813 /// Parameter `inAddress`: An AudioObjectPropertyAddress indicating which property is being changed.
814 ///
815 /// Parameter `inQualifierDataSize`: A UInt32 indicating the size of the buffer pointed to by inQualifierData.
816 /// Note that not all properties require qualification, in which case this
817 /// value will be 0.
818 ///
819 /// Parameter `inQualifierData`: A buffer of data to be used in determining the data of the property being
820 /// queried. Note that not all properties require qualification, in which case
821 /// this value will be NULL.
822 ///
823 /// Parameter `inDataSize`: A UInt32 indicating the size of the buffer pointed to by inData.
824 ///
825 /// Parameter `inData`: The buffer containing the data to be used to change the property's value.
826 ///
827 /// Returns: An OSStatus indicating success or failure.
828 pub fn AudioObjectSetPropertyData(
829 in_object_id: AudioObjectID,
830 in_address: NonNull<AudioObjectPropertyAddress>,
831 in_qualifier_data_size: u32,
832 in_qualifier_data: *const c_void,
833 in_data_size: u32,
834 in_data: NonNull<c_void>,
835 ) -> OSStatus;
836}
837
838extern "C-unwind" {
839 /// Registers the given AudioObjectPropertyListenerProc to receive notifications
840 /// when the given properties change.
841 ///
842 /// Parameter `inObjectID`: The AudioObject to register the listener with.
843 ///
844 /// Parameter `inAddress`: The AudioObjectPropertyAddresses indicating which property the listener
845 /// should be notified about.
846 ///
847 /// Parameter `inListener`: The AudioObjectPropertyListenerProc to call.
848 ///
849 /// Parameter `inClientData`: A pointer to client data that is passed to the listener when it is called.
850 ///
851 /// Returns: An OSStatus indicating success or failure.
852 pub fn AudioObjectAddPropertyListener(
853 in_object_id: AudioObjectID,
854 in_address: NonNull<AudioObjectPropertyAddress>,
855 in_listener: AudioObjectPropertyListenerProc,
856 in_client_data: *mut c_void,
857 ) -> OSStatus;
858}
859
860extern "C-unwind" {
861 /// Unregisters the given AudioObjectPropertyListenerProc from receiving
862 /// notifications when the given properties change.
863 ///
864 /// Parameter `inObjectID`: The AudioObject to unregister the listener from.
865 ///
866 /// Parameter `inAddress`: The AudioObjectPropertyAddress indicating from which property the listener
867 /// should be removed.
868 ///
869 /// Parameter `inListener`: The AudioObjectPropertyListenerProc being removed.
870 ///
871 /// Parameter `inClientData`: A pointer to client data that is passed to the listener when it is called.
872 ///
873 /// Returns: An OSStatus indicating success or failure.
874 pub fn AudioObjectRemovePropertyListener(
875 in_object_id: AudioObjectID,
876 in_address: NonNull<AudioObjectPropertyAddress>,
877 in_listener: AudioObjectPropertyListenerProc,
878 in_client_data: *mut c_void,
879 ) -> OSStatus;
880}
881
882extern "C-unwind" {
883 /// Registers the given AudioObjectPropertyListenerBlock to receive notifications
884 /// when the given properties change.
885 ///
886 /// Parameter `inObjectID`: The AudioObject to register the listener with.
887 ///
888 /// Parameter `inAddress`: The AudioObjectPropertyAddresses indicating which property the listener
889 /// should be notified about.
890 ///
891 /// Parameter `inDispatchQueue`: The dispatch queue on which the listener block will be dispatched. All
892 /// listener blocks will be dispatched asynchronously save for those dispatched
893 /// from the IO context (of which kAudioDevicePropertyDeviceIsRunning and
894 /// kAudioDeviceProcessorOverload are the only examples) which will be
895 /// dispatched synchronously. Note that this dispatch queue will be retained
896 /// until a matching call to AudioObjectRemovePropertyListenerBlock is made. If
897 /// this value is NULL, then the block will be directly invoked.
898 ///
899 /// Parameter `inListener`: The AudioObjectPropertyListenerBlock to call. Note that this block will be
900 /// Block_copy'd and the reference maintained until a matching call to
901 /// AudioObjectRemovePropertyListenerBlock is made.
902 ///
903 /// Returns: An OSStatus indicating success or failure.
904 #[cfg(all(feature = "block2", feature = "dispatch2"))]
905 pub fn AudioObjectAddPropertyListenerBlock(
906 in_object_id: AudioObjectID,
907 in_address: NonNull<AudioObjectPropertyAddress>,
908 in_dispatch_queue: Option<&DispatchQueue>,
909 in_listener: AudioObjectPropertyListenerBlock,
910 ) -> OSStatus;
911}
912
913extern "C-unwind" {
914 /// Unregisters the given AudioObjectPropertyListenerBlock from receiving
915 /// notifications when the given properties change.
916 ///
917 /// Parameter `inObjectID`: The AudioObject to unregister the listener from.
918 ///
919 /// Parameter `inAddress`: The AudioObjectPropertyAddress indicating from which property the listener
920 /// should be removed.
921 ///
922 /// Parameter `inDispatchQueue`: The dispatch queue on which the listener block was being dispatched to.
923 ///
924 /// Parameter `inListener`: The AudioObjectPropertyListenerBlock being removed.
925 ///
926 /// Returns: An OSStatus indicating success or failure.
927 #[cfg(all(feature = "block2", feature = "dispatch2"))]
928 pub fn AudioObjectRemovePropertyListenerBlock(
929 in_object_id: AudioObjectID,
930 in_address: NonNull<AudioObjectPropertyAddress>,
931 in_dispatch_queue: Option<&DispatchQueue>,
932 in_listener: AudioObjectPropertyListenerBlock,
933 ) -> OSStatus;
934}
935
936/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosystemobjectclassid?language=objc)
937pub const kAudioSystemObjectClassID: AudioClassID = 0x61737973;
938
939/// The values for kAudioHardwarePropertyPowerHint
940///
941/// The system object property, kAudioHardwarePropertyPowerHint, allows a process to
942/// to indicate how aggressive the system can be with optimizations that save power.
943/// Note that the value of this property can be set in an application's info.plist
944/// using the key, "AudioHardwarePowerHint". The values for this key are the strings
945/// that correspond to the values in the enum.
946///
947/// This is the default value and it indicates that the system will not make any
948/// power optimizations that compromise latency or quality in order to save
949/// power. The info.plist value is "None" or the "AudioHardwarePowerHint" entry
950/// can be omitted entirely.
951///
952/// The system will choose to save power even at the expense of latency. The
953/// info.plist value is "Favor Saving Power"
954///
955/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiohardwarepowerhint?language=objc)
956// NS_ENUM
957#[repr(transparent)]
958#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
959pub struct AudioHardwarePowerHint(pub u32);
960impl AudioHardwarePowerHint {
961 #[doc(alias = "kAudioHardwarePowerHintNone")]
962 pub const None: Self = Self(0);
963 #[doc(alias = "kAudioHardwarePowerHintFavorSavingPower")]
964 pub const FavorSavingPower: Self = Self(1);
965}
966
967#[cfg(feature = "objc2")]
968unsafe impl Encode for AudioHardwarePowerHint {
969 const ENCODING: Encoding = u32::ENCODING;
970}
971
972#[cfg(feature = "objc2")]
973unsafe impl RefEncode for AudioHardwarePowerHint {
974 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
975}
976
977/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydevices?language=objc)
978pub const kAudioHardwarePropertyDevices: AudioObjectPropertySelector = 0x64657623;
979/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydefaultinputdevice?language=objc)
980pub const kAudioHardwarePropertyDefaultInputDevice: AudioObjectPropertySelector = 0x64496e20;
981/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydefaultoutputdevice?language=objc)
982pub const kAudioHardwarePropertyDefaultOutputDevice: AudioObjectPropertySelector = 0x644f7574;
983/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertydefaultsystemoutputdevice?language=objc)
984pub const kAudioHardwarePropertyDefaultSystemOutputDevice: AudioObjectPropertySelector = 0x734f7574;
985/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslateuidtodevice?language=objc)
986pub const kAudioHardwarePropertyTranslateUIDToDevice: AudioObjectPropertySelector = 0x75696464;
987/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertymixstereotomono?language=objc)
988pub const kAudioHardwarePropertyMixStereoToMono: AudioObjectPropertySelector = 0x73746d6f;
989/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertypluginlist?language=objc)
990pub const kAudioHardwarePropertyPlugInList: AudioObjectPropertySelector = 0x706c6723;
991/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslatebundleidtoplugin?language=objc)
992pub const kAudioHardwarePropertyTranslateBundleIDToPlugIn: AudioObjectPropertySelector = 0x62696470;
993/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytransportmanagerlist?language=objc)
994pub const kAudioHardwarePropertyTransportManagerList: AudioObjectPropertySelector = 0x746d6723;
995/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslatebundleidtotransportmanager?language=objc)
996pub const kAudioHardwarePropertyTranslateBundleIDToTransportManager: AudioObjectPropertySelector =
997 0x746d6269;
998/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyboxlist?language=objc)
999pub const kAudioHardwarePropertyBoxList: AudioObjectPropertySelector = 0x626f7823;
1000/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslateuidtobox?language=objc)
1001pub const kAudioHardwarePropertyTranslateUIDToBox: AudioObjectPropertySelector = 0x75696462;
1002/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyclockdevicelist?language=objc)
1003pub const kAudioHardwarePropertyClockDeviceList: AudioObjectPropertySelector = 0x636c6b23;
1004/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslateuidtoclockdevice?language=objc)
1005pub const kAudioHardwarePropertyTranslateUIDToClockDevice: AudioObjectPropertySelector = 0x75696463;
1006/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessismain?language=objc)
1007pub const kAudioHardwarePropertyProcessIsMain: AudioObjectPropertySelector = 0x6d61696e;
1008/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyisinitingorexiting?language=objc)
1009pub const kAudioHardwarePropertyIsInitingOrExiting: AudioObjectPropertySelector = 0x696e6f74;
1010/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyuseridchanged?language=objc)
1011pub const kAudioHardwarePropertyUserIDChanged: AudioObjectPropertySelector = 0x65756964;
1012/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessinputmute?language=objc)
1013pub const kAudioHardwarePropertyProcessInputMute: AudioObjectPropertySelector = 0x706d696e;
1014/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessisaudible?language=objc)
1015pub const kAudioHardwarePropertyProcessIsAudible: AudioObjectPropertySelector = 0x706d7574;
1016/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertysleepingisallowed?language=objc)
1017pub const kAudioHardwarePropertySleepingIsAllowed: AudioObjectPropertySelector = 0x736c6570;
1018/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyunloadingisallowed?language=objc)
1019pub const kAudioHardwarePropertyUnloadingIsAllowed: AudioObjectPropertySelector = 0x756e6c64;
1020/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyhogmodeisallowed?language=objc)
1021pub const kAudioHardwarePropertyHogModeIsAllowed: AudioObjectPropertySelector = 0x686f6772;
1022/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyusersessionisactiveorheadless?language=objc)
1023pub const kAudioHardwarePropertyUserSessionIsActiveOrHeadless: AudioObjectPropertySelector =
1024 0x75736572;
1025/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyservicerestarted?language=objc)
1026pub const kAudioHardwarePropertyServiceRestarted: AudioObjectPropertySelector = 0x73727374;
1027/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertypowerhint?language=objc)
1028pub const kAudioHardwarePropertyPowerHint: AudioObjectPropertySelector = 0x706f7768;
1029/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertyprocessobjectlist?language=objc)
1030pub const kAudioHardwarePropertyProcessObjectList: AudioObjectPropertySelector = 0x70727323;
1031/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslatepidtoprocessobject?language=objc)
1032pub const kAudioHardwarePropertyTranslatePIDToProcessObject: AudioObjectPropertySelector =
1033 0x69643270;
1034/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytaplist?language=objc)
1035pub const kAudioHardwarePropertyTapList: AudioObjectPropertySelector = 0x74707323;
1036/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiohardwarepropertytranslateuidtotap?language=objc)
1037pub const kAudioHardwarePropertyTranslateUIDToTap: AudioObjectPropertySelector = 0x75696474;
1038
1039extern "C-unwind" {
1040 /// When this routine is called, all IO on all devices within a process will be
1041 /// terminated and all resources capable of being released will be released. This
1042 /// routine essentially returns the HAL to its uninitialized state.
1043 ///
1044 /// Returns: An OSStatus indicating success or failure.
1045 pub fn AudioHardwareUnload() -> OSStatus;
1046}
1047
1048extern "C-unwind" {
1049 /// This routine creates a new AudioAggregateDevice using the provided description.
1050 ///
1051 /// Parameter `inDescription`: The CFDictionary that specifies how to build the AudioAggregateDevice. The
1052 /// supported keys are described in the AudioAggregateDevice Constants section.
1053 ///
1054 /// Parameter `outDeviceID`: The AudioObjectID of the newly created AudioAggregateDevice.
1055 ///
1056 /// Returns: An OSStatus indicating success or failure.
1057 pub fn AudioHardwareCreateAggregateDevice(
1058 in_description: &CFDictionary,
1059 out_device_id: NonNull<AudioObjectID>,
1060 ) -> OSStatus;
1061}
1062
1063extern "C-unwind" {
1064 /// This routine destroys the given AudioAggregateDevice.
1065 ///
1066 /// The actual destruction of the device is asynchronous and may take place after
1067 /// the call to this routine has returned.
1068 ///
1069 /// Parameter `inDeviceID`: The AudioObjectID of the AudioAggregateDevice to destroy.
1070 ///
1071 /// Returns: An OSStatus indicating success or failure.
1072 pub fn AudioHardwareDestroyAggregateDevice(in_device_id: AudioObjectID) -> OSStatus;
1073}
1074
1075/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioplugincreateaggregatedevice?language=objc)
1076pub const kAudioPlugInCreateAggregateDevice: AudioObjectPropertySelector = 0x63616767;
1077/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioplugindestroyaggregatedevice?language=objc)
1078pub const kAudioPlugInDestroyAggregateDevice: AudioObjectPropertySelector = 0x64616767;
1079
1080/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotransportmanagercreateendpointdevice?language=objc)
1081pub const kAudioTransportManagerCreateEndPointDevice: AudioObjectPropertySelector = 0x63646576;
1082/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotransportmanagerdestroyendpointdevice?language=objc)
1083pub const kAudioTransportManagerDestroyEndPointDevice: AudioObjectPropertySelector = 0x64646576;
1084
1085/// An AudioDeviceIOProc is called by an AudioDevice to provide input data read from
1086/// the device and collect output data to be written to the device for the current
1087/// IO cycle.
1088///
1089/// Parameter `inDevice`: The AudioDevice doing the IO.
1090///
1091/// Parameter `inNow`: An AudioTimeStamp that indicates the IO cycle started. Note that this time
1092/// includes any scheduling latency that may have been incurred waking the
1093/// thread on which IO is being done.
1094///
1095/// Parameter `inInputData`: An AudioBufferList containing the input data for the current IO cycle. For
1096/// streams that are disabled, the AudioBuffer's mData field will be NULL but
1097/// the mDataByteSize field will still say how much data would have been there
1098/// if it was enabled. Note that the contents of this structure should never be
1099/// modified.
1100///
1101/// Parameter `inInputTime`: An AudioTimeStamp that indicates the time at which the first frame in the
1102/// data was acquired from the hardware. If the device has no input streams, the
1103/// time stamp will be zeroed out.
1104///
1105/// Parameter `outOutputData`: An AudioBufferList in which the output data for the current IO cycle is to
1106/// be placed. On entry, each AudioBuffer's mDataByteSize field indicates the
1107/// maximum amount of data that can be placed in the buffer and the buffer's
1108/// memory has been zeroed out. For formats where the number of bytes per packet
1109/// can vary (as with AC-3, for example), the client has to fill out on exit
1110/// each mDataByteSize field in each AudioBuffer with the amount of data that
1111/// was put in the buffer. Otherwise, the mDataByteSize field should not be
1112/// changed. For streams that are disabled, the AudioBuffer's mData field will
1113/// be NULL but the mDataByteSize field will still say how much data would have
1114/// been there if it was enabled. Except as noted above, the contents of this
1115/// structure should not other wise be modified.
1116///
1117/// Parameter `inOutputTime`: An AudioTimeStamp that indicates the time at which the first frame in the
1118/// data will be passed to the hardware. If the device has no output streams,
1119/// the time stamp will be zeroed out.
1120///
1121/// Parameter `inClientData`: A pointer to client data established when the AudioDeviceIOProc was
1122/// registered with the AudioDevice.
1123///
1124/// Returns: The return value is currently unused and should always be 0.
1125///
1126/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodeviceioproc?language=objc)
1127#[cfg(feature = "objc2-core-audio-types")]
1128pub type AudioDeviceIOProc = Option<
1129 unsafe extern "C-unwind" fn(
1130 AudioObjectID,
1131 NonNull<AudioTimeStamp>,
1132 NonNull<AudioBufferList>,
1133 NonNull<AudioTimeStamp>,
1134 NonNull<AudioBufferList>,
1135 NonNull<AudioTimeStamp>,
1136 *mut c_void,
1137 ) -> OSStatus,
1138>;
1139
1140/// An AudioDeviceIOBlock is called by an AudioDevice to provide input data read
1141/// from the device and collect output data to be written to the device for the
1142/// current IO cycle.
1143///
1144/// Parameter `inNow`: An AudioTimeStamp that indicates the IO cycle started. Note that this time
1145/// includes any scheduling latency that may have been incurred waking the
1146/// thread on which IO is being done.
1147///
1148/// Parameter `inInputData`: An AudioBufferList containing the input data for the current IO cycle. For
1149/// streams that are disabled, the AudioBuffer's mData field will be NULL but
1150/// the mDataByteSize field will still say how much data would have been there
1151/// if it was enabled. Note that the contents of this structure should never be
1152/// modified.
1153///
1154/// Parameter `inInputTime`: An AudioTimeStamp that indicates the time at which the first frame in the
1155/// data was acquired from the hardware. If the device has no input streams, the
1156/// time stamp will be zeroed out.
1157///
1158/// Parameter `outOutputData`: An AudioBufferList in which the output data for the current IO cycle is to
1159/// be placed. On entry, each AudioBuffer's mDataByteSize field indicates the
1160/// maximum amount of data that can be placed in the buffer and the buffer's
1161/// memory has been zeroed out. For formats where the number of bytes per packet
1162/// can vary (as with AC-3, for example), the client has to fill out on exit
1163/// each mDataByteSize field in each AudioBuffer with the amount of data that
1164/// was put in the buffer. Otherwise, the mDataByteSize field should not be
1165/// changed. For streams that are disabled, the AudioBuffer's mData field will
1166/// be NULL but the mDataByteSize field will still say how much data would have
1167/// been there if it was enabled. Except as noted above, the contents of this
1168/// structure should not other wise be modified.
1169///
1170/// Parameter `inOutputTime`: An AudioTimeStamp that indicates the time at which the first frame in the
1171/// data will be passed to the hardware. If the device has no output streams,
1172/// the time stamp will be zeroed out.
1173///
1174/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodeviceioblock?language=objc)
1175#[cfg(all(feature = "block2", feature = "objc2-core-audio-types"))]
1176pub type AudioDeviceIOBlock = *mut block2::DynBlock<
1177 dyn Fn(
1178 NonNull<AudioTimeStamp>,
1179 NonNull<AudioBufferList>,
1180 NonNull<AudioTimeStamp>,
1181 NonNull<AudioBufferList>,
1182 NonNull<AudioTimeStamp>,
1183 ),
1184>;
1185
1186/// An AudioDeviceIOProcID represents both an IOProc and the client data that goes
1187/// with it. Once created, an AudioDeviceIOProcID can be used everywhere one would
1188/// use a regular IOProc. The purpose for an AudioDeviceIOProcID is to allow a
1189/// client to register the same function pointer as an IOProc with a device multiple
1190/// times provided
1191///
1192/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodeviceioprocid?language=objc)
1193#[cfg(feature = "objc2-core-audio-types")]
1194pub type AudioDeviceIOProcID = AudioDeviceIOProc;
1195
1196/// This structure describes which streams a given AudioDeviceIOProc will use. It is
1197/// used in conjunction with kAudioDevicePropertyIOProcStreamUsage.
1198/// Field: mIOProc
1199/// The IOProc whose stream usage is being specified.
1200/// Field: mNumberStreams
1201/// The number of streams being specified.
1202/// Field: mStreamIsOn
1203/// An array of UInt32's whose length is specified by mNumberStreams. Each
1204/// element of the array corresponds to a stream. A value of 0 means the stream
1205/// is not to be enabled. Any other value means the stream is to be used.
1206///
1207/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiohardwareioprocstreamusage?language=objc)
1208#[repr(C)]
1209#[derive(Clone, Copy, Debug, PartialEq)]
1210pub struct AudioHardwareIOProcStreamUsage {
1211 pub mIOProc: NonNull<c_void>,
1212 pub mNumberStreams: u32,
1213 pub mStreamIsOn: [u32; 1],
1214}
1215
1216#[cfg(feature = "objc2")]
1217unsafe impl Encode for AudioHardwareIOProcStreamUsage {
1218 const ENCODING: Encoding = Encoding::Struct(
1219 "AudioHardwareIOProcStreamUsage",
1220 &[
1221 <NonNull<c_void>>::ENCODING,
1222 <u32>::ENCODING,
1223 <[u32; 1]>::ENCODING,
1224 ],
1225 );
1226}
1227
1228#[cfg(feature = "objc2")]
1229unsafe impl RefEncode for AudioHardwareIOProcStreamUsage {
1230 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1231}
1232
1233/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicestarttimeisinputflag?language=objc)
1234pub const kAudioDeviceStartTimeIsInputFlag: u32 = 1 << 0;
1235/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicestarttimedontconsultdeviceflag?language=objc)
1236pub const kAudioDeviceStartTimeDontConsultDeviceFlag: u32 = 1 << 1;
1237/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicestarttimedontconsulthalflag?language=objc)
1238pub const kAudioDeviceStartTimeDontConsultHALFlag: u32 = 1 << 2;
1239
1240/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplugin?language=objc)
1241pub const kAudioDevicePropertyPlugIn: AudioObjectPropertySelector = 0x706c7567;
1242/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydevicehaschanged?language=objc)
1243pub const kAudioDevicePropertyDeviceHasChanged: AudioObjectPropertySelector = 0x64696666;
1244/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydeviceisrunningsomewhere?language=objc)
1245pub const kAudioDevicePropertyDeviceIsRunningSomewhere: AudioObjectPropertySelector = 0x676f6e65;
1246/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodeviceprocessoroverload?language=objc)
1247pub const kAudioDeviceProcessorOverload: AudioObjectPropertySelector = 0x6f766572;
1248/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyiostoppedabnormally?language=objc)
1249pub const kAudioDevicePropertyIOStoppedAbnormally: AudioObjectPropertySelector = 0x73747064;
1250/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhogmode?language=objc)
1251pub const kAudioDevicePropertyHogMode: AudioObjectPropertySelector = 0x6f696e6b;
1252/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertybufferframesize?language=objc)
1253pub const kAudioDevicePropertyBufferFrameSize: AudioObjectPropertySelector = 0x6673697a;
1254/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertybufferframesizerange?language=objc)
1255pub const kAudioDevicePropertyBufferFrameSizeRange: AudioObjectPropertySelector = 0x66737a23;
1256/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyusesvariablebufferframesizes?language=objc)
1257pub const kAudioDevicePropertyUsesVariableBufferFrameSizes: AudioObjectPropertySelector =
1258 0x7666737a;
1259/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyiocycleusage?language=objc)
1260pub const kAudioDevicePropertyIOCycleUsage: AudioObjectPropertySelector = 0x6e637963;
1261/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystreamconfiguration?language=objc)
1262pub const kAudioDevicePropertyStreamConfiguration: AudioObjectPropertySelector = 0x736c6179;
1263/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyioprocstreamusage?language=objc)
1264pub const kAudioDevicePropertyIOProcStreamUsage: AudioObjectPropertySelector = 0x73757365;
1265/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyactualsamplerate?language=objc)
1266pub const kAudioDevicePropertyActualSampleRate: AudioObjectPropertySelector = 0x61737274;
1267/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclockdevice?language=objc)
1268pub const kAudioDevicePropertyClockDevice: AudioObjectPropertySelector = 0x61706364;
1269/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyiothreadosworkgroup?language=objc)
1270pub const kAudioDevicePropertyIOThreadOSWorkgroup: AudioObjectPropertySelector = 0x6f737767;
1271/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyprocessmute?language=objc)
1272pub const kAudioDevicePropertyProcessMute: AudioObjectPropertySelector = 0x6170706d;
1273
1274/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyjackisconnected?language=objc)
1275pub const kAudioDevicePropertyJackIsConnected: AudioObjectPropertySelector = 0x6a61636b;
1276/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumescalar?language=objc)
1277pub const kAudioDevicePropertyVolumeScalar: AudioObjectPropertySelector = 0x766f6c6d;
1278/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumedecibels?language=objc)
1279pub const kAudioDevicePropertyVolumeDecibels: AudioObjectPropertySelector = 0x766f6c64;
1280/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumerangedecibels?language=objc)
1281pub const kAudioDevicePropertyVolumeRangeDecibels: AudioObjectPropertySelector = 0x76646223;
1282/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumescalartodecibels?language=objc)
1283pub const kAudioDevicePropertyVolumeScalarToDecibels: AudioObjectPropertySelector = 0x76326462;
1284/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvolumedecibelstoscalar?language=objc)
1285pub const kAudioDevicePropertyVolumeDecibelsToScalar: AudioObjectPropertySelector = 0x64623276;
1286/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystereopan?language=objc)
1287pub const kAudioDevicePropertyStereoPan: AudioObjectPropertySelector = 0x7370616e;
1288/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertystereopanchannels?language=objc)
1289pub const kAudioDevicePropertyStereoPanChannels: AudioObjectPropertySelector = 0x73706e23;
1290/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertymute?language=objc)
1291pub const kAudioDevicePropertyMute: AudioObjectPropertySelector = 0x6d757465;
1292/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysolo?language=objc)
1293pub const kAudioDevicePropertySolo: AudioObjectPropertySelector = 0x736f6c6f;
1294/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyphantompower?language=objc)
1295pub const kAudioDevicePropertyPhantomPower: AudioObjectPropertySelector = 0x7068616e;
1296/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyphaseinvert?language=objc)
1297pub const kAudioDevicePropertyPhaseInvert: AudioObjectPropertySelector = 0x70687369;
1298/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertycliplight?language=objc)
1299pub const kAudioDevicePropertyClipLight: AudioObjectPropertySelector = 0x636c6970;
1300/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertytalkback?language=objc)
1301pub const kAudioDevicePropertyTalkback: AudioObjectPropertySelector = 0x74616c62;
1302/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertylistenback?language=objc)
1303pub const kAudioDevicePropertyListenback: AudioObjectPropertySelector = 0x6c736e62;
1304/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasource?language=objc)
1305pub const kAudioDevicePropertyDataSource: AudioObjectPropertySelector = 0x73737263;
1306/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasources?language=objc)
1307pub const kAudioDevicePropertyDataSources: AudioObjectPropertySelector = 0x73736323;
1308/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasourcenameforidcfstring?language=objc)
1309pub const kAudioDevicePropertyDataSourceNameForIDCFString: AudioObjectPropertySelector = 0x6c73636e;
1310/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertydatasourcekindforid?language=objc)
1311pub const kAudioDevicePropertyDataSourceKindForID: AudioObjectPropertySelector = 0x7373636b;
1312/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksource?language=objc)
1313pub const kAudioDevicePropertyClockSource: AudioObjectPropertySelector = 0x63737263;
1314/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksources?language=objc)
1315pub const kAudioDevicePropertyClockSources: AudioObjectPropertySelector = 0x63736323;
1316/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksourcenameforidcfstring?language=objc)
1317pub const kAudioDevicePropertyClockSourceNameForIDCFString: AudioObjectPropertySelector =
1318 0x6c63736e;
1319/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclocksourcekindforid?language=objc)
1320pub const kAudioDevicePropertyClockSourceKindForID: AudioObjectPropertySelector = 0x6373636b;
1321/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythru?language=objc)
1322pub const kAudioDevicePropertyPlayThru: AudioObjectPropertySelector = 0x74687275;
1323/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrusolo?language=objc)
1324pub const kAudioDevicePropertyPlayThruSolo: AudioObjectPropertySelector = 0x74687273;
1325/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumescalar?language=objc)
1326pub const kAudioDevicePropertyPlayThruVolumeScalar: AudioObjectPropertySelector = 0x6d767363;
1327/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumedecibels?language=objc)
1328pub const kAudioDevicePropertyPlayThruVolumeDecibels: AudioObjectPropertySelector = 0x6d766462;
1329/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumerangedecibels?language=objc)
1330pub const kAudioDevicePropertyPlayThruVolumeRangeDecibels: AudioObjectPropertySelector = 0x6d766423;
1331/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumescalartodecibels?language=objc)
1332pub const kAudioDevicePropertyPlayThruVolumeScalarToDecibels: AudioObjectPropertySelector =
1333 0x6d763264;
1334/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythruvolumedecibelstoscalar?language=objc)
1335pub const kAudioDevicePropertyPlayThruVolumeDecibelsToScalar: AudioObjectPropertySelector =
1336 0x6d763273;
1337/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrustereopan?language=objc)
1338pub const kAudioDevicePropertyPlayThruStereoPan: AudioObjectPropertySelector = 0x6d73706e;
1339/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrustereopanchannels?language=objc)
1340pub const kAudioDevicePropertyPlayThruStereoPanChannels: AudioObjectPropertySelector = 0x6d737023;
1341/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrudestination?language=objc)
1342pub const kAudioDevicePropertyPlayThruDestination: AudioObjectPropertySelector = 0x6d646473;
1343/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrudestinations?language=objc)
1344pub const kAudioDevicePropertyPlayThruDestinations: AudioObjectPropertySelector = 0x6d646423;
1345/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyplaythrudestinationnameforidcfstring?language=objc)
1346pub const kAudioDevicePropertyPlayThruDestinationNameForIDCFString: AudioObjectPropertySelector =
1347 0x6d646463;
1348/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnominallinelevel?language=objc)
1349pub const kAudioDevicePropertyChannelNominalLineLevel: AudioObjectPropertySelector = 0x6e6c766c;
1350/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnominallinelevels?language=objc)
1351pub const kAudioDevicePropertyChannelNominalLineLevels: AudioObjectPropertySelector = 0x6e6c7623;
1352/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertychannelnominallinelevelnameforidcfstring?language=objc)
1353pub const kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString:
1354 AudioObjectPropertySelector = 0x6c636e6c;
1355/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhighpassfiltersetting?language=objc)
1356pub const kAudioDevicePropertyHighPassFilterSetting: AudioObjectPropertySelector = 0x68697066;
1357/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhighpassfiltersettings?language=objc)
1358pub const kAudioDevicePropertyHighPassFilterSettings: AudioObjectPropertySelector = 0x68697023;
1359/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyhighpassfiltersettingnameforidcfstring?language=objc)
1360pub const kAudioDevicePropertyHighPassFilterSettingNameForIDCFString: AudioObjectPropertySelector =
1361 0x6869706c;
1362/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumescalar?language=objc)
1363pub const kAudioDevicePropertySubVolumeScalar: AudioObjectPropertySelector = 0x73766c6d;
1364/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumedecibels?language=objc)
1365pub const kAudioDevicePropertySubVolumeDecibels: AudioObjectPropertySelector = 0x73766c64;
1366/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumerangedecibels?language=objc)
1367pub const kAudioDevicePropertySubVolumeRangeDecibels: AudioObjectPropertySelector = 0x73766423;
1368/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumescalartodecibels?language=objc)
1369pub const kAudioDevicePropertySubVolumeScalarToDecibels: AudioObjectPropertySelector = 0x73763264;
1370/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubvolumedecibelstoscalar?language=objc)
1371pub const kAudioDevicePropertySubVolumeDecibelsToScalar: AudioObjectPropertySelector = 0x73643276;
1372/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertysubmute?language=objc)
1373pub const kAudioDevicePropertySubMute: AudioObjectPropertySelector = 0x736d7574;
1374/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvoiceactivitydetectionenable?language=objc)
1375pub const kAudioDevicePropertyVoiceActivityDetectionEnable: AudioObjectPropertySelector =
1376 0x7641642b;
1377/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyvoiceactivitydetectionstate?language=objc)
1378pub const kAudioDevicePropertyVoiceActivityDetectionState: AudioObjectPropertySelector = 0x76416453;
1379
1380extern "C-unwind" {
1381 /// Creates an AudioDeviceIOProcID from an AudioDeviceIOProc and a client data
1382 /// pointer.
1383 ///
1384 /// AudioDeviceIOProcIDs allow for the client to register the same function pointer
1385 /// with a device multiple times
1386 ///
1387 /// Parameter `inDevice`: The AudioDevice to register the IOProc with.
1388 ///
1389 /// Parameter `inProc`: The AudioDeviceIOProc to register.
1390 ///
1391 /// Parameter `inClientData`: A pointer to client data that is passed back to the IOProc when it is
1392 /// called.
1393 ///
1394 /// Parameter `outIOProcID`: The newly created AudioDeviceIOProcID.
1395 ///
1396 /// Returns: An OSStatus indicating success or failure.
1397 #[cfg(feature = "objc2-core-audio-types")]
1398 pub fn AudioDeviceCreateIOProcID(
1399 in_device: AudioObjectID,
1400 in_proc: AudioDeviceIOProc,
1401 in_client_data: *mut c_void,
1402 out_io_proc_id: NonNull<AudioDeviceIOProcID>,
1403 ) -> OSStatus;
1404}
1405
1406extern "C-unwind" {
1407 /// Creates an AudioDeviceIOProcID from an AudioDeviceIOBlock
1408 ///
1409 /// Parameter `outIOProcID`: The newly created AudioDeviceIOProcID.
1410 ///
1411 /// Parameter `inDevice`: The AudioDevice to register the Block with.
1412 ///
1413 /// Parameter `inDispatchQueue`: The dispatch queue on which the IOBlock will be dispatched. All
1414 /// IOBlocks are dispatched synchronously. Note that this dispatch queue will be
1415 /// retained until a matching call to AudioDeviceDestroyIOProcID is made. If
1416 /// this value is NULL, then the IOBlock will be directly invoked.
1417 ///
1418 /// Parameter `inIOBlock`: The AudioDeviceIOBlock to register. Note that this block will be
1419 /// Block_copy'd and the reference maintained until a matching call to
1420 /// AudioDeviceDestroyIOProcID is made.
1421 ///
1422 /// Returns: An OSStatus indicating success or failure.
1423 #[cfg(all(
1424 feature = "block2",
1425 feature = "dispatch2",
1426 feature = "objc2-core-audio-types"
1427 ))]
1428 pub fn AudioDeviceCreateIOProcIDWithBlock(
1429 out_io_proc_id: NonNull<AudioDeviceIOProcID>,
1430 in_device: AudioObjectID,
1431 in_dispatch_queue: Option<&DispatchQueue>,
1432 in_io_block: AudioDeviceIOBlock,
1433 ) -> OSStatus;
1434}
1435
1436extern "C-unwind" {
1437 /// Destroys an AudioDeviceIOProcID.
1438 ///
1439 /// AudioDeviceIOProcIDs allow for the client to register the same function pointer
1440 /// with a device multiple times
1441 ///
1442 /// Parameter `inDevice`: The AudioDevice from which the ID came.
1443 ///
1444 /// Parameter `inIOProcID`: The AudioDeviceIOProcID to get rid of.
1445 ///
1446 /// Returns: An OSStatus indicating success or failure.
1447 #[cfg(feature = "objc2-core-audio-types")]
1448 pub fn AudioDeviceDestroyIOProcID(
1449 in_device: AudioObjectID,
1450 in_io_proc_id: AudioDeviceIOProcID,
1451 ) -> OSStatus;
1452}
1453
1454extern "C-unwind" {
1455 /// Starts IO for the given AudioDeviceIOProcID.
1456 ///
1457 /// Parameter `inDevice`: The AudioDevice to start the IOProc on.
1458 ///
1459 /// Parameter `inProcID`: The AudioDeviceIOProcID to start. Note that this can be NULL, which starts
1460 /// the hardware regardless of whether or not there are any IOProcs registered.
1461 /// This is necessary if any of the AudioDevice's timing services are to be
1462 /// used. A balancing call to AudioDeviceStop with a NULL IOProc is required to
1463 /// stop the hardware.
1464 ///
1465 /// Returns: An OSStatus indicating success or failure.
1466 #[cfg(feature = "objc2-core-audio-types")]
1467 pub fn AudioDeviceStart(in_device: AudioObjectID, in_proc_id: AudioDeviceIOProcID) -> OSStatus;
1468}
1469
1470extern "C-unwind" {
1471 /// Starts IO for the given AudioDeviceIOProcID and aligns the IO cycle of the
1472 /// AudioDevice with the given time.
1473 ///
1474 /// Parameter `inDevice`: The AudioDevice to start the IOProc on.
1475 ///
1476 /// Parameter `inProcID`: The AudioDeviceIOProcID to start. Note that this can be NULL, which starts
1477 /// the hardware regardless of whether or not there are any IOProcs registered.
1478 ///
1479 /// Parameter `ioRequestedStartTime`: A pointer to an AudioTimeStamp that, on entry, is the requested time to
1480 /// start the IOProc. On exit, it will be the actual time the IOProc will start.
1481 ///
1482 /// Parameter `inFlags`: A UInt32 containing flags that modify how this function behaves.
1483 ///
1484 /// Returns: An OSStatus indicating success or failure.
1485 /// kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
1486 /// not support starting at a specific time and inProc and ioRequestedStartTime are
1487 /// not NULL.
1488 #[cfg(feature = "objc2-core-audio-types")]
1489 pub fn AudioDeviceStartAtTime(
1490 in_device: AudioObjectID,
1491 in_proc_id: AudioDeviceIOProcID,
1492 io_requested_start_time: NonNull<AudioTimeStamp>,
1493 in_flags: u32,
1494 ) -> OSStatus;
1495}
1496
1497extern "C-unwind" {
1498 /// Stops IO for the given AudioDeviceIOProcID.
1499 ///
1500 /// Parameter `inDevice`: The AudioDevice to stop the IOProc on.
1501 ///
1502 /// Parameter `inProcID`: The AudioDeviceIOProcID to stop.
1503 ///
1504 /// Returns: An OSStatus indicating success or failure.
1505 #[cfg(feature = "objc2-core-audio-types")]
1506 pub fn AudioDeviceStop(in_device: AudioObjectID, in_proc_id: AudioDeviceIOProcID) -> OSStatus;
1507}
1508
1509extern "C-unwind" {
1510 /// Retrieves the current time from an AudioDevice. Note that the device has to be
1511 /// running.
1512 ///
1513 /// Parameter `inDevice`: The AudioDevice to from which to get the time.
1514 ///
1515 /// Parameter `outTime`: An AudioTimeStamp into which the current time is put. On entry, the
1516 /// mFlags field specifies which representations to provide. Because not every
1517 /// device supports all time representations, on exit, the mFlags field will
1518 /// indicate what values are actually valid.
1519 ///
1520 /// Returns: An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1521 /// returned if the AudioDevice isn't running.
1522 #[cfg(feature = "objc2-core-audio-types")]
1523 pub fn AudioDeviceGetCurrentTime(
1524 in_device: AudioObjectID,
1525 out_time: NonNull<AudioTimeStamp>,
1526 ) -> OSStatus;
1527}
1528
1529extern "C-unwind" {
1530 /// Translates the time in the AudioDevice's time base from one representation to
1531 /// another. Note that the device has to be running
1532 ///
1533 /// Parameter `inDevice`: The AudioDevice whose time base governs the translation.
1534 ///
1535 /// Parameter `inTime`: An AudioTimeStamp containing the time to be translated.
1536 ///
1537 /// Parameter `outTime`: An AudioTimeStamp into which the translated time is put. On entry, the
1538 /// mFlags field specifies which representations to translate the input time
1539 /// into. Because not every device supports all time representations, on exit,
1540 /// the mFlags field will indicate which translations were actually done.
1541 ///
1542 /// Returns: An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1543 /// returned if the AudioDevice isn't running.
1544 #[cfg(feature = "objc2-core-audio-types")]
1545 pub fn AudioDeviceTranslateTime(
1546 in_device: AudioObjectID,
1547 in_time: NonNull<AudioTimeStamp>,
1548 out_time: NonNull<AudioTimeStamp>,
1549 ) -> OSStatus;
1550}
1551
1552extern "C-unwind" {
1553 /// Query an AudioDevice to get a time equal to or later than the given time that is
1554 /// the best time to start IO.
1555 ///
1556 /// The time that is returned is dictated by the constraints of the device and the
1557 /// system. For instance, the driver of a device that provides both audio and video
1558 /// data may only allow start times that coincide with the edge of a video frame.
1559 /// Also, if the device already has one or more active IOProcs, the start time will
1560 /// be shifted to the beginning of the next IO cycle so as not to cause
1561 /// discontinuities in the existing IOProcs. Another reason the start time may shift
1562 /// is to allow for aligning the buffer accesses in an optimal fashion. Note that
1563 /// the device must be running to use this function.
1564 ///
1565 /// Parameter `inDevice`: The AudioDevice to query.
1566 ///
1567 /// Parameter `ioRequestedStartTime`: A pointer to an AudioTimeStamp that, on entry, is the requested start time.
1568 /// On exit, it will have the a time equal to or later than the requested time,
1569 /// as dictated by the device's constraints.
1570 ///
1571 /// Parameter `inFlags`: A UInt32 containing flags that modify how this function behaves.
1572 ///
1573 /// Returns: An OSStatus indicating success or failure. kAudioHardwareNotRunningError will be
1574 /// returned if the AudioDevice isn't running.
1575 /// kAudioHardwareUnsupportedOperationError will be returned if the AudioDevice does
1576 /// not support starting at a specific time.
1577 #[cfg(feature = "objc2-core-audio-types")]
1578 pub fn AudioDeviceGetNearestStartTime(
1579 in_device: AudioObjectID,
1580 io_requested_start_time: NonNull<AudioTimeStamp>,
1581 in_flags: u32,
1582 ) -> OSStatus;
1583}
1584
1585/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedeviceclassid?language=objc)
1586pub const kAudioAggregateDeviceClassID: AudioClassID = 0x61616767;
1587
1588/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertyfullsubdevicelist?language=objc)
1589pub const kAudioAggregateDevicePropertyFullSubDeviceList: AudioObjectPropertySelector = 0x67727570;
1590/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertyactivesubdevicelist?language=objc)
1591pub const kAudioAggregateDevicePropertyActiveSubDeviceList: AudioObjectPropertySelector =
1592 0x61677270;
1593/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertycomposition?language=objc)
1594pub const kAudioAggregateDevicePropertyComposition: AudioObjectPropertySelector = 0x61636f6d;
1595/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertymainsubdevice?language=objc)
1596pub const kAudioAggregateDevicePropertyMainSubDevice: AudioObjectPropertySelector = 0x616d7374;
1597/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertyclockdevice?language=objc)
1598pub const kAudioAggregateDevicePropertyClockDevice: AudioObjectPropertySelector = 0x61706364;
1599/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertytaplist?language=objc)
1600pub const kAudioAggregateDevicePropertyTapList: AudioObjectPropertySelector = 0x74617023;
1601/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedevicepropertysubtaplist?language=objc)
1602pub const kAudioAggregateDevicePropertySubTapList: AudioObjectPropertySelector = 0x61746170;
1603
1604/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationminquality?language=objc)
1605pub const kAudioAggregateDriftCompensationMinQuality: u32 = 0;
1606/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationlowquality?language=objc)
1607pub const kAudioAggregateDriftCompensationLowQuality: u32 = 0x20;
1608/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationmediumquality?language=objc)
1609pub const kAudioAggregateDriftCompensationMediumQuality: u32 = 0x40;
1610/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationhighquality?language=objc)
1611pub const kAudioAggregateDriftCompensationHighQuality: u32 = 0x60;
1612/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioaggregatedriftcompensationmaxquality?language=objc)
1613pub const kAudioAggregateDriftCompensationMaxQuality: u32 = 0x7F;
1614
1615/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdeviceclassid?language=objc)
1616pub const kAudioSubDeviceClassID: AudioClassID = 0x61737562;
1617
1618/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationminquality?language=objc)
1619#[deprecated]
1620pub const kAudioSubDeviceDriftCompensationMinQuality: u32 = 0;
1621/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationlowquality?language=objc)
1622#[deprecated]
1623pub const kAudioSubDeviceDriftCompensationLowQuality: u32 = 0x20;
1624/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationmediumquality?language=objc)
1625#[deprecated]
1626pub const kAudioSubDeviceDriftCompensationMediumQuality: u32 = 0x40;
1627/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationhighquality?language=objc)
1628#[deprecated]
1629pub const kAudioSubDeviceDriftCompensationHighQuality: u32 = 0x60;
1630/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicedriftcompensationmaxquality?language=objc)
1631#[deprecated]
1632pub const kAudioSubDeviceDriftCompensationMaxQuality: u32 = 0x7F;
1633
1634/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicepropertyextralatency?language=objc)
1635pub const kAudioSubDevicePropertyExtraLatency: AudioObjectPropertySelector = 0x786c7463;
1636/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicepropertydriftcompensation?language=objc)
1637pub const kAudioSubDevicePropertyDriftCompensation: AudioObjectPropertySelector = 0x64726674;
1638/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubdevicepropertydriftcompensationquality?language=objc)
1639pub const kAudioSubDevicePropertyDriftCompensationQuality: AudioObjectPropertySelector = 0x64726671;
1640
1641/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtapclassid?language=objc)
1642pub const kAudioSubTapClassID: AudioClassID = 0x73746170;
1643
1644/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtappropertyextralatency?language=objc)
1645pub const kAudioSubTapPropertyExtraLatency: AudioObjectPropertySelector = 0x786c7463;
1646/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtappropertydriftcompensation?language=objc)
1647pub const kAudioSubTapPropertyDriftCompensation: AudioObjectPropertySelector = 0x64726674;
1648/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiosubtappropertydriftcompensationquality?language=objc)
1649pub const kAudioSubTapPropertyDriftCompensationQuality: AudioObjectPropertySelector = 0x64726671;
1650
1651/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocessclassid?language=objc)
1652pub const kAudioProcessClassID: AudioClassID = 0x636c6e74;
1653
1654/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertypid?language=objc)
1655pub const kAudioProcessPropertyPID: AudioObjectPropertySelector = 0x70706964;
1656/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertybundleid?language=objc)
1657pub const kAudioProcessPropertyBundleID: AudioObjectPropertySelector = 0x70626964;
1658/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertydevices?language=objc)
1659pub const kAudioProcessPropertyDevices: AudioObjectPropertySelector = 0x70647623;
1660/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertyisrunning?language=objc)
1661pub const kAudioProcessPropertyIsRunning: AudioObjectPropertySelector = 0x7069723f;
1662/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertyisrunninginput?language=objc)
1663pub const kAudioProcessPropertyIsRunningInput: AudioObjectPropertySelector = 0x70697269;
1664/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioprocesspropertyisrunningoutput?language=objc)
1665pub const kAudioProcessPropertyIsRunningOutput: AudioObjectPropertySelector = 0x7069726f;
1666
1667/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotapclassid?language=objc)
1668pub const kAudioTapClassID: AudioClassID = 0x74636c73;
1669
1670/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotappropertyuid?language=objc)
1671pub const kAudioTapPropertyUID: AudioObjectPropertySelector = 0x74756964;
1672/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotappropertydescription?language=objc)
1673pub const kAudioTapPropertyDescription: AudioObjectPropertySelector = 0x74647363;
1674/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiotappropertyformat?language=objc)
1675pub const kAudioTapPropertyFormat: AudioObjectPropertySelector = 0x74666d74;
1676
1677extern "C-unwind" {
1678 /// This routine creates a new Tap using the provided description.
1679 ///
1680 /// Parameter `inDescription`: The CATapDescription that specifies how to build the Tap.
1681 ///
1682 /// Parameter `outTapID`: The AudioObjectID of the newly created Tap.
1683 ///
1684 /// Returns: An OSStatus indicating success or failure.
1685 #[cfg(feature = "objc2")]
1686 pub fn AudioHardwareCreateProcessTap(
1687 in_description: Option<&CATapDescription>,
1688 out_tap_id: *mut AudioObjectID,
1689 ) -> OSStatus;
1690}
1691
1692extern "C-unwind" {
1693 /// This routine destroys the given Tap.
1694 ///
1695 /// Parameter `inTapID`: The AudioObjectID of the Tap to destroy.
1696 ///
1697 /// Returns: An OSStatus indicating success or failure.
1698 pub fn AudioHardwareDestroyProcessTap(in_tap_id: AudioObjectID) -> OSStatus;
1699}
1700
1701/// CATapMuteBehavior describes the playback behavior of the process being tapped. The default value is CATapUnmuted.
1702///
1703/// Audio is captured by the tap and also sent to the audio hardware
1704///
1705/// Audio is captured by the tap but no audio is sent from the process to the audio hardware
1706///
1707/// Audio is captured by the tap and also sent to the audio hardware until the tap is read by another audio client.
1708/// For the duration of the read activity on the tap no audio is sent to the audio hardware.
1709///
1710/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/catapmutebehavior?language=objc)
1711// NS_ENUM
1712#[cfg(feature = "objc2")]
1713#[repr(transparent)]
1714#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1715pub struct CATapMuteBehavior(pub NSInteger);
1716#[cfg(feature = "objc2")]
1717impl CATapMuteBehavior {
1718 #[doc(alias = "CATapUnmuted")]
1719 pub const Unmuted: Self = Self(0);
1720 #[doc(alias = "CATapMuted")]
1721 pub const Muted: Self = Self(1);
1722 #[doc(alias = "CATapMutedWhenTapped")]
1723 pub const MutedWhenTapped: Self = Self(2);
1724}
1725
1726#[cfg(feature = "objc2")]
1727unsafe impl Encode for CATapMuteBehavior {
1728 const ENCODING: Encoding = NSInteger::ENCODING;
1729}
1730
1731#[cfg(feature = "objc2")]
1732unsafe impl RefEncode for CATapMuteBehavior {
1733 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1734}
1735
1736#[cfg(feature = "objc2")]
1737extern_class!(
1738 /// 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.
1739 ///
1740 /// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/catapdescription?language=objc)
1741 #[unsafe(super(NSObject))]
1742 #[derive(Debug, PartialEq, Eq, Hash)]
1743 #[cfg(feature = "objc2")]
1744 pub struct CATapDescription;
1745);
1746
1747#[cfg(feature = "objc2")]
1748extern_conformance!(
1749 unsafe impl NSObjectProtocol for CATapDescription {}
1750);
1751
1752#[cfg(feature = "objc2")]
1753impl CATapDescription {
1754 extern_methods!(
1755 #[unsafe(method(init))]
1756 #[unsafe(method_family = init)]
1757 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1758
1759 #[cfg(feature = "objc2-foundation")]
1760 /// Mix all given process audio streams down to stereo. Mono sources will be duplicated in
1761 /// both right and left channels.
1762 ///
1763 /// Parameter `processesObjectIDsToIncludeInTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to include in the tap
1764 #[unsafe(method(initStereoMixdownOfProcesses:))]
1765 #[unsafe(method_family = init)]
1766 pub unsafe fn initStereoMixdownOfProcesses(
1767 this: Allocated<Self>,
1768 processes_object_i_ds_to_include_in_tap: &NSArray<NSNumber>,
1769 ) -> Retained<Self>;
1770
1771 #[cfg(feature = "objc2-foundation")]
1772 /// Mix all processes to a stereo stream except the given processes. Mono sources will be
1773 /// duplicated in both right and left channels.
1774 ///
1775 /// Parameter `processesObjectIDsToExcludeFromTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to exclude from the tap.
1776 /// All other processes that output audio will be included in the tap.
1777 #[unsafe(method(initStereoGlobalTapButExcludeProcesses:))]
1778 #[unsafe(method_family = init)]
1779 pub unsafe fn initStereoGlobalTapButExcludeProcesses(
1780 this: Allocated<Self>,
1781 processes_object_i_ds_to_exclude_from_tap: &NSArray<NSNumber>,
1782 ) -> Retained<Self>;
1783
1784 #[cfg(feature = "objc2-foundation")]
1785 /// Mix all given process audio streams audio to mono.
1786 ///
1787 /// Parameter `processesObjectIDsToIncludeInTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to include in the tap
1788 #[unsafe(method(initMonoMixdownOfProcesses:))]
1789 #[unsafe(method_family = init)]
1790 pub unsafe fn initMonoMixdownOfProcesses(
1791 this: Allocated<Self>,
1792 processes_object_i_ds_to_include_in_tap: &NSArray<NSNumber>,
1793 ) -> Retained<Self>;
1794
1795 #[cfg(feature = "objc2-foundation")]
1796 /// Mix all processes to a mono stream except the given processes
1797 ///
1798 /// Parameter `processesObjectIDsToExcludeFromTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to exclude from the tap.
1799 /// All other processes that output audio will be included in the tap.
1800 #[unsafe(method(initMonoGlobalTapButExcludeProcesses:))]
1801 #[unsafe(method_family = init)]
1802 pub unsafe fn initMonoGlobalTapButExcludeProcesses(
1803 this: Allocated<Self>,
1804 processes_object_i_ds_to_exclude_from_tap: &NSArray<NSNumber>,
1805 ) -> Retained<Self>;
1806
1807 #[cfg(feature = "objc2-foundation")]
1808 /// Mix all given process audio streams destined for the selected device stream
1809 ///
1810 /// Parameter `processesObjectIDsToIncludeInTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to exclude from the tap.
1811 /// All other processes that output audio will be included in the tap.
1812 ///
1813 /// Parameter `deviceUID`: The device UID of the output device whose audio will be captured
1814 ///
1815 /// Parameter `stream`: NSInteger that represents the index of the stream on the device whose audio will be captured. The format of the tap
1816 /// will match the format of this stream.
1817 #[unsafe(method(initWithProcesses:andDeviceUID:withStream:))]
1818 #[unsafe(method_family = init)]
1819 pub unsafe fn initWithProcesses_andDeviceUID_withStream(
1820 this: Allocated<Self>,
1821 processes_object_i_ds_to_include_in_tap: &NSArray<NSNumber>,
1822 device_uid: &NSString,
1823 stream: NSInteger,
1824 ) -> Retained<Self>;
1825
1826 #[cfg(feature = "objc2-foundation")]
1827 /// Mix all process audio streams destined for the selected device stream except the given processes
1828 ///
1829 /// Parameter `processesObjectIDsToExcludeFromTap`: An NSArray of NSNumbers where each NSNumber holds an AudioObjectID of the process object to exclude from the tap.
1830 /// All other processes that output audio will be included in the tap.
1831 ///
1832 /// Parameter `deviceUID`: The device UID of the output device whose audio will be captured
1833 ///
1834 /// Parameter `stream`: NSInteger that represents the index of the stream on the device whose audio will be captured. The format of the tap
1835 /// will match the format of this stream.
1836 #[unsafe(method(initExcludingProcesses:andDeviceUID:withStream:))]
1837 #[unsafe(method_family = init)]
1838 pub unsafe fn initExcludingProcesses_andDeviceUID_withStream(
1839 this: Allocated<Self>,
1840 processes_object_i_ds_to_exclude_from_tap: &NSArray<NSNumber>,
1841 device_uid: &NSString,
1842 stream: NSInteger,
1843 ) -> Retained<Self>;
1844
1845 #[cfg(feature = "objc2-foundation")]
1846 /// Human readable name of this tap.
1847 #[unsafe(method(name))]
1848 #[unsafe(method_family = none)]
1849 pub unsafe fn name(&self) -> Retained<NSString>;
1850
1851 #[cfg(feature = "objc2-foundation")]
1852 /// Setter for [`name`][Self::name].
1853 #[unsafe(method(setName:))]
1854 #[unsafe(method_family = none)]
1855 pub unsafe fn setName(&self, name: &NSString);
1856
1857 #[cfg(feature = "objc2-foundation")]
1858 /// UID of this tap.
1859 #[unsafe(method(UUID))]
1860 #[unsafe(method_family = none)]
1861 pub unsafe fn UUID(&self) -> Retained<NSUUID>;
1862
1863 #[cfg(feature = "objc2-foundation")]
1864 /// Setter for [`UUID`][Self::UUID].
1865 #[unsafe(method(setUUID:))]
1866 #[unsafe(method_family = none)]
1867 pub unsafe fn setUUID(&self, uuid: &NSUUID);
1868
1869 #[cfg(feature = "objc2-foundation")]
1870 /// An NSArray of NSNumbers where each NSNumber holds the AudioObjectID of the process object to tap or exclude.
1871 #[unsafe(method(processes))]
1872 #[unsafe(method_family = none)]
1873 pub unsafe fn processes(&self) -> Retained<NSArray<NSNumber>>;
1874
1875 #[cfg(feature = "objc2-foundation")]
1876 /// Setter for [`processes`][Self::processes].
1877 #[unsafe(method(setProcesses:))]
1878 #[unsafe(method_family = none)]
1879 pub unsafe fn setProcesses(&self, processes: &NSArray<NSNumber>);
1880
1881 /// True if this description is a mono mixdown of channels.
1882 #[unsafe(method(isMono))]
1883 #[unsafe(method_family = none)]
1884 pub unsafe fn isMono(&self) -> bool;
1885
1886 /// Setter for [`isMono`][Self::isMono].
1887 #[unsafe(method(setMono:))]
1888 #[unsafe(method_family = none)]
1889 pub unsafe fn setMono(&self, mono: bool);
1890
1891 /// True if this description should tap all processes except the process listed in the 'processes' property.
1892 #[unsafe(method(isExclusive))]
1893 #[unsafe(method_family = none)]
1894 pub unsafe fn isExclusive(&self) -> bool;
1895
1896 /// Setter for [`isExclusive`][Self::isExclusive].
1897 #[unsafe(method(setExclusive:))]
1898 #[unsafe(method_family = none)]
1899 pub unsafe fn setExclusive(&self, exclusive: bool);
1900
1901 /// True if this description is a mono or stereo mix of the tapped device's channels.
1902 #[unsafe(method(isMixdown))]
1903 #[unsafe(method_family = none)]
1904 pub unsafe fn isMixdown(&self) -> bool;
1905
1906 /// Setter for [`isMixdown`][Self::isMixdown].
1907 #[unsafe(method(setMixdown:))]
1908 #[unsafe(method_family = none)]
1909 pub unsafe fn setMixdown(&self, mixdown: bool);
1910
1911 /// True if this tap is only visible to the client process that created the tap.
1912 #[unsafe(method(isPrivate))]
1913 #[unsafe(method_family = none)]
1914 pub unsafe fn isPrivate(&self) -> bool;
1915
1916 /// Setter for [`isPrivate`][Self::isPrivate].
1917 #[unsafe(method(setPrivate:))]
1918 #[unsafe(method_family = none)]
1919 pub unsafe fn setPrivate(&self, private_tap: bool);
1920
1921 /// Set the tap's mute behavior. See CATapMuteBehavior above.
1922 #[unsafe(method(isMuted))]
1923 #[unsafe(method_family = none)]
1924 pub unsafe fn isMuted(&self) -> CATapMuteBehavior;
1925
1926 /// Setter for [`isMuted`][Self::isMuted].
1927 #[unsafe(method(setMuteBehavior:))]
1928 #[unsafe(method_family = none)]
1929 pub unsafe fn setMuteBehavior(&self, mute_behavior: CATapMuteBehavior);
1930
1931 #[cfg(feature = "objc2-foundation")]
1932 /// An optional deviceUID that will have a value if this tap only taps a specific hardware device
1933 #[unsafe(method(deviceUID))]
1934 #[unsafe(method_family = none)]
1935 pub unsafe fn deviceUID(&self) -> Option<Retained<NSString>>;
1936
1937 #[cfg(feature = "objc2-foundation")]
1938 /// Setter for [`deviceUID`][Self::deviceUID].
1939 #[unsafe(method(setDeviceUID:))]
1940 #[unsafe(method_family = none)]
1941 pub unsafe fn setDeviceUID(&self, device_uid: Option<&NSString>);
1942
1943 #[cfg(feature = "objc2-foundation")]
1944 /// An optional NSNumber that will have a value if this tap taps a specific device stream.
1945 /// The value represents the index of the hardware stream.
1946 #[unsafe(method(stream))]
1947 #[unsafe(method_family = none)]
1948 pub unsafe fn stream(&self) -> Option<Retained<NSNumber>>;
1949
1950 #[cfg(feature = "objc2-foundation")]
1951 /// Setter for [`stream`][Self::stream].
1952 #[unsafe(method(setStream:))]
1953 #[unsafe(method_family = none)]
1954 pub unsafe fn setStream(&self, stream: Option<&NSNumber>);
1955 );
1956}
1957
1958/// Methods declared on superclass `NSObject`.
1959#[cfg(feature = "objc2")]
1960impl CATapDescription {
1961 extern_methods!(
1962 #[unsafe(method(new))]
1963 #[unsafe(method_family = new)]
1964 pub unsafe fn new() -> Retained<Self>;
1965 );
1966}