annotate src/madplug/configure.c @ 676:1733b12ef974 trunk

[svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
author yaz
date Mon, 19 Feb 2007 19:39:42 -0800
parents b9167008fc3f
children a8494c2a87eb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
1 /*
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
2 * mad plugin for audacious
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
3 * Copyright (C) 2005-2007 William Pitcock, Yoshiki Yazawa
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
4 *
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
5 * Portions derived from xmms-mad:
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
6 * Copyright (C) 2001-2002 Sam Clegg - See COPYING
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
7 *
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
10 * the Free Software Foundation; under version 2 of the License.
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
11 *
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
16 *
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
20 */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
21
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
22 #include "plugin.h"
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
23
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
24 #include <gtk/gtk.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
25 #include <math.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
26 #include <audacious/configdb.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
27
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
28 static GtkWidget *configure_win = NULL;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
29 static GtkWidget *vbox;
676
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
30 static GtkWidget *fast_playback, *use_xing, *dither, *sjis, *show_avg;
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
31 static GtkWidget *RG_enable, *RG_track_mode, *RG_default, *pregain,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
32 *hard_limit;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
33 static GtkWidget *title_id3_box, *title_tag_desc;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
34 static GtkWidget *title_override, *title_id3_entry;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
35
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
36 static void configure_win_ok(GtkWidget * widget, gpointer data)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
37 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
38 ConfigDb *db;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
39 const gchar *text = NULL;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
40 #ifdef DEBUG
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
41 g_message("saving\n");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
42 #endif
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
43
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
44 audmad_config.fast_play_time_calc =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
45 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(fast_playback));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
46 audmad_config.use_xing =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
47 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_xing));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
48 audmad_config.dither =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
49 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dither));
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
50 audmad_config.sjis =
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
51 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sjis));
676
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
52 audmad_config.show_avg_vbr_bitrate =
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
53 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(show_avg));
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
54
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
55 audmad_config.replaygain.enable =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
56 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RG_enable));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
57 audmad_config.replaygain.track_mode =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
58 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RG_track_mode));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
59 audmad_config.hard_limit =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
60 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hard_limit));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
61 text = gtk_entry_get_text(GTK_ENTRY(RG_default));
651
b9167008fc3f [svn] - strings in audmad_config should be freed before update. thus constant initializer has been replaced with g_strdup().
yaz
parents: 619
diff changeset
62 g_free(audmad_config.replaygain.default_db);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
63 audmad_config.replaygain.default_db = g_strdup(text);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
64
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
65 text = gtk_entry_get_text(GTK_ENTRY(pregain));
651
b9167008fc3f [svn] - strings in audmad_config should be freed before update. thus constant initializer has been replaced with g_strdup().
yaz
parents: 619
diff changeset
66 g_free(audmad_config.pregain_db);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
67 audmad_config.pregain_db = g_strdup(text);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
68
619
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
69 audmad_config.title_override =
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
70 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override));
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
71
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
72 text = gtk_entry_get_text(GTK_ENTRY(title_id3_entry));
651
b9167008fc3f [svn] - strings in audmad_config should be freed before update. thus constant initializer has been replaced with g_strdup().
yaz
parents: 619
diff changeset
73 g_free(audmad_config.id3_format);
619
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
74 audmad_config.id3_format = g_strdup(text);
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
75
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
76 audmad_config_compute(&audmad_config);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
77
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
78 db = bmp_cfg_db_open();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
79 bmp_cfg_db_set_int(db, "MAD", "http_buffer_size",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
80 audmad_config.http_buffer_size);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
81 bmp_cfg_db_set_bool(db, "MAD", "fast_play_time_calc",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
82 audmad_config.fast_play_time_calc);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
83 bmp_cfg_db_set_bool(db, "MAD", "use_xing", audmad_config.use_xing);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
84 bmp_cfg_db_set_bool(db, "MAD", "dither", audmad_config.dither);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
85 bmp_cfg_db_set_bool(db, "MAD", "sjis", audmad_config.sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
86 bmp_cfg_db_set_bool(db, "MAD", "hard_limit",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
87 audmad_config.hard_limit);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
88 bmp_cfg_db_set_string(db, "MAD", "pregain_db",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
89 audmad_config.pregain_db);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
90
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
91 bmp_cfg_db_set_bool(db, "MAD", "RG.enable",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
92 audmad_config.replaygain.enable);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
93 bmp_cfg_db_set_bool(db, "MAD", "RG.track_mode",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
94 audmad_config.replaygain.track_mode);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
95 bmp_cfg_db_set_string(db, "MAD", "RG.default_db",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
96 audmad_config.replaygain.default_db);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
97
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
98 bmp_cfg_db_set_bool(db, "MAD", "title_override", audmad_config.title_override);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
99 bmp_cfg_db_set_string(db, "MAD", "id3_format", audmad_config.id3_format);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
100
676
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
101 bmp_cfg_db_set_bool(db, "MAD", "show_avg_vbr_bitrate",
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
102 audmad_config.show_avg_vbr_bitrate);
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
103
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
104 bmp_cfg_db_close(db);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
105 gtk_widget_destroy(configure_win);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
106 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
107
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
108 static void configure_destroy(GtkWidget * w, gpointer data)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
109 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
110 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
111
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
112 static void
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
113 title_override_cb(GtkWidget * w, gpointer data)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
114 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
115 gboolean override;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
116 override =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
117 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
118 gtk_widget_set_sensitive(title_id3_box, override);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
119 gtk_widget_set_sensitive(title_tag_desc, override);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
120 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
121
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
122 void audmad_configure(void)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
123 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
124 GtkWidget *bbox, *ok, *cancel;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
125 GtkWidget *label, *RG_default_hbox, *pregain_hbox;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
126 GtkWidget *notebook, *vbox2, *title_id3_label;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
127
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
128 if (configure_win != NULL)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
129 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
130 gtk_widget_show(configure_win);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
131 return;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
132 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
133
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
134 configure_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
135 gtk_window_set_type_hint(GTK_WINDOW(configure_win), GDK_WINDOW_TYPE_HINT_DIALOG);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
136
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
137 g_signal_connect(G_OBJECT(configure_win), "destroy",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
138 G_CALLBACK(gtk_widget_destroyed),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
139 &configure_win);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
140 g_signal_connect(G_OBJECT(configure_win), "destroy",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
141 G_CALLBACK(configure_destroy), &configure_win);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
142
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
143 gtk_window_set_title(GTK_WINDOW(configure_win),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
144 _("MPEG Audio Plugin Configuration"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
145 gtk_window_set_policy(GTK_WINDOW(configure_win), FALSE, FALSE, FALSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
146 gtk_container_border_width(GTK_CONTAINER(configure_win), 10);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
147
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
148 vbox = gtk_vbox_new(FALSE, 10);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
149 gtk_container_add(GTK_CONTAINER(configure_win), vbox);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
150
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
151 notebook = gtk_notebook_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
152 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
153
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
154 vbox2 = gtk_vbox_new(FALSE, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
155
676
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
156 dither = gtk_check_button_new_with_label
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
157 (_("Dither output when rounding to 16-bit"));
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
158 gtk_box_pack_start(GTK_BOX(vbox2), dither, TRUE, TRUE, 0);
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
159 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dither),
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
160 audmad_config.dither);
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
161
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
162 fast_playback =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
163 gtk_check_button_new_with_label(_("Enable fast play-length calculation"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
164 gtk_box_pack_start(GTK_BOX(vbox2), fast_playback, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
165 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fast_playback),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
166 audmad_config.fast_play_time_calc);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
167
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
168 use_xing = gtk_check_button_new_with_label(_("Parse XING headers"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
169 gtk_box_pack_start(GTK_BOX(vbox2), use_xing, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
170 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_xing),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
171 audmad_config.use_xing);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
172
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
173 sjis = gtk_check_button_new_with_label("Use SJIS to write ID3 tags instead of UTF-8");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
174 gtk_box_pack_start(GTK_BOX(vbox2), sjis, TRUE, TRUE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
175 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sjis), audmad_config.sjis);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
176
676
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
177 show_avg = gtk_check_button_new_with_label(_("Display average bitrate for VBR"));
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
178 gtk_box_pack_start(GTK_BOX(vbox2), show_avg, TRUE, TRUE, 0);
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
179 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(show_avg),
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
180 audmad_config.show_avg_vbr_bitrate);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
181
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
182 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new(_("General")));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
183
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
184 vbox2 = gtk_vbox_new(FALSE, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
185
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
186 /* SKR added config : */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
187 RG_enable = gtk_check_button_new_with_label(_("Enable ReplayGain processing"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
188 gtk_box_pack_start(GTK_BOX(vbox2), RG_enable, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
189 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RG_enable),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
190 audmad_config.replaygain.enable);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
191 RG_track_mode =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
192 gtk_check_button_new_with_label(_("Track mode"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
193 gtk_box_pack_start(GTK_BOX(vbox2), RG_track_mode, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
194 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RG_track_mode),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
195 audmad_config.replaygain.track_mode);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
196
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
197 hard_limit =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
198 gtk_check_button_new_with_label
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
199 (_("6dB hard limiting"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
200 gtk_box_pack_start(GTK_BOX(vbox2), hard_limit, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
201 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hard_limit),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
202 audmad_config.hard_limit);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
203
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
204 label = gtk_label_new(_("Default gain (dB):"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
205 RG_default_hbox = gtk_hbox_new(FALSE, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
206 gtk_box_pack_start(GTK_BOX(vbox2), RG_default_hbox, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
207 RG_default = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
208 gtk_widget_set_usize(RG_default, 80, -1);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
209 gtk_entry_set_text(GTK_ENTRY(RG_default),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
210 audmad_config.replaygain.default_db);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
211 gtk_box_pack_start(GTK_BOX(RG_default_hbox), label, FALSE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
212 gtk_box_pack_start(GTK_BOX(RG_default_hbox), RG_default, FALSE, TRUE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
213 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
214
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
215 label = gtk_label_new(_("Preamp (dB):"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
216 pregain_hbox = gtk_hbox_new(FALSE, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
217 gtk_box_pack_start(GTK_BOX(vbox2), pregain_hbox, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
218 pregain = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
219 gtk_widget_set_usize(pregain, 80, -1);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
220 gtk_entry_set_text(GTK_ENTRY(pregain), audmad_config.pregain_db);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
221 gtk_box_pack_start(GTK_BOX(pregain_hbox), label, FALSE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
222 gtk_box_pack_start(GTK_BOX(pregain_hbox), pregain, FALSE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
223
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
224 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new("ReplayGain"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
225
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
226 vbox2 = gtk_vbox_new(FALSE, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
227
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
228 title_override =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
229 gtk_check_button_new_with_label(_("Override generic titles"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
230 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_override),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
231 audmad_config.title_override);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
232 g_signal_connect(G_OBJECT(title_override), "clicked",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
233 G_CALLBACK(title_override_cb), NULL);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
234 gtk_box_pack_start(GTK_BOX(vbox2), title_override, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
235 FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
236
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
237 title_id3_box = gtk_hbox_new(FALSE, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
238 gtk_widget_set_sensitive(title_id3_box, audmad_config.title_override);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
239 gtk_box_pack_start(GTK_BOX(vbox2), title_id3_box, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
240 FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
241
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
242 title_id3_label = gtk_label_new(_("ID3 format:"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
243 gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_label, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
244 FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
245
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
246 title_id3_entry = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
247 gtk_entry_set_text(GTK_ENTRY(title_id3_entry), audmad_config.id3_format);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
248 gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_entry, TRUE, TRUE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
249 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
250
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
251 title_tag_desc = xmms_titlestring_descriptions("pafFetnygc", 2);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
252 gtk_widget_set_sensitive(title_tag_desc, audmad_config.title_override);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
253 gtk_box_pack_start(GTK_BOX(vbox2), title_tag_desc, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
254 FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
255 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
256 gtk_label_new(_("Title")));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
257
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
258 bbox = gtk_hbutton_box_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
259 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
260 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
261 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
262
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
263 cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
264 g_signal_connect_swapped(G_OBJECT(cancel), "clicked",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
265 G_CALLBACK(gtk_widget_destroy),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
266 G_OBJECT(configure_win));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
267 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
268
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
269 ok = gtk_button_new_from_stock(GTK_STOCK_OK);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
270 g_signal_connect(G_OBJECT(ok), "clicked",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
271 G_CALLBACK(configure_win_ok), NULL);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
272 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
273 gtk_widget_grab_default(ok);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
274
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
275 gtk_widget_show_all(configure_win);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
276 }