objc2_phase/generated/
PHASEGroupPreset.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 PHASEGroupPresetSetting is an object that holds settings that can be applied to a PHASEGroup object.
16    ///
17    /// These can be either be manually created and added to a PHASEGroupPreset object, or created inline using PHASEGroupPreset addGroup.
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasegrouppresetsetting?language=objc)
20    #[unsafe(super(NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    pub struct PHASEGroupPresetSetting;
23);
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for PHASEGroupPresetSetting {}
27);
28
29impl PHASEGroupPresetSetting {
30    extern_methods!(
31        #[unsafe(method(init))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
34
35        #[unsafe(method(new))]
36        #[unsafe(method_family = new)]
37        pub unsafe fn new() -> Retained<Self>;
38
39        #[cfg(feature = "PHASETypes")]
40        /// Initialize the PHASEGroupPresetSetting object with an existing PHASEGroup object.
41        ///
42        /// Parameter `gain`: The main gain setting to apply to the group. Values are clamped to the range [0, 1]. Default value is 1.
43        ///
44        /// Parameter `rate`: The playback rate setting to apply to the group. Values are clamped to the range [0.25, 4]. Default value is 1.
45        ///
46        /// Parameter `gainCurveType`: The type of curve to apply to the gain as the preset changes to this new setting.
47        ///
48        /// Parameter `rateCurveType`: The type of curve to apply to the rate as the preset changes to this new setting.
49        #[unsafe(method(initWithGain:rate:gainCurveType:rateCurveType:))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn initWithGain_rate_gainCurveType_rateCurveType(
52            this: Allocated<Self>,
53            gain: c_double,
54            rate: c_double,
55            gain_curve_type: PHASECurveType,
56            rate_curve_type: PHASECurveType,
57        ) -> Retained<Self>;
58
59        /// Linear gain scalar.
60        ///
61        /// Note: Values are clamped to the range [0, 1]. Default value is 1.
62        #[unsafe(method(gain))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn gain(&self) -> c_double;
65
66        /// Linear rate scalar.
67        #[unsafe(method(rate))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn rate(&self) -> c_double;
70
71        #[cfg(feature = "PHASETypes")]
72        /// The type of curve to apply to the gain as the preset changes to this new setting.
73        #[unsafe(method(gainCurveType))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn gainCurveType(&self) -> PHASECurveType;
76
77        #[cfg(feature = "PHASETypes")]
78        /// The type of curve to apply to the rate as the preset changes to this new setting.
79        #[unsafe(method(rateCurveType))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn rateCurveType(&self) -> PHASECurveType;
82    );
83}
84
85extern_class!(
86    /// *************************************************************************************************
87    ///
88    ///
89    ///
90    /// A PHASEGroupPreset holds a collection of PHASEGroupPresetSetting objects and other parameters to be applied all at once during playback.
91    ///
92    /// Initialize beforehand, and use activate or deactivate to switch to the new preset during playback.
93    /// Activating a preset will automatically deactivate the current one.
94    ///
95    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasegrouppreset?language=objc)
96    #[unsafe(super(NSObject))]
97    #[derive(Debug, PartialEq, Eq, Hash)]
98    pub struct PHASEGroupPreset;
99);
100
101extern_conformance!(
102    unsafe impl NSObjectProtocol for PHASEGroupPreset {}
103);
104
105impl PHASEGroupPreset {
106    extern_methods!(
107        #[unsafe(method(init))]
108        #[unsafe(method_family = init)]
109        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
110
111        #[unsafe(method(new))]
112        #[unsafe(method_family = new)]
113        pub unsafe fn new() -> Retained<Self>;
114
115        #[cfg(feature = "PHASEEngine")]
116        /// Create a new PHASEGroupPreset object with a given PHASEEngine object.
117        ///
118        /// Parameter `engine`: The PHASEEngine object to register this preset with.
119        ///
120        /// Parameter `settings`: A dictionary containing PHASEGroupPresetSetting objects paired with PHASEGroup objects as keys.
121        ///
122        /// Parameter `timeToTarget`: The time interval that all group settings in this preset will take to gradually fade to the new value
123        ///
124        /// Parameter `timeToReset`: The time interval that all group settings in this preset will take to gradually fade to the unity value
125        ///
126        /// Note: The timeToTarget and timeToReset are scaled by unitsPerSecond internally, so can be provided at the client's native time scale.
127        #[unsafe(method(initWithEngine:settings:timeToTarget:timeToReset:))]
128        #[unsafe(method_family = init)]
129        pub unsafe fn initWithEngine_settings_timeToTarget_timeToReset(
130            this: Allocated<Self>,
131            engine: &PHASEEngine,
132            settings: &NSDictionary<NSString, PHASEGroupPresetSetting>,
133            time_to_target: c_double,
134            time_to_reset: c_double,
135        ) -> Retained<Self>;
136
137        /// The collection of PHASEGroupPresetSetting objects to apply when this preset is activated.
138        #[unsafe(method(settings))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn settings(&self) -> Retained<NSDictionary<NSString, PHASEGroupPresetSetting>>;
141
142        /// The time interval that all group settings in this preset will take to gradually fade to the new value
143        ///
144        /// Note: The timeToTarget is scaled by unitsPerSecond internally, so can be provided at the client's native time scale.
145        #[unsafe(method(timeToTarget))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn timeToTarget(&self) -> c_double;
148
149        /// The time interval that all group settings in this preset will take to gradually fade to the unity value
150        ///
151        /// Note: The timeToReset is scaled by unitsPerSecond internally, so can be provided at the client's native time scale.
152        #[unsafe(method(timeToReset))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn timeToReset(&self) -> c_double;
155
156        /// Activate this preset in the PHASEEngine object it was initialized with. The internal timeToTarget value is used.
157        /// The current preset will be deactivated automatically.
158        #[unsafe(method(activate))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn activate(&self);
161
162        /// Activate this preset in the PHASEEngine object it was initialized with.
163        /// The current preset will be deactivated automatically.
164        ///
165        /// Parameter `timeToTargetOverride`: Override the timeToTarget value in the preset with this value.
166        ///
167        /// Note: The timeToTargetOverride is scaled by unitsPerSecond internally, so can be provided at the client's native time scale.
168        #[unsafe(method(activateWithTimeToTargetOverride:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn activateWithTimeToTargetOverride(&self, time_to_target_override: c_double);
171
172        /// Deactivate this preset and return the system to default unity values. The internal timeToReset value is used.
173        #[unsafe(method(deactivate))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn deactivate(&self);
176
177        /// Deactivate this preset and return the system to default unity values.
178        ///
179        /// Parameter `timeToResetOverride`: Override the timeToReset value in the preset with this value.
180        ///
181        /// Note: The timeToResetOverride is scaled by unitsPerSecond internally, so can be provided at the client's native time scale.
182        #[unsafe(method(deactivateWithTimeToResetOverride:))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn deactivateWithTimeToResetOverride(&self, time_to_reset_override: c_double);
185    );
186}