objc2_phase/generated/
PHASEDistanceModel.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
7use crate::*;
8
9extern_class!(
10    /// *************************************************************************************************
11    ///
12    ///
13    ///
14    /// Distance model fade out parameters.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasedistancemodelfadeoutparameters?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct PHASEDistanceModelFadeOutParameters;
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for PHASEDistanceModelFadeOutParameters {}
24);
25
26impl PHASEDistanceModelFadeOutParameters {
27    extern_methods!(
28        #[unsafe(method(init))]
29        #[unsafe(method_family = init)]
30        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
31
32        #[unsafe(method(new))]
33        #[unsafe(method_family = new)]
34        pub unsafe fn new() -> Retained<Self>;
35
36        /// Initialize with a cullDistance.
37        ///
38        /// Parameter `cullDistance`: The distance beyond which the sound will be culled. Values must be >= 1.
39        ///
40        /// Note: The cullDistance is scaled by unitsPerMeter internally, so can be provided at the client's native spatial scale.
41        /// The system will smoothly fade the sound to zero before reaching this distance to avoid any audible artifacts.
42        ///
43        /// Returns: An instance, or nil if initialization fails.
44        #[unsafe(method(initWithCullDistance:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithCullDistance(
47            this: Allocated<Self>,
48            cull_distance: c_double,
49        ) -> Retained<Self>;
50
51        /// The distance beyond which the sound will be culled.
52        ///
53        /// Note: Values are clamped the range [1, DBL_MAX].
54        /// This value is scaled by unitsPerMeter internally, so can be provided at the client's native spatial scale.
55        #[unsafe(method(cullDistance))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn cullDistance(&self) -> c_double;
58    );
59}
60
61extern_class!(
62    /// *************************************************************************************************
63    ///
64    ///
65    ///
66    /// Distance model parameters.
67    ///
68    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasedistancemodelparameters?language=objc)
69    #[unsafe(super(NSObject))]
70    #[derive(Debug, PartialEq, Eq, Hash)]
71    pub struct PHASEDistanceModelParameters;
72);
73
74extern_conformance!(
75    unsafe impl NSObjectProtocol for PHASEDistanceModelParameters {}
76);
77
78impl PHASEDistanceModelParameters {
79    extern_methods!(
80        #[unsafe(method(init))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
83
84        #[unsafe(method(new))]
85        #[unsafe(method_family = new)]
86        pub unsafe fn new() -> Retained<Self>;
87
88        /// Fade out parameters (optional).
89        #[unsafe(method(fadeOutParameters))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn fadeOutParameters(
92            &self,
93        ) -> Option<Retained<PHASEDistanceModelFadeOutParameters>>;
94
95        /// Setter for [`fadeOutParameters`][Self::fadeOutParameters].
96        #[unsafe(method(setFadeOutParameters:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn setFadeOutParameters(
99            &self,
100            fade_out_parameters: Option<&PHASEDistanceModelFadeOutParameters>,
101        );
102    );
103}
104
105extern_class!(
106    /// *************************************************************************************************
107    ///
108    ///
109    ///
110    /// Geometric spreading distance model parameters.
111    ///
112    /// Standard geometric spreading loss as a function of geometry and distance.
113    ///
114    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasegeometricspreadingdistancemodelparameters?language=objc)
115    #[unsafe(super(PHASEDistanceModelParameters, NSObject))]
116    #[derive(Debug, PartialEq, Eq, Hash)]
117    pub struct PHASEGeometricSpreadingDistanceModelParameters;
118);
119
120extern_conformance!(
121    unsafe impl NSObjectProtocol for PHASEGeometricSpreadingDistanceModelParameters {}
122);
123
124impl PHASEGeometricSpreadingDistanceModelParameters {
125    extern_methods!(
126        #[unsafe(method(init))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130        /// Rolloff factor.
131        ///
132        /// Note: Values are clamped to the range [0.0, DBL_MAX].
133        /// Default value is 1.0.
134        /// 0.0 is no effect. 0.5 is half the effect. 1.0 is normal. 2.0 is double the effect.
135        #[unsafe(method(rolloffFactor))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn rolloffFactor(&self) -> c_double;
138
139        /// Setter for [`rolloffFactor`][Self::rolloffFactor].
140        #[unsafe(method(setRolloffFactor:))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn setRolloffFactor(&self, rolloff_factor: c_double);
143    );
144}
145
146/// Methods declared on superclass `PHASEDistanceModelParameters`.
147impl PHASEGeometricSpreadingDistanceModelParameters {
148    extern_methods!(
149        #[unsafe(method(new))]
150        #[unsafe(method_family = new)]
151        pub unsafe fn new() -> Retained<Self>;
152    );
153}
154
155extern_class!(
156    /// *************************************************************************************************
157    ///
158    ///
159    ///
160    /// Envelope distance model parameters.
161    ///
162    /// Envelope-driven attenuation over distance.
163    ///
164    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseenvelopedistancemodelparameters?language=objc)
165    #[unsafe(super(PHASEDistanceModelParameters, NSObject))]
166    #[derive(Debug, PartialEq, Eq, Hash)]
167    pub struct PHASEEnvelopeDistanceModelParameters;
168);
169
170extern_conformance!(
171    unsafe impl NSObjectProtocol for PHASEEnvelopeDistanceModelParameters {}
172);
173
174impl PHASEEnvelopeDistanceModelParameters {
175    extern_methods!(
176        #[unsafe(method(init))]
177        #[unsafe(method_family = init)]
178        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
179
180        #[unsafe(method(new))]
181        #[unsafe(method_family = new)]
182        pub unsafe fn new() -> Retained<Self>;
183
184        #[cfg(feature = "PHASEEnvelope")]
185        /// Initialize a PHASEEnvelopeDistanceModelParameters with a PHASEEnvelope
186        ///
187        /// Parameter `envelope`: An envelope object where x values are interpreted as distance and the y values interpreted as gain.
188        ///
189        /// Returns: An instance, or nil if initialization failed.
190        #[unsafe(method(initWithEnvelope:))]
191        #[unsafe(method_family = init)]
192        pub unsafe fn initWithEnvelope(
193            this: Allocated<Self>,
194            envelope: &PHASEEnvelope,
195        ) -> Retained<Self>;
196
197        #[cfg(feature = "PHASEEnvelope")]
198        /// A PHASEEnvelope object
199        ///
200        /// Note: The x values are interpreted as distance and the y values are interpreted as gain.
201        #[unsafe(method(envelope))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn envelope(&self) -> Retained<PHASEEnvelope>;
204    );
205}