objc2_phase/generated/
PHASEMixer.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-avf-audio")]
7use objc2_avf_audio::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// *************************************************************************************************
14    ///
15    ///
16    ///
17    /// The base class for a mixer definition.
18    ///
19    /// Mixer definitions control how audio will be rendered to the output in PHASE.
20    ///
21    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasemixerdefinition?language=objc)
22    #[unsafe(super(PHASEDefinition, NSObject))]
23    #[derive(Debug, PartialEq, Eq, Hash)]
24    #[cfg(feature = "PHASEDefinition")]
25    pub struct PHASEMixerDefinition;
26);
27
28#[cfg(feature = "PHASEDefinition")]
29extern_conformance!(
30    unsafe impl NSObjectProtocol for PHASEMixerDefinition {}
31);
32
33#[cfg(feature = "PHASEDefinition")]
34impl PHASEMixerDefinition {
35    extern_methods!(
36        #[unsafe(method(init))]
37        #[unsafe(method_family = init)]
38        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
39
40        #[unsafe(method(new))]
41        #[unsafe(method_family = new)]
42        pub unsafe fn new() -> Retained<Self>;
43
44        /// Linear gain scalar.
45        ///
46        /// Note: Values are clamped to the range [0, 1]. Default value is 1.
47        #[unsafe(method(gain))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn gain(&self) -> c_double;
50
51        /// Setter for [`gain`][Self::gain].
52        #[unsafe(method(setGain:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn setGain(&self, gain: c_double);
55
56        #[cfg(feature = "PHASEMetaParameter")]
57        /// Optionally attach a metaparameter definition here to enable real-time control of the gain during playback.
58        #[unsafe(method(gainMetaParameterDefinition))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn gainMetaParameterDefinition(
61            &self,
62        ) -> Option<Retained<PHASENumberMetaParameterDefinition>>;
63
64        #[cfg(feature = "PHASEMetaParameter")]
65        /// Setter for [`gainMetaParameterDefinition`][Self::gainMetaParameterDefinition].
66        #[unsafe(method(setGainMetaParameterDefinition:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setGainMetaParameterDefinition(
69            &self,
70            gain_meta_parameter_definition: Option<&PHASENumberMetaParameterDefinition>,
71        );
72    );
73}
74
75extern_class!(
76    /// *************************************************************************************************
77    ///
78    ///
79    ///
80    /// Spatial mixer definition.
81    ///
82    /// Spatial mixers render audio with spatialization and environmental effects.
83    ///
84    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatialmixerdefinition?language=objc)
85    #[unsafe(super(PHASEMixerDefinition, PHASEDefinition, NSObject))]
86    #[derive(Debug, PartialEq, Eq, Hash)]
87    #[cfg(feature = "PHASEDefinition")]
88    pub struct PHASESpatialMixerDefinition;
89);
90
91#[cfg(feature = "PHASEDefinition")]
92extern_conformance!(
93    unsafe impl NSObjectProtocol for PHASESpatialMixerDefinition {}
94);
95
96#[cfg(feature = "PHASEDefinition")]
97impl PHASESpatialMixerDefinition {
98    extern_methods!(
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub unsafe fn new() -> Retained<Self>;
106
107        #[cfg(feature = "PHASESpatialPipeline")]
108        /// Create a new PHASESpatialMixerDefinition
109        ///
110        /// Parameter `spatialPipeline`: A spatial pipeline.
111        ///
112        /// Returns: A new PHASESpatialMixerDefinition object
113        #[unsafe(method(initWithSpatialPipeline:))]
114        #[unsafe(method_family = init)]
115        pub unsafe fn initWithSpatialPipeline(
116            this: Allocated<Self>,
117            spatial_pipeline: &PHASESpatialPipeline,
118        ) -> Retained<Self>;
119
120        #[cfg(feature = "PHASESpatialPipeline")]
121        /// Create a new PHASESpatialMixerDefinition
122        ///
123        /// Parameter `spatialPipeline`: A spatial pipeline.
124        ///
125        /// Parameter `identifier`: An optional custom identifier to give to this object
126        ///
127        /// Returns: A new PHASESpatialMixerDefinition object
128        #[unsafe(method(initWithSpatialPipeline:identifier:))]
129        #[unsafe(method_family = init)]
130        pub unsafe fn initWithSpatialPipeline_identifier(
131            this: Allocated<Self>,
132            spatial_pipeline: &PHASESpatialPipeline,
133            identifier: &NSString,
134        ) -> Retained<Self>;
135
136        #[cfg(feature = "PHASESpatialPipeline")]
137        /// Spatial Pipeline.
138        #[unsafe(method(spatialPipeline))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn spatialPipeline(&self) -> Retained<PHASESpatialPipeline>;
141
142        #[cfg(feature = "PHASEDistanceModel")]
143        /// Distance model parameters (optional).
144        #[unsafe(method(distanceModelParameters))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn distanceModelParameters(
147            &self,
148        ) -> Option<Retained<PHASEDistanceModelParameters>>;
149
150        #[cfg(feature = "PHASEDistanceModel")]
151        /// Setter for [`distanceModelParameters`][Self::distanceModelParameters].
152        #[unsafe(method(setDistanceModelParameters:))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn setDistanceModelParameters(
155            &self,
156            distance_model_parameters: Option<&PHASEDistanceModelParameters>,
157        );
158
159        #[cfg(feature = "PHASEDirectivityModel")]
160        /// Listener directivity model parameters (optional).
161        #[unsafe(method(listenerDirectivityModelParameters))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn listenerDirectivityModelParameters(
164            &self,
165        ) -> Option<Retained<PHASEDirectivityModelParameters>>;
166
167        #[cfg(feature = "PHASEDirectivityModel")]
168        /// Setter for [`listenerDirectivityModelParameters`][Self::listenerDirectivityModelParameters].
169        #[unsafe(method(setListenerDirectivityModelParameters:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn setListenerDirectivityModelParameters(
172            &self,
173            listener_directivity_model_parameters: Option<&PHASEDirectivityModelParameters>,
174        );
175
176        #[cfg(feature = "PHASEDirectivityModel")]
177        /// Source directivity model parameters (optional).
178        #[unsafe(method(sourceDirectivityModelParameters))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn sourceDirectivityModelParameters(
181            &self,
182        ) -> Option<Retained<PHASEDirectivityModelParameters>>;
183
184        #[cfg(feature = "PHASEDirectivityModel")]
185        /// Setter for [`sourceDirectivityModelParameters`][Self::sourceDirectivityModelParameters].
186        #[unsafe(method(setSourceDirectivityModelParameters:))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn setSourceDirectivityModelParameters(
189            &self,
190            source_directivity_model_parameters: Option<&PHASEDirectivityModelParameters>,
191        );
192    );
193}
194
195extern_class!(
196    /// *************************************************************************************************
197    ///
198    ///
199    ///
200    /// Ambient mixer definition.
201    ///
202    /// Ambient mixers render audio with spatialization but without environmental effects.
203    /// Use ambient mixers for content that isn't being simulated in the environment,
204    /// but should still sound like it's coming from somewhere out in space.
205    ///
206    /// Note: Ambient mixers do not support distance modeling or directivity modeling.
207    /// Clients can however set the orientation at initialization time.
208    ///
209    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseambientmixerdefinition?language=objc)
210    #[unsafe(super(PHASEMixerDefinition, PHASEDefinition, NSObject))]
211    #[derive(Debug, PartialEq, Eq, Hash)]
212    #[cfg(feature = "PHASEDefinition")]
213    pub struct PHASEAmbientMixerDefinition;
214);
215
216#[cfg(feature = "PHASEDefinition")]
217extern_conformance!(
218    unsafe impl NSObjectProtocol for PHASEAmbientMixerDefinition {}
219);
220
221#[cfg(feature = "PHASEDefinition")]
222impl PHASEAmbientMixerDefinition {
223    extern_methods!(
224        #[unsafe(method(init))]
225        #[unsafe(method_family = init)]
226        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
227
228        #[unsafe(method(new))]
229        #[unsafe(method_family = new)]
230        pub unsafe fn new() -> Retained<Self>;
231
232        #[cfg(feature = "objc2-avf-audio")]
233        /// A readonly value of the input channel layout this mixer was initialized with.
234        #[unsafe(method(inputChannelLayout))]
235        #[unsafe(method_family = none)]
236        pub unsafe fn inputChannelLayout(&self) -> Retained<AVAudioChannelLayout>;
237    );
238}
239
240extern_class!(
241    /// *************************************************************************************************
242    ///
243    ///
244    ///
245    /// Channel mixer definition.
246    ///
247    /// Channel mixers render audio without spatialization or environmental effects.
248    /// Use channel mixers for regular stem-based content that needs be rendered directly to the output device, such as stereo music
249    /// or center channel narrative dialogue.
250    ///
251    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasechannelmixerdefinition?language=objc)
252    #[unsafe(super(PHASEMixerDefinition, PHASEDefinition, NSObject))]
253    #[derive(Debug, PartialEq, Eq, Hash)]
254    #[cfg(feature = "PHASEDefinition")]
255    pub struct PHASEChannelMixerDefinition;
256);
257
258#[cfg(feature = "PHASEDefinition")]
259extern_conformance!(
260    unsafe impl NSObjectProtocol for PHASEChannelMixerDefinition {}
261);
262
263#[cfg(feature = "PHASEDefinition")]
264impl PHASEChannelMixerDefinition {
265    extern_methods!(
266        #[unsafe(method(init))]
267        #[unsafe(method_family = init)]
268        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
269
270        #[unsafe(method(new))]
271        #[unsafe(method_family = new)]
272        pub unsafe fn new() -> Retained<Self>;
273
274        #[cfg(feature = "objc2-avf-audio")]
275        /// Create a new PHASEChannelMixerDefinition
276        ///
277        /// Note: Any connected sampler must match this channel layout.
278        ///
279        /// Parameter `layout`: The input channel layout.
280        ///
281        /// Parameter `identifier`: An optional custom identifier to give to this object
282        ///
283        /// Returns: A new PHASEChannelMixerDefinition object
284        #[unsafe(method(initWithChannelLayout:identifier:))]
285        #[unsafe(method_family = init)]
286        pub unsafe fn initWithChannelLayout_identifier(
287            this: Allocated<Self>,
288            layout: &AVAudioChannelLayout,
289            identifier: &NSString,
290        ) -> Retained<Self>;
291
292        #[cfg(feature = "objc2-avf-audio")]
293        /// Create a new PHASEChannelMixerDefinition
294        ///
295        /// Note: Any connected sampler must match this channel layout.
296        ///
297        /// Parameter `layout`: The input channel layout. Any connected sampler must match this channel layout.
298        ///
299        /// Returns: A new PHASEChannelMixerDefinition object
300        #[unsafe(method(initWithChannelLayout:))]
301        #[unsafe(method_family = init)]
302        pub unsafe fn initWithChannelLayout(
303            this: Allocated<Self>,
304            layout: &AVAudioChannelLayout,
305        ) -> Retained<Self>;
306
307        #[cfg(feature = "objc2-avf-audio")]
308        /// A readonly value of the input channel layout this mixer was initialized with.
309        #[unsafe(method(inputChannelLayout))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn inputChannelLayout(&self) -> Retained<AVAudioChannelLayout>;
312    );
313}
314
315extern_class!(
316    /// *************************************************************************************************
317    ///
318    ///
319    ///
320    /// A generic object the represents an active mixer in the system
321    ///
322    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasemixer?language=objc)
323    #[unsafe(super(NSObject))]
324    #[derive(Debug, PartialEq, Eq, Hash)]
325    pub struct PHASEMixer;
326);
327
328extern_conformance!(
329    unsafe impl NSObjectProtocol for PHASEMixer {}
330);
331
332impl PHASEMixer {
333    extern_methods!(
334        #[unsafe(method(init))]
335        #[unsafe(method_family = init)]
336        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
337
338        #[unsafe(method(new))]
339        #[unsafe(method_family = new)]
340        pub unsafe fn new() -> Retained<Self>;
341
342        /// The identifier that uniquely represents this mixer.
343        #[unsafe(method(identifier))]
344        #[unsafe(method_family = none)]
345        pub unsafe fn identifier(&self) -> Retained<NSString>;
346
347        /// Linear gain scalar.
348        ///
349        /// Note: Values are clamped to the range [0, 1]. Default value is 1.
350        #[unsafe(method(gain))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn gain(&self) -> c_double;
353
354        #[cfg(feature = "PHASEMetaParameter")]
355        /// The metaparameter that can be used to adjust the gain during playback
356        #[unsafe(method(gainMetaParameter))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn gainMetaParameter(&self) -> Option<Retained<PHASEMetaParameter>>;
359    );
360}
361
362extern_class!(
363    /// *************************************************************************************************
364    ///
365    ///
366    ///
367    /// An object that holds runtime parameters for mixers when creating PHASESoundEvents.
368    ///
369    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasemixerparameters?language=objc)
370    #[unsafe(super(NSObject))]
371    #[derive(Debug, PartialEq, Eq, Hash)]
372    pub struct PHASEMixerParameters;
373);
374
375extern_conformance!(
376    unsafe impl NSObjectProtocol for PHASEMixerParameters {}
377);
378
379impl PHASEMixerParameters {
380    extern_methods!(
381        #[cfg(all(
382            feature = "PHASEListener",
383            feature = "PHASEObject",
384            feature = "PHASESource"
385        ))]
386        /// Adds runtime parameters for a spatial mixer
387        ///
388        /// Parameter `identifier`: The unique identifier assigned to a spatial submixer object.
389        ///
390        /// Parameter `source`: The PHASESource object that this mixer will use to spatialize sounds.
391        ///
392        /// Parameter `listener`: The PHASEListener object that this mixer will use to spatialize sounds.
393        #[unsafe(method(addSpatialMixerParametersWithIdentifier:source:listener:))]
394        #[unsafe(method_family = none)]
395        pub unsafe fn addSpatialMixerParametersWithIdentifier_source_listener(
396            &self,
397            identifier: &NSString,
398            source: &PHASESource,
399            listener: &PHASEListener,
400        );
401
402        #[cfg(all(feature = "PHASEListener", feature = "PHASEObject"))]
403        /// Adds runtime parameters for an ambient mixer
404        ///
405        /// Parameter `identifier`: The unique identifier assigned to a spatial submixer object.
406        ///
407        /// Parameter `listener`: The PHASEListener object that this mixer will use to orient sounds.
408        #[unsafe(method(addAmbientMixerParametersWithIdentifier:listener:))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn addAmbientMixerParametersWithIdentifier_listener(
411            &self,
412            identifier: &NSString,
413            listener: &PHASEListener,
414        );
415    );
416}
417
418/// Methods declared on superclass `NSObject`.
419impl PHASEMixerParameters {
420    extern_methods!(
421        #[unsafe(method(init))]
422        #[unsafe(method_family = init)]
423        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
424
425        #[unsafe(method(new))]
426        #[unsafe(method_family = new)]
427        pub unsafe fn new() -> Retained<Self>;
428    );
429}