1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use crate::BaseEffectClip;
use crate::Clip;
use crate::Container;
use crate::Extractable;
use crate::MetaContainer;
use crate::OperationClip;
use crate::TimelineElement;
use glib::object::IsA;
use glib::translate::*;
use glib::StaticType;

glib::wrapper! {
    /// The effect will be applied on the sources that have lower priorities
    /// (higher number) between the inpoint and the end of it.
    ///
    /// The asset ID of an effect clip is in the form:
    ///
    /// ```text
    ///   "audio ! bin ! description || video ! bin ! description"
    /// ```
    ///
    /// # Implements
    ///
    /// [`EffectClipExt`][trait@crate::prelude::EffectClipExt], [`BaseEffectClipExt`][trait@crate::prelude::BaseEffectClipExt], [`OperationClipExt`][trait@crate::prelude::OperationClipExt], [`ClipExt`][trait@crate::prelude::ClipExt], [`GESContainerExt`][trait@crate::prelude::GESContainerExt], [`TimelineElementExt`][trait@crate::prelude::TimelineElementExt], [`trait@glib::ObjectExt`], [`ExtractableExt`][trait@crate::prelude::ExtractableExt], [`MetaContainerExt`][trait@crate::prelude::MetaContainerExt], [`TimelineElementExtManual`][trait@crate::prelude::TimelineElementExtManual]
    #[doc(alias = "GESEffectClip")]
    pub struct EffectClip(Object<ffi::GESEffectClip, ffi::GESEffectClipClass>) @extends BaseEffectClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer;

    match fn {
        type_ => || ffi::ges_effect_clip_get_type(),
    }
}

impl EffectClip {
    pub const NONE: Option<&'static EffectClip> = None;

    /// Creates a new [`EffectClip`][crate::EffectClip] from the description of the bin.
    /// ## `video_bin_description`
    /// The gst-launch like bin description of the effect
    /// ## `audio_bin_description`
    /// The gst-launch like bin description of the effect
    ///
    /// # Returns
    ///
    /// a newly created [`EffectClip`][crate::EffectClip], or
    /// [`None`] if something went wrong.
    #[doc(alias = "ges_effect_clip_new")]
    pub fn new(
        video_bin_description: Option<&str>,
        audio_bin_description: Option<&str>,
    ) -> Option<EffectClip> {
        assert_initialized_main_thread!();
        unsafe {
            from_glib_none(ffi::ges_effect_clip_new(
                video_bin_description.to_glib_none().0,
                audio_bin_description.to_glib_none().0,
            ))
        }
    }
}

/// Trait containing all [`struct@EffectClip`] methods.
///
/// # Implementors
///
/// [`EffectClip`][struct@crate::EffectClip]
pub trait EffectClipExt: 'static {
    /// The description of the audio track of the effect bin with a gst-launch-style
    /// pipeline description. This should be used for test purposes.
    ///
    /// Example: "audiopanorama panorama=1.0"
    #[doc(alias = "audio-bin-description")]
    fn audio_bin_description(&self) -> Option<glib::GString>;

    /// The description of the video track of the effect bin with a gst-launch-style
    /// pipeline description. This should be used for test purposes.
    ///
    /// Example: "videobalance saturation=1.5 hue=+0.5"
    #[doc(alias = "video-bin-description")]
    fn video_bin_description(&self) -> Option<glib::GString>;
}

impl<O: IsA<EffectClip>> EffectClipExt for O {
    fn audio_bin_description(&self) -> Option<glib::GString> {
        glib::ObjectExt::property(self.as_ref(), "audio-bin-description")
    }

    fn video_bin_description(&self) -> Option<glib::GString> {
        glib::ObjectExt::property(self.as_ref(), "video-bin-description")
    }
}