diff --git a/ges/ges-timeline-background-source.c b/ges/ges-timeline-background-source.c index 5bc6a9b086..885a66a65d 100644 --- a/ges/ges-timeline-background-source.c +++ b/ges/ges-timeline-background-source.c @@ -32,6 +32,7 @@ #include "ges-track-object.h" #include "ges-track-video-background-source.h" #include "ges-track-audio-background-source.h" +#include G_DEFINE_TYPE (GESTimelineBackgroundSource, ges_tl_bg_src, GES_TYPE_TIMELINE_SOURCE); @@ -264,3 +265,23 @@ ges_timeline_background_source_new (void) /* FIXME : Check for validity/existence of URI */ return g_object_new (GES_TYPE_TIMELINE_BACKGROUND_SOURCE, NULL); } + +GESTimelineBackgroundSource * +ges_timeline_background_source_new_for_nick (gchar * nick) +{ + GESTimelineBackgroundSource *ret; + GEnumValue *value; + int i; + + for (i = 0, value = &vpattern_enum_values[i]; value->value_nick; + value = &vpattern_enum_values[i++]) { + if (!strcmp (nick, value->value_nick)) { + ret = g_object_new (GES_TYPE_TIMELINE_BACKGROUND_SOURCE, "vpattern", + (gint) value->value, NULL); + return ret; + } + value++; + } + + return NULL; +} diff --git a/ges/ges-timeline-background-source.h b/ges/ges-timeline-background-source.h index a386dc8e66..d616f59fa3 100644 --- a/ges/ges-timeline-background-source.h +++ b/ges/ges-timeline-background-source.h @@ -72,6 +72,8 @@ struct _GESTimelineBackgroundSourceClass { GType ges_tl_bg_src_get_type (void); GESTimelineBackgroundSource* ges_timeline_background_source_new (void); +GESTimelineBackgroundSource* ges_timeline_background_source_new_for_nick(gchar + * nick); G_END_DECLS