mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-05-23 02:38:15 +00:00
179 lines
6.2 KiB
Rust
179 lines
6.2 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 Asset;
|
|
use BaseEffect;
|
|
use Container;
|
|
use Extractable;
|
|
use Layer;
|
|
use TimelineElement;
|
|
use Track;
|
|
use TrackElement;
|
|
use TrackType;
|
|
use ffi;
|
|
use glib;
|
|
use glib::object::Downcast;
|
|
use glib::object::IsA;
|
|
use glib::signal::SignalHandlerId;
|
|
use glib::signal::connect;
|
|
use glib::translate::*;
|
|
use glib_ffi;
|
|
use gobject_ffi;
|
|
use std::boxed::Box as Box_;
|
|
use std::mem;
|
|
use std::mem::transmute;
|
|
use std::ptr;
|
|
|
|
glib_wrapper! {
|
|
pub struct Clip(Object<ffi::GESClip, ffi::GESClipClass>): Container, TimelineElement, Extractable;
|
|
|
|
match fn {
|
|
get_type => || ffi::ges_clip_get_type(),
|
|
}
|
|
}
|
|
|
|
pub trait ClipExt {
|
|
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> Option<TrackElement>;
|
|
|
|
fn find_track_element<'a, P: IsA<Track> + 'a, Q: Into<Option<&'a P>>>(&self, track: Q, type_: glib::types::Type) -> Option<TrackElement>;
|
|
|
|
fn find_track_elements<'a, P: IsA<Track> + 'a, Q: Into<Option<&'a P>>>(&self, track: Q, track_type: TrackType, type_: glib::types::Type) -> Vec<TrackElement>;
|
|
|
|
fn get_layer(&self) -> Option<Layer>;
|
|
|
|
fn get_supported_formats(&self) -> TrackType;
|
|
|
|
fn get_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P) -> i32;
|
|
|
|
fn get_top_effect_position<P: IsA<BaseEffect>>(&self, effect: &P) -> i32;
|
|
|
|
fn get_top_effects(&self) -> Vec<TrackElement>;
|
|
|
|
fn move_to_layer(&self, layer: &Layer) -> bool;
|
|
|
|
fn set_supported_formats(&self, supportedformats: TrackType);
|
|
|
|
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> bool;
|
|
|
|
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> bool;
|
|
|
|
fn split(&self, position: u64) -> Option<Clip>;
|
|
|
|
fn connect_property_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
}
|
|
|
|
impl<O: IsA<Clip> + IsA<glib::object::Object>> ClipExt for O {
|
|
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> Option<TrackElement> {
|
|
unsafe {
|
|
from_glib_none(ffi::ges_clip_add_asset(self.to_glib_none().0, asset.to_glib_none().0))
|
|
}
|
|
}
|
|
|
|
fn find_track_element<'a, P: IsA<Track> + 'a, Q: Into<Option<&'a P>>>(&self, track: Q, type_: glib::types::Type) -> Option<TrackElement> {
|
|
let track = track.into();
|
|
let track = track.to_glib_none();
|
|
unsafe {
|
|
from_glib_full(ffi::ges_clip_find_track_element(self.to_glib_none().0, track.0, type_.to_glib()))
|
|
}
|
|
}
|
|
|
|
fn find_track_elements<'a, P: IsA<Track> + 'a, Q: Into<Option<&'a P>>>(&self, track: Q, track_type: TrackType, type_: glib::types::Type) -> Vec<TrackElement> {
|
|
let track = track.into();
|
|
let track = track.to_glib_none();
|
|
unsafe {
|
|
FromGlibPtrContainer::from_glib_full(ffi::ges_clip_find_track_elements(self.to_glib_none().0, track.0, track_type.to_glib(), type_.to_glib()))
|
|
}
|
|
}
|
|
|
|
fn get_layer(&self) -> Option<Layer> {
|
|
unsafe {
|
|
from_glib_full(ffi::ges_clip_get_layer(self.to_glib_none().0))
|
|
}
|
|
}
|
|
|
|
fn get_supported_formats(&self) -> TrackType {
|
|
unsafe {
|
|
from_glib(ffi::ges_clip_get_supported_formats(self.to_glib_none().0))
|
|
}
|
|
}
|
|
|
|
fn get_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P) -> i32 {
|
|
unsafe {
|
|
ffi::ges_clip_get_top_effect_index(self.to_glib_none().0, effect.to_glib_none().0)
|
|
}
|
|
}
|
|
|
|
fn get_top_effect_position<P: IsA<BaseEffect>>(&self, effect: &P) -> i32 {
|
|
unsafe {
|
|
ffi::ges_clip_get_top_effect_position(self.to_glib_none().0, effect.to_glib_none().0)
|
|
}
|
|
}
|
|
|
|
fn get_top_effects(&self) -> Vec<TrackElement> {
|
|
unsafe {
|
|
FromGlibPtrContainer::from_glib_full(ffi::ges_clip_get_top_effects(self.to_glib_none().0))
|
|
}
|
|
}
|
|
|
|
fn move_to_layer(&self, layer: &Layer) -> bool {
|
|
unsafe {
|
|
from_glib(ffi::ges_clip_move_to_layer(self.to_glib_none().0, layer.to_glib_none().0))
|
|
}
|
|
}
|
|
|
|
fn set_supported_formats(&self, supportedformats: TrackType) {
|
|
unsafe {
|
|
ffi::ges_clip_set_supported_formats(self.to_glib_none().0, supportedformats.to_glib());
|
|
}
|
|
}
|
|
|
|
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> bool {
|
|
unsafe {
|
|
from_glib(ffi::ges_clip_set_top_effect_index(self.to_glib_none().0, effect.to_glib_none().0, newindex))
|
|
}
|
|
}
|
|
|
|
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> bool {
|
|
unsafe {
|
|
from_glib(ffi::ges_clip_set_top_effect_priority(self.to_glib_none().0, effect.to_glib_none().0, newpriority))
|
|
}
|
|
}
|
|
|
|
fn split(&self, position: u64) -> Option<Clip> {
|
|
unsafe {
|
|
from_glib_none(ffi::ges_clip_split(self.to_glib_none().0, position))
|
|
}
|
|
}
|
|
|
|
fn connect_property_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
unsafe {
|
|
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
|
connect(self.to_glib_none().0, "notify::layer",
|
|
transmute(notify_layer_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
|
}
|
|
}
|
|
|
|
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
|
unsafe {
|
|
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
|
connect(self.to_glib_none().0, "notify::supported-formats",
|
|
transmute(notify_supported_formats_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
|
}
|
|
}
|
|
}
|
|
|
|
unsafe extern "C" fn notify_layer_trampoline<P>(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
|
where P: IsA<Clip> {
|
|
let f: &&(Fn(&P) + 'static) = transmute(f);
|
|
f(&Clip::from_glib_borrow(this).downcast_unchecked())
|
|
}
|
|
|
|
unsafe extern "C" fn notify_supported_formats_trampoline<P>(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
|
where P: IsA<Clip> {
|
|
let f: &&(Fn(&P) + 'static) = transmute(f);
|
|
f(&Clip::from_glib_borrow(this).downcast_unchecked())
|
|
}
|