1 /* libxmms-flac - XMMS FLAC input plugin
2 * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Daisuke Shimamura
4 * Based on mpg123 plugin
5 * and prefs.c - 2000/05/06
6 * EasyTAG - Tag editor for MP3 and OGG files
7 * Copyright (C) 2000-2002 Jerome Couderc <j.couderc@ifrance.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 #include <xmms/configfile.h>
34 #include <xmms/dirbrowser.h>
35 #include <xmms/titlestring.h>
36 #include <xmms/util.h>
37 #include <xmms/plugin.h>
39 #include "share/replaygain_synthesis.h" /* for NOISE_SHAPING_LOW */
41 #include "configure.h"
42 #include "locale_hack.h"
45 * Initialize Global Valueable
47 flac_config_t flac_cfg = {
50 FALSE, /* tag_override */
51 NULL, /* tag_format */
52 FALSE, /* convert_char_set */
53 NULL /* user_char_set */
57 100 /* KB */, /* http_buffer_size */
58 50, /* http_prebuffer */
59 FALSE, /* use_proxy */
60 NULL, /* proxy_host */
62 FALSE, /* proxy_use_auth */
63 NULL, /* proxy_user */
64 NULL, /* proxy_pass */
65 FALSE, /* save_http_stream */
66 NULL, /* save_http_path */
67 FALSE, /* cast_title_streaming */
68 FALSE /* use_udp_channel */
75 TRUE, /* album_mode */
77 FALSE /* hard_limit */
83 TRUE /* dither_24_to_16 */
88 NOISE_SHAPING_LOW, /* noise_shaping */
96 static GtkWidget *flac_configurewin = NULL;
97 static GtkWidget *vbox, *notebook;
99 static GtkWidget *title_tag_override, *title_tag_box, *title_tag_entry, *title_desc;
100 static GtkWidget *convert_char_set, *fileCharacterSetEntry, *userCharacterSetEntry;
101 static GtkWidget *replaygain_enable, *replaygain_album_mode;
102 static GtkWidget *replaygain_preamp_hscale, *replaygain_preamp_label, *replaygain_hard_limit;
103 static GtkObject *replaygain_preamp;
104 static GtkWidget *resolution_normal_dither_24_to_16;
105 static GtkWidget *resolution_replaygain_dither;
106 static GtkWidget *resolution_replaygain_noise_shaping_frame;
107 static GtkWidget *resolution_replaygain_noise_shaping_radio_none;
108 static GtkWidget *resolution_replaygain_noise_shaping_radio_low;
109 static GtkWidget *resolution_replaygain_noise_shaping_radio_medium;
110 static GtkWidget *resolution_replaygain_noise_shaping_radio_high;
111 static GtkWidget *resolution_replaygain_bps_out_frame;
112 static GtkWidget *resolution_replaygain_bps_out_radio_16bps;
113 static GtkWidget *resolution_replaygain_bps_out_radio_24bps;
115 static GtkObject *streaming_size_adj, *streaming_pre_adj;
116 static GtkWidget *streaming_proxy_use, *streaming_proxy_host_entry;
117 static GtkWidget *streaming_proxy_port_entry, *streaming_save_use, *streaming_save_entry;
118 static GtkWidget *streaming_proxy_auth_use;
119 static GtkWidget *streaming_proxy_auth_pass_entry, *streaming_proxy_auth_user_entry;
120 static GtkWidget *streaming_proxy_auth_user_label, *streaming_proxy_auth_pass_label;
122 static GtkWidget *streaming_cast_title, *streaming_udp_title;
124 static GtkWidget *streaming_proxy_hbox, *streaming_proxy_auth_hbox, *streaming_save_dirbrowser;
125 static GtkWidget *streaming_save_hbox;
127 static gchar *gtk_entry_get_text_1 (GtkWidget *widget);
128 static void flac_configurewin_ok(GtkWidget * widget, gpointer data);
129 static void configure_destroy(GtkWidget * w, gpointer data);
131 static void flac_configurewin_ok(GtkWidget * widget, gpointer data)
136 (void)widget, (void)data; /* unused arguments */
137 g_free(flac_cfg.title.tag_format);
138 flac_cfg.title.tag_format = g_strdup(gtk_entry_get_text(GTK_ENTRY(title_tag_entry)));
139 flac_cfg.title.user_char_set = Charset_Get_Name_From_Title(gtk_entry_get_text_1(userCharacterSetEntry));
141 filename = g_strconcat(g_get_home_dir(), "/.xmms/config", NULL);
142 cfg = xmms_cfg_open_file(filename);
144 cfg = xmms_cfg_new();
146 xmms_cfg_write_boolean(cfg, "flac", "title.tag_override", flac_cfg.title.tag_override);
147 xmms_cfg_write_string(cfg, "flac", "title.tag_format", flac_cfg.title.tag_format);
148 xmms_cfg_write_boolean(cfg, "flac", "title.convert_char_set", flac_cfg.title.convert_char_set);
149 xmms_cfg_write_string(cfg, "flac", "title.user_char_set", flac_cfg.title.user_char_set);
151 xmms_cfg_write_boolean(cfg, "flac", "output.replaygain.enable", flac_cfg.output.replaygain.enable);
152 xmms_cfg_write_boolean(cfg, "flac", "output.replaygain.album_mode", flac_cfg.output.replaygain.album_mode);
153 xmms_cfg_write_int(cfg, "flac", "output.replaygain.preamp", flac_cfg.output.replaygain.preamp);
154 xmms_cfg_write_boolean(cfg, "flac", "output.replaygain.hard_limit", flac_cfg.output.replaygain.hard_limit);
155 xmms_cfg_write_boolean(cfg, "flac", "output.resolution.normal.dither_24_to_16", flac_cfg.output.resolution.normal.dither_24_to_16);
156 xmms_cfg_write_boolean(cfg, "flac", "output.resolution.replaygain.dither", flac_cfg.output.resolution.replaygain.dither);
157 xmms_cfg_write_int(cfg, "flac", "output.resolution.replaygain.noise_shaping", flac_cfg.output.resolution.replaygain.noise_shaping);
158 xmms_cfg_write_int(cfg, "flac", "output.resolution.replaygain.bps_out", flac_cfg.output.resolution.replaygain.bps_out);
160 flac_cfg.stream.http_buffer_size = (gint) GTK_ADJUSTMENT(streaming_size_adj)->value;
161 flac_cfg.stream.http_prebuffer = (gint) GTK_ADJUSTMENT(streaming_pre_adj)->value;
163 flac_cfg.stream.use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
164 if(flac_cfg.stream.proxy_host)
165 g_free(flac_cfg.stream.proxy_host);
166 flac_cfg.stream.proxy_host = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_host_entry)));
167 flac_cfg.stream.proxy_port = atoi(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_port_entry)));
169 flac_cfg.stream.proxy_use_auth = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use));
171 if(flac_cfg.stream.proxy_user)
172 g_free(flac_cfg.stream.proxy_user);
173 flac_cfg.stream.proxy_user = NULL;
174 if(strlen(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_user_entry))) > 0)
175 flac_cfg.stream.proxy_user = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_user_entry)));
177 if(flac_cfg.stream.proxy_pass)
178 g_free(flac_cfg.stream.proxy_pass);
179 flac_cfg.stream.proxy_pass = NULL;
180 if(strlen(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_pass_entry))) > 0)
181 flac_cfg.stream.proxy_pass = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_pass_entry)));
184 flac_cfg.stream.save_http_stream = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use));
185 if (flac_cfg.stream.save_http_path)
186 g_free(flac_cfg.stream.save_http_path);
187 flac_cfg.stream.save_http_path = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_save_entry)));
190 flac_cfg.stream.cast_title_streaming = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_cast_title));
191 flac_cfg.stream.use_udp_channel = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_udp_title));
194 xmms_cfg_write_int(cfg, "flac", "stream.http_buffer_size", flac_cfg.stream.http_buffer_size);
195 xmms_cfg_write_int(cfg, "flac", "stream.http_prebuffer", flac_cfg.stream.http_prebuffer);
196 xmms_cfg_write_boolean(cfg, "flac", "stream.use_proxy", flac_cfg.stream.use_proxy);
197 xmms_cfg_write_string(cfg, "flac", "stream.proxy_host", flac_cfg.stream.proxy_host);
198 xmms_cfg_write_int(cfg, "flac", "stream.proxy_port", flac_cfg.stream.proxy_port);
199 xmms_cfg_write_boolean(cfg, "flac", "stream.proxy_use_auth", flac_cfg.stream.proxy_use_auth);
200 if(flac_cfg.stream.proxy_user)
201 xmms_cfg_write_string(cfg, "flac", "stream.proxy_user", flac_cfg.stream.proxy_user);
203 xmms_cfg_remove_key(cfg, "flac", "stream.proxy_user");
204 if(flac_cfg.stream.proxy_pass)
205 xmms_cfg_write_string(cfg, "flac", "stream.proxy_pass", flac_cfg.stream.proxy_pass);
207 xmms_cfg_remove_key(cfg, "flac", "stream.proxy_pass");
208 xmms_cfg_write_boolean(cfg, "flac", "stream.save_http_stream", flac_cfg.stream.save_http_stream);
209 xmms_cfg_write_string(cfg, "flac", "stream.save_http_path", flac_cfg.stream.save_http_path);
211 xmms_cfg_write_boolean(cfg, "flac", "stream.cast_title_streaming", flac_cfg.stream.cast_title_streaming);
212 xmms_cfg_write_boolean(cfg, "flac", "stream.use_udp_channel", flac_cfg.stream.use_udp_channel);
215 xmms_cfg_write_file(cfg, filename);
218 gtk_widget_destroy(flac_configurewin);
221 static void configure_destroy(GtkWidget *widget, gpointer data)
223 (void)widget, (void)data; /* unused arguments */
226 static void title_tag_override_cb(GtkWidget *widget, gpointer data)
228 (void)widget, (void)data; /* unused arguments */
229 flac_cfg.title.tag_override = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_tag_override));
231 gtk_widget_set_sensitive(title_tag_box, flac_cfg.title.tag_override);
232 gtk_widget_set_sensitive(title_desc, flac_cfg.title.tag_override);
236 static void convert_char_set_cb(GtkWidget *widget, gpointer data)
238 (void)widget, (void)data; /* unused arguments */
239 flac_cfg.title.convert_char_set = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(convert_char_set));
241 gtk_widget_set_sensitive(fileCharacterSetEntry, FALSE);
242 gtk_widget_set_sensitive(userCharacterSetEntry, flac_cfg.title.convert_char_set);
245 static void replaygain_enable_cb(GtkWidget *widget, gpointer data)
247 (void)widget, (void)data; /* unused arguments */
248 flac_cfg.output.replaygain.enable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_enable));
250 gtk_widget_set_sensitive(replaygain_album_mode, flac_cfg.output.replaygain.enable);
251 gtk_widget_set_sensitive(replaygain_preamp_hscale, flac_cfg.output.replaygain.enable);
252 gtk_widget_set_sensitive(replaygain_hard_limit, flac_cfg.output.replaygain.enable);
255 static void replaygain_album_mode_cb(GtkWidget *widget, gpointer data)
257 (void)widget, (void)data; /* unused arguments */
258 flac_cfg.output.replaygain.album_mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_album_mode));
261 static void replaygain_hard_limit_cb(GtkWidget *widget, gpointer data)
263 (void)widget, (void)data; /* unused arguments */
264 flac_cfg.output.replaygain.hard_limit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_hard_limit));
267 static void replaygain_preamp_cb(GtkWidget *widget, gpointer data)
269 GString *gstring = g_string_new("");
270 (void)widget, (void)data; /* unused arguments */
271 flac_cfg.output.replaygain.preamp = (int) floor(GTK_ADJUSTMENT(replaygain_preamp)->value + 0.5);
273 g_string_sprintf(gstring, "%i dB", flac_cfg.output.replaygain.preamp);
274 gtk_label_set_text(GTK_LABEL(replaygain_preamp_label), _(gstring->str));
277 static void resolution_normal_dither_24_to_16_cb(GtkWidget *widget, gpointer data)
279 (void)widget, (void)data; /* unused arguments */
280 flac_cfg.output.resolution.normal.dither_24_to_16 = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_normal_dither_24_to_16));
283 static void resolution_replaygain_dither_cb(GtkWidget *widget, gpointer data)
285 (void)widget, (void)data; /* unused arguments */
286 flac_cfg.output.resolution.replaygain.dither = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_dither));
288 gtk_widget_set_sensitive(resolution_replaygain_noise_shaping_frame, flac_cfg.output.resolution.replaygain.dither);
291 static void resolution_replaygain_noise_shaping_cb(GtkWidget *widget, gpointer data)
293 (void)widget, (void)data; /* unused arguments */
294 flac_cfg.output.resolution.replaygain.noise_shaping =
295 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_none))? 0 :
296 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_low))? 1 :
297 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_medium))? 2 :
298 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_high))? 3 :
303 static void resolution_replaygain_bps_out_cb(GtkWidget *widget, gpointer data)
305 (void)widget, (void)data; /* unused arguments */
306 flac_cfg.output.resolution.replaygain.bps_out =
307 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_16bps))? 16 :
308 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_24bps))? 24 :
313 static void proxy_use_cb(GtkWidget * w, gpointer data)
315 gboolean use_proxy, use_proxy_auth;
319 use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
320 use_proxy_auth = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use));
322 gtk_widget_set_sensitive(streaming_proxy_hbox, use_proxy);
323 gtk_widget_set_sensitive(streaming_proxy_auth_use, use_proxy);
324 gtk_widget_set_sensitive(streaming_proxy_auth_hbox, use_proxy && use_proxy_auth);
327 static void proxy_auth_use_cb(GtkWidget *w, gpointer data)
329 gboolean use_proxy, use_proxy_auth;
333 use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
334 use_proxy_auth = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use));
336 gtk_widget_set_sensitive(streaming_proxy_auth_hbox, use_proxy && use_proxy_auth);
339 static void streaming_save_dirbrowser_cb(gchar * dir)
341 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), dir);
344 static void streaming_save_browse_cb(GtkWidget * w, gpointer data)
348 if (!streaming_save_dirbrowser)
350 streaming_save_dirbrowser = xmms_create_dir_browser(_("Select the directory where you want to store the MPEG streams:"),
351 flac_cfg.stream.save_http_path, GTK_SELECTION_SINGLE, streaming_save_dirbrowser_cb);
352 gtk_signal_connect(GTK_OBJECT(streaming_save_dirbrowser), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &streaming_save_dirbrowser);
353 gtk_window_set_transient_for(GTK_WINDOW(streaming_save_dirbrowser), GTK_WINDOW(flac_configurewin));
354 gtk_widget_show(streaming_save_dirbrowser);
358 static void streaming_save_use_cb(GtkWidget * w, gpointer data)
360 gboolean save_stream;
364 save_stream = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use));
366 gtk_widget_set_sensitive(streaming_save_hbox, save_stream);
370 void FLAC_XMMS__configure(void)
372 GtkWidget *title_frame, *title_tag_vbox, *title_tag_label;
373 GtkWidget *replaygain_frame, *resolution_frame, *output_vbox, *resolution_normal_frame, *resolution_replaygain_frame;
374 GtkWidget *replaygain_vbox, *resolution_hbox, *resolution_normal_vbox, *resolution_replaygain_vbox;
375 GtkWidget *resolution_replaygain_noise_shaping_vbox;
376 GtkWidget *resolution_replaygain_bps_out_vbox;
377 GtkWidget *label, *hbox;
378 GtkWidget *bbox, *ok, *cancel;
381 GtkWidget *streaming_vbox;
382 GtkWidget *streaming_buf_frame, *streaming_buf_hbox;
383 GtkWidget *streaming_size_box, *streaming_size_label, *streaming_size_spin;
384 GtkWidget *streaming_pre_box, *streaming_pre_label, *streaming_pre_spin;
385 GtkWidget *streaming_proxy_frame, *streaming_proxy_vbox;
386 GtkWidget *streaming_proxy_port_label, *streaming_proxy_host_label;
387 GtkWidget *streaming_save_frame, *streaming_save_vbox;
388 GtkWidget *streaming_save_label, *streaming_save_browse;
390 GtkWidget *streaming_cast_frame, *streaming_cast_vbox;
394 if (flac_configurewin != NULL) {
395 gdk_window_raise(flac_configurewin->window);
398 flac_configurewin = gtk_window_new(GTK_WINDOW_DIALOG);
399 gtk_signal_connect(GTK_OBJECT(flac_configurewin), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &flac_configurewin);
400 gtk_signal_connect(GTK_OBJECT(flac_configurewin), "destroy", GTK_SIGNAL_FUNC(configure_destroy), &flac_configurewin);
401 gtk_window_set_title(GTK_WINDOW(flac_configurewin), _("Flac Configuration"));
402 gtk_window_set_policy(GTK_WINDOW(flac_configurewin), FALSE, FALSE, FALSE);
403 gtk_container_border_width(GTK_CONTAINER(flac_configurewin), 10);
405 vbox = gtk_vbox_new(FALSE, 10);
406 gtk_container_add(GTK_CONTAINER(flac_configurewin), vbox);
408 notebook = gtk_notebook_new();
409 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
413 title_frame = gtk_frame_new(_("Tag Handling"));
414 gtk_container_border_width(GTK_CONTAINER(title_frame), 5);
416 title_tag_vbox = gtk_vbox_new(FALSE, 10);
417 gtk_container_border_width(GTK_CONTAINER(title_tag_vbox), 5);
418 gtk_container_add(GTK_CONTAINER(title_frame), title_tag_vbox);
420 /* Convert Char Set */
422 convert_char_set = gtk_check_button_new_with_label(_("Convert Character Set"));
423 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(convert_char_set), flac_cfg.title.convert_char_set);
424 gtk_signal_connect(GTK_OBJECT(convert_char_set), "clicked", convert_char_set_cb, NULL);
425 gtk_box_pack_start(GTK_BOX(title_tag_vbox), convert_char_set, FALSE, FALSE, 0);
427 hbox = gtk_hbox_new(FALSE,4);
428 gtk_container_add(GTK_CONTAINER(title_tag_vbox),hbox);
429 label = gtk_label_new(_("Convert character set from :"));
430 gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0);
431 fileCharacterSetEntry = gtk_combo_new();
432 gtk_box_pack_start(GTK_BOX(hbox),fileCharacterSetEntry,TRUE,TRUE,0);
434 label = gtk_label_new (_("to :"));
435 gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0);
436 userCharacterSetEntry = gtk_combo_new();
437 gtk_box_pack_start(GTK_BOX(hbox),userCharacterSetEntry,TRUE,TRUE,0);
439 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(fileCharacterSetEntry)->entry),FALSE);
440 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(userCharacterSetEntry)->entry),FALSE);
441 gtk_combo_set_value_in_list(GTK_COMBO(fileCharacterSetEntry),TRUE,FALSE);
442 gtk_combo_set_value_in_list(GTK_COMBO(userCharacterSetEntry),TRUE,FALSE);
444 list = Charset_Create_List();
445 gtk_combo_set_popdown_strings(GTK_COMBO(fileCharacterSetEntry),Charset_Create_List_UTF8_Only());
446 gtk_combo_set_popdown_strings(GTK_COMBO(userCharacterSetEntry),list);
447 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(userCharacterSetEntry)->entry),Charset_Get_Title_From_Name(flac_cfg.title.user_char_set));
448 gtk_widget_set_sensitive(fileCharacterSetEntry, FALSE);
449 gtk_widget_set_sensitive(userCharacterSetEntry, flac_cfg.title.convert_char_set);
451 /* Override Tagging Format */
453 title_tag_override = gtk_check_button_new_with_label(_("Override generic titles"));
454 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_tag_override), flac_cfg.title.tag_override);
455 gtk_signal_connect(GTK_OBJECT(title_tag_override), "clicked", title_tag_override_cb, NULL);
456 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_tag_override, FALSE, FALSE, 0);
458 title_tag_box = gtk_hbox_new(FALSE, 5);
459 gtk_widget_set_sensitive(title_tag_box, flac_cfg.title.tag_override);
460 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_tag_box, FALSE, FALSE, 0);
462 title_tag_label = gtk_label_new(_("Title format:"));
463 gtk_box_pack_start(GTK_BOX(title_tag_box), title_tag_label, FALSE, FALSE, 0);
465 title_tag_entry = gtk_entry_new();
466 gtk_entry_set_text(GTK_ENTRY(title_tag_entry), flac_cfg.title.tag_format);
467 gtk_box_pack_start(GTK_BOX(title_tag_box), title_tag_entry, TRUE, TRUE, 0);
469 title_desc = xmms_titlestring_descriptions("pafFetnygc", 2);
470 gtk_widget_set_sensitive(title_desc, flac_cfg.title.tag_override);
471 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_desc, FALSE, FALSE, 0);
473 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), title_frame, gtk_label_new(_("Title")));
475 /* Output config.. */
477 output_vbox = gtk_vbox_new(FALSE, 10);
478 gtk_container_border_width(GTK_CONTAINER(output_vbox), 5);
482 replaygain_frame = gtk_frame_new(_("ReplayGain"));
483 gtk_container_border_width(GTK_CONTAINER(replaygain_frame), 5);
484 gtk_box_pack_start(GTK_BOX(output_vbox), replaygain_frame, TRUE, TRUE, 0);
486 replaygain_vbox = gtk_vbox_new(FALSE, 10);
487 gtk_container_border_width(GTK_CONTAINER(replaygain_vbox), 5);
488 gtk_container_add(GTK_CONTAINER(replaygain_frame), replaygain_vbox);
490 replaygain_enable = gtk_check_button_new_with_label(_("Enable ReplayGain processing"));
491 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_enable), flac_cfg.output.replaygain.enable);
492 gtk_signal_connect(GTK_OBJECT(replaygain_enable), "clicked", replaygain_enable_cb, NULL);
493 gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_enable, FALSE, FALSE, 0);
495 replaygain_album_mode = gtk_check_button_new_with_label(_("Album mode"));
496 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_album_mode), flac_cfg.output.replaygain.album_mode);
497 gtk_signal_connect(GTK_OBJECT(replaygain_album_mode), "clicked", replaygain_album_mode_cb, NULL);
498 gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_album_mode, FALSE, FALSE, 0);
500 hbox = gtk_hbox_new(FALSE,3);
501 gtk_container_add(GTK_CONTAINER(replaygain_vbox),hbox);
502 label = gtk_label_new(_("Preamp:"));
503 gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0);
504 replaygain_preamp = gtk_adjustment_new(flac_cfg.output.replaygain.preamp, -24.0, +24.0, 1.0, 6.0, 0.0);
505 gtk_signal_connect(GTK_OBJECT(replaygain_preamp), "value-changed", replaygain_preamp_cb, NULL);
506 replaygain_preamp_hscale = gtk_hscale_new(GTK_ADJUSTMENT(replaygain_preamp));
507 gtk_scale_set_draw_value(GTK_SCALE(replaygain_preamp_hscale), FALSE);
508 gtk_box_pack_start(GTK_BOX(hbox),replaygain_preamp_hscale,TRUE,TRUE,0);
509 replaygain_preamp_label = gtk_label_new(_("0 dB"));
510 gtk_box_pack_start(GTK_BOX(hbox),replaygain_preamp_label,FALSE,FALSE,0);
511 gtk_adjustment_value_changed(GTK_ADJUSTMENT(replaygain_preamp));
513 replaygain_hard_limit = gtk_check_button_new_with_label(_("6dB hard limiting"));
514 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_hard_limit), flac_cfg.output.replaygain.hard_limit);
515 gtk_signal_connect(GTK_OBJECT(replaygain_hard_limit), "clicked", replaygain_hard_limit_cb, NULL);
516 gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_hard_limit, FALSE, FALSE, 0);
518 replaygain_enable_cb(replaygain_enable, NULL);
522 resolution_frame = gtk_frame_new(_("Resolution"));
523 gtk_container_border_width(GTK_CONTAINER(resolution_frame), 5);
524 gtk_box_pack_start(GTK_BOX(output_vbox), resolution_frame, TRUE, TRUE, 0);
526 resolution_hbox = gtk_hbox_new(FALSE, 10);
527 gtk_container_border_width(GTK_CONTAINER(resolution_hbox), 5);
528 gtk_container_add(GTK_CONTAINER(resolution_frame), resolution_hbox);
530 resolution_normal_frame = gtk_frame_new(_("Without ReplayGain"));
531 gtk_container_border_width(GTK_CONTAINER(resolution_normal_frame), 5);
532 gtk_box_pack_start(GTK_BOX(resolution_hbox), resolution_normal_frame, TRUE, TRUE, 0);
534 resolution_normal_vbox = gtk_vbox_new(FALSE, 10);
535 gtk_container_border_width(GTK_CONTAINER(resolution_normal_vbox), 5);
536 gtk_container_add(GTK_CONTAINER(resolution_normal_frame), resolution_normal_vbox);
538 resolution_normal_dither_24_to_16 = gtk_check_button_new_with_label(_("Dither 24bps to 16bps"));
539 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_normal_dither_24_to_16), flac_cfg.output.resolution.normal.dither_24_to_16);
540 gtk_signal_connect(GTK_OBJECT(resolution_normal_dither_24_to_16), "clicked", resolution_normal_dither_24_to_16_cb, NULL);
541 gtk_box_pack_start(GTK_BOX(resolution_normal_vbox), resolution_normal_dither_24_to_16, FALSE, FALSE, 0);
543 resolution_replaygain_frame = gtk_frame_new(_("With ReplayGain"));
544 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_frame), 5);
545 gtk_box_pack_start(GTK_BOX(resolution_hbox), resolution_replaygain_frame, TRUE, TRUE, 0);
547 resolution_replaygain_vbox = gtk_vbox_new(FALSE, 10);
548 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_vbox), 5);
549 gtk_container_add(GTK_CONTAINER(resolution_replaygain_frame), resolution_replaygain_vbox);
551 resolution_replaygain_dither = gtk_check_button_new_with_label(_("Enable dithering"));
552 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_dither), flac_cfg.output.resolution.replaygain.dither);
553 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_dither), "clicked", resolution_replaygain_dither_cb, NULL);
554 gtk_box_pack_start(GTK_BOX(resolution_replaygain_vbox), resolution_replaygain_dither, FALSE, FALSE, 0);
556 hbox = gtk_hbox_new(FALSE, 10);
557 gtk_container_border_width(GTK_CONTAINER(hbox), 5);
558 gtk_box_pack_start(GTK_BOX(resolution_replaygain_vbox), hbox, TRUE, TRUE, 0);
560 resolution_replaygain_noise_shaping_frame = gtk_frame_new(_("Noise shaping"));
561 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_noise_shaping_frame), 5);
562 gtk_box_pack_start(GTK_BOX(hbox), resolution_replaygain_noise_shaping_frame, TRUE, TRUE, 0);
564 resolution_replaygain_noise_shaping_vbox = gtk_vbutton_box_new();
565 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), 5);
566 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_frame), resolution_replaygain_noise_shaping_vbox);
568 resolution_replaygain_noise_shaping_radio_none = gtk_radio_button_new_with_label(NULL, _("none"));
569 if(flac_cfg.output.resolution.replaygain.noise_shaping == 0)
570 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_none), TRUE);
571 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_none), "clicked", resolution_replaygain_noise_shaping_cb, NULL);
572 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_none);
574 resolution_replaygain_noise_shaping_radio_low = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("low"));
575 if(flac_cfg.output.resolution.replaygain.noise_shaping == 1)
576 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_low), TRUE);
577 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_low), "clicked", resolution_replaygain_noise_shaping_cb, NULL);
578 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_low);
580 resolution_replaygain_noise_shaping_radio_medium = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("medium"));
581 if(flac_cfg.output.resolution.replaygain.noise_shaping == 2)
582 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_medium), TRUE);
583 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_medium), "clicked", resolution_replaygain_noise_shaping_cb, NULL);
584 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_medium);
586 resolution_replaygain_noise_shaping_radio_high = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("high"));
587 if(flac_cfg.output.resolution.replaygain.noise_shaping == 3)
588 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_high), TRUE);
589 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_high), "clicked", resolution_replaygain_noise_shaping_cb, NULL);
590 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_high);
592 resolution_replaygain_bps_out_frame = gtk_frame_new(_("Dither to"));
593 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_bps_out_frame), 5);
594 gtk_box_pack_start(GTK_BOX(hbox), resolution_replaygain_bps_out_frame, FALSE, FALSE, 0);
596 resolution_replaygain_bps_out_vbox = gtk_vbutton_box_new();
597 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), 0);
598 gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_frame), resolution_replaygain_bps_out_vbox);
600 resolution_replaygain_bps_out_radio_16bps = gtk_radio_button_new_with_label(NULL, _("16 bps"));
601 if(flac_cfg.output.resolution.replaygain.bps_out == 16)
602 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_16bps), TRUE);
603 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_bps_out_radio_16bps), "clicked", resolution_replaygain_bps_out_cb, NULL);
604 gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), resolution_replaygain_bps_out_radio_16bps);
606 resolution_replaygain_bps_out_radio_24bps = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_bps_out_radio_16bps), _("24 bps"));
607 if(flac_cfg.output.resolution.replaygain.bps_out == 24)
608 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_24bps), TRUE);
609 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_bps_out_radio_24bps), "clicked", resolution_replaygain_bps_out_cb, NULL);
610 gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), resolution_replaygain_bps_out_radio_24bps);
612 resolution_replaygain_dither_cb(resolution_replaygain_dither, NULL);
614 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), output_vbox, gtk_label_new(_("Output")));
618 streaming_vbox = gtk_vbox_new(FALSE, 0);
620 streaming_buf_frame = gtk_frame_new(_("Buffering:"));
621 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_frame), 5);
622 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_buf_frame, FALSE, FALSE, 0);
624 streaming_buf_hbox = gtk_hbox_new(TRUE, 5);
625 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_hbox), 5);
626 gtk_container_add(GTK_CONTAINER(streaming_buf_frame), streaming_buf_hbox);
628 streaming_size_box = gtk_hbox_new(FALSE, 5);
629 /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_size_box,0,1,0,1); */
630 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_size_box, TRUE, TRUE, 0);
631 streaming_size_label = gtk_label_new(_("Buffer size (kb):"));
632 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_label, FALSE, FALSE, 0);
633 streaming_size_adj = gtk_adjustment_new(flac_cfg.stream.http_buffer_size, 4, 4096, 4, 4, 4);
634 streaming_size_spin = gtk_spin_button_new(GTK_ADJUSTMENT(streaming_size_adj), 8, 0);
635 gtk_widget_set_usize(streaming_size_spin, 60, -1);
636 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_spin, FALSE, FALSE, 0);
638 streaming_pre_box = gtk_hbox_new(FALSE, 5);
639 /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_pre_box,1,2,0,1); */
640 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_pre_box, TRUE, TRUE, 0);
641 streaming_pre_label = gtk_label_new(_("Pre-buffer (percent):"));
642 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_label, FALSE, FALSE, 0);
643 streaming_pre_adj = gtk_adjustment_new(flac_cfg.stream.http_prebuffer, 0, 90, 1, 1, 1);
644 streaming_pre_spin = gtk_spin_button_new(GTK_ADJUSTMENT(streaming_pre_adj), 1, 0);
645 gtk_widget_set_usize(streaming_pre_spin, 60, -1);
646 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_spin, FALSE, FALSE, 0);
651 streaming_proxy_frame = gtk_frame_new(_("Proxy:"));
652 gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_frame), 5);
653 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_proxy_frame, FALSE, FALSE, 0);
655 streaming_proxy_vbox = gtk_vbox_new(FALSE, 5);
656 gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_vbox), 5);
657 gtk_container_add(GTK_CONTAINER(streaming_proxy_frame), streaming_proxy_vbox);
659 streaming_proxy_use = gtk_check_button_new_with_label(_("Use proxy"));
660 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_use), flac_cfg.stream.use_proxy);
661 gtk_signal_connect(GTK_OBJECT(streaming_proxy_use), "clicked", GTK_SIGNAL_FUNC(proxy_use_cb), NULL);
662 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_use, FALSE, FALSE, 0);
664 streaming_proxy_hbox = gtk_hbox_new(FALSE, 5);
665 gtk_widget_set_sensitive(streaming_proxy_hbox, flac_cfg.stream.use_proxy);
666 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_hbox, FALSE, FALSE, 0);
668 streaming_proxy_host_label = gtk_label_new(_("Host:"));
669 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_host_label, FALSE, FALSE, 0);
671 streaming_proxy_host_entry = gtk_entry_new();
672 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_host_entry), flac_cfg.stream.proxy_host? flac_cfg.stream.proxy_host : "");
673 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_host_entry, TRUE, TRUE, 0);
675 streaming_proxy_port_label = gtk_label_new(_("Port:"));
676 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_port_label, FALSE, FALSE, 0);
678 streaming_proxy_port_entry = gtk_entry_new();
679 gtk_widget_set_usize(streaming_proxy_port_entry, 50, -1);
680 temp = g_strdup_printf("%d", flac_cfg.stream.proxy_port);
681 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_port_entry), temp);
683 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_port_entry, FALSE, FALSE, 0);
685 streaming_proxy_auth_use = gtk_check_button_new_with_label(_("Use authentication"));
686 gtk_widget_set_sensitive(streaming_proxy_auth_use, flac_cfg.stream.use_proxy);
687 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use), flac_cfg.stream.proxy_use_auth);
688 gtk_signal_connect(GTK_OBJECT(streaming_proxy_auth_use), "clicked", GTK_SIGNAL_FUNC(proxy_auth_use_cb), NULL);
689 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_auth_use, FALSE, FALSE, 0);
691 streaming_proxy_auth_hbox = gtk_hbox_new(FALSE, 5);
692 gtk_widget_set_sensitive(streaming_proxy_auth_hbox, flac_cfg.stream.use_proxy && flac_cfg.stream.proxy_use_auth);
693 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_auth_hbox, FALSE, FALSE, 0);
695 streaming_proxy_auth_user_label = gtk_label_new(_("Username:"));
696 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_user_label, FALSE, FALSE, 0);
698 streaming_proxy_auth_user_entry = gtk_entry_new();
699 if(flac_cfg.stream.proxy_user)
700 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_user_entry), flac_cfg.stream.proxy_user);
701 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_user_entry, TRUE, TRUE, 0);
703 streaming_proxy_auth_pass_label = gtk_label_new(_("Password:"));
704 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_pass_label, FALSE, FALSE, 0);
706 streaming_proxy_auth_pass_entry = gtk_entry_new();
707 if(flac_cfg.stream.proxy_pass)
708 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_pass_entry), flac_cfg.stream.proxy_pass);
709 gtk_entry_set_visibility(GTK_ENTRY(streaming_proxy_auth_pass_entry), FALSE);
710 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_pass_entry, TRUE, TRUE, 0);
714 * Save to disk config.
716 streaming_save_frame = gtk_frame_new(_("Save stream to disk:"));
717 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_frame), 5);
718 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_save_frame, FALSE, FALSE, 0);
720 streaming_save_vbox = gtk_vbox_new(FALSE, 5);
721 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_vbox), 5);
722 gtk_container_add(GTK_CONTAINER(streaming_save_frame), streaming_save_vbox);
724 streaming_save_use = gtk_check_button_new_with_label(_("Save stream to disk"));
725 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use), flac_cfg.stream.save_http_stream);
726 gtk_signal_connect(GTK_OBJECT(streaming_save_use), "clicked", GTK_SIGNAL_FUNC(streaming_save_use_cb), NULL);
727 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use, FALSE, FALSE, 0);
729 streaming_save_hbox = gtk_hbox_new(FALSE, 5);
730 gtk_widget_set_sensitive(streaming_save_hbox, flac_cfg.stream.save_http_stream);
731 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_hbox, FALSE, FALSE, 0);
733 streaming_save_label = gtk_label_new(_("Path:"));
734 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_label, FALSE, FALSE, 0);
736 streaming_save_entry = gtk_entry_new();
737 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), flac_cfg.stream.save_http_path? flac_cfg.stream.save_http_path : "");
738 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_entry, TRUE, TRUE, 0);
740 streaming_save_browse = gtk_button_new_with_label(_("Browse"));
741 gtk_signal_connect(GTK_OBJECT(streaming_save_browse), "clicked", GTK_SIGNAL_FUNC(streaming_save_browse_cb), NULL);
742 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse, FALSE, FALSE, 0);
745 streaming_cast_frame = gtk_frame_new(_("SHOUT/Icecast:"));
746 gtk_container_set_border_width(GTK_CONTAINER(streaming_cast_frame), 5);
747 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_cast_frame, FALSE, FALSE, 0);
749 streaming_cast_vbox = gtk_vbox_new(5, FALSE);
750 gtk_container_add(GTK_CONTAINER(streaming_cast_frame), streaming_cast_vbox);
752 streaming_cast_title = gtk_check_button_new_with_label(_("Enable SHOUT/Icecast title streaming"));
753 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_cast_title), flac_cfg.stream.cast_title_streaming);
754 gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_cast_title, FALSE, FALSE, 0);
756 streaming_udp_title = gtk_check_button_new_with_label(_("Enable Icecast Metadata UDP Channel"));
757 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_udp_title), flac_cfg.stream.use_udp_channel);
758 gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_udp_title, FALSE, FALSE, 0);
761 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), streaming_vbox, gtk_label_new(_("Streaming")));
765 bbox = gtk_hbutton_box_new();
766 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
767 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
768 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
770 ok = gtk_button_new_with_label(_("Ok"));
771 gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(flac_configurewin_ok), NULL);
772 GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
773 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
774 gtk_widget_grab_default(ok);
776 cancel = gtk_button_new_with_label(_("Cancel"));
777 gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(flac_configurewin));
778 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
779 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
781 gtk_widget_show_all(flac_configurewin);
784 void FLAC_XMMS__aboutbox(void)
786 static GtkWidget *about_window;
789 gdk_window_raise(about_window->window);
791 about_window = xmms_show_message(
792 _("About Flac Plugin"),
793 _("Flac Plugin by Josh Coalson\n"
798 "Daisuke Shimamura\n"
799 "Visit http://flac.sourceforge.net/"),
800 _("Ok"), FALSE, NULL, NULL);
801 gtk_signal_connect(GTK_OBJECT(about_window), "destroy",
802 GTK_SIGNAL_FUNC(gtk_widget_destroyed),
807 * Get text of an Entry or a ComboBox
809 static gchar *gtk_entry_get_text_1 (GtkWidget *widget)
811 if (GTK_IS_COMBO(widget))
813 return gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(widget)->entry));
814 }else if (GTK_IS_ENTRY(widget))
816 return gtk_entry_get_text(GTK_ENTRY(widget));