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