Mercurial > audlegacy-plugins
annotate src/sid/xs_sidplay2.cc @ 1699:11135fc0e183
Fixed WavPack plugin for the new API.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 11 Sep 2007 02:10:49 +0300 |
parents | 22f1948c9c28 |
children | a5f1c47cee0c |
rev | line source |
---|---|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1 /* |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
3 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
4 libSIDPlay v2 support |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
9 This program is free software; you can redistribute it and/or modify |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
10 it under the terms of the GNU General Public License as published by |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
11 the Free Software Foundation; either version 2 of the License, or |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
12 (at your option) any later version. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
13 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
14 This program is distributed in the hope that it will be useful, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
17 GNU General Public License for more details. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
18 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
19 You should have received a copy of the GNU General Public License along |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
20 with this program; if not, write to the Free Software Foundation, Inc., |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
22 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
23 #include "xmms-sid.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
24 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
25 #ifdef HAVE_SIDPLAY2 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
26 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
27 #include <stdio.h> |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
28 #include "xs_sidplay2.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 #include "xs_config.h" |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
30 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
31 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
32 #include <sidplay/sidplay2.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
33 #ifdef HAVE_RESID_BUILDER |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
34 #include <sidplay/builders/resid.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
35 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
36 #ifdef HAVE_HARDSID_BUILDER |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 #include <sidplay/builders/hardsid.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
38 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
39 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
40 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
41 typedef struct { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
42 sidplay2 *currEng; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
43 sidbuilder *currBuilder; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 sid2_config_t currConfig; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
45 SidTune *currTune; |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
46 guint8 *buf; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
47 size_t bufSize; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
48 } t_xs_sidplay2; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
50 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
51 /* We need to 'export' all this pseudo-C++ crap */ |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
52 extern "C" { |
462
c488d191b528
[svn] - modified the sid plugin to use vfs, for both libsidplay v1 and v2; still requires testing and some work in the is_our_file part
giacomo
parents:
12
diff
changeset
|
53 |
c488d191b528
[svn] - modified the sid plugin to use vfs, for both libsidplay v1 and v2; still requires testing and some work in the is_our_file part
giacomo
parents:
12
diff
changeset
|
54 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
55 /* Return song information |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
56 */ |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
57 #define TFUNCTION xs_sidplay2_getinfo |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
58 #define TFUNCTION2 xs_sidplay2_updateinfo |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
59 #define TTUNEINFO SidTuneInfo |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
60 #define TTUNE SidTune |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
61 #define TENGINE t_xs_sidplay2 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
62 #include "xs_sidplay.h" |
462
c488d191b528
[svn] - modified the sid plugin to use vfs, for both libsidplay v1 and v2; still requires testing and some work in the is_our_file part
giacomo
parents:
12
diff
changeset
|
63 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
64 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
65 /* Check if we can play the given file |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 */ |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
67 gboolean xs_sidplay2_probe(t_xs_file *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
68 { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
69 gchar tmpBuf[4]; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
70 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
71 if (!f) return FALSE; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
72 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
73 if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
74 return FALSE; |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
75 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
76 if (!strncmp(tmpBuf, "PSID", 4) || !strncmp(tmpBuf, "RSID", 4)) |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
77 return TRUE; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
78 else |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
79 return FALSE; |
463
1e5cb7a00cb0
[svn] - added is_our_file_from_vfs function to sid, for both libsidplay v1 and v2
giacomo
parents:
462
diff
changeset
|
80 } |
1e5cb7a00cb0
[svn] - added is_our_file_from_vfs function to sid, for both libsidplay v1 and v2
giacomo
parents:
462
diff
changeset
|
81 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
82 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
83 /* Initialize SIDPlay2 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
84 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
85 gboolean xs_sidplay2_init(t_xs_status * myStatus) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
86 { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
87 gint tmpFreq, i; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
88 t_xs_sidplay2 *myEngine; |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
89 sid_filter_t tmpFilter; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
90 t_xs_sid2_filter *f; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
91 assert(myStatus); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
92 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
93 /* Allocate internal structures */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
94 myEngine = (t_xs_sidplay2 *) g_malloc0(sizeof(t_xs_sidplay2)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
95 myStatus->sidEngine = myEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
96 if (!myEngine) return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
97 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
98 /* Initialize the engine */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
99 myEngine->currEng = new sidplay2; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
100 if (!myEngine->currEng) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
101 xs_error(_("[SIDPlay2] Could not initialize emulation engine.\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
102 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
103 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
104 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
105 /* Get current configuration */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
106 myEngine->currConfig = myEngine->currEng->config(); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
107 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
108 /* Configure channels and stuff */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
109 switch (myStatus->audioChannels) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
110 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
111 case XS_CHN_AUTOPAN: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
112 myEngine->currConfig.playback = sid2_stereo; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
113 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
114 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
115 case XS_CHN_STEREO: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
116 myEngine->currConfig.playback = sid2_stereo; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
118 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
119 case XS_CHN_MONO: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
120 default: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
121 myEngine->currConfig.playback = sid2_mono; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
122 myStatus->audioChannels = XS_CHN_MONO; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
123 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
124 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
125 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
126 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
127 /* Memory mode settings */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
128 switch (xs_cfg.memoryMode) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
129 case XS_MPU_BANK_SWITCHING: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
130 myEngine->currConfig.environment = sid2_envBS; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
131 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
132 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
133 case XS_MPU_TRANSPARENT_ROM: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
134 myEngine->currConfig.environment = sid2_envTP; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
135 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
136 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
137 case XS_MPU_PLAYSID_ENVIRONMENT: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
138 myEngine->currConfig.environment = sid2_envPS; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
139 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
140 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
141 case XS_MPU_REAL: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
142 default: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
143 myEngine->currConfig.environment = sid2_envR; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
144 xs_cfg.memoryMode = XS_MPU_REAL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
145 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
146 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
147 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
148 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
149 /* Audio parameters sanity checking and setup */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
150 myEngine->currConfig.precision = myStatus->audioBitsPerSample; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
151 tmpFreq = myStatus->audioFrequency; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
152 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
153 if (myStatus->oversampleEnable) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
154 tmpFreq = (tmpFreq * myStatus->oversampleFactor); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
155 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
156 myEngine->currConfig.frequency = tmpFreq; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
157 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
158 switch (myStatus->audioBitsPerSample) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
159 case XS_RES_8BIT: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
160 myStatus->audioFormat = FMT_U8; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
161 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
162 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
163 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
164 case XS_RES_16BIT: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
165 default: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
166 switch (myStatus->audioFormat) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
167 case FMT_U16_LE: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
168 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
169 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
170 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
171 case FMT_U16_BE: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
172 myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
173 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
174 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
175 case FMT_U16_NE: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
176 #ifdef WORDS_BIGENDIAN |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
177 myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
178 #else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
179 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
180 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
181 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
182 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
183 case FMT_S16_LE: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
184 myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
185 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
186 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
187 case FMT_S16_BE: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
188 myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
189 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
190 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
191 default: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
192 myStatus->audioFormat = FMT_S16_NE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
193 #ifdef WORDS_BIGENDIAN |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
194 myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
195 #else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
196 myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
197 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
198 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
199 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
200 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
201 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
202 } |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
203 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
204 /* Convert filter */ |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
205 f = &(xs_cfg.sid2Filter); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
206 XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints); |
1553
22f1948c9c28
Merge some changes from XMMS-SID
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
207 if (f->npoints > XS_SIDPLAY2_NFPOINTS) { |
22f1948c9c28
Merge some changes from XMMS-SID
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
208 xs_error(_("[SIDPlay2] Invalid number of filter curve points (%d > %d)\n"), |
22f1948c9c28
Merge some changes from XMMS-SID
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
209 f->npoints, XS_SIDPLAY2_NFPOINTS); |
22f1948c9c28
Merge some changes from XMMS-SID
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
210 f->npoints = XS_SIDPLAY2_NFPOINTS; |
22f1948c9c28
Merge some changes from XMMS-SID
Matti Hamalainen <ccr@tnsp.org>
parents:
735
diff
changeset
|
211 } |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
212 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
213 tmpFilter.points = f->npoints; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
214 for (i = 0; i < f->npoints; i++) { |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
215 tmpFilter.cutoff[i][0] = f->points[i].x; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
216 tmpFilter.cutoff[i][1] = f->points[i].y; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
217 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
218 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
219 /* Initialize builder object */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
220 XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
221 #ifdef HAVE_RESID_BUILDER |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
222 if (xs_cfg.sid2Builder == XS_BLD_RESID) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
223 ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder"); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
224 myEngine->currBuilder = (sidbuilder *) rs; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
225 if (rs) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
226 /* Builder object created, initialize it */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
227 rs->create((myEngine->currEng->info()).maxsids); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
228 if (!*rs) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
229 xs_error(_("reSID->create() failed.\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
230 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
231 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
232 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
233 rs->filter(xs_cfg.emulateFilters); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
234 if (!*rs) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
235 xs_error(_("reSID->filter(%d) failed.\n"), xs_cfg.emulateFilters); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
236 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
237 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
238 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
239 // FIXME FIX ME: support other configurable parameters ... |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
240 // ... WHEN/IF resid-builder+libsidplay2 gets fixed |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
241 rs->sampling(tmpFreq); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
242 if (!*rs) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
243 xs_error(_("reSID->sampling(%d) failed.\n"), tmpFreq); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
244 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
245 } |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
246 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
247 if (tmpFilter.points > 0) |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
248 rs->filter((sid_filter_t *) &tmpFilter); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
249 else |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
250 rs->filter((sid_filter_t *) NULL); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
251 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
252 if (!*rs) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
253 xs_error(_("reSID->filter(NULL) failed.\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
254 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
255 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
256 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
257 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
258 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
259 #ifdef HAVE_HARDSID_BUILDER |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
260 if (xs_cfg.sid2Builder == XS_BLD_HARDSID) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
261 HardSIDBuilder *hs = new HardSIDBuilder("HardSID builder"); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
262 myEngine->currBuilder = (sidbuilder *) hs; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
263 if (hs) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
264 /* Builder object created, initialize it */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
265 hs->create((myEngine->currEng->info()).maxsids); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
266 if (!*hs) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
267 xs_error(_("hardSID->create() failed.\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
268 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
269 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
270 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
271 hs->filter(xs_cfg.emulateFilters); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
272 if (!*hs) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
273 xs_error(_("hardSID->filter(%d) failed.\n"), xs_cfg.emulateFilters); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
274 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
275 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
276 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
277 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
278 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
279 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
280 if (!myEngine->currBuilder) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
281 xs_error(_("[SIDPlay2] Could not initialize SIDBuilder object.\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
282 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
283 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
284 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
285 XSDEBUG("%s\n", myEngine->currBuilder->credits()); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
286 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
287 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
288 /* Clockspeed settings */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
289 switch (xs_cfg.clockSpeed) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
290 case XS_CLOCK_NTSC: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
291 myEngine->currConfig.clockDefault = SID2_CLOCK_NTSC; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
292 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
293 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
294 default: |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
295 xs_error(_("[SIDPlay2] Invalid clockSpeed=%d, falling back to PAL.\n"), |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
296 xs_cfg.clockSpeed); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
297 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
298 case XS_CLOCK_PAL: |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
299 myEngine->currConfig.clockDefault = SID2_CLOCK_PAL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
300 xs_cfg.clockSpeed = XS_CLOCK_PAL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
301 break; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
302 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
303 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
304 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
305 /* Configure rest of the emulation */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
306 myEngine->currConfig.sidEmulation = myEngine->currBuilder; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
307 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
308 if (xs_cfg.forceSpeed) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
309 myEngine->currConfig.clockForced = true; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
310 myEngine->currConfig.clockSpeed = myEngine->currConfig.clockDefault; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
311 } else { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
312 myEngine->currConfig.clockForced = false; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
313 myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
314 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
315 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
316 if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION)) |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
317 myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
318 else { |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
319 xs_error(_("Invalid sid2OptLevel=%d, falling back to %d.\n"), |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
320 xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
321 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
322 xs_cfg.sid2OptLevel = |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
323 myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
324 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
325 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
326 if (xs_cfg.mos8580) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
327 myEngine->currConfig.sidDefault = SID2_MOS8580; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
328 else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
329 myEngine->currConfig.sidDefault = SID2_MOS6581; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
330 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
331 if (xs_cfg.forceModel) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
332 myEngine->currConfig.sidModel = myEngine->currConfig.sidDefault; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
333 else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
334 myEngine->currConfig.sidModel = SID2_MODEL_CORRECT; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
335 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
336 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
337 /* XXX: Should this be configurable? libSIDPlay1 does not support it, though */ |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
338 myEngine->currConfig.sidSamples = TRUE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
339 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
340 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
341 /* Now set the emulator configuration */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
342 if (myEngine->currEng->config(myEngine->currConfig) < 0) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
343 xs_error(_("[SIDPlay2] Emulator engine configuration failed!\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
344 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
345 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
346 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
347 /* Create the sidtune */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
348 myEngine->currTune = new SidTune(0); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
349 if (!myEngine->currTune) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
350 xs_error(_("[SIDPlay2] Could not initialize SIDTune object.\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
351 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
352 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
353 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
354 return TRUE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
355 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
356 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
357 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
358 /* Close SIDPlay2 engine |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
359 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
360 void xs_sidplay2_close(t_xs_status * myStatus) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
361 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
362 t_xs_sidplay2 *myEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
363 assert(myStatus); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
364 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
365 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
366 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
367 /* Free internals */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
368 if (myEngine->currBuilder) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
369 delete myEngine->currBuilder; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
370 myEngine->currBuilder = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
371 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
372 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
373 if (myEngine->currEng) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
374 delete myEngine->currEng; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
375 myEngine->currEng = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
376 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
377 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
378 if (myEngine->currTune) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
379 delete myEngine->currTune; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
380 myEngine->currTune = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
381 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
382 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
383 xs_sidplay2_delete(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
384 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
385 g_free(myEngine); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
386 myStatus->sidEngine = NULL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
387 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
388 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
389 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
390 /* Initialize current song and sub-tune |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
391 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
392 gboolean xs_sidplay2_initsong(t_xs_status * myStatus) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
393 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
394 t_xs_sidplay2 *myEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
395 assert(myStatus); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
396 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
397 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
398 if (!myEngine) return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
399 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
400 if (!myEngine->currTune->selectSong(myStatus->currSong)) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
401 xs_error(_("[SIDPlay2] currTune->selectSong() failed\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
402 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
403 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
404 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
405 if (myEngine->currEng->load(myEngine->currTune) < 0) { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
406 xs_error(_("[SIDPlay2] currEng->load() failed\n")); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
407 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
408 } |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
409 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
410 myStatus->isInitialized = TRUE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
411 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
412 return TRUE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
413 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
414 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
415 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
416 /* Emulate and render audio data to given buffer |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
417 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
418 guint xs_sidplay2_fillbuffer(t_xs_status * myStatus, gchar * audioBuffer, guint audioBufSize) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
419 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
420 t_xs_sidplay2 *myEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
421 assert(myStatus); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
422 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
423 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
424 if (!myEngine) return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
425 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
426 return myEngine->currEng->play(audioBuffer, audioBufSize); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
427 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
428 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
429 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
430 /* Load a given SID-tune file |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
431 */ |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
432 gboolean xs_sidplay2_load(t_xs_status * myStatus, gchar * pcFilename) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
433 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
434 t_xs_sidplay2 *myEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
435 assert(myStatus); |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
436 myStatus->isInitialized = FALSE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
437 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
438 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
439 if (!myEngine) return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
440 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
441 /* Try to get the tune */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
442 if (!pcFilename) return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
443 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
444 if (xs_fload_buffer(pcFilename, &(myEngine->buf), &(myEngine->bufSize)) != 0) |
462
c488d191b528
[svn] - modified the sid plugin to use vfs, for both libsidplay v1 and v2; still requires testing and some work in the is_our_file part
giacomo
parents:
12
diff
changeset
|
445 return FALSE; |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
446 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
447 if (!myEngine->currTune->read(myEngine->buf, myEngine->bufSize)) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
448 return FALSE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
449 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
450 return TRUE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
451 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
452 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
453 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
454 /* Delete INTERNAL information |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
455 */ |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
456 void xs_sidplay2_delete(t_xs_status * myStatus) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
457 { |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
458 t_xs_sidplay2 *myEngine; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
459 assert(myStatus); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
460 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
461 myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
462 if (!myEngine) return; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
463 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
464 g_free(myEngine->buf); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
465 myEngine->buf = NULL; |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
466 myEngine->bufSize = 0; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
467 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
468 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
469 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
470 /* Hardware backend flushing |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
471 */ |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
472 void xs_sidplay2_flush(t_xs_status * myStatus) |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
473 { |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
474 assert(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
475 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
476 #ifdef HAVE_HARDSID_BUILDER |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
477 #ifdef HSID_SID2_COM |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
478 IfPtr<HardSIDBuilder> hs(myStatus->currBuilder); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
479 if (hs) |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
480 hs->flush(); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
481 #else |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
482 if (xs_cfg.sid2Builder == XS_BLD_HARDSID) |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
483 ((HardSIDBuilder *) myStatus->currBuilder)->flush(); |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
484 #endif |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
485 #endif |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
486 } |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
487 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
488 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
489 } /* extern "C" */ |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
490 #endif /* HAVE_SIDPLAY2 */ |