changeset 1412:6a424e6ff59c

playlist_get_songtime wanted a tuple, but was afraid to ask
author Tony Vroon <chainsaw@gentoo.org>
date Mon, 06 Aug 2007 01:37:26 +0100
parents 394738ae11dc
children 4731d28ea19d
files src/wav/wav-sndfile.c src/wav/wav-sndfile.h
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/wav/wav-sndfile.c	Mon Aug 06 01:36:42 2007 +0200
+++ b/src/wav/wav-sndfile.c	Mon Aug 06 01:37:26 2007 +0100
@@ -82,7 +82,7 @@
     get_song_info,
     NULL,
     NULL,
-    NULL,
+    get_song_tuple,
     NULL,
     NULL,
     NULL,
@@ -328,6 +328,16 @@
 	(*title) = get_title(filename);
 }
 
+static TitleInput*
+get_song_tuple (gchar *filename)
+{
+	TitleInput *tuple = bmp_title_input_new();
+	tuple->file_name = g_strdup(basename(filename));
+	tuple->length = get_song_length(filename);
+	tuple->track_name = get_title(filename);
+	return tuple;
+}
+
 static void wav_about(void)
 {
 	static GtkWidget *box;
--- a/src/wav/wav-sndfile.h	Mon Aug 06 01:36:42 2007 +0200
+++ b/src/wav/wav-sndfile.h	Mon Aug 06 01:37:26 2007 +0100
@@ -31,6 +31,7 @@
 static	void 	play_stop (InputPlayback *playback);
 static	void 	file_seek (InputPlayback *playback, int time);
 static	void 	get_song_info (char *filename, char **title, int *length);
+static	TitleInput* get_song_tuple (gchar *filename);
 static  void    wav_about (void);
 static	void	play_pause (InputPlayback *playback, gshort p);
 static  void file_mseek (InputPlayback *playback, gulong millisecond);