changeset 1882:eed7c270e8dd

Fix MILLIONS of Makefiles.
author Jonathan Schleifer <js@h3c.de>
date Wed, 26 Sep 2007 14:53:37 +0200
parents 8bdede3414cd
children 96da96b1bbeb 73d6306b4852
files src/OSS/Makefile src/aac/Makefile src/aac/aac_utils.c src/aac/libfaad2/Makefile src/aac/libmp4.c src/aac/m4a.xpm src/aac/mp4_utils.c src/aac/mp4ff/Makefile src/aac/src/Makefile src/aac/src/aac_utils.c src/aac/src/libmp4.c src/aac/src/m4a.xpm src/aac/src/mp4_utils.c src/aac/src/tagging.h src/aac/src/tagging_mp4.c src/aac/src/xmms-id3.h src/aac/tagging.h src/aac/tagging_mp4.c src/aac/xmms-id3.h src/alac/Makefile src/alarm/Makefile src/alsa/Makefile src/arts/arts_helper/Makefile src/blur_scope/Makefile src/dockalbumart/Makefile src/esd/Makefile src/evdev-plug/Makefile src/filewriter/Makefile src/flacng/Makefile src/gnomeshortcuts/Makefile src/hotkey/Makefile src/jack/Makefile src/ladspa/Makefile src/lastfm/Makefile src/m3u/Makefile src/metronom/Makefile src/mms/Makefile src/modplug/Makefile src/modplug/archive/Makefile src/musepack/Makefile src/neon/Makefile src/null/Makefile src/paranormal/Makefile src/paranormal/libcalc/Makefile src/pls/Makefile src/projectm/Makefile src/rocklight/Makefile src/scrobbler/Makefile src/sexypsf/Makefile src/smb/Makefile src/sndstretch/Makefile src/song_change/Makefile src/spectrum/Makefile src/statusicon/Makefile src/stdio/Makefile src/stereo_plugin/Makefile src/timidity/Makefile src/timidity/callbacks.c src/timidity/callbacks.h src/timidity/interface.c src/timidity/interface.h src/timidity/libtimidity/Makefile src/timidity/src/Makefile src/timidity/src/callbacks.c src/timidity/src/callbacks.h src/timidity/src/interface.c src/timidity/src/interface.h src/timidity/src/xmms-timidity.c src/timidity/src/xmms-timidity.h src/timidity/xmms-timidity.c src/timidity/xmms-timidity.h src/tonegen/Makefile src/tta/Makefile src/voice_removal/Makefile src/vorbis/Makefile src/vtx/Makefile src/wav/Makefile src/wavpack/Makefile src/wma/Makefile src/xspf/Makefile
diffstat 80 files changed, 3606 insertions(+), 3636 deletions(-) [+]
line wrap: on
line diff
--- a/src/OSS/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/OSS/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,6 +1,4 @@
 PLUGIN = OSS${PLUGIN_SUFFIX}
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 SRCS = OSS.c		\
        mixer.c		\
        about.c		\
@@ -9,6 +7,8 @@
        init.c		\
        convert.c
 
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
+
 include ../../buildsys.mk
 include ../../extra.mk
 
--- a/src/aac/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/aac/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,3 +1,58 @@
-include ../../buildsys.mk
+PLUGIN = aac${PLUGIN_SUFFIX}
+SRCS = libmp4.c			\
+       mp4_utils.c		\
+       aac_utils.c		\
+       tagging_mp4.c		\
+       libfaad2/bits.c		\
+       libfaad2/cfft.c		\
+       libfaad2/decoder.c	\
+       libfaad2/drc.c		\
+       libfaad2/drm_dec.c	\
+       libfaad2/error.c		\
+       libfaad2/filtbank.c	\
+       libfaad2/ic_predict.c	\
+       libfaad2/is.c		\
+       libfaad2/lt_predict.c	\
+       libfaad2/mdct.c		\
+       libfaad2/mp4.c		\
+       libfaad2/ms.c		\
+       libfaad2/output.c	\
+       libfaad2/pns.c		\
+       libfaad2/ps_dec.c	\
+       libfaad2/ps_syntax.c	\
+       libfaad2/pulse.c		\
+       libfaad2/specrec.c	\
+       libfaad2/syntax.c	\
+       libfaad2/tns.c		\
+       libfaad2/hcr.c		\
+       libfaad2/huffman.c	\
+       libfaad2/rvlc.c		\
+       libfaad2/ssr.c		\
+       libfaad2/ssr_fb.c	\
+       libfaad2/ssr_ipqf.c	\
+       libfaad2/common.c	\
+       libfaad2/sbr_dct.c	\
+       libfaad2/sbr_e_nf.c	\
+       libfaad2/sbr_fbt.c	\
+       libfaad2/sbr_hfadj.c	\
+       libfaad2/sbr_hfgen.c	\
+       libfaad2/sbr_huff.c	\
+       libfaad2/sbr_qmf.c	\
+       libfaad2/sbr_syntax.c	\
+       libfaad2/sbr_tf_grid.c	\
+       libfaad2/sbr_dec.c	\
+       mp4ff/mp4ff.c		\
+       mp4ff/mp4atom.c		\
+       mp4ff/mp4meta.c		\
+       mp4ff/mp4sample.c	\
+       mp4ff/mp4util.c		\
+       mp4ff/mp4tagupdate.c
 
