Mercurial > audlegacy-plugins
changeset 1609:e22d2f840d87
Branch merge.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 07 Sep 2007 06:46:33 +0300 |
parents | e423bdc4b4d5 (diff) 331b0614951b (current diff) |
children | 4c7d549bb593 75e0c0e13ed3 |
files | |
diffstat | 2 files changed, 41 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sid/xmms-sid.c Fri Sep 07 00:43:30 2007 +0200 +++ b/src/sid/xmms-sid.c Fri Sep 07 06:46:33 2007 +0300 @@ -277,15 +277,23 @@ return result; } +static gchar * xs_has_tracknumber(gchar *pcFilename) +{ + gchar *tmpSep = xs_strrchr(pcFilename, '?'); + if (tmpSep && g_ascii_isdigit(*(tmpSep + 1))) + return tmpSep; + else + return NULL; +} gboolean xs_get_trackinfo(const gchar *pcFilename, gchar **pcResult, gint *pTrack) { gchar *tmpSep; *pcResult = g_strdup(pcFilename); - tmpSep = xs_strrchr(*pcResult, '?'); + tmpSep = xs_has_tracknumber(*pcResult); - if (tmpSep && g_ascii_isdigit(*(tmpSep + 1))) { + if (tmpSep) { *tmpSep = '\0'; *pTrack = atoi(tmpSep + 1); return TRUE; @@ -298,52 +306,47 @@ gint xs_is_our_file_vfs(gchar *pcFilename, t_xs_file *f) { - gint tmpResult = 0; + gint tmpResult = 0, tmpDummy = 0; assert(xs_status.sidPlayer); /* Check the filename */ if (pcFilename == NULL) return 0; + if (xs_has_tracknumber(pcFilename) != NULL) + return 1; + if (xs_status.sidPlayer->plrProbe(f)) { - gchar *tmpFilename = NULL; - gint tmpDummy = 0; - - if (xs_get_trackinfo(pcFilename, &tmpFilename, &tmpDummy)) { - tmpResult = 1; - } else { - t_xs_tuneinfo *pInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename); + 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 (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 + 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); + if (doAdd) + playlist_add_url(playlist_get_active(), tmpStr); - g_free(tmpStr); - } + g_free(tmpStr); + } - tmpResult = -1; - } else - tmpResult = 1; + tmpResult = -1; + } else + tmpResult = 1; - xs_tuneinfo_free(pInfo); - } + xs_tuneinfo_free(pInfo); + } - g_free(tmpFilename); - } - return tmpResult; }
--- a/src/sid/xs_config.c Fri Sep 07 00:43:30 2007 +0200 +++ b/src/sid/xs_config.c Fri Sep 07 06:46:33 2007 +0300 @@ -280,14 +280,17 @@ #else xs_cfg.subsongControl = XS_SSC_POPUP; #endif - xs_cfg.detectMagic = FALSE; #ifndef HAVE_XMMSEXTRA xs_cfg.titleOverride = TRUE; #endif - xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) [%n/%N][%m/%C]"); +#ifdef AUDACIOUS_PLUGIN + xs_pstrcpy(&xs_cfg.titleFormat, "${artist} - ${title} (${copyright}) <${subtune}/${subtunes}> [${sid-model}/${sid-speed}]"); +#else + xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) <%n/%N> [%m/%C]"); +#endif xs_cfg.subAutoEnable = FALSE; xs_cfg.subAutoMinOnly = TRUE;