1pub const true_: u32 = 1;
4pub const false_: u32 = 0;
5pub const __bool_true_false_are_defined: u32 = 1;
6pub const SOUNDIO_MAX_CHANNELS: u32 = 24;
7pub const SoundIoError_SoundIoErrorNone: SoundIoError = 0;
8#[doc = " Out of memory."]
9pub const SoundIoError_SoundIoErrorNoMem: SoundIoError = 1;
10#[doc = " The backend does not appear to be active or running."]
11pub const SoundIoError_SoundIoErrorInitAudioBackend: SoundIoError = 2;
12#[doc = " A system resource other than memory was not available."]
13pub const SoundIoError_SoundIoErrorSystemResources: SoundIoError = 3;
14#[doc = " Attempted to open a device and failed."]
15pub const SoundIoError_SoundIoErrorOpeningDevice: SoundIoError = 4;
16#[doc = " Attempted to open a device and failed."]
17pub const SoundIoError_SoundIoErrorNoSuchDevice: SoundIoError = 5;
18#[doc = " The programmer did not comply with the API."]
19pub const SoundIoError_SoundIoErrorInvalid: SoundIoError = 6;
20#[doc = " libsoundio was compiled without support for that backend."]
21pub const SoundIoError_SoundIoErrorBackendUnavailable: SoundIoError = 7;
22#[doc = " An open stream had an error that can only be recovered from by"]
23#[doc = " destroying the stream and creating it again."]
24pub const SoundIoError_SoundIoErrorStreaming: SoundIoError = 8;
25#[doc = " Attempted to use a device with parameters it cannot support."]
26pub const SoundIoError_SoundIoErrorIncompatibleDevice: SoundIoError = 9;
27#[doc = " When JACK returns `JackNoSuchClient`"]
28pub const SoundIoError_SoundIoErrorNoSuchClient: SoundIoError = 10;
29#[doc = " Attempted to use parameters that the backend cannot support."]
30pub const SoundIoError_SoundIoErrorIncompatibleBackend: SoundIoError = 11;
31#[doc = " Backend server shutdown or became inactive."]
32pub const SoundIoError_SoundIoErrorBackendDisconnected: SoundIoError = 12;
33#[doc = " Backend server shutdown or became inactive."]
34pub const SoundIoError_SoundIoErrorInterrupted: SoundIoError = 13;
35#[doc = " Buffer underrun occurred."]
36pub const SoundIoError_SoundIoErrorUnderflow: SoundIoError = 14;
37#[doc = " Unable to convert to or from UTF-8 to the native string format."]
38pub const SoundIoError_SoundIoErrorEncodingString: SoundIoError = 15;
39#[doc = " See also ::soundio_strerror"]
40pub type SoundIoError = ::std::os::raw::c_uint;
41pub const SoundIoChannelId_SoundIoChannelIdInvalid: SoundIoChannelId = 0;
42#[doc = "< First of the more commonly supported ids."]
43pub const SoundIoChannelId_SoundIoChannelIdFrontLeft: SoundIoChannelId = 1;
44pub const SoundIoChannelId_SoundIoChannelIdFrontRight: SoundIoChannelId = 2;
45pub const SoundIoChannelId_SoundIoChannelIdFrontCenter: SoundIoChannelId = 3;
46pub const SoundIoChannelId_SoundIoChannelIdLfe: SoundIoChannelId = 4;
47pub const SoundIoChannelId_SoundIoChannelIdBackLeft: SoundIoChannelId = 5;
48pub const SoundIoChannelId_SoundIoChannelIdBackRight: SoundIoChannelId = 6;
49pub const SoundIoChannelId_SoundIoChannelIdFrontLeftCenter: SoundIoChannelId = 7;
50pub const SoundIoChannelId_SoundIoChannelIdFrontRightCenter: SoundIoChannelId = 8;
51pub const SoundIoChannelId_SoundIoChannelIdBackCenter: SoundIoChannelId = 9;
52pub const SoundIoChannelId_SoundIoChannelIdSideLeft: SoundIoChannelId = 10;
53pub const SoundIoChannelId_SoundIoChannelIdSideRight: SoundIoChannelId = 11;
54pub const SoundIoChannelId_SoundIoChannelIdTopCenter: SoundIoChannelId = 12;
55pub const SoundIoChannelId_SoundIoChannelIdTopFrontLeft: SoundIoChannelId = 13;
56pub const SoundIoChannelId_SoundIoChannelIdTopFrontCenter: SoundIoChannelId = 14;
57pub const SoundIoChannelId_SoundIoChannelIdTopFrontRight: SoundIoChannelId = 15;
58pub const SoundIoChannelId_SoundIoChannelIdTopBackLeft: SoundIoChannelId = 16;
59pub const SoundIoChannelId_SoundIoChannelIdTopBackCenter: SoundIoChannelId = 17;
60#[doc = "< Last of the more commonly supported ids."]
61pub const SoundIoChannelId_SoundIoChannelIdTopBackRight: SoundIoChannelId = 18;
62#[doc = "< First of the less commonly supported ids."]
63pub const SoundIoChannelId_SoundIoChannelIdBackLeftCenter: SoundIoChannelId = 19;
64pub const SoundIoChannelId_SoundIoChannelIdBackRightCenter: SoundIoChannelId = 20;
65pub const SoundIoChannelId_SoundIoChannelIdFrontLeftWide: SoundIoChannelId = 21;
66pub const SoundIoChannelId_SoundIoChannelIdFrontRightWide: SoundIoChannelId = 22;
67pub const SoundIoChannelId_SoundIoChannelIdFrontLeftHigh: SoundIoChannelId = 23;
68pub const SoundIoChannelId_SoundIoChannelIdFrontCenterHigh: SoundIoChannelId = 24;
69pub const SoundIoChannelId_SoundIoChannelIdFrontRightHigh: SoundIoChannelId = 25;
70pub const SoundIoChannelId_SoundIoChannelIdTopFrontLeftCenter: SoundIoChannelId = 26;
71pub const SoundIoChannelId_SoundIoChannelIdTopFrontRightCenter: SoundIoChannelId = 27;
72pub const SoundIoChannelId_SoundIoChannelIdTopSideLeft: SoundIoChannelId = 28;
73pub const SoundIoChannelId_SoundIoChannelIdTopSideRight: SoundIoChannelId = 29;
74pub const SoundIoChannelId_SoundIoChannelIdLeftLfe: SoundIoChannelId = 30;
75pub const SoundIoChannelId_SoundIoChannelIdRightLfe: SoundIoChannelId = 31;
76pub const SoundIoChannelId_SoundIoChannelIdLfe2: SoundIoChannelId = 32;
77pub const SoundIoChannelId_SoundIoChannelIdBottomCenter: SoundIoChannelId = 33;
78pub const SoundIoChannelId_SoundIoChannelIdBottomLeftCenter: SoundIoChannelId = 34;
79pub const SoundIoChannelId_SoundIoChannelIdBottomRightCenter: SoundIoChannelId = 35;
80#[doc = " Mid/side recording"]
81pub const SoundIoChannelId_SoundIoChannelIdMsMid: SoundIoChannelId = 36;
82#[doc = " Mid/side recording"]
83pub const SoundIoChannelId_SoundIoChannelIdMsSide: SoundIoChannelId = 37;
84#[doc = " first order ambisonic channels"]
85pub const SoundIoChannelId_SoundIoChannelIdAmbisonicW: SoundIoChannelId = 38;
86#[doc = " first order ambisonic channels"]
87pub const SoundIoChannelId_SoundIoChannelIdAmbisonicX: SoundIoChannelId = 39;
88#[doc = " first order ambisonic channels"]
89pub const SoundIoChannelId_SoundIoChannelIdAmbisonicY: SoundIoChannelId = 40;
90#[doc = " first order ambisonic channels"]
91pub const SoundIoChannelId_SoundIoChannelIdAmbisonicZ: SoundIoChannelId = 41;
92#[doc = " X-Y Recording"]
93pub const SoundIoChannelId_SoundIoChannelIdXyX: SoundIoChannelId = 42;
94#[doc = " X-Y Recording"]
95pub const SoundIoChannelId_SoundIoChannelIdXyY: SoundIoChannelId = 43;
96#[doc = "< First of the \"other\" channel ids"]
97pub const SoundIoChannelId_SoundIoChannelIdHeadphonesLeft: SoundIoChannelId = 44;
98pub const SoundIoChannelId_SoundIoChannelIdHeadphonesRight: SoundIoChannelId = 45;
99pub const SoundIoChannelId_SoundIoChannelIdClickTrack: SoundIoChannelId = 46;
100pub const SoundIoChannelId_SoundIoChannelIdForeignLanguage: SoundIoChannelId = 47;
101pub const SoundIoChannelId_SoundIoChannelIdHearingImpaired: SoundIoChannelId = 48;
102pub const SoundIoChannelId_SoundIoChannelIdNarration: SoundIoChannelId = 49;
103pub const SoundIoChannelId_SoundIoChannelIdHaptic: SoundIoChannelId = 50;
104#[doc = "< Last of the \"other\" channel ids"]
105pub const SoundIoChannelId_SoundIoChannelIdDialogCentricMix: SoundIoChannelId = 51;
106pub const SoundIoChannelId_SoundIoChannelIdAux: SoundIoChannelId = 52;
107pub const SoundIoChannelId_SoundIoChannelIdAux0: SoundIoChannelId = 53;
108pub const SoundIoChannelId_SoundIoChannelIdAux1: SoundIoChannelId = 54;
109pub const SoundIoChannelId_SoundIoChannelIdAux2: SoundIoChannelId = 55;
110pub const SoundIoChannelId_SoundIoChannelIdAux3: SoundIoChannelId = 56;
111pub const SoundIoChannelId_SoundIoChannelIdAux4: SoundIoChannelId = 57;
112pub const SoundIoChannelId_SoundIoChannelIdAux5: SoundIoChannelId = 58;
113pub const SoundIoChannelId_SoundIoChannelIdAux6: SoundIoChannelId = 59;
114pub const SoundIoChannelId_SoundIoChannelIdAux7: SoundIoChannelId = 60;
115pub const SoundIoChannelId_SoundIoChannelIdAux8: SoundIoChannelId = 61;
116pub const SoundIoChannelId_SoundIoChannelIdAux9: SoundIoChannelId = 62;
117pub const SoundIoChannelId_SoundIoChannelIdAux10: SoundIoChannelId = 63;
118pub const SoundIoChannelId_SoundIoChannelIdAux11: SoundIoChannelId = 64;
119pub const SoundIoChannelId_SoundIoChannelIdAux12: SoundIoChannelId = 65;
120pub const SoundIoChannelId_SoundIoChannelIdAux13: SoundIoChannelId = 66;
121pub const SoundIoChannelId_SoundIoChannelIdAux14: SoundIoChannelId = 67;
122pub const SoundIoChannelId_SoundIoChannelIdAux15: SoundIoChannelId = 68;
123#[doc = " Specifies where a channel is physically located."]
124pub type SoundIoChannelId = ::std::os::raw::c_uint;
125pub const SoundIoChannelLayoutId_SoundIoChannelLayoutIdMono: SoundIoChannelLayoutId = 0;
126pub const SoundIoChannelLayoutId_SoundIoChannelLayoutIdStereo: SoundIoChannelLayoutId = 1;
127pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId2Point1: SoundIoChannelLayoutId = 2;
128pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId3Point0: SoundIoChannelLayoutId = 3;
129pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId3Point0Back: SoundIoChannelLayoutId = 4;
130pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId3Point1: SoundIoChannelLayoutId = 5;
131pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId4Point0: SoundIoChannelLayoutId = 6;
132pub const SoundIoChannelLayoutId_SoundIoChannelLayoutIdQuad: SoundIoChannelLayoutId = 7;
133pub const SoundIoChannelLayoutId_SoundIoChannelLayoutIdQuadSide: SoundIoChannelLayoutId = 8;
134pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId4Point1: SoundIoChannelLayoutId = 9;
135pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId5Point0Back: SoundIoChannelLayoutId = 10;
136pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId5Point0Side: SoundIoChannelLayoutId = 11;
137pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId5Point1: SoundIoChannelLayoutId = 12;
138pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId5Point1Back: SoundIoChannelLayoutId = 13;
139pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId6Point0Side: SoundIoChannelLayoutId = 14;
140pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId6Point0Front: SoundIoChannelLayoutId = 15;
141pub const SoundIoChannelLayoutId_SoundIoChannelLayoutIdHexagonal: SoundIoChannelLayoutId = 16;
142pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId6Point1: SoundIoChannelLayoutId = 17;
143pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId6Point1Back: SoundIoChannelLayoutId = 18;
144pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId6Point1Front: SoundIoChannelLayoutId = 19;
145pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId7Point0: SoundIoChannelLayoutId = 20;
146pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId7Point0Front: SoundIoChannelLayoutId = 21;
147pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId7Point1: SoundIoChannelLayoutId = 22;
148pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId7Point1Wide: SoundIoChannelLayoutId = 23;
149pub const SoundIoChannelLayoutId_SoundIoChannelLayoutId7Point1WideBack: SoundIoChannelLayoutId = 24;
150pub const SoundIoChannelLayoutId_SoundIoChannelLayoutIdOctagonal: SoundIoChannelLayoutId = 25;
151#[doc = " Built-in channel layouts for convenience."]
152pub type SoundIoChannelLayoutId = ::std::os::raw::c_uint;
153pub const SoundIoBackend_SoundIoBackendNone: SoundIoBackend = 0;
154pub const SoundIoBackend_SoundIoBackendJack: SoundIoBackend = 1;
155pub const SoundIoBackend_SoundIoBackendPulseAudio: SoundIoBackend = 2;
156pub const SoundIoBackend_SoundIoBackendAlsa: SoundIoBackend = 3;
157pub const SoundIoBackend_SoundIoBackendCoreAudio: SoundIoBackend = 4;
158pub const SoundIoBackend_SoundIoBackendWasapi: SoundIoBackend = 5;
159pub const SoundIoBackend_SoundIoBackendDummy: SoundIoBackend = 6;
160pub type SoundIoBackend = ::std::os::raw::c_uint;
161#[doc = "< capture / recording"]
162pub const SoundIoDeviceAim_SoundIoDeviceAimInput: SoundIoDeviceAim = 0;
163#[doc = "< playback"]
164pub const SoundIoDeviceAim_SoundIoDeviceAimOutput: SoundIoDeviceAim = 1;
165pub type SoundIoDeviceAim = ::std::os::raw::c_uint;
166pub const SoundIoFormat_SoundIoFormatInvalid: SoundIoFormat = 0;
167#[doc = "< Signed 8 bit"]
168pub const SoundIoFormat_SoundIoFormatS8: SoundIoFormat = 1;
169#[doc = "< Unsigned 8 bit"]
170pub const SoundIoFormat_SoundIoFormatU8: SoundIoFormat = 2;
171#[doc = "< Signed 16 bit Little Endian"]
172pub const SoundIoFormat_SoundIoFormatS16LE: SoundIoFormat = 3;
173#[doc = "< Signed 16 bit Big Endian"]
174pub const SoundIoFormat_SoundIoFormatS16BE: SoundIoFormat = 4;
175#[doc = "< Unsigned 16 bit Little Endian"]
176pub const SoundIoFormat_SoundIoFormatU16LE: SoundIoFormat = 5;
177#[doc = "< Unsigned 16 bit Big Endian"]
178pub const SoundIoFormat_SoundIoFormatU16BE: SoundIoFormat = 6;
179#[doc = "< Signed 24 bit Little Endian using low three bytes in 32-bit word"]
180pub const SoundIoFormat_SoundIoFormatS24LE: SoundIoFormat = 7;
181#[doc = "< Signed 24 bit Big Endian using low three bytes in 32-bit word"]
182pub const SoundIoFormat_SoundIoFormatS24BE: SoundIoFormat = 8;
183#[doc = "< Unsigned 24 bit Little Endian using low three bytes in 32-bit word"]
184pub const SoundIoFormat_SoundIoFormatU24LE: SoundIoFormat = 9;
185#[doc = "< Unsigned 24 bit Big Endian using low three bytes in 32-bit word"]
186pub const SoundIoFormat_SoundIoFormatU24BE: SoundIoFormat = 10;
187#[doc = "< Signed 32 bit Little Endian"]
188pub const SoundIoFormat_SoundIoFormatS32LE: SoundIoFormat = 11;
189#[doc = "< Signed 32 bit Big Endian"]
190pub const SoundIoFormat_SoundIoFormatS32BE: SoundIoFormat = 12;
191#[doc = "< Unsigned 32 bit Little Endian"]
192pub const SoundIoFormat_SoundIoFormatU32LE: SoundIoFormat = 13;
193#[doc = "< Unsigned 32 bit Big Endian"]
194pub const SoundIoFormat_SoundIoFormatU32BE: SoundIoFormat = 14;
195#[doc = "< Float 32 bit Little Endian, Range -1.0 to 1.0"]
196pub const SoundIoFormat_SoundIoFormatFloat32LE: SoundIoFormat = 15;
197#[doc = "< Float 32 bit Big Endian, Range -1.0 to 1.0"]
198pub const SoundIoFormat_SoundIoFormatFloat32BE: SoundIoFormat = 16;
199#[doc = "< Float 64 bit Little Endian, Range -1.0 to 1.0"]
200pub const SoundIoFormat_SoundIoFormatFloat64LE: SoundIoFormat = 17;
201#[doc = "< Float 64 bit Big Endian, Range -1.0 to 1.0"]
202pub const SoundIoFormat_SoundIoFormatFloat64BE: SoundIoFormat = 18;
203#[doc = " For your convenience, Native Endian and Foreign Endian constants are defined"]
204#[doc = " which point to the respective SoundIoFormat values."]
205pub type SoundIoFormat = ::std::os::raw::c_uint;
206#[doc = " The size of this struct is OK to use."]
207#[repr(C)]
208#[derive(Debug, Copy, Clone)]
209pub struct SoundIoChannelLayout {
210 pub name: *const ::std::os::raw::c_char,
211 pub channel_count: ::std::os::raw::c_int,
212 pub channels: [SoundIoChannelId; 24usize],
213}
214#[test]
215fn bindgen_test_layout_SoundIoChannelLayout() {
216 assert_eq!(
217 ::std::mem::size_of::<SoundIoChannelLayout>(),
218 112usize,
219 concat!("Size of: ", stringify!(SoundIoChannelLayout))
220 );
221 assert_eq!(
222 ::std::mem::align_of::<SoundIoChannelLayout>(),
223 8usize,
224 concat!("Alignment of ", stringify!(SoundIoChannelLayout))
225 );
226 assert_eq!(
227 unsafe { &(*(::std::ptr::null::<SoundIoChannelLayout>())).name as *const _ as usize },
228 0usize,
229 concat!(
230 "Offset of field: ",
231 stringify!(SoundIoChannelLayout),
232 "::",
233 stringify!(name)
234 )
235 );
236 assert_eq!(
237 unsafe {
238 &(*(::std::ptr::null::<SoundIoChannelLayout>())).channel_count as *const _ as usize
239 },
240 8usize,
241 concat!(
242 "Offset of field: ",
243 stringify!(SoundIoChannelLayout),
244 "::",
245 stringify!(channel_count)
246 )
247 );
248 assert_eq!(
249 unsafe { &(*(::std::ptr::null::<SoundIoChannelLayout>())).channels as *const _ as usize },
250 12usize,
251 concat!(
252 "Offset of field: ",
253 stringify!(SoundIoChannelLayout),
254 "::",
255 stringify!(channels)
256 )
257 );
258}
259#[doc = " The size of this struct is OK to use."]
260#[repr(C)]
261#[derive(Debug, Copy, Clone)]
262pub struct SoundIoSampleRateRange {
263 pub min: ::std::os::raw::c_int,
264 pub max: ::std::os::raw::c_int,
265}
266#[test]
267fn bindgen_test_layout_SoundIoSampleRateRange() {
268 assert_eq!(
269 ::std::mem::size_of::<SoundIoSampleRateRange>(),
270 8usize,
271 concat!("Size of: ", stringify!(SoundIoSampleRateRange))
272 );
273 assert_eq!(
274 ::std::mem::align_of::<SoundIoSampleRateRange>(),
275 4usize,
276 concat!("Alignment of ", stringify!(SoundIoSampleRateRange))
277 );
278 assert_eq!(
279 unsafe { &(*(::std::ptr::null::<SoundIoSampleRateRange>())).min as *const _ as usize },
280 0usize,
281 concat!(
282 "Offset of field: ",
283 stringify!(SoundIoSampleRateRange),
284 "::",
285 stringify!(min)
286 )
287 );
288 assert_eq!(
289 unsafe { &(*(::std::ptr::null::<SoundIoSampleRateRange>())).max as *const _ as usize },
290 4usize,
291 concat!(
292 "Offset of field: ",
293 stringify!(SoundIoSampleRateRange),
294 "::",
295 stringify!(max)
296 )
297 );
298}
299#[doc = " The size of this struct is OK to use."]
300#[repr(C)]
301#[derive(Debug, Copy, Clone)]
302pub struct SoundIoChannelArea {
303 #[doc = " Base address of buffer."]
304 pub ptr: *mut ::std::os::raw::c_char,
305 #[doc = " How many bytes it takes to get from the beginning of one sample to"]
306 #[doc = " the beginning of the next sample."]
307 pub step: ::std::os::raw::c_int,
308}
309#[test]
310fn bindgen_test_layout_SoundIoChannelArea() {
311 assert_eq!(
312 ::std::mem::size_of::<SoundIoChannelArea>(),
313 16usize,
314 concat!("Size of: ", stringify!(SoundIoChannelArea))
315 );
316 assert_eq!(
317 ::std::mem::align_of::<SoundIoChannelArea>(),
318 8usize,
319 concat!("Alignment of ", stringify!(SoundIoChannelArea))
320 );
321 assert_eq!(
322 unsafe { &(*(::std::ptr::null::<SoundIoChannelArea>())).ptr as *const _ as usize },
323 0usize,
324 concat!(
325 "Offset of field: ",
326 stringify!(SoundIoChannelArea),
327 "::",
328 stringify!(ptr)
329 )
330 );
331 assert_eq!(
332 unsafe { &(*(::std::ptr::null::<SoundIoChannelArea>())).step as *const _ as usize },
333 8usize,
334 concat!(
335 "Offset of field: ",
336 stringify!(SoundIoChannelArea),
337 "::",
338 stringify!(step)
339 )
340 );
341}
342#[doc = " The size of this struct is not part of the API or ABI."]
343#[repr(C)]
344#[derive(Debug, Copy, Clone)]
345pub struct SoundIo {
346 #[doc = " Optional. Put whatever you want here. Defaults to NULL."]
347 pub userdata: *mut ::std::os::raw::c_void,
348 #[doc = " Optional callback. Called when the list of devices change. Only called"]
349 #[doc = " during a call to ::soundio_flush_events or ::soundio_wait_events."]
350 pub on_devices_change: ::std::option::Option<unsafe extern "C" fn(arg1: *mut SoundIo)>,
351 #[doc = " Optional callback. Called when the backend disconnects. For example,"]
352 #[doc = " when the JACK server shuts down. When this happens, listing devices"]
353 #[doc = " and opening streams will always fail with"]
354 #[doc = " SoundIoErrorBackendDisconnected. This callback is only called during a"]
355 #[doc = " call to ::soundio_flush_events or ::soundio_wait_events."]
356 #[doc = " If you do not supply a callback, the default will crash your program"]
357 #[doc = " with an error message. This callback is also called when the thread"]
358 #[doc = " that retrieves device information runs into an unrecoverable condition"]
359 #[doc = " such as running out of memory."]
360 #[doc = ""]
361 #[doc = " Possible errors:"]
362 #[doc = " * #SoundIoErrorBackendDisconnected"]
363 #[doc = " * #SoundIoErrorNoMem"]
364 #[doc = " * #SoundIoErrorSystemResources"]
365 #[doc = " * #SoundIoErrorOpeningDevice - unexpected problem accessing device"]
366 #[doc = " information"]
367 pub on_backend_disconnect:
368 ::std::option::Option<unsafe extern "C" fn(arg1: *mut SoundIo, err: ::std::os::raw::c_int)>,
369 #[doc = " Optional callback. Called from an unknown thread that you should not use"]
370 #[doc = " to call any soundio functions. You may use this to signal a condition"]
371 #[doc = " variable to wake up. Called when ::soundio_wait_events would be woken up."]
372 pub on_events_signal: ::std::option::Option<unsafe extern "C" fn(arg1: *mut SoundIo)>,
373 #[doc = " Read-only. After calling ::soundio_connect or ::soundio_connect_backend,"]
374 #[doc = " this field tells which backend is currently connected."]
375 pub current_backend: SoundIoBackend,
376 #[doc = " Optional: Application name."]
377 #[doc = " PulseAudio uses this for \"application name\"."]
378 #[doc = " JACK uses this for `client_name`."]
379 #[doc = " Must not contain a colon (\":\")."]
380 pub app_name: *const ::std::os::raw::c_char,
381 #[doc = " Optional: Real time priority warning."]
382 #[doc = " This callback is fired when making thread real-time priority failed. By"]
383 #[doc = " default, it will print to stderr only the first time it is called"]
384 #[doc = " a message instructing the user how to configure their system to allow"]
385 #[doc = " real-time priority threads. This must be set to a function not NULL."]
386 #[doc = " To silence the warning, assign this to a function that does nothing."]
387 pub emit_rtprio_warning: ::std::option::Option<unsafe extern "C" fn()>,
388 #[doc = " Optional: JACK info callback."]
389 #[doc = " By default, libsoundio sets this to an empty function in order to"]
390 #[doc = " silence stdio messages from JACK. You may override the behavior by"]
391 #[doc = " setting this to `NULL` or providing your own function. This is"]
392 #[doc = " registered with JACK regardless of whether ::soundio_connect_backend"]
393 #[doc = " succeeds."]
394 pub jack_info_callback:
395 ::std::option::Option<unsafe extern "C" fn(msg: *const ::std::os::raw::c_char)>,
396 #[doc = " Optional: JACK error callback."]
397 #[doc = " See SoundIo::jack_info_callback"]
398 pub jack_error_callback:
399 ::std::option::Option<unsafe extern "C" fn(msg: *const ::std::os::raw::c_char)>,
400}
401#[test]
402fn bindgen_test_layout_SoundIo() {
403 assert_eq!(
404 ::std::mem::size_of::<SoundIo>(),
405 72usize,
406 concat!("Size of: ", stringify!(SoundIo))
407 );
408 assert_eq!(
409 ::std::mem::align_of::<SoundIo>(),
410 8usize,
411 concat!("Alignment of ", stringify!(SoundIo))
412 );
413 assert_eq!(
414 unsafe { &(*(::std::ptr::null::<SoundIo>())).userdata as *const _ as usize },
415 0usize,
416 concat!(
417 "Offset of field: ",
418 stringify!(SoundIo),
419 "::",
420 stringify!(userdata)
421 )
422 );
423 assert_eq!(
424 unsafe { &(*(::std::ptr::null::<SoundIo>())).on_devices_change as *const _ as usize },
425 8usize,
426 concat!(
427 "Offset of field: ",
428 stringify!(SoundIo),
429 "::",
430 stringify!(on_devices_change)
431 )
432 );
433 assert_eq!(
434 unsafe { &(*(::std::ptr::null::<SoundIo>())).on_backend_disconnect as *const _ as usize },
435 16usize,
436 concat!(
437 "Offset of field: ",
438 stringify!(SoundIo),
439 "::",
440 stringify!(on_backend_disconnect)
441 )
442 );
443 assert_eq!(
444 unsafe { &(*(::std::ptr::null::<SoundIo>())).on_events_signal as *const _ as usize },
445 24usize,
446 concat!(
447 "Offset of field: ",
448 stringify!(SoundIo),
449 "::",
450 stringify!(on_events_signal)
451 )
452 );
453 assert_eq!(
454 unsafe { &(*(::std::ptr::null::<SoundIo>())).current_backend as *const _ as usize },
455 32usize,
456 concat!(
457 "Offset of field: ",
458 stringify!(SoundIo),
459 "::",
460 stringify!(current_backend)
461 )
462 );
463 assert_eq!(
464 unsafe { &(*(::std::ptr::null::<SoundIo>())).app_name as *const _ as usize },
465 40usize,
466 concat!(
467 "Offset of field: ",
468 stringify!(SoundIo),
469 "::",
470 stringify!(app_name)
471 )
472 );
473 assert_eq!(
474 unsafe { &(*(::std::ptr::null::<SoundIo>())).emit_rtprio_warning as *const _ as usize },
475 48usize,
476 concat!(
477 "Offset of field: ",
478 stringify!(SoundIo),
479 "::",
480 stringify!(emit_rtprio_warning)
481 )
482 );
483 assert_eq!(
484 unsafe { &(*(::std::ptr::null::<SoundIo>())).jack_info_callback as *const _ as usize },
485 56usize,
486 concat!(
487 "Offset of field: ",
488 stringify!(SoundIo),
489 "::",
490 stringify!(jack_info_callback)
491 )
492 );
493 assert_eq!(
494 unsafe { &(*(::std::ptr::null::<SoundIo>())).jack_error_callback as *const _ as usize },
495 64usize,
496 concat!(
497 "Offset of field: ",
498 stringify!(SoundIo),
499 "::",
500 stringify!(jack_error_callback)
501 )
502 );
503}
504#[doc = " The size of this struct is not part of the API or ABI."]
505#[repr(C)]
506#[derive(Debug, Copy, Clone)]
507pub struct SoundIoDevice {
508 #[doc = " Read-only. Set automatically."]
509 pub soundio: *mut SoundIo,
510 #[doc = " A string of bytes that uniquely identifies this device."]
511 #[doc = " If the same physical device supports both input and output, that makes"]
512 #[doc = " one SoundIoDevice for the input and one SoundIoDevice for the output."]
513 #[doc = " In this case, the id of each SoundIoDevice will be the same, and"]
514 #[doc = " SoundIoDevice::aim will be different. Additionally, if the device"]
515 #[doc = " supports raw mode, there may be up to four devices with the same id:"]
516 #[doc = " one for each value of SoundIoDevice::is_raw and one for each value of"]
517 #[doc = " SoundIoDevice::aim."]
518 pub id: *mut ::std::os::raw::c_char,
519 #[doc = " User-friendly UTF-8 encoded text to describe the device."]
520 pub name: *mut ::std::os::raw::c_char,
521 #[doc = " Tells whether this device is an input device or an output device."]
522 pub aim: SoundIoDeviceAim,
523 #[doc = " Channel layouts are handled similarly to SoundIoDevice::formats."]
524 #[doc = " If this information is missing due to a SoundIoDevice::probe_error,"]
525 #[doc = " layouts will be NULL. It's OK to modify this data, for example calling"]
526 #[doc = " ::soundio_sort_channel_layouts on it."]
527 #[doc = " Devices are guaranteed to have at least 1 channel layout."]
528 pub layouts: *mut SoundIoChannelLayout,
529 pub layout_count: ::std::os::raw::c_int,
530 #[doc = " See SoundIoDevice::current_format"]
531 pub current_layout: SoundIoChannelLayout,
532 #[doc = " List of formats this device supports. See also"]
533 #[doc = " SoundIoDevice::current_format."]
534 pub formats: *mut SoundIoFormat,
535 #[doc = " How many formats are available in SoundIoDevice::formats."]
536 pub format_count: ::std::os::raw::c_int,
537 #[doc = " A device is either a raw device or it is a virtual device that is"]
538 #[doc = " provided by a software mixing service such as dmix or PulseAudio (see"]
539 #[doc = " SoundIoDevice::is_raw). If it is a raw device,"]
540 #[doc = " current_format is meaningless;"]
541 #[doc = " the device has no current format until you open it. On the other hand,"]
542 #[doc = " if it is a virtual device, current_format describes the"]
543 #[doc = " destination sample format that your audio will be converted to. Or,"]
544 #[doc = " if you're the lucky first application to open the device, you might"]
545 #[doc = " cause the current_format to change to your format."]
546 #[doc = " Generally, you want to ignore current_format and use"]
547 #[doc = " whatever format is most convenient"]
548 #[doc = " for you which is supported by the device, because when you are the only"]
549 #[doc = " application left, the mixer might decide to switch"]
550 #[doc = " current_format to yours. You can learn the supported formats via"]
551 #[doc = " formats and SoundIoDevice::format_count. If this information is missing"]
552 #[doc = " due to a probe error, formats will be `NULL`. If current_format is"]
553 #[doc = " unavailable, it will be set to #SoundIoFormatInvalid."]
554 #[doc = " Devices are guaranteed to have at least 1 format available."]
555 pub current_format: SoundIoFormat,
556 #[doc = " Sample rate is the number of frames per second."]
557 #[doc = " Sample rate is handled very similar to SoundIoDevice::formats."]
558 #[doc = " If sample rate information is missing due to a probe error, the field"]
559 #[doc = " will be set to NULL."]
560 #[doc = " Devices which have SoundIoDevice::probe_error set to #SoundIoErrorNone are"]
561 #[doc = " guaranteed to have at least 1 sample rate available."]
562 pub sample_rates: *mut SoundIoSampleRateRange,
563 #[doc = " How many sample rate ranges are available in"]
564 #[doc = " SoundIoDevice::sample_rates. 0 if sample rate information is missing"]
565 #[doc = " due to a probe error."]
566 pub sample_rate_count: ::std::os::raw::c_int,
567 #[doc = " See SoundIoDevice::current_format"]
568 #[doc = " 0 if sample rate information is missing due to a probe error."]
569 pub sample_rate_current: ::std::os::raw::c_int,
570 #[doc = " Software latency minimum in seconds. If this value is unknown or"]
571 #[doc = " irrelevant, it is set to 0.0."]
572 #[doc = " For PulseAudio and WASAPI this value is unknown until you open a"]
573 #[doc = " stream."]
574 pub software_latency_min: f64,
575 #[doc = " Software latency maximum in seconds. If this value is unknown or"]
576 #[doc = " irrelevant, it is set to 0.0."]
577 #[doc = " For PulseAudio and WASAPI this value is unknown until you open a"]
578 #[doc = " stream."]
579 pub software_latency_max: f64,
580 #[doc = " Software latency in seconds. If this value is unknown or"]
581 #[doc = " irrelevant, it is set to 0.0."]
582 #[doc = " For PulseAudio and WASAPI this value is unknown until you open a"]
583 #[doc = " stream."]
584 #[doc = " See SoundIoDevice::current_format"]
585 pub software_latency_current: f64,
586 #[doc = " Raw means that you are directly opening the hardware device and not"]
587 #[doc = " going through a proxy such as dmix, PulseAudio, or JACK. When you open a"]
588 #[doc = " raw device, other applications on the computer are not able to"]
589 #[doc = " simultaneously access the device. Raw devices do not perform automatic"]
590 #[doc = " resampling and thus tend to have fewer formats available."]
591 pub is_raw: bool,
592 #[doc = " Devices are reference counted. See ::soundio_device_ref and"]
593 #[doc = " ::soundio_device_unref."]
594 pub ref_count: ::std::os::raw::c_int,
595 #[doc = " This is set to a SoundIoError representing the result of the device"]
596 #[doc = " probe. Ideally this will be SoundIoErrorNone in which case all the"]
597 #[doc = " fields of the device will be populated. If there is an error code here"]
598 #[doc = " then information about formats, sample rates, and channel layouts might"]
599 #[doc = " be missing."]
600 #[doc = ""]
601 #[doc = " Possible errors:"]
602 #[doc = " * #SoundIoErrorOpeningDevice"]
603 #[doc = " * #SoundIoErrorNoMem"]
604 pub probe_error: ::std::os::raw::c_int,
605}
606#[test]
607fn bindgen_test_layout_SoundIoDevice() {
608 assert_eq!(
609 ::std::mem::size_of::<SoundIoDevice>(),
610 232usize,
611 concat!("Size of: ", stringify!(SoundIoDevice))
612 );
613 assert_eq!(
614 ::std::mem::align_of::<SoundIoDevice>(),
615 8usize,
616 concat!("Alignment of ", stringify!(SoundIoDevice))
617 );
618 assert_eq!(
619 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).soundio as *const _ as usize },
620 0usize,
621 concat!(
622 "Offset of field: ",
623 stringify!(SoundIoDevice),
624 "::",
625 stringify!(soundio)
626 )
627 );
628 assert_eq!(
629 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).id as *const _ as usize },
630 8usize,
631 concat!(
632 "Offset of field: ",
633 stringify!(SoundIoDevice),
634 "::",
635 stringify!(id)
636 )
637 );
638 assert_eq!(
639 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).name as *const _ as usize },
640 16usize,
641 concat!(
642 "Offset of field: ",
643 stringify!(SoundIoDevice),
644 "::",
645 stringify!(name)
646 )
647 );
648 assert_eq!(
649 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).aim as *const _ as usize },
650 24usize,
651 concat!(
652 "Offset of field: ",
653 stringify!(SoundIoDevice),
654 "::",
655 stringify!(aim)
656 )
657 );
658 assert_eq!(
659 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).layouts as *const _ as usize },
660 32usize,
661 concat!(
662 "Offset of field: ",
663 stringify!(SoundIoDevice),
664 "::",
665 stringify!(layouts)
666 )
667 );
668 assert_eq!(
669 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).layout_count as *const _ as usize },
670 40usize,
671 concat!(
672 "Offset of field: ",
673 stringify!(SoundIoDevice),
674 "::",
675 stringify!(layout_count)
676 )
677 );
678 assert_eq!(
679 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).current_layout as *const _ as usize },
680 48usize,
681 concat!(
682 "Offset of field: ",
683 stringify!(SoundIoDevice),
684 "::",
685 stringify!(current_layout)
686 )
687 );
688 assert_eq!(
689 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).formats as *const _ as usize },
690 160usize,
691 concat!(
692 "Offset of field: ",
693 stringify!(SoundIoDevice),
694 "::",
695 stringify!(formats)
696 )
697 );
698 assert_eq!(
699 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).format_count as *const _ as usize },
700 168usize,
701 concat!(
702 "Offset of field: ",
703 stringify!(SoundIoDevice),
704 "::",
705 stringify!(format_count)
706 )
707 );
708 assert_eq!(
709 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).current_format as *const _ as usize },
710 172usize,
711 concat!(
712 "Offset of field: ",
713 stringify!(SoundIoDevice),
714 "::",
715 stringify!(current_format)
716 )
717 );
718 assert_eq!(
719 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).sample_rates as *const _ as usize },
720 176usize,
721 concat!(
722 "Offset of field: ",
723 stringify!(SoundIoDevice),
724 "::",
725 stringify!(sample_rates)
726 )
727 );
728 assert_eq!(
729 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).sample_rate_count as *const _ as usize },
730 184usize,
731 concat!(
732 "Offset of field: ",
733 stringify!(SoundIoDevice),
734 "::",
735 stringify!(sample_rate_count)
736 )
737 );
738 assert_eq!(
739 unsafe {
740 &(*(::std::ptr::null::<SoundIoDevice>())).sample_rate_current as *const _ as usize
741 },
742 188usize,
743 concat!(
744 "Offset of field: ",
745 stringify!(SoundIoDevice),
746 "::",
747 stringify!(sample_rate_current)
748 )
749 );
750 assert_eq!(
751 unsafe {
752 &(*(::std::ptr::null::<SoundIoDevice>())).software_latency_min as *const _ as usize
753 },
754 192usize,
755 concat!(
756 "Offset of field: ",
757 stringify!(SoundIoDevice),
758 "::",
759 stringify!(software_latency_min)
760 )
761 );
762 assert_eq!(
763 unsafe {
764 &(*(::std::ptr::null::<SoundIoDevice>())).software_latency_max as *const _ as usize
765 },
766 200usize,
767 concat!(
768 "Offset of field: ",
769 stringify!(SoundIoDevice),
770 "::",
771 stringify!(software_latency_max)
772 )
773 );
774 assert_eq!(
775 unsafe {
776 &(*(::std::ptr::null::<SoundIoDevice>())).software_latency_current as *const _ as usize
777 },
778 208usize,
779 concat!(
780 "Offset of field: ",
781 stringify!(SoundIoDevice),
782 "::",
783 stringify!(software_latency_current)
784 )
785 );
786 assert_eq!(
787 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).is_raw as *const _ as usize },
788 216usize,
789 concat!(
790 "Offset of field: ",
791 stringify!(SoundIoDevice),
792 "::",
793 stringify!(is_raw)
794 )
795 );
796 assert_eq!(
797 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).ref_count as *const _ as usize },
798 220usize,
799 concat!(
800 "Offset of field: ",
801 stringify!(SoundIoDevice),
802 "::",
803 stringify!(ref_count)
804 )
805 );
806 assert_eq!(
807 unsafe { &(*(::std::ptr::null::<SoundIoDevice>())).probe_error as *const _ as usize },
808 224usize,
809 concat!(
810 "Offset of field: ",
811 stringify!(SoundIoDevice),
812 "::",
813 stringify!(probe_error)
814 )
815 );
816}
817#[doc = " The size of this struct is not part of the API or ABI."]
818#[repr(C)]
819#[derive(Debug, Copy, Clone)]
820pub struct SoundIoOutStream {
821 #[doc = " Populated automatically when you call ::soundio_outstream_create."]
822 pub device: *mut SoundIoDevice,
823 #[doc = " Defaults to #SoundIoFormatFloat32NE, followed by the first one"]
824 #[doc = " supported."]
825 pub format: SoundIoFormat,
826 #[doc = " Sample rate is the number of frames per second."]
827 #[doc = " Defaults to 48000 (and then clamped into range)."]
828 pub sample_rate: ::std::os::raw::c_int,
829 #[doc = " Defaults to Stereo, if available, followed by the first layout"]
830 #[doc = " supported."]
831 pub layout: SoundIoChannelLayout,
832 #[doc = " Ignoring hardware latency, this is the number of seconds it takes for"]
833 #[doc = " the last sample in a full buffer to be played."]
834 #[doc = " After you call ::soundio_outstream_open, this value is replaced with the"]
835 #[doc = " actual software latency, as near to this value as possible."]
836 #[doc = " On systems that support clearing the buffer, this defaults to a large"]
837 #[doc = " latency, potentially upwards of 2 seconds, with the understanding that"]
838 #[doc = " you will call ::soundio_outstream_clear_buffer when you want to reduce"]
839 #[doc = " the latency to 0. On systems that do not support clearing the buffer,"]
840 #[doc = " this defaults to a reasonable lower latency value."]
841 #[doc = ""]
842 #[doc = " On backends with high latencies (such as 2 seconds), `frame_count_min`"]
843 #[doc = " will be 0, meaning you don't have to fill the entire buffer. In this"]
844 #[doc = " case, the large buffer is there if you want it; you only have to fill"]
845 #[doc = " as much as you want. On backends like JACK, `frame_count_min` will be"]
846 #[doc = " equal to `frame_count_max` and if you don't fill that many frames, you"]
847 #[doc = " will get glitches."]
848 #[doc = ""]
849 #[doc = " If the device has unknown software latency min and max values, you may"]
850 #[doc = " still set this, but you might not get the value you requested."]
851 #[doc = " For PulseAudio, if you set this value to non-default, it sets"]
852 #[doc = " `PA_STREAM_ADJUST_LATENCY` and is the value used for `maxlength` and"]
853 #[doc = " `tlength`."]
854 #[doc = ""]
855 #[doc = " For JACK, this value is always equal to"]
856 #[doc = " SoundIoDevice::software_latency_current of the device."]
857 pub software_latency: f64,
858 #[doc = " Core Audio and WASAPI only: current output Audio Unit volume. Float, 0.0-1.0."]
859 pub volume: f32,
860 #[doc = " Defaults to NULL. Put whatever you want here."]
861 pub userdata: *mut ::std::os::raw::c_void,
862 #[doc = " In this callback, you call ::soundio_outstream_begin_write and"]
863 #[doc = " ::soundio_outstream_end_write as many times as necessary to write"]
864 #[doc = " at minimum `frame_count_min` frames and at maximum `frame_count_max`"]
865 #[doc = " frames. `frame_count_max` will always be greater than 0. Note that you"]
866 #[doc = " should write as many frames as you can; `frame_count_min` might be 0 and"]
867 #[doc = " you can still get a buffer underflow if you always write"]
868 #[doc = " `frame_count_min` frames."]
869 #[doc = ""]
870 #[doc = " For Dummy, ALSA, and PulseAudio, `frame_count_min` will be 0. For JACK"]
871 #[doc = " and CoreAudio `frame_count_min` will be equal to `frame_count_max`."]
872 #[doc = ""]
873 #[doc = " The code in the supplied function must be suitable for real-time"]
874 #[doc = " execution. That means that it cannot call functions that might block"]
875 #[doc = " for a long time. This includes all I/O functions (disk, TTY, network),"]
876 #[doc = " malloc, free, printf, pthread_mutex_lock, sleep, wait, poll, select,"]
877 #[doc = " pthread_join, pthread_cond_wait, etc."]
878 pub write_callback: ::std::option::Option<
879 unsafe extern "C" fn(
880 arg1: *mut SoundIoOutStream,
881 frame_count_min: ::std::os::raw::c_int,
882 frame_count_max: ::std::os::raw::c_int,
883 ),
884 >,
885 #[doc = " This optional callback happens when the sound device runs out of"]
886 #[doc = " buffered audio data to play. After this occurs, the outstream waits"]
887 #[doc = " until the buffer is full to resume playback."]
888 #[doc = " This is called from the SoundIoOutStream::write_callback thread context."]
889 pub underflow_callback:
890 ::std::option::Option<unsafe extern "C" fn(arg1: *mut SoundIoOutStream)>,
891 #[doc = " Optional callback. `err` is always SoundIoErrorStreaming."]
892 #[doc = " SoundIoErrorStreaming is an unrecoverable error. The stream is in an"]
893 #[doc = " invalid state and must be destroyed."]
894 #[doc = " If you do not supply error_callback, the default callback will print"]
895 #[doc = " a message to stderr and then call `abort`."]
896 #[doc = " This is called from the SoundIoOutStream::write_callback thread context."]
897 pub error_callback: ::std::option::Option<
898 unsafe extern "C" fn(arg1: *mut SoundIoOutStream, err: ::std::os::raw::c_int),
899 >,
900 #[doc = " Optional: Name of the stream. Defaults to \"SoundIoOutStream\""]
901 #[doc = " PulseAudio uses this for the stream name."]
902 #[doc = " JACK uses this for the client name of the client that connects when you"]
903 #[doc = " open the stream."]
904 #[doc = " WASAPI uses this for the session display name."]
905 #[doc = " Must not contain a colon (\":\")."]
906 pub name: *const ::std::os::raw::c_char,
907 #[doc = " Optional: Hint that this output stream is nonterminal. This is used by"]
908 #[doc = " JACK and it means that the output stream data originates from an input"]
909 #[doc = " stream. Defaults to `false`."]
910 pub non_terminal_hint: bool,
911 #[doc = " computed automatically when you call ::soundio_outstream_open"]
912 pub bytes_per_frame: ::std::os::raw::c_int,
913 #[doc = " computed automatically when you call ::soundio_outstream_open"]
914 pub bytes_per_sample: ::std::os::raw::c_int,
915 #[doc = " If setting the channel layout fails for some reason, this field is set"]
916 #[doc = " to an error code. Possible error codes are:"]
917 #[doc = " * #SoundIoErrorIncompatibleDevice"]
918 pub layout_error: ::std::os::raw::c_int,
919}
920#[test]
921fn bindgen_test_layout_SoundIoOutStream() {
922 assert_eq!(
923 ::std::mem::size_of::<SoundIoOutStream>(),
924 200usize,
925 concat!("Size of: ", stringify!(SoundIoOutStream))
926 );
927 assert_eq!(
928 ::std::mem::align_of::<SoundIoOutStream>(),
929 8usize,
930 concat!("Alignment of ", stringify!(SoundIoOutStream))
931 );
932 assert_eq!(
933 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).device as *const _ as usize },
934 0usize,
935 concat!(
936 "Offset of field: ",
937 stringify!(SoundIoOutStream),
938 "::",
939 stringify!(device)
940 )
941 );
942 assert_eq!(
943 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).format as *const _ as usize },
944 8usize,
945 concat!(
946 "Offset of field: ",
947 stringify!(SoundIoOutStream),
948 "::",
949 stringify!(format)
950 )
951 );
952 assert_eq!(
953 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).sample_rate as *const _ as usize },
954 12usize,
955 concat!(
956 "Offset of field: ",
957 stringify!(SoundIoOutStream),
958 "::",
959 stringify!(sample_rate)
960 )
961 );
962 assert_eq!(
963 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).layout as *const _ as usize },
964 16usize,
965 concat!(
966 "Offset of field: ",
967 stringify!(SoundIoOutStream),
968 "::",
969 stringify!(layout)
970 )
971 );
972 assert_eq!(
973 unsafe {
974 &(*(::std::ptr::null::<SoundIoOutStream>())).software_latency as *const _ as usize
975 },
976 128usize,
977 concat!(
978 "Offset of field: ",
979 stringify!(SoundIoOutStream),
980 "::",
981 stringify!(software_latency)
982 )
983 );
984 assert_eq!(
985 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).volume as *const _ as usize },
986 136usize,
987 concat!(
988 "Offset of field: ",
989 stringify!(SoundIoOutStream),
990 "::",
991 stringify!(volume)
992 )
993 );
994 assert_eq!(
995 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).userdata as *const _ as usize },
996 144usize,
997 concat!(
998 "Offset of field: ",
999 stringify!(SoundIoOutStream),
1000 "::",
1001 stringify!(userdata)
1002 )
1003 );
1004 assert_eq!(
1005 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).write_callback as *const _ as usize },
1006 152usize,
1007 concat!(
1008 "Offset of field: ",
1009 stringify!(SoundIoOutStream),
1010 "::",
1011 stringify!(write_callback)
1012 )
1013 );
1014 assert_eq!(
1015 unsafe {
1016 &(*(::std::ptr::null::<SoundIoOutStream>())).underflow_callback as *const _ as usize
1017 },
1018 160usize,
1019 concat!(
1020 "Offset of field: ",
1021 stringify!(SoundIoOutStream),
1022 "::",
1023 stringify!(underflow_callback)
1024 )
1025 );
1026 assert_eq!(
1027 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).error_callback as *const _ as usize },
1028 168usize,
1029 concat!(
1030 "Offset of field: ",
1031 stringify!(SoundIoOutStream),
1032 "::",
1033 stringify!(error_callback)
1034 )
1035 );
1036 assert_eq!(
1037 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).name as *const _ as usize },
1038 176usize,
1039 concat!(
1040 "Offset of field: ",
1041 stringify!(SoundIoOutStream),
1042 "::",
1043 stringify!(name)
1044 )
1045 );
1046 assert_eq!(
1047 unsafe {
1048 &(*(::std::ptr::null::<SoundIoOutStream>())).non_terminal_hint as *const _ as usize
1049 },
1050 184usize,
1051 concat!(
1052 "Offset of field: ",
1053 stringify!(SoundIoOutStream),
1054 "::",
1055 stringify!(non_terminal_hint)
1056 )
1057 );
1058 assert_eq!(
1059 unsafe {
1060 &(*(::std::ptr::null::<SoundIoOutStream>())).bytes_per_frame as *const _ as usize
1061 },
1062 188usize,
1063 concat!(
1064 "Offset of field: ",
1065 stringify!(SoundIoOutStream),
1066 "::",
1067 stringify!(bytes_per_frame)
1068 )
1069 );
1070 assert_eq!(
1071 unsafe {
1072 &(*(::std::ptr::null::<SoundIoOutStream>())).bytes_per_sample as *const _ as usize
1073 },
1074 192usize,
1075 concat!(
1076 "Offset of field: ",
1077 stringify!(SoundIoOutStream),
1078 "::",
1079 stringify!(bytes_per_sample)
1080 )
1081 );
1082 assert_eq!(
1083 unsafe { &(*(::std::ptr::null::<SoundIoOutStream>())).layout_error as *const _ as usize },
1084 196usize,
1085 concat!(
1086 "Offset of field: ",
1087 stringify!(SoundIoOutStream),
1088 "::",
1089 stringify!(layout_error)
1090 )
1091 );
1092}
1093#[doc = " The size of this struct is not part of the API or ABI."]
1094#[repr(C)]
1095#[derive(Debug, Copy, Clone)]
1096pub struct SoundIoInStream {
1097 #[doc = " Populated automatically when you call ::soundio_outstream_create."]
1098 pub device: *mut SoundIoDevice,
1099 #[doc = " Defaults to #SoundIoFormatFloat32NE, followed by the first one"]
1100 #[doc = " supported."]
1101 pub format: SoundIoFormat,
1102 #[doc = " Sample rate is the number of frames per second."]
1103 #[doc = " Defaults to max(sample_rate_min, min(sample_rate_max, 48000))"]
1104 pub sample_rate: ::std::os::raw::c_int,
1105 #[doc = " Defaults to Stereo, if available, followed by the first layout"]
1106 #[doc = " supported."]
1107 pub layout: SoundIoChannelLayout,
1108 #[doc = " Ignoring hardware latency, this is the number of seconds it takes for a"]
1109 #[doc = " captured sample to become available for reading."]
1110 #[doc = " After you call ::soundio_instream_open, this value is replaced with the"]
1111 #[doc = " actual software latency, as near to this value as possible."]
1112 #[doc = " A higher value means less CPU usage. Defaults to a large value,"]
1113 #[doc = " potentially upwards of 2 seconds."]
1114 #[doc = " If the device has unknown software latency min and max values, you may"]
1115 #[doc = " still set this, but you might not get the value you requested."]
1116 #[doc = " For PulseAudio, if you set this value to non-default, it sets"]
1117 #[doc = " `PA_STREAM_ADJUST_LATENCY` and is the value used for `fragsize`."]
1118 #[doc = " For JACK, this value is always equal to"]
1119 #[doc = " SoundIoDevice::software_latency_current"]
1120 pub software_latency: f64,
1121 #[doc = " Defaults to NULL. Put whatever you want here."]
1122 pub userdata: *mut ::std::os::raw::c_void,
1123 #[doc = " In this function call ::soundio_instream_begin_read and"]
1124 #[doc = " ::soundio_instream_end_read as many times as necessary to read at"]
1125 #[doc = " minimum `frame_count_min` frames and at maximum `frame_count_max`"]
1126 #[doc = " frames. If you return from read_callback without having read"]
1127 #[doc = " `frame_count_min`, the frames will be dropped. `frame_count_max` is how"]
1128 #[doc = " many frames are available to read."]
1129 #[doc = ""]
1130 #[doc = " The code in the supplied function must be suitable for real-time"]
1131 #[doc = " execution. That means that it cannot call functions that might block"]
1132 #[doc = " for a long time. This includes all I/O functions (disk, TTY, network),"]
1133 #[doc = " malloc, free, printf, pthread_mutex_lock, sleep, wait, poll, select,"]
1134 #[doc = " pthread_join, pthread_cond_wait, etc."]
1135 pub read_callback: ::std::option::Option<
1136 unsafe extern "C" fn(
1137 arg1: *mut SoundIoInStream,
1138 frame_count_min: ::std::os::raw::c_int,
1139 frame_count_max: ::std::os::raw::c_int,
1140 ),
1141 >,
1142 #[doc = " This optional callback happens when the sound device buffer is full,"]
1143 #[doc = " yet there is more captured audio to put in it."]
1144 #[doc = " This is never fired for PulseAudio."]
1145 #[doc = " This is called from the SoundIoInStream::read_callback thread context."]
1146 pub overflow_callback: ::std::option::Option<unsafe extern "C" fn(arg1: *mut SoundIoInStream)>,
1147 #[doc = " Optional callback. `err` is always SoundIoErrorStreaming."]
1148 #[doc = " SoundIoErrorStreaming is an unrecoverable error. The stream is in an"]
1149 #[doc = " invalid state and must be destroyed."]
1150 #[doc = " If you do not supply `error_callback`, the default callback will print"]
1151 #[doc = " a message to stderr and then abort()."]
1152 #[doc = " This is called from the SoundIoInStream::read_callback thread context."]
1153 pub error_callback: ::std::option::Option<
1154 unsafe extern "C" fn(arg1: *mut SoundIoInStream, err: ::std::os::raw::c_int),
1155 >,
1156 #[doc = " Optional: Name of the stream. Defaults to \"SoundIoInStream\";"]
1157 #[doc = " PulseAudio uses this for the stream name."]
1158 #[doc = " JACK uses this for the client name of the client that connects when you"]
1159 #[doc = " open the stream."]
1160 #[doc = " WASAPI uses this for the session display name."]
1161 #[doc = " Must not contain a colon (\":\")."]
1162 pub name: *const ::std::os::raw::c_char,
1163 #[doc = " Optional: Hint that this input stream is nonterminal. This is used by"]
1164 #[doc = " JACK and it means that the data received by the stream will be"]
1165 #[doc = " passed on or made available to another stream. Defaults to `false`."]
1166 pub non_terminal_hint: bool,
1167 #[doc = " computed automatically when you call ::soundio_instream_open"]
1168 pub bytes_per_frame: ::std::os::raw::c_int,
1169 #[doc = " computed automatically when you call ::soundio_instream_open"]
1170 pub bytes_per_sample: ::std::os::raw::c_int,
1171 #[doc = " If setting the channel layout fails for some reason, this field is set"]
1172 #[doc = " to an error code. Possible error codes are: #SoundIoErrorIncompatibleDevice"]
1173 pub layout_error: ::std::os::raw::c_int,
1174}
1175#[test]
1176fn bindgen_test_layout_SoundIoInStream() {
1177 assert_eq!(
1178 ::std::mem::size_of::<SoundIoInStream>(),
1179 192usize,
1180 concat!("Size of: ", stringify!(SoundIoInStream))
1181 );
1182 assert_eq!(
1183 ::std::mem::align_of::<SoundIoInStream>(),
1184 8usize,
1185 concat!("Alignment of ", stringify!(SoundIoInStream))
1186 );
1187 assert_eq!(
1188 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).device as *const _ as usize },
1189 0usize,
1190 concat!(
1191 "Offset of field: ",
1192 stringify!(SoundIoInStream),
1193 "::",
1194 stringify!(device)
1195 )
1196 );
1197 assert_eq!(
1198 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).format as *const _ as usize },
1199 8usize,
1200 concat!(
1201 "Offset of field: ",
1202 stringify!(SoundIoInStream),
1203 "::",
1204 stringify!(format)
1205 )
1206 );
1207 assert_eq!(
1208 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).sample_rate as *const _ as usize },
1209 12usize,
1210 concat!(
1211 "Offset of field: ",
1212 stringify!(SoundIoInStream),
1213 "::",
1214 stringify!(sample_rate)
1215 )
1216 );
1217 assert_eq!(
1218 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).layout as *const _ as usize },
1219 16usize,
1220 concat!(
1221 "Offset of field: ",
1222 stringify!(SoundIoInStream),
1223 "::",
1224 stringify!(layout)
1225 )
1226 );
1227 assert_eq!(
1228 unsafe {
1229 &(*(::std::ptr::null::<SoundIoInStream>())).software_latency as *const _ as usize
1230 },
1231 128usize,
1232 concat!(
1233 "Offset of field: ",
1234 stringify!(SoundIoInStream),
1235 "::",
1236 stringify!(software_latency)
1237 )
1238 );
1239 assert_eq!(
1240 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).userdata as *const _ as usize },
1241 136usize,
1242 concat!(
1243 "Offset of field: ",
1244 stringify!(SoundIoInStream),
1245 "::",
1246 stringify!(userdata)
1247 )
1248 );
1249 assert_eq!(
1250 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).read_callback as *const _ as usize },
1251 144usize,
1252 concat!(
1253 "Offset of field: ",
1254 stringify!(SoundIoInStream),
1255 "::",
1256 stringify!(read_callback)
1257 )
1258 );
1259 assert_eq!(
1260 unsafe {
1261 &(*(::std::ptr::null::<SoundIoInStream>())).overflow_callback as *const _ as usize
1262 },
1263 152usize,
1264 concat!(
1265 "Offset of field: ",
1266 stringify!(SoundIoInStream),
1267 "::",
1268 stringify!(overflow_callback)
1269 )
1270 );
1271 assert_eq!(
1272 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).error_callback as *const _ as usize },
1273 160usize,
1274 concat!(
1275 "Offset of field: ",
1276 stringify!(SoundIoInStream),
1277 "::",
1278 stringify!(error_callback)
1279 )
1280 );
1281 assert_eq!(
1282 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).name as *const _ as usize },
1283 168usize,
1284 concat!(
1285 "Offset of field: ",
1286 stringify!(SoundIoInStream),
1287 "::",
1288 stringify!(name)
1289 )
1290 );
1291 assert_eq!(
1292 unsafe {
1293 &(*(::std::ptr::null::<SoundIoInStream>())).non_terminal_hint as *const _ as usize
1294 },
1295 176usize,
1296 concat!(
1297 "Offset of field: ",
1298 stringify!(SoundIoInStream),
1299 "::",
1300 stringify!(non_terminal_hint)
1301 )
1302 );
1303 assert_eq!(
1304 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).bytes_per_frame as *const _ as usize },
1305 180usize,
1306 concat!(
1307 "Offset of field: ",
1308 stringify!(SoundIoInStream),
1309 "::",
1310 stringify!(bytes_per_frame)
1311 )
1312 );
1313 assert_eq!(
1314 unsafe {
1315 &(*(::std::ptr::null::<SoundIoInStream>())).bytes_per_sample as *const _ as usize
1316 },
1317 184usize,
1318 concat!(
1319 "Offset of field: ",
1320 stringify!(SoundIoInStream),
1321 "::",
1322 stringify!(bytes_per_sample)
1323 )
1324 );
1325 assert_eq!(
1326 unsafe { &(*(::std::ptr::null::<SoundIoInStream>())).layout_error as *const _ as usize },
1327 188usize,
1328 concat!(
1329 "Offset of field: ",
1330 stringify!(SoundIoInStream),
1331 "::",
1332 stringify!(layout_error)
1333 )
1334 );
1335}
1336extern "C" {
1337 #[doc = " See also ::soundio_version_major, ::soundio_version_minor, ::soundio_version_patch"]
1338 pub fn soundio_version_string() -> *const ::std::os::raw::c_char;
1339}
1340extern "C" {
1341 #[doc = " See also ::soundio_version_string, ::soundio_version_minor, ::soundio_version_patch"]
1342 pub fn soundio_version_major() -> ::std::os::raw::c_int;
1343}
1344extern "C" {
1345 #[doc = " See also ::soundio_version_major, ::soundio_version_string, ::soundio_version_patch"]
1346 pub fn soundio_version_minor() -> ::std::os::raw::c_int;
1347}
1348extern "C" {
1349 #[doc = " See also ::soundio_version_major, ::soundio_version_minor, ::soundio_version_string"]
1350 pub fn soundio_version_patch() -> ::std::os::raw::c_int;
1351}
1352extern "C" {
1353 #[doc = " Create a SoundIo context. You may create multiple instances of this to"]
1354 #[doc = " connect to multiple backends. Sets all fields to defaults."]
1355 #[doc = " Returns `NULL` if and only if memory could not be allocated."]
1356 #[doc = " See also ::soundio_destroy"]
1357 pub fn soundio_create() -> *mut SoundIo;
1358}
1359extern "C" {
1360 pub fn soundio_destroy(soundio: *mut SoundIo);
1361}
1362extern "C" {
1363 #[doc = " Tries ::soundio_connect_backend on all available backends in order."]
1364 #[doc = " Possible errors:"]
1365 #[doc = " * #SoundIoErrorInvalid - already connected"]
1366 #[doc = " * #SoundIoErrorNoMem"]
1367 #[doc = " * #SoundIoErrorSystemResources"]
1368 #[doc = " * #SoundIoErrorNoSuchClient - when JACK returns `JackNoSuchClient`"]
1369 #[doc = " See also ::soundio_disconnect"]
1370 pub fn soundio_connect(soundio: *mut SoundIo) -> ::std::os::raw::c_int;
1371}
1372extern "C" {
1373 #[doc = " Instead of calling ::soundio_connect you may call this function to try a"]
1374 #[doc = " specific backend."]
1375 #[doc = " Possible errors:"]
1376 #[doc = " * #SoundIoErrorInvalid - already connected or invalid backend parameter"]
1377 #[doc = " * #SoundIoErrorNoMem"]
1378 #[doc = " * #SoundIoErrorBackendUnavailable - backend was not compiled in"]
1379 #[doc = " * #SoundIoErrorSystemResources"]
1380 #[doc = " * #SoundIoErrorNoSuchClient - when JACK returns `JackNoSuchClient`"]
1381 #[doc = " * #SoundIoErrorInitAudioBackend - requested `backend` is not active"]
1382 #[doc = " * #SoundIoErrorBackendDisconnected - backend disconnected while connecting"]
1383 #[doc = " See also ::soundio_disconnect"]
1384 pub fn soundio_connect_backend(
1385 soundio: *mut SoundIo,
1386 backend: SoundIoBackend,
1387 ) -> ::std::os::raw::c_int;
1388}
1389extern "C" {
1390 pub fn soundio_disconnect(soundio: *mut SoundIo);
1391}
1392extern "C" {
1393 #[doc = " Get a string representation of a #SoundIoError"]
1394 pub fn soundio_strerror(error: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
1395}
1396extern "C" {
1397 #[doc = " Get a string representation of a #SoundIoBackend"]
1398 pub fn soundio_backend_name(backend: SoundIoBackend) -> *const ::std::os::raw::c_char;
1399}
1400extern "C" {
1401 #[doc = " Returns the number of available backends."]
1402 pub fn soundio_backend_count(soundio: *mut SoundIo) -> ::std::os::raw::c_int;
1403}
1404extern "C" {
1405 #[doc = " get the available backend at the specified index"]
1406 #[doc = " (0 <= index < ::soundio_backend_count)"]
1407 pub fn soundio_get_backend(
1408 soundio: *mut SoundIo,
1409 index: ::std::os::raw::c_int,
1410 ) -> SoundIoBackend;
1411}
1412extern "C" {
1413 #[doc = " Returns whether libsoundio was compiled with backend."]
1414 pub fn soundio_have_backend(backend: SoundIoBackend) -> bool;
1415}
1416extern "C" {
1417 #[doc = " Atomically update information for all connected devices. Note that calling"]
1418 #[doc = " this function merely flips a pointer; the actual work of collecting device"]
1419 #[doc = " information is done elsewhere. It is performant to call this function many"]
1420 #[doc = " times per second."]
1421 #[doc = ""]
1422 #[doc = " When you call this, the following callbacks might be called:"]
1423 #[doc = " * SoundIo::on_devices_change"]
1424 #[doc = " * SoundIo::on_backend_disconnect"]
1425 #[doc = " This is the only time those callbacks can be called."]
1426 #[doc = ""]
1427 #[doc = " This must be called from the same thread as the thread in which you call"]
1428 #[doc = " these functions:"]
1429 #[doc = " * ::soundio_input_device_count"]
1430 #[doc = " * ::soundio_output_device_count"]
1431 #[doc = " * ::soundio_get_input_device"]
1432 #[doc = " * ::soundio_get_output_device"]
1433 #[doc = " * ::soundio_default_input_device_index"]
1434 #[doc = " * ::soundio_default_output_device_index"]
1435 #[doc = ""]
1436 #[doc = " Note that if you do not care about learning about updated devices, you"]
1437 #[doc = " might call this function only once ever and never call"]
1438 #[doc = " ::soundio_wait_events."]
1439 pub fn soundio_flush_events(soundio: *mut SoundIo);
1440}
1441extern "C" {
1442 #[doc = " This function calls ::soundio_flush_events then blocks until another event"]
1443 #[doc = " is ready or you call ::soundio_wakeup. Be ready for spurious wakeups."]
1444 pub fn soundio_wait_events(soundio: *mut SoundIo);
1445}
1446extern "C" {
1447 #[doc = " Makes ::soundio_wait_events stop blocking."]
1448 pub fn soundio_wakeup(soundio: *mut SoundIo);
1449}
1450extern "C" {
1451 #[doc = " If necessary you can manually trigger a device rescan. Normally you will"]
1452 #[doc = " not ever have to call this function, as libsoundio listens to system events"]
1453 #[doc = " for device changes and responds to them by rescanning devices and preparing"]
1454 #[doc = " the new device information for you to be atomically replaced when you call"]
1455 #[doc = " ::soundio_flush_events. However you might run into cases where you want to"]
1456 #[doc = " force trigger a device rescan, for example if an ALSA device has a"]
1457 #[doc = " SoundIoDevice::probe_error."]
1458 #[doc = ""]
1459 #[doc = " After you call this you still have to use ::soundio_flush_events or"]
1460 #[doc = " ::soundio_wait_events and then wait for the"]
1461 #[doc = " SoundIo::on_devices_change callback."]
1462 #[doc = ""]
1463 #[doc = " This can be called from any thread context except for"]
1464 #[doc = " SoundIoOutStream::write_callback and SoundIoInStream::read_callback"]
1465 pub fn soundio_force_device_scan(soundio: *mut SoundIo);
1466}
1467extern "C" {
1468 #[doc = " Returns whether the channel count field and each channel id matches in"]
1469 #[doc = " the supplied channel layouts."]
1470 pub fn soundio_channel_layout_equal(
1471 a: *const SoundIoChannelLayout,
1472 b: *const SoundIoChannelLayout,
1473 ) -> bool;
1474}
1475extern "C" {
1476 pub fn soundio_get_channel_name(id: SoundIoChannelId) -> *const ::std::os::raw::c_char;
1477}
1478extern "C" {
1479 #[doc = " Given UTF-8 encoded text which is the name of a channel such as"]
1480 #[doc = " \"Front Left\", \"FL\", or \"front-left\", return the corresponding"]
1481 #[doc = " SoundIoChannelId. Returns SoundIoChannelIdInvalid for no match."]
1482 pub fn soundio_parse_channel_id(
1483 str_: *const ::std::os::raw::c_char,
1484 str_len: ::std::os::raw::c_int,
1485 ) -> SoundIoChannelId;
1486}
1487extern "C" {
1488 #[doc = " Returns the number of builtin channel layouts."]
1489 pub fn soundio_channel_layout_builtin_count() -> ::std::os::raw::c_int;
1490}
1491extern "C" {
1492 #[doc = " Returns a builtin channel layout. 0 <= `index` < ::soundio_channel_layout_builtin_count"]
1493 #[doc = ""]
1494 #[doc = " Although `index` is of type `int`, it should be a valid"]
1495 #[doc = " #SoundIoChannelLayoutId enum value."]
1496 pub fn soundio_channel_layout_get_builtin(
1497 index: ::std::os::raw::c_int,
1498 ) -> *const SoundIoChannelLayout;
1499}
1500extern "C" {
1501 #[doc = " Get the default builtin channel layout for the given number of channels."]
1502 pub fn soundio_channel_layout_get_default(
1503 channel_count: ::std::os::raw::c_int,
1504 ) -> *const SoundIoChannelLayout;
1505}
1506extern "C" {
1507 #[doc = " Return the index of `channel` in `layout`, or `-1` if not found."]
1508 pub fn soundio_channel_layout_find_channel(
1509 layout: *const SoundIoChannelLayout,
1510 channel: SoundIoChannelId,
1511 ) -> ::std::os::raw::c_int;
1512}
1513extern "C" {
1514 #[doc = " Populates the name field of layout if it matches a builtin one."]
1515 #[doc = " returns whether it found a match"]
1516 pub fn soundio_channel_layout_detect_builtin(layout: *mut SoundIoChannelLayout) -> bool;
1517}
1518extern "C" {
1519 #[doc = " Iterates over preferred_layouts. Returns the first channel layout in"]
1520 #[doc = " preferred_layouts which matches one of the channel layouts in"]
1521 #[doc = " available_layouts. Returns NULL if none matches."]
1522 pub fn soundio_best_matching_channel_layout(
1523 preferred_layouts: *const SoundIoChannelLayout,
1524 preferred_layout_count: ::std::os::raw::c_int,
1525 available_layouts: *const SoundIoChannelLayout,
1526 available_layout_count: ::std::os::raw::c_int,
1527 ) -> *const SoundIoChannelLayout;
1528}
1529extern "C" {
1530 #[doc = " Sorts by channel count, descending."]
1531 pub fn soundio_sort_channel_layouts(
1532 layouts: *mut SoundIoChannelLayout,
1533 layout_count: ::std::os::raw::c_int,
1534 );
1535}
1536extern "C" {
1537 #[doc = " Returns -1 on invalid format."]
1538 pub fn soundio_get_bytes_per_sample(format: SoundIoFormat) -> ::std::os::raw::c_int;
1539}
1540extern "C" {
1541 #[doc = " Returns string representation of `format`."]
1542 pub fn soundio_format_string(format: SoundIoFormat) -> *const ::std::os::raw::c_char;
1543}
1544extern "C" {
1545 #[doc = " Get the number of input devices."]
1546 #[doc = " Returns -1 if you never called ::soundio_flush_events."]
1547 pub fn soundio_input_device_count(soundio: *mut SoundIo) -> ::std::os::raw::c_int;
1548}
1549extern "C" {
1550 #[doc = " Get the number of output devices."]
1551 #[doc = " Returns -1 if you never called ::soundio_flush_events."]
1552 pub fn soundio_output_device_count(soundio: *mut SoundIo) -> ::std::os::raw::c_int;
1553}
1554extern "C" {
1555 #[doc = " Always returns a device. Call ::soundio_device_unref when done."]
1556 #[doc = " `index` must be 0 <= index < ::soundio_input_device_count"]
1557 #[doc = " Returns NULL if you never called ::soundio_flush_events or if you provide"]
1558 #[doc = " invalid parameter values."]
1559 pub fn soundio_get_input_device(
1560 soundio: *mut SoundIo,
1561 index: ::std::os::raw::c_int,
1562 ) -> *mut SoundIoDevice;
1563}
1564extern "C" {
1565 #[doc = " Always returns a device. Call ::soundio_device_unref when done."]
1566 #[doc = " `index` must be 0 <= index < ::soundio_output_device_count"]
1567 #[doc = " Returns NULL if you never called ::soundio_flush_events or if you provide"]
1568 #[doc = " invalid parameter values."]
1569 pub fn soundio_get_output_device(
1570 soundio: *mut SoundIo,
1571 index: ::std::os::raw::c_int,
1572 ) -> *mut SoundIoDevice;
1573}
1574extern "C" {
1575 #[doc = " returns the index of the default input device"]
1576 #[doc = " returns -1 if there are no devices or if you never called"]
1577 #[doc = " ::soundio_flush_events."]
1578 pub fn soundio_default_input_device_index(soundio: *mut SoundIo) -> ::std::os::raw::c_int;
1579}
1580extern "C" {
1581 #[doc = " returns the index of the default output device"]
1582 #[doc = " returns -1 if there are no devices or if you never called"]
1583 #[doc = " ::soundio_flush_events."]
1584 pub fn soundio_default_output_device_index(soundio: *mut SoundIo) -> ::std::os::raw::c_int;
1585}
1586extern "C" {
1587 #[doc = " Add 1 to the reference count of `device`."]
1588 pub fn soundio_device_ref(device: *mut SoundIoDevice);
1589}
1590extern "C" {
1591 #[doc = " Remove 1 to the reference count of `device`. Clean up if it was the last"]
1592 #[doc = " reference."]
1593 pub fn soundio_device_unref(device: *mut SoundIoDevice);
1594}
1595extern "C" {
1596 #[doc = " Return `true` if and only if the devices have the same SoundIoDevice::id,"]
1597 #[doc = " SoundIoDevice::is_raw, and SoundIoDevice::aim are the same."]
1598 pub fn soundio_device_equal(a: *const SoundIoDevice, b: *const SoundIoDevice) -> bool;
1599}
1600extern "C" {
1601 #[doc = " Sorts channel layouts by channel count, descending."]
1602 pub fn soundio_device_sort_channel_layouts(device: *mut SoundIoDevice);
1603}
1604extern "C" {
1605 #[doc = " Convenience function. Returns whether `format` is included in the device's"]
1606 #[doc = " supported formats."]
1607 pub fn soundio_device_supports_format(
1608 device: *mut SoundIoDevice,
1609 format: SoundIoFormat,
1610 ) -> bool;
1611}
1612extern "C" {
1613 #[doc = " Convenience function. Returns whether `layout` is included in the device's"]
1614 #[doc = " supported channel layouts."]
1615 pub fn soundio_device_supports_layout(
1616 device: *mut SoundIoDevice,
1617 layout: *const SoundIoChannelLayout,
1618 ) -> bool;
1619}
1620extern "C" {
1621 #[doc = " Convenience function. Returns whether `sample_rate` is included in the"]
1622 #[doc = " device's supported sample rates."]
1623 pub fn soundio_device_supports_sample_rate(
1624 device: *mut SoundIoDevice,
1625 sample_rate: ::std::os::raw::c_int,
1626 ) -> bool;
1627}
1628extern "C" {
1629 #[doc = " Convenience function. Returns the available sample rate nearest to"]
1630 #[doc = " `sample_rate`, rounding up."]
1631 pub fn soundio_device_nearest_sample_rate(
1632 device: *mut SoundIoDevice,
1633 sample_rate: ::std::os::raw::c_int,
1634 ) -> ::std::os::raw::c_int;
1635}
1636extern "C" {
1637 #[doc = " Allocates memory and sets defaults. Next you should fill out the struct fields"]
1638 #[doc = " and then call ::soundio_outstream_open. Sets all fields to defaults."]
1639 #[doc = " Returns `NULL` if and only if memory could not be allocated."]
1640 #[doc = " See also ::soundio_outstream_destroy"]
1641 pub fn soundio_outstream_create(device: *mut SoundIoDevice) -> *mut SoundIoOutStream;
1642}
1643extern "C" {
1644 #[doc = " You may not call this function from the SoundIoOutStream::write_callback thread context."]
1645 pub fn soundio_outstream_destroy(outstream: *mut SoundIoOutStream);
1646}
1647extern "C" {
1648 #[doc = " After you call this function, SoundIoOutStream::software_latency is set to"]
1649 #[doc = " the correct value."]
1650 #[doc = ""]
1651 #[doc = " The next thing to do is call ::soundio_outstream_start."]
1652 #[doc = " If this function returns an error, the outstream is in an invalid state and"]
1653 #[doc = " you must call ::soundio_outstream_destroy on it."]
1654 #[doc = ""]
1655 #[doc = " Possible errors:"]
1656 #[doc = " * #SoundIoErrorInvalid"]
1657 #[doc = " * SoundIoDevice::aim is not #SoundIoDeviceAimOutput"]
1658 #[doc = " * SoundIoOutStream::format is not valid"]
1659 #[doc = " * SoundIoOutStream::channel_count is greater than #SOUNDIO_MAX_CHANNELS"]
1660 #[doc = " * #SoundIoErrorNoMem"]
1661 #[doc = " * #SoundIoErrorOpeningDevice"]
1662 #[doc = " * #SoundIoErrorBackendDisconnected"]
1663 #[doc = " * #SoundIoErrorSystemResources"]
1664 #[doc = " * #SoundIoErrorNoSuchClient - when JACK returns `JackNoSuchClient`"]
1665 #[doc = " * #SoundIoErrorIncompatibleBackend - SoundIoOutStream::channel_count is"]
1666 #[doc = " greater than the number of channels the backend can handle."]
1667 #[doc = " * #SoundIoErrorIncompatibleDevice - stream parameters requested are not"]
1668 #[doc = " compatible with the chosen device."]
1669 pub fn soundio_outstream_open(outstream: *mut SoundIoOutStream) -> ::std::os::raw::c_int;
1670}
1671extern "C" {
1672 #[doc = " After you call this function, SoundIoOutStream::write_callback will be called."]
1673 #[doc = ""]
1674 #[doc = " This function might directly call SoundIoOutStream::write_callback."]
1675 #[doc = ""]
1676 #[doc = " Possible errors:"]
1677 #[doc = " * #SoundIoErrorStreaming"]
1678 #[doc = " * #SoundIoErrorNoMem"]
1679 #[doc = " * #SoundIoErrorSystemResources"]
1680 #[doc = " * #SoundIoErrorBackendDisconnected"]
1681 pub fn soundio_outstream_start(outstream: *mut SoundIoOutStream) -> ::std::os::raw::c_int;
1682}
1683extern "C" {
1684 #[doc = " Call this function when you are ready to begin writing to the device buffer."]
1685 #[doc = " * `outstream` - (in) The output stream you want to write to."]
1686 #[doc = " * `areas` - (out) The memory addresses you can write data to, one per"]
1687 #[doc = " channel. It is OK to modify the pointers if that helps you iterate."]
1688 #[doc = " * `frame_count` - (in/out) Provide the number of frames you want to write."]
1689 #[doc = " Returned will be the number of frames you can actually write, which is"]
1690 #[doc = " also the number of frames that will be written when you call"]
1691 #[doc = " ::soundio_outstream_end_write. The value returned will always be less"]
1692 #[doc = " than or equal to the value provided."]
1693 #[doc = " It is your responsibility to call this function exactly as many times as"]
1694 #[doc = " necessary to meet the `frame_count_min` and `frame_count_max` criteria from"]
1695 #[doc = " SoundIoOutStream::write_callback."]
1696 #[doc = " You must call this function only from the SoundIoOutStream::write_callback thread context."]
1697 #[doc = " After calling this function, write data to `areas` and then call"]
1698 #[doc = " ::soundio_outstream_end_write."]
1699 #[doc = " If this function returns an error, do not call ::soundio_outstream_end_write."]
1700 #[doc = ""]
1701 #[doc = " Possible errors:"]
1702 #[doc = " * #SoundIoErrorInvalid"]
1703 #[doc = " * `*frame_count` <= 0"]
1704 #[doc = " * `*frame_count` < `frame_count_min` or `*frame_count` > `frame_count_max`"]
1705 #[doc = " * function called too many times without respecting `frame_count_max`"]
1706 #[doc = " * #SoundIoErrorStreaming"]
1707 #[doc = " * #SoundIoErrorUnderflow - an underflow caused this call to fail. You might"]
1708 #[doc = " also get a SoundIoOutStream::underflow_callback, and you might not get"]
1709 #[doc = " this error code when an underflow occurs. Unlike #SoundIoErrorStreaming,"]
1710 #[doc = " the outstream is still in a valid state and streaming can continue."]
1711 #[doc = " * #SoundIoErrorIncompatibleDevice - in rare cases it might just now"]
1712 #[doc = " be discovered that the device uses non-byte-aligned access, in which"]
1713 #[doc = " case this error code is returned."]
1714 pub fn soundio_outstream_begin_write(
1715 outstream: *mut SoundIoOutStream,
1716 areas: *mut *mut SoundIoChannelArea,
1717 frame_count: *mut ::std::os::raw::c_int,
1718 ) -> ::std::os::raw::c_int;
1719}
1720extern "C" {
1721 #[doc = " Commits the write that you began with ::soundio_outstream_begin_write."]
1722 #[doc = " You must call this function only from the SoundIoOutStream::write_callback thread context."]
1723 #[doc = ""]
1724 #[doc = " Possible errors:"]
1725 #[doc = " * #SoundIoErrorStreaming"]
1726 #[doc = " * #SoundIoErrorUnderflow - an underflow caused this call to fail. You might"]
1727 #[doc = " also get a SoundIoOutStream::underflow_callback, and you might not get"]
1728 #[doc = " this error code when an underflow occurs. Unlike #SoundIoErrorStreaming,"]
1729 #[doc = " the outstream is still in a valid state and streaming can continue."]
1730 pub fn soundio_outstream_end_write(outstream: *mut SoundIoOutStream) -> ::std::os::raw::c_int;
1731}
1732extern "C" {
1733 #[doc = " Clears the output stream buffer."]
1734 #[doc = " This function can be called from any thread."]
1735 #[doc = " This function can be called regardless of whether the outstream is paused"]
1736 #[doc = " or not."]
1737 #[doc = " Some backends do not support clearing the buffer. On these backends this"]
1738 #[doc = " function will return SoundIoErrorIncompatibleBackend."]
1739 #[doc = " Some devices do not support clearing the buffer. On these devices this"]
1740 #[doc = " function might return SoundIoErrorIncompatibleDevice."]
1741 #[doc = " Possible errors:"]
1742 #[doc = ""]
1743 #[doc = " * #SoundIoErrorStreaming"]
1744 #[doc = " * #SoundIoErrorIncompatibleBackend"]
1745 #[doc = " * #SoundIoErrorIncompatibleDevice"]
1746 pub fn soundio_outstream_clear_buffer(
1747 outstream: *mut SoundIoOutStream,
1748 ) -> ::std::os::raw::c_int;
1749}
1750extern "C" {
1751 #[doc = " If the underlying backend and device support pausing, this pauses the"]
1752 #[doc = " stream. SoundIoOutStream::write_callback may be called a few more times if"]
1753 #[doc = " the buffer is not full."]
1754 #[doc = " Pausing might put the hardware into a low power state which is ideal if your"]
1755 #[doc = " software is silent for some time."]
1756 #[doc = " This function may be called from any thread context, including"]
1757 #[doc = " SoundIoOutStream::write_callback."]
1758 #[doc = " Pausing when already paused or unpausing when already unpaused has no"]
1759 #[doc = " effect and returns #SoundIoErrorNone."]
1760 #[doc = ""]
1761 #[doc = " Possible errors:"]
1762 #[doc = " * #SoundIoErrorBackendDisconnected"]
1763 #[doc = " * #SoundIoErrorStreaming"]
1764 #[doc = " * #SoundIoErrorIncompatibleDevice - device does not support"]
1765 #[doc = " pausing/unpausing. This error code might not be returned even if the"]
1766 #[doc = " device does not support pausing/unpausing."]
1767 #[doc = " * #SoundIoErrorIncompatibleBackend - backend does not support"]
1768 #[doc = " pausing/unpausing."]
1769 #[doc = " * #SoundIoErrorInvalid - outstream not opened and started"]
1770 pub fn soundio_outstream_pause(
1771 outstream: *mut SoundIoOutStream,
1772 pause: bool,
1773 ) -> ::std::os::raw::c_int;
1774}
1775extern "C" {
1776 #[doc = " Obtain the total number of seconds that the next frame written after the"]
1777 #[doc = " last frame written with ::soundio_outstream_end_write will take to become"]
1778 #[doc = " audible. This includes both software and hardware latency. In other words,"]
1779 #[doc = " if you call this function directly after calling ::soundio_outstream_end_write,"]
1780 #[doc = " this gives you the number of seconds that the next frame written will take"]
1781 #[doc = " to become audible."]
1782 #[doc = ""]
1783 #[doc = " This function must be called only from within SoundIoOutStream::write_callback."]
1784 #[doc = ""]
1785 #[doc = " Possible errors:"]
1786 #[doc = " * #SoundIoErrorStreaming"]
1787 pub fn soundio_outstream_get_latency(
1788 outstream: *mut SoundIoOutStream,
1789 out_latency: *mut f64,
1790 ) -> ::std::os::raw::c_int;
1791}
1792extern "C" {
1793 pub fn soundio_outstream_set_volume(
1794 outstream: *mut SoundIoOutStream,
1795 volume: f64,
1796 ) -> ::std::os::raw::c_int;
1797}
1798extern "C" {
1799 #[doc = " Allocates memory and sets defaults. Next you should fill out the struct fields"]
1800 #[doc = " and then call ::soundio_instream_open. Sets all fields to defaults."]
1801 #[doc = " Returns `NULL` if and only if memory could not be allocated."]
1802 #[doc = " See also ::soundio_instream_destroy"]
1803 pub fn soundio_instream_create(device: *mut SoundIoDevice) -> *mut SoundIoInStream;
1804}
1805extern "C" {
1806 #[doc = " You may not call this function from SoundIoInStream::read_callback."]
1807 pub fn soundio_instream_destroy(instream: *mut SoundIoInStream);
1808}
1809extern "C" {
1810 #[doc = " After you call this function, SoundIoInStream::software_latency is set to the correct"]
1811 #[doc = " value."]
1812 #[doc = " The next thing to do is call ::soundio_instream_start."]
1813 #[doc = " If this function returns an error, the instream is in an invalid state and"]
1814 #[doc = " you must call ::soundio_instream_destroy on it."]
1815 #[doc = ""]
1816 #[doc = " Possible errors:"]
1817 #[doc = " * #SoundIoErrorInvalid"]
1818 #[doc = " * device aim is not #SoundIoDeviceAimInput"]
1819 #[doc = " * format is not valid"]
1820 #[doc = " * requested layout channel count > #SOUNDIO_MAX_CHANNELS"]
1821 #[doc = " * #SoundIoErrorOpeningDevice"]
1822 #[doc = " * #SoundIoErrorNoMem"]
1823 #[doc = " * #SoundIoErrorBackendDisconnected"]
1824 #[doc = " * #SoundIoErrorSystemResources"]
1825 #[doc = " * #SoundIoErrorNoSuchClient"]
1826 #[doc = " * #SoundIoErrorIncompatibleBackend"]
1827 #[doc = " * #SoundIoErrorIncompatibleDevice"]
1828 pub fn soundio_instream_open(instream: *mut SoundIoInStream) -> ::std::os::raw::c_int;
1829}
1830extern "C" {
1831 #[doc = " After you call this function, SoundIoInStream::read_callback will be called."]
1832 #[doc = ""]
1833 #[doc = " Possible errors:"]
1834 #[doc = " * #SoundIoErrorBackendDisconnected"]
1835 #[doc = " * #SoundIoErrorStreaming"]
1836 #[doc = " * #SoundIoErrorOpeningDevice"]
1837 #[doc = " * #SoundIoErrorSystemResources"]
1838 pub fn soundio_instream_start(instream: *mut SoundIoInStream) -> ::std::os::raw::c_int;
1839}
1840extern "C" {
1841 #[doc = " Call this function when you are ready to begin reading from the device"]
1842 #[doc = " buffer."]
1843 #[doc = " * `instream` - (in) The input stream you want to read from."]
1844 #[doc = " * `areas` - (out) The memory addresses you can read data from. It is OK"]
1845 #[doc = " to modify the pointers if that helps you iterate. There might be a \"hole\""]
1846 #[doc = " in the buffer. To indicate this, `areas` will be `NULL` and `frame_count`"]
1847 #[doc = " tells how big the hole is in frames."]
1848 #[doc = " * `frame_count` - (in/out) - Provide the number of frames you want to read;"]
1849 #[doc = " returns the number of frames you can actually read. The returned value"]
1850 #[doc = " will always be less than or equal to the provided value. If the provided"]
1851 #[doc = " value is less than `frame_count_min` from SoundIoInStream::read_callback this function"]
1852 #[doc = " returns with #SoundIoErrorInvalid."]
1853 #[doc = " It is your responsibility to call this function no more and no fewer than the"]
1854 #[doc = " correct number of times according to the `frame_count_min` and"]
1855 #[doc = " `frame_count_max` criteria from SoundIoInStream::read_callback."]
1856 #[doc = " You must call this function only from the SoundIoInStream::read_callback thread context."]
1857 #[doc = " After calling this function, read data from `areas` and then use"]
1858 #[doc = " ::soundio_instream_end_read` to actually remove the data from the buffer"]
1859 #[doc = " and move the read index forward. ::soundio_instream_end_read should not be"]
1860 #[doc = " called if the buffer is empty (`frame_count` == 0), but it should be called"]
1861 #[doc = " if there is a hole."]
1862 #[doc = ""]
1863 #[doc = " Possible errors:"]
1864 #[doc = " * #SoundIoErrorInvalid"]
1865 #[doc = " * `*frame_count` < `frame_count_min` or `*frame_count` > `frame_count_max`"]
1866 #[doc = " * #SoundIoErrorStreaming"]
1867 #[doc = " * #SoundIoErrorIncompatibleDevice - in rare cases it might just now"]
1868 #[doc = " be discovered that the device uses non-byte-aligned access, in which"]
1869 #[doc = " case this error code is returned."]
1870 pub fn soundio_instream_begin_read(
1871 instream: *mut SoundIoInStream,
1872 areas: *mut *mut SoundIoChannelArea,
1873 frame_count: *mut ::std::os::raw::c_int,
1874 ) -> ::std::os::raw::c_int;
1875}
1876extern "C" {
1877 #[doc = " This will drop all of the frames from when you called"]
1878 #[doc = " ::soundio_instream_begin_read."]
1879 #[doc = " You must call this function only from the SoundIoInStream::read_callback thread context."]
1880 #[doc = " You must call this function only after a successful call to"]
1881 #[doc = " ::soundio_instream_begin_read."]
1882 #[doc = ""]
1883 #[doc = " Possible errors:"]
1884 #[doc = " * #SoundIoErrorStreaming"]
1885 pub fn soundio_instream_end_read(instream: *mut SoundIoInStream) -> ::std::os::raw::c_int;
1886}
1887extern "C" {
1888 #[doc = " If the underyling device supports pausing, this pauses the stream and"]
1889 #[doc = " prevents SoundIoInStream::read_callback from being called. Otherwise this returns"]
1890 #[doc = " #SoundIoErrorIncompatibleDevice."]
1891 #[doc = " This function may be called from any thread."]
1892 #[doc = " Pausing when already paused or unpausing when already unpaused has no"]
1893 #[doc = " effect and always returns #SoundIoErrorNone."]
1894 #[doc = ""]
1895 #[doc = " Possible errors:"]
1896 #[doc = " * #SoundIoErrorBackendDisconnected"]
1897 #[doc = " * #SoundIoErrorStreaming"]
1898 #[doc = " * #SoundIoErrorIncompatibleDevice - device does not support pausing/unpausing"]
1899 pub fn soundio_instream_pause(
1900 instream: *mut SoundIoInStream,
1901 pause: bool,
1902 ) -> ::std::os::raw::c_int;
1903}
1904extern "C" {
1905 #[doc = " Obtain the number of seconds that the next frame of sound being"]
1906 #[doc = " captured will take to arrive in the buffer, plus the amount of time that is"]
1907 #[doc = " represented in the buffer. This includes both software and hardware latency."]
1908 #[doc = ""]
1909 #[doc = " This function must be called only from within SoundIoInStream::read_callback."]
1910 #[doc = ""]
1911 #[doc = " Possible errors:"]
1912 #[doc = " * #SoundIoErrorStreaming"]
1913 pub fn soundio_instream_get_latency(
1914 instream: *mut SoundIoInStream,
1915 out_latency: *mut f64,
1916 ) -> ::std::os::raw::c_int;
1917}
1918#[repr(C)]
1919#[derive(Debug, Copy, Clone)]
1920pub struct SoundIoRingBuffer {
1921 _unused: [u8; 0],
1922}
1923extern "C" {
1924 #[doc = " A ring buffer is a single-reader single-writer lock-free fixed-size queue."]
1925 #[doc = " libsoundio ring buffers use memory mapping techniques to enable a"]
1926 #[doc = " contiguous buffer when reading or writing across the boundary of the ring"]
1927 #[doc = " buffer's capacity."]
1928 #[doc = " `requested_capacity` in bytes."]
1929 #[doc = " Returns `NULL` if and only if memory could not be allocated."]
1930 #[doc = " Use ::soundio_ring_buffer_capacity to get the actual capacity, which might"]
1931 #[doc = " be greater for alignment purposes."]
1932 #[doc = " See also ::soundio_ring_buffer_destroy"]
1933 pub fn soundio_ring_buffer_create(
1934 soundio: *mut SoundIo,
1935 requested_capacity: ::std::os::raw::c_int,
1936 ) -> *mut SoundIoRingBuffer;
1937}
1938extern "C" {
1939 pub fn soundio_ring_buffer_destroy(ring_buffer: *mut SoundIoRingBuffer);
1940}
1941extern "C" {
1942 #[doc = " When you create a ring buffer, capacity might be more than the requested"]
1943 #[doc = " capacity for alignment purposes. This function returns the actual capacity."]
1944 pub fn soundio_ring_buffer_capacity(
1945 ring_buffer: *mut SoundIoRingBuffer,
1946 ) -> ::std::os::raw::c_int;
1947}
1948extern "C" {
1949 #[doc = " Do not write more than capacity."]
1950 pub fn soundio_ring_buffer_write_ptr(
1951 ring_buffer: *mut SoundIoRingBuffer,
1952 ) -> *mut ::std::os::raw::c_char;
1953}
1954extern "C" {
1955 #[doc = " `count` in bytes."]
1956 pub fn soundio_ring_buffer_advance_write_ptr(
1957 ring_buffer: *mut SoundIoRingBuffer,
1958 count: ::std::os::raw::c_int,
1959 );
1960}
1961extern "C" {
1962 #[doc = " Do not read more than capacity."]
1963 pub fn soundio_ring_buffer_read_ptr(
1964 ring_buffer: *mut SoundIoRingBuffer,
1965 ) -> *mut ::std::os::raw::c_char;
1966}
1967extern "C" {
1968 #[doc = " `count` in bytes."]
1969 pub fn soundio_ring_buffer_advance_read_ptr(
1970 ring_buffer: *mut SoundIoRingBuffer,
1971 count: ::std::os::raw::c_int,
1972 );
1973}
1974extern "C" {
1975 #[doc = " Returns how many bytes of the buffer is used, ready for reading."]
1976 pub fn soundio_ring_buffer_fill_count(
1977 ring_buffer: *mut SoundIoRingBuffer,
1978 ) -> ::std::os::raw::c_int;
1979}
1980extern "C" {
1981 #[doc = " Returns how many bytes of the buffer is free, ready for writing."]
1982 pub fn soundio_ring_buffer_free_count(
1983 ring_buffer: *mut SoundIoRingBuffer,
1984 ) -> ::std::os::raw::c_int;
1985}
1986extern "C" {
1987 #[doc = " Must be called by the writer."]
1988 pub fn soundio_ring_buffer_clear(ring_buffer: *mut SoundIoRingBuffer);
1989}