changeset 559:d5782f3bd760 trunk

[svn] Update plugins to the new input plugin API
author iabervon
date Sun, 28 Jan 2007 17:02:41 -0800
parents 324a6d834f32
children 7b4b37819c9d
files ChangeLog src/aac/src/libmp4.c src/adplug/adplug-xmms.cc src/alac/plugin.c src/amidi-plug/amidi-plug.c src/amidi-plug/amidi-plug.h src/cdaudio/cdaudio.c src/console/Audacious_Driver.cxx src/cue/cuesheet.c src/metronom/metronom.c src/modplug/plugin.cxx src/mpg123/mpg123.c src/sexypsf/xmms.c src/tonegen/tonegen.c src/vorbis/vorbis.c src/wav/wav.c src/wav/wav.h src/wma/wma.c
diffstat 18 files changed, 180 insertions(+), 140 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 28 14:37:17 2007 -0800
+++ b/ChangeLog	Sun Jan 28 17:02:41 2007 -0800
@@ -1,3 +1,13 @@
+2007-01-28 22:37:17 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [1202]
+  - fix vorbis fileinfo stuff
+  
+  trunk/src/vorbis/fileinfo.c |   12 +++++++-----
+  trunk/src/vorbis/vorbis.c   |    5 -----
+  trunk/src/vorbis/vorbis.h   |    5 +++++
+  3 files changed, 12 insertions(+), 10 deletions(-)
+
+
 2007-01-28 11:51:32 +0000  Tony Vroon <chainsaw@gentoo.org>
   revision [1200]
   Count leading zeroes as PPC assembler. Implemented by Joseph Jezak (JoseJX) from Gentoo.
--- a/src/aac/src/libmp4.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/aac/src/libmp4.c	Sun Jan 28 17:02:41 2007 -0800
@@ -29,11 +29,11 @@
 
 static void	mp4_init(void);
 static void	mp4_about(void);
-static void	mp4_play(char *);
-static void	mp4_stop(void);
-static void	mp4_pause(short);
-static void	mp4_seek(int);
-static int	mp4_getTime(void);
+static void	mp4_play(InputPlayback *);
+static void	mp4_stop(InputPlayback *);
+static void	mp4_pause(InputPlayback *, short);
+static void	mp4_seek(InputPlayback *, int);
+static int	mp4_getTime(InputPlayback *);
 static void	mp4_cleanup(void);
 static int	mp4_IsOurFD(char *, VFSFile *);
 static int	mp4_IsOurFile(char *);
@@ -140,14 +140,14 @@
   return;
 }
 
-static void mp4_play(char *filename)
+static void mp4_play(InputPlayback *data)
 {
+  char *filename = data->filename;
   buffer_playing = TRUE;
   decodeThread = g_thread_create((GThreadFunc)mp4Decode, g_strdup(filename), TRUE, NULL);
-  return;
 }
 
-static void mp4_stop(void)
+static void mp4_stop(InputPlayback *data)
 {
   if(buffer_playing){
     buffer_playing = FALSE;
@@ -230,19 +230,19 @@
                      &aboutbox);
 }
 
-static void	mp4_pause(short flag)
+static void	mp4_pause(InputPlayback *data, short flag)
 {
   mp4_ip.output->pause(flag);
 }
 
-static void	mp4_seek(int time)
+static void	mp4_seek(InputPlayback *data, int time)
 {
   seekPosition = time;
   while(buffer_playing && seekPosition!=-1)
     xmms_usleep(10000);
 }
 
-static int	mp4_getTime(void)
+static int	mp4_getTime(InputPlayback *data)
 {
   if(!buffer_playing)
     return (-1);
--- a/src/adplug/adplug-xmms.cc	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/adplug/adplug-xmms.cc	Sun Jan 28 17:02:41 2007 -0800
@@ -86,6 +86,8 @@
   GtkDialog		*infodlg;
 } plr = { 0, 0, 0, 0, -1, "", NULL, 0.0f, false, 0, NULL, NULL };
 
