objc2_watch_kit/generated/
WKAudioFilePlayerItem.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritemtimejumpednotification?language=objc)
12    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
13    pub static WKAudioFilePlayerItemTimeJumpedNotification: &'static NSString;
14}
15
16extern "C" {
17    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritemdidplaytoendtimenotification?language=objc)
18    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
19    pub static WKAudioFilePlayerItemDidPlayToEndTimeNotification: &'static NSString;
20}
21
22extern "C" {
23    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritemfailedtoplaytoendtimenotification?language=objc)
24    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
25    pub static WKAudioFilePlayerItemFailedToPlayToEndTimeNotification: &'static NSString;
26}
27
28/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritemstatus?language=objc)
29// NS_ENUM
30#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
31#[repr(transparent)]
32#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
33pub struct WKAudioFilePlayerItemStatus(pub NSInteger);
34impl WKAudioFilePlayerItemStatus {
35    #[doc(alias = "WKAudioFilePlayerItemStatusUnknown")]
36    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
37    pub const Unknown: Self = Self(0);
38    #[doc(alias = "WKAudioFilePlayerItemStatusReadyToPlay")]
39    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
40    pub const ReadyToPlay: Self = Self(1);
41    #[doc(alias = "WKAudioFilePlayerItemStatusFailed")]
42    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
43    pub const Failed: Self = Self(2);
44}
45
46unsafe impl Encode for WKAudioFilePlayerItemStatus {
47    const ENCODING: Encoding = NSInteger::ENCODING;
48}
49
50unsafe impl RefEncode for WKAudioFilePlayerItemStatus {
51    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
52}
53
54extern_class!(
55    /// WatchKit corollary to AVFoundation AVPlayer class
56    ///
57    ///
58    /// This class provides the functionality of AVPlayer for Watch OS apps. Only file-based assets are allowed.
59    ///
60    /// See also [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritem?language=objc)
61    #[unsafe(super(NSObject))]
62    #[derive(Debug, PartialEq, Eq, Hash)]
63    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
64    pub struct WKAudioFilePlayerItem;
65);
66
67extern_conformance!(
68    unsafe impl NSObjectProtocol for WKAudioFilePlayerItem {}
69);
70
71impl WKAudioFilePlayerItem {
72    extern_methods!(
73        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[cfg(feature = "WKAudioFileAsset")]
79        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
80        #[unsafe(method(playerItemWithAsset:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn playerItemWithAsset(
83            asset: &WKAudioFileAsset,
84        ) -> Retained<WKAudioFilePlayerItem>;
85
86        #[cfg(feature = "WKAudioFileAsset")]
87        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
88        #[unsafe(method(asset))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn asset(&self) -> Retained<WKAudioFileAsset>;
91
92        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
93        #[unsafe(method(status))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn status(&self) -> WKAudioFilePlayerItemStatus;
96
97        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
98        #[unsafe(method(error))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn error(&self) -> Option<Retained<NSError>>;
101
102        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
103        #[unsafe(method(currentTime))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn currentTime(&self) -> NSTimeInterval;
106
107        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
108        #[unsafe(method(setCurrentTime:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setCurrentTime(&self, current_time: NSTimeInterval);
111    );
112}
113
114/// Methods declared on superclass `NSObject`.
115impl WKAudioFilePlayerItem {
116    extern_methods!(
117        #[unsafe(method(new))]
118        #[unsafe(method_family = new)]
119        pub unsafe fn new() -> Retained<Self>;
120    );
121}