objc2_avf_audio/generated/
AVAudioUnitTimePitch.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-audio-toolbox")]
7#[cfg(not(target_os = "watchos"))]
8use objc2_audio_toolbox::*;
9
10use crate::*;
11
12extern_class!(
13    /// an AVAudioUnitTimeEffect that provides good quality time stretching and pitch shifting
14    ///
15    /// In this time effect, the playback rate and pitch parameters function independently of each other
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiounittimepitch?language=objc)
18    #[unsafe(super(AVAudioUnitTimeEffect, AVAudioUnit, AVAudioNode, NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(all(
21        feature = "AVAudioNode",
22        feature = "AVAudioUnit",
23        feature = "AVAudioUnitTimeEffect"
24    ))]
25    pub struct AVAudioUnitTimePitch;
26);
27
28#[cfg(all(
29    feature = "AVAudioNode",
30    feature = "AVAudioUnit",
31    feature = "AVAudioUnitTimeEffect"
32))]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for AVAudioUnitTimePitch {}
35);
36
37#[cfg(all(
38    feature = "AVAudioNode",
39    feature = "AVAudioUnit",
40    feature = "AVAudioUnitTimeEffect"
41))]
42impl AVAudioUnitTimePitch {
43    extern_methods!(
44        /// playback rate of the input signal
45        ///
46        /// Range:      1/32 -> 32.0
47        /// Default:    1.0
48        /// Unit:       Generic
49        #[unsafe(method(rate))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn rate(&self) -> c_float;
52
53        /// Setter for [`rate`][Self::rate].
54        #[unsafe(method(setRate:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn setRate(&self, rate: c_float);
57
58        /// amount by which the input signal is pitch shifted
59        ///
60        /// 1 octave  = 1200 cents
61        /// 1 musical semitone  = 100 cents
62        ///
63        /// Range:      -2400 -> 2400
64        /// Default:    0.0
65        /// Unit:       Cents
66        #[unsafe(method(pitch))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn pitch(&self) -> c_float;
69
70        /// Setter for [`pitch`][Self::pitch].
71        #[unsafe(method(setPitch:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn setPitch(&self, pitch: c_float);
74
75        /// amount of overlap between segments of the input audio signal
76        ///
77        /// A higher value results in fewer artifacts in the output signal.
78        /// This parameter also impacts the amount of CPU used.
79        ///
80        /// Range:      3.0 -> 32.0
81        /// Default:    8.0
82        /// Unit:       Generic
83        #[unsafe(method(overlap))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn overlap(&self) -> c_float;
86
87        /// Setter for [`overlap`][Self::overlap].
88        #[unsafe(method(setOverlap:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setOverlap(&self, overlap: c_float);
91    );
92}
93
94/// Methods declared on superclass `AVAudioUnitTimeEffect`.
95#[cfg(all(
96    feature = "AVAudioNode",
97    feature = "AVAudioUnit",
98    feature = "AVAudioUnitTimeEffect"
99))]
100impl AVAudioUnitTimePitch {
101    extern_methods!(
102        #[cfg(feature = "objc2-audio-toolbox")]
103        #[cfg(not(target_os = "watchos"))]
104        /// create an AVAudioUnitTimeEffect object
105        ///
106        ///
107        /// Parameter `audioComponentDescription`: AudioComponentDescription of the audio unit to be initialized
108        ///
109        /// The componentType must be kAudioUnitType_FormatConverter
110        #[unsafe(method(initWithAudioComponentDescription:))]
111        #[unsafe(method_family = init)]
112        pub unsafe fn initWithAudioComponentDescription(
113            this: Allocated<Self>,
114            audio_component_description: AudioComponentDescription,
115        ) -> Retained<Self>;
116    );
117}
118
119/// Methods declared on superclass `NSObject`.
120#[cfg(all(
121    feature = "AVAudioNode",
122    feature = "AVAudioUnit",
123    feature = "AVAudioUnitTimeEffect"
124))]
125impl AVAudioUnitTimePitch {
126    extern_methods!(
127        #[unsafe(method(init))]
128        #[unsafe(method_family = init)]
129        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
130
131        #[unsafe(method(new))]
132        #[unsafe(method_family = new)]
133        pub unsafe fn new() -> Retained<Self>;
134    );
135}