annotate src/arts/configure.c @ 1399:adb12b6703e6

Unbreak WMA I/O.
author William Pitcock <nenolod@atheme-project.org>
date Fri, 03 Aug 2007 22:13:41 -0500
parents a9a97179a1f9
children b8da6a0b0da2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1 /*
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2 * aRts ouput plugin for xmms
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
3 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
4 * Copyright (C) 2000,2003 Haavard Kvaalen <havardk@xmms.org>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
5 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
6 * Licenced under GNU GPL version 2.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
7 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
8 * Audacious port by Giacomo Lozito from develia.org
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
9 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
10 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
11
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
12 #include "arts.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
14 #include <gtk/gtk.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
15
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
16 static GtkWidget *configure_win = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
17 static GtkWidget *buffer_size_spin;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
18
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
19 static void configure_win_ok_cb(GtkWidget * w, gpointer data)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
20 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21 ConfigDb *db;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
22
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
23 artsxmms_cfg.buffer_size =
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
24 gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(buffer_size_spin));
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
25
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
26 db = bmp_cfg_db_open();
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
27 bmp_cfg_db_set_int(db, "arts", "buffer_size", artsxmms_cfg.buffer_size);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
28 bmp_cfg_db_close(db);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
29
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
30 gtk_widget_destroy(configure_win);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
31 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
32
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
33
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
34 void artsxmms_configure(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
35 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
36 GtkWidget *vbox, *notebook;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
37 GtkWidget *buffer_frame, *buffer_vbox, *buffer_table;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
38 GtkWidget *buffer_size_box, *buffer_size_label;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
39 GtkWidget *bbox, *ok, *cancel;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
40
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
41 GtkObject *buffer_size_adj;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
42
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
43 if (configure_win)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
44 return;
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
45
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
46 configure_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
47 gtk_window_set_type_hint( GTK_WINDOW(configure_win), GDK_WINDOW_TYPE_HINT_DIALOG );
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
48 gtk_signal_connect(GTK_OBJECT(configure_win), "destroy",
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
49 GTK_SIGNAL_FUNC(gtk_widget_destroyed), &configure_win);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
50 gtk_window_set_title(GTK_WINDOW(configure_win), _("aRts Driver configuration"));
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
51 gtk_window_set_policy(GTK_WINDOW(configure_win), FALSE, FALSE, FALSE);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
52 gtk_window_set_position(GTK_WINDOW(configure_win), GTK_WIN_POS_MOUSE);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
53 gtk_container_border_width(GTK_CONTAINER(configure_win), 10);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
54
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
55 vbox = gtk_vbox_new(FALSE, 10);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
56 gtk_container_add(GTK_CONTAINER(configure_win), vbox);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
57
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
58 notebook = gtk_notebook_new();
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
59 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
60
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
61 buffer_frame = gtk_frame_new(_("Buffering:"));
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
62 gtk_container_set_border_width(GTK_CONTAINER(buffer_frame), 5);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
63
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
64 buffer_vbox = gtk_vbox_new(FALSE, 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
65 gtk_container_add(GTK_CONTAINER(buffer_frame), buffer_vbox);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
66
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
67 buffer_table = gtk_table_new(2, 1, TRUE);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
68 gtk_container_set_border_width(GTK_CONTAINER(buffer_table), 5);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
69 gtk_box_pack_start(GTK_BOX(buffer_vbox), buffer_table, FALSE, FALSE, 0);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
70
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
71 buffer_size_box = gtk_hbox_new(FALSE, 5);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
72 gtk_table_attach_defaults(GTK_TABLE(buffer_table), buffer_size_box, 0, 1, 0, 1);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
73 buffer_size_label = gtk_label_new(_("Buffer size (ms):"));
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
74 gtk_box_pack_start(GTK_BOX(buffer_size_box), buffer_size_label, FALSE, FALSE, 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
75 gtk_widget_show(buffer_size_label);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
76 buffer_size_adj = gtk_adjustment_new(artsxmms_cfg.buffer_size,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
77 200, 10000, 100, 100, 100);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
78 buffer_size_spin = gtk_spin_button_new(GTK_ADJUSTMENT(buffer_size_adj), 8, 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
79 gtk_widget_set_usize(buffer_size_spin, 60, -1);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
80 gtk_box_pack_start(GTK_BOX(buffer_size_box), buffer_size_spin, FALSE, FALSE, 0);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
81
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
82 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), buffer_frame,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
83 gtk_label_new(_("Buffering")));
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
84
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
85 bbox = gtk_hbutton_box_new();
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
86 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
87 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
88 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
89
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
90 ok = gtk_button_new_with_label(_("Ok"));
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
91 cancel = gtk_button_new_with_label(_("Cancel"));
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
92 GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
93 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
94 gtk_signal_connect(GTK_OBJECT(ok), "clicked",
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
95 GTK_SIGNAL_FUNC(configure_win_ok_cb), NULL);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
96 gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked",
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
97 GTK_SIGNAL_FUNC(gtk_widget_destroy),
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
98 GTK_OBJECT(configure_win));
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
99 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
100 gtk_widget_grab_default(ok);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
101 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
1318
a9a97179a1f9 I will be ready for Audacious 2...
Stany HENRY <StrassBoy@gmail.com>
parents: 12
diff changeset
102
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
103 gtk_widget_show_all(configure_win);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
104 }