1 #![allow(non_camel_case_types)]
2 
3 use std::os::raw::{c_char, c_int, c_long, c_uint, c_ulong, c_void};
4 
5 /* automatically generated by rust-bindgen */
6 pub const PA_RATE_MAX: u32 = 48000 * 8;
7 
8 pub const PA_SAMPLE_U8: c_int = 0;
9 pub const PA_SAMPLE_ALAW: c_int = 1;
10 pub const PA_SAMPLE_ULAW: c_int = 2;
11 pub const PA_SAMPLE_S16LE: c_int = 3;
12 pub const PA_SAMPLE_S16BE: c_int = 4;
13 pub const PA_SAMPLE_FLOAT32LE: c_int = 5;
14 pub const PA_SAMPLE_FLOAT32BE: c_int = 6;
15 pub const PA_SAMPLE_S32LE: c_int = 7;
16 pub const PA_SAMPLE_S32BE: c_int = 8;
17 pub const PA_SAMPLE_S24LE: c_int = 9;
18 pub const PA_SAMPLE_S24BE: c_int = 10;
19 pub const PA_SAMPLE_S24_32LE: c_int = 11;
20 pub const PA_SAMPLE_S24_32BE: c_int = 12;
21 pub const PA_SAMPLE_MAX: c_int = 13;
22 pub const PA_SAMPLE_INVALID: c_int = -1;
23 pub type pa_sample_format_t = c_int;
24 
25 #[repr(C)]
26 #[derive(Copy, Clone, Debug)]
27 pub struct Struct_pa_sample_spec {
28     pub format: pa_sample_format_t,
29     pub rate: u32,
30     pub channels: u8,
31 }
32 
33 impl ::std::default::Default for Struct_pa_sample_spec {
default() -> Self34     fn default() -> Self {
35         unsafe { ::std::mem::zeroed() }
36     }
37 }
38 
39 pub type pa_sample_spec = Struct_pa_sample_spec;
40 pub type pa_usec_t = u64;
41 
42 // From pulse/timeval.h
43 pub const PA_USEC_PER_MSEC: pa_usec_t = 1_000;
44 pub const PA_USEC_PER_SEC: pa_usec_t = 1_000_000;
45 
46 pub const PA_CONTEXT_UNCONNECTED: c_int = 0;
47 pub const PA_CONTEXT_CONNECTING: c_int = 1;
48 pub const PA_CONTEXT_AUTHORIZING: c_int = 2;
49 pub const PA_CONTEXT_SETTING_NAME: c_int = 3;
50 pub const PA_CONTEXT_READY: c_int = 4;
51 pub const PA_CONTEXT_FAILED: c_int = 5;
52 pub const PA_CONTEXT_TERMINATED: c_int = 6;
53 pub type pa_context_state_t = c_int;
54 
55 #[allow(non_snake_case)]
PA_CONTEXT_IS_GOOD(x: pa_context_state_t) -> bool56 pub fn PA_CONTEXT_IS_GOOD(x: pa_context_state_t) -> bool {
57     x == PA_CONTEXT_CONNECTING
58         || x == PA_CONTEXT_AUTHORIZING
59         || x == PA_CONTEXT_SETTING_NAME
60         || x == PA_CONTEXT_READY
61 }
62 
63 pub const PA_STREAM_UNCONNECTED: c_int = 0;
64 pub const PA_STREAM_CREATING: c_int = 1;
65 pub const PA_STREAM_READY: c_int = 2;
66 pub const PA_STREAM_FAILED: c_int = 3;
67 pub const PA_STREAM_TERMINATED: c_int = 4;
68 pub type pa_stream_state_t = c_int;
69 
70 #[allow(non_snake_case)]
PA_STREAM_IS_GOOD(x: pa_stream_state_t) -> bool71 pub fn PA_STREAM_IS_GOOD(x: pa_stream_state_t) -> bool {
72     x == PA_STREAM_CREATING || x == PA_STREAM_READY
73 }
74 
75 pub const PA_OPERATION_RUNNING: c_int = 0;
76 pub const PA_OPERATION_DONE: c_int = 1;
77 pub const PA_OPERATION_CANCELLED: c_int = 2;
78 pub type pa_operation_state_t = c_int;
79 
80 pub const PA_CONTEXT_NOFLAGS: c_uint = 0;
81 pub const PA_CONTEXT_NOAUTOSPAWN: c_uint = 1;
82 pub const PA_CONTEXT_NOFAIL: c_uint = 2;
83 pub type pa_context_flags_t = c_uint;
84 
85 pub const PA_DIRECTION_OUTPUT: c_int = 1;
86 pub const PA_DIRECTION_INPUT: c_int = 2;
87 pub type pa_direction_t = c_int;
88 
89 pub const PA_DEVICE_TYPE_SINK: c_int = 0;
90 pub const PA_DEVICE_TYPE_SOURCE: c_int = 1;
91 pub type pa_device_type_t = c_int;
92 
93 pub const PA_STREAM_NODIRECTION: c_int = 0;
94 pub const PA_STREAM_PLAYBACK: c_int = 1;
95 pub const PA_STREAM_RECORD: c_int = 2;
96 pub const PA_STREAM_UPLOAD: c_int = 3;
97 pub type pa_stream_direction_t = c_int;
98 
99 pub const PA_STREAM_NOFLAGS: c_uint = 0x0_0000;
100 pub const PA_STREAM_START_CORKED: c_uint = 0x0_0001;
101 pub const PA_STREAM_INTERPOLATE_TIMING: c_uint = 0x0_0002;
102 pub const PA_STREAM_NOT_MONOTONIC: c_uint = 0x0_0004;
103 pub const PA_STREAM_AUTO_TIMING_UPDATE: c_uint = 0x0_0008;
104 pub const PA_STREAM_NO_REMAP_CHANNELS: c_uint = 0x0_0010;
105 pub const PA_STREAM_NO_REMIX_CHANNELS: c_uint = 0x0_0020;
106 pub const PA_STREAM_FIX_FORMAT: c_uint = 0x0_0040;
107 pub const PA_STREAM_FIX_RATE: c_uint = 0x0_0080;
108 pub const PA_STREAM_FIX_CHANNELS: c_uint = 0x0_0100;
109 pub const PA_STREAM_DONT_MOVE: c_uint = 0x0_0200;
110 pub const PA_STREAM_VARIABLE_RATE: c_uint = 0x0_0400;
111 pub const PA_STREAM_PEAK_DETECT: c_uint = 0x0_0800;
112 pub const PA_STREAM_START_MUTED: c_uint = 0x0_1000;
113 pub const PA_STREAM_ADJUST_LATENCY: c_uint = 0x0_2000;
114 pub const PA_STREAM_EARLY_REQUESTS: c_uint = 0x0_4000;
115 pub const PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND: c_uint = 0x0_8000;
116 pub const PA_STREAM_START_UNMUTED: c_uint = 0x1_0000;
117 pub const PA_STREAM_FAIL_ON_SUSPEND: c_uint = 0x2_0000;
118 pub const PA_STREAM_RELATIVE_VOLUME: c_uint = 0x4_0000;
119 pub const PA_STREAM_PASSTHROUGH: c_uint = 0x8_0000;
120 pub type pa_stream_flags_t = c_uint;
121 
122 #[repr(C)]
123 #[derive(Clone, Copy, Debug)]
124 pub struct pa_buffer_attr {
125     pub maxlength: u32,
126     pub tlength: u32,
127     pub prebuf: u32,
128     pub minreq: u32,
129     pub fragsize: u32,
130 }
131 
132 impl ::std::default::Default for pa_buffer_attr {
default() -> Self133     fn default() -> Self {
134         unsafe { ::std::mem::zeroed() }
135     }
136 }
137 
138 pub const PA_OK: c_int = 0;
139 pub const PA_ERR_ACCESS: c_int = 1;
140 pub const PA_ERR_COMMAND: c_int = 2;
141 pub const PA_ERR_INVALID: c_int = 3;
142 pub const PA_ERR_EXIST: c_int = 4;
143 pub const PA_ERR_NOENTITY: c_int = 5;
144 pub const PA_ERR_CONNECTIONREFUSED: c_int = 6;
145 pub const PA_ERR_PROTOCOL: c_int = 7;
146 pub const PA_ERR_TIMEOUT: c_int = 8;
147 pub const PA_ERR_AUTHKEY: c_int = 9;
148 pub const PA_ERR_INTERNAL: c_int = 10;
149 pub const PA_ERR_CONNECTIONTERMINATED: c_int = 11;
150 pub const PA_ERR_KILLED: c_int = 12;
151 pub const PA_ERR_INVALIDSERVER: c_int = 13;
152 pub const PA_ERR_MODINITFAILED: c_int = 14;
153 pub const PA_ERR_BADSTATE: c_int = 15;
154 pub const PA_ERR_NODATA: c_int = 16;
155 pub const PA_ERR_VERSION: c_int = 17;
156 pub const PA_ERR_TOOLARGE: c_int = 18;
157 pub const PA_ERR_NOTSUPPORTED: c_int = 19;
158 pub const PA_ERR_UNKNOWN: c_int = 20;
159 pub const PA_ERR_NOEXTENSION: c_int = 21;
160 pub const PA_ERR_OBSOLETE: c_int = 22;
161 pub const PA_ERR_NOTIMPLEMENTED: c_int = 23;
162 pub const PA_ERR_FORKED: c_int = 24;
163 pub const PA_ERR_IO: c_int = 25;
164 pub const PA_ERR_BUSY: c_int = 26;
165 pub const PA_ERR_MAX: c_int = 27;
166 pub type pa_error_code_t = c_int;
167 
168 pub const PA_SUBSCRIPTION_MASK_NULL: c_uint = 0x0;
169 pub const PA_SUBSCRIPTION_MASK_SINK: c_uint = 0x1;
170 pub const PA_SUBSCRIPTION_MASK_SOURCE: c_uint = 0x2;
171 pub const PA_SUBSCRIPTION_MASK_SINK_INPUT: c_uint = 0x4;
172 pub const PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT: c_uint = 0x8;
173 pub const PA_SUBSCRIPTION_MASK_MODULE: c_uint = 0x10;
174 pub const PA_SUBSCRIPTION_MASK_CLIENT: c_uint = 0x20;
175 pub const PA_SUBSCRIPTION_MASK_SAMPLE_CACHE: c_uint = 0x40;
176 pub const PA_SUBSCRIPTION_MASK_SERVER: c_uint = 0x80;
177 pub const PA_SUBSCRIPTION_MASK_AUTOLOAD: c_uint = 0x100;
178 pub const PA_SUBSCRIPTION_MASK_CARD: c_uint = 0x200;
179 pub const PA_SUBSCRIPTION_MASK_ALL: c_uint = 0x3FF;
180 pub type pa_subscription_mask_t = c_uint;
181 
182 pub const PA_SUBSCRIPTION_EVENT_SINK: c_int = 0;
183 pub const PA_SUBSCRIPTION_EVENT_SOURCE: c_int = 1;
184 pub const PA_SUBSCRIPTION_EVENT_SINK_INPUT: c_int = 2;
185 pub const PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT: c_int = 3;
186 pub const PA_SUBSCRIPTION_EVENT_MODULE: c_int = 4;
187 pub const PA_SUBSCRIPTION_EVENT_CLIENT: c_int = 5;
188 pub const PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE: c_int = 6;
189 pub const PA_SUBSCRIPTION_EVENT_SERVER: c_int = 7;
190 pub const PA_SUBSCRIPTION_EVENT_AUTOLOAD: c_int = 8;
191 pub const PA_SUBSCRIPTION_EVENT_CARD: c_int = 9;
192 pub const PA_SUBSCRIPTION_EVENT_FACILITY_MASK: c_int = 15;
193 pub const PA_SUBSCRIPTION_EVENT_NEW: c_int = 0;
194 pub const PA_SUBSCRIPTION_EVENT_CHANGE: c_int = 16;
195 pub const PA_SUBSCRIPTION_EVENT_REMOVE: c_int = 32;
196 pub const PA_SUBSCRIPTION_EVENT_TYPE_MASK: c_int = 48;
197 pub type pa_subscription_event_type_t = c_int;
198 
199 #[repr(C)]
200 #[derive(Clone, Copy, Debug)]
201 pub struct timeval {
202     pub tv_sec: c_long,
203     pub tv_usec: c_long,
204 }
205 
206 #[repr(C)]
207 #[derive(Clone, Copy, Debug)]
208 pub struct pa_timing_info {
209     pub timestamp: timeval,
210     pub synchronized_clocks: c_int,
211     pub sink_usec: pa_usec_t,
212     pub source_usec: pa_usec_t,
213     pub transport_usec: pa_usec_t,
214     pub playing: c_int,
215     pub write_index_corrupt: c_int,
216     pub write_index: i64,
217     pub read_index_corrupt: c_int,
218     pub read_index: i64,
219     pub configured_sink_usec: pa_usec_t,
220     pub configured_source_usec: pa_usec_t,
221     pub since_underrun: i64,
222 }
223 
224 impl ::std::default::Default for pa_timing_info {
default() -> Self225     fn default() -> Self {
226         unsafe { ::std::mem::zeroed() }
227     }
228 }
229 
230 #[repr(C)]
231 #[derive(Clone, Copy, Debug)]
232 pub struct pa_spawn_api {
233     pub prefork: Option<extern "C" fn() -> ()>,
234     pub postfork: Option<extern "C" fn() -> ()>,
235     pub atfork: Option<extern "C" fn() -> ()>,
236 }
237 
238 impl ::std::default::Default for pa_spawn_api {
default() -> Self239     fn default() -> Self {
240         unsafe { ::std::mem::zeroed() }
241     }
242 }
243 
244 pub const PA_SEEK_RELATIVE: c_int = 0;
245 pub const PA_SEEK_ABSOLUTE: c_int = 1;
246 pub const PA_SEEK_RELATIVE_ON_READ: c_int = 2;
247 pub const PA_SEEK_RELATIVE_END: c_int = 3;
248 pub type pa_seek_mode_t = c_int;
249 
250 pub const PA_SINK_NOFLAGS: c_uint = 0x000;
251 pub const PA_SINK_HW_VOLUME_CTRL: c_uint = 0x001;
252 pub const PA_SINK_LATENCY: c_uint = 0x002;
253 pub const PA_SINK_HARDWARE: c_uint = 0x004;
254 pub const PA_SINK_NETWORK: c_uint = 0x008;
255 pub const PA_SINK_HW_MUTE_CTRL: c_uint = 0x010;
256 pub const PA_SINK_DECIBEL_VOLUME: c_uint = 0x020;
257 pub const PA_SINK_FLAT_VOLUME: c_uint = 0x040;
258 pub const PA_SINK_DYNAMIC_LATENCY: c_uint = 0x080;
259 pub const PA_SINK_SET_FORMATS: c_uint = 0x100;
260 pub type pa_sink_flags_t = c_uint;
261 
262 pub const PA_SINK_INVALID_STATE: c_int = -1;
263 pub const PA_SINK_RUNNING: c_int = 0;
264 pub const PA_SINK_IDLE: c_int = 1;
265 pub const PA_SINK_SUSPENDED: c_int = 2;
266 pub const PA_SINK_INIT: c_int = -2;
267 pub const PA_SINK_UNLINKED: c_int = -3;
268 pub type pa_sink_state_t = c_int;
269 
270 pub const PA_SOURCE_NOFLAGS: c_uint = 0x00;
271 pub const PA_SOURCE_HW_VOLUME_CTRL: c_uint = 0x01;
272 pub const PA_SOURCE_LATENCY: c_uint = 0x02;
273 pub const PA_SOURCE_HARDWARE: c_uint = 0x04;
274 pub const PA_SOURCE_NETWORK: c_uint = 0x08;
275 pub const PA_SOURCE_HW_MUTE_CTRL: c_uint = 0x10;
276 pub const PA_SOURCE_DECIBEL_VOLUME: c_uint = 0x20;
277 pub const PA_SOURCE_DYNAMIC_LATENCY: c_uint = 0x40;
278 pub const PA_SOURCE_FLAT_VOLUME: c_uint = 0x80;
279 pub type pa_source_flags_t = c_uint;
280 
281 pub const PA_SOURCE_INVALID_STATE: c_int = -1;
282 pub const PA_SOURCE_RUNNING: c_int = 0;
283 pub const PA_SOURCE_IDLE: c_int = 1;
284 pub const PA_SOURCE_SUSPENDED: c_int = 2;
285 pub const PA_SOURCE_INIT: c_int = -2;
286 pub const PA_SOURCE_UNLINKED: c_int = -3;
287 pub type pa_source_state_t = c_int;
288 
289 pub type pa_free_cb_t = Option<unsafe extern "C" fn(p: *mut c_void) -> ()>;
290 
291 pub const PA_PORT_AVAILABLE_UNKNOWN: c_int = 0;
292 pub const PA_PORT_AVAILABLE_NO: c_int = 1;
293 pub const PA_PORT_AVAILABLE_YES: c_int = 2;
294 pub type pa_port_available_t = c_int;
295 
296 pub const PA_IO_EVENT_NULL: c_int = 0;
297 pub const PA_IO_EVENT_INPUT: c_int = 1;
298 pub const PA_IO_EVENT_OUTPUT: c_int = 2;
299 pub const PA_IO_EVENT_HANGUP: c_int = 4;
300 pub const PA_IO_EVENT_ERROR: c_int = 8;
301 pub type pa_io_event_flags_t = c_int;
302 
303 pub enum pa_io_event {}
304 pub type pa_io_event_cb_t = Option<
305     unsafe extern "C" fn(
306         ea: *mut pa_mainloop_api,
307         e: *mut pa_io_event,
308         fd: c_int,
309         events: pa_io_event_flags_t,
310         userdata: *mut c_void,
311     ),
312 >;
313 pub type pa_io_event_destroy_cb_t = Option<
314     unsafe extern "C" fn(a: *mut pa_mainloop_api, e: *mut pa_io_event, userdata: *mut c_void),
315 >;
316 pub enum pa_time_event {}
317 pub type pa_time_event_cb_t = Option<
318     unsafe extern "C" fn(
319         a: *mut pa_mainloop_api,
320         e: *mut pa_time_event,
321         tv: *const timeval,
322         userdata: *mut c_void,
323     ),
324 >;
325 pub type pa_time_event_destroy_cb_t = Option<
326     unsafe extern "C" fn(a: *mut pa_mainloop_api, e: *mut pa_time_event, userdata: *mut c_void),
327 >;
328 
329 pub enum pa_defer_event {}
330 pub type pa_defer_event_cb_t = Option<
331     unsafe extern "C" fn(a: *mut pa_mainloop_api, e: *mut pa_defer_event, userdata: *mut c_void),
332 >;
333 pub type pa_defer_event_destroy_cb_t = Option<
334     unsafe extern "C" fn(a: *mut pa_mainloop_api, e: *mut pa_defer_event, userdata: *mut c_void),
335 >;
336 pub type IoNewFn = Option<
337     unsafe extern "C" fn(
338         a: *mut pa_mainloop_api,
339         fd: c_int,
340         events: pa_io_event_flags_t,
341         cb: pa_io_event_cb_t,
342         userdata: *mut c_void,
343     ) -> *mut pa_io_event,
344 >;
345 pub type TimeNewFn = Option<
346     unsafe extern "C" fn(
347         a: *mut pa_mainloop_api,
348         tv: *const timeval,
349         cb: pa_time_event_cb_t,
350         userdata: *mut c_void,
351     ) -> *mut pa_time_event,
352 >;
353 pub type DeferNewFn = Option<
354     unsafe extern "C" fn(
355         a: *mut pa_mainloop_api,
356         cb: pa_defer_event_cb_t,
357         userdata: *mut c_void,
358     ) -> *mut pa_defer_event,
359 >;
360 
361 #[repr(C)]
362 #[derive(Clone, Copy, Debug)]
363 pub struct pa_mainloop_api {
364     pub userdata: *mut c_void,
365     pub io_new: IoNewFn,
366     pub io_enable: Option<unsafe extern "C" fn(e: *mut pa_io_event, events: pa_io_event_flags_t)>,
367     pub io_free: Option<unsafe extern "C" fn(e: *mut pa_io_event)>,
368     pub io_set_destroy:
369         Option<unsafe extern "C" fn(e: *mut pa_io_event, cb: pa_io_event_destroy_cb_t)>,
370     pub time_new: TimeNewFn,
371     pub time_restart: Option<unsafe extern "C" fn(e: *mut pa_time_event, tv: *const timeval)>,
372     pub time_free: Option<unsafe extern "C" fn(e: *mut pa_time_event)>,
373     pub time_set_destroy:
374         Option<unsafe extern "C" fn(e: *mut pa_time_event, cb: pa_time_event_destroy_cb_t)>,
375     pub defer_new: DeferNewFn,
376     pub defer_enable: Option<unsafe extern "C" fn(e: *mut pa_defer_event, b: c_int)>,
377     pub defer_free: Option<unsafe extern "C" fn(e: *mut pa_defer_event)>,
378     pub defer_set_destroy:
379         Option<unsafe extern "C" fn(e: *mut pa_defer_event, cb: pa_defer_event_destroy_cb_t)>,
380     pub quit: Option<unsafe extern "C" fn(a: *mut pa_mainloop_api, retval: c_int)>,
381 }
382 
383 impl ::std::default::Default for pa_mainloop_api {
default() -> Self384     fn default() -> Self {
385         unsafe { ::std::mem::zeroed() }
386     }
387 }
388 
389 pub type pa_mainloop_api_once_cb_t =
390     Option<unsafe extern "C" fn(m: *mut pa_mainloop_api, userdata: *mut c_void)>;
391 
392 pub enum pa_proplist {}
393 
394 pub const PA_UPDATE_SET: c_int = 0;
395 pub const PA_UPDATE_MERGE: c_int = 1;
396 pub const PA_UPDATE_REPLACE: c_int = 2;
397 pub type pa_update_mode_t = c_int;
398 
399 pub const PA_CHANNEL_POSITION_INVALID: c_int = -1;
400 pub const PA_CHANNEL_POSITION_MONO: c_int = 0;
401 pub const PA_CHANNEL_POSITION_FRONT_LEFT: c_int = 1;
402 pub const PA_CHANNEL_POSITION_FRONT_RIGHT: c_int = 2;
403 pub const PA_CHANNEL_POSITION_FRONT_CENTER: c_int = 3;
404 pub const PA_CHANNEL_POSITION_LEFT: c_int = 1;
405 pub const PA_CHANNEL_POSITION_RIGHT: c_int = 2;
406 pub const PA_CHANNEL_POSITION_CENTER: c_int = 3;
407 pub const PA_CHANNEL_POSITION_REAR_CENTER: c_int = 4;
408 pub const PA_CHANNEL_POSITION_REAR_LEFT: c_int = 5;
409 pub const PA_CHANNEL_POSITION_REAR_RIGHT: c_int = 6;
410 pub const PA_CHANNEL_POSITION_LFE: c_int = 7;
411 pub const PA_CHANNEL_POSITION_SUBWOOFER: c_int = 7;
412 pub const PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER: c_int = 8;
413 pub const PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER: c_int = 9;
414 pub const PA_CHANNEL_POSITION_SIDE_LEFT: c_int = 10;
415 pub const PA_CHANNEL_POSITION_SIDE_RIGHT: c_int = 11;
416 pub const PA_CHANNEL_POSITION_AUX0: c_int = 12;
417 pub const PA_CHANNEL_POSITION_AUX1: c_int = 13;
418 pub const PA_CHANNEL_POSITION_AUX2: c_int = 14;
419 pub const PA_CHANNEL_POSITION_AUX3: c_int = 15;
420 pub const PA_CHANNEL_POSITION_AUX4: c_int = 16;
421 pub const PA_CHANNEL_POSITION_AUX5: c_int = 17;
422 pub const PA_CHANNEL_POSITION_AUX6: c_int = 18;
423 pub const PA_CHANNEL_POSITION_AUX7: c_int = 19;
424 pub const PA_CHANNEL_POSITION_AUX8: c_int = 20;
425 pub const PA_CHANNEL_POSITION_AUX9: c_int = 21;
426 pub const PA_CHANNEL_POSITION_AUX10: c_int = 22;
427 pub const PA_CHANNEL_POSITION_AUX11: c_int = 23;
428 pub const PA_CHANNEL_POSITION_AUX12: c_int = 24;
429 pub const PA_CHANNEL_POSITION_AUX13: c_int = 25;
430 pub const PA_CHANNEL_POSITION_AUX14: c_int = 26;
431 pub const PA_CHANNEL_POSITION_AUX15: c_int = 27;
432 pub const PA_CHANNEL_POSITION_AUX16: c_int = 28;
433 pub const PA_CHANNEL_POSITION_AUX17: c_int = 29;
434 pub const PA_CHANNEL_POSITION_AUX18: c_int = 30;
435 pub const PA_CHANNEL_POSITION_AUX19: c_int = 31;
436 pub const PA_CHANNEL_POSITION_AUX20: c_int = 32;
437 pub const PA_CHANNEL_POSITION_AUX21: c_int = 33;
438 pub const PA_CHANNEL_POSITION_AUX22: c_int = 34;
439 pub const PA_CHANNEL_POSITION_AUX23: c_int = 35;
440 pub const PA_CHANNEL_POSITION_AUX24: c_int = 36;
441 pub const PA_CHANNEL_POSITION_AUX25: c_int = 37;
442 pub const PA_CHANNEL_POSITION_AUX26: c_int = 38;
443 pub const PA_CHANNEL_POSITION_AUX27: c_int = 39;
444 pub const PA_CHANNEL_POSITION_AUX28: c_int = 40;
445 pub const PA_CHANNEL_POSITION_AUX29: c_int = 41;
446 pub const PA_CHANNEL_POSITION_AUX30: c_int = 42;
447 pub const PA_CHANNEL_POSITION_AUX31: c_int = 43;
448 pub const PA_CHANNEL_POSITION_TOP_CENTER: c_int = 44;
449 pub const PA_CHANNEL_POSITION_TOP_FRONT_LEFT: c_int = 45;
450 pub const PA_CHANNEL_POSITION_TOP_FRONT_RIGHT: c_int = 46;
451 pub const PA_CHANNEL_POSITION_TOP_FRONT_CENTER: c_int = 47;
452 pub const PA_CHANNEL_POSITION_TOP_REAR_LEFT: c_int = 48;
453 pub const PA_CHANNEL_POSITION_TOP_REAR_RIGHT: c_int = 49;
454 pub const PA_CHANNEL_POSITION_TOP_REAR_CENTER: c_int = 50;
455 pub const PA_CHANNEL_POSITION_MAX: c_int = 51;
456 pub type pa_channel_position_t = c_int;
457 pub type pa_channel_position_mask_t = u64;
458 
459 pub const PA_CHANNEL_MAP_AIFF: c_int = 0;
460 pub const PA_CHANNEL_MAP_ALSA: c_int = 1;
461 pub const PA_CHANNEL_MAP_AUX: c_int = 2;
462 pub const PA_CHANNEL_MAP_WAVEEX: c_int = 3;
463 pub const PA_CHANNEL_MAP_OSS: c_int = 4;
464 pub const PA_CHANNEL_MAP_DEF_MAX: c_int = 5;
465 pub const PA_CHANNEL_MAP_DEFAULT: c_int = 0;
466 pub type pa_channel_map_def_t = c_int;
467 
468 #[repr(C)]
469 #[derive(Clone, Copy, Debug)]
470 pub struct pa_channel_map {
471     pub channels: u8,
472     pub map: [pa_channel_position_t; 32usize],
473 }
474 
475 impl ::std::default::Default for pa_channel_map {
default() -> Self476     fn default() -> Self {
477         unsafe { ::std::mem::zeroed() }
478     }
479 }
480 
481 pub const PA_ENCODING_ANY: c_int = 0;
482 pub const PA_ENCODING_PCM: c_int = 1;
483 pub const PA_ENCODING_AC3_IEC61937: c_int = 2;
484 pub const PA_ENCODING_EAC3_IEC61937: c_int = 3;
485 pub const PA_ENCODING_MPEG_IEC61937: c_int = 4;
486 pub const PA_ENCODING_DTS_IEC61937: c_int = 5;
487 pub const PA_ENCODING_MPEG2_AAC_IEC61937: c_int = 6;
488 pub const PA_ENCODING_MAX: c_int = 7;
489 pub const PA_ENCODING_INVALID: c_int = -1;
490 pub type pa_encoding_t = c_int;
491 
492 #[repr(C)]
493 #[derive(Clone, Copy, Debug)]
494 pub struct pa_format_info {
495     pub encoding: pa_encoding_t,
496     pub plist: *mut pa_proplist,
497 }
498 
499 impl ::std::default::Default for pa_format_info {
default() -> Self500     fn default() -> Self {
501         unsafe { ::std::mem::zeroed() }
502     }
503 }
504 
505 pub const PA_PROP_TYPE_INT: c_int = 0;
506 pub const PA_PROP_TYPE_INT_RANGE: c_int = 1;
507 pub const PA_PROP_TYPE_INT_ARRAY: c_int = 2;
508 pub const PA_PROP_TYPE_STRING: c_int = 3;
509 pub const PA_PROP_TYPE_STRING_ARRAY: c_int = 4;
510 pub const PA_PROP_TYPE_INVALID: c_int = -1;
511 pub type pa_prop_type_t = c_int;
512 
513 pub enum pa_operation {}
514 pub type pa_operation_notify_cb_t =
515     Option<unsafe extern "C" fn(o: *mut pa_operation, userdata: *mut c_void)>;
516 
517 pub enum pa_context {}
518 pub type pa_context_notify_cb_t =
519     Option<unsafe extern "C" fn(c: *mut pa_context, userdata: *mut c_void)>;
520 pub type pa_context_success_cb_t =
521     Option<unsafe extern "C" fn(c: *mut pa_context, success: c_int, userdata: *mut c_void)>;
522 pub type pa_context_event_cb_t = Option<
523     unsafe extern "C" fn(
524         c: *mut pa_context,
525         name: *const c_char,
526         p: *mut pa_proplist,
527         userdata: *mut c_void,
528     ),
529 >;
530 
531 pub type pa_volume_t = u32;
532 
533 #[repr(C)]
534 #[derive(Clone, Copy, Debug)]
535 pub struct pa_cvolume {
536     pub channels: u8,
537     pub values: [pa_volume_t; 32usize],
538 }
539 
540 impl ::std::default::Default for pa_cvolume {
default() -> Self541     fn default() -> Self {
542         unsafe { ::std::mem::zeroed() }
543     }
544 }
545 
546 pub enum pa_stream {}
547 pub type pa_stream_success_cb_t =
548     Option<unsafe extern "C" fn(s: *mut pa_stream, success: c_int, userdata: *mut c_void)>;
549 pub type pa_stream_request_cb_t =
550     Option<unsafe extern "C" fn(p: *mut pa_stream, nbytes: usize, userdata: *mut c_void)>;
551 pub type pa_stream_notify_cb_t =
552     Option<unsafe extern "C" fn(p: *mut pa_stream, userdata: *mut c_void)>;
553 pub type pa_stream_event_cb_t = Option<
554     unsafe extern "C" fn(
555         p: *mut pa_stream,
556         name: *const c_char,
557         pl: *mut pa_proplist,
558         userdata: *mut c_void,
559     ),
560 >;
561 
562 #[repr(C)]
563 #[derive(Clone, Copy, Debug)]
564 pub struct pa_port_info {
565     pub name: *const c_char,
566     pub description: *const c_char,
567     pub priority: u32,
568     pub available: c_int,
569 }
570 
571 impl ::std::default::Default for pa_port_info {
default() -> Self572     fn default() -> Self {
573         unsafe { ::std::mem::zeroed() }
574     }
575 }
576 
577 #[repr(C)]
578 #[derive(Clone, Copy, Debug)]
579 pub struct pa_sink_info {
580     pub name: *const c_char,
581     pub index: u32,
582     pub description: *const c_char,
583     pub sample_spec: pa_sample_spec,
584     pub channel_map: pa_channel_map,
585     pub owner_module: u32,
586     pub volume: pa_cvolume,
587     pub mute: c_int,
588     pub monitor_source: u32,
589     pub monitor_source_name: *const c_char,
590     pub latency: pa_usec_t,
591     pub driver: *const c_char,
592     pub flags: pa_sink_flags_t,
593     pub proplist: *mut pa_proplist,
594     pub configured_latency: pa_usec_t,
595     pub base_volume: pa_volume_t,
596     pub state: pa_sink_state_t,
597     pub n_volume_steps: u32,
598     pub card: u32,
599     pub n_ports: u32,
600     pub ports: *mut *mut pa_port_info,
601     pub active_port: *mut pa_port_info,
602     pub n_formats: u8,
603     pub formats: *mut *mut pa_format_info,
604 }
605 
606 impl ::std::default::Default for pa_sink_info {
default() -> Self607     fn default() -> Self {
608         unsafe { ::std::mem::zeroed() }
609     }
610 }
611 
612 pub type pa_sink_info_cb_t = Option<
613     unsafe extern "C" fn(
614         c: *mut pa_context,
615         i: *const pa_sink_info,
616         eol: c_int,
617         userdata: *mut c_void,
618     ),
619 >;
620 
621 #[repr(C)]
622 #[derive(Clone, Copy, Debug)]
623 pub struct pa_source_info {
624     pub name: *const c_char,
625     pub index: u32,
626     pub description: *const c_char,
627     pub sample_spec: pa_sample_spec,
628     pub channel_map: pa_channel_map,
629     pub owner_module: u32,
630     pub volume: pa_cvolume,
631     pub mute: c_int,
632     pub monitor_of_sink: u32,
633     pub monitor_of_sink_name: *const c_char,
634     pub latency: pa_usec_t,
635     pub driver: *const c_char,
636     pub flags: pa_source_flags_t,
637     pub proplist: *mut pa_proplist,
638     pub configured_latency: pa_usec_t,
639     pub base_volume: pa_volume_t,
640     pub state: pa_source_state_t,
641     pub n_volume_steps: u32,
642     pub card: u32,
643     pub n_ports: u32,
644     pub ports: *mut *mut pa_port_info,
645     pub active_port: *mut pa_port_info,
646     pub n_formats: u8,
647     pub formats: *mut *mut pa_format_info,
648 }
649 
650 impl ::std::default::Default for pa_source_info {
default() -> Self651     fn default() -> Self {
652         unsafe { ::std::mem::zeroed() }
653     }
654 }
655 
656 pub type pa_source_info_cb_t = Option<
657     unsafe extern "C" fn(
658         c: *mut pa_context,
659         i: *const pa_source_info,
660         eol: c_int,
661         userdata: *mut c_void,
662     ),
663 >;
664 
665 #[repr(C)]
666 #[derive(Clone, Copy, Debug)]
667 pub struct pa_server_info {
668     pub user_name: *const c_char,
669     pub host_name: *const c_char,
670     pub server_version: *const c_char,
671     pub server_name: *const c_char,
672     pub sample_spec: pa_sample_spec,
673     pub default_sink_name: *const c_char,
674     pub default_source_name: *const c_char,
675     pub cookie: u32,
676     pub channel_map: pa_channel_map,
677 }
678 
679 impl ::std::default::Default for pa_server_info {
default() -> Self680     fn default() -> Self {
681         unsafe { ::std::mem::zeroed() }
682     }
683 }
684 
685 pub type pa_server_info_cb_t = Option<
686     unsafe extern "C" fn(c: *mut pa_context, i: *const pa_server_info, userdata: *mut c_void),
687 >;
688 
689 #[repr(C)]
690 #[derive(Clone, Copy, Debug)]
691 pub struct pa_module_info {
692     pub index: u32,
693     pub name: *const c_char,
694     pub argument: *const c_char,
695     pub n_used: u32,
696     pub auto_unload: c_int,
697     pub proplist: *mut pa_proplist,
698 }
699 
700 impl ::std::default::Default for pa_module_info {
default() -> Self701     fn default() -> Self {
702         unsafe { ::std::mem::zeroed() }
703     }
704 }
705 
706 pub type pa_module_info_cb_t = Option<
707     unsafe extern "C" fn(
708         c: *mut pa_context,
709         i: *const pa_module_info,
710         eol: c_int,
711         userdata: *mut c_void,
712     ),
713 >;
714 pub type pa_context_index_cb_t =
715     Option<unsafe extern "C" fn(c: *mut pa_context, idx: u32, userdata: *mut c_void)>;
716 
717 #[repr(C)]
718 #[derive(Clone, Copy, Debug)]
719 pub struct pa_client_info {
720     pub index: u32,
721     pub name: *const c_char,
722     pub owner_module: u32,
723     pub driver: *const c_char,
724     pub proplist: *mut pa_proplist,
725 }
726 
727 impl ::std::default::Default for pa_client_info {
default() -> Self728     fn default() -> Self {
729         unsafe { ::std::mem::zeroed() }
730     }
731 }
732 
733 pub type pa_client_info_cb_t = Option<
734     unsafe extern "C" fn(
735         c: *mut pa_context,
736         i: *const pa_client_info,
737         eol: c_int,
738         userdata: *mut c_void,
739     ),
740 >;
741 
742 #[repr(C)]
743 #[derive(Clone, Copy, Debug)]
744 pub struct pa_card_profile_info {
745     pub name: *const c_char,
746     pub description: *const c_char,
747     pub n_sinks: u32,
748     pub n_sources: u32,
749     pub priority: u32,
750 }
751 
752 impl ::std::default::Default for pa_card_profile_info {
default() -> Self753     fn default() -> Self {
754         unsafe { ::std::mem::zeroed() }
755     }
756 }
757 
758 #[repr(C)]
759 #[derive(Clone, Copy, Debug)]
760 pub struct pa_card_profile_info2 {
761     pub name: *const c_char,
762     pub description: *const c_char,
763     pub n_sinks: u32,
764     pub n_sources: u32,
765     pub priority: u32,
766     pub available: c_int,
767 }
768 
769 impl ::std::default::Default for pa_card_profile_info2 {
default() -> Self770     fn default() -> Self {
771         unsafe { ::std::mem::zeroed() }
772     }
773 }
774 
775 #[repr(C)]
776 #[derive(Clone, Copy, Debug)]
777 pub struct pa_card_port_info {
778     pub name: *const c_char,
779     pub description: *const c_char,
780     pub priority: u32,
781     pub available: c_int,
782     pub direction: c_int,
783     pub n_profiles: u32,
784     pub profiles: *mut *mut pa_card_profile_info,
785     pub proplist: *mut pa_proplist,
786     pub latency_offset: i64,
787     pub profiles2: *mut *mut pa_card_profile_info2,
788 }
789 
790 impl ::std::default::Default for pa_card_port_info {
default() -> Self791     fn default() -> Self {
792         unsafe { ::std::mem::zeroed() }
793     }
794 }
795 
796 #[repr(C)]
797 #[derive(Clone, Copy, Debug)]
798 pub struct pa_card_info {
799     pub index: u32,
800     pub name: *const c_char,
801     pub owner_module: u32,
802     pub driver: *const c_char,
803     pub n_profiles: u32,
804     pub profiles: *mut pa_card_profile_info,
805     pub active_profile: *mut pa_card_profile_info,
806     pub proplist: *mut pa_proplist,
807     pub n_ports: u32,
808     pub ports: *mut *mut pa_card_port_info,
809     pub profiles2: *mut *mut pa_card_profile_info2,
810     pub active_profile2: *mut pa_card_profile_info2,
811 }
812 
813 impl ::std::default::Default for pa_card_info {
default() -> Self814     fn default() -> Self {
815         unsafe { ::std::mem::zeroed() }
816     }
817 }
818 
819 pub type pa_card_info_cb_t = Option<
820     unsafe extern "C" fn(
821         c: *mut pa_context,
822         i: *const pa_card_info,
823         eol: c_int,
824         userdata: *mut c_void,
825     ),
826 >;
827 
828 #[repr(C)]
829 #[derive(Clone, Copy, Debug)]
830 pub struct pa_sink_input_info {
831     pub index: u32,
832     pub name: *const c_char,
833     pub owner_module: u32,
834     pub client: u32,
835     pub sink: u32,
836     pub sample_spec: pa_sample_spec,
837     pub channel_map: pa_channel_map,
838     pub volume: pa_cvolume,
839     pub buffer_usec: pa_usec_t,
840     pub sink_usec: pa_usec_t,
841     pub resample_method: *const c_char,
842     pub driver: *const c_char,
843     pub mute: c_int,
844     pub proplist: *mut pa_proplist,
845     pub corked: c_int,
846     pub has_volume: c_int,
847     pub volume_writable: c_int,
848     pub format: *mut pa_format_info,
849 }
850 
851 impl ::std::default::Default for pa_sink_input_info {
default() -> Self852     fn default() -> Self {
853         unsafe { ::std::mem::zeroed() }
854     }
855 }
856 
857 pub type pa_sink_input_info_cb_t = Option<
858     unsafe extern "C" fn(
859         c: *mut pa_context,
860         i: *const pa_sink_input_info,
861         eol: c_int,
862         userdata: *mut c_void,
863     ),
864 >;
865 
866 #[repr(C)]
867 #[derive(Clone, Copy, Debug)]
868 pub struct pa_source_output_info {
869     pub index: u32,
870     pub name: *const c_char,
871     pub owner_module: u32,
872     pub client: u32,
873     pub source: u32,
874     pub sample_spec: pa_sample_spec,
875     pub channel_map: pa_channel_map,
876     pub buffer_usec: pa_usec_t,
877     pub source_usec: pa_usec_t,
878     pub resample_method: *const c_char,
879     pub driver: *const c_char,
880     pub proplist: *mut pa_proplist,
881     pub corked: c_int,
882     pub volume: pa_cvolume,
883     pub mute: c_int,
884     pub has_volume: c_int,
885     pub volume_writable: c_int,
886     pub format: *mut pa_format_info,
887 }
888 
889 impl ::std::default::Default for pa_source_output_info {
default() -> Self890     fn default() -> Self {
891         unsafe { ::std::mem::zeroed() }
892     }
893 }
894 
895 pub type pa_source_output_info_cb_t = Option<
896     unsafe extern "C" fn(
897         c: *mut pa_context,
898         i: *const pa_source_output_info,
899         eol: c_int,
900         userdata: *mut c_void,
901     ),
902 >;
903 
904 #[repr(C)]
905 #[derive(Clone, Copy, Debug)]
906 pub struct pa_stat_info {
907     pub memblock_total: u32,
908     pub memblock_total_size: u32,
909     pub memblock_allocated: u32,
910     pub memblock_allocated_size: u32,
911     pub scache_size: u32,
912 }
913 
914 impl ::std::default::Default for pa_stat_info {
default() -> Self915     fn default() -> Self {
916         unsafe { ::std::mem::zeroed() }
917     }
918 }
919 
920 pub type pa_stat_info_cb_t =
921     Option<unsafe extern "C" fn(c: *mut pa_context, i: *const pa_stat_info, userdata: *mut c_void)>;
922 
923 #[repr(C)]
924 #[derive(Clone, Copy, Debug)]
925 pub struct pa_sample_info {
926     pub index: u32,
927     pub name: *const c_char,
928     pub volume: pa_cvolume,
929     pub sample_spec: pa_sample_spec,
930     pub channel_map: pa_channel_map,
931     pub duration: pa_usec_t,
932     pub bytes: u32,
933     pub lazy: c_int,
934     pub filename: *const c_char,
935     pub proplist: *mut pa_proplist,
936 }
937 
938 impl ::std::default::Default for pa_sample_info {
default() -> Self939     fn default() -> Self {
940         unsafe { ::std::mem::zeroed() }
941     }
942 }
943 
944 pub type pa_sample_info_cb_t = Option<
945     unsafe extern "C" fn(
946         c: *mut pa_context,
947         i: *const pa_sample_info,
948         eol: c_int,
949         userdata: *mut c_void,
950     ),
951 >;
952 
953 pub const PA_AUTOLOAD_SINK: c_int = 0;
954 pub const PA_AUTOLOAD_SOURCE: c_int = 1;
955 pub type pa_autoload_type_t = c_int;
956 
957 #[repr(C)]
958 #[derive(Clone, Copy, Debug)]
959 pub struct pa_autoload_info {
960     pub index: u32,
961     pub name: *const c_char,
962     pub _type: pa_autoload_type_t,
963     pub module: *const c_char,
964     pub argument: *const c_char,
965 }
966 
967 impl ::std::default::Default for pa_autoload_info {
default() -> Self968     fn default() -> Self {
969         unsafe { ::std::mem::zeroed() }
970     }
971 }
972 
973 pub type pa_autoload_info_cb_t = Option<
974     unsafe extern "C" fn(
975         c: *mut pa_context,
976         i: *const pa_autoload_info,
977         eol: c_int,
978         userdata: *mut c_void,
979     ),
980 >;
981 pub type pa_context_subscribe_cb_t = Option<
982     unsafe extern "C" fn(
983         c: *mut pa_context,
984         t: pa_subscription_event_type_t,
985         idx: u32,
986         userdata: *mut c_void,
987     ),
988 >;
989 pub type pa_context_play_sample_cb_t =
990     Option<unsafe extern "C" fn(c: *mut pa_context, idx: u32, userdata: *mut c_void)>;
991 
992 pub enum pa_threaded_mainloop {}
993 pub enum pollfd {}
994 pub enum pa_mainloop {}
995 
996 pub type pa_poll_func = Option<
997     unsafe extern "C" fn(
998         ufds: *mut pollfd,
999         nfds: c_ulong,
1000         timeout: c_int,
1001         userdata: *mut c_void,
1002     ) -> c_int,
1003 >;
1004 pub enum pa_signal_event {}
1005 
1006 pub type pa_signal_cb_t = Option<
1007     unsafe extern "C" fn(
1008         api: *mut pa_mainloop_api,
1009         e: *mut pa_signal_event,
1010         sig: c_int,
1011         userdata: *mut c_void,
1012     ),
1013 >;
1014 pub type pa_signal_destroy_cb_t = Option<
1015     unsafe extern "C" fn(api: *mut pa_mainloop_api, e: *mut pa_signal_event, userdata: *mut c_void),
1016 >;
1017