+static InputPlayback *playback;
+
 /***** Debugging *****/
 
 #ifdef DEBUG
@@ -402,14 +404,16 @@
   return CAdPlug::factory(filename, newopl, cfg.players);
 }
 
-static void adplug_stop(void);
-static void adplug_play(char *filename);
+static void adplug_stop(InputPlayback *data);
+static void adplug_play(InputPlayback *data);
+
+
 
 static void subsong_slider(GtkAdjustment *adj)
 {
-  adplug_stop();
+  adplug_stop(NULL);
   plr.subsong = (unsigned int)adj->value - 1;
-  adplug_play(plr.filename);
+  adplug_play(playback);
 }
 
 static void close_infobox(GtkDialog *infodlg)
@@ -723,7 +727,7 @@
   return FALSE;
 }
 
-static int adplug_get_time(void)
+static int adplug_get_time(InputPlayback *data)
 {
   if(audio_error) { dbg_printf("adplug_get_time(): returned -2\n"); return -2; }
   if(!plr.playing) { dbg_printf("adplug_get_time(): returned -1\n"); return -1; }
@@ -758,8 +762,10 @@
 
 /***** Player control *****/
 
-static void adplug_play(char *filename)
+static void adplug_play(InputPlayback *data)
 {
+  char *filename = data->filename;
+  playback = data;
   dbg_printf("adplug_play(\"%s\"): ", filename);
   audio_error = FALSE;
 
@@ -787,7 +793,7 @@
   dbg_printf(".\n");
 }
 
-static void adplug_stop(void)
+static void adplug_stop(InputPlayback * data)
 {
   dbg_printf("adplug_stop(): join, ");
   plr.playing = false; g_thread_join(plr.play_thread); // stop player thread
@@ -795,13 +801,13 @@
   dbg_printf(".\n");
 }
 
-static void adplug_pause(short paused)
+static void adplug_pause(InputPlayback * data, short paused)
 {
   dbg_printf("adplug_pause(%d)\n", paused);
   adplug_ip.output->pause(paused);
 }
 
-static void adplug_seek(int time)
+static void adplug_seek(InputPlayback * data, int time)
 {
   dbg_printf("adplug_seek(%d)\n", time);
   plr.seek = time * 1000; // time is in seconds, but we count in ms
--- a/src/alac/plugin.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/alac/plugin.c	Sun Jan 28 17:02:41 2007 -0800
@@ -178,25 +178,31 @@
     return build_tuple_from_demux(&demux_res, filename);
 }
 
-static void play_file(char *filename)
+static void play_file(InputPlayback *data)
 {
+    char *filename = data->filename;
     going = 1;
     playback_thread = g_thread_create(decode_thread, filename, TRUE, NULL);
 }
 
-static void stop(void)
+static void stop(InputPlayback * data)
 {
     going = 0;
     g_thread_join(playback_thread);
     output_close_audio();
 }
 
-static void seek(gint time)
+static void do_pause(InputPlayback *data, short paused)
+{
+    output_pause(paused);
+}
+
+static void seek(InputPlayback * data, gint time)
 {
     seek_to = time;
 }
 
-static gint get_time(void)
+static gint get_time(InputPlayback *data)
 {
     if (going)
 	return get_output_time();
@@ -217,7 +223,7 @@
     NULL,
     play_file,
     stop,
-    output_pause,
+    do_pause,
     seek,
     NULL,
     get_time,
--- a/src/amidi-plug/amidi-plug.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/amidi-plug/amidi-plug.c	Sun Jan 28 17:02:41 2007 -0800
@@ -129,7 +129,7 @@
 }
 
 
-static void amidiplug_stop( void )
+static void amidiplug_stop( InputPlayback * data )
 {
   DEBUGMSG( "STOP request at tick: %i\n" , midifile.playing_tick );
   pthread_mutex_lock( &amidiplug_playing_mutex );
@@ -177,7 +177,7 @@
 }
 
 
-static void amidiplug_pause( gshort paused )
+static void amidiplug_pause( InputPlayback * data, gshort paused )
 {
   if ( paused )
   {
@@ -226,7 +226,7 @@
 }
 
 
-static void amidiplug_seek( gint time )
+static void amidiplug_seek( InputPlayback * data, gint time )
 {
   DEBUGMSG( "SEEK requested (time %i), pausing song...\n" , time );
   pthread_mutex_lock( &amidiplug_playing_mutex );
@@ -262,7 +262,7 @@
 }
 
 
-static gint amidiplug_get_time( void )
+static gint amidiplug_get_time( InputPlayback *data )
 {
   if ( backend.autonomous_audio == FALSE )
   {
@@ -366,8 +366,9 @@
 }
 
 
-static void amidiplug_play( gchar * filename )
+static void amidiplug_play( InputPlayback * data)
 {
+  gchar * filename = data->filename;
   gint port_count = 0;
   gint au_samplerate = -1, au_bitdepth = -1, au_channels = -1;
 
@@ -485,7 +486,6 @@
   }
 
   VFS_FCLOSE( midifile.file_pointer );
-  return;
 }
 
 
--- a/src/amidi-plug/amidi-plug.h	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/amidi-plug/amidi-plug.h	Sun Jan 28 17:02:41 2007 -0800
@@ -72,11 +72,11 @@
 static void amidiplug_configure( void );
 static gint amidiplug_is_our_file( gchar * );
 static gint amidiplug_is_our_file_from_vfs( gchar * , VFSFile * );
-static void amidiplug_play( gchar * );
-static void amidiplug_stop( void );
-static void amidiplug_pause( gshort );
-static void amidiplug_seek( gint );
-static gint amidiplug_get_time( void );
+static void amidiplug_play( InputPlayback * );
+static void amidiplug_stop( InputPlayback * );
+static void amidiplug_pause( InputPlayback *, gshort );
+static void amidiplug_seek( InputPlayback *, gint );
+static gint amidiplug_get_time( InputPlayback * );
 static void amidiplug_get_volume( gint * , gint * );
 static void amidiplug_set_volume( gint , gint );
 static void amidiplug_get_song_info( gchar * , gchar ** , gint * );
--- a/src/cdaudio/cdaudio.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/cdaudio/cdaudio.c	Sun Jan 28 17:02:41 2007 -0800
@@ -110,11 +110,11 @@
 static void cdda_init(void);
 static int is_our_file(char *filename);
 static GList *scan_dir(char *dir);
-static void play_file(char *filename);
-static void stop(void);
-static void cdda_pause(short p);
-static void seek(int time);
-static int get_time(void);
+static void play_file(InputPlayback *playback);
+static void stop(InputPlayback *playback);
+static void cdda_pause(InputPlayback *playback, short p);
+static void seek(InputPlayback *playback, int time);
+static int get_time(InputPlayback *playback);
 static void get_song_info(char *filename, char **title, int *length);
 static TitleInput *get_song_tuple(char *filename);
 static void get_volume(int *l, int *r);
@@ -945,8 +945,9 @@
 }
 
 static void
-play_file(char *filename)
+play_file(InputPlayback *playback)
 {
+    char *filename = playback->filename;
     char *tmp;
     struct driveinfo *drive;
     int track;
@@ -1003,7 +1004,8 @@
     if (drive->dae)
         dae_play();
     else
-        seek(0);
+        seek(playback, 0);
+    return;
 }
 
 static TitleInput *
@@ -1089,7 +1091,7 @@
 }
 
 static void
