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