Mercurial > audlegacy-plugins
annotate src/tta/libtta.c @ 1325:a33da9237bed
Several "i18n" improvements.
author | Stany HENRY <StrassBoy@gmail.com> |
---|---|
date | Sat, 21 Jul 2007 17:55:46 +0200 |
parents | f0b81aeed25f |
children | 4c43c38bd033 |
rev | line source |
---|---|
290 | 1 /* |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
2 * libtta.c |
290 | 3 * |
4 * Description: TTA input plug-in for Audacious | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
5 * Developed by: Alexander Djourik <ald@true-audio.com> |
290 | 6 * Audacious port: Yoshiki Yazawa <yaz@cc.rim.or.jp> |
7 * | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
8 * Copyright (c) 2007 Alexander Djourik. All rights reserved. |
290 | 9 * |
10 */ | |
11 | |
12 /* | |
13 * This library is free software; you can redistribute it and/or | |
14 * modify it under the terms of the GNU Lesser General Public | |
15 * License as published by the Free Software Foundation; either | |
16 * version 2.1 of the License, or (at your option) any later version. | |
17 * | |
18 * This library is distributed in the hope that it will be useful, | |
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 * Lesser General Public License for more details. | |
22 * | |
23 * You should have received a copy of the GNU Lesser General Public | |
24 * License along with this library; if not, write to the Free Software | |
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
26 * | |
27 * Please see the file COPYING in this directory for full copyright | |
28 * information. | |
29 */ | |
528 | 30 |
31 #ifdef HAVE_CONFIG_H | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
32 #include "config.h" |
528 | 33 #endif |
34 | |
290 | 35 #include <stdio.h> |
36 #include <stdlib.h> | |
37 #include <string.h> | |
38 #include <time.h> | |
39 #include <sys/types.h> | |
40 #include <sys/stat.h> | |
41 #include <glib.h> | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
42 #include <pthread.h> |
290 | 43 #include <string.h> |
44 | |
45 #include <audacious/util.h> | |
46 #include <audacious/plugin.h> | |
47 #include <audacious/titlestring.h> | |
48 #include <audacious/vfs.h> | |
520
8f1785471613
[svn] - add missing inclusion of audacious/strings.h where necessary
giacomo
parents:
443
diff
changeset
|
49 #include <audacious/output.h> |
8f1785471613
[svn] - add missing inclusion of audacious/strings.h where necessary
giacomo
parents:
443
diff
changeset
|
50 #include <audacious/strings.h> |
527
d124034ebea3
[svn] - glib/gi18n.h -> audacious/i18n.h for automatic dgettext support
nenolod
parents:
520
diff
changeset
|
51 #include <audacious/i18n.h> |
290 | 52 |
661 | 53 #include <audacious/id3tag.h> |
290 | 54 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
55 #define PLUGIN_VERSION "1.4" |
290 | 56 #define PROJECT_URL "<http://www.true-audio.com>" |
57 | |
58 #include "ttalib.h" | |
59 | |
60 #define OUTPUT_ERROR (MEMORY_ERROR+1) | |
61 #define MAX_BSIZE (MAX_BPS>>3) | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
62 #define BYTES(x) ((x) * sizeof(id3_ucs4_t)) |
290 | 63 |
64 static void init (); | |
65 static void cleanup (); | |
66 static int is_our_file (char *filename); | |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
67 static void play_file (InputPlayback *playback); |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
68 static void tta_pause (InputPlayback *playback, short paused); |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
69 static void stop (InputPlayback *playback); |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
70 static void seek (InputPlayback *playback, int time); |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
71 static int get_time (InputPlayback *playback); |
290 | 72 static void get_song_info (char *filename, char **title, int *length); |
73 static void file_info (char *filename); | |
74 static void about (); | |
75 static TitleInput *get_song_tuple(char *filename); | |
76 static gchar *extname(const char *filename); | |
851 | 77 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
78 static pthread_t decode_thread; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
79 static char sample_buffer[PCM_BUFFER_LENGTH * MAX_BSIZE * MAX_NCH]; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
80 static tta_info info; // currently playing file info |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
81 static int seek_position = -1; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
82 static int playing = FALSE; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
83 static int read_samples = -1; |
290 | 84 |
372
a157306caf03
[svn] - finalize the plugin-side of the extension-assist ABI
nenolod
parents:
368
diff
changeset
|
85 gchar *tta_fmts[] = { "tta", NULL }; |
a157306caf03
[svn] - finalize the plugin-side of the extension-assist ABI
nenolod
parents:
368
diff
changeset
|
86 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
87 InputPlugin tta_ip = |
290 | 88 { |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
89 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
90 NULL, |
1087 | 91 "True Audio Plugin", |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
92 init, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
93 about, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
94 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
95 is_our_file, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
96 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
97 play_file, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
98 stop, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
99 tta_pause, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
100 seek, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
101 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
102 get_time, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
103 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
104 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
105 cleanup, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
106 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
107 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
108 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
109 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
110 get_song_info, |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
111 file_info, |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
112 NULL, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
113 get_song_tuple, // get_song_tuple |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
114 NULL, // set_song_tuple |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
115 NULL, // buffer |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
116 NULL, // vfs |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
117 tta_fmts, |
290 | 118 }; |
119 | |
1087 | 120 InputPlugin *tta_iplist[] = { &tta_ip, NULL }; |
121 | |
122 DECLARE_PLUGIN(tta, NULL, NULL, tta_iplist, NULL, NULL, NULL, NULL); | |
290 | 123 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
124 size_t |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
125 file_size (char *filename) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
126 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
127 VFSFile *f; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
128 size_t size = -1; |
290 | 129 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
130 if ((f = vfs_fopen (filename, "r"))) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
131 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
132 vfs_fseek (f, 0, SEEK_END); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
133 size = vfs_ftell (f); |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
134 vfs_fclose (f); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
135 } |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
136 return size; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
137 } |
851 | 138 |
290 | 139 static void |
140 tta_error (int error) | |
141 { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
142 char *message; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
143 static GtkWidget *errorbox; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
144 if (errorbox != NULL) return; |
290 | 145 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
146 switch (error) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
147 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
148 case OPEN_ERROR: |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
149 message = _("Can't open file\n"); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
150 break; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
151 case FORMAT_ERROR: |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
152 message = _("Not supported file format\n"); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
153 break; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
154 case FILE_ERROR: |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
155 message = _("File is corrupted\n"); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
156 break; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
157 case READ_ERROR: |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
158 message = _("Can't read from file\n"); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
159 break; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
160 case MEMORY_ERROR: |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
161 message = _("Insufficient memory available\n"); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
162 break; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
163 case OUTPUT_ERROR: |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
164 message = _("Output plugin error\n"); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
165 break; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
166 default: |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
167 message = _("Unknown error\n"); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
168 break; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
169 } |
290 | 170 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
171 xmms_show_message (_("TTA Decoder Error"), message, |
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
172 _("Ok"), FALSE, NULL, NULL); |
290 | 173 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
174 gtk_signal_connect(GTK_OBJECT(errorbox), "destroy", |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
175 G_CALLBACK(gtk_widget_destroyed), &errorbox); |
290 | 176 } |
177 | |
178 static gchar * | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
179 get_song_title(TitleInput *tuple) |
290 | 180 { |
1166 | 181 return xmms_get_titlestring(xmms_get_gentitle_format(), tuple); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
182 } |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
183 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
184 static void |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
185 get_song_info (char *filename, char **title, int *length) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
186 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
187 TitleInput *tuple; |
290 | 188 |
1165 | 189 *length = -1; |
190 *title = NULL; | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
191 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
192 if ((tuple = get_song_tuple(filename)) != NULL) { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
193 *length = tuple->length; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
194 *title = get_song_title(tuple); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
195 } |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
196 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
197 bmp_title_input_free(tuple); |
290 | 198 } |
199 | |
200 static void * | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
201 play_loop (void *arg) |
290 | 202 { |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
203 InputPlayback *playback = arg; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
204 int bufsize = PCM_BUFFER_LENGTH * info.BSIZE * info.NCH; |
290 | 205 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
206 //////////////////////////////////////// |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
207 // decode PCM_BUFFER_LENGTH samples |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
208 // into the current PCM buffer position |
290 | 209 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
210 while (playing) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
211 { |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
212 while ((read_samples = get_samples ((unsigned char *)sample_buffer)) > 0) |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
213 { |
851 | 214 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
215 while ((playback->output->buffer_free () < bufsize) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
216 && seek_position == -1) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
217 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
218 if (!playing) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
219 goto DONE; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
220 xmms_usleep (10000); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
221 } |
852
421d5587b761
[svn] - remove unnecessary sleep code so that out_lame can encode at full speed.
yaz
parents:
851
diff
changeset
|
222 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
223 if (seek_position == -1) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
224 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
225 produce_audio(playback->output->written_time(), |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
226 ((info.BPS == 8) ? FMT_U8 : FMT_S16_LE), |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
227 info.NCH, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
228 read_samples * info.NCH * info.BSIZE, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
229 sample_buffer, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
230 NULL); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
231 } |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
232 else |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
233 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
234 set_position (seek_position); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
235 playback->output->flush (seek_position * SEEK_STEP); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
236 seek_position = -1; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
237 } |
1270
d73eed18f3f4
make tta decode easy to be interrupted.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1237
diff
changeset
|
238 if(!playing) |
d73eed18f3f4
make tta decode easy to be interrupted.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1237
diff
changeset
|
239 goto DONE; |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
240 } |
851 | 241 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
242 playback->output->buffer_free (); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
243 playback->output->buffer_free (); |
1270
d73eed18f3f4
make tta decode easy to be interrupted.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1237
diff
changeset
|
244 while (playback->output->buffer_playing()) { |
d73eed18f3f4
make tta decode easy to be interrupted.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1237
diff
changeset
|
245 xmms_usleep(10000); |
d73eed18f3f4
make tta decode easy to be interrupted.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1237
diff
changeset
|
246 if(!playing) |
d73eed18f3f4
make tta decode easy to be interrupted.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1237
diff
changeset
|
247 goto DONE; |
d73eed18f3f4
make tta decode easy to be interrupted.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1237
diff
changeset
|
248 } |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
249 } |
290 | 250 |
851 | 251 DONE: |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
252 //////////////////////// |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
253 // destroy memory pools |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
254 player_stop (); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
255 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
256 /////////////////////////////// |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
257 // close currently playing file |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
258 close_tta_file (&info); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
259 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
260 pthread_exit (NULL); |
290 | 261 } |
262 | |
263 static void | |
264 init () | |
265 { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
266 memset (&info, 0, sizeof (tta_info)); |
290 | 267 } |
268 | |
269 static void | |
270 cleanup () | |
271 { | |
272 } | |
273 | |
274 static void | |
275 about () | |
276 { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
277 static GtkWidget *aboutbox; |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
278 gchar *about_text; |
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
279 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
280 if (aboutbox != NULL) return; |
290 | 281 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
282 about_text = g_strjoin("", _("TTA input plugin "), PLUGIN_VERSION, |
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
283 _(" for BMP\n" |
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
284 "Copyright (c) 2004 True Audio Software\n"), PROJECT_URL, NULL); |
290 | 285 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
286 aboutbox = xmms_show_message(_("About True Audio Plugin"), |
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
287 about_text, |
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
288 _("Ok"), FALSE, NULL, NULL); |
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
289 |
1325
a33da9237bed
Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents:
1321
diff
changeset
|
290 gtk_signal_connect(GTK_OBJECT(aboutbox), "destroy", |
a33da9237bed
Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents:
1321
diff
changeset
|
291 G_CALLBACK(gtk_widget_destroyed), &aboutbox); |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
292 g_free(about_text); |
290 | 293 } |
294 | |
295 static GtkWidget *window = NULL; | |
296 static GtkWidget *filename_entry, *title_entry, | |
297 *artist_entry, *album_entry, | |
298 *year_entry, *tracknum_entry, | |
299 *comment_entry, *genre_entry, | |
300 *info_frame; | |
301 | |
302 static void | |
303 file_info (char *filename) | |
304 { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
305 tta_info ttainfo; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
306 char *title; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
307 gchar *utf_filename = NULL; |
1296
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
308 gchar *realfn = NULL; |
290 | 309 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
310 if (!window) { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
311 GtkWidget *vbox, *hbox, *left_vbox, *table; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
312 GtkWidget *label, *filename_hbox, *button_ok; |
290 | 313 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
314 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
315 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
316 gtk_signal_connect(GTK_OBJECT(window), "destroy", |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
317 G_CALLBACK(gtk_widget_destroyed), &window); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
318 gtk_container_set_border_width(GTK_CONTAINER(window), 10); |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
319 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
320 vbox = gtk_vbox_new(FALSE, 10); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
321 gtk_container_add(GTK_CONTAINER(window), vbox); |
290 | 322 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
323 filename_hbox = gtk_hbox_new(FALSE, 5); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
324 gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0); |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
325 label = gtk_label_new(_("Filename:")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
326 gtk_box_pack_start(GTK_BOX(filename_hbox), label, FALSE, TRUE, 0); |
290 | 327 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
328 filename_entry = gtk_entry_new_with_max_length(1024); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
329 gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
330 gtk_box_pack_start(GTK_BOX(filename_hbox), filename_entry, TRUE, TRUE, 0); |
290 | 331 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
332 hbox = gtk_hbox_new(FALSE, 10); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
333 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
334 left_vbox = gtk_vbox_new(FALSE, 10); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
335 gtk_box_pack_start(GTK_BOX(hbox), left_vbox, FALSE, FALSE, 0); |
290 | 336 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
337 info_frame = gtk_frame_new(_("ID3 Tag:")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
338 gtk_box_pack_start(GTK_BOX(left_vbox), info_frame, FALSE, FALSE, 0); |
290 | 339 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
340 table = gtk_table_new(5, 5, FALSE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
341 gtk_container_set_border_width(GTK_CONTAINER(table), 5); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
342 gtk_container_add(GTK_CONTAINER(info_frame), table); |
290 | 343 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
344 label = gtk_label_new(_("Title:")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
345 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
346 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 5, 5); |
290 | 347 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
348 title_entry = gtk_entry_new_with_max_length(1024); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
349 gtk_editable_set_editable(GTK_EDITABLE(title_entry), FALSE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
350 gtk_table_attach(GTK_TABLE(table), title_entry, 1, 4, 0, 1, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
351 GTK_FILL | GTK_EXPAND | GTK_SHRINK, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
352 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); |
290 | 353 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
354 label = gtk_label_new(_("Artist:")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
355 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
356 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
357 GTK_FILL, GTK_FILL, 5, 5); |
290 | 358 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
359 artist_entry = gtk_entry_new_with_max_length(1024); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
360 gtk_editable_set_editable(GTK_EDITABLE(artist_entry), FALSE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
361 gtk_table_attach(GTK_TABLE(table), artist_entry, 1, 4, 1, 2, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
362 GTK_FILL | GTK_EXPAND | GTK_SHRINK, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
363 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); |
290 | 364 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
365 label = gtk_label_new(_("Album:")); |
290 | 366 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
367 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
368 GTK_FILL, GTK_FILL, 5, 5); |
290 | 369 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
370 album_entry = gtk_entry_new_with_max_length(1024); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
371 gtk_editable_set_editable(GTK_EDITABLE(album_entry), FALSE); |
290 | 372 gtk_table_attach(GTK_TABLE(table), album_entry, 1, 4, 2, 3, |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
373 GTK_FILL | GTK_EXPAND | GTK_SHRINK, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
374 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); |
290 | 375 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
376 label = gtk_label_new(_("Comment:")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
377 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
378 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
379 GTK_FILL, GTK_FILL, 5, 5); |
290 | 380 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
381 comment_entry = gtk_entry_new_with_max_length(1024); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
382 gtk_editable_set_editable(GTK_EDITABLE(comment_entry), FALSE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
383 gtk_table_attach(GTK_TABLE(table), comment_entry, 1, 4, 3, 4, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
384 GTK_FILL | GTK_EXPAND | GTK_SHRINK, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
385 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); |
290 | 386 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
387 label = gtk_label_new(_("Year:")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
388 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
389 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
390 GTK_FILL, GTK_FILL, 5, 5); |
290 | 391 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
392 year_entry = gtk_entry_new_with_max_length(4); |
290 | 393 gtk_editable_set_editable(GTK_EDITABLE(year_entry), FALSE); |
394 gtk_widget_set_usize(year_entry, 40, -1); | |
395 gtk_table_attach(GTK_TABLE(table), year_entry, 1, 2, 4, 5, | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
396 GTK_FILL | GTK_EXPAND | GTK_SHRINK, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
397 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); |
290 | 398 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
399 label = gtk_label_new(_("Track number:")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
400 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
401 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 4, 5, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
402 GTK_FILL, GTK_FILL, 5, 5); |
290 | 403 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
404 tracknum_entry = gtk_entry_new_with_max_length(3); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
405 gtk_editable_set_editable(GTK_EDITABLE(tracknum_entry), FALSE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
406 gtk_widget_set_usize(tracknum_entry, 40, -1); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
407 gtk_table_attach(GTK_TABLE(table), tracknum_entry, 3, 4, 4, 5, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
408 GTK_FILL | GTK_EXPAND | GTK_SHRINK, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
409 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); |
290 | 410 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
411 label = gtk_label_new(_("Genre:")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
412 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
413 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
414 GTK_FILL, GTK_FILL, 5, 5); |
290 | 415 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
416 genre_entry = gtk_entry_new_with_max_length(1024); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
417 gtk_editable_set_editable(GTK_EDITABLE(genre_entry), FALSE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
418 gtk_widget_set_usize(genre_entry, 40, -1); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
419 gtk_table_attach(GTK_TABLE(table), genre_entry, 1, 4, 5, 6, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
420 GTK_FILL | GTK_EXPAND | GTK_SHRINK, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
421 GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); |
290 | 422 |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
423 button_ok = gtk_button_new_with_label(_("Ok")); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
424 gtk_signal_connect_object(GTK_OBJECT(button_ok), "clicked", |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
425 G_CALLBACK(gtk_widget_destroy), G_OBJECT(window)); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
426 GTK_WIDGET_SET_FLAGS(button_ok, GTK_CAN_DEFAULT); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
427 gtk_box_pack_start(GTK_BOX(vbox), button_ok, TRUE, TRUE, 0); |
290 | 428 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
429 gtk_widget_show_all (window); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
430 } |
1296
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
431 realfn = g_filename_from_uri(filename, NULL, NULL); |
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
432 utf_filename = str_to_utf8(realfn ? realfn : filename); |
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
433 g_free(realfn); realfn = NULL; |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
434 title = g_strdup_printf(_("File Info - %s"), g_basename(utf_filename)); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
435 gtk_window_set_title(GTK_WINDOW(window), title); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
436 g_free(title); |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
437 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
438 gtk_entry_set_text(GTK_ENTRY(filename_entry), utf_filename); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
439 gtk_editable_set_position(GTK_EDITABLE(filename_entry), -1); |
290 | 440 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
441 title = g_strdup(g_basename(utf_filename)); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
442 gtk_entry_set_text(GTK_ENTRY(title_entry), title); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
443 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
444 g_free(title); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
445 g_free(utf_filename); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
446 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
447 if (open_tta_file (filename, &ttainfo, 0) >= 0) |
290 | 448 { |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
449 gtk_entry_set_text(GTK_ENTRY(title_entry), (gchar *)ttainfo.ID3.title); |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
450 gtk_entry_set_text(GTK_ENTRY(artist_entry), (gchar *)ttainfo.ID3.artist); |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
451 gtk_entry_set_text(GTK_ENTRY(album_entry), (gchar *)ttainfo.ID3.album); |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
452 gtk_entry_set_text(GTK_ENTRY(year_entry), (gchar *)ttainfo.ID3.year); |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
453 gtk_entry_set_text(GTK_ENTRY(tracknum_entry), (gchar *)ttainfo.ID3.track); |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
454 gtk_entry_set_text(GTK_ENTRY(comment_entry), (gchar *)ttainfo.ID3.comment); |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
455 gtk_entry_set_text(GTK_ENTRY(genre_entry), (gchar *)ttainfo.ID3.genre); |
290 | 456 } |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
457 close_tta_file (&ttainfo); |
290 | 458 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
459 gtk_widget_set_sensitive(info_frame, TRUE); |
290 | 460 } |
461 | |
462 static int | |
463 is_our_file (char *filename) | |
464 { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
465 gchar *ext = strrchr(filename, '.'); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
466 |
1152
949457464b28
[svn] - fix for crash when file extension is not available.
yaz
parents:
1087
diff
changeset
|
467 if (ext && !strncasecmp(ext, ".tta", 4)) |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
468 return TRUE; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
469 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
470 return FALSE; |
290 | 471 } |
472 | |
473 static void | |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
474 play_file (InputPlayback *playback) |
290 | 475 { |
1237
0d5b0f861bf0
- quick fix for link breakage to libaudid3tag.so when --prefix is specified.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1190
diff
changeset
|
476 gchar *filename = playback->filename; |
1296
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
477 char *title = NULL; |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
478 int datasize, origsize, bitrate; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
479 TitleInput *tuple = NULL; |
290 | 480 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
481 playing = FALSE; |
290 | 482 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
483 //////////////////////////////////////// |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
484 // open TTA file |
1237
0d5b0f861bf0
- quick fix for link breakage to libaudid3tag.so when --prefix is specified.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1190
diff
changeset
|
485 if (open_tta_file (filename, &info, 0) > 0) |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
486 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
487 tta_error (info.STATE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
488 close_tta_file (&info); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
489 return; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
490 } |
290 | 491 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
492 //////////////////////////////////////// |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
493 // initialize TTA player |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
494 if (player_init (&info) < 0) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
495 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
496 tta_error (info.STATE); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
497 close_tta_file (&info); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
498 return; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
499 } |
290 | 500 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
501 if (playback->output->open_audio ((info.BPS == 8) ? FMT_U8 : FMT_S16_LE, |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
502 info.SAMPLERATE, info.NCH) == 0) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
503 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
504 tta_error (OUTPUT_ERROR); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
505 close_tta_file (&info); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
506 return; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
507 } |
290 | 508 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
509 tuple = get_song_tuple(filename); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
510 title = get_song_title(tuple); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
511 bmp_title_input_free(tuple); |
290 | 512 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
513 datasize = file_size(filename) - info.DATAPOS; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
514 origsize = info.DATALENGTH * info.BSIZE * info.NCH; |
290 | 515 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
516 bitrate = (int) ((float) datasize / origsize * |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
517 (info.SAMPLERATE * info.NCH * info.BPS)); |
290 | 518 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
519 tta_ip.set_info (title, 1000 * info.LENGTH, bitrate, info.SAMPLERATE, info.NCH); |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
520 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
521 if (title) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
522 g_free (title); |
290 | 523 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
524 playing = TRUE; |
1165 | 525 playback->playing = 1; |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
526 seek_position = -1; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
527 read_samples = -1; |
290 | 528 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
529 pthread_create (&decode_thread, NULL, play_loop, playback); |
290 | 530 } |
531 | |
532 static void | |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
533 tta_pause (InputPlayback *playback, short paused) |
290 | 534 { |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
535 playback->output->pause (paused); |
290 | 536 } |
851 | 537 |
290 | 538 static void |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
539 stop (InputPlayback *playback) |
290 | 540 { |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
541 if (playing) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
542 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
543 playing = FALSE; |
1165 | 544 playback->playing = 0; |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
545 pthread_join (decode_thread, NULL); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
546 playback->output->close_audio (); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
547 close_tta_file (&info); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
548 read_samples = 0; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
549 } |
290 | 550 } |
551 | |
552 static void | |
568 | 553 seek (InputPlayback *data, int time) |
290 | 554 { |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
555 if (playing) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
556 { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
557 seek_position = 1000 * time / SEEK_STEP; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
558 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
559 while (seek_position != -1) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
560 xmms_usleep (10000); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
561 } |
290 | 562 } |
563 | |
564 static int | |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
565 get_time (InputPlayback *playback) |
290 | 566 { |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
567 if (playing && (read_samples || playback->output->buffer_playing())) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
568 return playback->output->output_time(); |
290 | 569 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
570 return -1; |
290 | 571 } |
572 | |
573 static TitleInput * | |
574 get_song_tuple(char *filename) | |
575 { | |
576 TitleInput *tuple = NULL; | |
577 tta_info *ttainfo; | |
578 VFSFile *file; | |
1296
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
579 gchar *realfn = NULL; |
290 | 580 |
581 ttainfo = g_malloc0(sizeof(tta_info)); | |
582 | |
583 if((file = vfs_fopen(filename, "rb")) != NULL) { | |
584 if(open_tta_file(filename, ttainfo, 0) >= 0) { | |
585 tuple = bmp_title_input_new(); | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
586 |
1296
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
587 realfn = g_filename_from_uri(filename, NULL, NULL); |
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
588 tuple->file_name = g_path_get_basename(realfn ? realfn : filename); |
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
589 tuple->file_path = g_path_get_dirname(realfn ? realfn : filename); |
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
590 tuple->file_ext = extname(realfn ? realfn : filename); |
290 | 591 tuple->length = ttainfo->LENGTH * 1000; |
1296
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
592 g_free(realfn); realfn = NULL; |
290 | 593 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
594 if (ttainfo->ID3.id3has) { |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
595 if(ttainfo->ID3.artist && strlen((char *)ttainfo->ID3.artist)) |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
596 tuple->performer = g_strdup((gchar *)ttainfo->ID3.artist); |
1166 | 597 |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
598 if(ttainfo->ID3.album && strlen((char *)ttainfo->ID3.album)) |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
599 tuple->album_name = g_strdup((gchar *)ttainfo->ID3.album); |
1166 | 600 |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
601 if(ttainfo->ID3.title && strlen((char *)ttainfo->ID3.title)) |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
602 tuple->track_name = g_strdup((gchar *)ttainfo->ID3.title); |
1166 | 603 |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
604 if(ttainfo->ID3.year && strlen((char *)ttainfo->ID3.year)) |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
605 tuple->year = atoi((char *)ttainfo->ID3.year); |
1166 | 606 |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
607 if(ttainfo->ID3.track && strlen((char *)ttainfo->ID3.track)) |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
608 tuple->track_number = atoi((char *)ttainfo->ID3.track); |
1166 | 609 |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
610 if(ttainfo->ID3.genre && strlen((char *)ttainfo->ID3.genre)) |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
611 tuple->genre = g_strdup((gchar *)ttainfo->ID3.genre); |
1166 | 612 |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
613 if(ttainfo->ID3.comment && strlen((char *)ttainfo->ID3.comment)) |
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
614 tuple->comment = g_strdup((gchar *)ttainfo->ID3.comment); |
290 | 615 } |
616 close_tta_file (ttainfo); | |
617 } | |
618 vfs_fclose(file); | |
619 } | |
620 return tuple; | |
621 } | |
622 | |
623 static gchar * | |
624 extname(const char *filename) | |
625 { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
626 gchar *ext = strrchr(filename, '.'); |
290 | 627 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
628 if (ext != NULL) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
629 ++ext; |
290 | 630 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
631 return ext; |
290 | 632 } |
633 | |
634 /* return length in letters */ | |
635 size_t tta_ucs4len(id3_ucs4_t *ucs) | |
636 { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
637 id3_ucs4_t *ptr = ucs; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
638 size_t len = 0; |
290 | 639 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
640 while(*ptr++ != 0) |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
641 len++; |
290 | 642 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
643 return len; |
290 | 644 } |
645 | |
646 /* duplicate id3_ucs4_t string. new string will be terminated with 0. */ | |
647 id3_ucs4_t *tta_ucs4dup(id3_ucs4_t *org) | |
648 { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
649 id3_ucs4_t *new = NULL; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
650 size_t len = tta_ucs4len(org); |
290 | 651 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
652 new = g_malloc0((len + 1) * sizeof(id3_ucs4_t)); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
653 memcpy(new, org, len * sizeof(id3_ucs4_t)); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
654 *(new + len) = 0; //terminate |
290 | 655 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
656 return new; |
290 | 657 } |
658 | |
659 id3_ucs4_t *tta_parse_genre(const id3_ucs4_t *string) | |
660 { | |
661 id3_ucs4_t *ret = NULL; | |
662 id3_ucs4_t *tmp = NULL; | |
663 id3_ucs4_t *genre = NULL; | |
664 id3_ucs4_t *ptr, *end, *tail, *tp; | |
665 size_t ret_len = 0; //num of ucs4 char! | |
666 size_t tmp_len = 0; | |
667 gboolean is_num = TRUE; | |
668 | |
669 tail = (id3_ucs4_t *)string + tta_ucs4len((id3_ucs4_t *)string); | |
670 | |
671 ret = g_malloc0(1024); | |
672 | |
673 for(ptr = (id3_ucs4_t *)string; *ptr != 0 && ptr <= tail; ptr++) { | |
674 if(*ptr == '(') { | |
675 if(*(++ptr) == '(') { // escaped text like: ((something) | |
676 for(end = ptr; *end != ')' && *end != 0;) { // copy "(something)" | |
677 end++; | |
678 } | |
679 end++; //include trailing ')' | |
680 memcpy(ret, ptr, BYTES(end - ptr)); | |
681 ret_len += (end - ptr); | |
682 *(ret + ret_len) = 0; //terminate | |
683 ptr = end + 1; | |
684 } | |
685 else { | |
686 // reference to an id3v1 genre code | |
687 for(end = ptr; *end != ')' && *end != 0;) { | |
688 end++; | |
689 } | |
690 | |
691 tmp = g_malloc0(BYTES(end - ptr + 1)); | |
692 memcpy(tmp, ptr, BYTES(end - ptr)); | |
693 *(tmp + (end - ptr)) = 0; //terminate | |
694 ptr += end - ptr; | |
695 | |
696 genre = (id3_ucs4_t *)id3_genre_name((const id3_ucs4_t *)tmp); | |
697 | |
698 g_free(tmp); | |
699 tmp = NULL; | |
700 | |
701 tmp_len = tta_ucs4len(genre); | |
702 | |
703 memcpy(ret + BYTES(ret_len), genre, BYTES(tmp_len)); | |
704 | |
705 ret_len += tmp_len; | |
706 *(ret + ret_len) = 0; //terminate | |
707 } | |
708 } | |
709 else { | |
710 for(end = ptr; *end != '(' && *end != 0; ) { | |
711 end++; | |
712 } | |
713 // scan string to determine whether a genre code number or not | |
714 tp = ptr; | |
715 is_num = TRUE; | |
716 while(tp < end) { | |
717 if(*tp < '0' || *tp > '9') { // anything else than number appears. | |
718 is_num = FALSE; | |
719 break; | |
720 } | |
721 tp++; | |
722 } | |
723 if(is_num) { | |
724 #ifdef DEBUG | |
725 printf("is_num!\n"); | |
726 #endif | |
727 tmp = g_malloc0(BYTES(end - ptr + 1)); | |
728 memcpy(tmp, ptr, BYTES(end - ptr)); | |
729 *(tmp + (end - ptr)) = 0; //terminate | |
730 ptr += end - ptr; | |
731 | |
732 genre = (id3_ucs4_t *)id3_genre_name((const id3_ucs4_t *)tmp); | |
733 #ifdef DEBUG | |
734 printf("genre length = %d\n", tta_ucs4len(genre)); | |
735 #endif | |
736 g_free(tmp); | |
737 tmp = NULL; | |
738 | |
739 tmp_len = tta_ucs4len(genre); | |
740 | |
741 memcpy(ret + BYTES(ret_len), genre, BYTES(tmp_len)); | |
742 | |
743 ret_len += tmp_len; | |
744 *(ret + ret_len) = 0; //terminate | |
745 } | |
746 else { // plain text | |
747 #ifdef DEBUG | |
748 printf("plain!\n"); | |
749 printf("ret_len = %d\n", ret_len); | |
750 #endif | |
751 memcpy(ret + BYTES(ret_len), ptr, BYTES(end - ptr)); | |
752 ret_len = ret_len + (end - ptr); | |
753 *(ret + ret_len) = 0; //terminate | |
754 ptr += (end - ptr); | |
755 } | |
756 } | |
757 } | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
758 |
290 | 759 return ret; |
760 } | |
761 | |
762 gchar *tta_input_id3_get_string(struct id3_tag * tag, char *frame_name) | |
763 { | |
764 gchar *rtn; | |
765 gchar *rtn2; | |
766 const id3_ucs4_t *string_const; | |
767 id3_ucs4_t *string; | |
768 id3_ucs4_t *ucsptr; | |
769 struct id3_frame *frame; | |
770 union id3_field *field; | |
771 gboolean flagutf = FALSE; | |
772 | |
773 frame = id3_tag_findframe(tag, frame_name, 0); | |
774 if (!frame) | |
775 return NULL; | |
776 | |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
777 if (!strcmp(frame_name, ID3_FRAME_COMMENT)) |
290 | 778 field = id3_frame_field(frame, 3); |
779 else | |
780 field = id3_frame_field(frame, 1); | |
781 | |
782 if (!field) | |
783 return NULL; | |
784 | |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
785 if (!strcmp(frame_name, ID3_FRAME_COMMENT)) |
290 | 786 string_const = id3_field_getfullstring(field); |
787 else | |
788 string_const = id3_field_getstrings(field, 0); | |
789 | |
790 if (!string_const) | |
791 return NULL; | |
792 | |
793 string = tta_ucs4dup((id3_ucs4_t *)string_const); | |
794 | |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
795 if (!strcmp(frame_name, ID3_FRAME_GENRE)) { |
290 | 796 id3_ucs4_t *string2 = NULL; |
797 string2 = tta_parse_genre(string); | |
798 g_free((void *)string); | |
799 string = string2; | |
800 } | |
801 | |
802 ucsptr = (id3_ucs4_t *)string; | |
803 while (*ucsptr) { | |
804 if (*ucsptr > 0x000000ffL) { | |
805 flagutf = TRUE; | |
806 break; | |
807 } | |
808 ucsptr++; | |
809 } | |
810 | |
811 if (flagutf) { | |
812 #ifdef DEBUG | |
813 g_message("aud-tta: flagutf!\n"); | |
814 #endif | |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
815 rtn = (gchar *)id3_ucs4_utf8duplicate(string); |
290 | 816 } |
817 else { | |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
818 rtn = (gchar *)id3_ucs4_latin1duplicate(string); |
290 | 819 rtn2 = str_to_utf8(rtn); |
820 free(rtn); | |
821 rtn = rtn2; | |
822 } | |
823 g_free(string); | |
824 string = NULL; | |
825 #ifdef DEBUG | |
826 g_print("string = %s\n", rtn); | |
1321
f0b81aeed25f
Thank you for your help, Giacomo. ;-)
Stany HENRY <StrassBoy@gmail.com>
parents:
1296
diff
changeset
|
827 #endif |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
828 |
290 | 829 return rtn; |
830 } | |
831 | |
832 int get_id3_tags (const char *filename, tta_info *ttainfo) { | |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
833 int id3v2_size = 0; |
290 | 834 gchar *str = NULL; |
1296
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
835 gchar *realfn = NULL; |
290 | 836 |
837 struct id3_file *id3file = NULL; | |
838 struct id3_tag *tag = NULL; | |
839 | |
1296
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
840 realfn = g_filename_from_uri(filename, NULL, NULL); |
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
841 id3file = id3_file_open (realfn ? realfn : filename, ID3_FILE_MODE_READONLY); |
2a6865d42dc4
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1270
diff
changeset
|
842 g_free(realfn); realfn = NULL; |
290 | 843 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
844 if (id3file) { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
845 tag = id3_file_tag (id3file); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
846 |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
847 if (tag) { |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
848 ttainfo->ID3.id3has = 1; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
849 id3v2_size = tag->paddedsize; |
290 | 850 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
851 str = tta_input_id3_get_string (tag, ID3_FRAME_ARTIST); |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
852 if(str) strncpy((char *)ttainfo->ID3.artist, str, MAX_LINE); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
853 free(str); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
854 str = NULL; |
290 | 855 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
856 str = tta_input_id3_get_string (tag, ID3_FRAME_ALBUM); |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
857 if(str) strncpy((char *)ttainfo->ID3.album, str, MAX_LINE); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
858 free(str); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
859 str = NULL; |
290 | 860 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
861 str = tta_input_id3_get_string (tag, ID3_FRAME_TITLE); |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
862 if(str) strncpy((char *)ttainfo->ID3.title, str, MAX_LINE); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
863 free(str); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
864 str = NULL; |
290 | 865 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
866 str = tta_input_id3_get_string (tag, ID3_FRAME_YEAR); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
867 if(!str) str = tta_input_id3_get_string (tag, "TYER"); |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
868 if(str) strncpy((char *)ttainfo->ID3.year, str, MAX_YEAR); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
869 free(str); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
870 str = NULL; |
290 | 871 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
872 str = tta_input_id3_get_string (tag, ID3_FRAME_TRACK); |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
873 if(str) strncpy((char *)ttainfo->ID3.track, str, MAX_TRACK); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
874 free(str); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
875 str = NULL; |
290 | 876 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
877 str = tta_input_id3_get_string (tag, ID3_FRAME_GENRE); |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
878 if(str) strncpy((char *)ttainfo->ID3.genre, str, MAX_GENRE); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
879 free(str); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
880 str = NULL; |
290 | 881 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
882 str = tta_input_id3_get_string (tag, ID3_FRAME_COMMENT); |
1190
ed2d7787779e
more warning elimination.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1166
diff
changeset
|
883 if(str) strncpy((char *)ttainfo->ID3.comment, str, MAX_LINE); |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
884 free(str); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
885 str = NULL; |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
886 } |
290 | 887 |
1012
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
888 id3_file_close(id3file); |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
889 } |
d0d99b22e393
[svn] import major update by Aleksander Djuric (the original author).
yaz
parents:
912
diff
changeset
|
890 |
290 | 891 return id3v2_size; // not used |
892 } |