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)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-10-31 16:10:30 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-22 10:12:36 +00:00
|
|
|
use crate::Asset;
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2020-11-22 10:12:36 +00:00
|
|
|
use crate::Clip;
|
|
|
|
use crate::Extractable;
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2020-11-22 10:12:36 +00:00
|
|
|
use crate::FrameNumber;
|
|
|
|
use crate::Group;
|
|
|
|
use crate::Layer;
|
2021-09-19 08:07:33 +00:00
|
|
|
use crate::MetaContainer;
|
2020-11-22 10:12:36 +00:00
|
|
|
use crate::TimelineElement;
|
|
|
|
use crate::Track;
|
|
|
|
use crate::TrackElement;
|
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::*;
|
|
|
|
use std::boxed::Box as Box_;
|
2020-04-13 16:11:33 +00:00
|
|
|
use std::mem::transmute;
|
2018-10-31 16:10:30 +00:00
|
|
|
use std::ptr;
|
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GESTimeline")]
|
2021-09-19 08:07:33 +00:00
|
|
|
pub struct Timeline(Object<ffi::GESTimeline, ffi::GESTimelineClass>) @extends gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, Extractable, MetaContainer;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::ges_timeline_get_type(),
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Timeline {
|
2021-11-16 14:02:58 +00:00
|
|
|
pub const NONE: Option<&'static Timeline> = None;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_new")]
|
2018-10-31 16:10:30 +00:00
|
|
|
pub fn new() -> Timeline {
|
|
|
|
assert_initialized_main_thread!();
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib_none(ffi::ges_timeline_new()) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_new_audio_video")]
|
2018-10-31 16:10:30 +00:00
|
|
|
pub fn new_audio_video() -> Timeline {
|
|
|
|
assert_initialized_main_thread!();
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib_none(ffi::ges_timeline_new_audio_video()) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_new_from_uri")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "new_from_uri")]
|
2020-06-11 10:27:43 +00:00
|
|
|
pub fn from_uri(uri: &str) -> Result<Option<Timeline>, glib::Error> {
|
2018-10-31 16:10:30 +00:00
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2020-11-22 10:12:36 +00:00
|
|
|
let ret = ffi::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()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait TimelineExt: 'static {
|
2021-04-25 18:32:56 +00:00
|
|
|
#[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_add_layer")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_layer(&self, layer: &impl IsA<Layer>) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_add_track")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_track(&self, track: &impl IsA<Track>) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_append_layer")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn append_layer(&self) -> Layer;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_commit")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn commit(&self) -> bool;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_commit_sync")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn commit_sync(&self) -> bool;
|
|
|
|
|
2021-09-19 08:04:08 +00:00
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
#[doc(alias = "ges_timeline_freeze_commit")]
|
|
|
|
fn freeze_commit(&self);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_auto_transition")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_auto_transition")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn is_auto_transition(&self) -> bool;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_duration")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_duration")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn duration(&self) -> gst::ClockTime;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_element")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_element")]
|
2021-04-19 20:13:58 +00:00
|
|
|
fn element(&self, name: &str) -> Option<TimelineElement>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_frame_at")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_frame_at")]
|
2021-04-19 20:13:58 +00:00
|
|
|
fn frame_at(&self, timestamp: gst::ClockTime) -> FrameNumber;
|
2020-04-30 16:51:41 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_frame_time")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_frame_time")]
|
2021-04-05 10:48:30 +00:00
|
|
|
fn frame_time(&self, frame_number: FrameNumber) -> Option<gst::ClockTime>;
|
2020-04-30 16:51:41 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_groups")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_groups")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn groups(&self) -> Vec<Group>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_layer")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_layer")]
|
2021-04-19 20:13:58 +00:00
|
|
|
fn layer(&self, priority: u32) -> Option<Layer>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_layers")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_layers")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn layers(&self) -> Vec<Layer>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_pad_for_track")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_pad_for_track")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn pad_for_track(&self, track: &impl IsA<Track>) -> Option<gst::Pad>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_snapping_distance")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_snapping_distance")]
|
2021-04-05 10:48:30 +00:00
|
|
|
fn snapping_distance(&self) -> Option<gst::ClockTime>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_track_for_pad")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_track_for_pad")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn track_for_pad(&self, pad: &impl IsA<gst::Pad>) -> Option<Track>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_get_tracks")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_tracks")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn tracks(&self) -> Vec<Track>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_is_empty")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn is_empty(&self) -> bool;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_load_from_uri")]
|
2019-11-10 16:55:02 +00:00
|
|
|
fn load_from_uri(&self, uri: &str) -> Result<(), glib::Error>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_move_layer")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn move_layer(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
2021-05-23 19:22:45 +00:00
|
|
|
layer: &impl IsA<Layer>,
|
2019-06-18 10:12:00 +00:00
|
|
|
new_layer_priority: u32,
|
|
|
|
) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_paste_element")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn paste_element(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
2021-05-23 19:22:45 +00:00
|
|
|
element: &impl IsA<TimelineElement>,
|
2019-06-18 10:12:00 +00:00
|
|
|
position: gst::ClockTime,
|
|
|
|
layer_priority: i32,
|
|
|
|
) -> Option<TimelineElement>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_remove_layer")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_layer(&self, layer: &impl IsA<Layer>) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_remove_track")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_track(&self, track: &impl IsA<Track>) -> Result<(), glib::error::BoolError>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_save_to_uri")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn save_to_uri(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
uri: &str,
|
2021-05-23 19:22:45 +00:00
|
|
|
formatter_asset: Option<&impl IsA<Asset>>,
|
2019-06-18 10:12:00 +00:00
|
|
|
overwrite: bool,
|
2019-11-10 16:55:02 +00:00
|
|
|
) -> Result<(), glib::Error>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_set_auto_transition")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn set_auto_transition(&self, auto_transition: bool);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_timeline_set_snapping_distance")]
|
2021-06-16 15:25:28 +00:00
|
|
|
fn set_snapping_distance(&self, snapping_distance: gst::ClockTime);
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-09-19 08:04:08 +00:00
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
#[doc(alias = "ges_timeline_thaw_commit")]
|
|
|
|
fn thaw_commit(&self);
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "commited")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "group-added")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn connect_group_added<F: Fn(&Self, &Group) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
//#[doc(alias = "group-removed")]
|
2018-10-31 16:10:30 +00:00
|
|
|
//fn connect_group_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "layer-added")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "layer-removed")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "select-element-track")]
|
2020-08-11 07:49:37 +00:00
|
|
|
fn connect_select_element_track<F: Fn(&Self, &Clip, &TrackElement) -> Track + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
//#[doc(alias = "select-tracks-for-object")]
|
2018-10-31 16:10:30 +00:00
|
|
|
//fn connect_select_tracks_for_object<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "snapping-ended")]
|
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
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "snapping-started")]
|
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
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "track-added")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "track-removed")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "auto-transition")]
|
|
|
|
fn connect_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "duration")]
|
|
|
|
fn connect_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "snapping-distance")]
|
|
|
|
fn connect_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 {
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_layer(&self, layer: &impl IsA<Layer>) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_timeline_add_layer(
|
2019-06-18 10:12:00 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_track(&self, track: &impl IsA<Track>) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_timeline_add_track(
|
2019-06-18 10:12:00 +00:00
|
|
|
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 {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_none(ffi::ges_timeline_append_layer(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn commit(&self) -> bool {
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib(ffi::ges_timeline_commit(self.as_ref().to_glib_none().0)) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn commit_sync(&self) -> bool {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib(ffi::ges_timeline_commit_sync(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-19 08:04:08 +00:00
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
fn freeze_commit(&self) {
|
|
|
|
unsafe {
|
|
|
|
ffi::ges_timeline_freeze_commit(self.as_ref().to_glib_none().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn is_auto_transition(&self) -> bool {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib(ffi::ges_timeline_get_auto_transition(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn duration(&self) -> gst::ClockTime {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2021-04-05 10:48:30 +00:00
|
|
|
try_from_glib(ffi::ges_timeline_get_duration(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2021-04-05 10:48:30 +00:00
|
|
|
.expect("mandatory glib value is None")
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 20:13:58 +00:00
|
|
|
fn element(&self, name: &str) -> Option<TimelineElement> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_full(ffi::ges_timeline_get_element(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
name.to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2021-04-19 20:13:58 +00:00
|
|
|
fn frame_at(&self, timestamp: gst::ClockTime) -> FrameNumber {
|
2020-04-30 16:51:41 +00:00
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
ffi::ges_timeline_get_frame_at(self.as_ref().to_glib_none().0, timestamp.into_glib())
|
2020-04-30 16:51:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2021-04-05 10:48:30 +00:00
|
|
|
fn frame_time(&self, frame_number: FrameNumber) -> Option<gst::ClockTime> {
|
2020-04-30 16:51:41 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib(ffi::ges_timeline_get_frame_time(
|
2020-04-30 16:51:41 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
frame_number,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn groups(&self) -> Vec<Group> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(ffi::ges_timeline_get_groups(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 20:13:58 +00:00
|
|
|
fn layer(&self, priority: u32) -> Option<Layer> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_full(ffi::ges_timeline_get_layer(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
priority,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn layers(&self) -> Vec<Layer> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::ges_timeline_get_layers(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn pad_for_track(&self, track: &impl IsA<Track>) -> Option<gst::Pad> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_none(ffi::ges_timeline_get_pad_for_track(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
track.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-05 10:48:30 +00:00
|
|
|
fn snapping_distance(&self) -> Option<gst::ClockTime> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib(ffi::ges_timeline_get_snapping_distance(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn track_for_pad(&self, pad: &impl IsA<gst::Pad>) -> Option<Track> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_none(ffi::ges_timeline_get_track_for_pad(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
pad.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn tracks(&self) -> Vec<Track> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::ges_timeline_get_tracks(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn is_empty(&self) -> bool {
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib(ffi::ges_timeline_is_empty(self.as_ref().to_glib_none().0)) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2019-11-10 16:55:02 +00:00
|
|
|
fn load_from_uri(&self, uri: &str) -> Result<(), glib::Error> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2021-12-07 09:50:13 +00:00
|
|
|
let is_ok = ffi::ges_timeline_load_from_uri(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
uri.to_glib_none().0,
|
|
|
|
&mut error,
|
|
|
|
);
|
2021-12-14 11:43:30 +00:00
|
|
|
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
2019-06-18 10:12:00 +00:00
|
|
|
if error.is_null() {
|
|
|
|
Ok(())
|
|
|
|
} else {
|
|
|
|
Err(from_glib_full(error))
|
|
|
|
}
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn move_layer(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
2021-05-23 19:22:45 +00:00
|
|
|
layer: &impl IsA<Layer>,
|
2019-06-18 10:12:00 +00:00
|
|
|
new_layer_priority: u32,
|
|
|
|
) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_timeline_move_layer(
|
2019-06-18 10:12:00 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn paste_element(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
2021-05-23 19:22:45 +00:00
|
|
|
element: &impl IsA<TimelineElement>,
|
2019-06-18 10:12:00 +00:00
|
|
|
position: gst::ClockTime,
|
|
|
|
layer_priority: i32,
|
|
|
|
) -> Option<TimelineElement> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_full(ffi::ges_timeline_paste_element(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
element.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
position.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
layer_priority,
|
|
|
|
))
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_layer(&self, layer: &impl IsA<Layer>) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_timeline_remove_layer(
|
2019-06-18 10:12:00 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_track(&self, track: &impl IsA<Track>) -> Result<(), glib::error::BoolError> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_timeline_remove_track(
|
2019-06-18 10:12:00 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn save_to_uri(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
uri: &str,
|
2021-05-23 19:22:45 +00:00
|
|
|
formatter_asset: Option<&impl IsA<Asset>>,
|
2019-06-18 10:12:00 +00:00
|
|
|
overwrite: bool,
|
2019-11-10 16:55:02 +00:00
|
|
|
) -> Result<(), glib::Error> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2021-12-07 09:50:13 +00:00
|
|
|
let is_ok = ffi::ges_timeline_save_to_uri(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
uri.to_glib_none().0,
|
|
|
|
formatter_asset.map(|p| p.as_ref()).to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
overwrite.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&mut error,
|
|
|
|
);
|
2021-12-14 11:43:30 +00:00
|
|
|
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
2019-06-18 10:12:00 +00:00
|
|
|
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 {
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_timeline_set_auto_transition(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
auto_transition.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-16 15:25:28 +00:00
|
|
|
fn set_snapping_distance(&self, snapping_distance: gst::ClockTime) {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_timeline_set_snapping_distance(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-06-16 15:25:28 +00:00
|
|
|
snapping_distance.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-19 08:04:08 +00:00
|
|
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
|
|
|
fn thaw_commit(&self) {
|
|
|
|
unsafe {
|
|
|
|
ffi::ges_timeline_thaw_commit(self.as_ref().to_glib_none().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-31 16:10:30 +00:00
|
|
|
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn commited_trampoline<P: IsA<Timeline>, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(Timeline::from_glib_borrow(this).unsafe_cast_ref())
|
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"commited\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
commited_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
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 {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn group_added_trampoline<
|
|
|
|
P: IsA<Timeline>,
|
|
|
|
F: Fn(&P, &Group) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
group: *mut ffi::GESGroup,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Timeline::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
group_added_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//fn connect_group_removed<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
2020-08-11 07:49:37 +00:00
|
|
|
// Empty ctype children: *.PtrArray TypeId { ns_id: 1, id: 54 }
|
2018-10-31 16:10:30 +00:00
|
|
|
//}
|
|
|
|
|
|
|
|
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn layer_added_trampoline<
|
|
|
|
P: IsA<Timeline>,
|
|
|
|
F: Fn(&P, &Layer) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
layer: *mut ffi::GESLayer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Timeline::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
layer_added_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
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 {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn layer_removed_trampoline<
|
|
|
|
P: IsA<Timeline>,
|
|
|
|
F: Fn(&P, &Layer) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
layer: *mut ffi::GESLayer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Timeline::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
layer_removed_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2020-08-11 07:49:37 +00:00
|
|
|
fn connect_select_element_track<F: Fn(&Self, &Clip, &TrackElement) -> Track + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn select_element_track_trampoline<
|
2021-05-26 22:02:42 +00:00
|
|
|
P: IsA<Timeline>,
|
2020-08-11 07:49:37 +00:00
|
|
|
F: Fn(&P, &Clip, &TrackElement) -> Track + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
clip: *mut ffi::GESClip,
|
|
|
|
track_element: *mut ffi::GESTrackElement,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) -> *mut ffi::GESTrack {
|
2020-08-11 07:49:37 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Timeline::from_glib_borrow(this).unsafe_cast_ref(),
|
2020-08-11 07:49:37 +00:00
|
|
|
&from_glib_borrow(clip),
|
|
|
|
&from_glib_borrow(track_element),
|
|
|
|
)
|
|
|
|
.to_glib_full()
|
|
|
|
}
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<F> = Box_::new(f);
|
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"select-element-track\0".as_ptr() as *const _,
|
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
select_element_track_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
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 {
|
2020-04-30 16:51:41 +00:00
|
|
|
// Empty ctype return value *.PtrArray TypeId { ns_id: 1, id: 17 }
|
2018-10-31 16:10:30 +00:00
|
|
|
//}
|
|
|
|
|
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<
|
2021-05-26 22:02:42 +00:00
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:12:00 +00:00
|
|
|
F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
obj1: *mut ffi::GESTrackElement,
|
|
|
|
obj2: *mut ffi::GESTrackElement,
|
2019-06-18 10:12:00 +00:00
|
|
|
position: u64,
|
2020-11-22 10:12:36 +00:00
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Timeline::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
snapping_ended_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
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<
|
2021-05-26 22:02:42 +00:00
|
|
|
P: IsA<Timeline>,
|
2019-06-18 10:12:00 +00:00
|
|
|
F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
obj1: *mut ffi::GESTrackElement,
|
|
|
|
obj2: *mut ffi::GESTrackElement,
|
2019-06-18 10:12:00 +00:00
|
|
|
position: u64,
|
2020-11-22 10:12:36 +00:00
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Timeline::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
snapping_started_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
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 {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn track_added_trampoline<
|
|
|
|
P: IsA<Timeline>,
|
|
|
|
F: Fn(&P, &Track) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
track: *mut ffi::GESTrack,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Timeline::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
track_added_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
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 {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn track_removed_trampoline<
|
|
|
|
P: IsA<Timeline>,
|
|
|
|
F: Fn(&P, &Track) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
track: *mut ffi::GESTrack,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2021-06-21 21:07:45 +00:00
|
|
|
Timeline::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
track_removed_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_auto_transition_trampoline<
|
|
|
|
P: IsA<Timeline>,
|
|
|
|
F: Fn(&P) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(Timeline::from_glib_borrow(this).unsafe_cast_ref())
|
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"notify::auto-transition\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_auto_transition_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_duration_trampoline<P: IsA<Timeline>, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(Timeline::from_glib_borrow(this).unsafe_cast_ref())
|
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"notify::duration\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_duration_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_snapping_distance_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_snapping_distance_trampoline<
|
|
|
|
P: IsA<Timeline>,
|
|
|
|
F: Fn(&P) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTimeline,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(Timeline::from_glib_borrow(this).unsafe_cast_ref())
|
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"notify::snapping-distance\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_snapping_distance_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|