Mercurial > audlegacy-plugins
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 |
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 | 65 /* printf ("updating id3: %s: %s\n", frame_name, data); */ |
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 | 82 // setup ucs4 string |
83 if(audmad_config.sjis) { | |
84 ucs4 = id3_latin1_ucs4duplicate((id3_latin1_t *) data); | |
85 } | |
86 else { | |
87 ucs4 = id3_utf8_ucs4duplicate((id3_utf8_t *) data); | |
88 } | |
89 | |
90 // set encoding | |
91 field = id3_frame_field(frame, 0); | |
92 id3_field_settextencoding(field, audmad_config.sjis ? ID3_FIELD_TEXTENCODING_ISO_8859_1 : | |
93 ID3_FIELD_TEXTENCODING_UTF_8); | |
94 | |
95 // setup genre code | |
96 if (!strcmp(frame_name, ID3_FRAME_GENRE)) { | |
97 char *tmp; | |
98 int index = id3_genre_number(ucs4); | |
99 g_free(ucs4); | |
100 tmp = g_strdup_printf("%d", index); | |
101 ucs4 = id3_latin1_ucs4duplicate((unsigned char *) tmp); | |
102 } | |
103 | |
104 // write string | |
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 | 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 | 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 | 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 | 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 | 149 id3_tag_options(id3tag, ID3_TAG_OPTION_ID3V1, ~0); /* enables id3v1 */ |
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 | 155 encoding = audmad_config.sjis ? "SJIS" : "UTF-8"; |
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 | 158 sjis = g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL); |
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 | 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 | 164 sjis = g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL); |
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 | 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 | 170 sjis = |
171 g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL); | |
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 | 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 | 177 sjis = |
178 g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL); | |
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 | 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 | 184 sjis = |
185 g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL); | |
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 | 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 | 191 sjis = |
192 g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL); | |
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 | 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 | 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 | 199 sjis = g_convert(text, strlen(text), encoding, "UTF-8", NULL, NULL, NULL); |
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 | 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 | 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 | 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 | 245 #endif |
246 | |
247 static void remove_id3_cb(GtkWidget * w, gpointer data) | |
248 { | |
249 struct id3_file *id3file; | |
250 struct id3_tag *id3tag; | |
251 | |
252 /* read tag from file */ | |
253 id3file = id3_file_open(info.filename, ID3_FILE_MODE_READWRITE); | |
254 if (!id3file) | |
255 return; | |
256 | |
257 id3tag = id3_file_tag(id3file); | |
258 if(id3tag) { | |
259 /* since current libid3tag cannot delete tag completely, just add a dummy. */ | |
260 const char *dummy = ""; | |
261 update_id3_frame(id3tag, ID3_FRAME_TITLE, dummy); | |
262 update_id3_frame(id3tag, ID3_FRAME_ARTIST, dummy); | |
263 update_id3_frame(id3tag, ID3_FRAME_ALBUM, dummy); | |
264 update_id3_frame(id3tag, ID3_FRAME_YEAR, dummy); | |
265 update_id3_frame(id3tag, ID3_FRAME_TRACK, dummy); | |
266 update_id3_frame(id3tag, ID3_FRAME_GENRE, "Other"); | |
267 update_id3_frame(id3tag, ID3_FRAME_COMMENT, dummy); | |
268 | |
269 if (id3_file_update(id3file) != 0) { | |
270 xmms_show_message("File Info", "Couldn't write tag!", "OK", FALSE, | |
271 NULL, NULL); | |
272 } | |
273 } | |
274 | |
275 id3_file_close(id3file); | |
276 | |
277 gtk_entry_set_text(GTK_ENTRY(title_entry), ""); | |
278 gtk_entry_set_text(GTK_ENTRY(artist_entry), ""); | |
279 gtk_entry_set_text(GTK_ENTRY(album_entry), ""); | |
280 gtk_entry_set_text(GTK_ENTRY(comment_entry), ""); | |
281 gtk_entry_set_text(GTK_ENTRY(year_entry), ""); | |
282 gtk_entry_set_text(GTK_ENTRY(tracknum_entry), ""); | |
283 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), ""); | |
284 gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE); | |
285 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); | |
286 | |
287 // gtk_widget_destroy(window); | |
288 } | |
289 | |
290 #if 0 | |
291 void create_window() | |
292 { | |
293 GtkWidget *vbox, *hbox, *left_vbox, *table; | |
294 GtkWidget *mpeg_frame, *mpeg_box; | |
295 GtkWidget *label, *filename_hbox; | |
296 GtkWidget *bbox, *save, *remove_id3, *cancel; | |
297 | |
298 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
299 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); | |
300 gtk_signal_connect(GTK_OBJECT(window), "destroy", | |
301 GTK_SIGNAL_FUNC(close_window), &window); | |
302 gtk_container_set_border_width(GTK_CONTAINER(window), 10); | |
303 | |
304 vbox = gtk_vbox_new(FALSE, 10); | |
305 gtk_container_add(GTK_CONTAINER(window), vbox); | |
306 | |
307 filename_hbox = gtk_hbox_new(FALSE, 5); | |
308 gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0); | |
309 | |
310 label = gtk_label_new("Filename:"); | |
311 gtk_box_pack_start(GTK_BOX(filename_hbox), label, FALSE, TRUE, 0); | |
312 filename_entry = gtk_entry_new(); | |
313 gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE); | |
314 gtk_box_pack_start(GTK_BOX(filename_hbox), filename_entry, TRUE, TRUE, | |
315 0); | |
316 | |
317 hbox = gtk_hbox_new(FALSE, 10); | |
318 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); | |
319 | |
320 left_vbox = gtk_vbox_new(FALSE, 10); | |
321 gtk_box_pack_start(GTK_BOX(hbox), left_vbox, FALSE, FALSE, 0); | |
322 | |
323 id3_frame = gtk_frame_new("ID3 Tag:"); | |
324 gtk_box_pack_start(GTK_BOX(left_vbox), id3_frame, FALSE, FALSE, 0); | |
325 | |
326 table = gtk_table_new(5, 5, FALSE); | |
327 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
328 gtk_container_add(GTK_CONTAINER(id3_frame), table); | |
329 | |
330 label = gtk_label_new("Title:"); | |
331 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
332 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, | |
333 GTK_FILL, 5, 5); | |
334 | |
335 title_entry = gtk_entry_new(); | |
336 gtk_table_attach(GTK_TABLE(table), title_entry, 1, 4, 0, 1, | |
337 GTK_FILL | GTK_EXPAND | GTK_SHRINK, | |
338 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); | |
339 | |
340 label = gtk_label_new("Artist:"); | |
341 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
342 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, | |
343 GTK_FILL, 5, 5); | |
344 | |
345 artist_entry = gtk_entry_new(); | |
346 gtk_table_attach(GTK_TABLE(table), artist_entry, 1, 4, 1, 2, | |
347 GTK_FILL | GTK_EXPAND | GTK_SHRINK, | |
348 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); | |
349 | |
350 label = gtk_label_new("Album:"); | |
351 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
352 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, | |
353 GTK_FILL, 5, 5); | |
354 | |
355 album_entry = gtk_entry_new(); | |
356 gtk_table_attach(GTK_TABLE(table), album_entry, 1, 4, 2, 3, | |
357 GTK_FILL | GTK_EXPAND | GTK_SHRINK, | |
358 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); | |
359 | |
360 label = gtk_label_new("Comment:"); | |
361 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
362 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, | |
363 GTK_FILL, 5, 5); | |
364 | |
365 comment_entry = gtk_entry_new(); | |
366 gtk_table_attach(GTK_TABLE(table), comment_entry, 1, 4, 3, 4, | |
367 GTK_FILL | GTK_EXPAND | GTK_SHRINK, | |
368 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); | |
369 | |
370 label = gtk_label_new("Year:"); | |
371 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
372 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, GTK_FILL, | |
373 GTK_FILL, 5, 5); | |
374 | |
375 year_entry = gtk_entry_new(); | |
376 gtk_widget_set_usize(year_entry, 40, -1); | |
377 gtk_table_attach(GTK_TABLE(table), year_entry, 1, 2, 4, 5, | |
378 GTK_FILL | GTK_EXPAND | GTK_SHRINK, | |
379 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); | |
380 | |
381 label = gtk_label_new("Track number:"); | |
382 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
383 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 4, 5, GTK_FILL, | |
384 GTK_FILL, 5, 5); | |
385 | |
386 tracknum_entry = gtk_entry_new(); | |
387 gtk_widget_set_usize(tracknum_entry, 40, -1); | |
388 gtk_table_attach(GTK_TABLE(table), tracknum_entry, 3, 4, 4, 5, | |
389 GTK_FILL | GTK_EXPAND | GTK_SHRINK, | |
390 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); | |
391 | |
392 label = gtk_label_new("Genre:"); | |
393 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
394 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6, GTK_FILL, | |
395 GTK_FILL, 5, 5); | |
396 | |
397 genre_combo = gtk_combo_new(); | |
398 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), | |
399 FALSE); | |
400 if (!genre_list) { | |
401 int i = 0; | |
402 const id3_ucs4_t *ucs4 = id3_genre_index(i); | |
403 while (ucs4) { | |
404 genre_list = | |
405 g_list_append(genre_list, id3_ucs4_latin1duplicate(ucs4)); | |
406 i++; | |
407 ucs4 = id3_genre_index(i); | |
408 } | |
409 } | |
410 gtk_combo_set_popdown_strings(GTK_COMBO(genre_combo), genre_list); | |
411 | |
412 gtk_table_attach(GTK_TABLE(table), genre_combo, 1, 4, 5, 6, | |
413 GTK_FILL | GTK_EXPAND | GTK_SHRINK, | |
414 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); | |
415 | |
416 bbox = gtk_hbutton_box_new(); | |
417 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
418 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); | |
419 gtk_box_pack_start(GTK_BOX(left_vbox), bbox, FALSE, FALSE, 0); | |
420 | |
421 save = gtk_button_new_with_label("Save"); | |
422 gtk_signal_connect(GTK_OBJECT(save), "clicked", | |
423 GTK_SIGNAL_FUNC(save_cb), NULL); | |
424 GTK_WIDGET_SET_FLAGS(save, GTK_CAN_DEFAULT); | |
425 gtk_box_pack_start(GTK_BOX(bbox), save, TRUE, TRUE, 0); | |
426 gtk_widget_grab_default(save); | |
427 | |
428 remove_id3 = gtk_button_new_with_label("Remove ID3"); | |
429 gtk_signal_connect(GTK_OBJECT(remove_id3), "clicked", | |
430 GTK_SIGNAL_FUNC(remove_id3_cb), NULL); | |
431 GTK_WIDGET_SET_FLAGS(remove_id3, GTK_CAN_DEFAULT); | |
432 gtk_box_pack_start(GTK_BOX(bbox), remove_id3, TRUE, TRUE, 0); | |
433 | |
434 cancel = gtk_button_new_with_label("Cancel"); | |
435 gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", | |
436 GTK_SIGNAL_FUNC(gtk_widget_destroy), | |
437 GTK_OBJECT(window)); | |
438 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); | |
439 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); | |
440 | |
441 mpeg_frame = gtk_frame_new("MPEG Info:"); | |
442 gtk_box_pack_start(GTK_BOX(hbox), mpeg_frame, FALSE, FALSE, 0); | |
443 | |
444 mpeg_box = gtk_vbox_new(FALSE, 5); | |
445 gtk_container_add(GTK_CONTAINER(mpeg_frame), mpeg_box); | |
446 gtk_container_set_border_width(GTK_CONTAINER(mpeg_box), 10); | |
447 gtk_box_set_spacing(GTK_BOX(mpeg_box), 0); | |
448 | |
449 mpeg_level = gtk_label_new(""); | |
450 gtk_widget_set_usize(mpeg_level, 120, -2); | |
451 gtk_misc_set_alignment(GTK_MISC(mpeg_level), 0, 0); | |
452 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_level, FALSE, FALSE, 0); | |
453 | |
454 mpeg_bitrate = gtk_label_new(""); | |
455 gtk_misc_set_alignment(GTK_MISC(mpeg_bitrate), 0, 0); | |
456 gtk_label_set_justify(GTK_LABEL(mpeg_bitrate), GTK_JUSTIFY_LEFT); | |
457 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_bitrate, FALSE, FALSE, 0); | |
458 | |
459 mpeg_samplerate = gtk_label_new(""); | |
460 gtk_misc_set_alignment(GTK_MISC(mpeg_samplerate), 0, 0); | |
461 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_samplerate, FALSE, FALSE, | |
462 0); | |
463 | |
464 mpeg_flags = gtk_label_new(""); | |
465 gtk_misc_set_alignment(GTK_MISC(mpeg_flags), 0, 0); | |
466 gtk_label_set_justify(GTK_LABEL(mpeg_flags), GTK_JUSTIFY_LEFT); | |
467 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_flags, FALSE, FALSE, 0); | |
468 | |
469 mpeg_frames = gtk_label_new(""); | |
470 gtk_misc_set_alignment(GTK_MISC(mpeg_frames), 0, 0); | |
471 gtk_label_set_justify(GTK_LABEL(mpeg_frames), GTK_JUSTIFY_LEFT); | |
472 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_frames, FALSE, FALSE, 0); | |
473 | |
474 mpeg_duration = gtk_label_new(""); | |
475 gtk_misc_set_alignment(GTK_MISC(mpeg_duration), 0, 0); | |
476 gtk_label_set_justify(GTK_LABEL(mpeg_duration), GTK_JUSTIFY_LEFT); | |
477 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_duration, FALSE, FALSE, 0); | |
478 | |
479 mpeg_replaygain = gtk_label_new(""); | |
480 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain), 0, 0); | |
481 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain), GTK_JUSTIFY_LEFT); | |
482 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain, FALSE, FALSE, | |
483 0); | |
484 mpeg_replaygain2 = gtk_label_new(""); | |
485 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain2), 0, 0); | |
486 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain2), GTK_JUSTIFY_LEFT); | |
487 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain2, FALSE, FALSE, | |
488 0); | |
489 mpeg_replaygain3 = gtk_label_new(""); | |
490 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain3), 0, 0); | |
491 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain3), GTK_JUSTIFY_LEFT); | |
492 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain3, FALSE, FALSE, | |
493 0); | |
494 mpeg_replaygain4 = gtk_label_new(""); | |
495 gtk_misc_set_alignment(GTK_MISC(mpeg_replaygain4), 0, 0); | |
496 gtk_label_set_justify(GTK_LABEL(mpeg_replaygain4), GTK_JUSTIFY_LEFT); | |
497 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_replaygain4, FALSE, FALSE, | |
498 0); | |
499 mp3gain1 = gtk_label_new(""); | |
500 gtk_misc_set_alignment(GTK_MISC(mp3gain1), 0, 0); | |
501 gtk_label_set_justify(GTK_LABEL(mp3gain1), GTK_JUSTIFY_LEFT); | |
502 gtk_box_pack_start(GTK_BOX(mpeg_box), mp3gain1, FALSE, FALSE, 0); | |
503 mp3gain2 = gtk_label_new(""); | |
504 gtk_misc_set_alignment(GTK_MISC(mp3gain2), 0, 0); | |
505 gtk_label_set_justify(GTK_LABEL(mp3gain2), GTK_JUSTIFY_LEFT); | |
506 gtk_box_pack_start(GTK_BOX(mpeg_box), mp3gain2, FALSE, FALSE, 0); | |
507 | |
508 mpeg_fileinfo = gtk_label_new(""); | |
509 gtk_misc_set_alignment(GTK_MISC(mpeg_fileinfo), 0, 0); | |
510 gtk_label_set_justify(GTK_LABEL(mpeg_fileinfo), GTK_JUSTIFY_LEFT); | |
511 gtk_box_pack_start(GTK_BOX(mpeg_box), mpeg_fileinfo, FALSE, FALSE, 0); | |
512 | |
513 gtk_widget_show_all(window); | |
514 } | |
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 | 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 | 814 input_init(&info, filename); |
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 | 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 | 819 } |
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 | 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 | 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 | 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 | 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 } |