objc2_avf_audio/generated/
AVAudioUnitEQ.rs1use 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
13#[repr(transparent)]
65#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
66pub struct AVAudioUnitEQFilterType(pub NSInteger);
67impl AVAudioUnitEQFilterType {
68 #[doc(alias = "AVAudioUnitEQFilterTypeParametric")]
69 pub const Parametric: Self = Self(0);
70 #[doc(alias = "AVAudioUnitEQFilterTypeLowPass")]
71 pub const LowPass: Self = Self(1);
72 #[doc(alias = "AVAudioUnitEQFilterTypeHighPass")]
73 pub const HighPass: Self = Self(2);
74 #[doc(alias = "AVAudioUnitEQFilterTypeResonantLowPass")]
75 pub const ResonantLowPass: Self = Self(3);
76 #[doc(alias = "AVAudioUnitEQFilterTypeResonantHighPass")]
77 pub const ResonantHighPass: Self = Self(4);
78 #[doc(alias = "AVAudioUnitEQFilterTypeBandPass")]
79 pub const BandPass: Self = Self(5);
80 #[doc(alias = "AVAudioUnitEQFilterTypeBandStop")]
81 pub const BandStop: Self = Self(6);
82 #[doc(alias = "AVAudioUnitEQFilterTypeLowShelf")]
83 pub const LowShelf: Self = Self(7);
84 #[doc(alias = "AVAudioUnitEQFilterTypeHighShelf")]
85 pub const HighShelf: Self = Self(8);
86 #[doc(alias = "AVAudioUnitEQFilterTypeResonantLowShelf")]
87 pub const ResonantLowShelf: Self = Self(9);
88 #[doc(alias = "AVAudioUnitEQFilterTypeResonantHighShelf")]
89 pub const ResonantHighShelf: Self = Self(10);
90}
91
92unsafe impl Encode for AVAudioUnitEQFilterType {
93 const ENCODING: Encoding = NSInteger::ENCODING;
94}
95
96unsafe impl RefEncode for AVAudioUnitEQFilterType {
97 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
98}
99
100extern_class!(
101 #[unsafe(super(NSObject))]
108 #[derive(Debug, PartialEq, Eq, Hash)]
109 pub struct AVAudioUnitEQFilterParameters;
110);
111
112extern_conformance!(
113 unsafe impl NSObjectProtocol for AVAudioUnitEQFilterParameters {}
114);
115
116impl AVAudioUnitEQFilterParameters {
117 extern_methods!(
118 #[unsafe(method(init))]
119 #[unsafe(method_family = init)]
120 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122 #[unsafe(method(filterType))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn filterType(&self) -> AVAudioUnitEQFilterType;
128
129 #[unsafe(method(setFilterType:))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn setFilterType(&self, filter_type: AVAudioUnitEQFilterType);
133
134 #[unsafe(method(frequency))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn frequency(&self) -> c_float;
141
142 #[unsafe(method(setFrequency:))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn setFrequency(&self, frequency: c_float);
146
147 #[unsafe(method(bandwidth))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn bandwidth(&self) -> c_float;
154
155 #[unsafe(method(setBandwidth:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn setBandwidth(&self, bandwidth: c_float);
159
160 #[unsafe(method(gain))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn gain(&self) -> c_float;
168
169 #[unsafe(method(setGain:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn setGain(&self, gain: c_float);
173
174 #[unsafe(method(bypass))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn bypass(&self) -> bool;
180
181 #[unsafe(method(setBypass:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn setBypass(&self, bypass: bool);
185 );
186}
187
188impl AVAudioUnitEQFilterParameters {
190 extern_methods!(
191 #[unsafe(method(new))]
192 #[unsafe(method_family = new)]
193 pub unsafe fn new() -> Retained<Self>;
194 );
195}
196
197extern_class!(
198 #[unsafe(super(AVAudioUnitEffect, AVAudioUnit, AVAudioNode, NSObject))]
202 #[derive(Debug, PartialEq, Eq, Hash)]
203 #[cfg(all(
204 feature = "AVAudioNode",
205 feature = "AVAudioUnit",
206 feature = "AVAudioUnitEffect"
207 ))]
208 pub struct AVAudioUnitEQ;
209);
210
211#[cfg(all(
212 feature = "AVAudioNode",
213 feature = "AVAudioUnit",
214 feature = "AVAudioUnitEffect"
215))]
216extern_conformance!(
217 unsafe impl NSObjectProtocol for AVAudioUnitEQ {}
218);
219
220#[cfg(all(
221 feature = "AVAudioNode",
222 feature = "AVAudioUnit",
223 feature = "AVAudioUnitEffect"
224))]
225impl AVAudioUnitEQ {
226 extern_methods!(
227 #[unsafe(method(initWithNumberOfBands:))]
231 #[unsafe(method_family = init)]
232 pub unsafe fn initWithNumberOfBands(
233 this: Allocated<Self>,
234 number_of_bands: NSUInteger,
235 ) -> Retained<Self>;
236
237 #[unsafe(method(bands))]
241 #[unsafe(method_family = none)]
242 pub unsafe fn bands(&self) -> Retained<NSArray<AVAudioUnitEQFilterParameters>>;
243
244 #[unsafe(method(globalGain))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn globalGain(&self) -> c_float;
252
253 #[unsafe(method(setGlobalGain:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn setGlobalGain(&self, global_gain: c_float);
257 );
258}
259
260#[cfg(all(
262 feature = "AVAudioNode",
263 feature = "AVAudioUnit",
264 feature = "AVAudioUnitEffect"
265))]
266impl AVAudioUnitEQ {
267 extern_methods!(
268 #[cfg(feature = "objc2-audio-toolbox")]
269 #[cfg(not(target_os = "watchos"))]
270 #[unsafe(method(initWithAudioComponentDescription:))]
282 #[unsafe(method_family = init)]
283 pub unsafe fn initWithAudioComponentDescription(
284 this: Allocated<Self>,
285 audio_component_description: AudioComponentDescription,
286 ) -> Retained<Self>;
287 );
288}
289
290#[cfg(all(
292 feature = "AVAudioNode",
293 feature = "AVAudioUnit",
294 feature = "AVAudioUnitEffect"
295))]
296impl AVAudioUnitEQ {
297 extern_methods!(
298 #[unsafe(method(init))]
299 #[unsafe(method_family = init)]
300 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
301
302 #[unsafe(method(new))]
303 #[unsafe(method_family = new)]
304 pub unsafe fn new() -> Retained<Self>;
305 );
306}