changeset 2085:319930001524

Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 17 Oct 2007 23:09:54 +0300
parents 371d9450c631 (diff) cf87d00b86b9 (current diff)
children c7ee6a3f94f9
files
diffstat 2 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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);
 
--- 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