objc2_media_player/generated/
MPNowPlayingInfoCenter.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct MPNowPlayingInfoMediaType(pub NSUInteger);
15impl MPNowPlayingInfoMediaType {
16 #[doc(alias = "MPNowPlayingInfoMediaTypeNone")]
17 pub const None: Self = Self(0);
18 #[doc(alias = "MPNowPlayingInfoMediaTypeAudio")]
19 pub const Audio: Self = Self(1);
20 #[doc(alias = "MPNowPlayingInfoMediaTypeVideo")]
21 pub const Video: Self = Self(2);
22}
23
24unsafe impl Encode for MPNowPlayingInfoMediaType {
25 const ENCODING: Encoding = NSUInteger::ENCODING;
26}
27
28unsafe impl RefEncode for MPNowPlayingInfoMediaType {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32#[repr(transparent)]
35#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
36pub struct MPNowPlayingPlaybackState(pub NSUInteger);
37impl MPNowPlayingPlaybackState {
38 #[doc(alias = "MPNowPlayingPlaybackStateUnknown")]
39 pub const Unknown: Self = Self(0);
40 #[doc(alias = "MPNowPlayingPlaybackStatePlaying")]
41 pub const Playing: Self = Self(1);
42 #[doc(alias = "MPNowPlayingPlaybackStatePaused")]
43 pub const Paused: Self = Self(2);
44 #[doc(alias = "MPNowPlayingPlaybackStateStopped")]
45 pub const Stopped: Self = Self(3);
46 #[doc(alias = "MPNowPlayingPlaybackStateInterrupted")]
47 pub const Interrupted: Self = Self(4);
48}
49
50unsafe impl Encode for MPNowPlayingPlaybackState {
51 const ENCODING: Encoding = NSUInteger::ENCODING;
52}
53
54unsafe impl RefEncode for MPNowPlayingPlaybackState {
55 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
56}
57
58extern_class!(
59 #[unsafe(super(NSObject))]
61 #[derive(Debug, PartialEq, Eq, Hash)]
62 pub struct MPNowPlayingInfoCenter;
63);
64
65unsafe impl NSObjectProtocol for MPNowPlayingInfoCenter {}
66
67impl MPNowPlayingInfoCenter {
68 extern_methods!(
69 #[unsafe(method(defaultCenter))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn defaultCenter() -> Retained<MPNowPlayingInfoCenter>;
74
75 #[unsafe(method(new))]
76 #[unsafe(method_family = new)]
77 pub unsafe fn new() -> Retained<Self>;
78
79 #[unsafe(method(init))]
80 #[unsafe(method_family = init)]
81 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83 #[unsafe(method(nowPlayingInfo))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn nowPlayingInfo(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
88
89 #[unsafe(method(setNowPlayingInfo:))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn setNowPlayingInfo(
93 &self,
94 now_playing_info: Option<&NSDictionary<NSString, AnyObject>>,
95 );
96
97 #[unsafe(method(playbackState))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn playbackState(&self) -> MPNowPlayingPlaybackState;
105
106 #[unsafe(method(setPlaybackState:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setPlaybackState(&self, playback_state: MPNowPlayingPlaybackState);
110 );
111}
112
113extern "C" {
114 pub static MPNowPlayingInfoPropertyElapsedPlaybackTime: &'static NSString;
116}
117
118extern "C" {
119 pub static MPNowPlayingInfoPropertyPlaybackRate: &'static NSString;
121}
122
123extern "C" {
124 pub static MPNowPlayingInfoPropertyDefaultPlaybackRate: &'static NSString;
126}
127
128extern "C" {
129 pub static MPNowPlayingInfoPropertyPlaybackQueueIndex: &'static NSString;
131}
132
133extern "C" {
134 pub static MPNowPlayingInfoPropertyPlaybackQueueCount: &'static NSString;
136}
137
138extern "C" {
139 pub static MPNowPlayingInfoPropertyChapterNumber: &'static NSString;
141}
142
143extern "C" {
144 pub static MPNowPlayingInfoPropertyChapterCount: &'static NSString;
146}
147
148extern "C" {
149 pub static MPNowPlayingInfoPropertyIsLiveStream: &'static NSString;
151}
152
153extern "C" {
154 pub static MPNowPlayingInfoPropertyAvailableLanguageOptions: &'static NSString;
156}
157
158extern "C" {
159 pub static MPNowPlayingInfoPropertyCurrentLanguageOptions: &'static NSString;
161}
162
163extern "C" {
164 pub static MPNowPlayingInfoCollectionIdentifier: &'static NSString;
166}
167
168extern "C" {
169 pub static MPNowPlayingInfoPropertyExternalContentIdentifier: &'static NSString;
171}
172
173extern "C" {
174 pub static MPNowPlayingInfoPropertyExternalUserProfileIdentifier: &'static NSString;
176}
177
178extern "C" {
179 pub static MPNowPlayingInfoPropertyServiceIdentifier: &'static NSString;
181}
182
183extern "C" {
184 pub static MPNowPlayingInfoPropertyPlaybackProgress: &'static NSString;
186}
187
188extern "C" {
189 pub static MPNowPlayingInfoPropertyMediaType: &'static NSString;
191}
192
193extern "C" {
194 pub static MPNowPlayingInfoPropertyAssetURL: &'static NSString;
196}
197
198extern "C" {
199 pub static MPNowPlayingInfoPropertyCurrentPlaybackDate: &'static NSString;
201}
202
203extern "C" {
204 pub static MPNowPlayingInfoPropertyAdTimeRanges: &'static NSString;
206}
207
208extern "C" {
209 pub static MPNowPlayingInfoPropertyCreditsStartTime: &'static NSString;
211}
212
213extern "C" {
214 pub static MPNowPlayingInfoPropertyInternationalStandardRecordingCode: &'static NSString;
216}
217
218extern "C" {
219 pub static MPNowPlayingInfoPropertyExcludeFromSuggestions: &'static NSString;
221}