objc2_avf_audio/generated/
AVAudioUnitDelay.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::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14    /// an AVAudioUnitEffect that implements a delay effect
15    ///
16    /// A delay unit delays the input signal by the specified time interval
17    /// and then blends it with the input signal. The amount of high frequency
18    /// roll-off can also be controlled in order to simulate the effect of
19    /// a tape delay.
20    ///
21    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiounitdelay?language=objc)
22    #[unsafe(super(AVAudioUnitEffect, AVAudioUnit, AVAudioNode, NSObject))]
23    #[derive(Debug, PartialEq, Eq, Hash)]
24    #[cfg(all(
25        feature = "AVAudioNode",
26        feature = "AVAudioUnit",
27        feature = "AVAudioUnitEffect"
28    ))]
29    pub struct AVAudioUnitDelay;
30);
31
32#[cfg(all(
33    feature = "AVAudioNode",
34    feature = "AVAudioUnit",
35    feature = "AVAudioUnitEffect"
36))]
37extern_conformance!(
38    unsafe impl NSObjectProtocol for AVAudioUnitDelay {}
39);
40
41#[cfg(all(
42    feature = "AVAudioNode",
43    feature = "AVAudioUnit",
44    feature = "AVAudioUnitEffect"
45))]
46impl AVAudioUnitDelay {
47    extern_methods!(
48        /// Time taken by the delayed input signal to reach the output
49        ///
50        /// Range:      0 -> 2
51        /// Default:    1
52        /// Unit:       Seconds
53        #[unsafe(method(delayTime))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn delayTime(&self) -> NSTimeInterval;
56
57        /// Setter for [`delayTime`][Self::delayTime].
58        #[unsafe(method(setDelayTime:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setDelayTime(&self, delay_time: NSTimeInterval);
61
62        /// Amount of the output signal fed back into the delay line
63        /// Range:      -100 -> 100
64        /// Default:    50
65        /// Unit:       Percent
66        #[unsafe(method(feedback))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn feedback(&self) -> c_float;
69
70        /// Setter for [`feedback`][Self::feedback].
71        #[unsafe(method(setFeedback:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn setFeedback(&self, feedback: c_float);
74
75        /// Cutoff frequency above which high frequency content is rolled off
76        /// Range:      10 -> (samplerate/2)
77        /// Default:    15000
78        /// Unit:       Hertz
79        #[unsafe(method(lowPassCutoff))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn lowPassCutoff(&self) -> c_float;
82
83        /// Setter for [`lowPassCutoff`][Self::lowPassCutoff].
84        #[unsafe(method(setLowPassCutoff:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setLowPassCutoff(&self, low_pass_cutoff: c_float);
87
88        /// Blend of the wet and dry signals
89        /// Range:      0 (all dry) -> 100 (all wet)
90        /// Default:    100
91        /// Unit:       Percent
92        #[unsafe(method(wetDryMix))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn wetDryMix(&self) -> c_float;
95
96        /// Setter for [`wetDryMix`][Self::wetDryMix].
97        #[unsafe(method(setWetDryMix:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn setWetDryMix(&self, wet_dry_mix: c_float);
100    );
101}
102
103/// Methods declared on superclass `AVAudioUnitEffect`.
104#[cfg(all(
105    feature = "AVAudioNode",
106    feature = "AVAudioUnit",
107    feature = "AVAudioUnitEffect"
108))]
109impl AVAudioUnitDelay {
110    extern_methods!(
111        #[cfg(feature = "objc2-audio-toolbox")]
112        #[cfg(not(target_os = "watchos"))]
113        /// Create an AVAudioUnitEffect object.
114        ///
115        ///
116        /// Parameter `audioComponentDescription`: AudioComponentDescription of the audio unit to be instantiated.
117        ///
118        /// The componentType must be one of these types
119        /// kAudioUnitType_Effect
120        /// kAudioUnitType_MusicEffect
121        /// kAudioUnitType_Panner
122        /// kAudioUnitType_RemoteEffect
123        /// kAudioUnitType_RemoteMusicEffect
124        #[unsafe(method(initWithAudioComponentDescription:))]
125        #[unsafe(method_family = init)]
126        pub unsafe fn initWithAudioComponentDescription(
127            this: Allocated<Self>,
128            audio_component_description: AudioComponentDescription,
129        ) -> Retained<Self>;
130    );
131}
132
133/// Methods declared on superclass `NSObject`.
134#[cfg(all(
135    feature = "AVAudioNode",
136    feature = "AVAudioUnit",
137    feature = "AVAudioUnitEffect"
138))]
139impl AVAudioUnitDelay {
140    extern_methods!(
141        #[unsafe(method(init))]
142        #[unsafe(method_family = init)]
143        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
144
145        #[unsafe(method(new))]
146        #[unsafe(method_family = new)]
147        pub unsafe fn new() -> Retained<Self>;
148    );
149}