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