objc2_avf_audio/generated/
AVAudioUnitEffect.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-audio-toolbox")]
7#[cfg(not(target_os = "watchos"))]
8use objc2_audio_toolbox::*;
9
10use crate::*;
11
12extern_class!(
13    /// an AVAudioUnit that processes audio in real-time
14    ///
15    /// An AVAudioUnitEffect represents an audio unit of type kAudioUnitType_Effect,
16    /// kAudioUnitType_MusicEffect, kAudioUnitType_Panner, kAudioUnitType_RemoteEffect or
17    /// kAudioUnitType_RemoteMusicEffect.
18    ///
19    /// These effects run in real-time and process some x number of audio input
20    /// samples to produce x number of audio output samples. A delay unit is an
21    /// example of an effect unit.
22    ///
23    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiouniteffect?language=objc)
24    #[unsafe(super(AVAudioUnit, AVAudioNode, NSObject))]
25    #[derive(Debug, PartialEq, Eq, Hash)]
26    #[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
27    pub struct AVAudioUnitEffect;
28);
29
30#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
31extern_conformance!(
32    unsafe impl NSObjectProtocol for AVAudioUnitEffect {}
33);
34
35#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
36impl AVAudioUnitEffect {
37    extern_methods!(
38        #[cfg(feature = "objc2-audio-toolbox")]
39        #[cfg(not(target_os = "watchos"))]
40        /// Create an AVAudioUnitEffect object.
41        ///
42        ///
43        /// Parameter `audioComponentDescription`: AudioComponentDescription of the audio unit to be instantiated.
44        ///
45        /// The componentType must be one of these types
46        /// kAudioUnitType_Effect
47        /// kAudioUnitType_MusicEffect
48        /// kAudioUnitType_Panner
49        /// kAudioUnitType_RemoteEffect
50        /// kAudioUnitType_RemoteMusicEffect
51        #[unsafe(method(initWithAudioComponentDescription:))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithAudioComponentDescription(
54            this: Allocated<Self>,
55            audio_component_description: AudioComponentDescription,
56        ) -> Retained<Self>;
57
58        /// Bypass state of the audio unit.
59        #[unsafe(method(bypass))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn bypass(&self) -> bool;
62
63        /// Setter for [`bypass`][Self::bypass].
64        #[unsafe(method(setBypass:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setBypass(&self, bypass: bool);
67    );
68}
69
70/// Methods declared on superclass `NSObject`.
71#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
72impl AVAudioUnitEffect {
73    extern_methods!(
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[unsafe(method(new))]
79        #[unsafe(method_family = new)]
80        pub unsafe fn new() -> Retained<Self>;
81    );
82}