// 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::Edge; use crate::EditMode; use crate::Extractable; use crate::Layer; use crate::MetaContainer; use crate::TimelineElement; use crate::Track; use crate::TrackType; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::mem::transmute; glib::wrapper! { #[doc(alias = "GESTrackElement")] pub struct TrackElement(Object) @extends TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_track_element_get_type(), } } impl TrackElement { pub const NONE: Option<&'static TrackElement> = None; } pub trait TrackElementExt: 'static { #[doc(alias = "ges_track_element_add_children_props")] fn add_children_props( &self, element: &impl IsA, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str], ); #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "ges_track_element_clamp_control_source")] fn clamp_control_source(&self, property_name: &str); #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] #[doc(alias = "ges_track_element_edit")] fn edit( &self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64, ) -> Result<(), glib::error::BoolError>; //#[doc(alias = "ges_track_element_get_all_control_bindings")] //#[doc(alias = "get_all_control_bindings")] //fn all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 85 }; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "ges_track_element_get_auto_clamp_control_sources")] #[doc(alias = "get_auto_clamp_control_sources")] fn is_auto_clamp_control_sources(&self) -> bool; #[doc(alias = "ges_track_element_get_control_binding")] #[doc(alias = "get_control_binding")] fn control_binding(&self, property_name: &str) -> Option; #[doc(alias = "ges_track_element_get_element")] #[doc(alias = "get_element")] fn element(&self) -> Option; #[doc(alias = "ges_track_element_get_gnlobject")] #[doc(alias = "get_gnlobject")] fn gnlobject(&self) -> Option; #[doc(alias = "ges_track_element_get_nleobject")] #[doc(alias = "get_nleobject")] fn nleobject(&self) -> Option; #[doc(alias = "ges_track_element_get_track")] #[doc(alias = "get_track")] fn track(&self) -> Option; #[doc(alias = "ges_track_element_get_track_type")] #[doc(alias = "get_track_type")] fn track_type(&self) -> TrackType; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "ges_track_element_has_internal_source")] fn has_internal_source(&self) -> bool; #[doc(alias = "ges_track_element_is_active")] fn is_active(&self) -> bool; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "ges_track_element_is_core")] fn is_core(&self) -> bool; //#[doc(alias = "ges_track_element_lookup_child")] //fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option; #[doc(alias = "ges_track_element_remove_control_binding")] fn remove_control_binding(&self, property_name: &str) -> Result<(), glib::error::BoolError>; #[doc(alias = "ges_track_element_set_active")] fn set_active(&self, active: bool) -> bool; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "ges_track_element_set_auto_clamp_control_sources")] fn set_auto_clamp_control_sources(&self, auto_clamp: bool); #[doc(alias = "ges_track_element_set_control_source")] fn set_control_source( &self, source: &impl IsA, property_name: &str, binding_type: &str, ) -> bool; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "ges_track_element_set_has_internal_source")] fn set_has_internal_source(&self, has_internal_source: bool) -> bool; #[doc(alias = "ges_track_element_set_track_type")] fn set_track_type(&self, type_: TrackType); #[doc(alias = "control-binding-added")] fn connect_control_binding_added( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "control-binding-removed")] fn connect_control_binding_removed( &self, f: F, ) -> SignalHandlerId; #[doc(alias = "active")] fn connect_active_notify(&self, f: F) -> SignalHandlerId; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "auto-clamp-control-sources")] fn connect_auto_clamp_control_sources_notify( &self, f: F, ) -> SignalHandlerId; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[doc(alias = "has-internal-source")] fn connect_has_internal_source_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "track")] fn connect_track_notify(&self, f: F) -> SignalHandlerId; #[doc(alias = "track-type")] fn connect_track_type_notify(&self, f: F) -> SignalHandlerId; } impl> TrackElementExt for O { fn add_children_props( &self, element: &impl IsA, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str], ) { unsafe { ffi::ges_track_element_add_children_props( self.as_ref().to_glib_none().0, element.as_ref().to_glib_none().0, wanted_categories.to_glib_none().0, blacklist.to_glib_none().0, whitelist.to_glib_none().0, ); } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn clamp_control_source(&self, property_name: &str) { unsafe { ffi::ges_track_element_clamp_control_source( self.as_ref().to_glib_none().0, property_name.to_glib_none().0, ); } } fn edit( &self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64, ) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::ges_track_element_edit( self.as_ref().to_glib_none().0, layers.to_glib_none().0, mode.into_glib(), edge.into_glib(), position ), "Failed to edit" ) } } //fn all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 85 } { // unsafe { TODO: call ffi:ges_track_element_get_all_control_bindings() } //} #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn is_auto_clamp_control_sources(&self) -> bool { unsafe { from_glib(ffi::ges_track_element_get_auto_clamp_control_sources( self.as_ref().to_glib_none().0, )) } } fn control_binding(&self, property_name: &str) -> Option { unsafe { from_glib_none(ffi::ges_track_element_get_control_binding( self.as_ref().to_glib_none().0, property_name.to_glib_none().0, )) } } fn element(&self) -> Option { unsafe { from_glib_none(ffi::ges_track_element_get_element( self.as_ref().to_glib_none().0, )) } } fn gnlobject(&self) -> Option { unsafe { from_glib_none(ffi::ges_track_element_get_gnlobject( self.as_ref().to_glib_none().0, )) } } fn nleobject(&self) -> Option { unsafe { from_glib_none(ffi::ges_track_element_get_nleobject( self.as_ref().to_glib_none().0, )) } } fn track(&self) -> Option { unsafe { from_glib_none(ffi::ges_track_element_get_track( self.as_ref().to_glib_none().0, )) } } fn track_type(&self) -> TrackType { unsafe { from_glib(ffi::ges_track_element_get_track_type( self.as_ref().to_glib_none().0, )) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn has_internal_source(&self) -> bool { unsafe { from_glib(ffi::ges_track_element_has_internal_source( self.as_ref().to_glib_none().0, )) } } fn is_active(&self) -> bool { unsafe { from_glib(ffi::ges_track_element_is_active( self.as_ref().to_glib_none().0, )) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn is_core(&self) -> bool { unsafe { from_glib(ffi::ges_track_element_is_core( self.as_ref().to_glib_none().0, )) } } //fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option { // unsafe { TODO: call ffi:ges_track_element_lookup_child() } //} fn remove_control_binding(&self, property_name: &str) -> Result<(), glib::error::BoolError> { unsafe { glib::result_from_gboolean!( ffi::ges_track_element_remove_control_binding( self.as_ref().to_glib_none().0, property_name.to_glib_none().0 ), "Failed to remove control binding" ) } } fn set_active(&self, active: bool) -> bool { unsafe { from_glib(ffi::ges_track_element_set_active( self.as_ref().to_glib_none().0, active.into_glib(), )) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn set_auto_clamp_control_sources(&self, auto_clamp: bool) { unsafe { ffi::ges_track_element_set_auto_clamp_control_sources( self.as_ref().to_glib_none().0, auto_clamp.into_glib(), ); } } fn set_control_source( &self, source: &impl IsA, property_name: &str, binding_type: &str, ) -> bool { unsafe { from_glib(ffi::ges_track_element_set_control_source( self.as_ref().to_glib_none().0, source.as_ref().to_glib_none().0, property_name.to_glib_none().0, binding_type.to_glib_none().0, )) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn set_has_internal_source(&self, has_internal_source: bool) -> bool { unsafe { from_glib(ffi::ges_track_element_set_has_internal_source( self.as_ref().to_glib_none().0, has_internal_source.into_glib(), )) } } fn set_track_type(&self, type_: TrackType) { unsafe { ffi::ges_track_element_set_track_type( self.as_ref().to_glib_none().0, type_.into_glib(), ); } } fn connect_control_binding_added( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn control_binding_added_trampoline< P: IsA, F: Fn(&P, &gst::ControlBinding) + 'static, >( this: *mut ffi::GESTrackElement, control_binding: *mut gst::ffi::GstControlBinding, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( TrackElement::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(control_binding), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"control-binding-added\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( control_binding_added_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_control_binding_removed( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn control_binding_removed_trampoline< P: IsA, F: Fn(&P, &gst::ControlBinding) + 'static, >( this: *mut ffi::GESTrackElement, control_binding: *mut gst::ffi::GstControlBinding, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( TrackElement::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(control_binding), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"control-binding-removed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( control_binding_removed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_active_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_active_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GESTrackElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(TrackElement::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_active_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn connect_auto_clamp_control_sources_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_auto_clamp_control_sources_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GESTrackElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(TrackElement::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::auto-clamp-control-sources\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_auto_clamp_control_sources_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn connect_has_internal_source_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_has_internal_source_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GESTrackElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(TrackElement::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::has-internal-source\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_has_internal_source_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_track_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_track_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GESTrackElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(TrackElement::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::track\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_track_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_track_type_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_track_type_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GESTrackElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(TrackElement::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::track-type\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_track_type_trampoline:: as *const (), )), Box_::into_raw(f), ) } } }