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