annotate src/xs_title.c @ 377:29be09bd9397 dev-0_8_0b15

Actually use nSubTunes value as it is meant to.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 09 Nov 2005 11:12:05 +0000
parents 1222cff759c6
children b09d74eb71e6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS)
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 Titlestring handling
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
324
dd201740a720 Changed copyright text.
Matti Hamalainen <ccr@tnsp.org>
parents: 233
diff changeset
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org>
dd201740a720 Changed copyright text.
Matti Hamalainen <ccr@tnsp.org>
parents: 233
diff changeset
7 (C) Copyright 1999-2005 Tecnic Software productions (TNSP)
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 This program is free software; you can redistribute it and/or modify
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 the Free Software Foundation; either version 2 of the License, or
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 (at your option) any later version.
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 This program is distributed in the hope that it will be useful,
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 GNU General Public License for more details.
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 along with this program; if not, write to the Free Software
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #include "xs_title.h"
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 #include "xs_support.h"
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 #include "xs_config.h"
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 #include <xmms/titlestring.h>
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 /*
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 * Create a title string based on given information and settings.
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 #define VPUTCH(MCH) \
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
33 if (iIndex < XS_BUF_SIZE) tmpBuf[iIndex++] = MCH;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 #define VPUTSTR(MSTR) { \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 if (MSTR) { \
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
36 if ((iIndex + strlen(MSTR) + 1) < XS_BUF_SIZE) { \
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 strcpy(&tmpBuf[iIndex], MSTR); \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 iIndex += strlen(MSTR); \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 } else \
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
40 iIndex = XS_BUF_SIZE; \
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 } \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
45 gchar *xs_make_titlestring(gchar * pcFilename, gint iSubTune, gint nSubTunes, gint iSidModel,
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
46 const gchar * formatString, const gchar * infoString0,
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
47 const gchar * infoString1, const gchar * infoString2)
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 {
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
49 gchar *tmpFilename, *tmpFilePath, *tmpFileExt, *pcStr, *pcResult, tmpStr[XS_BUF_SIZE], tmpBuf[XS_BUF_SIZE];
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
50 gint iIndex;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 #ifdef HAVE_XMMSEXTRA
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
52 TitleInput *ptInput;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 #endif
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
55 /* Split the filename into path */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
56 tmpFilePath = g_strdup(pcFilename);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
57 tmpFilename = xs_strrchr(tmpFilePath, '/');
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
58 if (tmpFilename)
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
59 tmpFilename[1] = 0;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
60
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
61 /* Filename */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
62 tmpFilename = xs_strrchr(pcFilename, '/');
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
63 if (tmpFilename)
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
64 tmpFilename = g_strdup(tmpFilename + 1);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 else
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
66 tmpFilename = g_strdup(pcFilename);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
68 tmpFileExt = xs_strrchr(tmpFilename, '.');
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
69 tmpFileExt[0] = 0;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
71 /* Extension */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
72 tmpFileExt = xs_strrchr(pcFilename, '.');
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 #ifdef HAVE_XMMSEXTRA
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
76 /* Check if the titles are overridden or not */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
77 if (!xs_cfg.titleOverride) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
78 /* Use generic XMMS titles */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
79 /* XMMS_NEW_TITLEINPUT(ptInput);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
80 * We duplicate and add typecast to the code here due to XMMS's braindead headers
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
81 */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
82 ptInput = (TitleInput *) g_malloc0(sizeof(TitleInput));
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
83 ptInput->__size = XMMS_TITLEINPUT_SIZE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
84 ptInput->__version = XMMS_TITLEINPUT_VERSION;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
86 /* Create the input fields */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
87 ptInput->file_name = tmpFilename;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
88 ptInput->file_ext = tmpFileExt;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
89 ptInput->file_path = tmpFilePath;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
91 ptInput->track_name = g_strdup(infoString0);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
92 ptInput->track_number = iSubTune;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
93 ptInput->album_name = NULL;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
94 ptInput->performer = g_strdup(infoString1);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
95 ptInput->date = g_strdup((iSidModel == XS_SIDMODEL_6581) ? "SID6581" : "SID8580");
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
97 ptInput->year = 0;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
98 ptInput->genre = g_strdup("SID-tune");
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
99 ptInput->comment = g_strdup(infoString2);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
101 /* Create the string */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
102 pcResult = xmms_get_titlestring(xmms_get_gentitle_format(), ptInput);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
104 /* Dispose all allocated memory */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
105 g_free(ptInput->track_name);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
106 g_free(ptInput->performer);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
107 g_free(ptInput->comment);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
108 g_free(ptInput->date);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
109 g_free(ptInput->genre);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
110 g_free(ptInput);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
111 } else
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 #endif
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
114 /* Create the string */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
115 pcStr = xs_cfg.titleFormat;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
116 iIndex = 0;
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
117 while (*pcStr && (iIndex < XS_BUF_SIZE)) {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
118 if (*pcStr == '%') {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
119 pcStr++;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
120 switch (*pcStr) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
121 case '%':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
122 VPUTCH('%');
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
123 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
124 case 'f':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
125 VPUTSTR(tmpFilename);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
126 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
127 case 'F':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
128 VPUTSTR(tmpFilePath);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
129 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
130 case 'e':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
131 VPUTSTR(tmpFileExt);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
132 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
133 case 'p':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
134 VPUTSTR(infoString1);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
135 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
136 case 't':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
137 VPUTSTR(infoString0);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
138 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
139 case 'c':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
140 VPUTSTR(infoString2);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
141 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
142 case 's':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
143 VPUTSTR(formatString);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
144 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
145 case 'm':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
146 switch (iSidModel) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
147 case XS_SIDMODEL_6581:
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
148 VPUTSTR("6581");
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
149 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
150 case XS_SIDMODEL_8580:
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
151 VPUTSTR("8580");
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
152 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
153 default:
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
154 VPUTSTR("Unknown");
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
155 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
156 }
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
157 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
158 case 'n':
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
159 snprintf(tmpStr, XS_BUF_SIZE, "%i", iSubTune);
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
160 VPUTSTR(tmpStr);
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
161 break;
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
162 case 'N':
377
29be09bd9397 Actually use nSubTunes value as it is meant to.
Matti Hamalainen <ccr@tnsp.org>
parents: 372
diff changeset
163 snprintf(tmpStr, XS_BUF_SIZE, "%i", nSubTunes);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
164 VPUTSTR(tmpStr);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
165 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
166 }
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
167 } else {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
168 VPUTCH(*pcStr);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
170 pcStr++;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
172
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
173 tmpBuf[iIndex] = 0;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
174
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
175 /* Make resulting string */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
176 pcResult = g_strdup(tmpBuf);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
179 /* Free temporary strings */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
180 g_free(tmpFilename);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
181 g_free(tmpFilePath);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
183 return pcResult;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184 }