-SUBDIRS = mp4ff libfaad2 src
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
+include ../../extra.mk
+
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../.. -I. -I./include -I./libfaad2 -I./mp4ff -DUSE_TAGGING=1
+CFLAGS += ${PLUGIN_CFLAGS} -fsigned-char
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -lm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aac/aac_utils.c	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,99 @@
+/*
+ *
+ * utils for AAC informations
+*/
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#define ADTS_HEADER_SIZE        8
+#define SEEK_TABLE_CHUNK        60
+#define MPEG4_TYPE              0
+#define MPEG2_TYPE              1
+
+// Read ADTS header, the file descriptor must be at
+// the begining of the aac frame not at the id3tag
+
+int	getAacInfo(FILE *fd)
+{
+  unsigned char	header[ADTS_HEADER_SIZE];
+  unsigned int	id;
+  unsigned long	originPosition;
+  
+  originPosition = ftell(fd);
+  if(fread(header, 1, ADTS_HEADER_SIZE, fd) != ADTS_HEADER_SIZE){
+    fseek(fd, originPosition, SEEK_SET);
+    return(-1);
+  }
+  if(!((header[0]==0xFF)&&((header[1]& 0xF6)==0xF0))){
+    printf("Bad header\n");
+    return(-1);
+  }
+  id = header[1]&0x08;
+  if(id==0){//MPEG-4 AAC
+    fseek(fd, originPosition, SEEK_SET);
+    return(MPEG4_TYPE);
+  }else{
+    fseek(fd, originPosition, SEEK_SET);
+    return(MPEG2_TYPE);
+  }
+  fseek(fd, originPosition, SEEK_SET);
+  return(-1);
+}
+
+// as AAC is VBR we need to check all ADTS header
+// to enable seeking...
+// there is no other solution
+void	checkADTSForSeeking(FILE *fd,
+			    unsigned long **seekTable,
+			    unsigned long *seekTableLength)
+{
+  unsigned long	originPosition;
+  unsigned long	position;
+  unsigned int	frameCount, frameLength, frameInsec;
+  unsigned int	id=0, seconds=0;
+  char header[ADTS_HEADER_SIZE];
+
+  originPosition = ftell(fd);
+
+  for(frameCount=0,frameInsec=0;; frameCount++,frameInsec++){
+    position = ftell(fd);
+    if(fread(header, 1, ADTS_HEADER_SIZE, fd)!=ADTS_HEADER_SIZE){
+      break;
+    }
+    if(!g_strncasecmp(header, "ID3", 3)){
+      break;
+    }
+    if(!frameCount){
+      id=header[1]&0x08;
+      if(((*seekTable) = malloc(SEEK_TABLE_CHUNK * sizeof(unsigned long)))==0){
+	printf("malloc error\n");
+	return;
+      }
+      (*seekTableLength) = SEEK_TABLE_CHUNK;
+    }
+
+    //if(id==0){//MPEG-4
+    //frameLength = ((unsigned int)header[4]<<5)|((unsigned int)header[5]>>3);
+    //}else{//MPEG-2
+      frameLength = (((unsigned int)header[3]&0x3)<<11)|((unsigned int)header[4]<<3)|(header[5]>>5);
+      //}
+    if(frameInsec==43){//???
+      frameInsec=0;
+    }
+    if(frameInsec==0){
+      if(seconds == (*seekTableLength)){
+	(*seekTable) = realloc((*seekTable), (seconds+SEEK_TABLE_CHUNK)*sizeof(unsigned long));
+	(*seekTableLength) = seconds+SEEK_TABLE_CHUNK;
+      }
+      (*seekTable)[seconds] = position;
+      seconds++;
+    }
+    if(fseek(fd, frameLength-ADTS_HEADER_SIZE, SEEK_CUR)==-1){
+      break;
+    } 
+  }
+  (*seekTableLength) = seconds;
+  fseek(fd, originPosition, SEEK_SET);
+}
--- a/src/aac/libfaad2/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-include ../../../extra.mk
-
-STATIC_LIB_NOINST = libfaad.a
-
-SRCS = bits.c cfft.c decoder.c drc.c \
-	drm_dec.c error.c filtbank.c \
-	ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c \
-	ps_dec.c ps_syntax.c \
-	pulse.c specrec.c syntax.c tns.c hcr.c huffman.c \
-	rvlc.c ssr.c ssr_fb.c ssr_ipqf.c common.c \
-	sbr_dct.c sbr_e_nf.c sbr_fbt.c sbr_hfadj.c sbr_hfgen.c \
-	sbr_huff.c sbr_qmf.c sbr_syntax.c sbr_tf_grid.c sbr_dec.c
-
-include ../../../buildsys.mk
-
-CPPFLAGS += -I../include -I../../.. -I.
-CFLAGS += $(PLUGIN_CFLAGS) -Wall
-
-LIBS += -lm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aac/libmp4.c	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,840 @@
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <string.h>
+#include <stdlib.h>
+#include "faad.h"
+#include "mp4ff.h"
+#include "tagging.h"
+
+#include "audacious/plugin.h"
+#include "audacious/output.h"
+#include "audacious/util.h"
+#include "audacious/vfs.h"
+#include "audacious/i18n.h"
+#include "audacious/strings.h"
+#include "audacious/main.h"
+#include "audacious/tuple.h"
+#include "audacious/tuple_formatter.h"
+
+#define MP4_VERSION VERSION
+
+#define SBR_DEC
+
+extern VFSFile *vfs_buffered_file_new_from_uri(gchar *uri);
+
+/*
+ * BUFFER_SIZE is the highest amount of memory that can be pulled.
+ * We use this for sanity checks, among other things, as mp4ff needs
+ * a labotomy sometimes.
+ */
+#define BUFFER_SIZE FAAD_MIN_STREAMSIZE*64
+
+/*
+ * AAC_MAGIC is the pattern that marks the beginning of an MP4 container.
+ */
+#define AAC_MAGIC     (unsigned char [4]) { 0xFF, 0xF9, 0x5C, 0x80 }
+
+static void        mp4_init(void);
+static void        mp4_about(void);
+static int         mp4_is_our_file(char *);
+static void        mp4_play(InputPlayback *);
+static void        mp4_stop(InputPlayback *);
+static void        mp4_pause(InputPlayback *, short);
+static void        mp4_seek(InputPlayback *, int);
+static void        mp4_cleanup(void);
+static void        mp4_get_song_title_len(char *filename, char **, int *);
+static Tuple*      mp4_get_song_tuple(char *);
+static int         mp4_is_our_fd(char *, VFSFile *);
+
+static gchar *fmts[] = { "m4a", "mp4", "aac", NULL };
+
+static void *   mp4_decode(void *);
+static gchar *  mp4_get_song_title(char *filename);
+gboolean        buffer_playing;
+
+InputPlugin mp4_ip =
+{
+    .description = "MP4 Audio Plugin",
+    .init = mp4_init,
+    .about = mp4_about,
+    .is_our_file = mp4_is_our_file,
+    .play_file = mp4_play,
+    .stop = mp4_stop,
+    .pause = mp4_pause,
+    .seek = mp4_seek,
+    .cleanup = mp4_cleanup,
+    .get_song_info = mp4_get_song_title_len,
+    .get_song_tuple = mp4_get_song_tuple,
+    .is_our_file_from_vfs = mp4_is_our_fd,
+    .vfs_extensions = fmts,
+};
+
+InputPlugin *mp4_iplist[] = { &mp4_ip, NULL };
+
+DECLARE_PLUGIN(mp4, NULL, NULL, mp4_iplist, NULL, NULL, NULL, NULL, NULL);
+
+typedef struct  _mp4cfg
+{
+#define FILE_UNKNOWN    0
+#define FILE_MP4        1
+#define FILE_AAC        2
+    gshort        file_type;
+} Mp4Config;
+
+static Mp4Config mp4cfg;
+static GThread   *decodeThread;
+GStaticMutex     mutex = G_STATIC_MUTEX_INIT;
+static int       seekPosition = -1;
+
+void getMP4info(char*);
+int getAACTrack(mp4ff_t *);
+
+static guint32 mp4_read_callback(void *data, void *buffer, guint32 len)
+{
+    if (data == NULL || buffer == NULL)
+        return -1;
+
+    return vfs_fread(buffer, 1, len, (VFSFile *) data);
+}
+
+static guint32 mp4_seek_callback(void *data, guint64 pos)
+{
+    if (data == NULL)
+        return -1;
+
+    return vfs_fseek((VFSFile *) data, pos, SEEK_SET);
+}
+
+static void mp4_init(void)
+{
+    mp4cfg.file_type = FILE_UNKNOWN;
+    seekPosition = -1;
+    return;
+}
+
+static void mp4_play(InputPlayback *playback)
+{
+    buffer_playing = TRUE;
+    playback->playing = 1; //XXX should acquire lock?
+    decodeThread = g_thread_self();
+    playback->set_pb_ready(playback);
+    mp4_decode(playback);
+}
+
+static void mp4_stop(InputPlayback *playback)
+{
+    if (buffer_playing)
+    {
+        buffer_playing = FALSE;
+        playback->playing = 0; //XXX should acquire lock?
+        g_thread_join(decodeThread);
+        playback->output->close_audio();
+    }
+}
+
+/*
+ * These routines are derived from MPlayer.
+ */
+
+/// \param srate (out) sample rate
+/// \param num (out) number of audio frames in this ADTS frame
+/// \return size of the ADTS frame in bytes
+/// aac_parse_frames needs a buffer at least 8 bytes long
+int aac_parse_frame(guchar *buf, int *srate, int *num)
+{
+        int i = 0, sr, fl = 0, id;
+        static int srates[] = {96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 0, 0, 0};
+
+        if((buf[i] != 0xFF) || ((buf[i+1] & 0xF6) != 0xF0))
+                return 0;
+
+        id = (buf[i+1] >> 3) & 0x01;    //id=1 mpeg2, 0: mpeg4
+        sr = (buf[i+2] >> 2)  & 0x0F;
+        if(sr > 11)
+                return 0;
+        *srate = srates[sr];
+
+        fl = ((buf[i+3] & 0x03) << 11) | (buf[i+4] << 3) | ((buf[i+5] >> 5) & 0x07);
+        *num = (buf[i+6] & 0x02) + 1;
+
+        return fl;
+}
+
+static gboolean parse_aac_stream(VFSFile *stream)
+{
+        int cnt = 0, c, len, srate, num;
+        off_t init, probed;
+	static guchar buf[8];
+
+        init = probed = vfs_ftell(stream);
+        while(probed-init <= 32768 && cnt < 8)
+        {
+                c = 0;
+                while(probed-init <= 32768 && c != 0xFF)
+                {
+                        c = vfs_getc(stream);
+                        if(c < 0)
+                                return FALSE;
+	                probed = vfs_ftell(stream);
+                }
+                buf[0] = 0xFF;
+                if(vfs_fread(&(buf[1]), 1, 7, stream) < 7)
+                        return FALSE;
+
+                len = aac_parse_frame(buf, &srate, &num);
+                if(len > 0)
+                {
+                        cnt++;
+                        vfs_fseek(stream, len - 8, SEEK_CUR);
+                }
+                probed = vfs_ftell(stream);
+        }
+
+        if(cnt < 8)
+                return FALSE;
+
+        return TRUE;
+}
+
+static int aac_probe(unsigned char *buffer, int len)
+{
+  int i = 0, pos = 0;
+#ifdef DEBUG
+  g_print("\nAAC_PROBE: %d bytes\n", len);
+#endif
+  while(i <= len-4) {
+    if(
+       ((buffer[i] == 0xff) && ((buffer[i+1] & 0xf6) == 0xf0)) ||
+       (buffer[i] == 'A' && buffer[i+1] == 'D' && buffer[i+2] == 'I' && buffer[i+3] == 'F')
+    ) {
+      pos = i;
+      break;
+    }
+#ifdef DEBUG
+    g_print("AUDIO PAYLOAD: %x %x %x %x\n",
+	buffer[i], buffer[i+1], buffer[i+2], buffer[i+3]);
+#endif
+    i++;
+  }
+#ifdef DEBUG
+  g_print("\nAAC_PROBE: ret %d\n", pos);
+#endif
+  return pos;
+}
+
+static int mp4_is_our_file(char *filename)
+{
+  VFSFile *file;
+  gchar* extension;
+  gchar magic[8];
+
+  memset(magic, '\0', 8);
+
+  extension = strrchr(filename, '.');
+  if ((file = vfs_fopen(filename, "rb"))) {
+      vfs_fread(magic, 1, 8, file);
+      vfs_rewind(file);
+      if (parse_aac_stream(file) == TRUE) {
+           vfs_fclose(file);
+           return TRUE;
+      }
+      if (!memcmp(magic, "ID3", 3)) {       // ID3 tag bolted to the front, obfuscated magic bytes
+           vfs_fclose(file);
+           if (extension &&(
+          !strcasecmp(extension, ".mp4") || // official extension
+          !strcasecmp(extension, ".m4a") || // Apple mp4 extension
+          !strcasecmp(extension, ".aac")    // old MPEG2/4-AAC extension
+       ))
+          return 1;
+       else
+          return 0;
+      }
+      if (!memcmp(&magic[4], "ftyp", 4)) {
+           vfs_fclose(file);
+           return 1;
+      }
+      vfs_fclose(file);
+  }
+  return 0;
+}
+
+static int mp4_is_our_fd(char *filename, VFSFile* file)
+{
+  gchar* extension;
+  gchar magic[8];
+
+  extension = strrchr(filename, '.');
+  vfs_fread(magic, 1, 8, file);
+  vfs_rewind(file);
+  if (parse_aac_stream(file) == TRUE)
+    return 1;
+  if (!memcmp(&magic[4], "ftyp", 4))
+    return 1;
+  if (!memcmp(magic, "ID3", 3)) {       // ID3 tag bolted to the front, obfuscated magic bytes
+    if (extension &&(
+      !strcasecmp(extension, ".mp4") || // official extension
+      !strcasecmp(extension, ".m4a") || // Apple mp4 extension
+      !strcasecmp(extension, ".aac")    // old MPEG2/4-AAC extension
+    ))
+      return 1;
+    else
+      return 0;
+  }
+  return 0;
+}
+
+static void mp4_about(void)
+{
+    static GtkWidget *aboutbox = NULL;
+    gchar *about_text;
+
+    about_text = g_strjoin ("", _("Using libfaad2-"), FAAD2_VERSION,
+				_(" for decoding.\n"
+				  "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Nero AG, www.nero.com\n"
+				  "Copyright (c) 2005-2006 Audacious team"), NULL);
+
+    aboutbox = audacious_info_dialog(_("About MP4 AAC player plugin"),
+				 about_text,
+				 _("Ok"), FALSE, NULL, NULL);
+
+    g_signal_connect(G_OBJECT(aboutbox), "destroy",
+                     G_CALLBACK(gtk_widget_destroyed), &aboutbox);
+    g_free(about_text);
+}
+
+static void mp4_pause(InputPlayback *playback, short flag)
+{
+    playback->output->pause(flag);
+}
+
+static void mp4_seek(InputPlayback *data, int time)
+{
+    seekPosition = time;
+    while(buffer_playing && seekPosition != -1)
+        g_usleep(10000);
+}
+
+static void mp4_cleanup(void)
+{
+}
+
+static Tuple *mp4_get_song_tuple_base(char *filename, VFSFile *mp4fh)
+{
+    mp4ff_callback_t *mp4cb = g_malloc0(sizeof(mp4ff_callback_t));
+    mp4ff_t *mp4file;
+    Tuple *ti = tuple_new_from_filename(filename);
+
+    /* check if this file is an ADTS stream, if so return a blank tuple */
+    if (parse_aac_stream(mp4fh))
+    {
+        g_free(mp4cb);
+
+        tuple_associate_string(ti, FIELD_TITLE, NULL, vfs_get_metadata(mp4fh, "track-name"));
+        tuple_associate_string(ti, FIELD_ALBUM, NULL, vfs_get_metadata(mp4fh, "stream-name"));
+
+        tuple_associate_string(ti, FIELD_CODEC, NULL, "Advanced Audio Coding (AAC)");
+        tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
+
+        vfs_fclose(mp4fh);
+        return ti;
+    }
+
+    vfs_rewind(mp4fh);
+
+    mp4cb->read = mp4_read_callback;
+    mp4cb->seek = mp4_seek_callback;
+    mp4cb->user_data = mp4fh;
+
+    if (!(mp4file = mp4ff_open_read(mp4cb))) {
+        g_free(mp4cb);
+        vfs_fclose(mp4fh);
+    } else {
+        gint mp4track= getAACTrack(mp4file);
+        gint numSamples = mp4ff_num_samples(mp4file, mp4track);
+        guint framesize = 1024;
+        guint samplerate = 0;
+        guchar channels = 0;
+        gint msDuration;
+        mp4AudioSpecificConfig mp4ASC;
+        gchar *tmpval;
+        guchar *buffer = NULL;
+        guint bufferSize = 0;
+        faacDecHandle decoder;
+
+        if (mp4track == -1)
+            return NULL;
+
+        decoder = faacDecOpen();
+        mp4ff_get_decoder_config(mp4file, mp4track, &buffer, &bufferSize);
+
+        if ( !buffer ) {
+            faacDecClose(decoder);
+            return FALSE;
+        }
+        if ( faacDecInit2(decoder, buffer, bufferSize,
+                  &samplerate, &channels) < 0 ) {
+            faacDecClose(decoder);
+
+            return FALSE;
+        }
+
+        /* Add some hacks for SBR profile */
+        if (AudioSpecificConfig(buffer, bufferSize, &mp4ASC) >= 0) {
+            if (mp4ASC.frameLengthFlag == 1) framesize = 960;
+            if (mp4ASC.sbr_present_flag == 1) framesize *= 2;
+        }
+
+        g_free(buffer);
+
+        faacDecClose(decoder);
+
+        msDuration = ((float)numSamples * (float)(framesize - 1.0)/(float)samplerate) * 1000;
+        tuple_associate_int(ti, FIELD_LENGTH, NULL, msDuration);
+
+        mp4ff_meta_get_title(mp4file, &tmpval);
+        if (tmpval)
+        {
+            tuple_associate_string(ti, FIELD_TITLE, NULL, tmpval);
+            free(tmpval);
+        }
+
+        mp4ff_meta_get_album(mp4file, &tmpval);
+        if (tmpval)
+        {
+            tuple_associate_string(ti, FIELD_ALBUM, NULL, tmpval);
+            free(tmpval);
+        }
+
+        mp4ff_meta_get_artist(mp4file, &tmpval);
+        if (tmpval)
+        {
+            tuple_associate_string(ti, FIELD_ARTIST, NULL, tmpval);
+            free(tmpval);
+        }
+
+        mp4ff_meta_get_genre(mp4file, &tmpval);
+        if (tmpval)
+        {
+            tuple_associate_string(ti, FIELD_GENRE, NULL, tmpval);
+            free(tmpval);
+        }
+
+        mp4ff_meta_get_date(mp4file, &tmpval);
+        if (tmpval)
+        {
+            tuple_associate_int(ti, FIELD_YEAR, NULL, atoi(tmpval));
+            free(tmpval);
+        }
+
+        tuple_associate_string(ti, FIELD_CODEC, NULL, "Advanced Audio Coding (AAC)");
+        tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
+
+        free (mp4cb);
+        vfs_fclose(mp4fh);
+    }
+
+    return ti;
+}
+
+static Tuple *mp4_get_song_tuple(char *filename)
+{
+    Tuple *tuple;
+    VFSFile *mp4fh;
+    gboolean remote = str_has_prefix_nocase(filename, "http:") ||
+	              str_has_prefix_nocase(filename, "https:");
+
+    mp4fh = remote ? vfs_buffered_file_new_from_uri(filename) : vfs_fopen(filename, "rb");
+
+    tuple = mp4_get_song_tuple_base(filename, mp4fh);
+
+    return tuple;
+}
+
+static void mp4_get_song_title_len(char *filename, char **title, int *len)
+{
+    (*title) = mp4_get_song_title(filename);
+    (*len) = -1;
+}
+
+static gchar   *mp4_get_song_title(char *filename)
+{
+    gchar *title;
+    Tuple *tuple = mp4_get_song_tuple(filename);
+
+    title = tuple_formatter_make_title_string(tuple, get_gentitle_format());
+
+    tuple_free(tuple);
+
+    return title;
+}
+
+static int my_decode_mp4( InputPlayback *playback, char *filename, mp4ff_t *mp4file )
+{
+    // We are reading an MP4 file
+    gint mp4track= getAACTrack(mp4file);
+    faacDecHandle   decoder;
+    mp4AudioSpecificConfig mp4ASC;
+    guchar      *buffer = NULL;
+    guint       bufferSize = 0;
+    guint       samplerate = 0;
+    guchar      channels = 0;
+    gulong      msDuration;
+    guint       numSamples;
+    gulong      sampleID = 1;
+    guint       framesize = 1024;
+
+    if (mp4track < 0)
+    {
+        g_print("Unsupported Audio track type\n");
+        return TRUE;
+    }
+
+    gchar *xmmstitle = NULL;
+    xmmstitle = mp4_get_song_title(filename);
+    if(xmmstitle == NULL)
+        xmmstitle = g_strdup(filename);
+
+    decoder = faacDecOpen();
+    mp4ff_get_decoder_config(mp4file, mp4track, &buffer, &bufferSize);
+    if ( !buffer ) {
+        faacDecClose(decoder);
+        return FALSE;
+    }
+    if ( faacDecInit2(decoder, buffer, bufferSize,
+              &samplerate, &channels) < 0 ) {
+        faacDecClose(decoder);
+
+        return FALSE;
+    }
+
+    /* Add some hacks for SBR profile */
+    if (AudioSpecificConfig(buffer, bufferSize, &mp4ASC) >= 0) {
+        if (mp4ASC.frameLengthFlag == 1) framesize = 960;
+        if (mp4ASC.sbr_present_flag == 1) framesize *= 2;
+    }
+
+    g_free(buffer);
+    if( !channels ) {
+        faacDecClose(decoder);
+
+        return FALSE;
+    }
+    numSamples = mp4ff_num_samples(mp4file, mp4track);
+    msDuration = ((float)numSamples * (float)(framesize - 1.0)/(float)samplerate) * 1000;
+    playback->output->open_audio(FMT_S16_NE, samplerate, channels);
+    playback->output->flush(0);
+
+    mp4_ip.set_info(xmmstitle, msDuration,
+            mp4ff_get_avg_bitrate( mp4file, mp4track ),
+            samplerate,channels);
+
+    while ( buffer_playing ) {
+        void*           sampleBuffer;
+        faacDecFrameInfo    frameInfo;
+        gint            rc;
+
+        /* Seek if seek position has changed */
+        if ( seekPosition!=-1 ) {
+            sampleID =  (float)seekPosition*(float)samplerate/(float)(framesize - 1.0);
+            playback->output->flush(seekPosition*1000);
+            seekPosition = -1;
+        }
+
+        /* Otherwise continue playing */
+        buffer=NULL;
+        bufferSize=0;
+
+        /* If we've run to the end of the file, we're done. */
+        if(sampleID >= numSamples){
+            /* Finish playing before we close the
+               output. */
+            while ( playback->output->buffer_playing() ) {
+                g_usleep(10000);
+            }
+
+            playback->output->flush(seekPosition*1000);
+            playback->output->close_audio();
+            faacDecClose(decoder);
+
+            g_static_mutex_lock(&mutex);
+            buffer_playing = FALSE;
+            playback->playing = 0;
+            g_static_mutex_unlock(&mutex);
+            return FALSE;
+        }
+        rc= mp4ff_read_sample(mp4file, mp4track,
+                  sampleID++, &buffer, &bufferSize);
+
+        /*g_print(":: %d/%d\n", sampleID-1, numSamples);*/
+
+        /* If we can't read the file, we're done. */
+        if((rc == 0) || (buffer== NULL) || (bufferSize == 0) || (bufferSize > BUFFER_SIZE)){
+            g_print("MP4: read error\n");
+            sampleBuffer = NULL;
+            sampleID=0;
+            playback->output->buffer_free();
+            playback->output->close_audio();
+
+            faacDecClose(decoder);
+
+            return FALSE;
+        }
+
+/*          g_print(" :: %d/%d\n", bufferSize, BUFFER_SIZE); */
+
+        sampleBuffer= faacDecDecode(decoder,
+                        &frameInfo,
+                        buffer,
+                        bufferSize);
+
+        /* If there was an error decoding, we're done. */
+        if(frameInfo.error > 0){
+            g_print("MP4: %s\n",
+                faacDecGetErrorMessage(frameInfo.error));
+            playback->output->close_audio();
+            faacDecClose(decoder);
+
+            return FALSE;
+        }
+        if(buffer){
+            g_free(buffer);
+            buffer=NULL;
+            bufferSize=0;
+        }
+        if (buffer_playing == FALSE)
+        {
+            playback->output->close_audio();
+            return FALSE;
+        }
+        produce_audio(playback->output->written_time(),
+                   FMT_S16_NE,
+                   channels,
+                   frameInfo.samples<<1,
+                   sampleBuffer, &buffer_playing);
+    }
+
+    playback->output->close_audio();
+    faacDecClose(decoder);
+
+    return TRUE;
+}
+
+void my_decode_aac( InputPlayback *playback, char *filename, VFSFile *file )
+{
+    faacDecHandle   decoder = 0;
+    guchar      streambuffer[BUFFER_SIZE];
+    gulong      bufferconsumed = 0;
+    gulong      samplerate = 0;
+    guchar      channels = 0;
+    gulong      buffervalid = 0;
+    gchar       *ttemp = NULL, *stemp = NULL;
+    gchar       *temp = g_strdup(filename);
+    gchar       *xmmstitle = NULL;
+    gboolean    remote = str_has_prefix_nocase(filename, "http:") ||
+			 str_has_prefix_nocase(filename, "https:");
+
+    vfs_rewind(file);
+    if((decoder = faacDecOpen()) == NULL){
+        g_print("AAC: Open Decoder Error\n");
+        vfs_fclose(file);
+        buffer_playing = FALSE;
+        playback->playing = 0;
+        g_static_mutex_unlock(&mutex);
+        return;
+    }
+    if((buffervalid = vfs_fread(streambuffer, 1, BUFFER_SIZE, file))==0){
+        g_print("AAC: Error reading file\n");
+        vfs_fclose(file);
+        buffer_playing = FALSE;
+        playback->playing = 0;
+        faacDecClose(decoder);
+        g_static_mutex_unlock(&mutex);
+        return;
+    }
+    if(!strncmp((char*)streambuffer, "ID3", 3)){
+        gint size = 0;
+
+        vfs_fseek(file, 0, SEEK_SET);
+        size = (streambuffer[6]<<21) | (streambuffer[7]<<14) |
+		(streambuffer[8]<<7) | streambuffer[9];
+        size+=10;
+        vfs_fread(streambuffer, 1, size, file);
+        buffervalid = vfs_fread(streambuffer, 1, BUFFER_SIZE, file);
+    }
+
+    ttemp = vfs_get_metadata(file, "stream-name");
+
+    if (ttemp != NULL)
+    {
+        xmmstitle = g_strdup(ttemp);
+        g_free(ttemp);
+    }
+    else
+        xmmstitle = g_strdup(g_basename(temp));
+
+    bufferconsumed = aac_probe(streambuffer, buffervalid);
+    if(bufferconsumed) {
+      buffervalid -= bufferconsumed;
+      memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid);
+      buffervalid += vfs_fread(&streambuffer[buffervalid], 1,
+                     BUFFER_SIZE-buffervalid, file);
+      bufferconsumed = 0;
+    }
+
+    bufferconsumed = faacDecInit(decoder,
+                     streambuffer,
+                     buffervalid,
+                     &samplerate,
+                     &channels);
+#ifdef DEBUG
+    g_print("samplerate: %d, channels: %d\n", samplerate, channels);
+#endif
+    if(playback->output->open_audio(FMT_S16_NE,samplerate,channels) == FALSE){
+        g_print("AAC: Output Error\n");
+        faacDecClose(decoder);
+        vfs_fclose(file);
+        playback->output->close_audio();
+        g_free(xmmstitle);
+        buffer_playing = FALSE;
+        playback->playing = 0;
+        g_static_mutex_unlock(&mutex);
+        return;
+    }
+
+    mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
+    playback->output->flush(0);
+
+    while(buffer_playing && buffervalid > 0 && streambuffer != NULL)
+    {
+        faacDecFrameInfo    finfo;
+        unsigned long   samplesdecoded;
+        char*       sample_buffer = NULL;
+
+        if(bufferconsumed > 0)
+        {
+            buffervalid -= bufferconsumed;
+            memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid);
+            buffervalid += vfs_fread(&streambuffer[buffervalid], 1,
+                         BUFFER_SIZE-buffervalid, file);
+            bufferconsumed = 0;
+
+            ttemp = vfs_get_metadata(file, "stream-name");
+
+            if (ttemp != NULL)
+                stemp = vfs_get_metadata(file, "track-name");
+
+            if (stemp != NULL)
+            {
+                static gchar *ostmp = NULL;
+
+                if (ostmp == NULL || g_ascii_strcasecmp(stemp, ostmp))
+                {
+                    if (xmmstitle != NULL)
+                        g_free(xmmstitle);
+
+                    xmmstitle = g_strdup_printf("%s (%s)", stemp, ttemp);
+
+                    if (ostmp != NULL)
+                        g_free(ostmp);
+
+                    ostmp = stemp;
+
+                    mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
+                }
+            }
+
+            g_free(ttemp);
+            ttemp = NULL;
+        }
+
+        sample_buffer = faacDecDecode(decoder, &finfo, streambuffer, buffervalid);
+
+        bufferconsumed += finfo.bytesconsumed;
+        samplesdecoded = finfo.samples;
+
+        if(finfo.error > 0 && remote != FALSE)
+        {
+	    buffervalid--;
+            memmove(streambuffer, &streambuffer[1], buffervalid);
+            if(buffervalid < BUFFER_SIZE) {
+               buffervalid +=
+                 vfs_fread(&streambuffer[buffervalid], 1, BUFFER_SIZE-buffervalid, file);
+	    }
+            bufferconsumed = aac_probe(streambuffer, buffervalid);
+            if(bufferconsumed) {
+               buffervalid -= bufferconsumed;
+               memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid);
+               bufferconsumed = 0;
+            }
+            continue;
+        }
+
+        if((samplesdecoded <= 0) && !sample_buffer){
+#ifdef DEBUG
+            g_print("AAC: decoded %d samples!\n", samplesdecoded);
+#endif
+            continue;
+        }
+
+        produce_audio(playback->output->written_time(),
+                   FMT_S16_LE, channels,
+                   samplesdecoded<<1, sample_buffer, &buffer_playing);
+    }
+    playback->output->buffer_free();
+    playback->output->close_audio();
+    buffer_playing = FALSE;
+    playback->playing = 0;
+    faacDecClose(decoder);
+    g_free(xmmstitle);
+    vfs_fclose(file);
+    seekPosition = -1;
+
+    buffer_playing = FALSE;
+    playback->playing = 0;
+    g_static_mutex_unlock(&mutex);
+}
+
+static void *mp4_decode( void *args )
+{
+    mp4ff_callback_t *mp4cb = g_malloc0(sizeof(mp4ff_callback_t));
+    VFSFile *mp4fh;
+    mp4ff_t *mp4file;
+    gboolean ret;
+
+    InputPlayback *playback = args;
+    char *filename = playback->filename;
+
+    mp4fh = vfs_buffered_file_new_from_uri(filename);
+
+    g_static_mutex_lock(&mutex);
+    seekPosition= -1;
+    buffer_playing= TRUE;
+    g_static_mutex_unlock(&mutex);
+
+    if (mp4fh == NULL)
+        return NULL;
+
+    ret = parse_aac_stream(mp4fh);
+
+    if( ret == TRUE )
+        vfs_fseek(mp4fh, 0, SEEK_SET);
+    else {
+        vfs_fclose(mp4fh);
+        mp4fh = vfs_fopen(filename, "rb");
+    }
+
+    mp4cb->read = mp4_read_callback;
+    mp4cb->seek = mp4_seek_callback;
+    mp4cb->user_data = mp4fh;
+
+    mp4file= mp4ff_open_read(mp4cb);
+
+    if( ret == TRUE ) {
+        g_free(mp4cb);
+        my_decode_aac( playback, filename, mp4fh );
+    }
+    else
+        my_decode_mp4( playback, filename, mp4file );
+
+    return NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aac/m4a.xpm	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,958 @@
+/* XPM */
+static char * m4a_xpm[] = {
+"48 52 903 2",
+"  	c None",
+". 	c #000000",
+"+ 	c #010100",
+"@ 	c #020201",
+"# 	c #030201",
+"$ 	c #232323",
+"% 	c #1F1F1F",
+"& 	c #DADADA",
+"* 	c #FFFFFF",
+"= 	c #F6F6F6",
+"- 	c #CFCFCF",
+"; 	c #707070",
+"> 	c #FFFFFE",
+", 	c #FEFEFE",
+"' 	c #FBFBFB",
+") 	c #EDEDED",
+"! 	c #C0C0C0",
+"~ 	c #FFFEFE",
+"{ 	c #F8F5F2",
+"] 	c #EBE7E1",
+"^ 	c #ECEDE8",
+"/ 	c #ECEFEA",
+"( 	c #E6E9E4",
+"_ 	c #CED0CE",
+": 	c #BCBFBC",
+"< 	c #F0F0EF",
+"[ 	c #FEFEFD",
+"} 	c #F7F7F7",
+"| 	c #D7D7D7",
+"1 	c #F1F1F1",
+"2 	c #B7B7B7",
+"3 	c #EAEDEA",
+"4 	c #8EA299",
+"5 	c #697D70",
+"6 	c #546459",
+"7 	c #404D44",
+"8 	c #2C352F",
+"9 	c #4E5649",
+"0 	c #D6D8D3",
+"a 	c #D2D2D2",
+"b 	c #AEAEAE",
+"c 	c #070707",
+"d 	c #FCFCFB",
+"e 	c #6D7C75",
+"f 	c #5A5D4C",
+"g 	c #6B735F",
+"h 	c #6E7B63",
+"i 	c #5B6052",
+"j 	c #4A5042",
+"k 	c #CED0CB",
+"l 	c #FEFDFD",
+"m 	c #FDFDFD",
+"n 	c #B8B8B8",
+"o 	c #DCDCDC",
+"p 	c #A4A4A3",
+"q 	c #0E0E0E",
+"r 	c #8A928F",
+"s 	c #6A7F68",
+"t 	c #4D564E",
+"u 	c #4E5950",
+"v 	c #585E57",
+"w 	c #333530",
+"x 	c #9D9C9B",
+"y 	c #FCFDFE",
+"z 	c #FDFEFE",
+"A 	c #FDFDFE",
+"B 	c #F5F5F4",
+"C 	c #B5B5B5",
+"D 	c #F9F9F9",
+"E 	c #FCFCFC",
+"F 	c #CBCBCB",
+"G 	c #A5A5A5",
+"H 	c #CECDCB",
+"I 	c #788976",
+"J 	c #C6BDBB",
+"K 	c #E2E2E2",
+"L 	c #E2E0DF",
+"M 	c #656A65",
+"N 	c #4A4B49",
+"O 	c #EAEDF1",
+"P 	c #CED5DD",
+"Q 	c #DBE0E9",
+"R 	c #DDE1E9",
+"S 	c #D3D7DD",
+"T 	c #D9DCE1",
+"U 	c #F4F4F4",
+"V 	c #ACACAC",
+"W 	c #ECECEC",
+"X 	c #C3C3C3",
+"Y 	c #C2C2C2",
+"Z 	c #C9C9C8",
+"` 	c #A8A8A8",
+" .	c #F6F8F6",
+"..	c #A7ADA5",
+"+.	c #6D7F71",
+"@.	c #ECECE9",
+"#.	c #FDFDFC",
+"$.	c #939C9A",
+"%.	c #1B2321",
+"&.	c #FCFBFA",
+"*.	c #F2F6F9",
+"=.	c #B4BFCC",
+"-.	c #7E8A9B",
+";.	c #515B6F",
+">.	c #50596A",
+",.	c #737D8D",
+"'.	c #BEC6CE",
+").	c #C4CBD5",
+"!.	c #BFC5D1",
+"~.	c #F1F2F4",
+"{.	c #F4F4F3",
+"].	c #ABABAB",
+"^.	c #515151",
+"/.	c #474747",
+"(.	c #464645",
+"_.	c #464646",
+":.	c #5D5D5C",
+"<.	c #A9A9A9",
+"[.	c #FAFAF9",
+"}.	c #EDEFF0",
+"|.	c #F1F5F5",
+"1.	c #636E62",
+"2.	c #636E5F",
+"3.	c #D4D5D3",
+"4.	c #FBF7F4",
+"5.	c #9BA595",
+"6.	c #657366",
+"7.	c #001514",
+"8.	c #FCFAF8",
+"9.	c #FDFCFC",
+"0.	c #FBF9F7",
+"a.	c #E3E6EA",
+"b.	c #9DACBF",
+"c.	c #515A6D",
+"d.	c #111828",
+"e.	c #131B29",
+"f.	c #0F1A2B",
+"g.	c #081125",
+"h.	c #0D1328",
+"i.	c #C2C9D1",
+"j.	c #C5CBD4",
+"k.	c #A6AEBB",
+"l.	c #F6F6F7",
+"m.	c #FAFAFA",
+"n.	c #F2F2F2",
+"o.	c #F3F3F3",
+"p.	c #AAAAAA",
+"q.	c #A0A09F",
+"r.	c #8A8A8A",
+"s.	c #7A7A7A",
+"t.	c #6C6C6C",
+"u.	c #454545",
+"v.	c #ABB3AF",
+"w.	c #A8B6A3",
+"x.	c #D0DBD0",
+"y.	c #F2F3F0",
+"z.	c #DEE1E0",
+"A.	c #66736A",
+"B.	c #354336",
+"C.	c #556254",
+"D.	c #C5C7C6",
+"E.	c #F2EDEA",
+"F.	c #CADAD9",
+"G.	c #9BA893",
+"H.	c #1B3128",
+"I.	c #FCF4EF",
+"J.	c #FDFBF9",
+"K.	c #DDDFE4",
+"L.	c #97A3B4",
+"M.	c #374152",
+"N.	c #0D131C",
+"O.	c #1C2026",
+"P.	c #262C3A",
+"Q.	c #242E43",
+"R.	c #202D41",
+"S.	c #172538",
+"T.	c #121523",
+"U.	c #BABCC3",
+"V.	c #9DA6B5",
+"W.	c #BABEC4",
+"X.	c #F8F8F7",
+"Y.	c #E7E7E7",
+"Z.	c #C6C6C5",
+"`.	c #BABAB9",
+" +	c #E7E9E9",
+".+	c #63736C",
+"++	c #464945",
+"@+	c #5F7361",
+"#+	c #CED4C3",
+"$+	c #DBDEDA",
+"%+	c #979999",
+"&+	c #404342",
+"*+	c #606E6B",
+"=+	c #E5E5E3",
+"-+	c #4B5F52",
+";+	c #455845",
+">+	c #2D362F",
+",+	c #FCFAF9",
+"'+	c #E4E4E7",
+")+	c #97A8B9",
+"!+	c #343C4A",
+"~+	c #13181E",
+"{+	c #1B2027",
+"]+	c #1D232B",
+"^+	c #1F2632",
+"/+	c #212A3C",
+"(+	c #242F45",
+"_+	c #2A374D",
+":+	c #121C2F",
+"<+	c #525A67",
+"[+	c #D9DDE5",
+"}+	c #737C8C",
+"|+	c #EAEBEB",
+"1+	c #F7F7F6",
+"2+	c #F6F6F5",
+"3+	c #F5F5F5",
+"4+	c #EDEDEB",
+"5+	c #FBFBFA",
+"6+	c #6C8175",
+"7+	c #778673",
+"8+	c #121613",
+"9+	c #4C504A",
+"0+	c #8FA695",
+"a+	c #E2DCD8",
+"b+	c #E5E6E7",
+"c+	c #FBFAF9",
+"d+	c #CAC6C1",
+"e+	c #847F79",
+"f+	c #FCFAFA",
+"g+	c #ECE9E9",
+"h+	c #A6B1C4",
+"i+	c #232B37",
+"j+	c #12171E",
+"k+	c #191F27",
+"l+	c #1D222B",
+"m+	c #1E242B",
+"n+	c #1E252F",
+"o+	c #202937",
+"p+	c #232F44",
+"q+	c #283853",
+"r+	c #253046",
+"s+	c #0A1526",
+"t+	c #D5D7DB",
+"u+	c #727D90",
+"v+	c #CFD0D2",
+"w+	c #B1B1B1",
+"x+	c #99A597",
+"y+	c #7B9173",
+"z+	c #65705D",
+"A+	c #1F201B",
+"B+	c #58655E",
+"C+	c #F3F2F1",
+"D+	c #AAB3C1",
+"E+	c #525C6D",
+"F+	c #0A0F17",
+"G+	c #1C2129",
+"H+	c #1E242A",
+"I+	c #1E242C",
+"J+	c #1F232D",
+"K+	c #232E41",
+"L+	c #2B3855",
+"M+	c #2C3B57",
+"N+	c #070D1F",
+"O+	c #A3ABB6",
+"P+	c #828EA0",
+"Q+	c #B9BCC2",
+"R+	c #F3F3F2",
+"S+	c #F1EFEC",
+"T+	c #72886D",
+"U+	c #4E5849",
+"V+	c #748268",
+"W+	c #808080",
+"X+	c #D6D9DE",
+"Y+	c #5E6A7A",
+"Z+	c #121621",
+"`+	c #161D26",
+" @	c #1D242C",
+".@	c #1F242B",
+"+@	c #1E2427",
+"@@	c #212C3F",
+"#@	c #283552",
+"$@	c #2F405D",
+"%@	c #0E162B",
+"&@	c #59657B",
+"*@	c #8A98AA",
+"=@	c #AFB4BC",
+"-@	c #F2F2F1",
+";@	c #7D9074",
+">@	c #494949",
+",@	c #676D65",
+"'@	c #C8CBC7",
+")@	c #818B9B",
+"!@	c #1B232F",
+"~@	c #0F151F",
+"{@	c #1B212B",
+"]@	c #1E232D",
+"^@	c #20252C",
+"/@	c #24272C",
+"(@	c #1F2429",
+"_@	c #1C2228",
+":@	c #1F2A3C",
+"<@	c #1F2A40",
+"[@	c #25344E",
+"}@	c #314464",
+"|@	c #15223A",
+"1@	c #34445E",
+"2@	c #939FB3",
+"3@	c #ACB2BC",
+"4@	c #F1F1F0",
+"5@	c #ECEEEB",
+"6@	c #B8BCB7",
+"7@	c #647C65",
+"8@	c #797E78",
+"9@	c #C4C3C2",
+"0@	c #919191",
+"a@	c #DCE3EA",
+"b@	c #242C3D",
+"c@	c #0B101C",
+"d@	c #1A212A",
+"e@	c #1F242C",
+"f@	c #21252C",
+"g@	c #222629",
+"h@	c #1C232A",
+"i@	c #212B3D",
+"j@	c #33415B",
+"k@	c #27344B",
+"l@	c #212F47",
+"m@	c #374A68",
+"n@	c #1A2840",
+"o@	c #34445F",
+"p@	c #96A3B5",
+"q@	c #B3B7C0",
+"r@	c #F2F2F0",
+"s@	c #F0F0F0",
+"t@	c #E2E7E2",
+"u@	c #939E92",
+"v@	c #50644E",
+"w@	c #3D443E",
+"x@	c #D4D2CF",
+"y@	c #7F8898",
+"z@	c #020A14",
+"A@	c #171E28",
+"B@	c #1C222A",
+"C@	c #1E232B",
+"D@	c #1F242D",
+"E@	c #1F2228",
+"F@	c #1D2328",
+"G@	c #283449",
+"H@	c #4A5C7B",
+"I@	c #697D98",
+"J@	c #4D5D79",
+"K@	c #1F2D45",
+"L@	c #394A6B",
+"M@	c #1B2943",
+"N@	c #425371",
+"O@	c #95A3B5",
+"P@	c #B8BDC2",
+"Q@	c #EFEFEE",
+"R@	c #EFEFED",
+"S@	c #EDEEED",
+"T@	c #EFF0F0",
+"U@	c #F7FCF3",
+"V@	c #313F30",
+"W@	c #1C2120",
+"X@	c #C9CBC9",
+"Y@	c #F9F9F8",
+"Z@	c #E9EEF2",
+"`@	c #3C4352",
+" #	c #0C111D",
+".#	c #1E232E",
+"+#	c #1D212A",
+"@#	c #20242C",
+"##	c #1B1D20",
+"$#	c #263043",
+"%#	c #576886",
+"&#	c #8396B1",
+"*#	c #7A8FAD",
+"=#	c #677B99",
+"-#	c #28374F",
+";#	c #384A69",
+">#	c #182642",
+",#	c #5D708F",
+"'#	c #828FA3",
+")#	c #C5C7CB",
+"!#	c #F1F1EF",
+"~#	c #EEEEED",
+"{#	c #EEEEEC",
+"]#	c #9DA7A4",
+"^#	c #2A3B34",
+"/#	c #222725",
+"(#	c #80807E",
+"_#	c #EFEEEC",
+":#	c #F1F0EF",
+"<#	c #F4F3F2",
+"[#	c #F8F8F8",
+"}#	c #A8AFBB",
+"|#	c #0D1522",
+"1#	c #1A212E",
+"2#	c #1D232C",
+"3#	c #21252D",
+"4#	c #1E2327",
+"5#	c #171B20",
+"6#	c #637593",
+"7#	c #95A6BE",
+"8#	c #6D7F9C",
+"9#	c #617395",
+"0#	c #5A6E8B",
+"a#	c #2A354A",
+"b#	c #3D4E6D",
+"c#	c #1C2A46",
+"d#	c #748DAB",
+"e#	c #6D798A",
+"f#	c #DEDFE0",
+"g#	c #EEEEEE",
+"h#	c #EDEDEC",
+"i#	c #ECEAE7",
+"j#	c #ADB1B0",
+"k#	c #B5B9BA",
+"l#	c #F1F0F0",
+"m#	c #F9F8F8",
+"n#	c #F7F5F4",
+"o#	c #A7AAA4",
+"p#	c #B7BAB4",
+"q#	c #F7F6F6",
+"r#	c #ECEFF1",
+"s#	c #747F8E",
+"t#	c #0A121E",
+"u#	c #232C3A",
+"v#	c #1D232E",
+"w#	c #222932",
+"x#	c #1B1D21",
+"y#	c #1C273E",
+"z#	c #C1CFE1",
+"A#	c #8FA1B7",
+"B#	c #6D81A0",
+"C#	c #596D93",
+"D#	c #455674",
+"E#	c #293343",
+"F#	c #4A5C7D",
+"G#	c #304060",
+"H#	c #7690B8",
+"I#	c #5D6878",
+"J#	c #BBC0CC",
+"K#	c #ECECEB",
+"L#	c #F6F4F3",
+"M#	c #F4F1EF",
+"N#	c #F7F5F3",
+"O#	c #F9F8F7",
+"P#	c #BBBDB9",
+"Q#	c #4D5852",
+"R#	c #71746D",
+"S#	c #F0EAE7",
+"T#	c #DBDEE3",
+"U#	c #3E495B",
+"V#	c #1C2435",
+"W#	c #273041",
+"X#	c #283040",
+"Y#	c #293141",
+"Z#	c #262B38",
+"`#	c #1D212D",
+" $	c #4A5B77",
+".$	c #CFDBEB",
+"+$	c #7A8FAC",
+"@$	c #6C83A5",
+"#$	c #4D6389",
+"$$	c #35445E",
+"%$	c #404D60",
+"&$	c #506586",
+"*$	c #4F6687",
+"=$	c #6983AB",
+"-$	c #343E50",
+";$	c #4D5F7A",
+">$	c #B8C0CC",
+",$	c #F7F6F5",
+"'$	c #D2D6D3",
+")$	c #6C866F",
+"!$	c #5A715E",
+"~$	c #566758",
+"{$	c #B5C1B4",
+"]$	c #B2BAC8",
+"^$	c #273245",
+"/$	c #29354A",
+"($	c #323D53",
+"_$	c #364258",
+":$	c #333F52",
+"<$	c #343F52",
+"[$	c #28354A",
+"}$	c #6D7B92",
+"|$	c #ACBDD2",
+"1$	c #5B7297",
+"2$	c #495F87",
+"3$	c #3A4D6B",
+"4$	c #252F44",
+"5$	c #8292AC",
+"6$	c #586E94",
+"7$	c #6782A9",
+"8$	c #37404D",
+"9$	c #394860",
+"0$	c #475977",
+"a$	c #6E7E99",
+"b$	c #EBEBEA",
+"c$	c #BEC3BE",
+"d$	c #CFD1CE",
+"e$	c #F4F2F0",
+"f$	c #7D8F84",
+"g$	c #6A8667",
+"h$	c #D5D8D4",
+"i$	c #6B6B6B",
+"j$	c #9E9E9F",
+"k$	c #7A8EA8",
+"l$	c #2B374D",
+"m$	c #313E56",
+"n$	c #34425B",
+"o$	c #36425A",
+"p$	c #354257",
+"q$	c #39465D",
+"r$	c #3B4963",
+"s$	c #64738B",
+"t$	c #768CAD",
+"u$	c #354C72",
+"v$	c #2E3D5B",
+"w$	c #1D273A",
+"x$	c #3D4655",
+"y$	c #A7BACE",
+"z$	c #607799",
+"A$	c #617494",
+"B$	c #191B1B",
+"C$	c #445675",
+"D$	c #3A4A65",
+"E$	c #6C7A91",
+"F$	c #ECECEA",
+"G$	c #EAEAE9",
+"H$	c #EAEAE8",
+"I$	c #F7F6F4",
+"J$	c #B5B9B6",
+"K$	c #D7DCD9",
+"L$	c #7B8982",
+"M$	c #A9AEAD",
+"N$	c #517257",
+"O$	c #839284",
+"P$	c #DEDEDD",
+"Q$	c #D8D9D9",
+"R$	c #F3F2EE",
+"S$	c #51698C",
+"T$	c #313F55",
+"U$	c #35435B",
+"V$	c #36445A",
+"W$	c #35425C",
+"X$	c #37465D",
+"Y$	c #3D4A62",
+"Z$	c #516079",
+"`$	c #47536A",
+" %	c #354561",
+".%	c #212F46",
+"+%	c #0F1624",
+"@%	c #1A2231",
+"#%	c #99A5B7",
+"$%	c #97A8C3",
+"%%	c #6A7DA0",
+"&%	c #394559",
+"*%	c #1C1D26",
+"=%	c #35435C",
+"-%	c #344159",
+";%	c #8E96A2",
+">%	c #E9E9E8",
+",%	c #E9E9E7",
+"'%	c #F6F5F5",
+")%	c #70827F",
+"!%	c #C6D0C3",
+"~%	c #445344",
+"{%	c #637161",
+"]%	c #4B6C4C",
+"^%	c #CAC8C8",
+"/%	c #3D5271",
+"(%	c #3A4863",
+"_%	c #384862",
+":%	c #3E4C65",
+"<%	c #424D67",
+"[%	c #45536C",
+"}%	c #4D5A74",
+"|%	c #66768F",
+"1%	c #76869D",
+"2%	c #2A3243",
+"3%	c #151A27",
+"4%	c #252C3A",
+"5%	c #B2BBCE",
+"6%	c #C3D0E3",
+"7%	c #7B8CA9",
+"8%	c #51627E",
+"9%	c #171C22",
+"0%	c #141920",
+"a%	c #242C3A",
+"b%	c #3F4B60",
+"c%	c #BDC0C6",
+"d%	c #EBEBE9",
+"e%	c #D1D7D3",
+"f%	c #4F5753",
+"g%	c #27322D",
+"h%	c #57655B",
+"i%	c #7E8B86",
+"j%	c #F0EFED",
+"k%	c #3E516C",
+"l%	c #3F4E68",
+"m%	c #3C4A64",
+"n%	c #4C5A74",
+"o%	c #55637C",
+"p%	c #5A6881",
+"q%	c #707D95",
+"r%	c #8493A6",
+"s%	c #BFC8D8",
+"t%	c #D8E4F0",
+"u%	c #CCD5E4",
+"v%	c #E2E8F1",
+"w%	c #D2DAE9",
+"x%	c #8D9DB7",
+"y%	c #526380",
+"z%	c #323E53",
+"A%	c #080B11",
+"B%	c #0E1217",
+"C%	c #272E3A",
+"D%	c #747D8A",
+"E%	c #D6D7D8",
+"F%	c #E8E8E7",
+"G%	c #E8E8E6",
+"H%	c #D2D2D0",
+"I%	c #B3B7B4",
+"J%	c #BFC1BF",
+"K%	c #EBE8E7",
+"L%	c #5A718E",
+"M%	c #3F4C65",
+"N%	c #38475F",
+"O%	c #68768E",
+"P%	c #6E7C92",
+"Q%	c #78879B",
+"R%	c #959FB1",
+"S%	c #AAB4C1",
+"T%	c #C4CBD8",
+"U%	c #D7DCE6",
+"V%	c #D3D9E1",
+"W%	c #CCD3DC",
+"X%	c #8C9CB4",
+"Y%	c #52627B",
+"Z%	c #38475E",
+"`%	c #080E1A",
+" &	c #060910",
+".&	c #0E0F14",
+"+&	c #4F5869",
+"@&	c #B6B8BC",
+"#&	c #DDDDDC",
+"$&	c #E2E2E1",
+"%&	c #E5E5E4",
+"&&	c #E6E6E5",
+"*&	c #F2F1F1",
+"=&	c #F2F1F0",
+"-&	c #93A8C2",
+";&	c #2F3E56",
+">&	c #6C7A93",
+",&	c #939EAE",
+"'&	c #A9B3C0",
+")&	c #BDC3CB",
+"!&	c #C8CCD2",
+"~&	c #CDCFD5",
+"{&	c #CBD2DB",
+"]&	c #C7CFDC",
+"^&	c #A4B2C7",
+"/&	c #4C576D",
+"(&	c #262C3C",
+"_&	c #252D3B",
+":&	c #232C3D",
+"<&	c #323B4B",
+"[&	c #464B5A",
+"}&	c #959697",
+"|&	c #BDBDBC",
+"1&	c #C9C9C9",
+"2&	c #D6D6D5",
+"3&	c #E2E2E0",
+"4&	c #E7E7E6",
+"5&	c #E6E6E4",
+"6&	c #C8D6E7",
+"7&	c #515D76",
+"8&	c #33415A",
+"9&	c #66728A",
+"0&	c #C0C7D2",
+"a&	c #CACED7",
+"b&	c #CCCDD2",
+"c&	c #CBCED1",
+"d&	c #C8CED3",
+"e&	c #C2CDDB",
+"f&	c #A2B1C5",
+"g&	c #586377",
+"h&	c #181F27",
+"i&	c #363B40",
+"j&	c #575857",
+"k&	c #626261",
+"l&	c #656463",
+"m&	c #787877",
+"n&	c #929291",
+"o&	c #9F9F9D",
+"p&	c #B0B0AE",
+"q&	c #C3C3C2",
+"r&	c #D1D1D0",
+"s&	c #DCDCDB",
+"t&	c #DFE4EB",
+"u&	c #5F708B",
+"v&	c #717E92",
+"w&	c #4F5E78",
+"x&	c #8391A4",
+"y&	c #A9B4C2",
+"z&	c #B1BBC5",
+"A&	c #BAC3CE",
+"B&	c #D5DDE8",
+"C&	c #9EA7B9",
+"D&	c #444D63",
+"E&	c #1F242F",
+"F&	c #2D2F33",
+"G&	c #424242",
+"H&	c #4D4D4D",
+"I&	c #515150",
+"J&	c #575756",
+"K&	c #60605F",
+"L&	c #747473",
+"M&	c #838381",
+"N&	c #989897",
+"O&	c #B3B3B2",
+"P&	c #C6C6C4",
+"Q&	c #D3D3D2",
+"R&	c #F0EFEE",
+"S&	c #D0D1D3",
+"T&	c #959FB4",
+"U&	c #5B697E",
+"V&	c #9DA7B7",
+"W&	c #D8DEE4",
+"X&	c #D4DAE1",
+"Y&	c #DBE1E5",
+"Z&	c #DBDDE3",
+"`&	c #818894",
+" *	c #1E293A",
+".*	c #1B222B",
+"+*	c #222425",
+"@*	c #313131",
+"#*	c #343434",
+"$*	c #363635",
+"%*	c #3A3A3A",
+"&*	c #40403F",
+"**	c #484847",
+"=*	c #585858",
+"-*	c #6B6B6A",
+";*	c #838382",
+">*	c #A5A5A3",
+",*	c #BCBCBA",
+"'*	c #CFCFCE",
+")*	c #EFEFEF",
+"!*	c #E3E3E2",
+"~*	c #D9D9D8",
+"{*	c #BCBCBB",
+"]*	c #9DA0A4",
+"^*	c #616678",
+"/*	c #2F3A4F",
+"(*	c #2C3649",
+"_*	c #394250",
+":*	c #111923",
+"<*	c #010613",
+"[*	c #0A0F16",
+"}*	c #1F2225",
+"|*	c #262628",
+"1*	c #282828",
+"2*	c #292828",
+"3*	c #292929",
+"4*	c #2D2D2C",
+"5*	c #2F2F2F",
+"6*	c #343433",
+"7*	c #3D3D3C",
+"8*	c #5C5C5C",
+"9*	c #A1A1A0",
+"0*	c #B9B9B8",
+"a*	c #CECECC",
+"b*	c #E4E4E2",
+"c*	c #D7D7D5",
+"d*	c #989896",
+"e*	c #717174",
+"f*	c #464B51",
+"g*	c #2F353C",
+"h*	c #23272C",
+"i*	c #222529",
+"j*	c #25272A",
+"k*	c #2E2F31",
+"l*	c #313030",
+"m*	c #313130",
+"n*	c #333332",
+"o*	c #363636",
+"p*	c #3C3C3C",
+"q*	c #545454",
+"r*	c #686867",
+"s*	c #848483",
+"t*	c #A8A8A7",
+"u*	c #C0C0BE",
+"v*	c #D3D3D1",
+"w*	c #D9D9D7",
+"x*	c #C0C0BF",
+"y*	c #A3A3A2",
+"z*	c #888886",
+"A*	c #6E6D6C",
+"B*	c #5F6061",
+"C*	c #585859",
+"D*	c #A3A3A1",
+"E*	c #A2A2A0",
+"F*	c #A2A1A0",
+"G*	c #A2A2A1",
+"H*	c #A3A2A1",
+"I*	c #A4A3A2",
+"J*	c #A4A4A2",
+"K*	c #A6A6A4",
+"L*	c #A9A8A6",
+"M*	c #ABAAA8",
+"N*	c #AFAEAB",
+"O*	c #B3B1AE",
+"P*	c #B5B4B1",
+"Q*	c #B8B6B2",
+"R*	c #BAB8B4",
+"S*	c #6E6B62",
+"T*	c #DEDEDC",
+"U*	c #D1D1CF",
+"V*	c #BFBFBE",
+"W*	c #AFAFAF",
+"X*	c #9F9F9F",
+"Y*	c #919190",
+"Z*	c #302E28",
+"`*	c #2E2C27",
+" =	c #2D2B26",
+".=	c #312F29",
+"+=	c #33312B",
+"@=	c #36332D",
+"#=	c #38362F",
+"$=	c #3C3932",
+"%=	c #403D35",
+"&=	c #46423A",
+"*=	c #4D4940",
+"==	c #514D44",
+"-=	c #535046",
+";=	c #565248",
+">=	c #23211D",
+",=	c #EBEAE9",
+"'=	c #DADAD9",
+")=	c #C9C9C7",
+"!=	c #B2B0AD",
+"~=	c #423F37",
+"{=	c #E3E2E1",
+"]=	c #4E4B44",
+"^=	c #403D36",
+"/=	c #413E37",
+"(=	c #908E8A",
+"_=	c #424039",
+":=	c #48443C",
+"<=	c #A09F9A",
+"[=	c #95938C",
+"}=	c #94928C",
+"|=	c #D5D5D4",
+"1=	c #B6B5B1",
+"2=	c #4E4A41",
+"3=	c #D5D4D2",
+"4=	c #514E46",
+"5=	c #5E5B52",
+"6=	c #504C43",
+"7=	c #4C493F",
+"8=	c #827F78",
+"9=	c #EDECEB",
+"0=	c #D9D9D6",
+"a=	c #D9D8D6",
+"b=	c #E7E7E5",
+"c=	c #CCCBC8",
+"d=	c #C4C2BF",
+"e=	c #C4C3BF",
+"f=	c #555147",
+"g=	c #6C6860",
+"h=	c #F0EFEF",
+"i=	c #7C7971",
+"j=	c #747169",
+"k=	c #DEDDDB",
+"l=	c #E1E1DF",
+"m=	c #67635A",
+"n=	c #F5F4F4",
+"o=	c #67645B",
+"p=	c #E2E1E0",
+"q=	c #9B9993",
+"r=	c #B9B7B3",
+"s=	c #69665D",
+"t=	c #716D65",
+"u=	c #B8B7B2",
+"v=	c #8B8881",
+"w=	c #C0BEBA",
+"x=	c #8C8982",
+"y=	c #5D5A50",
+"z=	c #5D594F",
+"A=	c #E4E4E3",
+"B=	c #989690",
+"C=	c #98958F",
+"D=	c #DDDCDA",
+"E=	c #928F89",
+"F=	c #E3E3E1",
+"G=	c #A9A9A7",
+"H=	c #8D8D8D",
+"I=	c #9A9A9A",
+"J=	c #8C8C8C",
+"  . . . . . . . . . . . . . + @ # + . . . . . . . . . . . . . . . . . $ %                       ",
+". & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * = - ; .                   ",
+". * * * * * * * * * * * * * * * * * * * > * * , , , , , , , , , , , , ' = ) ! .                 ",
+". * * * * * * ~ * * { ] ^ / ( _ : < * * * , [ [ , , , , , , , , , , , } | * 1 2 .               ",
+". * * * * * * ~ * * 3 4 5 6 7 8 9 0 * , , , , , , , , , , , , , , , , } a * * ) b c             ",
+". * * * * * * * * * d e f g h i j k , , , , , l , , , , , , , , , m m = n * m * o p q           ",
+". * * * * * * * * * * r s t u v w x , , , , , l , , y z A m m m m m m B C * D E * F G .         ",
+". * * * * * * * * * * H I J K L M N , , , , l m z O P Q R S T ' E E E U V W X F n Y Z ` .       ",
+". * * * * * * * * m  ...+.@., #.$.%., , , , &.*.=.-.;.>.,.'.).!.~.E d {.].^./.(._._.:.<..       ",
+". * * * * [. .m * }.|.1.2.3.4.5.6.7.8.m 9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.! p.q.r.s.t.u..       ",
+". * * , n.v.w.x.y.z.A.B.C.D.E.F.G.H.I.m J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.D ' } } Y.Z.Z `.s..       ",
+". * * ,  +.+++@+#+$+%+&+*+=+E -+;+>+,+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+} X.1+2+3+3+3+4+<..       ",
+". * * , 5+6+7+8+9+0+1 a+b+c+E d+e+` f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+= } 3+3+B B o.o.w+.       ",
+". * , , 9.x+y+z+A+B+c+E E E E E E d C+D+E+F+G+l+m+H+I+J+K+L+M+N+O+P+Q+B B B U {.o.R+R+C .       ",
+". * m m m S+T+U+V+W+X.E E d ' ' ' ' X+Y+Z+`+ @I+.@.@+@^+@@#@$@%@&@*@=@o.U {.R+R+R+-@-@C .       ",
+". * m #.E ' ;@>@,@'@5+' ' ' ' 5+5+m.)@!@~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@{.R+R+n.n.-@4@4@C .       ",
+". * E ' 5@6@7@8@9@0@} ' 5+5+m.m.m.a@b@c@d@l+e@f@g@h@i@j@k@l@m@n@o@p@q@n.n.-@r@4@4@s@s@C .       ",
+". * d [.t@u@v@w@x@{.m.m.m.m.m.[.m.y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@-@-@r@s@s@< Q@R@C .       ",
+". * ' S@T@U@V@W@X@m.m.[.[.[.D Y@Z@`@ #.#+#@#D@##$#%#&#*#=#-#;#>#,#'#)#4@!#< < Q@~#~#{#C .       ",
+". * 5+3+]#^#/#(#_#[.D :#<#D X.[#}#|#1#2#3#f@4#5#6#7#8#9#0#a#b#c#d#e#f#< < g#g#~#{#h#h#C .       ",
+". * m.X.i#j#k#l#m#D n#o#p#q#} r#s#t#u#v#w#^@x#y#z#A#B#C#D#E#F#G#H#I#J#|+~#~#{#h#h#W K#C .       ",
+". * [.L#M#N#[#O#O#1+P#Q#R#S#1+T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$>${#h#4+4+K#K#K#C .       ",
+". * D ,$X.Y@[#[#} '$)$!$~${$3+]$^$/$($_$:$<$[$}$|$1$2$3$4$5$6$7$8$9$0$a$4+4+K#K#b$b$b$C .       ",
+". * [#[#[#n#c$d$e$f$g$h$i$j${.k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$K#F$b$b$b$G$H$C .       ",
+". * X.1+I$J$K$L$M$N$O$< P$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%b$b$b$G$>%>%,%C .       ",
+". * = = '%)%!%~%{%]%^%o.R+R+{./%(%_%:%<%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c%d%>%>%>%,%,%,%C .       ",
+". * 2+2+2+e%f%g%h%i%j%R+-@1 -@k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%A%B%C%D%E%F%F%>%,%F%F%G%C .       ",
+". * 3+U {.{.H%I%J%K%-@4@4@4@4@L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&F%G%G%G%C .       ",
+". * {.{.R+n.*&=&=&4@4@4@s@< Q@-&M%;&>&,&'&)&!&~&{&]&^&/&(&_&:&<&[&}&|&1&2&#&3&4&4&4&5&C .       ",
+". * n.-@-@-@-@4@4@s@< < < ~#b$6&7&8&9&0&a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&4&5&5&%&C .       ",
+". * -@-@-@4@< < < < < Q@R@G$%&t&u&v&w&x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&%&%&%&%&C .       ",
+". * 1 4@< < j%R&Q@Q@R@~#h#&&P$S&T&U&V&W&X&Y&Z&`& *.*+*@*#*$*%*&***=*-*;*>*,*'*%&=+=+=+C .       ",
+". * < < )*Q@Q@Q@R@~#~#K#G$!*~*{*]*^*/*(*_*:*<*[*}*|*1*2*3*4*5*6*7*>@8*m&9*0*a*=+=+=+b*C .       ",
+". * Q@Q@Q@Q@R@~#{#K#K#K#>%!*c*,*d*e*f*g*h*i*j*k*l*m*5*@*@*n*o*p*u.q*r*s*t*u*v*=+=+b*b*C .       ",
+". * Q@Q@~#~#{#K#K#K#K#b$>%!*w*x*y*z*A*B*C*D*E*E*E*E*F*E*G*H*I*J*K*L*M*N*O*P*Q*R*R*R*R*R*R*R*R*S*",
+". * ~#~#4+K#K#F$b$b$b$b$H$5&T*U*V*W*X*N&Y*M*Z*Z*`* = =`*Z*.=+=@=#=$=%=&=*===-=;=;=;=;=;=;=;=;=>=",
+". * 4+K#F$,=,=,=b$d%d%G$H$G%b*'=H%)=x*{*0*!=~=* {=]=^=/=(=* * *=_=:=<=* * ;=;=;=[=* * }=;=;=;=>=",
+". * F$b$b$b$d%G$G$G$G$H$H$G%5&3&#&~*|=Q&Q&1=2=* * 3=4=5={.* * 6=7=8=9=* * ;=;=;=0=* * a=;=;=;=>=",
+". * d%d%G$G$G$G$G$H$H$G%G%G%G%b=b=b=b=b=&&R*;=* c=* d=e=c=* * f=g=h=i=* * ;=;=j=* k=l=* j=;=;=>=",
+". * G$G$G$H$H$>%>%F%G%G%G%b=b=b=b=b=5&5&=+R*;=* m={.* n=o=* * ;=p=q=;=* * ;=;=r=< s=t=X.u=;=;=>=",
+". * H$>%>%>%>%F%G%G%4&4&b=b=b=b=5&5&=+=+=+R*;=* ;=v=w=x=;=* * ;=* * * * * * y=B * * * * B z=;=>=",
+". * >%>%>%G%4&4&4&4&b=b=b=&&&&5&=+=+=+=+A=R*;=* ;=;=;=;=;=* * ;=;=;=;=* * ;=B=* 3=;=;=3=* C=;=>=",
+". * ,%4&4&4&4&b=b=b=&&&&&&5&=+=+=+A=A=b*b*R*;=* ;=;=;=;=;=* * ;=;=;=;=* * ;=D=* E=;=;=E=* D=;=>=",
+". * 4&b=b=b=&&&&&&&&5&5&=+A=A=A=b*b*b*b*b*R*;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=>=",
+". * b=&&&&&&5&5&5&5&A=A=b*b*b*b*b*b*b*b*b*S*>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=",
+". * &&5&5&5&5&%&A=b*b*b*b*b*b*b*b*b*b*F=F=F=G=G=p p p y*y*y*y*D*D*D*D*D*D*D*D*D*D*D*D*H=.       ",
+". & 5&5&5&=+b*b*b*b*b*b*b*b*b*b*!*F=F=F=F=F=F=F=F=3&3&3&3&l=l=l=l=l=l=l=l=l=l=l=l=l=l=I=.       ",
+". Y C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C I=J=.       ",
+"  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       ",
+"                                                                                                ",
+"                                                                                                ",
+"                                                                                                "};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aac/mp4_utils.c	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,68 @@
+/*
+ * some functions for MP4 files
+*/
+
+#include "mp4ff.h"
+#include "faad.h"
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "audacious/plugin.h"
+#include "audacious/util.h"
+
+const char *mp4AudioNames[]=
+  {
+    "MPEG-1 Audio Layers 1,2 or 3",
+    "MPEG-2 low biterate (MPEG-1 extension) - MP3",
+    "MPEG-2 AAC Main Profile",
+    "MPEG-2 AAC Low Complexity profile",
+    "MPEG-2 AAC SSR profile",
+    "MPEG-4 audio (MPEG-4 AAC)",
+    0
+  };
+
+/* MPEG-4 Audio types from 14496-3 Table 1.5.1 (from mp4.h)*/
+const char *mpeg4AudioNames[]=
+  {
+    "!!!!MPEG-4 Audio track Invalid !!!!!!!",
+    "MPEG-4 AAC Main profile",
+    "MPEG-4 AAC Low Complexity profile",
+    "MPEG-4 AAC SSR profile",
+    "MPEG-4 AAC Long Term Prediction profile",
+    "MPEG-4 AAC Scalable",
+    "MPEG-4 CELP",
+    "MPEG-4 HVXC",
+    "MPEG-4 Text To Speech",
+    "MPEG-4 Main Synthetic profile",
+    "MPEG-4 Wavetable Synthesis profile",
+    "MPEG-4 MIDI Profile",
+    "MPEG-4 Algorithmic Synthesis and Audio FX profile"
+  };
+
+/*
+ * find AAC track
+ */
+
+int getAACTrack(mp4ff_t *infile)
+{
+  int i, rc;
+  int numTracks = mp4ff_total_tracks(infile);
+
+  for(i=0; i<numTracks; i++){
+    unsigned char*	buff = 0;
+    unsigned int	buff_size = 0;
+    mp4AudioSpecificConfig mp4ASC;
+
+    mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
+    if(buff){
+      rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
+      g_free(buff);
+      if(rc < 0)
+	continue;
+      return(i);
+    }
+  }
+  return(-1);
+}
--- a/src/aac/mp4ff/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-include ../../../extra.mk
-
-STATIC_LIB_NOINST = libmp4ff.a
-
-SRCS = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \
-   mp4tagupdate.c
-
-include ../../../buildsys.mk
-
-CFLAGS += $(PLUGIN_CFLAGS) -DUSE_TAGGING=1 -fsigned-char -I../../.. -Wall
--- a/src/aac/src/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-include ../../../extra.mk
-
-PLUGIN = aac$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = libmp4.c mp4_utils.c aac_utils.c tagging_mp4.c
-
-include ../../../buildsys.mk
-
-CFLAGS += $(PLUGIN_CFLAGS)
-
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-LIBS += ../libfaad2/libfaad.a ../mp4ff/libmp4ff.a -lstdc++
-
-OBJECTS = ${SOURCES:.c=.o}
-
-LIBDEP = ../libfaad2/libfaad.a ../mp4ff/libmp4ff.a
-
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../.. -I../include -I../libfaad -I../mp4ff -Wall
--- a/src/aac/src/aac_utils.c	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- *
- * utils for AAC informations
-*/
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-
-#define ADTS_HEADER_SIZE        8
-#define SEEK_TABLE_CHUNK        60
-#define MPEG4_TYPE              0
-#define MPEG2_TYPE              1
-
-// Read ADTS header, the file descriptor must be at
-// the begining of the aac frame not at the id3tag
-
-int	getAacInfo(FILE *fd)
-{
-  unsigned char	header[ADTS_HEADER_SIZE];
-  unsigned int	id;
-  unsigned long	originPosition;
-  
-  originPosition = ftell(fd);
-  if(fread(header, 1, ADTS_HEADER_SIZE, fd) != ADTS_HEADER_SIZE){
-    fseek(fd, originPosition, SEEK_SET);
-    return(-1);
-  }
-  if(!((header[0]==0xFF)&&((header[1]& 0xF6)==0xF0))){
-    printf("Bad header\n");
-    return(-1);
-  }
-  id = header[1]&0x08;
-  if(id==0){//MPEG-4 AAC
-    fseek(fd, originPosition, SEEK_SET);
-    return(MPEG4_TYPE);
-  }else{
-    fseek(fd, originPosition, SEEK_SET);
-    return(MPEG2_TYPE);
-  }
-  fseek(fd, originPosition, SEEK_SET);
-  return(-1);
-}
-
-// as AAC is VBR we need to check all ADTS header
-// to enable seeking...
-// there is no other solution
-void	checkADTSForSeeking(FILE *fd,
-			    unsigned long **seekTable,
-			    unsigned long *seekTableLength)
-{
-  unsigned long	originPosition;
-  unsigned long	position;
-  unsigned int	frameCount, frameLength, frameInsec;
-  unsigned int	id=0, seconds=0;
-  char header[ADTS_HEADER_SIZE];
-
-  originPosition = ftell(fd);
-
-  for(frameCount=0,frameInsec=0;; frameCount++,frameInsec++){
-    position = ftell(fd);
-    if(fread(header, 1, ADTS_HEADER_SIZE, fd)!=ADTS_HEADER_SIZE){
-      break;
-    }
-    if(!g_strncasecmp(header, "ID3", 3)){
-      break;
-    }
-    if(!frameCount){
-      id=header[1]&0x08;
-      if(((*seekTable) = malloc(SEEK_TABLE_CHUNK * sizeof(unsigned long)))==0){
-	printf("malloc error\n");
-	return;
-      }
-      (*seekTableLength) = SEEK_TABLE_CHUNK;
-    }
-
-    //if(id==0){//MPEG-4
-    //frameLength = ((unsigned int)header[4]<<5)|((unsigned int)header[5]>>3);
-    //}else{//MPEG-2
-      frameLength = (((unsigned int)header[3]&0x3)<<11)|((unsigned int)header[4]<<3)|(header[5]>>5);
-      //}
-    if(frameInsec==43){//???
-      frameInsec=0;
-    }
-    if(frameInsec==0){
-      if(seconds == (*seekTableLength)){
-	(*seekTable) = realloc((*seekTable), (seconds+SEEK_TABLE_CHUNK)*sizeof(unsigned long));
-	(*seekTableLength) = seconds+SEEK_TABLE_CHUNK;
-      }
-      (*seekTable)[seconds] = position;
-      seconds++;
-    }
-    if(fseek(fd, frameLength-ADTS_HEADER_SIZE, SEEK_CUR)==-1){
-      break;
-    } 
-  }
-  (*seekTableLength) = seconds;
-  fseek(fd, originPosition, SEEK_SET);
-}
--- a/src/aac/src/libmp4.c	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,840 +0,0 @@
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <string.h>
-#include <stdlib.h>
-#include "faad.h"
-#include "mp4ff.h"
-#include "tagging.h"
-
-#include "audacious/plugin.h"
-#include "audacious/output.h"
-#include "audacious/util.h"
-#include "audacious/vfs.h"
-#include "audacious/i18n.h"
-#include "audacious/strings.h"
-#include "audacious/main.h"
-#include "audacious/tuple.h"
-#include "audacious/tuple_formatter.h"
-
-#define MP4_VERSION VERSION
-
-#define SBR_DEC
-
-extern VFSFile *vfs_buffered_file_new_from_uri(gchar *uri);
-
-/*
- * BUFFER_SIZE is the highest amount of memory that can be pulled.
- * We use this for sanity checks, among other things, as mp4ff needs
- * a labotomy sometimes.
- */
-#define BUFFER_SIZE FAAD_MIN_STREAMSIZE*64
-
-/*
- * AAC_MAGIC is the pattern that marks the beginning of an MP4 container.
- */
-#define AAC_MAGIC     (unsigned char [4]) { 0xFF, 0xF9, 0x5C, 0x80 }
-
-static void        mp4_init(void);
-static void        mp4_about(void);
-static int         mp4_is_our_file(char *);
-static void        mp4_play(InputPlayback *);
-static void        mp4_stop(InputPlayback *);
-static void        mp4_pause(InputPlayback *, short);
-static void        mp4_seek(InputPlayback *, int);
-static void        mp4_cleanup(void);
-static void        mp4_get_song_title_len(char *filename, char **, int *);
-static Tuple*      mp4_get_song_tuple(char *);
-static int         mp4_is_our_fd(char *, VFSFile *);
-
-static gchar *fmts[] = { "m4a", "mp4", "aac", NULL };
-
-static void *   mp4_decode(void *);
-static gchar *  mp4_get_song_title(char *filename);
-gboolean        buffer_playing;
-
-InputPlugin mp4_ip =
-{
-    .description = "MP4 Audio Plugin",
-    .init = mp4_init,
-    .about = mp4_about,
-    .is_our_file = mp4_is_our_file,
-    .play_file = mp4_play,
-    .stop = mp4_stop,
-    .pause = mp4_pause,
-    .seek = mp4_seek,
-    .cleanup = mp4_cleanup,
-    .get_song_info = mp4_get_song_title_len,
-    .get_song_tuple = mp4_get_song_tuple,
-    .is_our_file_from_vfs = mp4_is_our_fd,
-    .vfs_extensions = fmts,
-};
-
-InputPlugin *mp4_iplist[] = { &mp4_ip, NULL };
-
-DECLARE_PLUGIN(mp4, NULL, NULL, mp4_iplist, NULL, NULL, NULL, NULL, NULL);
-
-typedef struct  _mp4cfg
-{
-#define FILE_UNKNOWN    0
-#define FILE_MP4        1
-#define FILE_AAC        2
-    gshort        file_type;
-} Mp4Config;
-
-static Mp4Config mp4cfg;
-static GThread   *decodeThread;
-GStaticMutex     mutex = G_STATIC_MUTEX_INIT;
-static int       seekPosition = -1;
-
-void getMP4info(char*);
-int getAACTrack(mp4ff_t *);
-
-static guint32 mp4_read_callback(void *data, void *buffer, guint32 len)
-{
-    if (data == NULL || buffer == NULL)
-        return -1;
-
-    return vfs_fread(buffer, 1, len, (VFSFile *) data);
-}
-
-static guint32 mp4_seek_callback(void *data, guint64 pos)
-{
-    if (data == NULL)
-        return -1;
-
-    return vfs_fseek((VFSFile *) data, pos, SEEK_SET);
-}
-
-static void mp4_init(void)
-{
-    mp4cfg.file_type = FILE_UNKNOWN;
-    seekPosition = -1;
-    return;
-}
-
-static void mp4_play(InputPlayback *playback)
-{
-    buffer_playing = TRUE;
-    playback->playing = 1; //XXX should acquire lock?
-    decodeThread = g_thread_self();
-    playback->set_pb_ready(playback);
-    mp4_decode(playback);
-}
-
-static void mp4_stop(InputPlayback *playback)
-{
-    if (buffer_playing)
-    {
-        buffer_playing = FALSE;
-        playback->playing = 0; //XXX should acquire lock?
-        g_thread_join(decodeThread);
-        playback->output->close_audio();
-    }
-}
-
-/*
- * These routines are derived from MPlayer.
- */
-
-/// \param srate (out) sample rate
-/// \param num (out) number of audio frames in this ADTS frame
-/// \return size of the ADTS frame in bytes
-/// aac_parse_frames needs a buffer at least 8 bytes long
-int aac_parse_frame(guchar *buf, int *srate, int *num)
-{
-        int i = 0, sr, fl = 0, id;
-        static int srates[] = {96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 0, 0, 0};
-
-        if((buf[i] != 0xFF) || ((buf[i+1] & 0xF6) != 0xF0))
-                return 0;
-
-        id = (buf[i+1] >> 3) & 0x01;    //id=1 mpeg2, 0: mpeg4
-        sr = (buf[i+2] >> 2)  & 0x0F;
-        if(sr > 11)
-                return 0;
-        *srate = srates[sr];
-
-        fl = ((buf[i+3] & 0x03) << 11) | (buf[i+4] << 3) | ((buf[i+5] >> 5) & 0x07);
-        *num = (buf[i+6] & 0x02) + 1;
-
-        return fl;
-}
-
-static gboolean parse_aac_stream(VFSFile *stream)
-{
-        int cnt = 0, c, len, srate, num;
-        off_t init, probed;
-	static guchar buf[8];
-
-        init = probed = vfs_ftell(stream);
-        while(probed-init <= 32768 && cnt < 8)
-        {
-                c = 0;
-                while(probed-init <= 32768 && c != 0xFF)
-                {
-                        c = vfs_getc(stream);
-                        if(c < 0)
-                                return FALSE;
-	                probed = vfs_ftell(stream);
-                }
-                buf[0] = 0xFF;
-                if(vfs_fread(&(buf[1]), 1, 7, stream) < 7)
-                        return FALSE;
-
-                len = aac_parse_frame(buf, &srate, &num);
-                if(len > 0)
-                {
-                        cnt++;
-                        vfs_fseek(stream, len - 8, SEEK_CUR);
-                }
-                probed = vfs_ftell(stream);
-        }
-
-        if(cnt < 8)
-                return FALSE;
-
-        return TRUE;
-}
-
-static int aac_probe(unsigned char *buffer, int len)
-{
-  int i = 0, pos = 0;
-#ifdef DEBUG
-  g_print("\nAAC_PROBE: %d bytes\n", len);
-#endif
-  while(i <= len-4) {
-    if(
-       ((buffer[i] == 0xff) && ((buffer[i+1] & 0xf6) == 0xf0)) ||
-       (buffer[i] == 'A' && buffer[i+1] == 'D' && buffer[i+2] == 'I' && buffer[i+3] == 'F')
-    ) {
-      pos = i;
-      break;
-    }
-#ifdef DEBUG
-    g_print("AUDIO PAYLOAD: %x %x %x %x\n",
-	buffer[i], buffer[i+1], buffer[i+2], buffer[i+3]);
-#endif
-    i++;
-  }
-#ifdef DEBUG
-  g_print("\nAAC_PROBE: ret %d\n", pos);
-#endif
-  return pos;
-}
-
-static int mp4_is_our_file(char *filename)
-{
-  VFSFile *file;
-  gchar* extension;
-  gchar magic[8];
-
-  memset(magic, '\0', 8);
-
-  extension = strrchr(filename, '.');
-  if ((file = vfs_fopen(filename, "rb"))) {
-      vfs_fread(magic, 1, 8, file);
-      vfs_rewind(file);
-      if (parse_aac_stream(file) == TRUE) {
-           vfs_fclose(file);
-           return TRUE;
-      }
-      if (!memcmp(magic, "ID3", 3)) {       // ID3 tag bolted to the front, obfuscated magic bytes
-           vfs_fclose(file);
-           if (extension &&(
-          !strcasecmp(extension, ".mp4") || // official extension
-          !strcasecmp(extension, ".m4a") || // Apple mp4 extension
-          !strcasecmp(extension, ".aac")    // old MPEG2/4-AAC extension
-       ))
-          return 1;
-       else
-          return 0;
-      }
-      if (!memcmp(&magic[4], "ftyp", 4)) {
-           vfs_fclose(file);
-           return 1;
-      }
-      vfs_fclose(file);
-  }
-  return 0;
-}
-
-static int mp4_is_our_fd(char *filename, VFSFile* file)
-{
-  gchar* extension;
-  gchar magic[8];
-
-  extension = strrchr(filename, '.');
-  vfs_fread(magic, 1, 8, file);
-  vfs_rewind(file);
-  if (parse_aac_stream(file) == TRUE)
-    return 1;
-  if (!memcmp(&magic[4], "ftyp", 4))
-    return 1;
-  if (!memcmp(magic, "ID3", 3)) {       // ID3 tag bolted to the front, obfuscated magic bytes
-    if (extension &&(
-      !strcasecmp(extension, ".mp4") || // official extension
-      !strcasecmp(extension, ".m4a") || // Apple mp4 extension
-      !strcasecmp(extension, ".aac")    // old MPEG2/4-AAC extension
-    ))
-      return 1;
-    else
-      return 0;
-  }
-  return 0;
-}
-
-static void mp4_about(void)
-{
-    static GtkWidget *aboutbox = NULL;
-    gchar *about_text;
-
-    about_text = g_strjoin ("", _("Using libfaad2-"), FAAD2_VERSION,
-				_(" for decoding.\n"
-				  "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Nero AG, www.nero.com\n"
-				  "Copyright (c) 2005-2006 Audacious team"), NULL);
-
-    aboutbox = audacious_info_dialog(_("About MP4 AAC player plugin"),
-				 about_text,
-				 _("Ok"), FALSE, NULL, NULL);
-
-    g_signal_connect(G_OBJECT(aboutbox), "destroy",
-                     G_CALLBACK(gtk_widget_destroyed), &aboutbox);
-    g_free(about_text);
-}
-
-static void mp4_pause(InputPlayback *playback, short flag)
-{
-    playback->output->pause(flag);
-}
-
-static void mp4_seek(InputPlayback *data, int time)
-{
-    seekPosition = time;
-    while(buffer_playing && seekPosition != -1)
-        g_usleep(10000);
-}
-
-static void mp4_cleanup(void)
-{
-}
-
-static Tuple *mp4_get_song_tuple_base(char *filename, VFSFile *mp4fh)
-{
-    mp4ff_callback_t *mp4cb = g_malloc0(sizeof(mp4ff_callback_t));
-    mp4ff_t *mp4file;
-    Tuple *ti = tuple_new_from_filename(filename);
-
-    /* check if this file is an ADTS stream, if so return a blank tuple */
-    if (parse_aac_stream(mp4fh))
-    {
-        g_free(mp4cb);
-
-        tuple_associate_string(ti, FIELD_TITLE, NULL, vfs_get_metadata(mp4fh, "track-name"));
-        tuple_associate_string(ti, FIELD_ALBUM, NULL, vfs_get_metadata(mp4fh, "stream-name"));
-
-        tuple_associate_string(ti, FIELD_CODEC, NULL, "Advanced Audio Coding (AAC)");
-        tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
-
-        vfs_fclose(mp4fh);
-        return ti;
-    }
-
-    vfs_rewind(mp4fh);
-
-    mp4cb->read = mp4_read_callback;
-    mp4cb->seek = mp4_seek_callback;
-    mp4cb->user_data = mp4fh;
-
-    if (!(mp4file = mp4ff_open_read(mp4cb))) {
-        g_free(mp4cb);
-        vfs_fclose(mp4fh);
-    } else {
-        gint mp4track= getAACTrack(mp4file);
-        gint numSamples = mp4ff_num_samples(mp4file, mp4track);
-        guint framesize = 1024;
-        guint samplerate = 0;
-        guchar channels = 0;
-        gint msDuration;
-        mp4AudioSpecificConfig mp4ASC;
-        gchar *tmpval;
-        guchar *buffer = NULL;
-        guint bufferSize = 0;
-        faacDecHandle decoder;
-
-        if (mp4track == -1)
-            return NULL;
-
-        decoder = faacDecOpen();
-        mp4ff_get_decoder_config(mp4file, mp4track, &buffer, &bufferSize);
-
-        if ( !buffer ) {
-            faacDecClose(decoder);
-            return FALSE;
-        }
-        if ( faacDecInit2(decoder, buffer, bufferSize,
-                  &samplerate, &channels) < 0 ) {
-            faacDecClose(decoder);
-
-            return FALSE;
-        }
-
-        /* Add some hacks for SBR profile */
-        if (AudioSpecificConfig(buffer, bufferSize, &mp4ASC) >= 0) {
-            if (mp4ASC.frameLengthFlag == 1) framesize = 960;
-            if (mp4ASC.sbr_present_flag == 1) framesize *= 2;
-        }
-
-        g_free(buffer);
-
-        faacDecClose(decoder);
-
-        msDuration = ((float)numSamples * (float)(framesize - 1.0)/(float)samplerate) * 1000;
-        tuple_associate_int(ti, FIELD_LENGTH, NULL, msDuration);
-
-        mp4ff_meta_get_title(mp4file, &tmpval);
-        if (tmpval)
-        {
-            tuple_associate_string(ti, FIELD_TITLE, NULL, tmpval);
-            free(tmpval);
-        }
-
-        mp4ff_meta_get_album(mp4file, &tmpval);
-        if (tmpval)
-        {
-            tuple_associate_string(ti, FIELD_ALBUM, NULL, tmpval);
-            free(tmpval);
-        }
-
-        mp4ff_meta_get_artist(mp4file, &tmpval);
-        if (tmpval)
-        {
-            tuple_associate_string(ti, FIELD_ARTIST, NULL, tmpval);
-            free(tmpval);
-        }
-
-        mp4ff_meta_get_genre(mp4file, &tmpval);
-        if (tmpval)
-        {
-            tuple_associate_string(ti, FIELD_GENRE, NULL, tmpval);
-            free(tmpval);
-        }
-
-        mp4ff_meta_get_date(mp4file, &tmpval);
-        if (tmpval)
-        {
-            tuple_associate_int(ti, FIELD_YEAR, NULL, atoi(tmpval));
-            free(tmpval);
-        }
-
-        tuple_associate_string(ti, FIELD_CODEC, NULL, "Advanced Audio Coding (AAC)");
-        tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
-
-        free (mp4cb);
-        vfs_fclose(mp4fh);
-    }
-
-    return ti;
-}
-
-static Tuple *mp4_get_song_tuple(char *filename)
-{
-    Tuple *tuple;
-    VFSFile *mp4fh;
-    gboolean remote = str_has_prefix_nocase(filename, "http:") ||
-	              str_has_prefix_nocase(filename, "https:");
-
-    mp4fh = remote ? vfs_buffered_file_new_from_uri(filename) : vfs_fopen(filename, "rb");
-
-    tuple = mp4_get_song_tuple_base(filename, mp4fh);
-
-    return tuple;
-}
-
-static void mp4_get_song_title_len(char *filename, char **title, int *len)
-{
-    (*title) = mp4_get_song_title(filename);
-    (*len) = -1;
-}
-
-static gchar   *mp4_get_song_title(char *filename)
-{
-    gchar *title;
-    Tuple *tuple = mp4_get_song_tuple(filename);
-
-    title = tuple_formatter_make_title_string(tuple, get_gentitle_format());
-
-    tuple_free(tuple);
-
-    return title;
-}
-
-static int my_decode_mp4( InputPlayback *playback, char *filename, mp4ff_t *mp4file )
-{
-    // We are reading an MP4 file
-    gint mp4track= getAACTrack(mp4file);
-    faacDecHandle   decoder;
-    mp4AudioSpecificConfig mp4ASC;
-    guchar      *buffer = NULL;
-    guint       bufferSize = 0;
-    guint       samplerate = 0;
-    guchar      channels = 0;
-    gulong      msDuration;
-    guint       numSamples;
-    gulong      sampleID = 1;
-    guint       framesize = 1024;
-
-    if (mp4track < 0)
-    {
-        g_print("Unsupported Audio track type\n");
-        return TRUE;
-    }
-
-    gchar *xmmstitle = NULL;
-    xmmstitle = mp4_get_song_title(filename);
-    if(xmmstitle == NULL)
-        xmmstitle = g_strdup(filename);
-
-    decoder = faacDecOpen();
-    mp4ff_get_decoder_config(mp4file, mp4track, &buffer, &bufferSize);
-    if ( !buffer ) {
-        faacDecClose(decoder);
-        return FALSE;
-    }
-    if ( faacDecInit2(decoder, buffer, bufferSize,
-              &samplerate, &channels) < 0 ) {
-        faacDecClose(decoder);
-
-        return FALSE;
-    }
-
-    /* Add some hacks for SBR profile */
-    if (AudioSpecificConfig(buffer, bufferSize, &mp4ASC) >= 0) {
-        if (mp4ASC.frameLengthFlag == 1) framesize = 960;
-        if (mp4ASC.sbr_present_flag == 1) framesize *= 2;
-    }
-
-    g_free(buffer);
-    if( !channels ) {
-        faacDecClose(decoder);
-
-        return FALSE;
-    }
-    numSamples = mp4ff_num_samples(mp4file, mp4track);
-    msDuration = ((float)numSamples * (float)(framesize - 1.0)/(float)samplerate) * 1000;
-    playback->output->open_audio(FMT_S16_NE, samplerate, channels);
-    playback->output->flush(0);
-
-    mp4_ip.set_info(xmmstitle, msDuration,
-            mp4ff_get_avg_bitrate( mp4file, mp4track ),
-            samplerate,channels);
-
-    while ( buffer_playing ) {
-        void*           sampleBuffer;
-        faacDecFrameInfo    frameInfo;
-        gint            rc;
-
-        /* Seek if seek position has changed */
-        if ( seekPosition!=-1 ) {
-            sampleID =  (float)seekPosition*(float)samplerate/(float)(framesize - 1.0);
-            playback->output->flush(seekPosition*1000);
-            seekPosition = -1;
-        }
-
-        /* Otherwise continue playing */
-        buffer=NULL;
-        bufferSize=0;
-
-        /* If we've run to the end of the file, we're done. */
-        if(sampleID >= numSamples){
-            /* Finish playing before we close the
-               output. */
-            while ( playback->output->buffer_playing() ) {
-                g_usleep(10000);
-            }
-
-            playback->output->flush(seekPosition*1000);
-            playback->output->close_audio();
-            faacDecClose(decoder);
-
-            g_static_mutex_lock(&mutex);
-            buffer_playing = FALSE;
-            playback->playing = 0;
-            g_static_mutex_unlock(&mutex);
-            return FALSE;
-        }
-        rc= mp4ff_read_sample(mp4file, mp4track,
-                  sampleID++, &buffer, &bufferSize);
-
-        /*g_print(":: %d/%d\n", sampleID-1, numSamples);*/
-
-        /* If we can't read the file, we're done. */
-        if((rc == 0) || (buffer== NULL) || (bufferSize == 0) || (bufferSize > BUFFER_SIZE)){
-            g_print("MP4: read error\n");
-            sampleBuffer = NULL;
-            sampleID=0;
-            playback->output->buffer_free();
-            playback->output->close_audio();
-
-            faacDecClose(decoder);
-
-            return FALSE;
-        }
-
-/*          g_print(" :: %d/%d\n", bufferSize, BUFFER_SIZE); */
-
-        sampleBuffer= faacDecDecode(decoder,
-                        &frameInfo,
-                        buffer,
-                        bufferSize);
-
-        /* If there was an error decoding, we're done. */
-        if(frameInfo.error > 0){
-            g_print("MP4: %s\n",
-                faacDecGetErrorMessage(frameInfo.error));
-            playback->output->close_audio();
-            faacDecClose(decoder);
-
-            return FALSE;
-        }
-        if(buffer){
-            g_free(buffer);
-            buffer=NULL;
-            bufferSize=0;
-        }
-        if (buffer_playing == FALSE)
-        {
-            playback->output->close_audio();
-            return FALSE;
-        }
-        produce_audio(playback->output->written_time(),
-                   FMT_S16_NE,
-                   channels,
-                   frameInfo.samples<<1,
-                   sampleBuffer, &buffer_playing);
-    }
-
-    playback->output->close_audio();
-    faacDecClose(decoder);
-
-    return TRUE;
-}
-
-void my_decode_aac( InputPlayback *playback, char *filename, VFSFile *file )
-{
-    faacDecHandle   decoder = 0;
-    guchar      streambuffer[BUFFER_SIZE];
-    gulong      bufferconsumed = 0;
-    gulong      samplerate = 0;
-    guchar      channels = 0;
-    gulong      buffervalid = 0;
-    gchar       *ttemp = NULL, *stemp = NULL;
-    gchar       *temp = g_strdup(filename);
-    gchar       *xmmstitle = NULL;
-    gboolean    remote = str_has_prefix_nocase(filename, "http:") ||
-			 str_has_prefix_nocase(filename, "https:");
-
-    vfs_rewind(file);
-    if((decoder = faacDecOpen()) == NULL){
-        g_print("AAC: Open Decoder Error\n");
-        vfs_fclose(file);
-        buffer_playing = FALSE;
-        playback->playing = 0;
-        g_static_mutex_unlock(&mutex);
-        return;
-    }
-    if((buffervalid = vfs_fread(streambuffer, 1, BUFFER_SIZE, file))==0){
-        g_print("AAC: Error reading file\n");
-        vfs_fclose(file);
-        buffer_playing = FALSE;
-        playback->playing = 0;
-        faacDecClose(decoder);
-        g_static_mutex_unlock(&mutex);
-        return;
-    }
-    if(!strncmp((char*)streambuffer, "ID3", 3)){
-        gint size = 0;
-
-        vfs_fseek(file, 0, SEEK_SET);
-        size = (streambuffer[6]<<21) | (streambuffer[7]<<14) |
-		(streambuffer[8]<<7) | streambuffer[9];
-        size+=10;
-        vfs_fread(streambuffer, 1, size, file);
-        buffervalid = vfs_fread(streambuffer, 1, BUFFER_SIZE, file);
-    }
-
-    ttemp = vfs_get_metadata(file, "stream-name");
-
-    if (ttemp != NULL)
-    {
-        xmmstitle = g_strdup(ttemp);
-        g_free(ttemp);
-    }
-    else
-        xmmstitle = g_strdup(g_basename(temp));
-
-    bufferconsumed = aac_probe(streambuffer, buffervalid);
-    if(bufferconsumed) {
-      buffervalid -= bufferconsumed;
-      memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid);
-      buffervalid += vfs_fread(&streambuffer[buffervalid], 1,
-                     BUFFER_SIZE-buffervalid, file);
-      bufferconsumed = 0;
-    }
-
-    bufferconsumed = faacDecInit(decoder,
-                     streambuffer,
-                     buffervalid,
-                     &samplerate,
-                     &channels);
-#ifdef DEBUG
-    g_print("samplerate: %d, channels: %d\n", samplerate, channels);
-#endif
-    if(playback->output->open_audio(FMT_S16_NE,samplerate,channels) == FALSE){
-        g_print("AAC: Output Error\n");
-        faacDecClose(decoder);
-        vfs_fclose(file);
-        playback->output->close_audio();
-        g_free(xmmstitle);
-        buffer_playing = FALSE;
-        playback->playing = 0;
-        g_static_mutex_unlock(&mutex);
-        return;
-    }
-
-    mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
-    playback->output->flush(0);
-
-    while(buffer_playing && buffervalid > 0 && streambuffer != NULL)
-    {
-        faacDecFrameInfo    finfo;
-        unsigned long   samplesdecoded;
-        char*       sample_buffer = NULL;
-
-        if(bufferconsumed > 0)
-        {
-            buffervalid -= bufferconsumed;
-            memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid);
-            buffervalid += vfs_fread(&streambuffer[buffervalid], 1,
-                         BUFFER_SIZE-buffervalid, file);
-            bufferconsumed = 0;
-
-            ttemp = vfs_get_metadata(file, "stream-name");
-
-            if (ttemp != NULL)
-                stemp = vfs_get_metadata(file, "track-name");
-
-            if (stemp != NULL)
-            {
-                static gchar *ostmp = NULL;
-
-                if (ostmp == NULL || g_ascii_strcasecmp(stemp, ostmp))
-                {
-                    if (xmmstitle != NULL)
-                        g_free(xmmstitle);
-
-                    xmmstitle = g_strdup_printf("%s (%s)", stemp, ttemp);
-
-                    if (ostmp != NULL)
-                        g_free(ostmp);
-
-                    ostmp = stemp;
-
-                    mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
-                }
-            }
-
-            g_free(ttemp);
-            ttemp = NULL;
-        }
-
-        sample_buffer = faacDecDecode(decoder, &finfo, streambuffer, buffervalid);
-
-        bufferconsumed += finfo.bytesconsumed;
-        samplesdecoded = finfo.samples;
-
-        if(finfo.error > 0 && remote != FALSE)
-        {
-	    buffervalid--;
-            memmove(streambuffer, &streambuffer[1], buffervalid);
-            if(buffervalid < BUFFER_SIZE) {
-               buffervalid +=
-                 vfs_fread(&streambuffer[buffervalid], 1, BUFFER_SIZE-buffervalid, file);
-	    }
-            bufferconsumed = aac_probe(streambuffer, buffervalid);
-            if(bufferconsumed) {
-               buffervalid -= bufferconsumed;
-               memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid);
-               bufferconsumed = 0;
-            }
-            continue;
-        }
-
-        if((samplesdecoded <= 0) && !sample_buffer){
-#ifdef DEBUG
-            g_print("AAC: decoded %d samples!\n", samplesdecoded);
-#endif
-            continue;
-        }
-
-        produce_audio(playback->output->written_time(),
-                   FMT_S16_LE, channels,
-                   samplesdecoded<<1, sample_buffer, &buffer_playing);
-    }
-    playback->output->buffer_free();
-    playback->output->close_audio();
-    buffer_playing = FALSE;
-    playback->playing = 0;
-    faacDecClose(decoder);
-    g_free(xmmstitle);
-    vfs_fclose(file);
-    seekPosition = -1;
-
-    buffer_playing = FALSE;
-    playback->playing = 0;
-    g_static_mutex_unlock(&mutex);
-}
-
-static void *mp4_decode( void *args )
-{
-    mp4ff_callback_t *mp4cb = g_malloc0(sizeof(mp4ff_callback_t));
-    VFSFile *mp4fh;
-    mp4ff_t *mp4file;
-    gboolean ret;
-
-    InputPlayback *playback = args;
-    char *filename = playback->filename;
-
-    mp4fh = vfs_buffered_file_new_from_uri(filename);
-
-    g_static_mutex_lock(&mutex);
-    seekPosition= -1;
-    buffer_playing= TRUE;
-    g_static_mutex_unlock(&mutex);
-
-    if (mp4fh == NULL)
-        return NULL;
-
-    ret = parse_aac_stream(mp4fh);
-
-    if( ret == TRUE )
-        vfs_fseek(mp4fh, 0, SEEK_SET);
-    else {
-        vfs_fclose(mp4fh);
-        mp4fh = vfs_fopen(filename, "rb");
-    }
-
-    mp4cb->read = mp4_read_callback;
-    mp4cb->seek = mp4_seek_callback;
-    mp4cb->user_data = mp4fh;
-
-    mp4file= mp4ff_open_read(mp4cb);
-
-    if( ret == TRUE ) {
-        g_free(mp4cb);
-        my_decode_aac( playback, filename, mp4fh );
-    }
-    else
-        my_decode_mp4( playback, filename, mp4file );
-
-    return NULL;
-}
--- a/src/aac/src/m4a.xpm	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,958 +0,0 @@
-/* XPM */
-static char * m4a_xpm[] = {
-"48 52 903 2",
-"  	c None",
-". 	c #000000",
-"+ 	c #010100",
-"@ 	c #020201",
-"# 	c #030201",
-"$ 	c #232323",
-"% 	c #1F1F1F",
-"& 	c #DADADA",
-"* 	c #FFFFFF",
-"= 	c #F6F6F6",
-"- 	c #CFCFCF",
-"; 	c #707070",
-"> 	c #FFFFFE",
-", 	c #FEFEFE",
-"' 	c #FBFBFB",
-") 	c #EDEDED",
-"! 	c #C0C0C0",
-"~ 	c #FFFEFE",
-"{ 	c #F8F5F2",
-"] 	c #EBE7E1",
-"^ 	c #ECEDE8",
-"/ 	c #ECEFEA",
-"( 	c #E6E9E4",
-"_ 	c #CED0CE",
-": 	c #BCBFBC",
-"< 	c #F0F0EF",
-"[ 	c #FEFEFD",
-"} 	c #F7F7F7",
-"| 	c #D7D7D7",
-"1 	c #F1F1F1",
-"2 	c #B7B7B7",
-"3 	c #EAEDEA",
-"4 	c #8EA299",
-"5 	c #697D70",
-"6 	c #546459",
-"7 	c #404D44",
-"8 	c #2C352F",
-"9 	c #4E5649",
-"0 	c #D6D8D3",
-"a 	c #D2D2D2",
-"b 	c #AEAEAE",
-"c 	c #070707",
-"d 	c #FCFCFB",
-"e 	c #6D7C75",
-"f 	c #5A5D4C",
-"g 	c #6B735F",
-"h 	c #6E7B63",
-"i 	c #5B6052",
-"j 	c #4A5042",
-"k 	c #CED0CB",
-"l 	c #FEFDFD",
-"m 	c #FDFDFD",
-"n 	c #B8B8B8",
-"o 	c #DCDCDC",
-"p 	c #A4A4A3",
-"q 	c #0E0E0E",
-"r 	c #8A928F",
-"s 	c #6A7F68",
-"t 	c #4D564E",
-"u 	c #4E5950",
-"v 	c #585E57",
-"w 	c #333530",
-"x 	c #9D9C9B",
-"y 	c #FCFDFE",
-"z 	c #FDFEFE",
-"A 	c #FDFDFE",
-"B 	c #F5F5F4",
-"C 	c #B5B5B5",
-"D 	c #F9F9F9",
-"E 	c #FCFCFC",
-"F 	c #CBCBCB",
-"G 	c #A5A5A5",
-"H 	c #CECDCB",
-"I 	c #788976",
-"J 	c #C6BDBB",
-"K 	c #E2E2E2",
-"L 	c #E2E0DF",
-"M 	c #656A65",
-"N 	c #4A4B49",
-"O 	c #EAEDF1",
-"P 	c #CED5DD",
-"Q 	c #DBE0E9",
-"R 	c #DDE1E9",
-"S 	c #D3D7DD",
-"T 	c #D9DCE1",
-"U 	c #F4F4F4",
-"V 	c #ACACAC",
-"W 	c #ECECEC",
-"X 	c #C3C3C3",
-"Y 	c #C2C2C2",
-"Z 	c #C9C9C8",
-"` 	c #A8A8A8",
-" .	c #F6F8F6",
-"..	c #A7ADA5",
-"+.	c #6D7F71",
-"@.	c #ECECE9",
-"#.	c #FDFDFC",
-"$.	c #939C9A",
-"%.	c #1B2321",
-"&.	c #FCFBFA",
-"*.	c #F2F6F9",
-"=.	c #B4BFCC",
-"-.	c #7E8A9B",
-";.	c #515B6F",
-">.	c #50596A",
-",.	c #737D8D",
-"'.	c #BEC6CE",
-").	c #C4CBD5",
-"!.	c #BFC5D1",
-"~.	c #F1F2F4",
-"{.	c #F4F4F3",
-"].	c #ABABAB",
-"^.	c #515151",
-"/.	c #474747",
-"(.	c #464645",
-"_.	c #464646",
-":.	c #5D5D5C",
-"<.	c #A9A9A9",
-"[.	c #FAFAF9",
-"}.	c #EDEFF0",
-"|.	c #F1F5F5",
-"1.	c #636E62",
-"2.	c #636E5F",
-"3.	c #D4D5D3",
-"4.	c #FBF7F4",
-"5.	c #9BA595",
-"6.	c #657366",
-"7.	c #001514",
-"8.	c #FCFAF8",
-"9.	c #FDFCFC",
-"0.	c #FBF9F7",
-"a.	c #E3E6EA",
-"b.	c #9DACBF",
-"c.	c #515A6D",
-"d.	c #111828",
-"e.	c #131B29",
-"f.	c #0F1A2B",
-"g.	c #081125",
-"h.	c #0D1328",
-"i.	c #C2C9D1",
-"j.	c #C5CBD4",
-"k.	c #A6AEBB",
-"l.	c #F6F6F7",
-"m.	c #FAFAFA",
-"n.	c #F2F2F2",
-"o.	c #F3F3F3",
-"p.	c #AAAAAA",
-"q.	c #A0A09F",
-"r.	c #8A8A8A",
-"s.	c #7A7A7A",
-"t.	c #6C6C6C",
-"u.	c #454545",
-"v.	c #ABB3AF",
-"w.	c #A8B6A3",
-"x.	c #D0DBD0",
-"y.	c #F2F3F0",
-"z.	c #DEE1E0",
-"A.	c #66736A",
-"B.	c #354336",
-"C.	c #556254",
-"D.	c #C5C7C6",
-"E.	c #F2EDEA",
-"F.	c #CADAD9",
-"G.	c #9BA893",
-"H.	c #1B3128",
-"I.	c #FCF4EF",
-"J.	c #FDFBF9",
-"K.	c #DDDFE4",
-"L.	c #97A3B4",
-"M.	c #374152",
-"N.	c #0D131C",
-"O.	c #1C2026",
-"P.	c #262C3A",
-"Q.	c #242E43",
-"R.	c #202D41",
-"S.	c #172538",
-"T.	c #121523",
-"U.	c #BABCC3",
-"V.	c #9DA6B5",
-"W.	c #BABEC4",
-"X.	c #F8F8F7",
-"Y.	c #E7E7E7",
-"Z.	c #C6C6C5",
-"`.	c #BABAB9",
-" +	c #E7E9E9",
-".+	c #63736C",
-"++	c #464945",
-"@+	c #5F7361",
-"#+	c #CED4C3",
-"$+	c #DBDEDA",
-"%+	c #979999",
-"&+	c #404342",
-"*+	c #606E6B",
-"=+	c #E5E5E3",
-"-+	c #4B5F52",
-";+	c #455845",
-">+	c #2D362F",
-",+	c #FCFAF9",
-"'+	c #E4E4E7",
-")+	c #97A8B9",
-"!+	c #343C4A",
-"~+	c #13181E",
-"{+	c #1B2027",
-"]+	c #1D232B",
-"^+	c #1F2632",
-"/+	c #212A3C",
-"(+	c #242F45",
-"_+	c #2A374D",
-":+	c #121C2F",
-"<+	c #525A67",
-"[+	c #D9DDE5",
-"}+	c #737C8C",
-"|+	c #EAEBEB",
-"1+	c #F7F7F6",
-"2+	c #F6F6F5",
-"3+	c #F5F5F5",
-"4+	c #EDEDEB",
-"5+	c #FBFBFA",
-"6+	c #6C8175",
-"7+	c #778673",
-"8+	c #121613",
-"9+	c #4C504A",
-"0+	c #8FA695",
-"a+	c #E2DCD8",
-"b+	c #E5E6E7",
-"c+	c #FBFAF9",
-"d+	c #CAC6C1",
-"e+	c #847F79",
-"f+	c #FCFAFA",
-"g+	c #ECE9E9",
-"h+	c #A6B1C4",
-"i+	c #232B37",
-"j+	c #12171E",
-"k+	c #191F27",
-"l+	c #1D222B",
-"m+	c #1E242B",
-"n+	c #1E252F",
-"o+	c #202937",
-"p+	c #232F44",
-"q+	c #283853",
-"r+	c #253046",
-"s+	c #0A1526",
-"t+	c #D5D7DB",
-"u+	c #727D90",
-"v+	c #CFD0D2",
-"w+	c #B1B1B1",
-"x+	c #99A597",
-"y+	c #7B9173",
-"z+	c #65705D",
-"A+	c #1F201B",
-"B+	c #58655E",
-"C+	c #F3F2F1",
-"D+	c #AAB3C1",
-"E+	c #525C6D",
-"F+	c #0A0F17",
-"G+	c #1C2129",
-"H+	c #1E242A",
-"I+	c #1E242C",
-"J+	c #1F232D",
-"K+	c #232E41",
-"L+	c #2B3855",
-"M+	c #2C3B57",
-"N+	c #070D1F",
-"O+	c #A3ABB6",
-"P+	c #828EA0",
-"Q+	c #B9BCC2",
-"R+	c #F3F3F2",
-"S+	c #F1EFEC",
-"T+	c #72886D",
-"U+	c #4E5849",
-"V+	c #748268",
-"W+	c #808080",
-"X+	c #D6D9DE",
-"Y+	c #5E6A7A",
-"Z+	c #121621",
-"`+	c #161D26",
-" @	c #1D242C",
-".@	c #1F242B",
-"+@	c #1E2427",
-"@@	c #212C3F",
-"#@	c #283552",
-"$@	c #2F405D",
-"%@	c #0E162B",
-"&@	c #59657B",
-"*@	c #8A98AA",
-"=@	c #AFB4BC",
-"-@	c #F2F2F1",
-";@	c #7D9074",
-">@	c #494949",
-",@	c #676D65",
-"'@	c #C8CBC7",
-")@	c #818B9B",
-"!@	c #1B232F",
-"~@	c #0F151F",
-"{@	c #1B212B",
-"]@	c #1E232D",
-"^@	c #20252C",
-"/@	c #24272C",
-"(@	c #1F2429",
-"_@	c #1C2228",
-":@	c #1F2A3C",
-"<@	c #1F2A40",
-"[@	c #25344E",
-"}@	c #314464",
-"|@	c #15223A",
-"1@	c #34445E",
-"2@	c #939FB3",
-"3@	c #ACB2BC",
-"4@	c #F1F1F0",
-"5@	c #ECEEEB",
-"6@	c #B8BCB7",
-"7@	c #647C65",
-"8@	c #797E78",
-"9@	c #C4C3C2",
-"0@	c #919191",
-"a@	c #DCE3EA",
-"b@	c #242C3D",
-"c@	c #0B101C",
-"d@	c #1A212A",
-"e@	c #1F242C",
-"f@	c #21252C",
-"g@	c #222629",
-"h@	c #1C232A",
-"i@	c #212B3D",
-"j@	c #33415B",
-"k@	c #27344B",
-"l@	c #212F47",
-"m@	c #374A68",
-"n@	c #1A2840",
-"o@	c #34445F",
-"p@	c #96A3B5",
-"q@	c #B3B7C0",
-"r@	c #F2F2F0",
-"s@	c #F0F0F0",
-"t@	c #E2E7E2",
-"u@	c #939E92",
-"v@	c #50644E",
-"w@	c #3D443E",
-"x@	c #D4D2CF",
-"y@	c #7F8898",
-"z@	c #020A14",
-"A@	c #171E28",
-"B@	c #1C222A",
-"C@	c #1E232B",
-"D@	c #1F242D",
-"E@	c #1F2228",
-"F@	c #1D2328",
-"G@	c #283449",
-"H@	c #4A5C7B",
-"I@	c #697D98",
-"J@	c #4D5D79",
-"K@	c #1F2D45",
-"L@	c #394A6B",
-"M@	c #1B2943",
-"N@	c #425371",
-"O@	c #95A3B5",
-"P@	c #B8BDC2",
-"Q@	c #EFEFEE",
-"R@	c #EFEFED",
-"S@	c #EDEEED",
-"T@	c #EFF0F0",
-"U@	c #F7FCF3",
-"V@	c #313F30",
-"W@	c #1C2120",
-"X@	c #C9CBC9",
-"Y@	c #F9F9F8",
-"Z@	c #E9EEF2",
-"`@	c #3C4352",
-" #	c #0C111D",
-".#	c #1E232E",
-"+#	c #1D212A",
-"@#	c #20242C",
-"##	c #1B1D20",
-"$#	c #263043",
-"%#	c #576886",
-"&#	c #8396B1",
-"*#	c #7A8FAD",
-"=#	c #677B99",
-"-#	c #28374F",
-";#	c #384A69",
-">#	c #182642",
-",#	c #5D708F",
-"'#	c #828FA3",
-")#	c #C5C7CB",
-"!#	c #F1F1EF",
-"~#	c #EEEEED",
-"{#	c #EEEEEC",
-"]#	c #9DA7A4",
-"^#	c #2A3B34",
-"/#	c #222725",
-"(#	c #80807E",
-"_#	c #EFEEEC",
-":#	c #F1F0EF",
-"<#	c #F4F3F2",
-"[#	c #F8F8F8",
-"}#	c #A8AFBB",
-"|#	c #0D1522",
-"1#	c #1A212E",
-"2#	c #1D232C",
-"3#	c #21252D",
-"4#	c #1E2327",
-"5#	c #171B20",
-"6#	c #637593",
-"7#	c #95A6BE",
-"8#	c #6D7F9C",
-"9#	c #617395",
-"0#	c #5A6E8B",
-"a#	c #2A354A",
-"b#	c #3D4E6D",
-"c#	c #1C2A46",
-"d#	c #748DAB",
-"e#	c #6D798A",
-"f#	c #DEDFE0",
-"g#	c #EEEEEE",
-"h#	c #EDEDEC",
-"i#	c #ECEAE7",
-"j#	c #ADB1B0",
-"k#	c #B5B9BA",
-"l#	c #F1F0F0",
-"m#	c #F9F8F8",
-"n#	c #F7F5F4",
-"o#	c #A7AAA4",
-"p#	c #B7BAB4",
-"q#	c #F7F6F6",
-"r#	c #ECEFF1",
-"s#	c #747F8E",
-"t#	c #0A121E",
-"u#	c #232C3A",
-"v#	c #1D232E",
-"w#	c #222932",
-"x#	c #1B1D21",
-"y#	c #1C273E",
-"z#	c #C1CFE1",
-"A#	c #8FA1B7",
-"B#	c #6D81A0",
-"C#	c #596D93",
-"D#	c #455674",
-"E#	c #293343",
-"F#	c #4A5C7D",
-"G#	c #304060",
-"H#	c #7690B8",
-"I#	c #5D6878",
-"J#	c #BBC0CC",
-"K#	c #ECECEB",
-"L#	c #F6F4F3",
-"M#	c #F4F1EF",
-"N#	c #F7F5F3",
-"O#	c #F9F8F7",
-"P#	c #BBBDB9",
-"Q#	c #4D5852",
-"R#	c #71746D",
-"S#	c #F0EAE7",
-"T#	c #DBDEE3",
-"U#	c #3E495B",
-"V#	c #1C2435",
-"W#	c #273041",
-"X#	c #283040",
-"Y#	c #293141",
-"Z#	c #262B38",
-"`#	c #1D212D",
-" $	c #4A5B77",
-".$	c #CFDBEB",
-"+$	c #7A8FAC",
-"@$	c #6C83A5",
-"#$	c #4D6389",
-"$$	c #35445E",
-"%$	c #404D60",
-"&$	c #506586",
-"*$	c #4F6687",
-"=$	c #6983AB",
-"-$	c #343E50",
-";$	c #4D5F7A",
-">$	c #B8C0CC",
-",$	c #F7F6F5",
-"'$	c #D2D6D3",
-")$	c #6C866F",
-"!$	c #5A715E",
-"~$	c #566758",
-"{$	c #B5C1B4",
-"]$	c #B2BAC8",
-"^$	c #273245",
-"/$	c #29354A",
-"($	c #323D53",
-"_$	c #364258",
-":$	c #333F52",
-"<$	c #343F52",
-"[$	c #28354A",
-"}$	c #6D7B92",
-"|$	c #ACBDD2",
-"1$	c #5B7297",
-"2$	c #495F87",
-"3$	c #3A4D6B",
-"4$	c #252F44",
-"5$	c #8292AC",
-"6$	c #586E94",
-"7$	c #6782A9",
-"8$	c #37404D",
-"9$	c #394860",
-"0$	c #475977",
-"a$	c #6E7E99",
-"b$	c #EBEBEA",
-"c$	c #BEC3BE",
-"d$	c #CFD1CE",
-"e$	c #F4F2F0",
-"f$	c #7D8F84",
-"g$	c #6A8667",
-"h$	c #D5D8D4",
-"i$	c #6B6B6B",
-"j$	c #9E9E9F",
-"k$	c #7A8EA8",
-"l$	c #2B374D",
-"m$	c #313E56",
-"n$	c #34425B",
-"o$	c #36425A",
-"p$	c #354257",
-"q$	c #39465D",
-"r$	c #3B4963",
-"s$	c #64738B",
-"t$	c #768CAD",
-"u$	c #354C72",
-"v$	c #2E3D5B",
-"w$	c #1D273A",
-"x$	c #3D4655",
-"y$	c #A7BACE",
-"z$	c #607799",
-"A$	c #617494",
-"B$	c #191B1B",
-"C$	c #445675",
-"D$	c #3A4A65",
-"E$	c #6C7A91",
-"F$	c #ECECEA",
-"G$	c #EAEAE9",
-"H$	c #EAEAE8",
-"I$	c #F7F6F4",
-"J$	c #B5B9B6",
-"K$	c #D7DCD9",
-"L$	c #7B8982",
-"M$	c #A9AEAD",
-"N$	c #517257",
-"O$	c #839284",
-"P$	c #DEDEDD",
-"Q$	c #D8D9D9",
-"R$	c #F3F2EE",
-"S$	c #51698C",
-"T$	c #313F55",
-"U$	c #35435B",
-"V$	c #36445A",
-"W$	c #35425C",
-"X$	c #37465D",
-"Y$	c #3D4A62",
-"Z$	c #516079",
-"`$	c #47536A",
-" %	c #354561",
-".%	c #212F46",
-"+%	c #0F1624",
-"@%	c #1A2231",
-"#%	c #99A5B7",
-"$%	c #97A8C3",
-"%%	c #6A7DA0",
-"&%	c #394559",
-"*%	c #1C1D26",
-"=%	c #35435C",
-"-%	c #344159",
-";%	c #8E96A2",
-">%	c #E9E9E8",
-",%	c #E9E9E7",
-"'%	c #F6F5F5",
-")%	c #70827F",
-"!%	c #C6D0C3",
-"~%	c #445344",
-"{%	c #637161",
-"]%	c #4B6C4C",
-"^%	c #CAC8C8",
-"/%	c #3D5271",
-"(%	c #3A4863",
-"_%	c #384862",
-":%	c #3E4C65",
-"<%	c #424D67",
-"[%	c #45536C",
-"}%	c #4D5A74",
-"|%	c #66768F",
-"1%	c #76869D",
-"2%	c #2A3243",
-"3%	c #151A27",
-"4%	c #252C3A",
-"5%	c #B2BBCE",
-"6%	c #C3D0E3",
-"7%	c #7B8CA9",
-"8%	c #51627E",
-"9%	c #171C22",
-"0%	c #141920",
-"a%	c #242C3A",
-"b%	c #3F4B60",
-"c%	c #BDC0C6",
-"d%	c #EBEBE9",
-"e%	c #D1D7D3",
-"f%	c #4F5753",
-"g%	c #27322D",
-"h%	c #57655B",
-"i%	c #7E8B86",
-"j%	c #F0EFED",
-"k%	c #3E516C",
-"l%	c #3F4E68",
-"m%	c #3C4A64",
-"n%	c #4C5A74",
-"o%	c #55637C",
-"p%	c #5A6881",
-"q%	c #707D95",
-"r%	c #8493A6",
-"s%	c #BFC8D8",
-"t%	c #D8E4F0",
-"u%	c #CCD5E4",
-"v%	c #E2E8F1",
-"w%	c #D2DAE9",
-"x%	c #8D9DB7",
-"y%	c #526380",
-"z%	c #323E53",
-"A%	c #080B11",
-"B%	c #0E1217",
-"C%	c #272E3A",
-"D%	c #747D8A",
-"E%	c #D6D7D8",
-"F%	c #E8E8E7",
-"G%	c #E8E8E6",
-"H%	c #D2D2D0",
-"I%	c #B3B7B4",
-"J%	c #BFC1BF",
-"K%	c #EBE8E7",
-"L%	c #5A718E",
-"M%	c #3F4C65",
-"N%	c #38475F",
-"O%	c #68768E",
-"P%	c #6E7C92",
-"Q%	c #78879B",
-"R%	c #959FB1",
-"S%	c #AAB4C1",
-"T%	c #C4CBD8",
-"U%	c #D7DCE6",
-"V%	c #D3D9E1",
-"W%	c #CCD3DC",
-"X%	c #8C9CB4",
-"Y%	c #52627B",
-"Z%	c #38475E",
-"`%	c #080E1A",
-" &	c #060910",
-".&	c #0E0F14",
-"+&	c #4F5869",
-"@&	c #B6B8BC",
-"#&	c #DDDDDC",
-"$&	c #E2E2E1",
-"%&	c #E5E5E4",
-"&&	c #E6E6E5",
-"*&	c #F2F1F1",
-"=&	c #F2F1F0",
-"-&	c #93A8C2",
-";&	c #2F3E56",
-">&	c #6C7A93",
-",&	c #939EAE",
-"'&	c #A9B3C0",
-")&	c #BDC3CB",
-"!&	c #C8CCD2",
-"~&	c #CDCFD5",
-"{&	c #CBD2DB",
-"]&	c #C7CFDC",
-"^&	c #A4B2C7",
-"/&	c #4C576D",
-"(&	c #262C3C",
-"_&	c #252D3B",
-":&	c #232C3D",
-"<&	c #323B4B",
-"[&	c #464B5A",
-"}&	c #959697",
-"|&	c #BDBDBC",
-"1&	c #C9C9C9",
-"2&	c #D6D6D5",
-"3&	c #E2E2E0",
-"4&	c #E7E7E6",
-"5&	c #E6E6E4",
-"6&	c #C8D6E7",
-"7&	c #515D76",
-"8&	c #33415A",
-"9&	c #66728A",
-"0&	c #C0C7D2",
-"a&	c #CACED7",
-"b&	c #CCCDD2",
-"c&	c #CBCED1",
-"d&	c #C8CED3",
-"e&	c #C2CDDB",
-"f&	c #A2B1C5",
-"g&	c #586377",
-"h&	c #181F27",
-"i&	c #363B40",
-"j&	c #575857",
-"k&	c #626261",
-"l&	c #656463",
-"m&	c #787877",
-"n&	c #929291",
-"o&	c #9F9F9D",
-"p&	c #B0B0AE",
-"q&	c #C3C3C2",
-"r&	c #D1D1D0",
-"s&	c #DCDCDB",
-"t&	c #DFE4EB",
-"u&	c #5F708B",
-"v&	c #717E92",
-"w&	c #4F5E78",
-"x&	c #8391A4",
-"y&	c #A9B4C2",
-"z&	c #B1BBC5",
-"A&	c #BAC3CE",
-"B&	c #D5DDE8",
-"C&	c #9EA7B9",
-"D&	c #444D63",
-"E&	c #1F242F",
-"F&	c #2D2F33",
-"G&	c #424242",
-"H&	c #4D4D4D",
-"I&	c #515150",
-"J&	c #575756",
-"K&	c #60605F",
-"L&	c #747473",
-"M&	c #838381",
-"N&	c #989897",
-"O&	c #B3B3B2",
-"P&	c #C6C6C4",
-"Q&	c #D3D3D2",
-"R&	c #F0EFEE",
-"S&	c #D0D1D3",
-"T&	c #959FB4",
-"U&	c #5B697E",
-"V&	c #9DA7B7",
-"W&	c #D8DEE4",
-"X&	c #D4DAE1",
-"Y&	c #DBE1E5",
-"Z&	c #DBDDE3",
-"`&	c #818894",
-" *	c #1E293A",
-".*	c #1B222B",
-"+*	c #222425",
-"@*	c #313131",
-"#*	c #343434",
-"$*	c #363635",
-"%*	c #3A3A3A",
-"&*	c #40403F",
-"**	c #484847",
-"=*	c #585858",
-"-*	c #6B6B6A",
-";*	c #838382",
-">*	c #A5A5A3",
-",*	c #BCBCBA",
-"'*	c #CFCFCE",
-")*	c #EFEFEF",
-"!*	c #E3E3E2",
-"~*	c #D9D9D8",
-"{*	c #BCBCBB",
-"]*	c #9DA0A4",
-"^*	c #616678",
-"/*	c #2F3A4F",
-"(*	c #2C3649",
-"_*	c #394250",
-":*	c #111923",
-"<*	c #010613",
-"[*	c #0A0F16",
-"}*	c #1F2225",
-"|*	c #262628",
-"1*	c #282828",
-"2*	c #292828",
-"3*	c #292929",
-"4*	c #2D2D2C",
-"5*	c #2F2F2F",
-"6*	c #343433",
-"7*	c #3D3D3C",
-"8*	c #5C5C5C",
-"9*	c #A1A1A0",
-"0*	c #B9B9B8",
-"a*	c #CECECC",
-"b*	c #E4E4E2",
-"c*	c #D7D7D5",
-"d*	c #989896",
-"e*	c #717174",
-"f*	c #464B51",
-"g*	c #2F353C",
-"h*	c #23272C",
-"i*	c #222529",
-"j*	c #25272A",
-"k*	c #2E2F31",
-"l*	c #313030",
-"m*	c #313130",
-"n*	c #333332",
-"o*	c #363636",
-"p*	c #3C3C3C",
-"q*	c #545454",
-"r*	c #686867",
-"s*	c #848483",
-"t*	c #A8A8A7",
-"u*	c #C0C0BE",
-"v*	c #D3D3D1",
-"w*	c #D9D9D7",
-"x*	c #C0C0BF",
-"y*	c #A3A3A2",
-"z*	c #888886",
-"A*	c #6E6D6C",
-"B*	c #5F6061",
-"C*	c #585859",
-"D*	c #A3A3A1",
-"E*	c #A2A2A0",
-"F*	c #A2A1A0",
-"G*	c #A2A2A1",
-"H*	c #A3A2A1",
-"I*	c #A4A3A2",
-"J*	c #A4A4A2",
-"K*	c #A6A6A4",
-"L*	c #A9A8A6",
-"M*	c #ABAAA8",
-"N*	c #AFAEAB",
-"O*	c #B3B1AE",
-"P*	c #B5B4B1",
-"Q*	c #B8B6B2",
-"R*	c #BAB8B4",
-"S*	c #6E6B62",
-"T*	c #DEDEDC",
-"U*	c #D1D1CF",
-"V*	c #BFBFBE",
-"W*	c #AFAFAF",
-"X*	c #9F9F9F",
-"Y*	c #919190",
-"Z*	c #302E28",
-"`*	c #2E2C27",
-" =	c #2D2B26",
-".=	c #312F29",
-"+=	c #33312B",
-"@=	c #36332D",
-"#=	c #38362F",
-"$=	c #3C3932",
-"%=	c #403D35",
-"&=	c #46423A",
-"*=	c #4D4940",
-"==	c #514D44",
-"-=	c #535046",
-";=	c #565248",
-">=	c #23211D",
-",=	c #EBEAE9",
-"'=	c #DADAD9",
-")=	c #C9C9C7",
-"!=	c #B2B0AD",
-"~=	c #423F37",
-"{=	c #E3E2E1",
-"]=	c #4E4B44",
-"^=	c #403D36",
-"/=	c #413E37",
-"(=	c #908E8A",
-"_=	c #424039",
-":=	c #48443C",
-"<=	c #A09F9A",
-"[=	c #95938C",
-"}=	c #94928C",
-"|=	c #D5D5D4",
-"1=	c #B6B5B1",
-"2=	c #4E4A41",
-"3=	c #D5D4D2",
-"4=	c #514E46",
-"5=	c #5E5B52",
-"6=	c #504C43",
-"7=	c #4C493F",
-"8=	c #827F78",
-"9=	c #EDECEB",
-"0=	c #D9D9D6",
-"a=	c #D9D8D6",
-"b=	c #E7E7E5",
-"c=	c #CCCBC8",
-"d=	c #C4C2BF",
-"e=	c #C4C3BF",
-"f=	c #555147",
-"g=	c #6C6860",
-"h=	c #F0EFEF",
-"i=	c #7C7971",
-"j=	c #747169",
-"k=	c #DEDDDB",
-"l=	c #E1E1DF",
-"m=	c #67635A",
-"n=	c #F5F4F4",
-"o=	c #67645B",
-"p=	c #E2E1E0",
-"q=	c #9B9993",
-"r=	c #B9B7B3",
-"s=	c #69665D",
-"t=	c #716D65",
-"u=	c #B8B7B2",
-"v=	c #8B8881",
-"w=	c #C0BEBA",
-"x=	c #8C8982",
-"y=	c #5D5A50",
-"z=	c #5D594F",
-"A=	c #E4E4E3",
-"B=	c #989690",
-"C=	c #98958F",
-"D=	c #DDDCDA",
-"E=	c #928F89",
-"F=	c #E3E3E1",
-"G=	c #A9A9A7",
-"H=	c #8D8D8D",
-"I=	c #9A9A9A",
-"J=	c #8C8C8C",
-"  . . . . . . . . . . . . . + @ # + . . . . . . . . . . . . . . . . . $ %                       ",
-". & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * = - ; .                   ",
-". * * * * * * * * * * * * * * * * * * * > * * , , , , , , , , , , , , ' = ) ! .                 ",
-". * * * * * * ~ * * { ] ^ / ( _ : < * * * , [ [ , , , , , , , , , , , } | * 1 2 .               ",
-". * * * * * * ~ * * 3 4 5 6 7 8 9 0 * , , , , , , , , , , , , , , , , } a * * ) b c             ",
-". * * * * * * * * * d e f g h i j k , , , , , l , , , , , , , , , m m = n * m * o p q           ",
-". * * * * * * * * * * r s t u v w x , , , , , l , , y z A m m m m m m B C * D E * F G .         ",
-". * * * * * * * * * * H I J K L M N , , , , l m z O P Q R S T ' E E E U V W X F n Y Z ` .       ",
-". * * * * * * * * m  ...+.@., #.$.%., , , , &.*.=.-.;.>.,.'.).!.~.E d {.].^./.(._._.:.<..       ",
-". * * * * [. .m * }.|.1.2.3.4.5.6.7.8.m 9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.! p.q.r.s.t.u..       ",
-". * * , n.v.w.x.y.z.A.B.C.D.E.F.G.H.I.m J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.D ' } } Y.Z.Z `.s..       ",
-". * * ,  +.+++@+#+$+%+&+*+=+E -+;+>+,+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+} X.1+2+3+3+3+4+<..       ",
-". * * , 5+6+7+8+9+0+1 a+b+c+E d+e+` f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+= } 3+3+B B o.o.w+.       ",
-". * , , 9.x+y+z+A+B+c+E E E E E E d C+D+E+F+G+l+m+H+I+J+K+L+M+N+O+P+Q+B B B U {.o.R+R+C .       ",
-". * m m m S+T+U+V+W+X.E E d ' ' ' ' X+Y+Z+`+ @I+.@.@+@^+@@#@$@%@&@*@=@o.U {.R+R+R+-@-@C .       ",
-". * m #.E ' ;@>@,@'@5+' ' ' ' 5+5+m.)@!@~@{@]@^@/@(@_@:@<@[@}@|@1@2@3@{.R+R+n.n.-@4@4@C .       ",
-". * E ' 5@6@7@8@9@0@} ' 5+5+m.m.m.a@b@c@d@l+e@f@g@h@i@j@k@l@m@n@o@p@q@n.n.-@r@4@4@s@s@C .       ",
-". * d [.t@u@v@w@x@{.m.m.m.m.m.[.m.y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@-@-@r@s@s@< Q@R@C .       ",
-". * ' S@T@U@V@W@X@m.m.[.[.[.D Y@Z@`@ #.#+#@#D@##$#%#&#*#=#-#;#>#,#'#)#4@!#< < Q@~#~#{#C .       ",
-". * 5+3+]#^#/#(#_#[.D :#<#D X.[#}#|#1#2#3#f@4#5#6#7#8#9#0#a#b#c#d#e#f#< < g#g#~#{#h#h#C .       ",
-". * m.X.i#j#k#l#m#D n#o#p#q#} r#s#t#u#v#w#^@x#y#z#A#B#C#D#E#F#G#H#I#J#|+~#~#{#h#h#W K#C .       ",
-". * [.L#M#N#[#O#O#1+P#Q#R#S#1+T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$>${#h#4+4+K#K#K#C .       ",
-". * D ,$X.Y@[#[#} '$)$!$~${$3+]$^$/$($_$:$<$[$}$|$1$2$3$4$5$6$7$8$9$0$a$4+4+K#K#b$b$b$C .       ",
-". * [#[#[#n#c$d$e$f$g$h$i$j${.k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$K#F$b$b$b$G$H$C .       ",
-". * X.1+I$J$K$L$M$N$O$< P$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%b$b$b$G$>%>%,%C .       ",
-". * = = '%)%!%~%{%]%^%o.R+R+{./%(%_%:%<%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c%d%>%>%>%,%,%,%C .       ",
-". * 2+2+2+e%f%g%h%i%j%R+-@1 -@k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%A%B%C%D%E%F%F%>%,%F%F%G%C .       ",
-". * 3+U {.{.H%I%J%K%-@4@4@4@4@L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &.&+&@&#&$&%&&&F%G%G%G%C .       ",
-". * {.{.R+n.*&=&=&4@4@4@s@< Q@-&M%;&>&,&'&)&!&~&{&]&^&/&(&_&:&<&[&}&|&1&2&#&3&4&4&4&5&C .       ",
-". * n.-@-@-@-@4@4@s@< < < ~#b$6&7&8&9&0&a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&4&5&5&%&C .       ",
-". * -@-@-@4@< < < < < Q@R@G$%&t&u&v&w&x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&%&%&%&%&C .       ",
-". * 1 4@< < j%R&Q@Q@R@~#h#&&P$S&T&U&V&W&X&Y&Z&`& *.*+*@*#*$*%*&***=*-*;*>*,*'*%&=+=+=+C .       ",
-". * < < )*Q@Q@Q@R@~#~#K#G$!*~*{*]*^*/*(*_*:*<*[*}*|*1*2*3*4*5*6*7*>@8*m&9*0*a*=+=+=+b*C .       ",
-". * Q@Q@Q@Q@R@~#{#K#K#K#>%!*c*,*d*e*f*g*h*i*j*k*l*m*5*@*@*n*o*p*u.q*r*s*t*u*v*=+=+b*b*C .       ",
-". * Q@Q@~#~#{#K#K#K#K#b$>%!*w*x*y*z*A*B*C*D*E*E*E*E*F*E*G*H*I*J*K*L*M*N*O*P*Q*R*R*R*R*R*R*R*R*S*",
-". * ~#~#4+K#K#F$b$b$b$b$H$5&T*U*V*W*X*N&Y*M*Z*Z*`* = =`*Z*.=+=@=#=$=%=&=*===-=;=;=;=;=;=;=;=;=>=",
-". * 4+K#F$,=,=,=b$d%d%G$H$G%b*'=H%)=x*{*0*!=~=* {=]=^=/=(=* * *=_=:=<=* * ;=;=;=[=* * }=;=;=;=>=",
-". * F$b$b$b$d%G$G$G$G$H$H$G%5&3&#&~*|=Q&Q&1=2=* * 3=4=5={.* * 6=7=8=9=* * ;=;=;=0=* * a=;=;=;=>=",
-". * d%d%G$G$G$G$G$H$H$G%G%G%G%b=b=b=b=b=&&R*;=* c=* d=e=c=* * f=g=h=i=* * ;=;=j=* k=l=* j=;=;=>=",
-". * G$G$G$H$H$>%>%F%G%G%G%b=b=b=b=b=5&5&=+R*;=* m={.* n=o=* * ;=p=q=;=* * ;=;=r=< s=t=X.u=;=;=>=",
-". * H$>%>%>%>%F%G%G%4&4&b=b=b=b=5&5&=+=+=+R*;=* ;=v=w=x=;=* * ;=* * * * * * y=B * * * * B z=;=>=",
-". * >%>%>%G%4&4&4&4&b=b=b=&&&&5&=+=+=+=+A=R*;=* ;=;=;=;=;=* * ;=;=;=;=* * ;=B=* 3=;=;=3=* C=;=>=",
-". * ,%4&4&4&4&b=b=b=&&&&&&5&=+=+=+A=A=b*b*R*;=* ;=;=;=;=;=* * ;=;=;=;=* * ;=D=* E=;=;=E=* D=;=>=",
-". * 4&b=b=b=&&&&&&&&5&5&=+A=A=A=b*b*b*b*b*R*;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=;=>=",
-". * b=&&&&&&5&5&5&5&A=A=b*b*b*b*b*b*b*b*b*S*>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=",
-". * &&5&5&5&5&%&A=b*b*b*b*b*b*b*b*b*b*F=F=F=G=G=p p p y*y*y*y*D*D*D*D*D*D*D*D*D*D*D*D*H=.       ",
-". & 5&5&5&=+b*b*b*b*b*b*b*b*b*b*!*F=F=F=F=F=F=F=F=3&3&3&3&l=l=l=l=l=l=l=l=l=l=l=l=l=l=I=.       ",
-". Y C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C I=J=.       ",
-"  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       ",
-"                                                                                                ",
-"                                                                                                ",
-"                                                                                                "};
--- a/src/aac/src/mp4_utils.c	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * some functions for MP4 files
-*/
-
-#include "mp4ff.h"
-#include "faad.h"
-
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "audacious/plugin.h"
-#include "audacious/util.h"
-
-const char *mp4AudioNames[]=
-  {
-    "MPEG-1 Audio Layers 1,2 or 3",
-    "MPEG-2 low biterate (MPEG-1 extension) - MP3",
-    "MPEG-2 AAC Main Profile",
-    "MPEG-2 AAC Low Complexity profile",
-    "MPEG-2 AAC SSR profile",
-    "MPEG-4 audio (MPEG-4 AAC)",
-    0
-  };
-
-/* MPEG-4 Audio types from 14496-3 Table 1.5.1 (from mp4.h)*/
-const char *mpeg4AudioNames[]=
-  {
-    "!!!!MPEG-4 Audio track Invalid !!!!!!!",
-    "MPEG-4 AAC Main profile",
-    "MPEG-4 AAC Low Complexity profile",
-    "MPEG-4 AAC SSR profile",
-    "MPEG-4 AAC Long Term Prediction profile",
-    "MPEG-4 AAC Scalable",
-    "MPEG-4 CELP",
-    "MPEG-4 HVXC",
-    "MPEG-4 Text To Speech",
-    "MPEG-4 Main Synthetic profile",
-    "MPEG-4 Wavetable Synthesis profile",
-    "MPEG-4 MIDI Profile",
-    "MPEG-4 Algorithmic Synthesis and Audio FX profile"
-  };
-
-/*
- * find AAC track
- */
-
-int getAACTrack(mp4ff_t *infile)
-{
-  int i, rc;
-  int numTracks = mp4ff_total_tracks(infile);
-
-  for(i=0; i<numTracks; i++){
-    unsigned char*	buff = 0;
-    unsigned int	buff_size = 0;
-    mp4AudioSpecificConfig mp4ASC;
-
-    mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
-    if(buff){
-      rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
-      g_free(buff);
-      if(rc < 0)
-	continue;
-      return(i);
-    }
-  }
-  return(-1);
-}
--- a/src/aac/src/tagging.h	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Audacious -- Cross-platform Multimedia Player
- * Copyright (c) 2005 William Pitcock <nenolod@nenolod.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _AUDMP4_TAGGING_H
-#define _AUDMP4_TAGGING_H
-
-#include <glib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "mp4ff.h"
-#include "xmms-id3.h"
-
-/* XXX: We will need the same for AAC eventually */
-extern gchar *audmp4_get_artist(mp4ff_t *);
-extern gchar *audmp4_get_title(mp4ff_t *);
-extern gchar *audmp4_get_album(mp4ff_t *);
-extern gchar *audmp4_get_genre(mp4ff_t *);
-extern gint   audmp4_get_year(mp4ff_t *);
-
-#define GENRE_MAX 0x94
-extern const char *audmp4_id3_genres[GENRE_MAX];
-
-#endif
--- a/src/aac/src/tagging_mp4.c	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Audacious -- Cross-platform Multimedia Player
- * Copyright (c) 2005-2006 William Pitcock <nenolod@nenolod.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <glib.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include "tagging.h"
-
-gchar *audmp4_get_artist(mp4ff_t *file)
-{
-	gchar *value;
-
-	mp4ff_meta_get_artist(file, &value);
-
-	return value;
-}
-
-gchar *audmp4_get_title(mp4ff_t *file)
-{
-	gchar *value;
-
-	mp4ff_meta_get_title(file, &value);
-
-	return value;
-}
-
-gchar *audmp4_get_album(mp4ff_t *file)
-{
-	gchar *value;
-
-	mp4ff_meta_get_album(file, &value);
-
-	return value;
-}
-
-gchar *audmp4_get_genre(mp4ff_t *file)
-{
-	gchar *value;
-
-	mp4ff_meta_get_genre(file, &value);
-
-	return value;
-}
-
-gint audmp4_get_year(mp4ff_t *file)
-{
-	gchar *value;
-
-	mp4ff_meta_get_date(file, &value);
-
-	if (!value)
-		return 0;
-
-	return atoi(value);
-}
--- a/src/aac/src/xmms-id3.h	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,367 +0,0 @@
-/*********************************************************************
- * 
- *    Copyright (C) 1998, 1999, 2002,  Espen Skoglund
- *    Department of Computer Science, University of Tromsø
- * 
- * Filename:      id3.h
- * Description:   Include file for accessing the ID3 library.
- * Author:        Espen Skoglund <espensk@stud.cs.uit.no>
- * Created at:    Thu Nov  5 15:55:10 1998
- *                
- * $Id: xmms-id3.h,v 1.1 2004/07/20 21:47:22 descender Exp $
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *                
- ********************************************************************/
-#ifndef ID3_H
-#define ID3_H
-
-#include <glib.h>
-#include <audacious/vfs.h>
-
-/*
- * Option flags to id3_open_*().
- */
-#define ID3_OPENF_NONE		0x0000
-#define ID3_OPENF_NOCHK		0x0001
-#define ID3_OPENF_CREATE	0x0002
-
-
-/*
- * The size of the read buffer used by file operations.
- */
-#define ID3_FD_BUFSIZE	8192
-
-
-/*
- * Structure describing the ID3 tag.
- */
-struct id3_tag {
-    int id3_type;               /* Memory or file desriptor */
-    int id3_oflags;             /* Flags from open call */
-    int id3_flags;              /* Flags from tag header */
-    int id3_altered;            /* Set when tag has been altered */
-    int id3_newtag;             /* Set if this is a new tag */
-
-    int id3_version;            /* Major ID3 version number */
-    int id3_revision;           /* ID3 revision number */
-
-    int id3_tagsize;            /* Total size of ID3 tag */
-    int id3_pos;                /* Current position within tag */
-
-    char *id3_error_msg;        /* Last error message */
-
-    char id3_buffer[256];       /* Used for various strings */
-
-    union {
-        /*
-         * Memory specific fields.
-         */
-        struct {
-            void *id3_ptr;
-        } me;
-
-        /*
-         * File desc. specific fields.
-         */
-        struct {
-            int id3_fd;
-            void *id3_buf;
-        } fd;
-
-        /*
-         * File ptr. specific fields.
-         */
-        struct {
-            VFSFile *id3_fp;
-            void *id3_buf;
-        } fp;
-    } s;
-
-    /*
-     * Functions for doing operations within ID3 tag.
-     */
-    int (*id3_seek) (struct id3_tag *, int);
-    void *(*id3_read) (struct id3_tag *, void *, int);
-
-    /*
-     * Linked list of ID3 frames.
-     */
-    GList *id3_frame;
-};
-
-#define ID3_TYPE_NONE	0
-#define ID3_TYPE_MEM	1
-#define ID3_TYPE_FD	2
-#define ID3_TYPE_FP	3
-
-
-/*
- * Structure describing an ID3 frame.
- */
-struct id3_frame {
-    struct id3_tag *fr_owner;
-    struct id3_framedesc *fr_desc;
-    int fr_flags;
-    unsigned char fr_encryption;
-    unsigned char fr_grouping;
-    unsigned char fr_altered;
-
-    void *fr_data;              /* Pointer to frame data, excluding headers */
-    int fr_size;                /* Size of uncompressed frame */
-
-    void *fr_raw_data;          /* Frame data */
-    int fr_raw_size;            /* Frame size */
-
-    void *fr_data_z;            /* The decompressed compressed frame */
-    int fr_size_z;              /* Size of decompressed compressed frame */
-};
-
-
-/*
- * Structure describing an ID3 frame type.
- */
-struct id3_framedesc {
-    guint32 fd_id;
-    char fd_idstr[4];
-    char *fd_description;
-};
-
-
-/*
- * Text encodings.
- */
-#define ID3_ENCODING_ISO_8859_1	0x00
-#define ID3_ENCODING_UTF16	0x01
-#define ID3_ENCODING_UTF16BE	0x02
-#define ID3_ENCODING_UTF8	0x03
-
-
-
-/*
- * ID3 frame id numbers.
- */
-#define ID3_FRAME_ID(a,b,c,d)   ((a << 24) | (b << 16) | (c << 8) | d)
-
-#define ID3_AENC	ID3_FRAME_ID('A','E','N','C')
-#define ID3_APIC	ID3_FRAME_ID('A','P','I','C')
-#define ID3_ASPI	ID3_FRAME_ID('A','S','P','I')
-#define ID3_COMM	ID3_FRAME_ID('C','O','M','M')
-#define ID3_COMR	ID3_FRAME_ID('C','O','M','R')
-#define ID3_ENCR	ID3_FRAME_ID('E','N','C','R')
-#define ID3_EQUA	ID3_FRAME_ID('E','Q','U','A')
-#define ID3_EQU2	ID3_FRAME_ID('E','Q','U','2')
-#define ID3_ETCO	ID3_FRAME_ID('E','T','C','O')
-#define ID3_GEOB	ID3_FRAME_ID('G','E','O','B')
-#define ID3_GRID	ID3_FRAME_ID('G','R','I','D')
-#define ID3_IPLS	ID3_FRAME_ID('I','P','L','S')
-#define ID3_LINK	ID3_FRAME_ID('L','I','N','K')
-#define ID3_MCDI	ID3_FRAME_ID('M','C','D','I')
-#define ID3_MLLT	ID3_FRAME_ID('M','L','L','T')
-#define ID3_OWNE	ID3_FRAME_ID('O','W','N','E')
-#define ID3_PRIV	ID3_FRAME_ID('P','R','I','V')
-#define ID3_PCNT	ID3_FRAME_ID('P','C','N','T')
-#define ID3_POPM	ID3_FRAME_ID('P','O','P','M')
-#define ID3_POSS	ID3_FRAME_ID('P','O','S','S')
-#define ID3_RBUF	ID3_FRAME_ID('R','B','U','F')
-#define ID3_RVAD	ID3_FRAME_ID('R','V','A','D')
-#define ID3_RVA2	ID3_FRAME_ID('R','V','A','2')
-#define ID3_RVRB	ID3_FRAME_ID('R','V','R','B')
-#define ID3_SEEK	ID3_FRAME_ID('S','E','E','K')
-#define ID3_SIGN	ID3_FRAME_ID('S','I','G','N')
-#define ID3_SYLT	ID3_FRAME_ID('S','Y','L','T')
-#define ID3_SYTC	ID3_FRAME_ID('S','Y','T','C')
-#define ID3_TALB	ID3_FRAME_ID('T','A','L','B')
-#define ID3_TBPM	ID3_FRAME_ID('T','B','P','M')
-#define ID3_TCOM	ID3_FRAME_ID('T','C','O','M')
-#define ID3_TCON	ID3_FRAME_ID('T','C','O','N')
-#define ID3_TCOP	ID3_FRAME_ID('T','C','O','P')
-#define ID3_TDAT	ID3_FRAME_ID('T','D','A','T')
-#define ID3_TDEN	ID3_FRAME_ID('T','D','E','N')
-#define ID3_TDLY	ID3_FRAME_ID('T','D','L','Y')
-#define ID3_TDOR	ID3_FRAME_ID('T','D','O','R')
-#define ID3_TDRC	ID3_FRAME_ID('T','D','R','C')
-#define ID3_TDRL	ID3_FRAME_ID('T','D','R','L')
-#define ID3_TDTG	ID3_FRAME_ID('T','D','T','G')
-#define ID3_TENC	ID3_FRAME_ID('T','E','N','C')
-#define ID3_TEXT	ID3_FRAME_ID('T','E','X','T')
-#define ID3_TFLT	ID3_FRAME_ID('T','F','L','T')
-#define ID3_TIME	ID3_FRAME_ID('T','I','M','E')
-#define ID3_TIPL	ID3_FRAME_ID('T','I','P','L')
-#define ID3_TIT1	ID3_FRAME_ID('T','I','T','1')
-#define ID3_TIT2	ID3_FRAME_ID('T','I','T','2')
-#define ID3_TIT3	ID3_FRAME_ID('T','I','T','3')
-#define ID3_TKEY	ID3_FRAME_ID('T','K','E','Y')
-#define ID3_TLAN	ID3_FRAME_ID('T','L','A','N')
-#define ID3_TLEN	ID3_FRAME_ID('T','L','E','N')
-#define ID3_TMCL	ID3_FRAME_ID('T','M','C','L')
-#define ID3_TMED	ID3_FRAME_ID('T','M','E','D')
-#define ID3_TMOO	ID3_FRAME_ID('T','M','O','O')
-#define ID3_TOAL	ID3_FRAME_ID('T','O','A','L')
-#define ID3_TOFN	ID3_FRAME_ID('T','O','F','N')
-#define ID3_TOLY	ID3_FRAME_ID('T','O','L','Y')
-#define ID3_TOPE	ID3_FRAME_ID('T','O','P','E')
-#define ID3_TORY	ID3_FRAME_ID('T','O','R','Y')
-#define ID3_TOWN	ID3_FRAME_ID('T','O','W','N')
-#define ID3_TPE1	ID3_FRAME_ID('T','P','E','1')
-#define ID3_TPE2	ID3_FRAME_ID('T','P','E','2')
-#define ID3_TPE3	ID3_FRAME_ID('T','P','E','3')
-#define ID3_TPE4	ID3_FRAME_ID('T','P','E','4')
-#define ID3_TPOS	ID3_FRAME_ID('T','P','O','S')
-#define ID3_TPRO	ID3_FRAME_ID('T','P','R','O')
-#define ID3_TPUB	ID3_FRAME_ID('T','P','U','B')
-#define ID3_TRCK	ID3_FRAME_ID('T','R','C','K')
-#define ID3_TRDA	ID3_FRAME_ID('T','R','D','A')
-#define ID3_TRSN	ID3_FRAME_ID('T','R','S','N')
-#define ID3_TRSO	ID3_FRAME_ID('T','R','S','O')
-#define ID3_TSIZ	ID3_FRAME_ID('T','S','I','Z')
-#define ID3_TSOA	ID3_FRAME_ID('T','S','O','A')
-#define ID3_TSOP	ID3_FRAME_ID('T','S','O','P')
-#define ID3_TSOT	ID3_FRAME_ID('T','S','O','T')
-#define ID3_TSRC	ID3_FRAME_ID('T','S','R','C')
-#define ID3_TSSE	ID3_FRAME_ID('T','S','S','E')
-#define ID3_TSST	ID3_FRAME_ID('T','S','S','T')
-#define ID3_TYER	ID3_FRAME_ID('T','Y','E','R')
-#define ID3_TXXX	ID3_FRAME_ID('T','X','X','X')
-#define ID3_UFID	ID3_FRAME_ID('U','F','I','D')
-#define ID3_USER	ID3_FRAME_ID('U','S','E','R')
-#define ID3_USLT	ID3_FRAME_ID('U','S','L','T')
-#define ID3_WCOM	ID3_FRAME_ID('W','C','O','M')
-#define ID3_WCOP	ID3_FRAME_ID('W','C','O','P')
-#define ID3_WOAF	ID3_FRAME_ID('W','O','A','F')
-#define ID3_WOAR	ID3_FRAME_ID('W','O','A','R')
-#define ID3_WOAS	ID3_FRAME_ID('W','O','A','S')
-#define ID3_WORS	ID3_FRAME_ID('W','O','R','S')
-#define ID3_WPAY	ID3_FRAME_ID('W','P','A','Y')
-#define ID3_WPUB	ID3_FRAME_ID('W','P','U','B')
-#define ID3_WXXX	ID3_FRAME_ID('W','X','X','X')
-
-/*
- * Version 2.2.0 
- */
-
-#define ID3_FRAME_ID_22(a, b, c)   ((a << 16) | (b << 8) | c)
-
-#define ID3_BUF ID3_FRAME_ID_22('B', 'U', 'F')
-#define ID3_CNT ID3_FRAME_ID_22('C', 'N', 'T')
-#define ID3_COM ID3_FRAME_ID_22('C', 'O', 'M')
-#define ID3_CRA ID3_FRAME_ID_22('C', 'R', 'A')
-#define ID3_CRM ID3_FRAME_ID_22('C', 'R', 'M')
-#define ID3_ETC ID3_FRAME_ID_22('E', 'T', 'C')
-#define ID3_EQU ID3_FRAME_ID_22('E', 'Q', 'U')
-#define ID3_GEO ID3_FRAME_ID_22('G', 'E', 'O')
-#define ID3_IPL ID3_FRAME_ID_22('I', 'P', 'L')
-#define ID3_LNK ID3_FRAME_ID_22('L', 'N', 'K')
-#define ID3_MCI ID3_FRAME_ID_22('M', 'C', 'I')
-#define ID3_MLL ID3_FRAME_ID_22('M', 'L', 'L')
-#define ID3_PIC ID3_FRAME_ID_22('P', 'I', 'C')
-#define ID3_POP ID3_FRAME_ID_22('P', 'O', 'P')
-#define ID3_REV ID3_FRAME_ID_22('R', 'E', 'V')
-#define ID3_RVA ID3_FRAME_ID_22('R', 'V', 'A')
-#define ID3_SLT ID3_FRAME_ID_22('S', 'L', 'T')
-#define ID3_STC ID3_FRAME_ID_22('S', 'T', 'C')
-#define ID3_TAL ID3_FRAME_ID_22('T', 'A', 'L')
-#define ID3_TBP ID3_FRAME_ID_22('T', 'B', 'P')
-#define ID3_TCM ID3_FRAME_ID_22('T', 'C', 'M')
-#define ID3_TCO ID3_FRAME_ID_22('T', 'C', 'O')
-#define ID3_TCR ID3_FRAME_ID_22('T', 'C', 'R')
-#define ID3_TDA ID3_FRAME_ID_22('T', 'D', 'A')
-#define ID3_TDY ID3_FRAME_ID_22('T', 'D', 'Y')
-#define ID3_TEN ID3_FRAME_ID_22('T', 'E', 'N')
-#define ID3_TFT ID3_FRAME_ID_22('T', 'F', 'T')
-#define ID3_TIM ID3_FRAME_ID_22('T', 'I', 'M')
-#define ID3_TKE ID3_FRAME_ID_22('T', 'K', 'E')
-#define ID3_TLA ID3_FRAME_ID_22('T', 'L', 'A')
-#define ID3_TLE ID3_FRAME_ID_22('T', 'L', 'E')
-#define ID3_TMT ID3_FRAME_ID_22('T', 'M', 'T')
-#define ID3_TOA ID3_FRAME_ID_22('T', 'O', 'A')
-#define ID3_TOF ID3_FRAME_ID_22('T', 'O', 'F')
-#define ID3_TOL ID3_FRAME_ID_22('T', 'O', 'L')
-#define ID3_TOR ID3_FRAME_ID_22('T', 'O', 'R')
-#define ID3_TOT ID3_FRAME_ID_22('T', 'O', 'T')
-#define ID3_TP1 ID3_FRAME_ID_22('T', 'P', '1')
-#define ID3_TP2 ID3_FRAME_ID_22('T', 'P', '2')
-#define ID3_TP3 ID3_FRAME_ID_22('T', 'P', '3')
-#define ID3_TP4 ID3_FRAME_ID_22('T', 'P', '4')
-#define ID3_TPA ID3_FRAME_ID_22('T', 'P', 'A')
-#define ID3_TPB ID3_FRAME_ID_22('T', 'P', 'B')
-#define ID3_TRC ID3_FRAME_ID_22('T', 'R', 'C')
-#define ID3_TRD ID3_FRAME_ID_22('T', 'R', 'D')
-#define ID3_TRK ID3_FRAME_ID_22('T', 'R', 'K')
-#define ID3_TSI ID3_FRAME_ID_22('T', 'S', 'I')
-#define ID3_TSS ID3_FRAME_ID_22('T', 'S', 'S')
-#define ID3_TT1 ID3_FRAME_ID_22('T', 'T', '1')
-#define ID3_TT2 ID3_FRAME_ID_22('T', 'T', '2')
-#define ID3_TT3 ID3_FRAME_ID_22('T', 'T', '3')
-#define ID3_TXT ID3_FRAME_ID_22('T', 'X', 'T')
-#define ID3_TXX ID3_FRAME_ID_22('T', 'X', 'X')
-#define ID3_TYE ID3_FRAME_ID_22('T', 'Y', 'E')
-#define ID3_UFI ID3_FRAME_ID_22('U', 'F', 'I')
-#define ID3_ULT ID3_FRAME_ID_22('U', 'L', 'T')
-#define ID3_WAF ID3_FRAME_ID_22('W', 'A', 'F')
-#define ID3_WAR ID3_FRAME_ID_22('W', 'A', 'R')
-#define ID3_WAS ID3_FRAME_ID_22('W', 'A', 'S')
-#define ID3_WCM ID3_FRAME_ID_22('W', 'C', 'M')
-#define ID3_WCP ID3_FRAME_ID_22('W', 'C', 'P')
-#define ID3_WPB ID3_FRAME_ID_22('W', 'P', 'B')
-#define ID3_WXX ID3_FRAME_ID_22('W', 'X', 'X')
-
-
-/*
- * Prototypes.
- */
-
-/* From id3.c */
-struct id3_tag *id3_open_mem(void *, int);
-struct id3_tag *id3_open_fd(int, int);
-struct id3_tag *id3_open_fp(VFSFile *, int);
-int id3_set_output(struct id3_tag *, char *);
-int id3_close(struct id3_tag *);
-int id3_tell(struct id3_tag *);
-int id3_alter_file(struct id3_tag *);
-int id3_write_tag(struct id3_tag *, int);
-
-/* From id3_frame.c */
-int id3_read_frame(struct id3_tag *id3);
-struct id3_frame *id3_get_frame(struct id3_tag *, guint32, int);
-int id3_delete_frame(struct id3_frame *frame);
-struct id3_frame *id3_add_frame(struct id3_tag *, guint32);
-int id3_decompress_frame(struct id3_frame *);
-void id3_destroy_frames(struct id3_tag *id);
-void id3_frame_clear_data(struct id3_frame *frame);
-
-/* From id3_frame_text.c */
-char *id3_utf16_to_ascii(void *);
-gint8 id3_get_encoding(struct id3_frame *);
-int id3_set_encoding(struct id3_frame *, gint8);
-char *id3_get_text(struct id3_frame *);
-char *id3_get_text_desc(struct id3_frame *);
-int id3_get_text_number(struct id3_frame *);
-int id3_set_text(struct id3_frame *, char *);
-int id3_set_text_number(struct id3_frame *, int);
-gboolean id3_frame_is_text(struct id3_frame *frame);
-
-/* From id3_frame_content.c */
-char *id3_get_content(struct id3_frame *);
-
-/* From id3_frame_url.c */
-char *id3_get_url(struct id3_frame *);
-char *id3_get_url_desc(struct id3_frame *);
-
-/* From id3_tag.c */
-void id3_init_tag(struct id3_tag *id3);
-int id3_read_tag(struct id3_tag *id3);
-
-#endif                          /* ID3_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aac/tagging.h	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,40 @@
+/*
+ * Audacious -- Cross-platform Multimedia Player
+ * Copyright (c) 2005 William Pitcock <nenolod@nenolod.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _AUDMP4_TAGGING_H
+#define _AUDMP4_TAGGING_H
+
+#include <glib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "mp4ff.h"
+#include "xmms-id3.h"
+
+/* XXX: We will need the same for AAC eventually */
+extern gchar *audmp4_get_artist(mp4ff_t *);
+extern gchar *audmp4_get_title(mp4ff_t *);
+extern gchar *audmp4_get_album(mp4ff_t *);
+extern gchar *audmp4_get_genre(mp4ff_t *);
+extern gint   audmp4_get_year(mp4ff_t *);
+
+#define GENRE_MAX 0x94
+extern const char *audmp4_id3_genres[GENRE_MAX];
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aac/tagging_mp4.c	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,73 @@
+/*
+ * Audacious -- Cross-platform Multimedia Player
+ * Copyright (c) 2005-2006 William Pitcock <nenolod@nenolod.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <glib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "tagging.h"
+
+gchar *audmp4_get_artist(mp4ff_t *file)
+{
+	gchar *value;
+
+	mp4ff_meta_get_artist(file, &value);
+
+	return value;
+}
+
+gchar *audmp4_get_title(mp4ff_t *file)
+{
+	gchar *value;
+
+	mp4ff_meta_get_title(file, &value);
+
+	return value;
+}
+
+gchar *audmp4_get_album(mp4ff_t *file)
+{
+	gchar *value;
+
+	mp4ff_meta_get_album(file, &value);
+
+	return value;
+}
+
+gchar *audmp4_get_genre(mp4ff_t *file)
+{
+	gchar *value;
+
+	mp4ff_meta_get_genre(file, &value);
+
+	return value;
+}
+
+gint audmp4_get_year(mp4ff_t *file)
+{
+	gchar *value;
+
+	mp4ff_meta_get_date(file, &value);
+
+	if (!value)
+		return 0;
+
+	return atoi(value);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aac/xmms-id3.h	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,367 @@
+/*********************************************************************
+ * 
+ *    Copyright (C) 1998, 1999, 2002,  Espen Skoglund
+ *    Department of Computer Science, University of Tromsø
+ * 
+ * Filename:      id3.h
+ * Description:   Include file for accessing the ID3 library.
+ * Author:        Espen Skoglund <espensk@stud.cs.uit.no>
+ * Created at:    Thu Nov  5 15:55:10 1998
+ *                
+ * $Id: xmms-id3.h,v 1.1 2004/07/20 21:47:22 descender Exp $
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *                
+ ********************************************************************/
+#ifndef ID3_H
+#define ID3_H
+
+#include <glib.h>
+#include <audacious/vfs.h>
+
+/*
+ * Option flags to id3_open_*().
+ */
+#define ID3_OPENF_NONE		0x0000
+#define ID3_OPENF_NOCHK		0x0001
+#define ID3_OPENF_CREATE	0x0002
+
+
+/*
+ * The size of the read buffer used by file operations.
+ */
+#define ID3_FD_BUFSIZE	8192
+
+
+/*
+ * Structure describing the ID3 tag.
+ */
+struct id3_tag {
+    int id3_type;               /* Memory or file desriptor */
+    int id3_oflags;             /* Flags from open call */
+    int id3_flags;              /* Flags from tag header */
+    int id3_altered;            /* Set when tag has been altered */
+    int id3_newtag;             /* Set if this is a new tag */
+
+    int id3_version;            /* Major ID3 version number */
+    int id3_revision;           /* ID3 revision number */
+
+    int id3_tagsize;            /* Total size of ID3 tag */
+    int id3_pos;                /* Current position within tag */
+
+    char *id3_error_msg;        /* Last error message */
+
+    char id3_buffer[256];       /* Used for various strings */
+
+    union {
+        /*
+         * Memory specific fields.
+         */
+        struct {
+            void *id3_ptr;
+        } me;
+
+        /*
+         * File desc. specific fields.
+         */
+        struct {
+            int id3_fd;
+            void *id3_buf;
+        } fd;
+
+        /*
+         * File ptr. specific fields.
+         */
+        struct {
+            VFSFile *id3_fp;
+            void *id3_buf;
+        } fp;
+    } s;
+
+    /*
+     * Functions for doing operations within ID3 tag.
+     */
+    int (*id3_seek) (struct id3_tag *, int);
+    void *(*id3_read) (struct id3_tag *, void *, int);
+
+    /*
+     * Linked list of ID3 frames.
+     */
+    GList *id3_frame;
+};
+
+#define ID3_TYPE_NONE	0
+#define ID3_TYPE_MEM	1
+#define ID3_TYPE_FD	2
+#define ID3_TYPE_FP	3
+
+
+/*
+ * Structure describing an ID3 frame.
+ */
+struct id3_frame {
+    struct id3_tag *fr_owner;
+    struct id3_framedesc *fr_desc;
+    int fr_flags;
+    unsigned char fr_encryption;
+    unsigned char fr_grouping;
+    unsigned char fr_altered;
+
+    void *fr_data;              /* Pointer to frame data, excluding headers */
+    int fr_size;                /* Size of uncompressed frame */
+
+    void *fr_raw_data;          /* Frame data */
+    int fr_raw_size;            /* Frame size */
+
+    void *fr_data_z;            /* The decompressed compressed frame */
+    int fr_size_z;              /* Size of decompressed compressed frame */
+};
+
+
+/*
+ * Structure describing an ID3 frame type.
+ */
+struct id3_framedesc {
+    guint32 fd_id;
+    char fd_idstr[4];
+    char *fd_description;
+};
+
+
+/*
+ * Text encodings.
+ */
+#define ID3_ENCODING_ISO_8859_1	0x00
+#define ID3_ENCODING_UTF16	0x01
+#define ID3_ENCODING_UTF16BE	0x02
+#define ID3_ENCODING_UTF8	0x03
+
+
+
+/*
+ * ID3 frame id numbers.
+ */
+#define ID3_FRAME_ID(a,b,c,d)   ((a << 24) | (b << 16) | (c << 8) | d)
+
+#define ID3_AENC	ID3_FRAME_ID('A','E','N','C')
+#define ID3_APIC	ID3_FRAME_ID('A','P','I','C')
+#define ID3_ASPI	ID3_FRAME_ID('A','S','P','I')
+#define ID3_COMM	ID3_FRAME_ID('C','O','M','M')
+#define ID3_COMR	ID3_FRAME_ID('C','O','M','R')
+#define ID3_ENCR	ID3_FRAME_ID('E','N','C','R')
+#define ID3_EQUA	ID3_FRAME_ID('E','Q','U','A')
+#define ID3_EQU2	ID3_FRAME_ID('E','Q','U','2')
+#define ID3_ETCO	ID3_FRAME_ID('E','T','C','O')
+#define ID3_GEOB	ID3_FRAME_ID('G','E','O','B')
+#define ID3_GRID	ID3_FRAME_ID('G','R','I','D')
+#define ID3_IPLS	ID3_FRAME_ID('I','P','L','S')
+#define ID3_LINK	ID3_FRAME_ID('L','I','N','K')
+#define ID3_MCDI	ID3_FRAME_ID('M','C','D','I')
+#define ID3_MLLT	ID3_FRAME_ID('M','L','L','T')
+#define ID3_OWNE	ID3_FRAME_ID('O','W','N','E')
+#define ID3_PRIV	ID3_FRAME_ID('P','R','I','V')
+#define ID3_PCNT	ID3_FRAME_ID('P','C','N','T')
+#define ID3_POPM	ID3_FRAME_ID('P','O','P','M')
+#define ID3_POSS	ID3_FRAME_ID('P','O','S','S')
+#define ID3_RBUF	ID3_FRAME_ID('R','B','U','F')
+#define ID3_RVAD	ID3_FRAME_ID('R','V','A','D')
+#define ID3_RVA2	ID3_FRAME_ID('R','V','A','2')
+#define ID3_RVRB	ID3_FRAME_ID('R','V','R','B')
+#define ID3_SEEK	ID3_FRAME_ID('S','E','E','K')
+#define ID3_SIGN	ID3_FRAME_ID('S','I','G','N')
+#define ID3_SYLT	ID3_FRAME_ID('S','Y','L','T')
+#define ID3_SYTC	ID3_FRAME_ID('S','Y','T','C')
+#define ID3_TALB	ID3_FRAME_ID('T','A','L','B')
+#define ID3_TBPM	ID3_FRAME_ID('T','B','P','M')
+#define ID3_TCOM	ID3_FRAME_ID('T','C','O','M')
+#define ID3_TCON	ID3_FRAME_ID('T','C','O','N')
+#define ID3_TCOP	ID3_FRAME_ID('T','C','O','P')
+#define ID3_TDAT	ID3_FRAME_ID('T','D','A','T')
+#define ID3_TDEN	ID3_FRAME_ID('T','D','E','N')
+#define ID3_TDLY	ID3_FRAME_ID('T','D','L','Y')
+#define ID3_TDOR	ID3_FRAME_ID('T','D','O','R')
+#define ID3_TDRC	ID3_FRAME_ID('T','D','R','C')
+#define ID3_TDRL	ID3_FRAME_ID('T','D','R','L')
+#define ID3_TDTG	ID3_FRAME_ID('T','D','T','G')
+#define ID3_TENC	ID3_FRAME_ID('T','E','N','C')
+#define ID3_TEXT	ID3_FRAME_ID('T','E','X','T')
+#define ID3_TFLT	ID3_FRAME_ID('T','F','L','T')
+#define ID3_TIME	ID3_FRAME_ID('T','I','M','E')
+#define ID3_TIPL	ID3_FRAME_ID('T','I','P','L')
+#define ID3_TIT1	ID3_FRAME_ID('T','I','T','1')
+#define ID3_TIT2	ID3_FRAME_ID('T','I','T','2')
+#define ID3_TIT3	ID3_FRAME_ID('T','I','T','3')
+#define ID3_TKEY	ID3_FRAME_ID('T','K','E','Y')
+#define ID3_TLAN	ID3_FRAME_ID('T','L','A','N')
+#define ID3_TLEN	ID3_FRAME_ID('T','L','E','N')
+#define ID3_TMCL	ID3_FRAME_ID('T','M','C','L')
+#define ID3_TMED	ID3_FRAME_ID('T','M','E','D')
+#define ID3_TMOO	ID3_FRAME_ID('T','M','O','O')
+#define ID3_TOAL	ID3_FRAME_ID('T','O','A','L')
+#define ID3_TOFN	ID3_FRAME_ID('T','O','F','N')
+#define ID3_TOLY	ID3_FRAME_ID('T','O','L','Y')
+#define ID3_TOPE	ID3_FRAME_ID('T','O','P','E')
+#define ID3_TORY	ID3_FRAME_ID('T','O','R','Y')
+#define ID3_TOWN	ID3_FRAME_ID('T','O','W','N')
+#define ID3_TPE1	ID3_FRAME_ID('T','P','E','1')
+#define ID3_TPE2	ID3_FRAME_ID('T','P','E','2')
+#define ID3_TPE3	ID3_FRAME_ID('T','P','E','3')
+#define ID3_TPE4	ID3_FRAME_ID('T','P','E','4')
+#define ID3_TPOS	ID3_FRAME_ID('T','P','O','S')
+#define ID3_TPRO	ID3_FRAME_ID('T','P','R','O')
+#define ID3_TPUB	ID3_FRAME_ID('T','P','U','B')
+#define ID3_TRCK	ID3_FRAME_ID('T','R','C','K')
+#define ID3_TRDA	ID3_FRAME_ID('T','R','D','A')
+#define ID3_TRSN	ID3_FRAME_ID('T','R','S','N')
+#define ID3_TRSO	ID3_FRAME_ID('T','R','S','O')
+#define ID3_TSIZ	ID3_FRAME_ID('T','S','I','Z')
+#define ID3_TSOA	ID3_FRAME_ID('T','S','O','A')
+#define ID3_TSOP	ID3_FRAME_ID('T','S','O','P')
+#define ID3_TSOT	ID3_FRAME_ID('T','S','O','T')
+#define ID3_TSRC	ID3_FRAME_ID('T','S','R','C')
+#define ID3_TSSE	ID3_FRAME_ID('T','S','S','E')
+#define ID3_TSST	ID3_FRAME_ID('T','S','S','T')
+#define ID3_TYER	ID3_FRAME_ID('T','Y','E','R')
+#define ID3_TXXX	ID3_FRAME_ID('T','X','X','X')
+#define ID3_UFID	ID3_FRAME_ID('U','F','I','D')
+#define ID3_USER	ID3_FRAME_ID('U','S','E','R')
+#define ID3_USLT	ID3_FRAME_ID('U','S','L','T')
+#define ID3_WCOM	ID3_FRAME_ID('W','C','O','M')
+#define ID3_WCOP	ID3_FRAME_ID('W','C','O','P')
+#define ID3_WOAF	ID3_FRAME_ID('W','O','A','F')
+#define ID3_WOAR	ID3_FRAME_ID('W','O','A','R')
+#define ID3_WOAS	ID3_FRAME_ID('W','O','A','S')
+#define ID3_WORS	ID3_FRAME_ID('W','O','R','S')
+#define ID3_WPAY	ID3_FRAME_ID('W','P','A','Y')
+#define ID3_WPUB	ID3_FRAME_ID('W','P','U','B')
+#define ID3_WXXX	ID3_FRAME_ID('W','X','X','X')
+
+/*
+ * Version 2.2.0 
+ */
+
+#define ID3_FRAME_ID_22(a, b, c)   ((a << 16) | (b << 8) | c)
+
+#define ID3_BUF ID3_FRAME_ID_22('B', 'U', 'F')
+#define ID3_CNT ID3_FRAME_ID_22('C', 'N', 'T')
+#define ID3_COM ID3_FRAME_ID_22('C', 'O', 'M')
+#define ID3_CRA ID3_FRAME_ID_22('C', 'R', 'A')
+#define ID3_CRM ID3_FRAME_ID_22('C', 'R', 'M')
+#define ID3_ETC ID3_FRAME_ID_22('E', 'T', 'C')
+#define ID3_EQU ID3_FRAME_ID_22('E', 'Q', 'U')
+#define ID3_GEO ID3_FRAME_ID_22('G', 'E', 'O')
+#define ID3_IPL ID3_FRAME_ID_22('I', 'P', 'L')
+#define ID3_LNK ID3_FRAME_ID_22('L', 'N', 'K')
+#define ID3_MCI ID3_FRAME_ID_22('M', 'C', 'I')
+#define ID3_MLL ID3_FRAME_ID_22('M', 'L', 'L')
+#define ID3_PIC ID3_FRAME_ID_22('P', 'I', 'C')
+#define ID3_POP ID3_FRAME_ID_22('P', 'O', 'P')
+#define ID3_REV ID3_FRAME_ID_22('R', 'E', 'V')
+#define ID3_RVA ID3_FRAME_ID_22('R', 'V', 'A')
+#define ID3_SLT ID3_FRAME_ID_22('S', 'L', 'T')
+#define ID3_STC ID3_FRAME_ID_22('S', 'T', 'C')
+#define ID3_TAL ID3_FRAME_ID_22('T', 'A', 'L')
+#define ID3_TBP ID3_FRAME_ID_22('T', 'B', 'P')
+#define ID3_TCM ID3_FRAME_ID_22('T', 'C', 'M')
+#define ID3_TCO ID3_FRAME_ID_22('T', 'C', 'O')
+#define ID3_TCR ID3_FRAME_ID_22('T', 'C', 'R')
+#define ID3_TDA ID3_FRAME_ID_22('T', 'D', 'A')
+#define ID3_TDY ID3_FRAME_ID_22('T', 'D', 'Y')
+#define ID3_TEN ID3_FRAME_ID_22('T', 'E', 'N')
+#define ID3_TFT ID3_FRAME_ID_22('T', 'F', 'T')
+#define ID3_TIM ID3_FRAME_ID_22('T', 'I', 'M')
+#define ID3_TKE ID3_FRAME_ID_22('T', 'K', 'E')
+#define ID3_TLA ID3_FRAME_ID_22('T', 'L', 'A')
+#define ID3_TLE ID3_FRAME_ID_22('T', 'L', 'E')
+#define ID3_TMT ID3_FRAME_ID_22('T', 'M', 'T')
+#define ID3_TOA ID3_FRAME_ID_22('T', 'O', 'A')
+#define ID3_TOF ID3_FRAME_ID_22('T', 'O', 'F')
+#define ID3_TOL ID3_FRAME_ID_22('T', 'O', 'L')
+#define ID3_TOR ID3_FRAME_ID_22('T', 'O', 'R')
+#define ID3_TOT ID3_FRAME_ID_22('T', 'O', 'T')
+#define ID3_TP1 ID3_FRAME_ID_22('T', 'P', '1')
+#define ID3_TP2 ID3_FRAME_ID_22('T', 'P', '2')
+#define ID3_TP3 ID3_FRAME_ID_22('T', 'P', '3')
+#define ID3_TP4 ID3_FRAME_ID_22('T', 'P', '4')
+#define ID3_TPA ID3_FRAME_ID_22('T', 'P', 'A')
+#define ID3_TPB ID3_FRAME_ID_22('T', 'P', 'B')
+#define ID3_TRC ID3_FRAME_ID_22('T', 'R', 'C')
+#define ID3_TRD ID3_FRAME_ID_22('T', 'R', 'D')
+#define ID3_TRK ID3_FRAME_ID_22('T', 'R', 'K')
+#define ID3_TSI ID3_FRAME_ID_22('T', 'S', 'I')
+#define ID3_TSS ID3_FRAME_ID_22('T', 'S', 'S')
+#define ID3_TT1 ID3_FRAME_ID_22('T', 'T', '1')
+#define ID3_TT2 ID3_FRAME_ID_22('T', 'T', '2')
+#define ID3_TT3 ID3_FRAME_ID_22('T', 'T', '3')
+#define ID3_TXT ID3_FRAME_ID_22('T', 'X', 'T')
+#define ID3_TXX ID3_FRAME_ID_22('T', 'X', 'X')
+#define ID3_TYE ID3_FRAME_ID_22('T', 'Y', 'E')
+#define ID3_UFI ID3_FRAME_ID_22('U', 'F', 'I')
+#define ID3_ULT ID3_FRAME_ID_22('U', 'L', 'T')
+#define ID3_WAF ID3_FRAME_ID_22('W', 'A', 'F')
+#define ID3_WAR ID3_FRAME_ID_22('W', 'A', 'R')
+#define ID3_WAS ID3_FRAME_ID_22('W', 'A', 'S')
+#define ID3_WCM ID3_FRAME_ID_22('W', 'C', 'M')
+#define ID3_WCP ID3_FRAME_ID_22('W', 'C', 'P')
+#define ID3_WPB ID3_FRAME_ID_22('W', 'P', 'B')
+#define ID3_WXX ID3_FRAME_ID_22('W', 'X', 'X')
+
+
+/*
+ * Prototypes.
+ */
+
+/* From id3.c */
+struct id3_tag *id3_open_mem(void *, int);
+struct id3_tag *id3_open_fd(int, int);
+struct id3_tag *id3_open_fp(VFSFile *, int);
+int id3_set_output(struct id3_tag *, char *);
+int id3_close(struct id3_tag *);
+int id3_tell(struct id3_tag *);
+int id3_alter_file(struct id3_tag *);
+int id3_write_tag(struct id3_tag *, int);
+
+/* From id3_frame.c */
+int id3_read_frame(struct id3_tag *id3);
+struct id3_frame *id3_get_frame(struct id3_tag *, guint32, int);
+int id3_delete_frame(struct id3_frame *frame);
+struct id3_frame *id3_add_frame(struct id3_tag *, guint32);
+int id3_decompress_frame(struct id3_frame *);
+void id3_destroy_frames(struct id3_tag *id);
+void id3_frame_clear_data(struct id3_frame *frame);
+
+/* From id3_frame_text.c */
+char *id3_utf16_to_ascii(void *);
+gint8 id3_get_encoding(struct id3_frame *);
+int id3_set_encoding(struct id3_frame *, gint8);
+char *id3_get_text(struct id3_frame *);
+char *id3_get_text_desc(struct id3_frame *);
+int id3_get_text_number(struct id3_frame *);
+int id3_set_text(struct id3_frame *, char *);
+int id3_set_text_number(struct id3_frame *, int);
+gboolean id3_frame_is_text(struct id3_frame *frame);
+
+/* From id3_frame_content.c */
+char *id3_get_content(struct id3_frame *);
+
+/* From id3_frame_url.c */
+char *id3_get_url(struct id3_frame *);
+char *id3_get_url_desc(struct id3_frame *);
+
+/* From id3_tag.c */
+void id3_init_tag(struct id3_tag *id3);
+int id3_read_tag(struct id3_tag *id3);
+
+#endif                          /* ID3_H */
--- a/src/alac/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/alac/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,11 +1,14 @@
 PLUGIN = alac${PLUGIN_SUFFIX}
