From 770a16f5ce4e6611ec4223d1f43682dc019b1c28 Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Thu, 8 Jul 2010 13:20:56 +0200 Subject: [PATCH] check whether setting vtype property actually succeeds --- ges/ges-timeline-transition.c | 25 +++++++++++++++++-------- ges/ges-track-video-transition.c | 5 +++-- ges/ges-track-video-transition.h | 6 ++++-- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ges/ges-timeline-transition.c b/ges/ges-timeline-transition.c index 2c49f1be6d..b63e59f5e8 100644 --- a/ges/ges-timeline-transition.c +++ b/ges/ges-timeline-transition.c @@ -59,11 +59,21 @@ ges_timeline_transition_update_vtype_internal (GESTimelineObject * self, GESVideoTransitionType value) { GList *tmp; + GESTimelineTransition *trself = (GESTimelineTransition *) self; + GESVideoTransitionType old; + old = trself->vtype; - for (tmp = self->trackobjects; tmp; tmp = g_list_next (tmp)) - if (GES_IS_TRACK_VIDEO_TRANSITION (tmp->data)) - ges_track_video_transition_set_type ((GESTrackVideoTransition *) - tmp->data, value); + for (tmp = self->trackobjects; tmp; tmp = g_list_next (tmp)) { + GESTrackVideoTransition *obj; + if (GES_IS_TRACK_VIDEO_TRANSITION (tmp->data)) { + obj = (GESTrackVideoTransition *) tmp->data; + if (!ges_track_video_transition_set_type (obj, value)) + return; + } + } + + trself->vtype = value; + return; } static void @@ -73,7 +83,7 @@ ges_timeline_transition_get_property (GObject * object, GESTimelineTransition *self = GES_TIMELINE_TRANSITION (object); switch (property_id) { case PROP_VTYPE: - self->vtype = g_value_get_enum (value); + g_value_set_enum (value, self->vtype); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -85,12 +95,11 @@ ges_timeline_transition_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { GESTimelineObject *self = GES_TIMELINE_OBJECT (object); - GESTimelineTransition *trself = GES_TIMELINE_TRANSITION (object); switch (property_id) { case PROP_VTYPE: - trself->vtype = g_value_get_enum (value); - ges_timeline_transition_update_vtype_internal (self, trself->vtype); + ges_timeline_transition_update_vtype_internal (self, + g_value_get_enum (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); diff --git a/ges/ges-track-video-transition.c b/ges/ges-track-video-transition.c index b1fd4a6b7d..a07834e083 100644 --- a/ges/ges-track-video-transition.c +++ b/ges/ges-track-video-transition.c @@ -309,7 +309,7 @@ ges_track_video_transition_duration_changed (GESTrackObject * object, GST_LOG ("done updating controller"); } -void +gboolean ges_track_video_transition_set_type (GESTrackVideoTransition * self, GESVideoTransitionType type) { @@ -320,12 +320,13 @@ ges_track_video_transition_set_type (GESTrackVideoTransition * self, (self->type == GES_VIDEO_TRANSITION_TYPE_CROSSFADE))) { GST_WARNING ("Changing between 'crossfade' and other types is not supported"); - return; + return FALSE; } self->type = type; if (self->smpte && (type != GES_VIDEO_TRANSITION_TYPE_CROSSFADE)) g_object_set (self->smpte, "type", (gint) type, NULL); + return TRUE; } GESTrackVideoTransition * diff --git a/ges/ges-track-video-transition.h b/ges/ges-track-video-transition.h index 35c06687e7..cbadb20a66 100644 --- a/ges/ges-track-video-transition.h +++ b/ges/ges-track-video-transition.h @@ -86,8 +86,10 @@ struct _GESTrackVideoTransitionClass { GType ges_track_video_transition_get_type (void); -void -ges_track_video_transition_set_type (GESTrackVideoTransition * self, GESVideoTransitionType type); +gboolean +ges_track_video_transition_set_type (GESTrackVideoTransition * self, +GESVideoTransitionType type); +; GESTrackVideoTransition* ges_track_video_transition_new (void);