gstreamer-rs/gstreamer-editing-services/src/auto/track_element.rs
2018-12-08 14:58:14 +02:00

219 lines
8.1 KiB
Rust

// 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 Edge;
use EditMode;
use Extractable;
use Layer;
use TimelineElement;
use Track;
use TrackType;
use ffi;
use glib::StaticType;
use glib::Value;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct TrackElement(Object<ffi::GESTrackElement, ffi::GESTrackElementClass>): TimelineElement, Extractable;
match fn {
get_type => || ffi::ges_track_element_get_type(),
}
}
pub trait TrackElementExt: 'static {
fn add_children_props<P: IsA<gst::Element>>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]);
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> bool;
//fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 };
//fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option<gst::ControlBinding>;
fn get_element(&self) -> Option<gst::Element>;
fn get_gnlobject(&self) -> Option<gst::Element>;
fn get_nleobject(&self) -> Option<gst::Element>;
fn get_track(&self) -> Option<Track>;
fn get_track_type(&self) -> TrackType;
fn is_active(&self) -> bool;
//fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option<gst::Element>;
fn remove_control_binding(&self, property_name: &str) -> bool;
fn set_active(&self, active: bool) -> bool;
//fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool;
fn set_track_type(&self, type_: TrackType);
fn get_property_active(&self) -> bool;
//fn connect_control_binding_added<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_control_binding_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_track_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<TrackElement>> TrackElementExt for O {
fn add_children_props<P: IsA<gst::Element>>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]) {
unsafe {
ffi::ges_track_element_add_children_props(self.to_glib_none().0, element.to_glib_none().0, wanted_categories.to_glib_none().0, blacklist.to_glib_none().0, whitelist.to_glib_none().0);
}
}
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> bool {
unsafe {
from_glib(ffi::ges_track_element_edit(self.to_glib_none().0, layers.to_glib_none().0, mode.to_glib(), edge.to_glib(), position))
}
}
//fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 } {
// unsafe { TODO: call ffi::ges_track_element_get_all_control_bindings() }
//}
//fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option<gst::ControlBinding> {
// unsafe { TODO: call ffi::ges_track_element_get_control_binding() }
//}
fn get_element(&self) -> Option<gst::Element> {
unsafe {
from_glib_none(ffi::ges_track_element_get_element(self.to_glib_none().0))
}
}
fn get_gnlobject(&self) -> Option<gst::Element> {
unsafe {
from_glib_none(ffi::ges_track_element_get_gnlobject(self.to_glib_none().0))
}
}
fn get_nleobject(&self) -> Option<gst::Element> {
unsafe {
from_glib_none(ffi::ges_track_element_get_nleobject(self.to_glib_none().0))
}
}
fn get_track(&self) -> Option<Track> {
unsafe {
from_glib_none(ffi::ges_track_element_get_track(self.to_glib_none().0))
}
}
fn get_track_type(&self) -> TrackType {
unsafe {
from_glib(ffi::ges_track_element_get_track_type(self.to_glib_none().0))
}
}
fn is_active(&self) -> bool {
unsafe {
from_glib(ffi::ges_track_element_is_active(self.to_glib_none().0))
}
}
//fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option<gst::Element> {
// unsafe { TODO: call ffi::ges_track_element_lookup_child() }
//}
fn remove_control_binding(&self, property_name: &str) -> bool {
unsafe {
from_glib(ffi::ges_track_element_remove_control_binding(self.to_glib_none().0, property_name.to_glib_none().0))
}
}
fn set_active(&self, active: bool) -> bool {
unsafe {
from_glib(ffi::ges_track_element_set_active(self.to_glib_none().0, active.to_glib()))
}
}
//fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool {
// unsafe { TODO: call ffi::ges_track_element_set_control_source() }
//}
fn set_track_type(&self, type_: TrackType) {
unsafe {
ffi::ges_track_element_set_track_type(self.to_glib_none().0, type_.to_glib());
}
}
fn get_property_active(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_ffi::g_object_get_property(self.to_glib_none().0 as *mut gobject_ffi::GObject, b"active\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get().unwrap()
}
}
//fn connect_control_binding_added<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored control_binding: Gst.ControlBinding
//}
//fn connect_control_binding_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored control_binding: Gst.ControlBinding
//}
fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::active\0".as_ptr() as *const _,
transmute(notify_active_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_property_track_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::track\0".as_ptr() as *const _,
transmute(notify_track_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::track-type\0".as_ptr() as *const _,
transmute(notify_track_type_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
}
unsafe extern "C" fn notify_active_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TrackElement> {
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&TrackElement::from_glib_borrow(this).downcast_unchecked())
}
unsafe extern "C" fn notify_track_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TrackElement> {
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&TrackElement::from_glib_borrow(this).downcast_unchecked())
}
unsafe extern "C" fn notify_track_type_trampoline<P>(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<TrackElement> {
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&TrackElement::from_glib_borrow(this).downcast_unchecked())
}