// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use glib::{prelude::*, translate::*};

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstAudioVisualizerShader")]
pub enum AudioVisualizerShader {
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_NONE")]
    None,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE")]
    Fade,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_UP")]
    FadeAndMoveUp,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_DOWN")]
    FadeAndMoveDown,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_LEFT")]
    FadeAndMoveLeft,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_RIGHT")]
    FadeAndMoveRight,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_OUT")]
    FadeAndMoveHorizOut,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_IN")]
    FadeAndMoveHorizIn,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_OUT")]
    FadeAndMoveVertOut,
    #[doc(alias = "GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_IN")]
    FadeAndMoveVertIn,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for AudioVisualizerShader {
    type GlibType = ffi::GstAudioVisualizerShader;

    #[inline]
    fn into_glib(self) -> ffi::GstAudioVisualizerShader {
        match self {
            Self::None => ffi::GST_AUDIO_VISUALIZER_SHADER_NONE,
            Self::Fade => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE,
            Self::FadeAndMoveUp => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_UP,
            Self::FadeAndMoveDown => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_DOWN,
            Self::FadeAndMoveLeft => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_LEFT,
            Self::FadeAndMoveRight => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_RIGHT,
            Self::FadeAndMoveHorizOut => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_OUT,
            Self::FadeAndMoveHorizIn => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_IN,
            Self::FadeAndMoveVertOut => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_OUT,
            Self::FadeAndMoveVertIn => ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_IN,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstAudioVisualizerShader> for AudioVisualizerShader {
    #[inline]
    unsafe fn from_glib(value: ffi::GstAudioVisualizerShader) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GST_AUDIO_VISUALIZER_SHADER_NONE => Self::None,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE => Self::Fade,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_UP => Self::FadeAndMoveUp,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_DOWN => Self::FadeAndMoveDown,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_LEFT => Self::FadeAndMoveLeft,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_RIGHT => Self::FadeAndMoveRight,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_OUT => Self::FadeAndMoveHorizOut,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_IN => Self::FadeAndMoveHorizIn,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_OUT => Self::FadeAndMoveVertOut,
            ffi::GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_IN => Self::FadeAndMoveVertIn,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for AudioVisualizerShader {
    #[inline]
    #[doc(alias = "gst_audio_visualizer_shader_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_audio_visualizer_shader_get_type()) }
    }
}

impl glib::HasParamSpec for AudioVisualizerShader {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for AudioVisualizerShader {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for AudioVisualizerShader {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for AudioVisualizerShader {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<AudioVisualizerShader> for glib::Value {
    #[inline]
    fn from(v: AudioVisualizerShader) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstDiscovererResult")]
pub enum DiscovererResult {
    #[doc(alias = "GST_DISCOVERER_OK")]
    Ok,
    #[doc(alias = "GST_DISCOVERER_URI_INVALID")]
    UriInvalid,
    #[doc(alias = "GST_DISCOVERER_ERROR")]
    Error,
    #[doc(alias = "GST_DISCOVERER_TIMEOUT")]
    Timeout,
    #[doc(alias = "GST_DISCOVERER_BUSY")]
    Busy,
    #[doc(alias = "GST_DISCOVERER_MISSING_PLUGINS")]
    MissingPlugins,
    #[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for DiscovererResult {
    type GlibType = ffi::GstDiscovererResult;

    #[inline]
    fn into_glib(self) -> ffi::GstDiscovererResult {
        match self {
            Self::Ok => ffi::GST_DISCOVERER_OK,
            Self::UriInvalid => ffi::GST_DISCOVERER_URI_INVALID,
            Self::Error => ffi::GST_DISCOVERER_ERROR,
            Self::Timeout => ffi::GST_DISCOVERER_TIMEOUT,
            Self::Busy => ffi::GST_DISCOVERER_BUSY,
            Self::MissingPlugins => ffi::GST_DISCOVERER_MISSING_PLUGINS,
            Self::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GstDiscovererResult> for DiscovererResult {
    #[inline]
    unsafe fn from_glib(value: ffi::GstDiscovererResult) -> Self {
        skip_assert_initialized!();

        match value {
            ffi::GST_DISCOVERER_OK => Self::Ok,
            ffi::GST_DISCOVERER_URI_INVALID => Self::UriInvalid,
            ffi::GST_DISCOVERER_ERROR => Self::Error,
            ffi::GST_DISCOVERER_TIMEOUT => Self::Timeout,
            ffi::GST_DISCOVERER_BUSY => Self::Busy,
            ffi::GST_DISCOVERER_MISSING_PLUGINS => Self::MissingPlugins,
            value => Self::__Unknown(value),
        }
    }
}

impl StaticType for DiscovererResult {
    #[inline]
    #[doc(alias = "gst_discoverer_result_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gst_discoverer_result_get_type()) }
    }
}

impl glib::HasParamSpec for DiscovererResult {
    type ParamSpec = glib::ParamSpecEnum;
    type SetValue = Self;
    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder_with_default
    }
}

impl glib::value::ValueType for DiscovererResult {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DiscovererResult {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for DiscovererResult {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DiscovererResult> for glib::Value {
    #[inline]
    fn from(v: DiscovererResult) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}
