objc2_av_foundation/generated/AVRouteDetector.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 "C" {
11 /// Posted when the value of multipleRoutesDetected changes.
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avroutedetectormultipleroutesdetecteddidchangenotification?language=objc)
14 pub static AVRouteDetectorMultipleRoutesDetectedDidChangeNotification:
15 &'static NSNotificationName;
16}
17
18extern_class!(
19 /// AVRouteDetector detects the presence of media playback routes.
20 ///
21 /// If route detection is enabled (it is disabled by default), AVRouteDetector reports whether or not multiple playback routes have been detected. If this is the case, AVKit's AVRoutePickerView can be used to allow users to pick from the set of available routes.
22 ///
23 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
24 ///
25 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avroutedetector?language=objc)
26 #[unsafe(super(NSObject))]
27 #[derive(Debug, PartialEq, Eq, Hash)]
28 pub struct AVRouteDetector;
29);
30
31extern_conformance!(
32 unsafe impl NSObjectProtocol for AVRouteDetector {}
33);
34
35impl AVRouteDetector {
36 extern_methods!(
37 /// Whether or not route detection is enabled. The default value is NO.
38 ///
39 /// Route detection significantly increases power consumption and must be turned off when it's no longer needed.
40 #[unsafe(method(isRouteDetectionEnabled))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn isRouteDetectionEnabled(&self) -> bool;
43
44 /// Setter for [`isRouteDetectionEnabled`][Self::isRouteDetectionEnabled].
45 #[unsafe(method(setRouteDetectionEnabled:))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn setRouteDetectionEnabled(&self, route_detection_enabled: bool);
48
49 /// This property is YES if, in addition to the local playback route, at least one more playback route has been detected.
50 ///
51 /// If multiple route have been detected, AVKit's AVRoutePickerView can be used to allow users to pick from the set of available routes. When the values of this property changes AVRouteDetectorMultipleRoutesDetectedDidChangeNotification is posted.
52 #[unsafe(method(multipleRoutesDetected))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn multipleRoutesDetected(&self) -> bool;
55
56 /// Whether or not route detection will include custom routes. The default value is NO.
57 ///
58 /// Only set this to YES if also using AVCustomRoutingController.
59 #[unsafe(method(detectsCustomRoutes))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn detectsCustomRoutes(&self) -> bool;
62
63 /// Setter for [`detectsCustomRoutes`][Self::detectsCustomRoutes].
64 #[unsafe(method(setDetectsCustomRoutes:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setDetectsCustomRoutes(&self, detects_custom_routes: bool);
67 );
68}
69
70/// Methods declared on superclass `NSObject`.
71impl AVRouteDetector {
72 extern_methods!(
73 #[unsafe(method(init))]
74 #[unsafe(method_family = init)]
75 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
76
77 #[unsafe(method(new))]
78 #[unsafe(method_family = new)]
79 pub unsafe fn new() -> Retained<Self>;
80 );
81}