objc2_audio_toolbox/generated/AudioComponent.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7use objc2::__framework_prelude::*;
8#[cfg(feature = "objc2-core-foundation")]
9use objc2_core_foundation::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponentconfigurationinfo_validationresult?language=objc)
14pub const kAudioComponentConfigurationInfo_ValidationResult: &CStr =
15 unsafe { CStr::from_bytes_with_nul_unchecked(b"ValidationResult\0") };
16/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponentvalidationparameter_timeout?language=objc)
17pub const kAudioComponentValidationParameter_TimeOut: &CStr =
18 unsafe { CStr::from_bytes_with_nul_unchecked(b"TimeOut\0") };
19/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponentvalidationparameter_forcevalidation?language=objc)
20pub const kAudioComponentValidationParameter_ForceValidation: &CStr =
21 unsafe { CStr::from_bytes_with_nul_unchecked(b"ForceValidation\0") };
22/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaudiocomponentvalidationparameter_loadoutofprocess?language=objc)
23pub const kAudioComponentValidationParameter_LoadOutOfProcess: &CStr =
24 unsafe { CStr::from_bytes_with_nul_unchecked(b"LoadOutOfProcess\0") };
25/// Flags found in AudioComponentDescription.componentFlags.
26///
27///
28/// When this bit in AudioComponentDescription's componentFlags is set, AudioComponentFindNext
29/// will only return this component when performing a specific, non-wildcard search for the
30/// component, i.e. with non-zero values of componentType, componentSubType, and
31/// componentManufacturer. This can be useful when privately registering a component.
32///
33///
34/// An AudioComponent sets this bit in its componentFlags to indicate to the system that the
35/// AudioComponent is safe to open in a sandboxed process.
36///
37///
38/// The system sets this flag automatically when registering components which implement a version 3
39/// Audio Unit.
40///
41///
42/// The system sets this flag automatically when registering components which require asynchronous
43/// instantiation via AudioComponentInstantiate (v3 audio units with views).
44///
45///
46/// The system sets this flag automatically when registering components which can be loaded into
47/// the current process. This is always true for V2 audio units; it depends on the packaging
48/// in the case of a V3 audio unit.
49///
50/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponentflags?language=objc)
51// NS_OPTIONS
52#[repr(transparent)]
53#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
54pub struct AudioComponentFlags(pub u32);
55bitflags::bitflags! {
56 impl AudioComponentFlags: u32 {
57 #[doc(alias = "kAudioComponentFlag_Unsearchable")]
58 const Unsearchable = 1;
59 #[doc(alias = "kAudioComponentFlag_SandboxSafe")]
60 const SandboxSafe = 2;
61 #[doc(alias = "kAudioComponentFlag_IsV3AudioUnit")]
62 const IsV3AudioUnit = 4;
63 #[doc(alias = "kAudioComponentFlag_RequiresAsyncInstantiation")]
64 const RequiresAsyncInstantiation = 8;
65 #[doc(alias = "kAudioComponentFlag_CanLoadInProcess")]
66 const CanLoadInProcess = 0x10;
67 }
68}
69
70unsafe impl Encode for AudioComponentFlags {
71 const ENCODING: Encoding = u32::ENCODING;
72}
73
74unsafe impl RefEncode for AudioComponentFlags {
75 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
76}
77
78/// Options controlling component instantiation.
79///
80/// Most component instances are loaded into the calling process.
81///
82/// A version 3 audio unit, however, can be loaded into a separate extension service process,
83/// and this is the default behavior for these components. To be able to load one in-process
84/// requires that the developer package the audio unit in a bundle separate from the application
85/// extension, since an extension's main binary cannot be dynamically loaded into another
86/// process.
87///
88/// A macOS host may request in-process loading of such audio units using
89/// kAudioComponentInstantiation_LoadInProcess.
90///
91/// kAudioComponentFlag_IsV3AudioUnit specifies whether an audio unit is implemented using API
92/// version 3.
93///
94/// These options are just requests to the implementation. It may fail and fall back to the
95/// default.
96///
97/// Attempt to load the component into a separate extension process.
98///
99/// Attempt to load the component into the current process. Only available on macOS.
100///
101/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponentinstantiationoptions?language=objc)
102// NS_OPTIONS
103#[repr(transparent)]
104#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
105pub struct AudioComponentInstantiationOptions(pub u32);
106bitflags::bitflags! {
107 impl AudioComponentInstantiationOptions: u32 {
108 #[doc(alias = "kAudioComponentInstantiation_LoadOutOfProcess")]
109 const LoadOutOfProcess = 1;
110 #[doc(alias = "kAudioComponentInstantiation_LoadInProcess")]
111 const LoadInProcess = 2;
112 #[doc(alias = "kAudioComponentInstantiation_LoadedRemotely")]
113 const LoadedRemotely = 1<<31;
114 }
115}
116
117unsafe impl Encode for AudioComponentInstantiationOptions {
118 const ENCODING: Encoding = u32::ENCODING;
119}
120
121unsafe impl RefEncode for AudioComponentInstantiationOptions {
122 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
123}
124
125/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponentdescription?language=objc)
126#[repr(C)]
127#[derive(Clone, Copy, Debug, PartialEq)]
128pub struct AudioComponentDescription {
129 pub componentType: OSType,
130 pub componentSubType: OSType,
131 pub componentManufacturer: OSType,
132 pub componentFlags: u32,
133 pub componentFlagsMask: u32,
134}
135
136unsafe impl Encode for AudioComponentDescription {
137 const ENCODING: Encoding = Encoding::Struct(
138 "AudioComponentDescription",
139 &[
140 <OSType>::ENCODING,
141 <OSType>::ENCODING,
142 <OSType>::ENCODING,
143 <u32>::ENCODING,
144 <u32>::ENCODING,
145 ],
146 );
147}
148
149unsafe impl RefEncode for AudioComponentDescription {
150 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
151}
152
153/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/opaqueaudiocomponent?language=objc)
154#[repr(C)]
155#[derive(Debug)]
156pub struct OpaqueAudioComponent {
157 inner: [u8; 0],
158 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
159}
160
161unsafe impl RefEncode for OpaqueAudioComponent {
162 const ENCODING_REF: Encoding =
163 Encoding::Pointer(&Encoding::Struct("OpaqueAudioComponent", &[]));
164}
165
166/// The type used to represent a class of particular audio components
167///
168/// An audio component is usually found through a search and is then uniquely
169/// identified by the triple of an audio component's type, subtype and
170/// manufacturer.
171///
172/// It can have properties associated with it (such as a name, a version).
173///
174/// It is then used as a factory (like a class in an object-oriented programming
175/// language) from which to create instances. The instances are used to do the
176/// actual work.
177///
178/// For example: the AudioComponentDescription 'aufx'/'dely'/'appl' describes the
179/// delay audio unit effect from Apple, Inc. You can find this component by
180/// searching explicitly for the audio component that matches this pattern (this is
181/// an unique identifier - there is only one match to this triple ID). Then once
182/// found, instances of the Apple delay effect audio unit can be created from its
183/// audio component and used to apply that effect to an audio signal. A single
184/// component can create any number of component instances.
185///
186/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponent?language=objc)
187pub type AudioComponent = *mut OpaqueAudioComponent;
188
189/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/opaqueaudiocomponentinstance?language=objc)
190#[repr(C)]
191#[derive(Debug)]
192pub struct OpaqueAudioComponentInstance {
193 inner: [u8; 0],
194 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
195}
196
197unsafe impl RefEncode for OpaqueAudioComponentInstance {
198 const ENCODING_REF: Encoding =
199 Encoding::Pointer(&Encoding::Struct("OpaqueAudioComponentInstance", &[]));
200}
201
202/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponentinstance?language=objc)
203pub type AudioComponentInstance = *mut OpaqueAudioComponentInstance;
204
205/// Generic prototype for an audio plugin method.
206///
207/// Every audio plugin will implement a collection of methods that match a particular
208/// selector. For example, the AudioUnitInitialize API call is implemented by a
209/// plugin implementing the kAudioUnitInitializeSelect selector. Any function implementing
210/// an audio plugin selector conforms to the basic pattern where the first argument
211/// is a pointer to the plugin instance structure, has 0 or more specific arguments,
212/// and returns an OSStatus.
213///
214/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponentmethod?language=objc)
215pub type AudioComponentMethod =
216 Option<unsafe extern "C-unwind" fn(NonNull<c_void>, ...) -> OSStatus>;
217
218/// A structure used to represent an audio plugin's routines
219///
220/// the function used to open (or create) an audio plugin instance
221///
222/// the function used to close (or dispose) an audio plugin instance
223///
224/// this is used to return a function pointer for a given selector,
225/// or NULL if that selector is not implemented
226///
227/// must be NULL
228///
229/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponentplugininterface?language=objc)
230#[repr(C)]
231#[derive(Clone, Copy, Debug, PartialEq)]
232pub struct AudioComponentPlugInInterface {
233 pub Open: unsafe extern "C-unwind" fn(NonNull<c_void>, AudioComponentInstance) -> OSStatus,
234 pub Close: unsafe extern "C-unwind" fn(NonNull<c_void>) -> OSStatus,
235 pub Lookup: unsafe extern "C-unwind" fn(i16) -> AudioComponentMethod,
236 pub reserved: *mut c_void,
237}
238
239unsafe impl Encode for AudioComponentPlugInInterface {
240 const ENCODING: Encoding = Encoding::Struct("AudioComponentPlugInInterface", &[
241 <unsafe extern "C-unwind" fn(NonNull<c_void>,AudioComponentInstance,) -> OSStatus>::ENCODING,
242 <unsafe extern "C-unwind" fn(NonNull<c_void>,) -> OSStatus>::ENCODING,
243 <unsafe extern "C-unwind" fn(i16,) -> AudioComponentMethod>::ENCODING,
244 <*mut c_void>::ENCODING,
245 ]);
246}
247
248unsafe impl RefEncode for AudioComponentPlugInInterface {
249 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
250}
251
252/// A function that creates AudioComponentInstances.
253///
254/// Authors of AudioComponents may register them from bundles as described
255/// above in the discussion of this header file, or dynamically within a single
256/// process, using AudioComponentRegister.
257///
258///
259/// Parameter `inDesc`: The AudioComponentDescription specifying the component to be instantiated.
260///
261/// Returns: A pointer to a AudioComponentPlugInInterface structure.
262///
263/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponentfactoryfunction?language=objc)
264pub type AudioComponentFactoryFunction = Option<
265 unsafe extern "C-unwind" fn(
266 NonNull<AudioComponentDescription>,
267 ) -> *mut AudioComponentPlugInInterface,
268>;
269
270extern "C-unwind" {
271 /// Finds an audio component.
272 ///
273 /// This function is used to find an audio component that is the closest match
274 /// to the provided values. Note that the list of available components may change
275 /// dynamically in situations involving inter-app audio on iOS, or version 3
276 /// audio unit extensions. See kAudioComponentRegistrationsChangedNotification.
277 ///
278 ///
279 /// Parameter `inComponent`: If NULL, then the search starts from the beginning until an audio
280 /// component is found that matches the description provided by inDesc.
281 /// If non-NULL, then the search starts (continues) from the previously
282 /// found audio component specified by inComponent, and will return the next
283 /// found audio component.
284 ///
285 /// Parameter `inDesc`: The type, subtype and manufacturer fields are used to specify the audio
286 /// component to search for. A value of 0 (zero) for any of these fields is
287 /// a wildcard, so the first match found is returned.
288 ///
289 /// Returns: An audio component that matches the search parameters, or NULL if none found.
290 pub fn AudioComponentFindNext(
291 in_component: AudioComponent,
292 in_desc: NonNull<AudioComponentDescription>,
293 ) -> AudioComponent;
294}
295
296extern "C-unwind" {
297 /// Counts audio components.
298 ///
299 /// Returns the number of AudioComponents that match the specified
300 /// AudioComponentDescription.
301 ///
302 /// Parameter `inDesc`: The type, subtype and manufacturer fields are used to specify the audio
303 /// components to count A value of 0 (zero) for any of these fields is a
304 /// wildcard, so will match any value for this field
305 ///
306 /// Returns: a UInt32. 0 (zero) means no audio components were found that matched the
307 /// search parameters.
308 pub fn AudioComponentCount(in_desc: NonNull<AudioComponentDescription>) -> u32;
309}
310
311extern "C-unwind" {
312 /// Retrieves the name of an audio component.
313 ///
314 /// the name of an audio component
315 ///
316 /// Parameter `inComponent`: the audio component (must not be NULL)
317 ///
318 /// Parameter `outName`: a CFString that is the name of the audio component. This string should
319 /// be released by the caller.
320 ///
321 /// Returns: an OSStatus result code.
322 #[cfg(feature = "objc2-core-foundation")]
323 pub fn AudioComponentCopyName(
324 in_component: AudioComponent,
325 out_name: NonNull<*const CFString>,
326 ) -> OSStatus;
327}
328
329extern "C-unwind" {
330 /// Retrieve an audio component's description.
331 ///
332 /// This will return the fully specified audio component description for the
333 /// provided audio component.
334 ///
335 /// Parameter `inComponent`: the audio component (must not be NULL)
336 ///
337 /// Parameter `outDesc`: the audio component description for the specified audio component
338 ///
339 /// Returns: an OSStatus result code.
340 pub fn AudioComponentGetDescription(
341 in_component: AudioComponent,
342 out_desc: NonNull<AudioComponentDescription>,
343 ) -> OSStatus;
344}
345
346extern "C-unwind" {
347 /// Retrieve an audio component's version.
348 ///
349 /// Parameter `inComponent`: the audio component (must not be NULL)
350 ///
351 /// Parameter `outVersion`: the audio component's version in the form of 0xMMMMmmDD (Major, Minor, Dot)
352 ///
353 /// Returns: an OSStatus result code.
354 pub fn AudioComponentGetVersion(
355 in_component: AudioComponent,
356 out_version: NonNull<u32>,
357 ) -> OSStatus;
358}
359
360extern "C-unwind" {
361 /// Creates an audio component instance.
362 ///
363 /// This function creates an instance of a given audio component. The audio
364 /// component instance is the object that does all of the work, whereas the
365 /// audio component is the way an application finds and then creates this object
366 /// to do this work. For example, an audio unit is a type of audio component
367 /// instance, so to use an audio unit, one finds its audio component, and then
368 /// creates a new instance of that component. This instance is then used to
369 /// perform the audio tasks for which it was designed (process, mix, synthesise,
370 /// etc.).
371 ///
372 /// Parameter `inComponent`: the audio component (must not be NULL)
373 ///
374 /// Parameter `outInstance`: the audio component instance
375 ///
376 /// Returns: an OSStatus result code.
377 pub fn AudioComponentInstanceNew(
378 in_component: AudioComponent,
379 out_instance: NonNull<AudioComponentInstance>,
380 ) -> OSStatus;
381}
382
383extern "C-unwind" {
384 /// Creates an audio component instance, asynchronously.
385 ///
386 /// This is an asynchronous version of AudioComponentInstanceNew(). It must be
387 /// used to instantiate any component with kAudioComponentFlag_RequiresAsyncInstantiation
388 /// set in its component flags. It may be used for other components as well.
389 ///
390 /// Note: Do not block the main thread while waiting for the completion handler
391 /// to be called; this can deadlock.
392 ///
393 /// Parameter `inComponent`: the audio component
394 ///
395 /// Parameter `inOptions`: see AudioComponentInstantiationOptions
396 ///
397 /// Parameter `inCompletionHandler`: called in an arbitrary thread context when instantiation is complete.
398 #[cfg(feature = "block2")]
399 pub fn AudioComponentInstantiate(
400 in_component: AudioComponent,
401 in_options: AudioComponentInstantiationOptions,
402 in_completion_handler: &block2::DynBlock<dyn Fn(AudioComponentInstance, OSStatus)>,
403 );
404}
405
406extern "C-unwind" {
407 /// Disposes of an audio component instance.
408 ///
409 /// This function will dispose the audio component instance that was created
410 /// with the New call. It will deallocate any resources that the instance was using.
411 ///
412 /// Parameter `inInstance`: the audio component instance to dispose (must not be NULL)
413 ///
414 /// Returns: an OSStatus result code.
415 pub fn AudioComponentInstanceDispose(in_instance: AudioComponentInstance) -> OSStatus;
416}
417
418extern "C-unwind" {
419 /// Retrieve the audio component from its instance
420 ///
421 /// Allows the application at any time to retrieve the audio component that is
422 /// the factory object of a given instance (i.e., the audio component that was
423 /// used to create the instance in the first place). This allows the application
424 /// to retrieve general information about a particular audio component (its
425 /// name, version, etc) when one just has an audio component instance to work
426 /// with
427 ///
428 /// Parameter `inInstance`: the audio component instance (must not be NULL, and instance must be valid - that is, not disposed)
429 ///
430 /// Returns: a valid audio component or NULL if no component was found.
431 pub fn AudioComponentInstanceGetComponent(
432 in_instance: AudioComponentInstance,
433 ) -> AudioComponent;
434}
435
436/// Determines if an audio component instance implements a particular component
437/// API call as signified by the specified selector identifier token.
438///
439/// Parameter `inInstance`: the audio component instance
440///
441/// Parameter `inSelectorID`: a number to signify the audio component API (component selector) as appropriate for the instance's component type.
442///
443/// Returns: a boolean
444#[inline]
445pub unsafe extern "C-unwind" fn AudioComponentInstanceCanDo(
446 in_instance: AudioComponentInstance,
447 in_selector_id: i16,
448) -> bool {
449 extern "C-unwind" {
450 fn AudioComponentInstanceCanDo(
451 in_instance: AudioComponentInstance,
452 in_selector_id: i16,
453 ) -> Boolean;
454 }
455 let ret = unsafe { AudioComponentInstanceCanDo(in_instance, in_selector_id) };
456 ret != 0
457}
458
459extern "C-unwind" {
460 /// Dynamically registers an AudioComponent within the current process
461 ///
462 /// AudioComponents are registered either when found in appropriate bundles in the filesystem,
463 /// or via this call. AudioComponents registered via this call are available only within
464 /// the current process.
465 ///
466 ///
467 /// Parameter `inDesc`: The AudioComponentDescription that describes the AudioComponent. Note that
468 /// the registrar needs to be sure to set the flag kAudioComponentFlag_SandboxSafe
469 /// in the componentFlags field of the AudioComponentDescription to indicate that
470 /// the AudioComponent can be loaded directly into a sandboxed process.
471 ///
472 /// Parameter `inName`: the AudioComponent's name
473 ///
474 /// Parameter `inVersion`: the AudioComponent's version
475 ///
476 /// Parameter `inFactory`: an AudioComponentFactoryFunction which will create instances of your
477 /// AudioComponent
478 ///
479 /// Returns: an AudioComponent object
480 #[cfg(feature = "objc2-core-foundation")]
481 pub fn AudioComponentRegister(
482 in_desc: NonNull<AudioComponentDescription>,
483 in_name: &CFString,
484 in_version: u32,
485 in_factory: AudioComponentFactoryFunction,
486 ) -> AudioComponent;
487}
488
489extern "C-unwind" {
490 /// Fetches the basic configuration info about a given AudioComponent
491 ///
492 /// Currently, only AudioUnits can supply this information.
493 ///
494 /// Parameter `inComponent`: The AudioComponent whose info is being fetched.
495 ///
496 /// Parameter `outConfigurationInfo`: On exit, this is CFDictionaryRef that contains information describing the
497 /// capabilities of the AudioComponent. The specific information depends on the
498 /// type of AudioComponent. The keys for the dictionary are defined in
499 /// AudioUnitProperties.h (or other headers as appropriate for the component type).
500 ///
501 /// Returns: An OSStatus indicating success or failure.
502 #[cfg(feature = "objc2-core-foundation")]
503 pub fn AudioComponentCopyConfigurationInfo(
504 in_component: AudioComponent,
505 out_configuration_info: NonNull<*const CFDictionary>,
506 ) -> OSStatus;
507}
508
509/// Constants for describing the result of validating an AudioComponent
510///
511/// The AudioComponent passed validation.
512///
513/// The AudioComponent failed validation.
514///
515/// The validation operation timed out before completing.
516///
517/// The AudioComponent failed validation during open operation as it is not authorized.
518///
519/// The AudioComponent failed validation during initialization as it is not authorized.
520///
521/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiocomponentvalidationresult?language=objc)
522// NS_ENUM
523#[repr(transparent)]
524#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
525pub struct AudioComponentValidationResult(pub u32);
526impl AudioComponentValidationResult {
527 #[doc(alias = "kAudioComponentValidationResult_Unknown")]
528 pub const Unknown: Self = Self(0);
529 #[doc(alias = "kAudioComponentValidationResult_Passed")]
530 pub const Passed: Self = Self(1);
531 #[doc(alias = "kAudioComponentValidationResult_Failed")]
532 pub const Failed: Self = Self(2);
533 #[doc(alias = "kAudioComponentValidationResult_TimedOut")]
534 pub const TimedOut: Self = Self(3);
535 #[doc(alias = "kAudioComponentValidationResult_UnauthorizedError_Open")]
536 pub const UnauthorizedError_Open: Self = Self(4);
537 #[doc(alias = "kAudioComponentValidationResult_UnauthorizedError_Init")]
538 pub const UnauthorizedError_Init: Self = Self(5);
539}
540
541unsafe impl Encode for AudioComponentValidationResult {
542 const ENCODING: Encoding = u32::ENCODING;
543}
544
545unsafe impl RefEncode for AudioComponentValidationResult {
546 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
547}
548
549extern "C-unwind" {
550 #[cfg(feature = "objc2-core-foundation")]
551 pub fn AudioComponentValidate(
552 in_component: AudioComponent,
553 in_validation_parameters: Option<&CFDictionary>,
554 out_validation_result: NonNull<AudioComponentValidationResult>,
555 ) -> OSStatus;
556}
557
558extern "C-unwind" {
559 /// Tests a specified AudioComponent for API and behavioral conformance
560 /// asynchronously, returning detailed validation results.
561 ///
562 /// Currently, only AudioUnits can can be validated. The `inCompletionHandler` callback
563 /// has two parameters, an `AudioComponentValidationResult` with result of the validation,
564 /// and a `CFDictionaryRef` which contains the details of this result.
565 /// This dictionary may contain the following entries:
566 /// "Output"
567 /// An array of strings, with the same content as if the AU was validated on auval.
568 /// "Result"
569 /// An `AudioComponentValidationResult` with the result of the validation
570 /// process. The same as what's in the `AudioComponentValidationResult`
571 /// in the `inCompletionHandler` and what `AudioComponentValidate`
572 /// currently returns.
573 /// "Tests"
574 /// An array in which each value is a dictionary and may contain:
575 /// "Name"
576 /// A descriptive name of the test.
577 /// "Result"
578 /// An `AudioComponentValidationResult` with the result of the
579 /// specific test.
580 /// "Output"
581 /// An array of strings with output generated by the test.
582 /// "WasCached"
583 /// `YES` if the returned result was cached from previous runs.
584 ///
585 /// Parameter `inComponent`: The AudioComponent to validate.
586 ///
587 /// Parameter `inValidationParameters`: A CFDictionaryRef that contains parameters for the validation operation.
588 /// Passing NULL for this argument tells the system to use the default
589 /// parameters.
590 ///
591 /// Parameter `inCompletionHandler`: Completion callback. See discussion section.
592 ///
593 /// Returns: an OSStatus result code.
594 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
595 pub fn AudioComponentValidateWithResults(
596 in_component: AudioComponent,
597 in_validation_parameters: Option<&CFDictionary>,
598 in_completion_handler: &block2::DynBlock<
599 dyn Fn(AudioComponentValidationResult, NonNull<CFDictionary>),
600 >,
601 ) -> OSStatus;
602}