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
65extern_conformance!(
66 unsafe impl NSObjectProtocol for MPNowPlayingInfoCenter {}
67);
68
69impl MPNowPlayingInfoCenter {
70 extern_methods!(
71 #[unsafe(method(defaultCenter))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn defaultCenter() -> Retained<MPNowPlayingInfoCenter>;
76
77 #[unsafe(method(new))]
78 #[unsafe(method_family = new)]
79 pub unsafe fn new() -> Retained<Self>;
80
81 #[unsafe(method(init))]
82 #[unsafe(method_family = init)]
83 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85 #[unsafe(method(nowPlayingInfo))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn nowPlayingInfo(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
90
91 #[unsafe(method(setNowPlayingInfo:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setNowPlayingInfo(
95 &self,
96 now_playing_info: Option<&NSDictionary<NSString, AnyObject>>,
97 );
98
99 #[unsafe(method(playbackState))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn playbackState(&self) -> MPNowPlayingPlaybackState;
107
108 #[unsafe(method(setPlaybackState:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn setPlaybackState(&self, playback_state: MPNowPlayingPlaybackState);
112 );
113}
114
115extern "C" {
116 pub static MPNowPlayingInfoPropertyElapsedPlaybackTime: &'static NSString;
118}
119
120extern "C" {
121 pub static MPNowPlayingInfoPropertyPlaybackRate: &'static NSString;
123}
124
125extern "C" {
126 pub static MPNowPlayingInfoPropertyDefaultPlaybackRate: &'static NSString;
128}
129
130extern "C" {
131 pub static MPNowPlayingInfoPropertyPlaybackQueueIndex: &'static NSString;
133}
134
135extern "C" {
136 pub static MPNowPlayingInfoPropertyPlaybackQueueCount: &'static NSString;
138}
139
140extern "C" {
141 pub static MPNowPlayingInfoPropertyChapterNumber: &'static NSString;
143}
144
145extern "C" {
146 pub static MPNowPlayingInfoPropertyChapterCount: &'static NSString;
148}
149
150extern "C" {
151 pub static MPNowPlayingInfoPropertyIsLiveStream: &'static NSString;
153}
154
155extern "C" {
156 pub static MPNowPlayingInfoPropertyAvailableLanguageOptions: &'static NSString;
158}
159
160extern "C" {
161 pub static MPNowPlayingInfoPropertyCurrentLanguageOptions: &'static NSString;
163}
164
165extern "C" {
166 pub static MPNowPlayingInfoCollectionIdentifier: &'static NSString;
168}
169
170extern "C" {
171 pub static MPNowPlayingInfoPropertyExternalContentIdentifier: &'static NSString;
173}
174
175extern "C" {
176 pub static MPNowPlayingInfoPropertyExternalUserProfileIdentifier: &'static NSString;
178}
179
180extern "C" {
181 pub static MPNowPlayingInfoPropertyServiceIdentifier: &'static NSString;
183}
184
185extern "C" {
186 pub static MPNowPlayingInfoPropertyPlaybackProgress: &'static NSString;
188}
189
190extern "C" {
191 pub static MPNowPlayingInfoPropertyMediaType: &'static NSString;
193}
194
195extern "C" {
196 pub static MPNowPlayingInfoPropertyAssetURL: &'static NSString;
198}
199
200extern "C" {
201 pub static MPNowPlayingInfoPropertyCurrentPlaybackDate: &'static NSString;
203}
204
205extern "C" {
206 pub static MPNowPlayingInfoPropertyAdTimeRanges: &'static NSString;
208}
209
210extern "C" {
211 pub static MPNowPlayingInfoPropertyCreditsStartTime: &'static NSString;
213}
214
215extern "C" {
216 pub static MPNowPlayingInfoPropertyInternationalStandardRecordingCode: &'static NSString;
218}
219
220extern "C" {
221 pub static MPNowPlayingInfoPropertyExcludeFromSuggestions: &'static NSString;
223}