objc2_audio_toolbox/generated/
AUComponent.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-audio-types")]
7use objc2_core_audio_types::*;
8#[cfg(feature = "objc2-core-foundation")]
9use objc2_core_foundation::*;
10
11use crate::*;
12
13/// An audio unit is of type AudioComponentInstance as defined in
14/// AudioComponent.h
15///
16/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounit?language=objc)
17#[cfg(feature = "AudioComponent")]
18pub type AudioUnit = AudioComponentInstance;
19
20/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_output?language=objc)
21pub const kAudioUnitType_Output: u32 = 0x61756f75;
22/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_musicdevice?language=objc)
23pub const kAudioUnitType_MusicDevice: u32 = 0x61756d75;
24/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_musiceffect?language=objc)
25pub const kAudioUnitType_MusicEffect: u32 = 0x61756d66;
26/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_formatconverter?language=objc)
27pub const kAudioUnitType_FormatConverter: u32 = 0x61756663;
28/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_effect?language=objc)
29pub const kAudioUnitType_Effect: u32 = 0x61756678;
30/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_mixer?language=objc)
31pub const kAudioUnitType_Mixer: u32 = 0x61756d78;
32/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_panner?language=objc)
33pub const kAudioUnitType_Panner: u32 = 0x6175706e;
34/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_generator?language=objc)
35pub const kAudioUnitType_Generator: u32 = 0x6175676e;
36/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_offlineeffect?language=objc)
37pub const kAudioUnitType_OfflineEffect: u32 = 0x61756f6c;
38/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_midiprocessor?language=objc)
39pub const kAudioUnitType_MIDIProcessor: u32 = 0x61756d69;
40/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_speechsynthesizer?language=objc)
41pub const kAudioUnitType_SpeechSynthesizer: u32 = 0x61757370;
42
43/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_remoteeffect?language=objc)
44pub const kAudioUnitType_RemoteEffect: u32 = 0x61757278;
45/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_remotegenerator?language=objc)
46pub const kAudioUnitType_RemoteGenerator: u32 = 0x61757267;
47/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_remoteinstrument?language=objc)
48pub const kAudioUnitType_RemoteInstrument: u32 = 0x61757269;
49/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounittype_remotemusiceffect?language=objc)
50pub const kAudioUnitType_RemoteMusicEffect: u32 = 0x6175726d;
51
52/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitmanufacturer_apple?language=objc)
53pub const kAudioUnitManufacturer_Apple: u32 = 0x6170706c;
54
55/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_genericoutput?language=objc)
56pub const kAudioUnitSubType_GenericOutput: u32 = 0x67656e72;
57/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_voiceprocessingio?language=objc)
58pub const kAudioUnitSubType_VoiceProcessingIO: u32 = 0x7670696f;
59
60/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_haloutput?language=objc)
61pub const kAudioUnitSubType_HALOutput: u32 = 0x6168616c;
62/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_defaultoutput?language=objc)
63pub const kAudioUnitSubType_DefaultOutput: u32 = 0x64656620;
64/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_systemoutput?language=objc)
65pub const kAudioUnitSubType_SystemOutput: u32 = 0x73797320;
66
67/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_dlssynth?language=objc)
68pub const kAudioUnitSubType_DLSSynth: u32 = 0x646c7320;
69/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_sampler?language=objc)
70pub const kAudioUnitSubType_Sampler: u32 = 0x73616d70;
71/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_midisynth?language=objc)
72pub const kAudioUnitSubType_MIDISynth: u32 = 0x6d73796e;
73
74/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_auconverter?language=objc)
75pub const kAudioUnitSubType_AUConverter: u32 = 0x636f6e76;
76/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_varispeed?language=objc)
77pub const kAudioUnitSubType_Varispeed: u32 = 0x76617269;
78/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_deferredrenderer?language=objc)
79pub const kAudioUnitSubType_DeferredRenderer: u32 = 0x64656672;
80/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_splitter?language=objc)
81pub const kAudioUnitSubType_Splitter: u32 = 0x73706c74;
82/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_multisplitter?language=objc)
83pub const kAudioUnitSubType_MultiSplitter: u32 = 0x6d73706c;
84/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_merger?language=objc)
85pub const kAudioUnitSubType_Merger: u32 = 0x6d657267;
86/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_newtimepitch?language=objc)
87pub const kAudioUnitSubType_NewTimePitch: u32 = 0x6e757470;
88/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_auipodtimeother?language=objc)
89pub const kAudioUnitSubType_AUiPodTimeOther: u32 = 0x6970746f;
90/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_roundtripaac?language=objc)
91pub const kAudioUnitSubType_RoundTripAAC: u32 = 0x72616163;
92/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_auaudiomix?language=objc)
93pub const kAudioUnitSubType_AUAudioMix: u32 = 0x616d6978;
94
95/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_timepitch?language=objc)
96pub const kAudioUnitSubType_TimePitch: u32 = 0x746d7074;
97
98/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_peaklimiter?language=objc)
99pub const kAudioUnitSubType_PeakLimiter: u32 = 0x6c6d7472;
100/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_dynamicsprocessor?language=objc)
101pub const kAudioUnitSubType_DynamicsProcessor: u32 = 0x64636d70;
102/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_lowpassfilter?language=objc)
103pub const kAudioUnitSubType_LowPassFilter: u32 = 0x6c706173;
104/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_highpassfilter?language=objc)
105pub const kAudioUnitSubType_HighPassFilter: u32 = 0x68706173;
106/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_bandpassfilter?language=objc)
107pub const kAudioUnitSubType_BandPassFilter: u32 = 0x62706173;
108/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_highshelffilter?language=objc)
109pub const kAudioUnitSubType_HighShelfFilter: u32 = 0x68736866;
110/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_lowshelffilter?language=objc)
111pub const kAudioUnitSubType_LowShelfFilter: u32 = 0x6c736866;
112/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_parametriceq?language=objc)
113pub const kAudioUnitSubType_ParametricEQ: u32 = 0x706d6571;
114/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_distortion?language=objc)
115pub const kAudioUnitSubType_Distortion: u32 = 0x64697374;
116/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_delay?language=objc)
117pub const kAudioUnitSubType_Delay: u32 = 0x64656c79;
118/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_sampledelay?language=objc)
119pub const kAudioUnitSubType_SampleDelay: u32 = 0x73646c79;
120/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_nbandeq?language=objc)
121pub const kAudioUnitSubType_NBandEQ: u32 = 0x6e626571;
122/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_reverb2?language=objc)
123pub const kAudioUnitSubType_Reverb2: u32 = 0x72766232;
124/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_ausoundisolation?language=objc)
125pub const kAudioUnitSubType_AUSoundIsolation: u32 = 0x766f6973;
126
127/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_graphiceq?language=objc)
128pub const kAudioUnitSubType_GraphicEQ: u32 = 0x67726571;
129/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_multibandcompressor?language=objc)
130pub const kAudioUnitSubType_MultiBandCompressor: u32 = 0x6d636d70;
131/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_matrixreverb?language=objc)
132pub const kAudioUnitSubType_MatrixReverb: u32 = 0x6d726576;
133/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_pitch?language=objc)
134pub const kAudioUnitSubType_Pitch: u32 = 0x746d7074;
135/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_aufilter?language=objc)
136pub const kAudioUnitSubType_AUFilter: u32 = 0x66696c74;
137/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_netsend?language=objc)
138pub const kAudioUnitSubType_NetSend: u32 = 0x6e736e64;
139/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_rogerbeep?language=objc)
140pub const kAudioUnitSubType_RogerBeep: u32 = 0x726f6772;
141
142/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_multichannelmixer?language=objc)
143pub const kAudioUnitSubType_MultiChannelMixer: u32 = 0x6d636d78;
144/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_matrixmixer?language=objc)
145pub const kAudioUnitSubType_MatrixMixer: u32 = 0x6d786d78;
146/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_spatialmixer?language=objc)
147pub const kAudioUnitSubType_SpatialMixer: u32 = 0x3364656d;
148
149/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_stereomixer?language=objc)
150pub const kAudioUnitSubType_StereoMixer: u32 = 0x736d7872;
151/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_3dmixer?language=objc)
152#[deprecated = "no longer supported"]
153pub const kAudioUnitSubType_3DMixer: u32 = 0x33646d78;
154
155/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_sphericalheadpanner?language=objc)
156pub const kAudioUnitSubType_SphericalHeadPanner: u32 = 0x73706872;
157/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_vectorpanner?language=objc)
158pub const kAudioUnitSubType_VectorPanner: u32 = 0x76626173;
159/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_soundfieldpanner?language=objc)
160pub const kAudioUnitSubType_SoundFieldPanner: u32 = 0x616d6269;
161/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_hrtfpanner?language=objc)
162pub const kAudioUnitSubType_HRTFPanner: u32 = 0x68727466;
163
164/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_netreceive?language=objc)
165pub const kAudioUnitSubType_NetReceive: u32 = 0x6e726376;
166/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_scheduledsoundplayer?language=objc)
167pub const kAudioUnitSubType_ScheduledSoundPlayer: u32 = 0x7373706c;
168/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsubtype_audiofileplayer?language=objc)
169pub const kAudioUnitSubType_AudioFilePlayer: u32 = 0x6166706c;
170
171/// These flags can be set in a callback from an audio unit during an audio unit
172/// render operation from either the RenderNotify Proc or the render input
173/// callback.
174///
175///
176/// Called on a render notification Proc - which is called either before or after
177/// the render operation of the audio unit. If this flag is set, the proc is being
178/// called before the render operation is performed.
179///
180///
181/// Called on a render notification Proc - which is called either before or after
182/// the render operation of the audio unit. If this flag is set, the proc is being
183/// called after the render operation is completed.
184///
185///
186/// The originator of a buffer, in a render input callback, or in an audio unit's
187/// render operation, may use this flag to indicate that the buffer contains
188/// only silence.
189///
190/// The receiver of the buffer can then use the flag as a hint as to whether the
191/// buffer needs to be processed or not.
192///
193/// Note that because the flag is only a hint, when setting the silence flag,
194/// the originator of a buffer must also ensure that it contains silence (zeroes).
195///
196///
197/// This is used with offline audio units (of type 'auol'). It is used when an
198/// offline unit is being preflighted, which is performed prior to the actual
199/// offline rendering actions are performed. It is used for those cases where the
200/// offline process needs it (for example, with an offline unit that normalises an
201/// audio file, it needs to see all of the audio data first before it can perform
202/// its normalization)
203///
204///
205/// Once an offline unit has been successfully preflighted, it is then put into
206/// its render mode. So this flag is set to indicate to the audio unit that it is
207/// now in that state and that it should perform its processing on the input data.
208///
209///
210/// This flag is set when an offline unit has completed either its preflight or
211/// performed render operations
212///
213///
214/// If this flag is set on the post-render call an error was returned by the
215/// AUs render operation. In this case, the error can be retrieved through the
216/// lastRenderError property and the audio data in ioData handed to the post-render
217/// notification will be invalid.
218///
219/// If this flag is set, then checks that are done on the arguments provided to render
220/// are not performed. This can be useful to use to save computation time in
221/// situations where you are sure you are providing the correct arguments
222/// and structures to the various render calls
223///
224/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitrenderactionflags?language=objc)
225// NS_OPTIONS
226#[repr(transparent)]
227#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
228pub struct AudioUnitRenderActionFlags(pub u32);
229bitflags::bitflags! {
230    impl AudioUnitRenderActionFlags: u32 {
231        #[doc(alias = "kAudioUnitRenderAction_PreRender")]
232        const UnitRenderAction_PreRender = 1<<2;
233        #[doc(alias = "kAudioUnitRenderAction_PostRender")]
234        const UnitRenderAction_PostRender = 1<<3;
235        #[doc(alias = "kAudioUnitRenderAction_OutputIsSilence")]
236        const UnitRenderAction_OutputIsSilence = 1<<4;
237        #[doc(alias = "kAudioOfflineUnitRenderAction_Preflight")]
238        const OfflineUnitRenderAction_Preflight = 1<<5;
239        #[doc(alias = "kAudioOfflineUnitRenderAction_Render")]
240        const OfflineUnitRenderAction_Render = 1<<6;
241        #[doc(alias = "kAudioOfflineUnitRenderAction_Complete")]
242        const OfflineUnitRenderAction_Complete = 1<<7;
243        #[doc(alias = "kAudioUnitRenderAction_PostRenderError")]
244        const UnitRenderAction_PostRenderError = 1<<8;
245        #[doc(alias = "kAudioUnitRenderAction_DoNotCheckRenderArgs")]
246        const UnitRenderAction_DoNotCheckRenderArgs = 1<<9;
247    }
248}
249
250unsafe impl Encode for AudioUnitRenderActionFlags {
251    const ENCODING: Encoding = u32::ENCODING;
252}
253
254unsafe impl RefEncode for AudioUnitRenderActionFlags {
255    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
256}
257
258/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidproperty?language=objc)
259pub const kAudioUnitErr_InvalidProperty: OSStatus = -10879;
260/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidparameter?language=objc)
261pub const kAudioUnitErr_InvalidParameter: OSStatus = -10878;
262/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidelement?language=objc)
263pub const kAudioUnitErr_InvalidElement: OSStatus = -10877;
264/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_noconnection?language=objc)
265pub const kAudioUnitErr_NoConnection: OSStatus = -10876;
266/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_failedinitialization?language=objc)
267pub const kAudioUnitErr_FailedInitialization: OSStatus = -10875;
268/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_toomanyframestoprocess?language=objc)
269pub const kAudioUnitErr_TooManyFramesToProcess: OSStatus = -10874;
270/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidfile?language=objc)
271pub const kAudioUnitErr_InvalidFile: OSStatus = -10871;
272/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_unknownfiletype?language=objc)
273pub const kAudioUnitErr_UnknownFileType: OSStatus = -10870;
274/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_filenotspecified?language=objc)
275pub const kAudioUnitErr_FileNotSpecified: OSStatus = -10869;
276/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_formatnotsupported?language=objc)
277pub const kAudioUnitErr_FormatNotSupported: OSStatus = -10868;
278/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_uninitialized?language=objc)
279pub const kAudioUnitErr_Uninitialized: OSStatus = -10867;
280/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidscope?language=objc)
281pub const kAudioUnitErr_InvalidScope: OSStatus = -10866;
282/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_propertynotwritable?language=objc)
283pub const kAudioUnitErr_PropertyNotWritable: OSStatus = -10865;
284/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_cannotdoincurrentcontext?language=objc)
285pub const kAudioUnitErr_CannotDoInCurrentContext: OSStatus = -10863;
286/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidpropertyvalue?language=objc)
287pub const kAudioUnitErr_InvalidPropertyValue: OSStatus = -10851;
288/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_propertynotinuse?language=objc)
289pub const kAudioUnitErr_PropertyNotInUse: OSStatus = -10850;
290/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_initialized?language=objc)
291pub const kAudioUnitErr_Initialized: OSStatus = -10849;
292/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidofflinerender?language=objc)
293pub const kAudioUnitErr_InvalidOfflineRender: OSStatus = -10848;
294/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_unauthorized?language=objc)
295pub const kAudioUnitErr_Unauthorized: OSStatus = -10847;
296/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_midioutputbufferfull?language=objc)
297pub const kAudioUnitErr_MIDIOutputBufferFull: OSStatus = -66753;
298/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponenterr_instancetimedout?language=objc)
299pub const kAudioComponentErr_InstanceTimedOut: OSStatus = -66754;
300/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponenterr_instanceinvalidated?language=objc)
301pub const kAudioComponentErr_InstanceInvalidated: OSStatus = -66749;
302/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_rendertimeout?language=objc)
303pub const kAudioUnitErr_RenderTimeout: OSStatus = -66745;
304/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_extensionnotfound?language=objc)
305pub const kAudioUnitErr_ExtensionNotFound: OSStatus = -66744;
306/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidparametervalue?language=objc)
307pub const kAudioUnitErr_InvalidParameterValue: OSStatus = -66743;
308/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_invalidfilepath?language=objc)
309pub const kAudioUnitErr_InvalidFilePath: OSStatus = -66742;
310/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_missingkey?language=objc)
311pub const kAudioUnitErr_MissingKey: OSStatus = -66741;
312/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_componentmanagernotsupported?language=objc)
313pub const kAudioUnitErr_ComponentManagerNotSupported: OSStatus = -66740;
314/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_multiplevoiceprocessors?language=objc)
315pub const kAudioUnitErr_MultipleVoiceProcessors: OSStatus = -66635;
316
317/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponenterr_duplicatedescription?language=objc)
318pub const kAudioComponentErr_DuplicateDescription: OSStatus = -66752;
319/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponenterr_unsupportedtype?language=objc)
320pub const kAudioComponentErr_UnsupportedType: OSStatus = -66751;
321/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponenterr_toomanyinstances?language=objc)
322pub const kAudioComponentErr_TooManyInstances: OSStatus = -66750;
323/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponenterr_notpermitted?language=objc)
324pub const kAudioComponentErr_NotPermitted: OSStatus = -66748;
325/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponenterr_initializationtimedout?language=objc)
326pub const kAudioComponentErr_InitializationTimedOut: OSStatus = -66747;
327/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponenterr_invalidformat?language=objc)
328pub const kAudioComponentErr_InvalidFormat: OSStatus = -66746;
329
330/// Type used for audio unit properties.
331/// Properties are used to describe the state of an audio unit (for instance,
332/// the input or output audio format)
333///
334/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitpropertyid?language=objc)
335pub type AudioUnitPropertyID = u32;
336
337/// Type used for audio unit scopes. Apple reserves the 0
338/// <
339/// 1024 range for
340/// audio unit scope identifiers.
341/// Scopes are used to delineate a major attribute of an audio unit
342/// (for instance, global, input, output)
343///
344/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitscope?language=objc)
345pub type AudioUnitScope = u32;
346
347/// Type used for audio unit elements.
348/// Scopes can have one or more member, and a member of a scope is
349/// addressed / described by its element
350/// For instance, input bus 1 is input scope, element 1
351///
352/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitelement?language=objc)
353pub type AudioUnitElement = u32;
354
355/// Type used for audio unit parameters.
356/// Parameters are typically used to control and set render state
357/// (for instance, filter cut-off frequency)
358///
359/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitparameterid?language=objc)
360pub type AudioUnitParameterID = u32;
361
362/// Type used for audio unit parameter values.
363/// The value of a given parameter is specified using this type
364/// (typically a Float32)
365///
366/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitparametervalue?language=objc)
367pub type AudioUnitParameterValue = f32;
368
369/// The type of a parameter event (see AudioUnitScheduleParameter)
370///
371///
372/// The parameter event describes an immediate change to the parameter value to
373/// the new value
374///
375/// The parameter event describes a change to the parameter value that should
376/// be applied over the specified period of time
377///
378/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparametereventtype?language=objc)
379// NS_ENUM
380#[repr(transparent)]
381#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
382pub struct AUParameterEventType(pub u32);
383impl AUParameterEventType {
384    #[doc(alias = "kParameterEvent_Immediate")]
385    pub const ParameterEvent_Immediate: Self = Self(1);
386    #[doc(alias = "kParameterEvent_Ramped")]
387    pub const ParameterEvent_Ramped: Self = Self(2);
388}
389
390unsafe impl Encode for AUParameterEventType {
391    const ENCODING: Encoding = u32::ENCODING;
392}
393
394unsafe impl RefEncode for AUParameterEventType {
395    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
396}
397
398/// An audio unit parameter is defined by the triplet of audio unit scope, element
399/// and parameterID. This struct is used with the functions in AudioUnitUtilities.h
400/// to deal with audio unit parameters, but is included in this header file for
401/// completeness.
402///
403///
404/// The audio unit instance to which the specified parameter applies.
405///
406/// The parameterID for the parameter
407///
408/// The scope for the parameter
409///
410/// The element for the parameter
411///
412/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitparameter?language=objc)
413#[cfg(feature = "AudioComponent")]
414#[repr(C)]
415#[derive(Clone, Copy, Debug, PartialEq)]
416pub struct AudioUnitParameter {
417    pub mAudioUnit: AudioUnit,
418    pub mParameterID: AudioUnitParameterID,
419    pub mScope: AudioUnitScope,
420    pub mElement: AudioUnitElement,
421}
422
423#[cfg(feature = "AudioComponent")]
424unsafe impl Encode for AudioUnitParameter {
425    const ENCODING: Encoding = Encoding::Struct(
426        "AudioUnitParameter",
427        &[
428            <AudioUnit>::ENCODING,
429            <AudioUnitParameterID>::ENCODING,
430            <AudioUnitScope>::ENCODING,
431            <AudioUnitElement>::ENCODING,
432        ],
433    );
434}
435
436#[cfg(feature = "AudioComponent")]
437unsafe impl RefEncode for AudioUnitParameter {
438    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
439}
440
441/// An audio unit property is defined by the triplet of audio unit scope, element
442/// and propertyID. This struct is used with the functions in AudioUnitUtilities.h
443/// to deal with audio unit properties, but is included in this header file for
444/// completeness.
445///
446///
447/// The audio unit instance which the specified property applies too
448///
449/// The propertyID for the property
450///
451/// The scope for the property
452///
453/// The element for the property
454///
455/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitproperty?language=objc)
456#[cfg(feature = "AudioComponent")]
457#[repr(C)]
458#[derive(Clone, Copy, Debug, PartialEq)]
459pub struct AudioUnitProperty {
460    pub mAudioUnit: AudioUnit,
461    pub mPropertyID: AudioUnitPropertyID,
462    pub mScope: AudioUnitScope,
463    pub mElement: AudioUnitElement,
464}
465
466#[cfg(feature = "AudioComponent")]
467unsafe impl Encode for AudioUnitProperty {
468    const ENCODING: Encoding = Encoding::Struct(
469        "AudioUnitProperty",
470        &[
471            <AudioUnit>::ENCODING,
472            <AudioUnitPropertyID>::ENCODING,
473            <AudioUnitScope>::ENCODING,
474            <AudioUnitElement>::ENCODING,
475        ],
476    );
477}
478
479#[cfg(feature = "AudioComponent")]
480unsafe impl RefEncode for AudioUnitProperty {
481    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
482}
483
484/// This is the prototype for a function callback Proc that is used both with the
485/// AudioUnit render notification API and the render input callback. See
486/// kAudioUnitProperty_SetRenderCallback property or AudioUnitAddRenderNotify.
487/// This callback is part of the process of a call to AudioUnitRender. As a
488/// notification it is called either before or after the audio unit's render
489/// operations. As a render input callback, it is called to provide input data for
490/// the particular input bus the callback is attached too.
491///
492///
493/// Parameter `inRefCon`: The client data that is provided either with the AURenderCallbackStruct or as
494/// specified with the Add API call
495///
496/// Parameter `ioActionFlags`: Flags used to describe more about the context of this call (pre or post in the
497/// notify case for instance)
498///
499/// Parameter `inTimeStamp`: The times stamp associated with this call of audio unit render
500///
501/// Parameter `inBusNumber`: The bus number associated with this call of audio unit render
502///
503/// Parameter `inNumberFrames`: The number of sample frames that will be represented in the audio data in the
504/// provided ioData parameter
505///
506/// Parameter `ioData`: The AudioBufferList that will be used to contain the rendered or provided
507/// audio data. These buffers will be aligned to 16 byte boundaries (which is
508/// normally what malloc will return). Can be null in the notification that
509/// input is available.
510///
511/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/aurendercallback?language=objc)
512#[cfg(feature = "objc2-core-audio-types")]
513pub type AURenderCallback = Option<
514    unsafe extern "C-unwind" fn(
515        NonNull<c_void>,
516        NonNull<AudioUnitRenderActionFlags>,
517        NonNull<AudioTimeStamp>,
518        u32,
519        u32,
520        *mut AudioBufferList,
521    ) -> OSStatus,
522>;
523
524/// This is the prototype for a function callback Proc that is registered with an
525/// audio unit to notify the caller of any changes to a value of an audio unit
526/// property. See AudioUnitAddPropertyListener
527///
528///
529/// Parameter `inRefCon`: The client data that is provided with the add property listener registration
530///
531/// Parameter `inUnit`: The audio unit upon which the specified property value has changed
532///
533/// Parameter `inID`: The property whose value has changed
534///
535/// Parameter `inScope`: The scope of the property whose value has changed
536///
537/// Parameter `inElement`: The element ID on the scope of the property whose value has changed
538///
539/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitpropertylistenerproc?language=objc)
540#[cfg(feature = "AudioComponent")]
541pub type AudioUnitPropertyListenerProc = Option<
542    unsafe extern "C-unwind" fn(
543        NonNull<c_void>,
544        AudioUnit,
545        AudioUnitPropertyID,
546        AudioUnitScope,
547        AudioUnitElement,
548    ),
549>;
550
551/// This is the prototype for a function callback Proc that is registered with an
552/// audio unit to notify the caller of for the user of a varispeed or AUTimePitch
553/// audio unit where it is not clear what input sample is represented in the
554/// rendered output samples.
555///
556///
557/// Parameter `inRefCon`: The client data that is provided with the add property listener registration
558///
559/// Parameter `inOutputTimeStamp`: The time stamp that corresponds to the first sample of audio data produced in
560/// AudioUnitRender (its output data)
561///
562/// Parameter `inInputSample`: The sample number of the input that is represented in the first sample of that
563/// output time stamp
564///
565/// Parameter `inNumberInputSamples`: The number of input samples that are represented in an output buffer
566///
567/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auinputsamplesinoutputcallback?language=objc)
568#[cfg(feature = "objc2-core-audio-types")]
569pub type AUInputSamplesInOutputCallback =
570    Option<unsafe extern "C-unwind" fn(NonNull<c_void>, NonNull<AudioTimeStamp>, f64, f64)>;
571
572extern "C" {
573    /// Notification generated when the set of available AudioComponents changes.
574    ///
575    /// Register for this notification name with `[NSNotificationCenter defaultCenter]` or
576    /// `CFNotificationCenterGetLocalCenter()`, using an object of NULL.
577    ///
578    /// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponentregistrationschangednotification?language=objc)
579    #[cfg(feature = "objc2-core-foundation")]
580    pub static kAudioComponentRegistrationsChangedNotification: &'static CFString;
581}
582
583extern "C" {
584    /// Notification generated when the connection to an audio unit extension process
585    /// is invalidated.
586    ///
587    /// Register for this notification name with `[NSNotificationCenter defaultCenter]` or
588    /// `CFNotificationCenterGetLocalCenter()`. The "object" refers to an AUAudioUnit instance
589    /// to be observed, or can be nil to observe all instances.
590    ///
591    /// This notification can happen for several reasons, for instance the connection being
592    /// invalidated or the process abnormally ending. There can be multiple notifications for
593    /// the same event (i.e. a terminated process will also invalidate the connection).
594    ///
595    /// The notification's userInfo dictionary may contain the following keys, depending on
596    /// the reason for the invalidation and the platform in which it's running:
597    ///
598    /// "
599    /// audioUnit", a NSValue whose pointerValue is the AudioUnit or
600    /// AudioComponentInstance which is wrapping the AUAudioUnit communicating with
601    /// the extension process. (This may be null if there is no such component instance.).
602    /// For example:
603    ///
604    /// ```text
605    /// [[NSNotificationCenter defaultCenter]
606    /// addObserverForName:(NSString *)kAudioComponentInstanceInvalidationNotification
607    /// object:nil queue:nil usingBlock:^(NSNotification *note) {
608    /// AUAudioUnit *auAudioUnit = (AUAudioUnit *)note.object;
609    /// NSValue *val = note.userInfo[
610    /// "
611    /// audioUnit"];
612    /// AudioUnit audioUnit = (AudioUnit)val.pointerValue;
613    /// NSLog(
614    /// "
615    /// Received kAudioComponentInstanceInvalidationNotification: auAudioUnit %
616    /// @
617    /// , audioUnit %p",
618    /// auAudioUnit, audioUnit);
619    /// }];
620    /// ```
621    ///
622    /// "
623    /// Service PID", a NSNumber with the process ID for the service.
624    /// "
625    /// Host PID", a NSNumber with the process ID for the host.
626    /// "
627    /// Executable Path", a NSString with the path for the executable that may be responsible
628    /// for the abnormal exit.
629    /// "
630    /// Descriptions" a NSArray of NSValues representing byte encoded
631    /// AudioComponentDescriptions that may be responsible for the abnormal exit.
632    ///
633    /// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponentinstanceinvalidationnotification?language=objc)
634    #[cfg(feature = "objc2-core-foundation")]
635    pub static kAudioComponentInstanceInvalidationNotification: &'static CFString;
636}
637
638extern "C-unwind" {
639    /// initialize an audio unit
640    ///
641    /// Upon success, the audio unit has been successfully initialized. This means
642    /// that the formats for input and output are valid and can be supported and it
643    /// has based its allocations on the max number of frames that it is able to
644    /// render at any given time. Once initialized, it is in a state where it can be
645    /// asked to render.
646    ///
647    /// In common practice, major state of an audio unit (such as its I/O formats,
648    /// memory allocations) cannot be changed while an audio unit is initialized.
649    ///
650    ///
651    /// Parameter `inUnit`: The audio unit to initialize
652    ///
653    /// Returns: noErr, or an error representing the reasons why the audio unit was not able
654    /// to be initialized successfully
655    ///
656    /// # Safety
657    ///
658    /// `in_unit` must be a valid pointer.
659    #[cfg(feature = "AudioComponent")]
660    pub fn AudioUnitInitialize(in_unit: AudioUnit) -> OSStatus;
661}
662
663extern "C-unwind" {
664    /// uninitialize an audio unit
665    ///
666    /// Once an audio unit has been initialized, to change its state in response to
667    /// some kind of environmental change, the audio unit should be uninitialized.
668    /// This will have the effect of the audio unit de-allocating its resources.
669    /// The caller can then reconfigure the audio unit to match the new environment
670    /// (for instance, the sample rate to process audio is different than it was) and
671    /// then re-initialize the audio unit when those changes have been applied.
672    ///
673    ///
674    /// Parameter `inUnit`: The audio unit to uninitialize
675    ///
676    /// Returns: noErr, or an error representing the reasons why the audio unit was not able
677    /// to be initialized successfully. Typically this call won't return an error
678    /// unless the audio unit in question is no longer valid.
679    ///
680    /// # Safety
681    ///
682    /// `in_unit` must be a valid pointer.
683    #[cfg(feature = "AudioComponent")]
684    pub fn AudioUnitUninitialize(in_unit: AudioUnit) -> OSStatus;
685}
686
687extern "C-unwind" {
688    /// retrieves information about a specified property
689    ///
690    /// The API can be used to retrieve both the size of the property, and whether it
691    /// is writable or not. In order to get a general answer on the capability of an
692    /// audio unit, this function should be called before the audio unit
693    /// is initialized (as some properties are writable when the audio unit is
694    /// initialized, and others not)
695    ///
696    ///
697    /// Parameter `inUnit`: the audio unit
698    ///
699    /// Parameter `inID`: the property identifier
700    ///
701    /// Parameter `inScope`: the scope of the property
702    ///
703    /// Parameter `inElement`: the element of the scope
704    ///
705    /// Parameter `outDataSize`: if not null, then will retrieve the maximum size for the property. if null,
706    /// then it is ignored
707    ///
708    /// Parameter `outWritable`: if not null, then will retrieve whether the property can be written or not.
709    /// if null, then it is ignored
710    ///
711    ///
712    /// Returns: noErr, or various audio unit errors related to properties
713    ///
714    /// # Safety
715    ///
716    /// - `in_unit` must be a valid pointer.
717    /// - `out_data_size` must be a valid pointer or null.
718    /// - `out_writable` must be a valid pointer or null.
719    #[cfg(feature = "AudioComponent")]
720    pub fn AudioUnitGetPropertyInfo(
721        in_unit: AudioUnit,
722        in_id: AudioUnitPropertyID,
723        in_scope: AudioUnitScope,
724        in_element: AudioUnitElement,
725        out_data_size: *mut u32,
726        out_writable: *mut Boolean,
727    ) -> OSStatus;
728}
729
730extern "C-unwind" {
731    /// retrieves the value of a specified property
732    ///
733    /// The API can is used to retrieve the value of the property. Property values for
734    /// audio units are always passed by reference
735    ///
736    ///
737    /// Parameter `inUnit`: the audio unit
738    ///
739    /// Parameter `inID`: the property identifier
740    ///
741    /// Parameter `inScope`: the scope of the property
742    ///
743    /// Parameter `inElement`: the element of the scope
744    ///
745    /// Parameter `outData`: used to retrieve the value of the property. It should point to memory at least
746    /// as large as the value described by ioDataSize
747    ///
748    /// Parameter `ioDataSize`: on input contains the size of the data pointed to by outData, on output, the
749    /// size of the data that was returned.
750    ///
751    ///
752    /// Returns: noErr, or various audio unit errors related to properties
753    ///
754    /// # Safety
755    ///
756    /// - `in_unit` must be a valid pointer.
757    /// - `out_data` must be a valid pointer.
758    /// - `io_data_size` must be a valid pointer.
759    #[cfg(feature = "AudioComponent")]
760    pub fn AudioUnitGetProperty(
761        in_unit: AudioUnit,
762        in_id: AudioUnitPropertyID,
763        in_scope: AudioUnitScope,
764        in_element: AudioUnitElement,
765        out_data: NonNull<c_void>,
766        io_data_size: NonNull<u32>,
767    ) -> OSStatus;
768}
769
770extern "C-unwind" {
771    /// sets the value of a specified property
772    ///
773    /// The API can is used to set the value of the property. Property values for
774    /// audio units are always passed by reference
775    ///
776    ///
777    /// Parameter `inUnit`: the audio unit
778    ///
779    /// Parameter `inID`: the property identifier
780    ///
781    /// Parameter `inScope`: the scope of the property
782    ///
783    /// Parameter `inElement`: the element of the scope
784    ///
785    /// Parameter `inData`: if not null, then is the new value for the property that will be set. If null,
786    /// then inDataSize should be zero, and the call is then used to remove a
787    /// previously set value for a property. This removal is only valid for
788    /// some properties, as most properties will always have a default value if not
789    /// set.
790    ///
791    /// Parameter `inDataSize`: the size of the data being provided in inData
792    ///
793    ///
794    /// Returns: noErr, or various audio unit errors related to properties
795    ///
796    /// # Safety
797    ///
798    /// - `in_unit` must be a valid pointer.
799    /// - `in_data` must be a valid pointer or null.
800    #[cfg(feature = "AudioComponent")]
801    pub fn AudioUnitSetProperty(
802        in_unit: AudioUnit,
803        in_id: AudioUnitPropertyID,
804        in_scope: AudioUnitScope,
805        in_element: AudioUnitElement,
806        in_data: *const c_void,
807        in_data_size: u32,
808    ) -> OSStatus;
809}
810
811extern "C-unwind" {
812    /// registration call to receive notifications for when a property changes
813    ///
814    /// When an audio unit property value changes, a notification callback can be
815    /// called by the audio unit to  inform interested parties that this event has
816    /// occurred. The notification is defined by the tuple of inProc and
817    /// inProcUserData as paired to the specified property ID, so the previously
818    /// defined AudioUnitRemovePropertyListener is deprecated because it didn't allow
819    /// for the provision of the inProcUserData to remove a given listener (so,
820    /// you should use AudioUnitRemovePropertyListenerWithUserData).
821    ///
822    ///
823    /// Parameter `inUnit`: the audio unit
824    ///
825    /// Parameter `inID`: the property identifier
826    ///
827    /// Parameter `inProc`: the procedure to call when the property changes (on any scope or element)
828    ///
829    /// Parameter `inProcUserData`: the user data to provide with the callback
830    ///
831    ///
832    /// Returns: noErr, or various audio unit errors related to properties
833    ///
834    /// # Safety
835    ///
836    /// - `in_unit` must be a valid pointer.
837    /// - `in_proc` must be implemented correctly.
838    /// - `in_proc_user_data` must be a valid pointer or null.
839    #[cfg(feature = "AudioComponent")]
840    pub fn AudioUnitAddPropertyListener(
841        in_unit: AudioUnit,
842        in_id: AudioUnitPropertyID,
843        in_proc: AudioUnitPropertyListenerProc,
844        in_proc_user_data: *mut c_void,
845    ) -> OSStatus;
846}
847
848extern "C-unwind" {
849    /// remove a previously registered property listener
850    ///
851    /// Removes a previously registered property listener as specified by the inProc
852    /// and inProcUser data as paired to the property identifier
853    ///
854    ///
855    /// Parameter `inUnit`: the audio unit
856    ///
857    /// Parameter `inID`: the property identifier
858    ///
859    /// Parameter `inProc`: the procedure previously registered
860    ///
861    /// Parameter `inProcUserData`: the user data paired with the provided inProc
862    ///
863    ///
864    /// Returns: noErr, or various audio unit errors related to properties
865    ///
866    /// # Safety
867    ///
868    /// - `in_unit` must be a valid pointer.
869    /// - `in_proc` must be implemented correctly.
870    /// - `in_proc_user_data` must be a valid pointer or null.
871    #[cfg(feature = "AudioComponent")]
872    pub fn AudioUnitRemovePropertyListenerWithUserData(
873        in_unit: AudioUnit,
874        in_id: AudioUnitPropertyID,
875        in_proc: AudioUnitPropertyListenerProc,
876        in_proc_user_data: *mut c_void,
877    ) -> OSStatus;
878}
879
880extern "C-unwind" {
881    /// a notification callback to call when an audio unit is asked to render
882    ///
883    /// allows an application to register a callback with an audio unit for whenever
884    /// the audio unit is asked to render. The callback is called both before the
885    /// audio unit performs its render operations (the render flag's pre-render bit
886    /// is set) and after the audio unit has completed its render operations (the
887    /// render flag's post-render bit is set). On post-render, the audio buffer list
888    /// (ioData) will contain valid audio data that was rendered by the audio unit.
889    ///
890    /// The inProc and inProcUserData are treated as a tuple entity, so when wanting
891    /// to remove one, both the inProc and its inProcUserData must be specified
892    ///
893    ///
894    /// Parameter `inUnit`: the audio unit
895    ///
896    /// Parameter `inProc`: an AURenderCallback proc
897    ///
898    /// Parameter `inProcUserData`: the user data that will be provided with the proc when it is called
899    ///
900    ///
901    /// Returns: noErr, or an audio unit error code
902    ///
903    /// # Safety
904    ///
905    /// - `in_unit` must be a valid pointer.
906    /// - `in_proc` must be implemented correctly.
907    /// - `in_proc_user_data` must be a valid pointer or null.
908    #[cfg(all(feature = "AudioComponent", feature = "objc2-core-audio-types"))]
909    pub fn AudioUnitAddRenderNotify(
910        in_unit: AudioUnit,
911        in_proc: AURenderCallback,
912        in_proc_user_data: *mut c_void,
913    ) -> OSStatus;
914}
915
916extern "C-unwind" {
917    /// remove a previously registered render notification proc
918    ///
919    ///
920    /// Parameter `inUnit`: the audio unit
921    ///
922    /// Parameter `inProc`: an AURenderCallback proc
923    ///
924    /// Parameter `inProcUserData`: the user data that was provided with the proc when it was previously
925    /// registered
926    ///
927    ///
928    /// Returns: noErr, or an audio unit error code
929    ///
930    /// # Safety
931    ///
932    /// - `in_unit` must be a valid pointer.
933    /// - `in_proc` must be implemented correctly.
934    /// - `in_proc_user_data` must be a valid pointer or null.
935    #[cfg(all(feature = "AudioComponent", feature = "objc2-core-audio-types"))]
936    pub fn AudioUnitRemoveRenderNotify(
937        in_unit: AudioUnit,
938        in_proc: AURenderCallback,
939        in_proc_user_data: *mut c_void,
940    ) -> OSStatus;
941}
942
943extern "C-unwind" {
944    /// Get the value of a parameter
945    ///
946    /// Get the value of a parameter as specified by its ID, scope and element.
947    ///
948    ///
949    /// Parameter `inUnit`: the audio unit
950    ///
951    /// Parameter `inID`: the parameter ID
952    ///
953    /// Parameter `inScope`: the scope for the parameter
954    ///
955    /// Parameter `inElement`: the element on the scope for the parameter
956    ///
957    /// Parameter `outValue`: Must be non-null, and upon success will contain the current value for the
958    /// specified parameter
959    ///
960    ///
961    /// Returns: noErr, or an audio unit error code (such as InvalidParameter)
962    ///
963    /// # Safety
964    ///
965    /// - `in_unit` must be a valid pointer.
966    /// - `out_value` must be a valid pointer.
967    #[cfg(feature = "AudioComponent")]
968    pub fn AudioUnitGetParameter(
969        in_unit: AudioUnit,
970        in_id: AudioUnitParameterID,
971        in_scope: AudioUnitScope,
972        in_element: AudioUnitElement,
973        out_value: NonNull<AudioUnitParameterValue>,
974    ) -> OSStatus;
975}
976
977extern "C-unwind" {
978    /// Set the value of a parameter
979    ///
980    /// Set the value of a parameter as specified by its ID, scope and element.
981    /// Parameter IDs are consistent across all of the elements in a scope - so for a
982    /// mixer, the "input volume" parameter can be applied on any input, and the
983    /// particular input is specified by the elementID.
984    ///
985    ///
986    /// Parameter `inUnit`: the audio unit
987    ///
988    /// Parameter `inID`: the parameter ID
989    ///
990    /// Parameter `inScope`: the scope for the parameter
991    ///
992    /// Parameter `inElement`: the element on the scope for the parameter
993    ///
994    /// Parameter `inValue`: the new value for the parameter.
995    ///
996    /// Parameter `inBufferOffsetInFrames`: generally should be set to zero - see AudioUnitScheduleParameters
997    ///
998    ///
999    /// Returns: noErr, or an audio unit error code (such as InvalidParameter)
1000    ///
1001    /// # Safety
1002    ///
1003    /// `in_unit` must be a valid pointer.
1004    #[cfg(feature = "AudioComponent")]
1005    pub fn AudioUnitSetParameter(
1006        in_unit: AudioUnit,
1007        in_id: AudioUnitParameterID,
1008        in_scope: AudioUnitScope,
1009        in_element: AudioUnitElement,
1010        in_value: AudioUnitParameterValue,
1011        in_buffer_offset_in_frames: u32,
1012    ) -> OSStatus;
1013}
1014
1015extern "C-unwind" {
1016    /// the render operation where ioData will contain the results of the audio unit's
1017    /// render operations
1018    ///
1019    /// an audio unit will render the amount of audio data described by
1020    /// inNumberOfFrames and the results of that render will be contained within
1021    /// ioData. The caller should provide audio time stamps where at least the sample
1022    /// time is valid and it is incrementing sequentially from its previous call
1023    /// (so, the next time stamp will be the current time stamp + inNumberFrames)
1024    /// If the sample time is not incrementing sequentially, the audio unit will infer
1025    /// that there is some discontinuity with the timeline it is rendering for
1026    ///
1027    /// The caller must provide a valid ioData AudioBufferList that matches the
1028    /// expected topology for the current audio format for the given bus. The buffer
1029    /// list can be of two variants:
1030    /// (1) If the mData pointers are non-null then the audio unit will render its
1031    /// output into those buffers. These buffers should be aligned to 16 byte
1032    /// boundaries (which is normally what malloc will return).
1033    /// (2) If the mData pointers are null, then the audio unit can provide pointers
1034    /// to its own buffers. In this case the audio unit is required to keep those
1035    /// buffers valid for the duration of the calling thread's I/O cycle
1036    ///
1037    ///
1038    /// Parameter `inUnit`: the audio unit
1039    ///
1040    /// Parameter `ioActionFlags`: any appropriate action flags for the render operation
1041    ///
1042    /// Parameter `inTimeStamp`: the time stamp that applies to this particular render operation. when
1043    /// rendering for multiple output buses the time stamp will generally be the same
1044    /// for each output bus, so the audio unit is able to determine without doubt that
1045    /// this the same render operation
1046    ///
1047    /// Parameter `inOutputBusNumber`: the output bus to render for
1048    ///
1049    /// Parameter `inNumberFrames`: the number of sample frames to render
1050    ///
1051    /// Parameter `ioData`: the audio buffer list that the audio unit is to render into.
1052    ///
1053    ///
1054    /// Returns: noErr, or an audio unit render error
1055    ///
1056    /// # Safety
1057    ///
1058    /// - `in_unit` must be a valid pointer.
1059    /// - `io_action_flags` must be a valid pointer or null.
1060    /// - `in_time_stamp` must be a valid pointer.
1061    /// - `io_data` must be a valid pointer.
1062    #[cfg(all(feature = "AudioComponent", feature = "objc2-core-audio-types"))]
1063    pub fn AudioUnitRender(
1064        in_unit: AudioUnit,
1065        io_action_flags: *mut AudioUnitRenderActionFlags,
1066        in_time_stamp: NonNull<AudioTimeStamp>,
1067        in_output_bus_number: u32,
1068        in_number_frames: u32,
1069        io_data: NonNull<AudioBufferList>,
1070    ) -> OSStatus;
1071}
1072
1073extern "C-unwind" {
1074    /// # Safety
1075    ///
1076    /// - `in_unit` must be a valid pointer.
1077    /// - `io_action_flags` must be a valid pointer or null.
1078    /// - `in_time_stamp` must be a valid pointer.
1079    /// - `io_data` must be a valid pointer.
1080    #[cfg(all(feature = "AudioComponent", feature = "objc2-core-audio-types"))]
1081    pub fn AudioUnitProcess(
1082        in_unit: AudioUnit,
1083        io_action_flags: *mut AudioUnitRenderActionFlags,
1084        in_time_stamp: NonNull<AudioTimeStamp>,
1085        in_number_frames: u32,
1086        io_data: NonNull<AudioBufferList>,
1087    ) -> OSStatus;
1088}
1089
1090extern "C-unwind" {
1091    /// # Safety
1092    ///
1093    /// - `in_unit` must be a valid pointer.
1094    /// - `io_action_flags` must be a valid pointer or null.
1095    /// - `in_time_stamp` must be a valid pointer.
1096    /// - `in_input_buffer_lists` must be a valid pointer.
1097    /// - `io_output_buffer_lists` must be a valid pointer.
1098    #[cfg(all(feature = "AudioComponent", feature = "objc2-core-audio-types"))]
1099    pub fn AudioUnitProcessMultiple(
1100        in_unit: AudioUnit,
1101        io_action_flags: *mut AudioUnitRenderActionFlags,
1102        in_time_stamp: NonNull<AudioTimeStamp>,
1103        in_number_frames: u32,
1104        in_number_input_buffer_lists: u32,
1105        in_input_buffer_lists: NonNull<NonNull<AudioBufferList>>,
1106        in_number_output_buffer_lists: u32,
1107        io_output_buffer_lists: NonNull<NonNull<AudioBufferList>>,
1108    ) -> OSStatus;
1109}
1110
1111extern "C-unwind" {
1112    /// reset an audio unit's render state
1113    ///
1114    /// This call will clear any render state of an audio unit. For instance, with a
1115    /// delay or reverb type of audio unit reset will clear any of the delay lines
1116    /// maintained within the audio unit. Typically, this call is made when an
1117    /// audio unit was previously rendering, and was taken out of the render chain
1118    /// (say, the track it is in was muted) and is being added back in (unmuted).
1119    /// The host should reset the audio unit before adding it back so that it doesn't
1120    /// produce audio from its delay lines that is no longer valid.
1121    ///
1122    /// The call should only clear memory, it should NOT allocate or free memory
1123    /// resources (this is done in the Initialize calls).
1124    ///
1125    ///
1126    /// Parameter `inUnit`: the audio unit
1127    ///
1128    /// Parameter `inScope`: the scope - typically this is set to GlobalScope
1129    ///
1130    /// Parameter `inElement`: the element - typically this is set to 0
1131    ///
1132    ///
1133    /// Returns: noErr, or an audio unit error
1134    ///
1135    /// # Safety
1136    ///
1137    /// `in_unit` must be a valid pointer.
1138    #[cfg(feature = "AudioComponent")]
1139    pub fn AudioUnitReset(
1140        in_unit: AudioUnit,
1141        in_scope: AudioUnitScope,
1142        in_element: AudioUnitElement,
1143    ) -> OSStatus;
1144}
1145
1146extern "C-unwind" {
1147    /// Register an audio output unit as available to be used as an audio unit by
1148    /// other applications.
1149    ///
1150    ///
1151    /// Parameter `inOutputUnit`: The audio output unit to be published.
1152    ///
1153    /// Parameter `inDesc`: The AudioComponentDescription under which to register the application.
1154    ///
1155    /// Parameter `inName`: The application or component name.
1156    ///
1157    /// Returns: An OSStatus result code.
1158    ///
1159    ///
1160    /// This allows a publishing application to register its audio (input/)output unit as being able
1161    /// to be redirected and repurposed as an audio unit effect, generator, music device or music
1162    /// effect by another host application.
1163    ///
1164    /// # Safety
1165    ///
1166    /// - `in_desc` must be a valid pointer.
1167    /// - `in_output_unit` must be a valid pointer.
1168    #[cfg(all(feature = "AudioComponent", feature = "objc2-core-foundation"))]
1169    #[deprecated = "Inter-App Audio API is deprecated in favor of Audio Units"]
1170    pub fn AudioOutputUnitPublish(
1171        in_desc: NonNull<AudioComponentDescription>,
1172        in_name: &CFString,
1173        in_version: u32,
1174        in_output_unit: AudioUnit,
1175    ) -> OSStatus;
1176}
1177
1178extern "C-unwind" {
1179    /// Fetches the time at which the application publishing the component was last active.
1180    ///
1181    /// Inter-app audio hosts can use this to sort the list of available nodes by how recently
1182    /// the user interacted with them.
1183    ///
1184    ///
1185    /// Parameter `comp`: The AudioComponent being queried.
1186    ///
1187    /// Returns: The CFAbsoluteTime at which the node was last active (0 if never).
1188    ///
1189    /// # Safety
1190    ///
1191    /// `comp` must be a valid pointer.
1192    #[cfg(all(feature = "AudioComponent", feature = "objc2-core-foundation"))]
1193    #[deprecated = "Inter-App Audio API is deprecated in favor of Audio Units"]
1194    pub fn AudioComponentGetLastActiveTime(comp: AudioComponent) -> CFAbsoluteTime;
1195}
1196
1197extern "C-unwind" {
1198    /// Allows the implementor of an audio unit extension to dynamically modify the
1199    /// list of component registrations for the extension.
1200    ///
1201    /// Parameter `extensionIdentifier`: The bundle ID of the audio unit extension.
1202    ///
1203    /// Parameter `audioComponentInfo`: An array of dictionaries, one for each component, in the same format as
1204    /// described in AudioComponent.h for the Info.plist key "AudioComponents".
1205    ///
1206    /// Returns: An OSStatus result code.
1207    ///
1208    /// Note that the bundle ID of the process calling this API must prefix (or match)
1209    /// the provided extension identifier.
1210    ///
1211    /// # Safety
1212    ///
1213    /// `audio_component_info` generic must be of the correct type.
1214    #[cfg(feature = "objc2-core-foundation")]
1215    pub fn AudioUnitExtensionSetComponentList(
1216        extension_identifier: &CFString,
1217        audio_component_info: Option<&CFArray>,
1218    ) -> OSStatus;
1219}
1220
1221/// Returns the component registrations for a given audio unit extension.
1222///
1223/// Parameter `extensionIdentifier`: The bundle ID of the audio unit extension.
1224///
1225/// Returns: An array of dictionaries, one for each component, in the same format as
1226/// described in AudioComponent.h for the Info.plist key "AudioComponents".
1227/// The caller should release this value when done with it.
1228#[cfg(feature = "objc2-core-foundation")]
1229#[inline]
1230pub unsafe extern "C-unwind" fn AudioUnitExtensionCopyComponentList(
1231    extension_identifier: &CFString,
1232) -> Option<CFRetained<CFArray>> {
1233    extern "C-unwind" {
1234        fn AudioUnitExtensionCopyComponentList(
1235            extension_identifier: &CFString,
1236        ) -> Option<NonNull<CFArray>>;
1237    }
1238    let ret = unsafe { AudioUnitExtensionCopyComponentList(extension_identifier) };
1239    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1240}
1241
1242/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitrange?language=objc)
1243pub const kAudioUnitRange: c_uint = 0x0000;
1244/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitinitializeselect?language=objc)
1245pub const kAudioUnitInitializeSelect: c_uint = 0x0001;
1246/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounituninitializeselect?language=objc)
1247pub const kAudioUnitUninitializeSelect: c_uint = 0x0002;
1248/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitgetpropertyinfoselect?language=objc)
1249pub const kAudioUnitGetPropertyInfoSelect: c_uint = 0x0003;
1250/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitgetpropertyselect?language=objc)
1251pub const kAudioUnitGetPropertySelect: c_uint = 0x0004;
1252/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsetpropertyselect?language=objc)
1253pub const kAudioUnitSetPropertySelect: c_uint = 0x0005;
1254/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitaddpropertylistenerselect?language=objc)
1255pub const kAudioUnitAddPropertyListenerSelect: c_uint = 0x000A;
1256/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitremovepropertylistenerselect?language=objc)
1257pub const kAudioUnitRemovePropertyListenerSelect: c_uint = 0x000B;
1258/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitremovepropertylistenerwithuserdataselect?language=objc)
1259pub const kAudioUnitRemovePropertyListenerWithUserDataSelect: c_uint = 0x0012;
1260/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitaddrendernotifyselect?language=objc)
1261pub const kAudioUnitAddRenderNotifySelect: c_uint = 0x000F;
1262/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitremoverendernotifyselect?language=objc)
1263pub const kAudioUnitRemoveRenderNotifySelect: c_uint = 0x0010;
1264/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitgetparameterselect?language=objc)
1265pub const kAudioUnitGetParameterSelect: c_uint = 0x0006;
1266/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitsetparameterselect?language=objc)
1267pub const kAudioUnitSetParameterSelect: c_uint = 0x0007;
1268/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitscheduleparametersselect?language=objc)
1269pub const kAudioUnitScheduleParametersSelect: c_uint = 0x0011;
1270/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitrenderselect?language=objc)
1271pub const kAudioUnitRenderSelect: c_uint = 0x000E;
1272/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitresetselect?language=objc)
1273pub const kAudioUnitResetSelect: c_uint = 0x0009;
1274/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitcomplexrenderselect?language=objc)
1275pub const kAudioUnitComplexRenderSelect: c_uint = 0x0013;
1276/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitprocessselect?language=objc)
1277pub const kAudioUnitProcessSelect: c_uint = 0x0014;
1278/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiounitprocessmultipleselect?language=objc)
1279pub const kAudioUnitProcessMultipleSelect: c_uint = 0x0015;
1280
1281/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitinitializeproc?language=objc)
1282pub type AudioUnitInitializeProc = Option<unsafe extern "C-unwind" fn(NonNull<c_void>) -> OSStatus>;
1283
1284/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounituninitializeproc?language=objc)
1285pub type AudioUnitUninitializeProc =
1286    Option<unsafe extern "C-unwind" fn(NonNull<c_void>) -> OSStatus>;
1287
1288/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitgetpropertyinfoproc?language=objc)
1289pub type AudioUnitGetPropertyInfoProc = Option<
1290    unsafe extern "C-unwind" fn(
1291        NonNull<c_void>,
1292        AudioUnitPropertyID,
1293        AudioUnitScope,
1294        AudioUnitElement,
1295        *mut u32,
1296        *mut Boolean,
1297    ) -> OSStatus,
1298>;
1299
1300/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitgetpropertyproc?language=objc)
1301pub type AudioUnitGetPropertyProc = Option<
1302    unsafe extern "C-unwind" fn(
1303        NonNull<c_void>,
1304        AudioUnitPropertyID,
1305        AudioUnitScope,
1306        AudioUnitElement,
1307        NonNull<c_void>,
1308        NonNull<u32>,
1309    ) -> OSStatus,
1310>;
1311
1312/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitsetpropertyproc?language=objc)
1313pub type AudioUnitSetPropertyProc = Option<
1314    unsafe extern "C-unwind" fn(
1315        NonNull<c_void>,
1316        AudioUnitPropertyID,
1317        AudioUnitScope,
1318        AudioUnitElement,
1319        NonNull<c_void>,
1320        u32,
1321    ) -> OSStatus,
1322>;
1323
1324/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitaddpropertylistenerproc?language=objc)
1325#[cfg(feature = "AudioComponent")]
1326pub type AudioUnitAddPropertyListenerProc = Option<
1327    unsafe extern "C-unwind" fn(
1328        NonNull<c_void>,
1329        AudioUnitPropertyID,
1330        AudioUnitPropertyListenerProc,
1331        NonNull<c_void>,
1332    ) -> OSStatus,
1333>;
1334
1335/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitremovepropertylistenerproc?language=objc)
1336#[cfg(feature = "AudioComponent")]
1337pub type AudioUnitRemovePropertyListenerProc = Option<
1338    unsafe extern "C-unwind" fn(
1339        NonNull<c_void>,
1340        AudioUnitPropertyID,
1341        AudioUnitPropertyListenerProc,
1342    ) -> OSStatus,
1343>;
1344
1345/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitremovepropertylistenerwithuserdataproc?language=objc)
1346#[cfg(feature = "AudioComponent")]
1347pub type AudioUnitRemovePropertyListenerWithUserDataProc = Option<
1348    unsafe extern "C-unwind" fn(
1349        NonNull<c_void>,
1350        AudioUnitPropertyID,
1351        AudioUnitPropertyListenerProc,
1352        *mut c_void,
1353    ) -> OSStatus,
1354>;
1355
1356/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitaddrendernotifyproc?language=objc)
1357#[cfg(feature = "objc2-core-audio-types")]
1358pub type AudioUnitAddRenderNotifyProc =
1359    Option<unsafe extern "C-unwind" fn(NonNull<c_void>, AURenderCallback, *mut c_void) -> OSStatus>;
1360
1361/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitremoverendernotifyproc?language=objc)
1362#[cfg(feature = "objc2-core-audio-types")]
1363pub type AudioUnitRemoveRenderNotifyProc =
1364    Option<unsafe extern "C-unwind" fn(NonNull<c_void>, AURenderCallback, *mut c_void) -> OSStatus>;
1365
1366/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitresetproc?language=objc)
1367pub type AudioUnitResetProc = Option<
1368    unsafe extern "C-unwind" fn(NonNull<c_void>, AudioUnitScope, AudioUnitElement) -> OSStatus,
1369>;
1370
1371/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitcomplexrenderproc?language=objc)
1372#[cfg(feature = "objc2-core-audio-types")]
1373pub type AudioUnitComplexRenderProc = Option<
1374    unsafe extern "C-unwind" fn(
1375        NonNull<c_void>,
1376        *mut AudioUnitRenderActionFlags,
1377        NonNull<AudioTimeStamp>,
1378        u32,
1379        u32,
1380        NonNull<u32>,
1381        NonNull<AudioStreamPacketDescription>,
1382        NonNull<AudioBufferList>,
1383        NonNull<c_void>,
1384        NonNull<u32>,
1385    ) -> OSStatus,
1386>;
1387
1388/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitprocessproc?language=objc)
1389#[cfg(feature = "objc2-core-audio-types")]
1390pub type AudioUnitProcessProc = Option<
1391    unsafe extern "C-unwind" fn(
1392        NonNull<c_void>,
1393        *mut AudioUnitRenderActionFlags,
1394        NonNull<AudioTimeStamp>,
1395        u32,
1396        NonNull<AudioBufferList>,
1397    ) -> OSStatus,
1398>;
1399
1400/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitprocessmultipleproc?language=objc)
1401#[cfg(feature = "objc2-core-audio-types")]
1402pub type AudioUnitProcessMultipleProc = Option<
1403    unsafe extern "C-unwind" fn(
1404        NonNull<c_void>,
1405        *mut AudioUnitRenderActionFlags,
1406        NonNull<AudioTimeStamp>,
1407        u32,
1408        u32,
1409        NonNull<NonNull<AudioBufferList>>,
1410        u32,
1411        NonNull<NonNull<AudioBufferList>>,
1412    ) -> OSStatus,
1413>;
1414
1415/// This proc can be exported through the FastDispatch property or is used as the prototype for
1416/// an audio component dispatch for this selector.
1417///
1418/// The arguments are the same as are provided to the corresponding API call
1419///
1420///
1421/// Parameter `inComponentStorage`: For a component manager component, this is the component instance storage
1422/// pointer
1423///
1424/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitgetparameterproc?language=objc)
1425pub type AudioUnitGetParameterProc = Option<
1426    unsafe extern "C-unwind" fn(
1427        NonNull<c_void>,
1428        AudioUnitParameterID,
1429        AudioUnitScope,
1430        AudioUnitElement,
1431        NonNull<AudioUnitParameterValue>,
1432    ) -> OSStatus,
1433>;
1434
1435/// This proc can be exported through the FastDispatch property or is used as the prototype for
1436/// an audio component dispatch for this selector.
1437///
1438/// The arguments are the same as are provided to the corresponding API call
1439///
1440///
1441/// Parameter `inComponentStorage`: For a component manager component, this is the component instance storage
1442/// pointer
1443///
1444/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitsetparameterproc?language=objc)
1445pub type AudioUnitSetParameterProc = Option<
1446    unsafe extern "C-unwind" fn(
1447        NonNull<c_void>,
1448        AudioUnitParameterID,
1449        AudioUnitScope,
1450        AudioUnitElement,
1451        AudioUnitParameterValue,
1452        u32,
1453    ) -> OSStatus,
1454>;
1455
1456/// This proc can be exported through the FastDispatch property or is used as the prototype for
1457/// an audio component dispatch for this selector.
1458///
1459/// The arguments are the same as are provided to the corresponding API call
1460///
1461///
1462/// Parameter `inComponentStorage`: For a component manager component, this is the component instance storage
1463/// pointer
1464///
1465/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitrenderproc?language=objc)
1466#[cfg(feature = "objc2-core-audio-types")]
1467pub type AudioUnitRenderProc = Option<
1468    unsafe extern "C-unwind" fn(
1469        NonNull<c_void>,
1470        *mut AudioUnitRenderActionFlags,
1471        NonNull<AudioTimeStamp>,
1472        u32,
1473        u32,
1474        NonNull<AudioBufferList>,
1475    ) -> OSStatus,
1476>;
1477
1478/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_illegalinstrument?language=objc)
1479#[deprecated]
1480pub const kAudioUnitErr_IllegalInstrument: OSStatus = -10873;
1481/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiouniterr_instrumenttypenotfound?language=objc)
1482#[deprecated]
1483pub const kAudioUnitErr_InstrumentTypeNotFound: OSStatus = -10872;