annotate src/filewriter/mp3.c @ 3198:83b1a4e5f453

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