-stop(void)
+stop(InputPlayback * data)
 {
     struct timeout *to_info;
     if (cdda_playing.fd < 0)
@@ -1117,14 +1119,14 @@
 }
 
 static void
-cdda_pause(short p)
+cdda_pause(InputPlayback *data, short p)
 {
     if (cdda_playing.drive.dae) {
         cdda_ip.output->pause(p);
         return;
     }
     if (p) {
-        pause_time = get_time();
+        pause_time = get_time(data);
         ioctl(cdda_playing.fd, XMMS_PAUSE, 0);
     }
     else {
@@ -1137,7 +1139,7 @@
 
 
 static void
-seek(int time)
+seek(InputPlayback *data, int time)
 {
     struct cdda_msf *end, start;
     int track = cdda_playing.track;
@@ -1162,7 +1164,7 @@
     play_ioctl(&start, end);
 
     if (is_paused) {
-        cdda_pause(TRUE);
+        cdda_pause(data, TRUE);
         pause_time = time * 1000;
     }
 }
@@ -1202,7 +1204,7 @@
 }
 
 static int
-get_time(void)
+get_time(InputPlayback *playback)
 {
     if (cdda_playing.fd == -1)
         return -1;
--- a/src/console/Audacious_Driver.cxx	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/console/Audacious_Driver.cxx	Sun Jan 28 17:02:41 2007 -0800
@@ -290,8 +290,9 @@
 	return NULL;
 }
 
-static void play_file( char* path )
+static void play_file( InputPlayback *data )
 {
+        char* path = data->filename;
 	unload_file();
 	
 	// identify file
@@ -373,13 +374,13 @@
 	decode_thread = g_thread_create( play_loop_track, NULL, TRUE, NULL );
 }
 
-static void seek( gint time )
+static void seek( InputPlayback * data, gint time )
 {
 	// TODO: use thread-safe atomic set
 	pending_seek = time;
 }
 
-static void console_stop(void)
+static void console_stop(InputPlayback *data)
 {
 	console_ip_is_going = 0;
 	if ( decode_thread )
@@ -391,12 +392,12 @@
 	unload_file();
 }
 
-static void console_pause(gshort p)
+static void console_pause(InputPlayback * data, gshort p)
 {
 	console_ip.output->pause(p);
 }
 
-static int get_time(void)
+static int get_time(InputPlayback *data)
 {
 	return console_ip_is_going ? console_ip.output->output_time() : -1;
 }
--- a/src/cue/cuesheet.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/cue/cuesheet.c	Sun Jan 28 17:02:41 2007 -0800
@@ -35,17 +35,17 @@
 static void free_cue_info(void);
 static void fix_cue_argument(char *line);
 static gboolean is_our_file(gchar *filespec);
-static void play(gchar *uri);
-static void play_cue_uri(gchar *uri);
-static gint get_time(void);
-static void seek(gint time);
-static void stop(void);
-static void cue_pause(short);
+static void play(InputPlayback *data);
+static void play_cue_uri(InputPlayback *data, gchar *uri);
+static gint get_time(InputPlayback *data);
+static void seek(InputPlayback *data, gint time);
+static void stop(InputPlayback *data);
+static void cue_pause(InputPlayback *data, short);
 static TitleInput *get_tuple(gchar *uri);
 static TitleInput *get_tuple_uri(gchar *uri);
 static void get_song_info(gchar *uri, gchar **title, gint *length);
 
-static gint watchdog_func(gpointer unused);
+static gint watchdog_func(gpointer data);
 
 static gchar *cue_file = NULL;
 static gchar *cue_title = NULL;
@@ -66,7 +66,7 @@
 static gint timeout_tag = 0;
 static gint finetune_seek = 0;
 
-static InputPlugin *real_ip = NULL;
+static InputPlayback *real_ip = NULL;
 
 InputPlugin cue_ip =
 {
@@ -134,26 +134,27 @@
 	return FALSE;
 }
 
-static gint get_time(void)
+static gint get_time(InputPlayback *playback)
 {
 	if (real_ip)
-		return real_ip->get_time();
+		return real_ip->plugin->get_time(real_ip);
 
 	return -1;
 }
 
-static void play(gchar *uri)
+static void play(InputPlayback *data)
 {
+        gchar *uri = data->filename;
 	/* this isn't a cue:// uri? */
 	if (strncasecmp("cue://", uri, 6))
 	{
 		gchar *tmp = g_strdup_printf("cue://%s?0", uri);
-		play_cue_uri(tmp);
+		play_cue_uri(data, tmp);
 		g_free(tmp);
 		return;
 	}
 
-	play_cue_uri(uri);
+	play_cue_uri(data, uri);
 }
 
 static TitleInput *get_tuple(gchar *uri)
@@ -245,31 +246,32 @@
 	bmp_title_input_free(tuple);
 }
 
