Mercurial > hg > xmms-sid
annotate src/xmms-sid.cc @ 42:0f00ebab063d
Fixes
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 19 Jun 2003 23:50:01 +0000 |
parents | 1788f4ce6a44 |
children | 90cd38b28a72 |
rev | line source |
---|---|
1 | 1 /* |
5 | 2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) |
1 | 3 |
4 Main source file | |
5 | |
5 | 6 Written by Matti "ccr" Hamalainen <ccr@tnsp.org> |
1 | 7 |
8 This program is free software; you can redistribute it and/or modify | |
9 it under the terms of the GNU General Public License as published by | |
10 the Free Software Foundation; either version 2 of the License, or | |
11 (at your option) any later version. | |
12 | |
13 This program is distributed in the hope that it will be useful, | |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 GNU General Public License for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with this program; if not, write to the Free Software | |
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 */ | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
22 extern "C" { |
28 | 23 #include <pthread.h> |
24 #include <stdlib.h> | |
25 #include <string.h> | |
26 #include <stdio.h> | |
27 #include <errno.h> | |
28 #include <xmms/plugin.h> | |
29 #include <xmms/util.h> | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
30 #include <xmms/titlestring.h> |
1 | 31 #include "xmms-sid.h" |
42 | 32 #include "xs_interface.h" |
33 #include "xs_glade.h" | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
34 #include "xs_support.h" |
22 | 35 #include "xs_config.h" |
36 #include "xs_length.h" | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
37 } |
28 | 38 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
39 #ifdef HAVE_SIDPLAY1 |
1 | 40 #include <sidplay/player.h> |
41 #include <sidplay/myendian.h> | |
42 #include <sidplay/fformat.h> | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
43 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
44 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
45 #ifdef HAVE_SIDPLAY2 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
46 #include <sidplay/sidplay2.h> |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
47 #endif |
1 | 48 |
49 | |
50 /* | |
28 | 51 * Global variables |
1 | 52 */ |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
53 #ifdef HAVE_SIDPLAY1 |
1 | 54 static struct emuConfig xs_emuConf; |
55 static emuEngine xs_emuEngine; | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
56 typedef sidTune t_xs_tune; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
57 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
58 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
59 #ifdef HAVE_SIDPLAY2 |
42 | 60 static sidplay2 xs_emuEngine; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
61 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
62 |
42 | 63 static GtkWidget *xs_ctrlwin = NULL; |
1 | 64 static pthread_t xs_decode_thread; |
5 | 65 struct t_xs_cfg xs_cfg; |
66 | |
67 struct { | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
68 gboolean isError, isPlaying, allowNext; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
69 gint currSong, nSongs; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
70 t_xs_tune *currTune; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
71 gchar *currFilename; |
5 | 72 } xs_status; |
73 | |
74 pthread_mutex_t xs_mutex = PTHREAD_MUTEX_INITIALIZER; | |
1 | 75 |
42 | 76 /* |
77 * Create sub-song control window | |
78 */ | |
79 void xs_ctrlwin_open(void) | |
80 { | |
81 /* Create sub-song control window */ | |
82 if (xs_ctrlwin != NULL) | |
83 { | |
84 gdk_window_raise(xs_ctrlwin->window); | |
85 return; | |
86 } | |
87 | |
88 xs_ctrlwin = create_xs_ctrlwin(); | |
89 gtk_widget_show(xs_ctrlwin); | |
90 } | |
91 | |
1 | 92 |
93 /* | |
5 | 94 * Initialize XMMS-SID |
1 | 95 */ |
96 void xs_init(void) | |
97 { | |
5 | 98 XSDEBUG("xs_init()\n"); |
1 | 99 |
28 | 100 /* Initialize and get configuration */ |
101 memset(&xs_cfg, 0, sizeof(xs_cfg)); | |
102 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
103 xs_read_configuration(); |
28 | 104 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
105 xs_status.isError = FALSE; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
106 xs_status.isPlaying = FALSE; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
107 xs_status.nSongs = 0; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
108 xs_status.currSong = 0; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
109 xs_status.allowNext = TRUE; // Initialize to TRUE to allow first song |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
110 xs_status.currTune = NULL; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
111 xs_status.currFilename = NULL; |
28 | 112 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
113 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
114 /* Try to initialize libSIDPlay(s) */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
115 #ifdef HAVE_SIDPLAY1 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
116 if (!xs_emuEngine || !xs_emuEngine.verifyEndianess()) |
5 | 117 { |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
118 XSERR("Couldn't start SIDPlay1 emulator engine!\n"); |
5 | 119 return; |
1 | 120 } |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
121 #endif |
1 | 122 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
123 #ifdef HAVE_SIDPLAY2 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
124 #endif |
1 | 125 |
22 | 126 /* Read song-length database */ |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
127 if (xs_cfg.songlenDBEnable) |
22 | 128 if (xs_songlen_init() < 0) |
129 { | |
130 XSERR("Error initializing song-length database!\n"); | |
131 } | |
5 | 132 |
133 /* Initialize STIL structures */ | |
42 | 134 |
135 xs_ctrlwin_open(); | |
136 | |
5 | 137 // FIXME FIXME FIx ME |
1 | 138 |
139 } | |
140 | |
141 | |
142 /* | |
5 | 143 * Shut down XMMS-SID |
144 */ | |
145 void xs_close(void) | |
1 | 146 { |
5 | 147 XSDEBUG("shutting down...\n"); |
1 | 148 |
5 | 149 /* Stop playing */ |
22 | 150 xs_plugin_ip.stop(); |
1 | 151 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
152 /* Shutdown libSIDPlay(s) */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
153 #ifdef HAVE_SIDPLAY1 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
154 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
155 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
156 #ifdef HAVE_SIDPLAY2 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
157 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
158 |
28 | 159 /* Close sub-song control window */ |
160 | |
5 | 161 /* Free allocated memory */ |
22 | 162 xs_songlen_close(); |
1 | 163 |
28 | 164 // FIXME FIXME: STIL-entries |
1 | 165 } |
166 | |
167 | |
168 /* | |
28 | 169 * Check whether the given file is handled by this plugin |
1 | 170 */ |
5 | 171 gint xs_is_our_file(char *fileName) |
1 | 172 { |
5 | 173 char *pcExt; |
174 | |
175 /* Check the filename */ | |
176 if (fileName == NULL) | |
177 return FALSE; | |
178 | |
179 /* Try to detect via libSIDPlay's detection routine, if required */ | |
28 | 180 if (xs_cfg.detectMagic) |
181 { | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
182 #ifdef HAVE_SIDPLAY1 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
183 t_xs_tune *testTune = new sidTune(fileName); |
5 | 184 if (!testTune) return FALSE; |
185 if (!testTune->getStatus()) | |
186 { | |
187 delete testTune; | |
188 return FALSE; | |
189 } | |
190 | |
191 delete testTune; | |
192 return TRUE; | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
193 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
194 #ifdef HAVE_SIDPLAY2 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
195 #endif |
1 | 196 } |
197 | |
5 | 198 /* Detect just by checking filename extension */ |
199 pcExt = strrchr(fileName, '.'); | |
200 if (pcExt) | |
201 { | |
202 pcExt++; | |
203 if (!strcasecmp(pcExt, "psid")) return TRUE; | |
204 if (!strcasecmp(pcExt, "sid")) return TRUE; | |
205 if (!strcasecmp(pcExt, "dat")) return TRUE; | |
206 if (!strcasecmp(pcExt, "inf")) return TRUE; | |
207 if (!strcasecmp(pcExt, "info")) return TRUE; | |
1 | 208 } |
5 | 209 |
210 return FALSE; | |
1 | 211 } |
212 | |
213 | |
214 /* | |
28 | 215 * Main playing thread loop |
1 | 216 */ |
5 | 217 static void *xs_play_loop(void *argPointer) |
1 | 218 { |
5 | 219 /* Don't allow next song to be set yet */ |
220 pthread_mutex_lock(&xs_mutex); | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
221 xs_status.allowNext = FALSE; |
5 | 222 pthread_mutex_unlock(&xs_mutex); |
223 | |
224 | |
225 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
226 XSDEBUG("exiting thread, bye.\n"); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
227 return NULL; |
1 | 228 } |
229 | |
230 | |
231 /* | |
28 | 232 * Start playing the given file |
1 | 233 */ |
5 | 234 void xs_play_file(char *fileName) |
1 | 235 { |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
236 t_xs_tune *newTune; |
5 | 237 struct sidTuneInfo sidInf; |
238 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
239 XSDEBUG("request to load '%s'\n", fileName); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
240 |
5 | 241 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
242 /* Initialize audio output */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
243 XSDEBUG("opening audio output plugin...\n"); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
244 if (!xs_plugin_ip.output->open_audio( |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
245 ((xs_cfg.fmtBitsPerSample == 16) ? FMT_S16_NE : FMT_U8), xs_cfg.fmtFrequency, |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
246 ((xs_cfg.fmtChannels == XS_CHN_MONO) ? 1 : 2))) |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
247 { |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
248 XSERR("Couldn't open audio output plugin!\n"); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
249 delete newTune; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
250 return; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
251 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
252 |
1 | 253 |
5 | 254 /* Try to get the tune */ |
255 newTune = new sidTune(fileName); | |
256 if (newTune == NULL) return; | |
257 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
258 XSDEBUG("tune ok, configuring SIDPlay engine\n"); |
1 | 259 |
28 | 260 |
5 | 261 /* Get current configuration */ |
262 xs_emuEngine.getConfig(xs_emuConf); | |
263 | |
264 | |
265 /* Configure channels and stuff */ | |
266 switch (xs_cfg.fmtChannels) { | |
1 | 267 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
268 case XS_CHN_AUTOPAN: |
1 | 269 xs_emuConf.channels = SIDEMU_STEREO; |
270 xs_emuConf.autoPanning = SIDEMU_CENTEREDAUTOPANNING; | |
271 xs_emuConf.volumeControl = SIDEMU_FULLPANNING; | |
272 break; | |
273 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
274 case XS_CHN_STEREO: |
1 | 275 xs_emuConf.channels = SIDEMU_STEREO; |
276 xs_emuConf.autoPanning = SIDEMU_NONE; | |
277 xs_emuConf.volumeControl = SIDEMU_NONE; | |
278 break; | |
279 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
280 case XS_CHN_MONO: |
1 | 281 xs_emuConf.channels = SIDEMU_MONO; |
282 xs_emuConf.autoPanning = SIDEMU_NONE; | |
283 xs_emuConf.volumeControl = SIDEMU_NONE; | |
284 break; | |
285 | |
5 | 286 default: |
287 XSERR("Internal: Invalid channels setting. Possibly corrupted configuration file.\n"); | |
288 delete newTune; | |
289 return; | |
290 } | |
1 | 291 |
28 | 292 |
5 | 293 /* Memory mode settings */ |
294 switch (xs_cfg.memoryMode) { | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
295 case XS_MPU_BANK_SWITCHING: |
1 | 296 xs_emuConf.memoryMode = MPU_BANK_SWITCHING; |
297 break; | |
298 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
299 case XS_MPU_TRANSPARENT_ROM: |
1 | 300 xs_emuConf.memoryMode = MPU_TRANSPARENT_ROM; |
301 break; | |
302 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
303 case XS_MPU_PLAYSID_ENVIRONMENT: |
1 | 304 xs_emuConf.memoryMode = MPU_PLAYSID_ENVIRONMENT; |
305 break; | |
306 | |
5 | 307 default: |
308 XSERR("Internal: Invalid memoryMode setting. Possibly corrupted configuration file.\n"); | |
309 delete newTune; | |
310 return; | |
311 } | |
1 | 312 |
313 | |
5 | 314 /* Clockspeed settings */ |
315 switch (xs_cfg.clockSpeed) { | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
316 case XS_CLOCK_PAL: |
1 | 317 xs_emuConf.clockSpeed = SIDTUNE_CLOCK_PAL; |
318 break; | |
319 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
320 case XS_CLOCK_NTSC: |
1 | 321 xs_emuConf.clockSpeed = SIDTUNE_CLOCK_NTSC; |
322 break; | |
323 | |
5 | 324 default: |
325 XSERR("Internal: Invalid clockSpeed setting. Possibly corrupted configuration file.\n"); | |
326 delete newTune; | |
327 return; | |
328 } | |
329 | |
330 | |
331 /* Configure rest of the emulation */ | |
28 | 332 xs_emuConf.bitsPerSample = xs_cfg.fmtBitsPerSample; |
333 xs_emuConf.frequency = xs_cfg.fmtFrequency; | |
334 xs_emuConf.sampleFormat = SIDEMU_SIGNED_PCM; | |
335 xs_emuConf.mos8580 = xs_cfg.mos8580; | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
336 xs_emuConf.emulateFilter = xs_cfg.emulateFilters; |
28 | 337 xs_emuConf.filterFs = xs_cfg.filterFs; |
338 xs_emuConf.filterFm = xs_cfg.filterFm; | |
339 xs_emuConf.filterFt = xs_cfg.filterFt; | |
5 | 340 |
341 XSDEBUG("configuring engine..\n"); | |
342 | |
28 | 343 |
5 | 344 /* Now set the emulator configuration */ |
345 xs_emuEngine.setConfig(xs_emuConf); | |
346 newTune->getInfo(sidInf); | |
347 | |
28 | 348 |
349 /* Initialize status information */ | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
350 XSDEBUG("initializing and starting playing thread!\n"); |
28 | 351 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
352 xs_status.isError = FALSE; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
353 xs_status.isPlaying = TRUE; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
354 xs_status.allowNext = TRUE; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
355 xs_status.currSong = sidInf.startSong; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
356 xs_status.nSongs = sidInf.songs; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
357 xs_status.currTune = newTune; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
358 |
5 | 359 |
360 /* Start the playing thread! */ | |
361 if (pthread_create(&xs_decode_thread, NULL, xs_play_loop, NULL) < 0) | |
362 { | |
363 XSERR("Couldn't start playing thread! Possible reason reported by system: %s\n", strerror(errno)); | |
364 delete newTune; | |
1 | 365 } |
366 | |
5 | 367 /* Exit */ |
1 | 368 } |
369 | |
370 | |
371 /* | |
5 | 372 * Stop playing |
1 | 373 */ |
374 void xs_stop(void) | |
375 { | |
5 | 376 /* If playing, stop. */ |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
377 XSDEBUG("request to stop.\n"); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
378 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
379 if (xs_status.isPlaying) |
1 | 380 { |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
381 XSDEBUG("stopping...\n"); |
5 | 382 pthread_mutex_lock(&xs_mutex); |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
383 xs_status.isPlaying = 0; |
5 | 384 pthread_mutex_unlock(&xs_mutex); |
385 | |
386 pthread_join(xs_decode_thread, NULL); | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
387 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
388 xs_plugin_ip.output->close_audio(); |
1 | 389 } |
390 } | |
391 | |
392 | |
393 /* | |
5 | 394 * Pause the playing |
1 | 395 */ |
5 | 396 void xs_pause(short pauseState) |
1 | 397 { |
24 | 398 xs_plugin_ip.output->pause(pauseState); |
1 | 399 } |
400 | |
401 | |
402 /* | |
5 | 403 * Set the time-seek position |
404 * (the playing thread will do the "seeking" aka song-change) | |
1 | 405 */ |
5 | 406 void xs_seek(int iTime) |
1 | 407 { |
5 | 408 #ifdef HAVE_SONG_POSITION |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
409 pthread_mutex_lock(&xs_mutex); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
410 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
411 if ((iTime > 0) && (iTime <= xs_status.nSongs) && xs_status.isPlaying) |
5 | 412 { |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
413 xs_status.currSong = iTime; |
1 | 414 } |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
415 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
416 pthread_mutex_unlock(&xs_mutex); |
5 | 417 #endif |
1 | 418 } |
419 | |
420 | |
421 /* | |
5 | 422 * Return the playing "position/time" |
1 | 423 */ |
424 int xs_get_time(void) | |
425 { | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
426 pthread_mutex_lock(&xs_mutex); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
427 if (xs_status.isError) |
5 | 428 return -2; |
429 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
430 if (!xs_status.isPlaying) |
5 | 431 return -1; |
1 | 432 |
5 | 433 #ifdef HAVE_SONG_POSITION |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
434 set_song_position(xs_status.currSong, 1, xs_status.nSongs); |
5 | 435 #endif |
1 | 436 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
437 pthread_mutex_unlock(&xs_mutex); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
438 |
24 | 439 return xs_plugin_ip.output->output_time(); |
1 | 440 } |
441 | |
442 | |
5 | 443 /* |
444 * Return song information | |
445 */ | |
446 void xs_get_song_info(char *songFilename, char **songTitle, int *songLength) | |
447 { | |
448 struct sidTuneInfo sidInf; | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
449 t_xs_tune *testTune = new sidTune(songFilename); |
5 | 450 |
451 /* Check if the tune exists and is readable */ | |
452 if (!testTune) return; | |
453 if (!testTune->getStatus()) | |
454 { | |
455 delete testTune; | |
456 return; | |
457 } | |
458 | |
459 /* Get general tune information */ | |
460 testTune->getInfo(sidInf); | |
461 delete testTune; | |
462 | |
463 /* Get titlestring */ | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
464 *songTitle = NULL; |
5 | 465 |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
466 /* Get song length (in milliseconds), negative if no known length */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
467 *songLength = xs_songlen_get(songFilename, sidInf.startSong) * 1000; |
5 | 468 } |
469 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
470 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
471 /* |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
472 * Create the SID-tune description string from the tune's information |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
473 * formatted by the user-specified format-string. |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
474 */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
475 gchar *xs_filetitle_get(gchar *pcFilename, void *pfInfo, gint iSubTune) |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
476 { |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
477 gint i, j, iLength; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
478 gchar *pcResult; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
479 struct sidTuneInfo *finfo = (struct sidTuneInfo *) pfInfo; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
480 #ifdef HAVE_XMMSEXTRA |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
481 TitleInput *ptInput; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
482 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
483 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
484 // FIXME FIXME: get STIL-info |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
485 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
486 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
487 #ifdef HAVE_XMMSEXTRA |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
488 /* Check if the titles are overridden or not */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
489 if (!xs_cfg.titleOverride) |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
490 { |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
491 /* Use generic XMMS titles */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
492 /* XMMS_NEW_TITLEINPUT(ptInput); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
493 * We duplicate and add typecast to the code here due to XMMS's braindead headers |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
494 */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
495 ptInput = (TitleInput *) g_malloc0(sizeof(TitleInput)); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
496 ptInput->__size = XMMS_TITLEINPUT_SIZE; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
497 ptInput->__version = XMMS_TITLEINPUT_VERSION; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
498 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
499 /* Create the input fields */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
500 ptInput->file_name = pcFilename; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
501 ptInput->file_ext = pcFilename; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
502 ptInput->file_path = pcFilename; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
503 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
504 ptInput->track_name = finfo->nameString; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
505 ptInput->track_number = iSubTune; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
506 ptInput->album_name = NULL; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
507 ptInput->performer = finfo->authorString; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
508 xs_strcalloc(&ptInput->date, ""); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
509 ptInput->year = 0; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
510 xs_strcalloc(&ptInput->genre, "SID-tune"); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
511 ptInput->comment = finfo->copyrightString; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
512 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
513 /* Create the string */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
514 pcResult = xmms_get_titlestring(xmms_get_gentitle_format(), ptInput); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
515 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
516 /* Dispose all allocated memory */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
517 g_free(ptInput->date); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
518 g_free(ptInput->genre); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
519 g_free(ptInput); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
520 } else { |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
521 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
522 /* Check the info strings */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
523 if (finfo->numberOfInfoStrings != 3) |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
524 { |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
525 if (finfo->numberOfInfoStrings < 1) |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
526 return 0; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
527 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
528 return g_strdup(finfo->infoString[0]); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
529 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
530 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
531 /* Check the format-string for NULL */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
532 if (xs_cfg.titleFormat == NULL) |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
533 return g_strdup_printf("%s - %s", finfo->nameString, finfo->authorString); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
534 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
535 /* Construct the final result info */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
536 for (j = i = 0; i < strlen(xs_cfg.titleFormat); i++) |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
537 { |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
538 if (xs_cfg.titleFormat[i] == '%') |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
539 { |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
540 switch (xs_cfg.titleFormat[++i]) { |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
541 case '1': |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
542 xs_strpcat(&pcResult, &j, finfo->authorString); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
543 break; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
544 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
545 case '2': |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
546 xs_strpcat(&pcResult, &j, finfo->nameString); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
547 break; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
548 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
549 case '3': |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
550 xs_strpcat(&pcResult, &j, finfo->copyrightString); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
551 break; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
552 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
553 case '4': |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
554 xs_strpcat(&pcResult, &j, finfo->formatString); |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
555 break; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
556 } /* case */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
557 } else |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
558 pcResult[j++] = xs_cfg.titleFormat[i]; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
559 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
560 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
561 pcResult[j] = 0; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
562 #ifdef HAVE_XMMSEXTRA |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
563 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
564 #endif |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
565 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
566 return pcResult; |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
567 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
568 |