objc2_phase/generated/PHASEGroup.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
10extern_class!(
11 /// *************************************************************************************************
12 ///
13 ///
14 ///
15 /// A PHASEGroup allows clients to group generator nodes for shared processing.
16 /// Clients can set the gain and playback rate, as well as mute and solo the generator nodes in a group.
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasegroup?language=objc)
19 #[unsafe(super(NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 pub struct PHASEGroup;
22);
23
24extern_conformance!(
25 unsafe impl NSObjectProtocol for PHASEGroup {}
26);
27
28impl PHASEGroup {
29 extern_methods!(
30 #[unsafe(method(init))]
31 #[unsafe(method_family = init)]
32 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34 #[unsafe(method(new))]
35 #[unsafe(method_family = new)]
36 pub unsafe fn new() -> Retained<Self>;
37
38 /// Create a new group.
39 ///
40 /// Parameter `identifier`: The identifier that uniquely represents this group.
41 #[unsafe(method(initWithIdentifier:))]
42 #[unsafe(method_family = init)]
43 pub unsafe fn initWithIdentifier(
44 this: Allocated<Self>,
45 identifier: &NSString,
46 ) -> Retained<Self>;
47
48 #[cfg(feature = "PHASEEngine")]
49 /// Registers a group with a particular engine so that referenced assets can find it.
50 ///
51 /// Note: An exception will be thrown if the engine is invalid or the group already exists.
52 ///
53 /// Parameter `engine`: An engine object to associate this group with.
54 #[unsafe(method(registerWithEngine:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn registerWithEngine(&self, engine: &PHASEEngine);
57
58 /// Unregister the group from a particular engine.
59 #[unsafe(method(unregisterFromEngine))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn unregisterFromEngine(&self);
62
63 #[cfg(feature = "PHASETypes")]
64 /// Fade the gain of this group over a specified duration and curve.
65 ///
66 /// Note: The fade gain is applied on top of the base gain of the group.
67 ///
68 /// Parameter `gain`: A target linear gain scalar. Values are clamped to the range [0, 1].
69 ///
70 /// Parameter `duration`: The duration over which to ramp to the target linear gain scalar. Values must be >= 0.
71 /// The duration is scaled by unitsPerSecond internally, so can be provided at the client's native time scale.
72 ///
73 /// Parameter `curveType`: The type of curve function that is applied during the fade.
74 #[unsafe(method(fadeGain:duration:curveType:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn fadeGain_duration_curveType(
77 &self,
78 gain: c_double,
79 duration: c_double,
80 curve_type: PHASECurveType,
81 );
82
83 #[cfg(feature = "PHASETypes")]
84 /// Fade the playback rate of this group over a specified duration and curve.
85 ///
86 /// Note: The fade gain is applied on top of the base gain of the group.
87 ///
88 /// Parameter `rate`: A target linear rate scalar. Values are clamped to the range [0.25, 4.0].
89 ///
90 /// Parameter `duration`: The duration over which to ramp to the target linear rate scalar. Values must be >= 0.
91 /// The duration is scaled by unitsPerSecond internally, so can be provided at the client's native time scale.
92 ///
93 /// Parameter `curveType`: The type of curve function that is applied during the fade.
94 #[unsafe(method(fadeRate:duration:curveType:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn fadeRate_duration_curveType(
97 &self,
98 rate: c_double,
99 duration: c_double,
100 curve_type: PHASECurveType,
101 );
102
103 /// Mute the group.
104 #[unsafe(method(mute))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn mute(&self);
107
108 /// Unmute the group.
109 #[unsafe(method(unmute))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn unmute(&self);
112
113 /// Solo the group.
114 #[unsafe(method(solo))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn solo(&self);
117
118 /// Unsolo the group.
119 #[unsafe(method(unsolo))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn unsolo(&self);
122
123 /// The identifier that uniquely represents this group.
124 #[unsafe(method(identifier))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn identifier(&self) -> Retained<NSString>;
127
128 /// Linear gain scalar.
129 ///
130 /// Note: Values are clamped to the range [0, 1]. Default value is 1.
131 #[unsafe(method(gain))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn gain(&self) -> c_double;
134
135 /// Setter for [`gain`][Self::gain].
136 #[unsafe(method(setGain:))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn setGain(&self, gain: c_double);
139
140 /// Linear rate scalar.
141 ///
142 /// Note: Values are clamped to the range [0.25, 4]. Default value is 1.
143 #[unsafe(method(rate))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn rate(&self) -> c_double;
146
147 /// Setter for [`rate`][Self::rate].
148 #[unsafe(method(setRate:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn setRate(&self, rate: c_double);
151
152 /// Whether or not this group is muted.
153 #[unsafe(method(isMuted))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn isMuted(&self) -> bool;
156
157 /// Whether or not this group is soloed.
158 #[unsafe(method(isSoloed))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn isSoloed(&self) -> bool;
161 );
162}