objc2_core_media/generated/CMAudioDeviceClock.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2-core-audio")]
5use objc2_core_audio::*;
6use objc2_core_foundation::*;
7
8use crate::*;
9
10extern "C-unwind" {
11 /// Creates a clock that tracks playback through a particular CoreAudio device.
12 ///
13 /// When the device is stopped, the clock continues to tick, tracking HostTime until
14 /// the device starts up again.
15 /// Pass NULL for deviceUID to create a clock that tracks the default device.
16 /// deviceUID must be NULL on iOS.
17 ///
18 /// # Safety
19 ///
20 /// `clock_out` must be a valid pointer.
21 #[cfg(feature = "CMSync")]
22 pub fn CMAudioDeviceClockCreate(
23 allocator: Option<&CFAllocator>,
24 device_uid: Option<&CFString>,
25 clock_out: NonNull<*mut CMClock>,
26 ) -> OSStatus;
27}
28
29extern "C-unwind" {
30 /// Creates a clock that tracks playback through a particular CoreAudio device.
31 ///
32 /// # Safety
33 ///
34 /// `clock_out` must be a valid pointer.
35 #[cfg(all(feature = "CMSync", feature = "objc2-core-audio"))]
36 pub fn CMAudioDeviceClockCreateFromAudioDeviceID(
37 allocator: Option<&CFAllocator>,
38 device_id: AudioDeviceID,
39 clock_out: NonNull<*mut CMClock>,
40 ) -> OSStatus;
41}
42
43extern "C-unwind" {
44 /// Changes the CoreAudio device the clock is tracking.
45 ///
46 /// Pass NULL for deviceUID to make the clock track the default device.
47 #[cfg(feature = "CMSync")]
48 pub fn CMAudioDeviceClockSetAudioDeviceUID(
49 clock: &CMClock,
50 device_uid: Option<&CFString>,
51 ) -> OSStatus;
52}
53
54extern "C-unwind" {
55 /// Changes the CoreAudio device the clock is tracking.
56 #[cfg(all(feature = "CMSync", feature = "objc2-core-audio"))]
57 pub fn CMAudioDeviceClockSetAudioDeviceID(
58 clock: &CMClock,
59 device_id: AudioDeviceID,
60 ) -> OSStatus;
61}
62
63extern "C-unwind" {
64 /// Queries which CoreAudio device the clock is tracking.
65 ///
66 /// If a non-NULL deviceUID has been set, CMAudioDeviceClockGetAudioDevice returns the set UID, its associated ID,
67 /// and *trackingDefaultDeviceOut == false.
68 /// If a deviceID has been set directly, CMAudioDeviceClockGetAudioDevice returns NULL UID, the set device ID,
69 /// and *trackingDefaultDeviceOut == false.
70 /// If a NULL deviceUID has been set (which means "track the default device"), CMAudioDeviceClockGetAudioDevice
71 /// returns NULL UID, the ID of the current default device, and *trackingDefaultDeviceOut == true.
72 ///
73 /// # Safety
74 ///
75 /// - `device_uid_out` must be a valid pointer or null.
76 /// - `device_id_out` must be a valid pointer or null.
77 /// - `tracking_default_device_out` must be a valid pointer or null.
78 #[cfg(all(feature = "CMSync", feature = "objc2-core-audio"))]
79 pub fn CMAudioDeviceClockGetAudioDevice(
80 clock: &CMClock,
81 device_uid_out: *mut *const CFString,
82 device_id_out: *mut AudioDeviceID,
83 tracking_default_device_out: *mut Boolean,
84 ) -> OSStatus;
85}