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