// 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 crate::ffi;
use glib::{prelude::*, translate::*};

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstTagImageType")]
pub enum TagImageType {
    #[doc(alias = "GST_TAG_IMAGE_TYPE_NONE")]
    None,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_UNDEFINED")]
    Undefined,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_FRONT_COVER")]
    FrontCover,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_BACK_COVER")]
    BackCover,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_LEAFLET_PAGE")]
    LeafletPage,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_MEDIUM")]
    Medium,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_LEAD_ARTIST")]
    LeadArtist,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_ARTIST")]
    Artist,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_CONDUCTOR")]
    Conductor,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_BAND_ORCHESTRA")]
    BandOrchestra,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_COMPOSER")]
    Composer,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_LYRICIST")]
    Lyricist,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_RECORDING_LOCATION")]
    RecordingLocation,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_DURING_RECORDING")]
    DuringRecording,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_DURING_PERFORMANCE")]
    DuringPerformance,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_VIDEO_CAPTURE")]
    VideoCapture,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_FISH")]
    Fish,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_ILLUSTRATION")]
    Illustration,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_BAND_ARTIST_LOGO")]
    BandArtistLogo,
    #[doc(alias = "GST_TAG_IMAGE_TYPE_PUBLISHER_STUDIO_LOGO")]
    PublisherStudioLogo,
    #[doc(hidden)]
    __Unknown(i32),
}

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

    fn into_glib(self) -> ffi::GstTagImageType {
        match self {
            Self::None => ffi::GST_TAG_IMAGE_TYPE_NONE,
            Self::Undefined => ffi::GST_TAG_IMAGE_TYPE_UNDEFINED,
            Self::FrontCover => ffi::GST_TAG_IMAGE_TYPE_FRONT_COVER,
            Self::BackCover => ffi::GST_TAG_IMAGE_TYPE_BACK_COVER,
            Self::LeafletPage => ffi::GST_TAG_IMAGE_TYPE_LEAFLET_PAGE,
            Self::Medium => ffi::GST_TAG_IMAGE_TYPE_MEDIUM,
            Self::LeadArtist => ffi::GST_TAG_IMAGE_TYPE_LEAD_ARTIST,
            Self::Artist => ffi::GST_TAG_IMAGE_TYPE_ARTIST,
            Self::Conductor => ffi::GST_TAG_IMAGE_TYPE_CONDUCTOR,
            Self::BandOrchestra => ffi::GST_TAG_IMAGE_TYPE_BAND_ORCHESTRA,
            Self::Composer => ffi::GST_TAG_IMAGE_TYPE_COMPOSER,
            Self::Lyricist => ffi::GST_TAG_IMAGE_TYPE_LYRICIST,
            Self::RecordingLocation => ffi::GST_TAG_IMAGE_TYPE_RECORDING_LOCATION,
            Self::DuringRecording => ffi::GST_TAG_IMAGE_TYPE_DURING_RECORDING,
            Self::DuringPerformance => ffi::GST_TAG_IMAGE_TYPE_DURING_PERFORMANCE,
            Self::VideoCapture => ffi::GST_TAG_IMAGE_TYPE_VIDEO_CAPTURE,
            Self::Fish => ffi::GST_TAG_IMAGE_TYPE_FISH,
            Self::Illustration => ffi::GST_TAG_IMAGE_TYPE_ILLUSTRATION,
            Self::BandArtistLogo => ffi::GST_TAG_IMAGE_TYPE_BAND_ARTIST_LOGO,
            Self::PublisherStudioLogo => ffi::GST_TAG_IMAGE_TYPE_PUBLISHER_STUDIO_LOGO,
            Self::__Unknown(value) => value,
        }
    }
}

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

        match value {
            ffi::GST_TAG_IMAGE_TYPE_NONE => Self::None,
            ffi::GST_TAG_IMAGE_TYPE_UNDEFINED => Self::Undefined,
            ffi::GST_TAG_IMAGE_TYPE_FRONT_COVER => Self::FrontCover,
            ffi::GST_TAG_IMAGE_TYPE_BACK_COVER => Self::BackCover,
            ffi::GST_TAG_IMAGE_TYPE_LEAFLET_PAGE => Self::LeafletPage,
            ffi::GST_TAG_IMAGE_TYPE_MEDIUM => Self::Medium,
            ffi::GST_TAG_IMAGE_TYPE_LEAD_ARTIST => Self::LeadArtist,
            ffi::GST_TAG_IMAGE_TYPE_ARTIST => Self::Artist,
            ffi::GST_TAG_IMAGE_TYPE_CONDUCTOR => Self::Conductor,
            ffi::GST_TAG_IMAGE_TYPE_BAND_ORCHESTRA => Self::BandOrchestra,
            ffi::GST_TAG_IMAGE_TYPE_COMPOSER => Self::Composer,
            ffi::GST_TAG_IMAGE_TYPE_LYRICIST => Self::Lyricist,
            ffi::GST_TAG_IMAGE_TYPE_RECORDING_LOCATION => Self::RecordingLocation,
            ffi::GST_TAG_IMAGE_TYPE_DURING_RECORDING => Self::DuringRecording,
            ffi::GST_TAG_IMAGE_TYPE_DURING_PERFORMANCE => Self::DuringPerformance,
            ffi::GST_TAG_IMAGE_TYPE_VIDEO_CAPTURE => Self::VideoCapture,
            ffi::GST_TAG_IMAGE_TYPE_FISH => Self::Fish,
            ffi::GST_TAG_IMAGE_TYPE_ILLUSTRATION => Self::Illustration,
            ffi::GST_TAG_IMAGE_TYPE_BAND_ARTIST_LOGO => Self::BandArtistLogo,
            ffi::GST_TAG_IMAGE_TYPE_PUBLISHER_STUDIO_LOGO => Self::PublisherStudioLogo,
            value => Self::__Unknown(value),
        }
    }
}

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

impl glib::HasParamSpec for TagImageType {
    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 TagImageType {
    type Type = Self;
}

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

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

impl ToValue for TagImageType {
    #[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<TagImageType> for glib::Value {
    #[inline]
    fn from(v: TagImageType) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}
