objc2_avf_audio/generated/AVAudioTypes.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8/// A position in an audio file or stream.
9///
10/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudioframeposition?language=objc)
11pub type AVAudioFramePosition = i64;
12
13/// A number of audio sample frames.
14///
15/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudioframecount?language=objc)
16pub type AVAudioFrameCount = u32;
17
18/// A number of packets of compressed audio data.
19///
20/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiopacketcount?language=objc)
21pub type AVAudioPacketCount = u32;
22
23/// A number of audio channels.
24///
25///
26/// Rationale: making this a potentially larger-than-32-bit type like NSUInteger would open the
27/// door to a large set of runtime failures due to underlying implementations' use of UInt32.
28///
29/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiochannelcount?language=objc)
30pub type AVAudioChannelCount = u32;
31
32/// Generic callback handler.
33///
34/// Various AVAudioEngine objects issue callbacks to generic blocks of this type. In general
35/// the callback arrives on a non-main thread and it is the client's responsibility to handle it
36/// in a thread-safe manner.
37///
38/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudionodecompletionhandler?language=objc)
39#[cfg(feature = "block2")]
40pub type AVAudioNodeCompletionHandler = *mut block2::DynBlock<dyn Fn()>;
41
42/// The index of a bus on an AVAudioNode.
43///
44/// AVAudioNode objects potentially have multiple input and/or output busses.
45/// AVAudioNodeBus represents a bus as a zero-based index.
46///
47/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudionodebus?language=objc)
48pub type AVAudioNodeBus = NSUInteger;
49
50/// The time position in beats of playback and events in the AVAudioSequencer and its components.
51///
52/// AVMusicTimeStamp allows the position and duration of events and actions in the AVAudioSequencer to
53/// function independently from the tempo of the sequence being played. At the default tempo of 120.0,
54/// a time stamp of 1.0 represents 0.5 seconds of time.
55///
56/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avmusictimestamp?language=objc)
57pub type AVMusicTimeStamp = c_double;
58
59/// Struct representing a point in 3D space
60///
61/// This struct is used by classes dealing with 3D audio such as `AVAudioMixing`
62/// and `AVAudioEnvironmentNode` and represents a point in 3D space.
63///
64/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudio3dpoint?language=objc)
65#[repr(C)]
66#[derive(Clone, Copy, Debug, PartialEq)]
67pub struct AVAudio3DPoint {
68 pub x: c_float,
69 pub y: c_float,
70 pub z: c_float,
71}
72
73unsafe impl Encode for AVAudio3DPoint {
74 const ENCODING: Encoding = Encoding::Struct(
75 "AVAudio3DPoint",
76 &[
77 <c_float>::ENCODING,
78 <c_float>::ENCODING,
79 <c_float>::ENCODING,
80 ],
81 );
82}
83
84unsafe impl RefEncode for AVAudio3DPoint {
85 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
86}
87
88// TODO: pub fn AVAudioMake3DPoint(x: c_float,y: c_float,z: c_float,) -> AVAudio3DPoint;
89
90/// Struct representing a vector in 3D space
91///
92/// This struct is used by classes dealing with 3D audio such as `AVAudioMixing`
93/// and `AVAudioEnvironmentNode`.
94///
95/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudio3dvector?language=objc)
96pub type AVAudio3DVector = AVAudio3DPoint;
97
98// TODO: pub fn AVAudioMake3DVector(x: c_float,y: c_float,z: c_float,) -> AVAudio3DVector;
99
100/// Struct representing the orientation of the listener in 3D space
101///
102/// Two orthogonal vectors describe the orientation of the listener. The forward
103/// vector points in the direction that the listener is facing. The up vector is orthogonal
104/// to the forward vector and points upwards from the listener's head.
105///
106/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudio3dvectororientation?language=objc)
107#[repr(C)]
108#[derive(Clone, Copy, Debug, PartialEq)]
109pub struct AVAudio3DVectorOrientation {
110 pub forward: AVAudio3DVector,
111 pub up: AVAudio3DVector,
112}
113
114unsafe impl Encode for AVAudio3DVectorOrientation {
115 const ENCODING: Encoding = Encoding::Struct(
116 "AVAudio3DVectorOrientation",
117 &[<AVAudio3DVector>::ENCODING, <AVAudio3DVector>::ENCODING],
118 );
119}
120
121unsafe impl RefEncode for AVAudio3DVectorOrientation {
122 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
123}
124
125// TODO: pub fn AVAudioMake3DVectorOrientation(forward: AVAudio3DVector,up: AVAudio3DVector,) -> AVAudio3DVectorOrientation;
126
127/// Struct representing the orientation of the listener in 3D space
128///
129/// Three angles describe the orientation of a listener's head - yaw, pitch and roll.
130///
131/// Yaw describes the side to side movement of the listener's head.
132/// The yaw axis is perpendicular to the plane of the listener's ears with its origin at the
133/// center of the listener's head and directed towards the bottom of the listener's head. A
134/// positive yaw is in the clockwise direction going from 0 to 180 degrees. A negative yaw is in
135/// the counter-clockwise direction going from 0 to -180 degrees.
136///
137/// Pitch describes the up-down movement of the listener's head.
138/// The pitch axis is perpendicular to the yaw axis and is parallel to the plane of the
139/// listener's ears with its origin at the center of the listener's head and directed towards
140/// the right ear. A positive pitch is the upwards direction going from 0 to 180 degrees. A
141/// negative pitch is in the downwards direction going from 0 to -180 degrees.
142///
143/// Roll describes the tilt of the listener's head.
144/// The roll axis is perpendicular to the other two axes with its origin at the center of the
145/// listener's head and is directed towards the listener's nose. A positive roll is to the right
146/// going from 0 to 180 degrees. A negative roll is to the left going from 0 to -180 degrees.
147///
148/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudio3dangularorientation?language=objc)
149#[repr(C)]
150#[derive(Clone, Copy, Debug, PartialEq)]
151pub struct AVAudio3DAngularOrientation {
152 pub yaw: c_float,
153 pub pitch: c_float,
154 pub roll: c_float,
155}
156
157unsafe impl Encode for AVAudio3DAngularOrientation {
158 const ENCODING: Encoding = Encoding::Struct(
159 "AVAudio3DAngularOrientation",
160 &[
161 <c_float>::ENCODING,
162 <c_float>::ENCODING,
163 <c_float>::ENCODING,
164 ],
165 );
166}
167
168unsafe impl RefEncode for AVAudio3DAngularOrientation {
169 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
170}
171
172// TODO: pub fn AVAudioMake3DAngularOrientation(yaw: c_float,pitch: c_float,roll: c_float,) -> AVAudio3DAngularOrientation;