annotate src/xmms-sid.h @ 732:8312acdb7b15

Bump autotools version requirement.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 05 Nov 2012 12:06:05 +0200
parents 9321ffa2ea7e
children d9d769b5dbe2
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>
723
9321ffa2ea7e Update copyright years.
Matti Hamalainen <ccr@tnsp.org>
parents: 665
diff changeset
7 (C) Copyright 1999-2009 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 */
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
23 #ifndef XMMS_SID_H
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
24 #define XMMS_SID_H
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
465
ba98fdac6307 Moved some things to xs_support.h; t_xs_subtuneinfo.tuneSpeed is now the
Matti Hamalainen <ccr@tnsp.org>
parents: 459
diff changeset
26 #include "xs_support.h"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
28 #ifdef __cplusplus
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
29 extern "C" {
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
30 #endif
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
31
434
b79d319e3054 gettext fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 427
diff changeset
32 /*
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
33 * Some constants and defines
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
34 */
365
5a92a2aee74c Better comments and .. you guessed it: more indentation fixes. :)
Matti Hamalainen <ccr@tnsp.org>
parents: 355
diff changeset
35 /* #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
36 * 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
37 */
524
ecd827e89c8a Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 512
diff changeset
38 #define DEBUG
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
39
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
40 /* 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
41 * 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
42 * older standards. If #undef'd, a varargs function is used instead.
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
43 */
308
ae5795ba5c77 Remove "only when song-length unknown" option from minimum playtime, it
Matti Hamalainen <ccr@tnsp.org>
parents: 300
diff changeset
44 #define DEBUG_NP
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
45
272
4af5e6c1d968 Formatting cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
46 /* Define to enable non-portable thread and mutex debugging code.
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
47 * You need to #define DEBUG also to make this useful.
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
48 * (Works probably with GNU/Linux pthreads implementation only)
272
4af5e6c1d968 Formatting cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
49 */
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
50 #undef XS_MUTEX_DEBUG
72
e3b205a6bc7e Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
51
272
4af5e6c1d968 Formatting cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
52 /* 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
53 */
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
54 #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
55
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
56 /* Size for some small buffers (always static variables) */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
57 #define XS_BUF_SIZE (1024)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58
355
26079ab52fc3 Comment about XS_DYNAMIC_BUF changed
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
59 /* 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
60 * Static (#undef) might give slight performance gain,
26079ab52fc3 Comment about XS_DYNAMIC_BUF changed
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
61 * 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
62 #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
63
546
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
64 /* Configuration section identifier
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
65 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
66 #define XS_PACKAGE_STRING PACKAGE_STRING
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
67 #define XS_CONFIG_IDENT "XMMS-SID"
546
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
68
486
4c599be2d349 Default audio rendering frequency #define.
Matti Hamalainen <ccr@tnsp.org>
parents: 478
diff changeset
69 /* Default audio rendering frequency in Hz
4c599be2d349 Default audio rendering frequency #define.
Matti Hamalainen <ccr@tnsp.org>
parents: 478
diff changeset
70 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
71 #define XS_AUDIO_FREQ (44100)
486
4c599be2d349 Default audio rendering frequency #define.
Matti Hamalainen <ccr@tnsp.org>
parents: 478
diff changeset
72
242
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
73 /* 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
74 * "underruns" or clicks/gaps in output, try increasing this value.
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
75 * 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
76 * XMMS's visualization plugins...
1c743dcd6d84 Document XS_AUDIOBUF_SIZE
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
77 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
78 #define XS_AUDIOBUF_SIZE (2*1024)
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
79
241
291715a519e2 Compile-time setting to enable/disable use of dynamically allocated buffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 235
diff changeset
80 /* 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
81 * 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
82 * Largest SID files I've seen are ~70kB. */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
83 #define XS_SIDBUF_SIZE (80*1024)
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
84
546
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
85 /* libSIDPlay1/2 constants (copied from internal headers/source)
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
86 * For some stupid reason these are not available in public
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
87 * headers, so we have to duplicate them here...
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
88 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
89 #define XS_SIDPLAY1_FS (400.0f)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
90 #define XS_SIDPLAY1_FM (60.0f)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
91 #define XS_SIDPLAY1_FT (0.05f)
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
92
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
93 #define XS_SIDPLAY2_NFPOINTS (0x800)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
94 #define XS_SIDPLAY2_FMAX (24000)
62
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
95
546
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
96 /* Limits for oversampling
70fe31fe2bf5 Reordering cleanup and added constant for SIDPlay2 max # of filter coeffs.
Matti Hamalainen <ccr@tnsp.org>
parents: 534
diff changeset
97 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
98 #define XS_MIN_OVERSAMPLE (2)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
99 #define XS_MAX_OVERSAMPLE (8)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
101
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
102 /* Macros for mutexes and threads. These exist to be able to
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
103 * easily change from pthreads to glib threads, etc, if necessary.
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
104 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
105 #define XS_THREAD_T pthread_t
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
106 #define XS_THREAD_EXIT(M) pthread_exit(M)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
107 #define XS_THREAD_JOIN(M) pthread_join(M, NULL)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
108 #define XS_MPP(M) M ## _mutex
640
91056492b156 Fix XS_MUTEX_DEBUG to work again.
Matti Hamalainen <ccr@tnsp.org>
parents: 632
diff changeset
109 #ifdef XS_MUTEX_DEBUG
91056492b156 Fix XS_MUTEX_DEBUG to work again.
Matti Hamalainen <ccr@tnsp.org>
parents: 632
diff changeset
110 # ifndef __USE_GNU
91056492b156 Fix XS_MUTEX_DEBUG to work again.
Matti Hamalainen <ccr@tnsp.org>
parents: 632
diff changeset
111 # define __USE_GNU
91056492b156 Fix XS_MUTEX_DEBUG to work again.
Matti Hamalainen <ccr@tnsp.org>
parents: 632
diff changeset
112 # endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
113 # define XS_MUTEX(M) pthread_mutex_t XS_MPP(M) = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; gint M ## _qq
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
114 # define XS_MUTEX_H(M) extern pthread_mutex_t XS_MPP(M); extern gint M ## _qq
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
115 # 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); }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
116 # 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
117 #else
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
118 # define XS_MUTEX(M) pthread_mutex_t XS_MPP(M) = PTHREAD_MUTEX_INITIALIZER
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
119 # define XS_MUTEX_H(M) extern pthread_mutex_t XS_MPP(M)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
120 # define XS_MUTEX_LOCK(M) pthread_mutex_lock(&XS_MPP(M))
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
121 # define XS_MUTEX_UNLOCK(M) pthread_mutex_unlock(&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
122 #endif
640
91056492b156 Fix XS_MUTEX_DEBUG to work again.
Matti Hamalainen <ccr@tnsp.org>
parents: 632
diff changeset
123 #include <pthread.h>
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
124
622
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 619
diff changeset
125 /* Character set conversion helper macros
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 619
diff changeset
126 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
127 #define XS_CS_FILENAME(M) g_strdup(M)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
128 #define XS_CS_SID(M) g_strdup(M)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
129 #define XS_CS_STIL(M) M
622
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 619
diff changeset
130 #define XS_CS_FREE(M)
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 619
diff changeset
131
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
132 /* Shorthands for linked lists
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
133 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
134 #define LPREV (node->prev)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
135 #define LTHIS (node)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
136 #define LNEXT (node->next)
62
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
137
72
e3b205a6bc7e Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
138
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
139 /* Plugin-wide typedefs
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
140 */
72
e3b205a6bc7e Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents: 65
diff changeset
141 typedef struct {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
142 gint tuneSpeed,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
143 tuneLength;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
144 gboolean tunePlayed;
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 640
diff changeset
145 } xs_subtuneinfo_t;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
146
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
147
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
148 typedef struct {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
149 gchar *sidFilename,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
150 *sidName,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
151 *sidComposer,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
152 *sidCopyright,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
153 *sidFormat;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
154 gint loadAddr,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
155 initAddr,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
156 playAddr,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
157 dataFileLen,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
158 sidModel;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
159 gint nsubTunes, startTune;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
160 xs_subtuneinfo_t *subTunes;
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 640
diff changeset
161 } xs_tuneinfo_t;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
162
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
163
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
164 /* Global variables
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
165 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
166 extern InputPlugin xs_plugin_ip;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
167
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
168
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
169 /* Plugin function prototypes
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
171 void xs_init(void);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
172 void xs_reinit(void);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
173 void xs_close(void);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
174 gint xs_is_our_file(gchar *);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
175 void xs_play_file(gchar *);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
176 void xs_stop(void);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
177 void xs_pause(short);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
178 void xs_seek(gint);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
179 gint xs_get_time(void);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
180 void xs_get_song_info(gchar *, gchar **, gint *);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
181 void xs_about(void);
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
183 void xs_error(const char *, ...);
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184
427
2ea3005a4b7f Conditional #definition of _()
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
185
2ea3005a4b7f Conditional #definition of _()
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
186 /* Debugging
2ea3005a4b7f Conditional #definition of _()
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
187 */
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
188 #ifndef DEBUG_NP
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
189 void XSDEBUG(const char *, ...);
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
190 #else
532
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
191 # ifdef DEBUG
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
192 # define XSDEBUG(...) { fprintf(stderr, "XS[%s:%s:%d]: ", __FILE__, __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); }
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
193 # else
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
194 # define XSDEBUG(...) /* stub */
bc548249464a Audacious glue.
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
195 # endif
300
a05bb36f6873 DEBUG_NP
Matti Hamalainen <ccr@tnsp.org>
parents: 298
diff changeset
196 #endif
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197
612
32fc27395220 About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 610
diff changeset
198
32fc27395220 About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 610
diff changeset
199 /* And even some Gtk+ macro crap here, yay.
32fc27395220 About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 610
diff changeset
200 */
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
201 #define XS_DEF_WINDOW_DELETE(ME, MV) \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
202 gboolean xs_ ## ME ## _delete(GtkWidget *w, GdkEvent *e, gpointer d) { \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
203 (void) w; (void) e; (void) d; \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
204 if (xs_ ## MV ) { \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
205 gtk_widget_destroy(xs_ ## MV ); \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
206 xs_ ## MV = NULL; \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
207 } \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
208 return FALSE; \
612
32fc27395220 About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 610
diff changeset
209 }
32fc27395220 About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 610
diff changeset
210
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
211 #define XS_DEF_WINDOW_CLOSE(ME, MV) \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
212 void xs_ ## ME (GtkButton *b, gpointer d) { \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
213 (void) b; (void) d; \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
214 gtk_widget_destroy(xs_ ## MV ); \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
215 xs_ ## MV = NULL; \
612
32fc27395220 About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 610
diff changeset
216 }
32fc27395220 About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 610
diff changeset
217
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
218 #define XS_SIGNAL_CONNECT(SOBJ, SNAME, SFUNC, SDATA) \
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
219 gtk_signal_connect(GTK_OBJECT(SOBJ), SNAME, GTK_SIGNAL_FUNC(SFUNC), SDATA)
612
32fc27395220 About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 610
diff changeset
220
665
94186706beed Use macro wrapping for Gtk+ v1 vs v2 differences, yet again.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
221 #define XS_WINDOW_PRESENT(SWIN) gdk_window_raise(SWIN ->window)
94186706beed Use macro wrapping for Gtk+ v1 vs v2 differences, yet again.
Matti Hamalainen <ccr@tnsp.org>
parents: 660
diff changeset
222
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223 #ifdef __cplusplus
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225 #endif
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
226 #endif /* XMMS_SID_H */