ges: adds an enable_update function to the GESTimeline

Binds it in python

API: ges_timeline_enable_update
This commit is contained in:
Mathieu Duponchelle 2011-08-03 02:33:10 +02:00 committed by Thibault Saunier
parent 76f256f0bd
commit 2c4d614cb1
5 changed files with 75 additions and 0 deletions

View file

@ -853,6 +853,15 @@
(return-type "GList*")
)
(define-method enable_update
(of-object "GESTimeline")
(c-name "ges_timeline_enable_update")
(return-type "gboolean")
(parameters
'("gboolean" "enabled")
)
)
;; From ges-timeline-layer.h
@ -1636,6 +1645,15 @@
(return-type "GESTrack*")
)
(define-method enable_update
(of-object "GESTrack")
(c-name "ges_track_enable_update")
(return-type "gboolean")
(parameters
'("gboolean" "enabled")
)
)
;; From ges-track-image-source.h

View file

@ -1104,3 +1104,31 @@ ges_timeline_get_layers (GESTimeline * timeline)
return res;
}
/**
* ges_timeline_enable_update:
* @timeline : a #GESTimeline
* @enabled : TRUE if the timeline must be updated, FALSE otherwise.
*
* Calls the enable_update function of the tracks contained by the timeline.
*
* Returns : True if success, FALSE otherwise.
*/
gboolean
ges_timeline_enable_update (GESTimeline * timeline, gboolean enabled)
{
GList *tmp, *tracks;
gboolean res = TRUE;
tracks = ges_timeline_get_tracks (timeline);
for (tmp = tracks; tmp; tmp = tmp->next) {
if (!ges_track_enable_update (tmp->data, enabled)) {
res = FALSE;
}
}
g_list_free (tracks);
return res;
}

View file

@ -99,6 +99,8 @@ gboolean ges_timeline_remove_track (GESTimeline *timeline, GESTrack *track);
GESTrack * ges_timeline_get_track_for_pad (GESTimeline *timeline, GstPad *pad);
GList *ges_timeline_get_tracks (GESTimeline *timeline);
gboolean ges_timeline_enable_update(GESTimeline * timeline, gboolean enabled);
G_END_DECLS
#endif /* _GES_TIMELINE */

View file

@ -601,3 +601,28 @@ ges_track_get_timeline (GESTrack * track)
return track->priv->timeline;
}
/**
* ges_track_enable_update:
* @track : a #GESTrack
* @enabled : TRUE if the composition must be updated, FALSE otherwise.
*
* Sets the @track 's composition update property to @enabled .
*
* Returns : True if success, FALSE otherwise.
*/
gboolean
ges_track_enable_update (GESTrack * track, gboolean enabled)
{
gboolean update;
g_object_set (track->priv->composition, "update", enabled, NULL);
g_object_get (track->priv->composition, "update", &update, NULL);
if (update == enabled) {
return TRUE;
} else {
return FALSE;
}
}

View file

@ -98,6 +98,8 @@ gboolean ges_track_remove_object (GESTrack * track,
GESTrack *ges_track_video_raw_new (void);
GESTrack *ges_track_audio_raw_new (void);
gboolean ges_track_enable_update(GESTrack * track, gboolean enabled);
GList* ges_track_get_objects (GESTrack *track);
G_END_DECLS