# HG changeset patch # User Matti Hamalainen # Date 1192651794 -10800 # Node ID 319930001524af8fefd42bce8f23b709b1a7deff # Parent 371d9450c63142a370cfbc3cf5dfa330f10da0dc# Parent cf87d00b86b9a31d141fbdc58fcaadc08a687038 Automated merge with ssh://hg.atheme.org//hg/audacious-plugins diff -r cf87d00b86b9 -r 319930001524 src/sid/xmms-sid.c --- a/src/sid/xmms-sid.c Wed Oct 17 05:11:06 2007 +0200 +++ b/src/sid/xmms-sid.c Wed Oct 17 23:09:54 2007 +0300 @@ -599,11 +599,6 @@ aud_tuple_associate_string(pResult, FIELD_ARTIST, NULL, pInfo->sidComposer); aud_tuple_associate_string(pResult, FIELD_GENRE, NULL, "SID-tune"); aud_tuple_associate_string(pResult, FIELD_COPYRIGHT, NULL, pInfo->sidCopyright); - - if (xs_cfg.subAutoEnable) - aud_tuple_associate_int(pResult, FIELD_SUBSONG_NUM, NULL, pInfo->nsubTunes); - - aud_tuple_associate_int(pResult, -1, "subtunes", pInfo->nsubTunes); aud_tuple_associate_string(pResult, -1, "sid-format", pInfo->sidFormat); switch (pInfo->sidModel) { @@ -641,8 +636,27 @@ aud_tuple_associate_string(pResult, -1, "sid-speed", tmpStr); } else subTune = 1; + + /* Set subtunes */ + if (xs_cfg.subAutoEnable && pInfo->nsubTunes > 1) { + gint i, n; + pResult->subtunes = g_new(gint, pInfo->nsubTunes); + for (n = 0, i = 1; i <= pInfo->nsubTunes; 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) pResult->subtunes[n++] = i; + } + } else + pResult->nsubtunes = 0; - aud_tuple_associate_int(pResult, -1, "subtune", subTune); + aud_tuple_associate_int(pResult, FIELD_SUBSONG_NUM, NULL, pInfo->nsubTunes); aud_tuple_associate_int(pResult, FIELD_SUBSONG_ID, NULL, subTune); aud_tuple_associate_int(pResult, FIELD_TRACK_NUMBER, NULL, subTune); diff -r cf87d00b86b9 -r 319930001524 src/sid/xs_config.c --- a/src/sid/xs_config.c Wed Oct 17 05:11:06 2007 +0200 +++ b/src/sid/xs_config.c Wed Oct 17 23:09:54 2007 +0300 @@ -285,7 +285,7 @@ #endif #ifdef AUDACIOUS_PLUGIN - xs_pstrcpy(&xs_cfg.titleFormat, "${artist} - ${title} (${copyright}) <${subtune}/${subtunes}> [${sid-model}/${sid-speed}]"); + xs_pstrcpy(&xs_cfg.titleFormat, "${artist} - ${title} (${copyright}) <${subsong-id}/${subsong-num}> [${sid-model}/${sid-speed}]"); #else xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) <%n/%N> [%m/%C]"); #endif