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 // DO NOT EDIT
4 
5 use glib::translate::*;
6 use glib::value::FromValue;
7 use glib::value::FromValueOptional;
8 use glib::value::SetValue;
9 use glib::value::Value;
10 use glib::StaticType;
11 use glib::Type;
12 use gobject_sys;
13 use gst_app_sys;
14 
15 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
16 pub enum AppStreamType {
17     Stream,
18     Seekable,
19     RandomAccess,
20     #[doc(hidden)]
21     __Unknown(i32),
22 }
23 
24 #[doc(hidden)]
25 impl ToGlib for AppStreamType {
26     type GlibType = gst_app_sys::GstAppStreamType;
27 
to_glib(&self) -> gst_app_sys::GstAppStreamType28     fn to_glib(&self) -> gst_app_sys::GstAppStreamType {
29         match *self {
30             AppStreamType::Stream => gst_app_sys::GST_APP_STREAM_TYPE_STREAM,
31             AppStreamType::Seekable => gst_app_sys::GST_APP_STREAM_TYPE_SEEKABLE,
32             AppStreamType::RandomAccess => gst_app_sys::GST_APP_STREAM_TYPE_RANDOM_ACCESS,
33             AppStreamType::__Unknown(value) => value,
34         }
35     }
36 }
37 
38 #[doc(hidden)]
39 impl FromGlib<gst_app_sys::GstAppStreamType> for AppStreamType {
from_glib(value: gst_app_sys::GstAppStreamType) -> Self40     fn from_glib(value: gst_app_sys::GstAppStreamType) -> Self {
41         skip_assert_initialized!();
42         match value {
43             0 => AppStreamType::Stream,
44             1 => AppStreamType::Seekable,
45             2 => AppStreamType::RandomAccess,
46             value => AppStreamType::__Unknown(value),
47         }
48     }
49 }
50 
51 impl StaticType for AppStreamType {
static_type() -> Type52     fn static_type() -> Type {
53         unsafe { from_glib(gst_app_sys::gst_app_stream_type_get_type()) }
54     }
55 }
56 
57 impl<'a> FromValueOptional<'a> for AppStreamType {
from_value_optional(value: &Value) -> Option<Self>58     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
59         Some(FromValue::from_value(value))
60     }
61 }
62 
63 impl<'a> FromValue<'a> for AppStreamType {
from_value(value: &Value) -> Self64     unsafe fn from_value(value: &Value) -> Self {
65         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
66     }
67 }
68 
69 impl SetValue for AppStreamType {
set_value(value: &mut Value, this: &Self)70     unsafe fn set_value(value: &mut Value, this: &Self) {
71         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
72     }
73 }
74