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
112unsafe impl NSObjectProtocol for AVAudioUnitEQFilterParameters {}
113
114impl AVAudioUnitEQFilterParameters {
115 extern_methods!(
116 #[unsafe(method(init))]
117 #[unsafe(method_family = init)]
118 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120 #[unsafe(method(filterType))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn filterType(&self) -> AVAudioUnitEQFilterType;
126
127 #[unsafe(method(setFilterType:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setFilterType(&self, filter_type: AVAudioUnitEQFilterType);
131
132 #[unsafe(method(frequency))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn frequency(&self) -> c_float;
139
140 #[unsafe(method(setFrequency:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn setFrequency(&self, frequency: c_float);
144
145 #[unsafe(method(bandwidth))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn bandwidth(&self) -> c_float;
152
153 #[unsafe(method(setBandwidth:))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn setBandwidth(&self, bandwidth: c_float);
157
158 #[unsafe(method(gain))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn gain(&self) -> c_float;
166
167 #[unsafe(method(setGain:))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn setGain(&self, gain: c_float);
171
172 #[unsafe(method(bypass))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn bypass(&self) -> bool;
178
179 #[unsafe(method(setBypass:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn setBypass(&self, bypass: bool);
183 );
184}
185
186impl AVAudioUnitEQFilterParameters {
188 extern_methods!(
189 #[unsafe(method(new))]
190 #[unsafe(method_family = new)]
191 pub unsafe fn new() -> Retained<Self>;
192 );
193}
194
195extern_class!(
196 #[unsafe(super(AVAudioUnitEffect, AVAudioUnit, AVAudioNode, NSObject))]
200 #[derive(Debug, PartialEq, Eq, Hash)]
201 #[cfg(all(
202 feature = "AVAudioNode",
203 feature = "AVAudioUnit",
204 feature = "AVAudioUnitEffect"
205 ))]
206 pub struct AVAudioUnitEQ;
207);
208
209#[cfg(all(
210 feature = "AVAudioNode",
211 feature = "AVAudioUnit",
212 feature = "AVAudioUnitEffect"
213))]
214unsafe impl NSObjectProtocol for AVAudioUnitEQ {}
215
216#[cfg(all(
217 feature = "AVAudioNode",
218 feature = "AVAudioUnit",
219 feature = "AVAudioUnitEffect"
220))]
221impl AVAudioUnitEQ {
222 extern_methods!(
223 #[unsafe(method(initWithNumberOfBands:))]
227 #[unsafe(method_family = init)]
228 pub unsafe fn initWithNumberOfBands(
229 this: Allocated<Self>,
230 number_of_bands: NSUInteger,
231 ) -> Retained<Self>;
232
233 #[unsafe(method(bands))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn bands(&self) -> Retained<NSArray<AVAudioUnitEQFilterParameters>>;
239
240 #[unsafe(method(globalGain))]
246 #[unsafe(method_family = none)]
247 pub unsafe fn globalGain(&self) -> c_float;
248
249 #[unsafe(method(setGlobalGain:))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn setGlobalGain(&self, global_gain: c_float);
253 );
254}
255
256#[cfg(all(
258 feature = "AVAudioNode",
259 feature = "AVAudioUnit",
260 feature = "AVAudioUnitEffect"
261))]
262impl AVAudioUnitEQ {
263 extern_methods!(
264 #[cfg(feature = "objc2-audio-toolbox")]
265 #[cfg(not(target_os = "watchos"))]
266 #[unsafe(method(initWithAudioComponentDescription:))]
278 #[unsafe(method_family = init)]
279 pub unsafe fn initWithAudioComponentDescription(
280 this: Allocated<Self>,
281 audio_component_description: AudioComponentDescription,
282 ) -> Retained<Self>;
283 );
284}
285
286#[cfg(all(
288 feature = "AVAudioNode",
289 feature = "AVAudioUnit",
290 feature = "AVAudioUnitEffect"
291))]
292impl AVAudioUnitEQ {
293 extern_methods!(
294 #[unsafe(method(init))]
295 #[unsafe(method_family = init)]
296 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
297
298 #[unsafe(method(new))]
299 #[unsafe(method_family = new)]
300 pub unsafe fn new() -> Retained<Self>;
301 );
302}