GESFormatterLoadFromURIMethod
GESFormatterSaveToURIMethod
GESFormatterSourceMovedMethod
+GESFormatterLoadedMethod
ges_default_formatter_new
ges_formatter_load_from_uri
ges_formatter_save_to_uri
*
* Support for saving or loading new formats can be added by creating a subclass of
* #GESFormatter and implement the various vmethods of #GESFormatterClass.
+ *
+ * Note that subclasses should call project_loaded wen they are done loading
+ * a project.
**/
#include <gst/gst.h>
static void discovery_error_cb (GESTimeline * timeline,
GESTimelineFileSource * tfs, GError * error, GESFormatter * formatter);
+static gboolean project_loaded (GESFormatter * formatter,
+ GESTimeline * timeline);
+
enum
{
SOURCE_MOVED_SIGNAL,
+ LOADED_SIGNAL,
LAST_SIGNAL
};
G_SIGNAL_RUN_LAST, 0, NULL, NULL, ges_marshal_VOID__OBJECT, G_TYPE_NONE,
1, GES_TYPE_TIMELINE_FILE_SOURCE);
+ /**
+ * GESFormatter::loaded:
+ * @formatter: the #GESFormatter that is done loading a project.
+ */
+ ges_formatter_signals[LOADED_SIGNAL] =
+ g_signal_new ("loaded", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST, 0, NULL, NULL, ges_marshal_VOID__OBJECT, G_TYPE_NONE,
+ 1, GES_TYPE_TIMELINE);
+
object_class->dispose = ges_formatter_dispose;
klass->can_load_uri = default_can_load_uri;
klass->load_from_uri = load_from_uri;
klass->save_to_uri = save_to_uri;
klass->update_source_uri = NULL;
+ klass->project_loaded = project_loaded;
}
static void
tfs);
}
}
+
+static gboolean
+project_loaded (GESFormatter * formatter, GESTimeline * timeline)
+{
+ g_signal_emit (formatter, ges_formatter_signals[LOADED_SIGNAL], 0, timeline);
+
+ return TRUE;
+}
typedef gboolean (*GESFormatterSourceMovedMethod) (GESFormatter *formatter,
GESTimelineFileSource *tfs, gchar *new_uri);
+/**
+ * GESFormatterLoadedMethod
+ * @formatter: The #GESFormatter that is done loading
+ * @timeline: The #GESTimeline that has finnished to load
+ *
+ * This method should be called by sublcasses when they are done
+ * loading @timeline
+ */
+typedef gboolean (*GESFormatterLoadedMethod) (GESFormatter *formatter,
+ GESTimeline *timeline);
+
/**
* GESFormatterClass:
* @parent_class: the parent class structure
* @save_to_uri: class method to serialize data to a URI
* @update_source_uri: virtual method to specify that a source has moved, and thus its URI
* must be set to its new location (specified by the user)
+ * @project_loaded: Must be called by subclasses when done loading a project
*
* GES Formatter class. Override the vmethods to implement the formatter functionnality.
*/
GESFormatterLoadFromURIMethod load_from_uri;
GESFormatterSaveToURIMethod save_to_uri;
GESFormatterSourceMovedMethod update_source_uri;
+ GESFormatterLoadedMethod project_loaded;
/*< private >*/
/* FIXME : formatter name */