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))]
32extern_conformance!(
33    unsafe impl AVAudio3DMixing for AVAudioUnitGenerator {}
34);
35
36#[cfg(all(
37    feature = "AVAudioMixing",
38    feature = "AVAudioNode",
39    feature = "AVAudioUnit"
40))]
41extern_conformance!(
42    unsafe impl AVAudioMixing for AVAudioUnitGenerator {}
43);
44
45#[cfg(all(
46    feature = "AVAudioMixing",
47    feature = "AVAudioNode",
48    feature = "AVAudioUnit"
49))]
50extern_conformance!(
51    unsafe impl AVAudioStereoMixing for AVAudioUnitGenerator {}
52);
53
54#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
55extern_conformance!(
56    unsafe impl NSObjectProtocol for AVAudioUnitGenerator {}
57);
58
59#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
60impl AVAudioUnitGenerator {
61    extern_methods!(
62        #[cfg(feature = "objc2-audio-toolbox")]
63        #[cfg(not(target_os = "watchos"))]
64        /// Create an AVAudioUnitGenerator object.
65        ///
66        ///
67        /// Parameter `audioComponentDescription`: AudioComponentDescription of the audio unit to be instantiated.
68        ///
69        /// The componentType must be kAudioUnitType_Generator or kAudioUnitType_RemoteGenerator
70        #[unsafe(method(initWithAudioComponentDescription:))]
71        #[unsafe(method_family = init)]
72        pub unsafe fn initWithAudioComponentDescription(
73            this: Allocated<Self>,
74            audio_component_description: AudioComponentDescription,
75        ) -> Retained<Self>;
76
77        /// Bypass state of the audio unit.
78        #[unsafe(method(bypass))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn bypass(&self) -> bool;
81
82        /// Setter for [`bypass`][Self::bypass].
83        #[unsafe(method(setBypass:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setBypass(&self, bypass: bool);
86    );
87}
88
89/// Methods declared on superclass `NSObject`.
90#[cfg(all(feature = "AVAudioNode", feature = "AVAudioUnit"))]
91impl AVAudioUnitGenerator {
92    extern_methods!(
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96
97        #[unsafe(method(new))]
98        #[unsafe(method_family = new)]
99        pub unsafe fn new() -> Retained<Self>;
100    );
101}