1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use crate::ffi;
use glib::translate::*;
glib::wrapper! {
/// A boxed object to express data of control event.
///
/// A [`EventDataCtl`][crate::EventDataCtl] is a boxed object to express data of control event. The instance of
/// object is one of data properties in event.
///
/// The object wraps `struct snd_seq_ev_ctrl` in UAPI of Linux sound subsystem.
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EventDataCtl(Boxed<ffi::ALSASeqEventDataCtl>);
match fn {
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::alsaseq_event_data_ctl_get_type(), ptr as *mut _) as *mut ffi::ALSASeqEventDataCtl,
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::alsaseq_event_data_ctl_get_type(), ptr as *mut _),
type_ => || ffi::alsaseq_event_data_ctl_get_type(),
}
}
impl EventDataCtl {
/// Get the value of channel for the control event.
///
/// # Returns
///
///
/// ## `channel`
/// The value of channel for the control event.
#[doc(alias = "alsaseq_event_data_ctl_get_channel")]
#[doc(alias = "get_channel")]
pub fn channel(&self) -> u8 {
unsafe {
let mut channel = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_data_ctl_get_channel(self.to_glib_none().0, channel.as_mut_ptr());
channel.assume_init()
}
}
/// Get the parameter for the control event.
///
/// # Returns
///
///
/// ## `param`
/// The parameter for the control event.
#[doc(alias = "alsaseq_event_data_ctl_get_param")]
#[doc(alias = "get_param")]
pub fn param(&self) -> u32 {
unsafe {
let mut param = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_data_ctl_get_param(self.to_glib_none().0, param.as_mut_ptr());
param.assume_init()
}
}
/// Get the value for the control event.
///
/// # Returns
///
///
/// ## `value`
/// The value for the control event.
#[doc(alias = "alsaseq_event_data_ctl_get_value")]
#[doc(alias = "get_value")]
pub fn value(&self) -> i32 {
unsafe {
let mut value = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_data_ctl_get_value(self.to_glib_none().0, value.as_mut_ptr());
value.assume_init()
}
}
/// Set the channel for the control event.
/// ## `channel`
/// The channel for the control event.
#[doc(alias = "alsaseq_event_data_ctl_set_channel")]
pub fn set_channel(&mut self, channel: u8) {
unsafe {
ffi::alsaseq_event_data_ctl_set_channel(self.to_glib_none_mut().0, channel);
}
}
/// Set the parameter for the control event.
/// ## `param`
/// The parameter for the control event.
#[doc(alias = "alsaseq_event_data_ctl_set_param")]
pub fn set_param(&mut self, param: u32) {
unsafe {
ffi::alsaseq_event_data_ctl_set_param(self.to_glib_none_mut().0, param);
}
}
/// Set the value for the control event.
/// ## `value`
/// The value for the control event.
#[doc(alias = "alsaseq_event_data_ctl_set_value")]
pub fn set_value(&mut self, value: i32) {
unsafe {
ffi::alsaseq_event_data_ctl_set_value(self.to_glib_none_mut().0, value);
}
}
}
unsafe impl Send for EventDataCtl {}