Mercurial > hg > xmms-sid
annotate src/xs_sidplay.h @ 460:9e683fb666ba
Updates
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 24 Jan 2007 22:10:00 +0000 |
parents | f277dad3180f |
children | 6963982fcbb6 |
rev | line source |
---|---|
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
373
diff
changeset
|
1 /* Here comes the really ugly code... Get all SID-tune information |
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
373
diff
changeset
|
2 * for all sub-tunes, including name, length, etc. |
76 | 3 */ |
460 | 4 t_xs_tuneinfo *TFUNCTION(gchar *pcFilename) |
76 | 5 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
6 t_xs_tuneinfo *pResult; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
7 TTUNEINFO tuneInfo; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
8 TTUNE *testTune; |
87
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
76
diff
changeset
|
9 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
10 /* Check if the tune exists and is readable */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
11 if ((testTune = new TTUNE(pcFilename)) == NULL) |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
12 return NULL; |
87
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
76
diff
changeset
|
13 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
14 if (!testTune->getStatus()) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
15 delete testTune; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
16 return NULL; |
87
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
76
diff
changeset
|
17 } |
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
76
diff
changeset
|
18 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
19 /* Get general tune information */ |
95 | 20 #ifdef _XS_SIDPLAY1_H |
445
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
21 testTune->getInfo(tuneInfo); |
95 | 22 #endif |
23 #ifdef _XS_SIDPLAY2_H | |
412
7f694e5a1493
Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
24 tuneInfo = testTune->getInfo(); |
95 | 25 #endif |
26 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
27 /* Allocate tuneinfo structure */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
28 pResult = xs_tuneinfo_new(pcFilename, |
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
373
diff
changeset
|
29 tuneInfo.songs, tuneInfo.startSong, |
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
373
diff
changeset
|
30 tuneInfo.infoString[0], tuneInfo.infoString[1], tuneInfo.infoString[2], |
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
373
diff
changeset
|
31 tuneInfo.loadAddr, tuneInfo.initAddr, tuneInfo.playAddr, |
445
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
32 tuneInfo.dataFileLen, tuneInfo.formatString, -1, -1, -1); |
87
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
76
diff
changeset
|
33 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
34 delete testTune; |
87
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
76
diff
changeset
|
35 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
230
diff
changeset
|
36 return pResult; |
87
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
76
diff
changeset
|
37 } |
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
76
diff
changeset
|
38 |
445
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
39 |
460 | 40 gboolean TFUNCTION2(t_xs_status *myStatus) |
445
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
41 { |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
42 TTUNEINFO tuneInfo; |
460 | 43 #ifdef _XS_SIDPLAY1_H |
44 t_xs_sidplay1 *myEngine; | |
45 #endif | |
46 #ifdef _XS_SIDPLAY2_H | |
47 t_xs_sidplay2 *myEngine; | |
48 #endif | |
49 | |
50 if (!myStatus || !myStatus->tuneInfo) | |
51 return FALSE; | |
445
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
52 |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
53 /* Get general tune information */ |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
54 #ifdef _XS_SIDPLAY1_H |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
55 testTune->getInfo(tuneInfo); |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
56 #endif |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
57 #ifdef _XS_SIDPLAY2_H |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
58 tuneInfo = testTune->getInfo(); |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
59 #endif |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
60 |
460 | 61 if (!tuneInfo) |
62 return FALSE; | |
63 | |
64 | |
445
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
65 /* Allocate tuneinfo structure */ |
460 | 66 pResult = xs_tuneinfo_new(->pcFilename, |
445
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
67 tuneInfo.songs, tuneInfo.startSong, |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
68 tuneInfo.infoString[0], tuneInfo.infoString[1], tuneInfo.infoString[2], |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
69 tuneInfo.loadAddr, tuneInfo.initAddr, tuneInfo.playAddr, |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
70 tuneInfo.dataFileLen, tuneInfo.formatString, |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
71 tuneInfo.sidModel, tuneInfo.songSpeed, tuneInfo.clockSpeed); |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
72 |
460 | 73 return TRUE; |
445
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
74 } |
f277dad3180f
Working on the localization and fixing up the breakage in song information
Matti Hamalainen <ccr@tnsp.org>
parents:
412
diff
changeset
|
75 |
95 | 76 /* Undefine these */ |
202 | 77 #undef TFUNCTION |
460 | 78 #undef TFUNCTION2 |
95 | 79 #undef TTUNEINFO |
80 #undef TTUNE |