2020-06-09 01:06:49 +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)
|
2020-06-09 01:06:49 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2023-01-03 18:56:00 +00:00
|
|
|
use crate::{InterpolationMode, TimedValueControlSource};
|
|
|
|
use glib::{
|
|
|
|
prelude::*,
|
|
|
|
signal::{connect_raw, SignalHandlerId},
|
|
|
|
translate::*,
|
|
|
|
};
|
|
|
|
use std::{boxed::Box as Box_, mem::transmute};
|
2020-06-09 01:06:49 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstInterpolationControlSource")]
|
2020-11-21 18:48:08 +00:00
|
|
|
pub struct InterpolationControlSource(Object<ffi::GstInterpolationControlSource, ffi::GstInterpolationControlSourceClass>) @extends TimedValueControlSource, gst::ControlSource, gst::Object;
|
2020-06-09 01:06:49 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_interpolation_control_source_get_type(),
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl InterpolationControlSource {
|
2021-11-16 14:02:58 +00:00
|
|
|
pub const NONE: Option<&'static InterpolationControlSource> = None;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_interpolation_control_source_new")]
|
2020-06-09 01:06:49 +00:00
|
|
|
pub fn new() -> InterpolationControlSource {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
2020-11-21 18:48:08 +00:00
|
|
|
gst::ControlSource::from_glib_full(ffi::gst_interpolation_control_source_new())
|
|
|
|
.unsafe_cast()
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for InterpolationControlSource {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for InterpolationControlSource {}
|
|
|
|
unsafe impl Sync for InterpolationControlSource {}
|
|
|
|
|
|
|
|
pub trait InterpolationControlSourceExt: 'static {
|
2021-04-11 19:38:18 +00:00
|
|
|
fn mode(&self) -> InterpolationMode;
|
2020-06-09 01:06:49 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn set_mode(&self, mode: InterpolationMode);
|
2020-06-09 01:06:49 +00:00
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "mode")]
|
|
|
|
fn connect_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<InterpolationControlSource>> InterpolationControlSourceExt for O {
|
2021-04-11 19:38:18 +00:00
|
|
|
fn mode(&self) -> InterpolationMode {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::property(self.as_ref(), "mode")
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn set_mode(&self, mode: InterpolationMode) {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::set_property(self.as_ref(), "mode", &mode)
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_mode_trampoline<
|
|
|
|
P: IsA<InterpolationControlSource>,
|
|
|
|
F: Fn(&P) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-21 18:48:08 +00:00
|
|
|
this: *mut ffi::GstInterpolationControlSource,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2020-06-09 01:06:49 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(InterpolationControlSource::from_glib_borrow(this).unsafe_cast_ref())
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<F> = Box_::new(f);
|
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::mode\0".as_ptr() as *const _,
|
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_mode_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|