// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::object::IsA;
use glib::translate::*;
use gst_sys;
use Element;
use Object;
use Toc;

glib_wrapper! {
    pub struct TocSetter(Interface<gst_sys::GstTocSetter>) @requires Element, Object;

    match fn {
        get_type => || gst_sys::gst_toc_setter_get_type(),
    }
}

unsafe impl Send for TocSetter {}
unsafe impl Sync for TocSetter {}

pub const NONE_TOC_SETTER: Option<&TocSetter> = None;

pub trait TocSetterExt: 'static {
    fn get_toc(&self) -> Option<Toc>;

    fn reset(&self);

    fn set_toc(&self, toc: Option<&Toc>);
}

impl<O: IsA<TocSetter>> TocSetterExt for O {
    fn get_toc(&self) -> Option<Toc> {
        unsafe {
            from_glib_full(gst_sys::gst_toc_setter_get_toc(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn reset(&self) {
        unsafe {
            gst_sys::gst_toc_setter_reset(self.as_ref().to_glib_none().0);
        }
    }

    fn set_toc(&self, toc: Option<&Toc>) {
        unsafe {
            gst_sys::gst_toc_setter_set_toc(self.as_ref().to_glib_none().0, toc.to_glib_none().0);
        }
    }
}
