Mercurial > audlegacy-plugins
annotate src/wav/wav-sndfile.c @ 1420:40136e537bd9
wav: update to new tuple API.
author | William Pitcock <nenolod@atheme-project.org> |
---|---|
date | Fri, 10 Aug 2007 06:23:10 -0500 |
parents | 4731d28ea19d |
children | bf7d4c236d9f |
rev | line source |
---|---|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1 /* Audacious - Cross-platform multimedia player |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 * Copyright (C) 2005 Audacious development team. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
3 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
4 * Based on the xmms_sndfile input plugin: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 * Copyright (C) 2000, 2002 Erik de Castro Lopo |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
10 * (at your option) any later version. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
11 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
15 * GNU General Public License for more details. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
16 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
18 * along with this program; if not, write to the Free Software |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
20 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
21 |
665 | 22 /* |
23 * Rewritten 17-Feb-2007 (nenolod): | |
24 * - now uses conditional variables to ensure that sndfile mutex is | |
25 * entirely protected. | |
26 * - pausing works now | |
27 * - fixed some potential race conditions when dealing with NFS. | |
28 * - TITLE_LEN removed | |
29 */ | |
30 | |
528 | 31 #ifdef HAVE_CONFIG_H |
32 # include "config.h" | |
33 #endif | |
34 | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
35 #include <glib.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
36 #include <string.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 #include <math.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
38 #include <stdio.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
39 |
565 | 40 #include <audacious/plugin.h> |
4
0ad4849f6219
[svn] - the first pass missed some libaudacious references, this fixes them
nenolod
parents:
0
diff
changeset
|
41 #include <audacious/util.h> |
0ad4849f6219
[svn] - the first pass missed some libaudacious references, this fixes them
nenolod
parents:
0
diff
changeset
|
42 #include <audacious/titlestring.h> |
527
d124034ebea3
[svn] - glib/gi18n.h -> audacious/i18n.h for automatic dgettext support
nenolod
parents:
12
diff
changeset
|
43 #include <audacious/i18n.h> |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 #include "audacious/output.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
45 #include "wav-sndfile.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
46 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
47 #include <sndfile.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
48 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 static SNDFILE *sndfile = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
50 static SF_INFO sfinfo; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
51 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
52 static int song_length; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
53 static int bit_rate = 0; |
862 | 54 static glong seek_time = -1; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
55 |
665 | 56 static GThread *decode_thread; |
57 static GMutex *decode_mutex; | |
58 static GCond *decode_cond; | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
59 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
60 InputPlugin wav_ip = { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
61 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
62 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
63 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
64 plugin_init, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
65 wav_about, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
67 is_our_file, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
68 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
69 play_start, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
70 play_stop, |
665 | 71 play_pause, |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
72 file_seek, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
73 NULL, |
665 | 74 NULL, |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
75 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
76 NULL, |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
77 plugin_cleanup, |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
78 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
79 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
80 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
81 NULL, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
82 get_song_info, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
83 NULL, |
862 | 84 NULL, |
1412
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
85 get_song_tuple, |
862 | 86 NULL, |
87 NULL, | |
88 NULL, | |
89 NULL, | |
90 file_mseek, | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
91 }; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
92 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
93 int |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
94 get_song_length (char *filename) |
665 | 95 { |
96 SNDFILE *tmp_sndfile; | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
97 SF_INFO tmp_sfinfo; |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
98 gchar *realfn = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
99 |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
100 realfn = g_filename_from_uri(filename, NULL, NULL); |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
101 tmp_sndfile = sf_open (realfn ? realfn : filename, SFM_READ, &tmp_sfinfo); |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
102 g_free(realfn); realfn = NULL; |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
103 |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
104 if (!tmp_sndfile) { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
105 return 0; |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
106 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
107 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
108 sf_close (tmp_sndfile); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
109 tmp_sndfile = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
110 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
111 if (tmp_sfinfo.samplerate <= 0) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
112 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
113 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
114 return (int) ceil (1000.0 * tmp_sfinfo.frames / tmp_sfinfo.samplerate); |
665 | 115 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
116 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 static gchar *get_title(char *filename) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
118 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
119 gchar *title; |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
120 gchar *realfn = NULL; |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
121 |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
122 realfn = g_filename_from_uri(filename, NULL, NULL); |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
123 title = g_path_get_basename(realfn ? realfn : filename); |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
124 g_free(realfn); realfn = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
125 return title; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
126 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
127 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
128 static void |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
129 plugin_init (void) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
130 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
131 seek_time = -1; |
665 | 132 |
133 decode_mutex = g_mutex_new(); | |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
134 decode_cond = g_cond_new(); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
135 } |
665 | 136 |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
137 static void |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
138 plugin_cleanup (void) |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
139 { |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
140 g_cond_free(decode_cond); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
141 g_mutex_free(decode_mutex); |
665 | 142 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
143 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
144 static int |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
145 is_our_file (char *filename) |
664
52b8efa55fcf
[svn] - wav-sndfile engine: correctly compute the bitrate
nenolod
parents:
565
diff
changeset
|
146 { |
52b8efa55fcf
[svn] - wav-sndfile engine: correctly compute the bitrate
nenolod
parents:
565
diff
changeset
|
147 SNDFILE *tmp_sndfile; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
148 SF_INFO tmp_sfinfo; |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
149 gchar *realfn = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
150 |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
151 realfn = g_filename_from_uri(filename, NULL, NULL); |
1263
458d46e65a86
wav-sndfile: in is_our_file, ensure that filename is not NULL before passing it to sf_open
Giacomo Lozito <james@develia.org>
parents:
1242
diff
changeset
|
152 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
153 /* Have to open the file to see if libsndfile can handle it. */ |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
154 tmp_sndfile = sf_open (realfn ? realfn : filename, SFM_READ, &tmp_sfinfo); |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
155 g_free(realfn); realfn = NULL; |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
156 |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
157 if (!tmp_sndfile) { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
158 return FALSE; |
1263
458d46e65a86
wav-sndfile: in is_our_file, ensure that filename is not NULL before passing it to sf_open
Giacomo Lozito <james@develia.org>
parents:
1242
diff
changeset
|
159 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
160 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
161 /* It can so close file and return TRUE. */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
162 sf_close (tmp_sndfile); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
163 tmp_sndfile = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
164 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
165 return TRUE; |
665 | 166 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
167 |
665 | 168 static gpointer |
169 play_loop (gpointer arg) | |
664
52b8efa55fcf
[svn] - wav-sndfile engine: correctly compute the bitrate
nenolod
parents:
565
diff
changeset
|
170 { |
52b8efa55fcf
[svn] - wav-sndfile engine: correctly compute the bitrate
nenolod
parents:
565
diff
changeset
|
171 static short buffer [BUFFER_SIZE]; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
172 int samples; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
173 InputPlayback *playback = arg; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
174 |
666 | 175 for (;;) |
176 { | |
665 | 177 GTimeVal sleeptime; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
178 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
179 /* sf_read_short will return 0 for all reads at EOF. */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
180 samples = sf_read_short (sndfile, buffer, BUFFER_SIZE); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
181 |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
182 if (samples > 0 && playback->playing == TRUE) { |
862 | 183 while ((playback->output->buffer_free () < samples) && |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
184 playback->playing == TRUE) { |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
185 g_get_current_time(&sleeptime); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
186 g_time_val_add(&sleeptime, 500000); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
187 g_mutex_lock(decode_mutex); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
188 g_cond_timed_wait(decode_cond, decode_mutex, &sleeptime); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
189 g_mutex_unlock(decode_mutex); |
665 | 190 |
191 if (playback->playing == FALSE) | |
192 break; | |
193 } | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
194 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
195 produce_audio (playback->output->written_time (), FMT_S16_NE, sfinfo.channels, |
665 | 196 samples * sizeof (short), buffer, &playback->playing); |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
197 } |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
198 else { |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
199 while(playback->output->buffer_playing()) { |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
200 g_get_current_time(&sleeptime); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
201 g_time_val_add(&sleeptime, 500000); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
202 g_mutex_lock(decode_mutex); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
203 g_cond_timed_wait(decode_cond, decode_mutex, &sleeptime); |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
204 g_mutex_unlock(decode_mutex); |
665 | 205 |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
206 if(playback->playing == FALSE) |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
207 break; |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
208 } |
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
209 |
667 | 210 playback->eof = TRUE; |
211 playback->playing = FALSE; | |
665 | 212 |
667 | 213 g_mutex_unlock(decode_mutex); |
214 break; | |
665 | 215 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
216 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
217 /* Do seek if seek_time is valid. */ |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
218 if (seek_time >= 0) { |
862 | 219 sf_seek (sndfile, (sf_count_t)((gint64)seek_time * (gint64)sfinfo.samplerate / 1000L), |
220 SEEK_SET); | |
221 playback->output->flush (seek_time); | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
222 seek_time = -1; |
665 | 223 } |
224 | |
666 | 225 if (playback->playing == FALSE) |
226 break; | |
227 } | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
228 |
665 | 229 sf_close (sndfile); |
230 sndfile = NULL; | |
231 seek_time = -1; | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
232 |
666 | 233 playback->output->close_audio(); |
234 | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
235 return NULL; |
666 | 236 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
237 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
238 static void |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
239 play_start (InputPlayback *playback) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
240 { |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
241 gchar *realfn = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
242 int pcmbitwidth; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
243 gchar *song_title; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
244 |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
245 if (sndfile) /* already opened */ |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
246 return; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
247 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
248 pcmbitwidth = 32; |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
249 song_title = get_title(playback->filename); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
250 |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
251 realfn = g_filename_from_uri(playback->filename, NULL, NULL); |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
252 sndfile = sf_open (realfn ? realfn : playback->filename, SFM_READ, &sfinfo); |
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
253 g_free(realfn); realfn = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
254 |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
255 if (!sndfile) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
256 return; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
257 |
664
52b8efa55fcf
[svn] - wav-sndfile engine: correctly compute the bitrate
nenolod
parents:
565
diff
changeset
|
258 bit_rate = sfinfo.samplerate * pcmbitwidth; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
259 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
260 if (sfinfo.samplerate > 0) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
261 song_length = (int) ceil (1000.0 * sfinfo.frames / sfinfo.samplerate); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
262 else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
263 song_length = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
264 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
265 if (! playback->output->open_audio (FMT_S16_NE, sfinfo.samplerate, sfinfo.channels)) |
665 | 266 { |
267 sf_close (sndfile); | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
268 sndfile = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
269 return; |
665 | 270 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
271 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
272 wav_ip.set_info (song_title, song_length, bit_rate, sfinfo.samplerate, sfinfo.channels); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
273 g_free (song_title); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
274 |
665 | 275 playback->playing = TRUE; |
276 | |
1367
c75fd6894758
wav-sndfile, wav: convert to new threading model
William Pitcock <nenolod@atheme-project.org>
parents:
1283
diff
changeset
|
277 decode_thread = g_thread_self(); |
c75fd6894758
wav-sndfile, wav: convert to new threading model
William Pitcock <nenolod@atheme-project.org>
parents:
1283
diff
changeset
|
278 play_loop(playback); |
665 | 279 } |
280 | |
281 static void | |
282 play_pause (InputPlayback *playback, gshort p) | |
283 { | |
284 playback->output->pause(p); | |
285 } | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
286 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
287 static void |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
528
diff
changeset
|
288 play_stop (InputPlayback *playback) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
289 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
290 if (decode_thread == NULL) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
291 return; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
292 |
665 | 293 g_mutex_lock(decode_mutex); |
294 playback->playing = FALSE; | |
295 g_mutex_unlock(decode_mutex); | |
296 g_cond_signal(decode_cond); | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
297 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
298 g_thread_join (decode_thread); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
299 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
300 sndfile = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
301 decode_thread = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
302 seek_time = -1; |
665 | 303 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
304 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
305 static void |
862 | 306 file_mseek (InputPlayback *playback, gulong millisecond) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
307 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
308 if (! sfinfo.seekable) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
309 return; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
310 |
862 | 311 seek_time = (glong)millisecond; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
312 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
313 while (seek_time != -1) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
314 xmms_usleep (80000); |
665 | 315 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
316 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
317 static void |
862 | 318 file_seek (InputPlayback *playback, int time) |
319 { | |
320 gulong millisecond = time * 1000; | |
321 file_mseek(playback, millisecond); | |
322 } | |
323 | |
324 static void | |
1283
ef8c6b02bdf7
more adaptation for file:// scheme.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1264
diff
changeset
|
325 get_song_info (char *filename, char **title, int *length) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
326 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
327 (*length) = get_song_length(filename); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
328 (*title) = get_title(filename); |
665 | 329 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
330 |
1412
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
331 static TitleInput* |
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
332 get_song_tuple (gchar *filename) |
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
333 { |
1413
4731d28ea19d
Fix tuple report. (null)/filename.wav wasn't so great.
Christian Birchinger <joker@netswarm.net>
parents:
1412
diff
changeset
|
334 gchar *realfn = NULL; |
1412
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
335 TitleInput *tuple = bmp_title_input_new(); |
1413
4731d28ea19d
Fix tuple report. (null)/filename.wav wasn't so great.
Christian Birchinger <joker@netswarm.net>
parents:
1412
diff
changeset
|
336 |
4731d28ea19d
Fix tuple report. (null)/filename.wav wasn't so great.
Christian Birchinger <joker@netswarm.net>
parents:
1412
diff
changeset
|
337 realfn = g_filename_from_uri(filename, NULL, NULL); |
4731d28ea19d
Fix tuple report. (null)/filename.wav wasn't so great.
Christian Birchinger <joker@netswarm.net>
parents:
1412
diff
changeset
|
338 tuple->file_name = g_path_get_basename(realfn ? realfn : filename); |
4731d28ea19d
Fix tuple report. (null)/filename.wav wasn't so great.
Christian Birchinger <joker@netswarm.net>
parents:
1412
diff
changeset
|
339 tuple->file_path = g_path_get_dirname(realfn ? realfn : filename); |
1412
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
340 tuple->length = get_song_length(filename); |
1413
4731d28ea19d
Fix tuple report. (null)/filename.wav wasn't so great.
Christian Birchinger <joker@netswarm.net>
parents:
1412
diff
changeset
|
341 g_free(realfn); realfn = NULL; |
4731d28ea19d
Fix tuple report. (null)/filename.wav wasn't so great.
Christian Birchinger <joker@netswarm.net>
parents:
1412
diff
changeset
|
342 |
1412
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
343 return tuple; |
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
344 } |
6a424e6ff59c
playlist_get_songtime wanted a tuple, but was afraid to ask
Tony Vroon <chainsaw@gentoo.org>
parents:
1395
diff
changeset
|
345 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
346 static void wav_about(void) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
347 { |
921
8b0850943335
[svn] - now wav plugin can handle remaining buffered data at the end of playing.
yaz
parents:
862
diff
changeset
|
348 static GtkWidget *box; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
349 if (!box) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
350 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
351 box = xmms_show_message( |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
352 _("About sndfile WAV support"), |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
353 _("Adapted for Audacious usage by Tony Vroon <chainsaw@gentoo.org>\n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
354 "from the xmms_sndfile plugin which is:\n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
355 "Copyright (C) 2000, 2002 Erik de Castro Lopo\n\n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
356 "This program is free software ; you can redistribute it and/or modify \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
357 "it under the terms of the GNU General Public License as published by \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
358 "the Free Software Foundation ; either version 2 of the License, or \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
359 "(at your option) any later version. \n \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
360 "This program is distributed in the hope that it will be useful, \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
361 "but WITHOUT ANY WARRANTY ; without even the implied warranty of \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
362 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
363 "See the GNU General Public License for more details. \n\n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
364 "You should have received a copy of the GNU General Public \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
365 "License along with this program ; if not, write to \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
366 "the Free Software Foundation, Inc., \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
367 "51 Franklin Street, Fifth Floor, \n" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
368 "Boston, MA 02110-1301 USA"), |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
369 _("Ok"), FALSE, NULL, NULL); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
370 g_signal_connect(G_OBJECT(box), "destroy", |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
371 (GCallback)gtk_widget_destroyed, &box); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
372 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
373 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
374 |
1063 | 375 void init(void) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
376 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
377 wav_ip.description = g_strdup_printf(_("sndfile WAV plugin")); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
378 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
379 |
1063 | 380 void fini(void) |
381 { | |
382 g_free(wav_ip.description); | |
383 } | |
384 | |
385 InputPlugin *wav_iplist[] = { &wav_ip, NULL }; | |
386 | |
1395
761e17b23e0c
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
1381
diff
changeset
|
387 DECLARE_PLUGIN(wav-sndfile, init, fini, wav_iplist, NULL, NULL, NULL, NULL, NULL) |