Mercurial > audlegacy-plugins
annotate src/sid/xmms-sid.h @ 2815:cc6f02424609
added initial support for xiph streaming directory; small bug fixes & code cleanups
author | Calin Crisan ccrisan@gmail.com |
---|---|
date | Sun, 13 Jul 2008 04:00:04 +0300 |
parents | da7e2ec2ea27 |
children |
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 Main header file |
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:
561
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:
561
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:
561
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:
561
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 */ |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
23 #ifndef XMMS_SID_H |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
24 #define XMMS_SID_H |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
25 |
1801 | 26 #include <config.h> |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
27 #include "xs_support.h" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
28 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 #ifdef __cplusplus |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
30 extern "C" { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
31 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
32 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
33 /* |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
34 * Some constants and defines |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
35 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
36 /* #define to enable spurious debugging messages for development |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 * purposes. Output goes to stderr. See also DEBUG_NP below. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
38 */ |
1591
fccf78344cab
Undefine DEBUG, it is probably not needed at the moment; Made mutex debugging
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
39 #undef DEBUG |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
40 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
41 /* Define to ISO C99 macro for debugging instead of varargs function. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
42 * This provides more useful information, but is incompatible with |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
43 * older standards. If #undef'd, a varargs function is used instead. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 */ |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
45 #define DEBUG_NP |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
46 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
47 /* Define to enable non-portable thread and mutex debugging code. |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
48 * You need to #define DEBUG also to make this useful. |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
49 * (Works probably with GNU/Linux pthreads implementation only) |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
50 */ |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
51 #undef XS_MUTEX_DEBUG |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
52 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
53 /* HardSID-support is not working and is untested, thus we disable it here. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
54 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
55 #undef HAVE_HARDSID_BUILDER |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
56 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
57 /* Size for some small buffers (always static variables) */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
58 #define XS_BUF_SIZE (1024) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
59 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
60 /* If defined, some dynamically allocated temp. buffers are used. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
61 * Static (#undef) might give slight performance gain, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
62 * but fails on systems with limited stack space. */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
63 #define XS_BUF_DYNAMIC |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
64 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
65 /* Configuration section identifier |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
66 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
67 #define XS_PACKAGE_STRING "Audacious-SID" |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
68 #define XS_CONFIG_IDENT "sid" |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
69 |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
70 /* Default audio rendering frequency in Hz |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
71 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
72 #define XS_AUDIO_FREQ (44100) |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
73 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
74 /* Size of audio buffer. If you are experiencing lots of audio |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
75 * "underruns" or clicks/gaps in output, try increasing this value. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
76 * Do notice, however, that it also affects the update frequency of |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
77 * XMMS's visualization plugins... |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
78 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
79 #define XS_AUDIOBUF_SIZE (2*1024) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
80 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
81 /* Size of data buffer used for SID-tune MD5 hash calculation. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
82 * If this is too small, the computed hash will be incorrect. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
83 * Largest SID files I've seen are ~70kB. */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
84 #define XS_SIDBUF_SIZE (80*1024) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
85 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
86 /* libSIDPlay1/2 constants (copied from internal headers/source) |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
87 * For some stupid reason these are not available in public |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
88 * headers, so we have to duplicate them here... |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
89 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
90 #define XS_SIDPLAY1_FS (400.0f) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
91 #define XS_SIDPLAY1_FM (60.0f) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
92 #define XS_SIDPLAY1_FT (0.05f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
93 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
94 #define XS_SIDPLAY2_NFPOINTS (0x800) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
95 #define XS_SIDPLAY2_FMAX (24000) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
96 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
97 /* Limits for oversampling |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
98 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
99 #define XS_MIN_OVERSAMPLE (2) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
100 #define XS_MAX_OVERSAMPLE (8) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
101 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
102 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
103 /* Macros for mutexes and threads. These exist to be able to |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
104 * easily change from pthreads to glib threads, etc, if necessary. |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
105 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
106 #define XS_THREAD_T GThread * |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
107 #define XS_THREAD_EXIT(M) g_thread_exit(M) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
108 #define XS_THREAD_JOIN(M) g_thread_join(M) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
109 #define XS_MPP(M) M ## _mutex |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
110 #define XS_MUTEX(M) GStaticMutex XS_MPP(M) = G_STATIC_MUTEX_INIT |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
111 #define XS_MUTEX_H(M) extern GStaticMutex XS_MPP(M) |
1591
fccf78344cab
Undefine DEBUG, it is probably not needed at the moment; Made mutex debugging
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
112 #ifdef XS_MUTEX_DEBUG |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
113 # define XS_MUTEX_LOCK(M) { \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
114 gboolean tmpRes; \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
115 XSDEBUG("XS_MUTEX_TRYLOCK(" #M ")\n"); \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
116 tmpRes = g_static_mutex_trylock(&XS_MPP(M)); \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
117 XSDEBUG("[" #M "] = %s\n", tmpRes ? "TRUE" : "FALSE"); \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
118 } |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
119 # define XS_MUTEX_UNLOCK(M) { XSDEBUG("XS_MUTEX_UNLOCK(" #M ")\n"); g_static_mutex_unlock(&XS_MPP(M)); } |
1591
fccf78344cab
Undefine DEBUG, it is probably not needed at the moment; Made mutex debugging
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
120 #else |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
121 # define XS_MUTEX_LOCK(M) g_static_mutex_lock(&XS_MPP(M)) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
122 # define XS_MUTEX_UNLOCK(M) g_static_mutex_unlock(&XS_MPP(M)) |
1591
fccf78344cab
Undefine DEBUG, it is probably not needed at the moment; Made mutex debugging
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
123 #endif |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
124 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
125 /* Character set conversion helper macros |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
126 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
127 #define XS_CS_FILENAME(M) g_filename_to_utf8(M, -1, NULL, NULL, NULL) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
128 #define XS_CS_SID(M) g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
129 #define XS_CS_STIL(M) g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
130 #define XS_CS_FREE(M) g_free(M) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
131 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
132 /* Shorthands for linked lists |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
133 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
134 #define LPREV (node->prev) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
135 #define LTHIS (node) |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
136 #define LNEXT (node->next) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
137 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
138 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
139 /* Plugin-wide typedefs |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
140 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
141 typedef struct { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
142 gint tuneSpeed, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
143 tuneLength; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
144 gboolean tunePlayed; |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
1801
diff
changeset
|
145 } xs_subtuneinfo_t; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
146 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
147 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
148 typedef struct { |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
149 gchar *sidFilename, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
150 *sidName, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
151 *sidComposer, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
152 *sidCopyright, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
153 *sidFormat; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
154 gint loadAddr, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
155 initAddr, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
156 playAddr, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
157 dataFileLen, |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
158 sidModel; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
159 gint nsubTunes, startTune; |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
160 xs_subtuneinfo_t *subTunes; |
2507
251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
Matti Hamalainen <ccr@tnsp.org>
parents:
1801
diff
changeset
|
161 } xs_tuneinfo_t; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
162 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
163 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
164 /* Global variables |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
165 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
166 extern InputPlugin xs_plugin_ip; |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
167 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
168 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
169 /* Plugin function prototypes |
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 void xs_init(void); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
172 void xs_reinit(void); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
173 void xs_close(void); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
174 void xs_play_file(InputPlayback *); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
175 void xs_stop(InputPlayback *); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
176 void xs_pause(InputPlayback *, short); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
177 void xs_seek(InputPlayback *, gint); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
178 gint xs_get_time(InputPlayback *); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
179 Tuple * xs_get_song_tuple(gchar *); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
180 Tuple * xs_probe_for_tuple(gchar *, xs_file_t *); |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
181 void xs_about(void); |
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 void xs_error(const char *, ...); |
1581
8581eb9d574a
Fix fileinfo dialog to work with new subtune system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
184 gboolean xs_get_trackinfo(const gchar *, gchar **, gint *); |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
185 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
186 |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
187 /* Debugging |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
188 */ |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
189 #ifndef DEBUG_NP |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
190 void XSDEBUG(const char *, ...); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
191 #else |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
192 # ifdef DEBUG |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
193 # define XSDEBUG(...) { fprintf(stderr, "XS[%s:%s:%d]: ", __FILE__, __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); } |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
194 # else |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
195 # define XSDEBUG(...) /* stub */ |
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
196 # endif |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
197 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
198 |
1573
82548d92c922
Some macro additions for handling Gtk+/Glib stuff; Misc merges.
Matti Hamalainen <ccr@tnsp.org>
parents:
1564
diff
changeset
|
199 |
82548d92c922
Some macro additions for handling Gtk+/Glib stuff; Misc merges.
Matti Hamalainen <ccr@tnsp.org>
parents:
1564
diff
changeset
|
200 /* And even some Gtk+ macro crap here, yay. |
82548d92c922
Some macro additions for handling Gtk+/Glib stuff; Misc merges.
Matti Hamalainen <ccr@tnsp.org>
parents:
1564
diff
changeset
|
201 */ |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
202 #define XS_DEF_WINDOW_DELETE(ME, MV) \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
203 gboolean xs_ ## ME ## _delete(GtkWidget *w, GdkEvent *e, gpointer d) { \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
204 (void) w; (void) e; (void) d; \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
205 if (xs_ ## MV ) { \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
206 gtk_widget_destroy(xs_ ## MV ); \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
207 xs_ ## MV = NULL; \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
208 } \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
209 return FALSE; \ |
1573
82548d92c922
Some macro additions for handling Gtk+/Glib stuff; Misc merges.
Matti Hamalainen <ccr@tnsp.org>
parents:
1564
diff
changeset
|
210 } |
82548d92c922
Some macro additions for handling Gtk+/Glib stuff; Misc merges.
Matti Hamalainen <ccr@tnsp.org>
parents:
1564
diff
changeset
|
211 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
212 #define XS_DEF_WINDOW_CLOSE(ME, MV) \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
213 void xs_ ## ME (GtkButton *b, gpointer d) { \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
214 (void) b; (void) d; \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
215 gtk_widget_destroy(xs_ ## MV ); \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
216 xs_ ## MV = NULL; \ |
1573
82548d92c922
Some macro additions for handling Gtk+/Glib stuff; Misc merges.
Matti Hamalainen <ccr@tnsp.org>
parents:
1564
diff
changeset
|
217 } |
82548d92c922
Some macro additions for handling Gtk+/Glib stuff; Misc merges.
Matti Hamalainen <ccr@tnsp.org>
parents:
1564
diff
changeset
|
218 |
2509
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
219 #define XS_SIGNAL_CONNECT(SOBJ, SNAME, SFUNC, SDATA) \ |
1223e8510d8a
Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents:
2507
diff
changeset
|
220 g_signal_connect(G_OBJECT(SOBJ), SNAME, G_CALLBACK(SFUNC), SDATA) |
1573
82548d92c922
Some macro additions for handling Gtk+/Glib stuff; Misc merges.
Matti Hamalainen <ccr@tnsp.org>
parents:
1564
diff
changeset
|
221 |
2511
da7e2ec2ea27
Use macro wrapping for Gtk+ v1 vs v2 differences, yet again.
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
222 #define XS_WINDOW_PRESENT(XX) gtk_window_present(GTK_WINDOW( XX )) |
da7e2ec2ea27
Use macro wrapping for Gtk+ v1 vs v2 differences, yet again.
Matti Hamalainen <ccr@tnsp.org>
parents:
2509
diff
changeset
|
223 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
224 #ifdef __cplusplus |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
225 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
226 #endif |
735
6c3c7b841382
[svn] - sync audacious-sid with latest xmms-sid, from Matti Hamalainen (ccr).
nenolod
parents:
561
diff
changeset
|
227 #endif /* XMMS_SID_H */ |