-SRCS = alac.c demux.c plugin.c stream.c
+SRCS = alac.c	\
+       demux.c	\
+       plugin.c	\
+       stream.c
 
 plugindir = audacious/${INPUT_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/alarm/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/alarm/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,5 +1,6 @@
 PLUGIN = alarm${PLUGIN_SUFFIX}
-SRCS = alarm.c interface.c
+SRCS = alarm.c	\
+       interface.c
 
 plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
--- a/src/alsa/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/alsa/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,5 +1,9 @@
 PLUGIN = ALSA${PLUGIN_SUFFIX}
-SRCS = alsa.c about.c audio.c configure.c init.c
+SRCS = alsa.c		\
+       about.c		\
+       audio.c		\
+       configure.c	\
+       init.c
 
 plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
--- a/src/arts/arts_helper/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/arts/arts_helper/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -4,7 +4,6 @@
 include ../../../buildsys.mk
 include ../../../extra.mk
 
-LDFLAGS += -Wl,-export-dynamic
+CPPFLAGS += ${ARTSC_CFLAGS} -I../../../intl -I../../..
 LIBS += ${ARTSC_LIBS}
-
-CPPFLAGS += ${ARTSC_CFLAGS} -I../../../intl -I../../..
+LDFLAGS += -Wl,-export-dynamic
--- a/src/blur_scope/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/blur_scope/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,5 +1,6 @@
 PLUGIN = blur_scope${PLUGIN_SUFFIX}
-SRCS = blur_scope.c config.c
+SRCS = blur_scope.c	\
+       config.c
 
 plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
--- a/src/dockalbumart/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/dockalbumart/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -8,4 +8,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/esd/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/esd/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,13 +1,16 @@
 PLUGIN = ESD${PLUGIN_SUFFIX}
-SRCS = esd.c mixer.c about.c configure.c audio.c init.c
+SRCS = esd.c		\
+       mixer.c		\
+       about.c		\
+       configure.c	\
+       audio.c		\
+       init.c
 
 plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ESD_CFLAGS} -I../../intl -I../.. -I..
 CFLAGS += ${PLUGIN_CFLAGS}
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${ESD_LIBS} ${OSS_LIBS}
--- a/src/evdev-plug/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/evdev-plug/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,5 +1,8 @@
 PLUGIN = evdev-plug${PLUGIN_SUFFIX}
