TimelineObject: add the ges_timeline_object_get_top_effect_position method

tests: adapt the effect testsuite to use this function

docs: add the method to the documentation
This commit is contained in:
Thibault Saunier 2011-01-31 11:41:37 +01:00 committed by Edward Hervey
parent dd298b99c7
commit ca2d5bca2b
4 changed files with 27 additions and 1 deletions

View file

@ -281,6 +281,7 @@ ges_timeline_object_get_layer
ges_timeline_object_find_track_object ges_timeline_object_find_track_object
ges_timeline_object_add_track_object ges_timeline_object_add_track_object
ges_timeline_object_get_effects ges_timeline_object_get_effects
ges_timeline_object_get_top_effect_position
<SUBSECTION Standard> <SUBSECTION Standard>
GES_TIMELINE_OBJECT_DURATION GES_TIMELINE_OBJECT_DURATION
GES_TIMELINE_OBJECT_INPOINT GES_TIMELINE_OBJECT_INPOINT

View file

@ -822,6 +822,24 @@ ges_timeline_object_get_effects (GESTimelineObject * object)
return ret; return ret;
} }
/**
* ges_timeline_object_get_top_effect_position:
*
* @object: The origin #GESTimelineObject
* @effect: The #GESTrackEffect we want to get the top position from
*
* Gets the top position of an effect.
*
* Returns: The top position of the effect, -1 if something went wrong.
*/
gint
ges_timeline_object_get_top_effect_position (GESTimelineObject * object,
GESTrackOperation * effect)
{
return find_object_mapping (object,
GES_TRACK_OBJECT (effect))->priority_offset;
}
/* /*
* PROPERTY NOTIFICATIONS FROM TRACK OBJECTS * PROPERTY NOTIFICATIONS FROM TRACK OBJECTS
*/ */

View file

@ -244,6 +244,10 @@ ges_timeline_object_add_track_object (GESTimelineObject *object, GESTrackObject
GList * GList *
ges_timeline_object_get_effects (GESTimelineObject *object); ges_timeline_object_get_effects (GESTimelineObject *object);
gint
ges_timeline_object_get_top_effect_position (GESTimelineObject *object,
GESTrackOperation *effect);
G_END_DECLS G_END_DECLS
#endif /* _GES_TIMELINE_OBJECT */ #endif /* _GES_TIMELINE_OBJECT */

View file

@ -135,7 +135,10 @@ GST_START_TEST (test_get_effects_from_tl)
effects = ges_timeline_object_get_effects (GES_TIMELINE_OBJECT (source)); effects = ges_timeline_object_get_effects (GES_TIMELINE_OBJECT (source));
for (tmp = effects; tmp; tmp = tmp->next) { for (tmp = effects; tmp; tmp = tmp->next) {
int priority = GES_TRACK_OBJECT (tmp->data)->priority; gint priority =
ges_timeline_object_get_top_effect_position (GES_TIMELINE_OBJECT
(source),
GES_TRACK_OPERATION (tmp->data));
fail_unless (priority > effect_prio); fail_unless (priority > effect_prio);
fail_unless (GES_IS_TRACK_EFFECT (tmp->data)); fail_unless (GES_IS_TRACK_EFFECT (tmp->data));
effect_prio = priority; effect_prio = priority;