icrate/generated/MediaPlayer/
MPMediaItem.rs1use crate::common::*;
4use crate::AppKit::*;
5use crate::Foundation::*;
6use crate::MediaPlayer::*;
7
8ns_options!(
9 #[underlying(NSUInteger)]
10 pub enum MPMediaType {
11 MPMediaTypeMusic = 1 << 0,
12 MPMediaTypePodcast = 1 << 1,
13 MPMediaTypeAudioBook = 1 << 2,
14 MPMediaTypeAudioITunesU = 1 << 3,
15 MPMediaTypeAnyAudio = 0x00ff,
16 MPMediaTypeMovie = 1 << 8,
17 MPMediaTypeTVShow = 1 << 9,
18 MPMediaTypeVideoPodcast = 1 << 10,
19 MPMediaTypeMusicVideo = 1 << 11,
20 MPMediaTypeVideoITunesU = 1 << 12,
21 MPMediaTypeHomeVideo = 1 << 13,
22 MPMediaTypeAnyVideo = 0xff00,
23 MPMediaTypeAny = !0,
24 }
25);
26
27extern_static!(MPMediaItemPropertyPersistentID: &'static NSString);
28
29extern_static!(MPMediaItemPropertyMediaType: &'static NSString);
30
31extern_static!(MPMediaItemPropertyTitle: &'static NSString);
32
33extern_static!(MPMediaItemPropertyAlbumTitle: &'static NSString);
34
35extern_static!(MPMediaItemPropertyAlbumPersistentID: &'static NSString);
36
37extern_static!(MPMediaItemPropertyArtist: &'static NSString);
38
39extern_static!(MPMediaItemPropertyArtistPersistentID: &'static NSString);
40
41extern_static!(MPMediaItemPropertyAlbumArtist: &'static NSString);
42
43extern_static!(MPMediaItemPropertyAlbumArtistPersistentID: &'static NSString);
44
45extern_static!(MPMediaItemPropertyGenre: &'static NSString);
46
47extern_static!(MPMediaItemPropertyGenrePersistentID: &'static NSString);
48
49extern_static!(MPMediaItemPropertyComposer: &'static NSString);
50
51extern_static!(MPMediaItemPropertyComposerPersistentID: &'static NSString);
52
53extern_static!(MPMediaItemPropertyPlaybackDuration: &'static NSString);
54
55extern_static!(MPMediaItemPropertyAlbumTrackNumber: &'static NSString);
56
57extern_static!(MPMediaItemPropertyAlbumTrackCount: &'static NSString);
58
59extern_static!(MPMediaItemPropertyDiscNumber: &'static NSString);
60
61extern_static!(MPMediaItemPropertyDiscCount: &'static NSString);
62
63extern_static!(MPMediaItemPropertyArtwork: &'static NSString);
64
65extern_static!(MPMediaItemPropertyIsExplicit: &'static NSString);
66
67extern_static!(MPMediaItemPropertyLyrics: &'static NSString);
68
69extern_static!(MPMediaItemPropertyIsCompilation: &'static NSString);
70
71extern_static!(MPMediaItemPropertyReleaseDate: &'static NSString);
72
73extern_static!(MPMediaItemPropertyBeatsPerMinute: &'static NSString);
74
75extern_static!(MPMediaItemPropertyComments: &'static NSString);
76
77extern_static!(MPMediaItemPropertyAssetURL: &'static NSString);
78
79extern_static!(MPMediaItemPropertyIsCloudItem: &'static NSString);
80
81extern_static!(MPMediaItemPropertyHasProtectedAsset: &'static NSString);
82
83extern_static!(MPMediaItemPropertyPodcastTitle: &'static NSString);
84
85extern_static!(MPMediaItemPropertyPodcastPersistentID: &'static NSString);
86
87extern_static!(MPMediaItemPropertyPlayCount: &'static NSString);
88
89extern_static!(MPMediaItemPropertySkipCount: &'static NSString);
90
91extern_static!(MPMediaItemPropertyRating: &'static NSString);
92
93extern_static!(MPMediaItemPropertyLastPlayedDate: &'static NSString);
94
95extern_static!(MPMediaItemPropertyUserGrouping: &'static NSString);
96
97extern_static!(MPMediaItemPropertyBookmarkTime: &'static NSString);
98
99extern_static!(MPMediaItemPropertyDateAdded: &'static NSString);
100
101extern_static!(MPMediaItemPropertyPlaybackStoreID: &'static NSString);
102
103extern_static!(MPMediaItemPropertyIsPreorder: &'static NSString);
104
105extern_class!(
106 #[derive(Debug, PartialEq, Eq, Hash)]
107 #[cfg(feature = "MediaPlayer_MPMediaItem")]
108 pub struct MPMediaItem;
109
110 #[cfg(feature = "MediaPlayer_MPMediaItem")]
111 unsafe impl ClassType for MPMediaItem {
112 #[inherits(NSObject)]
113 type Super = MPMediaEntity;
114 type Mutability = InteriorMutable;
115 }
116);
117
118#[cfg(feature = "MediaPlayer_MPMediaItem")]
119unsafe impl NSCoding for MPMediaItem {}
120
121#[cfg(feature = "MediaPlayer_MPMediaItem")]
122unsafe impl NSObjectProtocol for MPMediaItem {}
123
124#[cfg(feature = "MediaPlayer_MPMediaItem")]
125unsafe impl NSSecureCoding for MPMediaItem {}
126
127extern_methods!(
128 #[cfg(feature = "MediaPlayer_MPMediaItem")]
129 unsafe impl MPMediaItem {
130 #[method(persistentID)]
131 pub unsafe fn persistentID(&self) -> MPMediaEntityPersistentID;
132
133 #[method(mediaType)]
134 pub unsafe fn mediaType(&self) -> MPMediaType;
135
136 #[cfg(feature = "Foundation_NSString")]
137 #[method_id(@__retain_semantics Other title)]
138 pub unsafe fn title(&self) -> Option<Id<NSString>>;
139
140 #[cfg(feature = "Foundation_NSString")]
141 #[method_id(@__retain_semantics Other albumTitle)]
142 pub unsafe fn albumTitle(&self) -> Option<Id<NSString>>;
143
144 #[method(albumPersistentID)]
145 pub unsafe fn albumPersistentID(&self) -> MPMediaEntityPersistentID;
146
147 #[cfg(feature = "Foundation_NSString")]
148 #[method_id(@__retain_semantics Other artist)]
149 pub unsafe fn artist(&self) -> Option<Id<NSString>>;
150
151 #[method(artistPersistentID)]
152 pub unsafe fn artistPersistentID(&self) -> MPMediaEntityPersistentID;
153
154 #[cfg(feature = "Foundation_NSString")]
155 #[method_id(@__retain_semantics Other albumArtist)]
156 pub unsafe fn albumArtist(&self) -> Option<Id<NSString>>;
157
158 #[method(albumArtistPersistentID)]
159 pub unsafe fn albumArtistPersistentID(&self) -> MPMediaEntityPersistentID;
160
161 #[cfg(feature = "Foundation_NSString")]
162 #[method_id(@__retain_semantics Other genre)]
163 pub unsafe fn genre(&self) -> Option<Id<NSString>>;
164
165 #[method(genrePersistentID)]
166 pub unsafe fn genrePersistentID(&self) -> MPMediaEntityPersistentID;
167
168 #[cfg(feature = "Foundation_NSString")]
169 #[method_id(@__retain_semantics Other composer)]
170 pub unsafe fn composer(&self) -> Option<Id<NSString>>;
171
172 #[method(composerPersistentID)]
173 pub unsafe fn composerPersistentID(&self) -> MPMediaEntityPersistentID;
174
175 #[method(playbackDuration)]
176 pub unsafe fn playbackDuration(&self) -> NSTimeInterval;
177
178 #[method(albumTrackNumber)]
179 pub unsafe fn albumTrackNumber(&self) -> NSUInteger;
180
181 #[method(albumTrackCount)]
182 pub unsafe fn albumTrackCount(&self) -> NSUInteger;
183
184 #[method(discNumber)]
185 pub unsafe fn discNumber(&self) -> NSUInteger;
186
187 #[method(discCount)]
188 pub unsafe fn discCount(&self) -> NSUInteger;
189
190 #[cfg(feature = "MediaPlayer_MPMediaItemArtwork")]
191 #[method_id(@__retain_semantics Other artwork)]
192 pub unsafe fn artwork(&self) -> Option<Id<MPMediaItemArtwork>>;
193
194 #[method(isExplicitItem)]
195 pub unsafe fn isExplicitItem(&self) -> bool;
196
197 #[cfg(feature = "Foundation_NSString")]
198 #[method_id(@__retain_semantics Other lyrics)]
199 pub unsafe fn lyrics(&self) -> Option<Id<NSString>>;
200
201 #[method(isCompilation)]
202 pub unsafe fn isCompilation(&self) -> bool;
203
204 #[cfg(feature = "Foundation_NSDate")]
205 #[method_id(@__retain_semantics Other releaseDate)]
206 pub unsafe fn releaseDate(&self) -> Option<Id<NSDate>>;
207
208 #[method(beatsPerMinute)]
209 pub unsafe fn beatsPerMinute(&self) -> NSUInteger;
210
211 #[cfg(feature = "Foundation_NSString")]
212 #[method_id(@__retain_semantics Other comments)]
213 pub unsafe fn comments(&self) -> Option<Id<NSString>>;
214
215 #[cfg(feature = "Foundation_NSURL")]
216 #[method_id(@__retain_semantics Other assetURL)]
217 pub unsafe fn assetURL(&self) -> Option<Id<NSURL>>;
218
219 #[method(isCloudItem)]
220 pub unsafe fn isCloudItem(&self) -> bool;
221
222 #[method(hasProtectedAsset)]
223 pub unsafe fn hasProtectedAsset(&self) -> bool;
224
225 #[cfg(feature = "Foundation_NSString")]
226 #[method_id(@__retain_semantics Other podcastTitle)]
227 pub unsafe fn podcastTitle(&self) -> Option<Id<NSString>>;
228
229 #[method(podcastPersistentID)]
230 pub unsafe fn podcastPersistentID(&self) -> MPMediaEntityPersistentID;
231
232 #[method(playCount)]
233 pub unsafe fn playCount(&self) -> NSUInteger;
234
235 #[method(skipCount)]
236 pub unsafe fn skipCount(&self) -> NSUInteger;
237
238 #[method(rating)]
239 pub unsafe fn rating(&self) -> NSUInteger;
240
241 #[cfg(feature = "Foundation_NSDate")]
242 #[method_id(@__retain_semantics Other lastPlayedDate)]
243 pub unsafe fn lastPlayedDate(&self) -> Option<Id<NSDate>>;
244
245 #[cfg(feature = "Foundation_NSString")]
246 #[method_id(@__retain_semantics Other userGrouping)]
247 pub unsafe fn userGrouping(&self) -> Option<Id<NSString>>;
248
249 #[method(bookmarkTime)]
250 pub unsafe fn bookmarkTime(&self) -> NSTimeInterval;
251
252 #[cfg(feature = "Foundation_NSDate")]
253 #[method_id(@__retain_semantics Other dateAdded)]
254 pub unsafe fn dateAdded(&self) -> Id<NSDate>;
255
256 #[cfg(feature = "Foundation_NSString")]
257 #[method_id(@__retain_semantics Other playbackStoreID)]
258 pub unsafe fn playbackStoreID(&self) -> Id<NSString>;
259
260 #[method(isPreorder)]
261 pub unsafe fn isPreorder(&self) -> bool;
262 }
263);
264
265extern_methods!(
266 #[cfg(feature = "MediaPlayer_MPMediaItem")]
268 unsafe impl MPMediaItem {
269 #[method_id(@__retain_semantics Init init)]
270 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
271
272 #[method_id(@__retain_semantics New new)]
273 pub unsafe fn new() -> Id<Self>;
274 }
275);
276
277extern_class!(
278 #[derive(Debug, PartialEq, Eq, Hash)]
279 #[cfg(feature = "MediaPlayer_MPMediaItemArtwork")]
280 pub struct MPMediaItemArtwork;
281
282 #[cfg(feature = "MediaPlayer_MPMediaItemArtwork")]
283 unsafe impl ClassType for MPMediaItemArtwork {
284 type Super = NSObject;
285 type Mutability = InteriorMutable;
286 }
287);
288
289#[cfg(feature = "MediaPlayer_MPMediaItemArtwork")]
290unsafe impl NSObjectProtocol for MPMediaItemArtwork {}
291
292extern_methods!(
293 #[cfg(feature = "MediaPlayer_MPMediaItemArtwork")]
294 unsafe impl MPMediaItemArtwork {
295 #[method_id(@__retain_semantics New new)]
296 pub unsafe fn new() -> Id<Self>;
297
298 #[method_id(@__retain_semantics Init init)]
299 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
300
301 #[cfg(feature = "AppKit_NSImage")]
302 #[method_id(@__retain_semantics Init initWithBoundsSize:requestHandler:)]
303 pub unsafe fn initWithBoundsSize_requestHandler(
304 this: Allocated<Self>,
305 bounds_size: CGSize,
306 request_handler: &Block<(CGSize,), NonNull<NSImage>>,
307 ) -> Id<Self>;
308
309 #[cfg(feature = "AppKit_NSImage")]
310 #[method_id(@__retain_semantics Other imageWithSize:)]
311 pub unsafe fn imageWithSize(&self, size: CGSize) -> Option<Id<NSImage>>;
312
313 #[method(bounds)]
314 pub unsafe fn bounds(&self) -> CGRect;
315
316 #[deprecated = "cropRect is no longer used"]
317 #[method(imageCropRect)]
318 pub unsafe fn imageCropRect(&self) -> CGRect;
319 }
320);