From: Brandon Lewis Date: Thu, 8 Jul 2010 10:35:41 +0000 (+0200) Subject: add track object virtual methods for property change notifications X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fee9f7fb67cdb1da89bf702bcc80b0233b5d8cf1;p=platform%2Fupstream%2Fgst-editing-services.git add track object virtual methods for property change notifications --- diff --git a/ges/ges-track-object.c b/ges/ges-track-object.c index 6680ce5..c5dfce9 100644 --- a/ges/ges-track-object.c +++ b/ges/ges-track-object.c @@ -316,6 +316,10 @@ gnlobject_start_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED, GESTrackObject * obj) { guint64 start; + GESTrackObjectClass *klass; + + klass = GES_TRACK_OBJECT_GET_CLASS (obj); + g_object_get (gnlobject, "start", &start, NULL); GST_DEBUG ("gnlobject start : %" GST_TIME_FORMAT " current : %" @@ -323,6 +327,8 @@ gnlobject_start_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED, if (start != obj->start) { obj->start = start; + if (klass->start_changed) + klass->start_changed (obj, start); /* FIXME : emit changed */ } } @@ -333,6 +339,10 @@ gnlobject_media_start_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED, GESTrackObject * obj) { guint64 start; + GESTrackObjectClass *klass; + + klass = GES_TRACK_OBJECT_GET_CLASS (obj); + g_object_get (gnlobject, "media-start", &start, NULL); GST_DEBUG ("gnlobject in-point : %" GST_TIME_FORMAT " current : %" @@ -340,6 +350,8 @@ gnlobject_media_start_cb (GstElement * gnlobject, if (start != obj->inpoint) { obj->inpoint = start; + if (klass->media_start_changed) + klass->media_start_changed (obj, start); /* FIXME : emit changed */ } } @@ -349,12 +361,18 @@ gnlobject_priority_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED, GESTrackObject * obj) { guint32 priority; + GESTrackObjectClass *klass; + + klass = GES_TRACK_OBJECT_GET_CLASS (obj); + g_object_get (gnlobject, "priority", &priority, NULL); GST_DEBUG ("gnlobject priority : %d current : %d", priority, obj->priority); if (priority != obj->priority) { obj->priority = priority; + if (klass->priority_changed) + klass->priority_changed (obj, priority); /* FIXME : emit changed */ } } @@ -364,6 +382,10 @@ gnlobject_duration_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED, GESTrackObject * obj) { guint64 duration; + GESTrackObjectClass *klass; + + klass = GES_TRACK_OBJECT_GET_CLASS (obj); + g_object_get (gnlobject, "duration", &duration, NULL); GST_DEBUG ("gnlobject duration : %" GST_TIME_FORMAT " current : %" @@ -371,6 +393,8 @@ gnlobject_duration_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED, if (duration != obj->duration) { obj->duration = duration; + if (klass->duration_changed) + klass->duration_changed (obj, duration); /* FIXME : emit changed */ } } @@ -380,12 +404,18 @@ gnlobject_active_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED, GESTrackObject * obj) { gboolean active; + GESTrackObjectClass *klass; + + klass = GES_TRACK_OBJECT_GET_CLASS (obj); + g_object_get (gnlobject, "active", &active, NULL); GST_DEBUG ("gnlobject active : %d current : %d", active, obj->active); if (active != obj->active) { obj->active = active; + if (klass->active_changed) + klass->active_changed (obj, active); /* FIXME : emit changed */ } } diff --git a/ges/ges-track-object.h b/ges/ges-track-object.h index 6b36da6..cd0dd7c 100644 --- a/ges/ges-track-object.h +++ b/ges/ges-track-object.h @@ -122,6 +122,11 @@ struct _GESTrackObject { * GESTrackObjectClass: * @parent_class: parent class * @create_gnl_object: method to create the GNonLin container object. + * @start_changed: start property of gnlobject has changed + * @media_start_changed: media-start property of gnlobject has changed + * @duration_changed: duration property glnobject has changed + * @priority_changed: duration property glnobject has changed + * @active_changed: active property of gnlobject has changed * * Subclasses can override the @create_gnl_object method to override what type * of GNonLin object will be created. @@ -136,6 +141,12 @@ struct _GESTrackObjectClass { /*< public >*/ /* virtual methods for subclasses */ gboolean (*create_gnl_object) (GESTrackObject * object); + + void (*start_changed) (GESTrackObject *object, guint64 start); + void (*media_start_changed) (GESTrackObject *object, guint64 media_start); + void (*priority_changed) (GESTrackObject *object, guint priority); + void (*duration_changed) (GESTrackObject *object, guint64 duration); + void (*active_changed) (GESTrackObject *object, gboolean active); }; GType ges_track_object_get_type (void);