gstreamer_editing_services/auto/
effect.rs

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::{
7    ffi, BaseEffect, Extractable, MetaContainer, Operation, TimelineElement, TrackElement,
8};
9use glib::{prelude::*, translate::*};
10
11glib::wrapper! {
12    #[doc(alias = "GESEffect")]
13    pub struct Effect(Object<ffi::GESEffect, ffi::GESEffectClass>) @extends BaseEffect, Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer;
14
15    match fn {
16        type_ => || ffi::ges_effect_get_type(),
17    }
18}
19
20impl Effect {
21    pub const NONE: Option<&'static Effect> = None;
22
23    #[doc(alias = "ges_effect_new")]
24    pub fn new(bin_description: &str) -> Result<Effect, glib::BoolError> {
25        assert_initialized_main_thread!();
26        unsafe {
27            Option::<_>::from_glib_none(ffi::ges_effect_new(bin_description.to_glib_none().0))
28                .ok_or_else(|| glib::bool_error!("Failed to create effect from description"))
29        }
30    }
31}
32
33pub trait EffectExt: IsA<Effect> + 'static {
34    #[doc(alias = "bin-description")]
35    fn bin_description(&self) -> Option<glib::GString> {
36        ObjectExt::property(self.as_ref(), "bin-description")
37    }
38}
39
40impl<O: IsA<Effect>> EffectExt for O {}