changeset 580:2419d6928017 trunk

[svn] - converted timidity plugin to InputPlayback
author giacomo
date Tue, 30 Jan 2007 08:36:50 -0800
parents 22a80841acd0
children c5022551db57
files ChangeLog src/timidity/src/xmms-timidity.c src/timidity/src/xmms-timidity.h
diffstat 3 files changed, 28 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jan 30 08:24:40 2007 -0800
+++ b/ChangeLog	Tue Jan 30 08:36:50 2007 -0800
@@ -1,3 +1,12 @@
+2007-01-30 16:24:40 +0000  Giacomo Lozito <james@develia.org>
+  revision [1244]
+  - added audacious osd in configure.ac
+  trunk/configure.ac      |   32 ++++++++++++++++++++++++++++++++
+  trunk/mk/rules.mk.in    |    4 ++++
+  trunk/src/aosd/Makefile |    4 ++--
+  3 files changed, 38 insertions(+), 2 deletions(-)
+
+
 2007-01-30 16:04:43 +0000  Giacomo Lozito <james@develia.org>
   revision [1242]
   - splitted GTK_CFLAGS in GTK_CFLAGS, GLIB_CFLAGS and PANGO_CFLAGS, splitted GTK_LIBS in GTK_LIBS, GLIB_LIBS, PANGO_LIBS
--- a/src/timidity/src/xmms-timidity.c	Tue Jan 30 08:24:40 2007 -0800
+++ b/src/timidity/src/xmms-timidity.c	Tue Jan 30 08:36:50 2007 -0800
@@ -264,6 +264,7 @@
 }
 
 static void *xmmstimid_play_loop(void *arg) {
+	InputPlayback *playback = arg;
 	size_t buffer_size;
 	void *buffer;
 	size_t bytes_read;
@@ -290,7 +291,7 @@
 
 		if (xmmstimid_seek_to != -1) {
 			mid_song_seek(xmmstimid_song, xmmstimid_seek_to * 1000);
-			xmmstimid_ip.output->flush(xmmstimid_seek_to * 1000);
+			playback->output->flush(xmmstimid_seek_to * 1000);
 			xmmstimid_seek_to = -1;
 			bytes_read = 0;
 		}
@@ -331,7 +332,8 @@
 	return title;
 }
 
-void xmmstimid_play_file(char *filename) {
+void xmmstimid_play_file(InputPlayback * playback) {
+	char *filename = playback->filename;
 	MidIStream *stream;
 	gchar *title;
 
@@ -364,7 +366,7 @@
 		return;
 	}
 
-	if (xmmstimid_ip.output->open_audio(
+	if (playback->output->open_audio(
 				(xmmstimid_opts.format == MID_AUDIO_S16LSB) ?
 				FMT_S16_LE : FMT_S8,
 				xmmstimid_opts.rate, xmmstimid_opts.channels) == 0) {
@@ -385,28 +387,28 @@
 	xmmstimid_eof = FALSE;
 	xmmstimid_seek_to = -1;
 
-	xmmstimid_decode_thread = g_thread_create((GThreadFunc)xmmstimid_play_loop, NULL, TRUE, NULL);
+	xmmstimid_decode_thread = g_thread_create((GThreadFunc)xmmstimid_play_loop, playback, TRUE, NULL);
 	if (xmmstimid_decode_thread == NULL) {
 		mid_song_free(xmmstimid_song);
-		xmmstimid_stop();
+		xmmstimid_stop(playback);
 	}
 }
 
-void xmmstimid_stop(void) {
+void xmmstimid_stop(InputPlayback * playback) {
 	if (xmmstimid_song != NULL && xmmstimid_going) {
 		xmmstimid_going = FALSE;
 		g_thread_join(xmmstimid_decode_thread);
-		xmmstimid_ip.output->close_audio();
+		playback->output->close_audio();
 		mid_song_free(xmmstimid_song);
 		xmmstimid_song = NULL;
 	}
 }
 
-void xmmstimid_pause(short p) {
-	xmmstimid_ip.output->pause(p);
+void xmmstimid_pause(InputPlayback * playback, short p) {
+	playback->output->pause(p);
 }
 
-void xmmstimid_seek(int time) {
+void xmmstimid_seek(InputPlayback * playback, int time) {
 	xmmstimid_seek_to = time;
 	xmmstimid_eof = FALSE;
 
@@ -414,13 +416,13 @@
 		xmms_usleep(10000);
 }
 
-int xmmstimid_get_time(void) {
+int xmmstimid_get_time(InputPlayback * playback) {
 	if (xmmstimid_audio_error)
 		return -2;
 	if (xmmstimid_song == NULL)
 		return -1;
 	if (!xmmstimid_going || (xmmstimid_eof &&
-				xmmstimid_ip.output->buffer_playing()))
+				playback->output->buffer_playing()))
 		return -1;
 
 	return mid_song_get_time(xmmstimid_song);
--- a/src/timidity/src/xmms-timidity.h	Tue Jan 30 08:24:40 2007 -0800
+++ b/src/timidity/src/xmms-timidity.h	Tue Jan 30 08:36:50 2007 -0800
@@ -29,11 +29,11 @@
 static void xmmstimid_about(void);
 static void xmmstimid_configure(void);
 static int xmmstimid_is_our_fd( char * filename, VFSFile * fp );
-static void xmmstimid_play_file(char *filename);
-static void xmmstimid_stop(void);
-static void xmmstimid_pause(short p);
-static void xmmstimid_seek(int time);
-static int xmmstimid_get_time(void);
+static void xmmstimid_play_file(InputPlayback * playback);
+static void xmmstimid_stop(InputPlayback * playback);
+static void xmmstimid_pause(InputPlayback * playback, short p);
+static void xmmstimid_seek(InputPlayback * playback, int time);
+static int xmmstimid_get_time(InputPlayback * playback);
 static void xmmstimid_cleanup(void);
 static void xmmstimid_get_song_info(char *filename, char **title, int *length);