Mercurial > audlegacy-plugins
annotate src/sid/xs_sidplay2.cc @ 2623:02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
only the relevant code changes, the -plugins configure script needs to be
adapted to make it actually used.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 22 May 2008 12:32:41 +0300 |
parents | 1223e8510d8a |
children | 45ef6d7c0174 |
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> |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
33 #ifdef HAVE_SIDPLAY2_COMI |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
34 # include <sidplay/sidlazyiptr.h> |
0
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 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
38 class xs_sidplay2_t { |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
39 public: |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
40 #ifdef HAVE_SIDPLAY2_COMI |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
41 SidIPtr<ISidplay2> currEng; |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
42 SidLazyIPtr<ISidUnknown> currBuilder; |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
43 #else |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
44 sidplay2 *currEng; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
45 sidbuilder *currBuilder; |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
46 #endif |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
47 sid2_config_t currConfig; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
48 SidTune *currTune; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
49 guint8 *buf; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
50 size_t bufSize; |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
51 |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
52 xs_sidplay2_t(void); |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
53 virtual ~xs_sidplay2_t(void) { ; } |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
54 }; |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
55 |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
56 |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
57 #ifdef HAVE_RESID_BUILDER |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
58 # include <sidplay/builders/resid.h> |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
59 #endif |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
60 #ifdef HAVE_HARDSID_BUILDER |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
61 # include <sidplay/builders/hardsid.h> |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
62 #endif |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
63 |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
64 |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
65 xs_sidplay2_t::xs_sidplay2_t(void) |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
66 #ifdef HAVE_SIDPLAY2_COMI |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
67 :currEng(sidplay2::create()) |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
68 #else |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
69 :currEng(NULL) |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
70 #endif |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
71 { |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
72 buf = NULL; |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
73 bufSize = 0; |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
74 currTune = NULL; |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
75 currBuilder = NULL; |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
76 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
77 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
78 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
79 /* 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
|
80 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
|
81 |
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
|
82 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
83 /* Return song information |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
84 */ |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
85 #define TFUNCTION xs_sidplay2_getinfo |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
86 #define TFUNCTION2 xs_sidplay2_updateinfo |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
87 #define TTUNEINFO SidTuneInfo |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
88 #define TTUNE SidTune |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
89 #define TENGINE xs_sidplay2_t |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
90 #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
|
91 |
0
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 /* Check if we can play the given file |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
94 */ |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
2478
diff
changeset
|
95 gboolean xs_sidplay2_probe(xs_file_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
96 { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
97 gchar tmpBuf[4]; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
98 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
99 if (!f) return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
100 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
101 if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
102 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
103 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
104 if (!strncmp(tmpBuf, "PSID", 4) || !strncmp(tmpBuf, "RSID", 4)) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
105 return TRUE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
106 else |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
107 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
|
108 } |
1e5cb7a00cb0
[svn] - added is_our_file_from_vfs function to sid, for both libsidplay v1 and v2
giacomo
parents:
462
diff
changeset
|
109 |
0
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 /* Initialize SIDPlay2 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
112 */ |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
2478
diff
changeset
|
113 gboolean xs_sidplay2_init(xs_status_t * myStatus) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
114 { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
115 gint tmpFreq, i; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
116 xs_sidplay2_t *myEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
117 sid_filter_t tmpFilter; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
118 t_xs_sid2_filter *f; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
119 assert(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
120 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
121 /* Allocate internal structures */ |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
122 myEngine = new xs_sidplay2_t(); |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
123 myStatus->sidEngine = myEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
124 if (!myEngine) return FALSE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
125 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
126 /* Initialize the engine */ |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
127 #ifndef HAVE_SIDPLAY2_COMI |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
128 myEngine->currEng = new sidplay2; |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
129 #endif |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
130 if (!myEngine->currEng) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
131 xs_error("[SIDPlay2] Could not initialize emulation engine.\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
132 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
133 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
134 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
135 /* Get current configuration */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
136 myEngine->currConfig = myEngine->currEng->config(); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
137 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
138 /* Configure channels and stuff */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
139 switch (myStatus->audioChannels) { |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
140 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
141 case XS_CHN_AUTOPAN: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
142 myEngine->currConfig.playback = sid2_stereo; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
143 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
144 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
145 case XS_CHN_STEREO: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
146 myEngine->currConfig.playback = sid2_stereo; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
147 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
148 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
149 case XS_CHN_MONO: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
150 default: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
151 myEngine->currConfig.playback = sid2_mono; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
152 myStatus->audioChannels = XS_CHN_MONO; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
153 break; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
154 } |
0
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 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
157 /* Memory mode settings */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
158 switch (xs_cfg.memoryMode) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
159 case XS_MPU_BANK_SWITCHING: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
160 myEngine->currConfig.environment = sid2_envBS; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
161 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
162 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
163 case XS_MPU_TRANSPARENT_ROM: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
164 myEngine->currConfig.environment = sid2_envTP; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
165 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
166 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
167 case XS_MPU_PLAYSID_ENVIRONMENT: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
168 myEngine->currConfig.environment = sid2_envPS; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
169 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
170 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
171 case XS_MPU_REAL: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
172 default: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
173 myEngine->currConfig.environment = sid2_envR; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
174 xs_cfg.memoryMode = XS_MPU_REAL; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
175 break; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
176 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
177 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
178 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
179 /* Audio parameters sanity checking and setup */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
180 myEngine->currConfig.precision = myStatus->audioBitsPerSample; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
181 tmpFreq = myStatus->audioFrequency; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
182 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
183 if (myStatus->oversampleEnable) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
184 tmpFreq = (tmpFreq * myStatus->oversampleFactor); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
185 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
186 myEngine->currConfig.frequency = tmpFreq; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
187 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
188 switch (myStatus->audioBitsPerSample) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
189 case XS_RES_8BIT: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
190 myStatus->audioFormat = FMT_U8; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
191 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
192 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
193 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
194 case XS_RES_16BIT: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
195 default: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
196 switch (myStatus->audioFormat) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
197 case FMT_U16_LE: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
198 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
199 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
200 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
201 case FMT_U16_BE: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
202 myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
203 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
204 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
205 case FMT_U16_NE: |
2475
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
206 #if G_BYTE_ORDER == G_BIG_ENDIAN |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
207 myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
208 #else |
2475
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
209 #if G_BYTE_ORDER == G_LITTLE_ENDIAN |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
210 myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED; |
2475
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
211 #else |
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
212 #error Unsupported endianess! |
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
213 #endif |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
214 #endif |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
215 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
216 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
217 case FMT_S16_LE: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
218 myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
219 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
220 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
221 case FMT_S16_BE: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
222 myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
223 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
224 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
225 default: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
226 myStatus->audioFormat = FMT_S16_NE; |
2475
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
227 #if G_BYTE_ORDER == G_BIG_ENDIAN |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
228 myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
229 #else |
2475
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
230 #if G_BYTE_ORDER == G_LITTLE_ENDIAN |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
231 myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED; |
2475
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
232 #else |
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
233 #error Unsupported endianess! |
a5f1c47cee0c
Use Glib endianess macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1553
diff
changeset
|
234 #endif |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
235 #endif |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
236 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
237 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
238 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
239 break; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
240 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
241 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
242 /* Convert filter */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
243 f = &(xs_cfg.sid2Filter); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
244 XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
245 if (f->npoints > XS_SIDPLAY2_NFPOINTS) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
246 xs_error("[SIDPlay2] Invalid number of filter curve points (%d > %d)\n", |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
247 f->npoints, XS_SIDPLAY2_NFPOINTS); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
248 f->npoints = XS_SIDPLAY2_NFPOINTS; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
249 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
250 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
251 tmpFilter.points = f->npoints; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
252 for (i = 0; i < f->npoints; i++) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
253 tmpFilter.cutoff[i][0] = f->points[i].x; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
254 tmpFilter.cutoff[i][1] = f->points[i].y; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
255 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
256 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
257 /* Initialize builder object */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
258 XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
259 #ifdef HAVE_RESID_BUILDER |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
260 if (xs_cfg.sid2Builder == XS_BLD_RESID) { |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
261 #ifdef HAVE_SIDPLAY2_COMI |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
262 myEngine->currBuilder = ReSIDBuilderCreate(""); |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
263 SidLazyIPtr<IReSIDBuilder> rs(myEngine->currBuilder); |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
264 if (rs) { |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
265 myEngine->currConfig.sidEmulation = rs->iaggregate(); |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
266 #else |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
267 ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
268 myEngine->currBuilder = (sidbuilder *) rs; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
269 if (rs) { |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
270 #endif |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
271 /* Builder object created, initialize it */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
272 rs->create((myEngine->currEng->info()).maxsids); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
273 if (!*rs) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
274 xs_error("reSID->create() failed.\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
275 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
276 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
277 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
278 rs->filter(xs_cfg.emulateFilters); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
279 if (!*rs) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
280 xs_error("reSID->filter(%d) failed.\n", xs_cfg.emulateFilters); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
281 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
282 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
283 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
284 // FIXME FIX ME: support other configurable parameters ... |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
285 // ... WHEN/IF resid-builder+libsidplay2 gets fixed |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
286 rs->sampling(tmpFreq); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
287 if (!*rs) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
288 xs_error("reSID->sampling(%d) failed.\n", tmpFreq); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
289 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
290 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
291 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
292 if (tmpFilter.points > 0) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
293 rs->filter((sid_filter_t *) &tmpFilter); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
294 else |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
295 rs->filter((sid_filter_t *) NULL); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
296 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
297 if (!*rs) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
298 xs_error("reSID->filter(NULL) failed.\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
299 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
300 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
301 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
302 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
303 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
304 #ifdef HAVE_HARDSID_BUILDER |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
305 if (xs_cfg.sid2Builder == XS_BLD_HARDSID) { |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
306 #ifdef HAVE_SIDPLAY2_COMI |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
307 myEngine->currBuilder = HardSIDBuilderCreate(""); |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
308 SidLazyIPtr<IHardSIDBuilder> hs(myEngine->currBuilder); |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
309 if (hs) { |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
310 myEngine->currConfig.sidEmulation = hs->iaggregate(); |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
311 #else |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
312 HardSIDBuilder *hs = new HardSIDBuilder("HardSID builder"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
313 myEngine->currBuilder = (sidbuilder *) hs; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
314 if (hs) { |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
315 #endif |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
316 /* Builder object created, initialize it */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
317 hs->create((myEngine->currEng->info()).maxsids); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
318 if (!*hs) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
319 xs_error("hardSID->create() failed.\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
320 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
321 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
322 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
323 hs->filter(xs_cfg.emulateFilters); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
324 if (!*hs) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
325 xs_error("hardSID->filter(%d) failed.\n", xs_cfg.emulateFilters); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
326 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
327 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
328 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
329 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
330 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
331 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
332 if (!myEngine->currBuilder) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
333 xs_error("[SIDPlay2] Could not initialize SIDBuilder object.\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
334 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
335 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
336 |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
337 #ifndef HAVE_SIDPLAY2_COMI |
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
338 myEngine->currConfig.sidEmulation = myEngine->currBuilder; |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
339 XSDEBUG("%s\n", myEngine->currBuilder->credits()); |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
340 #endif |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
341 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
342 /* Clockspeed settings */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
343 switch (xs_cfg.clockSpeed) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
344 case XS_CLOCK_NTSC: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
345 myEngine->currConfig.clockDefault = SID2_CLOCK_NTSC; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
346 break; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
347 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
348 default: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
349 xs_error("[SIDPlay2] Invalid clockSpeed=%d, falling back to PAL.\n", |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
350 xs_cfg.clockSpeed); |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
351 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
352 case XS_CLOCK_PAL: |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
353 myEngine->currConfig.clockDefault = SID2_CLOCK_PAL; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
354 xs_cfg.clockSpeed = XS_CLOCK_PAL; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
355 break; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
356 } |
0
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 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
359 /* Configure rest of the emulation */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
360 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
361 if (xs_cfg.forceSpeed) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
362 myEngine->currConfig.clockForced = true; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
363 myEngine->currConfig.clockSpeed = myEngine->currConfig.clockDefault; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
364 } else { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
365 myEngine->currConfig.clockForced = false; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
366 myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
367 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
368 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
369 if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION)) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
370 myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
371 else { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
372 xs_error("Invalid sid2OptLevel=%d, falling back to %d.\n", |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
373 xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
374 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
375 xs_cfg.sid2OptLevel = |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
376 myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
377 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
378 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
379 if (xs_cfg.mos8580) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
380 myEngine->currConfig.sidDefault = SID2_MOS8580; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
381 else |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
382 myEngine->currConfig.sidDefault = SID2_MOS6581; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
383 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
384 if (xs_cfg.forceModel) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
385 myEngine->currConfig.sidModel = myEngine->currConfig.sidDefault; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
386 else |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
387 myEngine->currConfig.sidModel = SID2_MODEL_CORRECT; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
388 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
389 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
390 /* XXX: Should this be configurable? libSIDPlay1 does not support it, though */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
391 myEngine->currConfig.sidSamples = TRUE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
392 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
393 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
394 /* Now set the emulator configuration */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
395 if (myEngine->currEng->config(myEngine->currConfig) < 0) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
396 xs_error("[SIDPlay2] Emulator engine configuration failed!\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
397 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
398 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
399 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
400 /* Create the sidtune */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
401 myEngine->currTune = new SidTune(0); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
402 if (!myEngine->currTune) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
403 xs_error("[SIDPlay2] Could not initialize SIDTune object.\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
404 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
405 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
406 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
407 return TRUE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
408 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
409 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
410 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
411 /* Close SIDPlay2 engine |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
412 */ |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
2478
diff
changeset
|
413 void xs_sidplay2_close(xs_status_t * myStatus) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
414 { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
415 xs_sidplay2_t *myEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
416 assert(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
417 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
418 myEngine = (xs_sidplay2_t *) myStatus->sidEngine; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
419 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
420 /* Free internals */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
421 if (myEngine->currBuilder) { |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
422 #ifndef HAVE_SIDPLAY2_COMI |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
423 delete myEngine->currBuilder; |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
424 #endif |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
425 myEngine->currBuilder = NULL; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
426 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
427 |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
428 #ifndef HAVE_SIDPLAY2_COMI |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
429 if (myEngine->currEng) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
430 delete myEngine->currEng; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
431 myEngine->currEng = NULL; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
432 } |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
433 #endif |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
434 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
435 if (myEngine->currTune) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
436 delete myEngine->currTune; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
437 myEngine->currTune = NULL; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
438 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
439 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
440 xs_sidplay2_delete(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
441 |
2623
02dbe40dd0c3
Synchronized CVS libsidplay2 COM interface support from XMMS-SID. This is
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
442 delete myEngine; |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
443 myStatus->sidEngine = NULL; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
444 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
445 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
446 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
447 /* Initialize current song and sub-tune |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
448 */ |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
2478
diff
changeset
|
449 gboolean xs_sidplay2_initsong(xs_status_t * myStatus) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
450 { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
451 xs_sidplay2_t *myEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
452 assert(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
453 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
454 myEngine = (xs_sidplay2_t *) myStatus->sidEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
455 if (!myEngine) return FALSE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
456 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
457 if (!myEngine->currTune->selectSong(myStatus->currSong)) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
458 xs_error("[SIDPlay2] currTune->selectSong() failed\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
459 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
460 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
461 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
462 if (myEngine->currEng->load(myEngine->currTune) < 0) { |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
463 xs_error("[SIDPlay2] currEng->load() failed\n"); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
464 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
465 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
466 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
467 myStatus->isInitialized = TRUE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
468 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
469 return TRUE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
470 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
471 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
472 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
473 /* Emulate and render audio data to given buffer |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
474 */ |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
2478
diff
changeset
|
475 guint xs_sidplay2_fillbuffer(xs_status_t * myStatus, gchar * audioBuffer, guint audioBufSize) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
476 { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
477 xs_sidplay2_t *myEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
478 assert(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
479 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
480 myEngine = (xs_sidplay2_t *) myStatus->sidEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
481 if (!myEngine) return 0; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
482 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
483 return myEngine->currEng->play(audioBuffer, audioBufSize); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
484 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
485 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
486 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
487 /* Load a given SID-tune file |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
488 */ |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
2478
diff
changeset
|
489 gboolean xs_sidplay2_load(xs_status_t * myStatus, gchar * pcFilename) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
490 { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
491 xs_sidplay2_t *myEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
492 assert(myStatus); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
493 myStatus->isInitialized = FALSE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
494 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
495 myEngine = (xs_sidplay2_t *) myStatus->sidEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
496 if (!myEngine) return FALSE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
497 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
498 /* Try to get the tune */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
499 if (!pcFilename) return FALSE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
500 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
501 if (xs_fload_buffer(pcFilename, &(myEngine->buf), &(myEngine->bufSize)) != 0) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
502 return FALSE; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
503 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
504 if (!myEngine->currTune->read(myEngine->buf, myEngine->bufSize)) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
505 return FALSE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
506 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
507 return TRUE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
508 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
509 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
510 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
511 /* Delete INTERNAL information |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
512 */ |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
2478
diff
changeset
|
513 void xs_sidplay2_delete(xs_status_t * myStatus) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
514 { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
515 xs_sidplay2_t *myEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
516 assert(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
517 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
518 myEngine = (xs_sidplay2_t *) myStatus->sidEngine; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
519 if (!myEngine) return; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
520 |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
521 g_free(myEngine->buf); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
522 myEngine->buf = NULL; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
523 myEngine->bufSize = 0; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
524 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
525 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
526 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
527 /* Hardware backend flushing |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
528 */ |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
2478
diff
changeset
|
529 void xs_sidplay2_flush(xs_status_t * myStatus) |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
530 { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
531 assert(myStatus); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
532 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
533 #ifdef HAVE_HARDSID_BUILDER |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
534 #ifdef HSID_SID2_COM |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
535 IfPtr<HardSIDBuilder> hs(myStatus->currBuilder); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
536 if (hs) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
537 hs->flush(); |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
538 #else |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
539 if (xs_cfg.sid2Builder == XS_BLD_HARDSID) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
540 ((HardSIDBuilder *) myStatus->currBuilder)->flush(); |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
541 #endif |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
542 #endif |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
543 } |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
544 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
463
diff
changeset
|
545 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
546 } /* extern "C" */ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
547 #endif /* HAVE_SIDPLAY2 */ |