objc2_watch_kit/generated/
WKAudioFileAsset.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// WatchKit corollary to AVFoundation AVAsset abstract class
11    ///
12    ///
13    /// This class provides the functionality of AVAsset for Watch OS apps. Only file-based assets are allowed.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileasset?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
19    pub struct WKAudioFileAsset;
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for WKAudioFileAsset {}
24);
25
26impl WKAudioFileAsset {
27    extern_methods!(
28        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        /// Returns an instance of WKAudioFileAsset for inspection of a media resource.
34        ///
35        /// Parameter `URL`: An instance of NSURL that references a file-based media resource.
36        ///
37        /// Returns: An instance of WKAudioFileAsset.
38        ///
39        /// Returns a newly allocated instance of a subclass of WKAudioFileAsset initialized with the specified URL.
40        /// Title, ablumTitle, and artist properties are initialized to the values found in the common metadata of the media resource
41        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
42        #[unsafe(method(assetWithURL:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>;
45
46        /// Returns an instance of WKAudioFileAsset for inspection of a media resource.
47        ///
48        /// Parameter `URL`: An instance of NSURL that references a file-based media resource.
49        ///
50        /// Parameter `title`: Title string to use for the Now Playing controls. If nil, value in common metadata of the media resource will be used. If no value is found in common metadata, the file name will be used.
51        ///
52        /// Parameter `albumTitle`: Album Title string to use for the Now Playing controls. If nil, value in common metadata of the media resource will be used.
53        ///
54        /// Parameter `artist`: Artist string to use for the Now Playing controls. If nil, value in common metadata of the media resource will be used.
55        ///
56        /// Returns: An instance of WKAudioFileAsset.
57        ///
58        /// Returns a newly allocated instance of a subclass of WKAudioFileAsset initialized with the specified URL.
59        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
60        #[unsafe(method(assetWithURL:title:albumTitle:artist:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn assetWithURL_title_albumTitle_artist(
63            url: &NSURL,
64            title: Option<&NSString>,
65            album_title: Option<&NSString>,
66            artist: Option<&NSString>,
67        ) -> Retained<Self>;
68
69        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
70        #[unsafe(method(URL))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn URL(&self) -> Retained<NSURL>;
73
74        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
75        #[unsafe(method(duration))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn duration(&self) -> NSTimeInterval;
78
79        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
80        #[unsafe(method(title))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
83
84        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
85        #[unsafe(method(albumTitle))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn albumTitle(&self) -> Option<Retained<NSString>>;
88
89        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
90        #[unsafe(method(artist))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn artist(&self) -> Option<Retained<NSString>>;
93    );
94}
95
96/// Methods declared on superclass `NSObject`.
97impl WKAudioFileAsset {
98    extern_methods!(
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub unsafe fn new() -> Retained<Self>;
102    );
103}