From: Brandon Lewis Date: Fri, 9 Jul 2010 11:49:23 +0000 (+0200) Subject: update height when track object priority offset changes X-Git-Tag: 1.19.3~493^2~2713 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9c3628b5a72f4d45d7abed407218d2374ea2cf7;p=platform%2Fupstream%2Fgstreamer.git update height when track object priority offset changes --- diff --git a/ges/ges-timeline-object.c b/ges/ges-timeline-object.c index d5e32b1a37..943472fbe3 100644 --- a/ges/ges-timeline-object.c +++ b/ges/ges-timeline-object.c @@ -39,6 +39,10 @@ gboolean ges_timeline_object_create_track_objects_func (GESTimelineObject * object, GESTrack * track); +static void +track_object_priority_offset_changed_cb (GESTrackObject * child, + GParamSpec * arg G_GNUC_UNUSED, GESTimelineObject * obj); + G_DEFINE_TYPE (GESTimelineObject, ges_timeline_object, G_TYPE_OBJECT); enum @@ -301,6 +305,9 @@ ges_timeline_object_add_track_object (GESTimelineObject * object, GESTrackObject GST_DEBUG ("Returning trobj:%p", trobj); + g_signal_connect (G_OBJECT (trobj), "notify::priority-offset", G_CALLBACK + (track_object_priority_offset_changed_cb), object); + return TRUE; } @@ -487,3 +494,22 @@ ges_timeline_object_find_track_object (GESTimelineObject * object, return ret; } + +static void +track_object_priority_offset_changed_cb (GESTrackObject * child, + GParamSpec * arg G_GNUC_UNUSED, GESTimelineObject * obj) +{ + guint new, old; + + /* all track objects have height 1 */ + new = GES_TRACK_OBJECT_PRIORITY_OFFSET (child) + 1; + old = GES_TIMELINE_OBJECT_HEIGHT (obj); + + GST_LOG ("object %p, new=%d, old=%d", obj, new, old); + + if (new > old) { + obj->height = new; + GST_LOG ("emitting notify signal"); + g_object_notify ((GObject *) obj, "height"); + } +}