changeset 2519:2da1343a024d

Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author William Pitcock <nenolod@atheme.org>
date Tue, 08 Apr 2008 15:11:35 -0500
parents eef3a506a2b8 (current diff) 292636e718c1 (diff)
children 7aca8941495b
files src/crystalizer/crystalizer.c
diffstat 126 files changed, 4473 insertions(+), 4665 deletions(-) [+]
line wrap: on
line diff
--- a/src/CoreAudio/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/CoreAudio/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -18,9 +18,8 @@
  */
 
 #include "coreaudio.h"
-#include <audacious/configdb.h>
 #include <CoreAudio/CoreAudio.h>
-
+#include <audacious/plugin.h>
 #include <audacious/i18n.h>
 
 static GtkWidget *configure_win = NULL;
--- a/src/CoreAudio/init.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/CoreAudio/init.c	Tue Apr 08 15:11:35 2008 -0500
@@ -16,7 +16,7 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 #include "coreaudio.h"
-#include <audacious/configdb.h>
+#include <audacious/plugin.h>
 
 OSXConfig osx_cfg;
 
--- a/src/OSS/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/OSS/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -26,7 +26,6 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <audacious/configdb.h>
 #include <audacious/i18n.h>
 
 
--- a/src/OSS/init.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/OSS/init.c	Tue Apr 08 15:11:35 2008 -0500
@@ -21,7 +21,6 @@
 
 #include <glib.h>
 #include <string.h>
-#include <audacious/configdb.h>
 #include "OSS.h"
 
 
--- a/src/OSS4/OSS4.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/OSS4/OSS4.c	Tue Apr 08 15:11:35 2008 -0500
@@ -22,9 +22,9 @@
 #include "OSS4.h"
 
 #include <glib.h>
+#include <audacious/plugin.h>
 #include <audacious/i18n.h>
 #include <stdlib.h>
-#include <audacious/configdb.h>
 
 OutputPlugin oss_op = {
     .description = "OSS4 Output Plugin",                      /* Description */
--- a/src/OSS4/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/OSS4/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -25,9 +25,7 @@
 #include <gtk/gtk.h>
 #include <stdio.h>
 #include <string.h>
-
-#include <audacious/configdb.h>
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 #include <audacious/i18n.h>
 
 
--- a/src/OSS4/init.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/OSS4/init.c	Tue Apr 08 15:11:35 2008 -0500
@@ -21,7 +21,7 @@
 
 #include <glib.h>
 #include <string.h>
-#include <audacious/configdb.h>
+#include <audacious/plugin.h>
 #include "OSS4.h"
 
 
--- a/src/aac/libmp4.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/aac/libmp4.c	Tue Apr 08 15:11:35 2008 -0500
@@ -11,7 +11,6 @@
 #include <audacious/util.h>
 #include <audacious/i18n.h>
 #include <audacious/strings.h>
-#include <audacious/main.h>
 
 #define MP4_VERSION VERSION
 #define SBR_DEC
--- a/src/adplug/adplug-xmms.cc	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/adplug/adplug-xmms.cc	Tue Apr 08 15:11:35 2008 -0500
@@ -33,7 +33,6 @@
 extern "C"
 {
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include <audacious/output.h>
 #include <audacious/util.h>
 }
--- a/src/alac/plugin.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/alac/plugin.c	Tue Apr 08 15:11:35 2008 -0500
@@ -46,9 +46,7 @@
 #include <audacious/i18n.h>
 
 #include <audacious/plugin.h>
-#include <audacious/main.h>
 #include <audacious/output.h>
-#include <audacious/vfs.h>
 #include <audacious/util.h>
 
 #include "demux.h"
--- a/src/alac/stream.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/alac/stream.c	Tue Apr 08 15:11:35 2008 -0500
@@ -45,7 +45,6 @@
 #include <errno.h>
 
 #include <audacious/plugin.h>
-#include <audacious/vfs.h>
 
 #include "stream.h"
 
--- a/src/alac/stream.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/alac/stream.h	Tue Apr 08 15:11:35 2008 -0500
@@ -14,7 +14,6 @@
 #endif
 
 #include <audacious/plugin.h>
-#include <audacious/vfs.h>
 
 typedef struct stream_tTAG stream_t;
 
--- a/src/alarm/alarm.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/alarm/alarm.c	Tue Apr 08 15:11:35 2008 -0500
@@ -40,7 +40,6 @@
 #include <stdio.h>
 #include <audacious/plugin.h>
 #include <audacious/auddrct.h>
-#include <audacious/configdb.h>
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 #include <pthread.h>
--- a/src/alsa/alsa.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/alsa/alsa.h	Tue Apr 08 15:11:35 2008 -0500
@@ -26,8 +26,6 @@
 #include "config.h"
 
 #include <audacious/util.h>
-#include <audacious/configdb.h>
-#include <audacious/main.h>
 #include <audacious/plugin.h>
 #include <audacious/i18n.h>
 
--- a/src/alsa/init.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/alsa/init.c	Tue Apr 08 15:11:35 2008 -0500
@@ -17,7 +17,6 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 #include <glib.h>
-#include <audacious/main.h>
 #include "alsa.h"
 #include <dlfcn.h>
 #include <ctype.h>
--- a/src/aosd/aosd_cfg.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/aosd/aosd_cfg.c	Tue Apr 08 15:11:35 2008 -0500
@@ -23,7 +23,6 @@
 #include <glib.h>
 #include <stdlib.h>
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 
 
 static gint
--- a/src/arts/arts.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/arts/arts.h	Tue Apr 08 15:11:35 2008 -0500
@@ -25,7 +25,6 @@
 #include <string.h>
 
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include <audacious/i18n.h>
 # include "config.h"
 
--- a/src/audiocompress/audacious-glue.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/audiocompress/audacious-glue.c	Tue Apr 08 15:11:35 2008 -0500
@@ -11,7 +11,6 @@
 #include <audacious/i18n.h>
 #include <audacious/plugin.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
 
 #include "audiocompress_config.h"
 #include "compress.h"
--- a/src/blur_scope/blur_scope.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/blur_scope/blur_scope.c	Tue Apr 08 15:11:35 2008 -0500
@@ -27,7 +27,6 @@
 #include <string.h>
 #include <audacious/plugin.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
 #include "blur_scope.h"
 #include "bscope_logo.xpm"
 
--- a/src/blur_scope/config.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/blur_scope/config.c	Tue Apr 08 15:11:35 2008 -0500
@@ -5,7 +5,6 @@
 #include <gtk/gtk.h>
 
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include "blur_scope.h"
 
 
--- a/src/cdaudio-ng/cdaudio-ng.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/cdaudio-ng/cdaudio-ng.c	Tue Apr 08 15:11:35 2008 -0500
@@ -48,7 +48,6 @@
 #include <audacious/plugin.h>
 #include <audacious/i18n.h>
 #include <audacious/output.h>
-#include <audacious/playlist.h>
 #include <audacious/ui_plugin_menu.h>
 #include <audacious/util.h>
 
--- a/src/console/Audacious_Config.cxx	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/console/Audacious_Config.cxx	Tue Apr 08 15:11:35 2008 -0500
@@ -14,7 +14,6 @@
 #include <audacious/i18n.h>
 #include <audacious/plugin.h>
 #include <gtk/gtk.h>
-#include <audacious/configdb.h>
 #include "Audacious_Config.h"
 
 // TODO: add UI for echo
--- a/src/console/Audacious_Driver.cxx	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/console/Audacious_Driver.cxx	Tue Apr 08 15:11:35 2008 -0500
@@ -15,7 +15,6 @@
 #include <audacious/plugin.h>
 #include <audacious/util.h>
 #include <audacious/output.h>
-#include <audacious/playlist.h>
 }
 #include <string.h>
 #include <stdlib.h>
--- a/src/console/abstract_file.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/console/abstract_file.h	Tue Apr 08 15:11:35 2008 -0500
@@ -5,7 +5,6 @@
 #define ABSTRACT_FILE_H
 
 #include <stdio.h>
-#include <audacious/vfs.h>
 
 // Supports reading and finding out how many bytes are remaining
 class Data_Reader {
--- a/src/crystalizer/crystalizer.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/crystalizer/crystalizer.c	Tue Apr 08 15:11:35 2008 -0500
@@ -17,14 +17,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "config.h"
+
 #include <gtk/gtk.h>
 #include <audacious/i18n.h>
 #include <audacious/util.h>
-
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
-
-#include "../../config.h"
 
 static void init(void);
 static void configure(void);
--- a/src/cue/cuesheet.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/cue/cuesheet.c	Tue Apr 08 15:11:35 2008 -0500
@@ -25,10 +25,8 @@
 #include <ctype.h>
 #include <audacious/plugin.h>
 #include <audacious/output.h>
-#include <audacious/playlist.h>
 #include <audacious/util.h>
 #include <audacious/strings.h>
-#include <audacious/main.h>
 
 #define MAX_CUE_LINE_LENGTH 1000
 #define MAX_CUE_TRACKS 1000
@@ -87,6 +85,8 @@
 
 static InputPlayback *real_ip = NULL;
 
+static gchar *cue_fmts[] = { "cue", NULL };
+
 InputPlugin cue_ip =
 {
 	.description = "Cuesheet Plugin",	/* description */
@@ -98,6 +98,7 @@
 	.seek = seek,
 	.cleanup = cue_cleanup,		/* cleanup */
 	.get_song_tuple = get_tuple,
+	.vfs_extensions = cue_fmts,
 };
 
 InputPlugin *cue_iplist[] = { &cue_ip, NULL };
--- a/src/demac/ape.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/demac/ape.c	Tue Apr 08 15:11:35 2008 -0500
@@ -22,12 +22,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+/* #define DEBUG */
+
 #include <stdio.h>
 #include <stdlib.h> 
 #include <errno.h> 
 #include <string.h> 
 
-#include <audacious/vfs.h>
 #include <audacious/plugin.h> 
 
 #include "ape.h"
@@ -152,32 +153,48 @@
 #define ape_dumpinfo(a) ;
 #endif
 
+#define SEARCH_BUF_SZ 64*1024 /* search header in first 64k, it's enough for skipping id3v2 -- asphyx */
+static int
+find_header(VFSFile *pb, int16_t* ver)
+{
+    uint8_t sbuf[SEARCH_BUF_SZ];
+    unsigned i;
+    uint32_t tag;
+    uint8_t* s;
+
+    if (aud_vfs_fread(sbuf, 1, SEARCH_BUF_SZ, pb) < SEARCH_BUF_SZ) return -1;
+    for (i = 0; i < SEARCH_BUF_SZ - 6; i++) {
+        s = &(sbuf[i]);
+        tag = AV_RL32(s);
+        s += 4;
+        *ver = AV_RL16(s);
+        if (tag == MKTAG('M', 'A', 'C', ' ') &&
+            *ver >= APE_MIN_VERSION &&
+            *ver <= APE_MAX_VERSION) {
+            
+#ifdef DEBUG
+            fprintf(stderr, "found MAC header at offset 0x%0x, version %d.%d\n", i, *ver / 1000, (*ver % 1000) / 10);
+#endif
+            return i;
+        }
+    }
+
+    return -1;
+}
+
 int ape_read_header(APEContext *ape, VFSFile *pb, int probe_only)
 {
-    /*ByteIOContext *pb = &s->pb;
-    APEContext *ape = s->priv_data;
-    AVStream *st;*/
-    uint32_t tag;
-    int i;
-    //int total_blocks;
-    //int64_t pts;
-
-    /* TODO: Skip any leading junk such as id3v2 tags */
-    ape->junklength = 0;
+    int i, header_offset;
 
-    tag = get_le32(pb);
-    if (tag != MKTAG('M', 'A', 'C', ' '))
-        return -1;
-
-    ape->fileversion = get_le16(pb);
-
-    if (ape->fileversion < APE_MIN_VERSION || ape->fileversion > APE_MAX_VERSION) {
+    if ((header_offset = find_header(pb, &(ape->fileversion))) < 0) {
 #ifdef DEBUG
-        fprintf(stderr, "ape.c: ape_read_header(): Unsupported file version - %d.%02d\n",
-	        ape->fileversion / 1000, (ape->fileversion % 1000) / 10);
+        fprintf(stderr, "ape.c: ape_read_header(): header not found or unsupported version\n");
 #endif
         return -1;
     }
+    
+    aud_vfs_fseek(pb, header_offset + 6, SEEK_SET);
+    ape->junklength = header_offset;
 
     if (ape->fileversion >= 3980) {
         ape->padding1             = get_le16(pb);
@@ -262,7 +279,7 @@
           return AVERROR_NOMEM;
     }
 
-    ape->firstframe   = ape->junklength + ape->descriptorlength + ape->headerlength + ape->seektablelength + ape->wavheaderlength;
+    ape->firstframe = ape->junklength + ape->descriptorlength + ape->headerlength + ape->seektablelength + ape->wavheaderlength;
     ape->currentframe = 0;
 
     ape->totalsamples = ape->finalframeblocks;
@@ -280,7 +297,7 @@
         ape->frames[0].nblocks = ape->blocksperframe;
         ape->frames[0].skip    = 0;
         for (i = 1; i < ape->totalframes; i++) {
-            ape->frames[i].pos      = ape->seektable[i]; //ape->frames[i-1].pos + ape->blocksperframe;
+            ape->frames[i].pos      = ape->seektable[i] + ape->junklength;
             ape->frames[i].nblocks  = ape->blocksperframe;
             ape->frames[i - 1].size = ape->frames[i].pos - ape->frames[i - 1].pos;
             ape->frames[i].skip     = (ape->frames[i].pos - ape->frames[0].pos) & 3;
@@ -296,17 +313,14 @@
                 ape->frames[i].size += ape->frames[i].skip;
             }
             ape->frames[i].size = (ape->frames[i].size + 3) & ~3;
-    	    // Eugene:
-    	    ape->max_packet_size = MAX(ape->max_packet_size, ape->frames[i].size + 8);
-    	    // why +8? look in ape_read_packet()
+    	    ape->max_packet_size = MAX(ape->max_packet_size, ape->frames[i].size + 8); /* simplifies future frame buffer allocation --asphyx */
+    	    /* why +8? look in ape_read_packet() */
         }
         ape_dumpinfo(ape);
 
-    } // !probe_only
+    } /* !probe_only */
 
-    //ape->total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks;
     ape->frame_size = MAC_SUBFRAME_SIZE;
-    //ape->duration = (uint64_t) total_blocks * AV_TIME_BASE / ape->samplerate;
     ape->duration = (uint64_t) ape->totalsamples * AV_TIME_BASE / ape->samplerate;
 
 #ifdef DEBUG
@@ -315,15 +329,6 @@
 	    ape->totalframes, ape->blocksperframe, ape->channels == 2 ? "stereo" : "mono");
 #endif
 
-    //av_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate);
-
-    /*pts = 0;
-    for (i = 0; i < ape->totalframes; i++) {
-        ape->frames[i].pts = pts;
-        av_add_index_entry(st, ape->frames[i].pos, ape->frames[i].pts, 0, 0, AVINDEX_KEYFRAME);
-        pts += ape->blocksperframe / MAC_SUBFRAME_SIZE;
-    }*/
-
     return 0;
 }
 
@@ -347,21 +352,11 @@
     else
         nblocks = ape->blocksperframe;
 
-    /*if (av_new_packet(pkt,  ape->frames[ape->currentframe].size + extra_size) < 0)
-        return AVERROR_NOMEM;*/
-
     AV_WL32(pkt    , nblocks);
     AV_WL32(pkt + 4, ape->frames[ape->currentframe].skip);
 
     ret = aud_vfs_fread(pkt + extra_size, 1, ape->frames[ape->currentframe].size, pb);
 
-    /*pkt->pts = ape->frames[ape->currentframe].pts;
-    pkt->stream_index = 0;*/
-
-    /* note: we need to modify the packet size here to handle the last
-       packet */
-    /*pkt->size = ret + extra_size;*/
-
     ape->currentframe++;
     *pkt_size = ape->frames[ape->currentframe].size + extra_size;
 
@@ -374,18 +369,3 @@
     if(ape->seektable != NULL) free(ape->seektable);
     return 0;
 }
-
-/*
-static int ape_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
-{
-    AVStream *st = s->streams[stream_index];
-    APEContext *ape = s->priv_data;
-    int index = av_index_search_timestamp(st, timestamp, flags);
-
-    if (index < 0)
-        return -1;
-
-    ape->currentframe = index;
-    return 0;
-}*/
-
--- a/src/demac/ape.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/demac/ape.h	Tue Apr 08 15:11:35 2008 -0500
@@ -37,6 +37,12 @@
                                  ((uint64_t)e << 32) | ((uint64_t)f << 40) | ((uint64_t)g << 48) | ((uint64_t)h << 56))
 
 #define AV_TIME_BASE 1000
+#define AV_RL16(x) (((uint16_t)(((uint8_t*)(x))[1]) << 8) | (uint16_t)(((uint8_t*)(x))[0]))
+#define AV_RL32(x) (((uint32_t)(((uint8_t*)(x))[3]) << 24) | \
+                    ((uint32_t)(((uint8_t*)(x))[2]) << 16) | \
+                    ((uint32_t)(((uint8_t*)(x))[1]) <<  8) | \
+                     (uint32_t)(((uint8_t*)(x))[0]))
+
 #define AV_WL16(a,b) { \
           ((uint8_t*)(a))[0] =  (uint16_t)(b) & 0x00ff;        \
           ((uint8_t*)(a))[1] = ((uint16_t)(b) & 0xff00) >> 8; \
--- a/src/demac/apedec.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/demac/apedec.c	Tue Apr 08 15:11:35 2008 -0500
@@ -28,7 +28,6 @@
 #include <string.h> 
 #include <assert.h> 
 
-#include <audacious/vfs.h>
 #include <audacious/plugin.h> 
 
 #include "ape.h"
--- a/src/demac/apev2.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/demac/apev2.c	Tue Apr 08 15:11:35 2008 -0500
@@ -26,7 +26,6 @@
 
 #include <glib.h>
 #include <mowgli.h>
-#include <audacious/vfs.h>
 #include <audacious/plugin.h> 
 
 #include "ape.h"
--- a/src/demac/apev2.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/demac/apev2.h	Tue Apr 08 15:11:35 2008 -0500
@@ -2,7 +2,6 @@
 #define APEV2_H
 
 #include <mowgli.h>
-#include <audacious/vfs.h>
 
 mowgli_dictionary_t* parse_apev2_tag(VFSFile *vfd);
 gboolean write_apev2_tag(VFSFile *vfd, mowgli_dictionary_t *tag);
--- a/src/demac/plugin.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/demac/plugin.c	Tue Apr 08 15:11:35 2008 -0500
@@ -44,9 +44,7 @@
 #include <audacious/i18n.h> 
 
 #include <audacious/plugin.h> 
-#include <audacious/main.h> 
 #include <audacious/output.h> 
-#include <audacious/vfs.h> 
 #include <audacious/util.h> 
 
 #include "ape.h"
@@ -69,7 +67,7 @@
 static InputPlugin demac_ip;
 static GtkWidget *about_window = NULL;
 
-#ifdef DEBUG
+#ifdef AUD_DEBUG
 # include "crc.c"
 #endif
 
@@ -120,14 +118,12 @@
     APEDecoderContext *dec = NULL;
     int decoded_bytes;
     int pkt_size, bytes_used;
-#ifdef DEBUG
+#ifdef AUD_DEBUG
     uint32_t frame_crc;
 #endif
     
     if ((vfd = aud_vfs_fopen(pb->filename, "r")) == NULL) {
-#ifdef DEBUG
-        fprintf(stderr, "** demac: plugin.c: Error opening URI: %s\n", pb->filename);
-#endif
+        AUDDBG("** demac: plugin.c: Error opening URI: %s\n", pb->filename);
         pb->error = TRUE;
         goto cleanup;
     }
@@ -135,32 +131,24 @@
     ctx = calloc(sizeof(APEContext), 1);
     if(ape_read_header(ctx, vfd, 0) < 0) {
         pb->error = TRUE;
-#ifdef DEBUG
-        fprintf(stderr, "** demac: plugin.c: Cannot parse APE header or unsupported format: %s\n", pb->filename);
-#endif
+        AUDDBG("** demac: plugin.c: Cannot parse APE header or unsupported format: %s\n", pb->filename);
         goto cleanup;
     }
 
     dec = calloc(sizeof(APEDecoderContext), 1);
     if(ape_decode_init(dec, ctx) < 0) {
         pb->error = TRUE;
-#ifdef DEBUG
-        fprintf(stderr, "** demac: plugin.c: Error initializing decoder\n");
-#endif
+        AUDDBG("** demac: plugin.c: Error initializing decoder\n");
         goto cleanup;
     }
     
     frame_buf = malloc(ctx->max_packet_size);
    
-#ifdef DEBUG
-    fprintf(stderr, "** demac: plugin.c: Duration: %u msec\n", ctx->duration);
-#endif
+    AUDDBG("** demac: plugin.c: Duration: %u msec\n", ctx->duration);
 
     if(!pb->output->open_audio(FMT_S16_LE, ctx->samplerate, ctx->channels)) {
         pb->error = TRUE;
-#ifdef DEBUG
-        fprintf(stderr, "** demac: plugin.c: Cannot open audio.\n");
-#endif
+        AUDDBG("** demac: plugin.c: Cannot open audio.\n");
         goto cleanup;
     }
 
@@ -201,17 +189,12 @@
 	}
 
         ape_read_packet(ctx, vfd, frame_buf, &pkt_size);
-#ifdef DEBUG
+#ifdef AUD_DEBUG
         assert(pkt_size <= ctx->max_packet_size);
 	frame_crc = ape_initcrc();
 #endif
 	bytes_used = 0;
 
-/*#ifdef DEBUG
-        fprintf(stderr, "frame %d, %d samples, offset %d, size %d\n", ctx->currentframe-1,
-	        *((uint32_t*)frame_buf), *((uint32_t*)(frame_buf+4)), pkt_size);
-#endif*/
-
         /* Decode the frame a chunk at a time */
         while (playing && (bytes_used != pkt_size) && (local_seek_to == -1))
         {
@@ -232,17 +215,17 @@
 
             /* Write audio data */
             pb->pass_audio(pb, FMT_S16_LE, ctx->channels, decoded_bytes, wav, &playing);
-#if DEBUG
+#ifdef AUD_DEBUG
             frame_crc = ape_updatecrc(wav, decoded_bytes, frame_crc);
 #endif
 
         }
 
-#if DEBUG
+#ifdef AUD_DEBUG
         frame_crc = ape_finishcrc(frame_crc);
 
         if (dec->CRC != frame_crc) {
-            fprintf(stderr, "** demac: plugin.c: CRC error in frame %d\n", ctx->currentframe-1);
+            AUDDBG("** demac: plugin.c: CRC error in frame %d\n", ctx->currentframe-1);
         }
 #endif
     }
@@ -261,9 +244,7 @@
     if(ctx) {ape_read_close(ctx); free(ctx);}
     if(vfd) aud_vfs_fclose(vfd);
 
-#ifdef DEBUG
-    fprintf(stderr, "** demac: plugin.c: decoding loop finished\n");
-#endif
+    AUDDBG("** demac: plugin.c: decoding loop finished\n");
 
     return NULL;
 }
@@ -278,15 +259,9 @@
         g_mutex_lock(demac_mutex);
         pb->playing = 0;
         g_mutex_unlock(demac_mutex);
-#ifdef DEBUG
-        fprintf(stderr, "** demac: plugin.c: waiting for thread finished\n");
-#endif
-        //g_thread_join(pb->thread);
-	/* pb->thread is useless if input plugin initialized from **terrible** cue-sheet plugin */
+        AUDDBG("** demac: plugin.c: waiting for thread finished\n");
         g_thread_join(pb_thread);
-#ifdef DEBUG
-        fprintf(stderr, "** demac: plugin.c: thread finished\n");
-#endif
+        AUDDBG("** demac: plugin.c: thread finished\n");
     }
 }
 
@@ -299,9 +274,7 @@
 }
 
 Tuple *demac_probe_for_tuple (gchar *uri, VFSFile *vfd) {
-#ifdef DEBUG
-    fprintf(stderr, "** demac: plugin.c: demac_probe_for_tuple()\n");
-#endif
+    AUDDBG("** demac: plugin.c: demac_probe_for_tuple()\n");
     Tuple *tpl = aud_tuple_new_from_filename(uri);
     gchar codec_string[32];
 
@@ -327,9 +300,7 @@
     ape_read_header(ctx, vfd, 1);
     aud_tuple_associate_int(tpl, FIELD_LENGTH, NULL, ctx->duration);
     g_sprintf(codec_string, "Monkey's Audio v%4.2f", (float)ctx->fileversion/1000.0);
-#ifdef DEBUG
-    fprintf(stderr, "** demac: plugin.c: Codec: %s\n", codec_string);
-#endif
+    AUDDBG("** demac: plugin.c: Codec: %s\n", codec_string);
     aud_tuple_associate_string(tpl, FIELD_CODEC, NULL, codec_string);
     aud_tuple_associate_string(tpl, FIELD_QUALITY, NULL, "lossless");
     aud_tuple_associate_string(tpl, FIELD_MIMETYPE, NULL, "audio/x-ape");
@@ -343,9 +314,7 @@
 }
 
 Tuple *demac_get_tuple(char *filename) {
-#ifdef DEBUG
-  fprintf(stderr, "** demac: plugin.c: demac_get_tuple()\n");
-#endif
+  AUDDBG("** demac: plugin.c: demac_get_tuple()\n");
   VFSFile *vfd;
 
   if ((vfd = aud_vfs_fopen(filename, "r")) == NULL) {
@@ -361,9 +330,7 @@
   g_mutex_lock(demac_mutex);
   seek_to_msec = millisecond;
   g_mutex_unlock(demac_mutex);
-#ifdef DEBUG
-  fprintf(stderr, "** demac: plugin.c: seeking to %u msec\n", millisecond);
-#endif
+  AUDDBG("** demac: plugin.c: seeking to %u msec\n", millisecond);
 }
 
 static void demac_seek (InputPlayback *pb, gint time) {
--- a/src/dockalbumart/dockalbumart.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/dockalbumart/dockalbumart.c	Tue Apr 08 15:11:35 2008 -0500
@@ -29,7 +29,6 @@
 
 #include <audacious/plugin.h>
 #include <audacious/util.h>
-#include <audacious/playlist.h>
 
 #include "audacious_player.xpm"
 
--- a/src/echo_plugin/echo.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/echo_plugin/echo.c	Tue Apr 08 15:11:35 2008 -0500
@@ -1,14 +1,12 @@
+#include "config.h"
 #include <audacious/plugin.h>
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <gtk/gtk.h>
 #include <audacious/i18n.h>
-#include <audacious/configdb.h>
 #include "echo.h"
 
-#include "../../config.h"
 
 static void init(void);
 static void cleanup(void);
--- a/src/echo_plugin/gui.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/echo_plugin/gui.c	Tue Apr 08 15:11:35 2008 -0500
@@ -4,7 +4,6 @@
 #include <audacious/plugin.h>
 #include <audacious/i18n.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
 #include "echo.h"
 
 static const char *echo_about_text =
--- a/src/esd/audio.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/esd/audio.c	Tue Apr 08 15:11:35 2008 -0500
@@ -158,6 +158,9 @@
     case FMT_S16_NE:
         esd_format = ESD_BITS16;
         break;
+    default:
+        /* for warning suppression */
+        break;
     }
 
 #if (G_BYTE_ORDER == G_BIG_ENDIAN)
--- a/src/esd/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/esd/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -22,11 +22,11 @@
 #include "esdout.h"
 
 #include <glib.h>
+#include <audacious/plugin.h>
 #include <audacious/i18n.h>
 #include <gtk/gtk.h>
 #include <stdlib.h>
 
-#include <audacious/configdb.h>
 
 
 static GtkWidget *configure_win;
--- a/src/esd/init.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/esd/init.c	Tue Apr 08 15:11:35 2008 -0500
@@ -18,9 +18,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <esd.h>
-
-#include <audacious/configdb.h>
-
+#include <audacious/plugin.h>
 #include "esdout.h"
 
 
--- a/src/esd/mixer.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/esd/mixer.c	Tue Apr 08 15:11:35 2008 -0500
@@ -23,9 +23,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <esd.h>
-
-#include <audacious/configdb.h>
-
+#include <audacious/plugin.h>
+#include <audacious/util.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
@@ -45,7 +44,6 @@
 # define OSS_AVAILABLE FALSE
 #endif
 
-#include <audacious/util.h>
 
 #define QUERY_PLAYER_ID_ATTEMPTS 5
 
--- a/src/filewriter/filewriter.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/filewriter/filewriter.h	Tue Apr 08 15:11:35 2008 -0500
@@ -29,13 +29,9 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <audacious/main.h>
 #include <audacious/plugin.h>
-#include <audacious/playlist.h>
-#include <audacious/configdb.h>
 #include <audacious/i18n.h>
 #include <audacious/util.h>
-#include <audacious/vfs.h>
 
 struct format_info { 
     AFormat format;
--- a/src/flacng/flacng.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/flacng/flacng.h	Tue Apr 08 15:11:35 2008 -0500
@@ -22,7 +22,6 @@
 #include "config.h"
 #include <glib.h>
 #include <audacious/plugin.h>
-#include <audacious/main.h>
 #include <audacious/i18n.h>
 
 #define OUTPUT_BLOCK_SIZE (1024u)
--- a/src/flacng/seekable_stream_callbacks.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/flacng/seekable_stream_callbacks.c	Tue Apr 08 15:11:35 2008 -0500
@@ -20,7 +20,6 @@
 #include <string.h>
 #include <FLAC/all.h>
 #include <glib.h>
-#include <audacious/vfs.h>
 #include "flacng.h"
 #include "tools.h"
 #include "seekable_stream_callbacks.h"
--- a/src/hotkey/plugin.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/hotkey/plugin.c	Tue Apr 08 15:11:35 2008 -0500
@@ -41,7 +41,6 @@
 #include <gdk/gdkx.h>
 #include <audacious/plugin.h>
 #include <audacious/auddrct.h>
-#include <audacious/configdb.h>
 
 #include <audacious/i18n.h>
 
--- a/src/jack/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/jack/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -25,7 +25,6 @@
 #include "jack.h"
 
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include <audacious/i18n.h>
 # include "config.h"
 
--- a/src/jack/jack.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/jack/jack.c	Tue Apr 08 15:11:35 2008 -0500
@@ -7,7 +7,6 @@
  */
 
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include <audacious/util.h>
 #include <dlfcn.h>
 #include <gtk/gtk.h>
--- a/src/ladspa/ladspa.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/ladspa/ladspa.c	Tue Apr 08 15:11:35 2008 -0500
@@ -30,7 +30,6 @@
 #include <gtk/gtk.h>
 
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include <audacious/i18n.h>
 
 #include "ladspa.h"
--- a/src/lastfm/lastfm.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/lastfm/lastfm.c	Tue Apr 08 15:11:35 2008 -0500
@@ -39,9 +39,7 @@
  *              * Ordinary mp3 streams seem to share this behavior. Didnt tested if others do.
  */
 
-#include <audacious/vfs.h>
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include <libmowgli/mowgli_global_storage.h>
 #include <curl/curl.h>
 #include <glib.h>
--- a/src/lirc/lirc_cfg.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/lirc/lirc_cfg.c	Tue Apr 08 15:11:35 2008 -0500
@@ -3,7 +3,6 @@
 #include <gtk/gtk.h>
 #include <audacious/i18n.h>
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 
 #include "common.h"
 
--- a/src/m3u/m3u.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/m3u/m3u.c	Tue Apr 08 15:11:35 2008 -0500
@@ -34,10 +34,7 @@
 #include <sys/errno.h>
 
 #include <audacious/plugin.h>
-#include <audacious/main.h>
 #include <audacious/util.h>
-#include <audacious/playlist.h>
-#include <audacious/playlist_container.h>
 #include <audacious/strings.h>
 
 static void
--- a/src/madplug/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/madplug/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -25,7 +25,6 @@
 
 #include <gtk/gtk.h>
 #include <math.h>
-#include <audacious/configdb.h>
 
 static GtkWidget *configure_win = NULL;
 static audmad_config_t *oldconfig = NULL; // undo storage
--- a/src/madplug/decoder.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/madplug/decoder.c	Tue Apr 08 15:11:35 2008 -0500
@@ -28,7 +28,7 @@
 #include "plugin.h"
 #include "input.h"
 
-#define BUFFER_SIZE 16*1024
+#define BUFFER_SIZE (16*1024)
 #define N_AVERAGE_FRAMES 10
 
 void
--- a/src/madplug/input.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/madplug/input.c	Tue Apr 08 15:11:35 2008 -0500
@@ -138,7 +138,7 @@
 id3_ucs4_t *
 mad_ucs4dup(id3_ucs4_t *org)
 {
-    id3_ucs4_t *res = NULL;
+    id3_ucs4_t *res;
     size_t len = mad_ucs4len(org);
 
     res = g_malloc0((len + 1) * sizeof(id3_ucs4_t));
@@ -352,7 +352,7 @@
 static void
 input_read_tag(struct mad_info_t *info)
 {
-    gchar *string = NULL;
+    gchar *string;
     Tuple *tuple;
     glong curpos = 0;
 
@@ -360,7 +360,7 @@
 
     if (info->tuple != NULL)
         aud_tuple_free(info->tuple);
-        
+    
     tuple = aud_tuple_new_from_filename(info->filename);
     info->tuple = tuple;
 
@@ -393,11 +393,9 @@
     if (string) {
         aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi(string));
         g_free(string);
-        string = NULL;
     }
 
     // year
-    string = NULL;
     string = input_id3_get_string(info->tag, ID3_FRAME_YEAR);   //TDRC
     if (!string)
         string = input_id3_get_string(info->tag, "TYER");
@@ -405,7 +403,6 @@
     if (string) {
         aud_tuple_associate_int(tuple, FIELD_YEAR, NULL, atoi(string));
         g_free(string);
-        string = NULL;
     }
 
     // length
@@ -414,7 +411,6 @@
         aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, atoi(string));
         AUDDBG("input_read_tag: TLEN = %d\n", atoi(string));
         g_free(string);
-        string = NULL;
     } else
         aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
     
@@ -439,7 +435,7 @@
     gboolean metadata = FALSE;
 
     if(info->remote && mad_timer_count(info->duration, MAD_UNITS_SECONDS) <= 0){
-        gchar *tmp = NULL;
+        gchar *tmp;
 
 #ifdef DEBUG_INTENSIVELY
         AUDDBG("process_remote_meta\n");
@@ -452,28 +448,20 @@
         tmp = aud_vfs_get_metadata(info->infile, "track-name");
         if(tmp){
             metadata = TRUE;
-            gchar *scratch;
-
-            scratch = aud_str_to_utf8(tmp);
+            gchar *scratch = aud_str_to_utf8(tmp);
             aud_tuple_associate_string(info->tuple, FIELD_TITLE, NULL, scratch);
             g_free(scratch);
-
             g_free(tmp);
-            tmp = NULL;
         }
 
         tmp = aud_vfs_get_metadata(info->infile, "stream-name");
         if(tmp){
             metadata = TRUE;
-            gchar *scratch;
-
-            scratch = aud_str_to_utf8(tmp);
+            gchar *scratch = aud_str_to_utf8(tmp);
             aud_tuple_associate_string(info->tuple, FIELD_ALBUM, NULL, scratch);
             aud_tuple_associate_string(info->tuple, -1, "stream", scratch);
             g_free(scratch);
-
             g_free(tmp);
-            tmp = NULL;
         }
 
         if (metadata)
@@ -482,8 +470,8 @@
             gchar *realfn = g_filename_from_uri(info->filename, NULL, NULL);
             gchar *tmp2 = g_path_get_basename(realfn ? realfn : info->filename); // info->filename is uri. --yaz
             tmp = aud_str_to_utf8(tmp2);
-            g_free(tmp2); tmp2 = NULL;
-            g_free(realfn); realfn = NULL;
+            g_free(tmp2);
+            g_free(realfn);
 //            tmp = g_strdup(g_basename(info->filename)); //XXX maybe ok. --yaz
         }
 
@@ -587,37 +575,27 @@
 {
     AUDDBG("f: input_term\n");
 
-    if (info->title)
-        g_free(info->title);
-    if (info->url)
-        g_free(info->url);
-    if (info->filename)
-        g_free(info->filename);
+    g_free(info->title);
+    g_free(info->url);
+    g_free(info->filename);
     if (info->infile)
         aud_vfs_fclose(info->infile);
     if (info->id3file)
         id3_file_close(info->id3file);
 
-    if (info->replaygain_album_str)
-        g_free(info->replaygain_album_str);
-    if (info->replaygain_track_str)
-        g_free(info->replaygain_track_str);
-    if (info->replaygain_album_peak_str)
-        g_free(info->replaygain_album_peak_str);
-    if (info->replaygain_track_peak_str)
-        g_free(info->replaygain_track_peak_str);
-    if (info->mp3gain_undo_str)
-        g_free(info->mp3gain_undo_str);
-    if (info->mp3gain_minmax_str)
-        g_free(info->mp3gain_minmax_str);
+    g_free(info->replaygain_album_str);
+    g_free(info->replaygain_track_str);
+    g_free(info->replaygain_album_peak_str);
+    g_free(info->replaygain_track_peak_str);
+    g_free(info->mp3gain_undo_str);
+    g_free(info->mp3gain_minmax_str);
 
     if (info->tuple) {
         aud_tuple_free(info->tuple);
         info->tuple = NULL;
     }
 
-    if (info->prev_title)
-        g_free(info->prev_title);
+    g_free(info->prev_title);
 
     /* set everything to zero in case it gets used again. */
     memset(info, 0, sizeof(struct mad_info_t));
--- a/src/madplug/plugin.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/madplug/plugin.c	Tue Apr 08 15:11:35 2008 -0500
@@ -29,10 +29,8 @@
 
 #include <gtk/gtk.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
 #include <stdarg.h>
 #include <fcntl.h>
-#include <audacious/vfs.h>
 #include <sys/stat.h>
 #include "tuple.h"
 
--- a/src/madplug/plugin.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/madplug/plugin.h	Tue Apr 08 15:11:35 2008 -0500
@@ -37,7 +37,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <audacious/plugin.h>
-#include <audacious/main.h>
 #include <audacious/util.h>
 #include <audacious/strings.h>
 #include <audacious/i18n.h>
--- a/src/madplug/replaygain.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/madplug/replaygain.c	Tue Apr 08 15:11:35 2008 -0500
@@ -65,6 +65,9 @@
     return res;
 }
 
+/* Check for APE tag header in current file position, and read
+ * header data into given structure. Return 0 if OK.
+ */
 static gint checkAPEHeader(VFSFile * fp, ape_header_t *hdr)
 {
     /* Get magic id and check it */
@@ -90,7 +93,8 @@
     return 0;
 }
 
-// Reads APE v2.0 tag ending at current pos in fp
+/* Reads APE v2.0 tag ending at current pos in fp
+ */
 static gint
 readAPE2Tag(VFSFile * fp, struct mad_info_t *file_info)
 {
@@ -132,11 +136,6 @@
         if (*tmp != 0) break;
         tmp++;
         
-        fprintf(stderr, "wtf: vsize=%x, flags=%x, s=%s\n", vsize, flags, p);
-        if (vsize > end - tmp + 1) {
-            fprintf(stderr, "vsize > end - tmp + 1: %d > %d\n", vsize, end - tmp + 1);
-        }
-        
         if (isize > 0 && vsize > 0) {
             gdouble *scale = NULL;
             gchar **str = NULL;
--- a/src/madplug/xing.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/madplug/xing.c	Tue Apr 08 15:11:35 2008 -0500
@@ -20,7 +20,6 @@
  */
 
 #include <mad.h>
-
 #include "xing.h"
 
 #define XING_MAGIC	(('X' << 24) | ('i' << 16) | ('n' << 8) | 'g')
@@ -44,8 +43,7 @@
  * DESCRIPTION:	parse a Xing VBR header
  */
 int
-xing_parse(struct xing *xing, struct mad_bitptr ptr,
-               unsigned int bitlen)
+xing_parse(struct xing *xing, struct mad_bitptr ptr, guint bitlen)
 {
     if (bitlen < 64 || mad_bit_read(&ptr, 32) != XING_MAGIC)
         goto fail;
@@ -70,14 +68,14 @@
     }
 
     if (xing->flags & XING_TOC) {
-        int i;
+        gint i;
 
         if (bitlen < 800)
             goto fail;
 
         for (i = 0; i < 100; ++i)
             xing->toc[i] = mad_bit_read(&ptr, 8);
-
+        
         bitlen -= 800;
     }
 
--- a/src/madplug/xing.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/madplug/xing.h	Tue Apr 08 15:11:35 2008 -0500
@@ -20,15 +20,15 @@
 #ifndef XING_H
 #define XING_H
 
-#include "mad.h"
+#include <glib.h>
 
 struct xing
 {
-    long flags;                 /* valid fields (see below) */
-    unsigned long frames;       /* total number of frames */
-    unsigned long bytes;        /* total number of bytes */
-    unsigned char toc[100];     /* 100-point seek table */
-    long scale;                 /* ?? */
+    guint flags;        /* valid fields (see below) */
+    guint frames;       /* total number of frames */
+    guint bytes;        /* total number of bytes */
+    guchar toc[100];    /* 100-point seek table */
+    gulong scale;       /* ?? */
 };
 
 enum
--- a/src/modplug/modplugbmp.cxx	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/modplug/modplugbmp.cxx	Tue Apr 08 15:11:35 2008 -0500
@@ -15,7 +15,6 @@
 #include "stddefs.h"
 #include "archive/open.h"
 extern "C" {
-#include <audacious/configdb.h>
 #include <audacious/output.h>
 #include <audacious/strings.h>
 }
--- a/src/mtp_up/mtp.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/mtp_up/mtp.c	Tue Apr 08 15:11:35 2008 -0500
@@ -22,7 +22,6 @@
 #include <sys/types.h>
 #include <libmtp.h>
 #include <audacious/plugin.h>
-#include <audacious/playlist.h>
 #include <audacious/ui_plugin_menu.h>
 #include <audacious/i18n.h>
 
--- a/src/musepack/libmpc.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/musepack/libmpc.h	Tue Apr 08 15:11:35 2008 -0500
@@ -9,8 +9,6 @@
 #include <audacious/plugin.h>
 #include <audacious/output.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
-#include <audacious/main.h>
 #include <audacious/i18n.h>
 }
 
--- a/src/neon/neon.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/neon/neon.c	Tue Apr 08 15:11:35 2008 -0500
@@ -20,7 +20,6 @@
 #include "neon.h"
 
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 
 #include <ne_socket.h>
 #include <ne_utils.h>
--- a/src/null/null.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/null/null.c	Tue Apr 08 15:11:35 2008 -0500
@@ -19,14 +19,12 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
-
+#include "config.h"
 #include <glib.h>
-#include <audacious/i18n.h>
 #include <gtk/gtk.h>
 #include <audacious/plugin.h>
+#include <audacious/i18n.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
-#include "../../config.h"
 
 static GTimer *timer;
 static gulong offset_time, written;
--- a/src/pls/pls.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/pls/pls.c	Tue Apr 08 15:11:35 2008 -0500
@@ -33,10 +33,7 @@
 #include <sys/stat.h>
 #include <sys/errno.h>
 
-#include <audacious/main.h>
 #include <audacious/util.h>
-#include <audacious/playlist.h>
-#include <audacious/playlist_container.h>
 #include <audacious/plugin.h>
 #include <audacious/strings.h>
 
--- a/src/pulse_audio/pulse_audio.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/pulse_audio/pulse_audio.c	Tue Apr 08 15:11:35 2008 -0500
@@ -28,7 +28,6 @@
 
 #include <gtk/gtk.h>
 #include <audacious/plugin.h>
-#include <audacious/playlist.h>
 #include <audacious/util.h>
 #include <audacious/i18n.h>
 
--- a/src/rootvis/config_backend.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/rootvis/config_backend.c	Tue Apr 08 15:11:35 2008 -0500
@@ -1,8 +1,7 @@
 #include <string.h>
-#include <audacious/configdb.h>
-
-#include <rootvis.h>
-#include <config.h>
+#include <audacious/plugin.h>
+#include "rootvis.h"
+#include "config.h"
 
 extern void config_def_init(void);
 extern void config_frontend_init(void);
--- a/src/rootvis/config_frontend.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/rootvis/config_frontend.c	Tue Apr 08 15:11:35 2008 -0500
@@ -1,9 +1,7 @@
 #include <stdarg.h>
 #include <string.h>
-
-#include <rootvis.h>
-
-#include <config_frontend.h>
+#include "rootvis.h"
+#include "config_frontend.h"
 
 extern GtkWidget *frontend_create_channel(int channel);
 extern GtkWidget *frontend_create_main(void);
--- a/src/rootvis/config_frontend.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/rootvis/config_frontend.h	Tue Apr 08 15:11:35 2008 -0500
@@ -1,4 +1,4 @@
-#include <config.h>
+#include "config.h"
 
 #define VBOX  	1
 #define HBOX  	2
--- a/src/scrobbler/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/scrobbler/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -4,7 +4,6 @@
 
 #include <audacious/util.h>
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
--- a/src/scrobbler/gtkstuff.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/scrobbler/gtkstuff.c	Tue Apr 08 15:11:35 2008 -0500
@@ -1,5 +1,4 @@
 #include <audacious/util.h>
-#include <audacious/configdb.h>
 
 #include <glib.h>
 #include <audacious/i18n.h>
--- a/src/scrobbler/plugin.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/scrobbler/plugin.c	Tue Apr 08 15:11:35 2008 -0500
@@ -9,11 +9,8 @@
 
 #include <audacious/plugin.h>
 #include <audacious/ui_preferences.h>
-#include <audacious/playlist.h>
-#include <audacious/configdb.h>
 #include <audacious/hook.h>
 #include <audacious/strings.h>
-#include <audacious/main.h>
 
 #include <unistd.h>
 #include <stdio.h>
--- a/src/sexypsf/plugin.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sexypsf/plugin.c	Tue Apr 08 15:11:35 2008 -0500
@@ -18,7 +18,6 @@
 
 #include <audacious/plugin.h>
 #include <audacious/output.h>
-#include <audacious/main.h>
 #include <audacious/util.h>
 #include <stdio.h>
 #include <stdlib.h>
--- a/src/shnplug/gtk.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/shnplug/gtk.c	Tue Apr 08 15:11:35 2008 -0500
@@ -23,7 +23,6 @@
 #include <stdlib.h>
 #include <glib.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
 #include "shorten.h"
 
 #undef XMMS_SHN_LOAD_TEXTFILES
--- a/src/shnplug/shn.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/shnplug/shn.c	Tue Apr 08 15:11:35 2008 -0500
@@ -25,7 +25,6 @@
 #include <math.h>
 #include <glib.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
 #include "shorten.h"
 
 #ifdef HAVE_CONFIG_H
--- a/src/shnplug/shn.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/shnplug/shn.h	Tue Apr 08 15:11:35 2008 -0500
@@ -32,7 +32,6 @@
 #include <sys/stat.h>
 
 #include <audacious/plugin.h>
-#include <audacious/vfs.h>
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
--- a/src/sid/xmms-sid.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xmms-sid.c	Tue Apr 08 15:11:35 2008 -0500
@@ -27,8 +27,6 @@
 #endif
 
 #include <stdarg.h>
-#include <gdk/gdkkeysyms.h>
-
 #include "xs_config.h"
 #include "xs_length.h"
 #include "xs_stil.h"
@@ -54,62 +52,62 @@
 /*
  * List of players and links to their functions
  */
-t_xs_player xs_playerlist[] = {
+static const xs_player_t xs_playerlist[] = {
 #ifdef HAVE_SIDPLAY1
-	{XS_ENG_SIDPLAY1,
-	 xs_sidplay1_probe,
-	 xs_sidplay1_init, xs_sidplay1_close,
-	 xs_sidplay1_initsong, xs_sidplay1_fillbuffer,
-	 xs_sidplay1_load, xs_sidplay1_delete,
-	 xs_sidplay1_getinfo, xs_sidplay1_updateinfo,
-	 NULL
-	},
+    {XS_ENG_SIDPLAY1,
+     xs_sidplay1_probe,
+     xs_sidplay1_init, xs_sidplay1_close,
+     xs_sidplay1_initsong, xs_sidplay1_fillbuffer,
+     xs_sidplay1_load, xs_sidplay1_delete,
+     xs_sidplay1_getinfo, xs_sidplay1_updateinfo,
+     NULL
+    },
 #endif
 #ifdef HAVE_SIDPLAY2
-	{XS_ENG_SIDPLAY2,
-	 xs_sidplay2_probe,
-	 xs_sidplay2_init, xs_sidplay2_close,
-	 xs_sidplay2_initsong, xs_sidplay2_fillbuffer,
-	 xs_sidplay2_load, xs_sidplay2_delete,
-	 xs_sidplay2_getinfo, xs_sidplay2_updateinfo,
-	 xs_sidplay2_flush
-	},
+    {XS_ENG_SIDPLAY2,
+     xs_sidplay2_probe,
+     xs_sidplay2_init, xs_sidplay2_close,
+     xs_sidplay2_initsong, xs_sidplay2_fillbuffer,
+     xs_sidplay2_load, xs_sidplay2_delete,
+     xs_sidplay2_getinfo, xs_sidplay2_updateinfo,
+     xs_sidplay2_flush
+    },
 #endif
 };
 
-const gint xs_nplayerlist = (sizeof(xs_playerlist) / sizeof(t_xs_player));
+static const gint xs_nplayerlist = (sizeof(xs_playerlist) / sizeof(xs_playerlist[0]));
 
 
 /*
  * Global variables
  */
-t_xs_status xs_status;
+xs_status_t xs_status;
 XS_MUTEX(xs_status);
 static XS_THREAD_T xs_decode_thread;
 
-static void xs_get_song_tuple_info(Tuple *pResult, t_xs_tuneinfo *pInfo, gint subTune);
+static void xs_get_song_tuple_info(Tuple *pResult, xs_tuneinfo_t *pInfo, gint subTune);
 
 /*
  * Error messages
  */
 void xs_error(const char *fmt, ...)
 {
-	va_list ap;
-	fprintf(stderr, "AUD-SID: ");
-	va_start(ap, fmt);
-	vfprintf(stderr, fmt, ap);
-	va_end(ap);
+    va_list ap;
+    fprintf(stderr, "AUD-SID: ");
+    va_start(ap, fmt);
+    vfprintf(stderr, fmt, ap);
+    va_end(ap);
 }
 
 #ifndef DEBUG_NP
 void XSDEBUG(const char *fmt, ...)
 {
 #ifdef DEBUG
-	va_list ap;
-	fprintf(stderr, "XSDEBUG: ");
-	va_start(ap, fmt);
-	vfprintf(stderr, fmt, ap);
-	va_end(ap);
+    va_list ap;
+    fprintf(stderr, "XSDEBUG: ");
+    va_start(ap, fmt);
+    vfprintf(stderr, fmt, ap);
+    va_end(ap);
 #endif
 }
 #endif
@@ -120,94 +118,94 @@
  */
 void xs_reinit(void)
 {
-	gint iPlayer;
-	gboolean isInitialized;
+    gint player;
+    gboolean isInitialized;
 
-	XSDEBUG("xs_reinit() thread = %p\n", g_thread_self());
+    XSDEBUG("xs_reinit() thread = %p\n", g_thread_self());
 
-	/* Stop playing, if we are */
-	XS_MUTEX_LOCK(xs_status);
-	if (xs_status.isPlaying) {
-		XS_MUTEX_UNLOCK(xs_status);
-		xs_stop(NULL);
-	} else {
-		XS_MUTEX_UNLOCK(xs_status);
-	}
+    /* Stop playing, if we are */
+    XS_MUTEX_LOCK(xs_status);
+    if (xs_status.isPlaying) {
+        XS_MUTEX_UNLOCK(xs_status);
+        xs_stop(NULL);
+    } else {
+        XS_MUTEX_UNLOCK(xs_status);
+    }
 
-	XS_MUTEX_LOCK(xs_status);
-	XS_MUTEX_LOCK(xs_cfg);
+    XS_MUTEX_LOCK(xs_status);
+    XS_MUTEX_LOCK(xs_cfg);
 
-	/* Initialize status and sanitize configuration */
-	memset(&xs_status, 0, sizeof(xs_status));
+    /* Initialize status and sanitize configuration */
+    memset(&xs_status, 0, sizeof(xs_status));
 
-	if (xs_cfg.audioFrequency < 8000)
-		xs_cfg.audioFrequency = 8000;
+    if (xs_cfg.audioFrequency < 8000)
+        xs_cfg.audioFrequency = 8000;
 
-	if (xs_cfg.oversampleFactor < XS_MIN_OVERSAMPLE)
-		xs_cfg.oversampleFactor = XS_MIN_OVERSAMPLE;
-	else if (xs_cfg.oversampleFactor > XS_MAX_OVERSAMPLE)
-		xs_cfg.oversampleFactor = XS_MAX_OVERSAMPLE;
+    if (xs_cfg.oversampleFactor < XS_MIN_OVERSAMPLE)
+        xs_cfg.oversampleFactor = XS_MIN_OVERSAMPLE;
+    else if (xs_cfg.oversampleFactor > XS_MAX_OVERSAMPLE)
+        xs_cfg.oversampleFactor = XS_MAX_OVERSAMPLE;
 
-	if (xs_cfg.audioChannels != XS_CHN_MONO)
-		xs_cfg.oversampleEnable = FALSE;
+    if (xs_cfg.audioChannels != XS_CHN_MONO)
+        xs_cfg.oversampleEnable = FALSE;
 
-	xs_status.audioFrequency = xs_cfg.audioFrequency;
-	xs_status.audioBitsPerSample = xs_cfg.audioBitsPerSample;
-	xs_status.audioChannels = xs_cfg.audioChannels;
-	xs_status.audioFormat = -1;
-	xs_status.oversampleEnable = xs_cfg.oversampleEnable;
-	xs_status.oversampleFactor = xs_cfg.oversampleFactor;
+    xs_status.audioFrequency = xs_cfg.audioFrequency;
+    xs_status.audioBitsPerSample = xs_cfg.audioBitsPerSample;
+    xs_status.audioChannels = xs_cfg.audioChannels;
+    xs_status.audioFormat = -1;
+    xs_status.oversampleEnable = xs_cfg.oversampleEnable;
+    xs_status.oversampleFactor = xs_cfg.oversampleFactor;
 
-	/* Try to initialize emulator engine */
-	XSDEBUG("initializing emulator engine #%i...\n", xs_cfg.playerEngine);
+    /* Try to initialize emulator engine */
+    XSDEBUG("initializing emulator engine #%i...\n", xs_cfg.playerEngine);
 
-	iPlayer = 0;
-	isInitialized = FALSE;
-	while ((iPlayer < xs_nplayerlist) && !isInitialized) {
-		if (xs_playerlist[iPlayer].plrIdent == xs_cfg.playerEngine) {
-			if (xs_playerlist[iPlayer].plrInit(&xs_status)) {
-				isInitialized = TRUE;
-				xs_status.sidPlayer = (t_xs_player *) & xs_playerlist[iPlayer];
-			}
-		}
-		iPlayer++;
-	}
+    player = 0;
+    isInitialized = FALSE;
+    while ((player < xs_nplayerlist) && !isInitialized) {
+        if (xs_playerlist[player].plrIdent == xs_cfg.playerEngine) {
+            if (xs_playerlist[player].plrInit(&xs_status)) {
+                isInitialized = TRUE;
+                xs_status.sidPlayer = (xs_player_t *) & xs_playerlist[player];
+            }
+        }
+        player++;
+    }
 
-	XSDEBUG("init#1: %s, %i\n", (isInitialized) ? "OK" : "FAILED", iPlayer);
+    XSDEBUG("init#1: %s, %i\n", (isInitialized) ? "OK" : "FAILED", player);
 
-	iPlayer = 0;
-	while ((iPlayer < xs_nplayerlist) && !isInitialized) {
-		if (xs_playerlist[iPlayer].plrInit(&xs_status)) {
-			isInitialized = TRUE;
-			xs_status.sidPlayer = (t_xs_player *) & xs_playerlist[iPlayer];
-			xs_cfg.playerEngine = xs_playerlist[iPlayer].plrIdent;
-		} else
-			iPlayer++;
-	}
+    player = 0;
+    while ((player < xs_nplayerlist) && !isInitialized) {
+        if (xs_playerlist[player].plrInit(&xs_status)) {
+            isInitialized = TRUE;
+            xs_status.sidPlayer = (xs_player_t *) & xs_playerlist[player];
+            xs_cfg.playerEngine = xs_playerlist[player].plrIdent;
+        } else
+            player++;
+    }
 
-	XSDEBUG("init#2: %s, %i\n", (isInitialized) ? "OK" : "FAILED", iPlayer);
+    XSDEBUG("init#2: %s, %i\n", (isInitialized) ? "OK" : "FAILED", player);
 
 
-	/* Get settings back, in case the chosen emulator backend changed them */
-	xs_cfg.audioFrequency = xs_status.audioFrequency;
-	xs_cfg.audioBitsPerSample = xs_status.audioBitsPerSample;
-	xs_cfg.audioChannels = xs_status.audioChannels;
-	xs_cfg.oversampleEnable = xs_status.oversampleEnable;
+    /* Get settings back, in case the chosen emulator backend changed them */
+    xs_cfg.audioFrequency = xs_status.audioFrequency;
+    xs_cfg.audioBitsPerSample = xs_status.audioBitsPerSample;
+    xs_cfg.audioChannels = xs_status.audioChannels;
+    xs_cfg.oversampleEnable = xs_status.oversampleEnable;
 
-	XS_MUTEX_UNLOCK(xs_status);
-	XS_MUTEX_UNLOCK(xs_cfg);
+    XS_MUTEX_UNLOCK(xs_status);
+    XS_MUTEX_UNLOCK(xs_cfg);
 
-	/* Initialize song-length database */
-	xs_songlen_close();
-	if (xs_cfg.songlenDBEnable && (xs_songlen_init() != 0)) {
-		xs_error("Error initializing song-length database!\n");
-	}
+    /* Initialize song-length database */
+    xs_songlen_close();
+    if (xs_cfg.songlenDBEnable && (xs_songlen_init() != 0)) {
+        xs_error("Error initializing song-length database!\n");
+    }
 
-	/* Initialize STIL database */
-	xs_stil_close();
-	if (xs_cfg.stilDBEnable && (xs_stil_init() != 0)) {
-		xs_error("Error initializing STIL database!\n");
-	}
+    /* Initialize STIL database */
+    xs_stil_close();
+    if (xs_cfg.stilDBEnable && (xs_stil_init() != 0)) {
+        xs_error("Error initializing STIL database!\n");
+    }
 
 }
 
@@ -217,16 +215,16 @@
  */
 void xs_init(void)
 {
-	XSDEBUG("xs_init()\n");
+    XSDEBUG("xs_init()\n");
 
-	/* Initialize and get configuration */
-	xs_init_configuration();
-	xs_read_configuration();
+    /* Initialize and get configuration */
+    xs_init_configuration();
+    xs_read_configuration();
 
-	/* Initialize subsystems */
-	xs_reinit();
+    /* Initialize subsystems */
+    xs_reinit();
 
-	XSDEBUG("OK\n");
+    XSDEBUG("OK\n");
 }
 
 
@@ -235,50 +233,50 @@
  */
 void xs_close(void)
 {
-	XSDEBUG("xs_close(): shutting down...\n");
+    XSDEBUG("xs_close(): shutting down...\n");
 
-	/* Stop playing, free structures */
-	xs_stop(NULL);
+    /* Stop playing, free structures */
+    xs_stop(NULL);
 
-	xs_tuneinfo_free(xs_status.tuneInfo);
-	xs_status.tuneInfo = NULL;
-	xs_status.sidPlayer->plrDeleteSID(&xs_status);
-	xs_status.sidPlayer->plrClose(&xs_status);
+    xs_tuneinfo_free(xs_status.tuneInfo);
+    xs_status.tuneInfo = NULL;
+    xs_status.sidPlayer->plrDeleteSID(&xs_status);
+    xs_status.sidPlayer->plrClose(&xs_status);
 
-	xs_songlen_close();
-	xs_stil_close();
+    xs_songlen_close();
+    xs_stil_close();
 
-	XSDEBUG("shutdown finished.\n");
+    XSDEBUG("shutdown finished.\n");
 }
 
 
 /*
  * Check whether the given file is handled by this plugin
  */
-static gchar * xs_has_tracknumber(gchar *pcFilename)
+static gchar * xs_has_tracknumber(gchar *filename)
 {
-	gchar *tmpSep = xs_strrchr(pcFilename, '?');
-	if (tmpSep && g_ascii_isdigit(*(tmpSep + 1)))
-		return tmpSep;
-	else
-		return NULL;
+    gchar *sep = xs_strrchr(filename, '?');
+    if (sep && g_ascii_isdigit(*(sep + 1)))
+        return sep;
+    else
+        return NULL;
 }
 
-gboolean xs_get_trackinfo(const gchar *pcFilename, gchar **pcResult, gint *pTrack)
+gboolean xs_get_trackinfo(const gchar *filename, gchar **result, gint *track)
 {
-	gchar *tmpSep;
+    gchar *sep;
 
-	*pcResult = g_strdup(pcFilename);
-	tmpSep = xs_has_tracknumber(*pcResult);
+    *result = g_strdup(filename);
+    sep = xs_has_tracknumber(*result);
 
-	if (tmpSep) {
-		*tmpSep = '\0';
-		*pTrack = atoi(tmpSep + 1);
-		return TRUE;
-	} else {
-		*pTrack = -1;
-		return FALSE;
-	}
+    if (sep) {
+        *sep = '\0';
+        *track = atoi(sep + 1);
+        return TRUE;
+    } else {
+        *track = -1;
+        return FALSE;
+    }
 }
 
 
@@ -287,212 +285,212 @@
  */
 void xs_play_file(InputPlayback *pb)
 {
-	t_xs_tuneinfo *tmpTune;
-	gboolean audioOpen = FALSE;
-	gint audioGot, tmpLength, subTune;
-	gchar *tmpFilename, *audioBuffer = NULL, *oversampleBuffer = NULL, *tmpTitle;
-	Tuple *tmpTuple;
+    xs_tuneinfo_t *tmpTune;
+    gboolean audioOpen = FALSE;
+    gint audioGot, tmpLength, subTune;
+    gchar *tmpFilename, *audioBuffer = NULL, *oversampleBuffer = NULL, *tmpTitle;
+    Tuple *tmpTuple;
 
-	assert(pb);
-	assert(xs_status.sidPlayer);
-	
-	XSDEBUG("play '%s'\n", pb->filename);
+    assert(pb);
+    assert(xs_status.sidPlayer);
+    
+    XSDEBUG("play '%s'\n", pb->filename);
 
-	XS_MUTEX_LOCK(xs_status);
+    XS_MUTEX_LOCK(xs_status);
 
-	/* Get tune information */
-	xs_get_trackinfo(pb->filename, &tmpFilename, &subTune);
-	if ((xs_status.tuneInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename)) == NULL) {
-		XS_MUTEX_UNLOCK(xs_status);
-		g_free(tmpFilename);
-		return;
-	}
+    /* Get tune information */
+    xs_get_trackinfo(pb->filename, &tmpFilename, &subTune);
+    if ((xs_status.tuneInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename)) == NULL) {
+        XS_MUTEX_UNLOCK(xs_status);
+        g_free(tmpFilename);
+        return;
+    }
 
-	/* Initialize the tune */
-	if (!xs_status.sidPlayer->plrLoadSID(&xs_status, tmpFilename)) {
-		XS_MUTEX_UNLOCK(xs_status);
-		g_free(tmpFilename);
-		xs_tuneinfo_free(xs_status.tuneInfo);
-		xs_status.tuneInfo = NULL;
-		return;
-	}
-	
-	g_free(tmpFilename);
-	tmpFilename = NULL;
+    /* Initialize the tune */
+    if (!xs_status.sidPlayer->plrLoadSID(&xs_status, tmpFilename)) {
+        XS_MUTEX_UNLOCK(xs_status);
+        g_free(tmpFilename);
+        xs_tuneinfo_free(xs_status.tuneInfo);
+        xs_status.tuneInfo = NULL;
+        return;
+    }
+    
+    g_free(tmpFilename);
+    tmpFilename = NULL;
 
-	XSDEBUG("load ok\n");
+    XSDEBUG("load ok\n");
 
-	/* Set general status information */
-	xs_status.isPlaying = TRUE;
-	xs_status.isError = FALSE;
-	tmpTune = xs_status.tuneInfo;
+    /* Set general status information */
+    xs_status.isPlaying = TRUE;
+    xs_status.isError = FALSE;
+    tmpTune = xs_status.tuneInfo;
 
-	if (subTune < 1 || subTune > xs_status.tuneInfo->nsubTunes)
-		xs_status.currSong = xs_status.tuneInfo->startTune;
-	else
-		xs_status.currSong = subTune;
+    if (subTune < 1 || subTune > xs_status.tuneInfo->nsubTunes)
+        xs_status.currSong = xs_status.tuneInfo->startTune;
+    else
+        xs_status.currSong = subTune;
 
-	XSDEBUG("subtune #%i selected (#%d wanted), initializing...\n", xs_status.currSong, subTune);
+    XSDEBUG("subtune #%i selected (#%d wanted), initializing...\n", xs_status.currSong, subTune);
 
 
-	/* We are ready */
-	xs_decode_thread = g_thread_self();
-	XSDEBUG("playing thread = %p\n", xs_decode_thread);
-	pb->set_pb_ready(pb);
+    /* We are ready */
+    xs_decode_thread = g_thread_self();
+    XSDEBUG("playing thread = %p\n", xs_decode_thread);
+    pb->set_pb_ready(pb);
 
 
-	/* Allocate audio buffer */
-	audioBuffer = (gchar *) g_malloc(XS_AUDIOBUF_SIZE);
-	if (audioBuffer == NULL) {
-		xs_error("Couldn't allocate memory for audio data buffer!\n");
-		XS_MUTEX_UNLOCK(xs_status);
-		goto xs_err_exit;
-	}
-	
-	if (xs_status.oversampleEnable) {
-		oversampleBuffer = (gchar *) g_malloc(XS_AUDIOBUF_SIZE * xs_status.oversampleFactor);
-		if (oversampleBuffer == NULL) {
-			xs_error("Couldn't allocate memory for audio oversampling buffer!\n");
-			XS_MUTEX_UNLOCK(xs_status);
-			goto xs_err_exit;
-		}
-	}
+    /* Allocate audio buffer */
+    audioBuffer = (gchar *) g_malloc(XS_AUDIOBUF_SIZE);
+    if (audioBuffer == NULL) {
+        xs_error("Couldn't allocate memory for audio data buffer!\n");
+        XS_MUTEX_UNLOCK(xs_status);
+        goto xs_err_exit;
+    }
+    
+    if (xs_status.oversampleEnable) {
+        oversampleBuffer = (gchar *) g_malloc(XS_AUDIOBUF_SIZE * xs_status.oversampleFactor);
+        if (oversampleBuffer == NULL) {
+            xs_error("Couldn't allocate memory for audio oversampling buffer!\n");
+            XS_MUTEX_UNLOCK(xs_status);
+            goto xs_err_exit;
+        }
+    }
 
 
-	/* Check minimum playtime */
-	tmpLength = tmpTune->subTunes[xs_status.currSong - 1].tuneLength;
-	if (xs_cfg.playMinTimeEnable && (tmpLength >= 0)) {
-		if (tmpLength < xs_cfg.playMinTime)
-			tmpLength = xs_cfg.playMinTime;
-	}
+    /* Check minimum playtime */
+    tmpLength = tmpTune->subTunes[xs_status.currSong - 1].tuneLength;
+    if (xs_cfg.playMinTimeEnable && (tmpLength >= 0)) {
+        if (tmpLength < xs_cfg.playMinTime)
+            tmpLength = xs_cfg.playMinTime;
+    }
 
-	/* Initialize song */
-	if (!xs_status.sidPlayer->plrInitSong(&xs_status)) {
-		xs_error("Couldn't initialize SID-tune '%s' (sub-tune #%i)!\n",
-			tmpTune->sidFilename, xs_status.currSong);
-		XS_MUTEX_UNLOCK(xs_status);
-		goto xs_err_exit;
-	}
-		
-	/* Open the audio output */
-	XSDEBUG("open audio output (%d, %d, %d)\n",
-		xs_status.audioFormat, xs_status.audioFrequency, xs_status.audioChannels);
-		
-	if (!pb->output->open_audio(xs_status.audioFormat, xs_status.audioFrequency, xs_status.audioChannels)) {
-		xs_error("Couldn't open audio output (fmt=%x, freq=%i, nchan=%i)!\n",
-			xs_status.audioFormat,
-			xs_status.audioFrequency,
-			xs_status.audioChannels);
+    /* Initialize song */
+    if (!xs_status.sidPlayer->plrInitSong(&xs_status)) {
+        xs_error("Couldn't initialize SID-tune '%s' (sub-tune #%i)!\n",
+            tmpTune->sidFilename, xs_status.currSong);
+        XS_MUTEX_UNLOCK(xs_status);
+        goto xs_err_exit;
+    }
+        
+    /* Open the audio output */
+    XSDEBUG("open audio output (%d, %d, %d)\n",
+        xs_status.audioFormat, xs_status.audioFrequency, xs_status.audioChannels);
+        
+    if (!pb->output->open_audio(xs_status.audioFormat, xs_status.audioFrequency, xs_status.audioChannels)) {
+        xs_error("Couldn't open audio output (fmt=%x, freq=%i, nchan=%i)!\n",
+            xs_status.audioFormat,
+            xs_status.audioFrequency,
+            xs_status.audioChannels);
 
-		xs_status.isError = TRUE;
-		XS_MUTEX_UNLOCK(xs_status);
-		goto xs_err_exit;
-	}
+        xs_status.isError = TRUE;
+        XS_MUTEX_UNLOCK(xs_status);
+        goto xs_err_exit;
+    }
 
-	audioOpen = TRUE;
+    audioOpen = TRUE;
 
-	/* Set song information for current subtune */
-	XSDEBUG("foobar #1\n");
-	xs_status.sidPlayer->plrUpdateSIDInfo(&xs_status);
-	XS_MUTEX_UNLOCK(xs_status);
-	tmpTuple = aud_tuple_new_from_filename(tmpTune->sidFilename);
-	xs_get_song_tuple_info(tmpTuple, tmpTune, xs_status.currSong);
+    /* Set song information for current subtune */
+    XSDEBUG("foobar #1\n");
+    xs_status.sidPlayer->plrUpdateSIDInfo(&xs_status);
+    XS_MUTEX_UNLOCK(xs_status);
+    tmpTuple = aud_tuple_new_from_filename(tmpTune->sidFilename);
+    xs_get_song_tuple_info(tmpTuple, tmpTune, xs_status.currSong);
 
-	tmpTitle = aud_tuple_formatter_process_string(tmpTuple,
-		xs_cfg.titleOverride ? xs_cfg.titleFormat : aud_get_gentitle_format());
-	
-	XSDEBUG("foobar #4\n");
-	XS_MUTEX_LOCK(xs_status);
-	pb->set_params(pb,
-		tmpTitle,
-		(tmpLength > 0) ? (tmpLength * 1000) : 0,
-		-1,
-		xs_status.audioFrequency,
-		xs_status.audioChannels);
-		
-	g_free(tmpTitle);
-	
-	XS_MUTEX_UNLOCK(xs_status);
-	XSDEBUG("playing\n");
-	while (xs_status.isPlaying) {
-		/* Render audio data */
-		XS_MUTEX_LOCK(xs_status);
-		if (xs_status.oversampleEnable) {
-			/* Perform oversampled rendering */
-			audioGot = xs_status.sidPlayer->plrFillBuffer(
-				&xs_status,
-				oversampleBuffer,
-				(XS_AUDIOBUF_SIZE * xs_status.oversampleFactor));
+    tmpTitle = aud_tuple_formatter_process_string(tmpTuple,
+        xs_cfg.titleOverride ? xs_cfg.titleFormat : aud_get_gentitle_format());
+    
+    XSDEBUG("foobar #4\n");
+    XS_MUTEX_LOCK(xs_status);
+    pb->set_params(pb,
+        tmpTitle,
+        (tmpLength > 0) ? (tmpLength * 1000) : 0,
+        -1,
+        xs_status.audioFrequency,
+        xs_status.audioChannels);
+        
+    g_free(tmpTitle);
+    
+    XS_MUTEX_UNLOCK(xs_status);
+    XSDEBUG("playing\n");
+    while (xs_status.isPlaying) {
+        /* Render audio data */
+        XS_MUTEX_LOCK(xs_status);
+        if (xs_status.oversampleEnable) {
+            /* Perform oversampled rendering */
+            audioGot = xs_status.sidPlayer->plrFillBuffer(
+                &xs_status,
+                oversampleBuffer,
+                (XS_AUDIOBUF_SIZE * xs_status.oversampleFactor));
 
-			audioGot /= xs_status.oversampleFactor;
+            audioGot /= xs_status.oversampleFactor;
 
-			/* Execute rate-conversion with filtering */
-			if (xs_filter_rateconv(audioBuffer, oversampleBuffer,
-				xs_status.audioFormat, xs_status.oversampleFactor, audioGot) < 0) {
-				xs_error("Oversampling rate-conversion pass failed.\n");
-				xs_status.isError = TRUE;
-				XS_MUTEX_UNLOCK(xs_status);
-				goto xs_err_exit;
-			}
-		} else {
-			audioGot = xs_status.sidPlayer->plrFillBuffer(
-				&xs_status, audioBuffer, XS_AUDIOBUF_SIZE);
-		}
+            /* Execute rate-conversion with filtering */
+            if (xs_filter_rateconv(audioBuffer, oversampleBuffer,
+                xs_status.audioFormat, xs_status.oversampleFactor, audioGot) < 0) {
+                xs_error("Oversampling rate-conversion pass failed.\n");
+                xs_status.isError = TRUE;
+                XS_MUTEX_UNLOCK(xs_status);
+                goto xs_err_exit;
+            }
+        } else {
+            audioGot = xs_status.sidPlayer->plrFillBuffer(
+                &xs_status, audioBuffer, XS_AUDIOBUF_SIZE);
+        }
 
-		/* I <3 visualice/haujobb */
-		pb->pass_audio(pb, xs_status.audioFormat, xs_status.audioChannels,
-			audioGot, audioBuffer, NULL);
-		
-		XS_MUTEX_UNLOCK(xs_status);
+        /* I <3 visualice/haujobb */
+        pb->pass_audio(pb, xs_status.audioFormat, xs_status.audioChannels,
+            audioGot, audioBuffer, NULL);
+        
+        XS_MUTEX_UNLOCK(xs_status);
 
-		/* Wait a little */
-		while (xs_status.isPlaying && (pb->output->buffer_free() < audioGot))
-			g_usleep(500);
+        /* Wait a little */
+        while (xs_status.isPlaying && (pb->output->buffer_free() < audioGot))
+            g_usleep(500);
 
-		/* Check if we have played enough */
-		XS_MUTEX_LOCK(xs_status);
-		if (xs_cfg.playMaxTimeEnable) {
-			if (xs_cfg.playMaxTimeUnknown) {
-				if ((tmpLength < 0) &&
-					(pb->output->output_time() >= (xs_cfg.playMaxTime * 1000)))
-					xs_status.isPlaying = FALSE;
-			} else {
-				if (pb->output->output_time() >= (xs_cfg.playMaxTime * 1000))
-					xs_status.isPlaying = FALSE;
-			}
-		}
+        /* Check if we have played enough */
+        XS_MUTEX_LOCK(xs_status);
+        if (xs_cfg.playMaxTimeEnable) {
+            if (xs_cfg.playMaxTimeUnknown) {
+                if ((tmpLength < 0) &&
+                    (pb->output->output_time() >= (xs_cfg.playMaxTime * 1000)))
+                    xs_status.isPlaying = FALSE;
+            } else {
+                if (pb->output->output_time() >= (xs_cfg.playMaxTime * 1000))
+                    xs_status.isPlaying = FALSE;
+            }
+        }
 
-		if (tmpLength >= 0) {
-			if (pb->output->output_time() >= (tmpLength * 1000))
-				xs_status.isPlaying = FALSE;
-		}
-		XS_MUTEX_UNLOCK(xs_status);
-	}
+        if (tmpLength >= 0) {
+            if (pb->output->output_time() >= (tmpLength * 1000))
+                xs_status.isPlaying = FALSE;
+        }
+        XS_MUTEX_UNLOCK(xs_status);
+    }
 
 xs_err_exit:
-	XSDEBUG("out of playing loop\n");
-	
-	/* Close audio output plugin */
-	if (audioOpen) {
-		XSDEBUG("close audio #2\n");
-		pb->output->close_audio();
-		XSDEBUG("closed\n");
-	}
+    XSDEBUG("out of playing loop\n");
+    
+    /* Close audio output plugin */
+    if (audioOpen) {
+        XSDEBUG("close audio #2\n");
+        pb->output->close_audio();
+        XSDEBUG("closed\n");
+    }
 
-	g_free(audioBuffer);
-	g_free(oversampleBuffer);
+    g_free(audioBuffer);
+    g_free(oversampleBuffer);
 
-	/* Set playing status to false (stopped), thus when
-	 * XMMS next calls xs_get_time(), it can return appropriate
-	 * value "not playing" status and XMMS knows to move to
-	 * next entry in the playlist .. or whatever it wishes.
-	 */
-	XS_MUTEX_LOCK(xs_status);
-	xs_status.isPlaying = FALSE;
-	XS_MUTEX_UNLOCK(xs_status);
+    /* Set playing status to false (stopped), thus when
+     * XMMS next calls xs_get_time(), it can return appropriate
+     * value "not playing" status and XMMS knows to move to
+     * next entry in the playlist .. or whatever it wishes.
+     */
+    XS_MUTEX_LOCK(xs_status);
+    xs_status.isPlaying = FALSE;
+    XS_MUTEX_UNLOCK(xs_status);
 
-	/* Exit the playing thread */
-	XSDEBUG("exiting thread, bye.\n");
+    /* Exit the playing thread */
+    XSDEBUG("exiting thread, bye.\n");
 }
 
 
@@ -508,30 +506,30 @@
  */
 void xs_stop(InputPlayback *pb)
 {
-	(void) pb;
-	
-	XSDEBUG("stop requested\n");
+    (void) pb;
+    
+    XSDEBUG("stop requested\n");
 
-	/* Lock xs_status and stop playing thread */
-	XS_MUTEX_LOCK(xs_status);
-	if (xs_status.isPlaying) {
-		XSDEBUG("stopping...\n");
-		xs_status.isPlaying = FALSE;
-		XS_MUTEX_UNLOCK(xs_status);
-		XS_THREAD_JOIN(xs_decode_thread);
-	} else {
-		XS_MUTEX_UNLOCK(xs_status);
-	}
+    /* Lock xs_status and stop playing thread */
+    XS_MUTEX_LOCK(xs_status);
+    if (xs_status.isPlaying) {
+        XSDEBUG("stopping...\n");
+        xs_status.isPlaying = FALSE;
+        XS_MUTEX_UNLOCK(xs_status);
+        XS_THREAD_JOIN(xs_decode_thread);
+    } else {
+        XS_MUTEX_UNLOCK(xs_status);
+    }
 
-	XSDEBUG("done, updating status\n");
-	
-	/* Free tune information */
-	XS_MUTEX_LOCK(xs_status);
-	xs_status.sidPlayer->plrDeleteSID(&xs_status);
-	xs_tuneinfo_free(xs_status.tuneInfo);
-	xs_status.tuneInfo = NULL;
-	XS_MUTEX_UNLOCK(xs_status);
-	XSDEBUG("ok\n");
+    XSDEBUG("done, updating status\n");
+    
+    /* Free tune information */
+    XS_MUTEX_LOCK(xs_status);
+    xs_status.sidPlayer->plrDeleteSID(&xs_status);
+    xs_tuneinfo_free(xs_status.tuneInfo);
+    xs_status.tuneInfo = NULL;
+    XS_MUTEX_UNLOCK(xs_status);
+    XSDEBUG("ok\n");
 }
 
 
@@ -540,7 +538,7 @@
  */
 void xs_pause(InputPlayback *pb, short pauseState)
 {
-	pb->output->pause(pauseState);
+    pb->output->pause(pauseState);
 }
 
 
@@ -549,7 +547,7 @@
  */
 void xs_seek(InputPlayback *pb, gint time)
 {
-	(void) pb; (void) time;
+    (void) pb; (void) time;
 }
 
 
@@ -562,182 +560,182 @@
  */
 gint xs_get_time(InputPlayback *pb)
 {
-	/* If errorflag is set, return -2 to signal it to XMMS's idle callback */
-	XS_MUTEX_LOCK(xs_status);
-	if (xs_status.isError) {
-		XS_MUTEX_UNLOCK(xs_status);
-		return -2;
-	}
+    /* If errorflag is set, return -2 to signal it to XMMS's idle callback */
+    XS_MUTEX_LOCK(xs_status);
+    if (xs_status.isError) {
+        XS_MUTEX_UNLOCK(xs_status);
+        return -2;
+    }
 
-	/* If there is no tune, return -1 */
-	if (!xs_status.tuneInfo) {
-		XS_MUTEX_UNLOCK(xs_status);
-		return -1;
-	}
+    /* If there is no tune, return -1 */
+    if (!xs_status.tuneInfo) {
+        XS_MUTEX_UNLOCK(xs_status);
+        return -1;
+    }
 
-	/* If tune has ended, return -1 */
-	if (!xs_status.isPlaying) {
-		XS_MUTEX_UNLOCK(xs_status);
-		return -1;
-	}
+    /* If tune has ended, return -1 */
+    if (!xs_status.isPlaying) {
+        XS_MUTEX_UNLOCK(xs_status);
+        return -1;
+    }
 
-	XS_MUTEX_UNLOCK(xs_status);
+    XS_MUTEX_UNLOCK(xs_status);
 
-	/* Return output time reported by audio output plugin */
-	return pb->output->output_time();
+    /* Return output time reported by audio output plugin */
+    return pb->output->output_time();
 }
 
 
 /*
  * Return song information Tuple
  */
-static void xs_get_song_tuple_info(Tuple *pResult, t_xs_tuneinfo *pInfo, gint subTune)
+static void xs_get_song_tuple_info(Tuple *pResult, xs_tuneinfo_t *pInfo, gint subTune)
 {
-	gchar *tmpStr, tmpStr2[64];
+    gchar *tmpStr, tmpStr2[64];
 
-	aud_tuple_associate_string(pResult, FIELD_TITLE, NULL, pInfo->sidName);
-	aud_tuple_associate_string(pResult, FIELD_ARTIST, NULL, pInfo->sidComposer);
-	aud_tuple_associate_string(pResult, FIELD_GENRE, NULL, "SID-tune");
-	aud_tuple_associate_string(pResult, FIELD_COPYRIGHT, NULL, pInfo->sidCopyright);
-	aud_tuple_associate_string(pResult, -1, "sid-format", pInfo->sidFormat);
+    aud_tuple_associate_string(pResult, FIELD_TITLE, NULL, pInfo->sidName);
+    aud_tuple_associate_string(pResult, FIELD_ARTIST, NULL, pInfo->sidComposer);
+    aud_tuple_associate_string(pResult, FIELD_GENRE, NULL, "SID-tune");
+    aud_tuple_associate_string(pResult, FIELD_COPYRIGHT, NULL, pInfo->sidCopyright);
+    aud_tuple_associate_string(pResult, -1, "sid-format", pInfo->sidFormat);
 
-	switch (pInfo->sidModel) {
-		case XS_SIDMODEL_6581: tmpStr = "6581"; break;
-		case XS_SIDMODEL_8580: tmpStr = "8580"; break;
-		case XS_SIDMODEL_ANY: tmpStr = "ANY"; break;
-		default: tmpStr = "?"; break;
-	}
-	aud_tuple_associate_string(pResult, -1, "sid-model", tmpStr);
-	
-	/* Get sub-tune information, if available */
-	if (subTune < 0 || pInfo->startTune > pInfo->nsubTunes)
-		subTune = pInfo->startTune;
-	
-	if ((subTune > 0) && (subTune <= pInfo->nsubTunes)) {
-		gint tmpInt = pInfo->subTunes[subTune - 1].tuneLength;
-		aud_tuple_associate_int(pResult, FIELD_LENGTH, NULL, (tmpInt < 0) ? -1 : tmpInt * 1000);
-		
-		tmpInt = pInfo->subTunes[subTune - 1].tuneSpeed;
-		if (tmpInt > 0) {
-			switch (tmpInt) {
-			case XS_CLOCK_PAL: tmpStr = "PAL"; break;
-			case XS_CLOCK_NTSC: tmpStr = "NTSC"; break;
-			case XS_CLOCK_ANY: tmpStr = "ANY"; break;
-			case XS_CLOCK_VBI: tmpStr = "VBI"; break;
-			case XS_CLOCK_CIA: tmpStr = "CIA"; break;
-			default:
-				g_snprintf(tmpStr2, sizeof(tmpStr2), "%dHz", tmpInt);
-				tmpStr = tmpStr2;
-				break;
-			}
-		} else
-			tmpStr = "?";
+    switch (pInfo->sidModel) {
+        case XS_SIDMODEL_6581: tmpStr = "6581"; break;
+        case XS_SIDMODEL_8580: tmpStr = "8580"; break;
+        case XS_SIDMODEL_ANY: tmpStr = "ANY"; break;
+        default: tmpStr = "?"; break;
+    }
+    aud_tuple_associate_string(pResult, -1, "sid-model", tmpStr);
+    
+    /* Get sub-tune information, if available */
+    if (subTune < 0 || pInfo->startTune > pInfo->nsubTunes)
+        subTune = pInfo->startTune;
+    
+    if ((subTune > 0) && (subTune <= pInfo->nsubTunes)) {
+        gint tmpInt = pInfo->subTunes[subTune - 1].tuneLength;
+        aud_tuple_associate_int(pResult, FIELD_LENGTH, NULL, (tmpInt < 0) ? -1 : tmpInt * 1000);
+        
+        tmpInt = pInfo->subTunes[subTune - 1].tuneSpeed;
+        if (tmpInt > 0) {
+            switch (tmpInt) {
+            case XS_CLOCK_PAL: tmpStr = "PAL"; break;
+            case XS_CLOCK_NTSC: tmpStr = "NTSC"; break;
+            case XS_CLOCK_ANY: tmpStr = "ANY"; break;
+            case XS_CLOCK_VBI: tmpStr = "VBI"; break;
+            case XS_CLOCK_CIA: tmpStr = "CIA"; break;
+            default:
+                g_snprintf(tmpStr2, sizeof(tmpStr2), "%dHz", tmpInt);
+                tmpStr = tmpStr2;
+                break;
+            }
+        } else
+            tmpStr = "?";
 
-		aud_tuple_associate_string(pResult, -1, "sid-speed", tmpStr);
-	} else
-		subTune = 1;
-	
-	aud_tuple_associate_int(pResult, FIELD_SUBSONG_NUM, NULL, pInfo->nsubTunes);
-	aud_tuple_associate_int(pResult, FIELD_SUBSONG_ID, NULL, subTune);
-	aud_tuple_associate_int(pResult, FIELD_TRACK_NUMBER, NULL, subTune);
+        aud_tuple_associate_string(pResult, -1, "sid-speed", tmpStr);
+    } else
+        subTune = 1;
+    
+    aud_tuple_associate_int(pResult, FIELD_SUBSONG_NUM, NULL, pInfo->nsubTunes);
+    aud_tuple_associate_int(pResult, FIELD_SUBSONG_ID, NULL, subTune);
+    aud_tuple_associate_int(pResult, FIELD_TRACK_NUMBER, NULL, subTune);
 
-	if (xs_cfg.titleOverride)
-		aud_tuple_associate_string(pResult, FIELD_FORMATTER, NULL, xs_cfg.titleFormat);
+    if (xs_cfg.titleOverride)
+        aud_tuple_associate_string(pResult, FIELD_FORMATTER, NULL, xs_cfg.titleFormat);
 }
 
 
-Tuple * xs_get_song_tuple(gchar *songFilename)
+Tuple * xs_get_song_tuple(gchar *filename)
 {
-	Tuple *tmpResult;
-	gchar *tmpFilename;
-	t_xs_tuneinfo *tmpInfo;
-	gint tmpTune;
+    Tuple *result;
+    gchar *tmpFilename;
+    xs_tuneinfo_t *tmpInfo;
+    gint tmpTune;
 
-	/* Get information from URL */
-	xs_get_trackinfo(songFilename, &tmpFilename, &tmpTune);
+    /* Get information from URL */
+    xs_get_trackinfo(filename, &tmpFilename, &tmpTune);
 
-	tmpResult = aud_tuple_new_from_filename(tmpFilename);
-	if (!tmpResult) {
-		g_free(tmpFilename);
-		return NULL;
-	}
+    result = aud_tuple_new_from_filename(tmpFilename);
+    if (!result) {
+        g_free(tmpFilename);
+        return NULL;
+    }
 
-	/* Get tune information from emulation engine */
-	XS_MUTEX_LOCK(xs_status);
-	tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename);
-	XS_MUTEX_UNLOCK(xs_status);
-	g_free(tmpFilename);
+    /* Get tune information from emulation engine */
+    XS_MUTEX_LOCK(xs_status);
+    tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename);
+    XS_MUTEX_UNLOCK(xs_status);
+    g_free(tmpFilename);
 
-	if (!tmpInfo)
-		return tmpResult;
-	
-	xs_get_song_tuple_info(tmpResult, tmpInfo, tmpTune);
-	xs_tuneinfo_free(tmpInfo);
+    if (!tmpInfo)
+        return result;
+    
+    xs_get_song_tuple_info(result, tmpInfo, tmpTune);
+    xs_tuneinfo_free(tmpInfo);
 
-	return tmpResult;
+    return result;
 }
 
 
-Tuple *xs_probe_for_tuple(gchar *songFilename, t_xs_file *fd)
+Tuple *xs_probe_for_tuple(gchar *filename, xs_file_t *fd)
 {
-	Tuple *tmpResult;
-	gchar *tmpFilename;
-	t_xs_tuneinfo *tmpInfo;
-	gint tmpTune;
+    Tuple *result;
+    gchar *tmpFilename;
+    xs_tuneinfo_t *tmpInfo;
+    gint tmpTune;
 
-	assert(xs_status.sidPlayer);
+    assert(xs_status.sidPlayer);
 
-	if (songFilename == NULL)
-		return NULL;
+    if (filename == NULL)
+        return NULL;
 
-	XS_MUTEX_LOCK(xs_status);
-	if (!xs_status.sidPlayer->plrProbe(fd)) {
-		XS_MUTEX_UNLOCK(xs_status);
-		return NULL;
-	}
-	XS_MUTEX_UNLOCK(xs_status);
+    XS_MUTEX_LOCK(xs_status);
+    if (!xs_status.sidPlayer->plrProbe(fd)) {
+        XS_MUTEX_UNLOCK(xs_status);
+        return NULL;
+    }
+    XS_MUTEX_UNLOCK(xs_status);
 
 
-	/* Get information from URL */
-	xs_get_trackinfo(songFilename, &tmpFilename, &tmpTune);
-	tmpResult = aud_tuple_new_from_filename(tmpFilename);
-	if (!tmpResult) {
-		g_free(tmpFilename);
-		return NULL;
-	}
+    /* Get information from URL */
+    xs_get_trackinfo(filename, &tmpFilename, &tmpTune);
+    result = aud_tuple_new_from_filename(tmpFilename);
+    if (!result) {
+        g_free(tmpFilename);
+        return NULL;
+    }
 
-	/* Get tune information from emulation engine */
-	XS_MUTEX_LOCK(xs_status);
-	tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename);
-	XS_MUTEX_UNLOCK(xs_status);
-	g_free(tmpFilename);
+    /* Get tune information from emulation engine */
+    XS_MUTEX_LOCK(xs_status);
+    tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename);
+    XS_MUTEX_UNLOCK(xs_status);
+    g_free(tmpFilename);
 
-	if (!tmpInfo)
-		return tmpResult;
-	
-	xs_get_song_tuple_info(tmpResult, tmpInfo, tmpTune);
+    if (!tmpInfo)
+        return result;
+    
+    xs_get_song_tuple_info(result, tmpInfo, tmpTune);
 
-	/* Set subtunes */
-	if (xs_cfg.subAutoEnable && tmpInfo->nsubTunes > 1 && tmpTune < 0) {
-		gint i, n;
-		tmpResult->subtunes = g_new(gint, tmpInfo->nsubTunes);
-		for (n = 0, i = 1; i <= tmpInfo->nsubTunes; i++) {
-			gboolean doAdd = FALSE;
-					
-			if (xs_cfg.subAutoMinOnly) {
-				if (i == tmpInfo->startTune ||
-					tmpInfo->subTunes[i - 1].tuneLength >= xs_cfg.subAutoMinTime)
-					doAdd = TRUE;
-			} else
-				doAdd = TRUE;
-					
-			if (doAdd) tmpResult->subtunes[n++] = i;
-		}
-		tmpResult->nsubtunes = n;
-	} else
-		tmpResult->nsubtunes = 0;
-	
-	xs_tuneinfo_free(tmpInfo);
+    /* Set subtunes */
+    if (xs_cfg.subAutoEnable && tmpInfo->nsubTunes > 1 && tmpTune < 0) {
+        gint i, n;
+        result->subtunes = g_new(gint, tmpInfo->nsubTunes);
+        for (n = 0, i = 1; i <= tmpInfo->nsubTunes; i++) {
+            gboolean doAdd = FALSE;
+                    
+            if (xs_cfg.subAutoMinOnly) {
+                if (i == tmpInfo->startTune ||
+                    tmpInfo->subTunes[i - 1].tuneLength >= xs_cfg.subAutoMinTime)
+                    doAdd = TRUE;
+            } else
+                doAdd = TRUE;
+                    
+            if (doAdd) result->subtunes[n++] = i;
+        }
+        result->nsubtunes = n;
+    } else
+        result->nsubtunes = 0;
+    
+    xs_tuneinfo_free(tmpInfo);
 
-	return tmpResult;
+    return result;
 }
--- a/src/sid/xmms-sid.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xmms-sid.h	Tue Apr 08 15:11:35 2008 -0500
@@ -55,7 +55,7 @@
 #undef HAVE_HARDSID_BUILDER
 
 /* Size for some small buffers (always static variables) */
-#define XS_BUF_SIZE		(1024)
+#define XS_BUF_SIZE        (1024)
 
 /* If defined, some dynamically allocated temp. buffers are used.
  * Static (#undef) might give slight performance gain,
@@ -64,130 +64,130 @@
 
 /* Configuration section identifier
  */
-#define XS_PACKAGE_STRING	"Audacious-SID"
-#define XS_CONFIG_IDENT		"sid"
+#define XS_PACKAGE_STRING    "Audacious-SID"
+#define XS_CONFIG_IDENT        "sid"
 
 /* Default audio rendering frequency in Hz
  */
-#define XS_AUDIO_FREQ		(44100)
+#define XS_AUDIO_FREQ        (44100)
 
 /* Size of audio buffer. If you are experiencing lots of audio
  * "underruns" or clicks/gaps in output, try increasing this value.
  * Do notice, however, that it also affects the update frequency of
  * XMMS's visualization plugins... 
  */
-#define XS_AUDIOBUF_SIZE	(2*1024)
+#define XS_AUDIOBUF_SIZE    (2*1024)
 
 /* Size of data buffer used for SID-tune MD5 hash calculation.
  * If this is too small, the computed hash will be incorrect.
  * Largest SID files I've seen are ~70kB. */
-#define XS_SIDBUF_SIZE		(80*1024)
+#define XS_SIDBUF_SIZE        (80*1024)
 
 /* libSIDPlay1/2 constants (copied from internal headers/source)
  * For some stupid reason these are not available in public
  * headers, so we have to duplicate them here...
  */
-#define XS_SIDPLAY1_FS		(400.0f)
-#define XS_SIDPLAY1_FM		(60.0f)
-#define XS_SIDPLAY1_FT		(0.05f)
+#define XS_SIDPLAY1_FS        (400.0f)
+#define XS_SIDPLAY1_FM        (60.0f)
+#define XS_SIDPLAY1_FT        (0.05f)
 
-#define XS_SIDPLAY2_NFPOINTS	(0x800)
-#define XS_SIDPLAY2_FMAX	(24000)
+#define XS_SIDPLAY2_NFPOINTS    (0x800)
+#define XS_SIDPLAY2_FMAX    (24000)
 
 /* Limits for oversampling
  */
-#define XS_MIN_OVERSAMPLE	(2)
-#define XS_MAX_OVERSAMPLE	(8)
+#define XS_MIN_OVERSAMPLE    (2)
+#define XS_MAX_OVERSAMPLE    (8)
 
 
 /* Macros for mutexes and threads. These exist to be able to
  * easily change from pthreads to glib threads, etc, if necessary.
  */
-#define XS_THREAD_T		GThread *
-#define XS_THREAD_EXIT(M)	g_thread_exit(M)
-#define XS_THREAD_JOIN(M)	g_thread_join(M)
-#define XS_MPP(M)		M ## _mutex
-#define XS_MUTEX(M)		GStaticMutex XS_MPP(M) = G_STATIC_MUTEX_INIT
-#define XS_MUTEX_H(M)		extern GStaticMutex XS_MPP(M)
+#define XS_THREAD_T        GThread *
+#define XS_THREAD_EXIT(M)    g_thread_exit(M)
+#define XS_THREAD_JOIN(M)    g_thread_join(M)
+#define XS_MPP(M)        M ## _mutex
+#define XS_MUTEX(M)        GStaticMutex XS_MPP(M) = G_STATIC_MUTEX_INIT
+#define XS_MUTEX_H(M)        extern GStaticMutex XS_MPP(M)
 #ifdef XS_MUTEX_DEBUG
-#  define XS_MUTEX_LOCK(M)	{			\
-	gboolean tmpRes;				\
-	XSDEBUG("XS_MUTEX_TRYLOCK(" #M ")\n");	\
-	tmpRes = g_static_mutex_trylock(&XS_MPP(M));	\
-	XSDEBUG("[" #M "] = %s\n", tmpRes ? "TRUE" : "FALSE");	\
-	}
-#  define XS_MUTEX_UNLOCK(M)	{ XSDEBUG("XS_MUTEX_UNLOCK(" #M ")\n"); g_static_mutex_unlock(&XS_MPP(M)); }
+#  define XS_MUTEX_LOCK(M)    {            \
+    gboolean tmpRes;                \
+    XSDEBUG("XS_MUTEX_TRYLOCK(" #M ")\n");    \
+    tmpRes = g_static_mutex_trylock(&XS_MPP(M));    \
+    XSDEBUG("[" #M "] = %s\n", tmpRes ? "TRUE" : "FALSE");    \
+    }
+#  define XS_MUTEX_UNLOCK(M)    { XSDEBUG("XS_MUTEX_UNLOCK(" #M ")\n"); g_static_mutex_unlock(&XS_MPP(M)); }
 #else
-#  define XS_MUTEX_LOCK(M)	g_static_mutex_lock(&XS_MPP(M))
-#  define XS_MUTEX_UNLOCK(M)	g_static_mutex_unlock(&XS_MPP(M))
+#  define XS_MUTEX_LOCK(M)    g_static_mutex_lock(&XS_MPP(M))
+#  define XS_MUTEX_UNLOCK(M)    g_static_mutex_unlock(&XS_MPP(M))
 #endif
 
 /* Character set conversion helper macros
  */
-#define XS_CS_FILENAME(M)	g_filename_to_utf8(M, -1, NULL, NULL, NULL)
-#define XS_CS_SID(M)		g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL)
-#define XS_CS_STIL(M)		g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL)
-#define XS_CS_FREE(M)		g_free(M)
+#define XS_CS_FILENAME(M)    g_filename_to_utf8(M, -1, NULL, NULL, NULL)
+#define XS_CS_SID(M)        g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL)
+#define XS_CS_STIL(M)        g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL)
+#define XS_CS_FREE(M)        g_free(M)
 
 /* Shorthands for linked lists
  */
-#define LPREV	(pNode->pPrev)
-#define LTHIS	(pNode)
-#define LNEXT	(pNode->pNext)
+#define LPREV    (node->prev)
+#define LTHIS    (node)
+#define LNEXT    (node->next)
 
 
 /* Plugin-wide typedefs
  */
 typedef struct {
-	gint		tuneSpeed,
-			tuneLength;
-	gboolean	tunePlayed;
-} t_xs_subtuneinfo;
+    gint        tuneSpeed,
+            tuneLength;
+    gboolean    tunePlayed;
+} xs_subtuneinfo_t;
 
 
 typedef struct {
-	gchar		*sidFilename,
-			*sidName,
-			*sidComposer,
-			*sidCopyright,
-			*sidFormat;
-	gint		loadAddr,
-			initAddr,
-			playAddr,
-			dataFileLen,
-			sidModel;
-	gint		nsubTunes, startTune;
-	t_xs_subtuneinfo	*subTunes;
-} t_xs_tuneinfo;
+    gchar        *sidFilename,
+            *sidName,
+            *sidComposer,
+            *sidCopyright,
+            *sidFormat;
+    gint        loadAddr,
+            initAddr,
+            playAddr,
+            dataFileLen,
+            sidModel;
+    gint        nsubTunes, startTune;
+    xs_subtuneinfo_t    *subTunes;
+} xs_tuneinfo_t;
 
 
 /* Global variables
  */
-extern InputPlugin	xs_plugin_ip;
+extern InputPlugin    xs_plugin_ip;
 
 
 /* Plugin function prototypes
  */
-void	xs_init(void);
-void	xs_reinit(void);
-void	xs_close(void);
-void	xs_play_file(InputPlayback *);
-void	xs_stop(InputPlayback *);
-void	xs_pause(InputPlayback *, short);
-void	xs_seek(InputPlayback *, gint);
-gint	xs_get_time(InputPlayback *);
-Tuple *	xs_get_song_tuple(gchar *);
-Tuple *	xs_probe_for_tuple(gchar *, t_xs_file *);
-void	xs_about(void);
+void    xs_init(void);
+void    xs_reinit(void);
+void    xs_close(void);
+void    xs_play_file(InputPlayback *);
+void    xs_stop(InputPlayback *);
+void    xs_pause(InputPlayback *, short);
+void    xs_seek(InputPlayback *, gint);
+gint    xs_get_time(InputPlayback *);
+Tuple *    xs_get_song_tuple(gchar *);
+Tuple *    xs_probe_for_tuple(gchar *, xs_file_t *);
+void    xs_about(void);
 
-void	xs_error(const char *, ...);
+void    xs_error(const char *, ...);
 gboolean xs_get_trackinfo(const gchar *, gchar **, gint *);
 
 
 /* Debugging
  */
 #ifndef DEBUG_NP
-void	XSDEBUG(const char *, ...);
+void    XSDEBUG(const char *, ...);
 #else
 #  ifdef DEBUG
 #    define XSDEBUG(...) { fprintf(stderr, "XS[%s:%s:%d]: ", __FILE__, __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); }
@@ -199,25 +199,27 @@
 
 /* And even some Gtk+ macro crap here, yay.
  */
-#define XS_DEF_WINDOW_DELETE(ME, MV)					\
-gboolean xs_ ## ME ## _delete(GtkWidget *w, GdkEvent *e, gpointer d) {	\
-	(void) w; (void) e; (void) d;					\
-	if (xs_ ## MV ) {						\
-		gtk_widget_destroy(xs_ ## MV );				\
-		xs_ ## MV = NULL;					\
-	}								\
-	return FALSE;							\
+#define XS_DEF_WINDOW_DELETE(ME, MV)                    \
+gboolean xs_ ## ME ## _delete(GtkWidget *w, GdkEvent *e, gpointer d) {    \
+    (void) w; (void) e; (void) d;                    \
+    if (xs_ ## MV ) {                        \
+        gtk_widget_destroy(xs_ ## MV );                \
+        xs_ ## MV = NULL;                    \
+    }                                \
+    return FALSE;                            \
 }
 
-#define XS_DEF_WINDOW_CLOSE(ME, MV)			\
-void xs_ ## ME (GtkButton *b, gpointer d) {		\
-	(void) b; (void) d;				\
-	gtk_widget_destroy(xs_ ## MV );			\
-	xs_ ## MV = NULL;				\
+#define XS_DEF_WINDOW_CLOSE(ME, MV)            \
+void xs_ ## ME (GtkButton *b, gpointer d) {        \
+    (void) b; (void) d;                \
+    gtk_widget_destroy(xs_ ## MV );            \
+    xs_ ## MV = NULL;                \
 }
 
-#define XS_SIGNAL_CONNECT(SOBJ, SNAME, SFUNC, SDATA)		\
-	g_signal_connect(G_OBJECT(SOBJ), SNAME, G_CALLBACK(SFUNC), SDATA)
+#define XS_SIGNAL_CONNECT(SOBJ, SNAME, SFUNC, SDATA)        \
+    g_signal_connect(G_OBJECT(SOBJ), SNAME, G_CALLBACK(SFUNC), SDATA)
+
+#define XS_WINDOW_PRESENT(XX) gtk_window_present(GTK_WINDOW( XX ))
 
 #ifdef __cplusplus
 }
--- a/src/sid/xs_about.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_about.c	Tue Apr 08 15:11:35 2008 -0500
@@ -37,16 +37,16 @@
  */
 gint xs_about_theme(void)
 {
-	const gint iSession = 0;	/* Assume session 0 */
-	gint iPos;
+    const gint iSession = 0;    /* Assume session 0 */
+    gint iPos;
 
-	/* Stop current song, add theme to playlist, play. */
-	xmms_remote_stop(iSession);
-	iPos = xmms_remote_get_playlist_length(iSession);
-	xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE);
-	xmms_remote_set_playlist_pos(iSession, iPos);
-	xmms_remote_play(iSession);
-	return 0;
+    /* Stop current song, add theme to playlist, play. */
+    xmms_remote_stop(iSession);
+    iPos = xmms_remote_get_playlist_length(iSession);
+    xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE);
+    xmms_remote_set_playlist_pos(iSession, iPos);
+    xmms_remote_play(iSession);
+    return 0;
 }
 #endif
 
@@ -60,167 +60,167 @@
  */
 void xs_about(void)
 {
-	GtkWidget *about_vbox1;
-	GtkWidget *about_frame;
-	GtkWidget *about_logo;
-	GdkPixmap *about_logo_pixmap = NULL, *about_logo_mask = NULL;
-	GtkWidget *about_scrwin;
-	GtkWidget *about_text;
-	GtkWidget *alignment6;
-	GtkWidget *about_close;
-	gchar tmpStr[64];
+    GtkWidget *about_vbox1;
+    GtkWidget *about_frame;
+    GtkWidget *about_logo;
+    GdkPixmap *about_logo_pixmap = NULL, *about_logo_mask = NULL;
+    GtkWidget *about_scrwin;
+    GtkWidget *about_text;
+    GtkWidget *alignment6;
+    GtkWidget *about_close;
+    gchar tmpStr[64];
 
-	/* Check if there already is an open about window */
-	if (xs_aboutwin != NULL) {
+    /* Check if there already is an open about window */
+    if (xs_aboutwin != NULL) {
                 gtk_window_present(GTK_WINDOW(xs_aboutwin));
-		return;
-	}
+        return;
+    }
 
-	/* No, create one ... */
-	xs_aboutwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-	gtk_window_set_type_hint(GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG);
-	gtk_widget_set_name(xs_aboutwin, "xs_aboutwin");
-	gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin);
-	g_snprintf(tmpStr, sizeof(tmpStr), _("About %s"), XS_PACKAGE_STRING);
-	gtk_window_set_title(GTK_WINDOW(xs_aboutwin), tmpStr);
-	gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 350, -1);
+    /* No, create one ... */
+    xs_aboutwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    gtk_window_set_type_hint(GTK_WINDOW(xs_aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG);
+    gtk_widget_set_name(xs_aboutwin, "xs_aboutwin");
+    gtk_object_set_data(GTK_OBJECT(xs_aboutwin), "xs_aboutwin", xs_aboutwin);
+    g_snprintf(tmpStr, sizeof(tmpStr), _("About %s"), XS_PACKAGE_STRING);
+    gtk_window_set_title(GTK_WINDOW(xs_aboutwin), tmpStr);
+    gtk_window_set_default_size(GTK_WINDOW(xs_aboutwin), 350, -1);
 
-	XS_SIGNAL_CONNECT(xs_aboutwin, "delete_event", xs_about_delete, NULL);
+    XS_SIGNAL_CONNECT(xs_aboutwin, "delete_event", xs_about_delete, NULL);
 
-	about_vbox1 = gtk_vbox_new(FALSE, 0);
-	gtk_widget_set_name(about_vbox1, "about_vbox1");
-	gtk_widget_ref(about_vbox1);
-	gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1,
-				 (GtkDestroyNotify) gtk_widget_unref);
-	gtk_widget_show(about_vbox1);
-	gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1);
+    about_vbox1 = gtk_vbox_new(FALSE, 0);
+    gtk_widget_set_name(about_vbox1, "about_vbox1");
+    gtk_widget_ref(about_vbox1);
+    gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_vbox1", about_vbox1,
+                 (GtkDestroyNotify) gtk_widget_unref);
+    gtk_widget_show(about_vbox1);
+    gtk_container_add(GTK_CONTAINER(xs_aboutwin), about_vbox1);
 
 #ifdef HAVE_THEMETUNE
-	about_frame = gtk_button_new();
+    about_frame = gtk_button_new();
 #else
-	about_frame = gtk_frame_new(NULL);
+    about_frame = gtk_frame_new(NULL);
 #endif
-	gtk_widget_set_name(about_frame, "about_frame");
-	gtk_widget_ref(about_frame);
-	gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame,
-				 (GtkDestroyNotify) gtk_widget_unref);
-	gtk_widget_show(about_frame);
-	gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0);
-	gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4);
+    gtk_widget_set_name(about_frame, "about_frame");
+    gtk_widget_ref(about_frame);
+    gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_frame", about_frame,
+                 (GtkDestroyNotify) gtk_widget_unref);
+    gtk_widget_show(about_frame);
+    gtk_box_pack_start(GTK_BOX(about_vbox1), about_frame, FALSE, FALSE, 0);
+    gtk_container_set_border_width(GTK_CONTAINER(about_frame), 4);
 
 #ifdef HAVE_THEMETUNE
-	gtk_signal_connect(GTK_OBJECT(about_frame), "clicked", GTK_SIGNAL_FUNC(xs_about_theme), NULL);
+    gtk_signal_connect(GTK_OBJECT(about_frame), "clicked", GTK_SIGNAL_FUNC(xs_about_theme), NULL);
 #else
-	gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT);
+    gtk_frame_set_shadow_type(GTK_FRAME(about_frame), GTK_SHADOW_OUT);
 #endif
 
-	/* Create the Gdk data for logo pixmap */
-	gtk_widget_realize(xs_aboutwin);
-	about_logo_pixmap = gdk_pixmap_create_from_xpm_d(
-		xs_aboutwin->window, &about_logo_mask,
-		NULL, (gchar **) xmms_sid_logo_xpm);
+    /* Create the Gdk data for logo pixmap */
+    gtk_widget_realize(xs_aboutwin);
+    about_logo_pixmap = gdk_pixmap_create_from_xpm_d(
+        xs_aboutwin->window, &about_logo_mask,
+        NULL, (gchar **) xmms_sid_logo_xpm);
 
-	about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask);
+    about_logo = gtk_pixmap_new(about_logo_pixmap, about_logo_mask);
 
-	/* Create logo widget */
-	gtk_widget_set_name(about_logo, "about_logo");
-	gtk_widget_ref(about_logo);
-	gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo,
-		(GtkDestroyNotify) gtk_widget_unref);
-	gtk_widget_show(about_logo);
-	gtk_container_add(GTK_CONTAINER(about_frame), about_logo);
-	gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6);
+    /* Create logo widget */
+    gtk_widget_set_name(about_logo, "about_logo");
+    gtk_widget_ref(about_logo);
+    gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_logo", about_logo,
+        (GtkDestroyNotify) gtk_widget_unref);
+    gtk_widget_show(about_logo);
+    gtk_container_add(GTK_CONTAINER(about_frame), about_logo);
+    gtk_misc_set_padding(GTK_MISC(about_logo), 0, 6);
 
-	about_scrwin = gtk_scrolled_window_new(NULL, NULL);
-	gtk_widget_set_name(about_scrwin, "about_scrwin");
-	gtk_widget_ref(about_scrwin);
-	gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin,
-		(GtkDestroyNotify) gtk_widget_unref);
-	gtk_widget_show(about_scrwin);
-	gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0);
-	gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8);
-	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin),
-		GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+    about_scrwin = gtk_scrolled_window_new(NULL, NULL);
+    gtk_widget_set_name(about_scrwin, "about_scrwin");
+    gtk_widget_ref(about_scrwin);
+    gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_scrwin", about_scrwin,
+        (GtkDestroyNotify) gtk_widget_unref);
+    gtk_widget_show(about_scrwin);
+    gtk_box_pack_start(GTK_BOX(about_vbox1), about_scrwin, TRUE, TRUE, 0);
+    gtk_container_set_border_width(GTK_CONTAINER(about_scrwin), 8);
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(about_scrwin),
+        GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
 
-	about_text = gtk_text_view_new();
-	gtk_widget_set_name(about_text, "about_text");
-	gtk_widget_ref(about_text);
-	gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text,
-		(GtkDestroyNotify) gtk_widget_unref);
-	gtk_widget_show(about_text);
-	gtk_container_add(GTK_CONTAINER(about_scrwin), about_text);
-	gtk_widget_set_usize(about_text, -2, 100);
-	gtk_text_buffer_set_text(
-	GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))),
-			"\n"
-			"This release of XMMS-SID is dedicated to\n"
-			"            Richard Joseph\n"
-			"                  and\n"
-			"      Lauri Sipilä (aka Xaztur/PWP)\n"
-			" - Now gone, but forever in our hearts -\n"
-			"\n"
-			"\n"
-			"(C) Copyright 1999-2007\n"
-			"\tTecnic Software productions (TNSP)\n"
-			"\tLicensed under GNU GPL v2\n"
-			"\n"
-			"Programming and design\n"
-			"\tMatti 'ccr' Hämäläinen\n"
-			"\n"
+    about_text = gtk_text_view_new();
+    gtk_widget_set_name(about_text, "about_text");
+    gtk_widget_ref(about_text);
+    gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_text", about_text,
+        (GtkDestroyNotify) gtk_widget_unref);
+    gtk_widget_show(about_text);
+    gtk_container_add(GTK_CONTAINER(about_scrwin), about_text);
+    gtk_widget_set_usize(about_text, -2, 100);
+    gtk_text_buffer_set_text(
+    GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(about_text))),
+            "\n"
+            "This release of XMMS-SID is dedicated to\n"
+            "            Richard Joseph\n"
+            "                  and\n"
+            "      Lauri Sipilä (aka Xaztur/PWP)\n"
+            " - Now gone, but forever in our hearts -\n"
+            "\n"
+            "\n"
+            "(C) Copyright 1999-2007\n"
+            "\tTecnic Software productions (TNSP)\n"
+            "\tLicensed under GNU GPL v2\n"
+            "\n"
+            "Programming and design\n"
+            "\tMatti 'ccr' Hämäläinen\n"
+            "\n"
 #ifdef HAVE_SIDPLAY1
-			"libSIDPlay1 created by\n"
-			"\tMichael Schwendt\n" "\n"
+            "libSIDPlay1 created by\n"
+            "\tMichael Schwendt\n" "\n"
 #endif
 #ifdef HAVE_SIDPLAY2
-			"libSIDPlay2 and reSID created by\n"
-			"\tSimon White, Dag Lem,\n"
-			"\tMichael Schwendt and rest.\n"
-			"\n"
+            "libSIDPlay2 and reSID created by\n"
+            "\tSimon White, Dag Lem,\n"
+            "\tMichael Schwendt and rest.\n"
+            "\n"
 #endif
 #ifdef HAVE_THEMETUNE
-			"\"Kummatti City\", theme of XMMS-SID 0.8\n"
-			"\tby Ari 'Agemixer' Yliaho\n"
-			"\t(C) Copyright 1998 Scallop\n"
-			"\t(Refer to README for license)\n" "\n"
+            "\"Kummatti City\", theme of XMMS-SID 0.8\n"
+            "\tby Ari 'Agemixer' Yliaho\n"
+            "\t(C) Copyright 1998 Scallop\n"
+            "\t(Refer to README for license)\n" "\n"
 #endif
-			"Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n"
+            "Original XMMS-SID (v0.4) by\n" "\tWillem Monsuwe\n" "\n"
 
-			"Greetings fly out to ...\n"
-			"\tEveryone at #Linux.Fi, #Fireball,\n"
-			"\t#TNSP and #c-64 of IRCNet, #xmms\n"
-			"\tof Freenode.net.\n"
-			"\n"
-			"\tDekadence, PWP, Byterapers,\n"
-			"\tmfx, Unique, Fairlight, iSO,\n"
-			"\tWrath Designs, Padua, Extend,\n"
-			"\tPHn, Creators, Cosine, tAAt,\n"
-			"\tViruz, Crest and Skalaria.\n" "\n"
+            "Greetings fly out to ...\n"
+            "\tEveryone at #Linux.Fi, #Fireball,\n"
+            "\t#TNSP and #c-64 of IRCNet, #xmms\n"
+            "\tof Freenode.net.\n"
+            "\n"
+            "\tDekadence, PWP, Byterapers,\n"
+            "\tmfx, Unique, Fairlight, iSO,\n"
+            "\tWrath Designs, Padua, Extend,\n"
+            "\tPHn, Creators, Cosine, tAAt,\n"
+            "\tViruz, Crest and Skalaria.\n" "\n"
 
-			"Special thanks\n"
-			"\tGerfried 'Alfie' Fuchs\n"
-			"\tAndreas 'mrsid' Varga\n"
-			"\tAll the betatesters.\n"
-			"\tAll the users!\n", -1);
+            "Special thanks\n"
+            "\tGerfried 'Alfie' Fuchs\n"
+            "\tAndreas 'mrsid' Varga\n"
+            "\tAll the betatesters.\n"
+            "\tAll the users!\n", -1);
 
-	alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1);
-	gtk_widget_set_name(alignment6, "alignment6");
-	gtk_widget_ref(alignment6);
-	gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6,
-		 (GtkDestroyNotify) gtk_widget_unref);
-	gtk_widget_show(alignment6);
-	gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0);
-	gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8);
+    alignment6 = gtk_alignment_new(0.5, 0.5, 0.18, 1);
+    gtk_widget_set_name(alignment6, "alignment6");
+    gtk_widget_ref(alignment6);
+    gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "alignment6", alignment6,
+         (GtkDestroyNotify) gtk_widget_unref);
+    gtk_widget_show(alignment6);
+    gtk_box_pack_start(GTK_BOX(about_vbox1), alignment6, FALSE, TRUE, 0);
+    gtk_container_set_border_width(GTK_CONTAINER(alignment6), 8);
 
-	about_close = gtk_button_new_with_label(_("Close"));
-	gtk_widget_set_name(about_close, "about_close");
-	gtk_widget_ref(about_close);
-	gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close,
-		 (GtkDestroyNotify) gtk_widget_unref);
-	gtk_widget_show(about_close);
-	gtk_container_add(GTK_CONTAINER(alignment6), about_close);
-	GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT);
+    about_close = gtk_button_new_with_label(_("Close"));
+    gtk_widget_set_name(about_close, "about_close");
+    gtk_widget_ref(about_close);
+    gtk_object_set_data_full(GTK_OBJECT(xs_aboutwin), "about_close", about_close,
+         (GtkDestroyNotify) gtk_widget_unref);
+    gtk_widget_show(about_close);
+    gtk_container_add(GTK_CONTAINER(alignment6), about_close);
+    GTK_WIDGET_SET_FLAGS(about_close, GTK_CAN_DEFAULT);
 
-	XS_SIGNAL_CONNECT(about_close, "clicked", xs_about_ok, NULL);
+    XS_SIGNAL_CONNECT(about_close, "clicked", xs_about_ok, NULL);
 
-	gtk_widget_show(xs_aboutwin);
+    gtk_widget_show(xs_aboutwin);
 }
--- a/src/sid/xs_config.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_config.c	Tue Apr 08 15:11:35 2008 -0500
@@ -24,32 +24,32 @@
 
 #ifdef AUDACIOUS_PLUGIN
 #include <audacious/plugin.h>
-#define XS_CONFIG_FILE		ConfigDb
-#define XS_CONFIG_OPEN		aud_cfg_db_open
-#define XS_CONFIG_FREE		aud_cfg_db_close
+#define XS_CONFIG_FILE        ConfigDb
+#define XS_CONFIG_OPEN        aud_cfg_db_open
+#define XS_CONFIG_FREE        aud_cfg_db_close
 
-#define XS_CFG_SET_STRING	aud_cfg_db_set_string
-#define XS_CFG_SET_FLOAT	aud_cfg_db_set_float
-#define XS_CFG_SET_INT		aud_cfg_db_set_int
-#define XS_CFG_SET_BOOL		aud_cfg_db_set_bool
-#define XS_CFG_GET_STRING	aud_cfg_db_get_string
-#define XS_CFG_GET_FLOAT	aud_cfg_db_get_float
-#define XS_CFG_GET_INT		aud_cfg_db_get_int
-#define XS_CFG_GET_BOOL		aud_cfg_db_get_bool
+#define XS_CFG_SET_STRING    aud_cfg_db_set_string
+#define XS_CFG_SET_FLOAT    aud_cfg_db_set_float
+#define XS_CFG_SET_INT        aud_cfg_db_set_int
+#define XS_CFG_SET_BOOL        aud_cfg_db_set_bool
+#define XS_CFG_GET_STRING    aud_cfg_db_get_string
+#define XS_CFG_GET_FLOAT    aud_cfg_db_get_float
+#define XS_CFG_GET_INT        aud_cfg_db_get_int
+#define XS_CFG_GET_BOOL        aud_cfg_db_get_bool
 #else
 #include <xmms/configfile.h>
-#define XS_CONFIG_FILE		ConfigFile
-#define XS_CONFIG_OPEN		xmms_cfg_open_default_file
-#define XS_CONFIG_FREE		xmms_cfg_free
+#define XS_CONFIG_FILE        ConfigFile
+#define XS_CONFIG_OPEN        xmms_cfg_open_default_file
+#define XS_CONFIG_FREE        xmms_cfg_free
 
-#define XS_CFG_SET_STRING	xmms_cfg_write_string
-#define XS_CFG_SET_FLOAT	xmms_cfg_write_float
-#define XS_CFG_SET_INT		xmms_cfg_write_int
-#define XS_CFG_SET_BOOL		xmms_cfg_write_boolean
-#define XS_CFG_GET_STRING	xmms_cfg_read_string
-#define XS_CFG_GET_FLOAT	xmms_cfg_read_float
-#define XS_CFG_GET_INT		xmms_cfg_read_int
-#define XS_CFG_GET_BOOL		xmms_cfg_read_boolean
+#define XS_CFG_SET_STRING    xmms_cfg_write_string
+#define XS_CFG_SET_FLOAT    xmms_cfg_write_float
+#define XS_CFG_SET_INT        xmms_cfg_write_int
+#define XS_CFG_SET_BOOL        xmms_cfg_write_boolean
+#define XS_CFG_GET_STRING    xmms_cfg_read_string
+#define XS_CFG_GET_FLOAT    xmms_cfg_read_float
+#define XS_CFG_GET_INT        xmms_cfg_read_int
+#define XS_CFG_GET_BOOL        xmms_cfg_read_boolean
 #endif
 #include <stdio.h>
 #include <ctype.h>
@@ -62,20 +62,20 @@
  * Global widgets
  */
 static GtkWidget *xs_configwin = NULL,
-	*xs_sldb_fileselector = NULL,
-	*xs_stil_fileselector = NULL,
-	*xs_hvsc_selector = NULL,
-	*xs_filt_importselector = NULL,
-	*xs_filt_exportselector = NULL;
+    *xs_sldb_fileselector = NULL,
+    *xs_stil_fileselector = NULL,
+    *xs_hvsc_selector = NULL,
+    *xs_filt_importselector = NULL,
+    *xs_filt_exportselector = NULL;
 
-#define LUW(x)	lookup_widget(xs_configwin, x)
+#define LUW(x)    lookup_widget(xs_configwin, x)
 
 /* Samplerates
  */
 static const gchar *xs_samplerates_table[] = {
-	"8000", "11025", "22050", 
-	"44100", "48000", "64000",
-	"96000"
+    "8000", "11025", "22050", 
+    "44100", "48000", "64000",
+    "96000"
 };
 
 static const gint xs_nsamplerates_table = (sizeof(xs_samplerates_table) / sizeof(xs_samplerates_table[0]));
@@ -87,116 +87,116 @@
 struct t_xs_cfg xs_cfg;
 
 static t_xs_cfg_item xs_cfgtable[] = {
-{ CTYPE_INT,	&xs_cfg.audioBitsPerSample,	"audioBitsPerSample" },
-{ CTYPE_INT,	&xs_cfg.audioChannels,		"audioChannels" },
-{ CTYPE_INT,	&xs_cfg.audioFrequency,		"audioFrequency" },
+{ CTYPE_INT,    &xs_cfg.audioBitsPerSample,    "audioBitsPerSample" },
+{ CTYPE_INT,    &xs_cfg.audioChannels,        "audioChannels" },
+{ CTYPE_INT,    &xs_cfg.audioFrequency,        "audioFrequency" },
 
-{ CTYPE_BOOL,	&xs_cfg.mos8580,		"mos8580" },
-{ CTYPE_BOOL,	&xs_cfg.forceModel,		"forceModel" },
-{ CTYPE_BOOL,	&xs_cfg.emulateFilters,		"emulateFilters" },
-{ CTYPE_FLOAT,	&xs_cfg.sid1FilterFs,		"filterFs" },
-{ CTYPE_FLOAT,	&xs_cfg.sid1FilterFm,		"filterFm" },
-{ CTYPE_FLOAT,	&xs_cfg.sid1FilterFt,		"filterFt" },
-{ CTYPE_INT,	&xs_cfg.memoryMode,		"memoryMode" },
-{ CTYPE_INT,	&xs_cfg.clockSpeed,		"clockSpeed" },
-{ CTYPE_BOOL,	&xs_cfg.forceSpeed,		"forceSpeed" },
+{ CTYPE_BOOL,    &xs_cfg.mos8580,        "mos8580" },
+{ CTYPE_BOOL,    &xs_cfg.forceModel,        "forceModel" },
+{ CTYPE_BOOL,    &xs_cfg.emulateFilters,        "emulateFilters" },
+{ CTYPE_FLOAT,    &xs_cfg.sid1FilterFs,        "filterFs" },
+{ CTYPE_FLOAT,    &xs_cfg.sid1FilterFm,        "filterFm" },
+{ CTYPE_FLOAT,    &xs_cfg.sid1FilterFt,        "filterFt" },
+{ CTYPE_INT,    &xs_cfg.memoryMode,        "memoryMode" },
+{ CTYPE_INT,    &xs_cfg.clockSpeed,        "clockSpeed" },
+{ CTYPE_BOOL,    &xs_cfg.forceSpeed,        "forceSpeed" },
 
-{ CTYPE_INT,	&xs_cfg.playerEngine,		"playerEngine" },
+{ CTYPE_INT,    &xs_cfg.playerEngine,        "playerEngine" },
 
-{ CTYPE_INT,	&xs_cfg.sid2Builder,		"sid2Builder" },
-{ CTYPE_INT,	&xs_cfg.sid2OptLevel,		"sid2OptLevel" },
-{ CTYPE_INT,	&xs_cfg.sid2NFilterPresets,	"sid2NFilterPresets" },
+{ CTYPE_INT,    &xs_cfg.sid2Builder,        "sid2Builder" },
+{ CTYPE_INT,    &xs_cfg.sid2OptLevel,        "sid2OptLevel" },
+{ CTYPE_INT,    &xs_cfg.sid2NFilterPresets,    "sid2NFilterPresets" },
 
-{ CTYPE_BOOL,	&xs_cfg.oversampleEnable,	"oversampleEnable" },
-{ CTYPE_INT,	&xs_cfg.oversampleFactor,	"oversampleFactor" },
+{ CTYPE_BOOL,    &xs_cfg.oversampleEnable,    "oversampleEnable" },
+{ CTYPE_INT,    &xs_cfg.oversampleFactor,    "oversampleFactor" },
 
-{ CTYPE_BOOL,	&xs_cfg.playMaxTimeEnable,	"playMaxTimeEnable" },
-{ CTYPE_BOOL,	&xs_cfg.playMaxTimeUnknown,	"playMaxTimeUnknown" },
-{ CTYPE_INT,	&xs_cfg.playMaxTime,		"playMaxTime" },
-{ CTYPE_BOOL,	&xs_cfg.playMinTimeEnable,	"playMinTimeEnable" },
-{ CTYPE_INT,	&xs_cfg.playMinTime,		"playMinTime" },
-{ CTYPE_BOOL,	&xs_cfg.songlenDBEnable,	"songlenDBEnable" },
-{ CTYPE_STR,	&xs_cfg.songlenDBPath,		"songlenDBPath" },
+{ CTYPE_BOOL,    &xs_cfg.playMaxTimeEnable,    "playMaxTimeEnable" },
+{ CTYPE_BOOL,    &xs_cfg.playMaxTimeUnknown,    "playMaxTimeUnknown" },
+{ CTYPE_INT,    &xs_cfg.playMaxTime,        "playMaxTime" },
+{ CTYPE_BOOL,    &xs_cfg.playMinTimeEnable,    "playMinTimeEnable" },
+{ CTYPE_INT,    &xs_cfg.playMinTime,        "playMinTime" },
+{ CTYPE_BOOL,    &xs_cfg.songlenDBEnable,    "songlenDBEnable" },
+{ CTYPE_STR,    &xs_cfg.songlenDBPath,        "songlenDBPath" },
 
-{ CTYPE_BOOL,	&xs_cfg.stilDBEnable,		"stilDBEnable" },
-{ CTYPE_STR,	&xs_cfg.stilDBPath,		"stilDBPath" },
-{ CTYPE_STR,	&xs_cfg.hvscPath,		"hvscPath" },
+{ CTYPE_BOOL,    &xs_cfg.stilDBEnable,        "stilDBEnable" },
+{ CTYPE_STR,    &xs_cfg.stilDBPath,        "stilDBPath" },
+{ CTYPE_STR,    &xs_cfg.hvscPath,        "hvscPath" },
 
 #ifndef AUDACIOUS_PLUGIN
-{ CTYPE_INT,	&xs_cfg.subsongControl,		"subsongControl" },
-{ CTYPE_BOOL,	&xs_cfg.detectMagic,		"detectMagic" },
+{ CTYPE_INT,    &xs_cfg.subsongControl,        "subsongControl" },
+{ CTYPE_BOOL,    &xs_cfg.detectMagic,        "detectMagic" },
 #endif
 
-{ CTYPE_BOOL,	&xs_cfg.titleOverride,		"titleOverride" },
-{ CTYPE_STR,	&xs_cfg.titleFormat,		"titleFormat" },
+{ CTYPE_BOOL,    &xs_cfg.titleOverride,        "titleOverride" },
+{ CTYPE_STR,    &xs_cfg.titleFormat,        "titleFormat" },
 
-{ CTYPE_BOOL,	&xs_cfg.subAutoEnable,		"subAutoEnable" },
-{ CTYPE_BOOL,	&xs_cfg.subAutoMinOnly,		"subAutoMinOnly" },
-{ CTYPE_INT,	&xs_cfg.subAutoMinTime,		"subAutoMinTime" },
+{ CTYPE_BOOL,    &xs_cfg.subAutoEnable,        "subAutoEnable" },
+{ CTYPE_BOOL,    &xs_cfg.subAutoMinOnly,        "subAutoMinOnly" },
+{ CTYPE_INT,    &xs_cfg.subAutoMinTime,        "subAutoMinTime" },
 };
 
 static const gint xs_cfgtable_max = (sizeof(xs_cfgtable) / sizeof(t_xs_cfg_item));
 
 
 static t_xs_wid_item xs_widtable[] = {
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_res_16bit",	&xs_cfg.audioBitsPerSample,	XS_RES_16BIT },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_res_8bit",		&xs_cfg.audioBitsPerSample,	XS_RES_8BIT },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_chn_mono",		&xs_cfg.audioChannels,		XS_CHN_MONO },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_chn_stereo",	&xs_cfg.audioChannels,		XS_CHN_STEREO },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_chn_autopan",	&xs_cfg.audioChannels,		XS_CHN_AUTOPAN },
-{ WTYPE_COMBO,	CTYPE_INT,	"cfg_samplerate",	&xs_cfg.audioFrequency,		XS_AUDIO_FREQ },
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_oversample",	&xs_cfg.oversampleEnable,	0 },
-{ WTYPE_SPIN,	CTYPE_INT,	"cfg_oversample_factor",&xs_cfg.oversampleFactor,	0 },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_res_16bit",    &xs_cfg.audioBitsPerSample,    XS_RES_16BIT },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_res_8bit",        &xs_cfg.audioBitsPerSample,    XS_RES_8BIT },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_chn_mono",        &xs_cfg.audioChannels,        XS_CHN_MONO },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_chn_stereo",    &xs_cfg.audioChannels,        XS_CHN_STEREO },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_chn_autopan",    &xs_cfg.audioChannels,        XS_CHN_AUTOPAN },
+{ WTYPE_COMBO,    CTYPE_INT,    "cfg_samplerate",    &xs_cfg.audioFrequency,        XS_AUDIO_FREQ },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_oversample",    &xs_cfg.oversampleEnable,    0 },
+{ WTYPE_SPIN,    CTYPE_INT,    "cfg_oversample_factor",&xs_cfg.oversampleFactor,    0 },
 
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_sidplay1",	&xs_cfg.playerEngine,		XS_ENG_SIDPLAY1 },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_sidplay2",	&xs_cfg.playerEngine,		XS_ENG_SIDPLAY2 },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_mem_real",	&xs_cfg.memoryMode,		XS_MPU_REAL },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_mem_banksw",	&xs_cfg.memoryMode,		XS_MPU_BANK_SWITCHING },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_mem_transrom",	&xs_cfg.memoryMode,		XS_MPU_TRANSPARENT_ROM },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_mem_playsid",	&xs_cfg.memoryMode,		XS_MPU_PLAYSID_ENVIRONMENT },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_sidplay1",    &xs_cfg.playerEngine,        XS_ENG_SIDPLAY1 },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_sidplay2",    &xs_cfg.playerEngine,        XS_ENG_SIDPLAY2 },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_mem_real",    &xs_cfg.memoryMode,        XS_MPU_REAL },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_mem_banksw",    &xs_cfg.memoryMode,        XS_MPU_BANK_SWITCHING },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_mem_transrom",    &xs_cfg.memoryMode,        XS_MPU_TRANSPARENT_ROM },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_mem_playsid",    &xs_cfg.memoryMode,        XS_MPU_PLAYSID_ENVIRONMENT },
 
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_emu_mos8580",	&xs_cfg.mos8580,		0 },
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_emu_sid_force",	&xs_cfg.forceModel,		0 },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_clock_ntsc",	&xs_cfg.clockSpeed,		XS_CLOCK_NTSC },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_clock_pal",	&xs_cfg.clockSpeed,		XS_CLOCK_PAL },
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_emu_clock_force",	&xs_cfg.forceSpeed,		0 },
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_emu_sp2_opt",	&xs_cfg.sid2OptLevel,		0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_emu_mos8580",    &xs_cfg.mos8580,        0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_emu_sid_force",    &xs_cfg.forceModel,        0 },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_clock_ntsc",    &xs_cfg.clockSpeed,        XS_CLOCK_NTSC },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_clock_pal",    &xs_cfg.clockSpeed,        XS_CLOCK_PAL },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_emu_clock_force",    &xs_cfg.forceSpeed,        0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_emu_sp2_opt",    &xs_cfg.sid2OptLevel,        0 },
 
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_sp2_resid",	&xs_cfg.sid2Builder,		XS_BLD_RESID },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_emu_sp2_hardsid",	&xs_cfg.sid2Builder,		XS_BLD_HARDSID },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_sp2_resid",    &xs_cfg.sid2Builder,        XS_BLD_RESID },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_emu_sp2_hardsid",    &xs_cfg.sid2Builder,        XS_BLD_HARDSID },
 
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_emu_filters",	&xs_cfg.emulateFilters,		0 },
-{ WTYPE_SCALE,	CTYPE_FLOAT,	"cfg_sp1_filter_fs",	&xs_cfg.sid1FilterFs,		0 },
-{ WTYPE_SCALE,	CTYPE_FLOAT,	"cfg_sp1_filter_fm",	&xs_cfg.sid1FilterFm,		0 },
-{ WTYPE_SCALE,	CTYPE_FLOAT,	"cfg_sp1_filter_ft",	&xs_cfg.sid1FilterFt,		0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_emu_filters",    &xs_cfg.emulateFilters,        0 },
+{ WTYPE_SCALE,    CTYPE_FLOAT,    "cfg_sp1_filter_fs",    &xs_cfg.sid1FilterFs,        0 },
+{ WTYPE_SCALE,    CTYPE_FLOAT,    "cfg_sp1_filter_fm",    &xs_cfg.sid1FilterFm,        0 },
+{ WTYPE_SCALE,    CTYPE_FLOAT,    "cfg_sp1_filter_ft",    &xs_cfg.sid1FilterFt,        0 },
 
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_maxtime_enable",	&xs_cfg.playMaxTimeEnable,	0 },
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_maxtime_unknown",	&xs_cfg.playMaxTimeUnknown,	0 },
-{ WTYPE_SPIN,	CTYPE_INT,	"cfg_maxtime",		&xs_cfg.playMaxTime,		0 },
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_mintime_enable",	&xs_cfg.playMinTimeEnable,	0 },
-{ WTYPE_SPIN,	CTYPE_INT,	"cfg_mintime",		&xs_cfg.playMinTime,		0 },
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_sld_enable",	&xs_cfg.songlenDBEnable,	0 },
-{ WTYPE_TEXT,	CTYPE_STR,	"cfg_sld_dbpath",	&xs_cfg.songlenDBPath,		0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_maxtime_enable",    &xs_cfg.playMaxTimeEnable,    0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_maxtime_unknown",    &xs_cfg.playMaxTimeUnknown,    0 },
+{ WTYPE_SPIN,    CTYPE_INT,    "cfg_maxtime",        &xs_cfg.playMaxTime,        0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_mintime_enable",    &xs_cfg.playMinTimeEnable,    0 },
+{ WTYPE_SPIN,    CTYPE_INT,    "cfg_mintime",        &xs_cfg.playMinTime,        0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_sld_enable",    &xs_cfg.songlenDBEnable,    0 },
+{ WTYPE_TEXT,    CTYPE_STR,    "cfg_sld_dbpath",    &xs_cfg.songlenDBPath,        0 },
 
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_stil_enable",	&xs_cfg.stilDBEnable,		0 },
-{ WTYPE_TEXT,	CTYPE_STR,	"cfg_stil_dbpath",	&xs_cfg.stilDBPath,		0 },
-{ WTYPE_TEXT,	CTYPE_STR,	"cfg_hvsc_path",	&xs_cfg.hvscPath,		0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_stil_enable",    &xs_cfg.stilDBEnable,        0 },
+{ WTYPE_TEXT,    CTYPE_STR,    "cfg_stil_dbpath",    &xs_cfg.stilDBPath,        0 },
+{ WTYPE_TEXT,    CTYPE_STR,    "cfg_hvsc_path",    &xs_cfg.hvscPath,        0 },
 
 #ifndef AUDACIOUS_PLUGIN
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_subctrl_none",	&xs_cfg.subsongControl,		XS_SSC_NONE },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_subctrl_seek",	&xs_cfg.subsongControl,		XS_SSC_SEEK },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_subctrl_popup",	&xs_cfg.subsongControl,		XS_SSC_POPUP },
-{ WTYPE_BGROUP,	CTYPE_INT,	"cfg_subctrl_patch",	&xs_cfg.subsongControl,		XS_SSC_PATCH },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_subctrl_none",    &xs_cfg.subsongControl,        XS_SSC_NONE },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_subctrl_seek",    &xs_cfg.subsongControl,        XS_SSC_SEEK },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_subctrl_popup",    &xs_cfg.subsongControl,        XS_SSC_POPUP },
+{ WTYPE_BGROUP,    CTYPE_INT,    "cfg_subctrl_patch",    &xs_cfg.subsongControl,        XS_SSC_PATCH },
 
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_detectmagic",	&xs_cfg.detectMagic,		0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_detectmagic",    &xs_cfg.detectMagic,        0 },
 #endif
 
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_ftitle_override",	&xs_cfg.titleOverride,		0 },
-{ WTYPE_TEXT,	CTYPE_STR,	"cfg_ftitle_format",	&xs_cfg.titleFormat,		0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_ftitle_override",    &xs_cfg.titleOverride,        0 },
+{ WTYPE_TEXT,    CTYPE_STR,    "cfg_ftitle_format",    &xs_cfg.titleFormat,        0 },
 
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_subauto_enable",	&xs_cfg.subAutoEnable,		0 },
-{ WTYPE_BUTTON,	CTYPE_BOOL,	"cfg_subauto_min_only",	&xs_cfg.subAutoMinOnly,		0 },
-{ WTYPE_SPIN,	CTYPE_INT,	"cfg_subauto_mintime",	&xs_cfg.subAutoMinTime,		0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_subauto_enable",    &xs_cfg.subAutoEnable,        0 },
+{ WTYPE_BUTTON,    CTYPE_BOOL,    "cfg_subauto_min_only",    &xs_cfg.subAutoMinOnly,        0 },
+{ WTYPE_SPIN,    CTYPE_INT,    "cfg_subauto_mintime",    &xs_cfg.subAutoMinTime,        0 },
 };
 
 static const gint xs_widtable_max = (sizeof(xs_widtable) / sizeof(t_xs_wid_item));
@@ -206,49 +206,49 @@
  */
 void xs_init_configuration(void)
 {
-	/* Lock configuration mutex */
-	XSDEBUG("initializing configuration ...\n");
-	XS_MUTEX_LOCK(xs_cfg);
+    /* Lock configuration mutex */
+    XSDEBUG("initializing configuration ...\n");
+    XS_MUTEX_LOCK(xs_cfg);
 
-	memset(&xs_cfg, 0, sizeof(xs_cfg));
-	
-	/* Initialize values with sensible defaults */
-	xs_cfg.audioBitsPerSample = XS_RES_16BIT;
-	xs_cfg.audioChannels = XS_CHN_MONO;
-	xs_cfg.audioFrequency = XS_AUDIO_FREQ;
+    memset(&xs_cfg, 0, sizeof(xs_cfg));
+    
+    /* Initialize values with sensible defaults */
+    xs_cfg.audioBitsPerSample = XS_RES_16BIT;
+    xs_cfg.audioChannels = XS_CHN_MONO;
+    xs_cfg.audioFrequency = XS_AUDIO_FREQ;
 
-	xs_cfg.mos8580 = FALSE;
-	xs_cfg.forceModel = FALSE;
+    xs_cfg.mos8580 = FALSE;
+    xs_cfg.forceModel = FALSE;
 
-	/* Filter values */
-	xs_cfg.emulateFilters = TRUE;
-	xs_cfg.sid1FilterFs = XS_SIDPLAY1_FS;
-	xs_cfg.sid1FilterFm = XS_SIDPLAY1_FM;
-	xs_cfg.sid1FilterFt = XS_SIDPLAY1_FT;
+    /* Filter values */
+    xs_cfg.emulateFilters = TRUE;
+    xs_cfg.sid1FilterFs = XS_SIDPLAY1_FS;
+    xs_cfg.sid1FilterFm = XS_SIDPLAY1_FM;
+    xs_cfg.sid1FilterFt = XS_SIDPLAY1_FT;
 
 #ifdef HAVE_SIDPLAY2
-	xs_cfg.playerEngine = XS_ENG_SIDPLAY2;
-	xs_cfg.memoryMode = XS_MPU_REAL;
+    xs_cfg.playerEngine = XS_ENG_SIDPLAY2;
+    xs_cfg.memoryMode = XS_MPU_REAL;
 #else
 #ifdef HAVE_SIDPLAY1
-	xs_cfg.playerEngine = XS_ENG_SIDPLAY1;
-	xs_cfg.memoryMode = XS_MPU_BANK_SWITCHING;
+    xs_cfg.playerEngine = XS_ENG_SIDPLAY1;
+    xs_cfg.memoryMode = XS_MPU_BANK_SWITCHING;
 #else
 #error This should not happen! No emulator engines configured in!
 #endif
 #endif
 
-	xs_cfg.clockSpeed = XS_CLOCK_PAL;
-	xs_cfg.forceSpeed = FALSE;
+    xs_cfg.clockSpeed = XS_CLOCK_PAL;
+    xs_cfg.forceSpeed = FALSE;
 
-	xs_cfg.sid2OptLevel = 0;
-	xs_cfg.sid2NFilterPresets = 0;
+    xs_cfg.sid2OptLevel = 0;
+    xs_cfg.sid2NFilterPresets = 0;
 
 #ifdef HAVE_RESID_BUILDER
-	xs_cfg.sid2Builder = XS_BLD_RESID;
+    xs_cfg.sid2Builder = XS_BLD_RESID;
 #else
 #ifdef HAVE_HARDSID_BUILDER
-	xs_cfg.sid2Builder = XS_BLD_HARDSID;
+    xs_cfg.sid2Builder = XS_BLD_HARDSID;
 #else
 #ifdef HAVE_SIDPLAY2
 #error This should not happen! No supported SIDPlay2 builders configured in!
@@ -256,47 +256,47 @@
 #endif
 #endif
 
-	xs_cfg.oversampleEnable = FALSE;
-	xs_cfg.oversampleFactor = XS_MIN_OVERSAMPLE;
+    xs_cfg.oversampleEnable = FALSE;
+    xs_cfg.oversampleFactor = XS_MIN_OVERSAMPLE;
 
-	xs_cfg.playMaxTimeEnable = FALSE;
-	xs_cfg.playMaxTimeUnknown = FALSE;
-	xs_cfg.playMaxTime = 150;
+    xs_cfg.playMaxTimeEnable = FALSE;
+    xs_cfg.playMaxTimeUnknown = FALSE;
+    xs_cfg.playMaxTime = 150;
 
-	xs_cfg.playMinTimeEnable = FALSE;
-	xs_cfg.playMinTime = 15;
+    xs_cfg.playMinTimeEnable = FALSE;
+    xs_cfg.playMinTime = 15;
 
-	xs_cfg.songlenDBEnable = FALSE;
-	xs_pstrcpy(&xs_cfg.songlenDBPath, "~/C64Music/Songlengths.txt");
+    xs_cfg.songlenDBEnable = FALSE;
+    xs_pstrcpy(&xs_cfg.songlenDBPath, "~/C64Music/Songlengths.txt");
 
-	xs_cfg.stilDBEnable = FALSE;
-	xs_pstrcpy(&xs_cfg.stilDBPath, "~/C64Music/DOCUMENTS/STIL.txt");
-	xs_pstrcpy(&xs_cfg.hvscPath, "~/C64Music");
+    xs_cfg.stilDBEnable = FALSE;
+    xs_pstrcpy(&xs_cfg.stilDBPath, "~/C64Music/DOCUMENTS/STIL.txt");
+    xs_pstrcpy(&xs_cfg.hvscPath, "~/C64Music");
 
 #if defined(HAVE_SONG_POSITION) && !defined(AUDACIOUS_PLUGIN)
-	xs_cfg.subsongControl = XS_SSC_PATCH;
+    xs_cfg.subsongControl = XS_SSC_PATCH;
 #else
-	xs_cfg.subsongControl = XS_SSC_POPUP;
+    xs_cfg.subsongControl = XS_SSC_POPUP;
 #endif
-	xs_cfg.detectMagic = FALSE;
+    xs_cfg.detectMagic = FALSE;
 
 #ifndef HAVE_XMMSEXTRA
-	xs_cfg.titleOverride = TRUE;
+    xs_cfg.titleOverride = TRUE;
 #endif
 
 #ifdef AUDACIOUS_PLUGIN
-	xs_pstrcpy(&xs_cfg.titleFormat, "${artist} - ${title} (${copyright}) <${subsong-id}/${subsong-num}> [${sid-model}/${sid-speed}]");
+    xs_pstrcpy(&xs_cfg.titleFormat, "${artist} - ${title} (${copyright}) <${subsong-id}/${subsong-num}> [${sid-model}/${sid-speed}]");
 #else
-	xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) <%n/%N> [%m/%C]");
+    xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) <%n/%N> [%m/%C]");
 #endif
 
-	xs_cfg.subAutoEnable = FALSE;
-	xs_cfg.subAutoMinOnly = TRUE;
-	xs_cfg.subAutoMinTime = 15;
+    xs_cfg.subAutoEnable = FALSE;
+    xs_cfg.subAutoMinOnly = TRUE;
+    xs_cfg.subAutoMinTime = 15;
 
 
-	/* Unlock the configuration */
-	XS_MUTEX_UNLOCK(xs_cfg);
+    /* Unlock the configuration */
+    XS_MUTEX_UNLOCK(xs_cfg);
 }
 
 
@@ -306,84 +306,84 @@
 
 static gboolean xs_filter_load_into(XS_CONFIG_FILE *cfg, gint nFilter, t_xs_sid2_filter *pResult)
 {
-	gchar tmpKey[64], *tmpStr;
-	gint i, j;
+    gchar tmpKey[64], *tmpStr;
+    gint i, j;
 
-	/* Get fields from config */
-	g_snprintf(tmpKey, sizeof(tmpKey), "filter%dNPoints", nFilter);
-	if (!XS_CFG_GET_INT(cfg, XS_CONFIG_IDENT, tmpKey, &(pResult->npoints)))
-		return FALSE;
-	
-	g_snprintf(tmpKey, sizeof(tmpKey), "filter%dName", nFilter);
-	if (!XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, &tmpStr))
-		return FALSE;
-	
-	pResult->name = g_strdup(tmpStr);
-	if (pResult->name == NULL) {
-		g_free(pResult);
-		return FALSE;
-	}
-	
-	g_snprintf(tmpKey, sizeof(tmpKey), "filter%dPoints", nFilter);
-	if (!XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, &tmpStr))
-		return FALSE;
-	
-	for (i = 0, j = 0; i < pResult->npoints; i++, j += XS_FITEM) {
-		if (sscanf(&tmpStr[j], "%4x%4x",
-			&(pResult->points[i].x),
-			&(pResult->points[i].y)) != 2)
-			return FALSE;
-	}
-	
-	return TRUE;
+    /* Get fields from config */
+    g_snprintf(tmpKey, sizeof(tmpKey), "filter%dNPoints", nFilter);
+    if (!XS_CFG_GET_INT(cfg, XS_CONFIG_IDENT, tmpKey, &(pResult->npoints)))
+        return FALSE;
+    
+    g_snprintf(tmpKey, sizeof(tmpKey), "filter%dName", nFilter);
+    if (!XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, &tmpStr))
+        return FALSE;
+    
+    pResult->name = g_strdup(tmpStr);
+    if (pResult->name == NULL) {
+        g_free(pResult);
+        return FALSE;
+    }
+    
+    g_snprintf(tmpKey, sizeof(tmpKey), "filter%dPoints", nFilter);
+    if (!XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, &tmpStr))
+        return FALSE;
+    
+    for (i = 0, j = 0; i < pResult->npoints; i++, j += XS_FITEM) {
+        if (sscanf(&tmpStr[j], "%4x%4x",
+            &(pResult->points[i].x),
+            &(pResult->points[i].y)) != 2)
+            return FALSE;
+    }
+    
+    return TRUE;
 }
 
 
 static t_xs_sid2_filter * xs_filter_load(XS_CONFIG_FILE *cfg, gint nFilter)
 {
-	t_xs_sid2_filter *pResult;
-	
-	/* Allocate filter struct */
-	if ((pResult = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL)
-		return NULL;
-	
-	if (!xs_filter_load_into(cfg, nFilter, pResult)) {
-		g_free(pResult);
-		return NULL;
-	} else
-		return pResult;
+    t_xs_sid2_filter *pResult;
+    
+    /* Allocate filter struct */
+    if ((pResult = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL)
+        return NULL;
+    
+    if (!xs_filter_load_into(cfg, nFilter, pResult)) {
+        g_free(pResult);
+        return NULL;
+    } else
+        return pResult;
 }
 
 #if 0
 static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, t_xs_sid2_filter *pFilter, gint nFilter)
 {
-	gchar *tmpValue, tmpKey[64];
-	gint i, j;
-	
-	/* Allocate memory for value string */
-	tmpValue = g_malloc(sizeof(gchar) * XS_FITEM * (pFilter->npoints + 1));
-	if (tmpValue == NULL)
-		return FALSE;
-	
-	/* Make value string */
-	for (i = 0, j = 0; i < pFilter->npoints; i++, j += XS_FITEM) {
-		g_snprintf(&tmpValue[j], XS_FITEM+1, "%04x%04x",
-			pFilter->points[i].x,
-			pFilter->points[i].y);
-	}
-	
-	/* Write into the configuration */
-	g_snprintf(tmpKey, sizeof(tmpKey), "filter%dName", nFilter);
-	XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, pFilter->name);
-	
-	g_snprintf(tmpKey, sizeof(tmpKey), "filter%dNPoints", nFilter);
-	XS_CFG_SET_INT(cfg, XS_CONFIG_IDENT, tmpKey, pFilter->npoints);
+    gchar *tmpValue, tmpKey[64];
+    gint i, j;
+    
+    /* Allocate memory for value string */
+    tmpValue = g_malloc(sizeof(gchar) * XS_FITEM * (pFilter->npoints + 1));
+    if (tmpValue == NULL)
+        return FALSE;
+    
+    /* Make value string */
+    for (i = 0, j = 0; i < pFilter->npoints; i++, j += XS_FITEM) {
+        g_snprintf(&tmpValue[j], XS_FITEM+1, "%04x%04x",
+            pFilter->points[i].x,
+            pFilter->points[i].y);
+    }
+    
+    /* Write into the configuration */
+    g_snprintf(tmpKey, sizeof(tmpKey), "filter%dName", nFilter);
+    XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, pFilter->name);
+    
+    g_snprintf(tmpKey, sizeof(tmpKey), "filter%dNPoints", nFilter);
+    XS_CFG_SET_INT(cfg, XS_CONFIG_IDENT, tmpKey, pFilter->npoints);
 
-	g_snprintf(tmpKey, sizeof(tmpKey), "filter%dPoints", nFilter);
-	XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, tmpValue);
-	
-	g_free(tmpValue);
-	return TRUE;
+    g_snprintf(tmpKey, sizeof(tmpKey), "filter%dPoints", nFilter);
+    XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, tmpValue);
+    
+    g_free(tmpValue);
+    return TRUE;
 }
 #endif
 
@@ -392,203 +392,203 @@
  */
 static gboolean xs_fgetitem(gchar *inLine, size_t *linePos, gchar sep, gchar *tmpStr, size_t tmpMax)
 {
-	size_t i;
-	for (i = 0; i < tmpMax && inLine[*linePos] &&
-		!isspace(inLine[*linePos]) &&
-		inLine[*linePos] != sep; i++, (*linePos)++)
-		tmpStr[i] = inLine[*linePos];
-	tmpStr[i] = 0;
-	xs_findnext(inLine, linePos);
-	return (inLine[*linePos] == sep);
+    size_t i;
+    for (i = 0; i < tmpMax && inLine[*linePos] &&
+        !isspace(inLine[*linePos]) &&
+        inLine[*linePos] != sep; i++, (*linePos)++)
+        tmpStr[i] = inLine[*linePos];
+    tmpStr[i] = 0;
+    xs_findnext(inLine, linePos);
+    return (inLine[*linePos] == sep);
 }
 
 static gboolean xs_filters_import(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint *nFilters)
 {
-	FILE *inFile;
-	gchar inLine[XS_BUF_SIZE], tmpStr[XS_BUF_SIZE];
-	gchar *sectName = NULL;
-	gboolean sectBegin;
-	size_t lineNum, i;
-	t_xs_sid2_filter *tmpFilter;
+    FILE *inFile;
+    gchar inLine[XS_BUF_SIZE], tmpStr[XS_BUF_SIZE];
+    gchar *sectName = NULL;
+    gboolean sectBegin;
+    size_t lineNum, i;
+    t_xs_sid2_filter *tmpFilter;
 
 fprintf(stderr, "xs_filters_import(%s)\n", pcFilename);
 
-	if ((inFile = fopen(pcFilename, "ra")) == NULL)
-		return FALSE;
+    if ((inFile = fopen(pcFilename, "ra")) == NULL)
+        return FALSE;
 
 fprintf(stderr, "importing...\n");
-	
-	sectBegin = FALSE;
-	lineNum = 0;
-	while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) {
-		size_t linePos = 0;
-		lineNum++;
-		
-		xs_findnext(inLine, &linePos);
-		if (isalpha(inLine[linePos]) && sectBegin) {
-			/* A new key/value pair */
-			if (!xs_fgetitem(inLine, &linePos, '=', tmpStr, XS_BUF_SIZE)) {
-				fprintf(stderr, "invalid line: %s [expect =']'", inLine);
-			} else {
-				linePos++;
-				xs_findnext(inLine, &linePos);
-				if (!strncmp(tmpStr, "points", 6)) {
-					fprintf(stderr, "points=%s\n", &inLine[linePos]);
-				} else if (!strncmp(tmpStr, "point", 5)) {
-				} else if (!strncmp(tmpStr, "type", 4)) {
-				} else {
-					fprintf(stderr, "warning: ukn def: %s @ %s\n",
-						tmpStr, sectName);
-				}
-			}
-		} else if (inLine[linePos] == '[') {
-			/* Check for existing section */
-			if (sectBegin) {
-				/* Submit definition */
-				fprintf(stderr, "filter ends: %s\n", sectName);
-				if ((tmpFilter = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) {
-					fprintf(stderr, "could not allocate ..\n");
-				} else {
-					
-				}
-				g_free(sectName);
-			}
-			
-			/* New filter(?) section starts */
-			linePos++;
-			for (i = 0; i < XS_BUF_SIZE && inLine[linePos] && inLine[linePos] != ']'; i++, linePos++)
-				tmpStr[i] = inLine[linePos];
-			tmpStr[i] = 0;
-			
-			if (inLine[linePos] != ']') {
-				fprintf(stderr, "invalid! expected ']': %s\n", inLine);
-			} else {
-				sectName = strdup(tmpStr);
-				fprintf(stderr, "filter: %s\n", sectName);
-				sectBegin = TRUE;
-			}
-		} else if ((inLine[linePos] != ';') && (inLine[linePos] != 0)) {
-			/* Syntax error */
-			fprintf(stderr, "syntax error: %s\n", inLine);
-		}
-	}
-	
-	fclose(inFile);
-	return TRUE;
+    
+    sectBegin = FALSE;
+    lineNum = 0;
+    while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) {
+        size_t linePos = 0;
+        lineNum++;
+        
+        xs_findnext(inLine, &linePos);
+        if (isalpha(inLine[linePos]) && sectBegin) {
+            /* A new key/value pair */
+            if (!xs_fgetitem(inLine, &linePos, '=', tmpStr, XS_BUF_SIZE)) {
+                fprintf(stderr, "invalid line: %s [expect =']'", inLine);
+            } else {
+                linePos++;
+                xs_findnext(inLine, &linePos);
+                if (!strncmp(tmpStr, "points", 6)) {
+                    fprintf(stderr, "points=%s\n", &inLine[linePos]);
+                } else if (!strncmp(tmpStr, "point", 5)) {
+                } else if (!strncmp(tmpStr, "type", 4)) {
+                } else {
+                    fprintf(stderr, "warning: ukn def: %s @ %s\n",
+                        tmpStr, sectName);
+                }
+            }
+        } else if (inLine[linePos] == '[') {
+            /* Check for existing section */
+            if (sectBegin) {
+                /* Submit definition */
+                fprintf(stderr, "filter ends: %s\n", sectName);
+                if ((tmpFilter = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) {
+                    fprintf(stderr, "could not allocate ..\n");
+                } else {
+                    
+                }
+                g_free(sectName);
+            }
+            
+            /* New filter(?) section starts */
+            linePos++;
+            for (i = 0; i < XS_BUF_SIZE && inLine[linePos] && inLine[linePos] != ']'; i++, linePos++)
+                tmpStr[i] = inLine[linePos];
+            tmpStr[i] = 0;
+            
+            if (inLine[linePos] != ']') {
+                fprintf(stderr, "invalid! expected ']': %s\n", inLine);
+            } else {
+                sectName = strdup(tmpStr);
+                fprintf(stderr, "filter: %s\n", sectName);
+                sectBegin = TRUE;
+            }
+        } else if ((inLine[linePos] != ';') && (inLine[linePos] != 0)) {
+            /* Syntax error */
+            fprintf(stderr, "syntax error: %s\n", inLine);
+        }
+    }
+    
+    fclose(inFile);
+    return TRUE;
 }
 
 
 static gboolean xs_filters_export(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint nFilters)
 {
-	FILE *outFile;
-	t_xs_sid2_filter *f;
-	gint n;
-	
-	/* Open/create the file */
-	if ((outFile = fopen(pcFilename, "wa")) == NULL)
-		return FALSE;
-	
-	/* Header */
-	fprintf(outFile,
-		"; SIDPlay2 compatible filter definition file\n"
-		"; Exported by " PACKAGE_STRING "\n\n");
-	
-	/* Write each filter spec in "INI"-style format */
-	for (n = 0; n < nFilters; n++) {
-		gint i;
-		f = pFilters[n];
-		
-		fprintf(outFile,
-		"[%s]\n"
-		"type=1\n"
-		"points=%d\n",
-		f->name, f->npoints);
-	
-		for (i = 0; i < f->npoints; i++) {
-			fprintf(outFile,
-			"point%d=%d,%d\n",
-			i + 1,
-			f->points[i].x,
-			f->points[i].y);
-		}
-	
-		fprintf(outFile, "\n");
-		f++;
-	}
-	
-	fclose(outFile);
-	return TRUE;
+    FILE *outFile;
+    t_xs_sid2_filter *f;
+    gint n;
+    
+    /* Open/create the file */
+    if ((outFile = fopen(pcFilename, "wa")) == NULL)
+        return FALSE;
+    
+    /* Header */
+    fprintf(outFile,
+        "; SIDPlay2 compatible filter definition file\n"
+        "; Exported by " PACKAGE_STRING "\n\n");
+    
+    /* Write each filter spec in "INI"-style format */
+    for (n = 0; n < nFilters; n++) {
+        gint i;
+        f = pFilters[n];
+        
+        fprintf(outFile,
+        "[%s]\n"
+        "type=1\n"
+        "points=%d\n",
+        f->name, f->npoints);
+    
+        for (i = 0; i < f->npoints; i++) {
+            fprintf(outFile,
+            "point%d=%d,%d\n",
+            i + 1,
+            f->points[i].x,
+            f->points[i].y);
+        }
+    
+        fprintf(outFile, "\n");
+        f++;
+    }
+    
+    fclose(outFile);
+    return TRUE;
 }
 
 /* Get the configuration (from file or default)
  */
 void xs_read_configuration(void)
 {
-	XS_CONFIG_FILE *cfg;
-	gint i;
-	gchar *tmpStr;
+    XS_CONFIG_FILE *cfg;
+    gint i;
+    gchar *tmpStr;
 
-	/* Try to open the XMMS configuration file  */
-	XS_MUTEX_LOCK(xs_cfg);
-	XSDEBUG("loading from config-file ...\n");
+    /* Try to open the XMMS configuration file  */
+    XS_MUTEX_LOCK(xs_cfg);
+    XSDEBUG("loading from config-file ...\n");
 
-	cfg = XS_CONFIG_OPEN();
+    cfg = XS_CONFIG_OPEN();
 
-	if (cfg == NULL) {
-		XSDEBUG("Could not open configuration, trying to write defaults...\n");
-		xs_write_configuration();
-		return;
-	}
+    if (cfg == NULL) {
+        XSDEBUG("Could not open configuration, trying to write defaults...\n");
+        xs_write_configuration();
+        return;
+    }
 
-	/* Read the new settings from XMMS configuration file */
-	for (i = 0; i < xs_cfgtable_max; i++) {
-		switch (xs_cfgtable[i].itemType) {
-		case CTYPE_INT:
-			XS_CFG_GET_INT(cfg, XS_CONFIG_IDENT,
-				xs_cfgtable[i].itemName,
-				(gint *) xs_cfgtable[i].itemData);
-			break;
+    /* Read the new settings from XMMS configuration file */
+    for (i = 0; i < xs_cfgtable_max; i++) {
+        switch (xs_cfgtable[i].itemType) {
+        case CTYPE_INT:
+            XS_CFG_GET_INT(cfg, XS_CONFIG_IDENT,
+                xs_cfgtable[i].itemName,
+                (gint *) xs_cfgtable[i].itemData);
+            break;
 
-		case CTYPE_BOOL:
-			XS_CFG_GET_BOOL(cfg, XS_CONFIG_IDENT,
-				xs_cfgtable[i].itemName,
-				(gboolean *) xs_cfgtable[i].itemData);
-			break;
+        case CTYPE_BOOL:
+            XS_CFG_GET_BOOL(cfg, XS_CONFIG_IDENT,
+                xs_cfgtable[i].itemName,
+                (gboolean *) xs_cfgtable[i].itemData);
+            break;
 
-		case CTYPE_FLOAT:
-			XS_CFG_GET_FLOAT(cfg, XS_CONFIG_IDENT,
-				xs_cfgtable[i].itemName,
-				(gfloat *) xs_cfgtable[i].itemData);
-			break;
-		
-		case CTYPE_STR:
-			if (XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT,
-				xs_cfgtable[i].itemName, (gchar **) &tmpStr)) {
-				xs_pstrcpy((gchar **) xs_cfgtable[i].itemData, tmpStr);
-				g_free(tmpStr);
-			}
-			break;
-		}
-	}
-	
-	/* Filters and presets are a special case */
-	xs_filter_load_into(cfg, 0, &xs_cfg.sid2Filter);
-	
-	if (xs_cfg.sid2NFilterPresets > 0) {
-		xs_cfg.sid2FilterPresets = g_malloc0(xs_cfg.sid2NFilterPresets * sizeof(t_xs_sid2_filter *));
-		if (!xs_cfg.sid2FilterPresets) {
-			xs_error("Allocation of sid2FilterPresets structure failed!\n");
-		} else {
-			for (i = 0; i < xs_cfg.sid2NFilterPresets; i++) {
-				xs_cfg.sid2FilterPresets[i] = xs_filter_load(cfg, i);
-			}
-		}
-	}
+        case CTYPE_FLOAT:
+            XS_CFG_GET_FLOAT(cfg, XS_CONFIG_IDENT,
+                xs_cfgtable[i].itemName,
+                (gfloat *) xs_cfgtable[i].itemData);
+            break;
+        
+        case CTYPE_STR:
+            if (XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT,
+                xs_cfgtable[i].itemName, (gchar **) &tmpStr)) {
+                xs_pstrcpy((gchar **) xs_cfgtable[i].itemData, tmpStr);
+                g_free(tmpStr);
+            }
+            break;
+        }
+    }
+    
+    /* Filters and presets are a special case */
+    xs_filter_load_into(cfg, 0, &xs_cfg.sid2Filter);
+    
+    if (xs_cfg.sid2NFilterPresets > 0) {
+        xs_cfg.sid2FilterPresets = g_malloc0(xs_cfg.sid2NFilterPresets * sizeof(t_xs_sid2_filter *));
+        if (!xs_cfg.sid2FilterPresets) {
+            xs_error("Allocation of sid2FilterPresets structure failed!\n");
+        } else {
+            for (i = 0; i < xs_cfg.sid2NFilterPresets; i++) {
+                xs_cfg.sid2FilterPresets[i] = xs_filter_load(cfg, i);
+            }
+        }
+    }
 
-	XS_CONFIG_FREE(cfg);
+    XS_CONFIG_FREE(cfg);
 
-	XS_MUTEX_UNLOCK(xs_cfg);
-	XSDEBUG("OK\n");
+    XS_MUTEX_UNLOCK(xs_cfg);
+    XSDEBUG("OK\n");
 }
 
 
@@ -596,58 +596,58 @@
  */
 gint xs_write_configuration(void)
 {
-	XS_CONFIG_FILE *cfg;
-	gint i;
+    XS_CONFIG_FILE *cfg;
+    gint i;
 
-	XSDEBUG("writing configuration ...\n");
-	XS_MUTEX_LOCK(xs_cfg);
+    XSDEBUG("writing configuration ...\n");
+    XS_MUTEX_LOCK(xs_cfg);
 
-	/* Try to open the XMMS configuration file  */
-	cfg = XS_CONFIG_OPEN();
+    /* Try to open the XMMS configuration file  */
+    cfg = XS_CONFIG_OPEN();
 
 #ifndef AUDACIOUS_PLUGIN
-	if (!cfg) cfg = xmms_cfg_new();
-	if (!cfg) return -1;
+    if (!cfg) cfg = xmms_cfg_new();
+    if (!cfg) return -1;
 #endif
 
-	/* Write the new settings to XMMS configuration file */
-	for (i = 0; i < xs_cfgtable_max; i++) {
-		switch (xs_cfgtable[i].itemType) {
-		case CTYPE_INT:
-			XS_CFG_SET_INT(cfg, XS_CONFIG_IDENT,
-				xs_cfgtable[i].itemName,
-				*(gint *) xs_cfgtable[i].itemData);
-			break;
+    /* Write the new settings to XMMS configuration file */
+    for (i = 0; i < xs_cfgtable_max; i++) {
+        switch (xs_cfgtable[i].itemType) {
+        case CTYPE_INT:
+            XS_CFG_SET_INT(cfg, XS_CONFIG_IDENT,
+                xs_cfgtable[i].itemName,
+                *(gint *) xs_cfgtable[i].itemData);
+            break;
 
-		case CTYPE_BOOL:
-			XS_CFG_SET_BOOL(cfg, XS_CONFIG_IDENT,
-				xs_cfgtable[i].itemName,
-				*(gboolean *) xs_cfgtable[i].itemData);
-			break;
+        case CTYPE_BOOL:
+            XS_CFG_SET_BOOL(cfg, XS_CONFIG_IDENT,
+                xs_cfgtable[i].itemName,
+                *(gboolean *) xs_cfgtable[i].itemData);
+            break;
 
-		case CTYPE_FLOAT:
-			XS_CFG_SET_FLOAT(cfg, XS_CONFIG_IDENT,
-				xs_cfgtable[i].itemName,
-				*(gfloat *) xs_cfgtable[i].itemData);
-			break;
+        case CTYPE_FLOAT:
+            XS_CFG_SET_FLOAT(cfg, XS_CONFIG_IDENT,
+                xs_cfgtable[i].itemName,
+                *(gfloat *) xs_cfgtable[i].itemData);
+            break;
 
-		case CTYPE_STR:
-			XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT,
-				xs_cfgtable[i].itemName,
-				*(gchar **) xs_cfgtable[i].itemData);
-			break;
-		}
-	}
+        case CTYPE_STR:
+            XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT,
+                xs_cfgtable[i].itemName,
+                *(gchar **) xs_cfgtable[i].itemData);
+            break;
+        }
+    }
 
 
 #ifndef AUDACIOUS_PLUGIN
-	xmms_cfg_write_default_file(cfg);
+    xmms_cfg_write_default_file(cfg);
 #endif
-	XS_CONFIG_FREE(cfg);
+    XS_CONFIG_FREE(cfg);
 
-	XS_MUTEX_UNLOCK(xs_cfg);
+    XS_MUTEX_UNLOCK(xs_cfg);
 
-	return 0;
+    return 0;
 }
 
 
@@ -660,97 +660,97 @@
  */
 void xs_cfg_ok(void)
 {
-	gint i;
-	gfloat tmpValue;
-	gint tmpInt;
-	const gchar *tmpStr;
+    gint i;
+    gfloat tmpValue;
+    gint tmpInt;
+    const gchar *tmpStr;
 
-	/* Get lock on configuration */
-	XS_MUTEX_LOCK(xs_cfg);
+    /* Get lock on configuration */
+    XS_MUTEX_LOCK(xs_cfg);
 
-	XSDEBUG("get data from widgets to config...\n");
+    XSDEBUG("get data from widgets to config...\n");
 
-	for (i = 0; i < xs_widtable_max; i++) {
-		switch (xs_widtable[i].widType) {
-		case WTYPE_BGROUP:
-			/* Check if toggle-button is active */
-			if (GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName))->active) {
-				/* Yes, set the constant value */
-				*((gint *) xs_widtable[i].itemData) = xs_widtable[i].itemSet;
-			}
-			break;
+    for (i = 0; i < xs_widtable_max; i++) {
+        switch (xs_widtable[i].widType) {
+        case WTYPE_BGROUP:
+            /* Check if toggle-button is active */
+            if (GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName))->active) {
+                /* Yes, set the constant value */
+                *((gint *) xs_widtable[i].itemData) = xs_widtable[i].itemSet;
+            }
+            break;
 
-		case WTYPE_COMBO:
-			/* Get text from text-widget */
-			tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName)));
-			if (sscanf(tmpStr, "%d", &tmpInt) != 1)
-				tmpInt = xs_widtable[i].itemSet;
+        case WTYPE_COMBO:
+            /* Get text from text-widget */
+            tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName)));
+            if (sscanf(tmpStr, "%d", &tmpInt) != 1)
+                tmpInt = xs_widtable[i].itemSet;
 
-			*((gint *) xs_widtable[i].itemData) = tmpInt;
-			break;
-			
-		case WTYPE_SPIN:
-		case WTYPE_SCALE:
-			/* Get the value */
-			switch (xs_widtable[i].widType) {
-			case WTYPE_SPIN:
-				tmpValue = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName)))->value;
-				break;
+            *((gint *) xs_widtable[i].itemData) = tmpInt;
+            break;
+            
+        case WTYPE_SPIN:
+        case WTYPE_SCALE:
+            /* Get the value */
+            switch (xs_widtable[i].widType) {
+            case WTYPE_SPIN:
+                tmpValue = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName)))->value;
+                break;
 
-			case WTYPE_SCALE:
-				tmpValue = gtk_range_get_adjustment(GTK_RANGE(LUW(xs_widtable[i].widName)))->value;
-				break;
-			
-			default:
-				tmpValue = -1;
-				break;
-			}
+            case WTYPE_SCALE:
+                tmpValue = gtk_range_get_adjustment(GTK_RANGE(LUW(xs_widtable[i].widName)))->value;
+                break;
+            
+            default:
+                tmpValue = -1;
+                break;
+            }
 
-			/* Set the value */
-			switch (xs_widtable[i].itemType) {
-			case CTYPE_INT:
-				*((gint *) xs_widtable[i].itemData) = (gint) tmpValue;
-				break;
+            /* Set the value */
+            switch (xs_widtable[i].itemType) {
+            case CTYPE_INT:
+                *((gint *) xs_widtable[i].itemData) = (gint) tmpValue;
+                break;
 
-			case CTYPE_FLOAT:
-				*((gfloat *) xs_widtable[i].itemData) = tmpValue;
-				break;
-			}
-			break;
+            case CTYPE_FLOAT:
+                *((gfloat *) xs_widtable[i].itemData) = tmpValue;
+                break;
+            }
+            break;
 
-		case WTYPE_BUTTON:
-			/* Check if toggle-button is active */
-			*((gboolean *) xs_widtable[i].itemData) =
-				(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName))->active);
-			break;
+        case WTYPE_BUTTON:
+            /* Check if toggle-button is active */
+            *((gboolean *) xs_widtable[i].itemData) =
+                (GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName))->active);
+            break;
 
-		case WTYPE_TEXT:
-			/* Get text from text-widget */
-			xs_pstrcpy((gchar **) xs_widtable[i].itemData,
-				gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName))));
-			break;
-		}
-	}
-	
-	/* Get filter settings */
-	/*
-	if (!xs_curve_get_points(XS_CURVE(LUW("")), &xs_cfg.sid2Filter.points, &xs_cfg.sid2Filter.npoints)) {
-		xs_error("Warning: Could not get filter curve widget points!\n");
-	}
-	*/
+        case WTYPE_TEXT:
+            /* Get text from text-widget */
+            xs_pstrcpy((gchar **) xs_widtable[i].itemData,
+                gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName))));
+            break;
+        }
+    }
+    
+    /* Get filter settings */
+    /*
+    if (!xs_curve_get_points(XS_CURVE(LUW("")), &xs_cfg.sid2Filter.points, &xs_cfg.sid2Filter.npoints)) {
+        xs_error("Warning: Could not get filter curve widget points!\n");
+    }
+    */
 
-	/* Release lock */
-	XS_MUTEX_UNLOCK(xs_cfg);
-	
-	/* Close window */
-	gtk_widget_destroy(xs_configwin);
-	xs_configwin = NULL;
+    /* Release lock */
+    XS_MUTEX_UNLOCK(xs_cfg);
+    
+    /* Close window */
+    gtk_widget_destroy(xs_configwin);
+    xs_configwin = NULL;
 
-	/* Write settings */
-	xs_write_configuration();
+    /* Write settings */
+    xs_write_configuration();
 
-	/* Re-initialize */
-	xs_reinit();
+    /* Re-initialize */
+    xs_reinit();
 }
 
 
@@ -758,11 +758,11 @@
  */
 gboolean xs_confirmwin_delete(GtkWidget *widget, GdkEvent *event, gpointer user_data)
 {
-	(void) widget;
-	(void) event;
-	(void) user_data;
-	
-	return FALSE;
+    (void) widget;
+    (void) event;
+    (void) user_data;
+    
+    return FALSE;
 }
 
 
@@ -771,34 +771,34 @@
  */
 void xs_cfg_sldb_browse(GtkButton * button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
+    (void) button;
+    (void) user_data;
 
-	if (xs_sldb_fileselector != NULL) {
-                gtk_window_present(GTK_WINDOW(xs_sldb_fileselector));
-		return;
-	}
+    if (xs_sldb_fileselector != NULL) {
+        XS_WINDOW_PRESENT(xs_sldb_fileselector);
+        return;
+    }
 
-	xs_sldb_fileselector = create_xs_sldb_fs();
-	XS_MUTEX_LOCK(xs_cfg);
-	gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_sldb_fileselector), xs_cfg.songlenDBPath);
-	XS_MUTEX_UNLOCK(xs_cfg);
-	gtk_widget_show(xs_sldb_fileselector);
+    xs_sldb_fileselector = create_xs_sldb_fs();
+    XS_MUTEX_LOCK(xs_cfg);
+    gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_sldb_fileselector), xs_cfg.songlenDBPath);
+    XS_MUTEX_UNLOCK(xs_cfg);
+    gtk_widget_show(xs_sldb_fileselector);
 }
 
 
 void xs_sldb_fs_ok(GtkButton *button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
-	
-	/* Selection was accepted! */
-	gtk_entry_set_text(GTK_ENTRY(LUW("cfg_sld_dbpath")),
-			   gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_sldb_fileselector)));
+    (void) button;
+    (void) user_data;
+    
+    /* Selection was accepted! */
+    gtk_entry_set_text(GTK_ENTRY(LUW("cfg_sld_dbpath")),
+               gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_sldb_fileselector)));
 
-	/* Close file selector window */
-	gtk_widget_destroy(xs_sldb_fileselector);
-	xs_sldb_fileselector = NULL;
+    /* Close file selector window */
+    gtk_widget_destroy(xs_sldb_fileselector);
+    xs_sldb_fileselector = NULL;
 }
 
 XS_DEF_WINDOW_CLOSE(sldb_fs_cancel, sldb_fileselector)
@@ -809,34 +809,34 @@
  */
 void xs_cfg_stil_browse(GtkButton * button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
+    (void) button;
+    (void) user_data;
 
-	if (xs_stil_fileselector != NULL) {
-                gtk_window_present(GTK_WINDOW(xs_stil_fileselector));
-		return;
-	}
+    if (xs_stil_fileselector != NULL) {
+        XS_WINDOW_PRESENT(xs_stil_fileselector);
+        return;
+    }
 
-	xs_stil_fileselector = create_xs_stil_fs();
-	XS_MUTEX_LOCK(xs_cfg);
-	gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_stil_fileselector), xs_cfg.stilDBPath);
-	XS_MUTEX_UNLOCK(xs_cfg);
-	gtk_widget_show(xs_stil_fileselector);
+    xs_stil_fileselector = create_xs_stil_fs();
+    XS_MUTEX_LOCK(xs_cfg);
+    gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_stil_fileselector), xs_cfg.stilDBPath);
+    XS_MUTEX_UNLOCK(xs_cfg);
+    gtk_widget_show(xs_stil_fileselector);
 }
 
 
 void xs_stil_fs_ok(GtkButton *button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
+    (void) button;
+    (void) user_data;
 
-	/* Selection was accepted! */
-	gtk_entry_set_text(GTK_ENTRY(LUW("cfg_stil_dbpath")),
-		gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_stil_fileselector)));
+    /* Selection was accepted! */
+    gtk_entry_set_text(GTK_ENTRY(LUW("cfg_stil_dbpath")),
+        gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_stil_fileselector)));
 
-	/* Close file selector window */
-	gtk_widget_destroy(xs_stil_fileselector);
-	xs_stil_fileselector = NULL;
+    /* Close file selector window */
+    gtk_widget_destroy(xs_stil_fileselector);
+    xs_stil_fileselector = NULL;
 }
 
 
@@ -848,34 +848,34 @@
  */
 void xs_cfg_hvsc_browse(GtkButton * button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
+    (void) button;
+    (void) user_data;
 
-	if (xs_hvsc_selector != NULL) {
-                gtk_window_present(GTK_WINDOW(xs_hvsc_selector));
-		return;
-	}
+    if (xs_hvsc_selector != NULL) {
+        XS_WINDOW_PRESENT(xs_hvsc_selector);
+        return;
+    }
 
-	xs_hvsc_selector = create_xs_hvsc_fs();
-	XS_MUTEX_LOCK(xs_cfg);
-	gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_hvsc_selector), xs_cfg.hvscPath);
-	XS_MUTEX_UNLOCK(xs_cfg);
-	gtk_widget_show(xs_hvsc_selector);
+    xs_hvsc_selector = create_xs_hvsc_fs();
+    XS_MUTEX_LOCK(xs_cfg);
+    gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_hvsc_selector), xs_cfg.hvscPath);
+    XS_MUTEX_UNLOCK(xs_cfg);
+    gtk_widget_show(xs_hvsc_selector);
 }
 
 
 void xs_hvsc_fs_ok(GtkButton *button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
+    (void) button;
+    (void) user_data;
 
-	/* Selection was accepted! */
-	gtk_entry_set_text(GTK_ENTRY(LUW("cfg_hvsc_path")),
-		gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_hvsc_selector)));
+    /* Selection was accepted! */
+    gtk_entry_set_text(GTK_ENTRY(LUW("cfg_hvsc_path")),
+        gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_hvsc_selector)));
 
-	/* Close file selector window */
-	gtk_widget_destroy(xs_hvsc_selector);
-	xs_hvsc_selector = NULL;
+    /* Close file selector window */
+    gtk_widget_destroy(xs_hvsc_selector);
+    xs_hvsc_selector = NULL;
 }
 
 
@@ -887,155 +887,156 @@
  */
 void xs_cfg_sp1_filter_reset(GtkButton * button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
+    (void) button;
+    (void) user_data;
 
-	gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_fs"))), XS_SIDPLAY1_FS);
-	gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_fm"))), XS_SIDPLAY1_FM);
-	gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_ft"))), XS_SIDPLAY1_FT);
+    gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_fs"))), XS_SIDPLAY1_FS);
+    gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_fm"))), XS_SIDPLAY1_FM);
+    gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_ft"))), XS_SIDPLAY1_FT);
 }
 
 
 void xs_cfg_sp2_filter_update(XSCurve *curve, t_xs_sid2_filter *f)
 {
-	assert(curve);
-	assert(f);
-	
-	xs_curve_reset(curve);
-	xs_curve_set_range(curve, 0,0, XS_SIDPLAY2_NFPOINTS, XS_SIDPLAY2_FMAX);
-	if (!xs_curve_set_points(curve, f->points, f->npoints))
-		// FIXME
-		xs_error("Warning: Could not set filter curve widget points!\n");
+    assert(curve);
+    assert(f);
+    
+    xs_curve_reset(curve);
+    xs_curve_set_range(curve, 0,0, XS_SIDPLAY2_NFPOINTS, XS_SIDPLAY2_FMAX);
+    if (!xs_curve_set_points(curve, f->points, f->npoints)) {
+        // FIXME
+        xs_error("Warning: Could not set filter curve widget points!\n");
+    }
 }
 
 
 void xs_cfg_sp2_presets_update(void)
 {
-	GList *tmpList = NULL;
-	gint i;
-	
-	for (i = 0; i < xs_cfg.sid2NFilterPresets; i++) {
-		tmpList = g_list_append(tmpList,
-			(gpointer) xs_cfg.sid2FilterPresets[i]->name);
-	}
-	
-	gtk_combo_set_popdown_strings(GTK_COMBO(LUW("cfg_sp2_filter_combo")), tmpList);
-	g_list_free(tmpList);
+    GList *tmpList = NULL;
+    gint i;
+    
+    for (i = 0; i < xs_cfg.sid2NFilterPresets; i++) {
+        tmpList = g_list_append(tmpList,
+            (gpointer) xs_cfg.sid2FilterPresets[i]->name);
+    }
+    
+    gtk_combo_set_popdown_strings(GTK_COMBO(LUW("cfg_sp2_filter_combo")), tmpList);
+    g_list_free(tmpList);
 }
 
 
 void xs_cfg_sp2_filter_load(GtkButton *button, gpointer user_data)
 {
-	const gchar *tmpStr;
-	gint i, j;
-	
-	(void) button;
-	(void) user_data;
-	
-	XS_MUTEX_LOCK(xs_cfg);
-	
-	tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW("cfg_sp2_filter_combo_entry")));
-	for (i = 0, j = -1; i < xs_cfg.sid2NFilterPresets; i++) {
-		if (!strcmp(tmpStr, xs_cfg.sid2FilterPresets[i]->name)) {
-			j = i;
-			break;
-		}
-	}
-	
-	if (j != -1) {
-		fprintf(stderr, "Updating from '%s'\n", tmpStr);
-		xs_cfg_sp2_filter_update(
-			XS_CURVE(LUW("cfg_sp2_filter_curve")),
-			xs_cfg.sid2FilterPresets[i]);
-	} else {
-		/* error/warning: no such filter preset */
-		fprintf(stderr, "No such filter preset '%s'!\n", tmpStr);
-	}
-	
-	XS_MUTEX_UNLOCK(xs_cfg);
+    const gchar *tmpStr;
+    gint i, j;
+    
+    (void) button;
+    (void) user_data;
+    
+    XS_MUTEX_LOCK(xs_cfg);
+    
+    tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW("cfg_sp2_filter_combo_entry")));
+    for (i = 0, j = -1; i < xs_cfg.sid2NFilterPresets; i++) {
+        if (!strcmp(tmpStr, xs_cfg.sid2FilterPresets[i]->name)) {
+            j = i;
+            break;
+        }
+    }
+    
+    if (j != -1) {
+        fprintf(stderr, "Updating from '%s'\n", tmpStr);
+        xs_cfg_sp2_filter_update(
+            XS_CURVE(LUW("cfg_sp2_filter_curve")),
+            xs_cfg.sid2FilterPresets[i]);
+    } else {
+        /* error/warning: no such filter preset */
+        fprintf(stderr, "No such filter preset '%s'!\n", tmpStr);
+    }
+    
+    XS_MUTEX_UNLOCK(xs_cfg);
 }
 
 
 void xs_cfg_sp2_filter_save(GtkButton *button, gpointer user_data)
 {
-	/*
-	1) check if textentry matches any current filter name
-		yes) ask if saving over ok?
-		no) ...
-		
-	2) save current filter to the name		
-	*/
-	const gchar *tmpStr;
-	gint i, j;
-	
-	(void) button;
-	(void) user_data;
-	
-	XS_MUTEX_LOCK(xs_cfg);
-	
-	tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW("cfg_sp2_filter_combo_entry")));
-	for (i = 0, j = -1; i < xs_cfg.sid2NFilterPresets; i++) {
-		if (!strcmp(tmpStr, xs_cfg.sid2FilterPresets[i]->name)) {
-			j = i;
-			break;
-		}
-	}
-	
-	if (j != -1) {
-		fprintf(stderr, "Found, confirm overwrite?\n");
-	}
-	
-	fprintf(stderr, "saving!\n");
-	
-	xs_cfg_sp2_presets_update();
-	
-	XS_MUTEX_UNLOCK(xs_cfg);
+    /*
+    1) check if textentry matches any current filter name
+        yes) ask if saving over ok?
+        no) ...
+        
+    2) save current filter to the name        
+    */
+    const gchar *tmpStr;
+    gint i, j;
+    
+    (void) button;
+    (void) user_data;
+    
+    XS_MUTEX_LOCK(xs_cfg);
+    
+    tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW("cfg_sp2_filter_combo_entry")));
+    for (i = 0, j = -1; i < xs_cfg.sid2NFilterPresets; i++) {
+        if (!strcmp(tmpStr, xs_cfg.sid2FilterPresets[i]->name)) {
+            j = i;
+            break;
+        }
+    }
+    
+    if (j != -1) {
+        fprintf(stderr, "Found, confirm overwrite?\n");
+    }
+    
+    fprintf(stderr, "saving!\n");
+    
+    xs_cfg_sp2_presets_update();
+    
+    XS_MUTEX_UNLOCK(xs_cfg);
 }
 
 
 void xs_cfg_sp2_filter_delete(GtkButton *button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
-	/*
-	1) confirm
-	2) delete
-	*/
+    (void) button;
+    (void) user_data;
+    /*
+    1) confirm
+    2) delete
+    */
 }
 
 
 void xs_cfg_sp2_filter_import(GtkButton *button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
+    (void) button;
+    (void) user_data;
 
-	if (xs_filt_importselector != NULL) {
-                gtk_window_present(GTK_WINDOW(xs_filt_importselector));
-		return;
-	}
+    if (xs_filt_importselector != NULL) {
+        XS_WINDOW_PRESENT(xs_filt_importselector);
+        return;
+    }
 
-	xs_filt_importselector = create_xs_filter_import_fs();
-	gtk_widget_show(xs_filt_importselector);
+    xs_filt_importselector = create_xs_filter_import_fs();
+    gtk_widget_show(xs_filt_importselector);
 }
 
 
 void xs_filter_import_fs_ok(GtkButton *button, gpointer user_data)
 {
-	const gchar *tmpStr;
-	(void) button;
-	(void) user_data;
-	
-	XS_MUTEX_LOCK(xs_cfg);
+    const gchar *tmpStr;
+    (void) button;
+    (void) user_data;
+    
+    XS_MUTEX_LOCK(xs_cfg);
 
-	/* Selection was accepted! */
-	tmpStr = gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_filt_importselector));
-	xs_filters_import(tmpStr, xs_cfg.sid2FilterPresets, &xs_cfg.sid2NFilterPresets);
-	xs_cfg_sp2_presets_update();
+    /* Selection was accepted! */
+    tmpStr = gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_filt_importselector));
+    xs_filters_import(tmpStr, xs_cfg.sid2FilterPresets, &xs_cfg.sid2NFilterPresets);
+    xs_cfg_sp2_presets_update();
 
-	/* Close file selector window */
-	gtk_widget_destroy(xs_filt_importselector);
-	xs_filt_importselector = NULL;
-	XS_MUTEX_UNLOCK(xs_cfg);
+    /* Close file selector window */
+    gtk_widget_destroy(xs_filt_importselector);
+    xs_filt_importselector = NULL;
+    XS_MUTEX_UNLOCK(xs_cfg);
 }
 
 
@@ -1045,35 +1046,35 @@
 
 void xs_cfg_sp2_filter_export(GtkButton *button, gpointer user_data)
 {
-	(void) button;
-	(void) user_data;
+    (void) button;
+    (void) user_data;
 
-	if (xs_filt_exportselector != NULL) {
-                gtk_window_present(GTK_WINDOW(xs_filt_exportselector));
-		return;
-	}
+    if (xs_filt_exportselector != NULL) {
+        XS_WINDOW_PRESENT(xs_filt_exportselector);
+        return;
+    }
 
-	xs_filt_exportselector = create_xs_filter_export_fs();
-	gtk_widget_show(xs_filt_exportselector);
+    xs_filt_exportselector = create_xs_filter_export_fs();
+    gtk_widget_show(xs_filt_exportselector);
 }
 
 
 void xs_filter_export_fs_ok(GtkButton *button, gpointer user_data)
 {
-	const gchar *tmpStr;
-	(void) button;
-	(void) user_data;
+    const gchar *tmpStr;
+    (void) button;
+    (void) user_data;
 
-	XS_MUTEX_LOCK(xs_cfg);
+    XS_MUTEX_LOCK(xs_cfg);
 
-	/* Selection was accepted! */
-	tmpStr = gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_filt_exportselector));
-	xs_filters_export(tmpStr, xs_cfg.sid2FilterPresets, xs_cfg.sid2NFilterPresets);
+    /* Selection was accepted! */
+    tmpStr = gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_filt_exportselector));
+    xs_filters_export(tmpStr, xs_cfg.sid2FilterPresets, xs_cfg.sid2NFilterPresets);
 
-	/* Close file selector window */
-	gtk_widget_destroy(xs_filt_exportselector);
-	xs_filt_exportselector = NULL;
-	XS_MUTEX_UNLOCK(xs_cfg);
+    /* Close file selector window */
+    gtk_widget_destroy(xs_filt_exportselector);
+    xs_filt_exportselector = NULL;
+    XS_MUTEX_UNLOCK(xs_cfg);
 }
 
 
@@ -1085,162 +1086,162 @@
  */
 void xs_cfg_emu_filters_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_filters_notebook"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_filters_notebook"), isActive);
 }
 
 
 void xs_cfg_ftitle_override_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_ftitle_box"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_ftitle_box"), isActive);
 }
 
 
 void xs_cfg_emu_sidplay1_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	(void) togglebutton;
-	(void) user_data;
+    (void) togglebutton;
+    (void) user_data;
 }
 
 
 void xs_cfg_emu_sidplay2_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_emu_mem_real"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_emu_mem_real"), isActive);
 
-	gtk_widget_set_sensitive(LUW("cfg_sidplay2_frame"), isActive);
-	gtk_widget_set_sensitive(LUW("cfg_emu_sp2_opt"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_sidplay2_frame"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_emu_sp2_opt"), isActive);
 
-	gtk_widget_set_sensitive(LUW("cfg_chn_autopan"), !isActive);
+    gtk_widget_set_sensitive(LUW("cfg_chn_autopan"), !isActive);
 
 #ifdef HAVE_RESID_BUILDER
-	gtk_widget_set_sensitive(LUW("cfg_emu_sp2_resid"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_emu_sp2_resid"), isActive);
 #else
-	gtk_widget_set_sensitive(LUW("cfg_emu_sp2_resid"), FALSE);
+    gtk_widget_set_sensitive(LUW("cfg_emu_sp2_resid"), FALSE);
 #endif
 
 #ifdef HAVE_HARDSID_BUILDER
-	gtk_widget_set_sensitive(LUW("cfg_emu_sp2_hardsid"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_emu_sp2_hardsid"), isActive);
 #else
-	gtk_widget_set_sensitive(LUW("cfg_emu_sp2_hardsid"), FALSE);
+    gtk_widget_set_sensitive(LUW("cfg_emu_sp2_hardsid"), FALSE);
 #endif
 }
 
 
 void xs_cfg_oversample_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_oversample_box"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_oversample_box"), isActive);
 }
 
 
 void xs_cfg_mintime_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_mintime_box"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_mintime_box"), isActive);
 }
 
 
 void xs_cfg_maxtime_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(LUW("cfg_maxtime_enable"))->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(LUW("cfg_maxtime_enable"))->active;
 
-	(void) togglebutton;
-	(void) user_data;
+    (void) togglebutton;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_maxtime_unknown"), isActive);
-	gtk_widget_set_sensitive(LUW("cfg_maxtime_box"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_maxtime_unknown"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_maxtime_box"), isActive);
 }
 
 
 void xs_cfg_sldb_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_sld_box"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_sld_box"), isActive);
 }
 
 
 void xs_cfg_stil_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_stil_box1"), isActive);
-	gtk_widget_set_sensitive(LUW("cfg_stil_box2"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_stil_box1"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_stil_box2"), isActive);
 }
 
 
 void xs_cfg_subauto_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_subauto_min_only"), isActive);
-	gtk_widget_set_sensitive(LUW("cfg_subauto_box"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_subauto_min_only"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_subauto_box"), isActive);
 }
 
 
 void xs_cfg_subauto_min_only_toggled(GtkToggleButton * togglebutton, gpointer user_data)
 {
-	gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active &&
-		GTK_TOGGLE_BUTTON(LUW("cfg_subauto_enable"))->active;
+    gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active &&
+        GTK_TOGGLE_BUTTON(LUW("cfg_subauto_enable"))->active;
 
-	(void) user_data;
+    (void) user_data;
 
-	gtk_widget_set_sensitive(LUW("cfg_subauto_box"), isActive);
+    gtk_widget_set_sensitive(LUW("cfg_subauto_box"), isActive);
 }
 
 
 void xs_cfg_mintime_changed(GtkEditable * editable, gpointer user_data)
 {
-	gint tmpValue;
-	GtkAdjustment *tmpAdj;
+    gint tmpValue;
+    GtkAdjustment *tmpAdj;
 
-	(void) user_data;
+    (void) user_data;
 
-	tmpAdj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW("cfg_maxtime")));
+    tmpAdj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW("cfg_maxtime")));
 
-	tmpValue = (gint) gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(editable))->value;
+    tmpValue = (gint) gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(editable))->value;
 
-	if (tmpValue > tmpAdj->value)
-		gtk_adjustment_set_value(tmpAdj, tmpValue);
+    if (tmpValue > tmpAdj->value)
+        gtk_adjustment_set_value(tmpAdj, tmpValue);
 }
 
 
 void xs_cfg_maxtime_changed(GtkEditable * editable, gpointer user_data)
 {
-	gint tmpValue;
-	GtkAdjustment *tmpAdj;
+    gint tmpValue;
+    GtkAdjustment *tmpAdj;
 
-	(void) user_data;
+    (void) user_data;
 
-	tmpAdj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW("cfg_mintime")));
+    tmpAdj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW("cfg_mintime")));
 
-	tmpValue = (gint) gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(editable))->value;
+    tmpValue = (gint) gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(editable))->value;
 
-	if (tmpValue < tmpAdj->value)
-		gtk_adjustment_set_value(tmpAdj, tmpValue);
+    if (tmpValue < tmpAdj->value)
+        gtk_adjustment_set_value(tmpAdj, tmpValue);
 }
 
 
@@ -1251,148 +1252,148 @@
  */
 void xs_configure(void)
 {
-	gint i;
-	gfloat tmpValue;
-	gchar tmpStr[64];
-	GList *tmpList = NULL;
-	GtkWidget *tmpCurve;
+    gint i;
+    gfloat tmpValue;
+    gchar tmpStr[64];
+    GList *tmpList = NULL;
+    GtkWidget *tmpCurve;
 
-	/* Check if the window already exists */
-	if (xs_configwin) {
-                gtk_window_present(GTK_WINDOW(xs_configwin));
-		return;
-	}
+    /* Check if the window already exists */
+    if (xs_configwin) {
+        XS_WINDOW_PRESENT(xs_configwin);
+        return;
+    }
 
-	/* Create the window */
-	xs_configwin = create_xs_configwin();
-	
-	/* Get lock on configuration */
-	XS_MUTEX_LOCK(xs_cfg);
+    /* Create the window */
+    xs_configwin = create_xs_configwin();
+    
+    /* Get lock on configuration */
+    XS_MUTEX_LOCK(xs_cfg);
 
-	/* Add samplerates */
-	for (i = 0; i < xs_nsamplerates_table; i++) {
-		tmpList = g_list_append (tmpList,
-			(gpointer) xs_samplerates_table[i]);
-	}
-	gtk_combo_set_popdown_strings(GTK_COMBO(LUW("cfg_samplerate_combo")), tmpList);
-	g_list_free(tmpList);
-	
-	/* Create the custom filter curve widget for libSIDPlay2 */
-	xs_cfg_sp2_presets_update();
-	tmpCurve = xs_curve_new();
-	xs_cfg_sp2_filter_update(XS_CURVE(tmpCurve), &xs_cfg.sid2Filter);
-	gtk_widget_set_name(tmpCurve, "cfg_sp2_filter_curve");
-	gtk_widget_ref(tmpCurve);
-	gtk_object_set_data_full(GTK_OBJECT(xs_configwin),
-		"cfg_sp2_filter_curve", tmpCurve, (GtkDestroyNotify) gtk_widget_unref);
-	gtk_widget_show(tmpCurve);
-	gtk_container_add(GTK_CONTAINER(LUW("cfg_sp2_filter_frame")), tmpCurve);
+    /* Add samplerates */
+    for (i = 0; i < xs_nsamplerates_table; i++) {
+        tmpList = g_list_append (tmpList,
+            (gpointer) xs_samplerates_table[i]);
+    }
+    gtk_combo_set_popdown_strings(GTK_COMBO(LUW("cfg_samplerate_combo")), tmpList);
+    g_list_free(tmpList);
+    
+    /* Create the custom filter curve widget for libSIDPlay2 */
+    xs_cfg_sp2_presets_update();
+    tmpCurve = xs_curve_new();
+    xs_cfg_sp2_filter_update(XS_CURVE(tmpCurve), &xs_cfg.sid2Filter);
+    gtk_widget_set_name(tmpCurve, "cfg_sp2_filter_curve");
+    gtk_widget_ref(tmpCurve);
+    gtk_object_set_data_full(GTK_OBJECT(xs_configwin),
+        "cfg_sp2_filter_curve", tmpCurve, (GtkDestroyNotify) gtk_widget_unref);
+    gtk_widget_show(tmpCurve);
+    gtk_container_add(GTK_CONTAINER(LUW("cfg_sp2_filter_frame")), tmpCurve);
 
 
-	/* Based on available optional parts, gray out options */
+    /* Based on available optional parts, gray out options */
 #ifndef HAVE_SIDPLAY1
-	gtk_widget_set_sensitive(LUW("cfg_emu_sidplay1"), FALSE);
-	gtk_widget_set_sensitive(LUW("cfg_box_filter_sidplay1"), FALSE);
+    gtk_widget_set_sensitive(LUW("cfg_emu_sidplay1"), FALSE);
+    gtk_widget_set_sensitive(LUW("cfg_box_filter_sidplay1"), FALSE);
 #endif
 
 #ifndef HAVE_SIDPLAY2
-	gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2"), FALSE);
-	gtk_widget_set_sensitive(LUW("cfg_box_filter_sidplay2"), FALSE);
+    gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2"), FALSE);
+    gtk_widget_set_sensitive(LUW("cfg_box_filter_sidplay2"), FALSE);
 #endif
 
-	gtk_widget_set_sensitive(LUW("cfg_resid_frame"), FALSE);
+    gtk_widget_set_sensitive(LUW("cfg_resid_frame"), FALSE);
 
 #if !defined(HAVE_XMMSEXTRA) && !defined(AUDACIOUS_PLUGIN)
-	gtk_widget_set_sensitive(LUW("cfg_ftitle_override"), FALSE);
-	xs_cfg.titleOverride = TRUE;
+    gtk_widget_set_sensitive(LUW("cfg_ftitle_override"), FALSE);
+    xs_cfg.titleOverride = TRUE;
 #endif
 
 #if !defined(HAVE_SONG_POSITION) && !defined(AUDACIOUS_PLUGIN)
-	gtk_widget_set_sensitive(LUW("cfg_subctrl_patch"), FALSE);
+    gtk_widget_set_sensitive(LUW("cfg_subctrl_patch"), FALSE);
 #endif
 
-	xs_cfg_ftitle_override_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_ftitle_override")), NULL);
-	xs_cfg_emu_filters_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_filters")), NULL);
-	xs_cfg_emu_sidplay1_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_sidplay1")), NULL);
-	xs_cfg_emu_sidplay2_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_sidplay2")), NULL);
-	xs_cfg_oversample_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_oversample")), NULL);
-	xs_cfg_mintime_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_mintime_enable")), NULL);
-	xs_cfg_maxtime_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_maxtime_enable")), NULL);
-	xs_cfg_sldb_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_sld_enable")), NULL);
-	xs_cfg_stil_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_stil_enable")), NULL);
-	xs_cfg_subauto_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_subauto_enable")), NULL);
-	xs_cfg_subauto_min_only_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_subauto_min_only")), NULL);
+    xs_cfg_ftitle_override_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_ftitle_override")), NULL);
+    xs_cfg_emu_filters_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_filters")), NULL);
+    xs_cfg_emu_sidplay1_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_sidplay1")), NULL);
+    xs_cfg_emu_sidplay2_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_emu_sidplay2")), NULL);
+    xs_cfg_oversample_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_oversample")), NULL);
+    xs_cfg_mintime_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_mintime_enable")), NULL);
+    xs_cfg_maxtime_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_maxtime_enable")), NULL);
+    xs_cfg_sldb_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_sld_enable")), NULL);
+    xs_cfg_stil_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_stil_enable")), NULL);
+    xs_cfg_subauto_enable_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_subauto_enable")), NULL);
+    xs_cfg_subauto_min_only_toggled(GTK_TOGGLE_BUTTON(LUW("cfg_subauto_min_only")), NULL);
 
 
-	/* Set current data to widgets */
-	for (i = 0; i < xs_widtable_max; i++) {
-		switch (xs_widtable[i].widType) {
-		case WTYPE_BGROUP:
-			assert(xs_widtable[i].itemType == CTYPE_INT);
-			/* Check if current value matches the given one */
-			gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName)),
-				(*((gint *) xs_widtable[i].itemData) == xs_widtable[i].itemSet));
-			break;
+    /* Set current data to widgets */
+    for (i = 0; i < xs_widtable_max; i++) {
+        switch (xs_widtable[i].widType) {
+        case WTYPE_BGROUP:
+            assert(xs_widtable[i].itemType == CTYPE_INT);
+            /* Check if current value matches the given one */
+            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName)),
+                (*((gint *) xs_widtable[i].itemData) == xs_widtable[i].itemSet));
+            break;
 
-		case WTYPE_COMBO:
-			assert(xs_widtable[i].itemType == CTYPE_INT);
-			g_snprintf(tmpStr, sizeof(tmpStr), "%d", *(gint *) xs_widtable[i].itemData);
-			gtk_entry_set_text(GTK_ENTRY(LUW(xs_widtable[i].widName)), tmpStr);
-			break;
-			
-		case WTYPE_SPIN:
-		case WTYPE_SCALE:
-			/* Get the value */
-			switch (xs_widtable[i].itemType) {
-			case CTYPE_INT:
-				tmpValue = (gfloat) * ((gint *) xs_widtable[i].itemData);
-				break;
+        case WTYPE_COMBO:
+            assert(xs_widtable[i].itemType == CTYPE_INT);
+            g_snprintf(tmpStr, sizeof(tmpStr), "%d", *(gint *) xs_widtable[i].itemData);
+            gtk_entry_set_text(GTK_ENTRY(LUW(xs_widtable[i].widName)), tmpStr);
+            break;
+            
+        case WTYPE_SPIN:
+        case WTYPE_SCALE:
+            /* Get the value */
+            switch (xs_widtable[i].itemType) {
+            case CTYPE_INT:
+                tmpValue = (gfloat) * ((gint *) xs_widtable[i].itemData);
+                break;
 
-			case CTYPE_FLOAT:
-				tmpValue = *((gfloat *) xs_widtable[i].itemData);
-				break;
+            case CTYPE_FLOAT:
+                tmpValue = *((gfloat *) xs_widtable[i].itemData);
+                break;
 
-			default:
-				tmpValue = -1;
-				assert(0);
-				break;
-			}
+            default:
+                tmpValue = -1;
+                assert(0);
+                break;
+            }
 
-			/* Set the value */
-			switch (xs_widtable[i].widType) {
-			case WTYPE_SPIN:
-				gtk_adjustment_set_value(gtk_spin_button_get_adjustment
-					(GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName))), tmpValue);
-				break;
+            /* Set the value */
+            switch (xs_widtable[i].widType) {
+            case WTYPE_SPIN:
+                gtk_adjustment_set_value(gtk_spin_button_get_adjustment
+                    (GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName))), tmpValue);
+                break;
 
-			case WTYPE_SCALE:
-				gtk_adjustment_set_value(gtk_range_get_adjustment
-					(GTK_RANGE(LUW(xs_widtable[i].widName))), tmpValue);
-				break;
-			}
-			break;
+            case WTYPE_SCALE:
+                gtk_adjustment_set_value(gtk_range_get_adjustment
+                    (GTK_RANGE(LUW(xs_widtable[i].widName))), tmpValue);
+                break;
+            }
+            break;
 
-		case WTYPE_BUTTON:
-			assert(xs_widtable[i].itemType == CTYPE_BOOL);
-			/* Set toggle-button */
-			gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName)),
-				*((gboolean *) xs_widtable[i].itemData));
-			break;
+        case WTYPE_BUTTON:
+            assert(xs_widtable[i].itemType == CTYPE_BOOL);
+            /* Set toggle-button */
+            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName)),
+                *((gboolean *) xs_widtable[i].itemData));
+            break;
 
-		case WTYPE_TEXT:
-			assert(xs_widtable[i].itemType == CTYPE_STR);
-			/* Set text to text-widget */
-			if (*(gchar **) xs_widtable[i].itemData != NULL) {
-				gtk_entry_set_text(GTK_ENTRY(LUW(xs_widtable[i].widName)),
-				*(gchar **) xs_widtable[i].itemData);
-			}
-			break;
-		}
-	}
+        case WTYPE_TEXT:
+            assert(xs_widtable[i].itemType == CTYPE_STR);
+            /* Set text to text-widget */
+            if (*(gchar **) xs_widtable[i].itemData != NULL) {
+                gtk_entry_set_text(GTK_ENTRY(LUW(xs_widtable[i].widName)),
+                *(gchar **) xs_widtable[i].itemData);
+            }
+            break;
+        }
+    }
 
-	/* Release the configuration */
-	XS_MUTEX_UNLOCK(xs_cfg);
+    /* Release the configuration */
+    XS_MUTEX_UNLOCK(xs_cfg);
 
-	/* Show the widget */
-	gtk_widget_show(xs_configwin);
+    /* Show the widget */
+    gtk_widget_show(xs_configwin);
 }
--- a/src/sid/xs_config.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_config.h	Tue Apr 08 15:11:35 2008 -0500
@@ -12,124 +12,124 @@
 /* Configuration structure
  */
 enum XS_EMUENGINE {
-	XS_ENG_SIDPLAY1 = 1,
-	XS_ENG_SIDPLAY2
+    XS_ENG_SIDPLAY1 = 1,
+    XS_ENG_SIDPLAY2
 };
 
 
 enum XS_BUILDER {
-	XS_BLD_RESID = 1,
-	XS_BLD_HARDSID
+    XS_BLD_RESID = 1,
+    XS_BLD_HARDSID
 };
 
 enum XS_RESOLUTION {
-	XS_RES_8BIT = 8,
-	XS_RES_16BIT = 16
+    XS_RES_8BIT = 8,
+    XS_RES_16BIT = 16
 };
 
 enum XS_CHANNELS {
-	XS_CHN_MONO = 1,
-	XS_CHN_STEREO = 2,
-	XS_CHN_AUTOPAN = 3
+    XS_CHN_MONO = 1,
+    XS_CHN_STEREO = 2,
+    XS_CHN_AUTOPAN = 3
 };
 
 
 enum XS_CLOCK {
-	XS_CLOCK_PAL = 1,
-	XS_CLOCK_NTSC,
-	XS_CLOCK_VBI,
-	XS_CLOCK_CIA,
-	XS_CLOCK_ANY
+    XS_CLOCK_PAL = 1,
+    XS_CLOCK_NTSC,
+    XS_CLOCK_VBI,
+    XS_CLOCK_CIA,
+    XS_CLOCK_ANY
 };
 
 
 enum XS_MPU {
-	XS_MPU_BANK_SWITCHING = 1,
-	XS_MPU_TRANSPARENT_ROM,
-	XS_MPU_PLAYSID_ENVIRONMENT,
-	XS_MPU_REAL
+    XS_MPU_BANK_SWITCHING = 1,
+    XS_MPU_TRANSPARENT_ROM,
+    XS_MPU_PLAYSID_ENVIRONMENT,
+    XS_MPU_REAL
 };
 
 
 enum XS_SSC {
-	XS_SSC_NONE = 1,
-	XS_SSC_POPUP,
-	XS_SSC_PATCH,
-	XS_SSC_SEEK
+    XS_SSC_NONE = 1,
+    XS_SSC_POPUP,
+    XS_SSC_PATCH,
+    XS_SSC_SEEK
 };
 
 
 enum XS_SIDMODEL {
-	XS_SIDMODEL_UNKNOWN = 0,
-	XS_SIDMODEL_6581,
-	XS_SIDMODEL_8580,
-	XS_SIDMODEL_ANY
+    XS_SIDMODEL_UNKNOWN = 0,
+    XS_SIDMODEL_6581,
+    XS_SIDMODEL_8580,
+    XS_SIDMODEL_ANY
 };
 
 
 typedef struct {
-	t_xs_int_point	points[XS_SIDPLAY2_NFPOINTS];
-	gint		npoints;
-	gchar		*name;
+    t_xs_int_point    points[XS_SIDPLAY2_NFPOINTS];
+    gint        npoints;
+    gchar        *name;
 } t_xs_sid2_filter;
 
 
 extern struct t_xs_cfg {
-	/* General audio settings */
-	gint		audioBitsPerSample;
-	gint		audioChannels;
-	gint		audioFrequency;
+    /* General audio settings */
+    gint        audioBitsPerSample;
+    gint        audioChannels;
+    gint        audioFrequency;
 
-	gboolean	oversampleEnable;
-	gint		oversampleFactor;	/* Factor of oversampling */
+    gboolean    oversampleEnable;
+    gint        oversampleFactor;    /* Factor of oversampling */
 
-	/* Emulation settings */
-	gboolean	mos8580;		/* TRUE = 8580, FALSE = 6581 */
-	gboolean	forceModel;
-	gint		memoryMode;		/* See XS_MPU-constants */
-	gint		clockSpeed;		/* PAL (50Hz) or NTSC (60Hz) */
-	gboolean	forceSpeed;		/* TRUE = force to given clockspeed */
+    /* Emulation settings */
+    gboolean    mos8580;        /* TRUE = 8580, FALSE = 6581 */
+    gboolean    forceModel;
+    gint        memoryMode;        /* See XS_MPU-constants */
+    gint        clockSpeed;        /* PAL (50Hz) or NTSC (60Hz) */
+    gboolean    forceSpeed;        /* TRUE = force to given clockspeed */
 
-	gint		playerEngine;		/* Selected player engine */
+    gint        playerEngine;        /* Selected player engine */
 
-	gboolean	emulateFilters;
-	gfloat		sid1FilterFs;
-	gfloat		sid1FilterFm;
-	gfloat		sid1FilterFt;
+    gboolean    emulateFilters;
+    gfloat        sid1FilterFs;
+    gfloat        sid1FilterFm;
+    gfloat        sid1FilterFt;
 
-	gint		sid2OptLevel;		/* SIDPlay2 emulation optimization */
-	gint		sid2Builder;		/* SIDPlay2 "builder" aka SID-emu */
-	t_xs_sid2_filter	sid2Filter;	/* Current SIDPlay2 filter */
-	t_xs_sid2_filter	**sid2FilterPresets;
-	gint		sid2NFilterPresets;
-	
-	
-	/* Playing settings */
-	gboolean	playMaxTimeEnable,
-			playMaxTimeUnknown;	/* Use max-time only when song-length is unknown */
-	gint		playMaxTime;		/* MAX playtime in seconds */
+    gint        sid2OptLevel;        /* SIDPlay2 emulation optimization */
+    gint        sid2Builder;        /* SIDPlay2 "builder" aka SID-emu */
+    t_xs_sid2_filter    sid2Filter;    /* Current SIDPlay2 filter */
+    t_xs_sid2_filter    **sid2FilterPresets;
+    gint        sid2NFilterPresets;
+    
+    
+    /* Playing settings */
+    gboolean    playMaxTimeEnable,
+            playMaxTimeUnknown;    /* Use max-time only when song-length is unknown */
+    gint        playMaxTime;        /* MAX playtime in seconds */
 
-	gboolean	playMinTimeEnable;
-	gint		playMinTime;		/* MIN playtime in seconds */
+    gboolean    playMinTimeEnable;
+    gint        playMinTime;        /* MIN playtime in seconds */
 
-	gboolean	songlenDBEnable;
-	gchar		*songlenDBPath;		/* Path to Songlengths.txt */
+    gboolean    songlenDBEnable;
+    gchar        *songlenDBPath;        /* Path to Songlengths.txt */
 
 
-	/* Miscellaneous settings */
-	gboolean	stilDBEnable;
-	gchar		*stilDBPath;		/* Path to STIL.txt */
-	gchar		*hvscPath;		/* Path-prefix for HVSC */
+    /* Miscellaneous settings */
+    gboolean    stilDBEnable;
+    gchar        *stilDBPath;        /* Path to STIL.txt */
+    gchar        *hvscPath;        /* Path-prefix for HVSC */
 
-	gint		subsongControl;
-	gboolean	detectMagic;
+    gint        subsongControl;
+    gboolean    detectMagic;
 
-	gboolean	titleOverride;		/* TRUE if XMMS titles are overriden */
-	gchar		*titleFormat;
+    gboolean    titleOverride;        /* TRUE if XMMS titles are overriden */
+    gchar        *titleFormat;
 
-	gboolean	subAutoEnable,
-			subAutoMinOnly;
-	gint		subAutoMinTime;
+    gboolean    subAutoEnable,
+            subAutoMinOnly;
+    gint        subAutoMinTime;
 } xs_cfg;
 
 XS_MUTEX_H(xs_cfg);
@@ -138,46 +138,46 @@
 /* Configuration-file
  */
 enum {
-	CTYPE_INT = 1,
-	CTYPE_FLOAT,
-	CTYPE_STR,
-	CTYPE_BOOL
+    CTYPE_INT = 1,
+    CTYPE_FLOAT,
+    CTYPE_STR,
+    CTYPE_BOOL
 };
 
 enum {
-	WTYPE_BGROUP = 1,
-	WTYPE_SPIN,
-	WTYPE_SCALE,
-	WTYPE_BUTTON,
-	WTYPE_TEXT,
-	WTYPE_COMBO
+    WTYPE_BGROUP = 1,
+    WTYPE_SPIN,
+    WTYPE_SCALE,
+    WTYPE_BUTTON,
+    WTYPE_TEXT,
+    WTYPE_COMBO
 };
 
 
 typedef struct {
-	gint	itemType;	/* Type of item (CTYPE_*) */
-	void	*itemData;	/* Pointer to variable */
-	gchar	*itemName;	/* Name of configuration item */
+    gint    itemType;    /* Type of item (CTYPE_*) */
+    void    *itemData;    /* Pointer to variable */
+    gchar    *itemName;    /* Name of configuration item */
 } t_xs_cfg_item;
 
 
 typedef struct {
-	gint	widType;
-	gint	itemType;
-	gchar	*widName;
-	void	*itemData;
-	gint	itemSet;
+    gint    widType;
+    gint    itemType;
+    gchar    *widName;
+    void    *itemData;
+    gint    itemSet;
 } t_xs_wid_item;
 
 
 /* Functions
  */
-void	xs_init_configuration(void);
-void	xs_configure(void);
-void	xs_read_configuration(void);
-gint	xs_write_configuration(void);
+void    xs_init_configuration(void);
+void    xs_configure(void);
+void    xs_read_configuration(void);
+gint    xs_write_configuration(void);
 
 #ifdef __cplusplus
 }
 #endif
-#endif	/* XS_CONFIG_H */
+#endif    /* XS_CONFIG_H */
--- a/src/sid/xs_curve.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_curve.c	Tue Apr 08 15:11:35 2008 -0500
@@ -33,29 +33,29 @@
 #include <gtk/gtkprivate.h>
 
 
-#define RADIUS		3	/* radius of the control points */
-#define RADIUS2		(RADIUS * 2)
-#define MIN_DISTANCE	7	/* min distance between control points */
+#define RADIUS        3    /* radius of the control points */
+#define RADIUS2        (RADIUS * 2)
+#define MIN_DISTANCE    7    /* min distance between control points */
 
 
-#define GRAPH_MASK	(GDK_EXPOSURE_MASK |		\
-			GDK_POINTER_MOTION_MASK |	\
-			GDK_POINTER_MOTION_HINT_MASK |	\
-			GDK_ENTER_NOTIFY_MASK |		\
-			GDK_BUTTON_PRESS_MASK |		\
-			GDK_BUTTON_RELEASE_MASK |	\
-			GDK_BUTTON1_MOTION_MASK)
+#define GRAPH_MASK    (GDK_EXPOSURE_MASK |        \
+            GDK_POINTER_MOTION_MASK |    \
+            GDK_POINTER_MOTION_HINT_MASK |    \
+            GDK_ENTER_NOTIFY_MASK |        \
+            GDK_BUTTON_PRESS_MASK |        \
+            GDK_BUTTON_RELEASE_MASK |    \
+            GDK_BUTTON1_MOTION_MASK)
 
-#define GET_X(i)	curve->ctlpoints[i].x
-#define GET_Y(i)	curve->ctlpoints[i].y
+#define GET_X(i)    curve->ctlpoints[i].x
+#define GET_Y(i)    curve->ctlpoints[i].y
 
 
 enum {
-	PROP_0,
-	PROP_MIN_X,
-	PROP_MAX_X,
-	PROP_MIN_Y,
-	PROP_MAX_Y
+    PROP_0,
+    PROP_MIN_X,
+    PROP_MAX_X,
+    PROP_MIN_Y,
+    PROP_MAX_Y
 };
 
 static GtkDrawingAreaClass *parent_class = NULL;
@@ -63,9 +63,9 @@
 static void xs_curve_class_init(XSCurveClass * class);
 static void xs_curve_init(XSCurve * curve);
 static void xs_curve_get_property(GObject * object, guint param_id,
-			GValue * value, GParamSpec * pspec);
+            GValue * value, GParamSpec * pspec);
 static void xs_curve_set_property(GObject * object, guint param_id,
-			const GValue * value, GParamSpec * pspec);
+            const GValue * value, GParamSpec * pspec);
 static void xs_curve_finalize(GObject * object);
 static gint xs_curve_graph_events(GtkWidget * widget, GdkEvent * event, XSCurve * c);
 static void xs_curve_size_graph(XSCurve * curve);
@@ -73,640 +73,640 @@
 
 GtkType xs_curve_get_type(void)
 {
-	static GType curve_type = 0;
+    static GType curve_type = 0;
 
-	if (!curve_type) {
-		static const GTypeInfo curve_info = {
-			sizeof(XSCurveClass),
-			NULL,	/* base_init */
-			NULL,	/* base_finalize */
-			(GClassInitFunc) xs_curve_class_init,
-			NULL,	/* class_finalize */
-			NULL,	/* class_data */
-			sizeof(XSCurve),
-			0,	/* n_preallocs */
-			(GInstanceInitFunc) xs_curve_init,
-		};
+    if (!curve_type) {
+        static const GTypeInfo curve_info = {
+            sizeof(XSCurveClass),
+            NULL,    /* base_init */
+            NULL,    /* base_finalize */
+            (GClassInitFunc) xs_curve_class_init,
+            NULL,    /* class_finalize */
+            NULL,    /* class_data */
+            sizeof(XSCurve),
+            0,    /* n_preallocs */
+            (GInstanceInitFunc) xs_curve_init,
+        };
 
-		curve_type = g_type_register_static(
-			GTK_TYPE_DRAWING_AREA, "XSCurve",
-			&curve_info, 0);
-	}
-	return curve_type;
+        curve_type = g_type_register_static(
+            GTK_TYPE_DRAWING_AREA, "XSCurve",
+            &curve_info, 0);
+    }
+    return curve_type;
 }
 
 
 static void xs_curve_class_init(XSCurveClass *class)
 {
-	GObjectClass *gobject_class = G_OBJECT_CLASS(class);
+    GObjectClass *gobject_class = G_OBJECT_CLASS(class);
 
-	parent_class = g_type_class_peek_parent(class);
+    parent_class = g_type_class_peek_parent(class);
 
-	gobject_class->finalize = xs_curve_finalize;
+    gobject_class->finalize = xs_curve_finalize;
 
-	gobject_class->set_property = xs_curve_set_property;
-	gobject_class->get_property = xs_curve_get_property;
+    gobject_class->set_property = xs_curve_set_property;
+    gobject_class->get_property = xs_curve_get_property;
 
-	g_object_class_install_property(gobject_class, PROP_MIN_X,
-		g_param_spec_float("min-x",
-			"Minimum X",
-			"Minimum possible value for X",
-			-G_MAXFLOAT, G_MAXFLOAT, 0.0,
-			GTK_PARAM_READWRITE)
-		);
+    g_object_class_install_property(gobject_class, PROP_MIN_X,
+        g_param_spec_float("min-x",
+            "Minimum X",
+            "Minimum possible value for X",
+            -G_MAXFLOAT, G_MAXFLOAT, 0.0,
+            GTK_PARAM_READWRITE)
+        );
 
-	g_object_class_install_property(gobject_class, PROP_MAX_X,
-		g_param_spec_float("max-x",
-			"Maximum X",
-			"Maximum possible X value",
-			-G_MAXFLOAT, G_MAXFLOAT, 1.0,
-			GTK_PARAM_READWRITE)
-		);
-	
-	g_object_class_install_property(gobject_class, PROP_MIN_Y,
-		g_param_spec_float("min-y",
-			"Minimum Y",
-			"Minimum possible value for Y",
-			-G_MAXFLOAT, G_MAXFLOAT, 0.0,
-			GTK_PARAM_READWRITE)
-		);
-	
-	g_object_class_install_property(gobject_class, PROP_MAX_Y,
-		g_param_spec_float("max-y",
-			"Maximum Y",
-			"Maximum possible value for Y",
-			-G_MAXFLOAT, G_MAXFLOAT, 1.0,
-			GTK_PARAM_READWRITE)
-		);
+    g_object_class_install_property(gobject_class, PROP_MAX_X,
+        g_param_spec_float("max-x",
+            "Maximum X",
+            "Maximum possible X value",
+            -G_MAXFLOAT, G_MAXFLOAT, 1.0,
+            GTK_PARAM_READWRITE)
+        );
+    
+    g_object_class_install_property(gobject_class, PROP_MIN_Y,
+        g_param_spec_float("min-y",
+            "Minimum Y",
+            "Minimum possible value for Y",
+            -G_MAXFLOAT, G_MAXFLOAT, 0.0,
+            GTK_PARAM_READWRITE)
+        );
+    
+    g_object_class_install_property(gobject_class, PROP_MAX_Y,
+        g_param_spec_float("max-y",
+            "Maximum Y",
+            "Maximum possible value for Y",
+            -G_MAXFLOAT, G_MAXFLOAT, 1.0,
+            GTK_PARAM_READWRITE)
+        );
 }
 
 
 static void xs_curve_init(XSCurve *curve)
 {
-	gint old_mask;
+    gint old_mask;
 
-	curve->pixmap = NULL;
-	curve->grab_point = -1;
+    curve->pixmap = NULL;
+    curve->grab_point = -1;
 
-	curve->nctlpoints = 0;
-	curve->ctlpoints = NULL;
+    curve->nctlpoints = 0;
+    curve->ctlpoints = NULL;
 
-	curve->min_x = 0.0;
-	curve->max_x = 2047.0;
-	curve->min_y = 0.0;
-	curve->max_y = 24000.0;
+    curve->min_x = 0.0;
+    curve->max_x = 2047.0;
+    curve->min_y = 0.0;
+    curve->max_y = 24000.0;
 
-	old_mask = gtk_widget_get_events(GTK_WIDGET(curve));
-	gtk_widget_set_events(GTK_WIDGET(curve), old_mask | GRAPH_MASK);
-	g_signal_connect(curve, "event", G_CALLBACK(xs_curve_graph_events), curve);
-	xs_curve_size_graph(curve);
+    old_mask = gtk_widget_get_events(GTK_WIDGET(curve));
+    gtk_widget_set_events(GTK_WIDGET(curve), old_mask | GRAPH_MASK);
+    g_signal_connect(curve, "event", G_CALLBACK(xs_curve_graph_events), curve);
+    xs_curve_size_graph(curve);
 }
 
 
 static void xs_curve_set_property(GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec)
 {
-	XSCurve *curve = XS_CURVE(object);
+    XSCurve *curve = XS_CURVE(object);
 
-	switch (prop_id) {
-	case PROP_MIN_X:
-		xs_curve_set_range(curve,
-			g_value_get_float(value), curve->max_x,
-			curve->min_y, curve->max_y);
-		break;
-	case PROP_MAX_X:
-		xs_curve_set_range(curve,
-			curve->min_x, g_value_get_float(value),
-			curve->min_y, curve->max_y);
-		break;
-	case PROP_MIN_Y:
-		xs_curve_set_range(curve,
-			curve->min_x, curve->max_x,
-			g_value_get_float(value), curve->max_y);
-		break;
-	case PROP_MAX_Y:
-		xs_curve_set_range(curve,
-			curve->min_x, curve->max_x,
-			curve->min_y, g_value_get_float(value));
-		break;
-	default:
-		G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
-		break;
-	}
+    switch (prop_id) {
+    case PROP_MIN_X:
+        xs_curve_set_range(curve,
+            g_value_get_float(value), curve->max_x,
+            curve->min_y, curve->max_y);
+        break;
+    case PROP_MAX_X:
+        xs_curve_set_range(curve,
+            curve->min_x, g_value_get_float(value),
+            curve->min_y, curve->max_y);
+        break;
+    case PROP_MIN_Y:
+        xs_curve_set_range(curve,
+            curve->min_x, curve->max_x,
+            g_value_get_float(value), curve->max_y);
+        break;
+    case PROP_MAX_Y:
+        xs_curve_set_range(curve,
+            curve->min_x, curve->max_x,
+            curve->min_y, g_value_get_float(value));
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
 }
 
 
 static void xs_curve_get_property(GObject * object, guint prop_id, GValue * value, GParamSpec * pspec)
 {
-	XSCurve *curve = XS_CURVE(object);
+    XSCurve *curve = XS_CURVE(object);
 
-	switch (prop_id) {
-	case PROP_MIN_X:
-		g_value_set_float(value, curve->min_x);
-		break;
-	case PROP_MAX_X:
-		g_value_set_float(value, curve->max_x);
-		break;
-	case PROP_MIN_Y:
-		g_value_set_float(value, curve->min_y);
-		break;
-	case PROP_MAX_Y:
-		g_value_set_float(value, curve->max_y);
-		break;
-	default:
-		G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
-		break;
-	}
+    switch (prop_id) {
+    case PROP_MIN_X:
+        g_value_set_float(value, curve->min_x);
+        break;
+    case PROP_MAX_X:
+        g_value_set_float(value, curve->max_x);
+        break;
+    case PROP_MIN_Y:
+        g_value_set_float(value, curve->min_y);
+        break;
+    case PROP_MAX_Y:
+        g_value_set_float(value, curve->max_y);
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
 }
 
 
 static int xs_project(gfloat value, gfloat min, gfloat max, int norm)
 {
-	return (norm - 1) * ((value - min) / (max - min)) + 0.5;
+    return (norm - 1) * ((value - min) / (max - min)) + 0.5;
 }
 
 
 static gfloat xs_unproject(gint value, gfloat min, gfloat max, int norm)
 {
-	return value / (gfloat) (norm - 1) * (max - min) + min;
+    return value / (gfloat) (norm - 1) * (max - min) + min;
 }
 
 
 static inline void xs_cubic_coeff(gfloat x1, gfloat y1,
-			gfloat x2, gfloat y2,
-			gfloat k1, gfloat k2,
-			gfloat *a, gfloat *b,
-			gfloat *c, gfloat *d)
+            gfloat x2, gfloat y2,
+            gfloat k1, gfloat k2,
+            gfloat *a, gfloat *b,
+            gfloat *c, gfloat *d)
 {
-	gfloat dx = x2 - x1, dy = y2 - y1;
+    gfloat dx = x2 - x1, dy = y2 - y1;
 
-	*a = ((k1 + k2) - 2 * dy / dx) / (dx * dx);
-	*b = ((k2 - k1) / dx - 3 * (x1 + x2) * (*a)) / 2;
-	*c = k1 - (3 * x1 * (*a) + 2 * (*b)) * x1;
-	*d = y1 - ((x1 * (*a) + (*b)) * x1 + (*c)) * x1;
+    *a = ((k1 + k2) - 2 * dy / dx) / (dx * dx);
+    *b = ((k2 - k1) / dx - 3 * (x1 + x2) * (*a)) / 2;
+    *c = k1 - (3 * x1 * (*a) + 2 * (*b)) * x1;
+    *d = y1 - ((x1 * (*a) + (*b)) * x1 + (*c)) * x1;
 }
 
 
 static void xs_curve_draw(XSCurve *curve, gint width, gint height)
 {
-	gfloat res = 5.0f;
-	GtkStateType state;
-	GtkStyle *style;
-	gint i, ox = -1, oy = -1;
-	t_xs_point *p0, *p1, *p2, *p3;
+    gfloat res = 5.0f;
+    GtkStateType state;
+    GtkStyle *style;
+    gint i, ox = -1, oy = -1;
+    t_xs_point *p0, *p1, *p2, *p3;
 
-	if (!curve->pixmap)
-		return;
+    if (!curve->pixmap)
+        return;
 
-	state = GTK_STATE_NORMAL;
-	if (!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(curve)))
-		state = GTK_STATE_INSENSITIVE;
+    state = GTK_STATE_NORMAL;
+    if (!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(curve)))
+        state = GTK_STATE_INSENSITIVE;
 
-	style = GTK_WIDGET(curve)->style;
+    style = GTK_WIDGET(curve)->style;
 
-	/* Clear the pixmap */
-	gtk_paint_flat_box(style, curve->pixmap,
-		GTK_STATE_NORMAL, GTK_SHADOW_NONE,
-		NULL, GTK_WIDGET(curve), "curve_bg",
-		0, 0,
-		width + RADIUS2,
-		height + RADIUS2);
+    /* Clear the pixmap */
+    gtk_paint_flat_box(style, curve->pixmap,
+        GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+        NULL, GTK_WIDGET(curve), "curve_bg",
+        0, 0,
+        width + RADIUS2,
+        height + RADIUS2);
 
-	
-	/* Draw the grid */
-	for (i = 0; i < 5; i++) {
-		gdk_draw_line(curve->pixmap, style->dark_gc[state],
-			RADIUS,		i * (height / 4.0) + RADIUS,
-			width + RADIUS,	i * (height / 4.0) + RADIUS);
+    
+    /* Draw the grid */
+    for (i = 0; i < 5; i++) {
+        gdk_draw_line(curve->pixmap, style->dark_gc[state],
+            RADIUS,        i * (height / 4.0) + RADIUS,
+            width + RADIUS,    i * (height / 4.0) + RADIUS);
 
-		gdk_draw_line(curve->pixmap, style->dark_gc[state],
-			i * (width / 4.0) + RADIUS, RADIUS,
-			i * (width / 4.0) + RADIUS, height + RADIUS);
-	}
+        gdk_draw_line(curve->pixmap, style->dark_gc[state],
+            i * (width / 4.0) + RADIUS, RADIUS,
+            i * (width / 4.0) + RADIUS, height + RADIUS);
+    }
 
 #if 1
-	/* Draw the spline/curve itself */
-	p0 = curve->ctlpoints;
-	p1 = p0;
-	p2 = p1; p2++;
-	p3 = p2; p3++;
+    /* Draw the spline/curve itself */
+    p0 = curve->ctlpoints;
+    p1 = p0;
+    p2 = p1; p2++;
+    p3 = p2; p3++;
 
-	/* Draw each curve segment */
-	if (curve->nctlpoints > 5)
-	for (i = 0; i < curve->nctlpoints; i++, ++p0, ++p1, ++p2, ++p3) {
-		gint n;
-		gfloat k1, k2, a, b, c, d, x;
-		
-		if (p1->x == p2->x)
-			continue;
+    /* Draw each curve segment */
+    if (curve->nctlpoints > 5)
+    for (i = 0; i < curve->nctlpoints; i++, ++p0, ++p1, ++p2, ++p3) {
+        gint n;
+        gfloat k1, k2, a, b, c, d, x;
+        
+        if (p1->x == p2->x)
+            continue;
 
-		if (p0->x == p1->x && p2->x == p3->x) {
-			k1 = k2 = (p2->y - p1->y) / (p2->x - p1->x);
-		} else if (p0->x == p1->x) {
-			k2 = (p3->y - p1->y) / (p3->x - p1->x);
-			k1 = (3 * (p2->y - p1->y) / (p2->x - p1->x) - k2) / 2;
-		} else if (p2->x == p3->x) {
-			k1 = (p2->y - p0->y) / (p2->x - p0->x);
-			k2 = (3 * (p2->y - p1->y) / (p2->x - p1->x) - k1) / 2;
-		} else {
-			k1 = (p2->y - p0->y) / (p2->x - p0->x);
-			k2 = (p3->y - p1->y) / (p3->x - p1->x);
-		}
+        if (p0->x == p1->x && p2->x == p3->x) {
+            k1 = k2 = (p2->y - p1->y) / (p2->x - p1->x);
+        } else if (p0->x == p1->x) {
+            k2 = (p3->y - p1->y) / (p3->x - p1->x);
+            k1 = (3 * (p2->y - p1->y) / (p2->x - p1->x) - k2) / 2;
+        } else if (p2->x == p3->x) {
+            k1 = (p2->y - p0->y) / (p2->x - p0->x);
+            k2 = (3 * (p2->y - p1->y) / (p2->x - p1->x) - k1) / 2;
+        } else {
+            k1 = (p2->y - p0->y) / (p2->x - p0->x);
+            k2 = (p3->y - p1->y) / (p3->x - p1->x);
+        }
 
-		xs_cubic_coeff(p1->x, p1->y, p2->x, p2->y, k1, k2, &a, &b, &c, &d);
+        xs_cubic_coeff(p1->x, p1->y, p2->x, p2->y, k1, k2, &a, &b, &c, &d);
 
-		for (x = p1->x; x <= p2->x; x += res, n++) {
-			gfloat y = ((a * x + b) * x + c) * x + d;
-			gint qx, qy;
-			qx = RADIUS + xs_project(x, curve->min_x, curve->max_x, width);
-			qy = RADIUS + xs_project(y, curve->min_y, curve->max_y, height);
-			
-			if (ox != -1) {
-				gdk_draw_line(curve->pixmap, style->fg_gc[state],
-					ox, oy, qx, qy);
-			}
-			ox = qx; oy = qy;
-		}
-	}
+        for (x = p1->x; x <= p2->x; x += res, n++) {
+            gfloat y = ((a * x + b) * x + c) * x + d;
+            gint qx, qy;
+            qx = RADIUS + xs_project(x, curve->min_x, curve->max_x, width);
+            qy = RADIUS + xs_project(y, curve->min_y, curve->max_y, height);
+            
+            if (ox != -1) {
+                gdk_draw_line(curve->pixmap, style->fg_gc[state],
+                    ox, oy, qx, qy);
+            }
+            ox = qx; oy = qy;
+        }
+    }
 
 #endif
 
-	/* Draw control points */
-	for (i = 0; i < curve->nctlpoints; ++i) {
-		gint x, y;
-		GtkStateType cstate;
+    /* Draw control points */
+    for (i = 0; i < curve->nctlpoints; ++i) {
+        gint x, y;
+        GtkStateType cstate;
 
-		if (GET_X(i) < curve->min_x || GET_Y(i) < curve->min_y ||
-			GET_X(i) >= curve->max_x || GET_Y(i) >= curve->max_y)
-			continue;
+        if (GET_X(i) < curve->min_x || GET_Y(i) < curve->min_y ||
+            GET_X(i) >= curve->max_x || GET_Y(i) >= curve->max_y)
+            continue;
 
-		x = xs_project(GET_X(i), curve->min_x, curve->max_x, width);
-		y = xs_project(GET_Y(i), curve->min_y, curve->max_y, height);
-		
-		if (i == curve->grab_point) {
-			cstate = GTK_STATE_SELECTED;
-			gdk_draw_line(curve->pixmap, style->fg_gc[cstate],
-				x + RADIUS, RADIUS, x + RADIUS, height + RADIUS);
-			gdk_draw_line(curve->pixmap, style->fg_gc[cstate],
-				RADIUS, y + RADIUS, width + RADIUS, y + RADIUS);
-		} else
-			cstate = state;
-		
-		gdk_draw_arc(curve->pixmap, style->fg_gc[cstate], TRUE,
-			x, y, RADIUS2, RADIUS2, 0, 360 * 64);
-	}
-	
-	/* Draw pixmap in the widget */
-	gdk_draw_pixmap(GTK_WIDGET(curve)->window,
-			style->fg_gc[state], curve->pixmap,
-			0, 0, 0, 0,
-			width + RADIUS2,
-			height + RADIUS2);
+        x = xs_project(GET_X(i), curve->min_x, curve->max_x, width);
+        y = xs_project(GET_Y(i), curve->min_y, curve->max_y, height);
+        
+        if (i == curve->grab_point) {
+            cstate = GTK_STATE_SELECTED;
+            gdk_draw_line(curve->pixmap, style->fg_gc[cstate],
+                x + RADIUS, RADIUS, x + RADIUS, height + RADIUS);
+            gdk_draw_line(curve->pixmap, style->fg_gc[cstate],
+                RADIUS, y + RADIUS, width + RADIUS, y + RADIUS);
+        } else
+            cstate = state;
+        
+        gdk_draw_arc(curve->pixmap, style->fg_gc[cstate], TRUE,
+            x, y, RADIUS2, RADIUS2, 0, 360 * 64);
+    }
+    
+    /* Draw pixmap in the widget */
+    gdk_draw_pixmap(GTK_WIDGET(curve)->window,
+            style->fg_gc[state], curve->pixmap,
+            0, 0, 0, 0,
+            width + RADIUS2,
+            height + RADIUS2);
 }
 
 
 static gint xs_curve_graph_events(GtkWidget *widget, GdkEvent *event, XSCurve *curve)
 {
-	GdkCursorType new_type = curve->cursor_type;
-	GdkEventButton *bevent;
-	GtkWidget *w;
-	gint i, width, height, x, y, tx, ty, cx, closest_point = 0, min_x;
-	guint distance;
+    GdkCursorType new_type = curve->cursor_type;
+    GdkEventButton *bevent;
+    GtkWidget *w;
+    gint i, width, height, x, y, tx, ty, cx, closest_point = 0, min_x;
+    guint distance;
 
-	w = GTK_WIDGET(curve);
-	width = w->allocation.width - RADIUS2;
-	height = w->allocation.height - RADIUS2;
+    w = GTK_WIDGET(curve);
+    width = w->allocation.width - RADIUS2;
+    height = w->allocation.height - RADIUS2;
 
-	if ((width < 0) || (height < 0))
-		return FALSE;
+    if ((width < 0) || (height < 0))
+        return FALSE;
 
-	/* get the pointer position */
-	gdk_window_get_pointer(w->window, &tx, &ty, NULL);
-	x = CLAMP((tx - RADIUS), 0, width - 1);
-	y = CLAMP((ty - RADIUS), 0, height - 1);
-	min_x = curve->min_x;
+    /* get the pointer position */
+    gdk_window_get_pointer(w->window, &tx, &ty, NULL);
+    x = CLAMP((tx - RADIUS), 0, width - 1);
+    y = CLAMP((ty - RADIUS), 0, height - 1);
+    min_x = curve->min_x;
 
-	distance = ~0U;
-	for (i = 0; i < curve->nctlpoints; ++i) {
-		cx = xs_project(GET_X(i), min_x, curve->max_x, width);
-		if ((guint) abs(x - cx) < distance) {
-			distance = abs(x - cx);
-			closest_point = i;
-		}
-	}
-	
-	/* Act based on event type */
-	switch (event->type) {
-	case GDK_CONFIGURE:
-		if (curve->pixmap)
-			gdk_pixmap_unref(curve->pixmap);
-		curve->pixmap = 0;
+    distance = ~0U;
+    for (i = 0; i < curve->nctlpoints; ++i) {
+        cx = xs_project(GET_X(i), min_x, curve->max_x, width);
+        if ((guint) abs(x - cx) < distance) {
+            distance = abs(x - cx);
+            closest_point = i;
+        }
+    }
+    
+    /* Act based on event type */
+    switch (event->type) {
+    case GDK_CONFIGURE:
+        if (curve->pixmap)
+            gdk_pixmap_unref(curve->pixmap);
+        curve->pixmap = 0;
 
-		/* fall through */
+        /* fall through */
 
-	case GDK_EXPOSE:
-		if (!curve->pixmap) {
-			curve->pixmap = gdk_pixmap_new(w->window,
-			w->allocation.width, w->allocation.height, -1);
-		}
-		xs_curve_draw(curve, width, height);
-		break;
+    case GDK_EXPOSE:
+        if (!curve->pixmap) {
+            curve->pixmap = gdk_pixmap_new(w->window,
+            w->allocation.width, w->allocation.height, -1);
+        }
+        xs_curve_draw(curve, width, height);
+        break;
 
-	case GDK_BUTTON_PRESS:
-		gtk_grab_add(widget);
+    case GDK_BUTTON_PRESS:
+        gtk_grab_add(widget);
 
-		bevent = (GdkEventButton *) event;
-		new_type = GDK_TCROSS;
+        bevent = (GdkEventButton *) event;
+        new_type = GDK_TCROSS;
 
-		if (distance > MIN_DISTANCE) {
-			/* insert a new control point */
-			if (curve->nctlpoints > 0) {
-				cx = xs_project(GET_X(closest_point), min_x, curve->max_x, width);
-				if (x > cx) closest_point++;
-			}
-			
-			curve->nctlpoints++;
-			
-			curve->ctlpoints = g_realloc(curve->ctlpoints,
-				curve->nctlpoints * sizeof(*curve->ctlpoints));
-			
-			for (i = curve->nctlpoints - 1; i > closest_point; --i) {
-				memcpy(curve->ctlpoints + i,
-					curve->ctlpoints + i - 1,
-					sizeof(*curve->ctlpoints));
-			}
-		}
-		
-		curve->grab_point = closest_point;
-		GET_X(curve->grab_point) = xs_unproject(x, min_x, curve->max_x, width);
-		GET_Y(curve->grab_point) = xs_unproject(y, curve->min_y, curve->max_y, height);
+        if (distance > MIN_DISTANCE) {
+            /* insert a new control point */
+            if (curve->nctlpoints > 0) {
+                cx = xs_project(GET_X(closest_point), min_x, curve->max_x, width);
+                if (x > cx) closest_point++;
+            }
+            
+            curve->nctlpoints++;
+            
+            curve->ctlpoints = g_realloc(curve->ctlpoints,
+                curve->nctlpoints * sizeof(*curve->ctlpoints));
+            
+            for (i = curve->nctlpoints - 1; i > closest_point; --i) {
+                memcpy(curve->ctlpoints + i,
+                    curve->ctlpoints + i - 1,
+                    sizeof(*curve->ctlpoints));
+            }
+        }
+        
+        curve->grab_point = closest_point;
+        GET_X(curve->grab_point) = xs_unproject(x, min_x, curve->max_x, width);
+        GET_Y(curve->grab_point) = xs_unproject(y, curve->min_y, curve->max_y, height);
 
-		xs_curve_draw(curve, width, height);
-		break;
+        xs_curve_draw(curve, width, height);
+        break;
 
-	case GDK_BUTTON_RELEASE:
-		{
-		gint src, dst;
-		
-		gtk_grab_remove(widget);
+    case GDK_BUTTON_RELEASE:
+        {
+        gint src, dst;
+        
+        gtk_grab_remove(widget);
 
-		/* delete inactive points: */
-		for (src = dst = 0; src < curve->nctlpoints; ++src) {
-			if (GET_X(src) >= min_x) {
-				memcpy(curve->ctlpoints + dst,
-					curve->ctlpoints + src,
-					sizeof(*curve->ctlpoints));
-				dst++;
-			}
-		}
+        /* delete inactive points: */
+        for (src = dst = 0; src < curve->nctlpoints; ++src) {
+            if (GET_X(src) >= min_x) {
+                memcpy(curve->ctlpoints + dst,
+                    curve->ctlpoints + src,
+                    sizeof(*curve->ctlpoints));
+                dst++;
+            }
+        }
 
-		if (dst < src) {
-			curve->nctlpoints -= (src - dst);
-			if (curve->nctlpoints <= 0) {
-				curve->nctlpoints = 1;
-				GET_X(0) = min_x;
-				GET_Y(0) = curve->min_y;
-				xs_curve_draw(curve, width, height);
-			}
-			curve->ctlpoints = g_realloc(curve->ctlpoints,
-				curve->nctlpoints * sizeof(*curve->ctlpoints));
-		}
+        if (dst < src) {
+            curve->nctlpoints -= (src - dst);
+            if (curve->nctlpoints <= 0) {
+                curve->nctlpoints = 1;
+                GET_X(0) = min_x;
+                GET_Y(0) = curve->min_y;
+                xs_curve_draw(curve, width, height);
+            }
+            curve->ctlpoints = g_realloc(curve->ctlpoints,
+                curve->nctlpoints * sizeof(*curve->ctlpoints));
+        }
 
-		new_type = GDK_FLEUR;
-		curve->grab_point = -1;
-		}
-		xs_curve_draw(curve, width, height);
-		break;
+        new_type = GDK_FLEUR;
+        curve->grab_point = -1;
+        }
+        xs_curve_draw(curve, width, height);
+        break;
 
-	case GDK_MOTION_NOTIFY:
-		if (curve->grab_point == -1) {
-			/* if no point is grabbed...  */
-			if (distance <= MIN_DISTANCE)
-				new_type = GDK_FLEUR;
-			else
-				new_type = GDK_TCROSS;
-		} else {
-			gint leftbound, rightbound;
-			
-			/* drag the grabbed point  */
-			new_type = GDK_TCROSS;
-			
-			leftbound = -MIN_DISTANCE;
-			if (curve->grab_point > 0) {
-				leftbound = xs_project(
-					GET_X(curve->grab_point-1),
-					min_x, curve->max_x, width);
-			}
+    case GDK_MOTION_NOTIFY:
+        if (curve->grab_point == -1) {
+            /* if no point is grabbed...  */
+            if (distance <= MIN_DISTANCE)
+                new_type = GDK_FLEUR;
+            else
+                new_type = GDK_TCROSS;
+        } else {
+            gint leftbound, rightbound;
+            
+            /* drag the grabbed point  */
+            new_type = GDK_TCROSS;
+            
+            leftbound = -MIN_DISTANCE;
+            if (curve->grab_point > 0) {
+                leftbound = xs_project(
+                    GET_X(curve->grab_point-1),
+                    min_x, curve->max_x, width);
+            }
 
-			rightbound = width + RADIUS2 + MIN_DISTANCE;
-			if (curve->grab_point + 1 < curve->nctlpoints) {
-				rightbound = xs_project(
-					GET_X(curve->grab_point+1),
-					min_x, curve->max_x, width);
-			}
+            rightbound = width + RADIUS2 + MIN_DISTANCE;
+            if (curve->grab_point + 1 < curve->nctlpoints) {
+                rightbound = xs_project(
+                    GET_X(curve->grab_point+1),
+                    min_x, curve->max_x, width);
+            }
 
-			if ((tx <= leftbound) || (tx >= rightbound) ||
-				(ty > height + RADIUS2 + MIN_DISTANCE) || (ty < -MIN_DISTANCE)) {
-				GET_X(curve->grab_point) = min_x - 1.0;
-			} else {
-				GET_X(curve->grab_point) =
-					xs_unproject(x, min_x, curve->max_x, width);
-				GET_Y(curve->grab_point) =
-					xs_unproject(y, curve->min_y, curve->max_y, height);
-			}
-			
-			xs_curve_draw(curve, width, height);
-		}
-		
-		/* See if cursor type was changed and update accordingly */
-		if (new_type != (GdkCursorType) curve->cursor_type) {
-			GdkCursor *cursor;
-			curve->cursor_type = new_type;
-			cursor = gdk_cursor_new(curve->cursor_type);
-			gdk_window_set_cursor(w->window, cursor);
-			gdk_cursor_destroy(cursor);
-		}
-		break;
+            if ((tx <= leftbound) || (tx >= rightbound) ||
+                (ty > height + RADIUS2 + MIN_DISTANCE) || (ty < -MIN_DISTANCE)) {
+                GET_X(curve->grab_point) = min_x - 1.0;
+            } else {
+                GET_X(curve->grab_point) =
+                    xs_unproject(x, min_x, curve->max_x, width);
+                GET_Y(curve->grab_point) =
+                    xs_unproject(y, curve->min_y, curve->max_y, height);
+            }
+            
+            xs_curve_draw(curve, width, height);
+        }
+        
+        /* See if cursor type was changed and update accordingly */
+        if (new_type != (GdkCursorType) curve->cursor_type) {
+            GdkCursor *cursor;
+            curve->cursor_type = new_type;
+            cursor = gdk_cursor_new(curve->cursor_type);
+            gdk_window_set_cursor(w->window, cursor);
+            gdk_cursor_destroy(cursor);
+        }
+        break;
 
-	default:
-		break;
-	}
-	
-	return FALSE;
+    default:
+        break;
+    }
+    
+    return FALSE;
 }
 
 
 static void xs_curve_size_graph(XSCurve *curve)
 {
-	gint width, height;
-	gfloat aspect;
-	GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(curve));
+    gint width, height;
+    gfloat aspect;
+    GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(curve));
 
-	width = (curve->max_x - curve->min_x) + 1;
-	height = (curve->max_y - curve->min_y) + 1;
-	aspect = width / (gfloat) height;
+    width = (curve->max_x - curve->min_x) + 1;
+    height = (curve->max_y - curve->min_y) + 1;
+    aspect = width / (gfloat) height;
 
-	if (width > gdk_screen_get_width(screen) / 4)
-		width = gdk_screen_get_width(screen) / 4;
+    if (width > gdk_screen_get_width(screen) / 4)
+        width = gdk_screen_get_width(screen) / 4;
 
-	if (height > gdk_screen_get_height(screen) / 4)
-		height = gdk_screen_get_height(screen) / 4;
+    if (height > gdk_screen_get_height(screen) / 4)
+        height = gdk_screen_get_height(screen) / 4;
 
-	if (aspect < 1.0)
-		width = height * aspect;
-	else
-		height = width / aspect;
+    if (aspect < 1.0)
+        width = height * aspect;
+    else
+        height = width / aspect;
 
-	gtk_widget_set_size_request(GTK_WIDGET(curve), width + RADIUS2, height + RADIUS2);
+    gtk_widget_set_size_request(GTK_WIDGET(curve), width + RADIUS2, height + RADIUS2);
 }
 
 
 static void xs_curve_update(XSCurve *curve)
 {
-	if (curve->pixmap) {
-		gint width, height;
+    if (curve->pixmap) {
+        gint width, height;
 
-		width = GTK_WIDGET(curve)->allocation.width - RADIUS2;
-		height = GTK_WIDGET(curve)->allocation.height - RADIUS2;
-		xs_curve_draw(curve, width, height);
-	}
+        width = GTK_WIDGET(curve)->allocation.width - RADIUS2;
+        height = GTK_WIDGET(curve)->allocation.height - RADIUS2;
+        xs_curve_draw(curve, width, height);
+    }
 }
 
 
 void xs_curve_reset(XSCurve *curve)
 {
-	if (curve->ctlpoints)
-		g_free(curve->ctlpoints);
+    if (curve->ctlpoints)
+        g_free(curve->ctlpoints);
 
-	curve->nctlpoints = 4;
-	curve->ctlpoints = g_malloc(curve->nctlpoints * sizeof(curve->ctlpoints[0]));
+    curve->nctlpoints = 4;
+    curve->ctlpoints = g_malloc(curve->nctlpoints * sizeof(curve->ctlpoints[0]));
 
-	GET_X(0) = curve->min_x;
-	GET_Y(0) = curve->min_y;
-	GET_X(1) = curve->min_x;
-	GET_Y(1) = curve->min_y;
+    GET_X(0) = curve->min_x;
+    GET_Y(0) = curve->min_y;
+    GET_X(1) = curve->min_x;
+    GET_Y(1) = curve->min_y;
 
-	GET_X(2) = curve->max_x;
-	GET_Y(2) = curve->max_y;
-	GET_X(3) = curve->max_x;
-	GET_Y(3) = curve->max_y;
-	
-	xs_curve_update(curve);
+    GET_X(2) = curve->max_x;
+    GET_Y(2) = curve->max_y;
+    GET_X(3) = curve->max_x;
+    GET_Y(3) = curve->max_y;
+    
+    xs_curve_update(curve);
 }
 
 
 void xs_curve_set_range(XSCurve *curve, gfloat min_x, gfloat min_y, gfloat max_x, gfloat max_y)
 {
-	g_object_freeze_notify(G_OBJECT(curve));
-	if (curve->min_x != min_x) {
-		curve->min_x = min_x;
-		g_object_notify(G_OBJECT(curve), "min-x");
-	}
-	if (curve->max_x != max_x) {
-		curve->max_x = max_x;
-		g_object_notify(G_OBJECT(curve), "max-x");
-	}
-	if (curve->min_y != min_y) {
-		curve->min_y = min_y;
-		g_object_notify(G_OBJECT(curve), "min-y");
-	}
-	if (curve->max_y != max_y) {
-		curve->max_y = max_y;
-		g_object_notify(G_OBJECT(curve), "max-y");
-	}
-	g_object_thaw_notify(G_OBJECT(curve));
+    g_object_freeze_notify(G_OBJECT(curve));
+    if (curve->min_x != min_x) {
+        curve->min_x = min_x;
+        g_object_notify(G_OBJECT(curve), "min-x");
+    }
+    if (curve->max_x != max_x) {
+        curve->max_x = max_x;
+        g_object_notify(G_OBJECT(curve), "max-x");
+    }
+    if (curve->min_y != min_y) {
+        curve->min_y = min_y;
+        g_object_notify(G_OBJECT(curve), "min-y");
+    }
+    if (curve->max_y != max_y) {
+        curve->max_y = max_y;
+        g_object_notify(G_OBJECT(curve), "max-y");
+    }
+    g_object_thaw_notify(G_OBJECT(curve));
 
-	xs_curve_size_graph(curve);
-	xs_curve_reset(curve);
+    xs_curve_size_graph(curve);
+    xs_curve_reset(curve);
 }
 
 
 gboolean xs_curve_realloc_data(XSCurve *curve, gint npoints)
 {
-	if (npoints != curve->nctlpoints) {
-		curve->nctlpoints = npoints;
-		curve->ctlpoints = (t_xs_point *) g_realloc(curve->ctlpoints,
-			curve->nctlpoints * sizeof(*curve->ctlpoints));
+    if (npoints != curve->nctlpoints) {
+        curve->nctlpoints = npoints;
+        curve->ctlpoints = (t_xs_point *) g_realloc(curve->ctlpoints,
+            curve->nctlpoints * sizeof(*curve->ctlpoints));
 
-		if (curve->ctlpoints == NULL)
-			return FALSE;
-	}
-	
-	return TRUE;
+        if (curve->ctlpoints == NULL)
+            return FALSE;
+    }
+    
+    return TRUE;
 }
 
 
 void xs_curve_get_data(XSCurve *curve, t_xs_point ***points, gint **npoints)
 {
-	*points = &(curve->ctlpoints);
-	*npoints = &(curve->nctlpoints);
+    *points = &(curve->ctlpoints);
+    *npoints = &(curve->nctlpoints);
 }
 
 
 gboolean xs_curve_set_points(XSCurve *curve, t_xs_int_point *points, gint npoints)
 {
-	gint i;
+    gint i;
 
-	if (!xs_curve_realloc_data(curve, npoints + 4))
-		return FALSE;
-	
-	GET_X(0) = curve->min_x;
-	GET_Y(0) = curve->min_y;
-	GET_X(1) = curve->min_x;
-	GET_Y(1) = curve->min_y;
+    if (!xs_curve_realloc_data(curve, npoints + 4))
+        return FALSE;
+    
+    GET_X(0) = curve->min_x;
+    GET_Y(0) = curve->min_y;
+    GET_X(1) = curve->min_x;
+    GET_Y(1) = curve->min_y;
 
-	for (i = 0; i < npoints; i++) {
-		GET_X(i+2) = points[i].x;
-		GET_Y(i+2) = points[i].y;
-	}
+    for (i = 0; i < npoints; i++) {
+        GET_X(i+2) = points[i].x;
+        GET_Y(i+2) = points[i].y;
+    }
 
-	GET_X(npoints+2) = curve->max_x;
-	GET_Y(npoints+2) = curve->max_y;
-	GET_X(npoints+3) = curve->max_x;
-	GET_Y(npoints+3) = curve->max_y;
-	
-	xs_curve_update(curve);
-	return TRUE;
+    GET_X(npoints+2) = curve->max_x;
+    GET_Y(npoints+2) = curve->max_y;
+    GET_X(npoints+3) = curve->max_x;
+    GET_Y(npoints+3) = curve->max_y;
+    
+    xs_curve_update(curve);
+    return TRUE;
 }
 
 
 gboolean xs_curve_get_points(XSCurve *curve, t_xs_int_point **points, gint *npoints)
 {
-	gint i, n;
-	
-	n = curve->nctlpoints - 4;
-	
-	*points = g_malloc(n * sizeof(t_xs_int_point));
-	if (*points == NULL)
-		return FALSE;
-	
-	*npoints = n;
-	for (i = 2; i < curve->nctlpoints - 2; i++) {
-		(*points)[i].x = GET_X(i);
-		(*points)[i].y = GET_Y(i);
-	}
+    gint i, n;
+    
+    n = curve->nctlpoints - 4;
+    
+    *points = g_malloc(n * sizeof(t_xs_int_point));
+    if (*points == NULL)
+        return FALSE;
+    
+    *npoints = n;
+    for (i = 2; i < curve->nctlpoints - 2; i++) {
+        (*points)[i].x = GET_X(i);
+        (*points)[i].y = GET_Y(i);
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 
 GtkWidget *xs_curve_new(void)
 {
-	return g_object_new(XS_TYPE_CURVE, NULL);
+    return g_object_new(XS_TYPE_CURVE, NULL);
 }
 
 
 static void xs_curve_finalize(GObject *object)
 {
-	XSCurve *curve;
+    XSCurve *curve;
 
-	g_return_if_fail(object != NULL);
-	g_return_if_fail(XS_IS_CURVE(object));
+    g_return_if_fail(object != NULL);
+    g_return_if_fail(XS_IS_CURVE(object));
 
-	curve = XS_CURVE(object);
-	if (curve->pixmap)
-		g_object_unref(curve->pixmap);
-	if (curve->ctlpoints)
-		g_free(curve->ctlpoints);
+    curve = XS_CURVE(object);
+    if (curve->pixmap)
+        g_object_unref(curve->pixmap);
+    if (curve->ctlpoints)
+        g_free(curve->ctlpoints);
 
-	G_OBJECT_CLASS(parent_class)->finalize(object);
+    G_OBJECT_CLASS(parent_class)->finalize(object);
 }
--- a/src/sid/xs_curve.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_curve.h	Tue Apr 08 15:11:35 2008 -0500
@@ -8,12 +8,12 @@
 
 /* Macros for type-classing this GtkWidget/object
  */
-#define XS_TYPE_CURVE			(xs_curve_get_type())
-#define XS_CURVE(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), XS_TYPE_CURVE, XSCurve))
-#define XS_CURVE_CLASS(luokka)		(G_TYPE_CHECK_CLASS_CAST ((luokka), XS_TYPE_CURVE, XSCurveClass))
-#define XS_IS_CURVE(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), XS_TYPE_CURVE))
-#define XS_IS_CURVE_CLASS(luokka)	(G_TYPE_CHECK_CLASS_TYPE ((luokka), XS_TYPE_CURVE))
-#define XS_CURVE_GET_CLASS(obj)		(G_TYPE_INSTANCE_GET_CLASS ((obj), XS_TYPE_CURVE, XSCurveClass))
+#define XS_TYPE_CURVE            (xs_curve_get_type())
+#define XS_CURVE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), XS_TYPE_CURVE, XSCurve))
+#define XS_CURVE_CLASS(luokka)        (G_TYPE_CHECK_CLASS_CAST ((luokka), XS_TYPE_CURVE, XSCurveClass))
+#define XS_IS_CURVE(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XS_TYPE_CURVE))
+#define XS_IS_CURVE_CLASS(luokka)    (G_TYPE_CHECK_CLASS_TYPE ((luokka), XS_TYPE_CURVE))
+#define XS_CURVE_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), XS_TYPE_CURVE, XSCurveClass))
 
 
 /* Structures
@@ -22,44 +22,44 @@
 typedef struct _XSCurveClass XSCurveClass;
 
 typedef struct {
-	gfloat x,y;
+    gfloat x,y;
 } t_xs_point;
 
 typedef struct {
-	gint x, y;
+    gint x, y;
 } t_xs_int_point;
 
 struct _XSCurve {
-	GtkDrawingArea graph;
+    GtkDrawingArea graph;
 
-	gint cursor_type;
-	gfloat min_x;
-	gfloat max_x;
-	gfloat min_y;
-	gfloat max_y;
-	GdkPixmap *pixmap;
-	gint grab_point;	/* point currently grabbed */
+    gint cursor_type;
+    gfloat min_x;
+    gfloat max_x;
+    gfloat min_y;
+    gfloat max_y;
+    GdkPixmap *pixmap;
+    gint grab_point;    /* point currently grabbed */
 
-	/* control points */
-	gint nctlpoints;	/* number of control points */
-	t_xs_point *ctlpoints;	/* array of control points */
+    /* control points */
+    gint nctlpoints;    /* number of control points */
+    t_xs_point *ctlpoints;    /* array of control points */
 };
 
 struct _XSCurveClass {
-	GtkDrawingAreaClass parent_class;
+    GtkDrawingAreaClass parent_class;
 };
 
 
-GType		xs_curve_get_type	(void);
-GtkWidget*	xs_curve_new		(void);
-void		xs_curve_reset		(XSCurve *curve);
-void		xs_curve_set_range	(XSCurve *curve,
-					 gfloat min_x, gfloat min_y,
-					 gfloat max_x, gfloat max_y);
-gboolean	xs_curve_realloc_data	(XSCurve *curve, gint npoints);
-void		xs_curve_get_data	(XSCurve *curve, t_xs_point ***points, gint **npoints);
-gboolean	xs_curve_set_points	(XSCurve *curve, t_xs_int_point *points, gint npoints);
-gboolean	xs_curve_get_points	(XSCurve *curve, t_xs_int_point **points, gint *npoints);
+GType        xs_curve_get_type    (void);
+GtkWidget*    xs_curve_new        (void);
+void        xs_curve_reset        (XSCurve *curve);
+void        xs_curve_set_range    (XSCurve *curve,
+                     gfloat min_x, gfloat min_y,
+                     gfloat max_x, gfloat max_y);
+gboolean    xs_curve_realloc_data    (XSCurve *curve, gint npoints);
+void        xs_curve_get_data    (XSCurve *curve, t_xs_point ***points, gint **npoints);
+gboolean    xs_curve_set_points    (XSCurve *curve, t_xs_int_point *points, gint npoints);
+gboolean    xs_curve_get_points    (XSCurve *curve, t_xs_int_point **points, gint *npoints);
 
 G_END_DECLS
 
--- a/src/sid/xs_fileinfo.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_fileinfo.c	Tue Apr 08 15:11:35 2008 -0500
@@ -33,261 +33,261 @@
 
 
 static GtkWidget *xs_fileinfowin = NULL;
-static t_xs_stil_node *xs_fileinfostil = NULL;
+static stil_node_t *xs_fileinfostil = NULL;
 XS_MUTEX(xs_fileinfowin);
 
-#define LUW(x)	lookup_widget(xs_fileinfowin, x)
+#define LUW(x)    lookup_widget(xs_fileinfowin, x)
 
 
 #ifndef AUDACIOUS_PLUGIN
 void xs_fileinfo_update(void)
 {
-	XS_MUTEX_LOCK(xs_status);
-	XS_MUTEX_LOCK(xs_fileinfowin);
+    XS_MUTEX_LOCK(xs_status);
+    XS_MUTEX_LOCK(xs_fileinfowin);
 
-	/* Check if control window exists, we are currently playing and have a tune */
-	if (xs_fileinfowin) {
-		gboolean isEnabled;
-		GtkAdjustment *tmpAdj;
+    /* Check if control window exists, we are currently playing and have a tune */
+    if (xs_fileinfowin) {
+        gboolean isEnabled;
+        GtkAdjustment *tmpAdj;
 
-		if (xs_status.tuneInfo && xs_status.isPlaying && (xs_status.tuneInfo->nsubTunes > 1)) {
-			tmpAdj = gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")));
+        if (xs_status.tuneInfo && xs_status.isPlaying && (xs_status.tuneInfo->nsubTunes > 1)) {
+            tmpAdj = gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")));
 
-			tmpAdj->value = xs_status.currSong;
-			tmpAdj->lower = 1;
-			tmpAdj->upper = xs_status.tuneInfo->nsubTunes;
-			XS_MUTEX_UNLOCK(xs_status);
-			XS_MUTEX_UNLOCK(xs_fileinfowin);
-			gtk_adjustment_value_changed(tmpAdj);
-			XS_MUTEX_LOCK(xs_status);
-			XS_MUTEX_LOCK(xs_fileinfowin);
-			isEnabled = TRUE;
-		} else
-			isEnabled = FALSE;
+            tmpAdj->value = xs_status.currSong;
+            tmpAdj->lower = 1;
+            tmpAdj->upper = xs_status.tuneInfo->nsubTunes;
+            XS_MUTEX_UNLOCK(xs_status);
+            XS_MUTEX_UNLOCK(xs_fileinfowin);
+            gtk_adjustment_value_changed(tmpAdj);
+            XS_MUTEX_LOCK(xs_status);
+            XS_MUTEX_LOCK(xs_fileinfowin);
+            isEnabled = TRUE;
+        } else
+            isEnabled = FALSE;
 
-		/* Enable or disable subtune-control in fileinfo window */
-		gtk_widget_set_sensitive(LUW("fileinfo_subctrl_prev"), isEnabled);
-		gtk_widget_set_sensitive(LUW("fileinfo_subctrl_adj"), isEnabled);
-		gtk_widget_set_sensitive(LUW("fileinfo_subctrl_next"), isEnabled);
-	}
+        /* Enable or disable subtune-control in fileinfo window */
+        gtk_widget_set_sensitive(LUW("fileinfo_subctrl_prev"), isEnabled);
+        gtk_widget_set_sensitive(LUW("fileinfo_subctrl_adj"), isEnabled);
+        gtk_widget_set_sensitive(LUW("fileinfo_subctrl_next"), isEnabled);
+    }
 
-	XS_MUTEX_UNLOCK(xs_status);
-	XS_MUTEX_UNLOCK(xs_fileinfowin);
+    XS_MUTEX_UNLOCK(xs_status);
+    XS_MUTEX_UNLOCK(xs_fileinfowin);
 }
 
 
 static void xs_fileinfo_setsong(void)
 {
-	gint n;
+    gint n;
 
-	XS_MUTEX_LOCK(xs_status);
-	XS_MUTEX_LOCK(xs_fileinfowin);
+    XS_MUTEX_LOCK(xs_status);
+    XS_MUTEX_LOCK(xs_fileinfowin);
 
-	if (xs_status.tuneInfo && xs_status.isPlaying) {
-		n = (gint) gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))->value;
-		if ((n >= 1) && (n <= xs_status.tuneInfo->nsubTunes))
-			xs_status.currSong = n;
-	}
+    if (xs_status.tuneInfo && xs_status.isPlaying) {
+        n = (gint) gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))->value;
+        if ((n >= 1) && (n <= xs_status.tuneInfo->nsubTunes))
+            xs_status.currSong = n;
+    }
 
-	XS_MUTEX_UNLOCK(xs_fileinfowin);
-	XS_MUTEX_UNLOCK(xs_status);
+    XS_MUTEX_UNLOCK(xs_fileinfowin);
+    XS_MUTEX_UNLOCK(xs_status);
 }
 #endif /* AUDACIOUS_PLUGIN */
 
 
 void xs_fileinfo_ok(void)
 {
-	XS_MUTEX_LOCK(xs_fileinfowin);
-	if (xs_fileinfowin) {
-		gtk_widget_destroy(xs_fileinfowin);
-		xs_fileinfowin = NULL;
-	}
-	XS_MUTEX_UNLOCK(xs_fileinfowin);
+    XS_MUTEX_LOCK(xs_fileinfowin);
+    if (xs_fileinfowin) {
+        gtk_widget_destroy(xs_fileinfowin);
+        xs_fileinfowin = NULL;
+    }
+    XS_MUTEX_UNLOCK(xs_fileinfowin);
 }
 
 
 gboolean xs_fileinfo_delete(GtkWidget * widget, GdkEvent * event, gpointer user_data)
 {
-	(void) widget;
-	(void) event;
-	(void) user_data;
+    (void) widget;
+    (void) event;
+    (void) user_data;
 
-	XSDEBUG("delete_event\n");
-	xs_fileinfo_ok();
-	return FALSE;
+    XSDEBUG("delete_event\n");
+    xs_fileinfo_ok();
+    return FALSE;
 }
 
 
 static void xs_fileinfo_subtune(GtkWidget * widget, void *data)
 {
-	t_xs_stil_subnode *tmpNode;
-	GtkWidget *tmpText;
-	gchar *subName, *subAuthor, *subInfo;
+    stil_subnode_t *tmpNode;
+    GtkWidget *tmpText;
+    gchar *subName, *subAuthor, *subInfo;
 
-	(void) widget;
-	(void) data;
+    (void) widget;
+    (void) data;
 
-	/* Freeze text-widget and delete the old text */
-	tmpText = LUW("fileinfo_sub_info");
+    /* Freeze text-widget and delete the old text */
+    tmpText = LUW("fileinfo_sub_info");
 #ifndef AUDACIOUS_PLUGIN
-	gtk_text_freeze(GTK_TEXT(tmpText));
-	gtk_text_set_point(GTK_TEXT(tmpText), 0);
-	gtk_text_forward_delete(GTK_TEXT(tmpText), gtk_text_get_length(GTK_TEXT(tmpText)));
+    gtk_text_freeze(GTK_TEXT(tmpText));
+    gtk_text_set_point(GTK_TEXT(tmpText), 0);
+    gtk_text_forward_delete(GTK_TEXT(tmpText), gtk_text_get_length(GTK_TEXT(tmpText)));
 #endif
 
-	/* Get subtune information */
-	tmpNode = (t_xs_stil_subnode *) data;
-	if (!tmpNode && xs_fileinfostil)
-		tmpNode = xs_fileinfostil->subTunes[0];
-	
-	if (tmpNode) {
-		subName = tmpNode->pName;
-		subAuthor = tmpNode->pAuthor;
-		subInfo = tmpNode->pInfo;
-	} else {
-		subName = NULL;
-		subAuthor = NULL;
-		subInfo = NULL;
-	}
+    /* Get subtune information */
+    tmpNode = (stil_subnode_t *) data;
+    if (!tmpNode && xs_fileinfostil)
+        tmpNode = xs_fileinfostil->subTunes[0];
+    
+    if (tmpNode) {
+        subName = tmpNode->name;
+        subAuthor = tmpNode->author;
+        subInfo = tmpNode->info;
+    } else {
+        subName = NULL;
+        subAuthor = NULL;
+        subInfo = NULL;
+    }
 
-	/* Get and set subtune information */
-	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_name")), subName ? subName : "");
-	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_author")), subAuthor ? subAuthor : "");
+    /* Get and set subtune information */
+    gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_name")), subName ? subName : "");
+    gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_author")), subAuthor ? subAuthor : "");
 
 #ifdef AUDACIOUS_PLUGIN
-	gtk_text_buffer_set_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmpText))),
-		subInfo ? subInfo : "", -1);
+    gtk_text_buffer_set_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmpText))),
+        subInfo ? subInfo : "", -1);
 #else
-	gtk_text_insert(GTK_TEXT(tmpText), NULL, NULL, NULL,
-		subInfo ? subInfo : "", -1);
+    gtk_text_insert(GTK_TEXT(tmpText), NULL, NULL, NULL,
+        subInfo ? subInfo : "", -1);
 
-	/* Un-freeze the widget */
-	gtk_text_thaw(GTK_TEXT(tmpText));
+    /* Un-freeze the widget */
+    gtk_text_thaw(GTK_TEXT(tmpText));
 #endif
 }
 
 
-void xs_fileinfo(gchar * pcFilename)
+void xs_fileinfo(gchar * filename)
 {
-	GtkWidget *tmpMenuItem, *tmpMenu, *tmpOptionMenu;
-	t_xs_tuneinfo *tmpInfo;
-	t_xs_stil_subnode *tmpNode;
-	gchar tmpStr[256], *tmpFilename;
-	gint n;
+    GtkWidget *tmpMenuItem, *tmpMenu, *tmpOptionMenu;
+    xs_tuneinfo_t *tmpInfo;
+    stil_subnode_t *tmpNode;
+    gchar tmpStr[256], *tmpFilename;
+    gint n;
 
-	/* Current implementation leaves old fileinfo window untouched if
-	 * no information can be found for the new file. Hmm...
-	 */
+    /* Current implementation leaves old fileinfo window untouched if
+     * no information can be found for the new file. Hmm...
+     */
 #ifdef AUDACIOUS_PLUGIN
-	xs_get_trackinfo(pcFilename, &tmpFilename, &n);
+    xs_get_trackinfo(filename, &tmpFilename, &n);
 #else
-	tmpFilename = pcFilename;
-#endif	
+    tmpFilename = filename;
+#endif    
 
-	/* Get new tune information */
-	XS_MUTEX_LOCK(xs_fileinfowin);
-	XS_MUTEX_LOCK(xs_status);
-	if ((tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename)) == NULL) {
-		XS_MUTEX_UNLOCK(xs_fileinfowin);
-		XS_MUTEX_UNLOCK(xs_status);
-		return;
-	}
-	XS_MUTEX_UNLOCK(xs_status);
+    /* Get new tune information */
+    XS_MUTEX_LOCK(xs_fileinfowin);
+    XS_MUTEX_LOCK(xs_status);
+    if ((tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename)) == NULL) {
+        XS_MUTEX_UNLOCK(xs_fileinfowin);
+        XS_MUTEX_UNLOCK(xs_status);
+        return;
+    }
+    XS_MUTEX_UNLOCK(xs_status);
 
-	xs_fileinfostil = xs_stil_get(tmpFilename);
+    xs_fileinfostil = xs_stil_get(tmpFilename);
 
 #ifdef AUDACIOUS_PLUGIN
-	g_free(tmpFilename);
+    g_free(tmpFilename);
 #endif
 
-	/* Check if there already is an open fileinfo window */
-	if (xs_fileinfowin)
-                gtk_window_present(GTK_WINDOW(xs_fileinfowin));
-	else {
-		xs_fileinfowin = create_xs_fileinfowin();
+    /* Check if there already is an open fileinfo window */
+    if (xs_fileinfowin)
+        XS_WINDOW_PRESENT(xs_fileinfowin);
+    else {
+        xs_fileinfowin = create_xs_fileinfowin();
 #ifndef AUDACIOUS_PLUGIN
-		XS_SIGNAL_CONNECT(gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj"))),
-			"value_changed", xs_fileinfo_setsong, NULL);
+        XS_SIGNAL_CONNECT(gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj"))),
+            "value_changed", xs_fileinfo_setsong, NULL);
 #endif
-	}
+    }
 
-	/* Delete current items */
-	tmpOptionMenu = LUW("fileinfo_sub_tune");
-	tmpMenu = gtk_option_menu_get_menu(GTK_OPTION_MENU(tmpOptionMenu));
-	gtk_widget_destroy(tmpMenu);
-	gtk_option_menu_remove_menu(GTK_OPTION_MENU(tmpOptionMenu));
-	tmpMenu = gtk_menu_new();
+    /* Delete current items */
+    tmpOptionMenu = LUW("fileinfo_sub_tune");
+    tmpMenu = gtk_option_menu_get_menu(GTK_OPTION_MENU(tmpOptionMenu));
+    gtk_widget_destroy(tmpMenu);
+    gtk_option_menu_remove_menu(GTK_OPTION_MENU(tmpOptionMenu));
+    tmpMenu = gtk_menu_new();
 
 
-	/* Set the generic song information */
-	tmpFilename = XS_CS_FILENAME(pcFilename);
-	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpFilename);
-	g_free(tmpFilename);
-	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_songname")), tmpInfo->sidName);
-	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_composer")), tmpInfo->sidComposer);
-	gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_copyright")), tmpInfo->sidCopyright);
+    /* Set the generic song information */
+    tmpFilename = XS_CS_FILENAME(filename);
+    gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpFilename);
+    g_free(tmpFilename);
+    gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_songname")), tmpInfo->sidName);
+    gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_composer")), tmpInfo->sidComposer);
+    gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_copyright")), tmpInfo->sidCopyright);
 
 
-	/* Main tune - the pseudo tune */
-	tmpMenuItem = gtk_menu_item_new_with_label(_("General info"));
-	gtk_widget_show(tmpMenuItem);
-	gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem);
-	if (xs_fileinfostil)
-		tmpNode = xs_fileinfostil->subTunes[0];
-	else
-		tmpNode = NULL;
-	XS_SIGNAL_CONNECT(tmpMenuItem, "activate", xs_fileinfo_subtune, tmpNode);
+    /* Main tune - the pseudo tune */
+    tmpMenuItem = gtk_menu_item_new_with_label(_("General info"));
+    gtk_widget_show(tmpMenuItem);
+    gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem);
+    if (xs_fileinfostil)
+        tmpNode = xs_fileinfostil->subTunes[0];
+    else
+        tmpNode = NULL;
+    XS_SIGNAL_CONNECT(tmpMenuItem, "activate", xs_fileinfo_subtune, tmpNode);
 
-	/* Other menu items */
-	for (n = 1; n <= tmpInfo->nsubTunes; n++) {
-		if (xs_fileinfostil && n <= xs_fileinfostil->nsubTunes && xs_fileinfostil->subTunes[n]) {
-			gboolean isSet = FALSE;
-			tmpNode = xs_fileinfostil->subTunes[n];
-			
-			g_snprintf(tmpStr, sizeof(tmpStr), _("Tune #%i: "), n);
+    /* Other menu items */
+    for (n = 1; n <= tmpInfo->nsubTunes; n++) {
+        if (xs_fileinfostil && n <= xs_fileinfostil->nsubTunes && xs_fileinfostil->subTunes[n]) {
+            gboolean isSet = FALSE;
+            tmpNode = xs_fileinfostil->subTunes[n];
+            
+            g_snprintf(tmpStr, sizeof(tmpStr), _("Tune #%i: "), n);
 
-			if (tmpNode->pName) {
-				xs_pnstrcat(tmpStr, sizeof(tmpStr), tmpNode->pName);
-				isSet = TRUE;
-			}
+            if (tmpNode->name) {
+                xs_pnstrcat(tmpStr, sizeof(tmpStr), tmpNode->name);
+                isSet = TRUE;
+            }
 
-			if (tmpNode->pTitle) {
-				xs_pnstrcat(tmpStr, sizeof(tmpStr),
-					isSet ? " [*]" : tmpNode->pTitle);
-				isSet = TRUE;
-			}
+            if (tmpNode->title) {
+                xs_pnstrcat(tmpStr, sizeof(tmpStr),
+                    isSet ? " [*]" : tmpNode->title);
+                isSet = TRUE;
+            }
 
-			if (tmpNode->pInfo) {
-				xs_pnstrcat(tmpStr, sizeof(tmpStr), " [!]");
-				isSet = TRUE;
-			}
+            if (tmpNode->info) {
+                xs_pnstrcat(tmpStr, sizeof(tmpStr), " [!]");
+                isSet = TRUE;
+            }
 
-			if (!isSet)
-				xs_pnstrcat(tmpStr, sizeof(tmpStr), "---");
+            if (!isSet)
+                xs_pnstrcat(tmpStr, sizeof(tmpStr), "---");
 
-			tmpMenuItem = gtk_menu_item_new_with_label(tmpStr);
-			gtk_widget_show(tmpMenuItem);
-			gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem);
-			XS_SIGNAL_CONNECT(tmpMenuItem, "activate", xs_fileinfo_subtune, tmpNode);
-		}
+            tmpMenuItem = gtk_menu_item_new_with_label(tmpStr);
+            gtk_widget_show(tmpMenuItem);
+            gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem);
+            XS_SIGNAL_CONNECT(tmpMenuItem, "activate", xs_fileinfo_subtune, tmpNode);
+        }
 
-	}
+    }
 
-	gtk_option_menu_set_menu(GTK_OPTION_MENU(tmpOptionMenu), tmpMenu);
-	gtk_widget_show(tmpOptionMenu);
+    gtk_option_menu_set_menu(GTK_OPTION_MENU(tmpOptionMenu), tmpMenu);
+    gtk_widget_show(tmpOptionMenu);
 
-	/* Set the subtune information */
-	xs_fileinfo_subtune(tmpOptionMenu, NULL);
+    /* Set the subtune information */
+    xs_fileinfo_subtune(tmpOptionMenu, NULL);
 
-	/* Free temporary tuneinfo */
-	xs_tuneinfo_free(tmpInfo);
+    /* Free temporary tuneinfo */
+    xs_tuneinfo_free(tmpInfo);
 
-	/* Show the window */
-	gtk_widget_show(xs_fileinfowin);
+    /* Show the window */
+    gtk_widget_show(xs_fileinfowin);
 
-	XS_MUTEX_UNLOCK(xs_fileinfowin);
+    XS_MUTEX_UNLOCK(xs_fileinfowin);
 
 #ifndef AUDACIOUS_PLUGIN
-	xs_fileinfo_update();
+    xs_fileinfo_update();
 #endif
 }
--- a/src/sid/xs_fileinfo.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_fileinfo.h	Tue Apr 08 15:11:35 2008 -0500
@@ -8,9 +8,9 @@
 #endif
 
 #ifndef AUDACIOUS_PLUGIN
-void	xs_fileinfo_update(void);
+void    xs_fileinfo_update(void);
 #endif
-void	xs_fileinfo(gchar *);
+void    xs_fileinfo(gchar *);
 
 #ifdef __cplusplus
 }
--- a/src/sid/xs_filter.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_filter.c	Tue Apr 08 15:11:35 2008 -0500
@@ -25,60 +25,60 @@
 /* Let's do some preprocessor magic :) */
 #define XS_FVAR(T, P, K) g ## K ## int ## P *sp_ ## T ## P , *dp_ ## T ## P
 
-#define XS_FILTER1(T, P, K, Q)							\
-	dataSize /= sizeof(g ## K ## int ## P); 				\
-	sp_ ## T ## P = (g ## K ## int ## P *) srcBuf;				\
-	dp_ ## T ## P = (g ## K ## int ## P *) destBuf;				\
-	while (dataSize-- > 0) {						\
-		for (tmp = 0, i = 0; i < oversampleFactor; i++)			\
-			tmp += (gint32) ((gint ## P) (*(sp_ ## T ## P ++) Q));	\
-		xs_filter_mbn = (tmp + xs_filter_mbn) / (oversampleFactor + 1);	\
-		*(dp_ ## T ## P ++) = ((g ## K ## int ## P) xs_filter_mbn) Q ;	\
-		}
+#define XS_FILTER1(T, P, K, Q)                            \
+    dataSize /= sizeof(g ## K ## int ## P);                 \
+    sp_ ## T ## P = (g ## K ## int ## P *) srcBuf;                \
+    dp_ ## T ## P = (g ## K ## int ## P *) destBuf;                \
+    while (dataSize-- > 0) {                        \
+        for (tmp = 0, i = 0; i < oversampleFactor; i++)            \
+            tmp += (gint32) ((gint ## P) (*(sp_ ## T ## P ++) Q));    \
+        xs_filter_mbn = (tmp + xs_filter_mbn) / (oversampleFactor + 1);    \
+        *(dp_ ## T ## P ++) = ((g ## K ## int ## P) xs_filter_mbn) Q ;    \
+        }
 
 
 static gint32 xs_filter_mbn = 0;
 
 
 gint xs_filter_rateconv(void *destBuf, void *srcBuf, const AFormat audioFormat,
-			const gint oversampleFactor, const gint bufSize)
+            const gint oversampleFactor, const gint bufSize)
 {
-	static gint32 tmp;
-	XS_FVAR(s, 8,);
-	XS_FVAR(u, 8, u);
-	XS_FVAR(s, 16,);
-	XS_FVAR(u, 16, u);
-	gint i;
-	gint dataSize = bufSize;
+    static gint32 tmp;
+    XS_FVAR(s, 8,);
+    XS_FVAR(u, 8, u);
+    XS_FVAR(s, 16,);
+    XS_FVAR(u, 16, u);
+    gint i;
+    gint dataSize = bufSize;
 
-	if (dataSize <= 0)
-		return dataSize;
+    if (dataSize <= 0)
+        return dataSize;
 
-	switch (audioFormat) {
-	case FMT_U8:
-		XS_FILTER1(u, 8, u, ^0x80)
-		    break;
+    switch (audioFormat) {
+    case FMT_U8:
+        XS_FILTER1(u, 8, u, ^0x80)
+            break;
 
-	case FMT_S8:
-		XS_FILTER1(s, 8,,)
-		    break;
+    case FMT_S8:
+        XS_FILTER1(s, 8,,)
+            break;
 
 
-	case FMT_U16_BE:
-	case FMT_U16_LE:
-	case FMT_U16_NE:
-		XS_FILTER1(u, 16, u, ^0x8000)
-		    break;
+    case FMT_U16_BE:
+    case FMT_U16_LE:
+    case FMT_U16_NE:
+        XS_FILTER1(u, 16, u, ^0x8000)
+            break;
 
-	case FMT_S16_BE:
-	case FMT_S16_LE:
-	case FMT_S16_NE:
-		XS_FILTER1(s, 16,,)
-		    break;
+    case FMT_S16_BE:
+    case FMT_S16_LE:
+    case FMT_S16_NE:
+        XS_FILTER1(s, 16,,)
+            break;
 
-	default:
-		return -1;
-	}
+    default:
+        return -1;
+    }
 
-	return 0;
+    return 0;
 }
--- a/src/sid/xs_filter.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_filter.h	Tue Apr 08 15:11:35 2008 -0500
@@ -11,9 +11,9 @@
 typedef struct {
 } t_xs_filter;
 
-void	xs_filter_init(t_xs_filter *);
+void    xs_filter_init(t_xs_filter *);
 */
-gint	xs_filter_rateconv(void *, void *, const AFormat, const gint, const gint);
+gint    xs_filter_rateconv(void *, void *, const AFormat, const gint, const gint);
 
 #ifdef __cplusplus
 }
--- a/src/sid/xs_init.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_init.c	Tue Apr 08 15:11:35 2008 -0500
@@ -28,24 +28,24 @@
 
 
 InputPlugin xs_plugin_ip = {
-	.description = XS_PACKAGE_STRING,	/* Plugin description */
-	.init = xs_init,			/* Initialization */
-	.cleanup = xs_close,			/* Cleanup */
-	.about = xs_about,			/* Show aboutbox */
-	.configure = xs_configure,		/* Show/edit configuration */
+    .description = XS_PACKAGE_STRING,    /* Plugin description */
+    .init = xs_init,            /* Initialization */
+    .cleanup = xs_close,            /* Cleanup */
+    .about = xs_about,            /* Show aboutbox */
+    .configure = xs_configure,        /* Show/edit configuration */
 
-	.play_file = xs_play_file,		/* Play given file */
-	.stop = xs_stop,			/* Stop playing */
-	.pause = xs_pause,			/* Pause playing */
-	.seek = xs_seek,			/* Seek time */
-	.get_time = xs_get_time,		/* Get playing time */
+    .play_file = xs_play_file,        /* Play given file */
+    .stop = xs_stop,            /* Stop playing */
+    .pause = xs_pause,            /* Pause playing */
+    .seek = xs_seek,            /* Seek time */
+    .get_time = xs_get_time,        /* Get playing time */
 
-	.file_info_box = xs_fileinfo,		/* Show file-information dialog */
+    .file_info_box = xs_fileinfo,        /* Show file-information dialog */
 
-	.get_song_tuple = xs_get_song_tuple,		/* Get Tuple */
-	.vfs_extensions = xs_sid_fmts,			/* File ext assist */
-	.probe_for_tuple = xs_probe_for_tuple,
-	.have_subtune = TRUE
+    .get_song_tuple = xs_get_song_tuple,        /* Get Tuple */
+    .vfs_extensions = xs_sid_fmts,            /* File ext assist */
+    .probe_for_tuple = xs_probe_for_tuple,
+    .have_subtune = TRUE
 };
 
 static InputPlugin *sid_iplist[] = { &xs_plugin_ip, NULL };
--- a/src/sid/xs_length.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_length.c	Tue Apr 08 15:11:35 2008 -0500
@@ -30,219 +30,219 @@
 
 /* Free memory allocated for given SLDB node
  */
-static void xs_sldb_node_free(t_xs_sldb_node *pNode)
+static void xs_sldb_node_free(sldb_node_t *node)
 {
-	if (pNode) {
-		/* Nothing much to do here ... */
-		g_free(pNode->sLengths);
-		g_free(pNode);
-	}
+    if (node) {
+        /* Nothing much to do here ... */
+        g_free(node->lengths);
+        g_free(node);
+    }
 }
 
 
 /* Insert given node to db linked list
  */
-static void xs_sldb_node_insert(t_xs_sldb *db, t_xs_sldb_node *pNode)
+static void xs_sldb_node_insert(xs_sldb_t *db, sldb_node_t *node)
 {
-	assert(db);
+    assert(db);
 
-	if (db->pNodes) {
-		/* The first node's pPrev points to last node */
-		LPREV = db->pNodes->pPrev;	/* New node's prev = Previous last node */
-		db->pNodes->pPrev->pNext = pNode;	/* Previous last node's next = New node */
-		db->pNodes->pPrev = pNode;	/* New last node = New node */
-		LNEXT = NULL;	/* But next is NULL! */
-	} else {
-		db->pNodes = pNode;	/* First node ... */
-		LPREV = pNode;	/* ... it's also last */
-		LNEXT = NULL;	/* But next is NULL! */
-	}
+    if (db->nodes) {
+        /* The first node's prev points to last node */
+        LPREV = db->nodes->prev;    /* New node's prev = Previous last node */
+        db->nodes->prev->next = node;    /* Previous last node's next = New node */
+        db->nodes->prev = node;    /* New last node = New node */
+        LNEXT = NULL;    /* But next is NULL! */
+    } else {
+        db->nodes = node;    /* First node ... */
+        LPREV = node;    /* ... it's also last */
+        LNEXT = NULL;    /* But next is NULL! */
+    }
 }
 
 
 /* Parse a time-entry in SLDB format
  */
-static gint xs_sldb_gettime(gchar *pcStr, size_t *piPos)
+static gint xs_sldb_gettime(gchar *str, size_t *pos)
 {
-	gint iResult, iTemp;
+    gint result, tmp;
 
-	/* Check if it starts with a digit */
-	if (isdigit(pcStr[*piPos])) {
-		/* Get minutes-field */
-		iResult = 0;
-		while (isdigit(pcStr[*piPos]))
-			iResult = (iResult * 10) + (pcStr[(*piPos)++] - '0');
+    /* Check if it starts with a digit */
+    if (isdigit(str[*pos])) {
+        /* Get minutes-field */
+        result = 0;
+        while (isdigit(str[*pos]))
+            result = (result * 10) + (str[(*pos)++] - '0');
 
-		iResult *= 60;
+        result *= 60;
 
-		/* Check the field separator char */
-		if (pcStr[*piPos] == ':') {
-			/* Get seconds-field */
-			(*piPos)++;
-			iTemp = 0;
-			while (isdigit(pcStr[*piPos])) {
-				iTemp = (iTemp * 10) + (pcStr[(*piPos)++] - '0');
-			}
+        /* Check the field separator char */
+        if (str[*pos] == ':') {
+            /* Get seconds-field */
+            (*pos)++;
+            tmp = 0;
+            while (isdigit(str[*pos])) {
+                tmp = (tmp * 10) + (str[(*pos)++] - '0');
+            }
 
-			iResult += iTemp;
-		} else
-			iResult = -2;
-	} else
-		iResult = -1;
+            result += tmp;
+        } else
+            result = -2;
+    } else
+        result = -1;
 
-	/* Ignore and skip the possible attributes */
-	while (pcStr[*piPos] && !isspace(pcStr[*piPos]))
-		(*piPos)++;
+    /* Ignore and skip the possible attributes */
+    while (str[*pos] && !isspace(str[*pos]))
+        (*pos)++;
 
-	return iResult;
+    return result;
 }
 
 
 /* Parse one SLDB definition line, return SLDB node
  */
-t_xs_sldb_node * xs_sldb_read_entry(gchar *inLine)
+sldb_node_t * xs_sldb_read_entry(gchar *inLine)
 {
-	size_t linePos;
-	gint i;
-	gboolean iOK;
-	t_xs_sldb_node *tmpNode;
+    size_t linePos;
+    gint i;
+    gboolean isOK;
+    sldb_node_t *tmnode;
 
-	/* Allocate new node */
-	tmpNode = (t_xs_sldb_node *) g_malloc0(sizeof(t_xs_sldb_node));
-	if (!tmpNode) {
-		xs_error("Error allocating new node. Fatal error.\n");
-		return NULL;
-	}
+    /* Allocate new node */
+    tmnode = (sldb_node_t *) g_malloc0(sizeof(sldb_node_t));
+    if (!tmnode) {
+        xs_error("Error allocating new node. Fatal error.\n");
+        return NULL;
+    }
 
-	/* Get hash value */
-	linePos = 0;
-	for (i = 0; i < XS_MD5HASH_LENGTH; i++, linePos += 2) {
-		gint tmpu;
-		sscanf(&inLine[linePos], "%2x", &tmpu);
-		tmpNode->md5Hash[i] = tmpu;
-	}
-		
-	/* Get playtimes */
-	if (inLine[linePos] != 0) {
-		if (inLine[linePos] != '=') {
-			xs_error("'=' expected on column #%d.\n", linePos);
-			xs_sldb_node_free(tmpNode);
-			return NULL;
-		} else {
-			size_t tmpLen, savePos;
-			
-			/* First playtime is after '=' */
-			savePos = ++linePos;
-			tmpLen = strlen(inLine);
-						
-			/* Get number of sub-tune lengths */						
-			iOK = TRUE;
-			while ((linePos < tmpLen) && iOK) {
-				xs_findnext(inLine, &linePos);
+    /* Get hash value */
+    linePos = 0;
+    for (i = 0; i < XS_MD5HASH_LENGTH; i++, linePos += 2) {
+        gint tmpu;
+        sscanf(&inLine[linePos], "%2x", &tmpu);
+        tmnode->md5Hash[i] = tmpu;
+    }
+        
+    /* Get playtimes */
+    if (inLine[linePos] != 0) {
+        if (inLine[linePos] != '=') {
+            xs_error("'=' expected on column #%d.\n", linePos);
+            xs_sldb_node_free(tmnode);
+            return NULL;
+        } else {
+            size_t tmpLen, savePos;
+            
+            /* First playtime is after '=' */
+            savePos = ++linePos;
+            tmpLen = strlen(inLine);
+                        
+            /* Get number of sub-tune lengths */                        
+            isOK = TRUE;
+            while ((linePos < tmpLen) && isOK) {
+                xs_findnext(inLine, &linePos);
 
-				if (xs_sldb_gettime(inLine, &linePos) >= 0)
-					tmpNode->nLengths++;
-				else
-					iOK = FALSE;
-			}
-			
-			/* Allocate memory for lengths */
-			if (tmpNode->nLengths > 0) {
-				tmpNode->sLengths = (gint *) g_malloc0(tmpNode->nLengths * sizeof(gint));
-				if (!tmpNode->sLengths) {
-					xs_error("Could not allocate memory for node.\n");
-					xs_sldb_node_free(tmpNode);
-					return NULL;
-				}
-			} else {
-				xs_sldb_node_free(tmpNode);
-				return NULL;
-			}
-			
-			/* Read lengths in */
-			i = 0;
-			linePos = savePos;
-			iOK = TRUE;
-			while ((linePos < tmpLen) && (i < tmpNode->nLengths) && iOK) {
-				gint l;
-				
-				xs_findnext(inLine, &linePos);
+                if (xs_sldb_gettime(inLine, &linePos) >= 0)
+                    tmnode->nlengths++;
+                else
+                    isOK = FALSE;
+            }
+            
+            /* Allocate memory for lengths */
+            if (tmnode->nlengths > 0) {
+                tmnode->lengths = (gint *) g_malloc0(tmnode->nlengths * sizeof(gint));
+                if (!tmnode->lengths) {
+                    xs_error("Could not allocate memory for node.\n");
+                    xs_sldb_node_free(tmnode);
+                    return NULL;
+                }
+            } else {
+                xs_sldb_node_free(tmnode);
+                return NULL;
+            }
+            
+            /* Read lengths in */
+            i = 0;
+            linePos = savePos;
+            isOK = TRUE;
+            while ((linePos < tmpLen) && (i < tmnode->nlengths) && isOK) {
+                gint l;
+                
+                xs_findnext(inLine, &linePos);
 
-				l = xs_sldb_gettime(inLine, &linePos);
-				if (l >= 0)
-					tmpNode->sLengths[i] = l;
-				else
-					iOK = FALSE;
+                l = xs_sldb_gettime(inLine, &linePos);
+                if (l >= 0)
+                    tmnode->lengths[i] = l;
+                else
+                    isOK = FALSE;
 
-				i++;
-			}
+                i++;
+            }
 
-			if (!iOK) {
-				xs_sldb_node_free(tmpNode);
-				return NULL;
-			} else
-				return tmpNode;
-		}
-	}
+            if (!isOK) {
+                xs_sldb_node_free(tmnode);
+                return NULL;
+            } else
+                return tmnode;
+        }
+    }
 
-	return NULL;
+    return NULL;
 }
 
 
 /* Read database to memory
  */
-gint xs_sldb_read(t_xs_sldb *db, const gchar *dbFilename)
+gint xs_sldb_read(xs_sldb_t *db, const gchar *dbFilename)
 {
-	FILE *inFile;
-	gchar inLine[XS_BUF_SIZE];
-	size_t lineNum;
-	t_xs_sldb_node *tmpNode;
-	assert(db);
+    FILE *inFile;
+    gchar inLine[XS_BUF_SIZE];
+    size_t lineNum;
+    sldb_node_t *tmnode;
+    assert(db);
 
-	/* Try to open the file */
-	if ((inFile = fopen(dbFilename, "ra")) == NULL) {
-		xs_error("Could not open SongLengthDB '%s'\n", dbFilename);
-		return -1;
-	}
+    /* Try to open the file */
+    if ((inFile = fopen(dbFilename, "ra")) == NULL) {
+        xs_error("Could not open SongLengthDB '%s'\n", dbFilename);
+        return -1;
+    }
 
-	/* Read and parse the data */
-	lineNum = 0;
+    /* Read and parse the data */
+    lineNum = 0;
 
-	while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) {
-		size_t linePos = 0;
-		lineNum++;
-		
-		xs_findnext(inLine, &linePos);
+    while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) {
+        size_t linePos = 0;
+        lineNum++;
+        
+        xs_findnext(inLine, &linePos);
 
-		/* Check if it is datafield */
-		if (isxdigit(inLine[linePos])) {
-			/* Check the length of the hash */
-			gint hashLen;
-			for (hashLen = 0; inLine[linePos] && isxdigit(inLine[linePos]); hashLen++, linePos++);
+        /* Check if it is datafield */
+        if (isxdigit(inLine[linePos])) {
+            /* Check the length of the hash */
+            gint hashLen;
+            for (hashLen = 0; inLine[linePos] && isxdigit(inLine[linePos]); hashLen++, linePos++);
 
-			if (hashLen != XS_MD5HASH_LENGTH_CH) {
-				xs_error("Invalid MD5-hash in SongLengthDB file '%s' line #%d!\n",
-					dbFilename, lineNum);
-			} else {
-				/* Parse and add node to db */
-				if ((tmpNode = xs_sldb_read_entry(inLine)) != NULL) {
-					xs_sldb_node_insert(db, tmpNode);
-				} else {
-					xs_error("Invalid entry in SongLengthDB file '%s' line #%d!\n",
-						dbFilename, lineNum);
-				}
-			}
-		} else if ((inLine[linePos] != ';') && (inLine[linePos] != '[') && (inLine[linePos] != 0)) {
-			xs_error("Invalid line in SongLengthDB file '%s' line #%d\n",
-				dbFilename, lineNum);
-		}
+            if (hashLen != XS_MD5HASH_LENGTH_CH) {
+                xs_error("Invalid MD5-hash in SongLengthDB file '%s' line #%d!\n",
+                    dbFilename, lineNum);
+            } else {
+                /* Parse and add node to db */
+                if ((tmnode = xs_sldb_read_entry(inLine)) != NULL) {
+                    xs_sldb_node_insert(db, tmnode);
+                } else {
+                    xs_error("Invalid entry in SongLengthDB file '%s' line #%d!\n",
+                        dbFilename, lineNum);
+                }
+            }
+        } else if ((inLine[linePos] != ';') && (inLine[linePos] != '[') && (inLine[linePos] != 0)) {
+            xs_error("Invalid line in SongLengthDB file '%s' line #%d\n",
+                dbFilename, lineNum);
+        }
 
-	}
+    }
 
-	/* Close the file */
-	fclose(inFile);
+    /* Close the file */
+    fclose(inFile);
 
-	return 0;
+    return 0;
 }
 
 
@@ -251,267 +251,269 @@
  *         negative if testHash1 < testHash2
  *         positive if testHash1 > testHash2
  */
-static gint xs_sldb_cmphash(t_xs_md5hash testHash1, t_xs_md5hash testHash2)
+static gint xs_sldb_cmphash(xs_md5hash_t testHash1, xs_md5hash_t testHash2)
 {
-	gint i, d;
+    gint i, d;
 
-	/* Compute difference of hashes */
-	for (i = 0, d = 0; (i < XS_MD5HASH_LENGTH) && !d; i++)
-		d = (testHash1[i] - testHash2[i]);
+    /* Compute difference of hashes */
+    for (i = 0, d = 0; (i < XS_MD5HASH_LENGTH) && !d; i++)
+        d = (testHash1[i] - testHash2[i]);
 
-	return d;
+    return d;
 }
 
 
 /* Compare two nodes
  */
-static gint xs_sldb_cmp(const void *pNode1, const void *pNode2)
+static gint xs_sldb_cmp(const void *node1, const void *node2)
 {
-	/* We assume here that we never ever get NULL-pointers or similar */
-	return xs_sldb_cmphash(
-		(*(t_xs_sldb_node **) pNode1)->md5Hash,
-		(*(t_xs_sldb_node **) pNode2)->md5Hash);
+    /* We assume here that we never ever get NULL-pointers or similar */
+    return xs_sldb_cmphash(
+        (*(sldb_node_t **) node1)->md5Hash,
+        (*(sldb_node_t **) node2)->md5Hash);
 }
 
 
 /* (Re)create index
  */
-gint xs_sldb_index(t_xs_sldb * db)
+gint xs_sldb_index(xs_sldb_t * db)
 {
-	t_xs_sldb_node *pCurr;
-	size_t i;
-	assert(db);
+    sldb_node_t *pCurr;
+    size_t i;
+    assert(db);
 
-	/* Free old index */
-	if (db->ppIndex) {
-		g_free(db->ppIndex);
-		db->ppIndex = NULL;
-	}
+    /* Free old index */
+    if (db->pindex) {
+        g_free(db->pindex);
+        db->pindex = NULL;
+    }
 
-	/* Get size of db */
-	pCurr = db->pNodes;
-	db->n = 0;
-	while (pCurr) {
-		db->n++;
-		pCurr = pCurr->pNext;
-	}
+    /* Get size of db */
+    pCurr = db->nodes;
+    db->n = 0;
+    while (pCurr) {
+        db->n++;
+        pCurr = pCurr->next;
+    }
 
-	/* Check number of nodes */
-	if (db->n > 0) {
-		/* Allocate memory for index-table */
-		db->ppIndex = (t_xs_sldb_node **) g_malloc(sizeof(t_xs_sldb_node *) * db->n);
-		if (!db->ppIndex)
-			return -1;
+    /* Check number of nodes */
+    if (db->n > 0) {
+        /* Allocate memory for index-table */
+        db->pindex = (sldb_node_t **) g_malloc(sizeof(sldb_node_t *) * db->n);
+        if (!db->pindex)
+            return -1;
 
-		/* Get node-pointers to table */
-		i = 0;
-		pCurr = db->pNodes;
-		while (pCurr && (i < db->n)) {
-			db->ppIndex[i++] = pCurr;
-			pCurr = pCurr->pNext;
-		}
+        /* Get node-pointers to table */
+        i = 0;
+        pCurr = db->nodes;
+        while (pCurr && (i < db->n)) {
+            db->pindex[i++] = pCurr;
+            pCurr = pCurr->next;
+        }
 
-		/* Sort the indexes */
-		qsort(db->ppIndex, db->n, sizeof(t_xs_sldb_node *), xs_sldb_cmp);
-	}
+        /* Sort the indexes */
+        qsort(db->pindex, db->n, sizeof(sldb_node_t *), xs_sldb_cmp);
+    }
 
-	return 0;
+    return 0;
 }
 
 
 /* Free a given song-length database
  */
-void xs_sldb_free(t_xs_sldb * db)
+void xs_sldb_free(xs_sldb_t * db)
 {
-	t_xs_sldb_node *pCurr, *pNext;
+    sldb_node_t *pCurr, *next;
 
-	if (!db)
-		return;
+    if (!db)
+        return;
 
-	/* Free the memory allocated for nodes */
-	pCurr = db->pNodes;
-	while (pCurr) {
-		pNext = pCurr->pNext;
-		xs_sldb_node_free(pCurr);
-		pCurr = pNext;
-	}
+    /* Free the memory allocated for nodes */
+    pCurr = db->nodes;
+    while (pCurr) {
+        next = pCurr->next;
+        xs_sldb_node_free(pCurr);
+        pCurr = next;
+    }
 
-	db->pNodes = NULL;
+    db->nodes = NULL;
 
-	/* Free memory allocated for index */
-	if (db->ppIndex) {
-		g_free(db->ppIndex);
-		db->ppIndex = NULL;
-	}
+    /* Free memory allocated for index */
+    if (db->pindex) {
+        g_free(db->pindex);
+        db->pindex = NULL;
+    }
 
-	/* Free structure */
-	db->n = 0;
-	g_free(db);
+    /* Free structure */
+    db->n = 0;
+    g_free(db);
 }
 
 
 /* Compute md5hash of given SID-file
  */
-typedef struct
-{
-	gchar magicID[4];	/* "PSID" / "RSID" magic identifier */
-	guint16 version,	/* Version number */
-		dataOffset,	/* Start of actual c64 data in file */
-		loadAddress,	/* Loading address */
-		initAddress,	/* Initialization address */
-		playAddress,	/* Play one frame */
-		nSongs,		/* Number of subsongs */
-		startSong;	/* Default starting song */
-	guint32 speed;		/* Speed */
-	gchar sidName[32];	/* Descriptive text-fields, ASCIIZ */
-	gchar sidAuthor[32];
-	gchar sidCopyright[32];
-} t_xs_psidv1_header;
+typedef struct {
+    gchar magicID[4];    /* "PSID" / "RSID" magic identifier */
+    guint16 version,    /* Version number */
+        dataOffset,    /* Start of actual c64 data in file */
+        loadAddress,    /* Loading address */
+        initAddress,    /* Initialization address */
+        playAddress,    /* Play one frame */
+        nSongs,        /* Number of subsongs */
+        startSong;    /* Default starting song */
+    guint32 speed;        /* Speed */
+    gchar sidName[32];    /* Descriptive text-fields, ASCIIZ */
+    gchar sidAuthor[32];
+    gchar sidCopyright[32];
+} psidv1_header_t;
 
 
-typedef struct
-{
-	guint16 flags;		/* Flags */
-	guint8 startPage, pageLength;
-	guint16 reserved;
-} t_xs_psidv2_header;
+typedef struct {
+    guint16 flags;        /* Flags */
+    guint8 startPage, pageLength;
+    guint16 reserved;
+} psidv2_header_t;
 
 
-static gint xs_get_sid_hash(const gchar *pcFilename, t_xs_md5hash hash)
+static gint xs_get_sid_hash(const gchar *filename, xs_md5hash_t hash)
 {
-	t_xs_file *inFile;
-	t_xs_md5state inState;
-	t_xs_psidv1_header psidH;
-	t_xs_psidv2_header psidH2;
-	guint8 *songData;
-	guint8 ib8[2], i8;
-	gint iIndex, iRes;
+    xs_file_t *inFile;
+    xs_md5state_t inState;
+    psidv1_header_t psidH;
+    psidv2_header_t psidH2;
+    guint8 *songData;
+    guint8 ib8[2], i8;
+    gint index, result;
 
-	/* Try to open the file */
-	if ((inFile = xs_fopen(pcFilename, "rb")) == NULL)
-		return -1;
+    /* Try to open the file */
+    if ((inFile = xs_fopen(filename, "rb")) == NULL)
+        return -1;
 
-	/* Read PSID header in */
-	xs_fread(psidH.magicID, sizeof(psidH.magicID), 1, inFile);
-	if (strncmp(psidH.magicID, "PSID", 4) && strncmp(psidH.magicID, "RSID", 4)) {
-		xs_fclose(inFile);
-		xs_error("Not a PSID or RSID file '%s'\n", pcFilename);
-		return -2;
-	}
+    /* Read PSID header in */
+    xs_fread(psidH.magicID, sizeof(psidH.magicID), 1, inFile);
+    if (strncmp(psidH.magicID, "PSID", 4) && strncmp(psidH.magicID, "RSID", 4)) {
+        xs_fclose(inFile);
+        xs_error("Not a PSID or RSID file '%s'\n", filename);
+        return -2;
+    }
 
-	psidH.version = xs_fread_be16(inFile);
-	psidH.dataOffset = xs_fread_be16(inFile);
-	psidH.loadAddress = xs_fread_be16(inFile);
-	psidH.initAddress = xs_fread_be16(inFile);
-	psidH.playAddress = xs_fread_be16(inFile);
-	psidH.nSongs = xs_fread_be16(inFile);
-	psidH.startSong = xs_fread_be16(inFile);
-	psidH.speed = xs_fread_be32(inFile);
+    psidH.version = xs_fread_be16(inFile);
+    psidH.dataOffset = xs_fread_be16(inFile);
+    psidH.loadAddress = xs_fread_be16(inFile);
+    psidH.initAddress = xs_fread_be16(inFile);
+    psidH.playAddress = xs_fread_be16(inFile);
+    psidH.nSongs = xs_fread_be16(inFile);
+    psidH.startSong = xs_fread_be16(inFile);
+    psidH.speed = xs_fread_be32(inFile);
 
-	xs_fread(psidH.sidName, sizeof(gchar), sizeof(psidH.sidName), inFile);
-	xs_fread(psidH.sidAuthor, sizeof(gchar), sizeof(psidH.sidAuthor), inFile);
-	xs_fread(psidH.sidCopyright, sizeof(gchar), sizeof(psidH.sidCopyright), inFile);
-	
-	if (xs_feof(inFile) || xs_ferror(inFile)) {
-		xs_fclose(inFile);
-		xs_error("Error reading SID file header from '%s'\n", pcFilename);
-		return -4;
-	}
-	
-	/* Check if we need to load PSIDv2NG header ... */
-	psidH2.flags = 0;	/* Just silence a stupid gcc warning */
-	
-	if (psidH.version == 2) {
-		/* Yes, we need to */
-		psidH2.flags = xs_fread_be16(inFile);
-		psidH2.startPage = xs_fgetc(inFile);
-		psidH2.pageLength = xs_fgetc(inFile);
-		psidH2.reserved = xs_fread_be16(inFile);
-	}
+    xs_fread(psidH.sidName, sizeof(gchar), sizeof(psidH.sidName), inFile);
+    xs_fread(psidH.sidAuthor, sizeof(gchar), sizeof(psidH.sidAuthor), inFile);
+    xs_fread(psidH.sidCopyright, sizeof(gchar), sizeof(psidH.sidCopyright), inFile);
+    
+    if (xs_feof(inFile) || xs_ferror(inFile)) {
+        xs_fclose(inFile);
+        xs_error("Error reading SID file header from '%s'\n", filename);
+        return -4;
+    }
+    
+    /* Check if we need to load PSIDv2NG header ... */
+    psidH2.flags = 0;    /* Just silence a stupid gcc warning */
+    
+    if (psidH.version == 2) {
+        /* Yes, we need to */
+        psidH2.flags = xs_fread_be16(inFile);
+        psidH2.startPage = xs_fgetc(inFile);
+        psidH2.pageLength = xs_fgetc(inFile);
+        psidH2.reserved = xs_fread_be16(inFile);
+    }
+
+    /* Allocate buffer */
+    songData = (guint8 *) g_malloc(XS_SIDBUF_SIZE * sizeof(guint8));
+    if (!songData) {
+        xs_fclose(inFile);
+        xs_error("Error allocating temp data buffer for file '%s'\n", filename);
+        return -3;
+    }
 
-	/* Allocate buffer */
-	songData = (guint8 *) g_malloc(XS_SIDBUF_SIZE * sizeof(guint8));
-	if (!songData) {
-		xs_fclose(inFile);
-		xs_error("Error allocating temp data buffer for file '%s'\n", pcFilename);
-		return -3;
-	}
+    /* Read data to buffer */
+    result = xs_fread(songData, sizeof(guint8), XS_SIDBUF_SIZE, inFile);
+    xs_fclose(inFile);
 
-	/* Read data to buffer */
-	iRes = xs_fread(songData, sizeof(guint8), XS_SIDBUF_SIZE, inFile);
-	xs_fclose(inFile);
-
-	/* Initialize and start MD5-hash calculation */
-	xs_md5_init(&inState);
+    /* Initialize and start MD5-hash calculation */
+    xs_md5_init(&inState);
 
-	if (psidH.loadAddress == 0) {
-		/* Strip load address (2 first bytes) */
-		xs_md5_append(&inState, &songData[2], iRes - 2);
-	} else {
-		/* Append "as is" */
-		xs_md5_append(&inState, songData, iRes);
-	}
+    if (psidH.loadAddress == 0) {
+        /* Strip load address (2 first bytes) */
+        xs_md5_append(&inState, &songData[2], result - 2);
+    } else {
+        /* Append "as is" */
+        xs_md5_append(&inState, songData, result);
+    }
+
+    /* Free buffer */
+    g_free(songData);
 
-	/* Free buffer */
-	g_free(songData);
+    /* Append header data to hash */
+#define XSADDHASH(QDATAB) do {                    \
+    ib8[0] = (QDATAB & 0xff);                \
+    ib8[1] = (QDATAB >> 8);                    \
+    xs_md5_append(&inState, (guint8 *) &ib8, sizeof(ib8));    \
+    } while (0)
 
-	/* Append header data to hash */
-#define XSADDHASH(QDATAB) { ib8[0] = (QDATAB & 0xff); ib8[1] = (QDATAB >> 8); xs_md5_append(&inState, (guint8 *) &ib8, sizeof(ib8)); }
-
-	XSADDHASH(psidH.initAddress)
-	XSADDHASH(psidH.playAddress)
-	XSADDHASH(psidH.nSongs)
+    XSADDHASH(psidH.initAddress);
+    XSADDHASH(psidH.playAddress);
+    XSADDHASH(psidH.nSongs);
 #undef XSADDHASH
 
-	/* Append song speed data to hash */
-	i8 = 0;
-	for (iIndex = 0; (iIndex < psidH.nSongs) && (iIndex < 32); iIndex++) {
-		i8 = (psidH.speed & (1 << iIndex)) ? 60 : 0;
-		xs_md5_append(&inState, &i8, sizeof(i8));
-	}
+    /* Append song speed data to hash */
+    i8 = 0;
+    for (index = 0; (index < psidH.nSongs) && (index < 32); index++) {
+        i8 = (psidH.speed & (1 << index)) ? 60 : 0;
+        xs_md5_append(&inState, &i8, sizeof(i8));
+    }
 
-	/* Rest of songs (more than 32) */
-	for (iIndex = 32; iIndex < psidH.nSongs; iIndex++) {
-		xs_md5_append(&inState, &i8, sizeof(i8));
-	}
+    /* Rest of songs (more than 32) */
+    for (index = 32; index < psidH.nSongs; index++) {
+        xs_md5_append(&inState, &i8, sizeof(i8));
+    }
 
-	/* PSIDv2NG specific */
-	if (psidH.version == 2) {
-		/* SEE SIDPLAY HEADERS FOR INFO */
-		i8 = (psidH2.flags >> 2) & 3;
-		if (i8 == 2)
-			xs_md5_append(&inState, &i8, sizeof(i8));
-	}
+    /* PSIDv2NG specific */
+    if (psidH.version == 2) {
+        /* SEE SIDPLAY HEADERS FOR INFO */
+        i8 = (psidH2.flags >> 2) & 3;
+        if (i8 == 2)
+            xs_md5_append(&inState, &i8, sizeof(i8));
+    }
 
-	/* Calculate the hash */
-	xs_md5_finish(&inState, hash);
+    /* Calculate the hash */
+    xs_md5_finish(&inState, hash);
 
-	return 0;
+    return 0;
 }
 
 
 /* Get node from db index via binary search
  */
-t_xs_sldb_node *xs_sldb_get(t_xs_sldb *db, const gchar *pcFilename)
+sldb_node_t *xs_sldb_get(xs_sldb_t *db, const gchar *filename)
 {
-	t_xs_sldb_node keyItem, *key, **item;
+    sldb_node_t keyItem, *key, **item;
 
-	/* Check the database pointers */
-	if (!db || !db->pNodes || !db->ppIndex)
-		return NULL;
+    /* Check the database pointers */
+    if (!db || !db->nodes || !db->pindex)
+        return NULL;
 
-	/* Get the hash and then look up from db */
-	if (xs_get_sid_hash(pcFilename, keyItem.md5Hash) == 0) {
-		key = &keyItem;
-		item = bsearch(&key, db->ppIndex, db->n,
-			sizeof(db->ppIndex[0]), xs_sldb_cmp);
-		
-		if (item)
-			return *item;
-		else
-			return NULL;
-	} else
-		return NULL;
+    /* Get the hash and then look up from db */
+    if (xs_get_sid_hash(filename, keyItem.md5Hash) == 0) {
+        key = &keyItem;
+        item = bsearch(&key, db->pindex, db->n,
+            sizeof(db->pindex[0]), xs_sldb_cmp);
+        
+        if (item)
+            return *item;
+        else
+            return NULL;
+    } else
+        return NULL;
 }
 
 
--- a/src/sid/xs_length.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_length.h	Tue Apr 08 15:11:35 2008 -0500
@@ -10,27 +10,27 @@
 
 /* Types
  */
-typedef struct _t_xs_sldb_node {
-	t_xs_md5hash	md5Hash;	/* 128-bit MD5 hash-digest */
-	gint		nLengths;	/* Number of lengths */
-	gint		*sLengths;	/* Lengths in seconds */
-	struct _t_xs_sldb_node *pPrev, *pNext;
-} t_xs_sldb_node;
+typedef struct _sldb_node_t {
+    xs_md5hash_t    md5Hash;    /* 128-bit MD5 hash-digest */
+    gint        nlengths;    /* Number of lengths */
+    gint        *lengths;    /* Lengths in seconds */
+    struct _sldb_node_t *prev, *next;
+} sldb_node_t;
 
 
 typedef struct {
-	t_xs_sldb_node	*pNodes,
-			**ppIndex;
-	size_t		n;
-} t_xs_sldb;
+    sldb_node_t    *nodes,
+            **pindex;
+    size_t        n;
+} xs_sldb_t;
 
 
 /* Functions
  */
-gint			xs_sldb_read(t_xs_sldb *, const gchar *);
-gint			xs_sldb_index(t_xs_sldb *);
-void			xs_sldb_free(t_xs_sldb *);
-t_xs_sldb_node *	xs_sldb_get(t_xs_sldb *, const gchar *);
+gint        xs_sldb_read(xs_sldb_t *, const gchar *);
+gint        xs_sldb_index(xs_sldb_t *);
+void        xs_sldb_free(xs_sldb_t *);
+sldb_node_t *    xs_sldb_get(xs_sldb_t *, const gchar *);
 
 #ifdef __cplusplus
 }
--- a/src/sid/xs_md5.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_md5.c	Tue Apr 08 15:11:35 2008 -0500
@@ -13,17 +13,17 @@
 
 
 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define xs_md5_bytereverse(buf, len)	/* Nothing */
+#define xs_md5_bytereverse(buf, len)    /* Nothing */
 #else
 #if G_BYTE_ORDER == G_BIG_ENDIAN
-void xs_md5_bytereverse(guint8 *buf, guint l)
+static void xs_md5_bytereverse(guint8 *buf, guint l)
 {
-	guint32 t;
-	do {
-		t = (guint32) ((guint) buf[3] << 8 | buf[2]) << 16 | ((guint) buf[1] << 8 | buf[0]);
-		*(guint32 *) buf = t;
-		buf += sizeof(guint32);
-	} while (--l);
+    guint32 t;
+    do {
+        t = (guint32) ((guint) buf[3] << 8 | buf[2]) << 16 | ((guint) buf[1] << 8 | buf[0]);
+        *(guint32 *) buf = t;
+        buf += sizeof(guint32);
+    } while (--l);
 }
 #else
 #error Unsupported endianess!
@@ -34,15 +34,15 @@
 /* Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
  * initialization constants.
  */
-void xs_md5_init(t_xs_md5state *ctx)
+void xs_md5_init(xs_md5state_t *ctx)
 {
-	ctx->buf[0] = 0x67452301;
-	ctx->buf[1] = 0xefcdab89;
-	ctx->buf[2] = 0x98badcfe;
-	ctx->buf[3] = 0x10325476;
+    ctx->buf[0] = 0x67452301;
+    ctx->buf[1] = 0xefcdab89;
+    ctx->buf[2] = 0x98badcfe;
+    ctx->buf[3] = 0x10325476;
 
-	ctx->bits[0] = 0;
-	ctx->bits[1] = 0;
+    ctx->bits[0] = 0;
+    ctx->bits[1] = 0;
 }
 
 
@@ -55,178 +55,176 @@
 #define F3(x, y, z) (x ^ y ^ z)
 #define F4(x, y, z) (y ^ (x | ~z))
 #define MD5STEP(f, w, x, y, z, data, s) \
-	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+    ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
 
-void xs_md5_transform(guint32 buf[4], guint32 const in[16])
+static void xs_md5_transform(guint32 buf[4], guint32 const in[16])
 {
-	register guint32 a, b, c, d;
+    register guint32 a, b, c, d;
 
-	a = buf[0];
-	b = buf[1];
-	c = buf[2];
-	d = buf[3];
+    a = buf[0];
+    b = buf[1];
+    c = buf[2];
+    d = buf[3];
 
-	MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
-	MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
-	MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
-	MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
-	MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
-	MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
-	MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
-	MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
-	MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
-	MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
-	MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
-	MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
-	MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
-	MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
-	MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
-	MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+    MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+    MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+    MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
+    MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+    MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+    MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+    MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
+    MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
+    MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
+    MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+    MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+    MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+    MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
+    MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
+    MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
+    MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
 
-	MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
-	MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
-	MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
-	MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
-	MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
-	MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
-	MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
-	MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
-	MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
-	MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
-	MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
-	MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
-	MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
-	MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
-	MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
-	MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+    MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+    MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
+    MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+    MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+    MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+    MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
+    MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+    MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+    MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+    MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+    MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+    MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+    MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+    MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+    MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+    MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
 
-	MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
-	MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
-	MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
-	MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
-	MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
-	MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
-	MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
-	MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
-	MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
-	MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
-	MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
-	MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
-	MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
-	MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
-	MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
-	MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+    MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+    MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
+    MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+    MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+    MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+    MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+    MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+    MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+    MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+    MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+    MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+    MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
+    MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+    MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+    MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+    MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
 
-	MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
-	MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
-	MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
-	MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
-	MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
-	MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
-	MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
-	MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
-	MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
-	MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
-	MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
-	MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
-	MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
-	MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
-	MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
-	MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+    MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
+    MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
+    MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+    MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+    MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+    MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+    MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+    MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+    MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+    MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+    MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
+    MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+    MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+    MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+    MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+    MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
 
-	buf[0] += a;
-	buf[1] += b;
-	buf[2] += c;
-	buf[3] += d;
+    buf[0] += a;
+    buf[1] += b;
+    buf[2] += c;
+    buf[3] += d;
 }
 
 
 /* Update context to reflect the concatenation of another buffer full
  * of bytes.
  */
-void xs_md5_append(t_xs_md5state *ctx, const guint8 *buf, guint len)
+void xs_md5_append(xs_md5state_t *ctx, const guint8 *buf, guint len)
 {
-	guint32 t;
+    guint32 t;
 
-	/* Update bitcount */
-	t = ctx->bits[0];
-	if ((ctx->bits[0] = t + ((guint32) len << 3)) < t)
-		ctx->bits[1]++;	/* Carry from low to high */
-	ctx->bits[1] += len >> 29;
+    /* Update bitcount */
+    t = ctx->bits[0];
+    if ((ctx->bits[0] = t + ((guint32) len << 3)) < t)
+        ctx->bits[1]++;    /* Carry from low to high */
+    ctx->bits[1] += len >> 29;
 
-	t = (t >> 3) & 0x3f;	/* Bytes already in shsInfo->data */
+    t = (t >> 3) & 0x3f;    /* Bytes already in shsInfo->data */
 
-	/* Handle any leading odd-sized chunks */
-
-	if (t) {
-		guint8 *p = (guint8 *) ctx->in + t;
+    /* Handle any leading odd-sized chunks */
+    if (t) {
+        guint8 *p = (guint8 *) ctx->in + t;
 
-		t = 64 - t;
-		if (len < t) {
-			memcpy(p, buf, len);
-			return;
-		}
-		memcpy(p, buf, t);
-		xs_md5_bytereverse(ctx->in, 16);
-		xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
-		buf += t;
-		len -= t;
-	}
-	/* Process data in 64-byte chunks */
+        t = 64 - t;
+        if (len < t) {
+            memcpy(p, buf, len);
+            return;
+        }
+        memcpy(p, buf, t);
+        xs_md5_bytereverse(ctx->in, 16);
+        xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
+        buf += t;
+        len -= t;
+    }
 
-	while (len >= 64) {
-		memcpy(ctx->in, buf, 64);
-		xs_md5_bytereverse(ctx->in, 16);
-		xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
-		buf += 64;
-		len -= 64;
-	}
+    /* Process data in 64-byte chunks */
+    while (len >= 64) {
+        memcpy(ctx->in, buf, 64);
+        xs_md5_bytereverse(ctx->in, 16);
+        xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
+        buf += 64;
+        len -= 64;
+    }
 
-	/* Handle any remaining bytes of data. */
-
-	memcpy(ctx->in, buf, len);
+    /* Handle any remaining bytes of data. */
+    memcpy(ctx->in, buf, len);
 }
 
 /* Final wrapup - pad to 64-byte boundary with the bit pattern 
  * 1 0* (64-bit count of bits processed, MSB-first)
  */
-void xs_md5_finish(t_xs_md5state *ctx, t_xs_md5hash digest)
+void xs_md5_finish(xs_md5state_t *ctx, xs_md5hash_t digest)
 {
-	guint count;
-	guint8 *p;
+    guint count;
+    guint8 *p;
 
-	/* Compute number of bytes mod 64 */
-	count = (ctx->bits[0] >> 3) & 0x3F;
+    /* Compute number of bytes mod 64 */
+    count = (ctx->bits[0] >> 3) & 0x3F;
 
-	/* Set the first char of padding to 0x80.  This is safe since there is
-	   always at least one byte free */
-	p = ctx->in + count;
-	*p++ = 0x80;
+    /* Set the first char of padding to 0x80.  This is safe since there is
+       always at least one byte free */
+    p = ctx->in + count;
+    *p++ = 0x80;
 
-	/* Bytes of padding needed to make 64 bytes */
-	count = 64 - 1 - count;
+    /* Bytes of padding needed to make 64 bytes */
+    count = 64 - 1 - count;
 
-	/* Pad out to 56 mod 64 */
-	if (count < 8) {
-		/* Two lots of padding:  Pad the first block to 64 bytes */
-		memset(p, 0, count);
-		xs_md5_bytereverse(ctx->in, 16);
-		xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
+    /* Pad out to 56 mod 64 */
+    if (count < 8) {
+        /* Two lots of padding:  Pad the first block to 64 bytes */
+        memset(p, 0, count);
+        xs_md5_bytereverse(ctx->in, 16);
+        xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
 
-		/* Now fill the next block with 56 bytes */
-		memset(ctx->in, 0, 56);
-	} else {
-		/* Pad block to 56 bytes */
-		memset(p, 0, count - 8);
-	}
-	xs_md5_bytereverse(ctx->in, 14);
+        /* Now fill the next block with 56 bytes */
+        memset(ctx->in, 0, 56);
+    } else {
+        /* Pad block to 56 bytes */
+        memset(p, 0, count - 8);
+    }
+    xs_md5_bytereverse(ctx->in, 14);
 
-	/* Append length in bits and transform */
-	((guint32 *) ctx->in)[14] = ctx->bits[0];
-	((guint32 *) ctx->in)[15] = ctx->bits[1];
+    /* Append length in bits and transform */
+    ((guint32 *) ctx->in)[14] = ctx->bits[0];
+    ((guint32 *) ctx->in)[15] = ctx->bits[1];
 
-	xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
-	xs_md5_bytereverse((guint8 *) ctx->buf, 4);
-	memcpy(digest, ctx->buf, 16);
-	memset(ctx, 0, sizeof(ctx));	/* In case it's sensitive */
+    xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
+    xs_md5_bytereverse((guint8 *) ctx->buf, 4);
+    memcpy(digest, ctx->buf, 16);
+    memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
 }
--- a/src/sid/xs_md5.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_md5.h	Tue Apr 08 15:11:35 2008 -0500
@@ -10,22 +10,22 @@
 /* Typedefs
  */
 typedef struct md5_state_s {
-	guint32 bits[2];	/* message length in bits, lsw first */
-	guint32 buf[4];		/* digest buffer */
-	guint8 in[64];		/* accumulate block */
-} t_xs_md5state;
+    guint32 bits[2];    /* message length in bits, lsw first */
+    guint32 buf[4];        /* digest buffer */
+    guint8 in[64];        /* accumulate block */
+} xs_md5state_t;
 
-#define XS_MD5HASH_LENGTH	(16)
-#define XS_MD5HASH_LENGTH_CH	(XS_MD5HASH_LENGTH * 2)
+#define XS_MD5HASH_LENGTH    (16)
+#define XS_MD5HASH_LENGTH_CH    (XS_MD5HASH_LENGTH * 2)
 
-typedef guint8 t_xs_md5hash[XS_MD5HASH_LENGTH];
+typedef guint8 xs_md5hash_t[XS_MD5HASH_LENGTH];
 
 
 /* Functions
  */
-void xs_md5_init(t_xs_md5state *ctx);
-void xs_md5_append(t_xs_md5state *ctx, const guint8 *buf, guint len);
-void xs_md5_finish(t_xs_md5state *ctx, t_xs_md5hash digest);
+void xs_md5_init(xs_md5state_t *ctx);
+void xs_md5_append(xs_md5state_t *ctx, const guint8 *buf, guint len);
+void xs_md5_finish(xs_md5state_t *ctx, xs_md5hash_t digest);
 
 
 #ifdef __cplusplus
--- a/src/sid/xs_player.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_player.h	Tue Apr 08 15:11:35 2008 -0500
@@ -8,48 +8,48 @@
 extern "C" {
 #endif
 
-struct t_xs_status;
+struct xs_status_t;
 
 typedef struct {
-	gint		plrIdent;
-	gboolean	(*plrProbe)(t_xs_file *);
-	gboolean	(*plrInit)(struct t_xs_status *);
-	void		(*plrClose)(struct t_xs_status *);
-	gboolean	(*plrInitSong)(struct t_xs_status *);
-	guint		(*plrFillBuffer)(struct t_xs_status *, gchar *, guint);
-	gboolean	(*plrLoadSID)(struct t_xs_status *, gchar *);
-	void		(*plrDeleteSID)(struct t_xs_status *);
-	t_xs_tuneinfo*	(*plrGetSIDInfo)(const gchar *);
-	gboolean	(*plrUpdateSIDInfo)(struct t_xs_status *);
-	void		(*plrFlush)(struct t_xs_status *);
-} t_xs_player;
+    gint        plrIdent;
+    gboolean    (*plrProbe)(xs_file_t *);
+    gboolean    (*plrInit)(struct xs_status_t *);
+    void        (*plrClose)(struct xs_status_t *);
+    gboolean    (*plrInitSong)(struct xs_status_t *);
+    guint        (*plrFillBuffer)(struct xs_status_t *, gchar *, guint);
+    gboolean    (*plrLoadSID)(struct xs_status_t *, gchar *);
+    void        (*plrDeleteSID)(struct xs_status_t *);
+    xs_tuneinfo_t*    (*plrGetSIDInfo)(const gchar *);
+    gboolean    (*plrUpdateSIDInfo)(struct xs_status_t *);
+    void        (*plrFlush)(struct xs_status_t *);
+} xs_player_t;
 
 
-typedef struct t_xs_status {
-	gint		audioFrequency,		/* Audio settings */
-			audioChannels,
-			audioBitsPerSample,
-			oversampleFactor;	/* Factor of oversampling */
-	AFormat		audioFormat;
-	gboolean	oversampleEnable;	/* TRUE after sidEngine initialization,
-						if xs_cfg.oversampleEnable == TRUE and
-						emulation backend supports oversampling.
-						*/
-	void		*sidEngine;		/* SID-emulation internal engine data */
-	t_xs_player	*sidPlayer;		/* Selected player engine */
-	gboolean	isError, isPlaying, isInitialized;
-	gint		currSong,		/* Current sub-tune */
-			lastTime;
+typedef struct xs_status_t {
+    gint        audioFrequency,        /* Audio settings */
+            audioChannels,
+            audioBitsPerSample,
+            oversampleFactor;    /* Factor of oversampling */
+    AFormat        audioFormat;
+    gboolean    oversampleEnable;    /* TRUE after sidEngine initialization,
+                        if xs_cfg.oversampleEnable == TRUE and
+                        emulation backend supports oversampling.
+                        */
+    void        *sidEngine;        /* SID-emulation internal engine data */
+    xs_player_t    *sidPlayer;        /* Selected player engine */
+    gboolean    isError, isPlaying, isInitialized;
+    gint        currSong,        /* Current sub-tune */
+            lastTime;
 
-	t_xs_tuneinfo	*tuneInfo;
-} t_xs_status;
+    xs_tuneinfo_t    *tuneInfo;
+} xs_status_t;
 
 
 /* Global variables
  */
-extern InputPlugin	xs_plugin_ip;
+extern InputPlugin    xs_plugin_ip;
 
-extern t_xs_status	xs_status;
+extern xs_status_t    xs_status;
 XS_MUTEX_H(xs_status);
 
 
--- a/src/sid/xs_sidplay.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_sidplay.h	Tue Apr 08 15:11:35 2008 -0500
@@ -26,126 +26,126 @@
  * (those variables that are only set by libSIDPlay when tune is initialized).
  * Rest of the information is acquired in TFUNCTION2()
  */
-t_xs_tuneinfo *TFUNCTION(const gchar *sidFilename)
+xs_tuneinfo_t *TFUNCTION(const gchar *sidFilename)
 {
-	t_xs_tuneinfo *pResult;
-	TTUNEINFO myInfo;
-	TTUNE *myTune;
-	guint8 *buf = NULL;
-	size_t bufSize = 0;
+    xs_tuneinfo_t *pResult;
+    TTUNEINFO myInfo;
+    TTUNE *myTune;
+    guint8 *buf = NULL;
+    size_t bufSize = 0;
 
-	/* Load file */
-	if (!sidFilename) return NULL;
+    /* Load file */
+    if (!sidFilename) return NULL;
 
-	if (xs_fload_buffer(sidFilename, &buf, &bufSize) != 0)
-		return NULL;
-	
-	/* Check if the tune exists and is readable */
-	if ((myTune = new TTUNE(buf, bufSize)) == NULL) {
-		g_free(buf);
-		return NULL;
-	}
-	g_free(buf);
+    if (xs_fload_buffer(sidFilename, &buf, &bufSize) != 0)
+        return NULL;
+    
+    /* Check if the tune exists and is readable */
+    if ((myTune = new TTUNE(buf, bufSize)) == NULL) {
+        g_free(buf);
+        return NULL;
+    }
+    g_free(buf);
 
-	if (!myTune->getStatus()) {
-		delete myTune;
-		return NULL;
-	}
+    if (!myTune->getStatus()) {
+        delete myTune;
+        return NULL;
+    }
 
-	/* Get general tune information */
+    /* Get general tune information */
 #ifdef XS_SIDPLAY1_H
-	myTune->getInfo(myInfo);
+    myTune->getInfo(myInfo);
 #endif
 #ifdef XS_SIDPLAY2_H
-	myInfo = myTune->getInfo();
+    myInfo = myTune->getInfo();
 #endif
 
-	/* Allocate tuneinfo structure and set information */
-	pResult = xs_tuneinfo_new(sidFilename,
-		myInfo.songs, myInfo.startSong,
-		myInfo.infoString[0], myInfo.infoString[1], myInfo.infoString[2],
-		myInfo.loadAddr, myInfo.initAddr, myInfo.playAddr,
-		myInfo.dataFileLen, myInfo.formatString, myInfo.sidModel);
-	
-	/* NOTICE! libSIDPlay[12] headers specifically state that sidModel,
-	 * songSpeed and clockSpeed are "undefined" before song initialization,
-	 * but in practice sidModel is known after getInfo() invocation...
-	 * This of course does not take the sub-tune specific changes into account,
-	 * but at least we have a reasonable guesstimate.
-	 */
+    /* Allocate tuneinfo structure and set information */
+    pResult = xs_tuneinfo_new(sidFilename,
+        myInfo.songs, myInfo.startSong,
+        myInfo.infoString[0], myInfo.infoString[1], myInfo.infoString[2],
+        myInfo.loadAddr, myInfo.initAddr, myInfo.playAddr,
+        myInfo.dataFileLen, myInfo.formatString, myInfo.sidModel);
+    
+    /* NOTICE! libSIDPlay[12] headers specifically state that sidModel,
+     * songSpeed and clockSpeed are "undefined" before song initialization,
+     * but in practice sidModel is known after getInfo() invocation...
+     * This of course does not take the sub-tune specific changes into account,
+     * but at least we have a reasonable guesstimate.
+     */
 
-	delete myTune;
+    delete myTune;
 
-	return pResult;
+    return pResult;
 }
 
 
 /* Updates the information of currently playing tune
  */
-gboolean TFUNCTION2(t_xs_status *myStatus)
+gboolean TFUNCTION2(xs_status_t *myStatus)
 {
-	TTUNEINFO myInfo;
-	TTUNE *myTune;
-	TENGINE *myEngine;
-	t_xs_tuneinfo *i;
-	
-	/* Check if we have required structures initialized */
-	if (!myStatus || !myStatus->tuneInfo || !myStatus->sidEngine)
-		return FALSE;
+    TTUNEINFO myInfo;
+    TTUNE *myTune;
+    TENGINE *myEngine;
+    xs_tuneinfo_t *i;
+    
+    /* Check if we have required structures initialized */
+    if (!myStatus || !myStatus->tuneInfo || !myStatus->sidEngine)
+        return FALSE;
 
-	myEngine = (TENGINE *) myStatus->sidEngine;
-	myTune = myEngine->currTune;
-	if (!myTune)
-		return FALSE;
+    myEngine = (TENGINE *) myStatus->sidEngine;
+    myTune = myEngine->currTune;
+    if (!myTune)
+        return FALSE;
 
-	/* Get currently playing tune information */
+    /* Get currently playing tune information */
 #ifdef XS_SIDPLAY1_H
-	myTune->getInfo(myInfo);
+    myTune->getInfo(myInfo);
 #endif
 #ifdef XS_SIDPLAY2_H
-	myInfo = myTune->getInfo();
+    myInfo = myTune->getInfo();
 #endif
 
-	/* NOTICE! Here we assume that libSIDPlay[12] headers define
-	 * SIDTUNE_SIDMODEL_* similarly to our enums in xs_config.h ...
-	 */
-	i = myStatus->tuneInfo;
-	i->sidModel = myInfo.sidModel;
+    /* NOTICE! Here we assume that libSIDPlay[12] headers define
+     * SIDTUNE_SIDMODEL_* similarly to our enums in xs_config.h ...
+     */
+    i = myStatus->tuneInfo;
+    i->sidModel = myInfo.sidModel;
 
-	if ((myStatus->currSong > 0) && (myStatus->currSong <= i->nsubTunes)) {
-		gint tmpSpeed = -1;
-		
-		switch (myInfo.clockSpeed) {
-		case SIDTUNE_CLOCK_PAL:
-			tmpSpeed = XS_CLOCK_PAL;
-			break;
-		case SIDTUNE_CLOCK_NTSC:
-			tmpSpeed = XS_CLOCK_NTSC;
-			break;
-		case SIDTUNE_CLOCK_ANY:
-			tmpSpeed = XS_CLOCK_ANY;
-			break;
-		case SIDTUNE_CLOCK_UNKNOWN:
-			switch (myInfo.songSpeed) {
-			case SIDTUNE_SPEED_VBI:
-				tmpSpeed = XS_CLOCK_VBI;
-				break;
-			case SIDTUNE_SPEED_CIA_1A:
-				tmpSpeed = XS_CLOCK_CIA;
-				break;
-			default:
-				tmpSpeed = myInfo.songSpeed;
-				break;
-			}
-		default:
-			tmpSpeed = myInfo.clockSpeed;
-			break;
-		}
-			
-		i->subTunes[myStatus->currSong - 1].tuneSpeed = tmpSpeed;
-	}
+    if ((myStatus->currSong > 0) && (myStatus->currSong <= i->nsubTunes)) {
+        gint tmpSpeed = -1;
+        
+        switch (myInfo.clockSpeed) {
+        case SIDTUNE_CLOCK_PAL:
+            tmpSpeed = XS_CLOCK_PAL;
+            break;
+        case SIDTUNE_CLOCK_NTSC:
+            tmpSpeed = XS_CLOCK_NTSC;
+            break;
+        case SIDTUNE_CLOCK_ANY:
+            tmpSpeed = XS_CLOCK_ANY;
+            break;
+        case SIDTUNE_CLOCK_UNKNOWN:
+            switch (myInfo.songSpeed) {
+            case SIDTUNE_SPEED_VBI:
+                tmpSpeed = XS_CLOCK_VBI;
+                break;
+            case SIDTUNE_SPEED_CIA_1A:
+                tmpSpeed = XS_CLOCK_CIA;
+                break;
+            default:
+                tmpSpeed = myInfo.songSpeed;
+                break;
+            }
+        default:
+            tmpSpeed = myInfo.clockSpeed;
+            break;
+        }
+            
+        i->subTunes[myStatus->currSong - 1].tuneSpeed = tmpSpeed;
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 /* Undefine these */
--- a/src/sid/xs_sidplay1.cc	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_sidplay1.cc	Tue Apr 08 15:11:35 2008 -0500
@@ -34,16 +34,16 @@
 
 
 /* Maximum audio frequency supported by libSIDPlay v1 */
-#define SIDPLAY1_MAX_FREQ	(48000)
+#define SIDPLAY1_MAX_FREQ    (48000)
 
 
 typedef struct {
-	emuEngine *currEng;
-	emuConfig currConfig;
-	sidTune *currTune;
-	guint8 *buf;
-	size_t bufSize;
-} t_xs_sidplay1;
+    emuEngine *currEng;
+    emuConfig currConfig;
+    sidTune *currTune;
+    guint8 *buf;
+    size_t bufSize;
+} xs_sidplay1_t;
 
 
 /* We need to 'export' all this pseudo-C++ crap */
@@ -52,312 +52,312 @@
 
 /* Return song information
  */
-#define	TFUNCTION	xs_sidplay1_getinfo
-#define	TFUNCTION2	xs_sidplay1_updateinfo
-#define	TTUNEINFO	sidTuneInfo
-#define	TTUNE		sidTune
-#define TENGINE		t_xs_sidplay1
+#define    TFUNCTION    xs_sidplay1_getinfo
+#define    TFUNCTION2    xs_sidplay1_updateinfo
+#define    TTUNEINFO    sidTuneInfo
+#define    TTUNE        sidTune
+#define TENGINE        xs_sidplay1_t
 #include "xs_sidplay.h"
 
 
 /* Check if we can play the given file
  */
-gboolean xs_sidplay1_probe(t_xs_file *f)
+gboolean xs_sidplay1_probe(xs_file_t *f)
 {
-	gchar tmpBuf[4];
-	
-	if (!f) return FALSE;
-	
-	if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4)
-		return FALSE;
-	
-	if (!strncmp(tmpBuf, "PSID", 4))
-		return TRUE;
-	else
-		return FALSE;
+    gchar tmpBuf[4];
+    
+    if (!f) return FALSE;
+    
+    if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4)
+        return FALSE;
+    
+    if (!strncmp(tmpBuf, "PSID", 4))
+        return TRUE;
+    else
+        return FALSE;
 }
 
 
 /* Initialize SIDPlay1
  */
-gboolean xs_sidplay1_init(t_xs_status * myStatus)
+gboolean xs_sidplay1_init(xs_status_t * myStatus)
 {
-	gint tmpFreq;
-	t_xs_sidplay1 *myEngine;
-	assert(myStatus);
+    gint tmpFreq;
+    xs_sidplay1_t *myEngine;
+    assert(myStatus);
 
-	/* Allocate internal structures */
-	myEngine = (t_xs_sidplay1 *) g_malloc0(sizeof(t_xs_sidplay1));
-	if (!myEngine) return FALSE;
+    /* Allocate internal structures */
+    myEngine = (xs_sidplay1_t *) g_malloc0(sizeof(xs_sidplay1_t));
+    if (!myEngine) return FALSE;
 
-	/* Initialize engine */
-	myEngine->currEng = new emuEngine();
-	if (!myEngine->currEng) {
-		xs_error("[SIDPlay1] Could not initialize emulation engine.\n");
-		g_free(myEngine);
-		return FALSE;
-	}
+    /* Initialize engine */
+    myEngine->currEng = new emuEngine();
+    if (!myEngine->currEng) {
+        xs_error("[SIDPlay1] Could not initialize emulation engine.\n");
+        g_free(myEngine);
+        return FALSE;
+    }
 
-	/* Verify endianess */
-	if (!myEngine->currEng->verifyEndianess()) {
-		xs_error("[SIDPlay1] Endianess verification failed.\n");
-		delete myEngine->currEng;
-		g_free(myEngine);
-		return FALSE;
-	}
+    /* Verify endianess */
+    if (!myEngine->currEng->verifyEndianess()) {
+        xs_error("[SIDPlay1] Endianess verification failed.\n");
+        delete myEngine->currEng;
+        g_free(myEngine);
+        return FALSE;
+    }
 
-	myStatus->sidEngine = myEngine;
+    myStatus->sidEngine = myEngine;
 
-	/* Get current configuration */
-	myEngine->currEng->getConfig(myEngine->currConfig);
+    /* Get current configuration */
+    myEngine->currEng->getConfig(myEngine->currConfig);
 
-	/* Configure channel parameters */
-	switch (myStatus->audioChannels) {
+    /* Configure channel parameters */
+    switch (myStatus->audioChannels) {
 
-	case XS_CHN_AUTOPAN:
-		myEngine->currConfig.channels = SIDEMU_STEREO;
-		myEngine->currConfig.autoPanning = SIDEMU_CENTEREDAUTOPANNING;
-		myEngine->currConfig.volumeControl = SIDEMU_FULLPANNING;
-		break;
+    case XS_CHN_AUTOPAN:
+        myEngine->currConfig.channels = SIDEMU_STEREO;
+        myEngine->currConfig.autoPanning = SIDEMU_CENTEREDAUTOPANNING;
+        myEngine->currConfig.volumeControl = SIDEMU_FULLPANNING;
+        break;
 
-	case XS_CHN_STEREO:
-		myEngine->currConfig.channels = SIDEMU_STEREO;
-		myEngine->currConfig.autoPanning = SIDEMU_NONE;
-		myEngine->currConfig.volumeControl = SIDEMU_NONE;
-		break;
+    case XS_CHN_STEREO:
+        myEngine->currConfig.channels = SIDEMU_STEREO;
+        myEngine->currConfig.autoPanning = SIDEMU_NONE;
+        myEngine->currConfig.volumeControl = SIDEMU_NONE;
+        break;
 
-	case XS_CHN_MONO:
-	default:
-		myEngine->currConfig.channels = SIDEMU_MONO;
-		myEngine->currConfig.autoPanning = SIDEMU_NONE;
-		myEngine->currConfig.volumeControl = SIDEMU_NONE;
-		myStatus->audioChannels = XS_CHN_MONO;
-		break;
-	}
+    case XS_CHN_MONO:
+    default:
+        myEngine->currConfig.channels = SIDEMU_MONO;
+        myEngine->currConfig.autoPanning = SIDEMU_NONE;
+        myEngine->currConfig.volumeControl = SIDEMU_NONE;
+        myStatus->audioChannels = XS_CHN_MONO;
+        break;
+    }
 
 
-	/* Memory mode settings */
-	switch (xs_cfg.memoryMode) {
-	case XS_MPU_TRANSPARENT_ROM:
-		myEngine->currConfig.memoryMode = MPU_TRANSPARENT_ROM;
-		break;
+    /* Memory mode settings */
+    switch (xs_cfg.memoryMode) {
+    case XS_MPU_TRANSPARENT_ROM:
+        myEngine->currConfig.memoryMode = MPU_TRANSPARENT_ROM;
+        break;
 
-	case XS_MPU_PLAYSID_ENVIRONMENT:
-		myEngine->currConfig.memoryMode = MPU_PLAYSID_ENVIRONMENT;
-		break;
+    case XS_MPU_PLAYSID_ENVIRONMENT:
+        myEngine->currConfig.memoryMode = MPU_PLAYSID_ENVIRONMENT;
+        break;
 
-	case XS_MPU_BANK_SWITCHING:
-	default:
-		myEngine->currConfig.memoryMode = MPU_BANK_SWITCHING;
-		xs_cfg.memoryMode = XS_MPU_BANK_SWITCHING;
-		break;
-	}
+    case XS_MPU_BANK_SWITCHING:
+    default:
+        myEngine->currConfig.memoryMode = MPU_BANK_SWITCHING;
+        xs_cfg.memoryMode = XS_MPU_BANK_SWITCHING;
+        break;
+    }
 
 
-	/* Audio parameters sanity checking and setup */
-	myEngine->currConfig.bitsPerSample = myStatus->audioBitsPerSample;
-	tmpFreq = myStatus->audioFrequency;
+    /* Audio parameters sanity checking and setup */
+    myEngine->currConfig.bitsPerSample = myStatus->audioBitsPerSample;
+    tmpFreq = myStatus->audioFrequency;
 
-	if (myStatus->oversampleEnable) {
-		if ((tmpFreq * myStatus->oversampleFactor) > SIDPLAY1_MAX_FREQ) {
-			myStatus->oversampleEnable = FALSE;
-		} else {
-			tmpFreq = (tmpFreq * myStatus->oversampleFactor);
-		}
-	} else {
-		if (tmpFreq > SIDPLAY1_MAX_FREQ)
-			tmpFreq = SIDPLAY1_MAX_FREQ;
-	}
+    if (myStatus->oversampleEnable) {
+        if ((tmpFreq * myStatus->oversampleFactor) > SIDPLAY1_MAX_FREQ) {
+            myStatus->oversampleEnable = FALSE;
+        } else {
+            tmpFreq = (tmpFreq * myStatus->oversampleFactor);
+        }
+    } else {
+        if (tmpFreq > SIDPLAY1_MAX_FREQ)
+            tmpFreq = SIDPLAY1_MAX_FREQ;
+    }
 
-	myEngine->currConfig.frequency = tmpFreq;
+    myEngine->currConfig.frequency = tmpFreq;
 
-	switch (myStatus->audioBitsPerSample) {
-	case XS_RES_8BIT:
-		switch (myStatus->audioFormat) {
-		case FMT_S8:
-			myStatus->audioFormat = FMT_S8;
-			myEngine->currConfig.sampleFormat = SIDEMU_SIGNED_PCM;
-			break;
+    switch (myStatus->audioBitsPerSample) {
+    case XS_RES_8BIT:
+        switch (myStatus->audioFormat) {
+        case FMT_S8:
+            myStatus->audioFormat = FMT_S8;
+            myEngine->currConfig.sampleFormat = SIDEMU_SIGNED_PCM;
+            break;
 
-		case FMT_U8:
-		default:
-			myStatus->audioFormat = FMT_U8;
-			myEngine->currConfig.sampleFormat = SIDEMU_UNSIGNED_PCM;
-			break;
-		}
-		break;
+        case FMT_U8:
+        default:
+            myStatus->audioFormat = FMT_U8;
+            myEngine->currConfig.sampleFormat = SIDEMU_UNSIGNED_PCM;
+            break;
+        }
+        break;
 
-	case XS_RES_16BIT:
-	default:
-		switch (myStatus->audioFormat) {
-		case FMT_U16_NE:
-		case FMT_U16_LE:
-		case FMT_U16_BE:
-			myStatus->audioFormat = FMT_U16_NE;
-			myEngine->currConfig.sampleFormat = SIDEMU_UNSIGNED_PCM;
-			break;
+    case XS_RES_16BIT:
+    default:
+        switch (myStatus->audioFormat) {
+        case FMT_U16_NE:
+        case FMT_U16_LE:
+        case FMT_U16_BE:
+            myStatus->audioFormat = FMT_U16_NE;
+            myEngine->currConfig.sampleFormat = SIDEMU_UNSIGNED_PCM;
+            break;
 
-		case FMT_S16_NE:
-		case FMT_S16_LE:
-		case FMT_S16_BE:
-		default:
-			myStatus->audioFormat = FMT_S16_NE;
-			myEngine->currConfig.sampleFormat = SIDEMU_SIGNED_PCM;
-			break;
-		}
-		break;
-	}
+        case FMT_S16_NE:
+        case FMT_S16_LE:
+        case FMT_S16_BE:
+        default:
+            myStatus->audioFormat = FMT_S16_NE;
+            myEngine->currConfig.sampleFormat = SIDEMU_SIGNED_PCM;
+            break;
+        }
+        break;
+    }
 
-	/* Clockspeed settings */
-	switch (xs_cfg.clockSpeed) {
-	case XS_CLOCK_NTSC:
-		myEngine->currConfig.clockSpeed = SIDTUNE_CLOCK_NTSC;
-		break;
+    /* Clockspeed settings */
+    switch (xs_cfg.clockSpeed) {
+    case XS_CLOCK_NTSC:
+        myEngine->currConfig.clockSpeed = SIDTUNE_CLOCK_NTSC;
+        break;
 
-	case XS_CLOCK_PAL:
-	default:
-		myEngine->currConfig.clockSpeed = SIDTUNE_CLOCK_PAL;
-		xs_cfg.clockSpeed = XS_CLOCK_PAL;
-		break;
-	}
+    case XS_CLOCK_PAL:
+    default:
+        myEngine->currConfig.clockSpeed = SIDTUNE_CLOCK_PAL;
+        xs_cfg.clockSpeed = XS_CLOCK_PAL;
+        break;
+    }
 
-	myEngine->currConfig.forceSongSpeed = xs_cfg.forceSpeed;
-	
-	
-	/* Configure rest of the emulation */
-	/* if (xs_cfg.forceModel) */
-	myEngine->currConfig.mos8580 = xs_cfg.mos8580;
-	myEngine->currConfig.emulateFilter = xs_cfg.emulateFilters;
-	myEngine->currConfig.filterFs = xs_cfg.sid1FilterFs;
-	myEngine->currConfig.filterFm = xs_cfg.sid1FilterFm;
-	myEngine->currConfig.filterFt = xs_cfg.sid1FilterFt;
+    myEngine->currConfig.forceSongSpeed = xs_cfg.forceSpeed;
+    
+    
+    /* Configure rest of the emulation */
+    /* if (xs_cfg.forceModel) */
+    myEngine->currConfig.mos8580 = xs_cfg.mos8580;
+    myEngine->currConfig.emulateFilter = xs_cfg.emulateFilters;
+    myEngine->currConfig.filterFs = xs_cfg.sid1FilterFs;
+    myEngine->currConfig.filterFm = xs_cfg.sid1FilterFm;
+    myEngine->currConfig.filterFt = xs_cfg.sid1FilterFt;
 
 
-	/* Now set the emulator configuration */
-	if (!myEngine->currEng->setConfig(myEngine->currConfig)) {
-		xs_error("[SIDPlay1] Emulator engine configuration failed!\n");
-		return FALSE;
-	}
-	
-	/* Create sidtune object */
-	myEngine->currTune = new sidTune(0);
-	if (!myEngine->currTune) {
-		xs_error("[SIDPlay1] Could not initialize SIDTune object.\n");
-		return FALSE;
-	}
-	
-	return TRUE;
+    /* Now set the emulator configuration */
+    if (!myEngine->currEng->setConfig(myEngine->currConfig)) {
+        xs_error("[SIDPlay1] Emulator engine configuration failed!\n");
+        return FALSE;
+    }
+    
+    /* Create sidtune object */
+    myEngine->currTune = new sidTune(0);
+    if (!myEngine->currTune) {
+        xs_error("[SIDPlay1] Could not initialize SIDTune object.\n");
+        return FALSE;
+    }
+    
+    return TRUE;
 }
 
 
 /* Close SIDPlay1 engine
  */
-void xs_sidplay1_close(t_xs_status * myStatus)
+void xs_sidplay1_close(xs_status_t * myStatus)
 {
-	t_xs_sidplay1 *myEngine;
-	assert(myStatus);
+    xs_sidplay1_t *myEngine;
+    assert(myStatus);
 
-	myEngine = (t_xs_sidplay1 *) myStatus->sidEngine;
+    myEngine = (xs_sidplay1_t *) myStatus->sidEngine;
 
-	/* Free internals */
-	if (myEngine->currEng) {
-		delete myEngine->currEng;
-		myEngine->currEng = NULL;
-	}
+    /* Free internals */
+    if (myEngine->currEng) {
+        delete myEngine->currEng;
+        myEngine->currEng = NULL;
+    }
 
-	if (myEngine->currTune) {
-		delete myEngine->currTune;
-		myEngine->currTune = NULL;
-	}
+    if (myEngine->currTune) {
+        delete myEngine->currTune;
+        myEngine->currTune = NULL;
+    }
 
-	xs_sidplay1_delete(myStatus);
-	
-	g_free(myEngine);
-	myStatus->sidEngine = NULL;
+    xs_sidplay1_delete(myStatus);
+    
+    g_free(myEngine);
+    myStatus->sidEngine = NULL;
 }
 
 
 /* Initialize current song and sub-tune
  */
-gboolean xs_sidplay1_initsong(t_xs_status * myStatus)
+gboolean xs_sidplay1_initsong(xs_status_t * myStatus)
 {
-	t_xs_sidplay1 *myEngine;
-	assert(myStatus);
+    xs_sidplay1_t *myEngine;
+    assert(myStatus);
 
-	myEngine = (t_xs_sidplay1 *) myStatus->sidEngine;
-	if (!myEngine) return FALSE;
+    myEngine = (xs_sidplay1_t *) myStatus->sidEngine;
+    if (!myEngine) return FALSE;
 
-	if (!myEngine->currTune) {
-		xs_error("[SIDPlay1] SID-tune struct pointer was NULL. This should not happen, report to XMMS-SID author.\n");
-		return FALSE;
-	}
+    if (!myEngine->currTune) {
+        xs_error("[SIDPlay1] SID-tune struct pointer was NULL. This should not happen, report to XMMS-SID author.\n");
+        return FALSE;
+    }
 
-	if (!myEngine->currTune->getStatus()) {
-		xs_error("[SIDPlay1] SID-tune status check failed. This should not happen, report to XMMS-SID author.\n");
-		return FALSE;
-	}
+    if (!myEngine->currTune->getStatus()) {
+        xs_error("[SIDPlay1] SID-tune status check failed. This should not happen, report to XMMS-SID author.\n");
+        return FALSE;
+    }
 
-	myStatus->isInitialized = TRUE;
+    myStatus->isInitialized = TRUE;
 
-	return sidEmuInitializeSong(*myEngine->currEng, *myEngine->currTune, myStatus->currSong);
+    return sidEmuInitializeSong(*myEngine->currEng, *myEngine->currTune, myStatus->currSong);
 }
 
 
 /* Emulate and render audio data to given buffer
  */
-guint xs_sidplay1_fillbuffer(t_xs_status * myStatus, gchar * audioBuffer, guint audioBufSize)
+guint xs_sidplay1_fillbuffer(xs_status_t * myStatus, gchar * audioBuffer, guint audioBufSize)
 {
-	t_xs_sidplay1 *myEngine;
-	assert(myStatus);
+    xs_sidplay1_t *myEngine;
+    assert(myStatus);
 
-	myEngine = (t_xs_sidplay1 *) myStatus->sidEngine;
-	if (!myEngine) return 0;
+    myEngine = (xs_sidplay1_t *) myStatus->sidEngine;
+    if (!myEngine) return 0;
 
-	sidEmuFillBuffer(*myEngine->currEng, *myEngine->currTune, audioBuffer, audioBufSize);
+    sidEmuFillBuffer(*myEngine->currEng, *myEngine->currTune, audioBuffer, audioBufSize);
 
-	return audioBufSize;
+    return audioBufSize;
 }
 
 
 /* Load a given SID-tune file
  */
-gboolean xs_sidplay1_load(t_xs_status * myStatus, gchar * pcFilename)
+gboolean xs_sidplay1_load(xs_status_t * myStatus, gchar * filename)
 {
-	t_xs_sidplay1 *myEngine;
-	assert(myStatus);
-	myStatus->isInitialized = FALSE;
+    xs_sidplay1_t *myEngine;
+    assert(myStatus);
+    myStatus->isInitialized = FALSE;
 
-	myEngine = (t_xs_sidplay1 *) myStatus->sidEngine;
-	if (!myEngine) return FALSE;
+    myEngine = (xs_sidplay1_t *) myStatus->sidEngine;
+    if (!myEngine) return FALSE;
 
-	/* Try to get the tune */
-	if (!pcFilename) return FALSE;
-	
-	if (xs_fload_buffer(pcFilename, &(myEngine->buf), &(myEngine->bufSize)) != 0)
-		return FALSE;
-	
-	if (!myEngine->currTune->load(myEngine->buf, myEngine->bufSize))
-		return FALSE;
+    /* Try to get the tune */
+    if (!filename) return FALSE;
+    
+    if (xs_fload_buffer(filename, &(myEngine->buf), &(myEngine->bufSize)) != 0)
+        return FALSE;
+    
+    if (!myEngine->currTune->load(myEngine->buf, myEngine->bufSize))
+        return FALSE;
 
-	return TRUE;
+    return TRUE;
 }
 
 
 /* Delete INTERNAL information
  */
-void xs_sidplay1_delete(t_xs_status * myStatus)
+void xs_sidplay1_delete(xs_status_t * myStatus)
 {
-	t_xs_sidplay1 *myEngine;
-	assert(myStatus);
+    xs_sidplay1_t *myEngine;
+    assert(myStatus);
 
-	myEngine = (t_xs_sidplay1 *) myStatus->sidEngine;
-	if (!myEngine) return;
-	
-	g_free(myEngine->buf);
-	myEngine->buf = NULL;
-	myEngine->bufSize = 0;
+    myEngine = (xs_sidplay1_t *) myStatus->sidEngine;
+    if (!myEngine) return;
+    
+    g_free(myEngine->buf);
+    myEngine->buf = NULL;
+    myEngine->bufSize = 0;
 }
 
 
-}	/* extern "C" */
-#endif	/* HAVE_SIDPLAY1 */
+}    /* extern "C" */
+#endif    /* HAVE_SIDPLAY1 */
--- a/src/sid/xs_sidplay1.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_sidplay1.h	Tue Apr 08 15:11:35 2008 -0500
@@ -9,15 +9,15 @@
 extern "C" {
 #endif
 
-gboolean	xs_sidplay1_probe(t_xs_file *);
-void		xs_sidplay1_close(t_xs_status *);
-gboolean	xs_sidplay1_init(t_xs_status *);
-gboolean	xs_sidplay1_initsong(t_xs_status *);
-guint		xs_sidplay1_fillbuffer(t_xs_status *, gchar *, guint);
-gboolean	xs_sidplay1_load(t_xs_status *, gchar *);
-void		xs_sidplay1_delete(t_xs_status *);
-t_xs_tuneinfo*	xs_sidplay1_getinfo(const gchar *);
-gboolean	xs_sidplay1_updateinfo(t_xs_status *);
+gboolean    xs_sidplay1_probe(xs_file_t *);
+void        xs_sidplay1_close(xs_status_t *);
+gboolean    xs_sidplay1_init(xs_status_t *);
+gboolean    xs_sidplay1_initsong(xs_status_t *);
+guint        xs_sidplay1_fillbuffer(xs_status_t *, gchar *, guint);
+gboolean    xs_sidplay1_load(xs_status_t *, gchar *);
+void        xs_sidplay1_delete(xs_status_t *);
+xs_tuneinfo_t*    xs_sidplay1_getinfo(const gchar *);
+gboolean    xs_sidplay1_updateinfo(xs_status_t *);
 
 #ifdef __cplusplus
 }
--- a/src/sid/xs_sidplay2.cc	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_sidplay2.cc	Tue Apr 08 15:11:35 2008 -0500
@@ -39,13 +39,13 @@
 
 
 typedef struct {
-	sidplay2 *currEng;
-	sidbuilder *currBuilder;
-	sid2_config_t currConfig;
-	SidTune *currTune;
-	guint8 *buf;
-	size_t bufSize;
-} t_xs_sidplay2;
+    sidplay2 *currEng;
+    sidbuilder *currBuilder;
+    sid2_config_t currConfig;
+    SidTune *currTune;
+    guint8 *buf;
+    size_t bufSize;
+} xs_sidplay2_t;
 
 
 /* We need to 'export' all this pseudo-C++ crap */
@@ -54,445 +54,445 @@
 
 /* Return song information
  */
-#define TFUNCTION	xs_sidplay2_getinfo
-#define TFUNCTION2	xs_sidplay2_updateinfo
-#define TTUNEINFO	SidTuneInfo
-#define TTUNE		SidTune
-#define TENGINE		t_xs_sidplay2
+#define TFUNCTION    xs_sidplay2_getinfo
+#define TFUNCTION2    xs_sidplay2_updateinfo
+#define TTUNEINFO    SidTuneInfo
+#define TTUNE        SidTune
+#define TENGINE        xs_sidplay2_t
 #include "xs_sidplay.h"
 
 
 /* Check if we can play the given file
  */
-gboolean xs_sidplay2_probe(t_xs_file *f)
+gboolean xs_sidplay2_probe(xs_file_t *f)
 {
-	gchar tmpBuf[4];
-	
-	if (!f) return FALSE;
-	
-	if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4)
-		return FALSE;
-	
-	if (!strncmp(tmpBuf, "PSID", 4) || !strncmp(tmpBuf, "RSID", 4))
-		return TRUE;
-	else
-		return FALSE;
+    gchar tmpBuf[4];
+    
+    if (!f) return FALSE;
+    
+    if (xs_fread(tmpBuf, sizeof(gchar), 4, f) != 4)
+        return FALSE;
+    
+    if (!strncmp(tmpBuf, "PSID", 4) || !strncmp(tmpBuf, "RSID", 4))
+        return TRUE;
+    else
+        return FALSE;
 }
 
 
 /* Initialize SIDPlay2
  */
-gboolean xs_sidplay2_init(t_xs_status * myStatus)
+gboolean xs_sidplay2_init(xs_status_t * myStatus)
 {
-	gint tmpFreq, i;
-	t_xs_sidplay2 *myEngine;
-	sid_filter_t tmpFilter;
-	t_xs_sid2_filter *f;
-	assert(myStatus);
+    gint tmpFreq, i;
+    xs_sidplay2_t *myEngine;
+    sid_filter_t tmpFilter;
+    t_xs_sid2_filter *f;
+    assert(myStatus);
 
-	/* Allocate internal structures */
-	myEngine = (t_xs_sidplay2 *) g_malloc0(sizeof(t_xs_sidplay2));
-	myStatus->sidEngine = myEngine;
-	if (!myEngine) return FALSE;
+    /* Allocate internal structures */
+    myEngine = (xs_sidplay2_t *) g_malloc0(sizeof(xs_sidplay2_t));
+    myStatus->sidEngine = myEngine;
+    if (!myEngine) return FALSE;
 
-	/* Initialize the engine */
-	myEngine->currEng = new sidplay2;
-	if (!myEngine->currEng) {
-		xs_error("[SIDPlay2] Could not initialize emulation engine.\n");
-		return FALSE;
-	}
+    /* Initialize the engine */
+    myEngine->currEng = new sidplay2;
+    if (!myEngine->currEng) {
+        xs_error("[SIDPlay2] Could not initialize emulation engine.\n");
+        return FALSE;
+    }
 
-	/* Get current configuration */
-	myEngine->currConfig = myEngine->currEng->config();
+    /* Get current configuration */
+    myEngine->currConfig = myEngine->currEng->config();
 
-	/* Configure channels and stuff */
-	switch (myStatus->audioChannels) {
+    /* Configure channels and stuff */
+    switch (myStatus->audioChannels) {
 
-	case XS_CHN_AUTOPAN:
-		myEngine->currConfig.playback = sid2_stereo;
-		break;
+    case XS_CHN_AUTOPAN:
+        myEngine->currConfig.playback = sid2_stereo;
+        break;
 
-	case XS_CHN_STEREO:
-		myEngine->currConfig.playback = sid2_stereo;
-		break;
+    case XS_CHN_STEREO:
+        myEngine->currConfig.playback = sid2_stereo;
+        break;
 
-	case XS_CHN_MONO:
-	default:
-		myEngine->currConfig.playback = sid2_mono;
-		myStatus->audioChannels = XS_CHN_MONO;
-		break;
-	}
+    case XS_CHN_MONO:
+    default:
+        myEngine->currConfig.playback = sid2_mono;
+        myStatus->audioChannels = XS_CHN_MONO;
+        break;
+    }
 
 
-	/* Memory mode settings */
-	switch (xs_cfg.memoryMode) {
-	case XS_MPU_BANK_SWITCHING:
-		myEngine->currConfig.environment = sid2_envBS;
-		break;
+    /* Memory mode settings */
+    switch (xs_cfg.memoryMode) {
+    case XS_MPU_BANK_SWITCHING:
+        myEngine->currConfig.environment = sid2_envBS;
+        break;
 
-	case XS_MPU_TRANSPARENT_ROM:
-		myEngine->currConfig.environment = sid2_envTP;
-		break;
+    case XS_MPU_TRANSPARENT_ROM:
+        myEngine->currConfig.environment = sid2_envTP;
+        break;
 
-	case XS_MPU_PLAYSID_ENVIRONMENT:
-		myEngine->currConfig.environment = sid2_envPS;
-		break;
+    case XS_MPU_PLAYSID_ENVIRONMENT:
+        myEngine->currConfig.environment = sid2_envPS;
+        break;
 
-	case XS_MPU_REAL:
-	default:
-		myEngine->currConfig.environment = sid2_envR;
-		xs_cfg.memoryMode = XS_MPU_REAL;
-		break;
-	}
+    case XS_MPU_REAL:
+    default:
+        myEngine->currConfig.environment = sid2_envR;
+        xs_cfg.memoryMode = XS_MPU_REAL;
+        break;
+    }
 
 
-	/* Audio parameters sanity checking and setup */
-	myEngine->currConfig.precision = myStatus->audioBitsPerSample;
-	tmpFreq = myStatus->audioFrequency;
+    /* Audio parameters sanity checking and setup */
+    myEngine->currConfig.precision = myStatus->audioBitsPerSample;
+    tmpFreq = myStatus->audioFrequency;
 
-	if (myStatus->oversampleEnable)
-		tmpFreq = (tmpFreq * myStatus->oversampleFactor);
+    if (myStatus->oversampleEnable)
+        tmpFreq = (tmpFreq * myStatus->oversampleFactor);
 
-	myEngine->currConfig.frequency = tmpFreq;
+    myEngine->currConfig.frequency = tmpFreq;
 
-	switch (myStatus->audioBitsPerSample) {
-	case XS_RES_8BIT:
-		myStatus->audioFormat = FMT_U8;
-		myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
-		break;
+    switch (myStatus->audioBitsPerSample) {
+    case XS_RES_8BIT:
+        myStatus->audioFormat = FMT_U8;
+        myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
+        break;
 
-	case XS_RES_16BIT:
-	default:
-		switch (myStatus->audioFormat) {
-		case FMT_U16_LE:
-			myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
-			break;
+    case XS_RES_16BIT:
+    default:
+        switch (myStatus->audioFormat) {
+        case FMT_U16_LE:
+            myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
+            break;
 
-		case FMT_U16_BE:
-			myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
-			break;
+        case FMT_U16_BE:
+            myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
+            break;
 
-		case FMT_U16_NE:
+        case FMT_U16_NE:
 #if G_BYTE_ORDER == G_BIG_ENDIAN
-			myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
+            myEngine->currConfig.sampleFormat = SID2_BIG_UNSIGNED;
 #else
 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
-			myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
+            myEngine->currConfig.sampleFormat = SID2_LITTLE_UNSIGNED;
 #else
 #error Unsupported endianess!
 #endif
 #endif
-			break;
+            break;
 
-		case FMT_S16_LE:
-			myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
-			break;
+        case FMT_S16_LE:
+            myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
+            break;
 
-		case FMT_S16_BE:
-			myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
-			break;
+        case FMT_S16_BE:
+            myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
+            break;
 
-		default:
-			myStatus->audioFormat = FMT_S16_NE;
+        default:
+            myStatus->audioFormat = FMT_S16_NE;
 #if G_BYTE_ORDER == G_BIG_ENDIAN
-			myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
+            myEngine->currConfig.sampleFormat = SID2_BIG_SIGNED;
 #else
 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
-			myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
+            myEngine->currConfig.sampleFormat = SID2_LITTLE_SIGNED;
 #else
 #error Unsupported endianess!
 #endif
 #endif
-			break;
+            break;
 
-		}
-		break;
-	}
-	
-	/* Convert filter */
-	f = &(xs_cfg.sid2Filter);
-	XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints);
-	if (f->npoints > XS_SIDPLAY2_NFPOINTS) {
-		xs_error("[SIDPlay2] Invalid number of filter curve points (%d > %d)\n",
-			f->npoints, XS_SIDPLAY2_NFPOINTS);
-		f->npoints = XS_SIDPLAY2_NFPOINTS;
-	}
-	
-	tmpFilter.points = f->npoints;
-	for (i = 0; i < f->npoints; i++) {
-		tmpFilter.cutoff[i][0] = f->points[i].x;
-		tmpFilter.cutoff[i][1] = f->points[i].y;
-	}
+        }
+        break;
+    }
+    
+    /* Convert filter */
+    f = &(xs_cfg.sid2Filter);
+    XSDEBUG("using filter '%s', %d points\n", f->name, f->npoints);
+    if (f->npoints > XS_SIDPLAY2_NFPOINTS) {
+        xs_error("[SIDPlay2] Invalid number of filter curve points (%d > %d)\n",
+            f->npoints, XS_SIDPLAY2_NFPOINTS);
+        f->npoints = XS_SIDPLAY2_NFPOINTS;
+    }
+    
+    tmpFilter.points = f->npoints;
+    for (i = 0; i < f->npoints; i++) {
+        tmpFilter.cutoff[i][0] = f->points[i].x;
+        tmpFilter.cutoff[i][1] = f->points[i].y;
+    }
 
-	/* Initialize builder object */
-	XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids);
+    /* Initialize builder object */
+    XSDEBUG("init builder #%i, maxsids=%i\n", xs_cfg.sid2Builder, (myEngine->currEng->info()).maxsids);
 #ifdef HAVE_RESID_BUILDER
-	if (xs_cfg.sid2Builder == XS_BLD_RESID) {
-		ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder");
-		myEngine->currBuilder = (sidbuilder *) rs;
-		if (rs) {
-			/* Builder object created, initialize it */
-			rs->create((myEngine->currEng->info()).maxsids);
-			if (!*rs) {
-				xs_error("reSID->create() failed.\n");
-				return FALSE;
-			}
+    if (xs_cfg.sid2Builder == XS_BLD_RESID) {
+        ReSIDBuilder *rs = new ReSIDBuilder("ReSID builder");
+        myEngine->currBuilder = (sidbuilder *) rs;
+        if (rs) {
+            /* Builder object created, initialize it */
+            rs->create((myEngine->currEng->info()).maxsids);
+            if (!*rs) {
+                xs_error("reSID->create() failed.\n");
+                return FALSE;
+            }
 
-			rs->filter(xs_cfg.emulateFilters);
-			if (!*rs) {
-				xs_error("reSID->filter(%d) failed.\n", xs_cfg.emulateFilters);
-				return FALSE;
-			}
+            rs->filter(xs_cfg.emulateFilters);
+            if (!*rs) {
+                xs_error("reSID->filter(%d) failed.\n", xs_cfg.emulateFilters);
+                return FALSE;
+            }
 
-			// FIXME FIX ME: support other configurable parameters ...
-			// ... WHEN/IF resid-builder+libsidplay2 gets fixed
-			rs->sampling(tmpFreq);
-			if (!*rs) {
-				xs_error("reSID->sampling(%d) failed.\n", tmpFreq);
-				return FALSE;
-			}
-			
-			if (tmpFilter.points > 0)
-				rs->filter((sid_filter_t *) &tmpFilter);
-			else
-				rs->filter((sid_filter_t *) NULL);
-			
-			if (!*rs) {
-				xs_error("reSID->filter(NULL) failed.\n");
-				return FALSE;
-			}
-		}
-	}
+            // FIXME FIX ME: support other configurable parameters ...
+            // ... WHEN/IF resid-builder+libsidplay2 gets fixed
+            rs->sampling(tmpFreq);
+            if (!*rs) {
+                xs_error("reSID->sampling(%d) failed.\n", tmpFreq);
+                return FALSE;
+            }
+            
+            if (tmpFilter.points > 0)
+                rs->filter((sid_filter_t *) &tmpFilter);
+            else
+                rs->filter((sid_filter_t *) NULL);
+            
+            if (!*rs) {
+                xs_error("reSID->filter(NULL) failed.\n");
+                return FALSE;
+            }
+        }
+    }
 #endif
 #ifdef HAVE_HARDSID_BUILDER
-	if (xs_cfg.sid2Builder == XS_BLD_HARDSID) {
-		HardSIDBuilder *hs = new HardSIDBuilder("HardSID builder");
-		myEngine->currBuilder = (sidbuilder *) hs;
-		if (hs) {
-			/* Builder object created, initialize it */
-			hs->create((myEngine->currEng->info()).maxsids);
-			if (!*hs) {
-				xs_error("hardSID->create() failed.\n");
-				return FALSE;
-			}
+    if (xs_cfg.sid2Builder == XS_BLD_HARDSID) {
+        HardSIDBuilder *hs = new HardSIDBuilder("HardSID builder");
+        myEngine->currBuilder = (sidbuilder *) hs;
+        if (hs) {
+            /* Builder object created, initialize it */
+            hs->create((myEngine->currEng->info()).maxsids);
+            if (!*hs) {
+                xs_error("hardSID->create() failed.\n");
+                return FALSE;
+            }
 
-			hs->filter(xs_cfg.emulateFilters);
-			if (!*hs) {
-				xs_error("hardSID->filter(%d) failed.\n", xs_cfg.emulateFilters);
-				return FALSE;
-			}
-		}
-	}
+            hs->filter(xs_cfg.emulateFilters);
+            if (!*hs) {
+                xs_error("hardSID->filter(%d) failed.\n", xs_cfg.emulateFilters);
+                return FALSE;
+            }
+        }
+    }
 #endif
 
-	if (!myEngine->currBuilder) {
-		xs_error("[SIDPlay2] Could not initialize SIDBuilder object.\n");
-		return FALSE;
-	}
+    if (!myEngine->currBuilder) {
+        xs_error("[SIDPlay2] Could not initialize SIDBuilder object.\n");
+        return FALSE;
+    }
 
-	XSDEBUG("%s\n", myEngine->currBuilder->credits());
+    XSDEBUG("%s\n", myEngine->currBuilder->credits());
 
 
-	/* Clockspeed settings */
-	switch (xs_cfg.clockSpeed) {
-	case XS_CLOCK_NTSC:
-		myEngine->currConfig.clockDefault = SID2_CLOCK_NTSC;
-		break;
+    /* Clockspeed settings */
+    switch (xs_cfg.clockSpeed) {
+    case XS_CLOCK_NTSC:
+        myEngine->currConfig.clockDefault = SID2_CLOCK_NTSC;
+        break;
 
-	default:
-		xs_error("[SIDPlay2] Invalid clockSpeed=%d, falling back to PAL.\n",
-			xs_cfg.clockSpeed);
+    default:
+        xs_error("[SIDPlay2] Invalid clockSpeed=%d, falling back to PAL.\n",
+            xs_cfg.clockSpeed);
 
-	case XS_CLOCK_PAL:
-		myEngine->currConfig.clockDefault = SID2_CLOCK_PAL;
-		xs_cfg.clockSpeed = XS_CLOCK_PAL;
-		break;
-	}
+    case XS_CLOCK_PAL:
+        myEngine->currConfig.clockDefault = SID2_CLOCK_PAL;
+        xs_cfg.clockSpeed = XS_CLOCK_PAL;
+        break;
+    }
 
 
-	/* Configure rest of the emulation */
-	myEngine->currConfig.sidEmulation = myEngine->currBuilder;
-	
-	if (xs_cfg.forceSpeed) { 
-		myEngine->currConfig.clockForced = true;
-		myEngine->currConfig.clockSpeed = myEngine->currConfig.clockDefault;
-	} else {
-		myEngine->currConfig.clockForced = false;
-		myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT;
-	}
-	
-	if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION))
-		myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel;
-	else {
-		xs_error("Invalid sid2OptLevel=%d, falling back to %d.\n",
-			xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION);
-		
-		xs_cfg.sid2OptLevel =
-		myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION;
-	}
+    /* Configure rest of the emulation */
+    myEngine->currConfig.sidEmulation = myEngine->currBuilder;
+    
+    if (xs_cfg.forceSpeed) { 
+        myEngine->currConfig.clockForced = true;
+        myEngine->currConfig.clockSpeed = myEngine->currConfig.clockDefault;
+    } else {
+        myEngine->currConfig.clockForced = false;
+        myEngine->currConfig.clockSpeed = SID2_CLOCK_CORRECT;
+    }
+    
+    if ((xs_cfg.sid2OptLevel >= 0) && (xs_cfg.sid2OptLevel <= SID2_MAX_OPTIMISATION))
+        myEngine->currConfig.optimisation = xs_cfg.sid2OptLevel;
+    else {
+        xs_error("Invalid sid2OptLevel=%d, falling back to %d.\n",
+            xs_cfg.sid2OptLevel, SID2_DEFAULT_OPTIMISATION);
+        
+        xs_cfg.sid2OptLevel =
+        myEngine->currConfig.optimisation = SID2_DEFAULT_OPTIMISATION;
+    }
 
-	if (xs_cfg.mos8580)
-		myEngine->currConfig.sidDefault = SID2_MOS8580;
-	else
-		myEngine->currConfig.sidDefault = SID2_MOS6581;
+    if (xs_cfg.mos8580)
+        myEngine->currConfig.sidDefault = SID2_MOS8580;
+    else
+        myEngine->currConfig.sidDefault = SID2_MOS6581;
 
-	if (xs_cfg.forceModel)
-		myEngine->currConfig.sidModel = myEngine->currConfig.sidDefault;
-	else
-		myEngine->currConfig.sidModel = SID2_MODEL_CORRECT;
+    if (xs_cfg.forceModel)
+        myEngine->currConfig.sidModel = myEngine->currConfig.sidDefault;
+    else
+        myEngine->currConfig.sidModel = SID2_MODEL_CORRECT;
 
-	
-	/* XXX: Should this be configurable? libSIDPlay1 does not support it, though */
-	myEngine->currConfig.sidSamples = TRUE;
+    
+    /* XXX: Should this be configurable? libSIDPlay1 does not support it, though */
+    myEngine->currConfig.sidSamples = TRUE;
 
 
-	/* Now set the emulator configuration */
-	if (myEngine->currEng->config(myEngine->currConfig) < 0) {
-		xs_error("[SIDPlay2] Emulator engine configuration failed!\n");
-		return FALSE;
-	}
+    /* Now set the emulator configuration */
+    if (myEngine->currEng->config(myEngine->currConfig) < 0) {
+        xs_error("[SIDPlay2] Emulator engine configuration failed!\n");
+        return FALSE;
+    }
 
-	/* Create the sidtune */
-	myEngine->currTune = new SidTune(0);
-	if (!myEngine->currTune) {
-		xs_error("[SIDPlay2] Could not initialize SIDTune object.\n");
-		return FALSE;
-	}
+    /* Create the sidtune */
+    myEngine->currTune = new SidTune(0);
+    if (!myEngine->currTune) {
+        xs_error("[SIDPlay2] Could not initialize SIDTune object.\n");
+        return FALSE;
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 
 /* Close SIDPlay2 engine
  */
-void xs_sidplay2_close(t_xs_status * myStatus)
+void xs_sidplay2_close(xs_status_t * myStatus)
 {
-	t_xs_sidplay2 *myEngine;
-	assert(myStatus);
+    xs_sidplay2_t *myEngine;
+    assert(myStatus);
 
-	myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
+    myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
 
-	/* Free internals */
-	if (myEngine->currBuilder) {
-		delete myEngine->currBuilder;
-		myEngine->currBuilder = NULL;
-	}
+    /* Free internals */
+    if (myEngine->currBuilder) {
+        delete myEngine->currBuilder;
+        myEngine->currBuilder = NULL;
+    }
 
-	if (myEngine->currEng) {
-		delete myEngine->currEng;
-		myEngine->currEng = NULL;
-	}
+    if (myEngine->currEng) {
+        delete myEngine->currEng;
+        myEngine->currEng = NULL;
+    }
 
-	if (myEngine->currTune) {
-		delete myEngine->currTune;
-		myEngine->currTune = NULL;
-	}
+    if (myEngine->currTune) {
+        delete myEngine->currTune;
+        myEngine->currTune = NULL;
+    }
 
-	xs_sidplay2_delete(myStatus);
+    xs_sidplay2_delete(myStatus);
 
-	g_free(myEngine);
-	myStatus->sidEngine = NULL;
+    g_free(myEngine);
+    myStatus->sidEngine = NULL;
 }
 
 
 /* Initialize current song and sub-tune
  */
-gboolean xs_sidplay2_initsong(t_xs_status * myStatus)
+gboolean xs_sidplay2_initsong(xs_status_t * myStatus)
 {
-	t_xs_sidplay2 *myEngine;
-	assert(myStatus);
+    xs_sidplay2_t *myEngine;
+    assert(myStatus);
 
-	myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
-	if (!myEngine) return FALSE;
+    myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
+    if (!myEngine) return FALSE;
 
-	if (!myEngine->currTune->selectSong(myStatus->currSong)) {
-		xs_error("[SIDPlay2] currTune->selectSong() failed\n");
-		return FALSE;
-	}
+    if (!myEngine->currTune->selectSong(myStatus->currSong)) {
+        xs_error("[SIDPlay2] currTune->selectSong() failed\n");
+        return FALSE;
+    }
 
-	if (myEngine->currEng->load(myEngine->currTune) < 0) {
-		xs_error("[SIDPlay2] currEng->load() failed\n");
-		return FALSE;
-	}
-	
-	myStatus->isInitialized = TRUE;
+    if (myEngine->currEng->load(myEngine->currTune) < 0) {
+        xs_error("[SIDPlay2] currEng->load() failed\n");
+        return FALSE;
+    }
+    
+    myStatus->isInitialized = TRUE;
 
-	return TRUE;
+    return TRUE;
 }
 
 
 /* Emulate and render audio data to given buffer
  */
-guint xs_sidplay2_fillbuffer(t_xs_status * myStatus, gchar * audioBuffer, guint audioBufSize)
+guint xs_sidplay2_fillbuffer(xs_status_t * myStatus, gchar * audioBuffer, guint audioBufSize)
 {
-	t_xs_sidplay2 *myEngine;
-	assert(myStatus);
+    xs_sidplay2_t *myEngine;
+    assert(myStatus);
 
-	myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
-	if (!myEngine) return 0;
+    myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
+    if (!myEngine) return 0;
 
-	return myEngine->currEng->play(audioBuffer, audioBufSize);
+    return myEngine->currEng->play(audioBuffer, audioBufSize);
 }
 
 
 /* Load a given SID-tune file
  */
-gboolean xs_sidplay2_load(t_xs_status * myStatus, gchar * pcFilename)
+gboolean xs_sidplay2_load(xs_status_t * myStatus, gchar * pcFilename)
 {
-	t_xs_sidplay2 *myEngine;
-	assert(myStatus);
-	myStatus->isInitialized = FALSE;
+    xs_sidplay2_t *myEngine;
+    assert(myStatus);
+    myStatus->isInitialized = FALSE;
 
-	myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
-	if (!myEngine) return FALSE;
+    myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
+    if (!myEngine) return FALSE;
 
-	/* Try to get the tune */
-	if (!pcFilename) return FALSE;
+    /* Try to get the tune */
+    if (!pcFilename) return FALSE;
 
-	if (xs_fload_buffer(pcFilename, &(myEngine->buf), &(myEngine->bufSize)) != 0)
-		return FALSE;
-	
-	if (!myEngine->currTune->read(myEngine->buf, myEngine->bufSize))
-		return FALSE;
+    if (xs_fload_buffer(pcFilename, &(myEngine->buf), &(myEngine->bufSize)) != 0)
+        return FALSE;
+    
+    if (!myEngine->currTune->read(myEngine->buf, myEngine->bufSize))
+        return FALSE;
 
-	return TRUE;
+    return TRUE;
 }
 
 
 /* Delete INTERNAL information
  */
-void xs_sidplay2_delete(t_xs_status * myStatus)
+void xs_sidplay2_delete(xs_status_t * myStatus)
 {
-	t_xs_sidplay2 *myEngine;
-	assert(myStatus);
+    xs_sidplay2_t *myEngine;
+    assert(myStatus);
 
-	myEngine = (t_xs_sidplay2 *) myStatus->sidEngine;
-	if (!myEngine) return;
-	
-	g_free(myEngine->buf);
-	myEngine->buf = NULL;
-	myEngine->bufSize = 0;
+    myEngine = (xs_sidplay2_t *) myStatus->sidEngine;
+    if (!myEngine) return;
+    
+    g_free(myEngine->buf);
+    myEngine->buf = NULL;
+    myEngine->bufSize = 0;
 }
 
 
 /* Hardware backend flushing
  */
-void xs_sidplay2_flush(t_xs_status * myStatus)
+void xs_sidplay2_flush(xs_status_t * myStatus)
 {
-	assert(myStatus);
+    assert(myStatus);
 
 #ifdef HAVE_HARDSID_BUILDER
 #ifdef HSID_SID2_COM
-	IfPtr<HardSIDBuilder> hs(myStatus->currBuilder);
-	if (hs)
-		hs->flush();
+    IfPtr<HardSIDBuilder> hs(myStatus->currBuilder);
+    if (hs)
+        hs->flush();
 #else
-	if (xs_cfg.sid2Builder == XS_BLD_HARDSID)
-		((HardSIDBuilder *) myStatus->currBuilder)->flush();
+    if (xs_cfg.sid2Builder == XS_BLD_HARDSID)
+        ((HardSIDBuilder *) myStatus->currBuilder)->flush();
 #endif
 #endif
 }
 
 
-}	/* extern "C" */
-#endif	/* HAVE_SIDPLAY2 */
+}    /* extern "C" */
+#endif    /* HAVE_SIDPLAY2 */
--- a/src/sid/xs_sidplay2.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_sidplay2.h	Tue Apr 08 15:11:35 2008 -0500
@@ -9,16 +9,16 @@
 extern "C" {
 #endif
 
-gboolean	xs_sidplay2_probe(t_xs_file *);
-void		xs_sidplay2_close(t_xs_status *);
-gboolean	xs_sidplay2_init(t_xs_status *);
-gboolean	xs_sidplay2_initsong(t_xs_status *);
-guint		xs_sidplay2_fillbuffer(t_xs_status *, gchar *, guint);
-gboolean	xs_sidplay2_load(t_xs_status *, gchar *);
-void		xs_sidplay2_delete(t_xs_status *);
-t_xs_tuneinfo*	xs_sidplay2_getinfo(const gchar *);
-gboolean	xs_sidplay2_updateinfo(t_xs_status *);
-void		xs_sidplay2_flush(t_xs_status *);
+gboolean    xs_sidplay2_probe(xs_file_t *);
+void        xs_sidplay2_close(xs_status_t *);
+gboolean    xs_sidplay2_init(xs_status_t *);
+gboolean    xs_sidplay2_initsong(xs_status_t *);
+guint        xs_sidplay2_fillbuffer(xs_status_t *, gchar *, guint);
+gboolean    xs_sidplay2_load(xs_status_t *, gchar *);
+void        xs_sidplay2_delete(xs_status_t *);
+xs_tuneinfo_t*    xs_sidplay2_getinfo(const gchar *);
+gboolean    xs_sidplay2_updateinfo(xs_status_t *);
+void        xs_sidplay2_flush(xs_status_t *);
 
 #ifdef __cplusplus
 }
--- a/src/sid/xs_slsup.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_slsup.c	Tue Apr 08 15:11:35 2008 -0500
@@ -24,10 +24,10 @@
 #include "xs_config.h"
 
 
-static t_xs_sldb *xs_sldb_db = NULL;
+static xs_sldb_t *xs_sldb_db = NULL;
 XS_MUTEX(xs_sldb_db);
 
-static t_xs_stildb *xs_stildb_db = NULL;
+static xs_stildb_t *xs_stildb_db = NULL;
 XS_MUTEX(xs_stildb_db);
 
 
@@ -35,92 +35,92 @@
  */
 gint xs_stil_init(void)
 {
-	XS_MUTEX_LOCK(xs_cfg);
+    XS_MUTEX_LOCK(xs_cfg);
 
-	if (!xs_cfg.stilDBPath) {
-		XS_MUTEX_UNLOCK(xs_cfg);
-		return -1;
-	}
+    if (!xs_cfg.stilDBPath) {
+        XS_MUTEX_UNLOCK(xs_cfg);
+        return -1;
+    }
 
-	XS_MUTEX_LOCK(xs_stildb_db);
+    XS_MUTEX_LOCK(xs_stildb_db);
 
-	/* Check if already initialized */
-	if (xs_stildb_db)
-		xs_stildb_free(xs_stildb_db);
+    /* Check if already initialized */
+    if (xs_stildb_db)
+        xs_stildb_free(xs_stildb_db);
 
-	/* Allocate database */
-	xs_stildb_db = (t_xs_stildb *) g_malloc0(sizeof(t_xs_stildb));
-	if (!xs_stildb_db) {
-		XS_MUTEX_UNLOCK(xs_cfg);
-		XS_MUTEX_UNLOCK(xs_stildb_db);
-		return -2;
-	}
+    /* Allocate database */
+    xs_stildb_db = (xs_stildb_t *) g_malloc0(sizeof(xs_stildb_t));
+    if (!xs_stildb_db) {
+        XS_MUTEX_UNLOCK(xs_cfg);
+        XS_MUTEX_UNLOCK(xs_stildb_db);
+        return -2;
+    }
 
-	/* Read the database */
-	if (xs_stildb_read(xs_stildb_db, xs_cfg.stilDBPath) != 0) {
-		xs_stildb_free(xs_stildb_db);
-		xs_stildb_db = NULL;
-		XS_MUTEX_UNLOCK(xs_cfg);
-		XS_MUTEX_UNLOCK(xs_stildb_db);
-		return -3;
-	}
+    /* Read the database */
+    if (xs_stildb_read(xs_stildb_db, xs_cfg.stilDBPath) != 0) {
+        xs_stildb_free(xs_stildb_db);
+        xs_stildb_db = NULL;
+        XS_MUTEX_UNLOCK(xs_cfg);
+        XS_MUTEX_UNLOCK(xs_stildb_db);
+        return -3;
+    }
 
-	/* Create index */
-	if (xs_stildb_index(xs_stildb_db) != 0) {
-		xs_stildb_free(xs_stildb_db);
-		xs_stildb_db = NULL;
-		XS_MUTEX_UNLOCK(xs_cfg);
-		XS_MUTEX_UNLOCK(xs_stildb_db);
-		return -4;
-	}
+    /* Create index */
+    if (xs_stildb_index(xs_stildb_db) != 0) {
+        xs_stildb_free(xs_stildb_db);
+        xs_stildb_db = NULL;
+        XS_MUTEX_UNLOCK(xs_cfg);
+        XS_MUTEX_UNLOCK(xs_stildb_db);
+        return -4;
+    }
 
-	XS_MUTEX_UNLOCK(xs_cfg);
-	XS_MUTEX_UNLOCK(xs_stildb_db);
-	return 0;
+    XS_MUTEX_UNLOCK(xs_cfg);
+    XS_MUTEX_UNLOCK(xs_stildb_db);
+    return 0;
 }
 
 
 void xs_stil_close(void)
 {
-	XS_MUTEX_LOCK(xs_stildb_db);
-	xs_stildb_free(xs_stildb_db);
-	xs_stildb_db = NULL;
-	XS_MUTEX_UNLOCK(xs_stildb_db);
+    XS_MUTEX_LOCK(xs_stildb_db);
+    xs_stildb_free(xs_stildb_db);
+    xs_stildb_db = NULL;
+    XS_MUTEX_UNLOCK(xs_stildb_db);
 }
 
 
-t_xs_stil_node *xs_stil_get(gchar *pcFilename)
+stil_node_t *xs_stil_get(gchar *filename)
 {
-	t_xs_stil_node *pResult;
-	gchar *tmpFilename;
+    stil_node_t *result;
+    gchar *tmpFilename;
 
-	XS_MUTEX_LOCK(xs_stildb_db);
-	XS_MUTEX_LOCK(xs_cfg);
+    XS_MUTEX_LOCK(xs_stildb_db);
+    XS_MUTEX_LOCK(xs_cfg);
 
-	if (xs_cfg.stilDBEnable && xs_stildb_db) {
-		if (xs_cfg.hvscPath) {
-			/* Remove postfixed directory separator from HVSC-path */
-			tmpFilename = xs_strrchr(xs_cfg.hvscPath, '/');
-			if (tmpFilename && (tmpFilename[1] == 0))
-				tmpFilename[0] = 0;
+    if (xs_cfg.stilDBEnable && xs_stildb_db) {
+        if (xs_cfg.hvscPath) {
+            /* Remove postfixed directory separator from HVSC-path */
+            tmpFilename = xs_strrchr(xs_cfg.hvscPath, '/');
+            if (tmpFilename && (tmpFilename[1] == 0))
+                tmpFilename[0] = 0;
 
-			/* Remove HVSC location-prefix from filename */
-			tmpFilename = strstr(pcFilename, xs_cfg.hvscPath);
-			if (tmpFilename)
-				tmpFilename += strlen(xs_cfg.hvscPath);
-			else
-				tmpFilename = pcFilename;
-		} else
-			tmpFilename = pcFilename;
+            /* Remove HVSC location-prefix from filename */
+            tmpFilename = strstr(filename, xs_cfg.hvscPath);
+            if (tmpFilename)
+                tmpFilename += strlen(xs_cfg.hvscPath);
+            else
+                tmpFilename = filename;
+        } else
+            tmpFilename = filename;
 
-		pResult = xs_stildb_get_node(xs_stildb_db, tmpFilename);
-	} else
-		pResult = NULL;
+        result = xs_stildb_get_node(xs_stildb_db, tmpFilename);
+    } else
+        result = NULL;
 
-	XS_MUTEX_UNLOCK(xs_stildb_db);
-	XS_MUTEX_UNLOCK(xs_cfg);
+    XS_MUTEX_UNLOCK(xs_stildb_db);
+    XS_MUTEX_UNLOCK(xs_cfg);
 
-	return pResult;
+    return result;
 }
 
 
@@ -128,160 +128,160 @@
  */
 gint xs_songlen_init(void)
 {
-	XS_MUTEX_LOCK(xs_cfg);
+    XS_MUTEX_LOCK(xs_cfg);
 
-	if (!xs_cfg.songlenDBPath) {
-		XS_MUTEX_UNLOCK(xs_cfg);
-		return -1;
-	}
+    if (!xs_cfg.songlenDBPath) {
+        XS_MUTEX_UNLOCK(xs_cfg);
+        return -1;
+    }
 
-	XS_MUTEX_LOCK(xs_sldb_db);
+    XS_MUTEX_LOCK(xs_sldb_db);
 
-	/* Check if already initialized */
-	if (xs_sldb_db)
-		xs_sldb_free(xs_sldb_db);
+    /* Check if already initialized */
+    if (xs_sldb_db)
+        xs_sldb_free(xs_sldb_db);
 
-	/* Allocate database */
-	xs_sldb_db = (t_xs_sldb *) g_malloc0(sizeof(t_xs_sldb));
-	if (!xs_sldb_db) {
-		XS_MUTEX_UNLOCK(xs_cfg);
-		XS_MUTEX_UNLOCK(xs_sldb_db);
-		return -2;
-	}
+    /* Allocate database */
+    xs_sldb_db = (xs_sldb_t *) g_malloc0(sizeof(xs_sldb_t));
+    if (!xs_sldb_db) {
+        XS_MUTEX_UNLOCK(xs_cfg);
+        XS_MUTEX_UNLOCK(xs_sldb_db);
+        return -2;
+    }
 
-	/* Read the database */
-	if (xs_sldb_read(xs_sldb_db, xs_cfg.songlenDBPath) != 0) {
-		xs_sldb_free(xs_sldb_db);
-		xs_sldb_db = NULL;
-		XS_MUTEX_UNLOCK(xs_cfg);
-		XS_MUTEX_UNLOCK(xs_sldb_db);
-		return -3;
-	}
+    /* Read the database */
+    if (xs_sldb_read(xs_sldb_db, xs_cfg.songlenDBPath) != 0) {
+        xs_sldb_free(xs_sldb_db);
+        xs_sldb_db = NULL;
+        XS_MUTEX_UNLOCK(xs_cfg);
+        XS_MUTEX_UNLOCK(xs_sldb_db);
+        return -3;
+    }
 
-	/* Create index */
-	if (xs_sldb_index(xs_sldb_db) != 0) {
-		xs_sldb_free(xs_sldb_db);
-		xs_sldb_db = NULL;
-		XS_MUTEX_UNLOCK(xs_cfg);
-		XS_MUTEX_UNLOCK(xs_sldb_db);
-		return -4;
-	}
+    /* Create index */
+    if (xs_sldb_index(xs_sldb_db) != 0) {
+        xs_sldb_free(xs_sldb_db);
+        xs_sldb_db = NULL;
+        XS_MUTEX_UNLOCK(xs_cfg);
+        XS_MUTEX_UNLOCK(xs_sldb_db);
+        return -4;
+    }
 
-	XS_MUTEX_UNLOCK(xs_cfg);
-	XS_MUTEX_UNLOCK(xs_sldb_db);
-	return 0;
+    XS_MUTEX_UNLOCK(xs_cfg);
+    XS_MUTEX_UNLOCK(xs_sldb_db);
+    return 0;
 }
 
 
 void xs_songlen_close(void)
 {
-	XS_MUTEX_LOCK(xs_sldb_db);
-	xs_sldb_free(xs_sldb_db);
-	xs_sldb_db = NULL;
-	XS_MUTEX_UNLOCK(xs_sldb_db);
+    XS_MUTEX_LOCK(xs_sldb_db);
+    xs_sldb_free(xs_sldb_db);
+    xs_sldb_db = NULL;
+    XS_MUTEX_UNLOCK(xs_sldb_db);
 }
 
 
-t_xs_sldb_node *xs_songlen_get(const gchar * pcFilename)
+sldb_node_t *xs_songlen_get(const gchar * filename)
 {
-	t_xs_sldb_node *pResult;
+    sldb_node_t *result;
 
-	XS_MUTEX_LOCK(xs_sldb_db);
+    XS_MUTEX_LOCK(xs_sldb_db);
 
-	if (xs_cfg.songlenDBEnable && xs_sldb_db)
-		pResult = xs_sldb_get(xs_sldb_db, pcFilename);
-	else
-		pResult = NULL;
+    if (xs_cfg.songlenDBEnable && xs_sldb_db)
+        result = xs_sldb_get(xs_sldb_db, filename);
+    else
+        result = NULL;
 
-	XS_MUTEX_UNLOCK(xs_sldb_db);
+    XS_MUTEX_UNLOCK(xs_sldb_db);
 
-	return pResult;
+    return result;
 }
 
 
 /* Allocate a new tune information structure
  */
-t_xs_tuneinfo *xs_tuneinfo_new(const gchar * pcFilename,
-		gint nsubTunes, gint startTune, const gchar * sidName,
-		const gchar * sidComposer, const gchar * sidCopyright,
-		gint loadAddr, gint initAddr, gint playAddr,
-		gint dataFileLen, const gchar *sidFormat, gint sidModel)
+xs_tuneinfo_t *xs_tuneinfo_new(const gchar * filename,
+        gint nsubTunes, gint startTune, const gchar * sidName,
+        const gchar * sidComposer, const gchar * sidCopyright,
+        gint loadAddr, gint initAddr, gint playAddr,
+        gint dataFileLen, const gchar *sidFormat, gint sidModel)
 {
-	t_xs_tuneinfo *pResult;
-	t_xs_sldb_node *tmpLength;
-	gint i;
+    xs_tuneinfo_t *result;
+    sldb_node_t *tmpLength;
+    gint i;
 
-	/* Allocate structure */
-	pResult = (t_xs_tuneinfo *) g_malloc0(sizeof(t_xs_tuneinfo));
-	if (!pResult) {
-		xs_error("Could not allocate memory for t_xs_tuneinfo ('%s')\n",
-			pcFilename);
-		return NULL;
-	}
+    /* Allocate structure */
+    result = (xs_tuneinfo_t *) g_malloc0(sizeof(xs_tuneinfo_t));
+    if (!result) {
+        xs_error("Could not allocate memory for tuneinfo ('%s')\n",
+            filename);
+        return NULL;
+    }
 
-	pResult->sidFilename = XS_CS_FILENAME(pcFilename);
-	if (!pResult->sidFilename) {
-		xs_error("Could not allocate sidFilename ('%s')\n",
-			pcFilename);
-		g_free(pResult);
-		return NULL;
-	}
+    result->sidFilename = XS_CS_FILENAME(filename);
+    if (!result->sidFilename) {
+        xs_error("Could not allocate sidFilename ('%s')\n",
+            filename);
+        g_free(result);
+        return NULL;
+    }
 
-	/* Allocate space for subtune information */
-	pResult->subTunes = g_malloc0(sizeof(t_xs_subtuneinfo) * (nsubTunes + 1));
-	if (!pResult->subTunes) {
-		xs_error("Could not allocate memory for t_xs_subtuneinfo ('%s', %i)\n",
-			pcFilename, nsubTunes);
+    /* Allocate space for subtune information */
+    result->subTunes = g_malloc0(sizeof(xs_subtuneinfo_t) * (nsubTunes + 1));
+    if (!result->subTunes) {
+        xs_error("Could not allocate memory for subtuneinfo ('%s', %i)\n",
+            filename, nsubTunes);
 
-		g_free(pResult->sidFilename);
-		g_free(pResult);
-		return NULL;
-	}
+        g_free(result->sidFilename);
+        g_free(result);
+        return NULL;
+    }
 
-	/* The following allocations don't matter if they fail */
-	pResult->sidName = XS_CS_SID(sidName);
-	pResult->sidComposer = XS_CS_SID(sidComposer);
-	pResult->sidCopyright = XS_CS_SID(sidCopyright);
+    /* The following allocations don't matter if they fail */
+    result->sidName = XS_CS_SID(sidName);
+    result->sidComposer = XS_CS_SID(sidComposer);
+    result->sidCopyright = XS_CS_SID(sidCopyright);
 
-	pResult->nsubTunes = nsubTunes;
-	pResult->startTune = startTune;
+    result->nsubTunes = nsubTunes;
+    result->startTune = startTune;
 
-	pResult->loadAddr = loadAddr;
-	pResult->initAddr = initAddr;
-	pResult->playAddr = playAddr;
-	pResult->dataFileLen = dataFileLen;
-	pResult->sidFormat = XS_CS_SID(sidFormat);
-	
-	pResult->sidModel = sidModel;
+    result->loadAddr = loadAddr;
+    result->initAddr = initAddr;
+    result->playAddr = playAddr;
+    result->dataFileLen = dataFileLen;
+    result->sidFormat = XS_CS_SID(sidFormat);
+    
+    result->sidModel = sidModel;
 
-	/* Get length information (NOTE: Do not free this!) */
-	tmpLength = xs_songlen_get(pcFilename);
-	
-	/* Fill in sub-tune information */
-	for (i = 0; i < pResult->nsubTunes; i++) {
-		if (tmpLength && (i < tmpLength->nLengths))
-			pResult->subTunes[i].tuneLength = tmpLength->sLengths[i];
-		else
-			pResult->subTunes[i].tuneLength = -1;
-		
-		pResult->subTunes[i].tuneSpeed = -1;
-	}
-	
-	return pResult;
+    /* Get length information (NOTE: Do not free this!) */
+    tmpLength = xs_songlen_get(filename);
+    
+    /* Fill in sub-tune information */
+    for (i = 0; i < result->nsubTunes; i++) {
+        if (tmpLength && (i < tmpLength->nlengths))
+            result->subTunes[i].tuneLength = tmpLength->lengths[i];
+        else
+            result->subTunes[i].tuneLength = -1;
+        
+        result->subTunes[i].tuneSpeed = -1;
+    }
+    
+    return result;
 }
 
 
 /* Free given tune information structure
  */
-void xs_tuneinfo_free(t_xs_tuneinfo * pTune)
+void xs_tuneinfo_free(xs_tuneinfo_t * tune)
 {
-	if (!pTune) return;
+    if (!tune) return;
 
-	g_free(pTune->subTunes);
-	g_free(pTune->sidFilename);
-	g_free(pTune->sidName);
-	g_free(pTune->sidComposer);
-	g_free(pTune->sidCopyright);
-	g_free(pTune->sidFormat);
-	g_free(pTune);
+    g_free(tune->subTunes);
+    g_free(tune->sidFilename);
+    g_free(tune->sidName);
+    g_free(tune->sidComposer);
+    g_free(tune->sidCopyright);
+    g_free(tune->sidFormat);
+    g_free(tune);
 }
--- a/src/sid/xs_slsup.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_slsup.h	Tue Apr 08 15:11:35 2008 -0500
@@ -9,20 +9,20 @@
 extern "C" {
 #endif
 
-gint		xs_stil_init(void);
-void		xs_stil_close(void);
-t_xs_stil_node *xs_stil_get(gchar *pcFilename);
+gint        xs_stil_init(void);
+void        xs_stil_close(void);
+stil_node_t    *xs_stil_get(gchar *filename);
 
-gint		xs_songlen_init(void);
-void		xs_songlen_close(void);
-t_xs_sldb_node *xs_songlen_get(const gchar *);
+gint        xs_songlen_init(void);
+void        xs_songlen_close(void);
+sldb_node_t    *xs_songlen_get(const gchar *);
 
-t_xs_tuneinfo *xs_tuneinfo_new(const gchar * pcFilename,
-		gint nsubTunes, gint startTune, const gchar * sidName,
-		const gchar * sidComposer, const gchar * sidCopyright,
-		gint loadAddr, gint initAddr, gint playAddr,
-		gint dataFileLen, const gchar *sidFormat, gint sidModel);
-void	xs_tuneinfo_free(t_xs_tuneinfo *);
+xs_tuneinfo_t    *xs_tuneinfo_new(const gchar * pcFilename,
+        gint nsubTunes, gint startTune, const gchar * sidName,
+        const gchar * sidComposer, const gchar * sidCopyright,
+        gint loadAddr, gint initAddr, gint playAddr,
+        gint dataFileLen, const gchar *sidFormat, gint sidModel);
+void    xs_tuneinfo_free(xs_tuneinfo_t *);
 
 
 #ifdef __cplusplus
--- a/src/sid/xs_stil.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_stil.c	Tue Apr 08 15:11:35 2008 -0500
@@ -30,404 +30,402 @@
 
 /* Database handling functions
  */
-static gboolean xs_stildb_node_realloc(t_xs_stil_node *pNode, gint nsubTunes)
+static gboolean xs_stildb_node_realloc(stil_node_t *node, gint nsubTunes)
 {
-	if (!pNode) return FALSE;
+    if (!node) return FALSE;
 
-	/* Re-allocate subTune structure if needed */
-	if (nsubTunes > pNode->nsubTunes) {
-		gint clearIndex, clearLength;
-		
-		pNode->subTunes =
-			(t_xs_stil_subnode **) g_realloc(pNode->subTunes,
-			(nsubTunes + 1) * sizeof(t_xs_stil_subnode **));
+    /* Re-allocate subTune structure if needed */
+    if (nsubTunes > node->nsubTunes) {
+        gint clearIndex, clearLength;
+        
+        node->subTunes =
+            (stil_subnode_t **) g_realloc(node->subTunes,
+            (nsubTunes + 1) * sizeof(stil_subnode_t **));
 
-		if (!pNode->subTunes) {
-			xs_error("SubTune pointer structure realloc failed.\n");
-			return FALSE;
-		}
-		
-		/* Clear the newly allocated memory */
-		if (pNode->nsubTunes == 0) {
-			clearIndex = 0;
-			clearLength = nsubTunes + 1;
-		} else {
-			clearIndex = pNode->nsubTunes + 1;
-			clearLength = (nsubTunes - clearIndex + 1);
-		}
-		memset(&(pNode->subTunes[clearIndex]), 0, clearLength * sizeof(t_xs_stil_subnode **));
-		
-		pNode->nsubTunes = nsubTunes;
-	}
+        if (!node->subTunes) {
+            xs_error("SubTune pointer structure realloc failed.\n");
+            return FALSE;
+        }
+        
+        /* Clear the newly allocated memory */
+        if (node->nsubTunes == 0) {
+            clearIndex = 0;
+            clearLength = nsubTunes + 1;
+        } else {
+            clearIndex = node->nsubTunes + 1;
+            clearLength = (nsubTunes - clearIndex + 1);
+        }
+        memset(&(node->subTunes[clearIndex]), 0, clearLength * sizeof(stil_subnode_t **));
+        
+        node->nsubTunes = nsubTunes;
+    }
 
-	/* Allocate memory for subTune */
-	if (!pNode->subTunes[nsubTunes]) {
-		pNode->subTunes[nsubTunes] = (t_xs_stil_subnode *)
-			g_malloc0(sizeof(t_xs_stil_subnode));
-		
-		if (!pNode->subTunes[nsubTunes]) {
-			xs_error("SubTune structure malloc failed!\n");
-			return FALSE;
-		}
-	}
+    /* Allocate memory for subTune */
+    if (!node->subTunes[nsubTunes]) {
+        node->subTunes[nsubTunes] = (stil_subnode_t *)
+            g_malloc0(sizeof(stil_subnode_t));
+        
+        if (!node->subTunes[nsubTunes]) {
+            xs_error("SubTune structure malloc failed!\n");
+            return FALSE;
+        }
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 
-static void xs_stildb_node_free(t_xs_stil_node *pNode)
+static void xs_stildb_node_free(stil_node_t *node)
 {
-	gint i;
-	t_xs_stil_subnode *pSub;
+    gint i;
+    stil_subnode_t *subnode;
+
+    if (!node) return;
 
-	if (pNode) {
-		/* Free subtune information */
-		for (i = 0; i <= pNode->nsubTunes; i++) {
-			pSub = pNode->subTunes[i];
-			if (pSub) {
-				g_free(pSub->pName);
-				g_free(pSub->pAuthor);
-				g_free(pSub->pInfo);
-				g_free(pSub->pTitle);
-
-				g_free(pSub);
-			}
-		}
-		
-		g_free(pNode->subTunes);
-		g_free(pNode->pcFilename);
-		g_free(pNode);
-	}
+    /* Free subtune information */
+    for (i = 0; i <= node->nsubTunes; i++) {
+        subnode = node->subTunes[i];
+        if (subnode) {
+            g_free(subnode->name);
+            g_free(subnode->author);
+            g_free(subnode->info);
+            g_free(subnode->title);
+            g_free(subnode);
+        }
+    }
+    g_free(node->subTunes);
+    g_free(node->filename);
+    g_free(node);
 }
 
 
-static t_xs_stil_node *xs_stildb_node_new(gchar *pcFilename)
+static stil_node_t *xs_stildb_node_new(gchar *filename)
 {
-	t_xs_stil_node *pResult;
+    stil_node_t *result;
 
-	/* Allocate memory for new node */
-	pResult = (t_xs_stil_node *) g_malloc0(sizeof(t_xs_stil_node));
-	if (!pResult)
-		return NULL;
+    /* Allocate memory for new node */
+    result = (stil_node_t *) g_malloc0(sizeof(stil_node_t));
+    if (!result)
+        return NULL;
 
-	/* Allocate filename and initial space for one subtune */
-	pResult->pcFilename = g_strdup(pcFilename);
-	if (!pResult->pcFilename || !xs_stildb_node_realloc(pResult, 1)) {
-		xs_stildb_node_free(pResult);
-		return NULL;
-	}
-	
-	return pResult;
+    /* Allocate filename and initial space for one subtune */
+    result->filename = g_strdup(filename);
+    if (!result->filename || !xs_stildb_node_realloc(result, 1)) {
+        xs_stildb_node_free(result);
+        return NULL;
+    }
+    
+    return result;
 }
 
 
 /* Insert given node to db linked list
  */
-static void xs_stildb_node_insert(t_xs_stildb *db, t_xs_stil_node *pNode)
+static void xs_stildb_node_insert(xs_stildb_t *db, stil_node_t *node)
 {
-	assert(db);
+    assert(db != NULL);
 
-	if (db->pNodes) {
-		/* The first node's pPrev points to last node */
-		LPREV = db->pNodes->pPrev;	/* New node's prev = Previous last node */
-		db->pNodes->pPrev->pNext = pNode;	/* Previous last node's next = New node */
-		db->pNodes->pPrev = pNode;	/* New last node = New node */
-		LNEXT = NULL;	/* But next is NULL! */
-	} else {
-		db->pNodes = pNode;	/* First node ... */
-		LPREV = pNode;	/* ... it's also last */
-		LNEXT = NULL;	/* But next is NULL! */
-	}
+    if (db->nodes) {
+        /* The first node's pPrev points to last node */
+        LPREV = db->nodes->prev;    /* New node's prev = Previous last node */
+        db->nodes->prev->next = node;    /* Previous last node's next = New node */
+        db->nodes->prev = node;    /* New last node = New node */
+        LNEXT = NULL;    /* But next is NULL! */
+    } else {
+        db->nodes = node;    /* First node ... */
+        LPREV = node;    /* ... it's also last */
+        LNEXT = NULL;    /* But next is NULL! */
+    }
 }
 
 
 /* Read database (additively) to given db-structure
  */
-#define XS_STILDB_MULTI							\
-	if (isMulti) {							\
-		isMulti = FALSE;					\
-		xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), "\n");\
-	}
+#define XS_STILDB_MULTI                            \
+    if (isMulti) {                            \
+        isMulti = FALSE;                    \
+        xs_pstrcat(&(tmnode->subTunes[subEntry]->info), "\n");\
+    }
 
 static void XS_STILDB_ERR(gint lineNum, gchar *inLine, const char *fmt, ...)
 {
-	va_list ap;
+    va_list ap;
 
-	va_start(ap, fmt);
-	xs_error(fmt, ap);
-	va_end(ap);
-	
-	fprintf(stderr, "#%d: '%s'\n", lineNum, inLine);
+    va_start(ap, fmt);
+    xs_error(fmt, ap);
+    va_end(ap);
+    
+    fprintf(stderr, "#%d: '%s'\n", lineNum, inLine);
 }
 
-gint xs_stildb_read(t_xs_stildb *db, gchar *dbFilename)
+gint xs_stildb_read(xs_stildb_t *db, gchar *dbFilename)
 {
-	FILE *inFile;
-	gchar inLine[XS_BUF_SIZE + 16];	/* Since we add some chars here and there */
-	size_t lineNum;
-	t_xs_stil_node *tmpNode;
-	gboolean isError, isMulti;
-	gint subEntry;
-	gchar *tmpLine = inLine;
-	assert(db);
+    FILE *inFile;
+    gchar inLine[XS_BUF_SIZE + 16];    /* Since we add some chars here and there */
+    size_t lineNum;
+    stil_node_t *tmnode;
+    gboolean isError, isMulti;
+    gint subEntry;
+    gchar *tmpLine = inLine;
+    assert(db != NULL);
 
-	/* Try to open the file */
-	if ((inFile = fopen(dbFilename, "ra")) == NULL) {
-		xs_error("Could not open STILDB '%s'\n", dbFilename);
-		return -1;
-	}
+    /* Try to open the file */
+    if ((inFile = fopen(dbFilename, "ra")) == NULL) {
+        xs_error("Could not open STILDB '%s'\n", dbFilename);
+        return -1;
+    }
 
-	/* Read and parse the data */
-	lineNum = 0;
-	isError = FALSE;
-	isMulti = FALSE;
-	tmpNode = NULL;
-	subEntry = 0;
+    /* Read and parse the data */
+    lineNum = 0;
+    isError = FALSE;
+    isMulti = FALSE;
+    tmnode = NULL;
+    subEntry = 0;
 
-	while (!isError && fgets(inLine, XS_BUF_SIZE, inFile) != NULL) {
-		size_t linePos = 0, eolPos = 0;
-		xs_findeol(inLine, &eolPos);
-		inLine[eolPos] = 0;
-		lineNum++;
-		
-		tmpLine = XS_CS_STIL(inLine);
+    while (!isError && fgets(inLine, XS_BUF_SIZE, inFile) != NULL) {
+        size_t linePos = 0, eolPos = 0;
+        xs_findeol(inLine, &eolPos);
+        inLine[eolPos] = 0;
+        lineNum++;
+        
+        tmpLine = XS_CS_STIL(inLine);
 
-		switch (tmpLine[0]) {
-		case '/':
-			/* Check if we are already parsing entry */
-			isMulti = FALSE;
-			if (tmpNode) {
-				XS_STILDB_ERR(lineNum, tmpLine,
-					"New entry found before end of current ('%s')!\n",
-					tmpNode->pcFilename);
-				xs_stildb_node_free(tmpNode);
-			}
+        switch (tmpLine[0]) {
+        case '/':
+            /* Check if we are already parsing entry */
+            isMulti = FALSE;
+            if (tmnode) {
+                XS_STILDB_ERR(lineNum, tmpLine,
+                    "New entry found before end of current ('%s')!\n",
+                    tmnode->filename);
+                xs_stildb_node_free(tmnode);
+            }
 
-			/* A new node */
-			subEntry = 0;
-			tmpNode = xs_stildb_node_new(tmpLine);
-			if (!tmpNode) {
-				/* Allocation failed */
-				XS_STILDB_ERR(lineNum, tmpLine,
-					"Could not allocate new STILdb-node!\n");
-				isError = TRUE;
-			}
-			break;
+            /* A new node */
+            subEntry = 0;
+            tmnode = xs_stildb_node_new(tmpLine);
+            if (!tmnode) {
+                /* Allocation failed */
+                XS_STILDB_ERR(lineNum, tmpLine,
+                    "Could not allocate new STILdb-node!\n");
+                isError = TRUE;
+            }
+            break;
 
-		case '(':
-			/* A new sub-entry */
-			isMulti = FALSE;
-			linePos++;
-			if (tmpLine[linePos] == '#') {
-				linePos++;
-				if (isdigit(tmpLine[linePos])) {
-					size_t savePos = linePos;
-					xs_findnum(tmpLine, &linePos);
-					tmpLine[linePos] = 0;
-					subEntry = atol(&tmpLine[savePos]);
+        case '(':
+            /* A new sub-entry */
+            isMulti = FALSE;
+            linePos++;
+            if (tmpLine[linePos] == '#') {
+                linePos++;
+                if (isdigit(tmpLine[linePos])) {
+                    size_t savePos = linePos;
+                    xs_findnum(tmpLine, &linePos);
+                    tmpLine[linePos] = 0;
+                    subEntry = atol(&tmpLine[savePos]);
 
-					/* Sanity check */
-					if (subEntry < 1) {
-						XS_STILDB_ERR(lineNum, tmpLine,
-							"Number of subEntry (%i) for '%s' is invalid\n",
-							subEntry, tmpNode->pcFilename);
-						subEntry = 0;
-					}
-				} else {
-					XS_STILDB_ERR(lineNum, tmpLine,
-						"Syntax error, expected subEntry number.\n");
-					subEntry = 0;
-				}
-			} else {
-				XS_STILDB_ERR(lineNum, tmpLine,
-					"Syntax error, expected '#' before subEntry number.\n");
-				subEntry = 0;
-			}
+                    /* Sanity check */
+                    if (subEntry < 1) {
+                        XS_STILDB_ERR(lineNum, tmpLine,
+                            "Number of subEntry (%i) for '%s' is invalid\n",
+                            subEntry, tmnode->filename);
+                        subEntry = 0;
+                    }
+                } else {
+                    XS_STILDB_ERR(lineNum, tmpLine,
+                        "Syntax error, expected subEntry number.\n");
+                    subEntry = 0;
+                }
+            } else {
+                XS_STILDB_ERR(lineNum, tmpLine,
+                    "Syntax error, expected '#' before subEntry number.\n");
+                subEntry = 0;
+            }
 
-			break;
+            break;
 
-		case 0:
-		case '#':
-		case '\n':
-		case '\r':
-			/* End of entry/field */
-			isMulti = FALSE;
-			if (tmpNode) {
-				/* Insert to database */
-				xs_stildb_node_insert(db, tmpNode);
-				tmpNode = NULL;
-			}
-			break;
+        case 0:
+        case '#':
+        case '\n':
+        case '\r':
+            /* End of entry/field */
+            isMulti = FALSE;
+            if (tmnode) {
+                /* Insert to database */
+                xs_stildb_node_insert(db, tmnode);
+                tmnode = NULL;
+            }
+            break;
 
-		default:
-			/* Check if we are parsing an entry */
-			xs_findnext(tmpLine, &linePos);
-			
-			if (!tmpNode) {
-				XS_STILDB_ERR(lineNum, tmpLine,
-					"Entry data encountered outside of entry or syntax error!\n");
-				break;
-			}
+        default:
+            /* Check if we are parsing an entry */
+            xs_findnext(tmpLine, &linePos);
+            
+            if (!tmnode) {
+                XS_STILDB_ERR(lineNum, tmpLine,
+                    "Entry data encountered outside of entry or syntax error!\n");
+                break;
+            }
 
-			if (!xs_stildb_node_realloc(tmpNode, subEntry)) {
-				XS_STILDB_ERR(lineNum, tmpLine,
-					"Could not (re)allocate memory for subEntries!\n");
-				isError = TRUE;
-				break;
-			}
-			
-			/* Some other type */
-			if (strncmp(tmpLine, "   NAME:", 8) == 0) {
-				XS_STILDB_MULTI;
-				g_free(tmpNode->subTunes[subEntry]->pName);
-				tmpNode->subTunes[subEntry]->pName = g_strdup(&tmpLine[9]);
-			} else if (strncmp(tmpLine, "  TITLE:", 8) == 0) {
-				XS_STILDB_MULTI;
-				isMulti = TRUE;
-				if (!tmpNode->subTunes[subEntry]->pTitle)
-					tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]);
-				xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[2]);
-			} else if (strncmp(tmpLine, " AUTHOR:", 8) == 0) {
-				XS_STILDB_MULTI;
-				g_free(tmpNode->subTunes[subEntry]->pAuthor);
-				tmpNode->subTunes[subEntry]->pAuthor = g_strdup(&tmpLine[9]);
-			} else if (strncmp(tmpLine, " ARTIST:", 8) == 0) {
-				XS_STILDB_MULTI;
-				isMulti = TRUE;
-				xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[1]);
-			} else if (strncmp(tmpLine, "COMMENT:", 8) == 0) {
-				XS_STILDB_MULTI;
-				isMulti = TRUE;
-				xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), tmpLine);
-			} else {
-				if (isMulti) {
-					xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), " ");
-					xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[linePos]);
-				} else {
-					XS_STILDB_ERR(lineNum, tmpLine,
-					"Entry continuation found when isMulti == FALSE.\n");
-				}
-			}
-			break;
-		}
-		
-		XS_CS_FREE(tmpLine);
+            if (!xs_stildb_node_realloc(tmnode, subEntry)) {
+                XS_STILDB_ERR(lineNum, tmpLine,
+                    "Could not (re)allocate memory for subEntries!\n");
+                isError = TRUE;
+                break;
+            }
+            
+            /* Some other type */
+            if (strncmp(tmpLine, "   NAME:", 8) == 0) {
+                XS_STILDB_MULTI;
+                g_free(tmnode->subTunes[subEntry]->name);
+                tmnode->subTunes[subEntry]->name = g_strdup(&tmpLine[9]);
+            } else if (strncmp(tmpLine, "  TITLE:", 8) == 0) {
+                XS_STILDB_MULTI;
+                isMulti = TRUE;
+                if (!tmnode->subTunes[subEntry]->title)
+                    tmnode->subTunes[subEntry]->title = g_strdup(&tmpLine[9]);
+                xs_pstrcat(&(tmnode->subTunes[subEntry]->info), &tmpLine[2]);
+            } else if (strncmp(tmpLine, " AUTHOR:", 8) == 0) {
+                XS_STILDB_MULTI;
+                g_free(tmnode->subTunes[subEntry]->author);
+                tmnode->subTunes[subEntry]->author = g_strdup(&tmpLine[9]);
+            } else if (strncmp(tmpLine, " ARTIST:", 8) == 0) {
+                XS_STILDB_MULTI;
+                isMulti = TRUE;
+                xs_pstrcat(&(tmnode->subTunes[subEntry]->info), &tmpLine[1]);
+            } else if (strncmp(tmpLine, "COMMENT:", 8) == 0) {
+                XS_STILDB_MULTI;
+                isMulti = TRUE;
+                xs_pstrcat(&(tmnode->subTunes[subEntry]->info), tmpLine);
+            } else {
+                if (isMulti) {
+                    xs_pstrcat(&(tmnode->subTunes[subEntry]->info), " ");
+                    xs_pstrcat(&(tmnode->subTunes[subEntry]->info), &tmpLine[linePos]);
+                } else {
+                    XS_STILDB_ERR(lineNum, tmpLine,
+                    "Entry continuation found when isMulti == FALSE.\n");
+                }
+            }
+            break;
+        }
+        
+        XS_CS_FREE(tmpLine);
 
-	} /* while */
+    } /* while */
 
-	/* Check if there is one remaining node */
-	if (tmpNode)
-		xs_stildb_node_insert(db, tmpNode);
+    /* Check if there is one remaining node */
+    if (tmnode)
+        xs_stildb_node_insert(db, tmnode);
 
-	/* Close the file */
-	fclose(inFile);
+    /* Close the file */
+    fclose(inFile);
 
-	return 0;
+    return 0;
 }
 
 
 /* Compare two nodes
  */
-static gint xs_stildb_cmp(const void *pNode1, const void *pNode2)
+static gint xs_stildb_cmp(const void *node1, const void *node2)
 {
-	/* We assume here that we never ever get NULL-pointers or similar */
-	return strcmp(
-		(*(t_xs_stil_node **) pNode1)->pcFilename,
-		(*(t_xs_stil_node **) pNode2)->pcFilename);
+    /* We assume here that we never ever get NULL-pointers or similar */
+    return strcmp(
+        (*(stil_node_t **) node1)->filename,
+        (*(stil_node_t **) node2)->filename);
 }
 
 
 /* (Re)create index
  */
-gint xs_stildb_index(t_xs_stildb *db)
+gint xs_stildb_index(xs_stildb_t *db)
 {
-	t_xs_stil_node *pCurr;
-	size_t i;
+    stil_node_t *curr;
+    size_t i;
 
-	/* Free old index */
-	if (db->ppIndex) {
-		g_free(db->ppIndex);
-		db->ppIndex = NULL;
-	}
+    /* Free old index */
+    if (db->pindex) {
+        g_free(db->pindex);
+        db->pindex = NULL;
+    }
 
-	/* Get size of db */
-	pCurr = db->pNodes;
-	db->n = 0;
-	while (pCurr) {
-		db->n++;
-		pCurr = pCurr->pNext;
-	}
+    /* Get size of db */
+    curr = db->nodes;
+    db->n = 0;
+    while (curr) {
+        db->n++;
+        curr = curr->next;
+    }
 
-	/* Check number of nodes */
-	if (db->n > 0) {
-		/* Allocate memory for index-table */
-		db->ppIndex = (t_xs_stil_node **) g_malloc(sizeof(t_xs_stil_node *) * db->n);
-		if (!db->ppIndex)
-			return -1;
+    /* Check number of nodes */
+    if (db->n > 0) {
+        /* Allocate memory for index-table */
+        db->pindex = (stil_node_t **) g_malloc(sizeof(stil_node_t *) * db->n);
+        if (!db->pindex)
+            return -1;
 
-		/* Get node-pointers to table */
-		i = 0;
-		pCurr = db->pNodes;
-		while (pCurr && (i < db->n)) {
-			db->ppIndex[i++] = pCurr;
-			pCurr = pCurr->pNext;
-		}
+        /* Get node-pointers to table */
+        i = 0;
+        curr = db->nodes;
+        while (curr && (i < db->n)) {
+            db->pindex[i++] = curr;
+            curr = curr->next;
+        }
 
-		/* Sort the indexes */
-		qsort(db->ppIndex, db->n, sizeof(t_xs_stil_node *), xs_stildb_cmp);
-	}
+        /* Sort the indexes */
+        qsort(db->pindex, db->n, sizeof(stil_node_t *), xs_stildb_cmp);
+    }
 
-	return 0;
+    return 0;
 }
 
 
 /* Free a given STIL database
  */
-void xs_stildb_free(t_xs_stildb *db)
+void xs_stildb_free(xs_stildb_t *db)
 {
-	t_xs_stil_node *pCurr, *pNext;
+    stil_node_t *curr, *next;
 
-	if (!db)
-		return;
+    if (!db)
+        return;
 
-	/* Free the memory allocated for nodes */
-	pCurr = db->pNodes;
-	while (pCurr) {
-		pNext = pCurr->pNext;
-		xs_stildb_node_free(pCurr);
-		pCurr = pNext;
-	}
+    /* Free the memory allocated for nodes */
+    curr = db->nodes;
+    while (curr) {
+        next = curr->next;
+        xs_stildb_node_free(curr);
+        curr = next;
+    }
 
-	db->pNodes = NULL;
+    db->nodes = NULL;
 
-	/* Free memory allocated for index */
-	if (db->ppIndex) {
-		g_free(db->ppIndex);
-		db->ppIndex = NULL;
-	}
+    /* Free memory allocated for index */
+    if (db->pindex) {
+        g_free(db->pindex);
+        db->pindex = NULL;
+    }
 
-	/* Free structure */
-	db->n = 0;
-	g_free(db);
+    /* Free structure */
+    db->n = 0;
+    g_free(db);
 }
 
 
 /* Get STIL information node from database
  */
-t_xs_stil_node *xs_stildb_get_node(t_xs_stildb *db, gchar *pcFilename)
+stil_node_t *xs_stildb_get_node(xs_stildb_t *db, gchar *filename)
 {
-	t_xs_stil_node keyItem, *key, **item;
+    stil_node_t keyItem, *key, **item;
 
-	/* Check the database pointers */
-	if (!db || !db->pNodes || !db->ppIndex)
-		return NULL;
+    /* Check the database pointers */
+    if (!db || !db->nodes || !db->pindex)
+        return NULL;
 
-	/* Look-up index using binary search */
-	keyItem.pcFilename = pcFilename;
-	key = &keyItem;
-	item = bsearch(&key, db->ppIndex, db->n, sizeof(t_xs_stil_node *), xs_stildb_cmp);
-	if (item)
-		return *item;
-	else
-		return NULL;
+    /* Look-up index using binary search */
+    keyItem.filename = filename;
+    key = &keyItem;
+    item = bsearch(&key, db->pindex, db->n, sizeof(stil_node_t *), xs_stildb_cmp);
+    if (item)
+        return *item;
+    else
+        return NULL;
 }
--- a/src/sid/xs_stil.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_stil.h	Tue Apr 08 15:11:35 2008 -0500
@@ -10,35 +10,34 @@
 /* Types
  */
 typedef struct {
-	gchar	*pName,
-		*pAuthor,
-		*pTitle,
-		*pInfo;
-} t_xs_stil_subnode;
+    gchar    *name,
+        *author,
+        *title,
+        *info;
+} stil_subnode_t;
 
 
-typedef struct _t_xs_stil_node {
-	gchar			*pcFilename;
-	gint			nsubTunes;
-	t_xs_stil_subnode	**subTunes;
-	
-	struct _t_xs_stil_node	*pPrev, *pNext;
-} t_xs_stil_node;
+typedef struct _stil_node_t {
+    gchar            *filename;
+    gint            nsubTunes;
+    stil_subnode_t        **subTunes;
+    struct _stil_node_t    *prev, *next;
+} stil_node_t;
 
 
 typedef struct {
-	t_xs_stil_node	*pNodes,
-			**ppIndex;
-	size_t		n;
-} t_xs_stildb;
+    stil_node_t    *nodes,
+            **pindex;
+    size_t        n;
+} xs_stildb_t;
 
 
 /* Functions
  */
-gint			xs_stildb_read(t_xs_stildb *, gchar *);
-gint			xs_stildb_index(t_xs_stildb *);
-void			xs_stildb_free(t_xs_stildb *);
-t_xs_stil_node *	xs_stildb_get_node(t_xs_stildb *, gchar *);
+gint            xs_stildb_read(xs_stildb_t *, gchar *);
+gint            xs_stildb_index(xs_stildb_t *);
+void            xs_stildb_free(xs_stildb_t *);
+stil_node_t *    xs_stildb_get_node(xs_stildb_t *, gchar *);
 
 #ifdef __cplusplus
 }
--- a/src/sid/xs_support.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_support.c	Tue Apr 08 15:11:35 2008 -0500
@@ -24,222 +24,222 @@
 #include <ctype.h>
 
 
-guint16 xs_fread_be16(t_xs_file *f)
+guint16 xs_fread_be16(xs_file_t *f)
 {
-	return (((guint16) xs_fgetc(f)) << 8) | ((guint16) xs_fgetc(f));
+    return (((guint16) xs_fgetc(f)) << 8) | ((guint16) xs_fgetc(f));
 }
 
 
-guint32 xs_fread_be32(t_xs_file *f)
+guint32 xs_fread_be32(xs_file_t *f)
 {
-	return (((guint32) xs_fgetc(f)) << 24) |
-		(((guint32) xs_fgetc(f)) << 16) |
-		(((guint32) xs_fgetc(f)) << 8) |
-		((guint32) xs_fgetc(f));
+    return (((guint32) xs_fgetc(f)) << 24) |
+        (((guint32) xs_fgetc(f)) << 16) |
+        (((guint32) xs_fgetc(f)) << 8) |
+        ((guint32) xs_fgetc(f));
 }
 
 
 /* Load a file to a buffer, return 0 on success, negative value on error
  */
-gint xs_fload_buffer(const gchar *pcFilename, guint8 **buf, size_t *bufSize)
+gint xs_fload_buffer(const gchar *filename, guint8 **buf, size_t *bufSize)
 {
-	t_xs_file *f;
-	glong seekPos;
-	
-	/* Open file, get file size */
-	if ((f = xs_fopen(pcFilename, "rb")) == NULL)
-		return -1;
+    xs_file_t *f;
+    glong seekPos;
+    
+    /* Open file, get file size */
+    if ((f = xs_fopen(filename, "rb")) == NULL)
+        return -1;
 
-	xs_fseek(f, 0, SEEK_END);
-	seekPos = xs_ftell(f);
-	
-	if (seekPos > 0) {
-		size_t readSize = seekPos;
-		if (readSize >= *bufSize || *buf == NULL) {
-			/* Only re-allocate if the required size > current */
-			if (*buf != NULL) {
-				g_free(*buf);
-				*buf = NULL;
-			}
-	
-			*bufSize = seekPos;
-			
-			*buf = (guint8 *) g_malloc(*bufSize * sizeof(guint8));
-			if (*buf == NULL) {
-				xs_fclose(f);
-				return -2;
-			}
-		}
-		
-		/* Read data */	
-		xs_fseek(f, 0, SEEK_SET);
-		readSize = xs_fread(*buf, sizeof(guint8), *bufSize, f);
-		xs_fclose(f);
-		
-		if (readSize != *bufSize)
-			return -3;
-		else
-			return 0;
-	} else {
-		xs_fclose(f);
-		return -4;
-	}
+    xs_fseek(f, 0, SEEK_END);
+    seekPos = xs_ftell(f);
+    
+    if (seekPos > 0) {
+        size_t readSize = seekPos;
+        if (readSize >= *bufSize || *buf == NULL) {
+            /* Only re-allocate if the required size > current */
+            if (*buf != NULL) {
+                g_free(*buf);
+                *buf = NULL;
+            }
+    
+            *bufSize = seekPos;
+            
+            *buf = (guint8 *) g_malloc(*bufSize * sizeof(guint8));
+            if (*buf == NULL) {
+                xs_fclose(f);
+                return -2;
+            }
+        }
+        
+        /* Read data */    
+        xs_fseek(f, 0, SEEK_SET);
+        readSize = xs_fread(*buf, sizeof(guint8), *bufSize, f);
+        xs_fclose(f);
+        
+        if (readSize != *bufSize)
+            return -3;
+        else
+            return 0;
+    } else {
+        xs_fclose(f);
+        return -4;
+    }
 }
 
 
 /* Copy a string
  */
-gchar *xs_strncpy(gchar *pDest, const gchar *pSource, size_t n)
+gchar *xs_strncpy(gchar *dest, const gchar *src, size_t n)
 {
-	const gchar *s;
-	gchar *d;
-	size_t i;
+    const gchar *s;
+    gchar *d;
+    size_t i;
 
-	/* Check the string pointers */
-	if (!pSource || !pDest)
-		return pDest;
+    /* Check the string pointers */
+    if (!src || !dest)
+        return dest;
 
-	/* Copy to the destination */
-	i = n;
-	s = pSource;
-	d = pDest;
-	while (*s && (i > 0)) {
-		*(d++) = *(s++);
-		i--;
-	}
+    /* Copy to the destination */
+    i = n;
+    s = src;
+    d = dest;
+    while (*s && (i > 0)) {
+        *(d++) = *(s++);
+        i--;
+    }
 
-	/* Fill rest of space with zeros */
-	while (i > 0) {
-		*(d++) = 0;
-		i--;
-	}
+    /* Fill rest of space with zeros */
+    while (i > 0) {
+        *(d++) = 0;
+        i--;
+    }
 
-	/* Ensure that last is always zero */
-	pDest[n - 1] = 0;
+    /* Ensure that last is always zero */
+    dest[n - 1] = 0;
 
-	return pDest;
+    return dest;
 }
 
 
-/* Copy a given string over in *ppResult.
+/* Copy a given string over in *result.
  */
-gint xs_pstrcpy(gchar **ppResult, const gchar *pStr)
+gint xs_pstrcpy(gchar **result, const gchar *str)
 {
-	/* Check the string pointers */
-	if (!ppResult || !pStr)
-		return -1;
+    /* Check the string pointers */
+    if (!result || !str)
+        return -1;
 
-	/* Allocate memory for destination */
-	if (*ppResult)
-		g_free(*ppResult);
-	*ppResult = (gchar *) g_malloc(strlen(pStr) + 1);
-	if (!*ppResult)
-		return -2;
+    /* Allocate memory for destination */
+    if (*result)
+        g_free(*result);
+    *result = (gchar *) g_malloc(strlen(str) + 1);
+    if (!*result)
+        return -2;
 
-	/* Copy to the destination */
-	strcpy(*ppResult, pStr);
+    /* Copy to the destination */
+    strcpy(*result, str);
 
-	return 0;
+    return 0;
 }
 
 
-/* Concatenates a given string into string pointed by *ppResult.
+/* Concatenates a given string into string pointed by *result.
  */
-gint xs_pstrcat(gchar **ppResult, const gchar *pStr)
+gint xs_pstrcat(gchar **result, const gchar *str)
 {
-	/* Check the string pointers */
-	if (!ppResult || !pStr)
-		return -1;
+    /* Check the string pointers */
+    if (!result || !str)
+        return -1;
 
-	if (*ppResult != NULL) {
-		*ppResult = (gchar *) g_realloc(*ppResult, strlen(*ppResult) + strlen(pStr) + 1);
-		if (*ppResult == NULL)
-			return -1;
-		strcat(*ppResult, pStr);
-	} else {
-		*ppResult = (gchar *) g_malloc(strlen(pStr) + 1);
-		if (*ppResult == NULL)
-			return -1;
-		strcpy(*ppResult, pStr);
-	}
+    if (*result != NULL) {
+        *result = (gchar *) g_realloc(*result, strlen(*result) + strlen(str) + 1);
+        if (*result == NULL)
+            return -1;
+        strcat(*result, str);
+    } else {
+        *result = (gchar *) g_malloc(strlen(str) + 1);
+        if (*result == NULL)
+            return -1;
+        strcpy(*result, str);
+    }
 
-	return 0;
+    return 0;
 }
 
 
 /* Concatenate a given string up to given dest size or \n.
  * If size max is reached, change the end to "..."
  */
-void xs_pnstrcat(gchar *pDest, size_t iSize, const gchar *pStr)
+void xs_pnstrcat(gchar *dest, size_t iSize, const gchar *str)
 {
-	size_t i, n;
-	const gchar *s;
-	gchar *d;
+    size_t i, n;
+    const gchar *s;
+    gchar *d;
 
-	d = pDest;
-	i = 0;
-	while (*d && (i < iSize)) {
-		i++;
-		d++;
-	}
+    d = dest;
+    i = 0;
+    while (*d && (i < iSize)) {
+        i++;
+        d++;
+    }
 
-	s = pStr;
-	while (*s && (*s != '\n') && (i < iSize)) {
-		*d = *s;
-		d++;
-		s++;
-		i++;
-	}
+    s = str;
+    while (*s && (*s != '\n') && (i < iSize)) {
+        *d = *s;
+        d++;
+        s++;
+        i++;
+    }
 
-	*d = 0;
+    *d = 0;
 
-	if (i >= iSize) {
-		i--;
-		d--;
-		n = 3;
-		while ((i > 0) && (n > 0)) {
-			*d = '.';
-			d--;
-			i--;
-			n--;
-		}
-	}
+    if (i >= iSize) {
+        i--;
+        d--;
+        n = 3;
+        while ((i > 0) && (n > 0)) {
+            *d = '.';
+            d--;
+            i--;
+            n--;
+        }
+    }
 }
 
 
 /* Locate character in string
  */
-gchar *xs_strrchr(gchar *pcStr, const gchar ch)
+gchar *xs_strrchr(gchar *str, const gchar ch)
 {
-	gchar *lastPos = NULL;
+    gchar *lastPos = NULL;
 
-	while (*pcStr) {
-		if (*pcStr == ch)
-			lastPos = pcStr;
-		pcStr++;
-	}
+    while (*str) {
+        if (*str == ch)
+            lastPos = str;
+        str++;
+    }
 
-	return lastPos;
+    return lastPos;
 }
 
 
-void xs_findnext(const gchar *pcStr, size_t *piPos)
+void xs_findnext(const gchar *str, size_t *pos)
 {
-	while (pcStr[*piPos] && isspace(pcStr[*piPos]))
-		(*piPos)++;
+    while (str[*pos] && isspace(str[*pos]))
+        (*pos)++;
 }
 
 
-void xs_findeol(const gchar *pcStr, size_t *piPos)
+void xs_findeol(const gchar *str, size_t *pos)
 {
-	while (pcStr[*piPos] && (pcStr[*piPos] != '\n') && (pcStr[*piPos] != '\r'))
-		(*piPos)++;
+    while (str[*pos] && (str[*pos] != '\n') && (str[*pos] != '\r'))
+        (*pos)++;
 }
 
 
-void xs_findnum(const gchar *pcStr, size_t *piPos)
+void xs_findnum(const gchar *str, size_t *pos)
 {
-	while (pcStr[*piPos] && isdigit(pcStr[*piPos]))
-		(*piPos)++;
+    while (str[*pos] && isdigit(str[*pos]))
+        (*pos)++;
 }
 
--- a/src/sid/xs_support.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sid/xs_support.h	Tue Apr 08 15:11:35 2008 -0500
@@ -67,8 +67,7 @@
 /* VFS replacement functions
  */
 #ifdef __AUDACIOUS_NEWVFS__
-#include <audacious/vfs.h>
-#define t_xs_file VFSFile
+#define xs_file_t VFSFile
 #define xs_fopen(a,b) aud_vfs_fopen(a,b)
 #define xs_fclose(a) aud_vfs_fclose(a)
 #define xs_fgetc(a) aud_vfs_getc(a)
@@ -78,8 +77,8 @@
 #define xs_ftell(a) aud_vfs_ftell(a)
 #define xs_fseek(a,b,c) aud_vfs_fseek(a,b,c)
 #else
-#define t_xs_file FILE
-#define xs_fopen(a,b)fopen(a,b)
+#define xs_file_t FILE
+#define xs_fopen(a,b) fopen(a,b)
 #define xs_fclose(a) fclose(a)
 #define xs_fgetc(a) fgetc(a)
 #define xs_fread(a,b,c,d) fread(a,b,c,d)
@@ -88,21 +87,21 @@
 #define xs_ftell(a) ftell(a)
 #define xs_fseek(a,b,c) fseek(a,b,c)
 #endif
-guint16 xs_fread_be16(t_xs_file *);
-guint32 xs_fread_be32(t_xs_file *);
-gint	xs_fload_buffer(const gchar *, guint8 **, size_t *);
+guint16 xs_fread_be16(xs_file_t *);
+guint32 xs_fread_be32(xs_file_t *);
+gint    xs_fload_buffer(const gchar *, guint8 **, size_t *);
 
 
 /* Misc functions
  */
-gchar	*xs_strncpy(gchar *, const gchar *, size_t);
-gint	xs_pstrcpy(gchar **, const gchar *);
-gint	xs_pstrcat(gchar **, const gchar *);
-void	xs_pnstrcat(gchar *, size_t, const gchar *);
-gchar	*xs_strrchr(gchar *, const gchar);
-void	xs_findnext(const gchar *, size_t *);
-void	xs_findeol(const gchar *, size_t *);
-void	xs_findnum(const gchar *, size_t *);
+gchar    *xs_strncpy(gchar *, const gchar *, size_t);
+gint    xs_pstrcpy(gchar **, const gchar *);
+gint    xs_pstrcat(gchar **, const gchar *);
+void    xs_pnstrcat(gchar *, size_t, const gchar *);
+gchar    *xs_strrchr(gchar *, const gchar);
+void    xs_findnext(const gchar *, size_t *);
+void    xs_findeol(const gchar *, size_t *);
+void    xs_findnum(const gchar *, size_t *);
 
 #ifdef __cplusplus
 }
--- a/src/sndfile/plugin.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sndfile/plugin.c	Tue Apr 08 15:11:35 2008 -0500
@@ -37,7 +37,6 @@
 #include <audacious/plugin.h>
 #include <audacious/util.h>
 #include <audacious/i18n.h>
-#include <audacious/main.h>
 #include <audacious/output.h>
 #include "plugin.h"
 
--- a/src/sndstretch/sndstretch_xmms.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sndstretch/sndstretch_xmms.c	Tue Apr 08 15:11:35 2008 -0500
@@ -25,7 +25,6 @@
 #include "FB_logo.xpm"
 
 #include "config.h"
-#include <audacious/configdb.h>
 #include <audacious/plugin.h>
 #include <audacious/i18n.h>
 #include <gtk/gtk.h>
--- a/src/song_change/song_change.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/song_change/song_change.c	Tue Apr 08 15:11:35 2008 -0500
@@ -17,12 +17,10 @@
 
 #include <audacious/plugin.h>
 #include <audacious/ui_preferences.h>
-#include <audacious/configdb.h>
 #include <audacious/auddrct.h>
 #include "formatter.h"
 #include <audacious/i18n.h>
 #include <audacious/hook.h>
-#include <audacious/playlist.h>
 
 static void init(void);
 static void cleanup(void);
--- a/src/statusicon/si.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/statusicon/si.c	Tue Apr 08 15:11:35 2008 -0500
@@ -24,7 +24,6 @@
 #include "si_cfg.h"
 #include "si_common.h"
 #include <audacious/auddrct.h>
-#include <audacious/playlist.h>
 
 
 GeneralPlugin *statusicon_gplist[] = { &si_gp, NULL };
--- a/src/statusicon/si_cfg.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/statusicon/si_cfg.c	Tue Apr 08 15:11:35 2008 -0500
@@ -21,7 +21,6 @@
 #include "si_cfg.h"
 #include "si_common.h"
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 
 si_cfg_t si_cfg;
 
--- a/src/statusicon/si_ui.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/statusicon/si_ui.c	Tue Apr 08 15:11:35 2008 -0500
@@ -23,8 +23,6 @@
 #include "si_cfg.h"
 #include "si_common.h"
 #include "gtktrayicon.h"
-#include <audacious/playlist.h>
-#include <audacious/main.h>
 #include <audacious/ui_fileinfopopup.h>
 #include <audacious/util.h>
 #include <audacious/i18n.h>
--- a/src/stereo_plugin/stereo.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/stereo_plugin/stereo.c	Tue Apr 08 15:11:35 2008 -0500
@@ -1,11 +1,9 @@
+#include "config.h"
 #include <gtk/gtk.h>
 #include <audacious/i18n.h>
 #include <audacious/util.h>
+#include <audacious/plugin.h>
 
-#include <audacious/plugin.h>
-#include <audacious/configdb.h>
-
-#include "../../config.h"
 
 static void init(void);
 static void about(void);
--- a/src/sun/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sun/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -23,7 +23,6 @@
 
 #include "sun.h"
 #include <audacious/util.h>
-#include <audacious/configdb.h>
 #include <audacious/i18n.h>
 
 #include "mixer.h"
--- a/src/sun/sun.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sun/sun.c	Tue Apr 08 15:11:35 2008 -0500
@@ -20,7 +20,6 @@
 #include <glib.h>
 
 #include "sun.h"
-#include <audacious/configdb.h>
 #include <audacious/i18n.h>
 
 #include <errno.h>
--- a/src/sun/sun.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/sun/sun.h	Tue Apr 08 15:11:35 2008 -0500
@@ -36,7 +36,6 @@
 #include "audioio.h"
 
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 
 /* Default path to audio device. */
 #ifndef SUN_DEV_AUDIO
--- a/src/timidity/xmms-timidity.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/timidity/xmms-timidity.c	Tue Apr 08 15:11:35 2008 -0500
@@ -20,8 +20,6 @@
 #include "config.h"
 
 #include <audacious/util.h>
-#include <audacious/configdb.h>
-#include <audacious/main.h>
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <string.h>
--- a/src/tta/libtta.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/tta/libtta.c	Tue Apr 08 15:11:35 2008 -0500
@@ -43,7 +43,6 @@
 
 #include <audacious/plugin.h>
 #include <audacious/util.h>
-#include <audacious/main.h>
 #include <audacious/output.h>
 #include <audacious/strings.h>
 #include <audacious/i18n.h>
--- a/src/vorbis/configure.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/vorbis/configure.c	Tue Apr 08 15:11:35 2008 -0500
@@ -8,7 +8,6 @@
 #include <string.h>
 
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include <audacious/util.h>
 #include <audacious/i18n.h>
 
--- a/src/vorbis/vorbis.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/vorbis/vorbis.c	Tue Apr 08 15:11:35 2008 -0500
@@ -55,8 +55,6 @@
 #include <audacious/plugin.h>
 #include <audacious/output.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
-#include <audacious/main.h>
 #include <audacious/i18n.h>
 #include <audacious/strings.h>
 
--- a/src/vtx/about.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/vtx/about.c	Tue Apr 08 15:11:35 2008 -0500
@@ -1,10 +1,6 @@
 #include <audacious/plugin.h>
-#include <audacious/util.h>
-#include <audacious/plugin.h>
-
 #include <audacious/output.h>
 #include <audacious/util.h>
-#include <audacious/vfs.h>
 #include <audacious/strings.h>
 #include <audacious/i18n.h>
 
--- a/src/vtx/ayemu_vtxfile.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/vtx/ayemu_vtxfile.h	Tue Apr 08 15:11:35 2008 -0500
@@ -3,7 +3,7 @@
 
 #include <glib.h>
 #include <inttypes.h>
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 #include "ayemu_8912.h"
 
 /* The following constants and data structure comes from
--- a/src/vtx/info.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/vtx/info.c	Tue Apr 08 15:11:35 2008 -0500
@@ -1,13 +1,10 @@
-#include <audacious/plugin.h>
+#include "ayemu.h"
+#include "vtx.h"
 #include <audacious/util.h>
 #include <audacious/output.h>
-#include <audacious/vfs.h>
 #include <audacious/strings.h>
 #include <audacious/i18n.h>
 
-#include "ayemu.h"
-#include "vtx.h"
-
 void vtx_file_info(gchar *filename)
 {
   static GtkWidget *box;
--- a/src/vtx/vtx.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/vtx/vtx.c	Tue Apr 08 15:11:35 2008 -0500
@@ -18,17 +18,13 @@
  */
 
 #include <audacious/plugin.h>
-
 #include <audacious/output.h>
 #include <audacious/util.h>
-#include <audacious/configdb.h>
-#include <audacious/vfs.h>
-#include <audacious/main.h>
 #include <audacious/strings.h>
 #include <audacious/i18n.h>
 
 #include "vtx.h"
-#include <ayemu.h>
+#include "ayemu.h"
 
 extern InputPlugin vtx_ip;
 
--- a/src/vtx/vtx.h	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/vtx/vtx.h	Tue Apr 08 15:11:35 2008 -0500
@@ -3,8 +3,6 @@
 
 #include <config.h>
 
-#include <pthread.h>
-
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
--- a/src/wavpack/libwavpack.cxx	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/wavpack/libwavpack.cxx	Tue Apr 08 15:11:35 2008 -0500
@@ -11,10 +11,7 @@
 #include <wavpack/wavpack.h>
 #include <audacious/plugin.h>
 #include <audacious/output.h>
-#include <audacious/configdb.h>
-#include <audacious/main.h>
 #include <audacious/util.h>
-#include <audacious/vfs.h>
 }
 #include <glib.h>
 #include <gtk/gtk.h>
--- a/src/wavpack/tags.cxx	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/wavpack/tags.cxx	Tue Apr 08 15:11:35 2008 -0500
@@ -5,7 +5,6 @@
 #include <fcntl.h>
 #include <wchar.h>
 #include <audacious/util.h>
-#include <audacious/vfs.h>
 #include <audacious/plugin.h>
 #include "tags.h"
 
--- a/src/wavpack/ui.cxx	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/wavpack/ui.cxx	Tue Apr 08 15:11:35 2008 -0500
@@ -9,7 +9,6 @@
 extern "C" {
 #include <wavpack/wavpack.h>
 #include <audacious/plugin.h>
-#include <audacious/configdb.h>
 #include <audacious/util.h>
 #include <audacious/i18n.h>
 }
--- a/src/wma/wma.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/wma/wma.c	Tue Apr 08 15:11:35 2008 -0500
@@ -40,7 +40,6 @@
 #include <audacious/util.h>
 #include <audacious/strings.h>
 #include <audacious/i18n.h>
-#include <audacious/main.h>
 
 #include "avcodec.h"
 #include "avformat.h"
--- a/src/xspf/xspf.c	Tue Apr 08 15:10:31 2008 -0500
+++ b/src/xspf/xspf.c	Tue Apr 08 15:11:35 2008 -0500
@@ -34,11 +34,8 @@
 #include <sys/errno.h>
 
 #include <audacious/plugin.h>
-#include <audacious/main.h>
 #include <audacious/util.h>
 #include <audacious/strings.h>
-#include <audacious/playlist.h>
-#include <audacious/playlist_container.h>
 
 #include <libxml/tree.h>
 #include <libxml/parser.h>