-static void seek(gint time)
+static void seek(InputPlayback * data, gint time)
 {
 	if (real_ip != NULL)
-		real_ip->seek(time);
+		real_ip->plugin->seek(real_ip, time);
 }
 
-static void stop(void)
+static void stop(InputPlayback * data)
 {
 	if (real_ip != NULL)
-		real_ip->stop();
+		real_ip->plugin->stop(real_ip);
 
 	gtk_timeout_remove(timeout_tag);
 	free_cue_info();
 
 	if (real_ip != NULL) {
-		real_ip->set_info = cue_ip.set_info;
-		real_ip->output = NULL;
+		real_ip->plugin->set_info = cue_ip.set_info;
+		real_ip->plugin->output = NULL;
+		g_free(real_ip);
 		real_ip = NULL;
 	}
 }
 
-static void cue_pause(short p)
+static void cue_pause(InputPlayback * data, short p)
 {
 	if (real_ip != NULL)
-		real_ip->pause(p);
+		real_ip->plugin->pause(real_ip, p);
 }
 
 static void set_info_override(gchar * unused, gint length, gint rate, gint freq, gint nch)
@@ -291,13 +293,14 @@
 	cue_ip.set_info(title, length, rate, freq, nch);
 }
 
-static void play_cue_uri(gchar *uri)
+static void play_cue_uri(InputPlayback * data, gchar *uri)
 {
         gchar *path2 = g_strdup(uri + 6);
         gchar *_path = strchr(path2, '?');
 	gint file_length = 0;
 	gint track = 0;
 	gchar *dummy = NULL;
+	InputPlugin *real_ip_plugin;
 
         if (_path != NULL && *_path == '?')
         {
@@ -311,16 +314,21 @@
         if (cue_file == NULL)
                 return;
 
-	real_ip = input_check_file(cue_file, FALSE);
+	real_ip_plugin = input_check_file(cue_file, FALSE);
 
-	if (real_ip != NULL)
+	if (real_ip_plugin != NULL)
 	{
-		real_ip->set_info = set_info_override;
-		real_ip->output = cue_ip.output;
-		real_ip->play_file(cue_file);
-		real_ip->seek(finetune_seek ? finetune_seek / 1000 : cue_tracks[track].index / 1000 + 1);
+	        if (real_ip)
+	                g_free(real_ip);
+	        real_ip = g_new0(InputPlayback, 1);
+		real_ip->plugin = real_ip_plugin;
+		real_ip->plugin->set_info = set_info_override;
+		real_ip->plugin->output = cue_ip.output;
+		real_ip->filename = cue_file;
+		real_ip->plugin->play_file(real_ip);
+		real_ip->plugin->seek(real_ip, finetune_seek ? finetune_seek / 1000 : cue_tracks[track].index / 1000 + 1);
 		// in some plugins, NULL as 2nd arg causes crash.
-		real_ip->get_song_info(cue_file, &dummy, &file_length);
+		real_ip->plugin->get_song_info(cue_file, &dummy, &file_length);
 		g_free(dummy);
 		cue_tracks[last_cue_track].index = file_length;
 	}
@@ -329,7 +337,7 @@
 
 	cur_cue_track = track;
 
-	timeout_tag = gtk_timeout_add(100, watchdog_func, NULL);
+	timeout_tag = gtk_timeout_add(100, watchdog_func, data);
 }
 
 InputPlugin *get_iplugin_info(void)
@@ -355,7 +363,7 @@
  *
  *     - nenolod
  */
-static gint watchdog_func(gpointer unused)
+static gint watchdog_func(gpointer data)
 {
 	gint time = get_output_time();
 	gboolean dir = FALSE;
@@ -381,7 +389,7 @@
 		if (!(time > cue_tracks[cur_cue_track].index))
 			finetune_seek = time;
 		if(cfg.stopaftersong) {
-			stop();
+			stop(data);
 			return TRUE;
 		}
 		playlist_next(playlist);
--- a/src/metronom/metronom.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/metronom/metronom.c	Sun Jan 28 17:02:41 2007 -0800
@@ -152,8 +152,9 @@
 	g_thread_exit(NULL);
 }
 
-static void metronom_play(char *filename)
+static void metronom_play(InputPlayback *data)
 {
+        char *filename = data->filename;
 	gchar *name;
 	size_t count;	
 	metronom_t *pmetronom;
@@ -199,7 +200,7 @@
 	play_thread = g_thread_create((GThreadFunc)play_loop, pmetronom, TRUE, NULL);
 }
 
-static void metronom_stop(void)
+static void metronom_stop(InputPlayback *data)
 {
 	if (going)
 	{
@@ -209,12 +210,12 @@
 	}
 }
 
-static void metronom_pause(short paused)
+static void metronom_pause(InputPlayback *data, short paused)
 {
 	metronom_ip.output->pause(paused);
 }
 
-static int metronom_get_time(void)
+static int metronom_get_time(InputPlayback *data)
 {
 	if (audio_error)
 		return -2;
--- a/src/modplug/plugin.cxx	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/modplug/plugin.cxx	Sun Jan 28 17:02:41 2007 -0800
@@ -23,27 +23,28 @@
 	return 0;
 }
 
-static void PlayFile(char* aFilename)
+static void PlayFile(InputPlayback *data)
 {
+        char* aFilename = data->filename;
 	gModplugXMMS.SetOutputPlugin(*gModPlug.output);
 	gModplugXMMS.PlayFile(aFilename);
 }
 
-static void Stop(void)
+static void Stop(InputPlayback *data)
 {
 	gModplugXMMS.Stop();
 }
 
-static void Pause(short aPaused)
+static void Pause(InputPlayback *data, short aPaused)
 {
 	gModplugXMMS.Pause((bool)aPaused);
 }
 
-static void Seek(int aTime)
+static void Seek(InputPlayback *data, int aTime)
 {
 	gModplugXMMS.Seek(float32(aTime));
 }
-static int GetTime(void)
+static int GetTime(InputPlayback *data)
 {
 	float32 lTime;
 	
--- a/src/mpg123/mpg123.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/mpg123/mpg123.c	Sun Jan 28 17:02:41 2007 -0800
@@ -924,8 +924,9 @@
 }
 
 static void
-play_file(char *filename)
+play_file(InputPlayback *data)
 {
+    char *filename = data->filename;
     memset(&fr, 0, sizeof(struct frame));
     memset(&temp_fr, 0, sizeof(struct frame));
 
@@ -944,7 +945,7 @@
 }
 
 static void
-stop(void)
+stop(InputPlayback * data)
 {
     if (mpgdec_info && mpgdec_info->going) {
         mpgdec_info->going = FALSE;
@@ -955,7 +956,7 @@
 }
 
 static void
-seek(int time)
+seek(InputPlayback * data, int time)
 {
     mpgdec_info->jump_to_time = time;
 
@@ -964,7 +965,7 @@
 }
 
 static void
-do_pause(short p)
+do_pause(InputPlayback * data, short p)
 {
     if (output_opened)
         mpgdec_ip.output->pause(p);
@@ -973,7 +974,7 @@
 }
 
 static int
-get_time(void)
+get_time(InputPlayback * data)
 {
     if (audio_error)
         return -2;
--- a/src/sexypsf/xmms.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/sexypsf/xmms.c	Sun Jan 28 17:02:41 2007 -0800
@@ -142,8 +142,9 @@
 	return(NULL);
 }
 
-static void sexypsf_xmms_play(char *fn)
+static void sexypsf_xmms_play(InputPlayback *data)
 {
+        char *fn = data->filename;
 	if(playing)
 		return;
 	nextsong=0;
@@ -169,7 +170,7 @@
 	}
 }
 
-static void sexypsf_xmms_stop(void)
+static void sexypsf_xmms_stop(InputPlayback * data)
 {
 	if(!playing) return;
 
@@ -190,20 +191,20 @@
 	PSFInfo=NULL;
 }
 
-static void sexypsf_xmms_pause(short p)
+static void sexypsf_xmms_pause(InputPlayback * data, short p)
 {
 	if(!playing) return;
 	sexypsf_ip.output->pause(p);
 	paused = p;
 }
 
-static void sexypsf_xmms_seek(int time)
+static void sexypsf_xmms_seek(InputPlayback * data, int time)
 {
 	if(!playing) return;
 	command=CMD_SEEK|time;
 }
 
-static int sexypsf_xmms_gettime(void)
+static int sexypsf_xmms_gettime(InputPlayback *data)
 {
 	if(nextsong)
 		return(-1);
--- a/src/tonegen/tonegen.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/tonegen/tonegen.c	Sun Jan 28 17:02:41 2007 -0800
@@ -178,7 +178,7 @@
 }
 	
 
-static void tone_play(char *filename)
+static void tone_play(InputPlayback *playback, char *filename)
 {
 	GArray* frequencies;
 	char *name;
@@ -202,7 +202,7 @@
 	play_thread = g_thread_create((GThreadFunc)play_loop, frequencies, TRUE, NULL);
 }
 
-static void tone_stop(void)
+static void tone_stop(InputPlayback *data)
 {
 	if (going)
 	{
@@ -212,12 +212,12 @@
 	}
 }
 
-static void tone_pause(short paused)
+static void tone_pause(InputPlayback *data, short paused)
 {
 	tone_ip.output->pause(paused);
 }
 
-static int tone_get_time(void)
+static int tone_get_time(InputPlayback *data)
 {
 	if (audio_error)
 		return -2;
--- a/src/vorbis/vorbis.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/vorbis/vorbis.c	Sun Jan 28 17:02:41 2007 -0800
@@ -64,11 +64,11 @@
 static TitleInput *get_song_tuple(gchar *filename);
 static int vorbis_check_file(char *filename);
 static int vorbis_check_fd(char *filename, VFSFile *stream);
-static void vorbis_play(char *filename);
-static void vorbis_stop(void);
-static void vorbis_pause(short p);
-static void vorbis_seek(int time);
-static int vorbis_time(void);
+static void vorbis_play(InputPlayback *data);
+static void vorbis_stop(InputPlayback *data);
+static void vorbis_pause(InputPlayback *data, short p);
+static void vorbis_seek(InputPlayback *data, int time);
+static int vorbis_time(InputPlayback *data);
 static void vorbis_get_song_info(char *filename, char **title, int *length);
 static gchar *vorbis_generate_title(OggVorbis_File * vorbisfile, gchar * fn);
 static void vorbis_aboutbox(void);
@@ -580,8 +580,9 @@
 }
 
 static void
-vorbis_play(char *filename)
+vorbis_play(InputPlayback *data)
 {
+    char *filename = data->filename;
     vorbis_playing = 1;
     vorbis_bytes_streamed = 0;
     vorbis_eos = 0;
@@ -592,7 +593,7 @@
 }
 
 static void
-vorbis_stop(void)
+vorbis_stop(InputPlayback *data)
 {
     if (vorbis_playing) {
         vorbis_playing = 0;
@@ -601,13 +602,13 @@
 }
 
 static void
-vorbis_pause(short p)
+vorbis_pause(InputPlayback *data, short p)
 {
     vorbis_ip.output->pause(p);
 }
 
 static int
-vorbis_time(void)
+vorbis_time(InputPlayback *data)
 {
     if (output_error)
         return -2;
@@ -617,7 +618,7 @@
 }
 
 static void
-vorbis_seek(int time)
+vorbis_seek(InputPlayback *data, int time)
 {
     if (vorbis_is_streaming)
         return;
--- a/src/wav/wav.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/wav/wav.c	Sun Jan 28 17:02:41 2007 -0800
@@ -310,8 +310,9 @@
 }
 
 static void
-play_file(gchar * filename)
+play_file(InputPlayback * data)
 {
+    gchar * filename = data->filename;
     gchar magic[4], *name;
     gulong len;
     gint rate;
@@ -427,7 +428,7 @@
 }
 
 static void
-stop(void)
+stop(InputPlayback * data)
 {
     if (wav_file && wav_file->going) {
         wav_file->going = 0;
@@ -439,13 +440,13 @@
 }
 
 static void
-wav_pause(gshort p)
+wav_pause(InputPlayback * data, gshort p)
 {
     wav_ip.output->pause(p);
 }
 
 static void
-seek(gint time)
+seek(InputPlayback * data, gint time)
 {
     wav_file->seek_to = time;
 
@@ -456,7 +457,7 @@
 }
 
 static int
-get_time(void)
+get_time(InputPlayback *data)
 {
     if (audio_error)
         return -2;
--- a/src/wav/wav.h	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/wav/wav.h	Sun Jan 28 17:02:41 2007 -0800
@@ -54,11 +54,11 @@
 
 static void wav_init(void);
 static int is_our_file(char *filename);
-static void play_file(char *filename);
-static void stop(void);
-static void seek(int time);
-static void wav_pause(short p);
-static int get_time(void);
+static void play_file(InputPlayback * data);
+static void stop(InputPlayback * data);
+static void seek(InputPlayback * data, int time);
+static void wav_pause(InputPlayback * data, short p);
+static int get_time(InputPlayback * data);
 static void get_song_info(char *filename, char **title, int *length);
 
 #endif
--- a/src/wma/wma.c	Sun Jan 28 14:37:17 2007 -0800
+++ b/src/wma/wma.c	Sun Jan 28 17:02:41 2007 -0800
@@ -77,11 +77,11 @@
 static void wma_init(void);
 static int wma_is_our_file(char *filename);
 static int wma_is_our_fd(char *filename, VFSFile *fd);
-static void wma_play_file(char *filename);
-static void wma_stop(void);
-static void wma_seek(int time);
-static void wma_do_pause(short p);
-static int wma_get_time(void);
+static void wma_play_file(InputPlayback *data);
+static void wma_stop(InputPlayback *data);
+static void wma_seek(InputPlayback *data, int time);
+static void wma_do_pause(InputPlayback *data, short p);
+static int wma_get_time(InputPlayback *data);
 static void wma_get_song_info(char *filename, char **title, int *length);
 static TitleInput *wma_get_song_tuple(char *filename);
 static char *wsong_title;
@@ -238,13 +238,13 @@
     return 1;
 }
 
-static void wma_do_pause(short p)
+static void wma_do_pause(InputPlayback *data, short p)
 {
     wma_pause = p;
     wma_ip.output->pause(wma_pause);
 }
 
-static void wma_seek(int time) 
+static void wma_seek(InputPlayback *data, int time) 
 {
     wma_seekpos = time;
     if(wma_pause) wma_ip.output->pause(0);
@@ -252,7 +252,7 @@
     if(wma_pause) wma_ip.output->pause(1);
 }
 
-static int wma_get_time(void)
+static int wma_get_time(InputPlayback *data)
 {
     wma_ip.output->buffer_free();
     if(wma_decode) return wma_ip.output->output_time();
@@ -430,8 +430,9 @@
     return(NULL);
 }
 
-static void wma_play_file(char *filename) 
+static void wma_play_file(InputPlayback *data)
 {
+    char *filename = data->filename;
     AVCodec *codec;
     
     if(av_open_input_file(&ic, str_twenty_to_space(filename), NULL, 0, NULL) < 0) return;
@@ -467,10 +468,10 @@
     wma_decode_thread = g_thread_create((GThreadFunc)wma_play_loop, NULL, TRUE, NULL);
 }
 
-static void wma_stop(void) 
+static void wma_stop(InputPlayback *data) 
 {
     wma_decode = 0;
-    if(wma_pause) wma_do_pause(0);
+    if(wma_pause) wma_do_pause(data, 0);
     g_thread_join(wma_decode_thread);
     wma_ip.output->close_audio();
 }