changeset 86:60cf31332daa trunk

[svn] - some improvements to the cuesheet plugin, not totally there yet ;)
author nenolod
date Thu, 05 Oct 2006 02:33:10 -0700
parents 86ce11c6b8c3
children fabe64e89949
files ChangeLog src/cue/cuesheet.c
diffstat 2 files changed, 38 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 04 21:01:38 2006 -0700
+++ b/ChangeLog	Thu Oct 05 02:33:10 2006 -0700
@@ -1,3 +1,15 @@
+2006-10-05 04:01:38 +0000  Jonathan Schleifer <js@h3c.de>
+  revision [170]
+  - Imported a few changes from alac decoder 0.1.3
+  - Added myself to AUTHORS
+  
+  trunk/AUTHORS           |    1 
+  trunk/src/alac/demux.c  |   89 ++++++++++++++++++++++++++++++++----------------
+  trunk/src/alac/demux.h  |    2 +
+  trunk/src/alac/plugin.c |    6 +--
+  4 files changed, 66 insertions(+), 32 deletions(-)
+
+
 2006-10-05 01:42:11 +0000  William Pitcock <nenolod@nenolod.net>
   revision [168]
   - try this
--- a/src/cue/cuesheet.c	Wed Oct 04 21:01:38 2006 -0700
+++ b/src/cue/cuesheet.c	Thu Oct 05 02:33:10 2006 -0700
@@ -38,6 +38,7 @@
 static void stop(void);
 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);
 
@@ -79,7 +80,7 @@
 	NULL,
 	NULL,
 	NULL,
-	NULL,		/* XXX get_song_info iface */
+	get_song_info,	/* XXX get_song_info iface */
 	NULL,
 	NULL,
 	get_tuple,
@@ -89,7 +90,7 @@
 static int is_our_file(gchar *filename)
 {
 	gchar *ext;
-	
+
 	/* is it a cue:// URI? */
 	if (!strncasecmp(filename, "cue://", 6))
 		return TRUE;
@@ -124,7 +125,7 @@
 
 static gint get_time(void)
 {
-	return get_output_time();
+	return cue_ip.output->output_time();
 }
 
 static void play(gchar *uri)
@@ -198,6 +199,28 @@
 	return out;
 }
 
+static void get_song_info(gchar *uri, gchar **title, gint *length)
+{
+	TitleInput *tuple;
+
+	/* this isn't a cue:// uri? */
+	if (strncasecmp("cue://", uri, 6))
+	{
+		gchar *tmp = g_strdup_printf("cue://%s?0", uri);
+		tuple = get_tuple_uri(tmp);
+		g_free(tmp);
+	}
+	else
+		tuple = get_tuple_uri(uri);
+
+	g_return_if_fail(tuple != NULL);
+
+	*title = xmms_get_titlestring(xmms_get_gentitle_format(), tuple);
+	*length = tuple->length;
+
+	bmp_title_input_free(tuple);
+}
+
 static void seek(gint time)
 {
 	if (real_ip != NULL)