implement ges_timeline_background_source_new_for_nick()

This commit is contained in:
Brandon Lewis 2010-06-11 16:51:44 +02:00 committed by Edward Hervey
parent fcab9fa0b3
commit 2d022c8886
2 changed files with 23 additions and 0 deletions

View file

@ -32,6 +32,7 @@
#include "ges-track-object.h"
#include "ges-track-video-background-source.h"
#include "ges-track-audio-background-source.h"
#include <string.h>
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;
}

View file

@ -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