# HG changeset patch # User Matti Hamalainen # Date 1131526500 0 # Node ID 1222cff759c6642ed27827419c4a6a5aace696e1 # Parent 75f51962c083ac1d3df94469281ed5c37a12dd84 Titlestring tag %N for number of subtunes; Removed "SID" from SID model strings. diff -r 75f51962c083 -r 1222cff759c6 src/xs_title.c --- 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; } diff -r 75f51962c083 -r 1222cff759c6 src/xs_title.h --- 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 }