objc2_browser_engine_core/generated/
BEAudioSession.rs1use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-avf-audio")]
7use objc2_avf_audio::*;
8#[cfg(feature = "objc2-foundation")]
9use objc2_foundation::*;
10
11use crate::*;
12
13#[cfg(feature = "objc2")]
14extern_class!(
15 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 #[cfg(feature = "objc2")]
21 pub struct BEAudioSession;
22);
23
24#[cfg(feature = "objc2")]
25extern_conformance!(
26 unsafe impl NSObjectProtocol for BEAudioSession {}
27);
28
29#[cfg(feature = "objc2")]
30impl BEAudioSession {
31 extern_methods!(
32 #[cfg(feature = "objc2-avf-audio")]
33 #[unsafe(method(initWithAudioSession:))]
38 #[unsafe(method_family = init)]
39 pub unsafe fn initWithAudioSession(
40 this: Allocated<Self>,
41 audio_session: &AVAudioSession,
42 ) -> Retained<Self>;
43
44 #[cfg(all(feature = "objc2-avf-audio", feature = "objc2-foundation"))]
45 #[unsafe(method(availableOutputs))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn availableOutputs(
49 &self,
50 ) -> Option<Retained<NSArray<AVAudioSessionPortDescription>>>;
51
52 #[cfg(all(feature = "objc2-avf-audio", feature = "objc2-foundation"))]
53 #[unsafe(method(setPreferredOutput:error:_))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn setPreferredOutput_error(
58 &self,
59 out_port: Option<&AVAudioSessionPortDescription>,
60 ) -> Result<(), Retained<NSError>>;
61
62 #[cfg(feature = "objc2-avf-audio")]
63 #[unsafe(method(preferredOutput))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn preferredOutput(&self) -> Option<Retained<AVAudioSessionPortDescription>>;
67 );
68}
69
70#[cfg(feature = "objc2")]
72impl BEAudioSession {
73 extern_methods!(
74 #[unsafe(method(init))]
75 #[unsafe(method_family = init)]
76 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78 #[unsafe(method(new))]
79 #[unsafe(method_family = new)]
80 pub unsafe fn new() -> Retained<Self>;
81 );
82}