Mercurial > hg > xmms-sid
annotate src/xs_title.c @ 541:e795d8e73ebc
More Audacious compatibility glue.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 21 Feb 2007 05:38:05 +0000 |
parents | 3e4901a89f3d |
children | a751d2b85a7d |
rev | line source |
---|---|
217 | 1 /* |
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) | |
3 | |
4 Titlestring handling | |
5 | |
324 | 6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> |
422 | 7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP) |
217 | 8 |
9 This program is free software; you can redistribute it and/or modify | |
10 it under the terms of the GNU General Public License as published by | |
11 the Free Software Foundation; either version 2 of the License, or | |
12 (at your option) any later version. | |
13 | |
14 This program is distributed in the hope that it will be useful, | |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 GNU General Public License for more details. | |
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 | 22 */ |
23 #include "xs_title.h" | |
24 #include "xs_support.h" | |
25 #include "xs_config.h" | |
540 | 26 #ifdef AUDACIOUS_PLUGIN |
27 #include <audacious/titlestring.h> | |
28 #else | |
217 | 29 #include <xmms/titlestring.h> |
540 | 30 #endif |
31 | |
32 | |
33 static void xs_path_split(gchar *path, gchar **tmpFilename, gchar **tmpFilePath, gchar **tmpFileExt) | |
34 { | |
35 gchar *tmpStr; | |
36 | |
37 /* Split the filename into path */ | |
38 *tmpFilePath = g_strdup(path); | |
39 tmpStr = xs_strrchr(*tmpFilePath, '/'); | |
40 if (tmpStr) tmpStr[1] = 0; | |
41 | |
42 /* Filename */ | |
43 *tmpFilename = xs_strrchr(path, '/'); | |
44 if (*tmpFilename) | |
45 *tmpFilename = g_strdup(*tmpFilename + 1); | |
46 else | |
47 *tmpFilename = g_strdup(path); | |
48 | |
49 tmpStr = xs_strrchr(*tmpFilename, '.'); | |
50 tmpStr[0] = 0; | |
51 | |
52 /* Extension */ | |
53 *tmpFileExt = xs_strrchr(path, '.'); | |
54 } | |
55 | |
56 | |
57 #if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN) | |
58 /* Tuple support | |
59 */ | |
60 static TitleInput * xs_get_titletuple(gchar *tmpFilename, gchar *tmpFilePath, | |
61 gchar *tmpFileExt, t_xs_tuneinfo *p, gint subTune) | |
62 { | |
63 TitleInput *pResult; | |
64 | |
65 #ifdef AUDACIOUS_PLUGIN | |
66 pResult = bmp_title_input_new(); | |
67 #else | |
68 pResult = (TitleInput *) g_malloc0(sizeof(TitleInput)); | |
69 pResult->__size = XMMS_TITLEINPUT_SIZE; | |
70 pResult->__version = XMMS_TITLEINPUT_VERSION; | |
71 #endif | |
72 | |
73 /* Create the input fields */ | |
74 pResult->file_name = tmpFilename; | |
75 pResult->file_ext = tmpFileExt; | |
76 pResult->file_path = tmpFilePath; | |
77 | |
541
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
78 pResult->track_name = g_strdup(p->sidName); |
540 | 79 pResult->track_number = subTune; |
80 pResult->album_name = NULL; | |
541
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
81 pResult->performer = g_strdup(p->sidComposer); |
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
82 pResult->date = g_strdup((p->sidModel == XS_SIDMODEL_6581) ? "SID6581" : "SID8580"); |
540 | 83 |
84 pResult->year = 0; | |
541
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
85 pResult->genre = g_strdup("SID-tune"); |
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
86 pResult->comment = g_strdup(p->sidCopyright); |
540 | 87 |
88 return pResult; | |
89 } | |
90 | |
91 #ifdef AUDACIOUS_PLUGIN | |
92 TitleInput * xs_make_titletuple(t_xs_tuneinfo *p, gint subTune) | |
93 { | |
94 gchar *tmpFilename, *tmpFilePath, *tmpFileExt; | |
95 | |
541
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
96 xs_path_split(p->sidFilename, &tmpFilename, &tmpFilePath, &tmpFileExt); |
540 | 97 |
541
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
98 return xs_get_titletuple(tmpFilename, tmpFilePath, tmpFileExt, p, subTune); |
540 | 99 } |
100 #endif | |
101 #endif | |
217 | 102 |
103 | |
104 /* | |
105 * Create a title string based on given information and settings. | |
106 */ | |
107 #define VPUTCH(MCH) \ | |
392
b09d74eb71e6
Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents:
377
diff
changeset
|
108 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
|
109 |
217 | 110 #define VPUTSTR(MSTR) { \ |
111 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
|
112 if ((iIndex + strlen(MSTR) + 1) < XS_BUF_SIZE) { \ |
217 | 113 strcpy(&tmpBuf[iIndex], MSTR); \ |
114 iIndex += strlen(MSTR); \ | |
392
b09d74eb71e6
Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents:
377
diff
changeset
|
115 } else \ |
372
1222cff759c6
Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
116 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
|
117 } \ |
b09d74eb71e6
Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents:
377
diff
changeset
|
118 } |
217 | 119 |
120 | |
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
121 gchar *xs_make_titlestring(t_xs_tuneinfo *p, gint subTune) |
217 | 122 { |
540 | 123 gchar *tmpFilename, *tmpFilePath, *tmpFileExt, |
124 *pcStr, *pcResult, tmpStr[XS_BUF_SIZE], tmpBuf[XS_BUF_SIZE]; | |
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
125 t_xs_subtuneinfo *subInfo; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
126 gint iIndex; |
217 | 127 |
540 | 128 /* Get filename parts */ |
129 xs_path_split(p->sidFilename, &tmpFilename, | |
130 &tmpFilePath, &tmpFileExt); | |
131 | |
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
132 /* Get sub-tune information */ |
472 | 133 if ((subTune > 0) && (subTune <= p->nsubTunes)) { |
134 subInfo = &(p->subTunes[subTune - 1]); | |
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
135 } else |
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
136 subInfo = NULL; |
217 | 137 |
540 | 138 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
139 /* Check if the titles are overridden or not */ |
540 | 140 #if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN) |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
141 if (!xs_cfg.titleOverride) { |
540 | 142 TitleInput *pTuple = xs_get_titletuple( |
143 tmpFilename, tmpFilePath, tmpFileExt, p, subTune); | |
144 | |
145 pcResult = xmms_get_titlestring(xmms_get_gentitle_format(), pTuple); | |
541
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
146 |
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
147 g_free(pTuple->track_name); |
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
148 g_free(pTuple->album_name); |
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
149 g_free(pTuple->performer); |
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
150 g_free(pTuple->date); |
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
151 g_free(pTuple->genre); |
e795d8e73ebc
More Audacious compatibility glue.
Matti Hamalainen <ccr@tnsp.org>
parents:
540
diff
changeset
|
152 g_free(pTuple->comment); |
540 | 153 g_free(pTuple); |
154 } else | |
217 | 155 #endif |
156 { | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
157 /* Create the string */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
158 pcStr = xs_cfg.titleFormat; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
159 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
|
160 while (*pcStr && (iIndex < XS_BUF_SIZE)) { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
161 if (*pcStr == '%') { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
162 pcStr++; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
163 switch (*pcStr) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
164 case '%': |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
165 VPUTCH('%'); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
166 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
167 case 'f': |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
168 VPUTSTR(tmpFilename); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
169 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
170 case 'F': |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
171 VPUTSTR(tmpFilePath); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
172 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
173 case 'e': |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
174 VPUTSTR(tmpFileExt); |
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 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
|
177 VPUTSTR(p->sidComposer); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
178 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
179 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
|
180 VPUTSTR(p->sidName); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
181 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
182 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
|
183 VPUTSTR(p->sidCopyright); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
184 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
185 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
|
186 VPUTSTR(p->sidFormat); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
187 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
188 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
|
189 switch (p->sidModel) { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
190 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
|
191 VPUTSTR("6581"); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
192 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
193 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
|
194 VPUTSTR("8580"); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
195 break; |
479
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
196 case XS_SIDMODEL_ANY: |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
197 VPUTSTR("ANY"); |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
198 break; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
199 default: |
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
200 VPUTSTR("?"); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
201 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
202 } |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
203 break; |
479
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
204 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
|
205 if (subInfo && (subInfo->tuneSpeed > 0)) { |
479
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
206 switch (subInfo->tuneSpeed) { |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
207 case XS_CLOCK_PAL: |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
208 VPUTSTR("PAL"); |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
209 break; |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
210 case XS_CLOCK_NTSC: |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
211 VPUTSTR("NTSC"); |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
212 break; |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
213 case XS_CLOCK_ANY: |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
214 VPUTSTR("ANY"); |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
215 break; |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
216 case XS_CLOCK_VBI: |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
217 VPUTSTR("VBI"); |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
218 break; |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
219 case XS_CLOCK_CIA: |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
220 VPUTSTR("CIA"); |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
221 break; |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
222 default: |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
223 g_snprintf(tmpStr, XS_BUF_SIZE, |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
224 "%iHz", subInfo->tuneSpeed); |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
225 VPUTSTR(tmpStr); |
99f05a74de5b
Improvements in titlestring handling and information passing in
Matti Hamalainen <ccr@tnsp.org>
parents:
472
diff
changeset
|
226 } |
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
227 } else |
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
228 VPUTSTR("?"); |
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
229 break; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
230 case 'n': |
472 | 231 g_snprintf(tmpStr, XS_BUF_SIZE, "%i", subTune); |
372
1222cff759c6
Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
232 VPUTSTR(tmpStr); |
1222cff759c6
Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
233 break; |
1222cff759c6
Titlestring tag %N for number of subtunes; Removed "SID" from SID model
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
234 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
|
235 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
|
236 VPUTSTR(tmpStr); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
237 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
238 } |
498 | 239 } else |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
240 VPUTCH(*pcStr); |
498 | 241 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
242 pcStr++; |
217 | 243 } |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
244 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
245 tmpBuf[iIndex] = 0; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
246 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
247 /* Make resulting string */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
248 pcResult = g_strdup(tmpBuf); |
217 | 249 } |
250 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
251 /* Free temporary strings */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
252 g_free(tmpFilename); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
253 g_free(tmpFilePath); |
217 | 254 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
255 return pcResult; |
217 | 256 } |