objc2_avf_audio/generated/
AVAudioChannelLayout.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-audio-types")]
6use objc2_core_audio_types::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// A description of the roles of a set of audio channels.
13    ///
14    /// This object is a thin wrapper for the AudioChannelLayout structure, described
15    /// in
16    /// <CoreAudio
17    /// /CoreAudioTypes.h>.
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiochannellayout?language=objc)
20    #[unsafe(super(NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    pub struct AVAudioChannelLayout;
23);
24
25unsafe impl Send for AVAudioChannelLayout {}
26
27unsafe impl Sync for AVAudioChannelLayout {}
28
29unsafe impl NSCoding for AVAudioChannelLayout {}
30
31unsafe impl NSObjectProtocol for AVAudioChannelLayout {}
32
33unsafe impl NSSecureCoding for AVAudioChannelLayout {}
34
35impl AVAudioChannelLayout {
36    extern_methods!(
37        #[unsafe(method(init))]
38        #[unsafe(method_family = init)]
39        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
40
41        #[cfg(feature = "objc2-core-audio-types")]
42        /// Initialize from a layout tag.
43        ///
44        /// Parameter `layoutTag`: The tag.
45        ///
46        /// Returns nil if the tag is either kAudioChannelLayoutTag_UseChannelDescriptions or
47        /// kAudioChannelLayoutTag_UseChannelBitmap.
48        #[unsafe(method(initWithLayoutTag:))]
49        #[unsafe(method_family = init)]
50        pub unsafe fn initWithLayoutTag(
51            this: Allocated<Self>,
52            layout_tag: AudioChannelLayoutTag,
53        ) -> Option<Retained<Self>>;
54
55        #[cfg(feature = "objc2-core-audio-types")]
56        /// Initialize from an AudioChannelLayout.
57        ///
58        /// Parameter `layout`: The AudioChannelLayout.
59        ///
60        /// If the provided layout's tag is kAudioChannelLayoutTag_UseChannelDescriptions, this
61        /// initializer attempts to convert it to a more specific tag.
62        #[unsafe(method(initWithLayout:))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn initWithLayout(
65            this: Allocated<Self>,
66            layout: NonNull<AudioChannelLayout>,
67        ) -> Retained<Self>;
68
69        /// Determine whether another AVAudioChannelLayout is exactly equal to this layout.
70        ///
71        /// Parameter `object`: The AVAudioChannelLayout to compare against.
72        ///
73        /// The underlying AudioChannelLayoutTag and AudioChannelLayout are compared for equality.
74        #[unsafe(method(isEqual:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn isEqual(&self, object: &AnyObject) -> bool;
77
78        #[cfg(feature = "objc2-core-audio-types")]
79        /// Create from a layout tag.
80        #[unsafe(method(layoutWithLayoutTag:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn layoutWithLayoutTag(layout_tag: AudioChannelLayoutTag) -> Retained<Self>;
83
84        #[cfg(feature = "objc2-core-audio-types")]
85        /// Create from an AudioChannelLayout
86        #[unsafe(method(layoutWithLayout:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn layoutWithLayout(layout: NonNull<AudioChannelLayout>) -> Retained<Self>;
89
90        #[cfg(feature = "objc2-core-audio-types")]
91        /// The layout's tag.
92        #[unsafe(method(layoutTag))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn layoutTag(&self) -> AudioChannelLayoutTag;
95
96        #[cfg(feature = "objc2-core-audio-types")]
97        /// The underlying AudioChannelLayout.
98        #[unsafe(method(layout))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn layout(&self) -> NonNull<AudioChannelLayout>;
101
102        #[cfg(feature = "AVAudioTypes")]
103        /// The number of channels of audio data.
104        #[unsafe(method(channelCount))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn channelCount(&self) -> AVAudioChannelCount;
107    );
108}
109
110/// Methods declared on superclass `NSObject`.
111impl AVAudioChannelLayout {
112    extern_methods!(
113        #[unsafe(method(new))]
114        #[unsafe(method_family = new)]
115        pub unsafe fn new() -> Retained<Self>;
116    );
117}