objc2_av_kit/generated/
AVPlaybackSpeed.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// Class used to define a user selectable playback speed in a playback UI.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/avkit/avplaybackspeed?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct AVPlaybackSpeed;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for AVPlaybackSpeed {}
21);
22
23impl AVPlaybackSpeed {
24    extern_methods!(
25        #[unsafe(method(init))]
26        #[unsafe(method_family = init)]
27        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
28
29        #[unsafe(method(new))]
30        #[unsafe(method_family = new)]
31        pub unsafe fn new() -> Retained<Self>;
32
33        /// A list of playback speeds to be used by default across the system.
34        #[unsafe(method(systemDefaultSpeeds))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn systemDefaultSpeeds() -> Retained<NSArray<AVPlaybackSpeed>>;
37
38        /// Parameter `rate`: The rate to be used when this playback speed is selected.
39        ///
40        /// Parameter `localizedName`: A localized name to be displayed representing this playback speed in a UI.
41        ///
42        /// Initializes an AVPlaybackSpeed.
43        #[unsafe(method(initWithRate:localizedName:))]
44        #[unsafe(method_family = init)]
45        pub unsafe fn initWithRate_localizedName(
46            this: Allocated<Self>,
47            rate: c_float,
48            localized_name: &NSString,
49        ) -> Retained<Self>;
50
51        /// The rate associated with this object. When this playback speed is selected this rate will be set in response to the play button being pressed.
52        #[unsafe(method(rate))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn rate(&self) -> c_float;
55
56        /// A localized name for this playback speed.
57        ///
58        /// This name will be used to represent this playback speed in playback UIs where more space is available.
59        #[unsafe(method(localizedName))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn localizedName(&self) -> Retained<NSString>;
62
63        /// A localized name for this playback speed used when space is limited.
64        ///
65        /// This name will be used to represent this playback speed in playback UIs where limited space is available.
66        #[unsafe(method(localizedNumericName))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn localizedNumericName(&self) -> Retained<NSString>;
69    );
70}