Mercurial > audlegacy-plugins
comparison src/metronom/metronom.c @ 559:d5782f3bd760 trunk
[svn] Update plugins to the new input plugin API
author | iabervon |
---|---|
date | Sun, 28 Jan 2007 17:02:41 -0800 |
parents | 5fa8b0ca6d61 |
children | 914c96de3244 |
comparison
equal
deleted
inserted
replaced
558:324a6d834f32 | 559:d5782f3bd760 |
---|---|
150 metronom_ip.output->buffer_free(); | 150 metronom_ip.output->buffer_free(); |
151 metronom_ip.output->buffer_free(); | 151 metronom_ip.output->buffer_free(); |
152 g_thread_exit(NULL); | 152 g_thread_exit(NULL); |
153 } | 153 } |
154 | 154 |
155 static void metronom_play(char *filename) | 155 static void metronom_play(InputPlayback *data) |
156 { | 156 { |
157 char *filename = data->filename; | |
157 gchar *name; | 158 gchar *name; |
158 size_t count; | 159 size_t count; |
159 metronom_t *pmetronom; | 160 metronom_t *pmetronom; |
160 gint flag,id; | 161 gint flag,id; |
161 | 162 |
197 metronom_ip.set_info(name, -1, 16 * 44100, 44100, 1); | 198 metronom_ip.set_info(name, -1, 16 * 44100, 44100, 1); |
198 g_free(name); | 199 g_free(name); |
199 play_thread = g_thread_create((GThreadFunc)play_loop, pmetronom, TRUE, NULL); | 200 play_thread = g_thread_create((GThreadFunc)play_loop, pmetronom, TRUE, NULL); |
200 } | 201 } |
201 | 202 |
202 static void metronom_stop(void) | 203 static void metronom_stop(InputPlayback *data) |
203 { | 204 { |
204 if (going) | 205 if (going) |
205 { | 206 { |
206 going = FALSE; | 207 going = FALSE; |
207 g_thread_join(play_thread); | 208 g_thread_join(play_thread); |
208 metronom_ip.output->close_audio(); | 209 metronom_ip.output->close_audio(); |
209 } | 210 } |
210 } | 211 } |
211 | 212 |
212 static void metronom_pause(short paused) | 213 static void metronom_pause(InputPlayback *data, short paused) |
213 { | 214 { |
214 metronom_ip.output->pause(paused); | 215 metronom_ip.output->pause(paused); |
215 } | 216 } |
216 | 217 |
217 static int metronom_get_time(void) | 218 static int metronom_get_time(InputPlayback *data) |
218 { | 219 { |
219 if (audio_error) | 220 if (audio_error) |
220 return -2; | 221 return -2; |
221 if (!going && !metronom_ip.output->buffer_playing()) | 222 if (!going && !metronom_ip.output->buffer_playing()) |
222 return -1; | 223 return -1; |