diff --git a/ges/ges-base-xml-formatter.c b/ges/ges-base-xml-formatter.c index 2e854c168e..bfa1e0e85c 100644 --- a/ges/ges-base-xml-formatter.c +++ b/ges/ges-base-xml-formatter.c @@ -111,6 +111,8 @@ struct _GESBaseXmlFormatterPrivate GESClip *current_clip; PendingClip *current_pending_clip; + + gboolean timeline_auto_transition; }; static void @@ -221,6 +223,8 @@ _load_from_uri (GESFormatter * self, GESTimeline * timeline, const gchar * uri, { GESBaseXmlFormatterPrivate *priv = _GET_PRIV (self); + ges_timeline_set_auto_transition (timeline, FALSE); + priv->parsecontext = create_parser_context (GES_BASE_XML_FORMATTER (self), uri, error); @@ -356,6 +360,7 @@ ges_base_xml_formatter_init (GESBaseXmlFormatter * self) priv->current_track_element = NULL; priv->current_clip = NULL; priv->current_pending_clip = NULL; + priv->timeline_auto_transition = FALSE; } static void @@ -406,6 +411,9 @@ _loading_done (GESFormatter * self) g_markup_parse_context_free (priv->parsecontext); priv->parsecontext = NULL; + ges_timeline_set_auto_transition (self->timeline, + priv->timeline_auto_transition); + g_hash_table_foreach (priv->layers, (GHFunc) _set_auto_transition, NULL); ges_project_set_loaded (self->project, self); } @@ -807,6 +815,35 @@ ges_base_xml_formatter_add_clip (GESBaseXmlFormatter * self, priv->current_clip = nclip; } +void +ges_base_xml_formatter_set_timeline_properties (GESBaseXmlFormatter * self, + GESTimeline * timeline, const gchar * properties, const gchar * metadatas) +{ + GESBaseXmlFormatterPrivate *priv = _GET_PRIV (self); + gboolean auto_transition = FALSE; + + if (properties) { + GstStructure *props = gst_structure_from_string (properties, NULL); + + if (props) { + if (gst_structure_get_boolean (props, "auto-transition", + &auto_transition)) + gst_structure_remove_field (props, "auto-transition"); + + gst_structure_foreach (props, + (GstStructureForeachFunc) set_property_foreach, timeline); + gst_structure_free (props); + } + } + + if (metadatas) { + ges_meta_container_add_metas_from_string (GES_META_CONTAINER (timeline), + metadatas); + }; + + priv->timeline_auto_transition = auto_transition; +} + void ges_base_xml_formatter_add_layer (GESBaseXmlFormatter * self, GType extractable_type, guint priority, GstStructure * properties, diff --git a/ges/ges-internal.h b/ges/ges-internal.h index c4aea8f710..9ce44f0e4e 100644 --- a/ges/ges-internal.h +++ b/ges/ges-internal.h @@ -253,6 +253,12 @@ G_GNUC_INTERNAL gint element_start_compare (GESTimelineElement * G_GNUC_INTERNAL gint element_end_compare (GESTimelineElement * a, GESTimelineElement * b); +void +ges_base_xml_formatter_set_timeline_properties(GESBaseXmlFormatter * self, + GESTimeline *timeline, + const gchar *properties, + const gchar *metadatas); + /**************************************************** * GESContainer * ****************************************************/ diff --git a/ges/ges-xml-formatter.c b/ges/ges-xml-formatter.c index 63b3bc47bb..d76abedaf6 100644 --- a/ges/ges-xml-formatter.c +++ b/ges/ges-xml-formatter.c @@ -244,19 +244,8 @@ _parse_timeline (GMarkupParseContext * context, const gchar * element_name, if (timeline == NULL) return; - if (properties) { - GstStructure *props = gst_structure_from_string (properties, NULL); - - if (props) { - gst_structure_foreach (props, - (GstStructureForeachFunc) set_property_foreach, timeline); - gst_structure_free (props); - } - } - if (metadatas) { - ges_meta_container_add_metas_from_string (GES_META_CONTAINER (timeline), - metadatas); - }; + ges_base_xml_formatter_set_timeline_properties (GES_BASE_XML_FORMATTER (self), + timeline, properties, metadatas); } static inline void