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
// 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, ElemInfoCommon, ElemInfoSingleArray};
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::boxed::Box as Box_;
glib::wrapper! {
/// An object to express information for integer64 type of element.
///
/// A `GObject::Object` derived object class for integer64 type of element.
///
/// The object wraps `struct snd_ctl_elem_info` in UAPI of Linux sound subsystem.
///
/// ## Properties
///
///
/// #### `value-max`
/// The maximum value of element in value array for the element.
///
/// Readable | Writeable
///
///
/// #### `value-min`
/// The minimum value of element in value array for the element.
///
/// Readable | Writeable
///
///
/// #### `value-step`
/// The step value of element in value array for the element.
///
/// Readable | Writeable
/// <details><summary><h4>ElemInfoCommon</h4></summary>
///
///
/// #### `access`
/// The access permission for the element with [`ElemAccessFlag`][crate::ElemAccessFlag].
///
/// Readable | Writeable
///
///
/// #### `elem-id`
/// The identifier of element.
///
/// Readable
///
///
/// #### `elem-type`
/// The type of element, one of [`ElemType`][crate::ElemType].
///
/// Readable | Writeable | Construct Only
///
///
/// #### `owner`
/// The value of PID for process to own the element.
///
/// Readable
/// </details>
/// <details><summary><h4>ElemInfoSingleArray</h4></summary>
///
///
/// #### `value-count`
/// The count of elements in value array of the element.
///
/// Readable | Writeable
/// </details>
///
/// # Implements
///
/// [`ElemInfoInteger64Ext`][trait@crate::prelude::ElemInfoInteger64Ext], [`ElemInfoCommonExt`][trait@crate::prelude::ElemInfoCommonExt], [`ElemInfoSingleArrayExt`][trait@crate::prelude::ElemInfoSingleArrayExt]
#[doc(alias = "ALSACtlElemInfoInteger64")]
pub struct ElemInfoInteger64(Object<ffi::ALSACtlElemInfoInteger64, ffi::ALSACtlElemInfoInteger64Class>) @implements ElemInfoCommon, ElemInfoSingleArray;
match fn {
type_ => || ffi::alsactl_elem_info_integer64_get_type(),
}
}
impl ElemInfoInteger64 {
pub const NONE: Option<&'static ElemInfoInteger64> = None;
/// Allocate and return an instance of [`ElemInfoInteger64`][crate::ElemInfoInteger64].
///
/// # Returns
///
/// An instance of [`ElemInfoInteger64`][crate::ElemInfoInteger64].
#[doc(alias = "alsactl_elem_info_integer64_new")]
pub fn new() -> ElemInfoInteger64 {
unsafe { from_glib_full(ffi::alsactl_elem_info_integer64_new()) }
}
}
impl Default for ElemInfoInteger64 {
fn default() -> Self {
Self::new()
}
}
/// Trait containing all [`struct@ElemInfoInteger64`] methods.
///
/// # Implementors
///
/// [`ElemInfoInteger64`][struct@crate::ElemInfoInteger64]
pub trait ElemInfoInteger64Ext: IsA<ElemInfoInteger64> + 'static {
/// The maximum value of element in value array for the element.
#[doc(alias = "value-max")]
fn value_max(&self) -> i64 {
ObjectExt::property(self.as_ref(), "value-max")
}
/// The maximum value of element in value array for the element.
#[doc(alias = "value-max")]
fn set_value_max(&self, value_max: i64) {
ObjectExt::set_property(self.as_ref(), "value-max", value_max)
}
/// The minimum value of element in value array for the element.
#[doc(alias = "value-min")]
fn value_min(&self) -> i64 {
ObjectExt::property(self.as_ref(), "value-min")
}
/// The minimum value of element in value array for the element.
#[doc(alias = "value-min")]
fn set_value_min(&self, value_min: i64) {
ObjectExt::set_property(self.as_ref(), "value-min", value_min)
}
/// The step value of element in value array for the element.
#[doc(alias = "value-step")]
fn value_step(&self) -> i64 {
ObjectExt::property(self.as_ref(), "value-step")
}
/// The step value of element in value array for the element.
#[doc(alias = "value-step")]
fn set_value_step(&self, value_step: i64) {
ObjectExt::set_property(self.as_ref(), "value-step", value_step)
}
#[doc(alias = "value-max")]
fn connect_value_max_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_value_max_trampoline<
P: IsA<ElemInfoInteger64>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSACtlElemInfoInteger64,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ElemInfoInteger64::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::value-max".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_value_max_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "value-min")]
fn connect_value_min_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_value_min_trampoline<
P: IsA<ElemInfoInteger64>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSACtlElemInfoInteger64,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ElemInfoInteger64::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::value-min".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_value_min_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "value-step")]
fn connect_value_step_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_value_step_trampoline<
P: IsA<ElemInfoInteger64>,
F: Fn(&P) + 'static,
>(
this: *mut ffi::ALSACtlElemInfoInteger64,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(ElemInfoInteger64::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::value-step".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_value_step_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl<O: IsA<ElemInfoInteger64>> ElemInfoInteger64Ext for O {}