-SRCS = ed.c  ed_bindings_store.c  ed_internals.c  ed_ui.c
+SRCS = ed.c			\
+       ed_bindings_store.c	\
+       ed_internals.c		\
+       ed_ui.c
 
 plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
@@ -8,4 +11,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/filewriter/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/filewriter/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,15 @@
+PLUGIN = filewriter${SHARED_SUFFIX}
+SRCS = filewriter.c	\
+       wav.c		\
+       mp3.c		\
+       vorbis.c		\
+       flac.c
+
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = filewriter$(SHARED_SUFFIX)
-plugindir = audacious/$(OUTPUT_PLUGIN_DIR)
-
-SRCS = filewriter.c wav.c mp3.c vorbis.c flac.c
-
-include ../../buildsys.mk
-
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(PANGO_CFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) -I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) ${FILEWRITER_LIBS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GLIB_CFLAGS} ${GTK_CFLAGS} ${PANGO_CFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${FILEWRITER_LIBS}
--- a/src/flacng/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/flacng/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,15 +1,14 @@
-include ../../extra.mk
+PLUGIN = flacng${SHARED_SUFFIX}
+SRCS = plugin.c				\
+       tools.c				\
+       seekable_stream_callbacks.c	\
+       flac_compat112.c
 
-PLUGIN = flacng$(SHARED_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = plugin.c tools.c seekable_stream_callbacks.c flac_compat112.c
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
 include ../../buildsys.mk
-
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(LIBFLAC_LIBS)
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. $(LIBFLAC_CFLAGS) -Wall
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. ${LIBFLAC_CFLAGS}
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${LIBFLAC_LIBS}
--- a/src/gnomeshortcuts/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/gnomeshortcuts/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,11 +1,11 @@
-PLUGIN = gnomeshortcuts$(PLUGIN_SUFFIX)
-plugindir = audacious/$(GENERAL_PLUGIN_DIR)
+PLUGIN = gnomeshortcuts${PLUGIN_SUFFIX}
+SRCS = gnomeshortcuts.c
 
-SRCS = gnomeshortcuts.c
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-LIBADD = $(GLIB_LIBS) $(DBUS_LIBS)
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GTK_CFLAGS) $(MOWGLI_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) -I../../intl -I../.. -I..
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${MOWGLI_CFLAGS} ${GLIB_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. -I..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GLIB_LIBS} ${DBUS_LIBS}
--- a/src/hotkey/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/hotkey/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,11 +1,11 @@
-PLUGIN = hotkey$(PLUGIN_SUFFIX)
-plugindir = audacious/$(GENERAL_PLUGIN_DIR)
+PLUGIN = hotkey${PLUGIN_SUFFIX}
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
 SRCS = plugin.c
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-LIBADD = $(GLIB_LIBS) $(DBUS_LIBS)
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GTK_CFLAGS) $(MOWGLI_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) -I../../intl -I../.. -I..
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${MOWGLI_CFLAGS} ${GLIB_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. -I..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GLIB_LIBS} ${DBUS_LIBS}
--- a/src/jack/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/jack/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -8,6 +8,6 @@
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${MOWGLI_CFLAGS} ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${SAMPLERATE_CFLAGS} -I../../intl -I../..
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${SAMPLERATE_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${JACK_LIBS} ${SAMPLERATE_LIBS} -pthread
--- a/src/ladspa/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/ladspa/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -8,4 +8,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/lastfm/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/lastfm/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,11 @@
-PLUGIN = lastfm$(PLUGIN_SUFFIX)
-plugindir = audacious/$(TRANSPORT_PLUGIN_DIR)
+PLUGIN = lastfm${PLUGIN_SUFFIX}
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
 SRCS = lastfm.c
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) \
-	$(CURL_CFLAGS) -I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS) $(CURL_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${CURL_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} ${CURL_LIBS}
--- a/src/m3u/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/m3u/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,11 @@
-PLUGIN = m3u$(PLUGIN_SUFFIX)
-plugindir = audacious/$(CONTAINER_PLUGIN_DIR)
+PLUGIN = m3u${PLUGIN_SUFFIX}
+SRCS = m3u.c
 
-SRCS = m3u.c
+plugindir = audacious/${CONTAINER_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) \
-	-I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../.. -Wall
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS}
--- a/src/metronom/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/metronom/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,11 @@
+PLUGIN = metronom${SHARED_SUFFIX}
+SRCS = metronom.c
+
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = metronom$(SHARED_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = metronom.c
-
-include ../../buildsys.mk
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../.. -Wall
-CPPFLAGS = $(CFLAGS)
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/mms/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/mms/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,11 @@
-PLUGIN = mms$(PLUGIN_SUFFIX)
-plugindir = audacious/$(TRANSPORT_PLUGIN_DIR)
+PLUGIN = mms${PLUGIN_SUFFIX}
+SRCS = mms.c
 
-SRCS = mms.c
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) \
-	$(MMS_CFLAGS) -I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS) $(MMS_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${MMS_CFLAGS} -I../../intl -I../.. -Wall
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} ${MMS_LIBS}
--- a/src/modplug/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/modplug/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,52 +1,56 @@
+PLUGIN = modplug${PLUGIN_SUFFIX}
+SRCS = plugin.cxx		\
+       modplugbmp.cxx		\
+       tables.cxx		\
+       sndmix.cxx		\
+       sndfile.cxx		\
+       snd_fx.cxx		\
+       snd_flt.cxx		\
+       snd_dsp.cxx		\
+       fastmix.cxx		\
+       mmcmp.cxx		\
+       load_xm.cxx		\
+       load_wav.cxx		\
+       load_umx.cxx		\
+       load_ult.cxx		\
+       load_stm.cxx		\
+       load_s3m.cxx		\
+       load_ptm.cxx		\
+       load_okt.cxx		\
+       load_mtm.cxx		\
+       load_mod.cxx		\
+       load_med.cxx		\
+       load_mdl.cxx		\
+       load_it.cxx		\
+       load_far.cxx		\
+       load_dsm.cxx		\
+       load_dmf.cxx		\
+       load_dbm.cxx		\
+       load_ams.cxx		\
+       load_amf.cxx		\
+       load_669.cxx		\
+       load_j2b.cxx		\
+       load_mt2.cxx		\
+       load_psm.cxx		\
+       modplug.cxx		\
+       archive/archive.cxx	\
+       archive/open.cxx		\
+       archive/arch_raw.cxx	\
+       archive/arch_gzip.cxx	\
+       archive/arch_zip.cxx	\
+       archive/arch_rar.cxx	\
+       archive/arch_bz2.cxx	\
+       gui/main.cxx		\
+       gui/support.cxx		\
+       gui/interface.cxx	\
+       gui/callbacks.cxx
+
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = modplug$(SHARED_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SOURCES.plugin  = plugin.cxx modplugbmp.cxx
-SOURCES.core = tables.cxx         \
-               sndmix.cxx         \
-               sndfile.cxx        \
-               snd_fx.cxx         \
-               snd_flt.cxx        \
-               snd_dsp.cxx        \
-               fastmix.cxx        \
-               mmcmp.cxx          \
-               load_xm.cxx        \
-               load_wav.cxx       \
-               load_umx.cxx       \
-               load_ult.cxx       \
-               load_stm.cxx       \
-               load_s3m.cxx       \
-               load_ptm.cxx       \
-               load_okt.cxx       \
-               load_mtm.cxx       \
-               load_mod.cxx       \
-               load_med.cxx       \
-               load_mdl.cxx       \
-               load_it.cxx        \
-               load_far.cxx       \
-               load_dsm.cxx       \
-               load_dmf.cxx       \
-               load_dbm.cxx       \
-               load_ams.cxx       \
-               load_amf.cxx       \
-               load_669.cxx       \
-               load_j2b.cxx       \
-               load_mt2.cxx       \
-               load_psm.cxx       \
-               modplug.cxx
-
-SRCS = ${SOURCES.core} ${SOURCES.plugin}
-
-LIBDEP = gui/libgui.a archive/libarchive.a
-
-include ../../buildsys.mk
-
-CXXFLAGS += $(PLUGIN_CFLAGS)
-CFLAGS   += $(PLUGIN_CFLAGS)
-
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I.. -I../.. -I../../intl
-LIBS     += $(MOWGLI_LIBS) $(DBUS_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -lstdc++ ./archive/libarchive.a ./gui/libgui.a
-
-SUBDIRS = archive gui
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I.. -I../.. -I../../intl
+CFLAGS += ${PLUGIN_CFLAGS}
+CXXFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${MOWGLI_LIBS} ${DBUS_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/modplug/archive/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-include ../../../extra.mk
-
-STATIC_LIB_NOINST = libarchive.a
-
-SRCS = archive.cxx     \
-          open.cxx        \
-          arch_raw.cxx    \
-          arch_gzip.cxx   \
-          arch_zip.cxx    \
-          arch_rar.cxx    \
-          arch_bz2.cxx
-
-include ../../../buildsys.mk
-
-CPPFLAGS += -I../../.. $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(AUDACIOUS_CFLAGS)
-CXXFLAGS += $(PLUGIN_CFLAGS) 
--- a/src/musepack/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/musepack/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,13 +1,11 @@
-include ../../extra.mk
-
-PLUGIN = musepack$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
+PLUGIN = musepack${PLUGIN_SUFFIX}
 SRCS = libmpc.cxx
 
-include ../../buildsys.mk
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-LIBS += -lmpcdec $(TAGLIB_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+include ../../buildsys.mk
+include ../../extra.mk
 
-CXXFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(TAGLIB_CFLAGS) -I../../intl -I../..
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${TAGLIB_CFLAGS} -I../../intl -I../..
+CXXFLAGS += ${PLUGIN_CFLAGS}
+LIBS += -lmpcdec ${TAGLIB_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/neon/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/neon/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,12 @@
-PLUGIN = neon$(PLUGIN_SUFFIX)
-plugindir = audacious/$(TRANSPORT_PLUGIN_DIR)
+PLUGIN = neon${PLUGIN_SUFFIX}
+SRCS = neon.c	\
+       rb.c
 
-SRCS = neon.c rb.c
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) \
-	$(NEON_CFLAGS) -I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS) $(NEON_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${NEON_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} ${NEON_LIBS}
--- a/src/null/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/null/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,13 +1,11 @@
-include ../../extra.mk
-
 PLUGIN = null${PLUGIN_SUFFIX}
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 SRCS = null.c
 
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
+
 include ../../buildsys.mk
+include ../../extra.mk
 
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} ${MOWGLI_CFLAGS} -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-CPPFLAGS += ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} ${MOWGLI_CFLAGS} -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
-
--- a/src/paranormal/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/paranormal/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,31 +1,32 @@
-PLUGIN = paranormal$(PLUGIN_SUFFIX)
-plugindir = audacious/$(VISUALIZATION_PLUGIN_DIR)
+SUBDIRS = presets
 
-SRCS =			\
-	actuators.c		\
-	beatdetect.c		\
-	builtins.c		\
-	cfg.c			\
-	cmaps.c			\
-	containers.c		\
-	drawing.c		\
-	freq.c			\
-	general.c		\
-	misc.c			\
-	paranormal.c		\
-	plugin.c		\
-	presets.c		\
-	wave.c			\
-	xform.c
+PLUGIN = paranormal${PLUGIN_SUFFIX}
+SRCS = actuators.c		\
+       beatdetect.c		\
+       builtins.c		\
+       cfg.c			\
+       cmaps.c			\
+       containers.c		\
+       drawing.c		\
+       freq.c			\
+       general.c		\
+       misc.c			\
+       paranormal.c		\
+       plugin.c			\
+       presets.c		\
+       wave.c			\
+       xform.c			\
+       libcalc/dict.c		\
+       libcalc/execute.c	\
+       libcalc/function.c	\
+       libcalc/parser.c		\
+       libcalc/storage.c
 
-EXT_DEPS = libcalc/libcalc.a
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-SUBDIRS = libcalc presets
-
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) $(SDL_CFLAGS) -I../../intl \
-	-I../.. -I.
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS) $(SDL_LIBS) libcalc/libcalc.a
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${SDL_CFLAGS} -I../../intl -I../.. -I.
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} ${SDL_LIBS}
--- a/src/paranormal/libcalc/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-STATIC_LIB_NOINST = libcalc.a
-
-SRCS = dict.c  execute.c  function.c  parser.c  storage.c
-
-include ../../../extra.mk
-include ../../../buildsys.mk
-
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GTK_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) $(SDL_CFLAGS) -I../../intl -I../..
--- a/src/pls/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/pls/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,11 @@
-PLUGIN = pls$(PLUGIN_SUFFIX)
-plugindir = audacious/$(CONTAINER_PLUGIN_DIR)
+PLUGIN = pls${PLUGIN_SUFFIX}
+SRCS = pls.c
 
