Mercurial > audlegacy-plugins
comparison src/Input/mpg123/configure.c @ 0:13389e613d67 trunk
[svn] - initial import of audacious-plugins tree (lots to do)
author | nenolod |
---|---|
date | Mon, 18 Sep 2006 01:11:49 -0700 |
parents | |
children | 0ad4849f6219 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13389e613d67 |
---|---|
1 | |
2 #include "mpg123.h" | |
3 | |
4 #include <glib.h> | |
5 #include <glib/gi18n.h> | |
6 #include <gtk/gtk.h> | |
7 #include <stdlib.h> | |
8 #include <string.h> | |
9 #include <math.h> | |
10 | |
11 #include <libaudacious/configdb.h> | |
12 #include <libaudacious/dirbrowser.h> | |
13 #include <libaudacious/titlestring.h> | |
14 | |
15 | |
16 static GtkWidget *mpgdec_configurewin = NULL; | |
17 static GtkWidget *vbox, *notebook; | |
18 static GtkWidget *decode_vbox, *decode_hbox1; | |
19 static GtkWidget *decode_res_frame, *decode_res_vbox, *decode_res_16, | |
20 *decode_res_8; | |
21 static GtkWidget *decode_ch_frame, *decode_ch_vbox, *decode_ch_stereo, | |
22 *decode_ch_mono; | |
23 static GtkWidget *decode_freq_frame, *decode_freq_vbox, *decode_freq_1to1, | |
24 *decode_freq_1to2, *decode_freq_1to4; | |
25 | |
26 static GtkObject *streaming_size_adj, *streaming_pre_adj; | |
27 static GtkWidget *streaming_save_use, *streaming_save_entry; | |
28 static GtkWidget *streaming_udp_title; | |
29 static GtkWidget *streaming_save_dirbrowser; | |
30 static GtkWidget *streaming_save_hbox, *title_id3_box, *title_tag_desc; | |
31 static GtkWidget *title_override, *title_id3_entry, *title_id3v2_disable; | |
32 | |
33 MPG123Config mpgdec_cfg; | |
34 | |
35 static void | |
36 mpgdec_configurewin_ok(GtkWidget * widget, gpointer data) | |
37 { | |
38 ConfigDb *db; | |
39 | |
40 if (GTK_TOGGLE_BUTTON(decode_res_16)->active) | |
41 mpgdec_cfg.resolution = 16; | |
42 else if (GTK_TOGGLE_BUTTON(decode_res_8)->active) | |
43 mpgdec_cfg.resolution = 8; | |
44 | |
45 if (GTK_TOGGLE_BUTTON(decode_ch_stereo)->active) | |
46 mpgdec_cfg.channels = 2; | |
47 else if (GTK_TOGGLE_BUTTON(decode_ch_mono)->active) | |
48 mpgdec_cfg.channels = 1; | |
49 | |
50 if (GTK_TOGGLE_BUTTON(decode_freq_1to1)->active) | |
51 mpgdec_cfg.downsample = 0; | |
52 else if (GTK_TOGGLE_BUTTON(decode_freq_1to2)->active) | |
53 mpgdec_cfg.downsample = 1; | |
54 if (GTK_TOGGLE_BUTTON(decode_freq_1to4)->active) | |
55 mpgdec_cfg.downsample = 2; | |
56 | |
57 mpgdec_cfg.http_buffer_size = | |
58 (gint) GTK_ADJUSTMENT(streaming_size_adj)->value; | |
59 mpgdec_cfg.http_prebuffer = | |
60 (gint) GTK_ADJUSTMENT(streaming_pre_adj)->value; | |
61 | |
62 mpgdec_cfg.save_http_stream = | |
63 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use)); | |
64 if (mpgdec_cfg.save_http_path) | |
65 g_free(mpgdec_cfg.save_http_path); | |
66 mpgdec_cfg.save_http_path = | |
67 g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_save_entry))); | |
68 | |
69 mpgdec_cfg.use_udp_channel = | |
70 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_udp_title)); | |
71 | |
72 mpgdec_cfg.title_override = | |
73 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override)); | |
74 mpgdec_cfg.disable_id3v2 = | |
75 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_id3v2_disable)); | |
76 g_free(mpgdec_cfg.id3_format); | |
77 mpgdec_cfg.id3_format = | |
78 g_strdup(gtk_entry_get_text(GTK_ENTRY(title_id3_entry))); | |
79 | |
80 db = bmp_cfg_db_open(); | |
81 bmp_cfg_db_set_int(db, "MPG123", "resolution", mpgdec_cfg.resolution); | |
82 bmp_cfg_db_set_int(db, "MPG123", "channels", mpgdec_cfg.channels); | |
83 bmp_cfg_db_set_int(db, "MPG123", "downsample", mpgdec_cfg.downsample); | |
84 bmp_cfg_db_set_int(db, "MPG123", "http_buffer_size", | |
85 mpgdec_cfg.http_buffer_size); | |
86 bmp_cfg_db_set_int(db, "MPG123", "http_prebuffer", | |
87 mpgdec_cfg.http_prebuffer); | |
88 bmp_cfg_db_set_bool(db, "MPG123", "save_http_stream", | |
89 mpgdec_cfg.save_http_stream); | |
90 bmp_cfg_db_set_string(db, "MPG123", "save_http_path", | |
91 mpgdec_cfg.save_http_path); | |
92 bmp_cfg_db_set_bool(db, "MPG123", "use_udp_channel", | |
93 mpgdec_cfg.use_udp_channel); | |
94 bmp_cfg_db_set_bool(db, "MPG123", "title_override", | |
95 mpgdec_cfg.title_override); | |
96 bmp_cfg_db_set_bool(db, "MPG123", "disable_id3v2", | |
97 mpgdec_cfg.disable_id3v2); | |
98 bmp_cfg_db_set_string(db, "MPG123", "id3_format", mpgdec_cfg.id3_format); | |
99 | |
100 bmp_cfg_db_close(db); | |
101 gtk_widget_destroy(mpgdec_configurewin); | |
102 } | |
103 | |
104 static void | |
105 streaming_save_dirbrowser_cb(gchar * dir) | |
106 { | |
107 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), dir); | |
108 } | |
109 | |
110 static void | |
111 streaming_save_browse_cb(GtkWidget * w, gpointer data) | |
112 { | |
113 if (!streaming_save_dirbrowser) { | |
114 streaming_save_dirbrowser = | |
115 xmms_create_dir_browser(_ | |
116 ("Select the directory where you want to store the MPEG streams:"), | |
117 mpgdec_cfg.save_http_path, | |
118 GTK_SELECTION_SINGLE, | |
119 streaming_save_dirbrowser_cb); | |
120 g_signal_connect(G_OBJECT(streaming_save_dirbrowser), "destroy", | |
121 G_CALLBACK(gtk_widget_destroyed), | |
122 &streaming_save_dirbrowser); | |
123 gtk_window_set_transient_for(GTK_WINDOW(streaming_save_dirbrowser), | |
124 GTK_WINDOW(mpgdec_configurewin)); | |
125 gtk_widget_show(streaming_save_dirbrowser); | |
126 } | |
127 } | |
128 | |
129 static void | |
130 streaming_save_use_cb(GtkWidget * w, gpointer data) | |
131 { | |
132 gboolean save_stream; | |
133 | |
134 save_stream = | |
135 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use)); | |
136 | |
137 gtk_widget_set_sensitive(streaming_save_hbox, save_stream); | |
138 } | |
139 | |
140 static void | |
141 title_override_cb(GtkWidget * w, gpointer data) | |
142 { | |
143 gboolean override; | |
144 override = | |
145 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override)); | |
146 gtk_widget_set_sensitive(title_id3_box, override); | |
147 gtk_widget_set_sensitive(title_tag_desc, override); | |
148 } | |
149 | |
150 static void | |
151 configure_destroy(GtkWidget * w, gpointer data) | |
152 { | |
153 if (streaming_save_dirbrowser) | |
154 gtk_widget_destroy(streaming_save_dirbrowser); | |
155 } | |
156 | |
157 void | |
158 mpgdec_configure(void) | |
159 { | |
160 GtkWidget *streaming_vbox; | |
161 GtkWidget *streaming_buf_frame, *streaming_buf_hbox; | |
162 GtkWidget *streaming_size_box, *streaming_size_label, | |
163 *streaming_size_spin; | |
164 GtkWidget *streaming_pre_box, *streaming_pre_label, *streaming_pre_spin; | |
165 GtkWidget *streaming_save_frame, *streaming_save_vbox; | |
166 GtkWidget *streaming_save_label, *streaming_save_browse; | |
167 GtkWidget *streaming_cast_frame, *streaming_cast_vbox; | |
168 GtkWidget *title_frame, *title_id3_vbox, *title_id3_label; | |
169 GtkWidget *bbox, *ok, *cancel; | |
170 | |
171 if (mpgdec_configurewin != NULL) { | |
172 gtk_window_present(GTK_WINDOW(mpgdec_configurewin)); | |
173 return; | |
174 } | |
175 mpgdec_configurewin = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
176 gtk_window_set_type_hint(GTK_WINDOW(mpgdec_configurewin), | |
177 GDK_WINDOW_TYPE_HINT_DIALOG); | |
178 gtk_window_set_position(GTK_WINDOW(mpgdec_configurewin), | |
179 GTK_WIN_POS_CENTER); | |
180 g_signal_connect(G_OBJECT(mpgdec_configurewin), "destroy", | |
181 G_CALLBACK(gtk_widget_destroyed), &mpgdec_configurewin); | |
182 g_signal_connect(G_OBJECT(mpgdec_configurewin), "destroy", | |
183 G_CALLBACK(configure_destroy), &mpgdec_configurewin); | |
184 gtk_window_set_title(GTK_WINDOW(mpgdec_configurewin), | |
185 _("MPEG Audio Plugin Configuration")); | |
186 gtk_window_set_resizable(GTK_WINDOW(mpgdec_configurewin), FALSE); | |
187 /* gtk_window_set_position(GTK_WINDOW(mpgdec_configurewin), GTK_WIN_POS_MOUSE); */ | |
188 gtk_container_border_width(GTK_CONTAINER(mpgdec_configurewin), 10); | |
189 | |
190 vbox = gtk_vbox_new(FALSE, 10); | |
191 gtk_container_add(GTK_CONTAINER(mpgdec_configurewin), vbox); | |
192 | |
193 notebook = gtk_notebook_new(); | |
194 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0); | |
195 | |
196 decode_vbox = gtk_vbox_new(FALSE, 5); | |
197 gtk_container_set_border_width(GTK_CONTAINER(decode_vbox), 5); | |
198 | |
199 decode_hbox1 = gtk_hbox_new(TRUE, 5); | |
200 gtk_box_pack_start(GTK_BOX(decode_vbox), decode_hbox1, FALSE, FALSE, 0); | |
201 | |
202 decode_res_frame = gtk_frame_new(_("Resolution:")); | |
203 gtk_box_pack_start(GTK_BOX(decode_hbox1), decode_res_frame, TRUE, TRUE, | |
204 0); | |
205 | |
206 decode_res_vbox = gtk_vbox_new(FALSE, 5); | |
207 gtk_container_set_border_width(GTK_CONTAINER(decode_res_vbox), 5); | |
208 gtk_container_add(GTK_CONTAINER(decode_res_frame), decode_res_vbox); | |
209 | |
210 decode_res_16 = gtk_radio_button_new_with_label(NULL, _("16 bit")); | |
211 if (mpgdec_cfg.resolution == 16) | |
212 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_res_16), TRUE); | |
213 gtk_box_pack_start(GTK_BOX(decode_res_vbox), decode_res_16, FALSE, | |
214 FALSE, 0); | |
215 | |
216 decode_res_8 = | |
217 gtk_radio_button_new_with_label(gtk_radio_button_group | |
218 (GTK_RADIO_BUTTON(decode_res_16)), | |
219 _("8 bit")); | |
220 if (mpgdec_cfg.resolution == 8) | |
221 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_res_8), TRUE); | |
222 | |
223 gtk_box_pack_start(GTK_BOX(decode_res_vbox), decode_res_8, FALSE, | |
224 FALSE, 0); | |
225 | |
226 decode_ch_frame = gtk_frame_new(_("Channels:")); | |
227 gtk_box_pack_start(GTK_BOX(decode_hbox1), decode_ch_frame, TRUE, TRUE, 0); | |
228 | |
229 decode_ch_vbox = gtk_vbox_new(FALSE, 5); | |
230 gtk_container_set_border_width(GTK_CONTAINER(decode_ch_vbox), 5); | |
231 gtk_container_add(GTK_CONTAINER(decode_ch_frame), decode_ch_vbox); | |
232 | |
233 decode_ch_stereo = | |
234 gtk_radio_button_new_with_label(NULL, _("Stereo (if available)")); | |
235 if (mpgdec_cfg.channels == 2) | |
236 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_ch_stereo), | |
237 TRUE); | |
238 | |
239 gtk_box_pack_start(GTK_BOX(decode_ch_vbox), decode_ch_stereo, FALSE, | |
240 FALSE, 0); | |
241 | |
242 decode_ch_mono = | |
243 gtk_radio_button_new_with_label(gtk_radio_button_group | |
244 (GTK_RADIO_BUTTON | |
245 (decode_ch_stereo)), _("Mono")); | |
246 if (mpgdec_cfg.channels == 1) | |
247 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_ch_mono), TRUE); | |
248 | |
249 gtk_box_pack_start(GTK_BOX(decode_ch_vbox), decode_ch_mono, FALSE, | |
250 FALSE, 0); | |
251 | |
252 decode_freq_frame = gtk_frame_new(_("Down sample:")); | |
253 gtk_box_pack_start(GTK_BOX(decode_vbox), decode_freq_frame, FALSE, | |
254 FALSE, 0); | |
255 | |
256 decode_freq_vbox = gtk_vbox_new(FALSE, 5); | |
257 gtk_container_set_border_width(GTK_CONTAINER(decode_freq_vbox), 5); | |
258 gtk_container_add(GTK_CONTAINER(decode_freq_frame), decode_freq_vbox); | |
259 | |
260 decode_freq_1to1 = | |
261 gtk_radio_button_new_with_label(NULL, _("1:1 (44 kHz)")); | |
262 if (mpgdec_cfg.downsample == 0) | |
263 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to1), | |
264 TRUE); | |
265 gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to1, FALSE, | |
266 FALSE, 0); | |
267 | |
268 decode_freq_1to2 = | |
269 gtk_radio_button_new_with_label(gtk_radio_button_group | |
270 (GTK_RADIO_BUTTON | |
271 (decode_freq_1to1)), | |
272 _("1:2 (22 kHz)")); | |
273 if (mpgdec_cfg.downsample == 1) | |
274 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to2), | |
275 TRUE); | |
276 gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to2, FALSE, | |
277 FALSE, 0); | |
278 | |
279 decode_freq_1to4 = | |
280 gtk_radio_button_new_with_label(gtk_radio_button_group | |
281 (GTK_RADIO_BUTTON | |
282 (decode_freq_1to1)), | |
283 _("1:4 (11 kHz)")); | |
284 if (mpgdec_cfg.downsample == 2) | |
285 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to4), | |
286 TRUE); | |
287 | |
288 gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to4, FALSE, | |
289 FALSE, 0); | |
290 | |
291 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), decode_vbox, | |
292 gtk_label_new(_("Decoder"))); | |
293 | |
294 streaming_vbox = gtk_vbox_new(FALSE, 0); | |
295 | |
296 streaming_buf_frame = gtk_frame_new(_("Buffering:")); | |
297 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_frame), 5); | |
298 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_buf_frame, FALSE, | |
299 FALSE, 0); | |
300 | |
301 streaming_buf_hbox = gtk_hbox_new(TRUE, 5); | |
302 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_hbox), 5); | |
303 gtk_container_add(GTK_CONTAINER(streaming_buf_frame), streaming_buf_hbox); | |
304 | |
305 streaming_size_box = gtk_hbox_new(FALSE, 5); | |
306 /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_size_box,0,1,0,1); */ | |
307 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_size_box, | |
308 TRUE, TRUE, 0); | |
309 streaming_size_label = gtk_label_new(_("Buffer size (kb):")); | |
310 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_label, | |
311 FALSE, FALSE, 0); | |
312 streaming_size_adj = | |
313 gtk_adjustment_new(mpgdec_cfg.http_buffer_size, 4, 4096, 4, 4, 4); | |
314 streaming_size_spin = | |
315 gtk_spin_button_new(GTK_ADJUSTMENT(streaming_size_adj), 8, 0); | |
316 gtk_widget_set_usize(streaming_size_spin, 60, -1); | |
317 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_spin, | |
318 FALSE, FALSE, 0); | |
319 | |
320 streaming_pre_box = gtk_hbox_new(FALSE, 5); | |
321 /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_pre_box,1,2,0,1); */ | |
322 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_pre_box, | |
323 TRUE, TRUE, 0); | |
324 streaming_pre_label = gtk_label_new(_("Pre-buffer (percent):")); | |
325 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_label, | |
326 FALSE, FALSE, 0); | |
327 streaming_pre_adj = | |
328 gtk_adjustment_new(mpgdec_cfg.http_prebuffer, 0, 90, 1, 1, 1); | |
329 streaming_pre_spin = | |
330 gtk_spin_button_new(GTK_ADJUSTMENT(streaming_pre_adj), 1, 0); | |
331 gtk_widget_set_usize(streaming_pre_spin, 60, -1); | |
332 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_spin, | |
333 FALSE, FALSE, 0); | |
334 | |
335 /* | |
336 * Save to disk config. | |
337 */ | |
338 streaming_save_frame = gtk_frame_new(_("Save stream to disk:")); | |
339 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_frame), 5); | |
340 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_save_frame, | |
341 FALSE, FALSE, 0); | |
342 | |
343 streaming_save_vbox = gtk_vbox_new(FALSE, 5); | |
344 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_vbox), 5); | |
345 gtk_container_add(GTK_CONTAINER(streaming_save_frame), | |
346 streaming_save_vbox); | |
347 | |
348 streaming_save_use = | |
349 gtk_check_button_new_with_label(_("Save stream to disk")); | |
350 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use), | |
351 mpgdec_cfg.save_http_stream); | |
352 g_signal_connect(G_OBJECT(streaming_save_use), "clicked", | |
353 G_CALLBACK(streaming_save_use_cb), NULL); | |
354 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use, | |
355 FALSE, FALSE, 0); | |
356 | |
357 streaming_save_hbox = gtk_hbox_new(FALSE, 5); | |
358 gtk_widget_set_sensitive(streaming_save_hbox, | |
359 mpgdec_cfg.save_http_stream); | |
360 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_hbox, | |
361 FALSE, FALSE, 0); | |
362 | |
363 streaming_save_label = gtk_label_new(_("Path:")); | |
364 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_label, | |
365 FALSE, FALSE, 0); | |
366 | |
367 streaming_save_entry = gtk_entry_new(); | |
368 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), | |
369 mpgdec_cfg.save_http_path); | |
370 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_entry, | |
371 TRUE, TRUE, 0); | |
372 | |
373 streaming_save_browse = gtk_button_new_with_label(_("Browse")); | |
374 g_signal_connect(G_OBJECT(streaming_save_browse), "clicked", | |
375 G_CALLBACK(streaming_save_browse_cb), NULL); | |
376 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse, | |
377 FALSE, FALSE, 0); | |
378 | |
379 streaming_cast_frame = gtk_frame_new(_("SHOUT/Icecast:")); | |
380 gtk_container_set_border_width(GTK_CONTAINER(streaming_cast_frame), 5); | |
381 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_cast_frame, | |
382 FALSE, FALSE, 0); | |
383 | |
384 streaming_cast_vbox = gtk_vbox_new(5, FALSE); | |
385 gtk_container_add(GTK_CONTAINER(streaming_cast_frame), | |
386 streaming_cast_vbox); | |
387 | |
388 streaming_udp_title = | |
389 gtk_check_button_new_with_label(_ | |
390 ("Enable Icecast Metadata UDP Channel")); | |
391 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_udp_title), | |
392 mpgdec_cfg.use_udp_channel); | |
393 gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_udp_title, | |
394 FALSE, FALSE, 0); | |
395 | |
396 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), streaming_vbox, | |
397 gtk_label_new(_("Streaming"))); | |
398 | |
399 title_frame = gtk_frame_new(_("ID3 Tags:")); | |
400 gtk_container_border_width(GTK_CONTAINER(title_frame), 5); | |
401 | |
402 title_id3_vbox = gtk_vbox_new(FALSE, 10); | |
403 gtk_container_border_width(GTK_CONTAINER(title_id3_vbox), 5); | |
404 gtk_container_add(GTK_CONTAINER(title_frame), title_id3_vbox); | |
405 | |
406 title_id3v2_disable = | |
407 gtk_check_button_new_with_label(_("Disable ID3V2 tags")); | |
408 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_id3v2_disable), | |
409 mpgdec_cfg.disable_id3v2); | |
410 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3v2_disable, FALSE, | |
411 FALSE, 0); | |
412 | |
413 title_override = | |
414 gtk_check_button_new_with_label(_("Override generic titles")); | |
415 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_override), | |
416 mpgdec_cfg.title_override); | |
417 g_signal_connect(G_OBJECT(title_override), "clicked", | |
418 G_CALLBACK(title_override_cb), NULL); | |
419 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_override, FALSE, | |
420 FALSE, 0); | |
421 | |
422 title_id3_box = gtk_hbox_new(FALSE, 5); | |
423 gtk_widget_set_sensitive(title_id3_box, mpgdec_cfg.title_override); | |
424 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3_box, FALSE, | |
425 FALSE, 0); | |
426 | |
427 title_id3_label = gtk_label_new(_("ID3 format:")); | |
428 gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_label, FALSE, | |
429 FALSE, 0); | |
430 | |
431 title_id3_entry = gtk_entry_new(); | |
432 gtk_entry_set_text(GTK_ENTRY(title_id3_entry), mpgdec_cfg.id3_format); | |
433 gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_entry, TRUE, TRUE, | |
434 0); | |
435 | |
436 title_tag_desc = xmms_titlestring_descriptions("pafFetnygc", 2); | |
437 gtk_widget_set_sensitive(title_tag_desc, mpgdec_cfg.title_override); | |
438 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_tag_desc, FALSE, | |
439 FALSE, 0); | |
440 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), title_frame, | |
441 gtk_label_new(_("Title"))); | |
442 | |
443 bbox = gtk_hbutton_box_new(); | |
444 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
445 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); | |
446 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); | |
447 | |
448 cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL); | |
449 g_signal_connect_swapped(G_OBJECT(cancel), "clicked", | |
450 G_CALLBACK(gtk_widget_destroy), | |
451 GTK_OBJECT(mpgdec_configurewin)); | |
452 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); | |
453 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); | |
454 | |
455 | |
456 ok = gtk_button_new_from_stock(GTK_STOCK_OK); | |
457 g_signal_connect(G_OBJECT(ok), "clicked", | |
458 G_CALLBACK(mpgdec_configurewin_ok), NULL); | |
459 GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT); | |
460 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0); | |
461 gtk_widget_grab_default(ok); | |
462 | |
463 gtk_widget_show_all(mpgdec_configurewin); | |
464 } |