changeset 372:1222cff759c6

Titlestring tag %N for number of subtunes; Removed "SID" from SID model strings.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 09 Nov 2005 08:55:00 +0000
parents 75f51962c083
children 684d09ff564b
files src/xs_title.c src/xs_title.h
diffstat 2 files changed, 15 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/xs_title.c	Wed Nov 09 08:54:00 2005 +0000
+++ b/src/xs_title.c	Wed Nov 09 08:55:00 2005 +0000
@@ -29,27 +29,24 @@
 /*
  * Create a title string based on given information and settings.
  */
-#define VBUFSIZE	(1024)
 #define VPUTCH(MCH)	\
-if (iIndex < VBUFSIZE) tmpBuf[iIndex++] = MCH;
+if (iIndex < XS_BUF_SIZE) tmpBuf[iIndex++] = MCH;
 #define VPUTSTR(MSTR) {						\
 	if (MSTR) {						\
-		if ((iIndex + strlen(MSTR) + 1) < VBUFSIZE) {	\
+		if ((iIndex + strlen(MSTR) + 1) < XS_BUF_SIZE) {	\
 			strcpy(&tmpBuf[iIndex], MSTR);		\
 			iIndex += strlen(MSTR); 		\
 			} else					\
-			iIndex = VBUFSIZE;			\
+			iIndex = XS_BUF_SIZE;			\
 		}						\
 	}
 
 
-gchar *xs_make_titlestring(gchar * pcFilename,
-			   gint iSubTune,
-			   gint iSidModel,
+gchar *xs_make_titlestring(gchar * pcFilename, gint iSubTune, gint nSubTunes, gint iSidModel,
 			   const gchar * formatString, const gchar * infoString0,
 			   const gchar * infoString1, const gchar * infoString2)
 {
-	gchar *tmpFilename, *tmpFilePath, *tmpFileExt, *pcStr, *pcResult, tmpStr[VBUFSIZE], tmpBuf[VBUFSIZE];
+	gchar *tmpFilename, *tmpFilePath, *tmpFileExt, *pcStr, *pcResult, tmpStr[XS_BUF_SIZE], tmpBuf[XS_BUF_SIZE];
 	gint iIndex;
 #ifdef HAVE_XMMSEXTRA
 	TitleInput *ptInput;
@@ -117,7 +114,7 @@
 		/* Create the string */
 		pcStr = xs_cfg.titleFormat;
 		iIndex = 0;
-		while (*pcStr && (iIndex < VBUFSIZE)) {
+		while (*pcStr && (iIndex < XS_BUF_SIZE)) {
 			if (*pcStr == '%') {
 				pcStr++;
 				switch (*pcStr) {
@@ -148,18 +145,22 @@
 				case 'm':
 					switch (iSidModel) {
 					case XS_SIDMODEL_6581:
-						VPUTSTR("SID6581");
+						VPUTSTR("6581");
 						break;
 					case XS_SIDMODEL_8580:
-						VPUTSTR("SID8580");
+						VPUTSTR("8580");
 						break;
 					default:
-						VPUTSTR("Unknown SID");
+						VPUTSTR("Unknown");
 						break;
 					}
 					break;
 				case 'n':
-					snprintf(tmpStr, VBUFSIZE, "%i", iSubTune);
+					snprintf(tmpStr, XS_BUF_SIZE, "%i", iSubTune);
+					VPUTSTR(tmpStr);
+					break;
+				case 'N':
+					snprintf(tmpStr, XS_BUF_SIZE, "%i", iSubTune);
 					VPUTSTR(tmpStr);
 					break;
 				}
--- a/src/xs_title.h	Wed Nov 09 08:54:00 2005 +0000
+++ b/src/xs_title.h	Wed Nov 09 08:55:00 2005 +0000
@@ -10,7 +10,7 @@
 /*
  * Functions
  */
-gchar *xs_make_titlestring(gchar *, gint, gint, const gchar *, const gchar *, const gchar *, const gchar *);
+gchar *xs_make_titlestring(gchar *, gint, gint, gint, const gchar *, const gchar *, const gchar *, const gchar *);
 
 #ifdef __cplusplus
 }