ges/ges-timeline-transition.{c,h}: add convenience routine for creating

transitions
docs/libs/ges-sections.txt: add routine to documentation
This commit is contained in:
Brandon Lewis 2010-05-27 12:02:10 +02:00 committed by Edward Hervey
parent 7cab52d01b
commit ff4443a9c6
3 changed files with 38 additions and 0 deletions

View file

@ -243,6 +243,7 @@ GES_TYPE_TIMELINE_FILE_SOURCE
GESTimelineTransition
GESTimelineTransitionClass
ges_timeline_transition_new
ges_timeline_transition_new_for_nick
<SUBSECTION Standard>
GES_IS_TIMELINE_TRANSITION
GES_IS_TIMELINE_TRANSITION_CLASS

View file

@ -109,3 +109,39 @@ ges_timeline_transition_new (GEnumValue * vtype)
ret->vtype = vtype;
return ret;
}
static GEnumClass *smpte_enum_class = NULL;
static
_ensure_smpte_enum_class ()
{
if (!smpte_enum_class) {
GstElement *element = gst_element_factory_make ("smpte", NULL);
GstElementClass *element_class = GST_ELEMENT_GET_CLASS (element);
GParamSpec *pspec =
g_object_class_find_property (G_OBJECT_CLASS (element_class), "type");
smpte_enum_class = G_ENUM_CLASS (g_type_class_ref (pspec->value_type));
}
}
GESTimelineTransition *
ges_timeline_transition_new_for_nick (char *nick)
{
_ensure_smpte_enum_class ();
if (!strcmp ("crossfade", nick)) {
return ges_timeline_transition_new (NULL);
}
GEnumValue *value = g_enum_get_value_by_nick (smpte_enum_class, nick);
if (!value) {
return NULL;
}
return ges_timeline_transition_new (value);
}

View file

@ -55,6 +55,7 @@ struct _GESTimelineTransitionClass {
GType ges_timeline_transition_get_type (void);
GESTimelineTransition *ges_timeline_transition_new (GEnumValue * vtype);
GESTimelineTransition *ges_timeline_transition_new_for_nick (char *nick);
G_END_DECLS