objc2_av_foundation/generated/
AVAudioProcessingSettings.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4use objc2_foundation::*;
5
6use crate::*;
7
8/// The type of a time pitch algorithm.
9///
10/// On macOS and iOS, the default algorithm for playback for applications linked on or after iOS 15.0 or macOS 12.0 is is AVAudioTimePitchAlgorithmTimeDomain. For iOS versions prior to 15.0 the default value is AVAudioTimePitchAlgorithmLowQualityZeroLatency. For macOS versions prior to 12.0 the default value is AVAudioTimePitchAlgorithmSpectral.
11/// The default for export
12/// &
13/// other offline processing is AVAudioTimePitchAlgorithmSpectral.
14///
15/// For scaled audio edits, i.e. when the timeMapping of an AVAssetTrackSegment is between timeRanges of unequal duration, it is important to choose an algorithm that supports the full range of edit rates present in the source media.  AVAudioTimePitchAlgorithmSpectral is often the best choice due to the highly inclusive range of rates it supports, assuming that it is desirable to maintain a constant pitch regardless of the edit rate.  If it is instead desirable to allow the pitch to vary with the edit rate, AVAudioTimePitchAlgorithmVarispeed is the best choice.
16///
17/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avaudiotimepitchalgorithm?language=objc)
18// NS_TYPED_ENUM
19pub type AVAudioTimePitchAlgorithm = NSString;
20
21extern "C" {
22    /// Values for time pitch algorithm
23    ///
24    ///
25    /// Low quality, very inexpensive. Suitable for brief fast-forward/rewind effects, low quality voice.
26    /// Rate snapped to {0.5, 0.666667, 0.8, 1.0, 1.25, 1.5, 2.0}.
27    ///
28    ///
29    /// Modest quality, less expensive. Suitable for voice.
30    /// Variable rate from 1/32 to 32.
31    ///
32    ///
33    /// Highest quality, most computationally expensive. Suitable for music.
34    /// Variable rate from 1/32 to 32.
35    ///
36    ///
37    /// High quality, no pitch correction. Pitch varies with rate.
38    /// Variable rate from 1/32 to 32.
39    ///
40    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avaudiotimepitchalgorithmlowqualityzerolatency?language=objc)
41    #[deprecated = "Use AVAudioTimePitchAlgorithmTimeDomain instead"]
42    pub static AVAudioTimePitchAlgorithmLowQualityZeroLatency:
43        Option<&'static AVAudioTimePitchAlgorithm>;
44}
45
46extern "C" {
47    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avaudiotimepitchalgorithmtimedomain?language=objc)
48    pub static AVAudioTimePitchAlgorithmTimeDomain: Option<&'static AVAudioTimePitchAlgorithm>;
49}
50
51extern "C" {
52    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avaudiotimepitchalgorithmspectral?language=objc)
53    pub static AVAudioTimePitchAlgorithmSpectral: Option<&'static AVAudioTimePitchAlgorithm>;
54}
55
56extern "C" {
57    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avaudiotimepitchalgorithmvarispeed?language=objc)
58    pub static AVAudioTimePitchAlgorithmVarispeed: Option<&'static AVAudioTimePitchAlgorithm>;
59}
60
61/// These constants can be used to specify values for allowedAudioSpatializationFormats.
62///
63///
64/// Indicates that no audio spatialization is allowed.
65///
66/// Indicates that only mono and stereo formats may be used for audio spatialization.
67///
68/// Indicates that only multichannel layouts may be used for audio spatialization.
69///
70/// Indicates that mono, stereo and multichannel layouts may be used for audio spatialization.
71///
72/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avaudiospatializationformats?language=objc)
73// NS_OPTIONS
74#[repr(transparent)]
75#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
76pub struct AVAudioSpatializationFormats(pub NSUInteger);
77bitflags::bitflags! {
78    impl AVAudioSpatializationFormats: NSUInteger {
79        #[doc(alias = "AVAudioSpatializationFormatNone")]
80        const None = 0;
81        #[doc(alias = "AVAudioSpatializationFormatMonoAndStereo")]
82        const MonoAndStereo = 0x3;
83        #[doc(alias = "AVAudioSpatializationFormatMultichannel")]
84        const Multichannel = 0x4;
85        #[doc(alias = "AVAudioSpatializationFormatMonoStereoAndMultichannel")]
86        const MonoStereoAndMultichannel = 0x7;
87    }
88}
89
90unsafe impl Encode for AVAudioSpatializationFormats {
91    const ENCODING: Encoding = NSUInteger::ENCODING;
92}
93
94unsafe impl RefEncode for AVAudioSpatializationFormats {
95    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
96}