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
use ges_sys;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use gobject_sys;
use BaseEffect;
use Extractable;
use TimelineElement;
use TrackElement;
glib_wrapper! {
pub struct Effect(Object<ges_sys::GESEffect, ges_sys::GESEffectClass, EffectClass>) @extends BaseEffect, TrackElement, TimelineElement, @implements Extractable;
match fn {
get_type => || ges_sys::ges_effect_get_type(),
}
}
impl Effect {
pub fn new(bin_description: &str) -> Result<Effect, glib::BoolError> {
assert_initialized_main_thread!();
unsafe {
Option::<_>::from_glib_none(ges_sys::ges_effect_new(bin_description.to_glib_none().0))
.ok_or_else(|| glib_bool_error!("Failed to create effect from description"))
}
}
}
pub const NONE_EFFECT: Option<&Effect> = None;
pub trait EffectExt: 'static {
fn get_property_bin_description(&self) -> Option<GString>;
}
impl<O: IsA<Effect>> EffectExt for O {
fn get_property_bin_description(&self) -> Option<GString> {
unsafe {
let mut value = Value::from_type(<GString as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"bin-description\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `bin-description` getter")
}
}
}