annotate Plugins/Input/mpg123/fileinfo.c @ 1121:75ac6ae39225 trunk

[svn] - add section concerning the MP3 patents and commercial use
author nenolod
date Tue, 30 May 2006 23:28:14 -0700
parents 4be4d74db123
children f12d7e208b43
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 /* BMP - Cross-platform multimedia player
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 * Copyright (C) 2003-2004 BMP development team.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 * Based on XMMS:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 * Copyright (C) 1998-2003 XMMS development team.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 * (at your option) any later version.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
16 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 #include "mpg123.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
24 #include <tag_c.h>
964
bf06569fb0b4 [svn] Quick n dirty unicode hack pending taglib-1.5.
nemo
parents: 959
diff changeset
25 #include "tag_c_hacked.h"
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27 #include <glib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28 #include <glib/gi18n.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 #include <gtk/gtk.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30 #include <gdk/gdkkeysyms.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31 #include <stdio.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32 #include <stdlib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33 #include <string.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 #include <stdarg.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36 #include <unistd.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37 #include <fcntl.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 #include <errno.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40 #include "audacious/util.h"
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
41 #include "libaudacious/util.h"
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
42 #include "libaudacious/vfs.h"
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
43 #include "libaudacious/xentry.h"
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
44
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
45 #include "mp3.xpm"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
46
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
47 static GtkWidget *window = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
48 static GtkWidget *filename_entry, *id3_frame;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
49 static GtkWidget *title_entry, *artist_entry, *album_entry, *year_entry,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
50 *tracknum_entry, *comment_entry;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51 static GtkWidget *genre_combo;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 static GtkWidget *mpeg_level, *mpeg_bitrate, *mpeg_samplerate, *mpeg_flags,
993
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
53 *mpeg_error, *mpeg_copy, *mpeg_orig, *mpeg_emph, *mpeg_filesize;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54 static GtkWidget *mpeg_level_val, *mpeg_bitrate_val, *mpeg_samplerate_val,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55 *mpeg_error_val, *mpeg_copy_val, *mpeg_orig_val, *mpeg_emph_val,
993
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
56 *mpeg_filesize_val, *mpeg_flags_val;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58 GtkWidget *vbox, *hbox, *left_vbox, *table;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59 GtkWidget *mpeg_frame, *mpeg_box;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 GtkWidget *label, *filename_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
61 GtkWidget *bbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
62 GtkWidget *remove_id3, *cancel, *save;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63 GtkWidget *boxx;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
65 VFSFile *fh;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
66 const gchar *emphasis[4];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
67 const gchar *bool_label[2];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
69 static GList *genre_list = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
70 static gchar *current_filename = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
71
1098
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
72 extern gchar *mpgdec_filename;
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
73 extern gint mpgdec_bitrate, mpgdec_frequency, mpgdec_layer, mpgdec_lsf,
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
74 mpgdec_mode;
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
75 extern gboolean mpgdec_stereo, mpgdec_mpeg25;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
76
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
77 glong info_rate;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
78
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
79 static TagLib_File *taglib_file;
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
80 static TagLib_Tag *taglib_tag;
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
81 static const TagLib_AudioProperties *taglib_ap;
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
82
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
83 void fill_entries(GtkWidget * w, gpointer data);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
84
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
85 #define MAX_STR_LEN 100
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
86
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
87 static gint
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
88 genre_comp_func(gconstpointer a, gconstpointer b)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
89 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
90 return strcasecmp(a, b);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
91 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
92
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
93 static gboolean
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
94 fileinfo_keypress_cb(GtkWidget * widget,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
95 GdkEventKey * event,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
96 gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
97 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
98 if (!event)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
99 return FALSE;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
100
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
101 switch (event->keyval) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
102 case GDK_Escape:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
103 gtk_widget_destroy(window);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
104 break;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
105 default:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
106 return FALSE;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
107 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
108
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
109 return TRUE;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
110 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
111
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
112 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
113 save_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
114 {
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
115 int result;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
116
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
117 if (str_has_prefix_nocase(current_filename, "http://"))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
118 return;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
119
964
bf06569fb0b4 [svn] Quick n dirty unicode hack pending taglib-1.5.
nemo
parents: 959
diff changeset
120 taglib_set_strings_unicode(1);
bf06569fb0b4 [svn] Quick n dirty unicode hack pending taglib-1.5.
nemo
parents: 959
diff changeset
121
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
122 taglib_file = taglib_file_new(current_filename);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
123 if(taglib_file) {
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
124 taglib_tag = taglib_file_tag(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
125 taglib_ap = taglib_file_audioproperties(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
126 } else return;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
127
964
bf06569fb0b4 [svn] Quick n dirty unicode hack pending taglib-1.5.
nemo
parents: 959
diff changeset
128 taglib_set_id3v2_default_text_encoding();
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
129 taglib_tag_set_title(taglib_tag, gtk_entry_get_text(GTK_ENTRY(title_entry)));
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
130 taglib_tag_set_artist(taglib_tag, gtk_entry_get_text(GTK_ENTRY(artist_entry)));
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
131 taglib_tag_set_album(taglib_tag, gtk_entry_get_text(GTK_ENTRY(album_entry)));
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
132 taglib_tag_set_comment(taglib_tag, gtk_entry_get_text(GTK_ENTRY(comment_entry)));
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
133 taglib_tag_set_year(taglib_tag, atoi(gtk_entry_get_text(GTK_ENTRY(year_entry))));
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
134 taglib_tag_set_track(taglib_tag, atoi(gtk_entry_get_text(GTK_ENTRY(tracknum_entry))));
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
135 taglib_tag_set_genre(taglib_tag, gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(genre_combo)->entry)));
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
136 gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
137 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
138
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
139 result = taglib_file_save(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
140 taglib_file_free(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
141 taglib_tag_free_strings();
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
142 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
143
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
144 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
145 label_set_text(GtkWidget * label, gchar * str, ...)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
146 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
147 va_list args;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
148 gchar tempstr[MAX_STR_LEN];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
149
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
150 va_start(args, str);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
151 g_vsnprintf(tempstr, MAX_STR_LEN, str, args);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
152 va_end(args);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
153
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
154 gtk_label_set_text(GTK_LABEL(label), tempstr);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
155 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
156
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
157 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
158 remove_id3_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
159 {
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
160 int result;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
161
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
162 if (str_has_prefix_nocase(current_filename, "http://"))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
163 return;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
164
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
165 taglib_file = taglib_file_new(current_filename);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
166 if(taglib_file) {
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
167 taglib_tag = taglib_file_tag(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
168 taglib_ap = taglib_file_audioproperties(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
169 } else return;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
170
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
171 taglib_tag_set_title(taglib_tag, "");
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
172 gtk_entry_set_text(GTK_ENTRY(title_entry), "");
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
173 taglib_tag_set_artist(taglib_tag, "");
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
174 gtk_entry_set_text(GTK_ENTRY(artist_entry), "");
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
175 taglib_tag_set_album(taglib_tag, "");
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
176 gtk_entry_set_text(GTK_ENTRY(album_entry), "");
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
177 taglib_tag_set_comment(taglib_tag, "");
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
178 gtk_entry_set_text(GTK_ENTRY(comment_entry), "");
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
179 taglib_tag_set_year(taglib_tag, 0);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
180 gtk_entry_set_text(GTK_ENTRY(year_entry), "");
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
181 taglib_tag_set_track(taglib_tag, 0);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
182 gtk_entry_set_text(GTK_ENTRY(tracknum_entry), "");
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
183 taglib_tag_set_genre(taglib_tag, "");
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
184 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), "");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
185 gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
186 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
187
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
188 result = taglib_file_save(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
189 taglib_file_free(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
190 taglib_tag_free_strings();
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
191 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
192
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
193 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
194 set_mpeg_level_label(gboolean mpeg25, gint lsf, gint layer)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
195 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
196 if (mpeg25)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
197 label_set_text(mpeg_level_val, "MPEG-2.5 Layer %d", layer);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
198 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
199 label_set_text(mpeg_level_val, "MPEG-%d Layer %d", lsf + 1, layer);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
200 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
201
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
202 static const gchar *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
203 channel_mode_name(gint mode)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
204 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
205 static const gchar *channel_mode[] = { N_("Stereo"), N_("Joint stereo"),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
206 N_("Dual channel"), N_("Single channel")
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
207 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
208 if (mode < 0 || mode > 3)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
209 return "";
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
210
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
211 return gettext(channel_mode[mode]);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
212 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
213
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
214 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
215 file_info_http(gchar * filename)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
216 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
217 gtk_widget_set_sensitive(id3_frame, FALSE);
1098
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
218 if (mpgdec_filename && !strcmp(filename, mpgdec_filename) &&
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
219 mpgdec_bitrate != 0) {
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
220 set_mpeg_level_label(mpgdec_mpeg25, mpgdec_lsf, mpgdec_layer);
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
221 label_set_text(mpeg_bitrate_val, _("%d KBit/s"), mpgdec_bitrate);
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
222 label_set_text(mpeg_samplerate_val, _("%ld Hz"), mpgdec_frequency);
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
223 label_set_text(mpeg_flags, "%s", channel_mode_name(mpgdec_mode));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
224 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
225 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
226
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
227 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
228 change_buttons(GtkObject * object)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
229 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
230 gtk_widget_set_sensitive(GTK_WIDGET(object), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
231 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
232
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
233 void
1098
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
234 mpgdec_file_info_box(gchar * filename)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
235 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
236 gint i;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
237 gchar *title, *filename_utf8;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
238
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
239 emphasis[0] = _("None");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
240 emphasis[1] = _("50/15 ms");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
241 emphasis[2] = "";
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
242 emphasis[3] = _("CCIT J.17");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
243 bool_label[0] = _("No");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
244 bool_label[1] = _("Yes");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
245
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
246 if (!window) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
247 GtkWidget *pixmapwid;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
248 GdkPixbuf *pixbuf;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
249 PangoAttrList *attrs;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
250 PangoAttribute *attr;
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
251 GtkWidget *test_table = gtk_table_new(2, 11, FALSE);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
252 GtkWidget *urk, *blark;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
253
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
254 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
255 gtk_window_set_type_hint(GTK_WINDOW(window),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
256 GDK_WINDOW_TYPE_HINT_DIALOG);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
257 gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
258 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
259 g_signal_connect(G_OBJECT(window), "destroy",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
260 G_CALLBACK(gtk_widget_destroyed), &window);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
261 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
262
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
263 vbox = gtk_vbox_new(FALSE, 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
264 gtk_container_add(GTK_CONTAINER(window), vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
265
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
266
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
267 filename_vbox = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
268 gtk_box_pack_start(GTK_BOX(vbox), filename_vbox, FALSE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
269
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
270 pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
271 gnome_mime_audio_xpm);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
272 pixmapwid = gtk_image_new_from_pixbuf(pixbuf);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
273 g_object_unref(pixbuf);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
274 gtk_misc_set_alignment(GTK_MISC(pixmapwid), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
275 gtk_box_pack_start(GTK_BOX(filename_vbox), pixmapwid, FALSE, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
276 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
277
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
278 label = gtk_label_new(NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
279
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
280 attrs = pango_attr_list_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
281
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
282 attr = pango_attr_weight_new(PANGO_WEIGHT_BOLD);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
283 attr->start_index = 0;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
284 attr->end_index = -1;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
285 pango_attr_list_insert(attrs, attr);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
286
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
287 gtk_label_set_attributes(GTK_LABEL(label), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
288 gtk_label_set_text(GTK_LABEL(label), _("Name:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
289 gtk_box_pack_start(GTK_BOX(filename_vbox), label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
290
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
291 filename_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
292 gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
293 gtk_box_pack_start(GTK_BOX(filename_vbox), filename_entry, TRUE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
294 TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
295
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
296 hbox = gtk_hbox_new(FALSE, 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
297 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
298
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
299 left_vbox = gtk_table_new(2, 4, FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
300 gtk_box_pack_start(GTK_BOX(hbox), left_vbox, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
301
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
302 /* MPEG-Info window */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
303
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
304 mpeg_frame = gtk_frame_new(_(" MPEG Info "));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
305 gtk_table_attach(GTK_TABLE(left_vbox), mpeg_frame, 0, 2, 0, 1,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
306 GTK_FILL, GTK_FILL, 0, 4);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
307
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
308 mpeg_box = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
309 gtk_container_add(GTK_CONTAINER(mpeg_frame), mpeg_box);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
310 gtk_container_set_border_width(GTK_CONTAINER(mpeg_box), 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
311 gtk_box_set_spacing(GTK_BOX(mpeg_box), 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
312
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
313 /* MPEG Layer Info */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
314
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
315 /* FIXME: Obvious... */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
316 gtk_container_set_border_width(GTK_CONTAINER(test_table), 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
317 gtk_container_add(GTK_CONTAINER(mpeg_box), test_table);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
318
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
319 mpeg_level = gtk_label_new(_("MPEG Level:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
320 gtk_misc_set_alignment(GTK_MISC(mpeg_level), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
321 gtk_label_set_justify(GTK_LABEL(mpeg_level), GTK_JUSTIFY_RIGHT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
322 gtk_label_set_attributes(GTK_LABEL(mpeg_level), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
323 gtk_table_attach(GTK_TABLE(test_table), mpeg_level, 0, 1, 0, 1,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
324 GTK_FILL, GTK_FILL, 5, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
325
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
326 mpeg_level_val = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
327 gtk_misc_set_alignment(GTK_MISC(mpeg_level_val), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
328 gtk_label_set_justify(GTK_LABEL(mpeg_level_val), GTK_JUSTIFY_LEFT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
329 gtk_table_attach(GTK_TABLE(test_table), mpeg_level_val, 1, 2, 0, 1,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
330 GTK_FILL, GTK_FILL, 10, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
331
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
332 mpeg_bitrate = gtk_label_new(_("Bit rate:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
333 gtk_misc_set_alignment(GTK_MISC(mpeg_bitrate), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
334 gtk_label_set_justify(GTK_LABEL(mpeg_bitrate), GTK_JUSTIFY_RIGHT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
335 gtk_label_set_attributes(GTK_LABEL(mpeg_bitrate), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
336 gtk_table_attach(GTK_TABLE(test_table), mpeg_bitrate, 0, 1, 1, 2,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
337 GTK_FILL, GTK_FILL, 5, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
338
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
339 mpeg_bitrate_val = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
340 gtk_misc_set_alignment(GTK_MISC(mpeg_bitrate_val), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
341 gtk_label_set_justify(GTK_LABEL(mpeg_bitrate_val), GTK_JUSTIFY_LEFT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
342 gtk_table_attach(GTK_TABLE(test_table), mpeg_bitrate_val, 1, 2, 1,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
343 2, GTK_FILL, GTK_FILL, 10, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
344
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
345 mpeg_samplerate = gtk_label_new(_("Sample rate:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
346 gtk_misc_set_alignment(GTK_MISC(mpeg_samplerate), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
347 gtk_label_set_justify(GTK_LABEL(mpeg_samplerate), GTK_JUSTIFY_RIGHT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
348 gtk_label_set_attributes(GTK_LABEL(mpeg_samplerate), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
349 gtk_table_attach(GTK_TABLE(test_table), mpeg_samplerate, 0, 1, 2,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
350 3, GTK_FILL, GTK_FILL, 5, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
351
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
352 mpeg_samplerate_val = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
353 gtk_misc_set_alignment(GTK_MISC(mpeg_samplerate_val), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
354 gtk_label_set_justify(GTK_LABEL(mpeg_samplerate_val),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
355 GTK_JUSTIFY_LEFT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
356 gtk_table_attach(GTK_TABLE(test_table), mpeg_samplerate_val, 1, 2,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
357 2, 3, GTK_FILL, GTK_FILL, 10, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
358
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
359 mpeg_filesize = gtk_label_new(_("File size:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
360 gtk_misc_set_alignment(GTK_MISC(mpeg_filesize), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
361 gtk_label_set_justify(GTK_LABEL(mpeg_filesize), GTK_JUSTIFY_RIGHT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
362 gtk_label_set_attributes(GTK_LABEL(mpeg_filesize), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
363 gtk_table_attach(GTK_TABLE(test_table), mpeg_filesize, 0, 1, 4, 5,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
364 GTK_FILL, GTK_FILL, 5, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
365
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
366 mpeg_filesize_val = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
367 gtk_misc_set_alignment(GTK_MISC(mpeg_filesize_val), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
368 gtk_label_set_justify(GTK_LABEL(mpeg_filesize_val), GTK_JUSTIFY_LEFT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
369 gtk_table_attach(GTK_TABLE(test_table), mpeg_filesize_val, 1, 2, 4,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
370 5, GTK_FILL, GTK_FILL, 10, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
371
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
372 mpeg_flags = gtk_label_new(_("Mode:"));
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
373 gtk_misc_set_alignment(GTK_MISC(mpeg_flags), 1, 0.5);
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
374 gtk_label_set_justify(GTK_LABEL(mpeg_flags), GTK_JUSTIFY_RIGHT);
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
375 gtk_label_set_attributes(GTK_LABEL(mpeg_flags), attrs);
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
376 gtk_table_attach(GTK_TABLE(test_table), mpeg_flags, 0, 1, 5, 6,
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
377 GTK_FILL, GTK_FILL, 5, 2);
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
378
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
379 mpeg_flags_val = gtk_label_new("");
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
380 gtk_misc_set_alignment(GTK_MISC(mpeg_flags_val), 0, 0);
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
381 gtk_label_set_justify(GTK_LABEL(mpeg_flags_val), GTK_JUSTIFY_LEFT);
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
382 gtk_table_attach(GTK_TABLE(test_table), mpeg_flags_val, 1, 2, 5,
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
383 6, GTK_FILL, GTK_FILL, 10, 2);
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
384
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
385 urk = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
386 blark = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
387 gtk_misc_set_alignment(GTK_MISC(urk), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
388 gtk_misc_set_alignment(GTK_MISC(blark), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
389
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
390 gtk_table_attach(GTK_TABLE(test_table), urk, 0, 1, 6, 7, GTK_FILL,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
391 GTK_FILL, 5, 5);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
392 gtk_table_attach(GTK_TABLE(test_table), blark, 1, 2, 6, 7,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
393 GTK_FILL, GTK_FILL, 10, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
394
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
395 mpeg_error = gtk_label_new(_("Error Protection:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
396 gtk_misc_set_alignment(GTK_MISC(mpeg_error), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
397 gtk_label_set_justify(GTK_LABEL(mpeg_error), GTK_JUSTIFY_RIGHT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
398 gtk_label_set_attributes(GTK_LABEL(mpeg_error), attrs);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
399 gtk_table_attach(GTK_TABLE(test_table), mpeg_error, 0, 1, 7, 8,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
400 GTK_FILL, GTK_FILL, 5, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
401
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
402 mpeg_error_val = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
403 gtk_misc_set_alignment(GTK_MISC(mpeg_error_val), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
404 gtk_label_set_justify(GTK_LABEL(mpeg_error_val), GTK_JUSTIFY_LEFT);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
405 gtk_table_attach(GTK_TABLE(test_table), mpeg_error_val, 1, 2, 7, 8,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
406 GTK_FILL, GTK_FILL, 10, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
407
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
408 mpeg_copy = gtk_label_new(_("Copyright:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
409 gtk_misc_set_alignment(GTK_MISC(mpeg_copy), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
410 gtk_label_set_justify(GTK_LABEL(mpeg_copy), GTK_JUSTIFY_RIGHT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
411 gtk_label_set_attributes(GTK_LABEL(mpeg_copy), attrs);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
412 gtk_table_attach(GTK_TABLE(test_table), mpeg_copy, 0, 1, 8, 9,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
413 GTK_FILL, GTK_FILL, 5, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
414
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
415 mpeg_copy_val = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
416 gtk_misc_set_alignment(GTK_MISC(mpeg_copy_val), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
417 gtk_label_set_justify(GTK_LABEL(mpeg_copy_val), GTK_JUSTIFY_LEFT);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
418 gtk_table_attach(GTK_TABLE(test_table), mpeg_copy_val, 1, 2, 8, 9,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
419 GTK_FILL, GTK_FILL, 10, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
420
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
421 mpeg_orig = gtk_label_new(_("Original:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
422 gtk_misc_set_alignment(GTK_MISC(mpeg_orig), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
423 gtk_label_set_justify(GTK_LABEL(mpeg_orig), GTK_JUSTIFY_RIGHT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
424 gtk_label_set_attributes(GTK_LABEL(mpeg_orig), attrs);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
425 gtk_table_attach(GTK_TABLE(test_table), mpeg_orig, 0, 1, 9, 10,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
426 GTK_FILL, GTK_FILL, 5, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
427
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
428 mpeg_orig_val = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
429 gtk_misc_set_alignment(GTK_MISC(mpeg_orig_val), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
430 gtk_label_set_justify(GTK_LABEL(mpeg_orig_val), GTK_JUSTIFY_LEFT);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
431 gtk_table_attach(GTK_TABLE(test_table), mpeg_orig_val, 1, 2, 9, 10,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
432 GTK_FILL, GTK_FILL, 10, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
433
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
434 mpeg_emph = gtk_label_new(_("Emphasis:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
435 gtk_misc_set_alignment(GTK_MISC(mpeg_emph), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
436 gtk_label_set_justify(GTK_LABEL(mpeg_emph), GTK_JUSTIFY_RIGHT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
437 gtk_label_set_attributes(GTK_LABEL(mpeg_emph), attrs);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
438 gtk_table_attach(GTK_TABLE(test_table), mpeg_emph, 0, 1, 10, 11,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
439 GTK_FILL, GTK_FILL, 5, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
440
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
441 mpeg_emph_val = gtk_label_new("");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
442 gtk_misc_set_alignment(GTK_MISC(mpeg_emph_val), 0, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
443 gtk_label_set_justify(GTK_LABEL(mpeg_emph_val), GTK_JUSTIFY_LEFT);
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
444 gtk_table_attach(GTK_TABLE(test_table), mpeg_emph_val, 1, 2, 10, 11,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
445 GTK_FILL, GTK_FILL, 10, 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
446
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
447
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
448 id3_frame = gtk_frame_new(_(" ID3 Tag "));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
449 gtk_table_attach(GTK_TABLE(left_vbox), id3_frame, 2, 4, 0, 1,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
450 GTK_FILL, GTK_FILL, 0, 4);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
451
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
452 table = gtk_table_new(7, 5, FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
453 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
454 gtk_container_add(GTK_CONTAINER(id3_frame), table);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
455
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
456 label = gtk_label_new(_("Title:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
457 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
458 gtk_label_set_attributes(GTK_LABEL(label), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
459 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
460 GTK_FILL, 5, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
461
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
462 title_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
463 gtk_table_attach(GTK_TABLE(table), title_entry, 1, 6, 0, 1,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
464 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
465 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
466
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
467 label = gtk_label_new(_("Artist:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
468 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
469 gtk_label_set_attributes(GTK_LABEL(label), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
470 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
471 GTK_FILL, 5, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
472
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
473 artist_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
474 gtk_table_attach(GTK_TABLE(table), artist_entry, 1, 6, 1, 2,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
475 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
476 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
477
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
478 label = gtk_label_new(_("Album:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
479 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
480 gtk_label_set_attributes(GTK_LABEL(label), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
481 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
482 GTK_FILL, 5, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
483
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
484 album_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
485 gtk_table_attach(GTK_TABLE(table), album_entry, 1, 6, 2, 3,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
486 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
487 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
488
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
489 label = gtk_label_new(_("Comment:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
490 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
491 gtk_label_set_attributes(GTK_LABEL(label), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
492 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
493 GTK_FILL, 5, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
494
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
495 comment_entry = gtk_entry_new();
983
6cc5538851d6 [svn] - Fun fileinfo fixes
nhjm449
parents: 964
diff changeset
496 gtk_table_attach(GTK_TABLE(table), comment_entry, 1, 6, 3, 4,
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
497 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
498 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
499
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
500 label = gtk_label_new(_("Year:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
501 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
502 gtk_label_set_attributes(GTK_LABEL(label), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
503 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, GTK_FILL,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
504 GTK_FILL, 5, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
505
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
506 year_entry = gtk_entry_new_with_max_length(4);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
507 gtk_entry_set_width_chars(GTK_ENTRY(year_entry),4);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
508 gtk_table_attach(GTK_TABLE(table), year_entry, 1, 2, 4, 5,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
509 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
510 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
511
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
512 label = gtk_label_new(_("Track number:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
513 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
514 gtk_label_set_attributes(GTK_LABEL(label), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
515 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 4, 5, GTK_FILL,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
516 GTK_FILL, 5, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
517
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
518 tracknum_entry = gtk_entry_new_with_max_length(3);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
519 gtk_widget_set_usize(tracknum_entry, 40, -1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
520 gtk_table_attach(GTK_TABLE(table), tracknum_entry, 3, 4, 4, 5,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
521 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
522 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
523
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
524 label = gtk_label_new(_("Genre:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
525 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
526 gtk_label_set_attributes(GTK_LABEL(label), attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
527 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6, GTK_FILL,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
528 GTK_FILL, 5, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
529
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
530 pango_attr_list_unref(attrs);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
531
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
532 genre_combo = gtk_combo_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
533 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(genre_combo)->entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
534 FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
535 if (!genre_list) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
536 for (i = 0; i < GENRE_MAX; i++)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
537 genre_list =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
538 g_list_prepend(genre_list,
1098
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
539 (gchar *) mpgdec_id3_genres[i]);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
540 genre_list = g_list_prepend(genre_list, "");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
541 genre_list = g_list_sort(genre_list, genre_comp_func);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
542 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
543 gtk_combo_set_popdown_strings(GTK_COMBO(genre_combo), genre_list);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
544
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
545 gtk_table_attach(GTK_TABLE(table), genre_combo, 1, 6, 5, 6,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
546 GTK_FILL | GTK_EXPAND | GTK_SHRINK,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
547 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
548
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
549 boxx = gtk_hbutton_box_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
550 gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_SPREAD);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
551
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
552 remove_id3 = gtk_button_new_from_stock(GTK_STOCK_DELETE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
553 gtk_container_add(GTK_CONTAINER(boxx), remove_id3);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
554
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
555 save = gtk_button_new_from_stock(GTK_STOCK_SAVE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
556 gtk_container_add(GTK_CONTAINER(boxx), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
557
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
558 g_signal_connect(G_OBJECT(remove_id3), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
559 G_CALLBACK(remove_id3_cb), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
560 g_signal_connect(G_OBJECT(save), "clicked", G_CALLBACK(save_cb),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
561 remove_id3);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
562
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
563 gtk_table_attach(GTK_TABLE(table), boxx, 0, 5, 6, 7, GTK_FILL, 0,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
564 0, 8);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
565
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
566 bbox = gtk_hbutton_box_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
567 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
568 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
569 gtk_table_attach(GTK_TABLE(left_vbox), bbox, 0, 4, 1, 2, GTK_FILL,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
570 0, 0, 8);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
571
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
572 cancel = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
573 g_signal_connect_swapped(G_OBJECT(cancel), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
574 G_CALLBACK(gtk_widget_destroy),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
575 G_OBJECT(window));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
576 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
577 gtk_box_pack_start(GTK_BOX(bbox), cancel, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
578 gtk_widget_grab_default(cancel);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
579
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
580
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
581 gtk_table_set_col_spacing(GTK_TABLE(left_vbox), 1, 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
582
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
583
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
584 g_signal_connect_swapped(G_OBJECT(title_entry), "changed",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
585 G_CALLBACK(change_buttons), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
586 g_signal_connect_swapped(G_OBJECT(artist_entry), "changed",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
587 G_CALLBACK(change_buttons), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
588 g_signal_connect_swapped(G_OBJECT(album_entry), "changed",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
589 G_CALLBACK(change_buttons), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
590 g_signal_connect_swapped(G_OBJECT(year_entry), "changed",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
591 G_CALLBACK(change_buttons), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
592 g_signal_connect_swapped(G_OBJECT(comment_entry), "changed",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
593 G_CALLBACK(change_buttons), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
594 g_signal_connect_swapped(G_OBJECT(tracknum_entry), "changed",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
595 G_CALLBACK(change_buttons), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
596 g_signal_connect_swapped(G_OBJECT(GTK_COMBO(genre_combo)->entry), "changed",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
597 G_CALLBACK(change_buttons), save);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
598
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
599 /* Nonsence, should i remove this altogether?
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
600 causes changes to be saved as you type -
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
601 makes save /revert buttons pointless
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
602 g_signal_connect(G_OBJECT(title_entry), "activate",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
603 G_CALLBACK(press_save), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
604 g_signal_connect(G_OBJECT(artist_entry), "activate",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
605 G_CALLBACK(press_save), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
606 g_signal_connect(G_OBJECT(album_entry), "activate",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
607 G_CALLBACK(press_save), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
608 g_signal_connect(G_OBJECT(year_entry), "activate",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
609 G_CALLBACK(press_save), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
610 g_signal_connect(G_OBJECT(comment_entry), "activate",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
611 G_CALLBACK(press_save), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
612 g_signal_connect(G_OBJECT(tracknum_entry), "activate",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
613 G_CALLBACK(press_save), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
614 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
615 g_signal_connect(G_OBJECT(window), "key_press_event",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
616 G_CALLBACK(fileinfo_keypress_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
617 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
618
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
619 g_free(current_filename);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
620 current_filename = g_strdup(filename);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
621
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
622 filename_utf8 = filename_to_utf8(filename);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
623
186
01babf2781bb [svn] Fileinfo dialog adjustment.
nenolod
parents: 61
diff changeset
624 title = g_strdup_printf(_("%s - Audacious"), g_basename(filename_utf8));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
625 gtk_window_set_title(GTK_WINDOW(window), title);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
626 g_free(title);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
627
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
628 gtk_entry_set_text(GTK_ENTRY(filename_entry), filename_utf8);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
629 g_free(filename_utf8);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
630
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
631 gtk_editable_set_position(GTK_EDITABLE(filename_entry), -1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
632
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
633 gtk_entry_set_text(GTK_ENTRY(artist_entry), "");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
634 gtk_entry_set_text(GTK_ENTRY(album_entry), "");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
635 gtk_entry_set_text(GTK_ENTRY(year_entry), "");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
636 gtk_entry_set_text(GTK_ENTRY(tracknum_entry), "");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
637 gtk_entry_set_text(GTK_ENTRY(comment_entry), "");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
638 gtk_list_select_item(GTK_LIST(GTK_COMBO(genre_combo)->list),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
639 g_list_index(genre_list, ""));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
640
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
641 gtk_label_set_text(GTK_LABEL(mpeg_level), _("MPEG Level:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
642 gtk_label_set_text(GTK_LABEL(mpeg_level_val), _("N/A"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
643
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
644 gtk_label_set_text(GTK_LABEL(mpeg_bitrate), _("Bit rate:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
645 gtk_label_set_text(GTK_LABEL(mpeg_bitrate_val), _("N/A"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
646
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
647 gtk_label_set_text(GTK_LABEL(mpeg_samplerate), _("Sample rate:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
648 gtk_label_set_text(GTK_LABEL(mpeg_samplerate_val), _("N/A"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
649
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
650 gtk_label_set_text(GTK_LABEL(mpeg_error), _("Error Protection:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
651 gtk_label_set_text(GTK_LABEL(mpeg_error_val), _("N/A"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
652
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
653 gtk_label_set_text(GTK_LABEL(mpeg_copy), _("Copyright:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
654 gtk_label_set_text(GTK_LABEL(mpeg_copy_val), _("N/A"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
655
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
656 gtk_label_set_text(GTK_LABEL(mpeg_orig), _("Original:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
657 gtk_label_set_text(GTK_LABEL(mpeg_orig_val), _("N/A"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
658
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
659 gtk_label_set_text(GTK_LABEL(mpeg_emph), _("Emphasis:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
660 gtk_label_set_text(GTK_LABEL(mpeg_emph_val), _("N/A"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
661
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
662 gtk_label_set_text(GTK_LABEL(mpeg_filesize), _("File size:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
663 gtk_label_set_text(GTK_LABEL(mpeg_filesize_val), _("N/A"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
664
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
665 gtk_label_set_text(GTK_LABEL(mpeg_flags), _("Mode:"));
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
666 gtk_label_set_text(GTK_LABEL(mpeg_flags_val), _("N/A"));
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
667
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
668 if (str_has_prefix_nocase(filename, "http://")) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
669 file_info_http(filename);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
670 return;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
671 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
672
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
673 gtk_widget_set_sensitive(id3_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
674 vfs_is_writeable(filename));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
675
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
676 fill_entries(NULL, NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
677
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
678 gtk_widget_set_sensitive(GTK_WIDGET(save), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
679 gtk_widget_show_all(window);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
680 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
681
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
682 void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
683 fill_entries(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
684 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
685 VFSFile *fh;
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
686 gchar *ptr, *ptr2;
959
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
687 guint32 i;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
688
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
689 if (str_has_prefix_nocase(current_filename, "http://"))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
690 return;
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
691
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
692 #ifdef USE_CHARDET
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
693 taglib_set_strings_unicode(FALSE);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
694 #endif
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
695 taglib_file = taglib_file_new(current_filename);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
696 if(taglib_file) {
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
697 taglib_tag = taglib_file_tag(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
698 taglib_ap = taglib_file_audioproperties(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
699 } else return;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
700
1039
fa999c7066e2 [svn] - if taglib_tag == NULL, then return instead of crash
nenolod
parents: 993
diff changeset
701 if (!taglib_tag)
fa999c7066e2 [svn] - if taglib_tag == NULL, then return instead of crash
nenolod
parents: 993
diff changeset
702 return;
fa999c7066e2 [svn] - if taglib_tag == NULL, then return instead of crash
nenolod
parents: 993
diff changeset
703
959
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
704 /* be sane here, taglib_tag results may be NULL --nenolod */
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
705 ptr = taglib_tag_title(taglib_tag);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
706
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
707 if (ptr != NULL) {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
708 ptr2 = str_to_utf8(ptr);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
709 gtk_entry_set_text(GTK_ENTRY(title_entry), ptr2);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
710 g_free(ptr2);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
711 }
959
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
712
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
713 ptr = taglib_tag_artist(taglib_tag);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
714
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
715 if (ptr != NULL) {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
716 ptr2 = str_to_utf8(ptr);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
717 gtk_entry_set_text(GTK_ENTRY(artist_entry), ptr2);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
718 g_free(ptr2);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
719 }
959
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
720
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
721 ptr = taglib_tag_album(taglib_tag);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
722
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
723 if (ptr != NULL) {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
724 ptr2 = str_to_utf8(ptr);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
725 gtk_entry_set_text(GTK_ENTRY(album_entry), ptr2);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
726 g_free(ptr2);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
727 }
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
728
959
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
729 ptr = taglib_tag_comment(taglib_tag);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
730
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
731 if (ptr != NULL) {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
732 ptr2 = str_to_utf8(ptr);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
733 gtk_entry_set_text(GTK_ENTRY(comment_entry), ptr2);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
734 g_free(ptr2);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1098
diff changeset
735 }
959
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
736
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
737 i = taglib_tag_year(taglib_tag);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
738
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
739 if (i != 0)
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
740 {
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
741 ptr = g_strdup_printf("%d", i);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
742 gtk_entry_set_text(GTK_ENTRY(year_entry), ptr);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
743 g_free(ptr);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
744 }
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
745
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
746 i = taglib_tag_track(taglib_tag);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
747
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
748 if (i != 0)
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
749 {
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
750 ptr = g_strdup_printf("%d", i);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
751 gtk_entry_set_text(GTK_ENTRY(tracknum_entry), ptr);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
752 g_free(ptr);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
753 }
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
754
993
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
755 i = taglib_audioproperties_samplerate(taglib_ap);
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
756
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
757 if (i != 0)
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
758 label_set_text(mpeg_samplerate_val, _("%ld Hz"), i);
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
759
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
760 i = taglib_audioproperties_bitrate(taglib_ap);
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
761
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
762 if (i != 0)
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
763 label_set_text(mpeg_bitrate_val, _("%d KBit/s"), i);
a9ac4beb4e15 [svn] Use taglib for length determination. Simpler code, might also deal better with some VBR MP3s if they have length info in their tags.
chainsaw
parents: 983
diff changeset
764
959
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
765 ptr = taglib_tag_genre(taglib_tag);
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
766
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
767 if (ptr != NULL)
b082b5c77461 [svn] - fix crashing with taglib
nenolod
parents: 957
diff changeset
768 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), ptr);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
769
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
770 gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
771 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
772
957
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
773 taglib_file_free(taglib_file);
12f57026da8f [svn] First attempt at introducing taglib here. Very rough, needs polishing. Please wear protective goggles before opening the file dialog. It *will* explode.
chainsaw
parents: 948
diff changeset
774 taglib_tag_free_strings();
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
775 gtk_widget_set_sensitive(GTK_WIDGET(remove_id3), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
776 gtk_widget_set_sensitive(GTK_WIDGET(save), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
777
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
778 if ((fh = vfs_fopen(current_filename, "rb")) != NULL) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
779 guint32 head;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
780 guchar tmp[4];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
781 struct frame frm;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
782
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
783 if (vfs_fread(tmp, 1, 4, fh) != 4) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
784 vfs_fclose(fh);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
785 return;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
786 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
787 head =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
788 ((guint32) tmp[0] << 24) | ((guint32) tmp[1] << 16) |
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
789 ((guint32) tmp[2] << 8) | (guint32) tmp[3];
1098
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
790 while (!mpgdec_head_check(head)) {
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
791 head <<= 8;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
792 if (vfs_fread(tmp, 1, 1, fh) != 1) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
793 vfs_fclose(fh);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
794 return;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
795 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
796 head |= tmp[0];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
797 }
1098
b5ae09a6c2f1 [svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
nenolod
parents: 1039
diff changeset
798 if (mpgdec_decode_header(&frm, head)) {
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
799 guchar *buf;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
800 gint pos;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
801
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
802 buf = g_malloc(frm.framesize + 4);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
803 vfs_fseek(fh, -4, SEEK_CUR);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
804 vfs_fread(buf, 1, frm.framesize + 4, fh);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
805 set_mpeg_level_label(frm.mpeg25, frm.lsf, frm.lay);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
806 pos = vfs_ftell(fh);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
807 vfs_fseek(fh, 0, SEEK_END);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
808 label_set_text(mpeg_error_val, _("%s"),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
809 bool_label[frm.error_protection]);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
810 label_set_text(mpeg_copy_val, _("%s"), bool_label[frm.copyright]);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
811 label_set_text(mpeg_orig_val, _("%s"), bool_label[frm.original]);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
812 label_set_text(mpeg_emph_val, _("%s"), emphasis[frm.emphasis]);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
813 label_set_text(mpeg_filesize_val, _("%lu Bytes"), vfs_ftell(fh));
908
9bc585cc3c65 [svn] Report mode from mpg123. Patch by spike, closes bug #457.
chainsaw
parents: 186
diff changeset
814 label_set_text(mpeg_flags_val, _("%s"), channel_mode_name(frm.mode));
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
815 g_free(buf);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
816 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
817 vfs_fclose(fh);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
818 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
819
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
820 }