annotate src/xmms-sid.h @ 434:b79d319e3054

gettext fixes
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 01 Jan 2007 08:34:01 +0000
parents 2ea3005a4b7f
children f277dad3180f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 Main header file
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
324
dd201740a720 Changed copyright text.
Matti Hamalainen <ccr@tnsp.org>
parents: 311
diff changeset
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org>
422
d2e6682d3ef8 Copyright year update
Matti Hamalainen <ccr@tnsp.org>
parents: 412
diff changeset
7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 This program is free software; you can redistribute it and/or modify
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 the Free Software Foundation; either version 2 of the License, or
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 (at your option) any later version.
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 This program is distributed in the hope that it will be useful,
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 GNU General Public License for more details.
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
412
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
19 You should have received a copy of the GNU General Public License along
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
20 with this program; if not, write to the Free Software Foundation, Inc.,
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 */
92
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
23 #ifndef _XMMS_SID_H
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
24 #define _XMMS_SID_H
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
92
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
26 #ifdef HAVE_CONFIG_H
24
271be59be975 Lots of changes
Matti Hamalainen <ccr@tnsp.org>
parents: 3
diff changeset
27 #include <config.h>
92
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
28 #endif
219
d18bf68d7bd9 Whitespace
Matti Hamalainen <ccr@tnsp.org>
parents: 147
diff changeset
29
92
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
30 #ifdef HAVE_ASSERT_H
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
31 #include <assert.h>
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
32 #else
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
33 #define assert(x) /* stub */
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
34 #endif
219
d18bf68d7bd9 Whitespace
Matti Hamalainen <ccr@tnsp.org>
parents: 147
diff changeset
35
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 #include <glib.h>
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
37 #include <pthread.h>
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
39 #ifdef __cplusplus
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
40 extern "C" {
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
41 #endif
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
42
434
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
43 /*
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
44 * Standard gettext macros.
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
45 */
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
46 #ifdef ENABLE_NLS
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
47 # include <libintl.h>
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
48 # undef _
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
49 # define _(String) dgettext (PACKAGE, String)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
50 # ifdef gettext_noop
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
51 # define N_(String) gettext_noop (String)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
52 # else
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
53 # define N_(String) (String)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
54 # endif
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
55 #else
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
56 # define textdomain(String) (String)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
57 # define gettext(String) (String)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
58 # define dgettext(Domain,Message) (Message)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
59 # define dcgettext(Domain,Message,Type) (Message)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
60 # define bindtextdomain(Domain,Directory) (Domain)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
61 # define _(String) (String)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
62 # define N_(String) (String)
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
63 #endif
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
64
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
65
328
7888e5d973b9 Minor cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
66 #include <xmms/plugin.h>
7888e5d973b9 Minor cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
67
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
68 /*
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
69 * Some constants and defines
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
70 */
365
5a92a2aee74c Better comments and .. you guessed it: more indentation fixes. :)
Matti Hamalainen <ccr@tnsp.org>
parents: 355
diff changeset
71 /* #define to enable spurious debugging messages for development
5a92a2aee74c Better comments and .. you guessed it: more indentation fixes. :)
Matti Hamalainen <ccr@tnsp.org>
parents: 355
diff changeset
72 * purposes. Output goes to stderr. See also DEBUG_NP below.
5a92a2aee74c Better comments and .. you guessed it: more indentation fixes. :)
Matti Hamalainen <ccr@tnsp.org>
parents: 355
diff changeset
73 */
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
74 #define DEBUG
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
75
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
76 /* Define to ISO C99 macro for debugging instead of varargs function.
365
5a92a2aee74c Better comments and .. you guessed it: more indentation fixes. :)
Matti Hamalainen <ccr@tnsp.org>
parents: 355
diff changeset
77 * This provides more useful information, but is incompatible with
5a92a2aee74c Better comments and .. you guessed it: more indentation fixes. :)
Matti Hamalainen <ccr@tnsp.org>
parents: 355
diff changeset
78 * older standards. If #undef'd, a varargs function is used instead.
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
79 */
308
ae5795ba5c77 Remove "only when song-length unknown" option from minimum playtime, it
Matti Hamalainen <ccr@tnsp.org>
parents: 300
diff changeset
80 #define DEBUG_NP
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
81
272
4af5e6c1d968 Formatting cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
82 /* Define to enable non-portable thread and mutex debugging code.
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
83 * You need to #define DEBUG also to make this useful.
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
84 * (Works probably with GNU/Linux pthreads implementation only)
272
4af5e6c1d968 Formatting cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
85 */
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
86 #undef XS_MUTEX_DEBUG
72
e3b205a6bc7e Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
87
272
4af5e6c1d968 Formatting cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
88 /* HardSID-support is not working and is untested, thus we disable it here.
4af5e6c1d968 Formatting cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
89 */
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
90 #undef HAVE_HARDSID_BUILDER
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
91
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
92 /* Size for some small buffers (always static variables) */
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
93 #define XS_BUF_SIZE (1024)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94
355
26079ab52fc3 Comment about XS_DYNAMIC_BUF changed
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
95 /* If defined, some dynamically allocated temp. buffers are used.
26079ab52fc3 Comment about XS_DYNAMIC_BUF changed
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
96 * Static (#undef) might give slight performance gain,
26079ab52fc3 Comment about XS_DYNAMIC_BUF changed
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
97 * but fails on systems with limited stack space. */
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
98 #define XS_BUF_DYNAMIC
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
99
242
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
100 /* Size of audio buffer. If you are experiencing lots of audio
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
101 * "underruns" or clicks/gaps in output, try increasing this value.
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
102 * Do notice, however, that it also affects the update frequency of
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
103 * XMMS's visualization plugins...
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
104 */
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
105 #define XS_AUDIOBUF_SIZE (2*1024)
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
106
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
107 /* Size of data buffer used for SID-tune MD5 hash calculation.
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
108 * If this is too small, the computed hash will be incorrect.
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
109 * Largest SID files I've seen are ~70kB. */
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
110 #define XS_SIDBUF_SIZE (80*1024)
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
111
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
112
376
b20300813b42 Moved some #defines from xs_config.c to xmms-sid.h; Changed default SID
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
113 /* libSIDPlay1 default filter values (copied from libsidplay1's headers) */
b20300813b42 Moved some #defines from xs_config.c to xmms-sid.h; Changed default SID
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
114 #define XS_SIDPLAY1_FS (400.0f)
b20300813b42 Moved some #defines from xs_config.c to xmms-sid.h; Changed default SID
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
115 #define XS_SIDPLAY1_FM (60.0f)
b20300813b42 Moved some #defines from xs_config.c to xmms-sid.h; Changed default SID
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
116 #define XS_SIDPLAY1_FT (0.05f)
b20300813b42 Moved some #defines from xs_config.c to xmms-sid.h; Changed default SID
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
117
b20300813b42 Moved some #defines from xs_config.c to xmms-sid.h; Changed default SID
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
118
369
4611f1194941 Make binary search bailout value a #define in xmms-sid.h
Matti Hamalainen <ccr@tnsp.org>
parents: 365
diff changeset
119 #define XS_BIN_BAILOUT (32) /* Binary search bailout treshold */
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
120
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
121
50
dae6d3c2268d Minor fixes, updated to support default XMMS configfile
Matti Hamalainen <ccr@tnsp.org>
parents: 40
diff changeset
122 #define XS_CONFIG_IDENT "XMMS-SID" /* Configuration file identifier */
62
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
123 #define XS_CONFIG_FILE "/.xmms/xmms-sid" /* Use this configfile if autocyrpe fails */
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
124
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
125 #define XS_MIN_OVERSAMPLE (2) /* Minimum oversampling factor */
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
126 #define XS_MAX_OVERSAMPLE (8) /* Maximum oversampling factor */
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
128
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
129 /* Macros for mutexes and threads. These exist to be able to
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
130 * easily change from pthreads to glib threads, etc, if necessary.
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
131 */
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
132 #define XS_MPP(M) M ## _mutex
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
133 #if XS_MUTEX_DEBUG
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
134 #define XS_MUTEX(M) pthread_mutex_t XS_MPP(M) = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; int M ## _qq;
293
3fa910269508 Remove extra semicolon from macro definition, #undef DEBUG
Matti Hamalainen <ccr@tnsp.org>
parents: 278
diff changeset
135 #define XS_MUTEX_H(M) extern pthread_mutex_t XS_MPP(M); extern int M ## _qq
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
136 #define XS_MUTEX_LOCK(M) { M ## _qq = pthread_mutex_lock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_LOCK(" #M ") == %i\n", M ## _qq); }
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
137 #define XS_MUTEX_UNLOCK(M) { M ## _qq = pthread_mutex_unlock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_UNLOCK(" #M ") == %i\n", M ## _qq); }
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
138 #else
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
139 #define XS_MUTEX(M) pthread_mutex_t XS_MPP(M) = PTHREAD_MUTEX_INITIALIZER
293
3fa910269508 Remove extra semicolon from macro definition, #undef DEBUG
Matti Hamalainen <ccr@tnsp.org>
parents: 278
diff changeset
140 #define XS_MUTEX_H(M) extern pthread_mutex_t XS_MPP(M)
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
141 #define XS_MUTEX_LOCK(M) pthread_mutex_lock(&XS_MPP(M))
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
142 #define XS_MUTEX_UNLOCK(M) pthread_mutex_unlock(&XS_MPP(M))
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
143 #endif
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
144
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
145 /* Shorthands for linked lists
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
146 */
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
147 #define LPREV (pNode->pPrev)
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
148 #define LTHIS (pNode)
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
149 #define LNEXT (pNode->pNext)
62
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
150
72
e3b205a6bc7e Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
151
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
152 /* Plugin-wide typedefs
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
153 */
72
e3b205a6bc7e Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
154 typedef struct {
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
155 gint tuneSpeed;
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
156 gint tuneLength;
87
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 78
diff changeset
157 gchar *tuneTitle;
392
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
158 gboolean tunePlayed;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
159 } t_xs_subtuneinfo;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
160
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
161
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
162 typedef struct {
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
163 gchar *sidFilename,
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
164 *sidName,
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
165 *sidComposer,
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
166 *sidCopyright,
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
167 *sidFormat;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
168 gint loadAddr,
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
169 initAddr,
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
170 playAddr,
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
171 dataFileLen,
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
172 sidModel;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
173 gint nsubTunes, startTune;
334
19c89f9ca2cc Misc commit.
Matti Hamalainen <ccr@tnsp.org>
parents: 328
diff changeset
174 t_xs_subtuneinfo *subTunes;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
175 } t_xs_tuneinfo;
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
176
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
177
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
178 struct t_xs_status;
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
179
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
180 typedef struct {
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
181 gint plrIdent;
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
182 gboolean (*plrIsOurFile)(gchar *);
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
183 gboolean (*plrInit)(struct t_xs_status *);
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
184 void (*plrClose)(struct t_xs_status *);
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
185 gboolean (*plrInitSong)(struct t_xs_status *);
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
186 guint (*plrFillBuffer)(struct t_xs_status *, gchar *, guint);
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
187 gboolean (*plrLoadSID)(struct t_xs_status *, gchar *);
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
188 void (*plrDeleteSID)(struct t_xs_status *);
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
189 t_xs_tuneinfo* (*plrGetSIDInfo)(gchar *);
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
190 } t_xs_player;
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
191
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
192
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
193 typedef struct t_xs_status {
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
194 gint audioFrequency, /* Audio settings */
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 119
diff changeset
195 audioChannels,
269
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
196 audioBitsPerSample,
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
197 oversampleFactor; /* Factor of oversampling */
295
d5c79d5a0b60 gint -> AFormat
Matti Hamalainen <ccr@tnsp.org>
parents: 293
diff changeset
198 AFormat audioFormat;
269
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
199 gboolean oversampleEnable; /* TRUE after sidEngine initialization,
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
200 if xs_cfg.oversampleEnable == TRUE and
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
201 emulation backend supports oversampling.
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
202 */
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
203 void *sidEngine; /* SID-emulation internal engine data */
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
204 t_xs_player *sidPlayer; /* Selected player engine */
87
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 78
diff changeset
205 gboolean isError, isPlaying;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
206 gint currSong, /* Current sub-tune */
132
4162a5370b9e Added "seek"-subsong control option, in style of xmms-sidplay.
Matti Hamalainen <ccr@tnsp.org>
parents: 127
diff changeset
207 lastTime;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
208 t_xs_tuneinfo *tuneInfo;
72
e3b205a6bc7e Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
209 } t_xs_status;
e3b205a6bc7e Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
210
87
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 78
diff changeset
211
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
212 /* Global variables
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
213 */
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
214 extern InputPlugin xs_plugin_ip;
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
215
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
216 extern t_xs_status xs_status;
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
217 XS_MUTEX_H(xs_status);
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
218
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
220
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
221 /* Plugin function prototypes
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 */
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223 void xs_init(void);
147
a7abcda7a86c SLDB, STIL and emulation engine settings are now updated
Matti Hamalainen <ccr@tnsp.org>
parents: 138
diff changeset
224 void xs_reinit(void);
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
225 void xs_close(void);
65
bf7b647b3239 The fabled 0.8-rewrite now works to some extent
Matti Hamalainen <ccr@tnsp.org>
parents: 62
diff changeset
226 gint xs_is_our_file(gchar *);
bf7b647b3239 The fabled 0.8-rewrite now works to some extent
Matti Hamalainen <ccr@tnsp.org>
parents: 62
diff changeset
227 void xs_play_file(gchar *);
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
228 void xs_stop(void);
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229 void xs_pause(short);
65
bf7b647b3239 The fabled 0.8-rewrite now works to some extent
Matti Hamalainen <ccr@tnsp.org>
parents: 62
diff changeset
230 void xs_seek(gint);
bf7b647b3239 The fabled 0.8-rewrite now works to some extent
Matti Hamalainen <ccr@tnsp.org>
parents: 62
diff changeset
231 gint xs_get_time(void);
bf7b647b3239 The fabled 0.8-rewrite now works to some extent
Matti Hamalainen <ccr@tnsp.org>
parents: 62
diff changeset
232 void xs_get_song_info(gchar *, gchar **, gint *);
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
233 void xs_about(void);
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
234
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
235 t_xs_tuneinfo *xs_tuneinfo_new(const gchar *, gint, gint,
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
236 const gchar *, const gchar *, const gchar *,
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
237 gint, gint, gint, gint, const gchar *);
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 394
diff changeset
238
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
239 void xs_tuneinfo_free(t_xs_tuneinfo *);
87
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 78
diff changeset
240
394
7c4216c7aa47 XSERR -> xs_error fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
241 void xs_error(const char *, ...);
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
242
427
2ea3005a4b7f Conditional #definition of _()
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
243
2ea3005a4b7f Conditional #definition of _()
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
244 /* Debugging
2ea3005a4b7f Conditional #definition of _()
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
245 */
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
246 #ifndef DEBUG_NP
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
247 void XSDEBUG(const char *, ...);
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
248 #else
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
249 #ifdef DEBUG
297
ac9a484e3430 Make XSERR into function.
Matti Hamalainen <ccr@tnsp.org>
parents: 295
diff changeset
250 #define XSDEBUG(...) { fprintf(stderr, "XS[%s:%s:%d]: ", __FILE__, __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); }
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
251 #else
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
252 #define XSDEBUG(...) /* stub */
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
253 #endif
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
254 #endif
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
255
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
256 #ifdef __cplusplus
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258 #endif
92
2607683bc9eb Improvements in length- and title handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
259 #endif /* _XMMS_SID_H */