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 objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// AVAudioSessionDeprecated.
#[cfg(feature = "AVAudioSession")]
impl AVAudioSession {
    extern_methods!(
        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[deprecated = "No longer supported"]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn AVAudioSessionDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// # Safety
        ///
        /// This is unretained, you must ensure the object is kept alive while in use.
        #[deprecated = "No longer supported"]
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn AVAudioSessionDelegate>>,
        );

        #[deprecated]
        #[unsafe(method(setActive:withFlags:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setActive_withFlags_error(
            &self,
            active: bool,
            flags: NSInteger,
        ) -> Result<(), Retained<NSError>>;

        #[deprecated]
        #[unsafe(method(inputIsAvailable))]
        #[unsafe(method_family = none)]
        pub unsafe fn inputIsAvailable(&self) -> bool;

        #[deprecated]
        #[unsafe(method(currentHardwareSampleRate))]
        #[unsafe(method_family = none)]
        pub unsafe fn currentHardwareSampleRate(&self) -> c_double;

        #[deprecated]
        #[unsafe(method(currentHardwareInputNumberOfChannels))]
        #[unsafe(method_family = none)]
        pub unsafe fn currentHardwareInputNumberOfChannels(&self) -> NSInteger;

        #[deprecated]
        #[unsafe(method(currentHardwareOutputNumberOfChannels))]
        #[unsafe(method_family = none)]
        pub unsafe fn currentHardwareOutputNumberOfChannels(&self) -> NSInteger;

        #[deprecated]
        #[unsafe(method(setPreferredHardwareSampleRate:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPreferredHardwareSampleRate_error(
            &self,
            sample_rate: c_double,
        ) -> Result<(), Retained<NSError>>;

        #[deprecated]
        #[unsafe(method(preferredHardwareSampleRate))]
        #[unsafe(method_family = none)]
        pub unsafe fn preferredHardwareSampleRate(&self) -> c_double;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessiondelegate?language=objc)
    #[deprecated = "No longer supported"]
    pub unsafe trait AVAudioSessionDelegate: NSObjectProtocol {
        #[deprecated = "No longer supported"]
        #[optional]
        #[unsafe(method(beginInterruption))]
        #[unsafe(method_family = none)]
        unsafe fn beginInterruption(&self);

        #[optional]
        #[unsafe(method(endInterruptionWithFlags:))]
        #[unsafe(method_family = none)]
        unsafe fn endInterruptionWithFlags(&self, flags: NSUInteger);

        #[deprecated = "No longer supported"]
        #[optional]
        #[unsafe(method(endInterruption))]
        #[unsafe(method_family = none)]
        unsafe fn endInterruption(&self);

        #[deprecated = "No longer supported"]
        #[optional]
        #[unsafe(method(inputIsAvailableChanged:))]
        #[unsafe(method_family = none)]
        unsafe fn inputIsAvailableChanged(&self, is_input_available: bool);
    }
);

/// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioninterruptionflags_shouldresume?language=objc)
#[deprecated]
pub const AVAudioSessionInterruptionFlags_ShouldResume: c_uint = 1;

/// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionsetactiveflags_notifyothersondeactivation?language=objc)
#[deprecated]
pub const AVAudioSessionSetActiveFlags_NotifyOthersOnDeactivation: c_uint = 1;