objc2_avf_audio/generated/
AVAudioUnitReverb.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
12/// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiounitreverbpreset?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct AVAudioUnitReverbPreset(pub NSInteger);
17impl AVAudioUnitReverbPreset {
18    #[doc(alias = "AVAudioUnitReverbPresetSmallRoom")]
19    pub const SmallRoom: Self = Self(0);
20    #[doc(alias = "AVAudioUnitReverbPresetMediumRoom")]
21    pub const MediumRoom: Self = Self(1);
22    #[doc(alias = "AVAudioUnitReverbPresetLargeRoom")]
23    pub const LargeRoom: Self = Self(2);
24    #[doc(alias = "AVAudioUnitReverbPresetMediumHall")]
25    pub const MediumHall: Self = Self(3);
26    #[doc(alias = "AVAudioUnitReverbPresetLargeHall")]
27    pub const LargeHall: Self = Self(4);
28    #[doc(alias = "AVAudioUnitReverbPresetPlate")]
29    pub const Plate: Self = Self(5);
30    #[doc(alias = "AVAudioUnitReverbPresetMediumChamber")]
31    pub const MediumChamber: Self = Self(6);
32    #[doc(alias = "AVAudioUnitReverbPresetLargeChamber")]
33    pub const LargeChamber: Self = Self(7);
34    #[doc(alias = "AVAudioUnitReverbPresetCathedral")]
35    pub const Cathedral: Self = Self(8);
36    #[doc(alias = "AVAudioUnitReverbPresetLargeRoom2")]
37    pub const LargeRoom2: Self = Self(9);
38    #[doc(alias = "AVAudioUnitReverbPresetMediumHall2")]
39    pub const MediumHall2: Self = Self(10);
40    #[doc(alias = "AVAudioUnitReverbPresetMediumHall3")]
41    pub const MediumHall3: Self = Self(11);
42    #[doc(alias = "AVAudioUnitReverbPresetLargeHall2")]
43    pub const LargeHall2: Self = Self(12);
44}
45
46unsafe impl Encode for AVAudioUnitReverbPreset {
47    const ENCODING: Encoding = NSInteger::ENCODING;
48}
49
50unsafe impl RefEncode for AVAudioUnitReverbPreset {
51    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
52}
53
54extern_class!(
55    /// an AVAudioUnitEffect that implements a reverb
56    ///
57    /// A reverb simulates the acoustic characteristics of a particular environment.
58    /// Use the different presets to simulate a particular space and blend it in with
59    /// the original signal using the wetDryMix parameter.
60    ///
61    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiounitreverb?language=objc)
62    #[unsafe(super(AVAudioUnitEffect, AVAudioUnit, AVAudioNode, NSObject))]
63    #[derive(Debug, PartialEq, Eq, Hash)]
64    #[cfg(all(
65        feature = "AVAudioNode",
66        feature = "AVAudioUnit",
67        feature = "AVAudioUnitEffect"
68    ))]
69    pub struct AVAudioUnitReverb;
70);
71
72#[cfg(all(
73    feature = "AVAudioNode",
74    feature = "AVAudioUnit",
75    feature = "AVAudioUnitEffect"
76))]
77unsafe impl NSObjectProtocol for AVAudioUnitReverb {}
78
79#[cfg(all(
80    feature = "AVAudioNode",
81    feature = "AVAudioUnit",
82    feature = "AVAudioUnitEffect"
83))]
84impl AVAudioUnitReverb {
85    extern_methods!(
86        /// load a reverb preset
87        /// Default:    AVAudioUnitReverbPresetMediumHall
88        #[unsafe(method(loadFactoryPreset:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn loadFactoryPreset(&self, preset: AVAudioUnitReverbPreset);
91
92        /// Blend of the wet and dry signals
93        /// Range:      0 (all dry) -> 100 (all wet)
94        /// Unit:       Percent
95        #[unsafe(method(wetDryMix))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn wetDryMix(&self) -> c_float;
98
99        /// Setter for [`wetDryMix`][Self::wetDryMix].
100        #[unsafe(method(setWetDryMix:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setWetDryMix(&self, wet_dry_mix: c_float);
103    );
104}
105
106/// Methods declared on superclass `AVAudioUnitEffect`.
107#[cfg(all(
108    feature = "AVAudioNode",
109    feature = "AVAudioUnit",
110    feature = "AVAudioUnitEffect"
111))]
112impl AVAudioUnitReverb {
113    extern_methods!(
114        #[cfg(feature = "objc2-audio-toolbox")]
115        #[cfg(not(target_os = "watchos"))]
116        /// Create an AVAudioUnitEffect object.
117        ///
118        ///
119        /// Parameter `audioComponentDescription`: AudioComponentDescription of the audio unit to be instantiated.
120        ///
121        /// The componentType must be one of these types
122        /// kAudioUnitType_Effect
123        /// kAudioUnitType_MusicEffect
124        /// kAudioUnitType_Panner
125        /// kAudioUnitType_RemoteEffect
126        /// kAudioUnitType_RemoteMusicEffect
127        #[unsafe(method(initWithAudioComponentDescription:))]
128        #[unsafe(method_family = init)]
129        pub unsafe fn initWithAudioComponentDescription(
130            this: Allocated<Self>,
131            audio_component_description: AudioComponentDescription,
132        ) -> Retained<Self>;
133    );
134}
135
136/// Methods declared on superclass `NSObject`.
137#[cfg(all(
138    feature = "AVAudioNode",
139    feature = "AVAudioUnit",
140    feature = "AVAudioUnitEffect"
141))]
142impl AVAudioUnitReverb {
143    extern_methods!(
144        #[unsafe(method(init))]
145        #[unsafe(method_family = init)]
146        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
147
148        #[unsafe(method(new))]
149        #[unsafe(method_family = new)]
150        pub unsafe fn new() -> Retained<Self>;
151    );
152}