objc2_watch_kit/generated/
WKAudioFilePlayerItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11 pub static WKAudioFilePlayerItemTimeJumpedNotification: &'static NSString;
13}
14
15extern "C" {
16 pub static WKAudioFilePlayerItemDidPlayToEndTimeNotification: &'static NSString;
18}
19
20extern "C" {
21 pub static WKAudioFilePlayerItemFailedToPlayToEndTimeNotification: &'static NSString;
23}
24
25#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
28#[repr(transparent)]
29#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
30pub struct WKAudioFilePlayerItemStatus(pub NSInteger);
31impl WKAudioFilePlayerItemStatus {
32 #[doc(alias = "WKAudioFilePlayerItemStatusUnknown")]
33 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
34 pub const Unknown: Self = Self(0);
35 #[doc(alias = "WKAudioFilePlayerItemStatusReadyToPlay")]
36 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
37 pub const ReadyToPlay: Self = Self(1);
38 #[doc(alias = "WKAudioFilePlayerItemStatusFailed")]
39 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
40 pub const Failed: Self = Self(2);
41}
42
43unsafe impl Encode for WKAudioFilePlayerItemStatus {
44 const ENCODING: Encoding = NSInteger::ENCODING;
45}
46
47unsafe impl RefEncode for WKAudioFilePlayerItemStatus {
48 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
49}
50
51extern_class!(
52 #[unsafe(super(NSObject))]
59 #[derive(Debug, PartialEq, Eq, Hash)]
60 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
61 pub struct WKAudioFilePlayerItem;
62);
63
64extern_conformance!(
65 unsafe impl NSObjectProtocol for WKAudioFilePlayerItem {}
66);
67
68impl WKAudioFilePlayerItem {
69 extern_methods!(
70 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
71 #[unsafe(method(init))]
72 #[unsafe(method_family = init)]
73 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
74
75 #[cfg(feature = "WKAudioFileAsset")]
76 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
77 #[unsafe(method(playerItemWithAsset:))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn playerItemWithAsset(
80 asset: &WKAudioFileAsset,
81 ) -> Retained<WKAudioFilePlayerItem>;
82
83 #[cfg(feature = "WKAudioFileAsset")]
84 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
85 #[unsafe(method(asset))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn asset(&self) -> Retained<WKAudioFileAsset>;
88
89 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
90 #[unsafe(method(status))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn status(&self) -> WKAudioFilePlayerItemStatus;
93
94 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
95 #[unsafe(method(error))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn error(&self) -> Option<Retained<NSError>>;
98
99 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
100 #[unsafe(method(currentTime))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn currentTime(&self) -> NSTimeInterval;
103
104 #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
105 #[unsafe(method(setCurrentTime:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setCurrentTime(&self, current_time: NSTimeInterval);
108 );
109}
110
111impl WKAudioFilePlayerItem {
113 extern_methods!(
114 #[unsafe(method(new))]
115 #[unsafe(method_family = new)]
116 pub unsafe fn new() -> Retained<Self>;
117 );
118}