Commit 3ea34695 authored by François Laignel's avatar François Laignel

ges: update functions returning bool to Result<(), BoolError>

Fixes #181
parent b4ad105c
Pipeline #17964 passed with stages
in 9 minutes and 23 seconds
......@@ -43,17 +43,10 @@ generate = [
"GES.Effect",
"GES.TrackType",
"GES.BaseEffect",
"GES.TimelineElement",
"GES.Group",
"GES.TrackElement",
"GES.Layer",
"GES.Clip",
"GES.UriClip",
"GES.Asset",
"GES.UriClipAsset",
"GES.UriSourceAsset",
"GES.Extractable",
"GES.Project",
]
[[object]]
......@@ -119,6 +112,10 @@ status = "generate"
[object.function.return]
bool_return_is_error = "Failed to move layer"
[[object.function]]
name = "remove_track"
[object.function.return]
bool_return_is_error = "Failed to remove track"
[[object]]
name = "GES.Container"
......@@ -158,6 +155,11 @@ trait_name = "GESPipelineExt"
[object.function.return]
bool_return_is_error = "Failed to save thumbnail"
[[object.function]]
name = "set_timeline"
[object.function.return]
bool_return_is_error = "Failed to set timeline"
[[object]]
name = "GES.Track"
status = "generate"
......@@ -171,3 +173,125 @@ trait_name = "GESTrackExt"
name = "remove_element"
[object.function.return]
bool_return_is_error = "Failed to remove element"
[[object]]
name = "GES.Asset"
status = "generate"
[[object.function]]
name = "set_proxy"
[object.function.return]
bool_return_is_error = "Failed to set proxy"
[[object.function]]
name = "unproxy"
[object.function.return]
bool_return_is_error = "Failed to unproxy asset"
[[object]]
name = "GES.Clip"
status = "generate"
[[object.function]]
name = "move_to_layer"
[object.function.return]
bool_return_is_error = "Failed to move clip to specified layer"
[[object.function]]
name = "set_top_effect_index"
[object.function.return]
bool_return_is_error = "Failed to move effect"
[[object.function]]
name = "set_top_effect_priority"
[object.function.return]
bool_return_is_error = "Failed to the set top effect priority"
[[object]]
name = "GES.Extractable"
status = "generate"
[[object.function]]
name = "set_asset"
[object.function.return]
bool_return_is_error = "Failed to set asset"
[[object]]
name = "GES.Layer"
status = "generate"
[[object.function]]
name = "add_clip"
[object.function.return]
bool_return_is_error = "Failed to add clip"
[[object.function]]
name = "remove_clip"
[object.function.return]
bool_return_is_error = "Failed to remove clip"
[[object]]
name = "GES.Project"
status = "generate"
[[object.function]]
name = "add_encoding_profile"
[object.function.return]
bool_return_is_error = "Failed to add profile"
[[object.function]]
name = "remove_asset"
[object.function.return]
bool_return_is_error = "Failed to remove asset"
[[object]]
name = "GES.TimelineElement"
status = "generate"
[[object.function]]
name = "ripple"
[object.function.return]
bool_return_is_error = "Failed to ripple"
[[object.function]]
name = "ripple_end"
[object.function.return]
bool_return_is_error = "Failed to ripple"
[[object.function]]
name = "roll_end"
[object.function.return]
bool_return_is_error = "Failed to roll"
[[object.function]]
name = "roll_start"
[object.function.return]
bool_return_is_error = "Failed to roll"
[[object.function]]
name = "set_name"
[object.function.return]
bool_return_is_error = "Failed to set name"
[[object.function]]
name = "set_parent"
[object.function.return]
bool_return_is_error = "`TimelineElement` already had a parent or its parent was the same as specified"
[[object.function]]
name = "set_timeline"
[object.function.return]
bool_return_is_error = "`Failed to set timeline"
[[object.function]]
name = "trim"
[object.function.return]
bool_return_is_error = "`Failed to trim"
[[object]]
name = "GES.TrackElement"
status = "generate"
[[object.function]]
name = "edit"
[object.function.return]
bool_return_is_error = "Failed to edit"
[[object.function]]
name = "remove_control_binding"
[object.function.return]
bool_return_is_error = "Failed to remove control binding"
\ No newline at end of file
......@@ -106,9 +106,9 @@ pub trait AssetExt: 'static {
fn list_proxies(&self) -> Vec<Asset>;
fn set_proxy<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, proxy: Q) -> bool;
fn set_proxy<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, proxy: Q) -> Result<(), glib::error::BoolError>;
fn unproxy<P: IsA<Asset>>(&self, proxy: &P) -> bool;
fn unproxy<P: IsA<Asset>>(&self, proxy: &P) -> Result<(), glib::error::BoolError>;
fn set_property_proxy_target<P: IsA<Asset> + glib::value::SetValueOptional>(&self, proxy_target: Option<&P>);
......@@ -162,16 +162,16 @@ impl<O: IsA<Asset>> AssetExt for O {
}
}
fn set_proxy<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, proxy: Q) -> bool {
fn set_proxy<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, proxy: Q) -> Result<(), glib::error::BoolError> {
let proxy = proxy.into();
unsafe {
from_glib(ffi::ges_asset_set_proxy(self.as_ref().to_glib_none().0, proxy.map(|p| p.as_ref()).to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_asset_set_proxy(self.as_ref().to_glib_none().0, proxy.map(|p| p.as_ref()).to_glib_none().0), "Failed to set proxy")
}
}
fn unproxy<P: IsA<Asset>>(&self, proxy: &P) -> bool {
fn unproxy<P: IsA<Asset>>(&self, proxy: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_asset_unproxy(self.as_ref().to_glib_none().0, proxy.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_asset_unproxy(self.as_ref().to_glib_none().0, proxy.as_ref().to_glib_none().0), "Failed to unproxy asset")
}
}
......
......@@ -49,13 +49,13 @@ pub trait ClipExt: 'static {
fn get_top_effects(&self) -> Vec<TrackElement>;
fn move_to_layer<P: IsA<Layer>>(&self, layer: &P) -> bool;
fn move_to_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError>;
fn set_supported_formats(&self, supportedformats: TrackType);
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> bool;
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> Result<(), glib::error::BoolError>;
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> bool;
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> Result<(), glib::error::BoolError>;
fn split(&self, position: u64) -> Option<Clip>;
......@@ -115,9 +115,9 @@ impl<O: IsA<Clip>> ClipExt for O {
}
}
fn move_to_layer<P: IsA<Layer>>(&self, layer: &P) -> bool {
fn move_to_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_clip_move_to_layer(self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_clip_move_to_layer(self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0), "Failed to move clip to specified layer")
}
}
......@@ -127,15 +127,15 @@ impl<O: IsA<Clip>> ClipExt for O {
}
}
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> bool {
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_clip_set_top_effect_index(self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newindex))
glib_result_from_gboolean!(ffi::ges_clip_set_top_effect_index(self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newindex), "Failed to move effect")
}
}
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> bool {
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_clip_set_top_effect_priority(self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newpriority))
glib_result_from_gboolean!(ffi::ges_clip_set_top_effect_priority(self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newpriority), "Failed to the set top effect priority")
}
}
......
......@@ -4,6 +4,7 @@
use Asset;
use ffi;
use glib;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
......@@ -23,7 +24,7 @@ pub trait ExtractableExt: 'static {
fn get_id(&self) -> Option<GString>;
fn set_asset<P: IsA<Asset>>(&self, asset: &P) -> bool;
fn set_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), glib::error::BoolError>;
}
impl<O: IsA<Extractable>> ExtractableExt for O {
......@@ -39,9 +40,9 @@ impl<O: IsA<Extractable>> ExtractableExt for O {
}
}
fn set_asset<P: IsA<Asset>>(&self, asset: &P) -> bool {
fn set_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_extractable_set_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_extractable_set_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0), "Failed to set asset")
}
}
}
......@@ -8,6 +8,7 @@ use Extractable;
use Timeline;
use TrackType;
use ffi;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
......@@ -46,7 +47,7 @@ pub const NONE_LAYER: Option<&Layer> = None;
pub trait LayerExt: 'static {
fn add_asset<P: IsA<Asset>>(&self, asset: &P, start: gst::ClockTime, inpoint: gst::ClockTime, duration: gst::ClockTime, track_types: TrackType) -> Option<Clip>;
fn add_clip<P: IsA<Clip>>(&self, clip: &P) -> bool;
fn add_clip<P: IsA<Clip>>(&self, clip: &P) -> Result<(), glib::error::BoolError>;
fn get_auto_transition(&self) -> bool;
......@@ -62,7 +63,7 @@ pub trait LayerExt: 'static {
fn is_empty(&self) -> bool;
fn remove_clip<P: IsA<Clip>>(&self, clip: &P) -> bool;
fn remove_clip<P: IsA<Clip>>(&self, clip: &P) -> Result<(), glib::error::BoolError>;
fn set_auto_transition(&self, auto_transition: bool);
......@@ -88,9 +89,9 @@ impl<O: IsA<Layer>> LayerExt for O {
}
}
fn add_clip<P: IsA<Clip>>(&self, clip: &P) -> bool {
fn add_clip<P: IsA<Clip>>(&self, clip: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_layer_add_clip(self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_layer_add_clip(self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0), "Failed to add clip")
}
}
......@@ -136,9 +137,9 @@ impl<O: IsA<Layer>> LayerExt for O {
}
}
fn remove_clip<P: IsA<Clip>>(&self, clip: &P) -> bool {
fn remove_clip<P: IsA<Clip>>(&self, clip: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_layer_remove_clip(self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_layer_remove_clip(self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0), "Failed to remove clip")
}
}
......
......@@ -68,7 +68,7 @@ pub trait GESPipelineExt: 'static {
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(&self, output_uri: &str, profile: &P) -> Result<(), glib::error::BoolError>;
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> bool;
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError>;
fn get_property_audio_filter(&self) -> Option<gst::Element>;
......@@ -164,9 +164,9 @@ impl<O: IsA<Pipeline>> GESPipelineExt for O {
}
}
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> bool {
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_pipeline_set_timeline(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_full()))
glib_result_from_gboolean!(ffi::ges_pipeline_set_timeline(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_full()), "Failed to set timeline")
}
}
......
......@@ -43,7 +43,7 @@ pub const NONE_PROJECT: Option<&Project> = None;
pub trait ProjectExt: 'static {
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> bool;
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(&self, profile: &P) -> bool;
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(&self, profile: &P) -> Result<(), glib::error::BoolError>;
fn create_asset<'a, P: Into<Option<&'a str>>>(&self, id: P, extractable_type: glib::types::Type) -> bool;
......@@ -61,7 +61,7 @@ pub trait ProjectExt: 'static {
fn load<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), Error>;
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> bool;
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), glib::error::BoolError>;
fn save<'a, P: IsA<Timeline>, Q: IsA<Asset> + 'a, R: Into<Option<&'a Q>>>(&self, timeline: &P, uri: &str, formatter_asset: R, overwrite: bool) -> Result<(), Error>;
......@@ -85,9 +85,9 @@ impl<O: IsA<Project>> ProjectExt for O {
}
}
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(&self, profile: &P) -> bool {
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(&self, profile: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_project_add_encoding_profile(self.as_ref().to_glib_none().0, profile.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_project_add_encoding_profile(self.as_ref().to_glib_none().0, profile.as_ref().to_glib_none().0), "Failed to add profile")
}
}
......@@ -145,9 +145,9 @@ impl<O: IsA<Project>> ProjectExt for O {
}
}
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> bool {
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_project_remove_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_project_remove_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0), "Failed to remove asset")
}
}
......
......@@ -105,7 +105,7 @@ pub trait TimelineExt: 'static {
fn remove_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError>;
fn remove_track<P: IsA<Track>>(&self, track: &P) -> bool;
fn remove_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError>;
fn save_to_uri<'a, P: IsA<Asset> + 'a, Q: Into<Option<&'a P>>>(&self, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error>;
......@@ -263,9 +263,9 @@ impl<O: IsA<Timeline>> TimelineExt for O {
}
}
fn remove_track<P: IsA<Track>>(&self, track: &P) -> bool {
fn remove_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_timeline_remove_track(self.as_ref().to_glib_none().0, track.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_timeline_remove_track(self.as_ref().to_glib_none().0, track.as_ref().to_glib_none().0), "Failed to remove track")
}
}
......
......@@ -6,6 +6,7 @@ use Extractable;
use Timeline;
use TrackType;
use ffi;
use glib;
use glib::GString;
use glib::StaticType;
use glib::Value;
......@@ -71,13 +72,13 @@ pub trait TimelineElementExt: 'static {
//fn remove_child_property(&self, pspec: /*Ignored*/&glib::ParamSpec) -> bool;
fn ripple(&self, start: gst::ClockTime) -> bool;
fn ripple(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError>;
fn ripple_end(&self, end: gst::ClockTime) -> bool;
fn ripple_end(&self, end: gst::ClockTime) -> Result<(), glib::error::BoolError>;
fn roll_end(&self, end: gst::ClockTime) -> bool;
fn roll_end(&self, end: gst::ClockTime) -> Result<(), glib::error::BoolError>;
fn roll_start(&self, start: gst::ClockTime) -> bool;
fn roll_start(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError>;
//fn set_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
......@@ -93,17 +94,17 @@ pub trait TimelineElementExt: 'static {
fn set_max_duration(&self, maxduration: gst::ClockTime);
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> bool;
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Result<(), glib::error::BoolError>;
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P) -> bool;
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P) -> Result<(), glib::error::BoolError>;
fn set_priority(&self, priority: u32);
fn set_start(&self, start: gst::ClockTime);
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> bool;
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError>;
fn trim(&self, start: gst::ClockTime) -> bool;
fn trim(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError>;
fn get_property_in_point(&self) -> u64;
......@@ -239,27 +240,27 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
// unsafe { TODO: call ffi::ges_timeline_element_remove_child_property() }
//}
fn ripple(&self, start: gst::ClockTime) -> bool {
fn ripple(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_timeline_element_ripple(self.as_ref().to_glib_none().0, start.to_glib()))
glib_result_from_gboolean!(ffi::ges_timeline_element_ripple(self.as_ref().to_glib_none().0, start.to_glib()), "Failed to ripple")
}
}
fn ripple_end(&self, end: gst::ClockTime) -> bool {
fn ripple_end(&self, end: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_timeline_element_ripple_end(self.as_ref().to_glib_none().0, end.to_glib()))
glib_result_from_gboolean!(ffi::ges_timeline_element_ripple_end(self.as_ref().to_glib_none().0, end.to_glib()), "Failed to ripple")
}
}
fn roll_end(&self, end: gst::ClockTime) -> bool {
fn roll_end(&self, end: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_timeline_element_roll_end(self.as_ref().to_glib_none().0, end.to_glib()))
glib_result_from_gboolean!(ffi::ges_timeline_element_roll_end(self.as_ref().to_glib_none().0, end.to_glib()), "Failed to roll")
}
}
fn roll_start(&self, start: gst::ClockTime) -> bool {
fn roll_start(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_timeline_element_roll_start(self.as_ref().to_glib_none().0, start.to_glib()))
glib_result_from_gboolean!(ffi::ges_timeline_element_roll_start(self.as_ref().to_glib_none().0, start.to_glib()), "Failed to roll")
}
}
......@@ -297,16 +298,16 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
}
}
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> bool {
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Result<(), glib::error::BoolError> {
let name = name.into();
unsafe {
from_glib(ffi::ges_timeline_element_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_timeline_element_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0), "Failed to set name")
}
}
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P) -> bool {
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_timeline_element_set_parent(self.as_ref().to_glib_none().0, parent.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_timeline_element_set_parent(self.as_ref().to_glib_none().0, parent.as_ref().to_glib_none().0), "`TimelineElement` already had a parent or its parent was the same as specified")
}
}
......@@ -322,15 +323,15 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
}
}
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> bool {
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_timeline_element_set_timeline(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_timeline_element_set_timeline(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0), "`Failed to set timeline")
}
}
fn trim(&self, start: gst::ClockTime) -> bool {
fn trim(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_timeline_element_trim(self.as_ref().to_glib_none().0, start.to_glib()))
glib_result_from_gboolean!(ffi::ges_timeline_element_trim(self.as_ref().to_glib_none().0, start.to_glib()), "`Failed to trim")
}
}
......
......@@ -10,6 +10,7 @@ use TimelineElement;
use Track;
use TrackType;
use ffi;
use glib;
use glib::GString;
use glib::StaticType;
use glib::Value;
......@@ -37,7 +38,7 @@ pub const NONE_TRACK_ELEMENT: Option<&TrackElement> = None;
pub trait TrackElementExt: 'static {
fn add_children_props<P: IsA<gst::Element>>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]);
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> bool;
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> Result<(), glib::error::BoolError>;
//fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 };
......@@ -57,7 +58,7 @@ pub trait TrackElementExt: 'static {
//fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option<gst::Element>;
fn remove_control_binding(&self, property_name: &str) -> bool;
fn remove_control_binding(&self, property_name: &str) -> Result<(), glib::error::BoolError>;
fn set_active(&self, active: bool) -> bool;
......@@ -85,9 +86,9 @@ impl<O: IsA<TrackElement>> TrackElementExt for O {
}
}
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> bool {
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_track_element_edit(self.as_ref().to_glib_none().0, layers.to_glib_none().0, mode.to_glib(), edge.to_glib(), position))
glib_result_from_gboolean!(ffi::ges_track_element_edit(self.as_ref().to_glib_none().0, layers.to_glib_none().0, mode.to_glib(), edge.to_glib(), position), "Failed to edit")
}
}
......@@ -139,9 +140,9 @@ impl<O: IsA<TrackElement>> TrackElementExt for O {
// unsafe { TODO: call ffi::ges_track_element_lookup_child() }
//}
fn remove_control_binding(&self, property_name: &str) -> bool {
fn remove_control_binding(&self, property_name: &str) -> Result<(), glib::error::BoolError> {
unsafe {
from_glib(ffi::ges_track_element_remove_control_binding(self.as_ref().to_glib_none().0, property_name.to_glib_none().0))
glib_result_from_gboolean!(ffi::ges_track_element_remove_control_binding(self.as_ref().to_glib_none().0, property_name.to_glib_none().0), "Failed to remove control binding")
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment