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
41extern_conformance!(
42 unsafe impl NSObjectProtocol for AVAudioTime {}
43);
44
45impl AVAudioTime {
46 extern_methods!(
47 #[cfg(feature = "objc2-core-audio-types")]
48 #[unsafe(method(initWithAudioTimeStamp:sampleRate:))]
49 #[unsafe(method_family = init)]
50 pub unsafe fn initWithAudioTimeStamp_sampleRate(
51 this: Allocated<Self>,
52 ts: NonNull<AudioTimeStamp>,
53 sample_rate: c_double,
54 ) -> Retained<Self>;
55
56 #[unsafe(method(initWithHostTime:))]
57 #[unsafe(method_family = init)]
58 pub unsafe fn initWithHostTime(this: Allocated<Self>, host_time: u64) -> Retained<Self>;
59
60 #[cfg(feature = "AVAudioTypes")]
61 #[unsafe(method(initWithSampleTime:atRate:))]
62 #[unsafe(method_family = init)]
63 pub unsafe fn initWithSampleTime_atRate(
64 this: Allocated<Self>,
65 sample_time: AVAudioFramePosition,
66 sample_rate: c_double,
67 ) -> Retained<Self>;
68
69 #[cfg(feature = "AVAudioTypes")]
70 #[unsafe(method(initWithHostTime:sampleTime:atRate:))]
71 #[unsafe(method_family = init)]
72 pub unsafe fn initWithHostTime_sampleTime_atRate(
73 this: Allocated<Self>,
74 host_time: u64,
75 sample_time: AVAudioFramePosition,
76 sample_rate: c_double,
77 ) -> Retained<Self>;
78
79 #[cfg(feature = "objc2-core-audio-types")]
80 #[unsafe(method(timeWithAudioTimeStamp:sampleRate:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn timeWithAudioTimeStamp_sampleRate(
83 ts: NonNull<AudioTimeStamp>,
84 sample_rate: c_double,
85 ) -> Retained<Self>;
86
87 #[unsafe(method(timeWithHostTime:))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn timeWithHostTime(host_time: u64) -> Retained<Self>;
90
91 #[cfg(feature = "AVAudioTypes")]
92 #[unsafe(method(timeWithSampleTime:atRate:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn timeWithSampleTime_atRate(
95 sample_time: AVAudioFramePosition,
96 sample_rate: c_double,
97 ) -> Retained<Self>;
98
99 #[cfg(feature = "AVAudioTypes")]
100 #[unsafe(method(timeWithHostTime:sampleTime:atRate:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn timeWithHostTime_sampleTime_atRate(
103 host_time: u64,
104 sample_time: AVAudioFramePosition,
105 sample_rate: c_double,
106 ) -> Retained<Self>;
107
108 #[unsafe(method(hostTimeForSeconds:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn hostTimeForSeconds(seconds: NSTimeInterval) -> u64;
112
113 #[unsafe(method(secondsForHostTime:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn secondsForHostTime(host_time: u64) -> NSTimeInterval;
117
118 #[unsafe(method(extrapolateTimeFromAnchor:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn extrapolateTimeFromAnchor(
143 &self,
144 anchor_time: &AVAudioTime,
145 ) -> Option<Retained<AVAudioTime>>;
146
147 #[unsafe(method(isHostTimeValid))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn isHostTimeValid(&self) -> bool;
151
152 #[unsafe(method(hostTime))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn hostTime(&self) -> u64;
156
157 #[unsafe(method(isSampleTimeValid))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn isSampleTimeValid(&self) -> bool;
161
162 #[cfg(feature = "AVAudioTypes")]
163 #[unsafe(method(sampleTime))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn sampleTime(&self) -> AVAudioFramePosition;
167
168 #[unsafe(method(sampleRate))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn sampleRate(&self) -> c_double;
172
173 #[cfg(feature = "objc2-core-audio-types")]
174 #[unsafe(method(audioTimeStamp))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn audioTimeStamp(&self) -> AudioTimeStamp;
180 );
181}
182
183impl AVAudioTime {
185 extern_methods!(
186 #[unsafe(method(init))]
187 #[unsafe(method_family = init)]
188 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
189
190 #[unsafe(method(new))]
191 #[unsafe(method_family = new)]
192 pub unsafe fn new() -> Retained<Self>;
193 );
194}