# HG changeset patch # User nenolod # Date 1160040790 25200 # Node ID 60cf31332daa3ad8d9170f147bec9385850e2a6e # Parent 86ce11c6b8c3b11e3a70cd2dbc3225db0cd5bfcc [svn] - some improvements to the cuesheet plugin, not totally there yet ;) diff -r 86ce11c6b8c3 -r 60cf31332daa ChangeLog --- 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 + 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 revision [168] - try this diff -r 86ce11c6b8c3 -r 60cf31332daa src/cue/cuesheet.c --- 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)