expose priority-offset as a property

This commit is contained in:
Brandon Lewis 2010-07-08 19:01:46 +02:00 committed by Edward Hervey
parent 92bedbc72e
commit 572f7ab4da
2 changed files with 20 additions and 1 deletions

View file

@ -57,6 +57,7 @@ enum
PROP_INPOINT, PROP_INPOINT,
PROP_DURATION, PROP_DURATION,
PROP_PRIORITY, PROP_PRIORITY,
PROP_PRIORITY_OFFSET,
PROP_ACTIVE PROP_ACTIVE
}; };
@ -99,6 +100,9 @@ ges_track_object_get_property (GObject * object, guint property_id,
case PROP_PRIORITY: case PROP_PRIORITY:
g_value_set_uint (value, tobj->base_priority); g_value_set_uint (value, tobj->base_priority);
break; break;
case PROP_PRIORITY_OFFSET:
g_value_set_uint (value, tobj->priority_offset);
break;
case PROP_ACTIVE: case PROP_ACTIVE:
g_value_set_boolean (value, tobj->active); g_value_set_boolean (value, tobj->active);
break; break;
@ -126,6 +130,10 @@ ges_track_object_set_property (GObject * object, guint property_id,
case PROP_PRIORITY: case PROP_PRIORITY:
ges_track_object_set_priority_internal (tobj, g_value_get_uint (value)); ges_track_object_set_priority_internal (tobj, g_value_get_uint (value));
break; break;
case PROP_PRIORITY_OFFSET:
ges_track_object_set_priority_offset_internal (tobj, g_value_get_uint
(value));
break;
case PROP_ACTIVE: case PROP_ACTIVE:
ges_track_object_set_active (tobj, g_value_get_boolean (value)); ges_track_object_set_active (tobj, g_value_get_boolean (value));
break; break;
@ -205,6 +213,17 @@ ges_track_object_class_init (GESTrackObjectClass * klass)
g_param_spec_uint ("priority", "Priority", g_param_spec_uint ("priority", "Priority",
"The priority of the object", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); "The priority of the object", 0, G_MAXUINT, 0, G_PARAM_READWRITE));
/**
* GESTrackObject:priority-offset
*
* A value added to the "priority" value. Needed for timeline objects
* that create multiple track objects per track.
*/
g_object_class_install_property (object_class, PROP_PRIORITY_OFFSET,
g_param_spec_uint ("priority-offset", "Priority Offset",
"An offset from the base priority", 0, G_MAXUINT, 0,
G_PARAM_READWRITE));
/** /**
* GESTrackObject:active * GESTrackObject:active
* *

View file

@ -119,7 +119,7 @@ GST_START_TEST (test_layer_properties)
gnl_object_check (trackobject->gnlobject, 42, 51, 12, 51, 0, TRUE); gnl_object_check (trackobject->gnlobject, 42, 51, 12, 51, 0, TRUE);
/* check priority offsets */ /* check priority offsets */
ges_track_object_set_priority_offset_internal (trackobject, 1); g_object_set (trackobject, "priority-offset", 1, NULL);
gnl_object_check (trackobject->gnlobject, 42, 51, 12, 51, 1, TRUE); gnl_object_check (trackobject->gnlobject, 42, 51, 12, 51, 1, TRUE);
g_object_set (object, "priority", 5, NULL); g_object_set (object, "priority", 5, NULL);
gnl_object_check (trackobject->gnlobject, 42, 51, 12, 51, 6, TRUE); gnl_object_check (trackobject->gnlobject, 42, 51, 12, 51, 6, TRUE);