*/
#include "ges-internal.h"
+#include "ges-project.h"
#include "ges-timeline.h"
#include "ges-track.h"
#include "ges-timeline-layer.h"
typedef struct _MoveContext MoveContext;
static inline void init_movecontext (MoveContext * mv_ctx);
+static void ges_extractable_interface_init (GESExtractableInterface * iface);
+
+G_DEFINE_TYPE_WITH_CODE (GESTimeline, ges_timeline, GST_TYPE_BIN,
+ G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE,
+ ges_extractable_interface_init));
-G_DEFINE_TYPE (GESTimeline, ges_timeline, GST_TYPE_BIN);
GST_DEBUG_CATEGORY_STATIC (ges_timeline_debug);
#undef GST_CAT_DEFAULT
TRACK_REMOVED,
LAYER_ADDED,
LAYER_REMOVED,
- DISCOVERY_ERROR,
SNAPING_STARTED,
SNAPING_ENDED,
LAST_SIGNAL
static gint custom_find_track (TrackPrivate * tr_priv, GESTrack * track);
+static guint nb_assets = 0;
+
+/* GESExtractable implementation */
+static gchar *
+extractable_check_id (GType type, const gchar * id)
+{
+ gchar *res;
+
+ if (id == NULL)
+ res = g_strdup_printf ("%s-%i", "project", nb_assets);
+ else
+ res = g_strdup (id);
+
+ nb_assets++;
+
+ return res;
+}
+
+static gchar *
+extractable_get_id (GESExtractable * self)
+{
+ GESAsset *asset;
+
+ if (!(asset = ges_extractable_get_asset (self)))
+ return NULL;
+
+ return g_strdup (ges_asset_get_id (asset));
+}
+
+static void
+ges_extractable_interface_init (GESExtractableInterface * iface)
+{
+ iface->asset_type = GES_TYPE_PROJECT;
+ iface->check_id = (GESExtractableCheckId) extractable_check_id;
+ iface->get_id = extractable_get_id;
+}
+
/* Internal methods */
static gboolean
ges_timeline_enable_update_internal (GESTimeline * timeline, gboolean enabled)
g_type_class_add_private (klass, sizeof (GESTimelinePrivate));
+ GST_DEBUG_CATEGORY_INIT (ges_timeline_debug, "gestimeline",
+ GST_DEBUG_FG_YELLOW, "ges timeline");
+
parent_class = g_type_class_peek_parent (klass);
object_class->get_property = ges_timeline_get_property;
GES_TYPE_TIMELINE_LAYER);
/**
- * GESTimeline::discovery-error:
- * @timeline: the #GESTimeline
- * @formatter: the #GESFormatter
- * @source: The #GESTimelineFileSource that could not be discovered properly
- * @error: (type GLib.Error): #GError, which will be non-NULL if an error
- * occurred during discovery
- */
- ges_timeline_signals[DISCOVERY_ERROR] =
- g_signal_new ("discovery-error", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_generic,
- G_TYPE_NONE, 2, GES_TYPE_TIMELINE_FILE_SOURCE, G_TYPE_ERROR);
-
- /**
* GESTimeline::track-objects-snapping:
* @timeline: the #GESTimeline
* @obj1: the first #GESTrackObject that was snapping.
{
GESTimelinePrivate *priv = self->priv;
- GST_DEBUG_CATEGORY_INIT (ges_timeline_debug, "gestimeline",
- GST_DEBUG_FG_YELLOW, "ges timeline");
-
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_TIMELINE, GESTimelinePrivate);