annotate Plugins/Input/vorbis/configure.c @ 61:fa848bd484d8 trunk

[svn] Move plugins to Plugins/
author nenolod
date Fri, 28 Oct 2005 22:58:11 -0700
parents
children e85198a7f34d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 #ifdef HAVE_CONFIG_H
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 # include "config.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 #include "vorbis.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 #include <glib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 #include <glib/gi18n.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 #include <gtk/gtk.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 #include <stdlib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 #include <string.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 #include "libaudacious/configdb.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14 #include "libaudacious/dirbrowser.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 #include "libaudacious/titlestring.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
16 #include "libaudacious/util.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 #include "audacious/plugin.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 extern GMutex *vf_mutex;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 static GtkWidget *vorbis_configurewin = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 static GtkWidget *vbox, *notebook;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24 static GtkWidget *streaming_proxy_use, *streaming_proxy_host_entry;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
25 static GtkWidget *streaming_proxy_port_entry, *streaming_save_entry;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26 static GtkWidget *streaming_save_use, *streaming_size_spin,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27 *streaming_pre_spin;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28 static GtkWidget *streaming_proxy_auth_use;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 static GtkWidget *streaming_proxy_auth_pass_entry,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30 *streaming_proxy_auth_user_entry;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31 static GtkWidget *streaming_proxy_auth_user_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32 *streaming_proxy_auth_pass_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33 static GtkWidget *streaming_proxy_hbox, *streaming_proxy_auth_hbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 static GtkWidget *streaming_save_dirbrowser, *streaming_save_hbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 static GtkWidget *title_tag_override, *title_tag_box, *title_tag_entry,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36 *title_desc;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37 static GtkWidget *rg_switch, *rg_clip_switch, *rg_booster_switch,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 *rg_track_gain;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40 vorbis_config_t vorbis_cfg;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
43 vorbis_configurewin_ok(GtkWidget * widget, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
44 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
45 ConfigDb *db;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
46 GtkToggleButton *tb;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
47
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
48 vorbis_cfg.http_buffer_size =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
49 gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
50 (streaming_size_spin));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51 vorbis_cfg.http_prebuffer =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(streaming_pre_spin));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
53
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54 vorbis_cfg.use_proxy =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
56 g_free(vorbis_cfg.proxy_host);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57 vorbis_cfg.proxy_host =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58 g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_host_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59 vorbis_cfg.proxy_port =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 atoi(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_port_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
62 vorbis_cfg.proxy_use_auth =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64 (streaming_proxy_auth_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
65
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
66 g_free(vorbis_cfg.proxy_user);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
67 vorbis_cfg.proxy_user = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68 if (strlen
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
69 (gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_user_entry))) > 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
70 vorbis_cfg.proxy_user =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
71 g_strdup(gtk_entry_get_text
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
72 (GTK_ENTRY(streaming_proxy_auth_user_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
73
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
74 g_free(vorbis_cfg.proxy_pass);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
75 vorbis_cfg.proxy_pass = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
76 if (strlen
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
77 (gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_pass_entry))) > 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
78 vorbis_cfg.proxy_pass =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
79 g_strdup(gtk_entry_get_text
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
80 (GTK_ENTRY(streaming_proxy_auth_pass_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
81
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
82
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
83 vorbis_cfg.save_http_stream =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
84 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
85 g_free(vorbis_cfg.save_http_path);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
86 vorbis_cfg.save_http_path =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
87 g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_save_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
88 g_free(vorbis_cfg.tag_format);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
89 vorbis_cfg.tag_format =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
90 g_strdup(gtk_entry_get_text(GTK_ENTRY(title_tag_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
91
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
92 tb = GTK_TOGGLE_BUTTON(title_tag_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
93 vorbis_cfg.tag_override = gtk_toggle_button_get_active(tb);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
94 tb = GTK_TOGGLE_BUTTON(rg_switch);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
95 vorbis_cfg.use_replaygain = gtk_toggle_button_get_active(tb);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
96 tb = GTK_TOGGLE_BUTTON(rg_clip_switch);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
97 vorbis_cfg.use_anticlip = gtk_toggle_button_get_active(tb);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
98 tb = GTK_TOGGLE_BUTTON(rg_booster_switch);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
99 vorbis_cfg.use_booster = gtk_toggle_button_get_active(tb);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
100 tb = GTK_TOGGLE_BUTTON(rg_track_gain);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
101 if (gtk_toggle_button_get_active(tb))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
102 vorbis_cfg.replaygain_mode = REPLAYGAIN_MODE_TRACK;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
103 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
104 vorbis_cfg.replaygain_mode = REPLAYGAIN_MODE_ALBUM;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
105
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
106
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
107 db = bmp_cfg_db_open();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
108
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
109 bmp_cfg_db_set_int(db, "vorbis", "http_buffer_size",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
110 vorbis_cfg.http_buffer_size);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
111 bmp_cfg_db_set_int(db, "vorbis", "http_prebuffer",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
112 vorbis_cfg.http_prebuffer);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
113 bmp_cfg_db_set_bool(db, "vorbis", "use_proxy", vorbis_cfg.use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
114 bmp_cfg_db_set_string(db, "vorbis", "proxy_host", vorbis_cfg.proxy_host);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
115 bmp_cfg_db_set_bool(db, "vorbis", "save_http_stream",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
116 vorbis_cfg.save_http_stream);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
117 bmp_cfg_db_set_string(db, "vorbis", "save_http_path",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
118 vorbis_cfg.save_http_path);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
119 bmp_cfg_db_set_bool(db, "vorbis", "tag_override",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
120 vorbis_cfg.tag_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
121 bmp_cfg_db_set_string(db, "vorbis", "tag_format", vorbis_cfg.tag_format);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
122 bmp_cfg_db_set_int(db, "vorbis", "proxy_port", vorbis_cfg.proxy_port);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
123 bmp_cfg_db_set_bool(db, "vorbis", "proxy_use_auth",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
124 vorbis_cfg.proxy_use_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
125 if (vorbis_cfg.proxy_user)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
126 bmp_cfg_db_set_string(db, "vorbis", "proxy_user",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
127 vorbis_cfg.proxy_user);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
128 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
129 bmp_cfg_db_unset_key(db, "vorbis", "proxy_user");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
130
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
131 if (vorbis_cfg.proxy_pass)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
132 bmp_cfg_db_set_string(db, "vorbis", "proxy_pass",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
133 vorbis_cfg.proxy_pass);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
134 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
135 bmp_cfg_db_unset_key(db, "vorbis", "proxy_pass");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
136 bmp_cfg_db_set_bool(db, "vorbis", "use_anticlip",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
137 vorbis_cfg.use_anticlip);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
138 bmp_cfg_db_set_bool(db, "vorbis", "use_replaygain",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
139 vorbis_cfg.use_replaygain);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
140 bmp_cfg_db_set_int(db, "vorbis", "replaygain_mode",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
141 vorbis_cfg.replaygain_mode);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
142 bmp_cfg_db_set_bool(db, "vorbis", "use_booster", vorbis_cfg.use_booster);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
143 bmp_cfg_db_close(db);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
144 gtk_widget_destroy(vorbis_configurewin);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
145 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
146
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
147 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
148 proxy_use_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
149 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
150 gboolean use_proxy, use_proxy_auth;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
151
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
152 use_proxy =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
153 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
154 use_proxy_auth =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
155 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
156 (streaming_proxy_auth_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
157
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
158 gtk_widget_set_sensitive(streaming_proxy_hbox, use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
159 gtk_widget_set_sensitive(streaming_proxy_auth_use, use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
160 gtk_widget_set_sensitive(streaming_proxy_auth_hbox, use_proxy
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
161 && use_proxy_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
162 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
163
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
164 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
165 proxy_auth_use_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
166 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
167 gboolean use_proxy, use_proxy_auth;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
168
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
169 use_proxy =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
170 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
171 use_proxy_auth =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
172 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
173 (streaming_proxy_auth_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
174
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
175 gtk_widget_set_sensitive(streaming_proxy_auth_hbox, use_proxy
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
176 && use_proxy_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
177 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
178
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
179 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
180 streaming_save_dirbrowser_cb(gchar * dir)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
181 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
182 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), dir);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
183 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
184
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
185 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
186 streaming_save_browse_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
187 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
188 if (streaming_save_dirbrowser)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
189 return;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
190
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
191 streaming_save_dirbrowser =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
192 xmms_create_dir_browser(_("Select the directory where you want "
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
193 "to store the Ogg Vorbis streams:"),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
194 vorbis_cfg.save_http_path,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
195 GTK_SELECTION_SINGLE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
196 streaming_save_dirbrowser_cb);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
197 g_signal_connect(G_OBJECT(streaming_save_dirbrowser),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
198 "destroy", G_CALLBACK(gtk_widget_destroyed),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
199 &streaming_save_dirbrowser);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
200 gtk_window_set_transient_for(GTK_WINDOW(streaming_save_dirbrowser),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
201 GTK_WINDOW(vorbis_configurewin));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
202 gtk_widget_show(streaming_save_dirbrowser);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
203 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
204
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
205 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
206 streaming_save_use_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
207 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
208 gboolean save_stream;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
209
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
210 save_stream =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
211 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
212
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
213 gtk_widget_set_sensitive(streaming_save_hbox, save_stream);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
214 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
215
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
216 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
217 configure_destroy(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
218 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
219 /* if (streaming_save_dirbrowser) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
220 /* gtk_widget_destroy(streaming_save_dirbrowser); */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
221 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
222
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
223 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
224 title_tag_override_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
225 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
226 gboolean override;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
227 override =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
228 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_tag_override));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
229 gtk_widget_set_sensitive(title_tag_box, override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
230 gtk_widget_set_sensitive(title_desc, override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
231 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
232
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
233 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
234 rg_switch_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
235 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
236 gtk_widget_set_sensitive(GTK_WIDGET(data),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
237 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
238 (w)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
239 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
240
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
241 void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
242 vorbis_configure(void)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
243 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
244 GtkWidget *streaming_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
245 GtkWidget *streaming_buf_frame, *streaming_buf_hbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
246 GtkWidget *streaming_size_box, *streaming_size_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
247 GtkWidget *streaming_pre_box, *streaming_pre_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
248 GtkWidget *streaming_proxy_frame, *streaming_proxy_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
249 GtkWidget *streaming_proxy_port_label, *streaming_proxy_host_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
250 GtkWidget *streaming_save_frame, *streaming_save_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
251 GtkWidget *streaming_save_label, *streaming_save_browse;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
252 GtkWidget *title_frame, *title_tag_vbox, *title_tag_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
253 GtkWidget *rg_frame, *rg_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
254 GtkWidget *bbox, *ok, *cancel;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
255 GtkWidget *rg_type_frame, *rg_type_vbox, *rg_album_gain;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
256 GtkObject *streaming_size_adj, *streaming_pre_adj;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
257
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
258 char *temp;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
259
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
260 if (vorbis_configurewin != NULL) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
261 gtk_window_present(GTK_WINDOW(vorbis_configurewin));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
262 return;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
263 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
264
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
265 vorbis_configurewin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
266 gtk_window_set_type_hint(GTK_WINDOW(vorbis_configurewin),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
267 GDK_WINDOW_TYPE_HINT_DIALOG);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
268 gtk_window_set_position(GTK_WINDOW(vorbis_configurewin),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
269 GTK_WIN_POS_CENTER);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
270 g_signal_connect(G_OBJECT(vorbis_configurewin), "destroy",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
271 G_CALLBACK(gtk_widget_destroyed), &vorbis_configurewin);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
272 g_signal_connect(G_OBJECT(vorbis_configurewin), "destroy",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
273 G_CALLBACK(configure_destroy), &vorbis_configurewin);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
274 gtk_window_set_title(GTK_WINDOW(vorbis_configurewin),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
275 _("Ogg Vorbis Audio Plugin Configuration"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
276 gtk_window_set_resizable(GTK_WINDOW(vorbis_configurewin), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
277 gtk_container_border_width(GTK_CONTAINER(vorbis_configurewin), 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
278
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
279 vbox = gtk_vbox_new(FALSE, 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
280 gtk_container_add(GTK_CONTAINER(vorbis_configurewin), vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
281
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
282 notebook = gtk_notebook_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
283 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
284
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
285 streaming_vbox = gtk_vbox_new(FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
286
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
287 streaming_buf_frame = gtk_frame_new(_("Buffering:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
288 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
289 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_buf_frame, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
290 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
291
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
292 streaming_buf_hbox = gtk_hbox_new(TRUE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
293 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_hbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
294 gtk_container_add(GTK_CONTAINER(streaming_buf_frame), streaming_buf_hbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
295
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
296 streaming_size_box = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
297 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_size_box,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
298 TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
299 streaming_size_label = gtk_label_new(_("Buffer size (kb):"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
300 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
301 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
302 streaming_size_adj =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
303 gtk_adjustment_new(vorbis_cfg.http_buffer_size, 4, 4096, 4, 4, 4);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
304 streaming_size_spin =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
305 gtk_spin_button_new(GTK_ADJUSTMENT(streaming_size_adj), 8, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
306 gtk_widget_set_usize(streaming_size_spin, 60, -1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
307 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_spin,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
308 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
309
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
310 streaming_pre_box = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
311 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_pre_box,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
312 TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
313 streaming_pre_label = gtk_label_new(_("Pre-buffer (percent):"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
314 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
315 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
316 streaming_pre_adj =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
317 gtk_adjustment_new(vorbis_cfg.http_prebuffer, 0, 90, 1, 1, 1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
318 streaming_pre_spin =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
319 gtk_spin_button_new(GTK_ADJUSTMENT(streaming_pre_adj), 1, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
320 gtk_widget_set_usize(streaming_pre_spin, 60, -1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
321 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_spin,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
322 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
323
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
324 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
325 * Proxy config.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
326 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
327 streaming_proxy_frame = gtk_frame_new(_("Proxy:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
328 gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
329 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_proxy_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
330 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
331
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
332 streaming_proxy_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
333 gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
334 gtk_container_add(GTK_CONTAINER(streaming_proxy_frame),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
335 streaming_proxy_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
336
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
337 streaming_proxy_use = gtk_check_button_new_with_label(_("Use proxy"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
338 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_use),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
339 vorbis_cfg.use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
340 g_signal_connect(G_OBJECT(streaming_proxy_use), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
341 G_CALLBACK(proxy_use_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
342 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_use,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
343 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
344
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
345 streaming_proxy_hbox = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
346 gtk_widget_set_sensitive(streaming_proxy_hbox, vorbis_cfg.use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
347 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
348 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
349
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
350 streaming_proxy_host_label = gtk_label_new(_("Host:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
351 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
352 streaming_proxy_host_label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
353
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
354 streaming_proxy_host_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
355 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_host_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
356 vorbis_cfg.proxy_host);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
357 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
358 streaming_proxy_host_entry, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
359
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
360 streaming_proxy_port_label = gtk_label_new(_("Port:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
361 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
362 streaming_proxy_port_label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
363
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
364 streaming_proxy_port_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
365 gtk_widget_set_usize(streaming_proxy_port_entry, 50, -1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
366 temp = g_strdup_printf("%d", vorbis_cfg.proxy_port);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
367 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_port_entry), temp);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
368 g_free(temp);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
369 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
370 streaming_proxy_port_entry, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
371
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
372 streaming_proxy_auth_use =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
373 gtk_check_button_new_with_label(_("Use authentication"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
374 gtk_widget_set_sensitive(streaming_proxy_auth_use, vorbis_cfg.use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
375 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
376 (streaming_proxy_auth_use),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
377 vorbis_cfg.proxy_use_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
378 g_signal_connect(G_OBJECT(streaming_proxy_auth_use), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
379 G_CALLBACK(proxy_auth_use_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
380 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
381 streaming_proxy_auth_use, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
382
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
383 streaming_proxy_auth_hbox = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
384 gtk_widget_set_sensitive(streaming_proxy_auth_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
385 vorbis_cfg.use_proxy
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
386 && vorbis_cfg.proxy_use_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
387 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
388 streaming_proxy_auth_hbox, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
389
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
390 streaming_proxy_auth_user_label = gtk_label_new(_("Username:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
391 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
392 streaming_proxy_auth_user_label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
393
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
394 streaming_proxy_auth_user_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
395 if (vorbis_cfg.proxy_user)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
396 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_user_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
397 vorbis_cfg.proxy_user);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
398 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
399 streaming_proxy_auth_user_entry, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
400
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
401 streaming_proxy_auth_pass_label = gtk_label_new(_("Password:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
402 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
403 streaming_proxy_auth_pass_label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
404
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
405 streaming_proxy_auth_pass_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
406 if (vorbis_cfg.proxy_pass)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
407 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_pass_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
408 vorbis_cfg.proxy_pass);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
409 gtk_entry_set_visibility(GTK_ENTRY(streaming_proxy_auth_pass_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
410 FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
411 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
412 streaming_proxy_auth_pass_entry, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
413
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
414
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
415 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
416 * Save to disk config.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
417 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
418 streaming_save_frame = gtk_frame_new(_("Save stream to disk:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
419 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
420 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_save_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
421 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
422
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
423 streaming_save_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
424 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
425 gtk_container_add(GTK_CONTAINER(streaming_save_frame),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
426 streaming_save_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
427
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
428 streaming_save_use =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
429 gtk_check_button_new_with_label(_("Save stream to disk"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
430 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
431 vorbis_cfg.save_http_stream);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
432 g_signal_connect(G_OBJECT(streaming_save_use), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
433 G_CALLBACK(streaming_save_use_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
434 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
435 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
436
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
437 streaming_save_hbox = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
438 gtk_widget_set_sensitive(streaming_save_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
439 vorbis_cfg.save_http_stream);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
440 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
441 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
442
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
443 streaming_save_label = gtk_label_new(_("Path:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
444 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
445 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
446
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
447 streaming_save_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
448 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
449 vorbis_cfg.save_http_path);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
450 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_entry,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
451 TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
452
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
453 streaming_save_browse = gtk_button_new_with_label(_("Browse"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
454 g_signal_connect(G_OBJECT(streaming_save_browse), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
455 G_CALLBACK(streaming_save_browse_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
456 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
457 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
458
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
459 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), streaming_vbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
460 gtk_label_new(_("Streaming")));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
461
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
462 /* Title config.. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
463
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
464 title_frame = gtk_frame_new(_("Ogg Vorbis Tags:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
465 gtk_container_border_width(GTK_CONTAINER(title_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
466
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
467 title_tag_vbox = gtk_vbox_new(FALSE, 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
468 gtk_container_border_width(GTK_CONTAINER(title_tag_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
469 gtk_container_add(GTK_CONTAINER(title_frame), title_tag_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
470
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
471 title_tag_override =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
472 gtk_check_button_new_with_label(_("Override generic titles"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
473 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_tag_override),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
474 vorbis_cfg.tag_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
475 g_signal_connect(G_OBJECT(title_tag_override), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
476 G_CALLBACK(title_tag_override_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
477 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_tag_override, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
478 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
479
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
480 title_tag_box = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
481 gtk_widget_set_sensitive(title_tag_box, vorbis_cfg.tag_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
482 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_tag_box, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
483 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
484
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
485 title_tag_label = gtk_label_new(_("Title format:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
486 gtk_box_pack_start(GTK_BOX(title_tag_box), title_tag_label, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
487 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
488
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
489 title_tag_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
490 gtk_entry_set_text(GTK_ENTRY(title_tag_entry), vorbis_cfg.tag_format);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
491 gtk_box_pack_start(GTK_BOX(title_tag_box), title_tag_entry, TRUE, TRUE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
492 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
493
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
494 title_desc = xmms_titlestring_descriptions("pafFetndgc", 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
495 gtk_widget_set_sensitive(title_desc, vorbis_cfg.tag_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
496 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_desc, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
497
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
498 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), title_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
499 gtk_label_new(_("Title")));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
500
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
501 /* Replay Gain.. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
502
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
503 rg_frame = gtk_frame_new(_("ReplayGain Settings:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
504 gtk_container_border_width(GTK_CONTAINER(rg_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
505
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
506 rg_vbox = gtk_vbox_new(FALSE, 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
507 gtk_container_border_width(GTK_CONTAINER(rg_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
508 gtk_container_add(GTK_CONTAINER(rg_frame), rg_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
509
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
510 rg_clip_switch =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
511 gtk_check_button_new_with_label(_("Enable Clipping Prevention"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
512 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_clip_switch),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
513 vorbis_cfg.use_anticlip);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
514 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_clip_switch, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
515
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
516 rg_switch = gtk_check_button_new_with_label(_("Enable ReplayGain"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
517 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_switch),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
518 vorbis_cfg.use_replaygain);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
519 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_switch, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
520
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
521 rg_type_frame = gtk_frame_new(_("ReplayGain Type:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
522 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_type_frame, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
523
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
524 g_signal_connect(G_OBJECT(rg_switch), "toggled",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
525 G_CALLBACK(rg_switch_cb), rg_type_frame);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
526
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
527 rg_type_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
528 gtk_container_set_border_width(GTK_CONTAINER(rg_type_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
529 gtk_container_add(GTK_CONTAINER(rg_type_frame), rg_type_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
530
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
531 rg_track_gain =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
532 gtk_radio_button_new_with_label(NULL, _("use Track Gain/Peak"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
533 if (vorbis_cfg.replaygain_mode == REPLAYGAIN_MODE_TRACK)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
534 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_track_gain), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
535 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
536 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_track_gain), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
537 gtk_box_pack_start(GTK_BOX(rg_type_vbox), rg_track_gain, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
538
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
539 rg_album_gain =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
540 gtk_radio_button_new_with_label(gtk_radio_button_group
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
541 (GTK_RADIO_BUTTON(rg_track_gain)),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
542 _("use Album Gain/Peak"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
543 if (vorbis_cfg.replaygain_mode == REPLAYGAIN_MODE_ALBUM)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
544 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_album_gain), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
545 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
546 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_album_gain), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
547 gtk_box_pack_start(GTK_BOX(rg_type_vbox), rg_album_gain, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
548
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
549 if (!vorbis_cfg.use_replaygain)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
550 gtk_widget_set_sensitive(rg_type_frame, FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
551
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
552 rg_booster_switch =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
553 gtk_check_button_new_with_label(_
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
554 ("Enable 6dB Boost + Hard Limiting"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
555 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_booster_switch),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
556 vorbis_cfg.use_booster);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
557 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_booster_switch, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
558
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
559 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), rg_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
560 gtk_label_new(_("ReplayGain")));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
561
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
562 /* Buttons */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
563
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
564 bbox = gtk_hbutton_box_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
565 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
566 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
567 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
568
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
569 cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
570 gtk_button_set_use_stock(GTK_BUTTON(cancel), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
571 g_signal_connect_swapped(G_OBJECT(cancel), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
572 G_CALLBACK(gtk_widget_destroy),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
573 G_OBJECT(vorbis_configurewin));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
574 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
575 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
576
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
577 ok = gtk_button_new_from_stock(GTK_STOCK_OK);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
578 gtk_button_set_use_stock(GTK_BUTTON(ok), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
579 g_signal_connect(G_OBJECT(ok), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
580 G_CALLBACK(vorbis_configurewin_ok), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
581 GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
582 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
583 gtk_widget_grab_default(ok);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
584
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
585 gtk_widget_show_all(vorbis_configurewin);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
586 }