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