objc2-avf-audio 0.3.2

Bindings to the AVFAudio framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    /// A node that mixes its inputs to a single output.
    ///
    /// Mixers may have any number of inputs.
    ///
    /// The mixer accepts input at any sample rate and efficiently combines sample rate
    /// conversions. It also accepts any channel count and will correctly upmix or downmix
    /// to the output channel count.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiomixernode?language=objc)
    #[unsafe(super(AVAudioNode, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "AVAudioNode")]
    pub struct AVAudioMixerNode;
);

#[cfg(all(feature = "AVAudioMixing", feature = "AVAudioNode"))]
extern_conformance!(
    unsafe impl AVAudio3DMixing for AVAudioMixerNode {}
);

#[cfg(all(feature = "AVAudioMixing", feature = "AVAudioNode"))]
extern_conformance!(
    unsafe impl AVAudioMixing for AVAudioMixerNode {}
);

#[cfg(all(feature = "AVAudioMixing", feature = "AVAudioNode"))]
extern_conformance!(
    unsafe impl AVAudioStereoMixing for AVAudioMixerNode {}
);

#[cfg(feature = "AVAudioNode")]
extern_conformance!(
    unsafe impl NSObjectProtocol for AVAudioMixerNode {}
);

#[cfg(feature = "AVAudioNode")]
impl AVAudioMixerNode {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// The mixer's output volume.
        ///
        /// This accesses the mixer's output volume (0.0-1.0, inclusive).
        #[unsafe(method(outputVolume))]
        #[unsafe(method_family = none)]
        pub unsafe fn outputVolume(&self) -> c_float;

        /// Setter for [`outputVolume`][Self::outputVolume].
        #[unsafe(method(setOutputVolume:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOutputVolume(&self, output_volume: c_float);

        #[cfg(feature = "AVAudioTypes")]
        /// Find an unused input bus.
        ///
        /// This will find and return the first input bus to which no other node is connected.
        #[unsafe(method(nextAvailableInputBus))]
        #[unsafe(method_family = none)]
        pub unsafe fn nextAvailableInputBus(&self) -> AVAudioNodeBus;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "AVAudioNode")]
impl AVAudioMixerNode {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}