check whether setting vtype property actually succeeds
authorBrandon Lewis <brandon@collabora.co.uk>
Thu, 8 Jul 2010 11:20:56 +0000 (13:20 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Fri, 9 Jul 2010 11:21:18 +0000 (13:21 +0200)
ges/ges-timeline-transition.c
ges/ges-track-video-transition.c
ges/ges-track-video-transition.h

index 2c49f1b..b63e59f 100644 (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)) {
+    GESTrackVideoTransition *obj;
+    if (GES_IS_TRACK_VIDEO_TRANSITION (tmp->data)) {
+      obj = (GESTrackVideoTransition *) tmp->data;
+      if (!ges_track_video_transition_set_type (obj, value))
+        return;
+    }
+  }
 
-  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);
+  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);
index b1fd4a6..a07834e 100644 (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 *
index 35c0668..cbadb20 100644 (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);