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
// 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::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::boxed::Box as Box_;
glib::wrapper! {
/// A GObject-derived object to express information of pool owned by client.
///
/// A [`ClientPool`][crate::ClientPool] is a GObject-derived object to express information of pool owned by
/// client. The pool consists of a batch of cells to store message contents in kernel space. The
/// call of [`client_pool()`][crate::client_pool()] returns the instance of object. The call of
/// [`UserClientExt::set_pool()`][crate::prelude::UserClientExt::set_pool()]) and [`UserClientExtManual::pool()`][crate::prelude::UserClientExtManual::pool()] require the instance of object.
///
/// The object wraps `struct snd_seq_client_pool` in UAPI of Linux sound subsystem.
///
/// ## Properties
///
///
/// #### `client-id`
/// The numeric ID of client. One of [`SpecificClientId`][crate::SpecificClientId] is available as well as any
/// numeric value.
///
/// Readable
///
///
/// #### `input-free`
/// The current number of free cells in memory pool for input direction.
///
/// Readable | Writeable
///
///
/// #### `input-pool`
/// The total number of cells in memory pool for input direction. The client dequeue any event
/// from the pool when the event is copied from the output memory pool of source client.
///
/// Readable | Writeable
///
///
/// #### `output-free`
/// The current number of free cells in memory pool for output direction.
///
/// Readable | Writeable
///
///
/// #### `output-pool`
/// The total number of cells in memory pool for output direction. The client enqueue any event
/// into the pool at scheduling, then the event is copied to input memory pool of destination
/// client.
///
/// Readable | Writeable
///
///
/// #### `output-room`
/// The number of cells in memory pool for output direction as threshold for writable condition
/// at the result of poll(2). The property is useless for [`UserClient`][crate::UserClient] since it doesn't
/// perform poll(2) to check writable or not.
///
/// Readable | Writeable
///
/// # Implements
///
/// [`ClientPoolExt`][trait@crate::prelude::ClientPoolExt]
#[doc(alias = "ALSASeqClientPool")]
pub struct ClientPool(Object<ffi::ALSASeqClientPool, ffi::ALSASeqClientPoolClass>);
match fn {
type_ => || ffi::alsaseq_client_pool_get_type(),
}
}
impl ClientPool {
pub const NONE: Option<&'static ClientPool> = None;
#[doc(alias = "alsaseq_client_pool_new")]
pub fn new() -> ClientPool {
unsafe { from_glib_full(ffi::alsaseq_client_pool_new()) }
}
}
impl Default for ClientPool {
fn default() -> Self {
Self::new()
}
}
/// Trait containing all [`struct@ClientPool`] methods.
///
/// # Implementors
///
/// [`ClientPool`][struct@crate::ClientPool]
pub trait ClientPoolExt: IsA<ClientPool> + 'static {
/// The numeric ID of client. One of [`SpecificClientId`][crate::SpecificClientId] is available as well as any
/// numeric value.
#[doc(alias = "client-id")]
fn client_id(&self) -> u8 {
ObjectExt::property(self.as_ref(), "client-id")
}
/// The current number of free cells in memory pool for input direction.
#[doc(alias = "input-free")]
fn input_free(&self) -> u32 {
ObjectExt::property(self.as_ref(), "input-free")
}
/// The current number of free cells in memory pool for input direction.
#[doc(alias = "input-free")]
fn set_input_free(&self, input_free: u32) {
ObjectExt::set_property(self.as_ref(), "input-free", input_free)
}
/// The total number of cells in memory pool for input direction. The client dequeue any event
/// from the pool when the event is copied from the output memory pool of source client.
#[doc(alias = "input-pool")]
fn input_pool(&self) -> u32 {
ObjectExt::property(self.as_ref(), "input-pool")
}
/// The total number of cells in memory pool for input direction. The client dequeue any event
/// from the pool when the event is copied from the output memory pool of source client.
#[doc(alias = "input-pool")]
fn set_input_pool(&self, input_pool: u32) {
ObjectExt::set_property(self.as_ref(), "input-pool", input_pool)
}
/// The current number of free cells in memory pool for output direction.
#[doc(alias = "output-free")]
fn output_free(&self) -> u32 {
ObjectExt::property(self.as_ref(), "output-free")
}
/// The current number of free cells in memory pool for output direction.
#[doc(alias = "output-free")]
fn set_output_free(&self, output_free: u32) {
ObjectExt::set_property(self.as_ref(), "output-free", output_free)
}
/// The total number of cells in memory pool for output direction. The client enqueue any event
/// into the pool at scheduling, then the event is copied to input memory pool of destination
/// client.
#[doc(alias = "output-pool")]
fn output_pool(&self) -> u32 {
ObjectExt::property(self.as_ref(), "output-pool")
}
/// The total number of cells in memory pool for output direction. The client enqueue any event
/// into the pool at scheduling, then the event is copied to input memory pool of destination
/// client.
#[doc(alias = "output-pool")]
fn set_output_pool(&self, output_pool: u32) {
ObjectExt::set_property(self.as_ref(), "output-pool", output_pool)
}
/// The number of cells in memory pool for output direction as threshold for writable condition
/// at the result of poll(2). The property is useless for [`UserClient`][crate::UserClient] since it doesn't
/// perform poll(2) to check writable or not.
#[doc(alias = "output-room")]
fn output_room(&self) -> u32 {
ObjectExt::property(self.as_ref(), "output-room")
}
/// The number of cells in memory pool for output direction as threshold for writable condition
/// at the result of poll(2). The property is useless for [`UserClient`][crate::UserClient] since it doesn't
/// perform poll(2) to check writable or not.
#[doc(alias = "output-room")]
fn set_output_room(&self, output_room: u32) {
ObjectExt::set_property(self.as_ref(), "output-room", output_room)
}
#[doc(alias = "client-id")]
fn connect_client_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_client_id_trampoline<
P: IsA<ClientPool>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSASeqClientPool,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ClientPool::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::client-id".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_client_id_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "input-free")]
fn connect_input_free_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_input_free_trampoline<
P: IsA<ClientPool>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSASeqClientPool,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ClientPool::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::input-free".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_input_free_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "input-pool")]
fn connect_input_pool_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_input_pool_trampoline<
P: IsA<ClientPool>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSASeqClientPool,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ClientPool::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::input-pool".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_input_pool_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "output-free")]
fn connect_output_free_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_output_free_trampoline<
P: IsA<ClientPool>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSASeqClientPool,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ClientPool::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::output-free".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_output_free_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "output-pool")]
fn connect_output_pool_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_output_pool_trampoline<
P: IsA<ClientPool>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSASeqClientPool,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ClientPool::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::output-pool".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_output_pool_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "output-room")]
fn connect_output_room_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_output_room_trampoline<
P: IsA<ClientPool>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSASeqClientPool,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ClientPool::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::output-room".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_output_room_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl<O: IsA<ClientPool>> ClientPoolExt for O {}