objc2_media_player/generated/
MPRemoteCommandEvent.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct MPRemoteCommandEvent;
15);
16
17extern_conformance!(
18 unsafe impl NSObjectProtocol for MPRemoteCommandEvent {}
19);
20
21impl MPRemoteCommandEvent {
22 extern_methods!(
23 #[cfg(feature = "MPRemoteCommand")]
24 #[unsafe(method(command))]
26 #[unsafe(method_family = none)]
27 pub unsafe fn command(&self) -> Retained<MPRemoteCommand>;
28
29 #[unsafe(method(timestamp))]
31 #[unsafe(method_family = none)]
32 pub unsafe fn timestamp(&self) -> NSTimeInterval;
33 );
34}
35
36impl MPRemoteCommandEvent {
38 extern_methods!(
39 #[unsafe(method(init))]
40 #[unsafe(method_family = init)]
41 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
42
43 #[unsafe(method(new))]
44 #[unsafe(method_family = new)]
45 pub unsafe fn new() -> Retained<Self>;
46 );
47}
48
49extern_class!(
50 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
52 #[derive(Debug, PartialEq, Eq, Hash)]
53 pub struct MPSkipIntervalCommandEvent;
54);
55
56extern_conformance!(
57 unsafe impl NSObjectProtocol for MPSkipIntervalCommandEvent {}
58);
59
60impl MPSkipIntervalCommandEvent {
61 extern_methods!(
62 #[unsafe(method(interval))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn interval(&self) -> NSTimeInterval;
66 );
67}
68
69impl MPSkipIntervalCommandEvent {
71 extern_methods!(
72 #[unsafe(method(init))]
73 #[unsafe(method_family = init)]
74 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76 #[unsafe(method(new))]
77 #[unsafe(method_family = new)]
78 pub unsafe fn new() -> Retained<Self>;
79 );
80}
81
82#[repr(transparent)]
85#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
86pub struct MPSeekCommandEventType(pub NSUInteger);
87impl MPSeekCommandEventType {
88 #[doc(alias = "MPSeekCommandEventTypeBeginSeeking")]
89 pub const BeginSeeking: Self = Self(0);
90 #[doc(alias = "MPSeekCommandEventTypeEndSeeking")]
91 pub const EndSeeking: Self = Self(1);
92}
93
94unsafe impl Encode for MPSeekCommandEventType {
95 const ENCODING: Encoding = NSUInteger::ENCODING;
96}
97
98unsafe impl RefEncode for MPSeekCommandEventType {
99 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
100}
101
102extern_class!(
103 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
105 #[derive(Debug, PartialEq, Eq, Hash)]
106 pub struct MPSeekCommandEvent;
107);
108
109extern_conformance!(
110 unsafe impl NSObjectProtocol for MPSeekCommandEvent {}
111);
112
113impl MPSeekCommandEvent {
114 extern_methods!(
115 #[unsafe(method(type))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn r#type(&self) -> MPSeekCommandEventType;
120 );
121}
122
123impl MPSeekCommandEvent {
125 extern_methods!(
126 #[unsafe(method(init))]
127 #[unsafe(method_family = init)]
128 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130 #[unsafe(method(new))]
131 #[unsafe(method_family = new)]
132 pub unsafe fn new() -> Retained<Self>;
133 );
134}
135
136extern_class!(
137 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
139 #[derive(Debug, PartialEq, Eq, Hash)]
140 pub struct MPRatingCommandEvent;
141);
142
143extern_conformance!(
144 unsafe impl NSObjectProtocol for MPRatingCommandEvent {}
145);
146
147impl MPRatingCommandEvent {
148 extern_methods!(
149 #[unsafe(method(rating))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn rating(&self) -> c_float;
154 );
155}
156
157impl MPRatingCommandEvent {
159 extern_methods!(
160 #[unsafe(method(init))]
161 #[unsafe(method_family = init)]
162 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
163
164 #[unsafe(method(new))]
165 #[unsafe(method_family = new)]
166 pub unsafe fn new() -> Retained<Self>;
167 );
168}
169
170extern_class!(
171 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
173 #[derive(Debug, PartialEq, Eq, Hash)]
174 pub struct MPChangePlaybackRateCommandEvent;
175);
176
177extern_conformance!(
178 unsafe impl NSObjectProtocol for MPChangePlaybackRateCommandEvent {}
179);
180
181impl MPChangePlaybackRateCommandEvent {
182 extern_methods!(
183 #[unsafe(method(playbackRate))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn playbackRate(&self) -> c_float;
189 );
190}
191
192impl MPChangePlaybackRateCommandEvent {
194 extern_methods!(
195 #[unsafe(method(init))]
196 #[unsafe(method_family = init)]
197 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
198
199 #[unsafe(method(new))]
200 #[unsafe(method_family = new)]
201 pub unsafe fn new() -> Retained<Self>;
202 );
203}
204
205extern_class!(
206 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
208 #[derive(Debug, PartialEq, Eq, Hash)]
209 pub struct MPFeedbackCommandEvent;
210);
211
212extern_conformance!(
213 unsafe impl NSObjectProtocol for MPFeedbackCommandEvent {}
214);
215
216impl MPFeedbackCommandEvent {
217 extern_methods!(
218 #[unsafe(method(isNegative))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn isNegative(&self) -> bool;
229 );
230}
231
232impl MPFeedbackCommandEvent {
234 extern_methods!(
235 #[unsafe(method(init))]
236 #[unsafe(method_family = init)]
237 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
238
239 #[unsafe(method(new))]
240 #[unsafe(method_family = new)]
241 pub unsafe fn new() -> Retained<Self>;
242 );
243}
244
245extern_class!(
246 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
248 #[derive(Debug, PartialEq, Eq, Hash)]
249 pub struct MPChangeLanguageOptionCommandEvent;
250);
251
252extern_conformance!(
253 unsafe impl NSObjectProtocol for MPChangeLanguageOptionCommandEvent {}
254);
255
256impl MPChangeLanguageOptionCommandEvent {
257 extern_methods!(
258 #[cfg(feature = "MPNowPlayingInfoLanguageOption")]
259 #[unsafe(method(languageOption))]
264 #[unsafe(method_family = none)]
265 pub unsafe fn languageOption(&self) -> Retained<MPNowPlayingInfoLanguageOption>;
266
267 #[cfg(feature = "MPRemoteControlTypes")]
268 #[unsafe(method(setting))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn setting(&self) -> MPChangeLanguageOptionSetting;
272 );
273}
274
275impl MPChangeLanguageOptionCommandEvent {
277 extern_methods!(
278 #[unsafe(method(init))]
279 #[unsafe(method_family = init)]
280 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
281
282 #[unsafe(method(new))]
283 #[unsafe(method_family = new)]
284 pub unsafe fn new() -> Retained<Self>;
285 );
286}
287
288extern_class!(
289 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
291 #[derive(Debug, PartialEq, Eq, Hash)]
292 pub struct MPChangePlaybackPositionCommandEvent;
293);
294
295extern_conformance!(
296 unsafe impl NSObjectProtocol for MPChangePlaybackPositionCommandEvent {}
297);
298
299impl MPChangePlaybackPositionCommandEvent {
300 extern_methods!(
301 #[unsafe(method(positionTime))]
303 #[unsafe(method_family = none)]
304 pub unsafe fn positionTime(&self) -> NSTimeInterval;
305 );
306}
307
308impl MPChangePlaybackPositionCommandEvent {
310 extern_methods!(
311 #[unsafe(method(init))]
312 #[unsafe(method_family = init)]
313 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
314
315 #[unsafe(method(new))]
316 #[unsafe(method_family = new)]
317 pub unsafe fn new() -> Retained<Self>;
318 );
319}
320
321extern_class!(
322 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
324 #[derive(Debug, PartialEq, Eq, Hash)]
325 pub struct MPChangeShuffleModeCommandEvent;
326);
327
328extern_conformance!(
329 unsafe impl NSObjectProtocol for MPChangeShuffleModeCommandEvent {}
330);
331
332impl MPChangeShuffleModeCommandEvent {
333 extern_methods!(
334 #[cfg(feature = "MPRemoteControlTypes")]
335 #[unsafe(method(shuffleType))]
337 #[unsafe(method_family = none)]
338 pub unsafe fn shuffleType(&self) -> MPShuffleType;
339
340 #[unsafe(method(preservesShuffleMode))]
342 #[unsafe(method_family = none)]
343 pub unsafe fn preservesShuffleMode(&self) -> bool;
344 );
345}
346
347impl MPChangeShuffleModeCommandEvent {
349 extern_methods!(
350 #[unsafe(method(init))]
351 #[unsafe(method_family = init)]
352 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
353
354 #[unsafe(method(new))]
355 #[unsafe(method_family = new)]
356 pub unsafe fn new() -> Retained<Self>;
357 );
358}
359
360extern_class!(
361 #[unsafe(super(MPRemoteCommandEvent, NSObject))]
363 #[derive(Debug, PartialEq, Eq, Hash)]
364 pub struct MPChangeRepeatModeCommandEvent;
365);
366
367extern_conformance!(
368 unsafe impl NSObjectProtocol for MPChangeRepeatModeCommandEvent {}
369);
370
371impl MPChangeRepeatModeCommandEvent {
372 extern_methods!(
373 #[cfg(feature = "MPRemoteControlTypes")]
374 #[unsafe(method(repeatType))]
376 #[unsafe(method_family = none)]
377 pub unsafe fn repeatType(&self) -> MPRepeatType;
378
379 #[unsafe(method(preservesRepeatMode))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn preservesRepeatMode(&self) -> bool;
383 );
384}
385
386impl MPChangeRepeatModeCommandEvent {
388 extern_methods!(
389 #[unsafe(method(init))]
390 #[unsafe(method_family = init)]
391 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
392
393 #[unsafe(method(new))]
394 #[unsafe(method_family = new)]
395 pub unsafe fn new() -> Retained<Self>;
396 );
397}