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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
// 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, Addr, EventDataConnect, EventDataCtl, EventDataNote, EventDataQueue, EventDataResult,
EventLengthMode, EventPriorityMode, EventTimeMode, EventTstampMode, EventType,
};
use glib::translate::*;
glib::wrapper! {
/// A boxed structure for sequencer event.
///
/// A [`Event`][crate::Event] expresses any type of event in ALSA Sequencer. The event consists of some
/// product-type propertiess and two variant-type properties.
///
/// The instance should be released by call of `boxed_free()` since it can point to the
/// other allocated object for blob data, therefore it's preferable to use `boxed_copy()`
/// to duplicate the instance so that the blob data is going to be duplicated as well.
///
/// This is the list of product-type properties:
///
/// - the type of event
/// - the mode of time stamp
/// - the mode of time
/// - the mode of length
/// - the mode of priority
/// - the numeric value of tag associated to the event
/// - the numeric identifier of queue to schedule the event
/// - destination address
/// - source address
///
/// One of variant-type property is for time stamp.
///
/// - tick count as time stamp of event
/// - real time as time stamp of event
///
/// Another variant-type property is for data of event.
///
/// - note
/// - control
/// - 12 bytes
/// - 3 quadlets
/// - blob as variable length of bytes
/// - pointer in VMA of user process
/// - queue control
/// - tick count as arbitrary time stamp
/// - real time as arbitrary time stamp
/// - arbitrary address
/// - connection between source and destination addresses
/// - result
///
/// The type of time stamp is associated to the mode of time stamp, while the type of data is
/// associated to the type of event loosely. Each of the variant type property has single storage
/// internally, thus an event can includes the sole variant.
///
/// The object wraps `struct snd_seq_event` in UAPI of Linux sound subsystem.
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Event(Boxed<ffi::ALSASeqEvent>);
match fn {
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::alsaseq_event_get_type(), ptr as *mut _) as *mut ffi::ALSASeqEvent,
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::alsaseq_event_get_type(), ptr as *mut _),
type_ => || ffi::alsaseq_event_get_type(),
}
}
impl Event {
/// Allocate and return an instance of [`Event`][crate::Event].
/// ## `event_type`
/// A [`EventType`][crate::EventType].
///
/// # Returns
///
/// An instance of [`Event`][crate::Event].
#[doc(alias = "alsaseq_event_new")]
pub fn new(event_type: EventType) -> Event {
unsafe { from_glib_full(ffi::alsaseq_event_new(event_type.into_glib())) }
}
/// Calculate the number of cells in client pool to be consumed when the event is delivered.
/// The comparison to properties of [`ClientPool`][crate::ClientPool] is useful when scheduling the event.
///
/// # Returns
///
///
/// ## `cells`
/// The number of consumed cells in client pool.
#[doc(alias = "alsaseq_event_calculate_pool_consumption")]
pub fn calculate_pool_consumption(&self) -> u32 {
unsafe {
let mut cells = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_calculate_pool_consumption(
self.to_glib_none().0,
cells.as_mut_ptr(),
);
cells.assume_init()
}
}
/// Get the type of event.
///
/// # Returns
///
///
/// ## `event_type`
/// A [`EventType`][crate::EventType].
#[doc(alias = "alsaseq_event_get_event_type")]
#[doc(alias = "get_event_type")]
pub fn event_type(&self) -> EventType {
unsafe {
let mut event_type = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_get_event_type(self.to_glib_none().0, event_type.as_mut_ptr());
from_glib(event_type.assume_init())
}
}
/// Get the mode of data length for the event.
///
/// # Returns
///
///
/// ## `length_mode`
/// A [`EventLengthMode`][crate::EventLengthMode] for the mode of data length.
#[doc(alias = "alsaseq_event_get_length_mode")]
#[doc(alias = "get_length_mode")]
pub fn length_mode(&self) -> EventLengthMode {
unsafe {
let mut length_mode = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_get_length_mode(self.to_glib_none().0, length_mode.as_mut_ptr());
from_glib(length_mode.assume_init())
}
}
/// Get the mode of priority for the event.
///
/// # Returns
///
///
/// ## `priority_mode`
/// A [`EventPriorityMode`][crate::EventPriorityMode] The mode of priority.
#[doc(alias = "alsaseq_event_get_priority_mode")]
#[doc(alias = "get_priority_mode")]
pub fn priority_mode(&self) -> EventPriorityMode {
unsafe {
let mut priority_mode = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_get_priority_mode(self.to_glib_none().0, priority_mode.as_mut_ptr());
from_glib(priority_mode.assume_init())
}
}
/// Get the numeric identifier of queue to schedule the event.
///
/// # Returns
///
///
/// ## `queue_id`
/// The numeric identifier of queue.
#[doc(alias = "alsaseq_event_get_queue_id")]
#[doc(alias = "get_queue_id")]
pub fn queue_id(&self) -> u8 {
unsafe {
let mut queue_id = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_get_queue_id(self.to_glib_none().0, queue_id.as_mut_ptr());
queue_id.assume_init()
}
}
/// Get the numeric value of tag associated to the event.
///
/// # Returns
///
///
/// ## `tag`
/// The numeric value of tag.
#[doc(alias = "alsaseq_event_get_tag")]
#[doc(alias = "get_tag")]
pub fn tag(&self) -> i8 {
unsafe {
let mut tag = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_get_tag(self.to_glib_none().0, tag.as_mut_ptr());
tag.assume_init()
}
}
/// Get the mode of time for the event.
///
/// # Returns
///
///
/// ## `time_mode`
/// A [`EventTimeMode`][crate::EventTimeMode] for the mode of time.
#[doc(alias = "alsaseq_event_get_time_mode")]
#[doc(alias = "get_time_mode")]
pub fn time_mode(&self) -> EventTimeMode {
unsafe {
let mut time_mode = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_get_time_mode(self.to_glib_none().0, time_mode.as_mut_ptr());
from_glib(time_mode.assume_init())
}
}
/// Get the mode of time stamp for the event.
///
/// # Returns
///
///
/// ## `tstamp_mode`
/// A [`EventTstampMode`][crate::EventTstampMode] for the mode of time stamp.
#[doc(alias = "alsaseq_event_get_tstamp_mode")]
#[doc(alias = "get_tstamp_mode")]
pub fn tstamp_mode(&self) -> EventTstampMode {
unsafe {
let mut tstamp_mode = std::mem::MaybeUninit::uninit();
ffi::alsaseq_event_get_tstamp_mode(self.to_glib_none().0, tstamp_mode.as_mut_ptr());
from_glib(tstamp_mode.assume_init())
}
}
/// Get the address data of event, available when [`event_type()`][Self::event_type()] results in one of:
///
/// - [`EventType`][crate::EventType].CLIENT_START
/// - [`EventType`][crate::EventType].CLIENT_EXIT
/// - [`EventType`][crate::EventType].CLIENT_CHANGE
/// - [`EventType`][crate::EventType].PORT_START
/// - [`EventType`][crate::EventType].PORT_EXIT
/// - [`EventType`][crate::EventType].PORT_CHANGE
/// - [`EventType`][crate::EventType].USR0
/// - [`EventType`][crate::EventType].USR1
/// - [`EventType`][crate::EventType].USR2
/// - [`EventType`][crate::EventType].USR3
/// - [`EventType`][crate::EventType].USR4
/// - [`EventType`][crate::EventType].USR5
/// - [`EventType`][crate::EventType].USR6
/// - [`EventType`][crate::EventType].USR7
/// - [`EventType`][crate::EventType].USR8
/// - [`EventType`][crate::EventType].USR9
/// ## `data`
/// The address data of event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_addr_data")]
pub fn set_addr_data(&mut self, data: &Addr) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::alsaseq_event_set_addr_data(
self.to_glib_none_mut().0,
data.to_glib_none().0,
&mut error,
);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Copy the quadlet data to the event, available when [`event_type()`][Self::event_type()] results in one of:
///
/// - [`EventType`][crate::EventType].SYSEX
/// - [`EventType`][crate::EventType].BOUNCE
/// - [`EventType`][crate::EventType].USR_VAR0
/// - [`EventType`][crate::EventType].USR_VAR1
/// - [`EventType`][crate::EventType].USR_VAR2
/// - [`EventType`][crate::EventType].USR_VAR3
/// - [`EventType`][crate::EventType].USR_VAR4
/// ## `data`
/// The pointer to blob data for the event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_blob_data")]
pub fn set_blob_data(&mut self, data: &[u8]) -> Result<(), glib::Error> {
let length = data.len() as _;
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::alsaseq_event_set_blob_data(
self.to_glib_none_mut().0,
data.to_glib_none().0,
length,
&mut error,
);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Copy the connect data to the event, available when [`event_type()`][Self::event_type()] results in one of:
///
/// - [`EventType`][crate::EventType].PORT_SUBSCRIBED
/// - [`EventType`][crate::EventType].PORT_UNSUBSCRIBED
/// - [`EventType`][crate::EventType].USR0
/// - [`EventType`][crate::EventType].USR1
/// - [`EventType`][crate::EventType].USR2
/// - [`EventType`][crate::EventType].USR3
/// - [`EventType`][crate::EventType].USR4
/// - [`EventType`][crate::EventType].USR5
/// - [`EventType`][crate::EventType].USR6
/// - [`EventType`][crate::EventType].USR7
/// - [`EventType`][crate::EventType].USR8
/// - [`EventType`][crate::EventType].USR9
/// ## `data`
/// The connect data of event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_connect_data")]
pub fn set_connect_data(&mut self, data: &EventDataConnect) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::alsaseq_event_set_connect_data(
self.to_glib_none_mut().0,
data.to_glib_none().0,
&mut error,
);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Copy the control data, available when [`event_type()`][Self::event_type()] results in one of:
///
/// - [`EventType`][crate::EventType].CONTROLLER
/// - [`EventType`][crate::EventType].PGMCHANGE
/// - [`EventType`][crate::EventType].CHANPRESS
/// - [`EventType`][crate::EventType].PITCHBEND
/// - [`EventType`][crate::EventType].CONTROL14
/// - [`EventType`][crate::EventType].NONREGPARAM
/// - [`EventType`][crate::EventType].REGPARAM
/// - [`EventType`][crate::EventType].SONGPOS
/// - [`EventType`][crate::EventType].SONGSEL
/// - [`EventType`][crate::EventType].QFRAME
/// - [`EventType`][crate::EventType].TIMESIGN
/// - [`EventType`][crate::EventType].KEYSIGN
/// - [`EventType`][crate::EventType].USR0
/// - [`EventType`][crate::EventType].USR1
/// - [`EventType`][crate::EventType].USR2
/// - [`EventType`][crate::EventType].USR3
/// - [`EventType`][crate::EventType].USR4
/// - [`EventType`][crate::EventType].USR5
/// - [`EventType`][crate::EventType].USR6
/// - [`EventType`][crate::EventType].USR7
/// - [`EventType`][crate::EventType].USR8
/// - [`EventType`][crate::EventType].USR9
/// ## `data`
/// The control data of event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_ctl_data")]
pub fn set_ctl_data(&mut self, data: &EventDataCtl) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::alsaseq_event_set_ctl_data(
self.to_glib_none_mut().0,
data.to_glib_none().0,
&mut error,
);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Copy the address as destination of event.
/// ## `addr`
/// A [`Addr`][crate::Addr] for event destination.
#[doc(alias = "alsaseq_event_set_destination")]
pub fn set_destination(&mut self, addr: &Addr) {
unsafe {
ffi::alsaseq_event_set_destination(self.to_glib_none_mut().0, addr.to_glib_none().0);
}
}
/// Copy the note data, available when [`event_type()`][Self::event_type()] results in one of:
///
/// - [`EventType`][crate::EventType].NOTE
/// - [`EventType`][crate::EventType].NOTEON
/// - [`EventType`][crate::EventType].NOTEOFF
/// - [`EventType`][crate::EventType].KEYPRESS
/// - [`EventType`][crate::EventType].USR0
/// - [`EventType`][crate::EventType].USR1
/// - [`EventType`][crate::EventType].USR2
/// - [`EventType`][crate::EventType].USR3
/// - [`EventType`][crate::EventType].USR4
/// - [`EventType`][crate::EventType].USR5
/// - [`EventType`][crate::EventType].USR6
/// - [`EventType`][crate::EventType].USR7
/// - [`EventType`][crate::EventType].USR8
/// - [`EventType`][crate::EventType].USR9
/// ## `data`
/// The note data of event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_note_data")]
pub fn set_note_data(&mut self, data: &EventDataNote) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::alsaseq_event_set_note_data(
self.to_glib_none_mut().0,
data.to_glib_none().0,
&mut error,
);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Set the mode of priority for the event.
/// ## `priority_mode`
/// A [`EventPriorityMode`][crate::EventPriorityMode] for the mode of priority.
#[doc(alias = "alsaseq_event_set_priority_mode")]
pub fn set_priority_mode(&mut self, priority_mode: EventPriorityMode) {
unsafe {
ffi::alsaseq_event_set_priority_mode(
self.to_glib_none_mut().0,
priority_mode.into_glib(),
);
}
}
/// Copy the queue data to the event, available when [`event_type()`][Self::event_type()] results in one of:
///
/// - [`EventType`][crate::EventType].START
/// - [`EventType`][crate::EventType].CONTINUE
/// - [`EventType`][crate::EventType].STOP
/// - [`EventType`][crate::EventType].SETPOS_TICK
/// - [`EventType`][crate::EventType].SETPOS_TIME
/// - [`EventType`][crate::EventType].TEMPO
/// - [`EventType`][crate::EventType].CLOCK
/// - [`EventType`][crate::EventType].TICK
/// - [`EventType`][crate::EventType].QUEUE_SKEW
/// - [`EventType`][crate::EventType].USR0
/// - [`EventType`][crate::EventType].USR1
/// - [`EventType`][crate::EventType].USR2
/// - [`EventType`][crate::EventType].USR3
/// - [`EventType`][crate::EventType].USR4
/// - [`EventType`][crate::EventType].USR5
/// - [`EventType`][crate::EventType].USR6
/// - [`EventType`][crate::EventType].USR7
/// - [`EventType`][crate::EventType].USR8
/// - [`EventType`][crate::EventType].USR9
/// ## `data`
/// The queue data of event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_queue_data")]
pub fn set_queue_data(&mut self, data: &EventDataQueue) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::alsaseq_event_set_queue_data(
self.to_glib_none_mut().0,
data.to_glib_none().0,
&mut error,
);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Set the numeric identifier of queue to schedule the event.
/// ## `queue_id`
/// The numeric identifier of queue.
#[doc(alias = "alsaseq_event_set_queue_id")]
pub fn set_queue_id(&mut self, queue_id: u8) {
unsafe {
ffi::alsaseq_event_set_queue_id(self.to_glib_none_mut().0, queue_id);
}
}
/// Copy the result data to the event, available when [`event_type()`][Self::event_type()] results in one of:
///
/// - [`EventType`][crate::EventType].SYSTEM
/// - [`EventType`][crate::EventType].RESULT
/// - [`EventType`][crate::EventType].USR0
/// - [`EventType`][crate::EventType].USR1
/// - [`EventType`][crate::EventType].USR2
/// - [`EventType`][crate::EventType].USR3
/// - [`EventType`][crate::EventType].USR4
/// - [`EventType`][crate::EventType].USR5
/// - [`EventType`][crate::EventType].USR6
/// - [`EventType`][crate::EventType].USR7
/// - [`EventType`][crate::EventType].USR8
/// - [`EventType`][crate::EventType].USR9
/// ## `data`
/// The result data of event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_result_data")]
pub fn set_result_data(&mut self, data: &EventDataResult) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::alsaseq_event_set_result_data(
self.to_glib_none_mut().0,
data.to_glib_none().0,
&mut error,
);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Copy the address as source of event.
/// ## `addr`
/// A [`Addr`][crate::Addr] for source address.
#[doc(alias = "alsaseq_event_set_source")]
pub fn set_source(&mut self, addr: &Addr) {
unsafe {
ffi::alsaseq_event_set_source(self.to_glib_none_mut().0, addr.to_glib_none().0);
}
}
/// Set the numeric value of tag associated to the event.
/// ## `tag`
/// The numeric value of tag.
#[doc(alias = "alsaseq_event_set_tag")]
pub fn set_tag(&mut self, tag: i8) {
unsafe {
ffi::alsaseq_event_set_tag(self.to_glib_none_mut().0, tag);
}
}
/// Copy the real time to the event and set [`EventTstampMode`][crate::EventTstampMode].TICK.
/// ## `tick_time`
/// The tick time of event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_tick_time")]
pub fn set_tick_time(&mut self, tick_time: u32) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok =
ffi::alsaseq_event_set_tick_time(self.to_glib_none_mut().0, tick_time, &mut error);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Copy the tick time data to the event, available when [`tstamp_mode()`][Self::tstamp_mode()] is
/// [`EventTstampMode`][crate::EventTstampMode].TICK and [`event_type()`][Self::event_type()] results in one of:
///
/// - [`EventType`][crate::EventType].USR0
/// - [`EventType`][crate::EventType].USR1
/// - [`EventType`][crate::EventType].USR2
/// - [`EventType`][crate::EventType].USR3
/// - [`EventType`][crate::EventType].USR4
/// - [`EventType`][crate::EventType].USR5
/// - [`EventType`][crate::EventType].USR6
/// - [`EventType`][crate::EventType].USR7
/// - [`EventType`][crate::EventType].USR8
/// - [`EventType`][crate::EventType].USR9
/// ## `tick_time`
/// The tick time data of event.
///
/// # Returns
///
/// [`true`] when the overall operation finishes successfully, else [`false`].
#[doc(alias = "alsaseq_event_set_tick_time_data")]
pub fn set_tick_time_data(&mut self, tick_time: u32) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::alsaseq_event_set_tick_time_data(
self.to_glib_none_mut().0,
tick_time,
&mut error,
);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
/// Set the mode of time for the event.
/// ## `time_mode`
/// A [`EventTimeMode`][crate::EventTimeMode] for the mode of time.
#[doc(alias = "alsaseq_event_set_time_mode")]
pub fn set_time_mode(&mut self, time_mode: EventTimeMode) {
unsafe {
ffi::alsaseq_event_set_time_mode(self.to_glib_none_mut().0, time_mode.into_glib());
}
}
}
unsafe impl Send for Event {}