changeset 104:04d4827ea8a4 trunk

[svn] Generate a proper title.
author nenolod
date Wed, 02 Nov 2005 19:31:34 -0800
parents 948027ac55be
children 18fe59468510
files Plugins/Input/console/Audacious_Driver.cpp
diffstat 1 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/console/Audacious_Driver.cpp	Wed Nov 02 19:11:24 2005 -0800
+++ b/Plugins/Input/console/Audacious_Driver.cpp	Wed Nov 02 19:31:34 2005 -0800
@@ -63,9 +63,26 @@
 	reader.open(filename);
 	reader.read(&header, sizeof(header));
 
-	title = g_strdup(header.song);
+	if (header.song)
+	{
+		TitleInput *tinput;
+
+		tinput = bmp_title_input_new();
+
+		tinput->performer = g_strdup(header.author);
+		tinput->album_name = g_strdup(header.game);
+		tinput->track_name = g_strdup(header.song);		
 
-	printf("song title is: %s\n", title);
+		tinput->file_name = g_path_get_basename(filename);
+		tinput->file_path = g_path_get_dirname(filename);
+
+		title = xmms_get_titlestring(xmms_get_gentitle_format(),
+				tinput);
+
+		g_free(tinput);
+	}
+	else
+		title = g_strdup(filename);
 
 	return title;
 }
@@ -74,8 +91,6 @@
 {
 	(*title) = get_title(filename);
 	(*length) = -1;
-
-	printf("get_song_info() finished\n");
 }
 
 static void play_file(char *filename)
@@ -126,7 +141,7 @@
 	NULL,
 	NULL,
 	NULL,
-	NULL,
+	get_song_info,
 	NULL,
 	NULL
 };