allow adding test sources

This commit is contained in:
Brandon Lewis 2010-08-02 17:24:24 +02:00 committed by Edward Hervey
parent e21bce1843
commit b37a92b255

View file

@ -64,6 +64,8 @@ void app_add_file (App * app, gchar * filename);
void app_add_title (App * app);
void app_add_test (App * app);
GList *app_get_selected_objects (App * app);
void app_delete_objects (App * app, GList * objects);
@ -82,6 +84,8 @@ void add_file_activate_cb (GtkAction * item, App * app);
void add_text_activate_cb (GtkAction * item, App * app);
void add_test_activate_cb (GtkAction * item, App * app);
void app_selection_changed_cb (GtkTreeSelection * selection, App * app);
void app_toggle_playback (App * app);
@ -185,6 +189,12 @@ add_text_activate_cb (GtkAction * item, App * app)
app_add_title (app);
}
void
add_test_activate_cb (GtkAction * item, App * app)
{
app_add_test (app);
}
void
play_activate_cb (GtkAction * item, App * app)
{
@ -469,6 +479,20 @@ app_add_title (App * app)
obj, -1);
}
void
app_add_test (App * app)
{
GESTimelineObject *obj;
GST_DEBUG ("adding test");
obj = GES_TIMELINE_OBJECT (ges_timeline_test_source_new ());
g_object_set (G_OBJECT (obj), "duration", GST_SECOND, NULL);
ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER
(app->layer), obj, -1);
}
App *
app_new (void)
{
@ -633,6 +657,10 @@ layer_object_added_cb (GESTimelineLayer * layer, GESTimelineObject * object,
title_source_text_changed_cb (object, NULL, app);
}
else if (GES_IS_TIMELINE_TEST_SOURCE (object)) {
gtk_list_store_set (app->model, &iter, 2, object, 0, "Test Source", -1);
}
g_signal_connect (G_OBJECT (object), "notify::duration",
G_CALLBACK (timeline_object_notify_duration_cb), app);
timeline_object_notify_duration_cb (object, NULL, app);