1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{ClockTime, Object};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 #[doc(alias = "GstControlBinding")]
11 pub struct ControlBinding(Object<ffi::GstControlBinding, ffi::GstControlBindingClass>) @extends Object;
12
13 match fn {
14 type_ => || ffi::gst_control_binding_get_type(),
15 }
16}
17
18impl ControlBinding {
19 pub const NONE: Option<&'static ControlBinding> = None;
20}
21
22unsafe impl Send for ControlBinding {}
23unsafe impl Sync for ControlBinding {}
24
25mod sealed {
26 pub trait Sealed {}
27 impl<T: super::IsA<super::ControlBinding>> Sealed for T {}
28}
29
30pub trait ControlBindingExt: IsA<ControlBinding> + sealed::Sealed + 'static {
31 #[doc(alias = "gst_control_binding_get_value")]
32 #[doc(alias = "get_value")]
33 fn value(&self, timestamp: ClockTime) -> Option<glib::Value> {
34 unsafe {
35 from_glib_full(ffi::gst_control_binding_get_value(
36 self.as_ref().to_glib_none().0,
37 timestamp.into_glib(),
38 ))
39 }
40 }
41
42 //#[doc(alias = "gst_control_binding_get_value_array")]
43 //#[doc(alias = "get_value_array")]
44 //fn is_value_array(&self, timestamp: impl Into<Option<ClockTime>>, interval: impl Into<Option<ClockTime>>, values: /*Unimplemented*/&[&Basic: Pointer]) -> bool {
45 // unsafe { TODO: call ffi:gst_control_binding_get_value_array() }
46 //}
47
48 #[doc(alias = "gst_control_binding_is_disabled")]
49 fn is_disabled(&self) -> bool {
50 unsafe {
51 from_glib(ffi::gst_control_binding_is_disabled(
52 self.as_ref().to_glib_none().0,
53 ))
54 }
55 }
56
57 #[doc(alias = "gst_control_binding_set_disabled")]
58 fn set_disabled(&self, disabled: bool) {
59 unsafe {
60 ffi::gst_control_binding_set_disabled(
61 self.as_ref().to_glib_none().0,
62 disabled.into_glib(),
63 );
64 }
65 }
66
67 #[doc(alias = "gst_control_binding_sync_values")]
68 fn sync_values(
69 &self,
70 object: &impl IsA<Object>,
71 timestamp: ClockTime,
72 last_sync: impl Into<Option<ClockTime>>,
73 ) -> bool {
74 unsafe {
75 from_glib(ffi::gst_control_binding_sync_values(
76 self.as_ref().to_glib_none().0,
77 object.as_ref().to_glib_none().0,
78 timestamp.into_glib(),
79 last_sync.into().into_glib(),
80 ))
81 }
82 }
83
84 fn object(&self) -> Option<Object> {
85 ObjectExt::property(self.as_ref(), "object")
86 }
87}
88
89impl<O: IsA<ControlBinding>> ControlBindingExt for O {}
90