objc2_watch_kit/generated/
WKAudioFilePlayer.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
10/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayerstatus?language=objc)
11// NS_ENUM
12#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
13#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct WKAudioFilePlayerStatus(pub NSInteger);
16impl WKAudioFilePlayerStatus {
17    #[doc(alias = "WKAudioFilePlayerStatusUnknown")]
18    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
19    pub const Unknown: Self = Self(0);
20    #[doc(alias = "WKAudioFilePlayerStatusReadyToPlay")]
21    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
22    pub const ReadyToPlay: Self = Self(1);
23    #[doc(alias = "WKAudioFilePlayerStatusFailed")]
24    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
25    pub const Failed: Self = Self(2);
26}
27
28unsafe impl Encode for WKAudioFilePlayerStatus {
29    const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for WKAudioFilePlayerStatus {
33    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayer?language=objc)
38    #[unsafe(super(NSObject))]
39    #[derive(Debug, PartialEq, Eq, Hash)]
40    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
41    pub struct WKAudioFilePlayer;
42);
43
44extern_conformance!(
45    unsafe impl NSObjectProtocol for WKAudioFilePlayer {}
46);
47
48impl WKAudioFilePlayer {
49    extern_methods!(
50        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        #[cfg(feature = "WKAudioFilePlayerItem")]
56        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
57        #[unsafe(method(playerWithPlayerItem:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn playerWithPlayerItem(item: &WKAudioFilePlayerItem) -> Retained<Self>;
60
61        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
62        #[unsafe(method(play))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn play(&self);
65
66        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
67        #[unsafe(method(pause))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn pause(&self);
70
71        #[cfg(feature = "WKAudioFilePlayerItem")]
72        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
73        #[unsafe(method(replaceCurrentItemWithPlayerItem:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn replaceCurrentItemWithPlayerItem(&self, item: Option<&WKAudioFilePlayerItem>);
76
77        #[cfg(feature = "WKAudioFilePlayerItem")]
78        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
79        #[unsafe(method(currentItem))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn currentItem(&self) -> Option<Retained<WKAudioFilePlayerItem>>;
82
83        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
84        #[unsafe(method(status))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn status(&self) -> WKAudioFilePlayerStatus;
87
88        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
89        #[unsafe(method(error))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn error(&self) -> Option<Retained<NSError>>;
92
93        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
94        #[unsafe(method(rate))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn rate(&self) -> c_float;
97
98        /// Setter for [`rate`][Self::rate].
99        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
100        #[unsafe(method(setRate:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setRate(&self, rate: c_float);
103
104        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
105        #[unsafe(method(currentTime))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn currentTime(&self) -> NSTimeInterval;
108    );
109}
110
111/// Methods declared on superclass `NSObject`.
112impl WKAudioFilePlayer {
113    extern_methods!(
114        #[unsafe(method(new))]
115        #[unsafe(method_family = new)]
116        pub unsafe fn new() -> Retained<Self>;
117    );
118}
119
120extern_class!(
121    /// WatchKit corollary to AVFoundation AVQueuePlayer class
122    ///
123    ///
124    /// This class provides the functionality of AVQueuePlayer for Watch OS apps. Only file-based assets are allowed.
125    ///
126    /// See also [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofilequeueplayer?language=objc)
127    #[unsafe(super(WKAudioFilePlayer, NSObject))]
128    #[derive(Debug, PartialEq, Eq, Hash)]
129    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
130    pub struct WKAudioFileQueuePlayer;
131);
132
133extern_conformance!(
134    unsafe impl NSObjectProtocol for WKAudioFileQueuePlayer {}
135);
136
137impl WKAudioFileQueuePlayer {
138    extern_methods!(
139        #[cfg(feature = "WKAudioFilePlayerItem")]
140        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
141        #[unsafe(method(queuePlayerWithItems:))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn queuePlayerWithItems(
144            items: &NSArray<WKAudioFilePlayerItem>,
145        ) -> Retained<Self>;
146
147        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
148        #[unsafe(method(advanceToNextItem))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn advanceToNextItem(&self);
151
152        #[cfg(feature = "WKAudioFilePlayerItem")]
153        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
154        #[unsafe(method(appendItem:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn appendItem(&self, item: &WKAudioFilePlayerItem);
157
158        #[cfg(feature = "WKAudioFilePlayerItem")]
159        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
160        #[unsafe(method(removeItem:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn removeItem(&self, item: &WKAudioFilePlayerItem);
163
164        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
165        #[unsafe(method(removeAllItems))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn removeAllItems(&self);
168
169        #[cfg(feature = "WKAudioFilePlayerItem")]
170        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
171        #[unsafe(method(items))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn items(&self) -> Retained<NSArray<WKAudioFilePlayerItem>>;
174    );
175}
176
177/// Methods declared on superclass `WKAudioFilePlayer`.
178impl WKAudioFileQueuePlayer {
179    extern_methods!(
180        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
181        #[unsafe(method(init))]
182        #[unsafe(method_family = init)]
183        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
184
185        #[cfg(feature = "WKAudioFilePlayerItem")]
186        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
187        #[unsafe(method(playerWithPlayerItem:))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn playerWithPlayerItem(item: &WKAudioFilePlayerItem) -> Retained<Self>;
190    );
191}
192
193/// Methods declared on superclass `NSObject`.
194impl WKAudioFileQueuePlayer {
195    extern_methods!(
196        #[unsafe(method(new))]
197        #[unsafe(method_family = new)]
198        pub unsafe fn new() -> Retained<Self>;
199    );
200}