use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-audio-toolbox")]
#[cfg(not(target_os = "watchos"))]
use objc2_audio_toolbox::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVAudioUnitEQFilterType(pub NSInteger);
impl AVAudioUnitEQFilterType {
#[doc(alias = "AVAudioUnitEQFilterTypeParametric")]
pub const Parametric: Self = Self(0);
#[doc(alias = "AVAudioUnitEQFilterTypeLowPass")]
pub const LowPass: Self = Self(1);
#[doc(alias = "AVAudioUnitEQFilterTypeHighPass")]
pub const HighPass: Self = Self(2);
#[doc(alias = "AVAudioUnitEQFilterTypeResonantLowPass")]
pub const ResonantLowPass: Self = Self(3);
#[doc(alias = "AVAudioUnitEQFilterTypeResonantHighPass")]
pub const ResonantHighPass: Self = Self(4);
#[doc(alias = "AVAudioUnitEQFilterTypeBandPass")]
pub const BandPass: Self = Self(5);
#[doc(alias = "AVAudioUnitEQFilterTypeBandStop")]
pub const BandStop: Self = Self(6);
#[doc(alias = "AVAudioUnitEQFilterTypeLowShelf")]
pub const LowShelf: Self = Self(7);
#[doc(alias = "AVAudioUnitEQFilterTypeHighShelf")]
pub const HighShelf: Self = Self(8);
#[doc(alias = "AVAudioUnitEQFilterTypeResonantLowShelf")]
pub const ResonantLowShelf: Self = Self(9);
#[doc(alias = "AVAudioUnitEQFilterTypeResonantHighShelf")]
pub const ResonantHighShelf: Self = Self(10);
}
unsafe impl Encode for AVAudioUnitEQFilterType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVAudioUnitEQFilterType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVAudioUnitEQFilterParameters;
);
extern_conformance!(
unsafe impl NSObjectProtocol for AVAudioUnitEQFilterParameters {}
);
impl AVAudioUnitEQFilterParameters {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(filterType))]
#[unsafe(method_family = none)]
pub unsafe fn filterType(&self) -> AVAudioUnitEQFilterType;
#[unsafe(method(setFilterType:))]
#[unsafe(method_family = none)]
pub unsafe fn setFilterType(&self, filter_type: AVAudioUnitEQFilterType);
#[unsafe(method(frequency))]
#[unsafe(method_family = none)]
pub unsafe fn frequency(&self) -> c_float;
#[unsafe(method(setFrequency:))]
#[unsafe(method_family = none)]
pub unsafe fn setFrequency(&self, frequency: c_float);
#[unsafe(method(bandwidth))]
#[unsafe(method_family = none)]
pub unsafe fn bandwidth(&self) -> c_float;
#[unsafe(method(setBandwidth:))]
#[unsafe(method_family = none)]
pub unsafe fn setBandwidth(&self, bandwidth: c_float);
#[unsafe(method(gain))]
#[unsafe(method_family = none)]
pub unsafe fn gain(&self) -> c_float;
#[unsafe(method(setGain:))]
#[unsafe(method_family = none)]
pub unsafe fn setGain(&self, gain: c_float);
#[unsafe(method(bypass))]
#[unsafe(method_family = none)]
pub unsafe fn bypass(&self) -> bool;
#[unsafe(method(setBypass:))]
#[unsafe(method_family = none)]
pub unsafe fn setBypass(&self, bypass: bool);
);
}
impl AVAudioUnitEQFilterParameters {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(AVAudioUnitEffect, AVAudioUnit, AVAudioNode, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(
feature = "AVAudioNode",
feature = "AVAudioUnit",
feature = "AVAudioUnitEffect"
))]
pub struct AVAudioUnitEQ;
);
#[cfg(all(
feature = "AVAudioNode",
feature = "AVAudioUnit",
feature = "AVAudioUnitEffect"
))]
extern_conformance!(
unsafe impl NSObjectProtocol for AVAudioUnitEQ {}
);
#[cfg(all(
feature = "AVAudioNode",
feature = "AVAudioUnit",
feature = "AVAudioUnitEffect"
))]
impl AVAudioUnitEQ {
extern_methods!(
#[unsafe(method(initWithNumberOfBands:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNumberOfBands(
this: Allocated<Self>,
number_of_bands: NSUInteger,
) -> Retained<Self>;
#[unsafe(method(bands))]
#[unsafe(method_family = none)]
pub unsafe fn bands(&self) -> Retained<NSArray<AVAudioUnitEQFilterParameters>>;
#[unsafe(method(globalGain))]
#[unsafe(method_family = none)]
pub unsafe fn globalGain(&self) -> c_float;
#[unsafe(method(setGlobalGain:))]
#[unsafe(method_family = none)]
pub unsafe fn setGlobalGain(&self, global_gain: c_float);
);
}
#[cfg(all(
feature = "AVAudioNode",
feature = "AVAudioUnit",
feature = "AVAudioUnitEffect"
))]
impl AVAudioUnitEQ {
extern_methods!(
#[cfg(feature = "objc2-audio-toolbox")]
#[cfg(not(target_os = "watchos"))]
#[unsafe(method(initWithAudioComponentDescription:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithAudioComponentDescription(
this: Allocated<Self>,
audio_component_description: AudioComponentDescription,
) -> Retained<Self>;
);
}
#[cfg(all(
feature = "AVAudioNode",
feature = "AVAudioUnit",
feature = "AVAudioUnitEffect"
))]
impl AVAudioUnitEQ {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}