summaryrefslogtreecommitdiffstats
path: root/extensions/audio-video-properties/test-properties-page.c
blob: 21be43a34539f6b8dd8123ae56173347e929218f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * Copyright (C) 2005  Bastien Nocera <hadess@hadess.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#include <config.h>
#include <string.h>
#define GST_USE_UNSTABLE_API 1
#include <gst/gst.h>
#include <glib/gi18n-lib.h>
#include "totem-gst-helpers.h"
#include "totem-properties-view.h"

static GtkWidget *window, *props, *label;

static void
create_props (const char *url)
{
	label = gtk_label_new ("Audio/Video");
	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (G_OBJECT (window), "destroy",
			  G_CALLBACK (gtk_main_quit), NULL);
	gtk_window_set_default_size (GTK_WINDOW (window), 450, 550);
	props = totem_properties_view_new (url, label);
	gtk_container_add (GTK_CONTAINER (window), props);

	gtk_widget_show_all (window);
}

static void
destroy_props (void)
{
	gtk_widget_destroy (label);
}

int main (int argc, char **argv)
{
	GFile *file;
	char *url;

	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);

	totem_gst_disable_display_decoders ();
	gst_init (&argc, &argv);
	gtk_init (&argc, &argv);

	if (argc != 2) {
		g_print ("Usage: %s [URI]\n", argv[0]);
		return 1;
	}

	file = g_file_new_for_commandline_arg (argv[1]);
	url = g_file_get_uri (file);
	g_object_unref (file);

	create_props (url);
	g_free (url);

	gtk_main ();

	destroy_props ();

	return 0;
}