objc2-virtualization 0.3.2

Bindings to the Virtualization 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 objc2_foundation::*;

use crate::*;

extern_class!(
    /// Virtio Sound Device Output Stream Configuration.
    ///
    /// A PCM stream of output audio data, such as to a speaker.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtiosounddeviceoutputstreamconfiguration?language=objc)
    #[unsafe(super(VZVirtioSoundDeviceStreamConfiguration, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "VZVirtioSoundDeviceStreamConfiguration")]
    pub struct VZVirtioSoundDeviceOutputStreamConfiguration;
);

#[cfg(feature = "VZVirtioSoundDeviceStreamConfiguration")]
extern_conformance!(
    unsafe impl NSCopying for VZVirtioSoundDeviceOutputStreamConfiguration {}
);

#[cfg(feature = "VZVirtioSoundDeviceStreamConfiguration")]
unsafe impl CopyingHelper for VZVirtioSoundDeviceOutputStreamConfiguration {
    type Result = Self;
}

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

#[cfg(feature = "VZVirtioSoundDeviceStreamConfiguration")]
impl VZVirtioSoundDeviceOutputStreamConfiguration {
    extern_methods!(
        /// Initialize the output stream configuration.
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "VZAudioOutputStreamSink")]
        /// Audio Stream Sink. Defines how the audio data produced by the guest is handled on the host. The default is nil.
        ///
        /// Not specifying a Sink will have a default handler that swallows the audio.
        ///
        /// See: VZAudioOutputStreamSink
        #[unsafe(method(sink))]
        #[unsafe(method_family = none)]
        pub unsafe fn sink(&self) -> Option<Retained<VZAudioOutputStreamSink>>;

        #[cfg(feature = "VZAudioOutputStreamSink")]
        /// Setter for [`sink`][Self::sink].
        #[unsafe(method(setSink:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSink(&self, sink: Option<&VZAudioOutputStreamSink>);
    );
}

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