ges/ges-simple-timeline-layer.c: don't allow user to create timelines with

adjacent transitions
This commit is contained in:
Brandon Lewis 2010-05-27 23:37:11 +02:00 committed by Edward Hervey
parent e5ae1405c8
commit ae34d99867

View file

@ -173,6 +173,23 @@ ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer * layer,
GST_DEBUG ("layer:%p, object:%p, position:%d", layer, object, position); GST_DEBUG ("layer:%p, object:%p, position:%d", layer, object, position);
GList *nth = g_list_nth (layer->objects, position);
if (GES_IS_TIMELINE_TRANSITION (object)) {
GList *lprev = g_list_previous (nth);
GESTimelineObject *prev = GES_TIMELINE_OBJECT (lprev ? lprev->data : NULL);
GESTimelineObject *next = GES_TIMELINE_OBJECT (nth ? nth->data : NULL);
if ((prev && GES_IS_TIMELINE_TRANSITION (prev)) ||
(next && GES_IS_TIMELINE_TRANSITION (next))) {
GST_ERROR ("Not adding transition: Only insert transitions between two"
" sources, or at the begining or end the layer\n");
return FALSE;
}
}
layer->adding_object = TRUE; layer->adding_object = TRUE;
res = ges_timeline_layer_add_object ((GESTimelineLayer *) layer, object); res = ges_timeline_layer_add_object ((GESTimelineLayer *) layer, object);