objc2_avf_audio/generated/
AVAudioUnitGenerator.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::*;
6#[cfg(feature = "objc2-audio-toolbox")]
7#[cfg(not(target_os = "watchos"))]
8use objc2_audio_toolbox::*;
9
10use crate::*;
11
12extern_class!(
13    /// an AVAudioUnit that generates audio output
14    ///
15    /// An AVAudioUnitGenerator represents an audio unit of type kAudioUnitType_Generator or
16    /// kAudioUnitType_RemoteGenerator.
17    /// A generator will have no audio input, but will just produce audio output.
18    /// A tone generator is an example of this.
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiounitgenerator?language=objc)
21    #[unsafe(super(AVAudioUnit, AVAudioNode, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
24    pub struct AVAudioUnitGenerator;
25);
26
27#[cfg(all(
28    feature = "AVAudioMixing",
29    feature = "AVAudioNode",
30    feature = "AVAudioUnit"
31))]
32unsafe impl AVAudio3DMixing for AVAudioUnitGenerator {}
33
34#[cfg(all(
35    feature = "AVAudioMixing",
36    feature = "AVAudioNode",
37    feature = "AVAudioUnit"
38))]
39unsafe impl AVAudioMixing for AVAudioUnitGenerator {}
40
41#[cfg(all(
42    feature = "AVAudioMixing",
43    feature = "AVAudioNode",
44    feature = "AVAudioUnit"
45))]
46unsafe impl AVAudioStereoMixing for AVAudioUnitGenerator {}
47
48#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
49unsafe impl NSObjectProtocol for AVAudioUnitGenerator {}
50
51#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
52impl AVAudioUnitGenerator {
53    extern_methods!(
54        #[cfg(feature = "objc2-audio-toolbox")]
55        #[cfg(not(target_os = "watchos"))]
56        /// Create an AVAudioUnitGenerator object.
57        ///
58        ///
59        /// Parameter `audioComponentDescription`: AudioComponentDescription of the audio unit to be instantiated.
60        ///
61        /// The componentType must be kAudioUnitType_Generator or kAudioUnitType_RemoteGenerator
62        #[unsafe(method(initWithAudioComponentDescription:))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn initWithAudioComponentDescription(
65            this: Allocated<Self>,
66            audio_component_description: AudioComponentDescription,
67        ) -> Retained<Self>;
68
69        /// Bypass state of the audio unit.
70        #[unsafe(method(bypass))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn bypass(&self) -> bool;
73
74        /// Setter for [`bypass`][Self::bypass].
75        #[unsafe(method(setBypass:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn setBypass(&self, bypass: bool);
78    );
79}
80
81/// Methods declared on superclass `NSObject`.
82#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
83impl AVAudioUnitGenerator {
84    extern_methods!(
85        #[unsafe(method(init))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88
89        #[unsafe(method(new))]
90        #[unsafe(method_family = new)]
91        pub unsafe fn new() -> Retained<Self>;
92    );
93}