1#![doc = include_str!("../README.md")]
7#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
8#![allow(
9 clippy::approx_constant,
10 clippy::type_complexity,
11 clippy::unreadable_literal,
12 clippy::upper_case_acronyms
13)]
14#![cfg_attr(docsrs, feature(doc_cfg))]
15
16use glib_sys as glib;
17use gobject_sys as gobject;
18
19#[cfg(unix)]
20#[allow(unused_imports)]
21use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
22#[allow(unused_imports)]
23use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE};
24#[allow(unused_imports)]
25use std::ffi::{
26 c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
27};
28
29#[allow(unused_imports)]
30use glib::{gboolean, gconstpointer, gpointer, GType};
31
32pub type ALSATimerClass = c_int;
34pub const ALSATIMER_CLASS_NONE: ALSATimerClass = -1;
35pub const ALSATIMER_CLASS_GLOBAL: ALSATimerClass = 1;
36pub const ALSATIMER_CLASS_CARD: ALSATimerClass = 2;
37pub const ALSATIMER_CLASS_PCM: ALSATimerClass = 3;
38
39pub type ALSATimerEventType = c_int;
40pub const ALSATIMER_EVENT_TYPE_TICK_TIME: ALSATimerEventType = 0;
41pub const ALSATIMER_EVENT_TYPE_REAL_TIME: ALSATimerEventType = 1;
42
43pub type ALSATimerRealTimeEventType = c_int;
44pub const ALSATIMER_REAL_TIME_EVENT_TYPE_RESOLUTION: ALSATimerRealTimeEventType = 0;
45pub const ALSATIMER_REAL_TIME_EVENT_TYPE_TICK: ALSATimerRealTimeEventType = 1;
46pub const ALSATIMER_REAL_TIME_EVENT_TYPE_START: ALSATimerRealTimeEventType = 2;
47pub const ALSATIMER_REAL_TIME_EVENT_TYPE_STOP: ALSATimerRealTimeEventType = 3;
48pub const ALSATIMER_REAL_TIME_EVENT_TYPE_CONTINUE: ALSATimerRealTimeEventType = 4;
49pub const ALSATIMER_REAL_TIME_EVENT_TYPE_PAUSE: ALSATimerRealTimeEventType = 5;
50pub const ALSATIMER_REAL_TIME_EVENT_TYPE_EARLY: ALSATimerRealTimeEventType = 6;
51pub const ALSATIMER_REAL_TIME_EVENT_TYPE_SUSPEND: ALSATimerRealTimeEventType = 7;
52pub const ALSATIMER_REAL_TIME_EVENT_TYPE_RESUME: ALSATimerRealTimeEventType = 8;
53pub const ALSATIMER_REAL_TIME_EVENT_TYPE_MSTART: ALSATimerRealTimeEventType = 12;
54pub const ALSATIMER_REAL_TIME_EVENT_TYPE_MSTOP: ALSATimerRealTimeEventType = 13;
55pub const ALSATIMER_REAL_TIME_EVENT_TYPE_MCONTINUE: ALSATimerRealTimeEventType = 14;
56pub const ALSATIMER_REAL_TIME_EVENT_TYPE_MPAUSE: ALSATimerRealTimeEventType = 15;
57pub const ALSATIMER_REAL_TIME_EVENT_TYPE_MSUSPEND: ALSATimerRealTimeEventType = 17;
58pub const ALSATIMER_REAL_TIME_EVENT_TYPE_MRESUME: ALSATimerRealTimeEventType = 18;
59
60pub type ALSATimerSlaveClass = c_int;
61pub const ALSATIMER_SLAVE_CLASS_NONE: ALSATimerSlaveClass = 0;
62pub const ALSATIMER_SLAVE_CLASS_APPLICATION: ALSATimerSlaveClass = 1;
63pub const ALSATIMER_SLAVE_CLASS_SEQUENCER: ALSATimerSlaveClass = 2;
64
65pub type ALSATimerSpecificGlobalDevice = c_int;
66pub const ALSATIMER_SPECIFIC_GLOBAL_DEVICE_SYSTEM: ALSATimerSpecificGlobalDevice = 0;
67pub const ALSATIMER_SPECIFIC_GLOBAL_DEVICE_HRTIMER: ALSATimerSpecificGlobalDevice = 3;
68
69pub type ALSATimerUserInstanceError = c_int;
70pub const ALSATIMER_USER_INSTANCE_ERROR_FAILED: ALSATimerUserInstanceError = 0;
71pub const ALSATIMER_USER_INSTANCE_ERROR_TIMER_NOT_FOUND: ALSATimerUserInstanceError = 1;
72pub const ALSATIMER_USER_INSTANCE_ERROR_NOT_ATTACHED: ALSATimerUserInstanceError = 2;
73pub const ALSATIMER_USER_INSTANCE_ERROR_ATTACHED: ALSATimerUserInstanceError = 3;
74
75pub type ALSATimerDeviceInfoFlag = c_uint;
77pub const ALSATIMER_DEVICE_INFO_FLAG_SLAVE: ALSATimerDeviceInfoFlag = 1;
78
79pub type ALSATimerInstanceParamFlag = c_uint;
80pub const ALSATIMER_INSTANCE_PARAM_FLAG_AUTO: ALSATimerInstanceParamFlag = 1;
81pub const ALSATIMER_INSTANCE_PARAM_FLAG_EXCLUSIVE: ALSATimerInstanceParamFlag = 2;
82pub const ALSATIMER_INSTANCE_PARAM_FLAG_EARLY_EVENT: ALSATimerInstanceParamFlag = 4;
83
84#[repr(C)]
86#[allow(dead_code)]
87pub struct ALSATimerDeviceId {
88 _data: [u8; 0],
89 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
90}
91
92impl ::std::fmt::Debug for ALSATimerDeviceId {
93 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
94 f.debug_struct(&format!("ALSATimerDeviceId @ {self:p}"))
95 .finish()
96 }
97}
98
99#[derive(Copy, Clone)]
100#[repr(C)]
101pub struct ALSATimerDeviceInfoClass {
102 pub parent_class: gobject::GObjectClass,
103}
104
105impl ::std::fmt::Debug for ALSATimerDeviceInfoClass {
106 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
107 f.debug_struct(&format!("ALSATimerDeviceInfoClass @ {self:p}"))
108 .field("parent_class", &self.parent_class)
109 .finish()
110 }
111}
112
113#[derive(Copy, Clone)]
114#[repr(C)]
115pub struct ALSATimerDeviceParamsClass {
116 pub parent_class: gobject::GObjectClass,
117}
118
119impl ::std::fmt::Debug for ALSATimerDeviceParamsClass {
120 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
121 f.debug_struct(&format!("ALSATimerDeviceParamsClass @ {self:p}"))
122 .field("parent_class", &self.parent_class)
123 .finish()
124 }
125}
126
127#[derive(Copy, Clone)]
128#[repr(C)]
129pub struct ALSATimerDeviceStatusClass {
130 pub parent_class: gobject::GObjectClass,
131}
132
133impl ::std::fmt::Debug for ALSATimerDeviceStatusClass {
134 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
135 f.debug_struct(&format!("ALSATimerDeviceStatusClass @ {self:p}"))
136 .field("parent_class", &self.parent_class)
137 .finish()
138 }
139}
140
141#[derive(Copy, Clone)]
142#[repr(C)]
143pub struct ALSATimerInstanceInfoClass {
144 pub parent_class: gobject::GObjectClass,
145}
146
147impl ::std::fmt::Debug for ALSATimerInstanceInfoClass {
148 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
149 f.debug_struct(&format!("ALSATimerInstanceInfoClass @ {self:p}"))
150 .field("parent_class", &self.parent_class)
151 .finish()
152 }
153}
154
155#[derive(Copy, Clone)]
156#[repr(C)]
157pub struct ALSATimerInstanceParamsClass {
158 pub parent_class: gobject::GObjectClass,
159}
160
161impl ::std::fmt::Debug for ALSATimerInstanceParamsClass {
162 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
163 f.debug_struct(&format!("ALSATimerInstanceParamsClass @ {self:p}"))
164 .field("parent_class", &self.parent_class)
165 .finish()
166 }
167}
168
169#[derive(Copy, Clone)]
170#[repr(C)]
171pub struct ALSATimerInstanceStatusClass {
172 pub parent_class: gobject::GObjectClass,
173}
174
175impl ::std::fmt::Debug for ALSATimerInstanceStatusClass {
176 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
177 f.debug_struct(&format!("ALSATimerInstanceStatusClass @ {self:p}"))
178 .field("parent_class", &self.parent_class)
179 .finish()
180 }
181}
182
183#[repr(C)]
184#[allow(dead_code)]
185pub struct ALSATimerRealTimeEvent {
186 _data: [u8; 0],
187 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
188}
189
190impl ::std::fmt::Debug for ALSATimerRealTimeEvent {
191 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
192 f.debug_struct(&format!("ALSATimerRealTimeEvent @ {self:p}"))
193 .finish()
194 }
195}
196
197#[repr(C)]
198#[allow(dead_code)]
199pub struct ALSATimerTickTimeEvent {
200 _data: [u8; 0],
201 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
202}
203
204impl ::std::fmt::Debug for ALSATimerTickTimeEvent {
205 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
206 f.debug_struct(&format!("ALSATimerTickTimeEvent @ {self:p}"))
207 .finish()
208 }
209}
210
211#[derive(Copy, Clone)]
212#[repr(C)]
213pub struct ALSATimerUserInstanceClass {
214 pub parent_class: gobject::GObjectClass,
215 pub handle_tick_time_event:
216 Option<unsafe extern "C" fn(*mut ALSATimerUserInstance, *const ALSATimerTickTimeEvent)>,
217 pub handle_real_time_event:
218 Option<unsafe extern "C" fn(*mut ALSATimerUserInstance, *const ALSATimerRealTimeEvent)>,
219 pub handle_disconnection: Option<unsafe extern "C" fn(*mut ALSATimerUserInstance)>,
220}
221
222impl ::std::fmt::Debug for ALSATimerUserInstanceClass {
223 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
224 f.debug_struct(&format!("ALSATimerUserInstanceClass @ {self:p}"))
225 .field("parent_class", &self.parent_class)
226 .field("handle_tick_time_event", &self.handle_tick_time_event)
227 .field("handle_real_time_event", &self.handle_real_time_event)
228 .field("handle_disconnection", &self.handle_disconnection)
229 .finish()
230 }
231}
232
233#[derive(Copy, Clone)]
235#[repr(C)]
236pub struct ALSATimerDeviceInfo {
237 pub parent_instance: gobject::GObject,
238}
239
240impl ::std::fmt::Debug for ALSATimerDeviceInfo {
241 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
242 f.debug_struct(&format!("ALSATimerDeviceInfo @ {self:p}"))
243 .field("parent_instance", &self.parent_instance)
244 .finish()
245 }
246}
247
248#[derive(Copy, Clone)]
249#[repr(C)]
250pub struct ALSATimerDeviceParams {
251 pub parent_instance: gobject::GObject,
252}
253
254impl ::std::fmt::Debug for ALSATimerDeviceParams {
255 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
256 f.debug_struct(&format!("ALSATimerDeviceParams @ {self:p}"))
257 .field("parent_instance", &self.parent_instance)
258 .finish()
259 }
260}
261
262#[derive(Copy, Clone)]
263#[repr(C)]
264pub struct ALSATimerDeviceStatus {
265 pub parent_instance: gobject::GObject,
266}
267
268impl ::std::fmt::Debug for ALSATimerDeviceStatus {
269 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
270 f.debug_struct(&format!("ALSATimerDeviceStatus @ {self:p}"))
271 .field("parent_instance", &self.parent_instance)
272 .finish()
273 }
274}
275
276#[derive(Copy, Clone)]
277#[repr(C)]
278pub struct ALSATimerInstanceInfo {
279 pub parent_instance: gobject::GObject,
280}
281
282impl ::std::fmt::Debug for ALSATimerInstanceInfo {
283 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
284 f.debug_struct(&format!("ALSATimerInstanceInfo @ {self:p}"))
285 .field("parent_instance", &self.parent_instance)
286 .finish()
287 }
288}
289
290#[derive(Copy, Clone)]
291#[repr(C)]
292pub struct ALSATimerInstanceParams {
293 pub parent_instance: gobject::GObject,
294}
295
296impl ::std::fmt::Debug for ALSATimerInstanceParams {
297 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
298 f.debug_struct(&format!("ALSATimerInstanceParams @ {self:p}"))
299 .field("parent_instance", &self.parent_instance)
300 .finish()
301 }
302}
303
304#[derive(Copy, Clone)]
305#[repr(C)]
306pub struct ALSATimerInstanceStatus {
307 pub parent_instance: gobject::GObject,
308}
309
310impl ::std::fmt::Debug for ALSATimerInstanceStatus {
311 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
312 f.debug_struct(&format!("ALSATimerInstanceStatus @ {self:p}"))
313 .field("parent_instance", &self.parent_instance)
314 .finish()
315 }
316}
317
318#[derive(Copy, Clone)]
319#[repr(C)]
320pub struct ALSATimerUserInstance {
321 pub parent_instance: gobject::GObject,
322}
323
324impl ::std::fmt::Debug for ALSATimerUserInstance {
325 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
326 f.debug_struct(&format!("ALSATimerUserInstance @ {self:p}"))
327 .field("parent_instance", &self.parent_instance)
328 .finish()
329 }
330}
331
332extern "C" {
333
334 pub fn alsatimer_class_get_type() -> GType;
338
339 pub fn alsatimer_event_type_get_type() -> GType;
343
344 pub fn alsatimer_real_time_event_type_get_type() -> GType;
348
349 pub fn alsatimer_slave_class_get_type() -> GType;
353
354 pub fn alsatimer_specific_global_device_get_type() -> GType;
358
359 pub fn alsatimer_user_instance_error_get_type() -> GType;
363 pub fn alsatimer_user_instance_error_quark() -> glib::GQuark;
364
365 pub fn alsatimer_device_info_flag_get_type() -> GType;
369
370 pub fn alsatimer_instance_param_flag_get_type() -> GType;
374
375 pub fn alsatimer_device_id_get_type() -> GType;
379 pub fn alsatimer_device_id_new(
380 class: ALSATimerClass,
381 card_id: c_int,
382 device_id: c_int,
383 subdevice_id: c_int,
384 ) -> *mut ALSATimerDeviceId;
385 pub fn alsatimer_device_id_get_card_id(self_: *const ALSATimerDeviceId, card_id: *mut c_int);
386 pub fn alsatimer_device_id_get_class(
387 self_: *const ALSATimerDeviceId,
388 class: *mut ALSATimerClass,
389 );
390 pub fn alsatimer_device_id_get_device_id(
391 self_: *const ALSATimerDeviceId,
392 device_id: *mut c_int,
393 );
394 pub fn alsatimer_device_id_get_subdevice_id(
395 self_: *const ALSATimerDeviceId,
396 subdevice_id: *mut c_int,
397 );
398
399 pub fn alsatimer_real_time_event_get_type() -> GType;
403 pub fn alsatimer_real_time_event_get_event(
404 self_: *const ALSATimerRealTimeEvent,
405 event: *mut ALSATimerRealTimeEventType,
406 );
407 pub fn alsatimer_real_time_event_get_time(
408 self_: *const ALSATimerRealTimeEvent,
409 real_time: *const *mut [i64; 2],
410 );
411 pub fn alsatimer_real_time_event_get_val(
412 self_: *const ALSATimerRealTimeEvent,
413 val: *mut c_uint,
414 );
415
416 pub fn alsatimer_tick_time_event_get_type() -> GType;
420 pub fn alsatimer_tick_time_event_get_count(
421 self_: *const ALSATimerTickTimeEvent,
422 count: *mut c_uint,
423 );
424 pub fn alsatimer_tick_time_event_get_resolution(
425 self_: *const ALSATimerTickTimeEvent,
426 resolution: *mut c_uint,
427 );
428
429 pub fn alsatimer_device_info_get_type() -> GType;
433
434 pub fn alsatimer_device_params_get_type() -> GType;
438 pub fn alsatimer_device_params_new() -> *mut ALSATimerDeviceParams;
439
440 pub fn alsatimer_device_status_get_type() -> GType;
444 pub fn alsatimer_device_status_new() -> *mut ALSATimerDeviceStatus;
445
446 pub fn alsatimer_instance_info_get_type() -> GType;
450
451 pub fn alsatimer_instance_params_get_type() -> GType;
455 pub fn alsatimer_instance_params_new() -> *mut ALSATimerInstanceParams;
456 pub fn alsatimer_instance_params_get_event_filter(
457 self_: *mut ALSATimerInstanceParams,
458 entries: *mut *mut ALSATimerRealTimeEventType,
459 entry_count: *mut size_t,
460 error: *mut *mut glib::GError,
461 ) -> gboolean;
462 pub fn alsatimer_instance_params_set_event_filter(
463 self_: *mut ALSATimerInstanceParams,
464 entries: *const ALSATimerRealTimeEventType,
465 entry_count: size_t,
466 error: *mut *mut glib::GError,
467 ) -> gboolean;
468
469 pub fn alsatimer_instance_status_get_type() -> GType;
473 pub fn alsatimer_instance_status_new() -> *mut ALSATimerInstanceStatus;
474 pub fn alsatimer_instance_status_get_time(
475 self_: *mut ALSATimerInstanceStatus,
476 real_time: *mut *const [i64; 2],
477 );
478
479 pub fn alsatimer_user_instance_get_type() -> GType;
483 pub fn alsatimer_user_instance_new() -> *mut ALSATimerUserInstance;
484 pub fn alsatimer_user_instance_attach(
485 self_: *mut ALSATimerUserInstance,
486 device_id: *mut ALSATimerDeviceId,
487 error: *mut *mut glib::GError,
488 ) -> gboolean;
489 pub fn alsatimer_user_instance_attach_as_slave(
490 self_: *mut ALSATimerUserInstance,
491 slave_class: ALSATimerSlaveClass,
492 slave_id: c_int,
493 error: *mut *mut glib::GError,
494 ) -> gboolean;
495 pub fn alsatimer_user_instance_choose_event_type(
496 self_: *mut ALSATimerUserInstance,
497 event_type: ALSATimerEventType,
498 error: *mut *mut glib::GError,
499 ) -> gboolean;
500 pub fn alsatimer_user_instance_continue(
501 self_: *mut ALSATimerUserInstance,
502 error: *mut *mut glib::GError,
503 ) -> gboolean;
504 pub fn alsatimer_user_instance_create_source(
505 self_: *mut ALSATimerUserInstance,
506 gsrc: *mut *mut glib::GSource,
507 error: *mut *mut glib::GError,
508 ) -> gboolean;
509 pub fn alsatimer_user_instance_get_info(
510 self_: *mut ALSATimerUserInstance,
511 instance_info: *mut *mut ALSATimerInstanceInfo,
512 error: *mut *mut glib::GError,
513 ) -> gboolean;
514 pub fn alsatimer_user_instance_get_protocol_version(
515 self_: *mut ALSATimerUserInstance,
516 proto_ver_triplet: *mut *const [u16; 3],
517 error: *mut *mut glib::GError,
518 ) -> gboolean;
519 pub fn alsatimer_user_instance_get_status(
520 self_: *mut ALSATimerUserInstance,
521 instance_status: *const *mut ALSATimerInstanceStatus,
522 error: *mut *mut glib::GError,
523 ) -> gboolean;
524 pub fn alsatimer_user_instance_open(
525 self_: *mut ALSATimerUserInstance,
526 open_flag: c_int,
527 error: *mut *mut glib::GError,
528 ) -> gboolean;
529 pub fn alsatimer_user_instance_pause(
530 self_: *mut ALSATimerUserInstance,
531 error: *mut *mut glib::GError,
532 ) -> gboolean;
533 pub fn alsatimer_user_instance_set_params(
534 self_: *mut ALSATimerUserInstance,
535 instance_params: *const *mut ALSATimerInstanceParams,
536 error: *mut *mut glib::GError,
537 ) -> gboolean;
538 pub fn alsatimer_user_instance_start(
539 self_: *mut ALSATimerUserInstance,
540 error: *mut *mut glib::GError,
541 ) -> gboolean;
542 pub fn alsatimer_user_instance_stop(
543 self_: *mut ALSATimerUserInstance,
544 error: *mut *mut glib::GError,
545 ) -> gboolean;
546
547 pub fn alsatimer_get_device_id_list(
551 entries: *mut *mut glib::GList,
552 error: *mut *mut glib::GError,
553 ) -> gboolean;
554 pub fn alsatimer_get_device_info(
555 device_id: *mut ALSATimerDeviceId,
556 device_info: *mut *mut ALSATimerDeviceInfo,
557 error: *mut *mut glib::GError,
558 ) -> gboolean;
559 pub fn alsatimer_get_device_status(
560 device_id: *mut ALSATimerDeviceId,
561 device_status: *const *mut ALSATimerDeviceStatus,
562 error: *mut *mut glib::GError,
563 ) -> gboolean;
564 pub fn alsatimer_get_devnode(
565 devnode: *mut *mut c_char,
566 error: *mut *mut glib::GError,
567 ) -> gboolean;
568 pub fn alsatimer_get_real_time_clock_id(
569 clock_id: *mut c_int,
570 error: *mut *mut glib::GError,
571 ) -> gboolean;
572 pub fn alsatimer_get_sysname(
573 sysname: *mut *mut c_char,
574 error: *mut *mut glib::GError,
575 ) -> gboolean;
576 pub fn alsatimer_set_device_params(
577 device_id: *mut ALSATimerDeviceId,
578 device_params: *const ALSATimerDeviceParams,
579 error: *mut *mut glib::GError,
580 ) -> gboolean;
581
582}