annotate src/madplug/configure.c @ 2497:ed6c81bd9016

Include cleanups, part #2.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 31 Mar 2008 14:55:14 +0300
parents bd9673d8b7d5
children 769e17da93dd
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
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
22 /* #define AUD_DEBUG 1 */
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
23
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
24 #include "plugin.h"
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
25
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
26 #include <gtk/gtk.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
27 #include <math.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
28
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
29 static GtkWidget *configure_win = NULL;
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
30 static audmad_config_t *oldconfig = NULL; // undo storage
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
31
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
32 static audmad_config_t *
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
33 duplicate_config(audmad_config_t *orig)
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
34 {
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
35 audmad_config_t *copy = g_memdup(orig, sizeof(audmad_config_t));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
36
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
37 copy->id3_format = g_strdup(orig->id3_format);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
38
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
39 return copy;
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
40 }
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
41
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
42 static void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
43 dispose_config(audmad_config_t *config)
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
44 {
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
45 g_free(config->id3_format);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
46 g_free(config);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
47 }
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
48
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
49 static void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
50 update_config(gpointer widgets)
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
51 {
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
52 const gchar *text = NULL;
2214
9a869d4bb0d3 make use of AUDDBG() for debug print out.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2124
diff changeset
53
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
54 AUDDBG("updating\n");
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
55
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
56 GtkWidget *reopen = g_object_get_data(widgets, "reopen");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
57 GtkWidget *fast_playback = g_object_get_data(widgets, "fast_playback");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
58 GtkWidget *use_xing = g_object_get_data(widgets, "use_xing");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
59 GtkWidget *sjis = g_object_get_data(widgets, "sjis");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
60 GtkWidget *show_avg = g_object_get_data(widgets, "show_avg");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
61 GtkWidget *title_override = g_object_get_data(widgets, "title_override");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
62 GtkWidget *title_id3_entry = g_object_get_data(widgets, "title_id3_entry");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
63
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
64 //audio
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
65 audmad_config->force_reopen_audio =
916
a8494c2a87eb [svn] revise reopen output code for #880. time count would be reset if output was closed. so I took two measures for it.
yaz
parents: 676
diff changeset
66 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(reopen));
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
67
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
68 //metadata
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
69 audmad_config->fast_play_time_calc =
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
70 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(fast_playback));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
71 audmad_config->use_xing =
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
72 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_xing));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
73 audmad_config->sjis =
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
74 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sjis));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
75
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
76 //misc
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
77 audmad_config->show_avg_vbr_bitrate =
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
78 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(show_avg));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
79
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
80 //text
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
81 audmad_config->title_override =
619
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
82 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override));
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
83
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
84 text = gtk_entry_get_text(GTK_ENTRY(title_id3_entry));
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
85 g_free(audmad_config->id3_format);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
86 audmad_config->id3_format = g_strdup(text);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
87
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
88 }
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
89
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
90 static void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
91 save_config(void)
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
92 {
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
93 ConfigDb *db = aud_cfg_db_open();
619
ca4cd00ca0c8 [svn] - now title_override works.
yaz
parents: 618
diff changeset
94
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
95 AUDDBG("saving\n");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
96
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
97 //audio
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
98 aud_cfg_db_set_bool(db, "MAD", "force_reopen_audio",
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
99 audmad_config->force_reopen_audio);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
100 //metadata
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1428
diff changeset
101 aud_cfg_db_set_bool(db, "MAD", "fast_play_time_calc",
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
102 audmad_config->fast_play_time_calc);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
103 aud_cfg_db_set_bool(db, "MAD", "use_xing", audmad_config->use_xing);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
104 aud_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
105
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
106 //misc
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
107 aud_cfg_db_set_bool(db, "MAD", "show_avg_vbr_bitrate",
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
108 audmad_config->show_avg_vbr_bitrate);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
109
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
110 //text
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
111 aud_cfg_db_set_bool(db, "MAD", "title_override", audmad_config->title_override);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
112 aud_cfg_db_set_string(db, "MAD", "id3_format", audmad_config->id3_format);
676
1733b12ef974 [svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
yaz
parents: 651
diff changeset
113
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1428
diff changeset
114 aud_cfg_db_close(db);
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
115 }
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
116
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
117 static void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
118 configure_win_cancel(GtkWidget *widget, gpointer widgets)
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
119 {
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
120 AUDDBG("cancel\n");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
121 dispose_config(audmad_config);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
122 audmad_config = oldconfig;
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
123 oldconfig = NULL;
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
124 save_config();
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
125 gtk_widget_destroy(configure_win);
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
126 g_object_unref(widgets);
610
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
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
129 static void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
130 configure_win_ok(GtkWidget *widget, gpointer widgets)
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
131 {
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
132 AUDDBG("ok\n");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
133 update_config(widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
134 save_config();
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
135 gtk_widget_destroy(configure_win);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
136 g_object_unref(widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
137 dispose_config(oldconfig);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
138 oldconfig = NULL;
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
139 }
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
140
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
141 static void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
142 configure_destroy(GtkWidget *w, gpointer data)
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
143 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
144 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
145
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
146 static void
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
147 simple_update_cb(GtkWidget *w, gpointer widgets)
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
148 {
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
149 update_config(widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
150 save_config();
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
151 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
152
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
153 static void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
154 entry_changed_cb(GtkWidget *w, gpointer widgets)
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
155 {
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
156 simple_update_cb(w, widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
157 }
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
158
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
159 static void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
160 title_override_cb(GtkWidget *w, gpointer widgets)
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
161 {
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
162 GtkWidget *title_override = g_object_get_data(widgets, "title_override");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
163 GtkWidget *title_id3_entry = g_object_get_data(widgets, "title_id3_entry");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
164 GtkWidget *title_id3_label = g_object_get_data(widgets, "title_id3_label");
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
165 gboolean override = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
166
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
167 update_config(widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
168 save_config();
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
169
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
170 gtk_widget_set_sensitive(title_id3_entry, override);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
171 gtk_widget_set_sensitive(title_id3_label, override);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
172 }
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
173
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
174 void
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
175 audmad_configure(void)
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
176 {
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
177 GtkWidget *vbox;
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
178 GtkWidget *bbox, *ok, *cancel;
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
179 GtkWidget *notebook, *vbox2, *title_id3_label, *title_id3_box;
2390
bd9673d8b7d5 converted to new sound engine scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2344
diff changeset
180 GtkWidget *fast_playback, *use_xing, *sjis, *show_avg, *reopen;
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
181 GtkWidget *title_override, *title_id3_entry;
2390
bd9673d8b7d5 converted to new sound engine scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2344
diff changeset
182 GtkWidget *metadataFrame, *audioFrame, *miscFrame;
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
183 GtkWidget *metadata_vbox, *audio_vbox, *misc_vbox;
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
184
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
185 gpointer widgets = g_object_new(G_TYPE_OBJECT, NULL);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
186
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
187 if(oldconfig) {
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
188 dispose_config(oldconfig);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
189 oldconfig = NULL;
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
190 }
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
191
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
192 oldconfig = duplicate_config(audmad_config); //for undo
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
193
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
194 if (configure_win != NULL) {
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
195 gtk_widget_show(configure_win);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
196 return;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
197 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
198
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
199 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
200 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
201
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
202 g_signal_connect(G_OBJECT(configure_win), "destroy",
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
203 G_CALLBACK(gtk_widget_destroyed), &configure_win);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
204 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
205 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
206
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
207 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
208 _("MPEG Audio Plugin Configuration"));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
209 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
210 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
211
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
212 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
213 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
214
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
215 notebook = gtk_notebook_new();
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
216 gtk_box_pack_start(GTK_BOX(vbox), notebook, FALSE, FALSE, 0);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
217
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
218
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
219 /********************************************************************************/
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
220
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
221
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
222 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
223
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
224 // audio frame
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
225 audioFrame = gtk_frame_new(_("Audio Settings"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
226 gtk_container_border_width(GTK_CONTAINER(audioFrame), 5);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
227
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
228 audio_vbox = gtk_vbox_new(FALSE, 5);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
229
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
230 gtk_container_add(GTK_CONTAINER(audioFrame), audio_vbox);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
231 gtk_container_add(GTK_CONTAINER(vbox2), audioFrame);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
232
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
233 reopen = gtk_check_button_new_with_label(_("Force reopen audio when audio type changed"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
234 g_object_set_data(widgets, "reopen", reopen);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
235 gtk_box_pack_start(GTK_BOX(audio_vbox), reopen, FALSE, FALSE, 0);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
236 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(reopen),
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
237 audmad_config->force_reopen_audio);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
238 g_signal_connect(G_OBJECT(reopen), "clicked", G_CALLBACK(simple_update_cb), widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
239
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
240
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
241 // metadata frame
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
242 metadataFrame = gtk_frame_new(_("Metadata Settings"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
243 gtk_container_border_width(GTK_CONTAINER(metadataFrame), 5);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
244
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
245 metadata_vbox = gtk_vbox_new(FALSE, 5);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
246
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
247 gtk_container_add(GTK_CONTAINER(metadataFrame), metadata_vbox);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
248 gtk_container_add(GTK_CONTAINER(vbox2), metadataFrame);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
249
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
250 fast_playback =
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
251 gtk_check_button_new_with_label(_("Enable fast play-length calculation"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
252 g_object_set_data(widgets, "fast_playback", fast_playback);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
253 gtk_box_pack_start(GTK_BOX(metadata_vbox), fast_playback, FALSE, FALSE, 0);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
254 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fast_playback),
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
255 audmad_config->fast_play_time_calc);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
256 g_signal_connect(G_OBJECT(fast_playback), "clicked", G_CALLBACK(simple_update_cb), widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
257
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
258 use_xing = gtk_check_button_new_with_label(_("Parse XING headers"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
259 g_object_set_data(widgets, "use_xing", use_xing);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
260 gtk_box_pack_start(GTK_BOX(metadata_vbox), use_xing, FALSE, FALSE, 0);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
261 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_xing),
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
262 audmad_config->use_xing);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
263 g_signal_connect(G_OBJECT(use_xing), "clicked", G_CALLBACK(simple_update_cb), widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
264
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
265 sjis = gtk_check_button_new_with_label(_("Use SJIS to write ID3 tags (not recommended)"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
266 g_object_set_data(widgets, "sjis", sjis);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
267 gtk_box_pack_start(GTK_BOX(metadata_vbox), sjis, FALSE, FALSE, 0);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
268 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sjis), audmad_config->sjis);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
269 g_signal_connect(G_OBJECT(sjis), "clicked", G_CALLBACK(simple_update_cb), widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
270
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
271 // misc frame
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
272 miscFrame = gtk_frame_new(_("Miscellaneous Settings"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
273 gtk_container_border_width(GTK_CONTAINER(miscFrame), 5);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
274
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
275 misc_vbox = gtk_vbox_new(FALSE, 5);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
276
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
277 gtk_container_add(GTK_CONTAINER(miscFrame), misc_vbox);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
278 gtk_container_add(GTK_CONTAINER(vbox2), miscFrame);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
279
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
280
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
281 show_avg = gtk_check_button_new_with_label(_("Display average bitrate for VBR"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
282 g_object_set_data(widgets, "show_avg", show_avg);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
283 gtk_box_pack_start(GTK_BOX(misc_vbox), show_avg, FALSE, FALSE, 0);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
284 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(show_avg),
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
285 audmad_config->show_avg_vbr_bitrate);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
286 g_signal_connect(G_OBJECT(show_avg), "clicked", G_CALLBACK(simple_update_cb), widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
287
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
288 // add to notebook
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
289 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new(_("General")));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
290
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
291
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
292
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
293 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
294
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
295 title_override = gtk_check_button_new_with_label(_("Override generic titles"));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
296 g_object_set_data(widgets, "title_override", title_override);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
297 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_override),
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
298 audmad_config->title_override);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
299 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
300 FALSE, 0);
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
301 g_signal_connect(G_OBJECT(title_override), "clicked",
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
302 G_CALLBACK(title_override_cb), widgets);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
303
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
304 title_id3_box = gtk_hbox_new(FALSE, 5);
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
305 gtk_box_pack_start(GTK_BOX(vbox2), title_id3_box, FALSE, FALSE, 0);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
306
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
307 title_id3_label = gtk_label_new(_("ID3 format:"));
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
308 g_object_set_data(widgets, "title_id3_label", title_id3_label);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
309 gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_label, FALSE, FALSE, 0);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
310 gtk_widget_set_sensitive(title_id3_label, audmad_config->title_override);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
311
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
312 title_id3_entry = gtk_entry_new();
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
313 g_object_set_data(widgets, "title_id3_entry", title_id3_entry);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
314 gtk_entry_set_text(GTK_ENTRY(title_id3_entry), audmad_config->id3_format);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
315 gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_entry, TRUE, TRUE, 0);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
316 g_signal_connect(title_id3_entry, "changed", G_CALLBACK(entry_changed_cb), widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
317 gtk_widget_set_sensitive(title_id3_entry, audmad_config->title_override);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
318
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
319 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new(_("Title")));
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
320
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
321
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
322
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
323 /*********************************************************************************/
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
324
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
325
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
326 bbox = gtk_hbutton_box_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
327 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
328 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
329 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
330
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
331 cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
332
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
333 g_signal_connect(G_OBJECT(cancel), "clicked",
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
334 G_CALLBACK(configure_win_cancel), widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
335
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
336 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
337
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
338 ok = gtk_button_new_from_stock(GTK_STOCK_OK);
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
339
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
340 g_signal_connect(G_OBJECT(ok), "clicked",
2341
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
341 G_CALLBACK(configure_win_ok), widgets);
59addab003d7 - reworked replaygain to use individual pre-gain for the files with RG info and the rest.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2214
diff changeset
342
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
343 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
344 gtk_widget_grab_default(ok);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
345
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
346 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
347 }