ges_timeline_remove_track
ges_timeline_get_track_for_pad
ges_timeline_load_from_uri
-ges_timeline_save
+ges_timeline_save_to_uri
ges_timeline_get_tracks
<SUBSECTION Standard>
ges_timeline_get_type
GESTimelineTextOverlay
GESTimelineTextOverlayClass
ges_timeline_text_overlay_new
+ges_timeline_new_from_uri
<SUBSECTION Standard>
ges_tl_text_overlay_get_type
GES_IS_TIMELINE_TEXT_OVERLAY
}
/**
+ * ges_timeline_new_from_uri:
+ * @uri: the URI to load from
+ *
+ * Creates a timeline from the given URI.
+ *
+ * Returns: A new timeline if the uri was loaded successfully, or NULL if the
+ * uri could not be loaded
+ */
+
+GESTimeline *
+ges_timeline_new_from_uri (gchar * uri)
+{
+ GESTimeline *ret;
+
+ ret = ges_timeline_new ();
+
+ if (!ges_timeline_load_from_uri (ret, uri)) {
+ g_object_unref (ret);
+ return NULL;
+ }
+
+ return ret;
+}
+
+
+/**
* ges_timeline_load_from_uri:
+ * @timeline: an empty #GESTimeline into which to load the formatter
* @uri: The URI to load from
*
- * Creates a timeline from the contents of given uri.
+ * Loads the contents of URI into the given timeline.
*
- * NOT_IMPLEMENTED !
- *
- * Returns: A new #GESTimeline if loading was successful, else NULL.
+ * Returns: TRUE if the timeline was loaded successfully, or FALSE if the uri
+ * could not be loaded.
*/
-GESTimeline *
-ges_timeline_load_from_uri (gchar * uri)
+gboolean
+ges_timeline_load_from_uri (GESTimeline * timeline, gchar * uri)
{
- /* FIXME : IMPLEMENT */
- return NULL;
+ GESFormatter *p = NULL;
+ gboolean ret = FALSE;
+
+ if (!(p = ges_formatter_new_for_uri (uri))) {
+ GST_ERROR ("unsupported uri '%s'", uri);
+ goto fail;
+ }
+
+ if (!ges_formatter_load_from_uri (p, timeline, uri)) {
+ GST_ERROR ("error deserializing formatter");
+ goto fail;
+ }
+
+ ret = TRUE;
+
+fail:
+ if (p)
+ g_object_unref (p);
+ return ret;
}
/**
- * ges_timeline_save:
+ * ges_timeline_save_to_uri:
* @timeline: a #GESTimeline
* @uri: The location to save to
*
* Saves the timeline to the given location
*
- * NOT_IMPLEMENTED !
- *
* Returns: TRUE if the timeline was successfully saved to the given location,
* else FALSE.
*/
gboolean
-ges_timeline_save (GESTimeline * timeline, gchar * uri)
+ges_timeline_save_to_uri (GESTimeline * timeline, gchar * uri)
{
- /* FIXME : IMPLEMENT */
- return FALSE;
+ GESFormatter *p = NULL;
+ gboolean ret = FALSE;
+
+ if (!(p = ges_formatter_new_for_uri (uri))) {
+ GST_ERROR ("unsupported uri '%s'", uri);
+ goto fail;
+ }
+
+ if (!ges_formatter_save_to_uri (p, timeline, uri)) {
+ GST_ERROR ("error serializing formatter");
+ goto fail;
+ }
+
+ ret = TRUE;
+
+fail:
+ if (p)
+ g_object_unref (p);
+ return ret;
}
static void
GType ges_timeline_get_type (void);
GESTimeline* ges_timeline_new (void);
+GESTimeline* ges_timeline_new_from_uri (gchar *uri);
-
-GESTimeline* ges_timeline_load_from_uri (gchar *uri);
-
-gboolean ges_timeline_save (GESTimeline *timeline, gchar *uri);
+gboolean ges_timeline_load_from_uri (GESTimeline *timeline, gchar *uri);
+gboolean ges_timeline_save_to_uri (GESTimeline *timeline, gchar *uri);
gboolean ges_timeline_add_layer (GESTimeline *timeline, GESTimelineLayer *layer);
gboolean ges_timeline_remove_layer (GESTimeline *timeline, GESTimelineLayer *layer);