gstreamer_editing_services/auto/
marker.rs1use crate::{MetaContainer, ffi};
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 #[doc(alias = "GESMarker")]
16 pub struct Marker(Object<ffi::GESMarker, ffi::GESMarkerClass>) @implements MetaContainer;
17
18 match fn {
19 type_ => || ffi::ges_marker_get_type(),
20 }
21}
22
23impl Marker {
24 #[cfg(feature = "v1_18")]
25 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
26 pub fn position(&self) -> u64 {
27 ObjectExt::property(self, "position")
28 }
29
30 #[cfg(feature = "v1_18")]
31 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
32 #[doc(alias = "position")]
33 pub fn connect_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
34 unsafe extern "C" fn notify_position_trampoline<F: Fn(&Marker) + 'static>(
35 this: *mut ffi::GESMarker,
36 _param_spec: glib::ffi::gpointer,
37 f: glib::ffi::gpointer,
38 ) {
39 unsafe {
40 let f: &F = &*(f as *const F);
41 f(&from_glib_borrow(this))
42 }
43 }
44 unsafe {
45 let f: Box_<F> = Box_::new(f);
46 connect_raw(
47 self.as_ptr() as *mut _,
48 c"notify::position".as_ptr(),
49 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
50 notify_position_trampoline::<F> as *const (),
51 )),
52 Box_::into_raw(f),
53 )
54 }
55 }
56}