From 335c93569bcf68b461a92b07b7e2effc2381c65e Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Mon, 2 Aug 2010 19:06:06 +0200 Subject: [PATCH] implement background widget --- tests/examples/ges-ui.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/tests/examples/ges-ui.c b/tests/examples/ges-ui.c index 9a5d2e720a..aa52d56bdc 100644 --- a/tests/examples/ges-ui.c +++ b/tests/examples/ges-ui.c @@ -123,6 +123,8 @@ void disconnect_from_title_source (GESTimelineObject * object, App * app); void seconds_notify_text_changed_cb (GtkEntry * widget, GParamSpec * unused, App * app); +void background_type_changed_cb (GtkComboBox * widget, App * app); + /* UI state functions *******************************************************/ static void @@ -374,6 +376,18 @@ seconds_notify_text_changed_cb (GtkEntry * widget, GParamSpec * unused, } } +void +background_type_changed_cb (GtkComboBox * widget, App * app) +{ + GList *tmp; + gint p; + p = gtk_combo_box_get_active (widget); + + for (tmp = app->selected_objects; tmp; tmp = tmp->next) { + g_object_set (G_OBJECT (tmp->data), "vpattern", (gint) p, NULL); + } +} + /* application methods ******************************************************/ static void selection_foreach (GtkTreeModel * model, GtkTreePath * path, @@ -767,7 +781,6 @@ disconnect_from_filesource (GESTimelineObject * object, App * app) void connect_to_title_source (GESTimelineObject * object, App * app) { - gdouble s; guint64 duration; gchar buf[30]; @@ -779,8 +792,6 @@ connect_to_title_source (GESTimelineObject * object, App * app) duration = GES_TIMELINE_OBJECT_DURATION (object); - s = (duration / (float) GST_SECOND); - g_snprintf (buf, sizeof (buf), "%02u:%02u:%02u.%09u", GST_TIME_ARGS (duration)); gtk_entry_set_text (app->seconds, buf); @@ -791,6 +802,23 @@ disconnect_from_title_source (GESTimelineObject * object, App * app) { } +static void +connect_to_test_source (GESTimelineObject * object, App * app) +{ + gchar buf[30]; + guint64 duration; + + GESTimelineTestSource *obj; + obj = GES_TIMELINE_TEST_SOURCE (object); + gtk_combo_box_set_active (app->background_type, obj->vpattern); + + duration = GES_TIMELINE_OBJECT_DURATION (object); + + g_snprintf (buf, sizeof (buf), "%02u:%02u:%02u.%09u", + GST_TIME_ARGS (duration)); + gtk_entry_set_text (app->seconds, buf); +} + void connect_to_object (GESTimelineObject * object, App * app) { @@ -798,6 +826,8 @@ connect_to_object (GESTimelineObject * object, App * app) connect_to_filesource (object, app); } else if (GES_IS_TIMELINE_TITLE_SOURCE (object)) { connect_to_title_source (object, app); + } else if (GES_IS_TIMELINE_TEST_SOURCE (object)) { + connect_to_test_source (object, app); } }