1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use glib::{bitflags::bitflags, prelude::*, translate::*};
7
8bitflags! {
9 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
10 #[doc(alias = "GstAudioFlags")]
11 pub struct AudioFlags: u32 {
12 #[doc(alias = "GST_AUDIO_FLAG_UNPOSITIONED")]
13 const UNPOSITIONED = ffi::GST_AUDIO_FLAG_UNPOSITIONED as _;
14 }
15}
16
17#[doc(hidden)]
18impl IntoGlib for AudioFlags {
19 type GlibType = ffi::GstAudioFlags;
20
21 #[inline]
22 fn into_glib(self) -> ffi::GstAudioFlags {
23 self.bits()
24 }
25}
26
27#[doc(hidden)]
28impl FromGlib<ffi::GstAudioFlags> for AudioFlags {
29 #[inline]
30 unsafe fn from_glib(value: ffi::GstAudioFlags) -> Self {
31 skip_assert_initialized!();
32 Self::from_bits_truncate(bits:value)
33 }
34}
35
36impl StaticType for AudioFlags {
37 #[inline]
38 #[doc(alias = "gst_audio_flags_get_type")]
39 fn static_type() -> glib::Type {
40 unsafe { from_glib(val:ffi::gst_audio_flags_get_type()) }
41 }
42}
43
44impl glib::HasParamSpec for AudioFlags {
45 type ParamSpec = glib::ParamSpecFlags;
46 type SetValue = Self;
47 type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
48
49 fn param_spec_builder() -> Self::BuilderFn {
50 Self::ParamSpec::builder
51 }
52}
53
54impl glib::value::ValueType for AudioFlags {
55 type Type = Self;
56}
57
58unsafe impl<'a> glib::value::FromValue<'a> for AudioFlags {
59 type Checker = glib::value::GenericValueTypeChecker<Self>;
60
61 #[inline]
62 unsafe fn from_value(value: &'a glib::Value) -> Self {
63 skip_assert_initialized!();
64 from_glib(val:glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
65 }
66}
67
68impl ToValue for AudioFlags {
69 #[inline]
70 fn to_value(&self) -> glib::Value {
71 let mut value: Value = glib::Value::for_value_type::<Self>();
72 unsafe {
73 glib::gobject_ffi::g_value_set_flags(value:value.to_glib_none_mut().0, self.into_glib());
74 }
75 value
76 }
77
78 #[inline]
79 fn value_type(&self) -> glib::Type {
80 Self::static_type()
81 }
82}
83
84impl From<AudioFlags> for glib::Value {
85 #[inline]
86 fn from(v: AudioFlags) -> Self {
87 skip_assert_initialized!();
88 ToValue::to_value(&v)
89 }
90}
91
92bitflags! {
93 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
94 #[doc(alias = "GstAudioFormatFlags")]
95 pub struct AudioFormatFlags: u32 {
96 #[doc(alias = "GST_AUDIO_FORMAT_FLAG_INTEGER")]
97 const INTEGER = ffi::GST_AUDIO_FORMAT_FLAG_INTEGER as _;
98 #[doc(alias = "GST_AUDIO_FORMAT_FLAG_FLOAT")]
99 const FLOAT = ffi::GST_AUDIO_FORMAT_FLAG_FLOAT as _;
100 #[doc(alias = "GST_AUDIO_FORMAT_FLAG_SIGNED")]
101 const SIGNED = ffi::GST_AUDIO_FORMAT_FLAG_SIGNED as _;
102 #[doc(alias = "GST_AUDIO_FORMAT_FLAG_COMPLEX")]
103 const COMPLEX = ffi::GST_AUDIO_FORMAT_FLAG_COMPLEX as _;
104 #[doc(alias = "GST_AUDIO_FORMAT_FLAG_UNPACK")]
105 const UNPACK = ffi::GST_AUDIO_FORMAT_FLAG_UNPACK as _;
106 }
107}
108
109#[doc(hidden)]
110impl IntoGlib for AudioFormatFlags {
111 type GlibType = ffi::GstAudioFormatFlags;
112
113 #[inline]
114 fn into_glib(self) -> ffi::GstAudioFormatFlags {
115 self.bits()
116 }
117}
118
119#[doc(hidden)]
120impl FromGlib<ffi::GstAudioFormatFlags> for AudioFormatFlags {
121 #[inline]
122 unsafe fn from_glib(value: ffi::GstAudioFormatFlags) -> Self {
123 skip_assert_initialized!();
124 Self::from_bits_truncate(bits:value)
125 }
126}
127
128impl StaticType for AudioFormatFlags {
129 #[inline]
130 #[doc(alias = "gst_audio_format_flags_get_type")]
131 fn static_type() -> glib::Type {
132 unsafe { from_glib(val:ffi::gst_audio_format_flags_get_type()) }
133 }
134}
135
136impl glib::HasParamSpec for AudioFormatFlags {
137 type ParamSpec = glib::ParamSpecFlags;
138 type SetValue = Self;
139 type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
140
141 fn param_spec_builder() -> Self::BuilderFn {
142 Self::ParamSpec::builder
143 }
144}
145
146impl glib::value::ValueType for AudioFormatFlags {
147 type Type = Self;
148}
149
150unsafe impl<'a> glib::value::FromValue<'a> for AudioFormatFlags {
151 type Checker = glib::value::GenericValueTypeChecker<Self>;
152
153 #[inline]
154 unsafe fn from_value(value: &'a glib::Value) -> Self {
155 skip_assert_initialized!();
156 from_glib(val:glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
157 }
158}
159
160impl ToValue for AudioFormatFlags {
161 #[inline]
162 fn to_value(&self) -> glib::Value {
163 let mut value: Value = glib::Value::for_value_type::<Self>();
164 unsafe {
165 glib::gobject_ffi::g_value_set_flags(value:value.to_glib_none_mut().0, self.into_glib());
166 }
167 value
168 }
169
170 #[inline]
171 fn value_type(&self) -> glib::Type {
172 Self::static_type()
173 }
174}
175
176impl From<AudioFormatFlags> for glib::Value {
177 #[inline]
178 fn from(v: AudioFormatFlags) -> Self {
179 skip_assert_initialized!();
180 ToValue::to_value(&v)
181 }
182}
183
184bitflags! {
185 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
186 #[doc(alias = "GstAudioPackFlags")]
187 pub struct AudioPackFlags: u32 {
188 #[doc(alias = "GST_AUDIO_PACK_FLAG_TRUNCATE_RANGE")]
189 const TRUNCATE_RANGE = ffi::GST_AUDIO_PACK_FLAG_TRUNCATE_RANGE as _;
190 }
191}
192
193#[doc(hidden)]
194impl IntoGlib for AudioPackFlags {
195 type GlibType = ffi::GstAudioPackFlags;
196
197 #[inline]
198 fn into_glib(self) -> ffi::GstAudioPackFlags {
199 self.bits()
200 }
201}
202
203#[doc(hidden)]
204impl FromGlib<ffi::GstAudioPackFlags> for AudioPackFlags {
205 #[inline]
206 unsafe fn from_glib(value: ffi::GstAudioPackFlags) -> Self {
207 skip_assert_initialized!();
208 Self::from_bits_truncate(bits:value)
209 }
210}
211
212impl StaticType for AudioPackFlags {
213 #[inline]
214 #[doc(alias = "gst_audio_pack_flags_get_type")]
215 fn static_type() -> glib::Type {
216 unsafe { from_glib(val:ffi::gst_audio_pack_flags_get_type()) }
217 }
218}
219
220impl glib::HasParamSpec for AudioPackFlags {
221 type ParamSpec = glib::ParamSpecFlags;
222 type SetValue = Self;
223 type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
224
225 fn param_spec_builder() -> Self::BuilderFn {
226 Self::ParamSpec::builder
227 }
228}
229
230impl glib::value::ValueType for AudioPackFlags {
231 type Type = Self;
232}
233
234unsafe impl<'a> glib::value::FromValue<'a> for AudioPackFlags {
235 type Checker = glib::value::GenericValueTypeChecker<Self>;
236
237 #[inline]
238 unsafe fn from_value(value: &'a glib::Value) -> Self {
239 skip_assert_initialized!();
240 from_glib(val:glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
241 }
242}
243
244impl ToValue for AudioPackFlags {
245 #[inline]
246 fn to_value(&self) -> glib::Value {
247 let mut value: Value = glib::Value::for_value_type::<Self>();
248 unsafe {
249 glib::gobject_ffi::g_value_set_flags(value:value.to_glib_none_mut().0, self.into_glib());
250 }
251 value
252 }
253
254 #[inline]
255 fn value_type(&self) -> glib::Type {
256 Self::static_type()
257 }
258}
259
260impl From<AudioPackFlags> for glib::Value {
261 #[inline]
262 fn from(v: AudioPackFlags) -> Self {
263 skip_assert_initialized!();
264 ToValue::to_value(&v)
265 }
266}
267