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
|
|
|
|
|
2021-09-19 08:07:33 +00:00
|
|
|
use crate::MetaContainer;
|
2020-11-22 10:12:36 +00:00
|
|
|
use crate::Timeline;
|
|
|
|
use crate::TrackElement;
|
|
|
|
use crate::TrackType;
|
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-06-18 10:12:00 +00:00
|
|
|
use glib::StaticType;
|
2021-04-27 08:09:37 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2021-04-19 16:24:43 +00:00
|
|
|
use glib::ToValue;
|
2018-10-31 16:10:30 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2020-04-13 16:11:33 +00:00
|
|
|
use std::mem::transmute;
|
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-06-03 12:26:16 +00:00
|
|
|
use std::ptr;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GESTrack")]
|
2021-09-19 08:07:33 +00:00
|
|
|
pub struct Track(Object<ffi::GESTrack, ffi::GESTrackClass>) @extends gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, MetaContainer;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::ges_track_get_type(),
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Track {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_new")]
|
2018-10-31 16:10:30 +00:00
|
|
|
pub fn new(type_: TrackType, caps: &gst::Caps) -> Track {
|
|
|
|
assert_initialized_main_thread!();
|
2021-04-27 15:10:39 +00:00
|
|
|
unsafe { from_glib_none(ffi::ges_track_new(type_.into_glib(), caps.to_glib_full())) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-03 17:28:46 +00:00
|
|
|
impl Track {
|
|
|
|
pub const NONE: Option<&'static Track> = None;
|
|
|
|
}
|
2019-01-16 11:32:39 +00:00
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait GESTrackExt: 'static {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_add_element")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_element(&self, object: &impl IsA<TrackElement>) -> Result<(), glib::error::BoolError>;
|
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_track_add_element_full")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_element_full(&self, object: &impl IsA<TrackElement>) -> Result<(), glib::Error>;
|
2020-06-03 12:26:16 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_commit")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn commit(&self) -> bool;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_get_caps")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_caps")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn caps(&self) -> Option<gst::Caps>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_get_elements")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_elements")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn elements(&self) -> Vec<TrackElement>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_get_mixing")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_mixing")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn is_mixing(&self) -> bool;
|
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_track_get_restriction_caps")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_restriction_caps")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn restriction_caps(&self) -> Option<gst::Caps>;
|
2020-04-30 16:51:41 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_get_timeline")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_timeline")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn timeline(&self) -> Option<Timeline>;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_remove_element")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_element(&self, object: &impl IsA<TrackElement>)
|
|
|
|
-> Result<(), glib::error::BoolError>;
|
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_track_remove_element_full")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_element_full(&self, object: &impl IsA<TrackElement>) -> Result<(), glib::Error>;
|
2020-06-03 12:26:16 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
//#[doc(alias = "ges_track_set_create_element_for_gap_func")]
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn set_create_element_for_gap_func<P: Fn(&Track) -> gst::Element + 'static>(&self, func: P);
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_set_mixing")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn set_mixing(&self, mixing: bool);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_set_restriction_caps")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn set_restriction_caps(&self, caps: &gst::Caps);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_set_timeline")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn set_timeline(&self, timeline: &impl IsA<Timeline>);
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "ges_track_update_restriction_caps")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn update_restriction_caps(&self, caps: &gst::Caps);
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn duration(&self) -> u64;
|
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-11 19:38:18 +00:00
|
|
|
fn id(&self) -> Option<glib::GString>;
|
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-11 19:38:18 +00:00
|
|
|
fn set_id(&self, id: Option<&str>);
|
2020-04-30 16:51:41 +00:00
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "restriction-caps")]
|
2018-10-31 16:10:30 +00:00
|
|
|
fn get_property_restriction_caps(&self) -> Option<gst::Caps>;
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "track-type")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn track_type(&self) -> TrackType;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
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 = "track-element-added")]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-10-31 16:10:30 +00:00
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "track-element-removed")]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + '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
|
|
|
|
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 = "id")]
|
|
|
|
fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
2020-04-30 16:51:41 +00:00
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "mixing")]
|
|
|
|
fn connect_mixing_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 = "restriction-caps")]
|
|
|
|
fn connect_restriction_caps_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<Track>> GESTrackExt for O {
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_element(&self, object: &impl IsA<TrackElement>) -> 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_track_add_element(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
object.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to add element"
|
|
|
|
)
|
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-05-23 19:22:45 +00:00
|
|
|
fn add_element_full(&self, object: &impl IsA<TrackElement>) -> Result<(), glib::Error> {
|
2020-06-03 12:26:16 +00:00
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2020-11-22 10:12:36 +00:00
|
|
|
let _ = ffi::ges_track_add_element_full(
|
2020-06-03 12:26:16 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
object.as_ref().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
|
|
|
fn commit(&self) -> bool {
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib(ffi::ges_track_commit(self.as_ref().to_glib_none().0)) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn caps(&self) -> Option<gst::Caps> {
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib_none(ffi::ges_track_get_caps(self.as_ref().to_glib_none().0)) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn elements(&self) -> Vec<TrackElement> {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::ges_track_get_elements(
|
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 is_mixing(&self) -> bool {
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib(ffi::ges_track_get_mixing(self.as_ref().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-11 19:38:18 +00:00
|
|
|
fn restriction_caps(&self) -> Option<gst::Caps> {
|
2020-04-30 16:51:41 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
from_glib_full(ffi::ges_track_get_restriction_caps(
|
2020-04-30 16:51:41 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn timeline(&self) -> Option<Timeline> {
|
2020-11-22 10:12:36 +00:00
|
|
|
unsafe { from_glib_none(ffi::ges_track_get_timeline(self.as_ref().to_glib_none().0)) }
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_element(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
2021-05-23 19:22:45 +00:00
|
|
|
object: &impl IsA<TrackElement>,
|
2019-06-18 10:12:00 +00:00
|
|
|
) -> 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_track_remove_element(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
object.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to remove element"
|
|
|
|
)
|
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-05-23 19:22:45 +00:00
|
|
|
fn remove_element_full(&self, object: &impl IsA<TrackElement>) -> Result<(), glib::Error> {
|
2020-06-03 12:26:16 +00:00
|
|
|
unsafe {
|
|
|
|
let mut error = ptr::null_mut();
|
2020-11-22 10:12:36 +00:00
|
|
|
let _ = ffi::ges_track_remove_element_full(
|
2020-06-03 12:26:16 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
object.as_ref().to_glib_none().0,
|
|
|
|
&mut error,
|
|
|
|
);
|
|
|
|
if error.is_null() {
|
|
|
|
Ok(())
|
|
|
|
} else {
|
|
|
|
Err(from_glib_full(error))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn set_create_element_for_gap_func<P: Fn(&Track) -> gst::Element + 'static>(&self, func: P) {
|
2020-11-22 10:12:36 +00:00
|
|
|
// unsafe { TODO: call ffi:ges_track_set_create_element_for_gap_func() }
|
2018-10-31 16:10:30 +00:00
|
|
|
//}
|
|
|
|
|
|
|
|
fn set_mixing(&self, mixing: bool) {
|
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
ffi::ges_track_set_mixing(self.as_ref().to_glib_none().0, mixing.into_glib());
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_restriction_caps(&self, caps: &gst::Caps) {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_track_set_restriction_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn set_timeline(&self, timeline: &impl IsA<Timeline>) {
|
2018-10-31 16:10:30 +00:00
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_track_set_timeline(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
timeline.as_ref().to_glib_none().0,
|
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn update_restriction_caps(&self, caps: &gst::Caps) {
|
|
|
|
unsafe {
|
2020-11-22 10:12:36 +00:00
|
|
|
ffi::ges_track_update_restriction_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
);
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn duration(&self) -> u64 {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::property(self.as_ref(), "duration")
|
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-11 19:38:18 +00:00
|
|
|
fn id(&self) -> Option<glib::GString> {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::property(self.as_ref(), "id")
|
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-11 19:38:18 +00:00
|
|
|
fn set_id(&self, id: Option<&str>) {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::set_property(self.as_ref(), "id", &id)
|
2020-04-30 16:51:41 +00:00
|
|
|
}
|
|
|
|
|
2018-10-31 16:10:30 +00:00
|
|
|
fn get_property_restriction_caps(&self) -> Option<gst::Caps> {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::property(self.as_ref(), "restriction-caps")
|
2018-10-31 16:10:30 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn track_type(&self) -> TrackType {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::property(self.as_ref(), "track-type")
|
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<Track>, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *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);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(Track::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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn track_element_added_trampoline<
|
|
|
|
P: IsA<Track>,
|
|
|
|
F: Fn(&P, &TrackElement) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTrack,
|
|
|
|
effect: *mut ffi::GESTrackElement,
|
|
|
|
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
|
|
|
Track::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&from_glib_borrow(effect),
|
|
|
|
)
|
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-element-added\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
track_element_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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn track_element_removed_trampoline<
|
2021-05-26 22:02:42 +00:00
|
|
|
P: IsA<Track>,
|
2019-06-18 10:12:00 +00:00
|
|
|
F: Fn(&P, &TrackElement) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTrack,
|
|
|
|
effect: *mut ffi::GESTrackElement,
|
|
|
|
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
|
|
|
Track::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&from_glib_borrow(effect),
|
|
|
|
)
|
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-element-removed\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
track_element_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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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<Track>, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTrack,
|
|
|
|
_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(Track::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),
|
|
|
|
)
|
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-05-03 18:35:37 +00:00
|
|
|
fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_id_trampoline<P: IsA<Track>, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTrack,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2020-04-30 16:51:41 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(Track::from_glib_borrow(this).unsafe_cast_ref())
|
2020-04-30 16:51:41 +00:00
|
|
|
}
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<F> = Box_::new(f);
|
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::id\0".as_ptr() as *const _,
|
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_id_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_mixing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_mixing_trampoline<P: IsA<Track>, F: Fn(&P) + 'static>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTrack,
|
|
|
|
_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(Track::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::mixing\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_mixing_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_restriction_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_restriction_caps_trampoline<
|
|
|
|
P: IsA<Track>,
|
|
|
|
F: Fn(&P) + 'static,
|
|
|
|
>(
|
2020-11-22 10:12:36 +00:00
|
|
|
this: *mut ffi::GESTrack,
|
|
|
|
_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(Track::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::restriction-caps\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_restriction_caps_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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|