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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// 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 note event.
///
/// A [`EventDataNote`][crate::EventDataNote] is a boxed object to express data of note event. The instance of
/// object is one of data properties in event.
///
/// The object wraps `struct snd_seq_ev_note` in UAPI of Linux sound subsystem.
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EventDataNote(Boxed<ffi::ALSASeqEventDataNote>);
match fn {
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::alsaseq_event_data_note_get_type(), ptr as *mut _) as *mut ffi::ALSASeqEventDataNote,
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::alsaseq_event_data_note_get_type(), ptr as *mut _),
type_ => || ffi::alsaseq_event_data_note_get_type(),
}
}
impl EventDataNote {
/// Get the value of channel in the note event.
///
/// # Returns
///
///
/// ## `channel`
/// The value of channel in the note event.
#[doc(alias = "alsaseq_event_data_note_get_channel")]
#[doc(alias = "get_channel")]
pub fn channel(&self) -> u8 {
unsafe {
let mut channel = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_data_note_get_channel(self.to_glib_none().0, channel.as_mut_ptr());
channel.assume_init()
}
}
/// Get the value of duration in the note event.
///
/// # Returns
///
///
/// ## `duration`
/// The value of duratino in the note event.
#[doc(alias = "alsaseq_event_data_note_get_duration")]
#[doc(alias = "get_duration")]
pub fn duration(&self) -> u8 {
unsafe {
let mut duration = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_data_note_get_duration(self.to_glib_none().0, duration.as_mut_ptr());
duration.assume_init()
}
}
/// Get the value of note in the note event.
///
/// # Returns
///
///
/// ## `note`
/// The value of note in the note event.
#[doc(alias = "alsaseq_event_data_note_get_note")]
#[doc(alias = "get_note")]
pub fn note(&self) -> u8 {
unsafe {
let mut note = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_data_note_get_note(self.to_glib_none().0, note.as_mut_ptr());
note.assume_init()
}
}
/// Get the value of off-velocity in the note event.
///
/// # Returns
///
///
/// ## `off_velocity`
/// The value of off-velocity in the note event.
#[doc(alias = "alsaseq_event_data_note_get_off_velocity")]
#[doc(alias = "get_off_velocity")]
pub fn off_velocity(&self) -> u8 {
unsafe {
let mut off_velocity = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_data_note_get_off_velocity(
self.to_glib_none().0,
off_velocity.as_mut_ptr(),
);
off_velocity.assume_init()
}
}
/// Get the value of velocity in the note event.
///
/// # Returns
///
///
/// ## `velocity`
/// The value of velocity in the note event.
#[doc(alias = "alsaseq_event_data_note_get_velocity")]
#[doc(alias = "get_velocity")]
pub fn velocity(&self) -> u8 {
unsafe {
let mut velocity = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_data_note_get_velocity(self.to_glib_none().0, velocity.as_mut_ptr());
velocity.assume_init()
}
}
/// Set the value of channel for the note event.
/// ## `channel`
/// The value of channel for the note event.
#[doc(alias = "alsaseq_event_data_note_set_channel")]
pub fn set_channel(&mut self, channel: u8) {
unsafe {
ffi::alsaseq_event_data_note_set_channel(self.to_glib_none_mut().0, channel);
}
}
/// Set the value of duration for the note event.
/// ## `duration`
/// The value of duration for the note event.
#[doc(alias = "alsaseq_event_data_note_set_duration")]
pub fn set_duration(&mut self, duration: u8) {
unsafe {
ffi::alsaseq_event_data_note_set_duration(self.to_glib_none_mut().0, duration);
}
}
/// Set the value of note for the note event.
/// ## `note`
/// The value of note for the note event.
#[doc(alias = "alsaseq_event_data_note_set_note")]
pub fn set_note(&mut self, note: u8) {
unsafe {
ffi::alsaseq_event_data_note_set_note(self.to_glib_none_mut().0, note);
}
}
/// Set the value of note for the off-velocity event.
/// ## `off_velocity`
/// The value of note for the off-velocity event.
#[doc(alias = "alsaseq_event_data_note_set_off_velocity")]
pub fn set_off_velocity(&mut self, off_velocity: u8) {
unsafe {
ffi::alsaseq_event_data_note_set_off_velocity(self.to_glib_none_mut().0, off_velocity);
}
}
/// Set the value of note for the velocity event.
/// ## `velocity`
/// The value of note for the velocity event.
#[doc(alias = "alsaseq_event_data_note_set_velocity")]
pub fn set_velocity(&mut self, velocity: u8) {
unsafe {
ffi::alsaseq_event_data_note_set_velocity(self.to_glib_none_mut().0, velocity);
}
}
}
unsafe impl Send for EventDataNote {}