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"))]
31unsafe impl NSObjectProtocol for AVAudioUnitEffect {}
32
33#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
34impl AVAudioUnitEffect {
35    extern_methods!(
36        #[cfg(feature = "objc2-audio-toolbox")]
37        #[cfg(not(target_os = "watchos"))]
38        /// Create an AVAudioUnitEffect object.
39        ///
40        ///
41        /// Parameter `audioComponentDescription`: AudioComponentDescription of the audio unit to be instantiated.
42        ///
43        /// The componentType must be one of these types
44        /// kAudioUnitType_Effect
45        /// kAudioUnitType_MusicEffect
46        /// kAudioUnitType_Panner
47        /// kAudioUnitType_RemoteEffect
48        /// kAudioUnitType_RemoteMusicEffect
49        #[unsafe(method(initWithAudioComponentDescription:))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn initWithAudioComponentDescription(
52            this: Allocated<Self>,
53            audio_component_description: AudioComponentDescription,
54        ) -> Retained<Self>;
55
56        /// Bypass state of the audio unit.
57        #[unsafe(method(bypass))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn bypass(&self) -> bool;
60
61        /// Setter for [`bypass`][Self::bypass].
62        #[unsafe(method(setBypass:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setBypass(&self, bypass: bool);
65    );
66}
67
68/// Methods declared on superclass `NSObject`.
69#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
70impl AVAudioUnitEffect {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}