alsaseq/auto/
event_data_queue.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::translate::*;
8
9glib::wrapper! {
10    /// A boxed object to express data of queue event.
11    ///
12    /// A [`EventDataQueue`][crate::EventDataQueue] is a boxed object to express data of queue event. The instance of
13    /// object is one of data properties in event.
14    ///
15    /// The object wraps `struct snd_seq_ev_queue_control` in UAPI of Linux sound subsystem.
16    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
17    pub struct EventDataQueue(Boxed<ffi::ALSASeqEventDataQueue>);
18
19    match fn {
20        copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::alsaseq_event_data_queue_get_type(), ptr as *mut _) as *mut ffi::ALSASeqEventDataQueue,
21        free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::alsaseq_event_data_queue_get_type(), ptr as *mut _),
22        type_ => || ffi::alsaseq_event_data_queue_get_type(),
23    }
24}
25
26impl EventDataQueue {
27    /// Get the position as param of the queue event.
28    ///
29    /// # Returns
30    ///
31    ///
32    /// ## `position`
33    /// The position as param of the queue event.
34    #[doc(alias = "alsaseq_event_data_queue_get_position_param")]
35    #[doc(alias = "get_position_param")]
36    pub fn position_param(&self) -> u32 {
37        unsafe {
38            let mut position = std::mem::MaybeUninit::uninit();
39            ffi::alsaseq_event_data_queue_get_position_param(
40                self.to_glib_none().0,
41                position.as_mut_ptr(),
42            );
43            position.assume_init()
44        }
45    }
46
47    /// Get the numeric identifier of queue for the event.
48    ///
49    /// # Returns
50    ///
51    ///
52    /// ## `queue_id`
53    /// the numeric identifier of queue for the event.
54    #[doc(alias = "alsaseq_event_data_queue_get_queue_id")]
55    #[doc(alias = "get_queue_id")]
56    pub fn queue_id(&self) -> u8 {
57        unsafe {
58            let mut queue_id = std::mem::MaybeUninit::uninit();
59            ffi::alsaseq_event_data_queue_get_queue_id(
60                self.to_glib_none().0,
61                queue_id.as_mut_ptr(),
62            );
63            queue_id.assume_init()
64        }
65    }
66
67    /// Get the tick time as param of the queue event.
68    ///
69    /// # Returns
70    ///
71    ///
72    /// ## `tick_time`
73    /// The tick time as param of the queue event.
74    #[doc(alias = "alsaseq_event_data_queue_get_tick_time_param")]
75    #[doc(alias = "get_tick_time_param")]
76    pub fn tick_time_param(&self) -> u32 {
77        unsafe {
78            let mut tick_time = std::mem::MaybeUninit::uninit();
79            ffi::alsaseq_event_data_queue_get_tick_time_param(
80                self.to_glib_none().0,
81                tick_time.as_mut_ptr(),
82            );
83            tick_time.assume_init()
84        }
85    }
86
87    /// Get the value as param of the queue event.
88    ///
89    /// # Returns
90    ///
91    ///
92    /// ## `value`
93    /// The value as param of the queue event.
94    #[doc(alias = "alsaseq_event_data_queue_get_value_param")]
95    #[doc(alias = "get_value_param")]
96    pub fn value_param(&self) -> i32 {
97        unsafe {
98            let mut value = std::mem::MaybeUninit::uninit();
99            ffi::alsaseq_event_data_queue_get_value_param(
100                self.to_glib_none().0,
101                value.as_mut_ptr(),
102            );
103            value.assume_init()
104        }
105    }
106
107    /// Set the position as param of the queue event.
108    /// ## `position`
109    /// the position as param of the queue event.
110    #[doc(alias = "alsaseq_event_data_queue_set_position_param")]
111    pub fn set_position_param(&mut self, position: u32) {
112        unsafe {
113            ffi::alsaseq_event_data_queue_set_position_param(self.to_glib_none_mut().0, position);
114        }
115    }
116
117    /// Se the numeric identifier of queue for the event.
118    /// ## `queue_id`
119    /// The numeric identifier of queue for the event.
120    #[doc(alias = "alsaseq_event_data_queue_set_queue_id")]
121    pub fn set_queue_id(&mut self, queue_id: u8) {
122        unsafe {
123            ffi::alsaseq_event_data_queue_set_queue_id(self.to_glib_none_mut().0, queue_id);
124        }
125    }
126
127    /// Set the tick time as param of the queue event.
128    /// ## `tick_time`
129    /// The tick time as param of the queue event.
130    #[doc(alias = "alsaseq_event_data_queue_set_tick_time_param")]
131    pub fn set_tick_time_param(&mut self, tick_time: u32) {
132        unsafe {
133            ffi::alsaseq_event_data_queue_set_tick_time_param(self.to_glib_none_mut().0, tick_time);
134        }
135    }
136
137    /// Set the value as param of the queue event.
138    /// ## `value`
139    /// The value as param of the queue event.
140    #[doc(alias = "alsaseq_event_data_queue_set_value_param")]
141    pub fn set_value_param(&mut self, value: i32) {
142        unsafe {
143            ffi::alsaseq_event_data_queue_set_value_param(self.to_glib_none_mut().0, value);
144        }
145    }
146}
147
148unsafe impl Send for EventDataQueue {}