objc2_av_foundation/generated/
AVCaptureAudioPreviewOutput.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// AVCaptureAudioPreviewOutput is a concrete subclass of AVCaptureOutput that can be used to preview the audio being captured.
12    ///
13    ///
14    /// Instances of AVCaptureAudioPreviewOutput have an associated Core Audio output device that can be used to play audio being captured by the capture session. The unique ID of a Core Audio device can be obtained from its kAudioDevicePropertyDeviceUID property.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcaptureaudiopreviewoutput?language=objc)
17    #[unsafe(super(AVCaptureOutput, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "AVCaptureOutputBase")]
20    pub struct AVCaptureAudioPreviewOutput;
21);
22
23#[cfg(feature = "AVCaptureOutputBase")]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for AVCaptureAudioPreviewOutput {}
26);
27
28#[cfg(feature = "AVCaptureOutputBase")]
29impl AVCaptureAudioPreviewOutput {
30    extern_methods!(
31        #[unsafe(method(init))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
34
35        #[unsafe(method(new))]
36        #[unsafe(method_family = new)]
37        pub unsafe fn new() -> Retained<Self>;
38
39        /// Specifies the unique ID of the Core Audio output device being used to play preview audio.
40        ///
41        ///
42        /// The value of this property is an NSString containing the unique ID of the Core Audio device to be used for output, or nil if the default system output should be used.
43        #[unsafe(method(outputDeviceUniqueID))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn outputDeviceUniqueID(&self) -> Option<Retained<NSString>>;
46
47        /// Setter for [`outputDeviceUniqueID`][Self::outputDeviceUniqueID].
48        ///
49        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
50        #[unsafe(method(setOutputDeviceUniqueID:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setOutputDeviceUniqueID(&self, output_device_unique_id: Option<&NSString>);
53
54        /// Specifies the preview volume of the output.
55        ///
56        ///
57        /// The value of this property is the preview volume of the receiver, where 1.0 is the maximum volume and 0.0 is muted.
58        #[unsafe(method(volume))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn volume(&self) -> c_float;
61
62        /// Setter for [`volume`][Self::volume].
63        #[unsafe(method(setVolume:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setVolume(&self, volume: c_float);
66    );
67}