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
29extern_conformance!(
30    unsafe impl NSCoding for AVAudioChannelLayout {}
31);
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for AVAudioChannelLayout {}
35);
36
37extern_conformance!(
38    unsafe impl NSSecureCoding for AVAudioChannelLayout {}
39);
40
41impl AVAudioChannelLayout {
42    extern_methods!(
43        #[unsafe(method(init))]
44        #[unsafe(method_family = init)]
45        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
46
47        #[cfg(feature = "objc2-core-audio-types")]
48        /// Initialize from a layout tag.
49        ///
50        /// Parameter `layoutTag`: The tag.
51        ///
52        /// Returns nil if the tag is either kAudioChannelLayoutTag_UseChannelDescriptions or
53        /// kAudioChannelLayoutTag_UseChannelBitmap.
54        #[unsafe(method(initWithLayoutTag:))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn initWithLayoutTag(
57            this: Allocated<Self>,
58            layout_tag: AudioChannelLayoutTag,
59        ) -> Option<Retained<Self>>;
60
61        #[cfg(feature = "objc2-core-audio-types")]
62        /// Initialize from an AudioChannelLayout.
63        ///
64        /// Parameter `layout`: The AudioChannelLayout.
65        ///
66        /// If the provided layout's tag is kAudioChannelLayoutTag_UseChannelDescriptions, this
67        /// initializer attempts to convert it to a more specific tag.
68        #[unsafe(method(initWithLayout:))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn initWithLayout(
71            this: Allocated<Self>,
72            layout: NonNull<AudioChannelLayout>,
73        ) -> Retained<Self>;
74
75        /// Determine whether another AVAudioChannelLayout is exactly equal to this layout.
76        ///
77        /// Parameter `object`: The AVAudioChannelLayout to compare against.
78        ///
79        /// The underlying AudioChannelLayoutTag and AudioChannelLayout are compared for equality.
80        #[unsafe(method(isEqual:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn isEqual(&self, object: &AnyObject) -> bool;
83
84        #[cfg(feature = "objc2-core-audio-types")]
85        /// Create from a layout tag.
86        #[unsafe(method(layoutWithLayoutTag:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn layoutWithLayoutTag(layout_tag: AudioChannelLayoutTag) -> Retained<Self>;
89
90        #[cfg(feature = "objc2-core-audio-types")]
91        /// Create from an AudioChannelLayout
92        #[unsafe(method(layoutWithLayout:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn layoutWithLayout(layout: NonNull<AudioChannelLayout>) -> Retained<Self>;
95
96        #[cfg(feature = "objc2-core-audio-types")]
97        /// The layout's tag.
98        #[unsafe(method(layoutTag))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn layoutTag(&self) -> AudioChannelLayoutTag;
101
102        #[cfg(feature = "objc2-core-audio-types")]
103        /// The underlying AudioChannelLayout.
104        #[unsafe(method(layout))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn layout(&self) -> NonNull<AudioChannelLayout>;
107
108        #[cfg(feature = "AVAudioTypes")]
109        /// The number of channels of audio data.
110        #[unsafe(method(channelCount))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn channelCount(&self) -> AVAudioChannelCount;
113    );
114}
115
116/// Methods declared on superclass `NSObject`.
117impl AVAudioChannelLayout {
118    extern_methods!(
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122    );
123}