check whether setting vtype property actually succeeds

This commit is contained in:
Brandon Lewis 2010-07-08 13:20:56 +02:00 committed by Edward Hervey
parent 33449efcd7
commit 770a16f5ce
3 changed files with 24 additions and 12 deletions

View file

@ -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);

View file

@ -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 *

View file

@ -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);