objc2_av_foundation/generated/
AVAudioMix.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-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avaudiomix?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct AVAudioMix;
17);
18
19unsafe impl NSCopying for AVAudioMix {}
20
21unsafe impl CopyingHelper for AVAudioMix {
22    type Result = Self;
23}
24
25unsafe impl NSMutableCopying for AVAudioMix {}
26
27unsafe impl MutableCopyingHelper for AVAudioMix {
28    type Result = AVMutableAudioMix;
29}
30
31unsafe impl NSObjectProtocol for AVAudioMix {}
32
33impl AVAudioMix {
34    extern_methods!(
35        #[unsafe(method(inputParameters))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn inputParameters(&self) -> Retained<NSArray<AVAudioMixInputParameters>>;
38    );
39}
40
41/// Methods declared on superclass `NSObject`.
42impl AVAudioMix {
43    extern_methods!(
44        #[unsafe(method(init))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
47
48        #[unsafe(method(new))]
49        #[unsafe(method_family = new)]
50        pub unsafe fn new() -> Retained<Self>;
51    );
52}
53
54extern_class!(
55    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutableaudiomix?language=objc)
56    #[unsafe(super(AVAudioMix, NSObject))]
57    #[derive(Debug, PartialEq, Eq, Hash)]
58    pub struct AVMutableAudioMix;
59);
60
61unsafe impl NSCopying for AVMutableAudioMix {}
62
63unsafe impl CopyingHelper for AVMutableAudioMix {
64    type Result = AVAudioMix;
65}
66
67unsafe impl NSMutableCopying for AVMutableAudioMix {}
68
69unsafe impl MutableCopyingHelper for AVMutableAudioMix {
70    type Result = Self;
71}
72
73unsafe impl NSObjectProtocol for AVMutableAudioMix {}
74
75impl AVMutableAudioMix {
76    extern_methods!(
77        #[unsafe(method(audioMix))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn audioMix() -> Retained<Self>;
80
81        /// Indicates parameters for inputs to the mix; an NSArray of instances of AVAudioMixInputParameters.
82        ///
83        /// Note that an instance of AVAudioMixInputParameters is not required for each audio track that contributes to the mix; audio for those without associated AVAudioMixInputParameters will be included in the mix, processed according to default behavior.
84        #[unsafe(method(inputParameters))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn inputParameters(&self) -> Retained<NSArray<AVAudioMixInputParameters>>;
87
88        /// Setter for [`inputParameters`][Self::inputParameters].
89        #[unsafe(method(setInputParameters:))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn setInputParameters(
92            &self,
93            input_parameters: &NSArray<AVAudioMixInputParameters>,
94        );
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl AVMutableAudioMix {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}
110
111extern_class!(
112    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avaudiomixinputparameters?language=objc)
113    #[unsafe(super(NSObject))]
114    #[derive(Debug, PartialEq, Eq, Hash)]
115    pub struct AVAudioMixInputParameters;
116);
117
118unsafe impl NSCopying for AVAudioMixInputParameters {}
119
120unsafe impl CopyingHelper for AVAudioMixInputParameters {
121    type Result = Self;
122}
123
124unsafe impl NSMutableCopying for AVAudioMixInputParameters {}
125
126unsafe impl MutableCopyingHelper for AVAudioMixInputParameters {
127    type Result = AVMutableAudioMixInputParameters;
128}
129
130unsafe impl NSObjectProtocol for AVAudioMixInputParameters {}
131
132impl AVAudioMixInputParameters {
133    extern_methods!(
134        #[cfg(feature = "objc2-core-media")]
135        /// Indicates the trackID of the audio track to which the parameters should be applied.
136        #[unsafe(method(trackID))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn trackID(&self) -> CMPersistentTrackID;
139
140        #[cfg(feature = "AVAudioProcessingSettings")]
141        /// Indicates the processing algorithm used to manage audio pitch at varying rates and for scaled audio edits.
142        ///
143        /// Constants for various time pitch algorithms, e.g. AVAudioTimePitchSpectral, are defined in AVAudioProcessingSettings.h.
144        /// Can be nil, in which case the audioTimePitchAlgorithm set on the AVPlayerItem, AVAssetExportSession, or AVAssetReaderAudioMixOutput on which the AVAudioMix is set will be used for the associated track.
145        #[unsafe(method(audioTimePitchAlgorithm))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn audioTimePitchAlgorithm(&self)
148            -> Option<Retained<AVAudioTimePitchAlgorithm>>;
149
150        #[cfg(feature = "objc2-core-media")]
151        #[unsafe(method(getVolumeRampForTime:startVolume:endVolume:timeRange:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn getVolumeRampForTime_startVolume_endVolume_timeRange(
154            &self,
155            time: CMTime,
156            start_volume: *mut c_float,
157            end_volume: *mut c_float,
158            time_range: *mut CMTimeRange,
159        ) -> bool;
160    );
161}
162
163/// Methods declared on superclass `NSObject`.
164impl AVAudioMixInputParameters {
165    extern_methods!(
166        #[unsafe(method(init))]
167        #[unsafe(method_family = init)]
168        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
169
170        #[unsafe(method(new))]
171        #[unsafe(method_family = new)]
172        pub unsafe fn new() -> Retained<Self>;
173    );
174}
175
176extern_class!(
177    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutableaudiomixinputparameters?language=objc)
178    #[unsafe(super(AVAudioMixInputParameters, NSObject))]
179    #[derive(Debug, PartialEq, Eq, Hash)]
180    pub struct AVMutableAudioMixInputParameters;
181);
182
183unsafe impl NSCopying for AVMutableAudioMixInputParameters {}
184
185unsafe impl CopyingHelper for AVMutableAudioMixInputParameters {
186    type Result = AVAudioMixInputParameters;
187}
188
189unsafe impl NSMutableCopying for AVMutableAudioMixInputParameters {}
190
191unsafe impl MutableCopyingHelper for AVMutableAudioMixInputParameters {
192    type Result = Self;
193}
194
195unsafe impl NSObjectProtocol for AVMutableAudioMixInputParameters {}
196
197impl AVMutableAudioMixInputParameters {
198    extern_methods!(
199        #[cfg(feature = "AVAssetTrack")]
200        #[unsafe(method(audioMixInputParametersWithTrack:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn audioMixInputParametersWithTrack(
203            track: Option<&AVAssetTrack>,
204        ) -> Retained<Self>;
205
206        #[unsafe(method(audioMixInputParameters))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn audioMixInputParameters() -> Retained<Self>;
209
210        #[cfg(feature = "objc2-core-media")]
211        /// Indicates the trackID of the audio track to which the parameters should be applied.
212        #[unsafe(method(trackID))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn trackID(&self) -> CMPersistentTrackID;
215
216        #[cfg(feature = "objc2-core-media")]
217        /// Setter for [`trackID`][Self::trackID].
218        #[unsafe(method(setTrackID:))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn setTrackID(&self, track_id: CMPersistentTrackID);
221
222        #[cfg(feature = "AVAudioProcessingSettings")]
223        /// Indicates the processing algorithm used to manage audio pitch at varying rates and for scaled audio edits.
224        ///
225        /// Constants for various time pitch algorithms, e.g. AVAudioTimePitchSpectral, are defined in AVAudioProcessingSettings.h.
226        /// Can be nil, in which case the audioTimePitchAlgorithm set on the AVPlayerItem, AVAssetExportSession, or AVAssetReaderAudioMixOutput on which the AVAudioMix is set will be used for the associated track.
227        #[unsafe(method(audioTimePitchAlgorithm))]
228        #[unsafe(method_family = none)]
229        pub unsafe fn audioTimePitchAlgorithm(&self)
230            -> Option<Retained<AVAudioTimePitchAlgorithm>>;
231
232        #[cfg(feature = "AVAudioProcessingSettings")]
233        /// Setter for [`audioTimePitchAlgorithm`][Self::audioTimePitchAlgorithm].
234        #[unsafe(method(setAudioTimePitchAlgorithm:))]
235        #[unsafe(method_family = none)]
236        pub unsafe fn setAudioTimePitchAlgorithm(
237            &self,
238            audio_time_pitch_algorithm: Option<&AVAudioTimePitchAlgorithm>,
239        );
240
241        #[cfg(feature = "objc2-core-media")]
242        #[unsafe(method(setVolumeRampFromStartVolume:toEndVolume:timeRange:))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn setVolumeRampFromStartVolume_toEndVolume_timeRange(
245            &self,
246            start_volume: c_float,
247            end_volume: c_float,
248            time_range: CMTimeRange,
249        );
250
251        #[cfg(feature = "objc2-core-media")]
252        #[unsafe(method(setVolume:atTime:))]
253        #[unsafe(method_family = none)]
254        pub unsafe fn setVolume_atTime(&self, volume: c_float, time: CMTime);
255    );
256}
257
258/// Methods declared on superclass `NSObject`.
259impl AVMutableAudioMixInputParameters {
260    extern_methods!(
261        #[unsafe(method(init))]
262        #[unsafe(method_family = init)]
263        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
264
265        #[unsafe(method(new))]
266        #[unsafe(method_family = new)]
267        pub unsafe fn new() -> Retained<Self>;
268    );
269}