-SRCS = pls.c
+plugindir = audacious/${CONTAINER_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) \
-	-I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS}
--- a/src/projectm/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/projectm/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,10 +1,12 @@
-PLUGIN = projectm$(PLUGIN_SUFFIX)
-plugindir = audacious/$(VISUALIZATION_PLUGIN_DIR)
-SRCS = main.c video_init.c
+PLUGIN = projectm${PLUGIN_SUFFIX}
+SRCS = main.c		\
+       video_init.c
+
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(SDL_LIBS) $(LIBPROJECTM_LIBS) -lprojectM
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) $(SDL_CFLAGS) $(LIBPROJECTM_CFLAGS) -I../../intl -I../..
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${SDL_CFLAGS} ${LIBPROJECTM_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${SDL_LIBS} ${LIBPROJECTM_LIBS} -lprojectM
--- a/src/rocklight/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/rocklight/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,5 +1,7 @@
 PLUGIN = rocklight${PLUGIN_SUFFIX}
-SRCS = rocklight.c sysled.c thinklight.c
+SRCS = rocklight.c	\
+       sysled.c		\
+       thinklight.c
 
 plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
@@ -8,4 +10,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/scrobbler/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/scrobbler/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,26 +1,22 @@
+PLUGIN = scrobbler${PLUGIN_SUFFIX}
+SRCS = fmt.c			\
+       configure.c		\
+       gtkstuff.c		\
+       md5.c			\
+       scrobbler.c		\
+       gerpok.c			\
+       plugin.c
+
+DATA = images/audioscrobbler.png	\
+       images/audioscrobbler_badge.png
+
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = scrobbler$(SHARED_SUFFIX)
-plugindir = audacious/$(GENERAL_PLUGIN_DIR)
-
-DATA = images/audioscrobbler.png images/audioscrobbler_badge.png
-
-SRCS = 			\
-	fmt.c			\
-	configure.c		\
-	gtkstuff.c		\
-	md5.c			\
-	scrobbler.c		\
-	gerpok.c		\
-	plugin.c
-
-include ../../buildsys.mk
-
-# XXX: used to get install paths right
 PACKAGE = audacious
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BEEP_DEFINES) $(CURL_CFLAGS) \
-	-I../../intl -I../..
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(CURL_LIBS) $(MUSICBRAINZ_LIBS)
-
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${BEEP_DEFINES} ${CURL_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${CURL_LIBS} ${MUSICBRAINZ_LIBS}
--- a/src/sexypsf/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/sexypsf/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,28 +1,22 @@
+PLUGIN = sexypsf${PLUGIN_SUFFIX}
+SRCS = PsxBios.c 	\
+       PsxCounters.c	\
+       PsxDma.c		\
+       Spu.c		\
+       PsxMem.c		\
+       PsxHw.c		\
+       Misc.c		\
+       R3000A.c		\
+       PsxInterpreter.c	\
+       PsxHLE.c		\
+       spu/spu.c	\
+       plugin.c
+
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = sexypsf$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = \
-	PsxBios.c \
-	PsxCounters.c \
-	PsxDma.c \
-	Spu.c \
-	PsxMem.c \
-	PsxHw.c \
-	Misc.c \
-	R3000A.c \
-	PsxInterpreter.c \
-	PsxHLE.c \
-	spu/spu.c \
-	plugin.c
-
-LIBS += -lz $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-include ../../buildsys.mk
-
-CPPFLAGS += $(MOWGLI_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. -Ispu/ -I.
-CFLAGS += $(PLUGIN_CFLAGS)
-
-clean-posthook:
-	@rm -f spu/*.o
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. -Ispu/ -I.
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += -lz ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/smb/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/smb/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,11 @@
-PLUGIN = smb$(PLUGIN_SUFFIX)
-plugindir = audacious/$(TRANSPORT_PLUGIN_DIR)
+PLUGIN = smb${PLUGIN_SUFFIX}
+SRCS = smb.c
 
-SRCS = smb.c
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) \
-	-I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS) -lsmbclient
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} -lsmbclient
--- a/src/sndstretch/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/sndstretch/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,10 @@
-PLUGIN = sndstretch$(PLUGIN_SUFFIX)
-plugindir = audacious/$(EFFECT_PLUGIN_DIR)
-
+PLUGIN = sndstretch${PLUGIN_SUFFIX}
 SRCS = sndstretch_xmms.c sndstretch.c
 
-include ../../extra.mk
-include ../../buildsys.mk
+plugindir = audacious/${EFFECT_PLUGIN_DIR}
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(MOWGLI_CFLAGS) $(PANGO_CFLAGS) \
-	-I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${MOWGLI_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
--- a/src/song_change/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/song_change/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -8,4 +8,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/spectrum/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/spectrum/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -8,4 +8,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/statusicon/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/statusicon/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,5 +1,8 @@
 PLUGIN = statusicon${PLUGIN_SUFFIX}
-SRCS = gtktrayicon-x11.c  si.c  si_cfg.c  si_ui.c
+SRCS = gtktrayicon-x11.c	\
+       si.c			\
+       si_cfg.c			\
+       si_ui.c
 
 plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
@@ -8,4 +11,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/stdio/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/stdio/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,11 @@
-PLUGIN = stdio$(PLUGIN_SUFFIX)
-plugindir = audacious/$(TRANSPORT_PLUGIN_DIR)
+PLUGIN = stdio${PLUGIN_SUFFIX}
+SRCS = stdio.c
 
-SRCS = stdio.c
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) \
-	-I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS}
--- a/src/stereo_plugin/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/stereo_plugin/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -8,4 +8,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/timidity/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/timidity/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,3 +1,24 @@
-include ../../buildsys.mk
+PLUGIN = timidity${PLUGIN_SUFFIX}
+SRCS = callbacks.c			\
+       interface.c			\
+       xmms-timidity.c			\
+       libtimidity/common.c		\
+       libtimidity/instrum.c		\
+       libtimidity/instrum_dls.c	\
+       libtimidity/mix.c		\
+       libtimidity/output.c		\
+       libtimidity/playmidi.c		\
+       libtimidity/readmidi.c		\
+       libtimidity/resample.c		\
+       libtimidity/stream.c		\
+       libtimidity/tables.c		\
+       libtimidity/timidity.c
 
-SUBDIRS = libtimidity src
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../../buildsys.mk
+include ../../../extra.mk
+
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../.. -I./libtimidity
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/timidity/callbacks.c	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,9 @@
+#include <config.h>
+
+#include <gtk/gtk.h>
+
+#include "callbacks.h"
+#include "interface.h"
+#include "interface.h"
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/timidity/callbacks.h	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,2 @@
+#include <gtk/gtk.h>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/timidity/interface.c	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,245 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+
+#include <audacious/i18n.h>
+
+#include "callbacks.h"
+#include "interface.h"
+#include "interface.h"
+
+GtkWidget*
+create_xmmstimid_conf_wnd (void)
+{
+  GtkWidget *xmmstimid_conf_wnd;
+  GtkWidget *vbox4;
+  GtkWidget *table1;
+  GtkWidget *frame1;
+  GtkWidget *vbox1;
+  GSList *rate_group = NULL;
+  GtkWidget *rate_11000;
+  GtkWidget *rate_22000;
+  GtkWidget *rate_44100;
+  GtkWidget *frame2;
+  GtkWidget *vbox2;
+  GSList *bits_group = NULL;
+  GtkWidget *bits_8;
+  GtkWidget *bits_16;
+  GtkWidget *frame3;
+  GtkWidget *vbox3;
+  GSList *channels_group = NULL;
+  GtkWidget *channels_1;
+  GtkWidget *channels_2;
+  GtkWidget *frame4;
+  GtkWidget *vbox5;
+  GtkWidget *config_file;
+  GtkWidget *hseparator1;
+  GtkWidget *hbuttonbox1;
+  GtkWidget *conf_ok;
+  GtkWidget *button2;
+
+  xmmstimid_conf_wnd = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  g_object_set_data (G_OBJECT (xmmstimid_conf_wnd), "xmmstimid_conf_wnd", xmmstimid_conf_wnd);
+  gtk_window_set_title (GTK_WINDOW (xmmstimid_conf_wnd), _("TiMidity Configuration"));
+  gtk_window_set_position (GTK_WINDOW (xmmstimid_conf_wnd), GTK_WIN_POS_MOUSE);
+
+  vbox4 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_ref (vbox4);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox4", vbox4,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (vbox4);
+  gtk_container_add (GTK_CONTAINER (xmmstimid_conf_wnd), vbox4);
+
+  table1 = gtk_table_new (3, 2, FALSE);
+  gtk_widget_ref (table1);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "table1", table1,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (table1);
+  gtk_box_pack_start (GTK_BOX (vbox4), table1, TRUE, TRUE, 0);
+  gtk_container_set_border_width (GTK_CONTAINER (table1), 10);
+  gtk_table_set_row_spacings (GTK_TABLE (table1), 5);
+  gtk_table_set_col_spacings (GTK_TABLE (table1), 5);
+
+  frame1 = gtk_frame_new (_("Sampling Rate"));
+  gtk_widget_ref (frame1);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "frame1", frame1,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (frame1);
+  gtk_table_attach (GTK_TABLE (table1), frame1, 0, 1, 1, 2,
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
+
+  vbox1 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_ref (vbox1);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox1", vbox1,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (vbox1);
+  gtk_container_add (GTK_CONTAINER (frame1), vbox1);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
+
+  rate_11000 = gtk_radio_button_new_with_label (rate_group, _("11000 Hz"));
+  rate_group = gtk_radio_button_group (GTK_RADIO_BUTTON (rate_11000));
+  gtk_widget_ref (rate_11000);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "rate_11000", rate_11000,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (rate_11000);
+  gtk_box_pack_start (GTK_BOX (vbox1), rate_11000, FALSE, FALSE, 0);
+
+  rate_22000 = gtk_radio_button_new_with_label (rate_group, _("22000 Hz"));
+  rate_group = gtk_radio_button_group (GTK_RADIO_BUTTON (rate_22000));
+  gtk_widget_ref (rate_22000);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "rate_22000", rate_22000,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (rate_22000);
+  gtk_box_pack_start (GTK_BOX (vbox1), rate_22000, FALSE, FALSE, 0);
+
+  rate_44100 = gtk_radio_button_new_with_label (rate_group, _("44100 Hz"));
+  rate_group = gtk_radio_button_group (GTK_RADIO_BUTTON (rate_44100));
+  gtk_widget_ref (rate_44100);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "rate_44100", rate_44100,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (rate_44100);
+  gtk_box_pack_start (GTK_BOX (vbox1), rate_44100, FALSE, FALSE, 0);
+
+  frame2 = gtk_frame_new (_("Sample Width"));
+  gtk_widget_ref (frame2);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "frame2", frame2,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (frame2);
+  gtk_table_attach (GTK_TABLE (table1), frame2, 1, 2, 1, 2,
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
+
+  vbox2 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_ref (vbox2);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox2", vbox2,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (vbox2);
+  gtk_container_add (GTK_CONTAINER (frame2), vbox2);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5);
+
+  bits_8 = gtk_radio_button_new_with_label (bits_group, _("8 bit"));
+  bits_group = gtk_radio_button_group (GTK_RADIO_BUTTON (bits_8));
+  gtk_widget_ref (bits_8);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "bits_8", bits_8,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (bits_8);
+  gtk_box_pack_start (GTK_BOX (vbox2), bits_8, FALSE, FALSE, 0);
+
+  bits_16 = gtk_radio_button_new_with_label (bits_group, _("16 bit"));
+  bits_group = gtk_radio_button_group (GTK_RADIO_BUTTON (bits_16));
+  gtk_widget_ref (bits_16);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "bits_16", bits_16,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (bits_16);
+  gtk_box_pack_start (GTK_BOX (vbox2), bits_16, FALSE, FALSE, 0);
+
+  frame3 = gtk_frame_new (_("Channels"));
+  gtk_widget_ref (frame3);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "frame3", frame3,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (frame3);
+  gtk_table_attach (GTK_TABLE (table1), frame3, 0, 1, 2, 3,
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
+
+  vbox3 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_ref (vbox3);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox3", vbox3,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (vbox3);
+  gtk_container_add (GTK_CONTAINER (frame3), vbox3);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox3), 5);
+
+  channels_1 = gtk_radio_button_new_with_label (channels_group, _("Mono"));
+  channels_group = gtk_radio_button_group (GTK_RADIO_BUTTON (channels_1));
+  gtk_widget_ref (channels_1);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "channels_1", channels_1,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (channels_1);
+  gtk_box_pack_start (GTK_BOX (vbox3), channels_1, FALSE, FALSE, 0);
+
+  channels_2 = gtk_radio_button_new_with_label (channels_group, _("Stereo"));
+  channels_group = gtk_radio_button_group (GTK_RADIO_BUTTON (channels_2));
+  gtk_widget_ref (channels_2);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "channels_2", channels_2,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (channels_2);
+  gtk_box_pack_start (GTK_BOX (vbox3), channels_2, FALSE, FALSE, 0);
+
+  frame4 = gtk_frame_new (_("TiMidity Configuration File"));
+  gtk_widget_ref (frame4);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "frame4", frame4,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (frame4);
+  gtk_table_attach (GTK_TABLE (table1), frame4, 0, 2, 0, 1,
+                    (GtkAttachOptions) (GTK_FILL),
+                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
+
+  vbox5 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_ref (vbox5);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox5", vbox5,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (vbox5);
+  gtk_container_add (GTK_CONTAINER (frame4), vbox5);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox5), 5);
+
+  config_file = gtk_entry_new ();
+  gtk_widget_ref (config_file);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "config_file", config_file,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (config_file);
+  gtk_box_pack_start (GTK_BOX (vbox5), config_file, TRUE, TRUE, 0);
+
+  hseparator1 = gtk_hseparator_new ();
+  gtk_widget_ref (hseparator1);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "hseparator1", hseparator1,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (hseparator1);
+  gtk_box_pack_start (GTK_BOX (vbox4), hseparator1, TRUE, TRUE, 0);
+
+  hbuttonbox1 = gtk_hbutton_box_new ();
+  gtk_widget_ref (hbuttonbox1);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "hbuttonbox1", hbuttonbox1,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (hbuttonbox1);
+  gtk_box_pack_start (GTK_BOX (vbox4), hbuttonbox1, TRUE, TRUE, 0);
+  gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 5);
+  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);
+  gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 10);
+
+  conf_ok = gtk_button_new_with_label (_("Ok"));
+  gtk_widget_ref (conf_ok);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "conf_ok", conf_ok,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (conf_ok);
+  gtk_container_add (GTK_CONTAINER (hbuttonbox1), conf_ok);
+  GTK_WIDGET_SET_FLAGS (conf_ok, GTK_CAN_DEFAULT);
+
+  button2 = gtk_button_new_with_label (_("Cancel"));
+  gtk_widget_ref (button2);
+  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "button2", button2,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (button2);
+  gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2);
+  GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);
+
+  g_signal_connect_swapped (G_OBJECT (button2), "clicked",
+                             G_CALLBACK (gtk_widget_hide),
+                             GTK_OBJECT (xmmstimid_conf_wnd));
+
+  gtk_widget_grab_focus (conf_ok);
+  gtk_widget_grab_default (conf_ok);
+  return xmmstimid_conf_wnd;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/timidity/interface.h	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,5 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+GtkWidget* create_xmmstimid_conf_wnd (void);
--- a/src/timidity/libtimidity/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-include ../../../extra.mk
-
-STATIC_LIB_NOINST = libtimidity.a
-
-SRCS = \
-	common.c \
-	instrum.c \
-	instrum_dls.c \
-	mix.c \
-	output.c \
-	playmidi.c \
-	readmidi.c \
-	resample.c \
-	stream.c \
-	tables.c \
-	timidity.c
-
-include ../../../buildsys.mk
-
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += -I../../.. $(GLIB_CFLAGS)
--- a/src/timidity/src/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-include ../../../extra.mk
-
-PLUGIN = timidity$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = \
-	callbacks.c \
-	interface.c \
-	xmms-timidity.c \
-
-LIBDEP = ../libtimidity/libtimidity.a
-
-include ../../../buildsys.mk
-
-LIBS += ../libtimidity/libtimidity.a $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../.. -I../libtimidity
--- a/src/timidity/src/callbacks.c	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#include <config.h>
-
-#include <gtk/gtk.h>
-
-#include "callbacks.h"
-#include "interface.h"
-#include "interface.h"
-
-
--- a/src/timidity/src/callbacks.h	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#include <gtk/gtk.h>
-
--- a/src/timidity/src/interface.c	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-/*
- * DO NOT EDIT THIS FILE - it is generated by Glade.
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <glib.h>
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
-
-#include <audacious/i18n.h>
-
-#include "callbacks.h"
-#include "interface.h"
-#include "interface.h"
-
-GtkWidget*
-create_xmmstimid_conf_wnd (void)
-{
-  GtkWidget *xmmstimid_conf_wnd;
-  GtkWidget *vbox4;
-  GtkWidget *table1;
-  GtkWidget *frame1;
-  GtkWidget *vbox1;
-  GSList *rate_group = NULL;
-  GtkWidget *rate_11000;
-  GtkWidget *rate_22000;
-  GtkWidget *rate_44100;
-  GtkWidget *frame2;
-  GtkWidget *vbox2;
-  GSList *bits_group = NULL;
-  GtkWidget *bits_8;
-  GtkWidget *bits_16;
-  GtkWidget *frame3;
-  GtkWidget *vbox3;
-  GSList *channels_group = NULL;
-  GtkWidget *channels_1;
-  GtkWidget *channels_2;
-  GtkWidget *frame4;
-  GtkWidget *vbox5;
-  GtkWidget *config_file;
-  GtkWidget *hseparator1;
-  GtkWidget *hbuttonbox1;
-  GtkWidget *conf_ok;
-  GtkWidget *button2;
-
-  xmmstimid_conf_wnd = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  g_object_set_data (G_OBJECT (xmmstimid_conf_wnd), "xmmstimid_conf_wnd", xmmstimid_conf_wnd);
-  gtk_window_set_title (GTK_WINDOW (xmmstimid_conf_wnd), _("TiMidity Configuration"));
-  gtk_window_set_position (GTK_WINDOW (xmmstimid_conf_wnd), GTK_WIN_POS_MOUSE);
-
-  vbox4 = gtk_vbox_new (FALSE, 0);
-  gtk_widget_ref (vbox4);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox4", vbox4,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (vbox4);
-  gtk_container_add (GTK_CONTAINER (xmmstimid_conf_wnd), vbox4);
-
-  table1 = gtk_table_new (3, 2, FALSE);
-  gtk_widget_ref (table1);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "table1", table1,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (table1);
-  gtk_box_pack_start (GTK_BOX (vbox4), table1, TRUE, TRUE, 0);
-  gtk_container_set_border_width (GTK_CONTAINER (table1), 10);
-  gtk_table_set_row_spacings (GTK_TABLE (table1), 5);
-  gtk_table_set_col_spacings (GTK_TABLE (table1), 5);
-
-  frame1 = gtk_frame_new (_("Sampling Rate"));
-  gtk_widget_ref (frame1);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "frame1", frame1,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (frame1);
-  gtk_table_attach (GTK_TABLE (table1), frame1, 0, 1, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
-
-  vbox1 = gtk_vbox_new (FALSE, 0);
-  gtk_widget_ref (vbox1);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox1", vbox1,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (vbox1);
-  gtk_container_add (GTK_CONTAINER (frame1), vbox1);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
-
-  rate_11000 = gtk_radio_button_new_with_label (rate_group, _("11000 Hz"));
-  rate_group = gtk_radio_button_group (GTK_RADIO_BUTTON (rate_11000));
-  gtk_widget_ref (rate_11000);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "rate_11000", rate_11000,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (rate_11000);
-  gtk_box_pack_start (GTK_BOX (vbox1), rate_11000, FALSE, FALSE, 0);
-
-  rate_22000 = gtk_radio_button_new_with_label (rate_group, _("22000 Hz"));
-  rate_group = gtk_radio_button_group (GTK_RADIO_BUTTON (rate_22000));
-  gtk_widget_ref (rate_22000);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "rate_22000", rate_22000,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (rate_22000);
-  gtk_box_pack_start (GTK_BOX (vbox1), rate_22000, FALSE, FALSE, 0);
-
-  rate_44100 = gtk_radio_button_new_with_label (rate_group, _("44100 Hz"));
-  rate_group = gtk_radio_button_group (GTK_RADIO_BUTTON (rate_44100));
-  gtk_widget_ref (rate_44100);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "rate_44100", rate_44100,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (rate_44100);
-  gtk_box_pack_start (GTK_BOX (vbox1), rate_44100, FALSE, FALSE, 0);
-
-  frame2 = gtk_frame_new (_("Sample Width"));
-  gtk_widget_ref (frame2);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "frame2", frame2,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (frame2);
-  gtk_table_attach (GTK_TABLE (table1), frame2, 1, 2, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
-
-  vbox2 = gtk_vbox_new (FALSE, 0);
-  gtk_widget_ref (vbox2);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox2", vbox2,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (vbox2);
-  gtk_container_add (GTK_CONTAINER (frame2), vbox2);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5);
-
-  bits_8 = gtk_radio_button_new_with_label (bits_group, _("8 bit"));
-  bits_group = gtk_radio_button_group (GTK_RADIO_BUTTON (bits_8));
-  gtk_widget_ref (bits_8);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "bits_8", bits_8,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (bits_8);
-  gtk_box_pack_start (GTK_BOX (vbox2), bits_8, FALSE, FALSE, 0);
-
-  bits_16 = gtk_radio_button_new_with_label (bits_group, _("16 bit"));
-  bits_group = gtk_radio_button_group (GTK_RADIO_BUTTON (bits_16));
-  gtk_widget_ref (bits_16);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "bits_16", bits_16,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (bits_16);
-  gtk_box_pack_start (GTK_BOX (vbox2), bits_16, FALSE, FALSE, 0);
-
-  frame3 = gtk_frame_new (_("Channels"));
-  gtk_widget_ref (frame3);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "frame3", frame3,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (frame3);
-  gtk_table_attach (GTK_TABLE (table1), frame3, 0, 1, 2, 3,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
-
-  vbox3 = gtk_vbox_new (FALSE, 0);
-  gtk_widget_ref (vbox3);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox3", vbox3,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (vbox3);
-  gtk_container_add (GTK_CONTAINER (frame3), vbox3);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox3), 5);
-
-  channels_1 = gtk_radio_button_new_with_label (channels_group, _("Mono"));
-  channels_group = gtk_radio_button_group (GTK_RADIO_BUTTON (channels_1));
-  gtk_widget_ref (channels_1);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "channels_1", channels_1,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (channels_1);
-  gtk_box_pack_start (GTK_BOX (vbox3), channels_1, FALSE, FALSE, 0);
-
-  channels_2 = gtk_radio_button_new_with_label (channels_group, _("Stereo"));
-  channels_group = gtk_radio_button_group (GTK_RADIO_BUTTON (channels_2));
-  gtk_widget_ref (channels_2);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "channels_2", channels_2,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (channels_2);
-  gtk_box_pack_start (GTK_BOX (vbox3), channels_2, FALSE, FALSE, 0);
-
-  frame4 = gtk_frame_new (_("TiMidity Configuration File"));
-  gtk_widget_ref (frame4);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "frame4", frame4,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (frame4);
-  gtk_table_attach (GTK_TABLE (table1), frame4, 0, 2, 0, 1,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
-
-  vbox5 = gtk_vbox_new (FALSE, 0);
-  gtk_widget_ref (vbox5);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "vbox5", vbox5,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (vbox5);
-  gtk_container_add (GTK_CONTAINER (frame4), vbox5);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox5), 5);
-
-  config_file = gtk_entry_new ();
-  gtk_widget_ref (config_file);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "config_file", config_file,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (config_file);
-  gtk_box_pack_start (GTK_BOX (vbox5), config_file, TRUE, TRUE, 0);
-
-  hseparator1 = gtk_hseparator_new ();
-  gtk_widget_ref (hseparator1);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "hseparator1", hseparator1,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (hseparator1);
-  gtk_box_pack_start (GTK_BOX (vbox4), hseparator1, TRUE, TRUE, 0);
-
-  hbuttonbox1 = gtk_hbutton_box_new ();
-  gtk_widget_ref (hbuttonbox1);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "hbuttonbox1", hbuttonbox1,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (hbuttonbox1);
-  gtk_box_pack_start (GTK_BOX (vbox4), hbuttonbox1, TRUE, TRUE, 0);
-  gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 5);
-  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);
-  gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 10);
-
-  conf_ok = gtk_button_new_with_label (_("Ok"));
-  gtk_widget_ref (conf_ok);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "conf_ok", conf_ok,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (conf_ok);
-  gtk_container_add (GTK_CONTAINER (hbuttonbox1), conf_ok);
-  GTK_WIDGET_SET_FLAGS (conf_ok, GTK_CAN_DEFAULT);
-
-  button2 = gtk_button_new_with_label (_("Cancel"));
-  gtk_widget_ref (button2);
-  g_object_set_data_full (G_OBJECT (xmmstimid_conf_wnd), "button2", button2,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (button2);
-  gtk_container_add (GTK_CONTAINER (hbuttonbox1), button2);
-  GTK_WIDGET_SET_FLAGS (button2, GTK_CAN_DEFAULT);
-
-  g_signal_connect_swapped (G_OBJECT (button2), "clicked",
-                             G_CALLBACK (gtk_widget_hide),
-                             GTK_OBJECT (xmmstimid_conf_wnd));
-
-  gtk_widget_grab_focus (conf_ok);
-  gtk_widget_grab_default (conf_ok);
-  return xmmstimid_conf_wnd;
-}
--- a/src/timidity/src/interface.h	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-/*
- * DO NOT EDIT THIS FILE - it is generated by Glade.
- */
-
-GtkWidget* create_xmmstimid_conf_wnd (void);
--- a/src/timidity/src/xmms-timidity.c	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,436 +0,0 @@
-/*
-    xmms-timidity - MIDI Plugin for XMMS
-    Copyright (C) 2004 Konstantin Korikov <lostclus@ua.fm>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include <config.h>
-
-#include "audacious/util.h"
-#include "audacious/configdb.h"
-#include "audacious/main.h"
-#include "audacious/vfs.h"
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <string.h>
-#include <timidity.h>
-#include <stdio.h>
-#include "audacious/output.h"
-#include <audacious/i18n.h>
-
-#include "xmms-timidity.h"
-#include "interface.h"
-
-InputPlugin xmmstimid_ip = {
-	.description = "TiMidity Audio Plugin",
-	.init = xmmstimid_init,
-	.about = xmmstimid_about,
-	.configure = xmmstimid_configure,
-	.play_file = xmmstimid_play_file,
-	.stop = xmmstimid_stop,
-	.pause = xmmstimid_pause,
-	.seek = xmmstimid_seek,
-	.get_time = xmmstimid_get_time,
-	.cleanup = xmmstimid_cleanup,
-	.get_song_info = xmmstimid_get_song_info,
-	.is_our_file_from_vfs = xmmstimid_is_our_fd,
-};
-
-InputPlugin *timidity_iplist[] = { &xmmstimid_ip, NULL };
-
-DECLARE_PLUGIN(timidity, NULL, NULL, timidity_iplist, NULL, NULL, NULL, NULL, NULL);
-
-static struct {
-	gchar *config_file;
-	gint rate;
-	gint bits;
-	gint channels;
-	gint buffer_size;
-} xmmstimid_cfg;
-
-static gboolean xmmstimid_initialized = FALSE;
-static GThread *xmmstimid_decode_thread;
-static gboolean xmmstimid_audio_error = FALSE;
-static MidSongOptions xmmstimid_opts;
-static MidSong *xmmstimid_song;
-static gint xmmstimid_seek_to;
-
-static GtkWidget *xmmstimid_conf_wnd = NULL, *xmmstimid_about_wnd = NULL;
-static GtkEntry
-	*xmmstimid_conf_config_file;
-static GtkToggleButton
-	*xmmstimid_conf_rate_11000,
-	*xmmstimid_conf_rate_22000,
-	*xmmstimid_conf_rate_44100;
-static GtkToggleButton
-	*xmmstimid_conf_bits_8,
-	*xmmstimid_conf_bits_16;
-static GtkToggleButton
-	*xmmstimid_conf_channels_1,
-	*xmmstimid_conf_channels_2;
-
-void xmmstimid_init(void) {
-	ConfigDb *db;
-
-	xmmstimid_cfg.config_file = NULL;
-	xmmstimid_cfg.rate = 44100;
-	xmmstimid_cfg.bits = 16;
-	xmmstimid_cfg.channels = 2;
-	xmmstimid_cfg.buffer_size = 512;
-
-	db = bmp_cfg_db_open();
-
-	if (! bmp_cfg_db_get_string(db, "timidity", "config_file",
-                                &xmmstimid_cfg.config_file))
-        xmmstimid_cfg.config_file = g_strdup("/etc/timidity/timidity.cfg");
-
-	bmp_cfg_db_get_int(db, "timidity", "samplerate", &xmmstimid_cfg.rate);
-	bmp_cfg_db_get_int(db, "timidity", "bits", &xmmstimid_cfg.bits);
-	bmp_cfg_db_get_int(db, "timidity", "channels", &xmmstimid_cfg.channels);
-	bmp_cfg_db_close(db);
-
-	if (mid_init(xmmstimid_cfg.config_file) != 0) {
-		xmmstimid_initialized = FALSE;
-		return;
-	}
-	xmmstimid_initialized = TRUE;
-}
-
-void xmmstimid_about(void) {
-	if (!xmmstimid_about_wnd) {
-		gchar *about_title, *about_text;
-		about_text = g_strjoin( "" ,
-			_("TiMidity Plugin\nhttp://libtimidity.sourceforge.net\nby Konstantin Korikov") , NULL );
-		about_title = g_strdup_printf( _("TiMidity Plugin %s") , PACKAGE_VERSION );
-		xmmstimid_about_wnd = audacious_info_dialog( about_title , about_text , _("Ok") , FALSE , NULL , NULL );
-		g_signal_connect(G_OBJECT(xmmstimid_about_wnd), "destroy",
-					(GCallback)gtk_widget_destroyed, &xmmstimid_about_wnd);
-		g_free(about_title);
-		g_free(about_text);
-	}
-	else
-	{
-		gdk_window_raise(xmmstimid_about_wnd->window);
-	}
-}
-
-void xmmstimid_conf_ok(GtkButton *button, gpointer user_data);
-
-void xmmstimid_configure(void) {
-	GtkToggleButton *tb;
-	if (xmmstimid_conf_wnd == NULL) {
-		xmmstimid_conf_wnd = create_xmmstimid_conf_wnd();
-
-#define get_conf_wnd_item(type, name) \
-	type (g_object_get_data(G_OBJECT(xmmstimid_conf_wnd), name))
-	
-		xmmstimid_conf_config_file = get_conf_wnd_item(
-				GTK_ENTRY, "config_file");
-		xmmstimid_conf_rate_11000 = get_conf_wnd_item(
-				GTK_TOGGLE_BUTTON, "rate_11000");
-		xmmstimid_conf_rate_22000 = get_conf_wnd_item(
-				GTK_TOGGLE_BUTTON, "rate_22000");
-		xmmstimid_conf_rate_44100 = get_conf_wnd_item(
-				GTK_TOGGLE_BUTTON, "rate_44100");
-		xmmstimid_conf_bits_8 = get_conf_wnd_item(
-				GTK_TOGGLE_BUTTON, "bits_8");
-		xmmstimid_conf_bits_16 = get_conf_wnd_item(
-				GTK_TOGGLE_BUTTON, "bits_16");
-		xmmstimid_conf_channels_1 = get_conf_wnd_item(
-				GTK_TOGGLE_BUTTON, "channels_1");
-		xmmstimid_conf_channels_2 = get_conf_wnd_item(
-				GTK_TOGGLE_BUTTON, "channels_2");
-
-		gtk_signal_connect_object(
-				get_conf_wnd_item(GTK_OBJECT, "conf_ok"),
-				"clicked", G_CALLBACK(xmmstimid_conf_ok),
-				NULL);
-	}
-
-	gtk_entry_set_text(xmmstimid_conf_config_file,
-			xmmstimid_cfg.config_file);
-	switch (xmmstimid_cfg.rate) {
-		case 11000: tb = xmmstimid_conf_rate_11000; break;
-		case 22000: tb = xmmstimid_conf_rate_22000; break;
-		case 44100: tb = xmmstimid_conf_rate_44100; break;
-		default: tb = NULL;
-	}
-	if (tb != NULL) gtk_toggle_button_set_active(tb, TRUE);
-	switch (xmmstimid_cfg.bits) {
-		case 8: tb = xmmstimid_conf_bits_8; break;
-		case 16: tb = xmmstimid_conf_bits_16; break;
-		default: tb = NULL;
-	}
-	if (tb != NULL) gtk_toggle_button_set_active(tb, TRUE);
-	switch (xmmstimid_cfg.channels) {
-		case 1: tb = xmmstimid_conf_channels_1; break;
-		case 2: tb = xmmstimid_conf_channels_2; break;
-		default: tb = NULL;
-	}
-	if (tb != NULL) gtk_toggle_button_set_active(tb, TRUE);
-
-	gtk_widget_show(xmmstimid_conf_wnd);
-	gdk_window_raise(xmmstimid_conf_wnd->window);
-}
-
-void xmmstimid_conf_ok(GtkButton *button, gpointer user_data) {
-	ConfigDb *db;
-
-	if (gtk_toggle_button_get_active(xmmstimid_conf_rate_11000))
-		xmmstimid_cfg.rate = 11000;
-	else if (gtk_toggle_button_get_active(xmmstimid_conf_rate_22000))
-		xmmstimid_cfg.rate = 22000;
-	else if (gtk_toggle_button_get_active(xmmstimid_conf_rate_44100))
-		xmmstimid_cfg.rate = 44100;
-	if (gtk_toggle_button_get_active(xmmstimid_conf_bits_8))
-		xmmstimid_cfg.bits = 8;
-	else if (gtk_toggle_button_get_active(xmmstimid_conf_bits_16))
-		xmmstimid_cfg.bits = 16;
-	if (gtk_toggle_button_get_active(xmmstimid_conf_channels_1))
-		xmmstimid_cfg.channels = 1;
-	else if (gtk_toggle_button_get_active(xmmstimid_conf_channels_2))
-		xmmstimid_cfg.channels = 2;
-
-	db = bmp_cfg_db_open();
-
-	g_free(xmmstimid_cfg.config_file);
-	xmmstimid_cfg.config_file = g_strdup(
-        gtk_entry_get_text(xmmstimid_conf_config_file));
-
-	bmp_cfg_db_set_string(db, "timidity", "config_file", xmmstimid_cfg.config_file);
-
-	bmp_cfg_db_set_int(db, "timidity", "samplerate", xmmstimid_cfg.rate);
-	bmp_cfg_db_set_int(db, "timidity", "bits", xmmstimid_cfg.bits);
-	bmp_cfg_db_set_int(db, "timidity", "channels", xmmstimid_cfg.channels);
-	bmp_cfg_db_close(db);
-
-	gtk_widget_hide(xmmstimid_conf_wnd);
-}
-
-static gint xmmstimid_is_our_fd( gchar * filename, VFSFile * fp )
-{
-	gchar magic_bytes[4];
-
-	vfs_fread( magic_bytes , 1 , 4 , fp );
-
-	if ( !memcmp( magic_bytes , "MThd" , 4 ) )
-		return TRUE;
-
-	if ( !memcmp( magic_bytes , "RIFF" , 4 ) )
-	{
-	/* skip the four bytes after RIFF,
-	   then read the next four */
-	vfs_fseek( fp , 4 , SEEK_CUR );
-	vfs_fread( magic_bytes , 1 , 4 , fp );
-	if ( !memcmp( magic_bytes , "RMID" , 4 ) )
-		return TRUE;
-	}
-	return FALSE;
-}
-
-static void *xmmstimid_play_loop(void *arg) {
-	InputPlayback *playback = arg;
-	size_t buffer_size;
-	void *buffer;
-	size_t bytes_read;
-	AFormat fmt;
-
-	buffer_size = ((xmmstimid_opts.format == MID_AUDIO_S16LSB) ? 16 : 8) * 
-			xmmstimid_opts.channels / 8 *
-			xmmstimid_opts.buffer_size;
-
-	buffer = g_malloc(buffer_size);
-	if (buffer == NULL) return(NULL);
-
-	fmt = (xmmstimid_opts.format == MID_AUDIO_S16LSB) ? FMT_S16_LE : FMT_S8;
-
-	while (playback->playing) {
-		bytes_read = mid_song_read_wave(xmmstimid_song,
-				buffer, buffer_size);
-
-		if (bytes_read != 0)
-			produce_audio(mid_song_get_time(xmmstimid_song),
-					fmt, xmmstimid_opts.channels,
-					bytes_read, buffer, &playback->playing);
-		else {
-		        playback->eof = TRUE;
-		        playback->output->buffer_free ();
-		        playback->output->buffer_free ();
-		        while (playback->output->buffer_playing())
-		                g_usleep(10000);
-			playback->playing = FALSE;
-		}
-
-		if (xmmstimid_seek_to != -1) {
-			mid_song_seek(xmmstimid_song, xmmstimid_seek_to * 1000);
-			playback->output->flush(xmmstimid_seek_to * 1000);
-			xmmstimid_seek_to = -1;
-			bytes_read = 0;
-		}
-	}
-
-	g_free(buffer);
-	return(NULL);
-}
-
-static gchar *xmmstimid_get_title(gchar *filename) {
-	Tuple *input;
-	gchar *title;
-
-	input = tuple_new_from_filename(filename);
-
-	title = tuple_formatter_make_title_string(input, get_gentitle_format());
-	if (title == NULL || *title == '\0')
-		title = g_strdup(tuple_get_string(input, FIELD_FILE_NAME, NULL));
-
-	tuple_free(input);
-
-	return title;
-}
-
-void xmmstimid_play_file(InputPlayback * playback) {
-	char *filename = playback->filename;
-	MidIStream *stream;
-	gchar *title;
-
-	if (!xmmstimid_initialized) {
-		xmmstimid_init();
-		if (!xmmstimid_initialized) return;
-	}
-
-	if (xmmstimid_song != NULL) {
-		mid_song_free(xmmstimid_song);
-		xmmstimid_song = NULL;
-	}
-
-	stream = mid_istream_open_file(filename);
-	if (stream == NULL) return;
-
-	xmmstimid_audio_error = FALSE;
-
-	xmmstimid_opts.rate = xmmstimid_cfg.rate;
-	xmmstimid_opts.format = (xmmstimid_cfg.bits == 16) ?
-		MID_AUDIO_S16LSB : MID_AUDIO_S8;
-	xmmstimid_opts.channels = xmmstimid_cfg.channels;
-	xmmstimid_opts.buffer_size = xmmstimid_cfg.buffer_size;
-
-	xmmstimid_song = mid_song_load(stream, &xmmstimid_opts);
-	mid_istream_close(stream);
-
-	if (xmmstimid_song == NULL) {
-		xmmstimid_ip.set_info_text(_("Couldn't load MIDI file"));
-		return;
-	}
-
-	if (playback->output->open_audio(
-				(xmmstimid_opts.format == MID_AUDIO_S16LSB) ?
-				FMT_S16_LE : FMT_S8,
-				xmmstimid_opts.rate, xmmstimid_opts.channels) == 0) {
-		xmmstimid_audio_error = TRUE;
-		mid_song_free(xmmstimid_song);
-		xmmstimid_song = NULL;
-		return;
-	}
-
-	title = xmmstimid_get_title(filename);
-	xmmstimid_ip.set_info(title,
-			mid_song_get_total_time(xmmstimid_song),
-			0, xmmstimid_opts.rate, xmmstimid_opts.channels);
-	g_free(title);
-
-	mid_song_start(xmmstimid_song);
-	playback->playing = TRUE;
-	playback->eof = FALSE;
-	xmmstimid_seek_to = -1;
-
-	xmmstimid_decode_thread = g_thread_self();
-	playback->set_pb_ready(playback);
-	xmmstimid_play_loop(playback);
-}
-
-void xmmstimid_stop(InputPlayback * playback) {
-	if (xmmstimid_song != NULL && playback->playing) {
-		playback->playing = FALSE;
-		g_thread_join(xmmstimid_decode_thread);
-		playback->output->close_audio();
-		mid_song_free(xmmstimid_song);
-		xmmstimid_song = NULL;
-	}
-}
-
-void xmmstimid_pause(InputPlayback * playback, short p) {
-	playback->output->pause(p);
-}
-
-void xmmstimid_seek(InputPlayback * playback, int time) {
-	xmmstimid_seek_to = time;
-	playback->eof = FALSE;
-
-	while (xmmstimid_seek_to != -1)
-		g_usleep(10000);
-}
-
-int xmmstimid_get_time(InputPlayback * playback) {
-	if (xmmstimid_audio_error)
-		return -2;
-	if (xmmstimid_song == NULL)
-		return -1;
-	if (!playback->playing || (playback->eof &&
-				playback->output->buffer_playing()))
-		return -1;
-
-	return mid_song_get_time(xmmstimid_song);
-}
-
-void xmmstimid_cleanup(void) {
-	if (xmmstimid_cfg.config_file) {
-		free(xmmstimid_cfg.config_file);
-		xmmstimid_cfg.config_file = NULL;
-	}
-
-	if (xmmstimid_initialized)
-		mid_exit();
-}
-
-void xmmstimid_get_song_info(char *filename, char **title, int *length) {
-	MidIStream *stream;
-	MidSongOptions opts;
-	MidSong *song;
-
-	if (!xmmstimid_initialized) {
-		xmmstimid_init();
-		if (!xmmstimid_initialized) return;
-	}
-
-	stream = mid_istream_open_file(filename);
-	if (stream == NULL) return;
-
-	opts.rate = xmmstimid_cfg.rate;
-	opts.format = (xmmstimid_cfg.bits == 16) ?
-		MID_AUDIO_S16LSB : MID_AUDIO_S8;
-	opts.channels = xmmstimid_cfg.channels;
-	opts.buffer_size = 8;
-
-	song = mid_song_load(stream, &opts);
-	mid_istream_close(stream);
-
-	if (song == NULL) return;
-
-	*length = mid_song_get_total_time(song);
-	*title = xmmstimid_get_title(filename);
-
-	mid_song_free(song);
-}
--- a/src/timidity/src/xmms-timidity.h	Wed Sep 26 06:38:56 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-    xmms-timidity - MIDI Plugin for XMMS
-    Copyright (C) 2004 Konstantin Korikov <lostclus@ua.fm>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef XMMS_TIMIDITY_H
-#define XMMS_TIMIDITY_H
-
-#include <audacious/plugin.h>
-#include <audacious/vfs.h>
-
-extern InputPlugin xmmstimid_ip;
-
-static void xmmstimid_init(void);
-static void xmmstimid_about(void);
-static void xmmstimid_configure(void);
-static int xmmstimid_is_our_fd( char * filename, VFSFile * fp );
-static void xmmstimid_play_file(InputPlayback * playback);
-static void xmmstimid_stop(InputPlayback * playback);
-static void xmmstimid_pause(InputPlayback * playback, short p);
-static void xmmstimid_seek(InputPlayback * playback, int time);
-static int xmmstimid_get_time(InputPlayback * playback);
-static void xmmstimid_cleanup(void);
-static void xmmstimid_get_song_info(char *filename, char **title, int *length);
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/timidity/xmms-timidity.c	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,436 @@
+/*
+    xmms-timidity - MIDI Plugin for XMMS
+    Copyright (C) 2004 Konstantin Korikov <lostclus@ua.fm>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <config.h>
+
+#include "audacious/util.h"
+#include "audacious/configdb.h"
+#include "audacious/main.h"
+#include "audacious/vfs.h"
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <string.h>
+#include <timidity.h>
+#include <stdio.h>
+#include "audacious/output.h"
+#include <audacious/i18n.h>
+
+#include "xmms-timidity.h"
+#include "interface.h"
+
+InputPlugin xmmstimid_ip = {
+	.description = "TiMidity Audio Plugin",
+	.init = xmmstimid_init,
+	.about = xmmstimid_about,
+	.configure = xmmstimid_configure,
+	.play_file = xmmstimid_play_file,
+	.stop = xmmstimid_stop,
+	.pause = xmmstimid_pause,
+	.seek = xmmstimid_seek,
+	.get_time = xmmstimid_get_time,
+	.cleanup = xmmstimid_cleanup,
+	.get_song_info = xmmstimid_get_song_info,
+	.is_our_file_from_vfs = xmmstimid_is_our_fd,
+};
+
+InputPlugin *timidity_iplist[] = { &xmmstimid_ip, NULL };
+
+DECLARE_PLUGIN(timidity, NULL, NULL, timidity_iplist, NULL, NULL, NULL, NULL, NULL);
+
+static struct {
+	gchar *config_file;
+	gint rate;
+	gint bits;
+	gint channels;
+	gint buffer_size;
+} xmmstimid_cfg;
+
+static gboolean xmmstimid_initialized = FALSE;
+static GThread *xmmstimid_decode_thread;
+static gboolean xmmstimid_audio_error = FALSE;
+static MidSongOptions xmmstimid_opts;
+static MidSong *xmmstimid_song;
+static gint xmmstimid_seek_to;
+
+static GtkWidget *xmmstimid_conf_wnd = NULL, *xmmstimid_about_wnd = NULL;
+static GtkEntry
+	*xmmstimid_conf_config_file;
+static GtkToggleButton
+	*xmmstimid_conf_rate_11000,
+	*xmmstimid_conf_rate_22000,
+	*xmmstimid_conf_rate_44100;
+static GtkToggleButton
+	*xmmstimid_conf_bits_8,
+	*xmmstimid_conf_bits_16;
+static GtkToggleButton
+	*xmmstimid_conf_channels_1,
+	*xmmstimid_conf_channels_2;
+
+void xmmstimid_init(void) {
+	ConfigDb *db;
+
+	xmmstimid_cfg.config_file = NULL;
+	xmmstimid_cfg.rate = 44100;
+	xmmstimid_cfg.bits = 16;
+	xmmstimid_cfg.channels = 2;
+	xmmstimid_cfg.buffer_size = 512;
+
+	db = bmp_cfg_db_open();
+
+	if (! bmp_cfg_db_get_string(db, "timidity", "config_file",
+                                &xmmstimid_cfg.config_file))
+        xmmstimid_cfg.config_file = g_strdup("/etc/timidity/timidity.cfg");
+
+	bmp_cfg_db_get_int(db, "timidity", "samplerate", &xmmstimid_cfg.rate);
+	bmp_cfg_db_get_int(db, "timidity", "bits", &xmmstimid_cfg.bits);
+	bmp_cfg_db_get_int(db, "timidity", "channels", &xmmstimid_cfg.channels);
+	bmp_cfg_db_close(db);
+
+	if (mid_init(xmmstimid_cfg.config_file) != 0) {
+		xmmstimid_initialized = FALSE;
+		return;
+	}
+	xmmstimid_initialized = TRUE;
+}
+
+void xmmstimid_about(void) {
+	if (!xmmstimid_about_wnd) {
+		gchar *about_title, *about_text;
+		about_text = g_strjoin( "" ,
+			_("TiMidity Plugin\nhttp://libtimidity.sourceforge.net\nby Konstantin Korikov") , NULL );
+		about_title = g_strdup_printf( _("TiMidity Plugin %s") , PACKAGE_VERSION );
+		xmmstimid_about_wnd = audacious_info_dialog( about_title , about_text , _("Ok") , FALSE , NULL , NULL );
+		g_signal_connect(G_OBJECT(xmmstimid_about_wnd), "destroy",
+					(GCallback)gtk_widget_destroyed, &xmmstimid_about_wnd);
+		g_free(about_title);
+		g_free(about_text);
+	}
+	else
+	{
+		gdk_window_raise(xmmstimid_about_wnd->window);
+	}
+}
+
+void xmmstimid_conf_ok(GtkButton *button, gpointer user_data);
+
+void xmmstimid_configure(void) {
+	GtkToggleButton *tb;
+	if (xmmstimid_conf_wnd == NULL) {
+		xmmstimid_conf_wnd = create_xmmstimid_conf_wnd();
+
+#define get_conf_wnd_item(type, name) \
+	type (g_object_get_data(G_OBJECT(xmmstimid_conf_wnd), name))
+	
+		xmmstimid_conf_config_file = get_conf_wnd_item(
+				GTK_ENTRY, "config_file");
+		xmmstimid_conf_rate_11000 = get_conf_wnd_item(
+				GTK_TOGGLE_BUTTON, "rate_11000");
+		xmmstimid_conf_rate_22000 = get_conf_wnd_item(
+				GTK_TOGGLE_BUTTON, "rate_22000");
+		xmmstimid_conf_rate_44100 = get_conf_wnd_item(
+				GTK_TOGGLE_BUTTON, "rate_44100");
+		xmmstimid_conf_bits_8 = get_conf_wnd_item(
+				GTK_TOGGLE_BUTTON, "bits_8");
+		xmmstimid_conf_bits_16 = get_conf_wnd_item(
+				GTK_TOGGLE_BUTTON, "bits_16");
+		xmmstimid_conf_channels_1 = get_conf_wnd_item(
+				GTK_TOGGLE_BUTTON, "channels_1");
+		xmmstimid_conf_channels_2 = get_conf_wnd_item(
+				GTK_TOGGLE_BUTTON, "channels_2");
+
+		gtk_signal_connect_object(
+				get_conf_wnd_item(GTK_OBJECT, "conf_ok"),
+				"clicked", G_CALLBACK(xmmstimid_conf_ok),
+				NULL);
+	}
+
+	gtk_entry_set_text(xmmstimid_conf_config_file,
+			xmmstimid_cfg.config_file);
+	switch (xmmstimid_cfg.rate) {
+		case 11000: tb = xmmstimid_conf_rate_11000; break;
+		case 22000: tb = xmmstimid_conf_rate_22000; break;
+		case 44100: tb = xmmstimid_conf_rate_44100; break;
+		default: tb = NULL;
+	}
+	if (tb != NULL) gtk_toggle_button_set_active(tb, TRUE);
+	switch (xmmstimid_cfg.bits) {
+		case 8: tb = xmmstimid_conf_bits_8; break;
+		case 16: tb = xmmstimid_conf_bits_16; break;
+		default: tb = NULL;
+	}
+	if (tb != NULL) gtk_toggle_button_set_active(tb, TRUE);
+	switch (xmmstimid_cfg.channels) {
+		case 1: tb = xmmstimid_conf_channels_1; break;
+		case 2: tb = xmmstimid_conf_channels_2; break;
+		default: tb = NULL;
+	}
+	if (tb != NULL) gtk_toggle_button_set_active(tb, TRUE);
+
+	gtk_widget_show(xmmstimid_conf_wnd);
+	gdk_window_raise(xmmstimid_conf_wnd->window);
+}
+
+void xmmstimid_conf_ok(GtkButton *button, gpointer user_data) {
+	ConfigDb *db;
+
+	if (gtk_toggle_button_get_active(xmmstimid_conf_rate_11000))
+		xmmstimid_cfg.rate = 11000;
+	else if (gtk_toggle_button_get_active(xmmstimid_conf_rate_22000))
+		xmmstimid_cfg.rate = 22000;
+	else if (gtk_toggle_button_get_active(xmmstimid_conf_rate_44100))
+		xmmstimid_cfg.rate = 44100;
+	if (gtk_toggle_button_get_active(xmmstimid_conf_bits_8))
+		xmmstimid_cfg.bits = 8;
+	else if (gtk_toggle_button_get_active(xmmstimid_conf_bits_16))
+		xmmstimid_cfg.bits = 16;
+	if (gtk_toggle_button_get_active(xmmstimid_conf_channels_1))
+		xmmstimid_cfg.channels = 1;
+	else if (gtk_toggle_button_get_active(xmmstimid_conf_channels_2))
+		xmmstimid_cfg.channels = 2;
+
+	db = bmp_cfg_db_open();
+
+	g_free(xmmstimid_cfg.config_file);
+	xmmstimid_cfg.config_file = g_strdup(
+        gtk_entry_get_text(xmmstimid_conf_config_file));
+
+	bmp_cfg_db_set_string(db, "timidity", "config_file", xmmstimid_cfg.config_file);
+
+	bmp_cfg_db_set_int(db, "timidity", "samplerate", xmmstimid_cfg.rate);
+	bmp_cfg_db_set_int(db, "timidity", "bits", xmmstimid_cfg.bits);
+	bmp_cfg_db_set_int(db, "timidity", "channels", xmmstimid_cfg.channels);
+	bmp_cfg_db_close(db);
+
+	gtk_widget_hide(xmmstimid_conf_wnd);
+}
+
+static gint xmmstimid_is_our_fd( gchar * filename, VFSFile * fp )
+{
+	gchar magic_bytes[4];
+
+	vfs_fread( magic_bytes , 1 , 4 , fp );
+
+	if ( !memcmp( magic_bytes , "MThd" , 4 ) )
+		return TRUE;
+
+	if ( !memcmp( magic_bytes , "RIFF" , 4 ) )
+	{
+	/* skip the four bytes after RIFF,
+	   then read the next four */
+	vfs_fseek( fp , 4 , SEEK_CUR );
+	vfs_fread( magic_bytes , 1 , 4 , fp );
+	if ( !memcmp( magic_bytes , "RMID" , 4 ) )
+		return TRUE;
+	}
+	return FALSE;
+}
+
+static void *xmmstimid_play_loop(void *arg) {
+	InputPlayback *playback = arg;
+	size_t buffer_size;
+	void *buffer;
+	size_t bytes_read;
+	AFormat fmt;
+
+	buffer_size = ((xmmstimid_opts.format == MID_AUDIO_S16LSB) ? 16 : 8) * 
+			xmmstimid_opts.channels / 8 *
+			xmmstimid_opts.buffer_size;
+
+	buffer = g_malloc(buffer_size);
+	if (buffer == NULL) return(NULL);
+
+	fmt = (xmmstimid_opts.format == MID_AUDIO_S16LSB) ? FMT_S16_LE : FMT_S8;
+
+	while (playback->playing) {
+		bytes_read = mid_song_read_wave(xmmstimid_song,
+				buffer, buffer_size);
+
+		if (bytes_read != 0)
+			produce_audio(mid_song_get_time(xmmstimid_song),
+					fmt, xmmstimid_opts.channels,
+					bytes_read, buffer, &playback->playing);
+		else {
+		        playback->eof = TRUE;
+		        playback->output->buffer_free ();
+		        playback->output->buffer_free ();
+		        while (playback->output->buffer_playing())
+		                g_usleep(10000);
+			playback->playing = FALSE;
+		}
+
+		if (xmmstimid_seek_to != -1) {
+			mid_song_seek(xmmstimid_song, xmmstimid_seek_to * 1000);
+			playback->output->flush(xmmstimid_seek_to * 1000);
+			xmmstimid_seek_to = -1;
+			bytes_read = 0;
+		}
+	}
+
+	g_free(buffer);
+	return(NULL);
+}
+
+static gchar *xmmstimid_get_title(gchar *filename) {
+	Tuple *input;
+	gchar *title;
+
+	input = tuple_new_from_filename(filename);
+
+	title = tuple_formatter_make_title_string(input, get_gentitle_format());
+	if (title == NULL || *title == '\0')
+		title = g_strdup(tuple_get_string(input, FIELD_FILE_NAME, NULL));
+
+	tuple_free(input);
+
+	return title;
+}
+
+void xmmstimid_play_file(InputPlayback * playback) {
+	char *filename = playback->filename;
+	MidIStream *stream;
+	gchar *title;
+
+	if (!xmmstimid_initialized) {
+		xmmstimid_init();
+		if (!xmmstimid_initialized) return;
+	}
+
+	if (xmmstimid_song != NULL) {
+		mid_song_free(xmmstimid_song);
+		xmmstimid_song = NULL;
+	}
+
+	stream = mid_istream_open_file(filename);
+	if (stream == NULL) return;
+
+	xmmstimid_audio_error = FALSE;
+
+	xmmstimid_opts.rate = xmmstimid_cfg.rate;
+	xmmstimid_opts.format = (xmmstimid_cfg.bits == 16) ?
+		MID_AUDIO_S16LSB : MID_AUDIO_S8;
+	xmmstimid_opts.channels = xmmstimid_cfg.channels;
+	xmmstimid_opts.buffer_size = xmmstimid_cfg.buffer_size;
+
+	xmmstimid_song = mid_song_load(stream, &xmmstimid_opts);
+	mid_istream_close(stream);
+
+	if (xmmstimid_song == NULL) {
+		xmmstimid_ip.set_info_text(_("Couldn't load MIDI file"));
+		return;
+	}
+
+	if (playback->output->open_audio(
+				(xmmstimid_opts.format == MID_AUDIO_S16LSB) ?
+				FMT_S16_LE : FMT_S8,
+				xmmstimid_opts.rate, xmmstimid_opts.channels) == 0) {
+		xmmstimid_audio_error = TRUE;
+		mid_song_free(xmmstimid_song);
+		xmmstimid_song = NULL;
+		return;
+	}
+
+	title = xmmstimid_get_title(filename);
+	xmmstimid_ip.set_info(title,
+			mid_song_get_total_time(xmmstimid_song),
+			0, xmmstimid_opts.rate, xmmstimid_opts.channels);
+	g_free(title);
+
+	mid_song_start(xmmstimid_song);
+	playback->playing = TRUE;
+	playback->eof = FALSE;
+	xmmstimid_seek_to = -1;
+
+	xmmstimid_decode_thread = g_thread_self();
+	playback->set_pb_ready(playback);
+	xmmstimid_play_loop(playback);
+}
+
+void xmmstimid_stop(InputPlayback * playback) {
+	if (xmmstimid_song != NULL && playback->playing) {
+		playback->playing = FALSE;
+		g_thread_join(xmmstimid_decode_thread);
+		playback->output->close_audio();
+		mid_song_free(xmmstimid_song);
+		xmmstimid_song = NULL;
+	}
+}
+
+void xmmstimid_pause(InputPlayback * playback, short p) {
+	playback->output->pause(p);
+}
+
+void xmmstimid_seek(InputPlayback * playback, int time) {
+	xmmstimid_seek_to = time;
+	playback->eof = FALSE;
+
+	while (xmmstimid_seek_to != -1)
+		g_usleep(10000);
+}
+
+int xmmstimid_get_time(InputPlayback * playback) {
+	if (xmmstimid_audio_error)
+		return -2;
+	if (xmmstimid_song == NULL)
+		return -1;
+	if (!playback->playing || (playback->eof &&
+				playback->output->buffer_playing()))
+		return -1;
+
+	return mid_song_get_time(xmmstimid_song);
+}
+
+void xmmstimid_cleanup(void) {
+	if (xmmstimid_cfg.config_file) {
+		free(xmmstimid_cfg.config_file);
+		xmmstimid_cfg.config_file = NULL;
+	}
+
+	if (xmmstimid_initialized)
+		mid_exit();
+}
+
+void xmmstimid_get_song_info(char *filename, char **title, int *length) {
+	MidIStream *stream;
+	MidSongOptions opts;
+	MidSong *song;
+
+	if (!xmmstimid_initialized) {
+		xmmstimid_init();
+		if (!xmmstimid_initialized) return;
+	}
+
+	stream = mid_istream_open_file(filename);
+	if (stream == NULL) return;
+
+	opts.rate = xmmstimid_cfg.rate;
+	opts.format = (xmmstimid_cfg.bits == 16) ?
+		MID_AUDIO_S16LSB : MID_AUDIO_S8;
+	opts.channels = xmmstimid_cfg.channels;
+	opts.buffer_size = 8;
+
+	song = mid_song_load(stream, &opts);
+	mid_istream_close(stream);
+
+	if (song == NULL) return;
+
+	*length = mid_song_get_total_time(song);
+	*title = xmmstimid_get_title(filename);
+
+	mid_song_free(song);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/timidity/xmms-timidity.h	Wed Sep 26 14:53:37 2007 +0200
@@ -0,0 +1,40 @@
+/*
+    xmms-timidity - MIDI Plugin for XMMS
+    Copyright (C) 2004 Konstantin Korikov <lostclus@ua.fm>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef XMMS_TIMIDITY_H
+#define XMMS_TIMIDITY_H
+
+#include <audacious/plugin.h>
+#include <audacious/vfs.h>
+
+extern InputPlugin xmmstimid_ip;
+
+static void xmmstimid_init(void);
+static void xmmstimid_about(void);
+static void xmmstimid_configure(void);
+static int xmmstimid_is_our_fd( char * filename, VFSFile * fp );
+static void xmmstimid_play_file(InputPlayback * playback);
+static void xmmstimid_stop(InputPlayback * playback);
+static void xmmstimid_pause(InputPlayback * playback, short p);
+static void xmmstimid_seek(InputPlayback * playback, int time);
+static int xmmstimid_get_time(InputPlayback * playback);
+static void xmmstimid_cleanup(void);
+static void xmmstimid_get_song_info(char *filename, char **title, int *length);
+
+#endif
--- a/src/tonegen/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/tonegen/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,13 +1,11 @@
-include ../../extra.mk
-
-PLUGIN = tonegen$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
+PLUGIN = tonegen${PLUGIN_SUFFIX}
 SRCS = tonegen.c
 
-include ../../buildsys.mk
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../..
-CPPFLAGS = $(CFLAGS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/tta/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/tta/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,12 @@
+PLUGIN = tta${PLUGIN_SUFFIX}
+SRCS = libtta.c	\
+       ttadec.c
+
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = tta$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = libtta.c ttadec.c
-
-include ../../buildsys.mk
-
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-LIBS += -L$(libdir) -laudid3tag $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += -L${libdir} -laudid3tag ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/voice_removal/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/voice_removal/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -8,4 +8,4 @@
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBADD = ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/vorbis/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/vorbis/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,14 @@
+PLUGIN = vorbis${PLUGIN_SUFFIX}
+SRCS = configure.c	\
+       fileinfo.c	\
+       vcedit.c		\
+       vorbis.c
+
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = vorbis$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = configure.c  fileinfo.c  vcedit.c  vorbis.c
-
-include ../../buildsys.mk
-
-LIBS += $(OGG_VORBIS_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(OGG_VORBIS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${OGG_VORBIS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${OGG_VORBIS_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/vtx/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/vtx/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,17 @@
+PLUGIN = vtx${SHARED_SUFFIX}
+SRCS = about.c		\
+       ay8912.c		\
+       config.c		\
+       info.c		\
+       lh5dec.c		\
+       vtx.c		\
+       vtxfile.c
+
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = vtx$(SHARED_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = about.c  ay8912.c  config.c  info.c  lh5dec.c  vtx.c  vtxfile.c
-
-include ../../buildsys.mk
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../.. -Wall
-CPPFLAGS = $(CFLAGS) -I.
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../.. -I.
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/wav/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/wav/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,13 +1,11 @@
+PLUGIN = wav${PLUGIN_SUFFIX}
+SRCS = wav${WAV_SNDFILE}.c
+
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
 include ../../extra.mk
 
-PLUGIN = wav$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-SRCS = wav$(WAV_SNDFILE).c
-
-include ../../buildsys.mk
-
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(CFLAGS) $(MOWGLI_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. -Wall
-LIBS += -L/usr/local/lib $(MOWGLI_LIBS) $(SNDFILE_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. 
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${MOWGLI_LIBS} ${SNDFILE_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/wavpack/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/wavpack/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,13 +1,13 @@
-include ../../extra.mk
+PLUGIN = wavpack${PLUGIN_SUFFIX}
+SRCS = tags.cxx		\
+       ui.cxx		\
+       libwavpack.cxx
 
-PLUGIN = wavpack$(PLUGIN_SUFFIX)
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-SRCS = tags.cxx ui.cxx libwavpack.cxx
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
 include ../../buildsys.mk
+include ../../extra.mk
 
-CPPFLAGS += $(DBUS_CFLAGS) $(MOWGLI_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(WAVPACK_CFLAGS) -I../../intl -I../..
-CXXFLAGS += $(PLUGIN_CFLAGS)
-
-LIBS += -L/usr/local/lib $(WAVPACK_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -lstdc++
-
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${DBUS_CFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${WAVPACK_CFLAGS} -I../../intl -I../..
+CXXFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${WAVPACK_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/wma/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/wma/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,4 +1,4 @@
-PLUGIN = wma$(PLUGIN_SUFFIX)
+PLUGIN = wma${PLUGIN_SUFFIX}
 SRCS = wma.c			\
        libffwma/allcodecs.c	\
        libffwma/allformats.c	\
@@ -20,12 +20,10 @@
        libffwma/mem.c		\
        libffwma/uri.c
 
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
+include ../../buildsys.mk
 include ../../extra.mk
-include ../../buildsys.mk
-
-${LIB}: libffwma/${LIB_PREFIX}ffwma${LIB_SUFFIX}
 
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../.. -I./libffwma -std=c99 ${GCC42_CFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
 CFLAGS += ${PLUGIN_CFLAGS}
--- a/src/xspf/Makefile	Wed Sep 26 06:38:56 2007 +0200
+++ b/src/xspf/Makefile	Wed Sep 26 14:53:37 2007 +0200
@@ -1,12 +1,11 @@
-PLUGIN = xspf$(PLUGIN_SUFFIX)
-plugindir = audacious/$(CONTAINER_PLUGIN_DIR)
+PLUGIN = xspf${PLUGIN_SUFFIX}
+SRCS = xspf.c
 
-SRCS = xspf.c
+plugindir = audacious/${CONTAINER_PLUGIN_DIR}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) \
-	-I../../intl -I../.. -Wall
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS)
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS}