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
6#[cfg(feature = "v1_18")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
8use glib::{prelude::*, translate::*};
9
10#[cfg(feature = "v1_18")]
11#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
12#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
13#[non_exhaustive]
14#[doc(alias = "GstAggregatorStartTimeSelection")]
15pub enum AggregatorStartTimeSelection {
16 #[doc(alias = "GST_AGGREGATOR_START_TIME_SELECTION_ZERO")]
17 Zero,
18 #[doc(alias = "GST_AGGREGATOR_START_TIME_SELECTION_FIRST")]
19 First,
20 #[doc(alias = "GST_AGGREGATOR_START_TIME_SELECTION_SET")]
21 Set,
22 #[doc(hidden)]
23 __Unknown(i32),
24}
25
26#[cfg(feature = "v1_18")]
27#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
28#[doc(hidden)]
29impl IntoGlib for AggregatorStartTimeSelection {
30 type GlibType = ffi::GstAggregatorStartTimeSelection;
31
32 #[inline]
33 fn into_glib(self) -> ffi::GstAggregatorStartTimeSelection {
34 match self {
35 Self::Zero => ffi::GST_AGGREGATOR_START_TIME_SELECTION_ZERO,
36 Self::First => ffi::GST_AGGREGATOR_START_TIME_SELECTION_FIRST,
37 Self::Set => ffi::GST_AGGREGATOR_START_TIME_SELECTION_SET,
38 Self::__Unknown(value) => value,
39 }
40 }
41}
42
43#[cfg(feature = "v1_18")]
44#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
45#[doc(hidden)]
46impl FromGlib<ffi::GstAggregatorStartTimeSelection> for AggregatorStartTimeSelection {
47 #[inline]
48 unsafe fn from_glib(value: ffi::GstAggregatorStartTimeSelection) -> Self {
49 skip_assert_initialized!();
50
51 match value {
52 ffi::GST_AGGREGATOR_START_TIME_SELECTION_ZERO => Self::Zero,
53 ffi::GST_AGGREGATOR_START_TIME_SELECTION_FIRST => Self::First,
54 ffi::GST_AGGREGATOR_START_TIME_SELECTION_SET => Self::Set,
55 value => Self::__Unknown(value),
56 }
57 }
58}
59
60#[cfg(feature = "v1_18")]
61#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
62impl StaticType for AggregatorStartTimeSelection {
63 #[inline]
64 #[doc(alias = "gst_aggregator_start_time_selection_get_type")]
65 fn static_type() -> glib::Type {
66 unsafe { from_glib(ffi::gst_aggregator_start_time_selection_get_type()) }
67 }
68}
69
70#[cfg(feature = "v1_18")]
71#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
72impl glib::HasParamSpec for AggregatorStartTimeSelection {
73 type ParamSpec = glib::ParamSpecEnum;
74 type SetValue = Self;
75 type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
76
77 fn param_spec_builder() -> Self::BuilderFn {
78 Self::ParamSpec::builder_with_default
79 }
80}
81
82#[cfg(feature = "v1_18")]
83#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
84impl glib::value::ValueType for AggregatorStartTimeSelection {
85 type Type = Self;
86}
87
88#[cfg(feature = "v1_18")]
89#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
90unsafe impl<'a> glib::value::FromValue<'a> for AggregatorStartTimeSelection {
91 type Checker = glib::value::GenericValueTypeChecker<Self>;
92
93 #[inline]
94 unsafe fn from_value(value: &'a glib::Value) -> Self {
95 skip_assert_initialized!();
96 from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
97 }
98}
99
100#[cfg(feature = "v1_18")]
101#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
102impl ToValue for AggregatorStartTimeSelection {
103 #[inline]
104 fn to_value(&self) -> glib::Value {
105 let mut value = glib::Value::for_value_type::<Self>();
106 unsafe {
107 glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
108 }
109 value
110 }
111
112 #[inline]
113 fn value_type(&self) -> glib::Type {
114 Self::static_type()
115 }
116}
117
118#[cfg(feature = "v1_18")]
119#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
120impl From<AggregatorStartTimeSelection> for glib::Value {
121 #[inline]
122 fn from(v: AggregatorStartTimeSelection) -> Self {
123 skip_assert_initialized!();
124 ToValue::to_value(&v)
125 }
126}
127