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
19unsafe impl NSObjectProtocol for AVPlaybackSpeed {}
20
21impl AVPlaybackSpeed {
22 extern_methods!(
23 #[unsafe(method(init))]
24 #[unsafe(method_family = init)]
25 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
26
27 #[unsafe(method(new))]
28 #[unsafe(method_family = new)]
29 pub unsafe fn new() -> Retained<Self>;
30
31 /// A list of playback speeds to be used by default across the system.
32 #[unsafe(method(systemDefaultSpeeds))]
33 #[unsafe(method_family = none)]
34 pub unsafe fn systemDefaultSpeeds() -> Retained<NSArray<AVPlaybackSpeed>>;
35
36 /// Parameter `rate`: The rate to be used when this playback speed is selected.
37 ///
38 /// Parameter `localizedName`: A localized name to be displayed representing this playback speed in a UI.
39 ///
40 /// Initializes an AVPlaybackSpeed.
41 #[unsafe(method(initWithRate:localizedName:))]
42 #[unsafe(method_family = init)]
43 pub unsafe fn initWithRate_localizedName(
44 this: Allocated<Self>,
45 rate: c_float,
46 localized_name: &NSString,
47 ) -> Retained<Self>;
48
49 /// 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.
50 #[unsafe(method(rate))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn rate(&self) -> c_float;
53
54 /// A localized name for this playback speed.
55 ///
56 /// This name will be used to represent this playback speed in playback UIs where more space is available.
57 #[unsafe(method(localizedName))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn localizedName(&self) -> Retained<NSString>;
60
61 /// A localized name for this playback speed used when space is limited.
62 ///
63 /// This name will be used to represent this playback speed in playback UIs where limited space is available.
64 #[unsafe(method(localizedNumericName))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn localizedNumericName(&self) -> Retained<NSString>;
67 );
68}