use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVAudioEnvironmentDistanceAttenuationModel(pub NSInteger);
impl AVAudioEnvironmentDistanceAttenuationModel {
#[doc(alias = "AVAudioEnvironmentDistanceAttenuationModelExponential")]
pub const Exponential: Self = Self(1);
#[doc(alias = "AVAudioEnvironmentDistanceAttenuationModelInverse")]
pub const Inverse: Self = Self(2);
#[doc(alias = "AVAudioEnvironmentDistanceAttenuationModelLinear")]
pub const Linear: Self = Self(3);
}
unsafe impl Encode for AVAudioEnvironmentDistanceAttenuationModel {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVAudioEnvironmentDistanceAttenuationModel {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVAudioEnvironmentDistanceAttenuationParameters;
);
extern_conformance!(
unsafe impl NSObjectProtocol for AVAudioEnvironmentDistanceAttenuationParameters {}
);
impl AVAudioEnvironmentDistanceAttenuationParameters {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(distanceAttenuationModel))]
#[unsafe(method_family = none)]
pub unsafe fn distanceAttenuationModel(&self)
-> AVAudioEnvironmentDistanceAttenuationModel;
#[unsafe(method(setDistanceAttenuationModel:))]
#[unsafe(method_family = none)]
pub unsafe fn setDistanceAttenuationModel(
&self,
distance_attenuation_model: AVAudioEnvironmentDistanceAttenuationModel,
);
#[unsafe(method(referenceDistance))]
#[unsafe(method_family = none)]
pub unsafe fn referenceDistance(&self) -> c_float;
#[unsafe(method(setReferenceDistance:))]
#[unsafe(method_family = none)]
pub unsafe fn setReferenceDistance(&self, reference_distance: c_float);
#[unsafe(method(maximumDistance))]
#[unsafe(method_family = none)]
pub unsafe fn maximumDistance(&self) -> c_float;
#[unsafe(method(setMaximumDistance:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaximumDistance(&self, maximum_distance: c_float);
#[unsafe(method(rolloffFactor))]
#[unsafe(method_family = none)]
pub unsafe fn rolloffFactor(&self) -> c_float;
#[unsafe(method(setRolloffFactor:))]
#[unsafe(method_family = none)]
pub unsafe fn setRolloffFactor(&self, rolloff_factor: c_float);
);
}
impl AVAudioEnvironmentDistanceAttenuationParameters {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVAudioEnvironmentReverbParameters;
);
extern_conformance!(
unsafe impl NSObjectProtocol for AVAudioEnvironmentReverbParameters {}
);
impl AVAudioEnvironmentReverbParameters {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(enable))]
#[unsafe(method_family = none)]
pub unsafe fn enable(&self) -> bool;
#[unsafe(method(setEnable:))]
#[unsafe(method_family = none)]
pub unsafe fn setEnable(&self, enable: bool);
#[unsafe(method(level))]
#[unsafe(method_family = none)]
pub unsafe fn level(&self) -> c_float;
#[unsafe(method(setLevel:))]
#[unsafe(method_family = none)]
pub unsafe fn setLevel(&self, level: c_float);
#[cfg(feature = "AVAudioUnitEQ")]
#[unsafe(method(filterParameters))]
#[unsafe(method_family = none)]
pub unsafe fn filterParameters(&self) -> Retained<AVAudioUnitEQFilterParameters>;
#[cfg(feature = "AVAudioUnitReverb")]
#[unsafe(method(loadFactoryReverbPreset:))]
#[unsafe(method_family = none)]
pub unsafe fn loadFactoryReverbPreset(&self, preset: AVAudioUnitReverbPreset);
);
}
impl AVAudioEnvironmentReverbParameters {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVAudioEnvironmentOutputType(pub NSInteger);
impl AVAudioEnvironmentOutputType {
#[doc(alias = "AVAudioEnvironmentOutputTypeAuto")]
pub const Auto: Self = Self(0);
#[doc(alias = "AVAudioEnvironmentOutputTypeHeadphones")]
pub const Headphones: Self = Self(1);
#[doc(alias = "AVAudioEnvironmentOutputTypeBuiltInSpeakers")]
pub const BuiltInSpeakers: Self = Self(2);
#[doc(alias = "AVAudioEnvironmentOutputTypeExternalSpeakers")]
pub const ExternalSpeakers: Self = Self(3);
}
unsafe impl Encode for AVAudioEnvironmentOutputType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVAudioEnvironmentOutputType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(AVAudioNode, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "AVAudioNode")]
pub struct AVAudioEnvironmentNode;
);
#[cfg(all(feature = "AVAudioMixing", feature = "AVAudioNode"))]
extern_conformance!(
unsafe impl AVAudio3DMixing for AVAudioEnvironmentNode {}
);
#[cfg(all(feature = "AVAudioMixing", feature = "AVAudioNode"))]
extern_conformance!(
unsafe impl AVAudioMixing for AVAudioEnvironmentNode {}
);
#[cfg(all(feature = "AVAudioMixing", feature = "AVAudioNode"))]
extern_conformance!(
unsafe impl AVAudioStereoMixing for AVAudioEnvironmentNode {}
);
#[cfg(feature = "AVAudioNode")]
extern_conformance!(
unsafe impl NSObjectProtocol for AVAudioEnvironmentNode {}
);
#[cfg(feature = "AVAudioNode")]
impl AVAudioEnvironmentNode {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(outputType))]
#[unsafe(method_family = none)]
pub unsafe fn outputType(&self) -> AVAudioEnvironmentOutputType;
#[unsafe(method(setOutputType:))]
#[unsafe(method_family = none)]
pub unsafe fn setOutputType(&self, output_type: AVAudioEnvironmentOutputType);
#[unsafe(method(outputVolume))]
#[unsafe(method_family = none)]
pub unsafe fn outputVolume(&self) -> c_float;
#[unsafe(method(setOutputVolume:))]
#[unsafe(method_family = none)]
pub unsafe fn setOutputVolume(&self, output_volume: c_float);
#[cfg(feature = "AVAudioTypes")]
#[unsafe(method(nextAvailableInputBus))]
#[unsafe(method_family = none)]
pub unsafe fn nextAvailableInputBus(&self) -> AVAudioNodeBus;
#[cfg(feature = "AVAudioTypes")]
#[unsafe(method(listenerPosition))]
#[unsafe(method_family = none)]
pub unsafe fn listenerPosition(&self) -> AVAudio3DPoint;
#[cfg(feature = "AVAudioTypes")]
#[unsafe(method(setListenerPosition:))]
#[unsafe(method_family = none)]
pub unsafe fn setListenerPosition(&self, listener_position: AVAudio3DPoint);
#[cfg(feature = "AVAudioTypes")]
#[unsafe(method(listenerVectorOrientation))]
#[unsafe(method_family = none)]
pub unsafe fn listenerVectorOrientation(&self) -> AVAudio3DVectorOrientation;
#[cfg(feature = "AVAudioTypes")]
#[unsafe(method(setListenerVectorOrientation:))]
#[unsafe(method_family = none)]
pub unsafe fn setListenerVectorOrientation(
&self,
listener_vector_orientation: AVAudio3DVectorOrientation,
);
#[cfg(feature = "AVAudioTypes")]
#[unsafe(method(listenerAngularOrientation))]
#[unsafe(method_family = none)]
pub unsafe fn listenerAngularOrientation(&self) -> AVAudio3DAngularOrientation;
#[cfg(feature = "AVAudioTypes")]
#[unsafe(method(setListenerAngularOrientation:))]
#[unsafe(method_family = none)]
pub unsafe fn setListenerAngularOrientation(
&self,
listener_angular_orientation: AVAudio3DAngularOrientation,
);
#[unsafe(method(distanceAttenuationParameters))]
#[unsafe(method_family = none)]
pub unsafe fn distanceAttenuationParameters(
&self,
) -> Retained<AVAudioEnvironmentDistanceAttenuationParameters>;
#[unsafe(method(reverbParameters))]
#[unsafe(method_family = none)]
pub unsafe fn reverbParameters(&self) -> Retained<AVAudioEnvironmentReverbParameters>;
#[unsafe(method(applicableRenderingAlgorithms))]
#[unsafe(method_family = none)]
pub unsafe fn applicableRenderingAlgorithms(&self) -> Retained<NSArray<NSNumber>>;
#[unsafe(method(isListenerHeadTrackingEnabled))]
#[unsafe(method_family = none)]
pub unsafe fn isListenerHeadTrackingEnabled(&self) -> bool;
#[unsafe(method(setListenerHeadTrackingEnabled:))]
#[unsafe(method_family = none)]
pub unsafe fn setListenerHeadTrackingEnabled(&self, listener_head_tracking_enabled: bool);
);
}
#[cfg(feature = "AVAudioNode")]
impl AVAudioEnvironmentNode {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}