Mercurial > audlegacy-plugins
annotate src/filewriter/mp3.c @ 2835:f1b6f1b2cdb3
fixed FSF address
author | Andrew O. Shadoura <bugzilla@tut.by> |
---|---|
date | Mon, 14 Jul 2008 03:35:13 +0300 |
parents | b17cffd47053 |
children | 31d6c44ffef2 |
rev | line source |
---|---|
984 | 1 /* FileWriter-Plugin |
2 * (C) copyright 2007 merging of Disk Writer and Out-Lame by Michael Färber | |
3 * | |
4 * Original Out-Lame-Plugin: | |
5 * (C) copyright 2002 Lars Siebold <khandha5@gmx.net> | |
6 * (C) copyright 2006-2007 porting to audacious by Yoshiki Yazawa <yaz@cc.rim.or.jp> | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
2835 | 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
984 | 21 */ |
22 | |
2275
e09d9633d6aa
- mp3_playing() should return 0 for now otherwise mp4 playback would halt at the end of a track.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2124
diff
changeset
|
23 /* #define AUD_DEBUG 1 */ |
e09d9633d6aa
- mp3_playing() should return 0 for now otherwise mp4 playback would halt at the end of a track.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2124
diff
changeset
|
24 |
984 | 25 #include "plugins.h" |
26 | |
1197
616928ec054d
Add #ifdef FILEWRITER_MP3 to filewriter/mp3.c
Jonathan Schleifer <js@h3c.de>
parents:
1044
diff
changeset
|
27 #ifdef FILEWRITER_MP3 |
616928ec054d
Add #ifdef FILEWRITER_MP3 to filewriter/mp3.c
Jonathan Schleifer <js@h3c.de>
parents:
1044
diff
changeset
|
28 |
984 | 29 #include <lame/lame.h> |
30 #define ENCBUFFER_SIZE 35000 | |
31 | |
2766
6d08e3120615
make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2461
diff
changeset
|
32 static void mp3_init(write_output_callback write_output_func); |
984 | 33 static void mp3_configure(void); |
34 static gint mp3_open(void); | |
35 static void mp3_write(void *ptr, gint length); | |
2774
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
36 static void mp3_flush(void); |
984 | 37 static void mp3_close(void); |
38 static gint mp3_free(void); | |
39 static gint mp3_playing(void); | |
40 static gint mp3_get_written_time(void); | |
2766
6d08e3120615
make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2461
diff
changeset
|
41 static gint (*write_output)(void *ptr, gint length); |
984 | 42 |
43 FileWriter mp3_plugin = | |
44 { | |
45 mp3_init, | |
46 mp3_configure, | |
47 mp3_open, | |
48 mp3_write, | |
2774
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
49 mp3_flush, |
984 | 50 mp3_close, |
51 mp3_free, | |
52 mp3_playing, | |
53 mp3_get_written_time | |
54 }; | |
55 | |
56 static GtkWidget *configure_win = NULL; | |
57 static GtkWidget *configure_bbox, *configure_ok, *configure_cancel; | |
58 static GtkWidget *alg_quality_spin; | |
59 static GtkWidget *alg_quality_hbox; | |
60 static GtkObject *alg_quality_adj; | |
61 static GtkWidget *vbox, *notebook; | |
62 static GtkWidget *quality_vbox, *quality_hbox1, *alg_quality_frame; | |
63 static GtkWidget *enc_quality_frame, *enc_quality_label1, *enc_quality_label2; | |
64 static GtkWidget *enc_radio1, *enc_radio2, *bitrate_option_menu, *bitrate_menu, | |
65 *bitrate_menu_item; | |
66 static GtkWidget *compression_spin; | |
67 static GtkObject *compression_adj; | |
68 static GtkWidget *mode_hbox, *mode_option_menu, *mode_menu, *mode_frame, | |
69 *mode_menu_item, *ms_mode_toggle; | |
70 static GtkWidget *samplerate_hbox, *samplerate_option_menu, *samplerate_menu, | |
71 *samplerate_label, *samplerate_frame, *samplerate_menu_item; | |
72 static GtkWidget *misc_frame, *misc_vbox, *enforce_iso_toggle, | |
73 *error_protection_toggle; | |
74 static GtkTooltips *quality_tips, *vbr_tips, *tags_tips; | |
75 static GtkWidget *vbr_vbox, *vbr_toggle, *vbr_options_vbox, *vbr_type_frame, | |
76 *vbr_type_hbox, *vbr_type_radio1, *vbr_type_radio2; | |
77 static GtkWidget *abr_frame, *abr_option_menu, *abr_menu, *abr_menu_item, | |
78 *abr_hbox, *abr_label; | |
79 static GtkWidget *vbr_frame, *vbr_options_vbox2; | |
80 static GtkWidget *vbr_options_hbox1, *vbr_min_option_menu, *vbr_min_menu, | |
81 *vbr_min_menu_item, *vbr_min_label; | |
82 static GtkWidget *vbr_options_hbox2, *vbr_max_option_menu, *vbr_max_menu, | |
83 *vbr_max_menu_item, *vbr_max_label, *enforce_min_toggle; | |
84 static GtkWidget *vbr_options_hbox3, *vbr_quality_spin, *vbr_quality_label; | |
85 static GtkObject *vbr_quality_adj; | |
86 static GtkWidget *xing_header_toggle; | |
87 static GtkWidget *tags_vbox, *tags_frames_frame, *tags_frames_hbox, | |
88 *tags_copyright_toggle, *tags_original_toggle; | |
89 static GtkWidget *tags_id3_frame, *tags_id3_vbox, *tags_id3_hbox, | |
90 *tags_force_id3v2_toggle, *tags_only_v1_toggle, *tags_only_v2_toggle; | |
91 | |
92 static GtkWidget *enc_quality_vbox, *hbox1, *hbox2; | |
93 | |
94 static guint64 olen = 0; | |
95 static int inside; | |
96 | |
97 static gint vbr_on = 0; | |
98 static gint vbr_type = 0; | |
99 static gint vbr_min_val = 32; | |
100 static gint vbr_max_val = 320; | |
101 static gint enforce_min_val = 0; | |
102 static gint vbr_quality_val = 4; | |
103 static gint abr_val = 128; | |
104 static gint toggle_xing_val = 1; | |
105 static gint mark_original_val = 1; | |
106 static gint mark_copyright_val = 0; | |
107 static gint force_v2_val = 0; | |
108 static gint only_v1_val = 0; | |
109 static gint only_v2_val = 0; | |
110 static gint algo_quality_val = 5; | |
111 static gint out_samplerate_val = 0; | |
112 static gint bitrate_val = 128; | |
113 static gfloat compression_val = 11; | |
114 static gint enc_toggle_val = 0; | |
115 static gint audio_mode_val = 4; | |
116 static gint auto_ms_val = 0; | |
117 static gint enforce_iso_val = 0; | |
118 static gint error_protect_val = 0; | |
119 | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
120 static gint available_samplerates[] = |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
121 { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 } ; |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
122 |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
123 static gint available_bitrates[] = |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
124 { 8, 16, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 } ; |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
125 |
984 | 126 typedef struct { |
127 gchar *track_name; | |
128 gchar *album_name; | |
129 gchar *performer; | |
130 gchar *genre; | |
131 gchar *year; | |
132 gchar *track_number; | |
133 } lameid3_t; | |
134 | |
135 static lameid3_t lameid3; | |
136 | |
137 static lame_global_flags *gfp; | |
138 static int encout; | |
139 static unsigned char encbuffer[ENCBUFFER_SIZE]; | |
140 | |
141 static void free_lameid3(lameid3_t *p) | |
142 { | |
143 g_free(p->track_name); | |
144 g_free(p->album_name); | |
145 g_free(p->performer); | |
146 g_free(p->genre); | |
147 g_free(p->year); | |
148 g_free(p->track_number); | |
149 | |
150 p->track_name = NULL; | |
151 p->album_name = NULL; | |
152 p->performer = NULL; | |
153 p->genre = NULL; | |
154 p->year = NULL; | |
155 p->track_number = NULL; | |
156 | |
157 }; | |
158 | |
159 static void lame_debugf(const char *format, va_list ap) | |
160 { | |
161 (void) vfprintf(stdout, format, ap); | |
162 } | |
163 | |
2766
6d08e3120615
make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2461
diff
changeset
|
164 static void mp3_init(write_output_callback write_output_func) |
984 | 165 { |
2124 | 166 ConfigDb *db = aud_cfg_db_open(); |
167 aud_cfg_db_get_int(db, "filewriter_mp3", "vbr_on", &vbr_on); | |
168 aud_cfg_db_get_int(db, "filewriter_mp3", "vbr_type", &vbr_type); | |
169 aud_cfg_db_get_int(db, "filewriter_mp3", "vbr_min_val", &vbr_min_val); | |
170 aud_cfg_db_get_int(db, "filewriter_mp3", "vbr_max_val", &vbr_max_val); | |
171 aud_cfg_db_get_int(db, "filewriter_mp3", "enforce_min_val", | |
984 | 172 &enforce_min_val); |
2124 | 173 aud_cfg_db_get_int(db, "filewriter_mp3", "vbr_quality_val", |
984 | 174 &vbr_quality_val); |
2124 | 175 aud_cfg_db_get_int(db, "filewriter_mp3", "abr_val", &abr_val); |
176 aud_cfg_db_get_int(db, "filewriter_mp3", "toggle_xing_val", | |
984 | 177 &toggle_xing_val); |
2124 | 178 aud_cfg_db_get_int(db, "filewriter_mp3", "mark_original_val", |
984 | 179 &mark_original_val); |
2124 | 180 aud_cfg_db_get_int(db, "filewriter_mp3", "mark_copyright_val", |
984 | 181 &mark_copyright_val); |
2124 | 182 aud_cfg_db_get_int(db, "filewriter_mp3", "force_v2_val", &force_v2_val); |
183 aud_cfg_db_get_int(db, "filewriter_mp3", "only_v1_val", &only_v1_val); | |
184 aud_cfg_db_get_int(db, "filewriter_mp3", "only_v2_val", &only_v2_val); | |
185 aud_cfg_db_get_int(db, "filewriter_mp3", "algo_quality_val", | |
984 | 186 &algo_quality_val); |
2124 | 187 aud_cfg_db_get_int(db, "filewriter_mp3", "out_samplerate_val", |
984 | 188 &out_samplerate_val); |
2124 | 189 aud_cfg_db_get_int(db, "filewriter_mp3", "bitrate_val", &bitrate_val); |
190 aud_cfg_db_get_float(db, "filewriter_mp3", "compression_val", | |
984 | 191 &compression_val); |
2124 | 192 aud_cfg_db_get_int(db, "filewriter_mp3", "enc_toggle_val", &enc_toggle_val); |
193 aud_cfg_db_get_int(db, "filewriter_mp3", "audio_mode_val", &audio_mode_val); | |
194 aud_cfg_db_get_int(db, "filewriter_mp3", "auto_ms_val", &auto_ms_val); | |
195 aud_cfg_db_get_int(db, "filewriter_mp3", "enforce_iso_val", | |
984 | 196 &enforce_iso_val); |
2124 | 197 aud_cfg_db_get_int(db, "filewriter_mp3", "error_protect_val", |
984 | 198 &error_protect_val); |
2124 | 199 aud_cfg_db_close(db); |
2766
6d08e3120615
make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2461
diff
changeset
|
200 if (write_output_func) |
6d08e3120615
make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2461
diff
changeset
|
201 write_output=write_output_func; |
984 | 202 } |
203 | |
204 static gint mp3_open(void) | |
205 { | |
2830
b17cffd47053
fix time display and playback; don't know why, but playing=0 makes it happy
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
206 olen = 0; |
b17cffd47053
fix time display and playback; don't know why, but playing=0 makes it happy
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
207 |
2461
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
208 gfp = lame_init(); |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
209 if (gfp == NULL) |
984 | 210 return 0; |
211 | |
212 /* setup id3 data */ | |
213 id3tag_init(gfp); | |
214 | |
215 if (tuple) { | |
216 /* XXX write UTF-8 even though libmp3lame does id3v2.3. --yaz */ | |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1687
diff
changeset
|
217 lameid3.track_name = g_strdup(aud_tuple_get_string(tuple, FIELD_TITLE, NULL)); |
984 | 218 id3tag_set_title(gfp, lameid3.track_name); |
219 | |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1687
diff
changeset
|
220 lameid3.performer = g_strdup(aud_tuple_get_string(tuple, FIELD_ARTIST, NULL)); |
984 | 221 id3tag_set_artist(gfp, lameid3.performer); |
222 | |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1687
diff
changeset
|
223 lameid3.album_name = g_strdup(aud_tuple_get_string(tuple, FIELD_ALBUM, NULL)); |
984 | 224 id3tag_set_album(gfp, lameid3.album_name); |
225 | |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1687
diff
changeset
|
226 lameid3.genre = g_strdup(aud_tuple_get_string(tuple, FIELD_GENRE, NULL)); |
984 | 227 id3tag_set_genre(gfp, lameid3.genre); |
228 | |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1687
diff
changeset
|
229 lameid3.year = g_strdup_printf("%d", aud_tuple_get_int(tuple, FIELD_YEAR, NULL)); |
984 | 230 id3tag_set_year(gfp, lameid3.year); |
231 | |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1687
diff
changeset
|
232 lameid3.track_number = g_strdup_printf("%d", aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL)); |
984 | 233 id3tag_set_track(gfp, lameid3.track_number); |
234 | |
2461
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
235 if(force_v2_val) { |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
236 id3tag_add_v2(gfp); |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
237 } |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
238 if(only_v1_val) { |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
239 id3tag_v1_only(gfp); |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
240 } |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
241 if(only_v2_val) { |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
242 id3tag_v2_only(gfp); |
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
243 } |
984 | 244 } |
245 | |
246 /* input stream description */ | |
247 | |
248 lame_set_in_samplerate(gfp, input.frequency); | |
249 lame_set_num_channels(gfp, input.channels); | |
250 /* Maybe implement this? */ | |
251 /* lame_set_scale(lame_global_flags *, float); */ | |
252 lame_set_out_samplerate(gfp, out_samplerate_val); | |
253 | |
254 /* general control parameters */ | |
255 | |
256 lame_set_bWriteVbrTag(gfp, toggle_xing_val); | |
257 lame_set_quality(gfp, algo_quality_val); | |
258 if (audio_mode_val != 4) { | |
2275
e09d9633d6aa
- mp3_playing() should return 0 for now otherwise mp4 playback would halt at the end of a track.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2124
diff
changeset
|
259 AUDDBG("set mode to %d\n", audio_mode_val); |
984 | 260 lame_set_mode(gfp, audio_mode_val); |
261 } | |
262 if(auto_ms_val) | |
263 lame_set_mode_automs(gfp, auto_ms_val); // this forces to use joint stereo!! --yaz. | |
264 | |
265 lame_set_errorf(gfp, lame_debugf); | |
266 lame_set_debugf(gfp, lame_debugf); | |
267 lame_set_msgf(gfp, lame_debugf); | |
268 | |
269 if (enc_toggle_val == 0 && vbr_on == 0) | |
270 lame_set_brate(gfp, bitrate_val); | |
271 else if (vbr_on == 0) | |
272 lame_set_compression_ratio(gfp, compression_val); | |
273 | |
274 /* frame params */ | |
275 | |
276 lame_set_copyright(gfp, mark_copyright_val); | |
277 lame_set_original(gfp, mark_original_val); | |
278 lame_set_error_protection(gfp, error_protect_val); | |
279 lame_set_strict_ISO(gfp, enforce_iso_val); | |
280 | |
281 if (vbr_on != 0) { | |
282 if (vbr_type == 0) | |
283 lame_set_VBR(gfp, 2); | |
284 else | |
285 lame_set_VBR(gfp, 3); | |
286 lame_set_VBR_q(gfp, vbr_quality_val); | |
287 lame_set_VBR_mean_bitrate_kbps(gfp, abr_val); | |
288 lame_set_VBR_min_bitrate_kbps(gfp, vbr_min_val); | |
289 lame_set_VBR_max_bitrate_kbps(gfp, vbr_max_val); | |
290 lame_set_VBR_hard_min(gfp, enforce_min_val); | |
291 } | |
292 | |
293 if (lame_init_params(gfp) == -1) | |
294 return 0; | |
295 | |
296 return 1; | |
297 } | |
298 | |
299 static void mp3_write(void *ptr, gint length) | |
300 { | |
301 if (input.channels == 1) { | |
302 encout = | |
303 lame_encode_buffer(gfp, ptr, ptr, length / 2, encbuffer, | |
304 ENCBUFFER_SIZE); | |
305 } | |
306 else { | |
307 encout = | |
308 lame_encode_buffer_interleaved(gfp, ptr, length / 4, encbuffer, | |
309 ENCBUFFER_SIZE); | |
310 } | |
311 | |
2766
6d08e3120615
make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2461
diff
changeset
|
312 write_output(encbuffer, encout); |
984 | 313 written += encout; |
314 olen += length; | |
315 } | |
316 | |
2774
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
317 static void mp3_flush(void) |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
318 { |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
319 encout = lame_encode_flush_nogap(gfp, encbuffer, ENCBUFFER_SIZE); |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
320 write_output(encbuffer, encout); |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
321 } |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
322 |
984 | 323 static void mp3_close(void) |
324 { | |
325 if (output_file) | |
326 { | |
327 encout = lame_encode_flush_nogap(gfp, encbuffer, ENCBUFFER_SIZE); | |
2766
6d08e3120615
make some file filewriter backends use callbacks instead of calling VFS directly
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2461
diff
changeset
|
328 write_output(encbuffer, encout); |
984 | 329 |
2461
85e03a981a7c
take care of force_v2_val, only_v1_val and only_v2_val
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2275
diff
changeset
|
330 // lame_mp3_tags_fid(gfp, output_file); // will erase id3v2 tag?? |
984 | 331 |
332 olen = 0; | |
333 } | |
2774
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
334 |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
335 lame_close(gfp); |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
336 AUDDBG("lame_close() done\n"); |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
337 |
f1f7ee810de8
add metadata to stream + flush() should do a real flush at least with mp3
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2766
diff
changeset
|
338 free_lameid3(&lameid3); |
984 | 339 } |
340 | |
341 static gint mp3_free(void) | |
342 { | |
343 return ENCBUFFER_SIZE - encout; | |
344 } | |
345 | |
346 static gint mp3_playing(void) | |
347 { | |
2275
e09d9633d6aa
- mp3_playing() should return 0 for now otherwise mp4 playback would halt at the end of a track.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
2124
diff
changeset
|
348 return 0; |
984 | 349 } |
350 | |
351 static gint mp3_get_written_time(void) | |
352 { | |
353 gint time; | |
354 if (input.frequency && input.channels) { | |
355 time = (gint) ((olen * 1000) / (input.frequency * 2 * input.channels)); | |
356 return time + offset; | |
357 } | |
358 | |
359 return 0; | |
360 } | |
361 | |
362 /*****************/ | |
363 /* Configuration */ | |
364 /*****************/ | |
365 | |
366 /* Various Singal-Fuctions */ | |
367 | |
368 static void algo_qual(GtkAdjustment * adjustment, gpointer user_data) | |
369 { | |
370 | |
371 algo_quality_val = | |
372 gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON | |
373 (alg_quality_spin)); | |
374 | |
375 } | |
376 | |
377 static void samplerate_activate(GtkMenuItem * menuitem, gpointer user_data) | |
378 { | |
379 | |
380 out_samplerate_val = GPOINTER_TO_INT(user_data); | |
381 | |
382 } | |
383 | |
384 static void bitrate_activate(GtkMenuItem * menuitem, gpointer user_data) | |
385 { | |
386 | |
387 bitrate_val = GPOINTER_TO_INT(user_data); | |
388 | |
389 } | |
390 | |
391 static void compression_change(GtkAdjustment * adjustment, | |
392 gpointer user_data) | |
393 { | |
394 | |
395 compression_val = | |
396 gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON | |
397 (compression_spin)); | |
398 | |
399 } | |
400 | |
401 static void encoding_toggle(GtkToggleButton * togglebutton, | |
402 gpointer user_data) | |
403 { | |
404 | |
405 enc_toggle_val = GPOINTER_TO_INT(user_data); | |
406 | |
407 } | |
408 | |
409 static void mode_activate(GtkMenuItem * menuitem, gpointer user_data) | |
410 { | |
411 | |
412 audio_mode_val = GPOINTER_TO_INT(user_data); | |
413 | |
414 } | |
415 | |
416 static void toggle_auto_ms(GtkToggleButton * togglebutton, | |
417 gpointer user_data) | |
418 { | |
419 | |
420 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ms_mode_toggle)) == | |
421 TRUE) | |
422 auto_ms_val = 1; | |
423 else | |
424 auto_ms_val = 0; | |
425 | |
426 } | |
427 | |
428 static void toggle_enforce_iso(GtkToggleButton * togglebutton, | |
429 gpointer user_data) | |
430 { | |
431 | |
432 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enforce_iso_toggle)) | |
433 == TRUE) | |
434 enforce_iso_val = 1; | |
435 else | |
436 enforce_iso_val = 0; | |
437 | |
438 } | |
439 | |
440 static void toggle_error_protect(GtkToggleButton * togglebutton, | |
441 gpointer user_data) | |
442 { | |
443 | |
444 if (gtk_toggle_button_get_active | |
445 (GTK_TOGGLE_BUTTON(error_protection_toggle)) == TRUE) | |
446 error_protect_val = 1; | |
447 else | |
448 error_protect_val = 0; | |
449 | |
450 } | |
451 | |
452 static void toggle_vbr(GtkToggleButton * togglebutton, gpointer user_data) | |
453 { | |
454 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(vbr_toggle)) == | |
455 TRUE) { | |
456 gtk_widget_set_sensitive(vbr_options_vbox, TRUE); | |
457 gtk_widget_set_sensitive(enc_quality_frame, FALSE); | |
458 vbr_on = 1; | |
459 | |
460 if (vbr_type == 0) { | |
461 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
462 (vbr_type_radio1), TRUE); | |
463 gtk_widget_set_sensitive(abr_frame, FALSE); | |
464 gtk_widget_set_sensitive(vbr_frame, TRUE); | |
465 } | |
466 else if (vbr_type == 1) { | |
467 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
468 (vbr_type_radio2), TRUE); | |
469 gtk_widget_set_sensitive(abr_frame, TRUE); | |
470 gtk_widget_set_sensitive(vbr_frame, FALSE); | |
471 } | |
472 | |
473 } | |
474 else { | |
475 gtk_widget_set_sensitive(vbr_options_vbox, FALSE); | |
476 gtk_widget_set_sensitive(enc_quality_frame, TRUE); | |
477 vbr_on = 0; | |
478 } | |
479 } | |
480 | |
481 static void vbr_abr_toggle(GtkToggleButton * togglebutton, | |
482 gpointer user_data) | |
483 { | |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
1004
diff
changeset
|
484 if (!strcmp(user_data, "VBR")) { |
984 | 485 gtk_widget_set_sensitive(abr_frame, FALSE); |
486 gtk_widget_set_sensitive(vbr_frame, TRUE); | |
487 vbr_type = 0; | |
488 } | |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
1004
diff
changeset
|
489 else if (!strcmp(user_data, "ABR")) { |
984 | 490 gtk_widget_set_sensitive(abr_frame, TRUE); |
491 gtk_widget_set_sensitive(vbr_frame, FALSE); | |
492 vbr_type = 1; | |
493 } | |
494 } | |
495 | |
496 static void vbr_min_activate(GtkMenuItem * menuitem, gpointer user_data) | |
497 { | |
498 | |
499 vbr_min_val = GPOINTER_TO_INT(user_data); | |
500 | |
501 } | |
502 | |
503 static void vbr_max_activate(GtkMenuItem * menuitem, gpointer user_data) | |
504 { | |
505 | |
506 vbr_max_val = GPOINTER_TO_INT(user_data); | |
507 | |
508 } | |
509 | |
510 static void toggle_enforce_min(GtkToggleButton * togglebutton, | |
511 gpointer user_data) | |
512 { | |
513 | |
514 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enforce_min_toggle)) | |
515 == TRUE) | |
516 enforce_min_val = 1; | |
517 else | |
518 enforce_min_val = 0; | |
519 | |
520 } | |
521 | |
522 static void vbr_qual(GtkAdjustment * adjustment, gpointer user_data) | |
523 { | |
524 | |
525 vbr_quality_val = | |
526 gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON | |
527 (vbr_quality_spin)); | |
528 | |
529 } | |
530 | |
531 static void abr_activate(GtkMenuItem * menuitem, gpointer user_data) | |
532 { | |
533 | |
534 abr_val = GPOINTER_TO_INT(user_data); | |
535 | |
536 } | |
537 | |
538 static void toggle_xing(GtkToggleButton * togglebutton, gpointer user_data) | |
539 { | |
540 | |
541 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(xing_header_toggle)) == TRUE) | |
542 toggle_xing_val = 0; | |
543 else | |
544 toggle_xing_val = 1; | |
545 | |
546 } | |
547 | |
548 static void toggle_original(GtkToggleButton * togglebutton, | |
549 gpointer user_data) | |
550 { | |
551 | |
552 if (gtk_toggle_button_get_active | |
553 (GTK_TOGGLE_BUTTON(tags_original_toggle)) == TRUE) | |
554 mark_original_val = 1; | |
555 else | |
556 mark_original_val = 0; | |
557 | |
558 } | |
559 | |
560 static void toggle_copyright(GtkToggleButton * togglebutton, | |
561 gpointer user_data) | |
562 { | |
563 | |
564 if (gtk_toggle_button_get_active | |
565 (GTK_TOGGLE_BUTTON(tags_copyright_toggle)) == TRUE) | |
566 mark_copyright_val = 1; | |
567 else | |
568 mark_copyright_val = 0; | |
569 | |
570 } | |
571 | |
572 static void force_v2_toggle(GtkToggleButton * togglebutton, | |
573 gpointer user_data) | |
574 { | |
575 | |
576 if (gtk_toggle_button_get_active | |
577 (GTK_TOGGLE_BUTTON(tags_force_id3v2_toggle)) == TRUE) { | |
578 force_v2_val = 1; | |
579 if (gtk_toggle_button_get_active | |
580 (GTK_TOGGLE_BUTTON(tags_only_v1_toggle)) == TRUE) { | |
581 inside = 1; | |
582 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
583 (tags_only_v1_toggle), FALSE); | |
584 only_v1_val = 0; | |
585 inside = 0; | |
586 } | |
587 } | |
588 else | |
589 force_v2_val = 0; | |
590 | |
591 } | |
592 | |
593 static void id3_only_version(GtkToggleButton * togglebutton, | |
594 gpointer user_data) | |
595 { | |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
1004
diff
changeset
|
596 if (!strcmp(user_data, "v1") && inside != 1) { |
984 | 597 if (gtk_toggle_button_get_active |
598 (GTK_TOGGLE_BUTTON(tags_only_v1_toggle)) == TRUE); | |
599 { | |
600 inside = 1; | |
601 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
602 (tags_only_v2_toggle), FALSE); | |
603 only_v1_val = 1; | |
604 only_v2_val = 0; | |
605 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
606 (tags_force_id3v2_toggle), FALSE); | |
607 inside = 0; | |
608 } | |
609 } | |
1044
b1128efde471
[svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents:
1004
diff
changeset
|
610 else if (!strcmp(user_data, "v2") && inside != 1) { |
984 | 611 if (gtk_toggle_button_get_active |
612 (GTK_TOGGLE_BUTTON(tags_only_v2_toggle)) == TRUE); | |
613 { | |
614 inside = 1; | |
615 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
616 (tags_only_v1_toggle), FALSE); | |
617 only_v1_val = 0; | |
618 only_v2_val = 1; | |
619 inside = 0; | |
620 } | |
621 } | |
622 | |
623 } | |
624 | |
625 | |
626 | |
627 /* Save Configuration */ | |
628 | |
629 static void configure_ok_cb(gpointer data) | |
630 { | |
631 ConfigDb *db; | |
632 | |
633 if (vbr_min_val > vbr_max_val) | |
634 vbr_max_val = vbr_min_val; | |
635 | |
2124 | 636 db = aud_cfg_db_open(); |
984 | 637 |
2124 | 638 aud_cfg_db_set_int(db, "filewriter_mp3", "vbr_on", vbr_on); |
639 aud_cfg_db_set_int(db, "filewriter_mp3", "vbr_type", vbr_type); | |
640 aud_cfg_db_set_int(db, "filewriter_mp3", "vbr_min_val", vbr_min_val); | |
641 aud_cfg_db_set_int(db, "filewriter_mp3", "vbr_max_val", vbr_max_val); | |
642 aud_cfg_db_set_int(db, "filewriter_mp3", "enforce_min_val", enforce_min_val); | |
643 aud_cfg_db_set_int(db, "filewriter_mp3", "vbr_quality_val", vbr_quality_val); | |
644 aud_cfg_db_set_int(db, "filewriter_mp3", "abr_val", abr_val); | |
645 aud_cfg_db_set_int(db, "filewriter_mp3", "toggle_xing_val", toggle_xing_val); | |
646 aud_cfg_db_set_int(db, "filewriter_mp3", "mark_original_val", | |
984 | 647 mark_original_val); |
2124 | 648 aud_cfg_db_set_int(db, "filewriter_mp3", "mark_copyright_val", |
984 | 649 mark_copyright_val); |
2124 | 650 aud_cfg_db_set_int(db, "filewriter_mp3", "force_v2_val", force_v2_val); |
651 aud_cfg_db_set_int(db, "filewriter_mp3", "only_v1_val", only_v1_val); | |
652 aud_cfg_db_set_int(db, "filewriter_mp3", "only_v2_val", only_v2_val); | |
653 aud_cfg_db_set_int(db, "filewriter_mp3", "algo_quality_val", | |
984 | 654 algo_quality_val); |
2124 | 655 aud_cfg_db_set_int(db, "filewriter_mp3", "out_samplerate_val", |
984 | 656 out_samplerate_val); |
2124 | 657 aud_cfg_db_set_int(db, "filewriter_mp3", "bitrate_val", bitrate_val); |
658 aud_cfg_db_set_float(db, "filewriter_mp3", "compression_val", | |
984 | 659 compression_val); |
2124 | 660 aud_cfg_db_set_int(db, "filewriter_mp3", "enc_toggle_val", enc_toggle_val); |
661 aud_cfg_db_set_int(db, "filewriter_mp3", "audio_mode_val", audio_mode_val); | |
662 aud_cfg_db_set_int(db, "filewriter_mp3", "auto_ms_val", auto_ms_val); | |
663 aud_cfg_db_set_int(db, "filewriter_mp3", "enforce_iso_val", enforce_iso_val); | |
664 aud_cfg_db_set_int(db, "filewriter_mp3", "error_protect_val", | |
984 | 665 error_protect_val); |
2124 | 666 aud_cfg_db_close(db); |
984 | 667 |
668 | |
669 gtk_widget_destroy(configure_win); | |
670 } | |
671 | |
672 | |
673 /************************/ | |
674 /* Configuration Widget */ | |
675 /************************/ | |
676 | |
677 | |
678 static void mp3_configure(void) | |
679 { | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
680 gint i; |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
681 |
984 | 682 if (!configure_win) { |
683 configure_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
684 | |
685 gtk_signal_connect(GTK_OBJECT(configure_win), "destroy", | |
686 GTK_SIGNAL_FUNC(gtk_widget_destroyed), | |
687 &configure_win); | |
688 gtk_window_set_title(GTK_WINDOW(configure_win), | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
689 _("MP3 Configuration")); |
984 | 690 gtk_window_set_position(GTK_WINDOW(configure_win), |
691 GTK_WIN_POS_MOUSE); | |
692 gtk_window_set_policy(GTK_WINDOW(configure_win), FALSE, TRUE, | |
693 FALSE); | |
694 gtk_container_set_border_width(GTK_CONTAINER(configure_win), 5); | |
695 | |
696 vbox = gtk_vbox_new(FALSE, 5); | |
697 gtk_container_add(GTK_CONTAINER(configure_win), vbox); | |
698 | |
699 notebook = gtk_notebook_new(); | |
700 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0); | |
701 | |
702 | |
703 /* Quality */ | |
704 | |
705 quality_vbox = gtk_vbox_new(FALSE, 5); | |
706 gtk_container_set_border_width(GTK_CONTAINER(quality_vbox), 5); | |
707 | |
708 quality_tips = gtk_tooltips_new(); | |
709 | |
710 quality_hbox1 = gtk_hbox_new(FALSE, 5); | |
711 gtk_box_pack_start(GTK_BOX(quality_vbox), quality_hbox1, FALSE, | |
712 FALSE, 0); | |
713 | |
714 /* Algorithm Quality */ | |
715 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
716 alg_quality_frame = gtk_frame_new(_("Algorithm Quality:")); |
984 | 717 gtk_container_set_border_width(GTK_CONTAINER(alg_quality_frame), |
718 5); | |
719 gtk_box_pack_start(GTK_BOX(quality_hbox1), alg_quality_frame, | |
720 FALSE, FALSE, 0); | |
721 | |
722 alg_quality_hbox = gtk_hbox_new(FALSE, 5); | |
723 gtk_container_set_border_width(GTK_CONTAINER(alg_quality_hbox), | |
724 10); | |
725 gtk_container_add(GTK_CONTAINER(alg_quality_frame), | |
726 alg_quality_hbox); | |
727 | |
728 alg_quality_adj = gtk_adjustment_new(5, 0, 9, 1, 1, 1); | |
729 alg_quality_spin = | |
730 gtk_spin_button_new(GTK_ADJUSTMENT(alg_quality_adj), 8, 0); | |
731 gtk_widget_set_usize(alg_quality_spin, 20, 28); | |
732 gtk_box_pack_start(GTK_BOX(alg_quality_hbox), alg_quality_spin, | |
733 TRUE, TRUE, 0); | |
734 gtk_signal_connect(GTK_OBJECT(alg_quality_adj), "value-changed", | |
735 GTK_SIGNAL_FUNC(algo_qual), NULL); | |
736 | |
737 gtk_tooltips_set_tip(GTK_TOOLTIPS(quality_tips), alg_quality_spin, | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
738 _("best/slowest:0;\nworst/fastest:9;\nrecommended:2;\ndefault:5;"), |
984 | 739 ""); |
740 | |
741 gtk_spin_button_set_value(GTK_SPIN_BUTTON(alg_quality_spin), | |
742 algo_quality_val); | |
743 | |
744 /* Output Samplerate */ | |
745 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
746 samplerate_frame = gtk_frame_new(_("Output Samplerate:")); |
984 | 747 gtk_container_set_border_width(GTK_CONTAINER(samplerate_frame), 5); |
748 gtk_box_pack_start(GTK_BOX(quality_hbox1), samplerate_frame, FALSE, | |
749 FALSE, 0); | |
750 | |
751 samplerate_hbox = gtk_hbox_new(TRUE, 5); | |
752 gtk_container_set_border_width(GTK_CONTAINER(samplerate_hbox), 10); | |
753 gtk_container_add(GTK_CONTAINER(samplerate_frame), | |
754 samplerate_hbox); | |
755 samplerate_option_menu = gtk_option_menu_new(); | |
756 samplerate_menu = gtk_menu_new(); | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
757 samplerate_menu_item = gtk_menu_item_new_with_label(_("Auto")); |
984 | 758 gtk_signal_connect(GTK_OBJECT(samplerate_menu_item), "activate", |
759 GTK_SIGNAL_FUNC(samplerate_activate), | |
760 GINT_TO_POINTER(0)); | |
761 gtk_menu_append(GTK_MENU(samplerate_menu), samplerate_menu_item); | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
762 |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
763 for (i = 0; i < sizeof(available_samplerates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
764 { |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
765 gchar *string = g_strdup_printf("%d", available_samplerates[i]); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
766 samplerate_menu_item = gtk_menu_item_new_with_label(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
767 gtk_signal_connect(GTK_OBJECT(samplerate_menu_item), "activate", |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
768 GTK_SIGNAL_FUNC(samplerate_activate), |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
769 GINT_TO_POINTER(available_samplerates[i])); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
770 gtk_menu_append(GTK_MENU(samplerate_menu), samplerate_menu_item); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
771 g_free(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
772 } |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
773 |
984 | 774 gtk_option_menu_set_menu(GTK_OPTION_MENU(samplerate_option_menu), |
775 samplerate_menu); | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
776 gtk_widget_set_usize(samplerate_option_menu, 75, 28); |
984 | 777 gtk_box_pack_start(GTK_BOX(samplerate_hbox), |
778 samplerate_option_menu, FALSE, FALSE, 0); | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
779 samplerate_label = gtk_label_new(_("(Hz)")); |
984 | 780 gtk_misc_set_alignment(GTK_MISC(samplerate_label), 0, 0.5); |
781 gtk_box_pack_start(GTK_BOX(samplerate_hbox), samplerate_label, | |
782 FALSE, FALSE, 0); | |
783 | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
784 for (i = 0; i < sizeof(available_samplerates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
785 if (out_samplerate_val == available_samplerates[i]) |
984 | 786 gtk_option_menu_set_history(GTK_OPTION_MENU |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
787 (samplerate_option_menu), i+1); |
984 | 788 |
789 /* Encoder Quality */ | |
790 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
791 enc_quality_frame = gtk_frame_new(_("Bitrate / Compression ratio:")); |
984 | 792 gtk_container_set_border_width(GTK_CONTAINER(enc_quality_frame), |
793 5); | |
794 gtk_box_pack_start(GTK_BOX(quality_vbox), enc_quality_frame, FALSE, | |
795 FALSE, 0); | |
796 | |
797 | |
798 /* yaz new code */ | |
799 // vbox sorrounding hbox1 and hbox2 | |
800 enc_quality_vbox = gtk_vbox_new(FALSE, 5); | |
801 gtk_container_set_border_width(GTK_CONTAINER(enc_quality_vbox), 10); | |
802 | |
803 // pack vbox to frame | |
804 gtk_container_add(GTK_CONTAINER(enc_quality_frame), enc_quality_vbox); | |
805 | |
806 // hbox1 for bitrate | |
807 hbox1 = gtk_hbox_new(FALSE, 5); | |
808 gtk_container_add(GTK_CONTAINER(enc_quality_vbox), hbox1); | |
809 | |
810 // radio 1 | |
811 enc_radio1 = gtk_radio_button_new(NULL); | |
812 if (enc_toggle_val == 0) | |
813 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enc_radio1), TRUE); | |
814 gtk_box_pack_start(GTK_BOX(hbox1), enc_radio1, FALSE, FALSE, 0); | |
815 | |
816 // label 1 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
817 enc_quality_label1 = gtk_label_new(_("Bitrate (kbps):")); |
984 | 818 gtk_box_pack_start(GTK_BOX(hbox1), enc_quality_label1, FALSE, FALSE, 0); |
819 | |
820 // bitrate menu | |
821 bitrate_option_menu = gtk_option_menu_new(); | |
822 bitrate_menu = gtk_menu_new(); | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
823 |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
824 for (i = 0; i < sizeof(available_bitrates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
825 { |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
826 gchar *string = g_strdup_printf("%d", available_bitrates[i]); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
827 bitrate_menu_item = gtk_menu_item_new_with_label(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
828 gtk_signal_connect(GTK_OBJECT(bitrate_menu_item), "activate", |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
829 GTK_SIGNAL_FUNC(bitrate_activate), |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
830 GINT_TO_POINTER(available_bitrates[i])); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
831 gtk_menu_append(GTK_MENU(bitrate_menu), bitrate_menu_item); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
832 g_free(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
833 } |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
834 |
984 | 835 gtk_option_menu_set_menu(GTK_OPTION_MENU(bitrate_option_menu), |
836 bitrate_menu); | |
837 gtk_widget_set_usize(bitrate_option_menu, 80, 28); | |
838 gtk_box_pack_end(GTK_BOX(hbox1), bitrate_option_menu, FALSE, FALSE, 0); | |
839 | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
840 for (i = 0; i < sizeof(available_bitrates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
841 if (bitrate_val == available_bitrates[i]) |
984 | 842 gtk_option_menu_set_history(GTK_OPTION_MENU |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
843 (bitrate_option_menu), i); |
984 | 844 |
845 // hbox2 for compression ratio | |
846 hbox2 = gtk_hbox_new(FALSE, 5); | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
847 gtk_container_add(GTK_CONTAINER(enc_quality_vbox), hbox2); |
984 | 848 |
849 // radio 2 | |
850 enc_radio2 = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(enc_radio1)); | |
851 if (enc_toggle_val == 1) | |
852 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enc_radio2), | |
853 TRUE); | |
854 // pack radio 2 | |
855 gtk_box_pack_start(GTK_BOX(hbox2), enc_radio2, FALSE, FALSE, 0); | |
856 | |
857 // label | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
858 enc_quality_label2 = gtk_label_new(_("Compression ratio:")); |
984 | 859 gtk_box_pack_start(GTK_BOX(hbox2), enc_quality_label2, FALSE, FALSE, 0); |
860 | |
861 // comp-ratio spin | |
862 compression_adj = gtk_adjustment_new(11, 0, 100, 1, 1, 1); | |
863 compression_spin = | |
864 gtk_spin_button_new(GTK_ADJUSTMENT(compression_adj), 8, 0); | |
865 gtk_widget_set_usize(compression_spin, 40, 28); | |
866 gtk_container_add(GTK_CONTAINER(hbox2), compression_spin); | |
867 gtk_box_pack_end(GTK_BOX(hbox2), compression_spin, FALSE, FALSE, 0); | |
868 | |
869 gtk_signal_connect(GTK_OBJECT(compression_adj), "value-changed", | |
870 GTK_SIGNAL_FUNC(compression_change), NULL); | |
871 | |
872 gtk_spin_button_set_value(GTK_SPIN_BUTTON(compression_spin), | |
873 compression_val); | |
874 | |
875 // radio button signale connect | |
876 gtk_signal_connect(GTK_OBJECT(enc_radio1), "toggled", | |
877 GTK_SIGNAL_FUNC(encoding_toggle), | |
878 GINT_TO_POINTER(0)); | |
879 gtk_signal_connect(GTK_OBJECT(enc_radio2), "toggled", | |
880 GTK_SIGNAL_FUNC(encoding_toggle), | |
881 GINT_TO_POINTER(1)); | |
882 | |
883 /* end of yaz new code */ | |
884 | |
885 | |
886 /* Audio Mode */ | |
887 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
888 mode_frame = gtk_frame_new(_("Audio Mode:")); |
984 | 889 gtk_container_set_border_width(GTK_CONTAINER(mode_frame), 5); |
890 gtk_box_pack_start(GTK_BOX(quality_vbox), mode_frame, FALSE, FALSE, | |
891 0); | |
892 | |
893 mode_hbox = gtk_hbox_new(TRUE, 10); | |
894 gtk_container_set_border_width(GTK_CONTAINER(mode_hbox), 10); | |
895 gtk_container_add(GTK_CONTAINER(mode_frame), mode_hbox); | |
896 mode_option_menu = gtk_option_menu_new(); | |
897 mode_menu = gtk_menu_new(); | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
898 mode_menu_item = gtk_menu_item_new_with_label(_("Auto")); |
984 | 899 gtk_signal_connect(GTK_OBJECT(mode_menu_item), "activate", |
900 GTK_SIGNAL_FUNC(mode_activate), | |
901 GINT_TO_POINTER(4)); | |
902 gtk_menu_append(GTK_MENU(mode_menu), mode_menu_item); | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
903 mode_menu_item = gtk_menu_item_new_with_label(_("Joint-Stereo")); |
984 | 904 gtk_signal_connect(GTK_OBJECT(mode_menu_item), "activate", |
905 GTK_SIGNAL_FUNC(mode_activate), | |
906 GINT_TO_POINTER(1)); | |
907 gtk_menu_append(GTK_MENU(mode_menu), mode_menu_item); | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
908 mode_menu_item = gtk_menu_item_new_with_label(_("Stereo")); |
984 | 909 gtk_signal_connect(GTK_OBJECT(mode_menu_item), "activate", |
910 GTK_SIGNAL_FUNC(mode_activate), | |
911 GINT_TO_POINTER(0)); | |
912 gtk_menu_append(GTK_MENU(mode_menu), mode_menu_item); | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
913 mode_menu_item = gtk_menu_item_new_with_label(_("Mono")); |
984 | 914 gtk_signal_connect(GTK_OBJECT(mode_menu_item), "activate", |
915 GTK_SIGNAL_FUNC(mode_activate), | |
916 GINT_TO_POINTER(3)); | |
917 gtk_menu_append(GTK_MENU(mode_menu), mode_menu_item); | |
918 gtk_option_menu_set_menu(GTK_OPTION_MENU(mode_option_menu), | |
919 mode_menu); | |
920 gtk_widget_set_usize(mode_option_menu, 50, 28); | |
921 gtk_box_pack_start(GTK_BOX(mode_hbox), mode_option_menu, TRUE, | |
922 TRUE, 2); | |
923 | |
924 switch (audio_mode_val) { | |
925 | |
926 case 4: | |
927 gtk_option_menu_set_history(GTK_OPTION_MENU(mode_option_menu), | |
928 0); | |
929 break; | |
930 case 1: | |
931 gtk_option_menu_set_history(GTK_OPTION_MENU(mode_option_menu), | |
932 1); | |
933 break; | |
934 case 0: | |
935 gtk_option_menu_set_history(GTK_OPTION_MENU(mode_option_menu), | |
936 2); | |
937 break; | |
938 case 3: | |
939 gtk_option_menu_set_history(GTK_OPTION_MENU(mode_option_menu), | |
940 3); | |
941 break; | |
942 } | |
943 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
944 ms_mode_toggle = gtk_check_button_new_with_label(_("auto-M/S mode")); |
984 | 945 gtk_box_pack_start(GTK_BOX(mode_hbox), ms_mode_toggle, TRUE, TRUE, |
946 5); | |
947 gtk_signal_connect(GTK_OBJECT(ms_mode_toggle), "toggled", | |
948 GTK_SIGNAL_FUNC(toggle_auto_ms), NULL); | |
949 | |
950 if (auto_ms_val == 1) | |
951 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ms_mode_toggle), | |
952 TRUE); | |
953 | |
954 /* Misc */ | |
955 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
956 misc_frame = gtk_frame_new(_("Misc:")); |
984 | 957 gtk_container_set_border_width(GTK_CONTAINER(misc_frame), 5); |
958 gtk_box_pack_start(GTK_BOX(quality_vbox), misc_frame, FALSE, FALSE, | |
959 0); | |
960 | |
961 misc_vbox = gtk_vbox_new(TRUE, 5); | |
962 gtk_container_set_border_width(GTK_CONTAINER(misc_vbox), 5); | |
963 gtk_container_add(GTK_CONTAINER(misc_frame), misc_vbox); | |
964 | |
965 enforce_iso_toggle = | |
966 gtk_check_button_new_with_label | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
967 (_("Enforce strict ISO complience")); |
984 | 968 gtk_box_pack_start(GTK_BOX(misc_vbox), enforce_iso_toggle, TRUE, |
969 TRUE, 2); | |
970 gtk_signal_connect(GTK_OBJECT(enforce_iso_toggle), "toggled", | |
971 GTK_SIGNAL_FUNC(toggle_enforce_iso), NULL); | |
972 | |
973 if (enforce_iso_val == 1) | |
974 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
975 (enforce_iso_toggle), TRUE); | |
976 | |
977 error_protection_toggle = | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
978 gtk_check_button_new_with_label(_("Error protection")); |
984 | 979 gtk_box_pack_start(GTK_BOX(misc_vbox), error_protection_toggle, |
980 TRUE, TRUE, 2); | |
981 gtk_signal_connect(GTK_OBJECT(error_protection_toggle), "toggled", | |
982 GTK_SIGNAL_FUNC(toggle_error_protect), NULL); | |
983 | |
984 if (error_protect_val == 1) | |
985 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
986 (error_protection_toggle), TRUE); | |
987 | |
988 gtk_tooltips_set_tip(GTK_TOOLTIPS(quality_tips), | |
989 error_protection_toggle, | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
990 _("Adds 16 bit checksum to every frame"), ""); |
984 | 991 |
992 | |
993 /* Add the Notebook */ | |
994 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), quality_vbox, | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
995 gtk_label_new(_("Quality"))); |
984 | 996 |
997 | |
998 /* VBR/ABR */ | |
999 | |
1000 vbr_vbox = gtk_vbox_new(FALSE, 5); | |
1001 gtk_container_set_border_width(GTK_CONTAINER(vbr_vbox), 5); | |
1002 | |
1003 vbr_tips = gtk_tooltips_new(); | |
1004 | |
1005 /* Toggle VBR */ | |
1006 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1007 vbr_toggle = gtk_check_button_new_with_label(_("Enable VBR/ABR")); |
984 | 1008 gtk_widget_set_usize(vbr_toggle, 60, 30); |
1009 gtk_box_pack_start(GTK_BOX(vbr_vbox), vbr_toggle, FALSE, FALSE, 2); | |
1010 gtk_signal_connect(GTK_OBJECT(vbr_toggle), "toggled", | |
1011 GTK_SIGNAL_FUNC(toggle_vbr), NULL); | |
1012 | |
1013 vbr_options_vbox = gtk_vbox_new(FALSE, 0); | |
1014 gtk_container_add(GTK_CONTAINER(vbr_vbox), vbr_options_vbox); | |
1015 gtk_widget_set_sensitive(vbr_options_vbox, FALSE); | |
1016 | |
1017 /* Choose VBR/ABR */ | |
1018 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1019 vbr_type_frame = gtk_frame_new(_("Type:")); |
984 | 1020 gtk_container_set_border_width(GTK_CONTAINER(vbr_type_frame), 5); |
1021 gtk_box_pack_start(GTK_BOX(vbr_options_vbox), vbr_type_frame, | |
1022 FALSE, FALSE, 2); | |
1023 | |
1024 vbr_type_hbox = gtk_hbox_new(FALSE, 5); | |
1025 gtk_container_set_border_width(GTK_CONTAINER(vbr_type_hbox), 5); | |
1026 gtk_container_add(GTK_CONTAINER(vbr_type_frame), vbr_type_hbox); | |
1027 | |
1028 vbr_type_radio1 = gtk_radio_button_new_with_label(NULL, "VBR"); | |
1029 gtk_tooltips_set_tip(GTK_TOOLTIPS(vbr_tips), vbr_type_radio1, | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1030 _("Variable bitrate"), ""); |
984 | 1031 gtk_box_pack_start(GTK_BOX(vbr_type_hbox), vbr_type_radio1, TRUE, |
1032 TRUE, 2); | |
1033 if (vbr_type == 0) | |
1034 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1035 (vbr_type_radio1), TRUE); | |
1036 | |
1037 vbr_type_radio2 = | |
1038 gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON | |
1039 (vbr_type_radio1), | |
1040 "ABR"); | |
1041 gtk_tooltips_set_tip(GTK_TOOLTIPS(vbr_tips), vbr_type_radio2, | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1042 _("Average bitrate"), ""); |
984 | 1043 gtk_box_pack_start(GTK_BOX(vbr_type_hbox), vbr_type_radio2, TRUE, |
1044 TRUE, 2); | |
1045 if (vbr_type == 1) | |
1046 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1047 (vbr_type_radio2), TRUE); | |
1048 | |
1049 gtk_signal_connect(GTK_OBJECT(vbr_type_radio1), "toggled", | |
1050 GTK_SIGNAL_FUNC(vbr_abr_toggle), "VBR"); | |
1051 gtk_signal_connect(GTK_OBJECT(vbr_type_radio2), "toggled", | |
1052 GTK_SIGNAL_FUNC(vbr_abr_toggle), "ABR"); | |
1053 | |
1054 /* VBR Options */ | |
1055 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1056 vbr_frame = gtk_frame_new(_("VBR Options:")); |
984 | 1057 gtk_container_set_border_width(GTK_CONTAINER(vbr_frame), 5); |
1058 gtk_box_pack_start(GTK_BOX(vbr_options_vbox), vbr_frame, FALSE, | |
1059 FALSE, 2); | |
1060 | |
1061 vbr_options_vbox2 = gtk_vbox_new(FALSE, 5); | |
1062 gtk_container_set_border_width(GTK_CONTAINER(vbr_options_vbox2), | |
1063 5); | |
1064 gtk_container_add(GTK_CONTAINER(vbr_frame), vbr_options_vbox2); | |
1065 | |
1066 vbr_options_hbox1 = gtk_hbox_new(FALSE, 5); | |
1067 gtk_container_set_border_width(GTK_CONTAINER(vbr_options_hbox1), | |
1068 5); | |
1069 gtk_container_add(GTK_CONTAINER(vbr_options_vbox2), | |
1070 vbr_options_hbox1); | |
1071 | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1072 vbr_min_label = gtk_label_new(_("Minimum bitrate (kbps):")); |
984 | 1073 gtk_misc_set_alignment(GTK_MISC(vbr_min_label), 0, 0.5); |
1074 gtk_box_pack_start(GTK_BOX(vbr_options_hbox1), vbr_min_label, TRUE, | |
1075 TRUE, 0); | |
1076 | |
1077 vbr_min_option_menu = gtk_option_menu_new(); | |
1078 vbr_min_menu = gtk_menu_new(); | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1079 |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1080 for (i = 0; i < sizeof(available_bitrates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1081 { |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1082 gchar *string = g_strdup_printf("%d", available_bitrates[i]); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1083 vbr_min_menu_item = gtk_menu_item_new_with_label(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1084 gtk_signal_connect(GTK_OBJECT(vbr_min_menu_item), "activate", |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1085 GTK_SIGNAL_FUNC(vbr_min_activate), |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1086 GINT_TO_POINTER(available_bitrates[i])); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1087 gtk_menu_append(GTK_MENU(vbr_min_menu), vbr_min_menu_item); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1088 g_free(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1089 } |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1090 |
984 | 1091 gtk_option_menu_set_menu(GTK_OPTION_MENU(vbr_min_option_menu), |
1092 vbr_min_menu); | |
1093 gtk_widget_set_usize(vbr_min_option_menu, 40, 25); | |
1094 gtk_box_pack_start(GTK_BOX(vbr_options_hbox1), vbr_min_option_menu, | |
1095 TRUE, TRUE, 2); | |
1096 | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1097 for (i = 0; i < sizeof(available_bitrates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1098 if (vbr_min_val == available_bitrates[i]) |
984 | 1099 gtk_option_menu_set_history(GTK_OPTION_MENU |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1100 (vbr_min_option_menu), i); |
984 | 1101 |
1102 vbr_options_hbox2 = gtk_hbox_new(FALSE, 5); | |
1103 gtk_container_set_border_width(GTK_CONTAINER(vbr_options_hbox2), | |
1104 5); | |
1105 gtk_container_add(GTK_CONTAINER(vbr_options_vbox2), | |
1106 vbr_options_hbox2); | |
1107 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1108 vbr_max_label = gtk_label_new(_("Maximum bitrate (kbps):")); |
984 | 1109 gtk_misc_set_alignment(GTK_MISC(vbr_max_label), 0, 0.5); |
1110 gtk_box_pack_start(GTK_BOX(vbr_options_hbox2), vbr_max_label, TRUE, | |
1111 TRUE, 0); | |
1112 | |
1113 vbr_max_option_menu = gtk_option_menu_new(); | |
1114 vbr_max_menu = gtk_menu_new(); | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1115 |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1116 for (i = 0; i < sizeof(available_bitrates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1117 { |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1118 gchar *string = g_strdup_printf("%d", available_bitrates[i]); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1119 vbr_max_menu_item = gtk_menu_item_new_with_label(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1120 gtk_signal_connect(GTK_OBJECT(vbr_max_menu_item), "activate", |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1121 GTK_SIGNAL_FUNC(vbr_max_activate), |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1122 GINT_TO_POINTER(available_bitrates[i])); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1123 gtk_menu_append(GTK_MENU(vbr_max_menu), vbr_max_menu_item); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1124 g_free(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1125 } |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1126 |
984 | 1127 gtk_option_menu_set_menu(GTK_OPTION_MENU(vbr_max_option_menu), |
1128 vbr_max_menu); | |
1129 gtk_widget_set_usize(vbr_max_option_menu, 40, 25); | |
1130 gtk_box_pack_start(GTK_BOX(vbr_options_hbox2), vbr_max_option_menu, | |
1131 TRUE, TRUE, 2); | |
1132 | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1133 for (i = 0; i < sizeof(available_bitrates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1134 if (vbr_max_val == available_bitrates[i]) |
984 | 1135 gtk_option_menu_set_history(GTK_OPTION_MENU |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1136 (vbr_max_option_menu), i); |
984 | 1137 |
1138 enforce_min_toggle = | |
1139 gtk_check_button_new_with_label | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1140 (_("Strictly enforce minimum bitrate")); |
984 | 1141 gtk_tooltips_set_tip(GTK_TOOLTIPS(vbr_tips), enforce_min_toggle, |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1142 _("For use with players that do not support low bitrate mp3 (Apex AD600-A DVD/mp3 player)"), |
984 | 1143 ""); |
1144 gtk_box_pack_start(GTK_BOX(vbr_options_vbox2), enforce_min_toggle, | |
1145 FALSE, FALSE, 2); | |
1146 gtk_signal_connect(GTK_OBJECT(enforce_min_toggle), "toggled", | |
1147 GTK_SIGNAL_FUNC(toggle_enforce_min), NULL); | |
1148 | |
1149 if (enforce_min_val == 1) | |
1150 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1151 (enforce_min_toggle), TRUE); | |
1152 | |
1153 /* ABR Options */ | |
1154 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1155 abr_frame = gtk_frame_new(_("ABR Options:")); |
984 | 1156 gtk_container_set_border_width(GTK_CONTAINER(abr_frame), 5); |
1157 gtk_box_pack_start(GTK_BOX(vbr_options_vbox), abr_frame, FALSE, | |
1158 FALSE, 2); | |
1159 gtk_widget_set_sensitive(abr_frame, FALSE); | |
1160 | |
1161 abr_hbox = gtk_hbox_new(FALSE, 5); | |
1162 gtk_container_set_border_width(GTK_CONTAINER(abr_hbox), 5); | |
1163 gtk_container_add(GTK_CONTAINER(abr_frame), abr_hbox); | |
1164 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1165 abr_label = gtk_label_new(_("Average bitrate (kbps):")); |
984 | 1166 gtk_misc_set_alignment(GTK_MISC(abr_label), 0, 0.5); |
1167 gtk_box_pack_start(GTK_BOX(abr_hbox), abr_label, TRUE, TRUE, 0); | |
1168 | |
1169 abr_option_menu = gtk_option_menu_new(); | |
1170 abr_menu = gtk_menu_new(); | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1171 |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1172 for (i = 0; i < sizeof(available_bitrates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1173 { |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1174 gchar *string = g_strdup_printf("%d", available_bitrates[i]); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1175 abr_menu_item = gtk_menu_item_new_with_label(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1176 gtk_signal_connect(GTK_OBJECT(abr_menu_item), "activate", |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1177 GTK_SIGNAL_FUNC(abr_activate), |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1178 GINT_TO_POINTER(available_bitrates[i])); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1179 gtk_menu_append(GTK_MENU(abr_menu), abr_menu_item); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1180 g_free(string); |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1181 } |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1182 |
984 | 1183 gtk_option_menu_set_menu(GTK_OPTION_MENU(abr_option_menu), |
1184 abr_menu); | |
1185 gtk_widget_set_usize(abr_option_menu, 40, 25); | |
1186 gtk_box_pack_start(GTK_BOX(abr_hbox), abr_option_menu, TRUE, TRUE, | |
1187 2); | |
1188 | |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1189 for (i = 0; i < sizeof(available_bitrates)/sizeof(gint); i++) |
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1190 if (abr_val == available_bitrates[i]) |
984 | 1191 gtk_option_menu_set_history(GTK_OPTION_MENU(abr_option_menu), |
1525
bee9eaedefa5
- made the MP3 FileWriter output plugin less braindead
mf0102 <0102@gmx.at>
parents:
1441
diff
changeset
|
1192 i); |
984 | 1193 |
1194 /* Quality Level */ | |
1195 | |
1196 vbr_options_hbox3 = gtk_hbox_new(FALSE, 5); | |
1197 gtk_container_set_border_width(GTK_CONTAINER(vbr_options_hbox3), | |
1198 5); | |
1199 gtk_container_add(GTK_CONTAINER(vbr_options_vbox), | |
1200 vbr_options_hbox3); | |
1201 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1202 vbr_quality_label = gtk_label_new(_("VBR quality level:")); |
984 | 1203 gtk_misc_set_alignment(GTK_MISC(vbr_quality_label), 0, 0.5); |
1204 gtk_box_pack_start(GTK_BOX(vbr_options_hbox3), vbr_quality_label, | |
1205 TRUE, TRUE, 0); | |
1206 | |
1207 vbr_quality_adj = gtk_adjustment_new(4, 0, 9, 1, 1, 1); | |
1208 vbr_quality_spin = | |
1209 gtk_spin_button_new(GTK_ADJUSTMENT(vbr_quality_adj), 8, 0); | |
1210 gtk_widget_set_usize(vbr_quality_spin, 20, -1); | |
1211 gtk_box_pack_start(GTK_BOX(vbr_options_hbox3), vbr_quality_spin, | |
1212 TRUE, TRUE, 0); | |
1213 gtk_signal_connect(GTK_OBJECT(vbr_quality_adj), "value-changed", | |
1214 GTK_SIGNAL_FUNC(vbr_qual), NULL); | |
1215 | |
1216 gtk_tooltips_set_tip(GTK_TOOLTIPS(vbr_tips), vbr_quality_spin, | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1217 _("highest:0;\nlowest:9;\ndefault:4;"), ""); |
984 | 1218 |
1219 gtk_spin_button_set_value(GTK_SPIN_BUTTON(vbr_quality_spin), | |
1220 vbr_quality_val); | |
1221 | |
1222 /* Xing Header */ | |
1223 | |
1224 xing_header_toggle = | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1225 gtk_check_button_new_with_label(_("Don't write Xing VBR header")); |
984 | 1226 gtk_box_pack_start(GTK_BOX(vbr_options_vbox), xing_header_toggle, |
1227 FALSE, FALSE, 2); | |
1228 gtk_signal_connect(GTK_OBJECT(xing_header_toggle), "toggled", | |
1229 GTK_SIGNAL_FUNC(toggle_xing), NULL); | |
1230 | |
1231 if (toggle_xing_val == 0) | |
1232 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1233 (xing_header_toggle), TRUE); | |
1234 | |
1235 | |
1236 | |
1237 /* Add the Notebook */ | |
1238 | |
1239 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbr_vbox, | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1240 gtk_label_new(_("VBR/ABR"))); |
984 | 1241 |
1242 | |
1243 /* Tags */ | |
1244 | |
1245 tags_vbox = gtk_vbox_new(FALSE, 5); | |
1246 gtk_container_set_border_width(GTK_CONTAINER(tags_vbox), 5); | |
1247 | |
1248 tags_tips = gtk_tooltips_new(); | |
1249 | |
1250 /* Frame Params */ | |
1251 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1252 tags_frames_frame = gtk_frame_new(_("Frame params:")); |
984 | 1253 gtk_container_set_border_width(GTK_CONTAINER(tags_frames_frame), |
1254 5); | |
1255 gtk_box_pack_start(GTK_BOX(tags_vbox), tags_frames_frame, FALSE, | |
1256 FALSE, 2); | |
1257 | |
1258 tags_frames_hbox = gtk_hbox_new(FALSE, 5); | |
1259 gtk_container_set_border_width(GTK_CONTAINER(tags_frames_hbox), 5); | |
1260 gtk_container_add(GTK_CONTAINER(tags_frames_frame), | |
1261 tags_frames_hbox); | |
1262 | |
1263 tags_copyright_toggle = | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1264 gtk_check_button_new_with_label(_("Mark as copyright")); |
984 | 1265 gtk_box_pack_start(GTK_BOX(tags_frames_hbox), |
1266 tags_copyright_toggle, FALSE, FALSE, 2); | |
1267 gtk_signal_connect(GTK_OBJECT(tags_copyright_toggle), "toggled", | |
1268 GTK_SIGNAL_FUNC(toggle_copyright), NULL); | |
1269 | |
1270 if (mark_copyright_val == 1) | |
1271 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1272 (tags_copyright_toggle), TRUE); | |
1273 | |
1274 tags_original_toggle = | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1275 gtk_check_button_new_with_label(_("Mark as original")); |
984 | 1276 gtk_box_pack_start(GTK_BOX(tags_frames_hbox), tags_original_toggle, |
1277 FALSE, FALSE, 2); | |
1278 gtk_signal_connect(GTK_OBJECT(tags_original_toggle), "toggled", | |
1279 GTK_SIGNAL_FUNC(toggle_original), NULL); | |
1280 | |
1281 if (mark_original_val == 1) | |
1282 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1283 (tags_original_toggle), TRUE); | |
1284 | |
1285 /* ID3 Params */ | |
1286 | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1287 tags_id3_frame = gtk_frame_new(_("ID3 params:")); |
984 | 1288 gtk_container_set_border_width(GTK_CONTAINER(tags_id3_frame), 5); |
1289 gtk_box_pack_start(GTK_BOX(tags_vbox), tags_id3_frame, FALSE, | |
1290 FALSE, 2); | |
1291 | |
1292 tags_id3_vbox = gtk_vbox_new(FALSE, 5); | |
1293 gtk_container_set_border_width(GTK_CONTAINER(tags_id3_vbox), 5); | |
1294 gtk_container_add(GTK_CONTAINER(tags_id3_frame), tags_id3_vbox); | |
1295 | |
1296 tags_force_id3v2_toggle = | |
1297 gtk_check_button_new_with_label | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1298 (_("Force addition of version 2 tag")); |
984 | 1299 gtk_box_pack_start(GTK_BOX(tags_id3_vbox), tags_force_id3v2_toggle, |
1300 FALSE, FALSE, 2); | |
1301 gtk_signal_connect(GTK_OBJECT(tags_force_id3v2_toggle), "toggled", | |
1302 GTK_SIGNAL_FUNC(force_v2_toggle), NULL); | |
1303 | |
1304 tags_id3_hbox = gtk_hbox_new(FALSE, 5); | |
1305 gtk_container_add(GTK_CONTAINER(tags_id3_vbox), tags_id3_hbox); | |
1306 | |
1307 tags_only_v1_toggle = | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1308 gtk_check_button_new_with_label(_("Only add v1 tag")); |
984 | 1309 gtk_box_pack_start(GTK_BOX(tags_id3_hbox), tags_only_v1_toggle, |
1310 FALSE, FALSE, 2); | |
1311 gtk_signal_connect(GTK_OBJECT(tags_only_v1_toggle), "toggled", | |
1312 GTK_SIGNAL_FUNC(id3_only_version), "v1"); | |
1313 | |
1314 tags_only_v2_toggle = | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1315 gtk_check_button_new_with_label(_("Only add v2 tag")); |
984 | 1316 gtk_box_pack_start(GTK_BOX(tags_id3_hbox), tags_only_v2_toggle, |
1317 FALSE, FALSE, 2); | |
1318 gtk_signal_connect(GTK_OBJECT(tags_only_v2_toggle), "toggled", | |
1319 GTK_SIGNAL_FUNC(id3_only_version), "v2"); | |
1320 | |
1321 if (force_v2_val == 1) | |
1322 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1323 (tags_force_id3v2_toggle), TRUE); | |
1324 | |
1325 if (only_v1_val == 1) | |
1326 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1327 (tags_only_v1_toggle), TRUE); | |
1328 | |
1329 if (only_v2_val == 1) | |
1330 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON | |
1331 (tags_only_v2_toggle), TRUE); | |
1332 | |
1333 /* Add the Notebook */ | |
1334 | |
1335 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tags_vbox, | |
1298
94eee8a16189
The "i18n" saga is still going on...
Stany HENRY <StrassBoy@gmail.com>
parents:
1197
diff
changeset
|
1336 gtk_label_new(_("Tags"))); |
984 | 1337 |
1338 | |
1339 | |
1340 | |
1341 /* The Rest */ | |
1342 | |
1343 /* Buttons */ | |
1344 | |
1345 configure_bbox = gtk_hbutton_box_new(); | |
1346 gtk_button_box_set_layout(GTK_BUTTON_BOX(configure_bbox), | |
1347 GTK_BUTTONBOX_END); | |
1348 gtk_button_box_set_spacing(GTK_BUTTON_BOX(configure_bbox), 5); | |
1349 gtk_box_pack_start(GTK_BOX(vbox), configure_bbox, FALSE, FALSE, 0); | |
1350 | |
985 | 1351 configure_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL); |
1352 gtk_signal_connect_object(GTK_OBJECT(configure_cancel), "clicked", | |
1353 GTK_SIGNAL_FUNC(gtk_widget_destroy), | |
1354 GTK_OBJECT(configure_win)); | |
1355 GTK_WIDGET_SET_FLAGS(configure_cancel, GTK_CAN_DEFAULT); | |
1356 gtk_box_pack_start(GTK_BOX(configure_bbox), configure_cancel, TRUE, | |
1357 TRUE, 0); | |
1358 | |
1359 configure_ok = gtk_button_new_from_stock(GTK_STOCK_OK); | |
984 | 1360 gtk_signal_connect(GTK_OBJECT(configure_ok), "clicked", |
1361 GTK_SIGNAL_FUNC(configure_ok_cb), NULL); | |
1362 GTK_WIDGET_SET_FLAGS(configure_ok, GTK_CAN_DEFAULT); | |
1363 gtk_box_pack_start(GTK_BOX(configure_bbox), configure_ok, TRUE, | |
1364 TRUE, 0); | |
1365 gtk_widget_show(configure_ok); | |
1366 gtk_widget_grab_default(configure_ok); | |
1367 | |
1368 /* Set States */ | |
1369 | |
1370 if (vbr_on == 1) | |
1371 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(vbr_toggle), | |
1372 TRUE); | |
1373 else | |
1374 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(vbr_toggle), | |
1375 FALSE); | |
1376 | |
1377 /* Show it! */ | |
1378 | |
1379 gtk_widget_show_all(configure_win); | |
1380 | |
1381 } | |
1382 } | |
1197
616928ec054d
Add #ifdef FILEWRITER_MP3 to filewriter/mp3.c
Jonathan Schleifer <js@h3c.de>
parents:
1044
diff
changeset
|
1383 |
616928ec054d
Add #ifdef FILEWRITER_MP3 to filewriter/mp3.c
Jonathan Schleifer <js@h3c.de>
parents:
1044
diff
changeset
|
1384 #endif |