annotate src/xs_title.c @ 412:7f694e5a1493

Updated GNU GPL (new FSF address) and some cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 14 Aug 2006 00:49:02 +0000
parents f997b79a7251
children d2e6682d3ef8
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
412
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
19 You should have received a copy of the GNU General Public License along
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
20 with this program; if not, write to the Free Software Foundation, Inc.,
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
217
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) \
392
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 377
diff changeset
33 if (iIndex < XS_BUF_SIZE) tmpBuf[iIndex++] = MCH;
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 377
diff changeset
34
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 #define VPUTSTR(MSTR) { \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 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
37 if ((iIndex + strlen(MSTR) + 1) < XS_BUF_SIZE) { \
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 strcpy(&tmpBuf[iIndex], MSTR); \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 iIndex += strlen(MSTR); \
392
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 377
diff changeset
40 } else \
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
41 iIndex = XS_BUF_SIZE; \
392
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 377
diff changeset
42 } \
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 377
diff changeset
43 }
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
46 gchar *xs_make_titlestring(t_xs_tuneinfo *p, gint subTune)
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 {
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
48 gchar *tmpFilename, *tmpFilePath, *tmpFileExt, *pcStr, *pcResult,
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
49 tmpStr[XS_BUF_SIZE], tmpBuf[XS_BUF_SIZE];
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
50 t_xs_subtuneinfo *subInfo;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
51 gint iIndex;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 #ifdef HAVE_XMMSEXTRA
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
53 TitleInput *ptInput;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 #endif
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
56 /* Split the filename into path */
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
57 tmpFilePath = g_strdup(p->sidFilename);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
58 tmpFilename = xs_strrchr(tmpFilePath, '/');
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
59 if (tmpFilename)
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
60 tmpFilename[1] = 0;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
61
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
62 /* Filename */
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
63 tmpFilename = xs_strrchr(p->sidFilename, '/');
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
64 if (tmpFilename)
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
65 tmpFilename = g_strdup(tmpFilename + 1);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 else
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
67 tmpFilename = g_strdup(p->sidFilename);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
69 tmpFileExt = xs_strrchr(tmpFilename, '.');
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
70 tmpFileExt[0] = 0;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
72 /* Extension */
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
73 tmpFileExt = xs_strrchr(p->sidFilename, '.');
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
74
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
76 /* Get sub-tune information */
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
77 if ((subTune >= 0) && (subTune < p->nsubTunes)) {
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
78 subInfo = &(p->subTunes[subTune]);
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
79 } else
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
80 subInfo = NULL;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 #ifdef HAVE_XMMSEXTRA
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
83 /* Check if the titles are overridden or not */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
84 if (!xs_cfg.titleOverride) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
85 /* Use generic XMMS titles */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
86 /* XMMS_NEW_TITLEINPUT(ptInput);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
87 * 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
88 */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
89 ptInput = (TitleInput *) g_malloc0(sizeof(TitleInput));
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
90 ptInput->__size = XMMS_TITLEINPUT_SIZE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
91 ptInput->__version = XMMS_TITLEINPUT_VERSION;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
93 /* Create the input fields */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
94 ptInput->file_name = tmpFilename;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
95 ptInput->file_ext = tmpFileExt;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
96 ptInput->file_path = tmpFilePath;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
98 ptInput->track_name = p->sidName;
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
99 ptInput->track_number = subTune + 1;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
100 ptInput->album_name = NULL;
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
101 ptInput->performer = p->sidComposer;
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
102 ptInput->date = (p->sidModel == XS_SIDMODEL_6581) ? "SID6581" : "SID8580";
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 ptInput->year = 0;
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
105 ptInput->genre = "SID-tune";
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
106 ptInput->comment = p->sidCopyright;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
108 /* Create the string */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
109 pcResult = xmms_get_titlestring(xmms_get_gentitle_format(), ptInput);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
111 /* Dispose all allocated memory */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
112 g_free(ptInput);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
113 } else
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 #endif
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
116 /* Create the string */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
117 pcStr = xs_cfg.titleFormat;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
118 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
119 while (*pcStr && (iIndex < XS_BUF_SIZE)) {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
120 if (*pcStr == '%') {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
121 pcStr++;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
122 switch (*pcStr) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
123 case '%':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
124 VPUTCH('%');
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
125 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
126 case 'f':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
127 VPUTSTR(tmpFilename);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
128 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
129 case 'F':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
130 VPUTSTR(tmpFilePath);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
131 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
132 case 'e':
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
133 VPUTSTR(tmpFileExt);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
134 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
135 case 'p':
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
136 VPUTSTR(p->sidComposer);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
137 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
138 case 't':
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
139 VPUTSTR(p->sidName);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
140 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
141 case 'c':
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
142 VPUTSTR(p->sidCopyright);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
143 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
144 case 's':
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
145 VPUTSTR(p->sidFormat);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
146 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
147 case 'm':
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
148 switch (p->sidModel) {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
149 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
150 VPUTSTR("6581");
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
151 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
152 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
153 VPUTSTR("8580");
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
154 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
155 default:
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
156 VPUTSTR("?");
359
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 }
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
159 break;
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
160 case 'S':
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
161 if (subInfo && (subInfo->tuneSpeed > 0)) {
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
162 g_snprintf(tmpStr, XS_BUF_SIZE,
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
163 "%i", subInfo->tuneSpeed);
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
164 VPUTSTR(tmpStr);
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
165 } else
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
166 VPUTSTR("?");
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
167 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
168 case 'n':
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
169 g_snprintf(tmpStr, XS_BUF_SIZE, "%i", subTune + 1);
372
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
170 VPUTSTR(tmpStr);
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
171 break;
1222cff759c6 Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
172 case 'N':
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
173 g_snprintf(tmpStr, XS_BUF_SIZE, "%i", p->nsubTunes);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
174 VPUTSTR(tmpStr);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
175 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
176 }
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
177 } else {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
178 VPUTCH(*pcStr);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
180 pcStr++;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
182
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
183 tmpBuf[iIndex] = 0;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
184
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
185 /* Make resulting string */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
186 pcResult = g_strdup(tmpBuf);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
189 /* Free temporary strings */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
190 g_free(tmpFilename);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
191 g_free(tmpFilePath);
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
193 return pcResult;
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194 }