// 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::{
    Extractable, MetaContainer, Source, TimelineElement, TrackElement, VideoSource,
    VideoTestPattern,
};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "GESVideoTestSource")]
    pub struct VideoTestSource(Object<ffi::GESVideoTestSource, ffi::GESVideoTestSourceClass>) @extends VideoSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer;

    match fn {
        type_ => || ffi::ges_video_test_source_get_type(),
    }
}

impl VideoTestSource {
    pub const NONE: Option<&'static VideoTestSource> = None;
}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::VideoTestSource>> Sealed for T {}
}

pub trait VideoTestSourceExt: IsA<VideoTestSource> + sealed::Sealed + 'static {
    #[doc(alias = "ges_video_test_source_get_pattern")]
    #[doc(alias = "get_pattern")]
    fn pattern(&self) -> VideoTestPattern {
        unsafe {
            from_glib(ffi::ges_video_test_source_get_pattern(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "ges_video_test_source_set_pattern")]
    fn set_pattern(&self, pattern: VideoTestPattern) {
        unsafe {
            ffi::ges_video_test_source_set_pattern(
                self.as_ref().to_glib_none().0,
                pattern.into_glib(),
            );
        }
    }
}

impl<O: IsA<VideoTestSource>> VideoTestSourceExt for O {}
