objc2_av_routing/generated/
AVRoutingPlaybackArbiter.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// An object that manages playback routing preferences.
11    ///
12    /// This object manages instances of ``AVRoutingPlaybackParticipant`` for arbitration of media playback routing priorities and preferences on restricted playback interfaces. The playback routing arbiter is responsible for collecting and applying preferences, such as priorities in non-mixable audio routes and external playback states where the number of allowed players is limited.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/avrouting/avroutingplaybackarbiter?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct AVRoutingPlaybackArbiter;
18);
19
20extern_conformance!(
21    unsafe impl NSObjectProtocol for AVRoutingPlaybackArbiter {}
22);
23
24impl AVRoutingPlaybackArbiter {
25    extern_methods!(
26        /// Returns the singleton playback arbiter instance.
27        #[unsafe(method(sharedRoutingPlaybackArbiter))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn sharedRoutingPlaybackArbiter() -> Retained<AVRoutingPlaybackArbiter>;
30
31        /// The participant that has priority to play audio when it's not possible to play multiple audio sources concurrently.
32        ///
33        /// This participant takes precedence over all other participants to play audio in non-mixable audio routes when concurrent audio playback isn't possible, and only a single participant can play audio. The system unmutes this participant's audio, and mutes the audio of all other participants.
34        ///
35        /// By default, this value is `nil`. When the current preferred participant finishes, the system sets this value to `nil`. If this value is `nil`, the arbiter doesn't impose any priority on the participants, and the participant that's unmuted is based on the existing selection mechanism.
36        #[unsafe(method(preferredParticipantForNonMixableAudioRoutes))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn preferredParticipantForNonMixableAudioRoutes(
39            &self,
40        ) -> Option<Retained<ProtocolObject<dyn AVRoutingPlaybackParticipant>>>;
41
42        /// Setter for [`preferredParticipantForNonMixableAudioRoutes`][Self::preferredParticipantForNonMixableAudioRoutes].
43        ///
44        /// This is a [weak property][objc2::topics::weak_property].
45        #[unsafe(method(setPreferredParticipantForNonMixableAudioRoutes:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setPreferredParticipantForNonMixableAudioRoutes(
48            &self,
49            preferred_participant_for_non_mixable_audio_routes: Option<
50                &ProtocolObject<dyn AVRoutingPlaybackParticipant>,
51            >,
52        );
53
54        /// The participant that has priority to play on external playback interfaces.
55        ///
56        /// This participant takes precedence over all others to play on external playback interfaces (specifically for AirPlay video and Apple Lightning Digital AV Adapters).
57        ///
58        /// By default, this value is `nil`. When the value is `nil`, the arbiter doesn't impose any priority on the participants, and the participant that is selected to playback externally falls back to the existing selection mechanism.
59        #[unsafe(method(preferredParticipantForExternalPlayback))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn preferredParticipantForExternalPlayback(
62            &self,
63        ) -> Option<Retained<ProtocolObject<dyn AVRoutingPlaybackParticipant>>>;
64
65        /// Setter for [`preferredParticipantForExternalPlayback`][Self::preferredParticipantForExternalPlayback].
66        ///
67        /// This is a [weak property][objc2::topics::weak_property].
68        #[unsafe(method(setPreferredParticipantForExternalPlayback:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn setPreferredParticipantForExternalPlayback(
71            &self,
72            preferred_participant_for_external_playback: Option<
73                &ProtocolObject<dyn AVRoutingPlaybackParticipant>,
74            >,
75        );
76
77        #[unsafe(method(init))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81        #[unsafe(method(new))]
82        #[unsafe(method_family = new)]
83        pub unsafe fn new() -> Retained<Self>;
84    );
85}
86
87extern_protocol!(
88    /// A protocol for objects that participate in playback routing arbitration.
89    ///
90    /// Classes conform to this protocol if they participate in media playback routing arbitration for managing preferences such as priority on restricted playback routes.
91    ///
92    /// See also [Apple's documentation](https://developer.apple.com/documentation/avrouting/avroutingplaybackparticipant?language=objc)
93    pub unsafe trait AVRoutingPlaybackParticipant {}
94);