objc2_avf_audio/generated/
AVAudioTime.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-audio-types")]
7use objc2_core_audio_types::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
33 #[derive(Debug, PartialEq, Eq, Hash)]
34 pub struct AVAudioTime;
35);
36
37unsafe impl Send for AVAudioTime {}
38
39unsafe impl Sync for AVAudioTime {}
40
41unsafe impl NSObjectProtocol for AVAudioTime {}
42
43impl AVAudioTime {
44 extern_methods!(
45 #[cfg(feature = "objc2-core-audio-types")]
46 #[unsafe(method(initWithAudioTimeStamp:sampleRate:))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn initWithAudioTimeStamp_sampleRate(
49 this: Allocated<Self>,
50 ts: NonNull<AudioTimeStamp>,
51 sample_rate: c_double,
52 ) -> Retained<Self>;
53
54 #[unsafe(method(initWithHostTime:))]
55 #[unsafe(method_family = init)]
56 pub unsafe fn initWithHostTime(this: Allocated<Self>, host_time: u64) -> Retained<Self>;
57
58 #[cfg(feature = "AVAudioTypes")]
59 #[unsafe(method(initWithSampleTime:atRate:))]
60 #[unsafe(method_family = init)]
61 pub unsafe fn initWithSampleTime_atRate(
62 this: Allocated<Self>,
63 sample_time: AVAudioFramePosition,
64 sample_rate: c_double,
65 ) -> Retained<Self>;
66
67 #[cfg(feature = "AVAudioTypes")]
68 #[unsafe(method(initWithHostTime:sampleTime:atRate:))]
69 #[unsafe(method_family = init)]
70 pub unsafe fn initWithHostTime_sampleTime_atRate(
71 this: Allocated<Self>,
72 host_time: u64,
73 sample_time: AVAudioFramePosition,
74 sample_rate: c_double,
75 ) -> Retained<Self>;
76
77 #[cfg(feature = "objc2-core-audio-types")]
78 #[unsafe(method(timeWithAudioTimeStamp:sampleRate:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn timeWithAudioTimeStamp_sampleRate(
81 ts: NonNull<AudioTimeStamp>,
82 sample_rate: c_double,
83 ) -> Retained<Self>;
84
85 #[unsafe(method(timeWithHostTime:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn timeWithHostTime(host_time: u64) -> Retained<Self>;
88
89 #[cfg(feature = "AVAudioTypes")]
90 #[unsafe(method(timeWithSampleTime:atRate:))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn timeWithSampleTime_atRate(
93 sample_time: AVAudioFramePosition,
94 sample_rate: c_double,
95 ) -> Retained<Self>;
96
97 #[cfg(feature = "AVAudioTypes")]
98 #[unsafe(method(timeWithHostTime:sampleTime:atRate:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn timeWithHostTime_sampleTime_atRate(
101 host_time: u64,
102 sample_time: AVAudioFramePosition,
103 sample_rate: c_double,
104 ) -> Retained<Self>;
105
106 #[unsafe(method(hostTimeForSeconds:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn hostTimeForSeconds(seconds: NSTimeInterval) -> u64;
110
111 #[unsafe(method(secondsForHostTime:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn secondsForHostTime(host_time: u64) -> NSTimeInterval;
115
116 #[unsafe(method(extrapolateTimeFromAnchor:))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn extrapolateTimeFromAnchor(
141 &self,
142 anchor_time: &AVAudioTime,
143 ) -> Option<Retained<AVAudioTime>>;
144
145 #[unsafe(method(isHostTimeValid))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn isHostTimeValid(&self) -> bool;
149
150 #[unsafe(method(hostTime))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn hostTime(&self) -> u64;
154
155 #[unsafe(method(isSampleTimeValid))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn isSampleTimeValid(&self) -> bool;
159
160 #[cfg(feature = "AVAudioTypes")]
161 #[unsafe(method(sampleTime))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn sampleTime(&self) -> AVAudioFramePosition;
165
166 #[unsafe(method(sampleRate))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn sampleRate(&self) -> c_double;
170
171 #[cfg(feature = "objc2-core-audio-types")]
172 #[unsafe(method(audioTimeStamp))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn audioTimeStamp(&self) -> AudioTimeStamp;
178 );
179}
180
181impl AVAudioTime {
183 extern_methods!(
184 #[unsafe(method(init))]
185 #[unsafe(method_family = init)]
186 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
187
188 #[unsafe(method(new))]
189 #[unsafe(method_family = new)]
190 pub unsafe fn new() -> Retained<Self>;
191 );
192}