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))]
37unsafe impl NSObjectProtocol for AVAudioUnitDelay {}
38
39#[cfg(all(
40    feature = "AVAudioNode",
41    feature = "AVAudioUnit",
42    feature = "AVAudioUnitEffect"
43))]
44impl AVAudioUnitDelay {
45    extern_methods!(
46        /// Time taken by the delayed input signal to reach the output
47        ///
48        /// Range:      0 -> 2
49        /// Default:    1
50        /// Unit:       Seconds
51        #[unsafe(method(delayTime))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn delayTime(&self) -> NSTimeInterval;
54
55        /// Setter for [`delayTime`][Self::delayTime].
56        #[unsafe(method(setDelayTime:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn setDelayTime(&self, delay_time: NSTimeInterval);
59
60        /// Amount of the output signal fed back into the delay line
61        /// Range:      -100 -> 100
62        /// Default:    50
63        /// Unit:       Percent
64        #[unsafe(method(feedback))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn feedback(&self) -> c_float;
67
68        /// Setter for [`feedback`][Self::feedback].
69        #[unsafe(method(setFeedback:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setFeedback(&self, feedback: c_float);
72
73        /// Cutoff frequency above which high frequency content is rolled off
74        /// Range:      10 -> (samplerate/2)
75        /// Default:    15000
76        /// Unit:       Hertz
77        #[unsafe(method(lowPassCutoff))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn lowPassCutoff(&self) -> c_float;
80
81        /// Setter for [`lowPassCutoff`][Self::lowPassCutoff].
82        #[unsafe(method(setLowPassCutoff:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setLowPassCutoff(&self, low_pass_cutoff: c_float);
85
86        /// Blend of the wet and dry signals
87        /// Range:      0 (all dry) -> 100 (all wet)
88        /// Default:    100
89        /// Unit:       Percent
90        #[unsafe(method(wetDryMix))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn wetDryMix(&self) -> c_float;
93
94        /// Setter for [`wetDryMix`][Self::wetDryMix].
95        #[unsafe(method(setWetDryMix:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setWetDryMix(&self, wet_dry_mix: c_float);
98    );
99}
100
101/// Methods declared on superclass `AVAudioUnitEffect`.
102#[cfg(all(
103    feature = "AVAudioNode",
104    feature = "AVAudioUnit",
105    feature = "AVAudioUnitEffect"
106))]
107impl AVAudioUnitDelay {
108    extern_methods!(
109        #[cfg(feature = "objc2-audio-toolbox")]
110        #[cfg(not(target_os = "watchos"))]
111        /// Create an AVAudioUnitEffect object.
112        ///
113        ///
114        /// Parameter `audioComponentDescription`: AudioComponentDescription of the audio unit to be instantiated.
115        ///
116        /// The componentType must be one of these types
117        /// kAudioUnitType_Effect
118        /// kAudioUnitType_MusicEffect
119        /// kAudioUnitType_Panner
120        /// kAudioUnitType_RemoteEffect
121        /// kAudioUnitType_RemoteMusicEffect
122        #[unsafe(method(initWithAudioComponentDescription:))]
123        #[unsafe(method_family = init)]
124        pub unsafe fn initWithAudioComponentDescription(
125            this: Allocated<Self>,
126            audio_component_description: AudioComponentDescription,
127        ) -> Retained<Self>;
128    );
129}
130
131/// Methods declared on superclass `NSObject`.
132#[cfg(all(
133    feature = "AVAudioNode",
134    feature = "AVAudioUnit",
135    feature = "AVAudioUnitEffect"
136))]
137impl AVAudioUnitDelay {
138    extern_methods!(
139        #[unsafe(method(init))]
140        #[unsafe(method_family = init)]
141        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
142
143        #[unsafe(method(new))]
144        #[unsafe(method_family = new)]
145        pub unsafe fn new() -> Retained<Self>;
146    );
147}