objc2_phase/generated/
PHASESpatialPipeline.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
10/// [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatialcategory?language=objc)
11// NS_TYPED_ENUM
12pub type PHASESpatialCategory = NSString;
13
14extern "C" {
15    /// [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatialcategorydirectpathtransmission?language=objc)
16    pub static PHASESpatialCategoryDirectPathTransmission: &'static PHASESpatialCategory;
17}
18
19extern "C" {
20    /// [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatialcategoryearlyreflections?language=objc)
21    pub static PHASESpatialCategoryEarlyReflections: &'static PHASESpatialCategory;
22}
23
24extern "C" {
25    /// [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatialcategorylatereverb?language=objc)
26    pub static PHASESpatialCategoryLateReverb: &'static PHASESpatialCategory;
27}
28
29/// *************************************************************************************************
30///
31///
32///
33/// Spatial pipeline flags.
34///
35/// Direct Path Transmission.
36///
37/// Early Reflections.
38///
39/// Late Reverb.
40///
41/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatialpipelineflags?language=objc)
42// NS_OPTIONS
43#[repr(transparent)]
44#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
45pub struct PHASESpatialPipelineFlags(pub NSUInteger);
46bitflags::bitflags! {
47    impl PHASESpatialPipelineFlags: NSUInteger {
48        #[doc(alias = "PHASESpatialPipelineFlagDirectPathTransmission")]
49        const DirectPathTransmission = 1<<0;
50        #[doc(alias = "PHASESpatialPipelineFlagEarlyReflections")]
51        const EarlyReflections = 1<<1;
52        #[doc(alias = "PHASESpatialPipelineFlagLateReverb")]
53        const LateReverb = 1<<2;
54    }
55}
56
57unsafe impl Encode for PHASESpatialPipelineFlags {
58    const ENCODING: Encoding = NSUInteger::ENCODING;
59}
60
61unsafe impl RefEncode for PHASESpatialPipelineFlags {
62    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
63}
64
65extern_class!(
66    /// *************************************************************************************************
67    ///
68    ///
69    ///
70    /// Spatial Pipeline Entry.
71    ///
72    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatialpipelineentry?language=objc)
73    #[unsafe(super(NSObject))]
74    #[derive(Debug, PartialEq, Eq, Hash)]
75    pub struct PHASESpatialPipelineEntry;
76);
77
78extern_conformance!(
79    unsafe impl NSObjectProtocol for PHASESpatialPipelineEntry {}
80);
81
82impl PHASESpatialPipelineEntry {
83    extern_methods!(
84        /// Send level.
85        ///
86        /// Note: Values are clamped to the range [0, 1]. Default value is 1.
87        #[unsafe(method(sendLevel))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn sendLevel(&self) -> c_double;
90
91        /// Setter for [`sendLevel`][Self::sendLevel].
92        #[unsafe(method(setSendLevel:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setSendLevel(&self, send_level: c_double);
95
96        #[cfg(all(feature = "PHASEDefinition", feature = "PHASEMetaParameter"))]
97        /// An optional metaparameter used to drive the send level during playback.
98        #[unsafe(method(sendLevelMetaParameterDefinition))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn sendLevelMetaParameterDefinition(
101            &self,
102        ) -> Option<Retained<PHASENumberMetaParameterDefinition>>;
103
104        #[cfg(all(feature = "PHASEDefinition", feature = "PHASEMetaParameter"))]
105        /// Setter for [`sendLevelMetaParameterDefinition`][Self::sendLevelMetaParameterDefinition].
106        #[unsafe(method(setSendLevelMetaParameterDefinition:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn setSendLevelMetaParameterDefinition(
109            &self,
110            send_level_meta_parameter_definition: Option<&PHASENumberMetaParameterDefinition>,
111        );
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116impl PHASESpatialPipelineEntry {
117    extern_methods!(
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub unsafe fn new() -> Retained<Self>;
125    );
126}
127
128extern_class!(
129    /// *************************************************************************************************
130    ///
131    ///
132    ///
133    /// Spatial Pipeline.
134    ///
135    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatialpipeline?language=objc)
136    #[unsafe(super(NSObject))]
137    #[derive(Debug, PartialEq, Eq, Hash)]
138    pub struct PHASESpatialPipeline;
139);
140
141extern_conformance!(
142    unsafe impl NSObjectProtocol for PHASESpatialPipeline {}
143);
144
145impl PHASESpatialPipeline {
146    extern_methods!(
147        #[unsafe(method(init))]
148        #[unsafe(method_family = init)]
149        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
150
151        #[unsafe(method(new))]
152        #[unsafe(method_family = new)]
153        pub unsafe fn new() -> Retained<Self>;
154
155        /// Initialize a Spatial Pipeline with the provided flags.
156        ///
157        /// It's invalid to pass flags == 0 to this function. Doing so will return nil.
158        ///
159        /// Parameter `flags`: Options for direct path transmission, early reflections, late reverb, etc.
160        #[unsafe(method(initWithFlags:))]
161        #[unsafe(method_family = init)]
162        pub unsafe fn initWithFlags(
163            this: Allocated<Self>,
164            flags: PHASESpatialPipelineFlags,
165        ) -> Option<Retained<Self>>;
166
167        /// Spatial Pipeline Flags.
168        #[unsafe(method(flags))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn flags(&self) -> PHASESpatialPipelineFlags;
171
172        /// A dictionary of entries in the Spatial Pipeline.
173        ///
174        /// Upon initialization, an entry will be created for every flag in the PHASESpatialPipelineFlags passed to PHASESpatialPipeline:initWithFlags.
175        #[unsafe(method(entries))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn entries(
178            &self,
179        ) -> Retained<NSDictionary<PHASESpatialCategory, PHASESpatialPipelineEntry>>;
180    );
181}