annotate src/madplug/fileinfo.c @ 613:85a70ace8c02 trunk

[svn] - press F5 on not yet played stream no longer hangs. - some cleanups.
author yaz
date Wed, 07 Feb 2007 01:10:37 -0800
parents 3f7a52adfe0e
children ee59ad236eb6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
1 /*
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
2 * mad plugin for audacious
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
3 * Copyright (C) 2005-2007 William Pitcock, Yoshiki Yazawa
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
4 *
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
5 * Portions derived from xmms-mad:
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
6 * Copyright (C) 2001-2002 Sam Clegg - See COPYING
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
7 *
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
10 * the Free Software Foundation; under version 2 of the License.
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
11 *
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
16 *
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
20 */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
21
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
22 #include "config.h"
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
23
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
24 #include "plugin.h"
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
25 #include "input.h"
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
26
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
27 #include "mp3.xpm"
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
28
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
29 #include <math.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
30 #include <audacious/util.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
31 #include <gtk/gtk.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
32
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
33 /* yaz */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
34 #include <langinfo.h>
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
35
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
36 #ifndef NOGUI
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
37 static GtkWidget *window = 0;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
38 static GtkWidget *filename_entry, *id3_frame;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
39 static GtkWidget *title_entry, *artist_entry, *album_entry;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
40 static GtkWidget *year_entry, *tracknum_entry, *comment_entry;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
41 static GtkWidget *genre_combo;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
42 static GtkWidget *mpeg_level, *mpeg_bitrate, *mpeg_samplerate,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
43 *mpeg_frames, *mpeg_duration, *mpeg_flags;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
44 static GtkWidget *mpeg_fileinfo, *mpeg_replaygain, *mpeg_replaygain2,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
45 *mpeg_replaygain3, *mpeg_replaygain4, *mp3gain1, *mp3gain2;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
46 #endif /* !NOGUI */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
47
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
48 static GList *genre_list = 0;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
49 static struct mad_info_t info;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
50 struct id3_frame *id3_frame_new(const char *str);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
51
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
52 #ifndef NOGUI
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
53 static void
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
54 update_id3_frame(struct id3_tag *tag, const char *frame_name,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
55 const char *data)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
56 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
57 int res;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
58 struct id3_frame *frame;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
59 union id3_field *field;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
60 id3_ucs4_t *ucs4;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
61
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
62 if (data == NULL)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
63 return;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
64
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
65 /* printf ("updating id3: %s: %s\n", frame_name, data); */
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
66
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
67 /*
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
68 * An empty string removes the frame altogether.
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
69 */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
70 if (strlen(data) == 0) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
71 while ((frame = id3_tag_findframe(tag, frame_name, 0)))
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
72 id3_tag_detachframe(tag, frame);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
73 return;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
74 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
75
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
76 frame = id3_tag_findframe(tag, frame_name, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
77 if (!frame) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
78 frame = id3_frame_new(frame_name);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
79 id3_tag_attachframe(tag, frame);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
80 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
81
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
82 // setup ucs4 string
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
83 if(audmad_config.sjis) {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
84 ucs4 = id3_latin1_ucs4duplicate((id3_latin1_t *) data);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
85 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
86 else {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
87 ucs4 = id3_utf8_ucs4duplicate((id3_utf8_t *) data);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
88 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
89
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
90 // set encoding
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
91 field = id3_frame_field(frame, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
92 id3_field_settextencoding(field, audmad_config.sjis ? ID3_FIELD_TEXTENCODING_ISO_8859_1 :
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
93 ID3_FIELD_TEXTENCODING_UTF_8);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
94
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
95 // setup genre code
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
96 if (!strcmp(frame_name, ID3_FRAME_GENRE)) {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
97 char *tmp;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
98 int index = id3_genre_number(ucs4);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
99 g_free(ucs4);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
100 tmp = g_strdup_printf("%d", index);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
101 ucs4 = id3_latin1_ucs4duplicate((unsigned char *) tmp);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
102 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
103
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
104 // write string
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
105 if (!strcmp(frame_name, ID3_FRAME_COMMENT)) {
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
106 field = id3_frame_field(frame, 3);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
107 field->type = ID3_FIELD_TYPE_STRINGFULL;
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
108 res = id3_field_setfullstring(field, ucs4);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
109 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
110 else {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
111 field = id3_frame_field(frame, 1);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
112 field->type = ID3_FIELD_TYPE_STRINGLIST;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
113 res = id3_field_setstrings(field, 1, &ucs4);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
114 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
115
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
116 if (res != 0)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
117 g_print("error setting id3 field: %s\n", frame_name);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
118 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
119
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
120 static void close_window(GtkWidget * w, gpointer data)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
121 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
122 input_term(&info);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
123 gtk_widget_destroy(window);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
124 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
125
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
126 static void save_cb(GtkWidget * w, gpointer data)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
127 {
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
128 gchar *text, *sjis;
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
129 struct id3_file *id3file;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
130 struct id3_tag *id3tag;
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
131 char *encoding;
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
132
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
133 if (info.remote)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
134 return;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
135
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
136 /* read tag from file */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
137 id3file = id3_file_open(info.filename, ID3_FILE_MODE_READWRITE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
138 if (!id3file) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
139 id3tag = id3_tag_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
140 id3_tag_clearframes(id3tag);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
141 id3tag->options |= ID3_TAG_OPTION_ID3V1;
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
142 if (!id3file) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
143 xmms_show_message("File Info", "Couldn't open file!", "Ok",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
144 FALSE, NULL, NULL);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
145 return;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
146 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
147 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
148 id3tag = id3_file_tag(id3file);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
149 id3_tag_options(id3tag, ID3_TAG_OPTION_ID3V1, ~0); /* enables id3v1 */
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
150 // id3_tag_options(id3tag, ID3_TAG_OPTION_ID3V1, 0); /* disables id3v1 */
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
151 if (!id3tag) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
152 id3tag = id3_tag_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
153 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
154
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
155 encoding = audmad_config.sjis ? "SJIS" : "UTF-8";
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
156
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
157 text = gtk_editable_get_chars(GTK_EDITABLE(title_entry), 0, -1);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
158 sjis = g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
159 update_id3_frame(id3tag, ID3_FRAME_TITLE, sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
160 free(text);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
161 free(sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
162
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
163 text = gtk_editable_get_chars(GTK_EDITABLE(artist_entry), 0, -1);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
164 sjis = g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
165 update_id3_frame(id3tag, ID3_FRAME_ARTIST, sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
166 free(text);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
167 free(sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
168
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
169 text = gtk_editable_get_chars(GTK_EDITABLE(album_entry), 0, -1);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
170 sjis =
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
171 g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
172 update_id3_frame(id3tag, ID3_FRAME_ALBUM, sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
173 free(text);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
174 free(sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
175
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
176 text = gtk_editable_get_chars(GTK_EDITABLE(year_entry), 0, -1);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
177 sjis =
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
178 g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
179 update_id3_frame(id3tag, ID3_FRAME_YEAR, sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
180 free(text);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
181 free(sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
182
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
183 text = gtk_editable_get_chars(GTK_EDITABLE(comment_entry), 0, -1);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
184 sjis =
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
185 g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
186 update_id3_frame(id3tag, ID3_FRAME_COMMENT, sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
187 free(text);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
188 free(sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
189
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
190 text = gtk_editable_get_chars(GTK_EDITABLE(tracknum_entry), 0, -1);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
191 sjis =
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
192 g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
193 update_id3_frame(id3tag, ID3_FRAME_TRACK, sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
194 free(text);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
195 free(sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
196
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
197 text = gtk_editable_get_chars(GTK_EDITABLE(GTK_COMBO(genre_combo)->entry),
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
198 0, -1);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
199 sjis = g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
200 update_id3_frame(id3tag, ID3_FRAME_GENRE, sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
201 free(text);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
202 free(sjis);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
203
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
204 if (id3_file_update(id3file) != 0) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
205 xmms_show_message("File Info", "Couldn't write tag!", "Ok", FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
206 NULL, NULL);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
207 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
208 id3_file_close(id3file);
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
209 // gtk_widget_destroy(window);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
210 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
211
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
212 #if 0
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
213 static void remove_id3_cb(GtkWidget * w, gpointer data)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
214 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
215 struct id3_file *id3file;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
216 struct id3_tag *id3tag;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
217
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
218 id3file = id3_file_open(info.filename, ID3_FILE_MODE_READWRITE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
219
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
220 if (id3file == NULL)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
221 return;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
222
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
223 id3tag = id3_file_tag(id3file);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
224
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
225 if (id3tag == NULL)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
226 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
227 id3_file_close(id3file);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
228 return;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
229 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
230
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
231 id3_tag_clearframes(id3tag);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
232 id3_file_update(id3file);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
233 id3_file_close(id3file);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
234
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
235 gtk_entry_set_text(GTK_ENTRY(title_entry), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
236 gtk_entry_set_text(GTK_ENTRY(artist_entry), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
237 gtk_entry_set_text(GTK_ENTRY(album_entry), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
238 gtk_entry_set_text(GTK_ENTRY(comment_entry), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
239 gtk_entry_set_text(GTK_ENTRY(year_entry), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
240 gtk_entry_set_text(GTK_ENTRY(tracknum_entry), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
241 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
242 gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
243 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
244 }
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
245 #endif
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
246
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
247 static void remove_id3_cb(GtkWidget * w, gpointer data)
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
248 {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
249 struct id3_file *id3file;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
250 struct id3_tag *id3tag;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
251
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
252 /* read tag from file */
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
253 id3file = id3_file_open(info.filename, ID3_FILE_MODE_READWRITE);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
254 if (!id3file)
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
255 return;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
256
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
257 id3tag = id3_file_tag(id3file);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
258 if(id3tag) {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
259 /* since current libid3tag cannot delete tag completely, just add a dummy. */
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
260 const char *dummy = "";
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
261 update_id3_frame(id3tag, ID3_FRAME_TITLE, dummy);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
262 update_id3_frame(id3tag, ID3_FRAME_ARTIST, dummy);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
263 update_id3_frame(id3tag, ID3_FRAME_ALBUM, dummy);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
264 update_id3_frame(id3tag, ID3_FRAME_YEAR, dummy);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
265 update_id3_frame(id3tag, ID3_FRAME_TRACK, dummy);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
266 update_id3_frame(id3tag, ID3_FRAME_GENRE, "Other");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
267 update_id3_frame(id3tag, ID3_FRAME_COMMENT, dummy);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
268
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
269 if (id3_file_update(id3file) != 0) {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
270 xmms_show_message("File Info", "Couldn't write tag!", "OK", FALSE,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
271 NULL, NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
272 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
273 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
274
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
275 id3_file_close(id3file);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
276
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
277 gtk_entry_set_text(GTK_ENTRY(title_entry), "");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
278 gtk_entry_set_text(GTK_ENTRY(artist_entry), "");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
279 gtk_entry_set_text(GTK_ENTRY(album_entry), "");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
280 gtk_entry_set_text(GTK_ENTRY(comment_entry), "");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
281 gtk_entry_set_text(GTK_ENTRY(year_entry), "");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
282 gtk_entry_set_text(GTK_ENTRY(tracknum_entry), "");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
283 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), "");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
284 gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
285 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
286
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
287 // gtk_widget_destroy(window);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
288 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
289
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
290 #if 0
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
291 void create_window()
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
292 {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
293 GtkWidget *vbox, *hbox, *left_vbox, *table;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
294 GtkWidget *mpeg_frame, *mpeg_box;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
295 GtkWidget *label, *filename_hbox;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
296 GtkWidget *bbox, *save, *remove_id3, *cancel;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
297
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
298 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
299 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
300 gtk_signal_connect(GTK_OBJECT(window), "destroy",
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
301 GTK_SIGNAL_FUNC(close_window), &window);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
302 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
303
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
304 vbox = gtk_vbox_new(FALSE, 10);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
305 gtk_container_add(GTK_CONTAINER(window), vbox);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
306
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
307 filename_hbox = gtk_hbox_new(FALSE, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
308 gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
309
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
310 label = gtk_label_new("Filename:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
311 gtk_box_pack_start(GTK_BOX(filename_hbox), label, FALSE, TRUE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
312 filename_entry = gtk_entry_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
313 gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
314 gtk_box_pack_start(GTK_BOX(filename_hbox), filename_entry, TRUE, TRUE,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
315 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
316
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
317 hbox = gtk_hbox_new(FALSE, 10);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
318 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
319
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
320 left_vbox = gtk_vbox_new(FALSE, 10);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
321 gtk_box_pack_start(GTK_BOX(hbox), left_vbox, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
322
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
323 id3_frame = gtk_frame_new("ID3 Tag:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
324 gtk_box_pack_start(GTK_BOX(left_vbox), id3_frame, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
325
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
326 table = gtk_table_new(5, 5, FALSE);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
327 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
328 gtk_container_add(GTK_CONTAINER(id3_frame), table);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
329
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
330 label = gtk_label_new("Title:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
331 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
332 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
333 GTK_FILL, 5, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
334
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
335 title_entry = gtk_entry_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
336 gtk_table_attach(GTK_TABLE(table), title_entry, 1, 4, 0, 1,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
337 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
338 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
339
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
340 label = gtk_label_new("Artist:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
341 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
342 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
343 GTK_FILL, 5, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
344
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
345 artist_entry = gtk_entry_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
346 gtk_table_attach(GTK_TABLE(table), artist_entry, 1, 4, 1, 2,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
347 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
348 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
349
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
350 label = gtk_label_new("Album:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
351 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
352 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
353 GTK_FILL, 5, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
354
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
355 album_entry = gtk_entry_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
356 gtk_table_attach(GTK_TABLE(table), album_entry, 1, 4, 2, 3,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
357 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
358 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
359
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
360 label = gtk_label_new("Comment:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
361 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
362 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
363 GTK_FILL, 5, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
364
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
365 comment_entry = gtk_entry_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
366 gtk_table_attach(GTK_TABLE(table), comment_entry, 1, 4, 3, 4,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
367 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
368 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
369
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
370 label = gtk_label_new("Year:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
371 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
372 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, GTK_FILL,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
373 GTK_FILL, 5, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
374
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
375 year_entry = gtk_entry_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
376 gtk_widget_set_usize(year_entry, 40, -1);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
377 gtk_table_attach(GTK_TABLE(table), year_entry, 1, 2, 4, 5,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
378 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
379 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
380
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
381 label = gtk_label_new("Track number:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
382 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
383 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 4, 5, GTK_FILL,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
384 GTK_FILL, 5, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
385
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
386 tracknum_entry = gtk_entry_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
387 gtk_widget_set_usize(tracknum_entry, 40, -1);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
388 gtk_table_attach(GTK_TABLE(table), tracknum_entry, 3, 4, 4, 5,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
389 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
390 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
391
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
392 label = gtk_label_new("Genre:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
393 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
394 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6, GTK_FILL,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
395 GTK_FILL, 5, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
396
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
397 genre_combo = gtk_combo_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
398 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(genre_combo)->entry),
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
399 FALSE);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
400 if (!genre_list) {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
401 int i = 0;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
402 const id3_ucs4_t *ucs4 = id3_genre_index(i);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
403 while (ucs4) {
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
404 genre_list =
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
405 g_list_append(genre_list, id3_ucs4_latin1duplicate(ucs4));
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
406 i++;
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
407 ucs4 = id3_genre_index(i);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
408 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
409 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
410 gtk_combo_set_popdown_strings(GTK_COMBO(genre_combo), genre_list);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
411
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
412 gtk_table_attach(GTK_TABLE(table), genre_combo, 1, 4, 5, 6,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
413 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
414 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
415
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
416 bbox = gtk_hbutton_box_new();
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
417 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
418 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
419 gtk_box_pack_start(GTK_BOX(left_vbox), bbox, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
420
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
421 save = gtk_button_new_with_label("Save");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
422 gtk_signal_connect(GTK_OBJECT(save), "clicked",
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
423 GTK_SIGNAL_FUNC(save_cb), NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
424 GTK_WIDGET_SET_FLAGS(save, GTK_CAN_DEFAULT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
425 gtk_box_pack_start(GTK_BOX(bbox), save, TRUE, TRUE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
426 gtk_widget_grab_default(save);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
427
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
428 remove_id3 = gtk_button_new_with_label("Remove ID3");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
429 gtk_signal_connect(GTK_OBJECT(remove_id3), "clicked",
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
430 GTK_SIGNAL_FUNC(remove_id3_cb), NULL);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
431 GTK_WIDGET_SET_FLAGS(remove_id3, GTK_CAN_DEFAULT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
432 gtk_box_pack_start(GTK_BOX(bbox), remove_id3, TRUE, TRUE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
433
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
434 cancel = gtk_button_new_with_label("Cancel");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
435 gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked",
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
436 GTK_SIGNAL_FUNC(gtk_widget_destroy),
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
437 GTK_OBJECT(window));
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
438 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
439 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
440
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
441 mpeg_frame = gtk_frame_new("MPEG Info:");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
442 gtk_box_pack_start(GTK_BOX(hbox), mpeg_frame, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
443
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
444 mpeg_box = gtk_vbox_new(FALSE, 5);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
445 gtk_container_add(GTK_CONTAINER(mpeg_frame), mpeg_box);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
446 gtk_container_set_border_width(GTK_CONTAINER(mpeg_box), 10);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
447 gtk_box_set_spacing(GTK_BOX(mpeg_box), 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
448
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
449 mpeg_level = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
450 gtk_widget_set_usize(mpeg_level, 120, -2);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
451 gtk_misc_set_alignment(GTK_MISC(mpeg_level), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
452 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_level, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
453
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
454 mpeg_bitrate = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
455 gtk_misc_set_alignment(GTK_MISC(mpeg_bitrate), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
456 gtk_label_set_justify(GTK_LABEL(mpeg_bitrate), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
457 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_bitrate, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
458
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
459 mpeg_samplerate = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
460 gtk_misc_set_alignment(GTK_MISC(mpeg_samplerate), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
461 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_samplerate, FALSE, FALSE,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
462 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
463
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
464 mpeg_flags = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
465 gtk_misc_set_alignment(GTK_MISC(mpeg_flags), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
466 gtk_label_set_justify(GTK_LABEL(mpeg_flags), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
467 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_flags, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
468
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
469 mpeg_frames = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
470 gtk_misc_set_alignment(GTK_MISC(mpeg_frames), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
471 gtk_label_set_justify(GTK_LABEL(mpeg_frames), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
472 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_frames, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
473
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
474 mpeg_duration = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
475 gtk_misc_set_alignment(GTK_MISC(mpeg_duration), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
476 gtk_label_set_justify(GTK_LABEL(mpeg_duration), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
477 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_duration, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
478
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
479 mpeg_replaygain = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
480 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
481 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
482 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain, FALSE, FALSE,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
483 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
484 mpeg_replaygain2 = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
485 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain2), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
486 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain2), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
487 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain2, FALSE, FALSE,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
488 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
489 mpeg_replaygain3 = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
490 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain3), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
491 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain3), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
492 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain3, FALSE, FALSE,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
493 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
494 mpeg_replaygain4 = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
495 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain4), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
496 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain4), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
497 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain4, FALSE, FALSE,
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
498 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
499 mp3gain1 = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
500 gtk_misc_set_alignment(GTK_MISC(mp3gain1), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
501 gtk_label_set_justify(GTK_LABEL(mp3gain1), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
502 gtk_box_pack_start(GTK_BOX(mpeg_box), mp3gain1, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
503 mp3gain2 = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
504 gtk_misc_set_alignment(GTK_MISC(mp3gain2), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
505 gtk_label_set_justify(GTK_LABEL(mp3gain2), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
506 gtk_box_pack_start(GTK_BOX(mpeg_box), mp3gain2, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
507
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
508 mpeg_fileinfo = gtk_label_new("");
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
509 gtk_misc_set_alignment(GTK_MISC(mpeg_fileinfo), 0, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
510 gtk_label_set_justify(GTK_LABEL(mpeg_fileinfo), GTK_JUSTIFY_LEFT);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
511 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_fileinfo, FALSE, FALSE, 0);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
512
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
513 gtk_widget_show_all(window);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
514 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
515 #endif
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
516
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
517 static void
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
518 change_buttons(GtkWidget * object)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
519 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
520 gtk_widget_set_sensitive(GTK_WIDGET(object), TRUE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
521 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
522
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
523 void create_window()
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
524 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
525 GtkWidget *vbox, *hbox, *left_vbox, *table;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
526 GtkWidget *mpeg_frame, *mpeg_box;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
527 GtkWidget *label, *filename_hbox;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
528 GtkWidget *bbox, *save, *remove_id3, *cancel;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
529 GtkWidget *pixmapwid;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
530 GdkPixbuf *pixbuf;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
531
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
532 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
533 gtk_window_set_type_hint(GTK_WINDOW(window),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
534 GDK_WINDOW_TYPE_HINT_DIALOG);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
535 gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
536 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
537 g_signal_connect(G_OBJECT(window), "destroy",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
538 G_CALLBACK(close_window), &window);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
539 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
540
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
541 vbox = gtk_vbox_new(FALSE, 10);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
542 gtk_container_add(GTK_CONTAINER(window), vbox);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
543
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
544 filename_hbox = gtk_hbox_new(FALSE, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
545 gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
546
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
547 pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
548 gnome_mime_audio_xpm);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
549 pixmapwid = gtk_image_new_from_pixbuf(pixbuf);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
550 g_object_unref(pixbuf);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
551 gtk_misc_set_alignment(GTK_MISC(pixmapwid), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
552 gtk_box_pack_start(GTK_BOX(filename_hbox), pixmapwid, FALSE, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
553 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
554
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
555 label = gtk_label_new("<b>Name:</b>");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
556 gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
557 gtk_box_pack_start(GTK_BOX(filename_hbox), label, FALSE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
558 filename_entry = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
559 gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
560 gtk_box_pack_start(GTK_BOX(filename_hbox), filename_entry, TRUE, TRUE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
561 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
562
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
563 hbox = gtk_hbox_new(FALSE, 10);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
564 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
565
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
566 left_vbox = gtk_table_new(2, 4, FALSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
567 gtk_box_pack_start(GTK_BOX(hbox), left_vbox, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
568
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
569 mpeg_frame = gtk_frame_new(_(" MPEG Info "));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
570 gtk_table_attach(GTK_TABLE(left_vbox), mpeg_frame, 0, 2, 0, 1,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
571 GTK_FILL, GTK_FILL, 5, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
572
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
573 mpeg_box = gtk_vbox_new(FALSE, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
574 gtk_container_add(GTK_CONTAINER(mpeg_frame), mpeg_box);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
575 gtk_container_set_border_width(GTK_CONTAINER(mpeg_box), 10);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
576 gtk_box_set_spacing(GTK_BOX(mpeg_box), 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
577
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
578 mpeg_level = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
579 gtk_widget_set_usize(mpeg_level, 120, -2);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
580 gtk_misc_set_alignment(GTK_MISC(mpeg_level), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
581 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_level, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
582
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
583 mpeg_bitrate = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
584 gtk_misc_set_alignment(GTK_MISC(mpeg_bitrate), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
585 gtk_label_set_justify(GTK_LABEL(mpeg_bitrate), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
586 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_bitrate, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
587
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
588 mpeg_samplerate = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
589 gtk_misc_set_alignment(GTK_MISC(mpeg_samplerate), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
590 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_samplerate, FALSE, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
591 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
592
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
593 mpeg_flags = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
594 gtk_misc_set_alignment(GTK_MISC(mpeg_flags), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
595 gtk_label_set_justify(GTK_LABEL(mpeg_flags), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
596 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_flags, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
597
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
598 mpeg_frames = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
599 gtk_misc_set_alignment(GTK_MISC(mpeg_frames), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
600 gtk_label_set_justify(GTK_LABEL(mpeg_frames), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
601 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_frames, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
602
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
603 mpeg_duration = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
604 gtk_misc_set_alignment(GTK_MISC(mpeg_duration), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
605 gtk_label_set_justify(GTK_LABEL(mpeg_duration), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
606 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_duration, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
607
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
608 mpeg_replaygain = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
609 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
610 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
611 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain, FALSE, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
612 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
613 mpeg_replaygain2 = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
614 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain2), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
615 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain2), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
616 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain2, FALSE, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
617 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
618 mpeg_replaygain3 = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
619 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain3), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
620 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain3), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
621 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain3, FALSE, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
622 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
623 mpeg_replaygain4 = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
624 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain4), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
625 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain4), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
626 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain4, FALSE, FALSE,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
627 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
628 mp3gain1 = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
629 gtk_misc_set_alignment(GTK_MISC(mp3gain1), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
630 gtk_label_set_justify(GTK_LABEL(mp3gain1), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
631 gtk_box_pack_start(GTK_BOX(mpeg_box), mp3gain1, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
632 mp3gain2 = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
633 gtk_misc_set_alignment(GTK_MISC(mp3gain2), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
634 gtk_label_set_justify(GTK_LABEL(mp3gain2), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
635 gtk_box_pack_start(GTK_BOX(mpeg_box), mp3gain2, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
636
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
637 mpeg_fileinfo = gtk_label_new("");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
638 gtk_misc_set_alignment(GTK_MISC(mpeg_fileinfo), 0, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
639 gtk_label_set_justify(GTK_LABEL(mpeg_fileinfo), GTK_JUSTIFY_LEFT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
640 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_fileinfo, FALSE, FALSE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
641
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
642 id3_frame = gtk_frame_new(_(" ID3 Tag "));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
643 gtk_table_attach(GTK_TABLE(left_vbox), id3_frame, 2, 4, 0, 1,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
644 GTK_FILL, GTK_FILL, 0, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
645
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
646 table = gtk_table_new(5, 5, FALSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
647 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
648 gtk_container_add(GTK_CONTAINER(id3_frame), table);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
649
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
650 label = gtk_label_new("Title:");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
651 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
652 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
653 GTK_FILL, 5, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
654
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
655 title_entry = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
656 gtk_table_attach(GTK_TABLE(table), title_entry, 1, 4, 0, 1,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
657 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
658 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
659
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
660 label = gtk_label_new("Artist:");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
661 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
662 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
663 GTK_FILL, 5, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
664
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
665 artist_entry = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
666 gtk_table_attach(GTK_TABLE(table), artist_entry, 1, 4, 1, 2,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
667 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
668 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
669
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
670 label = gtk_label_new("Album:");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
671 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
672 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
673 GTK_FILL, 5, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
674
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
675 album_entry = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
676 gtk_table_attach(GTK_TABLE(table), album_entry, 1, 4, 2, 3,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
677 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
678 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
679
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
680 label = gtk_label_new("Comment:");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
681 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
682 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
683 GTK_FILL, 5, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
684
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
685 comment_entry = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
686 gtk_table_attach(GTK_TABLE(table), comment_entry, 1, 4, 3, 4,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
687 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
688 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
689
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
690 label = gtk_label_new("Year:");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
691 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
692 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, GTK_FILL,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
693 GTK_FILL, 5, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
694
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
695 year_entry = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
696 gtk_widget_set_usize(year_entry, 40, -1);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
697 gtk_table_attach(GTK_TABLE(table), year_entry, 1, 2, 4, 5,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
698 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
699 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
700
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
701 label = gtk_label_new("Track number:");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
702 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
703 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 4, 5, GTK_FILL,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
704 GTK_FILL, 5, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
705
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
706 tracknum_entry = gtk_entry_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
707 gtk_widget_set_usize(tracknum_entry, 40, -1);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
708 gtk_table_attach(GTK_TABLE(table), tracknum_entry, 3, 4, 4, 5,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
709 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
710 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
711
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
712 label = gtk_label_new("Genre:");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
713 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
714 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6, GTK_FILL,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
715 GTK_FILL, 5, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
716
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
717 genre_combo = gtk_combo_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
718 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(genre_combo)->entry),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
719 FALSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
720 if (!genre_list) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
721 int i = 0;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
722 const id3_ucs4_t *ucs4 = id3_genre_index(i);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
723 while (ucs4) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
724 genre_list =
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
725 g_list_append(genre_list, id3_ucs4_utf8duplicate(ucs4));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
726 i++;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
727 ucs4 = id3_genre_index(i);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
728 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
729 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
730 gtk_combo_set_popdown_strings(GTK_COMBO(genre_combo), genre_list);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
731
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
732 gtk_table_attach(GTK_TABLE(table), genre_combo, 1, 4, 5, 6,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
733 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
734 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
735
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
736 bbox = gtk_hbutton_box_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
737 gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_SPREAD);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
738
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
739 save = gtk_button_new_from_stock(GTK_STOCK_SAVE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
740 g_signal_connect(G_OBJECT(save), "clicked",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
741 G_CALLBACK(save_cb), NULL);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
742 gtk_box_pack_start(GTK_BOX(bbox), save, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
743 gtk_widget_grab_default(save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
744
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
745 remove_id3 = gtk_button_new_from_stock(GTK_STOCK_DELETE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
746 g_signal_connect(G_OBJECT(remove_id3), "clicked",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
747 G_CALLBACK(remove_id3_cb), save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
748 gtk_box_pack_start(GTK_BOX(bbox), remove_id3, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
749
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
750 g_signal_connect_swapped(G_OBJECT(title_entry), "changed",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
751 G_CALLBACK(change_buttons), save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
752 g_signal_connect_swapped(G_OBJECT(artist_entry), "changed",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
753 G_CALLBACK(change_buttons), save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
754 g_signal_connect_swapped(G_OBJECT(album_entry), "changed",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
755 G_CALLBACK(change_buttons), save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
756 g_signal_connect_swapped(G_OBJECT(year_entry), "changed",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
757 G_CALLBACK(change_buttons), save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
758 g_signal_connect_swapped(G_OBJECT(comment_entry), "changed",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
759 G_CALLBACK(change_buttons), save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
760 g_signal_connect_swapped(G_OBJECT(tracknum_entry), "changed",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
761 G_CALLBACK(change_buttons), save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
762
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
763 g_signal_connect_swapped(G_OBJECT(GTK_COMBO(genre_combo)->entry), "changed",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
764 G_CALLBACK(change_buttons), save);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
765
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
766
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
767 gtk_table_attach(GTK_TABLE(table), bbox, 0, 5, 6, 7, GTK_FILL, 0,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
768 0, 8);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
769
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
770 bbox = gtk_hbutton_box_new();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
771 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
772 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
773 gtk_table_attach(GTK_TABLE(left_vbox), bbox, 0, 4, 1, 2, GTK_FILL,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
774 0, 0, 8);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
775
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
776 cancel = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
777 g_signal_connect_swapped(G_OBJECT(cancel), "clicked",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
778 G_CALLBACK(gtk_widget_destroy),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
779 G_OBJECT(window));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
780 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
781 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
782
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
783 gtk_widget_show_all(window);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
784 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
785
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
786 static void id3_frame_to_entry(char *framename, GtkEntry * entry)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
787 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
788 gtk_entry_set_text(entry, "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
789
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
790 if (info.tag) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
791 gchar *text = input_id3_get_string(info.tag, framename);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
792 if (text) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
793 gtk_entry_set_text(entry, text);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
794 g_free(text);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
795 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
796 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
797 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
798 #endif /* !NOGUI */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
799
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
800 void audmad_get_file_info(char *filename)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
801 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
802 #ifndef NOGUI
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
803 gchar *title;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
804 gchar message[128];
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
805 static char const *const layer_str[3] = { "I", "II", "III" };
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
806 static char const *const mode_str[4] = {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
807 ("single channel"), ("dual channel"), "joint stereo", "stereo"
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
808 };
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
809 char *utf_filename;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
810
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
811 #ifdef DEBUG
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
812 g_message("f: audmad_get_file_info: %s\n", filename);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
813 #endif
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
814 input_init(&info, filename);
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
815
613
85a70ace8c02 [svn] - press F5 on not yet played stream no longer hangs.
yaz
parents: 611
diff changeset
816 if (!strncasecmp("http://", filename, 7) || !strncasecmp("https://", filename, 8)) {
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
817 info.remote = TRUE;
613
85a70ace8c02 [svn] - press F5 on not yet played stream no longer hangs.
yaz
parents: 611
diff changeset
818 return; //file info dialog for remote streaming doesn't make sense.
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
819 }
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
820
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
821 utf_filename = str_to_utf8(filename);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
822 create_window();
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
823
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
824 input_get_info(&info, info.remote ? TRUE : audmad_config.fast_play_time_calc);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
825
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
826 title = g_strdup_printf("File Info - %s", g_basename(filename));
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
827 gtk_window_set_title(GTK_WINDOW(window), title);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
828 g_free(title);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
829
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
830 gtk_entry_set_text(GTK_ENTRY(filename_entry), utf_filename);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
831 gtk_editable_set_position(GTK_EDITABLE(filename_entry), -1);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
832
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
833 free(utf_filename);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
834
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
835 id3_frame_to_entry(ID3_FRAME_ARTIST, GTK_ENTRY(artist_entry));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
836 id3_frame_to_entry(ID3_FRAME_TITLE, GTK_ENTRY(title_entry));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
837 id3_frame_to_entry(ID3_FRAME_ALBUM, GTK_ENTRY(album_entry));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
838
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
839 // year
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
840 // id3_frame_to_entry (ID3_FRAME_YEAR, GTK_ENTRY (year_entry));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
841 // to set year entry, we have to do manually because TYER is still used equally to TDRC.
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
842 gtk_entry_set_text(GTK_ENTRY(year_entry), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
843 if (info.tag) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
844 gchar *text = NULL;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
845 text = input_id3_get_string(info.tag, "TDRC");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
846 if (!text)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
847 text = input_id3_get_string(info.tag, "TYER");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
848 if (text) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
849 gtk_entry_set_text(GTK_ENTRY(year_entry), text);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
850 g_free(text);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
851 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
852 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
853
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
854 id3_frame_to_entry(ID3_FRAME_TRACK, GTK_ENTRY(tracknum_entry));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
855 id3_frame_to_entry(ID3_FRAME_COMMENT, GTK_ENTRY(comment_entry));
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
856 snprintf(message, 127, "Layer %s", layer_str[info.mpeg_layer - 1]);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
857 gtk_label_set_text(GTK_LABEL(mpeg_level), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
858 if (info.vbr) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
859 snprintf(message, 127, "VBR (avg. %d kbps)", info.bitrate / 1000);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
860 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
861 else {
611
3f7a52adfe0e [svn] merge recent changes from yaz's branch.
yaz
parents: 610
diff changeset
862 snprintf(message, 127, "%d kbps", info.bitrate / 1000);
610
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
863 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
864 gtk_label_set_text(GTK_LABEL(mpeg_bitrate), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
865 snprintf(message, 127, "%d Hz", info.freq);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
866 gtk_label_set_text(GTK_LABEL(mpeg_samplerate), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
867 if (info.frames != -1) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
868 snprintf(message, 127, "%d frames", info.frames);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
869 gtk_label_set_text(GTK_LABEL(mpeg_frames), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
870 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
871 else {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
872 gtk_label_set_text(GTK_LABEL(mpeg_frames), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
873 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
874 gtk_label_set_text(GTK_LABEL(mpeg_flags), mode_str[info.mode]);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
875 snprintf(message, 127, "%ld seconds",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
876 mad_timer_count(info.duration, MAD_UNITS_SECONDS));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
877 gtk_label_set_text(GTK_LABEL(mpeg_duration), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
878
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
879 if (info.replaygain_album_str != NULL) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
880 snprintf(message, 127, "RG_album=%4s (x%4.2f)",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
881 info.replaygain_album_str, info.replaygain_album_scale);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
882 gtk_label_set_text(GTK_LABEL(mpeg_replaygain), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
883 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
884 else
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
885 gtk_label_set_text(GTK_LABEL(mpeg_replaygain), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
886
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
887 if (info.replaygain_track_str != NULL) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
888 snprintf(message, 127, "RG_track=%4s (x%4.2f)",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
889 info.replaygain_track_str, info.replaygain_track_scale);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
890 gtk_label_set_text(GTK_LABEL(mpeg_replaygain2), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
891 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
892 else
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
893 gtk_label_set_text(GTK_LABEL(mpeg_replaygain2), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
894
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
895 if (info.replaygain_album_peak_str != NULL) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
896 snprintf(message, 127, "Peak album=%4s (%+5.3fdBFS)",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
897 info.replaygain_album_peak_str,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
898 20 * log10(info.replaygain_album_peak));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
899 gtk_label_set_text(GTK_LABEL(mpeg_replaygain3), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
900 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
901 else
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
902 gtk_label_set_text(GTK_LABEL(mpeg_replaygain3), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
903
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
904 if (info.replaygain_track_peak_str != NULL) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
905 snprintf(message, 127, "Peak track=%4s (%+5.3fdBFS)",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
906 info.replaygain_track_peak_str,
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
907 20 * log10(info.replaygain_track_peak));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
908 gtk_label_set_text(GTK_LABEL(mpeg_replaygain4), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
909 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
910 else
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
911 gtk_label_set_text(GTK_LABEL(mpeg_replaygain3), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
912
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
913 if (info.mp3gain_undo_str != NULL) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
914 snprintf(message, 127, "mp3gain undo=%4s (%+5.3fdB)",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
915 info.mp3gain_undo_str, info.mp3gain_undo);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
916 gtk_label_set_text(GTK_LABEL(mp3gain1), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
917 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
918 else
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
919 gtk_label_set_text(GTK_LABEL(mp3gain1), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
920
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
921 if (info.mp3gain_minmax_str != NULL) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
922 snprintf(message, 127, "mp3gain minmax=%4s (max-min=%+6.3fdB)",
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
923 info.mp3gain_minmax_str, info.mp3gain_minmax);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
924 gtk_label_set_text(GTK_LABEL(mp3gain2), message);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
925 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
926 else
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
927 gtk_label_set_text(GTK_LABEL(mp3gain2), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
928
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
929 gtk_label_set_text(GTK_LABEL(mpeg_fileinfo), "");
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
930
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
931
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
932 /* work out the index of the genre in the list */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
933 {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
934 const id3_ucs4_t *string;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
935 struct id3_frame *frame;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
936 union id3_field *field;
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
937 frame = id3_tag_findframe(info.tag, ID3_FRAME_GENRE, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
938 if (frame) {
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
939 field = id3_frame_field(frame, 1);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
940 string = id3_field_getstrings(field, 0);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
941 string = id3_genre_name(string);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
942 if (string)
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
943 gtk_list_select_item(GTK_LIST
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
944 (GTK_COMBO(genre_combo)->list),
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
945 id3_genre_number(string));
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
946 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
947 }
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
948
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
949 gtk_widget_set_sensitive(id3_frame, TRUE);
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
950
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
951 #endif /* !NOGUI */
862190d39e00 [svn] - add madplug. It is not yet hooked up, I'll do that later.
nenolod
parents:
diff changeset
952 }