# HG changeset patch # User Giacomo Lozito # Date 1190135592 -7200 # Node ID 4bdb8621853ed4a17a5763761d1850c7978c674d # Parent 38375d565192e7244b03033499b69f49fdf7efa6 - updated sid plugin to use subsong-num and subsong-id diff -r 38375d565192 -r 4bdb8621853e src/sid/xmms-sid.c --- a/src/sid/xmms-sid.c Tue Sep 18 18:03:11 2007 +0200 +++ b/src/sid/xmms-sid.c Tue Sep 18 19:13:12 2007 +0200 @@ -304,59 +304,16 @@ gint xs_is_our_file_vfs(gchar *pcFilename, t_xs_file *f) { - gint tmpResult = 0, tmpDummy = 0; assert(xs_status.sidPlayer); /* Check the filename */ if (pcFilename == NULL) return 0; - -#ifdef LULZ - /* FIXME! ATTENTION! Subtune addition is now temporarily disabled - * again, due to following reason: the way it currently is "supposed" - * to be done is horribly broken and causes an "infinite recursive - * addition loop" in some cases. - ccr - */ - if (xs_has_tracknumber(pcFilename) != NULL) + + if (xs_status.sidPlayer->plrProbe(f)) return 1; -#endif - - if (xs_status.sidPlayer->plrProbe(f)) { -#ifdef LULZ - t_xs_tuneinfo *pInfo; - - pInfo = xs_status.sidPlayer->plrGetSIDInfo(pcFilename); - - if (pInfo->nsubTunes > 1) { - gint i; - for (i = 1; i <= pInfo->nsubTunes; i++) { - gchar *tmpStr = g_strdup_printf("%s?%d", pcFilename, i); - gboolean doAdd = FALSE; - - if (xs_cfg.subAutoMinOnly) { - if (i == pInfo->startTune || - pInfo->subTunes[i - 1].tuneLength >= xs_cfg.subAutoMinTime) - doAdd = TRUE; - } else - doAdd = TRUE; - - if (doAdd) - playlist_add_url(playlist_get_active(), tmpStr); - - g_free(tmpStr); - } - - tmpResult = -1; - } else - tmpResult = 1; - - xs_tuneinfo_free(pInfo); -#else - tmpResult = 1; -#endif - } - - return tmpResult; + else + return 0; } @@ -676,6 +633,7 @@ tuple_associate_string(pResult, FIELD_ARTIST, NULL, pInfo->sidComposer); tuple_associate_string(pResult, FIELD_GENRE, NULL, "SID-tune"); tuple_associate_string(pResult, FIELD_COPYRIGHT, NULL, pInfo->sidCopyright); + tuple_associate_int(pResult, FIELD_SUBSONG_NUM, NULL, pInfo->nsubTunes); tuple_associate_int(pResult, -1, "subtunes", pInfo->nsubTunes); tuple_associate_string(pResult, -1, "sid-format", pInfo->sidFormat); @@ -717,6 +675,7 @@ subTune = 1; tuple_associate_int(pResult, -1, "subtune", subTune); + tuple_associate_int(pResult, FIELD_SUBSONG_ID, NULL, subTune); tuple_associate_int(pResult, FIELD_TRACK_NUMBER, NULL, subTune); if (xs_cfg.titleOverride) @@ -753,3 +712,13 @@ return tmpResult; } + +Tuple *xs_probe_for_tuple(gchar *filename, t_xs_file *fd) +{ + if (!xs_is_our_file_vfs(filename, fd)) + return NULL; + + vfs_rewind(fd); + + return xs_get_song_tuple(filename); +} diff -r 38375d565192 -r 4bdb8621853e src/sid/xmms-sid.h --- a/src/sid/xmms-sid.h Tue Sep 18 18:03:11 2007 +0200 +++ b/src/sid/xmms-sid.h Tue Sep 18 19:13:12 2007 +0200 @@ -178,6 +178,7 @@ void xs_seek(InputPlayback *, gint); gint xs_get_time(InputPlayback *); Tuple * xs_get_song_tuple(gchar *); +Tuple * xs_probe_for_tuple(gchar *, t_xs_file *); void xs_about(void); void xs_error(const char *, ...); diff -r 38375d565192 -r 4bdb8621853e src/sid/xs_init.c --- a/src/sid/xs_init.c Tue Sep 18 18:03:11 2007 +0200 +++ b/src/sid/xs_init.c Tue Sep 18 19:13:12 2007 +0200 @@ -46,6 +46,7 @@ .is_our_file = xs_is_our_file, /* Check file */ .is_our_file_from_vfs = xs_is_our_file_vfs, /* VFS */ .vfs_extensions = xs_sid_fmts, /* File ext assist */ + .probe_for_tuple = xs_probe_for_tuple }; static InputPlugin *sid_iplist[] = { &xs_plugin_ip, NULL };