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
// 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, QueueTimerCommon};
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::boxed::Box as Box_;
glib::wrapper! {
/// An object to express queue timer specific to instance in ALSA Timer.
///
/// A [`glib::object::Object`][crate::glib::object::Object] derived object class for queue timer specific to any instance in ALSA
/// Timer.
///
/// ## Properties
///
///
/// #### `device-id`
/// [`alsatimer::DeviceId`][crate::alsatimer::DeviceId] for the associated timer instance in ALSA Timer.
///
/// Readable | Writeable
///
///
/// #### `resolution-ticks`
/// The number of ticks as resolution of timer.
///
/// Readable | Writeable
/// <details><summary><h4>QueueTimerCommon</h4></summary>
///
///
/// #### `queue-id`
/// The numeric identifier of queue. An entry of [`SpecificClientId`][crate::SpecificClientId] is available as well.
///
/// Readable
///
///
/// #### `timer-type`
/// The type of timer for the queue, one of [`QueueTimerType`][crate::QueueTimerType].
///
/// Readable
/// </details>
///
/// # Implements
///
/// [`QueueTimerAlsaExt`][trait@crate::prelude::QueueTimerAlsaExt], [`QueueTimerCommonExt`][trait@crate::prelude::QueueTimerCommonExt]
#[doc(alias = "ALSASeqQueueTimerAlsa")]
pub struct QueueTimerAlsa(Object<ffi::ALSASeqQueueTimerAlsa, ffi::ALSASeqQueueTimerAlsaClass>) @implements QueueTimerCommon;
match fn {
type_ => || ffi::alsaseq_queue_timer_alsa_get_type(),
}
}
impl QueueTimerAlsa {
pub const NONE: Option<&'static QueueTimerAlsa> = None;
/// Allocate and return an instance of [`QueueTimerAlsa`][crate::QueueTimerAlsa].
///
/// # Returns
///
/// An instance of [`QueueTimerAlsa`][crate::QueueTimerAlsa].
#[doc(alias = "alsaseq_queue_timer_alsa_new")]
pub fn new() -> QueueTimerAlsa {
unsafe { from_glib_full(ffi::alsaseq_queue_timer_alsa_new()) }
}
}
impl Default for QueueTimerAlsa {
fn default() -> Self {
Self::new()
}
}
/// Trait containing all [`struct@QueueTimerAlsa`] methods.
///
/// # Implementors
///
/// [`QueueTimerAlsa`][struct@crate::QueueTimerAlsa]
pub trait QueueTimerAlsaExt: IsA<QueueTimerAlsa> + 'static {
/// [`alsatimer::DeviceId`][crate::alsatimer::DeviceId] for the associated timer instance in ALSA Timer.
#[doc(alias = "device-id")]
fn device_id(&self) -> Option<alsatimer::DeviceId> {
ObjectExt::property(self.as_ref(), "device-id")
}
/// [`alsatimer::DeviceId`][crate::alsatimer::DeviceId] for the associated timer instance in ALSA Timer.
#[doc(alias = "device-id")]
fn set_device_id(&self, device_id: Option<&alsatimer::DeviceId>) {
ObjectExt::set_property(self.as_ref(), "device-id", device_id)
}
/// The number of ticks as resolution of timer.
#[doc(alias = "resolution-ticks")]
fn resolution_ticks(&self) -> u32 {
ObjectExt::property(self.as_ref(), "resolution-ticks")
}
/// The number of ticks as resolution of timer.
#[doc(alias = "resolution-ticks")]
fn set_resolution_ticks(&self, resolution_ticks: u32) {
ObjectExt::set_property(self.as_ref(), "resolution-ticks", resolution_ticks)
}
#[doc(alias = "device-id")]
fn connect_device_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_device_id_trampoline<
P: IsA<QueueTimerAlsa>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSASeqQueueTimerAlsa,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(QueueTimerAlsa::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::device-id".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_device_id_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "resolution-ticks")]
fn connect_resolution_ticks_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_resolution_ticks_trampoline<
P: IsA<QueueTimerAlsa>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSASeqQueueTimerAlsa,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(QueueTimerAlsa::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::resolution-ticks".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_resolution_ticks_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl<O: IsA<QueueTimerAlsa>> QueueTimerAlsaExt for O {}