struct _GESTimelinePrivate
{
- GList *layers; /* A list of GESTimelineLayer sorted by priority */
- GList *tracks; /* A list of private track data */
-
/* The duration of the timeline */
gint64 duration;
GST_DEBUG_OBJECT (timeline, "%s updates", enabled ? "Enabling" : "Disabling");
- for (tmp = timeline->priv->tracks; tmp; tmp = tmp->next) {
+ for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
if (!ges_track_enable_update (((TrackPrivate *) tmp->data)->track, enabled))
res = FALSE;
}
static void
ges_timeline_dispose (GObject * object)
{
- GESTimelinePrivate *priv = GES_TIMELINE (object)->priv;
+ GESTimeline *tl = GES_TIMELINE (object);
+ GESTimelinePrivate *priv = tl->priv;
- while (priv->layers) {
- GESTimelineLayer *layer = (GESTimelineLayer *) priv->layers->data;
+ while (tl->layers) {
+ GESTimelineLayer *layer = (GESTimelineLayer *) tl->layers->data;
ges_timeline_remove_layer (GES_TIMELINE (object), layer);
}
* objects aren't notified that their gnlobjects have been destroyed.
*/
- while (priv->tracks) {
- TrackPrivate *tr_priv = (TrackPrivate *) priv->tracks->data;
+ while (tl->tracks) {
+ TrackPrivate *tr_priv = (TrackPrivate *) tl->tracks->data;
ges_timeline_remove_track (GES_TIMELINE (object), tr_priv->track);
}
static void
ges_timeline_init (GESTimeline * self)
{
- GESTimelinePrivate *priv;
+ GESTimelinePrivate *priv = self->priv;
GST_DEBUG_CATEGORY_INIT (ges_timeline_debug, "gestimeline",
GST_DEBUG_FG_YELLOW, "ges timeline");
GES_TYPE_TIMELINE, GESTimelinePrivate);
priv = self->priv;
- priv->layers = NULL;
- priv->tracks = NULL;
+ self->layers = NULL;
+ self->tracks = NULL;
priv->duration = 0;
priv->snapping_distance = 0;
prio = ges_timeline_layer_get_priority (layer);
/* We know that the layer exists as we created it */
- new_layer = GES_TIMELINE_LAYER (g_list_nth_data (timeline->priv->layers,
+ new_layer = GES_TIMELINE_LAYER (g_list_nth_data (timeline->layers,
prio + offset));
if (new_layer == NULL) {
{
GList *tmp;
- for (tmp = timeline->priv->tracks; tmp; tmp = g_list_next (tmp)) {
+ for (tmp = timeline->tracks; tmp; tmp = g_list_next (tmp)) {
TrackPrivate *tr_priv = (TrackPrivate *) tmp->data;
GESTrack *track = tr_priv->track;
layer_priority_changed_cb (GESTimelineLayer * layer,
GParamSpec * arg G_GNUC_UNUSED, GESTimeline * timeline)
{
- timeline->priv->layers = g_list_sort (timeline->priv->layers, (GCompareFunc)
+ timeline->layers = g_list_sort (timeline->layers, (GCompareFunc)
sort_layers);
}
GESTrackObject *trobj = (GESTrackObject *) tmp->data;
GST_DEBUG ("Trying to remove TrackObject %p", trobj);
- if (G_LIKELY (g_list_find_custom (timeline->priv->tracks,
+ if (G_LIKELY (g_list_find_custom (timeline->tracks,
ges_track_object_get_track (trobj),
(GCompareFunc) custom_find_track))) {
GST_DEBUG ("Belongs to one of the tracks we control");
tr_priv->pad = pad;
no_more = TRUE;
- for (tmp = tr_priv->timeline->priv->tracks; tmp; tmp = g_list_next (tmp)) {
+ for (tmp = tr_priv->timeline->tracks; tmp; tmp = g_list_next (tmp)) {
TrackPrivate *tr_priv = (TrackPrivate *) tmp->data;
if (!tr_priv->pad) {
ges_timeline_append_layer (GESTimeline * timeline)
{
guint32 priority;
- GESTimelinePrivate *priv = timeline->priv;
GESTimelineLayer *layer;
layer = ges_timeline_layer_new ();
- priority = g_list_length (priv->layers);
+ priority = g_list_length (timeline->layers);
ges_timeline_layer_set_priority (layer, priority);
ges_timeline_add_layer (timeline, layer);
ges_timeline_add_layer (GESTimeline * timeline, GESTimelineLayer * layer)
{
GList *objects, *tmp;
- GESTimelinePrivate *priv = timeline->priv;
GST_DEBUG ("timeline:%p, layer:%p", timeline, layer);
}
/* Add to the list of layers, make sure we don't already control it */
- if (G_UNLIKELY (g_list_find (priv->layers, (gconstpointer) layer))) {
+ if (G_UNLIKELY (g_list_find (timeline->layers, (gconstpointer) layer))) {
GST_WARNING ("Layer is already controlled by this timeline");
return FALSE;
}
g_object_ref_sink (layer);
- priv->layers = g_list_insert_sorted (priv->layers, layer,
+ timeline->layers = g_list_insert_sorted (timeline->layers, layer,
(GCompareFunc) sort_layers);
/* Inform the layer that it belongs to a new timeline */
ges_timeline_remove_layer (GESTimeline * timeline, GESTimelineLayer * layer)
{
GList *layer_objects, *tmp;
- GESTimelinePrivate *priv = timeline->priv;
GST_DEBUG ("timeline:%p, layer:%p", timeline, layer);
- if (G_UNLIKELY (!g_list_find (priv->layers, layer))) {
+ if (G_UNLIKELY (!g_list_find (timeline->layers, layer))) {
GST_WARNING ("Layer doesn't belong to this timeline");
return FALSE;
}
g_signal_handlers_disconnect_by_func (layer, layer_object_removed_cb,
timeline);
- priv->layers = g_list_remove (priv->layers, layer);
+ timeline->layers = g_list_remove (timeline->layers, layer);
ges_timeline_layer_set_timeline (layer, NULL);
ges_timeline_add_track (GESTimeline * timeline, GESTrack * track)
{
TrackPrivate *tr_priv;
- GESTimelinePrivate *priv = timeline->priv;
GList *tmp;
GST_DEBUG ("timeline:%p, track:%p", timeline, track);
/* make sure we don't already control it */
- if (G_UNLIKELY (g_list_find_custom (priv->tracks, (gconstpointer) track,
+ if (G_UNLIKELY (g_list_find_custom (timeline->tracks, (gconstpointer) track,
(GCompareFunc) custom_find_track))) {
GST_WARNING ("Track is already controlled by this timeline");
return FALSE;
tr_priv->track = track;
/* Add the track to the list of tracks we track */
- priv->tracks = g_list_append (priv->tracks, tr_priv);
+ timeline->tracks = g_list_append (timeline->tracks, tr_priv);
/* Listen to pad-added/-removed */
g_signal_connect (track, "pad-added", (GCallback) pad_added_cb, tr_priv);
g_signal_connect (G_OBJECT (track), "track-object-removed",
G_CALLBACK (track_object_removed_cb), timeline);
- for (tmp = priv->layers; tmp; tmp = tmp->next) {
+ for (tmp = timeline->layers; tmp; tmp = tmp->next) {
GList *objects, *obj;
objects = ges_timeline_layer_get_objects (tmp->data);
{
GList *tmp;
TrackPrivate *tr_priv;
- GESTimelinePrivate *priv = timeline->priv;
GST_DEBUG ("timeline:%p, track:%p", timeline, track);
if (G_UNLIKELY (!(tmp =
- g_list_find_custom (priv->tracks, (gconstpointer) track,
+ g_list_find_custom (timeline->tracks, (gconstpointer) track,
(GCompareFunc) custom_find_track)))) {
GST_WARNING ("Track doesn't belong to this timeline");
return FALSE;
}
tr_priv = tmp->data;
- priv->tracks = g_list_remove (priv->tracks, tr_priv);
+ timeline->tracks = g_list_remove (timeline->tracks, tr_priv);
ges_track_set_timeline (track, NULL);
{
GList *tmp;
- for (tmp = timeline->priv->tracks; tmp; tmp = g_list_next (tmp)) {
+ for (tmp = timeline->tracks; tmp; tmp = g_list_next (tmp)) {
TrackPrivate *tr_priv = (TrackPrivate *) tmp->data;
if (pad == tr_priv->ghostpad)
return tr_priv->track;
{
GList *tmp, *res = NULL;
- for (tmp = timeline->priv->tracks; tmp; tmp = g_list_next (tmp)) {
+ for (tmp = timeline->tracks; tmp; tmp = g_list_next (tmp)) {
TrackPrivate *tr_priv = (TrackPrivate *) tmp->data;
res = g_list_append (res, g_object_ref (tr_priv->track));
}
{
GList *tmp, *res = NULL;
- for (tmp = timeline->priv->layers; tmp; tmp = g_list_next (tmp)) {
+ for (tmp = timeline->layers; tmp; tmp = g_list_next (tmp)) {
res = g_list_insert_sorted (res, g_object_ref (tmp->data),
(GCompareFunc) sort_layers);
}
g_return_val_if_fail (GES_IS_TIMELINE (timeline), FALSE);
- for (tmp = timeline->priv->tracks; tmp; tmp = tmp->next) {
+ for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
if (!ges_track_is_updating (((TrackPrivate *) tmp->data)->track))
return FALSE;
}