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")]
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 unsafe {
54 let f: &F = &*(f as *const F);
55 f(&from_glib_borrow(this))
56 }
57 }
58 unsafe {
59 let f: Box_<F> = Box_::new(f);
60 connect_raw(
61 self.as_ptr() as *mut _,
62 c"notify::position".as_ptr(),
63 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
64 notify_position_trampoline::<F> as *const (),
65 )),
66 Box_::into_raw(f),
67 )
68 }
69 }
70}