objc2_itunes_library/generated/
ITLibMediaItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
51#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
52pub struct ITLibMediaItemMediaKind(pub NSUInteger);
53impl ITLibMediaItemMediaKind {
54 #[doc(alias = "ITLibMediaItemMediaKindUnknown")]
55 pub const KindUnknown: Self = Self(1);
56 #[doc(alias = "ITLibMediaItemMediaKindSong")]
57 pub const KindSong: Self = Self(2);
58 #[doc(alias = "ITLibMediaItemMediaKindMovie")]
59 pub const KindMovie: Self = Self(3);
60 #[doc(alias = "ITLibMediaItemMediaKindPodcast")]
61 pub const KindPodcast: Self = Self(4);
62 #[doc(alias = "ITLibMediaItemMediaKindAudiobook")]
63 pub const KindAudiobook: Self = Self(5);
64 #[doc(alias = "ITLibMediaItemMediaKindPDFBooklet")]
65 pub const KindPDFBooklet: Self = Self(6);
66 #[doc(alias = "ITLibMediaItemMediaKindMusicVideo")]
67 pub const KindMusicVideo: Self = Self(7);
68 #[doc(alias = "ITLibMediaItemMediaKindTVShow")]
69 pub const KindTVShow: Self = Self(8);
70 #[doc(alias = "ITLibMediaItemMediaKindInteractiveBooklet")]
71 pub const KindInteractiveBooklet: Self = Self(9);
72 #[doc(alias = "ITLibMediaItemMediaKindHomeVideo")]
73 pub const KindHomeVideo: Self = Self(12);
74 #[doc(alias = "ITLibMediaItemMediaKindRingtone")]
75 pub const KindRingtone: Self = Self(14);
76 #[doc(alias = "ITLibMediaItemMediaKindDigitalBooklet")]
77 pub const KindDigitalBooklet: Self = Self(15);
78 #[doc(alias = "ITLibMediaItemMediaKindIOSApplication")]
79 pub const KindIOSApplication: Self = Self(16);
80 #[doc(alias = "ITLibMediaItemMediaKindVoiceMemo")]
81 pub const KindVoiceMemo: Self = Self(17);
82 #[doc(alias = "ITLibMediaItemMediaKindiTunesU")]
83 pub const KindiTunesU: Self = Self(18);
84 #[doc(alias = "ITLibMediaItemMediaKindBook")]
85 pub const KindBook: Self = Self(19);
86 #[doc(alias = "ITLibMediaItemMediaKindPDFBook")]
87 pub const KindPDFBook: Self = Self(20);
88 #[doc(alias = "ITLibMediaItemMediaKindAlertTone")]
89 pub const KindAlertTone: Self = Self(21);
90}
91
92unsafe impl Encode for ITLibMediaItemMediaKind {
93 const ENCODING: Encoding = NSUInteger::ENCODING;
94}
95
96unsafe impl RefEncode for ITLibMediaItemMediaKind {
97 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
98}
99
100#[repr(transparent)]
111#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
112pub struct ITLibMediaItemLyricsContentRating(pub NSUInteger);
113impl ITLibMediaItemLyricsContentRating {
114 #[doc(alias = "ITLibMediaItemLyricsContentRatingNone")]
115 pub const None: Self = Self(0);
116 #[doc(alias = "ITLibMediaItemLyricsContentRatingExplicit")]
117 pub const Explicit: Self = Self(1);
118 #[doc(alias = "ITLibMediaItemLyricsContentRatingClean")]
119 pub const Clean: Self = Self(2);
120}
121
122unsafe impl Encode for ITLibMediaItemLyricsContentRating {
123 const ENCODING: Encoding = NSUInteger::ENCODING;
124}
125
126unsafe impl RefEncode for ITLibMediaItemLyricsContentRating {
127 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
128}
129
130#[repr(transparent)]
143#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
144pub struct ITLibMediaItemLocationType(pub NSUInteger);
145impl ITLibMediaItemLocationType {
146 #[doc(alias = "ITLibMediaItemLocationTypeUnknown")]
147 pub const Unknown: Self = Self(0);
148 #[doc(alias = "ITLibMediaItemLocationTypeFile")]
149 pub const File: Self = Self(1);
150 #[doc(alias = "ITLibMediaItemLocationTypeURL")]
151 pub const URL: Self = Self(2);
152 #[doc(alias = "ITLibMediaItemLocationTypeRemote")]
153 pub const Remote: Self = Self(3);
154}
155
156unsafe impl Encode for ITLibMediaItemLocationType {
157 const ENCODING: Encoding = NSUInteger::ENCODING;
158}
159
160unsafe impl RefEncode for ITLibMediaItemLocationType {
161 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
162}
163
164#[repr(transparent)]
175#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
176pub struct ITLibMediaItemPlayStatus(pub NSUInteger);
177impl ITLibMediaItemPlayStatus {
178 #[doc(alias = "ITLibMediaItemPlayStatusNone")]
179 pub const None: Self = Self(0);
180 #[doc(alias = "ITLibMediaItemPlayStatusPartiallyPlayed")]
181 pub const PartiallyPlayed: Self = Self(1);
182 #[doc(alias = "ITLibMediaItemPlayStatusUnplayed")]
183 pub const Unplayed: Self = Self(2);
184}
185
186unsafe impl Encode for ITLibMediaItemPlayStatus {
187 const ENCODING: Encoding = NSUInteger::ENCODING;
188}
189
190unsafe impl RefEncode for ITLibMediaItemPlayStatus {
191 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
192}
193
194extern_class!(
195 #[unsafe(super(ITLibMediaEntity, NSObject))]
202 #[derive(Debug, PartialEq, Eq, Hash)]
203 #[cfg(feature = "ITLibMediaEntity")]
204 pub struct ITLibMediaItem;
205);
206
207#[cfg(feature = "ITLibMediaEntity")]
208extern_conformance!(
209 unsafe impl NSObjectProtocol for ITLibMediaItem {}
210);
211
212#[cfg(feature = "ITLibMediaEntity")]
213impl ITLibMediaItem {
214 extern_methods!(
215 #[unsafe(method(title))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn title(&self) -> Retained<NSString>;
219
220 #[unsafe(method(sortTitle))]
222 #[unsafe(method_family = none)]
223 pub unsafe fn sortTitle(&self) -> Option<Retained<NSString>>;
224
225 #[cfg(feature = "ITLibArtist")]
226 #[unsafe(method(artist))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn artist(&self) -> Option<Retained<ITLibArtist>>;
230
231 #[unsafe(method(composer))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn composer(&self) -> Retained<NSString>;
235
236 #[unsafe(method(sortComposer))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn sortComposer(&self) -> Option<Retained<NSString>>;
240
241 #[unsafe(method(rating))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn rating(&self) -> NSInteger;
245
246 #[unsafe(method(isRatingComputed))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn isRatingComputed(&self) -> bool;
250
251 #[unsafe(method(startTime))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn startTime(&self) -> NSUInteger;
255
256 #[unsafe(method(stopTime))]
258 #[unsafe(method_family = none)]
259 pub unsafe fn stopTime(&self) -> NSUInteger;
260
261 #[cfg(feature = "ITLibAlbum")]
262 #[unsafe(method(album))]
264 #[unsafe(method_family = none)]
265 pub unsafe fn album(&self) -> Retained<ITLibAlbum>;
266
267 #[unsafe(method(genre))]
269 #[unsafe(method_family = none)]
270 pub unsafe fn genre(&self) -> Retained<NSString>;
271
272 #[unsafe(method(kind))]
274 #[unsafe(method_family = none)]
275 pub unsafe fn kind(&self) -> Option<Retained<NSString>>;
276
277 #[unsafe(method(mediaKind))]
279 #[unsafe(method_family = none)]
280 pub unsafe fn mediaKind(&self) -> ITLibMediaItemMediaKind;
281
282 #[unsafe(method(fileSize))]
284 #[unsafe(method_family = none)]
285 pub unsafe fn fileSize(&self) -> c_ulonglong;
286
287 #[deprecated]
289 #[unsafe(method(size))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn size(&self) -> NSUInteger;
292
293 #[unsafe(method(totalTime))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn totalTime(&self) -> NSUInteger;
297
298 #[unsafe(method(trackNumber))]
300 #[unsafe(method_family = none)]
301 pub unsafe fn trackNumber(&self) -> NSUInteger;
302
303 #[unsafe(method(category))]
305 #[unsafe(method_family = none)]
306 pub unsafe fn category(&self) -> Option<Retained<NSString>>;
307
308 #[unsafe(method(description))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn description(&self) -> Option<Retained<NSString>>;
312
313 #[unsafe(method(lyricsContentRating))]
315 #[unsafe(method_family = none)]
316 pub unsafe fn lyricsContentRating(&self) -> ITLibMediaItemLyricsContentRating;
317
318 #[unsafe(method(contentRating))]
320 #[unsafe(method_family = none)]
321 pub unsafe fn contentRating(&self) -> Option<Retained<NSString>>;
322
323 #[unsafe(method(modifiedDate))]
325 #[unsafe(method_family = none)]
326 pub unsafe fn modifiedDate(&self) -> Option<Retained<NSDate>>;
327
328 #[unsafe(method(addedDate))]
330 #[unsafe(method_family = none)]
331 pub unsafe fn addedDate(&self) -> Option<Retained<NSDate>>;
332
333 #[unsafe(method(bitrate))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn bitrate(&self) -> NSUInteger;
337
338 #[unsafe(method(sampleRate))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn sampleRate(&self) -> NSUInteger;
342
343 #[unsafe(method(beatsPerMinute))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn beatsPerMinute(&self) -> NSUInteger;
347
348 #[unsafe(method(playCount))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn playCount(&self) -> NSUInteger;
352
353 #[unsafe(method(lastPlayedDate))]
355 #[unsafe(method_family = none)]
356 pub unsafe fn lastPlayedDate(&self) -> Option<Retained<NSDate>>;
357
358 #[unsafe(method(playStatus))]
360 #[unsafe(method_family = none)]
361 pub unsafe fn playStatus(&self) -> ITLibMediaItemPlayStatus;
362
363 #[unsafe(method(location))]
365 #[unsafe(method_family = none)]
366 pub unsafe fn location(&self) -> Option<Retained<NSURL>>;
367
368 #[unsafe(method(hasArtworkAvailable))]
370 #[unsafe(method_family = none)]
371 pub unsafe fn hasArtworkAvailable(&self) -> bool;
372
373 #[cfg(feature = "ITLibArtwork")]
374 #[unsafe(method(artwork))]
376 #[unsafe(method_family = none)]
377 pub unsafe fn artwork(&self) -> Option<Retained<ITLibArtwork>>;
378
379 #[unsafe(method(comments))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn comments(&self) -> Option<Retained<NSString>>;
383
384 #[unsafe(method(isPurchased))]
386 #[unsafe(method_family = none)]
387 pub unsafe fn isPurchased(&self) -> bool;
388
389 #[unsafe(method(isCloud))]
391 #[unsafe(method_family = none)]
392 pub unsafe fn isCloud(&self) -> bool;
393
394 #[unsafe(method(isDRMProtected))]
396 #[unsafe(method_family = none)]
397 pub unsafe fn isDRMProtected(&self) -> bool;
398
399 #[unsafe(method(isVideo))]
401 #[unsafe(method_family = none)]
402 pub unsafe fn isVideo(&self) -> bool;
403
404 #[cfg(feature = "ITLibMediaItemVideoInfo")]
405 #[unsafe(method(videoInfo))]
407 #[unsafe(method_family = none)]
408 pub unsafe fn videoInfo(&self) -> Option<Retained<ITLibMediaItemVideoInfo>>;
409
410 #[unsafe(method(releaseDate))]
412 #[unsafe(method_family = none)]
413 pub unsafe fn releaseDate(&self) -> Option<Retained<NSDate>>;
414
415 #[unsafe(method(year))]
417 #[unsafe(method_family = none)]
418 pub unsafe fn year(&self) -> NSUInteger;
419
420 #[deprecated]
422 #[unsafe(method(fileType))]
423 #[unsafe(method_family = none)]
424 pub unsafe fn fileType(&self) -> NSUInteger;
425
426 #[unsafe(method(skipCount))]
428 #[unsafe(method_family = none)]
429 pub unsafe fn skipCount(&self) -> NSUInteger;
430
431 #[unsafe(method(skipDate))]
433 #[unsafe(method_family = none)]
434 pub unsafe fn skipDate(&self) -> Option<Retained<NSDate>>;
435
436 #[deprecated]
438 #[unsafe(method(voiceOverLanguage))]
439 #[unsafe(method_family = none)]
440 pub unsafe fn voiceOverLanguage(&self) -> Option<Retained<NSString>>;
441
442 #[unsafe(method(volumeAdjustment))]
444 #[unsafe(method_family = none)]
445 pub unsafe fn volumeAdjustment(&self) -> NSInteger;
446
447 #[unsafe(method(volumeNormalizationEnergy))]
449 #[unsafe(method_family = none)]
450 pub unsafe fn volumeNormalizationEnergy(&self) -> NSUInteger;
451
452 #[unsafe(method(isUserDisabled))]
454 #[unsafe(method_family = none)]
455 pub unsafe fn isUserDisabled(&self) -> bool;
456
457 #[unsafe(method(grouping))]
459 #[unsafe(method_family = none)]
460 pub unsafe fn grouping(&self) -> Option<Retained<NSString>>;
461
462 #[unsafe(method(locationType))]
464 #[unsafe(method_family = none)]
465 pub unsafe fn locationType(&self) -> ITLibMediaItemLocationType;
466 );
467}
468
469#[cfg(feature = "ITLibMediaEntity")]
471impl ITLibMediaItem {
472 extern_methods!(
473 #[unsafe(method(init))]
474 #[unsafe(method_family = init)]
475 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
476
477 #[unsafe(method(new))]
478 #[unsafe(method_family = new)]
479 pub unsafe fn new() -> Retained<Self>;
480 );
481}
482
483extern "C" {
484 pub static ITLibMediaItemPropertyAlbumTitle: &'static NSString;
486}
487
488extern "C" {
489 pub static ITLibMediaItemPropertySortAlbumTitle: &'static NSString;
491}
492
493extern "C" {
494 pub static ITLibMediaItemPropertyAlbumArtist: &'static NSString;
496}
497
498extern "C" {
499 pub static ITLibMediaItemPropertyAlbumRating: &'static NSString;
501}
502
503extern "C" {
504 pub static ITLibMediaItemPropertyAlbumRatingComputed: &'static NSString;
506}
507
508extern "C" {
509 pub static ITLibMediaItemPropertySortAlbumArtist: &'static NSString;
511}
512
513extern "C" {
514 pub static ITLibMediaItemPropertyAlbumIsGapless: &'static NSString;
516}
517
518extern "C" {
519 pub static ITLibMediaItemPropertyAlbumIsCompilation: &'static NSString;
521}
522
523extern "C" {
524 pub static ITLibMediaItemPropertyAlbumDiscCount: &'static NSString;
526}
527
528extern "C" {
529 pub static ITLibMediaItemPropertyAlbumDiscNumber: &'static NSString;
531}
532
533extern "C" {
534 pub static ITLibMediaItemPropertyAlbumTrackCount: &'static NSString;
536}
537
538extern "C" {
539 pub static ITLibMediaItemPropertyArtistName: &'static NSString;
541}
542
543extern "C" {
544 pub static ITLibMediaItemPropertySortArtistName: &'static NSString;
546}
547
548extern "C" {
549 pub static ITLibMediaItemPropertyVideoIsHD: &'static NSString;
551}
552
553extern "C" {
554 pub static ITLibMediaItemPropertyVideoWidth: &'static NSString;
556}
557
558extern "C" {
559 pub static ITLibMediaItemPropertyVideoHeight: &'static NSString;
561}
562
563extern "C" {
564 pub static ITLibMediaItemPropertyVideoSeries: &'static NSString;
566}
567
568extern "C" {
569 pub static ITLibMediaItemPropertyVideoSortSeries: &'static NSString;
571}
572
573extern "C" {
574 pub static ITLibMediaItemPropertyVideoSeason: &'static NSString;
576}
577
578extern "C" {
579 pub static ITLibMediaItemPropertyVideoEpisode: &'static NSString;
581}
582
583extern "C" {
584 pub static ITLibMediaItemPropertyVideoEpisodeOrder: &'static NSString;
586}
587
588extern "C" {
589 pub static ITLibMediaItemPropertyHasArtwork: &'static NSString;
591}
592
593extern "C" {
594 pub static ITLibMediaItemPropertyBitRate: &'static NSString;
596}
597
598extern "C" {
599 pub static ITLibMediaItemPropertyBeatsPerMinute: &'static NSString;
601}
602
603extern "C" {
604 pub static ITLibMediaItemPropertyCategory: &'static NSString;
606}
607
608extern "C" {
609 pub static ITLibMediaItemPropertyComments: &'static NSString;
611}
612
613extern "C" {
614 pub static ITLibMediaItemPropertyComposer: &'static NSString;
616}
617
618extern "C" {
619 pub static ITLibMediaItemPropertySortComposer: &'static NSString;
621}
622
623extern "C" {
624 pub static ITLibMediaItemPropertyContentRating: &'static NSString;
626}
627
628extern "C" {
629 pub static ITLibMediaItemPropertyLyricsContentRating: &'static NSString;
631}
632
633extern "C" {
634 pub static ITLibMediaItemPropertyAddedDate: &'static NSString;
636}
637
638extern "C" {
639 pub static ITLibMediaItemPropertyModifiedDate: &'static NSString;
641}
642
643extern "C" {
644 pub static ITLibMediaItemPropertyDescription: &'static NSString;
646}
647
648extern "C" {
649 pub static ITLibMediaItemPropertyIsUserDisabled: &'static NSString;
651}
652
653extern "C" {
654 #[deprecated]
656 pub static ITLibMediaItemPropertyFileType: &'static NSString;
657}
658
659extern "C" {
660 pub static ITLibMediaItemPropertyGenre: &'static NSString;
662}
663
664extern "C" {
665 pub static ITLibMediaItemPropertyGrouping: &'static NSString;
667}
668
669extern "C" {
670 pub static ITLibMediaItemPropertyIsVideo: &'static NSString;
672}
673
674extern "C" {
675 pub static ITLibMediaItemPropertyKind: &'static NSString;
677}
678
679extern "C" {
680 pub static ITLibMediaItemPropertyTitle: &'static NSString;
682}
683
684extern "C" {
685 pub static ITLibMediaItemPropertySortTitle: &'static NSString;
687}
688
689extern "C" {
690 pub static ITLibMediaItemPropertyVolumeNormalizationEnergy: &'static NSString;
692}
693
694extern "C" {
695 pub static ITLibMediaItemPropertyPlayCount: &'static NSString;
697}
698
699extern "C" {
700 pub static ITLibMediaItemPropertyLastPlayDate: &'static NSString;
702}
703
704extern "C" {
705 pub static ITLibMediaItemPropertyPlayStatus: &'static NSString;
707}
708
709extern "C" {
710 pub static ITLibMediaItemPropertyIsDRMProtected: &'static NSString;
712}
713
714extern "C" {
715 pub static ITLibMediaItemPropertyIsPurchased: &'static NSString;
717}
718
719extern "C" {
720 pub static ITLibMediaItemPropertyMovementCount: &'static NSString;
722}
723
724extern "C" {
725 pub static ITLibMediaItemPropertyMovementName: &'static NSString;
727}
728
729extern "C" {
730 pub static ITLibMediaItemPropertyMovementNumber: &'static NSString;
732}
733
734extern "C" {
735 pub static ITLibMediaItemPropertyRating: &'static NSString;
737}
738
739extern "C" {
740 pub static ITLibMediaItemPropertyRatingComputed: &'static NSString;
742}
743
744extern "C" {
745 pub static ITLibMediaItemPropertyReleaseDate: &'static NSString;
747}
748
749extern "C" {
750 pub static ITLibMediaItemPropertySampleRate: &'static NSString;
752}
753
754extern "C" {
755 pub static ITLibMediaItemPropertySize: &'static NSString;
757}
758
759extern "C" {
760 pub static ITLibMediaItemPropertyFileSize: &'static NSString;
762}
763
764extern "C" {
765 pub static ITLibMediaItemPropertyUserSkipCount: &'static NSString;
767}
768
769extern "C" {
770 pub static ITLibMediaItemPropertySkipDate: &'static NSString;
772}
773
774extern "C" {
775 pub static ITLibMediaItemPropertyStartTime: &'static NSString;
777}
778
779extern "C" {
780 pub static ITLibMediaItemPropertyStopTime: &'static NSString;
782}
783
784extern "C" {
785 pub static ITLibMediaItemPropertyTotalTime: &'static NSString;
787}
788
789extern "C" {
790 pub static ITLibMediaItemPropertyTrackNumber: &'static NSString;
792}
793
794extern "C" {
795 pub static ITLibMediaItemPropertyLocationType: &'static NSString;
797}
798
799extern "C" {
800 #[deprecated]
802 pub static ITLibMediaItemPropertyVoiceOverLanguage: &'static NSString;
803}
804
805extern "C" {
806 pub static ITLibMediaItemPropertyVolumeAdjustment: &'static NSString;
808}
809
810extern "C" {
811 pub static ITLibMediaItemPropertyWork: &'static NSString;
813}
814
815extern "C" {
816 pub static ITLibMediaItemPropertyYear: &'static NSString;
818}
819
820extern "C" {
821 pub static ITLibMediaItemPropertyMediaKind: &'static NSString;
823}
824
825extern "C" {
826 pub static ITLibMediaItemPropertyLocation: &'static NSString;
828}
829
830extern "C" {
831 pub static ITLibMediaItemPropertyArtwork: &'static NSString;
833}