trackobject: Make the GESTrack (parent track) a GObject property

This commit is contained in:
Thibault Saunier 2013-01-10 18:09:23 -03:00
parent 9791fc541b
commit 5f69200a3a

View file

@ -89,6 +89,7 @@ enum
PROP_LOCKED,
PROP_MAX_DURATION,
PROP_TRACK_TYPE,
PROP_TRACK,
PROP_LAST
};
@ -171,6 +172,9 @@ ges_track_object_get_property (GObject * object, guint property_id,
case PROP_TRACK_TYPE:
g_value_set_flags (value, tobj->priv->track_type);
break;
case PROP_TRACK:
g_value_set_object (value, tobj->priv->track);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@ -359,6 +363,11 @@ ges_track_object_class_init (GESTrackObjectClass * klass)
g_object_class_install_property (object_class, PROP_TRACK_TYPE,
properties[PROP_TRACK_TYPE]);
properties[PROP_TRACK] = g_param_spec_object ("track", "Track",
"The track the object is in", GES_TYPE_TRACK, G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_TRACK,
properties[PROP_TRACK]);
/**
* GESTrackObject::deep-notify:
@ -920,6 +929,7 @@ done:
gboolean
ges_track_object_set_track (GESTrackObject * object, GESTrack * track)
{
gboolean ret = TRUE;
GST_DEBUG ("object:%p, track:%p", object, track);
object->priv->track = track;
@ -929,13 +939,13 @@ ges_track_object_set_track (GESTrackObject * object, GESTrack * track)
if (object->priv->gnlobject) {
g_object_set (object->priv->gnlobject,
"caps", ges_track_get_caps (object->priv->track), NULL);
return TRUE;
} else {
return ensure_gnl_object (object);
ret = ensure_gnl_object (object);
}
}
return TRUE;
g_object_notify_by_pspec (G_OBJECT (object), properties[PROP_TRACK]);
return ret;
}
/**