objc2_core_audio/generated/AudioServerPlugIn.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3#[cfg(feature = "objc2")]
4use objc2::__framework_prelude::*;
5use objc2_core_foundation::*;
6
7use crate::*;
8
9/// The AudioServerPlugInCustomPropertyInfo struct is used to describe enough about
10/// a custom property to allow the Host to marshal the data between the Host and
11/// its clients.
12/// Field: mSelector
13/// The AudioObjectPropertySelector of the custom property.
14/// Field: mPropertyDataType
15/// A UInt32 whose value indicates the data type of the data of the custom
16/// property. Constants for this value are defined in the Basic Constants
17/// section.
18/// Field: mQualifierDataType
19/// A UInt32 whose value indicates the data type of the data of the custom
20/// property. Constants for this value are defined in the Basic Constants
21/// section.
22///
23/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioserverplugincustompropertyinfo?language=objc)
24#[cfg(feature = "AudioHardware")]
25#[repr(C)]
26#[derive(Clone, Copy, Debug, PartialEq)]
27pub struct AudioServerPlugInCustomPropertyInfo {
28 pub mSelector: AudioObjectPropertySelector,
29 pub mPropertyDataType: u32,
30 pub mQualifierDataType: u32,
31}
32
33#[cfg(all(feature = "AudioHardware", feature = "objc2"))]
34unsafe impl Encode for AudioServerPlugInCustomPropertyInfo {
35 const ENCODING: Encoding = Encoding::Struct(
36 "AudioServerPlugInCustomPropertyInfo",
37 &[
38 <AudioObjectPropertySelector>::ENCODING,
39 <u32>::ENCODING,
40 <u32>::ENCODING,
41 ],
42 );
43}
44
45#[cfg(all(feature = "AudioHardware", feature = "objc2"))]
46unsafe impl RefEncode for AudioServerPlugInCustomPropertyInfo {
47 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
48}
49
50/// The AudioServerPlugInClientInfo struct is used to identify a client of the Host
51/// to the plug-in.
52/// Field: mClientID
53/// An ID that allows for differentiating multiple clients in the same process.
54/// This ID is passed to the plug-in during IO so that the plug-in can associate
55/// the IO with the client easily.
56/// Field: mProcessID
57/// The pid_t of the process that contains the client.
58/// Field: mIsNativeEndian
59/// A Boolean indicating whether or not the client has the same endianness as
60/// the server.
61/// Field: mBundleID
62/// A CFStringRef that contains the bundle ID of the main bundle of the process
63/// that contains the client. Note that the plug-in is expected to retain this
64/// string itself if the plug-in wishes to keep it around.
65///
66/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioserverpluginclientinfo?language=objc)
67#[cfg(feature = "libc")]
68#[repr(C)]
69#[derive(Clone, Copy, Debug, PartialEq)]
70pub struct AudioServerPlugInClientInfo {
71 pub mClientID: u32,
72 pub mProcessID: libc::pid_t,
73 pub mIsNativeEndian: Boolean,
74 pub mBundleID: *const CFString,
75}
76
77#[cfg(all(feature = "libc", feature = "objc2"))]
78unsafe impl Encode for AudioServerPlugInClientInfo {
79 const ENCODING: Encoding = Encoding::Struct(
80 "AudioServerPlugInClientInfo",
81 &[
82 <u32>::ENCODING,
83 <libc::pid_t>::ENCODING,
84 <Boolean>::ENCODING,
85 <*const CFString>::ENCODING,
86 ],
87 );
88}
89
90#[cfg(all(feature = "libc", feature = "objc2"))]
91unsafe impl RefEncode for AudioServerPlugInClientInfo {
92 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
93}
94
95/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpluginobject?language=objc)
96#[cfg(feature = "AudioHardware")]
97pub const kAudioObjectPlugInObject: AudioObjectID = 1;
98
99/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioserverpluginhostclientid?language=objc)
100#[cfg(feature = "AudioHardware")]
101pub const kAudioServerPlugInHostClientID: AudioObjectID = 0;
102
103/// The set of data types the Host knows how to marshal between the server and the
104/// client. These are the only types supported for custom properties. See
105/// AudioServerPlugInCustomPropertyInfo for more information.
106///
107/// This is used to declare that the property doesn't have any property or
108/// qualifier data.
109///
110/// The property/qualifier data is a CFStringRef.
111///
112/// The property/qualifier data is a CFPropertyListRef.
113///
114/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioserverplugincustompropertydatatype?language=objc)
115pub type AudioServerPlugInCustomPropertyDataType = u32;
116
117/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioserverplugincustompropertydatatypenone?language=objc)
118pub const kAudioServerPlugInCustomPropertyDataTypeNone: AudioServerPlugInCustomPropertyDataType = 0;
119/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioserverplugincustompropertydatatypecfstring?language=objc)
120pub const kAudioServerPlugInCustomPropertyDataTypeCFString:
121 AudioServerPlugInCustomPropertyDataType = 0x63667374;
122/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioserverplugincustompropertydatatypecfpropertylist?language=objc)
123pub const kAudioServerPlugInCustomPropertyDataTypeCFPropertyList:
124 AudioServerPlugInCustomPropertyDataType = 0x706c7374;
125
126/// The valid values for the inOperationID argument to the various IO methods.
127///
128/// This operation marks the beginning and the ending of the IO thread. Note
129/// that DoIOOperation() will never be called with this ID.
130///
131/// This operation marks the beginning and ending of each IO cycle. Note that
132/// DoIOOperation() will never be called with this ID.
133///
134/// This operation transfers the input data from the device's ring buffer to the
135/// provided buffer in the stream's native format. Note that this operation
136/// always happens in-place in the main buffer passed to DoIOOperation(). It is
137/// required that this operation be implemented if the AudioDevice has input
138/// streams.
139///
140/// This operation converts the input data from its native format to the
141/// canonical format.
142///
143/// This operation performs arbitrary signal processing on the input data in the
144/// canonical format.
145///
146/// This operation performs arbitrary signal processing on the output data in
147/// the canonical format.
148///
149/// This operation mixes the output data into the device's ring buffer. Note
150/// that if a plug-in implements this operation, no further output operations
151/// will occur for that cycle. It is assumed that the device handles everything
152/// from there down including preparing the data for consumption by the
153/// hardware. Note also that this operation always happens in-place in the main
154/// buffer passed to DoIOOperation().
155///
156/// This operation processes the full mix of all clients' data in the canonical
157/// format.
158///
159/// This operation converts the fully mixed data from the canonical format to
160/// the device's native format.
161///
162/// This operation puts the data into the device's ring buffer for consumption
163/// of the hardware. Note that this operation always happens in-place in the
164/// main buffer passed to DoIOOperation(). It is required that this operation be
165/// implemented if the AudioDevice has output streams.
166///
167/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audioserverpluginiooperation?language=objc)
168// NS_ENUM
169#[repr(transparent)]
170#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
171pub struct AudioServerPlugInIOOperation(pub u32);
172impl AudioServerPlugInIOOperation {
173 #[doc(alias = "kAudioServerPlugInIOOperationThread")]
174 pub const Thread: Self = Self(0x74687264);
175 #[doc(alias = "kAudioServerPlugInIOOperationCycle")]
176 pub const Cycle: Self = Self(0x6379636c);
177 #[doc(alias = "kAudioServerPlugInIOOperationReadInput")]
178 pub const ReadInput: Self = Self(0x72656164);
179 #[doc(alias = "kAudioServerPlugInIOOperationConvertInput")]
180 pub const ConvertInput: Self = Self(0x63696e70);
181 #[doc(alias = "kAudioServerPlugInIOOperationProcessInput")]
182 pub const ProcessInput: Self = Self(0x70696e70);
183 #[doc(alias = "kAudioServerPlugInIOOperationProcessOutput")]
184 pub const ProcessOutput: Self = Self(0x706f7574);
185 #[doc(alias = "kAudioServerPlugInIOOperationMixOutput")]
186 pub const MixOutput: Self = Self(0x6d69786f);
187 #[doc(alias = "kAudioServerPlugInIOOperationProcessMix")]
188 pub const ProcessMix: Self = Self(0x706d6978);
189 #[doc(alias = "kAudioServerPlugInIOOperationConvertMix")]
190 pub const ConvertMix: Self = Self(0x636d6978);
191 #[doc(alias = "kAudioServerPlugInIOOperationWriteMix")]
192 pub const WriteMix: Self = Self(0x72697465);
193}
194
195#[cfg(feature = "objc2")]
196unsafe impl Encode for AudioServerPlugInIOOperation {
197 const ENCODING: Encoding = u32::ENCODING;
198}
199
200#[cfg(feature = "objc2")]
201unsafe impl RefEncode for AudioServerPlugInIOOperation {
202 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
203}
204
205/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudioobjectpropertycustompropertyinfolist?language=objc)
206#[cfg(feature = "AudioHardware")]
207pub const kAudioObjectPropertyCustomPropertyInfoList: AudioObjectPropertySelector = 0x63757374;
208
209/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiopluginpropertyresourcebundle?language=objc)
210#[cfg(feature = "AudioHardware")]
211pub const kAudioPlugInPropertyResourceBundle: AudioObjectPropertySelector = 0x72737263;
212
213/// The valid values for kAudioDevicePropertyClockAlgorithm
214///
215/// When this value for the clock algorithm is specified, the Host will not
216/// apply any filtering to the time stamps returned from GetZeroTimeStamp(). The
217/// values will be used as-is.
218///
219/// When this value for the clock algorithm is specified, the Host applies a
220/// simple IIR filter to the time stamp stream. This is the default algorithm
221/// used for devices that don't implement kAudioDevicePropertyClockAlgorithm.
222///
223/// This clock algorithm uses a 12 point moving window average to filter the time
224/// stamps returned from GetZeroTimeStamp().
225///
226/// See also [Apple's documentation](https://developer.apple.com/documentation/coreaudio/audiodeviceclockalgorithmselector?language=objc)
227// NS_ENUM
228#[repr(transparent)]
229#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
230pub struct AudioDeviceClockAlgorithmSelector(pub u32);
231impl AudioDeviceClockAlgorithmSelector {
232 #[doc(alias = "kAudioDeviceClockAlgorithmRaw")]
233 pub const AlgorithmRaw: Self = Self(0x72617777);
234 #[doc(alias = "kAudioDeviceClockAlgorithmSimpleIIR")]
235 pub const AlgorithmSimpleIIR: Self = Self(0x69697266);
236 #[doc(alias = "kAudioDeviceClockAlgorithm12PtMovingWindowAverage")]
237 pub const Algorithm12PtMovingWindowAverage: Self = Self(0x6d617667);
238}
239
240#[cfg(feature = "objc2")]
241unsafe impl Encode for AudioDeviceClockAlgorithmSelector {
242 const ENCODING: Encoding = u32::ENCODING;
243}
244
245#[cfg(feature = "objc2")]
246unsafe impl RefEncode for AudioDeviceClockAlgorithmSelector {
247 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
248}
249
250/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyzerotimestampperiod?language=objc)
251#[cfg(feature = "AudioHardware")]
252pub const kAudioDevicePropertyZeroTimeStampPeriod: AudioObjectPropertySelector = 0x72696e67;
253/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclockalgorithm?language=objc)
254#[cfg(feature = "AudioHardware")]
255pub const kAudioDevicePropertyClockAlgorithm: AudioObjectPropertySelector = 0x636c6f6b;
256/// [Apple's documentation](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertyclockisstable?language=objc)
257#[cfg(feature = "AudioHardware")]
258pub const kAudioDevicePropertyClockIsStable: AudioObjectPropertySelector = 0x63737462;