2018-10-31 16:10:30 +00:00
|
|
|
// 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
|
|
|
|
|
2019-03-19 07:40:05 +00:00
|
|
|
use ges_sys;
|
2018-10-31 16:10:30 +00:00
|
|
|
use glib;
|
2019-01-16 11:32:39 +00:00
|
|
|
use glib::object::Cast;
|
2018-10-31 16:10:30 +00:00
|
|
|
use glib::object::IsA;
|
2018-12-08 09:05:20 +00:00
|
|
|
use glib::signal::connect_raw;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::signal::SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
use glib::translate::*;
|
2019-03-19 07:40:05 +00:00
|
|
|
use glib_sys;
|
2018-10-31 16:10:30 +00:00
|
|
|
use gst;
|
|
|
|
use std::boxed::Box as Box_;
|
|
|
|
use std::mem::transmute;
|
|
|
|
use std::ptr;
|
2019-06-18 10:12:00 +00:00
|
|
|
use Asset;
|
|
|
|
use Error;
|
|
|
|
use Extractable;
|
|
|
|
use Group;
|
|
|
|
use Layer;
|
|
|
|
use TimelineElement;
|
|
|
|
use Track;
|
|
|
|
use TrackElement;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
glib_wrapper! {
|
2019-03-19 07:40:05 +00:00
|
|
|
pub struct Timeline(Object<ges_sys::GESTimeline, ges_sys::GESTimelineClass, TimelineClass>) @extends gst::Element, gst::Object, @implements Extractable;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
match fn {
|
2019-03-19 07:40:05 +00:00
|
|
|
get_type => || ges_sys::ges_timeline_get_type(),
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Timeline {
|
|
|
|
pub fn new() -> Timeline {
|
|
|
|
assert_initialized_main_thread!();
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { from_glib_none(ges_sys::ges_timeline_new()) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn new_audio_video() -> Timeline {
|
|
|
|
assert_initialized_main_thread!();
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { from_glib_none(ges_sys::ges_timeline_new_audio_video()) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn new_from_uri(uri: &str) -> Result<Option<Timeline>, Error> {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2019-03-19 07:40:05 +00:00
|
|
|
let ret = ges_sys::ges_timeline_new_from_uri(uri.to_glib_none().0, &mut error);
|
2019-06-18 10:12:00 +00:00
|
|
|
if error.is_null() {
|
|
|
|
Ok(from_glib_none(ret))
|
|
|
|
} else {
|
|
|
|
Err(from_glib_full(error))
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for Timeline {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_TIMELINE: Option<&Timeline> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait TimelineExt: 'static {
|
2019-01-16 11:32:39 +00:00
|
|
|
fn add_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2018-11-04 18:30:58 +00:00
|
|
|
fn add_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
fn append_layer(&self) -> Layer;
|
|
|
|
|
|
|
|
fn commit(&self) -> bool;
|
|
|
|
|
|
|
|
fn commit_sync(&self) -> bool;
|
|
|
|
|
|
|
|
fn get_auto_transition(&self) -> bool;
|
|
|
|
|
|
|
|
fn get_duration(&self) -> gst::ClockTime;
|
|
|
|
|
|
|
|
fn get_element(&self, name: &str) -> Option<TimelineElement>;
|
|
|
|
|
|
|
|
fn get_groups(&self) -> Vec<Group>;
|
|
|
|
|
|
|
|
fn get_layer(&self, priority: u32) -> Option<Layer>;
|
|
|
|
|
|
|
|
fn get_layers(&self) -> Vec<Layer>;
|
|
|
|
|
|
|
|
fn get_pad_for_track<P: IsA<Track>>(&self, track: &P) -> Option<gst::Pad>;
|
|
|
|
|
|
|
|
fn get_snapping_distance(&self) -> gst::ClockTime;
|
|
|
|
|
|
|
|
fn get_track_for_pad<P: IsA<gst::Pad>>(&self, pad: &P) -> Option<Track>;
|
|
|
|
|
|
|
|
fn get_tracks(&self) -> Vec<Track>;
|
|
|
|
|
|
|
|
fn is_empty(&self) -> bool;
|
|
|
|
|
|
|
|
fn load_from_uri(&self, uri: &str) -> Result<(), Error>;
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn move_layer<P: IsA<Layer>>(
|
|
|
|
&self,
|
|
|
|
layer: &P,
|
|
|
|
new_layer_priority: u32,
|
|
|
|
) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn paste_element<P: IsA<TimelineElement>>(
|
|
|
|
&self,
|
|
|
|
element: &P,
|
|
|
|
position: gst::ClockTime,
|
|
|
|
layer_priority: i32,
|
|
|
|
) -> Option<TimelineElement>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
fn remove_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2019-02-07 10:03:01 +00:00
|
|
|
fn remove_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn save_to_uri<P: IsA<Asset>>(
|
|
|
|
&self,
|
|
|
|
uri: &str,
|
|
|
|
formatter_asset: Option<&P>,
|
|
|
|
overwrite: bool,
|
|
|
|
) -> Result<(), Error>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
fn set_auto_transition(&self, auto_transition: bool);
|
|
|
|
|
|
|
|
fn set_snapping_distance(&self, snapping_distance: gst::ClockTime);
|
|
|
|
|
|
|
|
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
fn connect_group_added<F: Fn(&Self, &Group) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
//fn connect_group_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
//fn connect_select_tracks_for_object<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
|
|
|
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
impl<O: IsA<Timeline>> TimelineExt for O {
|
2019-01-16 11:32:39 +00:00
|
|
|
fn add_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
ges_sys::ges_timeline_add_layer(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
layer.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to add layer"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-04 18:30:58 +00:00
|
|
|
fn add_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
ges_sys::ges_timeline_add_track(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
track.as_ref().to_glib_full()
|
|
|
|
),
|
|
|
|
"Failed to add track"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn append_layer(&self) -> Layer {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_none(ges_sys::ges_timeline_append_layer(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn commit(&self) -> bool {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { from_glib(ges_sys::ges_timeline_commit(self.as_ref().to_glib_none().0)) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn commit_sync(&self) -> bool {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(ges_sys::ges_timeline_commit_sync(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_auto_transition(&self) -> bool {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(ges_sys::ges_timeline_get_auto_transition(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_duration(&self) -> gst::ClockTime {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(ges_sys::ges_timeline_get_duration(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_element(&self, name: &str) -> Option<TimelineElement> {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(ges_sys::ges_timeline_get_element(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
name.to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_groups(&self) -> Vec<Group> {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(ges_sys::ges_timeline_get_groups(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_layer(&self, priority: u32) -> Option<Layer> {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(ges_sys::ges_timeline_get_layer(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
priority,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_layers(&self) -> Vec<Layer> {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ges_sys::ges_timeline_get_layers(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_pad_for_track<P: IsA<Track>>(&self, track: &P) -> Option<gst::Pad> {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_none(ges_sys::ges_timeline_get_pad_for_track(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
track.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_snapping_distance(&self) -> gst::ClockTime {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(ges_sys::ges_timeline_get_snapping_distance(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_track_for_pad<P: IsA<gst::Pad>>(&self, pad: &P) -> Option<Track> {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_none(ges_sys::ges_timeline_get_track_for_pad(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
pad.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_tracks(&self) -> Vec<Track> {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ges_sys::ges_timeline_get_tracks(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn is_empty(&self) -> bool {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib(ges_sys::ges_timeline_is_empty(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn load_from_uri(&self, uri: &str) -> Result<(), Error> {
|
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2019-06-18 10:12:00 +00:00
|
|
|
let _ = ges_sys::ges_timeline_load_from_uri(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
uri.to_glib_none().0,
|
|
|
|
&mut error,
|
|
|
|
);
|
|
|
|
if error.is_null() {
|
|
|
|
Ok(())
|
|
|
|
} else {
|
|
|
|
Err(from_glib_full(error))
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn move_layer<P: IsA<Layer>>(
|
|
|
|
&self,
|
|
|
|
layer: &P,
|
|
|
|
new_layer_priority: u32,
|
|
|
|
) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
ges_sys::ges_timeline_move_layer(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
layer.as_ref().to_glib_none().0,
|
|
|
|
new_layer_priority
|
|
|
|
),
|
|
|
|
"Failed to move layer"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn paste_element<P: IsA<TimelineElement>>(
|
|
|
|
&self,
|
|
|
|
element: &P,
|
|
|
|
position: gst::ClockTime,
|
|
|
|
layer_priority: i32,
|
|
|
|
) -> Option<TimelineElement> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_none(ges_sys::ges_timeline_paste_element(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
element.as_ref().to_glib_none().0,
|
|
|
|
position.to_glib(),
|
|
|
|
layer_priority,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
fn remove_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
ges_sys::ges_timeline_remove_layer(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
layer.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to remove layer"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-07 10:03:01 +00:00
|
|
|
fn remove_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
glib_result_from_gboolean!(
|
|
|
|
ges_sys::ges_timeline_remove_track(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
track.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to remove track"
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn save_to_uri<P: IsA<Asset>>(
|
|
|
|
&self,
|
|
|
|
uri: &str,
|
|
|
|
formatter_asset: Option<&P>,
|
|
|
|
overwrite: bool,
|
|
|
|
) -> Result<(), Error> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2019-06-18 10:12:00 +00:00
|
|
|
let _ = ges_sys::ges_timeline_save_to_uri(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
uri.to_glib_none().0,
|
|
|
|
formatter_asset.map(|p| p.as_ref()).to_glib_none().0,
|
|
|
|
overwrite.to_glib(),
|
|
|
|
&mut error,
|
|
|
|
);
|
|
|
|
if error.is_null() {
|
|
|
|
Ok(())
|
|
|
|
} else {
|
|
|
|
Err(from_glib_full(error))
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_auto_transition(&self, auto_transition: bool) {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
ges_sys::ges_timeline_set_auto_transition(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
auto_transition.to_glib(),
|
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_snapping_distance(&self, snapping_distance: gst::ClockTime) {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
ges_sys::ges_timeline_set_snapping_distance(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
snapping_distance.to_glib(),
|
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn commited_trampoline<P, F: Fn(&P) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&Timeline::from_glib_borrow(this).unsafe_cast())
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"commited\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(commited_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_group_added<F: Fn(&Self, &Group) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn group_added_trampoline<P, F: Fn(&P, &Group) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
group: *mut ges_sys::GESGroup,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
|
|
|
&Timeline::from_glib_borrow(this).unsafe_cast(),
|
|
|
|
&from_glib_borrow(group),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"group-added\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(group_added_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//fn connect_group_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
|
|
|
// Empty ctype children: *.PtrArray TypeId { ns_id: 1, id: 51 }
|
|
|
|
//}
|
|
|
|
|
|
|
|
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn layer_added_trampoline<P, F: Fn(&P, &Layer) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
layer: *mut ges_sys::GESLayer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
|
|
|
&Timeline::from_glib_borrow(this).unsafe_cast(),
|
|
|
|
&from_glib_borrow(layer),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"layer-added\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(layer_added_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn layer_removed_trampoline<P, F: Fn(&P, &Layer) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
layer: *mut ges_sys::GESLayer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
|
|
|
&Timeline::from_glib_borrow(this).unsafe_cast(),
|
|
|
|
&from_glib_borrow(layer),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"layer-removed\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(layer_removed_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//fn connect_select_tracks_for_object<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
|
|
|
// Empty ctype return value *.PtrArray TypeId { ns_id: 1, id: 16 }
|
|
|
|
//}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn snapping_ended_trampoline<
|
|
|
|
P,
|
|
|
|
F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
obj1: *mut ges_sys::GESTrackElement,
|
|
|
|
obj2: *mut ges_sys::GESTrackElement,
|
|
|
|
position: u64,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
|
|
|
&Timeline::from_glib_borrow(this).unsafe_cast(),
|
|
|
|
&from_glib_borrow(obj1),
|
|
|
|
&from_glib_borrow(obj2),
|
|
|
|
position,
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"snapping-ended\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(snapping_ended_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn snapping_started_trampoline<
|
|
|
|
P,
|
|
|
|
F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
obj1: *mut ges_sys::GESTrackElement,
|
|
|
|
obj2: *mut ges_sys::GESTrackElement,
|
|
|
|
position: u64,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
|
|
|
&Timeline::from_glib_borrow(this).unsafe_cast(),
|
|
|
|
&from_glib_borrow(obj1),
|
|
|
|
&from_glib_borrow(obj2),
|
|
|
|
position,
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"snapping-started\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(snapping_started_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn track_added_trampoline<P, F: Fn(&P, &Track) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
track: *mut ges_sys::GESTrack,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
|
|
|
&Timeline::from_glib_borrow(this).unsafe_cast(),
|
|
|
|
&from_glib_borrow(track),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"track-added\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(track_added_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn track_removed_trampoline<P, F: Fn(&P, &Track) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
track: *mut ges_sys::GESTrack,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
|
|
|
&Timeline::from_glib_borrow(this).unsafe_cast(),
|
|
|
|
&from_glib_borrow(track),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"track-removed\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(track_removed_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_auto_transition_trampoline<P, F: Fn(&P) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&Timeline::from_glib_borrow(this).unsafe_cast())
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::auto-transition\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(
|
|
|
|
notify_auto_transition_trampoline::<Self, F> as usize,
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&Timeline::from_glib_borrow(this).unsafe_cast())
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::duration\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(notify_duration_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_snapping_distance_trampoline<P, F: Fn(&P) + 'static>(
|
|
|
|
this: *mut ges_sys::GESTimeline,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&Timeline::from_glib_borrow(this).unsafe_cast())
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::snapping-distance\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(
|
|
|
|
notify_snapping_distance_trampoline::<Self, F> as usize,
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|