changeset 1929:64bcd7c9c705

Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author Kiyoshi Aman <kiyoshi.aman@gmail.com>
date Mon, 01 Oct 2007 05:56:16 -0500
parents b68bcc6a39c7 (current diff) a1ed9f7cb4cc (diff)
children a945460e921c
files src/aac/Makefile src/aac/libfaad2/Makefile 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/adplug/core/Makefile src/modplug/archive/Makefile src/musepack/config.h.in src/paranormal/libcalc/Makefile src/projectm-1.0/COPYING src/projectm-1.0/main.cxx src/projectm-1.0/sdltoprojectM.h src/projectm-1.0/video_init.cxx src/projectm-1.0/video_init.h src/rovascope/Makefile src/rovascope/TODO src/rovascope/actuatorbin.c src/rovascope/actuators.c src/rovascope/actuators.h src/rovascope/beatdetect.c src/rovascope/builtins.c src/rovascope/cmaps.c src/rovascope/containers.c src/rovascope/containers.h src/rovascope/drawing.c src/rovascope/drawing.h src/rovascope/freq.c src/rovascope/general.c src/rovascope/libcalc/Makefile src/rovascope/libcalc/calc.h src/rovascope/libcalc/dict.c src/rovascope/libcalc/dict.h src/rovascope/libcalc/execute.c src/rovascope/libcalc/execute.h src/rovascope/libcalc/function.c src/rovascope/libcalc/function.h src/rovascope/libcalc/parser.c src/rovascope/libcalc/parser.h src/rovascope/libcalc/parser.yacc src/rovascope/libcalc/storage.c src/rovascope/libcalc/storage.h src/rovascope/misc.c src/rovascope/paranormal.c src/rovascope/paranormal.h src/rovascope/plugin.c src/rovascope/pn_utils.h src/rovascope/wave.c src/rovascope/xform.c src/scrobbler/audioscrobbler.png src/scrobbler/audioscrobbler_badge.png src/sid/config.h.in src/timidity/Makefile 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/wma/libffwma/Makefile src/xspf/base64.c src/xspf/base64.h src/xspf/urlencode.c src/xspf/urlencode.h
diffstat 230 files changed, 7283 insertions(+), 11347 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,19 +1,3 @@
-.SILENT:
-
-include mk/rules.mk
-include mk/init.mk
-
 SUBDIRS = src po
 
-include mk/objective.mk
-
-install-posthook:
-	@if test `whoami` = 'root' && test -z "$(DESTDIR)"; then \
-		echo; \
-		echo "WARNING:"; \
-		echo "On some systems, it might be required that you run"; \
-		echo "ldconfig. However, this isn't done automatically"; \
-		echo "because some ldconfig versions might break the system"; \
-		echo "if it's called without any parameters."; \
-	fi
-
+include buildsys.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/buildsys.mk.in	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,401 @@
+#
+#  Copyright (c) 2007, Jonathan Schleifer <js@h3c.de>
+#
+#  Permission to use, copy, modify, and/or distribute this software for any
+#  purpose with or without fee is hereby granted, provided that the above
+#  copyright notice and this permission notice is present in all copies.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+#  POSSIBILITY OF SUCH DAMAGE.
+#
+
+PACKAGE = @PACKAGE@
+CC = @CC@
+CXX = @CXX@
+CPP = @CPP@
+DC = @DC@
+ERLC = @ERLC@
+OBJC = @OBJC@
+AR = @AR@
+LD = ${CC}
+CFLAGS = @CFLAGS@
+CXXFLAGS = @CXXFLAGS@
+CPPFLAGS = @CPPFLAGS@
+DFLAGS = @DFLAGS@
+ERLCFLAGS = @ERLCFLAGS@
+OBJCFLAGS = @OBJCFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+PROG_IMPLIB_NEEDED = @PROG_IMPLIB_NEEDED@
+PROG_IMPLIB_LDFLAGS = @PROG_IMPLIB_LDFLAGS@
+PROG_SUFFIX = @EXEEXT@
+LIB_CPPFLAGS = @LIB_CPPFLAGS@
+LIB_CFLAGS = @LIB_CFLAGS@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIB_PREFIX = @LIB_PREFIX@
+LIB_SUFFIX = @LIB_SUFFIX@
+PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@
+PLUGIN_CFLAGS = @PLUGIN_CFLAGS@
+PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@
+PLUGIN_SUFFIX = @PLUGIN_SUFFIX@
+INSTALL_LIB = @INSTALL_LIB@
+UNINSTALL_LIB = @UNINSTALL_LIB@
+CLEAN_LIB = @CLEAN_LIB@
+LN_S = @LN_S@
+MKDIR_P = mkdir -p
+INSTALL = install
+SHELL = @SHELL@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+libdir = @libdir@
+plugindir ?= ${PACKAGE}
+datarootdir = @datarootdir@
+datadir = @datadir@
+includedir = @includedir@
+includesubdir ?= ${PACKAGE}
+mandir = @mandir@
+mansubdir ?= man1
+
+OBJS1 = ${SRCS:.c=.o}
+OBJS2 = ${OBJS1:.cc=.o}
+OBJS3 = ${OBJS2:.cxx=.o}
+OBJS4 = ${OBJS3:.d=.o}
+OBJS5 = ${OBJS4:.erl=.beam}
+OBJS += ${OBJS5:.m=.o}
+
+.SILENT:
+.SUFFIXES: .beam .c .cc .cxx .d .erl .m
+.PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean
+
+all:
+	for i in subdirs depend ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST}; do \
+		${MAKE} ${MFLAGS} $$i || exit 1; \
+	done
+
+subdirs:
+	for i in ${SUBDIRS}; do \
+		${DIR_ENTER}; \
+		${MAKE} ${MFLAGS} || exit 1; \
+		${DIR_LEAVE}; \
+	done
+
+depend: pre-depend ${SRCS}
+	regen=0; \
+	for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \
+	if test x"$$regen" = x"1"; then \
+		list=""; \
+		${DEPEND_STATUS}; \
+		for i in ${SRCS}; do \
+			case $${i##*.} in \
+			c|cc|cxx|m) \
+				list="$$list $$i"; \
+				;; \
+			esac; \
+		done; \
+		if test x"$$list" != "x"; then \
+			if ${CPP} ${CPPFLAGS} -M $$list >.deps; then \
+				${DEPEND_OK}; \
+			else \
+				rm -f .deps; \
+				${DEPEND_FAILED}; \
+			fi; \
+		fi; \
+	fi
+
+pre-depend:
+
+${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS}
+	${LINK_STATUS}
+	if ${LD} -o $@ ${OBJS} ${LDFLAGS} ${LIBS}; then \
+		${LINK_OK}; \
+	else \
+		${LINK_FAILED}; \
+	fi
+
+${LIB} ${LIB_NOINST}: ${EXT_DEPS} ${OBJS}
+	${LINK_STATUS}
+	if ${LD} -o $@ ${OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \
+		${LINK_OK}; \
+	else \
+		${LINK_FAILED}; \
+	fi
+
+${PLUGIN} ${PLUGIN_NONST}: ${EXT_DEPS} ${OBJS}
+	${LINK_STATUS}
+	if ${LD} -o $@ ${OBJS} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \
+		${LINK_OK}; \
+	else \
+		${LINK_FAILED}; \
+	fi
+
+${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS}
+	${LINK_STATUS}
+	if ${AR} cr $@ ${OBJS}; then \
+		${LINK_OK}; \
+	else \
+		${LINK_FAILED}; \
+	fi
+
+.c.o:
+	${COMPILE_STATUS}
+	if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \
+		${COMPILE_OK}; \
+	else \
+		${COMPILE_FAILED}; \
+	fi
+
+.cc.o .cxx.o:
+	${COMPILE_STATUS}
+	if ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \
+		${COMPILE_OK}; \
+	else \
+		${COMPILE_FAILED}; \
+	fi
+
+.d.o:
+	${COMPILE_STATUS}
+	if test x"$(basename ${DC})" = x"dmd"; then \
+		if ${DC} ${DFLAGS} -c -of$@ $<; then \
+			${COMPILE_OK}; \
+		else \
+			${COMPILE_FAILED}; \
+		fi \
+	else \
+		if ${DC} ${DFLAGS} -c -o $@ $<; then \
+			${COMPILE_OK}; \
+		else \
+			${COMPILE_FAILED}; \
+		fi \
+	fi
+
+.erl.beam:
+	${COMPILE_STATUS}
+	if ${ERLC} ${ERLCFLAGS} -o $@ $<; then \
+		${COMPILE_OK}; \
+	else \
+		${COMPILE_FAILED}; \
+	fi
+
+.m.o:
+	${COMPILE_STATUS}
+	if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \
+		${COMPILE_OK}; \
+	else \
+		${COMPILE_FAILED}; \
+	fi
+
+install: ${LIB} ${STATIC_LIB} ${PLUGIN} ${PROG} install-extra
+	for i in ${SUBDIRS}; do \
+		${DIR_ENTER}; \
+		${MAKE} ${MFLAGS} install || exit 1; \
+		${DIR_LEAVE}; \
+	done
+
+	for i in ${LIB}; do \
+		${INSTALL_STATUS}; \
+		if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL_LIB}; then \
+			${INSTALL_OK}; \
+		else \
+			${INSTALL_FAILED}; \
+		fi \
+	done
+
+	for i in ${STATIC_LIB}; do \
+		${INSTALL_STATUS}; \
+		if ${MKDIR_P} ${DESTDIR}${libdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${libdir}/$$i; then \
+			${INSTALL_OK}; \
+		else \
+			${INSTALL_FAILED}; \
+		fi \
+	done
+
+	for i in ${PLUGIN}; do \
+		${INSTALL_STATUS}; \
+		if ${MKDIR_P} ${DESTDIR}${libdir}/${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/${plugindir}/$$i; then \
+			${INSTALL_OK}; \
+		else \
+			${INSTALL_FAILED}; \
+		fi \
+	done
+
+	for i in ${DATA}; do \
+		${INSTALL_STATUS}; \
+		if ${MKDIR_P} $$(dirname ${DESTDIR}${datadir}/${PACKAGE}/$$i) && ${INSTALL} -m 644 $$i ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \
+			${INSTALL_OK}; \
+		else \
+			${INSTALL_FAILED}; \
+		fi \
+	done
+
+	for i in ${PROG}; do \
+		${INSTALL_STATUS}; \
+		if ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i; then \
+			${INSTALL_OK}; \
+		else \
+			${INSTALL_FAILED}; \
+		fi \
+	done
+
+	for i in ${INCLUDES}; do \
+		${INSTALL_STATUS}; \
+		if ${MKDIR_P} ${DESTDIR}${includedir}/${includesubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${includedir}/${includesubdir}/$$i; then \
+			${INSTALL_OK}; \
+		else \
+			${INSTALL_FAILED}; \
+		fi \
+	done
+
+	for i in ${MAN}; do \
+		${INSTALL_STATUS}; \
+		if ${MKDIR_P} ${DESTDIR}${mandir}/${mansubdir} && ${INSTALL} -m 644 $$i ${DESTDIR}${mandir}/${mansubdir}/$$i; then \
+			${INSTALL_OK}; \
+		else \
+			${INSTALL_FAILED}; \
+		fi \
+	done
+
+install-extra:
+
+uninstall: uninstall-extra
+	for i in ${SUBDIRS}; do \
+		${DIR_ENTER}; \
+		${MAKE} ${MFLAGS} uninstall || exit 1; \
+		${DIR_LEAVE}; \
+	done
+
+	for i in ${LIB}; do \
+		if test -f ${DESTDIR}${libdir}/$$i; then \
+			if ${UNINSTALL_LIB}; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi; \
+	done
+
+	for i in ${STATIC_LIB}; do \
+		if test -f ${DESTDIR}${libdir}/$$i; then \
+			if rm -f ${DESTDIR}${libdir}/$$i; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi \
+	done
+
+	for i in ${PLUGIN}; do \
+		if test -f ${DESTDIR}${libdir}/${plugindir}/$$i; then \
+			if rm -f ${DESTDIR}${libdir}/${plugindir}/$$i; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi \
+	done
+	-rmdir ${DESTDIR}${libdir}/${plugindir} >/dev/null 2>&1
+
+	for i in ${DATA}; do \
+		if test -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \
+			if rm -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi \
+	done
+
+	for i in ${PROG}; do \
+		if test -f ${DESTDIR}${bindir}/$$i; then \
+			if rm -f ${DESTDIR}${bindir}/$$i; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi \
+	done
+
+	for i in ${INCLUDES}; do \
+		if test -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \
+			if rm -f ${DESTDIR}${includedir}/${includesubdir}/$$i; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi \
+	done
+	-rmdir ${DESTDIR}${includedir}/${includesubdir} >/dev/null 2>&1
+
+	for i in ${MAN}; do \
+		if test -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \
+			if rm -f ${DESTDIR}${mandir}/${mansubdir}/$$i; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi \
+	done
+
+uninstall-extra:
+
+clean:
+	for i in ${SUBDIRS}; do \
+		${DIR_ENTER}; \
+		${MAKE} ${MFLAGS} clean || exit 1; \
+		${DIR_LEAVE}; \
+	done
+	
+	for i in ${OBJS} ${CLEAN} ${CLEAN_LIB} .deps; do \
+		if test -f $$i -o -d $$i; then \
+			if rm -fr $$i; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi \
+	done
+
+distclean: clean
+	for i in ${SUBDIRS}; do \
+		${DIR_ENTER}; \
+		${MAKE} ${MFLAGS} distclean || exit 1; \
+		${DIR_LEAVE}; \
+	done
+	
+	for i in ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST}  ${PLUGIN} ${PLUGIN_NOINST} ${DISTCLEAN} *~; do \
+		if test -f $$i -o -d $$i; then \
+			if rm -fr $$i; then \
+				${DELETE_OK}; \
+			else \
+				${DELETE_FAILED}; \
+			fi \
+		fi \
+	done
+
+DIR_ENTER = printf "\033[0;36mEntering directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd $$i || exit 1
+DIR_LEAVE = printf "\033[0;36mLeaving directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd .. || exit 1
+DEPEND_STATUS = printf "\033[0;33mGenerating dependencies...\033[0m\r"
+DEPEND_OK = printf "\033[0;32mSuccessfully generated dependencies.\033[0m\n"
+DEPEND_FAILED = printf "\033[0;31mFailed to generate dependencies!\033[0m\n"; exit 1
+COMPILE_STATUS = printf "\033[0;33mCompiling \033[1;33m$<\033[0;33m...\033[0m\r"
+COMPILE_OK = printf "\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m.\033[0m\n"
+COMPILE_FAILED = printf "\033[0;31mFailed to compile \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
+LINK_STATUS = printf "\033[0;33mLinking \033[1;33m$@\033[0;33m...\033[0m\r"
+LINK_OK = printf "\033[0;32mSuccessfully linked \033[1;32m$@\033[0;32m.\033[0m\n"
+LINK_FAILED = printf "\033[0;31mFailed to link \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
+INSTALL_STATUS = printf "\033[0;33mInstalling \033[1;33m$$i\033[0;33m...\033[0m\r"
+INSTALL_OK = printf "\033[0;32mSuccessfully installed \033[1;32m$$i\033[0;32m.\033[0m\n"
+INSTALL_FAILED = printf "\033[0;31mFailed to install \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1
+DELETE_OK = printf "\033[0;34mDeleted \033[1;34m$$i\033[0;34m.\033[0m\n"
+DELETE_FAILED = printf "\033[0;31mFailed to delete \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1
+
+-include .deps
--- a/configure.ac	Wed Sep 19 11:03:57 2007 -0500
+++ b/configure.ac	Mon Oct 01 05:56:16 2007 -0500
@@ -22,6 +22,11 @@
 	CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
 fi
 
+dnl append audacious header path to CPPFLAGS when --prefix is specified.
+if test "$prefix" != "NONE" ; then
+   CPPFLAGS="$CPPFLAGS -I${includedir}"
+fi
+
 dnl OMK bootstrap
 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])
 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])
@@ -77,7 +82,6 @@
 
 dnl Checks for various programs
 
-AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 
@@ -185,6 +189,10 @@
 dnl plugin stuff
 dnl ========================
 
+BUILDSYS_SHARED_LIB
+BUILDSYS_PROG_IMPLIB
+test x"$PROG_IMPLIB_NEEDED" = x"yes" && LIBS="$LIBS -L\${libdir} -laudacious.exe"
+
 dnl Ok, first we find out what flags we need to use.
 AC_MSG_CHECKING([for what extension and flags to use for plugin compilation])
 case "$target" in
@@ -1282,7 +1290,7 @@
 [have_neon=no])
 
 if test "x$have_neon" = "xyes"; then
-    PKG_CHECK_MODULES(NEON, [neon >= 0.27], [TRANSPORT_PLUGINS="$TRANSPORT_PLUGINS neon" ], [have_neon="no"])
+    PKG_CHECK_MODULES(NEON, [neon >= 0.26], [TRANSPORT_PLUGINS="$TRANSPORT_PLUGINS neon" ], [have_neon="no"])
     NEON_LIBS=`pkg-config --libs neon`
     NEON_CFLAGS=`pkg-config --cflags neon`
 else
@@ -1356,14 +1364,14 @@
 ])
 
 if test "$have_paranormal" = "yes"; then
-	VISUALIZATION_PLUGINS="$VISUALIZATION_PLUGINS paranormal rovascope"
+	VISUALIZATION_PLUGINS="$VISUALIZATION_PLUGINS paranormal"
 fi
 
 if test "$have_xspf" = "yes"; then
 	CONTAINER_PLUGINS="$CONTAINER_PLUGINS xspf"
 fi
 
-dnl *** ProjectM (GL Milkdrop port)
+dnl *** projectM (GL Milkdrop port)
 
 AC_ARG_ENABLE(projectm,
 [  --disable-projectm      disable projectM vis plugin. (default=enabled)],
@@ -1371,7 +1379,7 @@
 [have_projectm=yes])
 
 if test "$have_projectm" = "yes"; then
-	PKG_CHECK_MODULES(LIBPROJECTM, libprojectM >= 0.0.0, [have_projectm="yes"], [have_projectm="no"])
+	PKG_CHECK_MODULES(LIBPROJECTM, libprojectM < 1.0, [have_projectm="yes"], [have_projectm="no"])
 	AM_PATH_SDL(1.2.5, , [
 		AC_MSG_WARN([*** SDL is not installed. projectM will not be built. ***])
 		have_projectm="no"
@@ -1379,7 +1387,7 @@
 	if test x$libprjM = xno; then
 	        AC_MSG_WARN([*** libprojectM not found.
 	                        libprojectM is needed to build this package.
-	                        You can download libprojectM at http://xmms-projectM.sf.net/])
+	                        You can download libprojectM at http://projectm.sf.net/])
 	fi
 	LIBPROJECTM_datadir=`pkg-config --variable=pkgdatadir libprojectM`;
 	LIBPROJECTM_sysconfdir=`pkg-config --variable=sysconfdir libprojectM`;
@@ -1392,6 +1400,36 @@
 	VISUALIZATION_PLUGINS="$VISUALIZATION_PLUGINS projectm"
 fi
 
+dnl *** projectM (GL Milkdrop port)
+
+AC_ARG_ENABLE(projectm-1.0,
+[  --disable-projectm-1.0      disable projectM 1.0+ vis plugin. (default=enabled)],
+[have_projectm1=$enableval],
+[have_projectm1=yes])
+
+if test "$have_projectm1" = "yes"; then
+	PKG_CHECK_MODULES(LIBPROJECTM1, libprojectM >= 1.0, [have_projectm1="yes"], [have_projectm1="no"])
+	AM_PATH_SDL(1.2.5, , [
+		AC_MSG_WARN([*** SDL is not installed. projectM will not be built. ***])
+		have_projectm1="no"
+	])
+	if test x$libprjM = xno; then
+	        AC_MSG_WARN([*** libprojectM not found.
+	                        libprojectM is needed to build this package.
+	                        You can download libprojectM at http://projectm.sf.net/])
+	fi
+	LIBPROJECTM1_datadir=`pkg-config --variable=pkgdatadir libprojectM`;
+	LIBPROJECTM1_sysconfdir=`pkg-config --variable=sysconfdir libprojectM`;
+        LIBPROJECTM1_prefix=`pkg-config --variable=prefix libprojectM`;
+	LIBPROJECTM1_CFLAGS="$LIBPROJECTM1_CFLAGS -DPROJECTM_DATADIR=\\\"$LIBPROJECTM1_datadir\\\" -DPROJECTM_SYSCONFDIR=\\\"$LIBPROJECTM1_sysconfdir\\\" -DPROJECTM_PREFIX=\\\"$LIBPROJECTM1_prefix\\\"";
+fi
+AC_SUBST(LIBPROJECTM1_LIBS)
+AC_SUBST(LIBPROJECTM1_CFLAGS)
+
+if test "$have_projectm1" = "yes"; then
+	VISUALIZATION_PLUGINS="$VISUALIZATION_PLUGINS projectm-1.0"
+fi
+
 dnl *** TTA
 
 AC_ARG_ENABLE(tta,
@@ -1537,6 +1575,8 @@
 AC_SUBST(GCC42_CFLAGS)
 
 AC_CONFIG_FILES([
+	buildsys.mk
+	extra.mk
 	mk/rules.mk
 	po/Makefile.in
 ])
@@ -1622,7 +1662,8 @@
 echo "  Blur Scope:                             yes"
 echo "  Spectrum Analyzer:                      yes"
 echo "  Paranormal Visualization Library:       $have_paranormal"
-echo "  ProjectM (GL milkdrop):                 $have_projectm"
+echo "  projectM 0.x (GL milkdrop):             $have_projectm"
+echo "  projectM 1.x (GL milkdrop):             $have_projectm1"
 echo "  RootVis plugin:                         $have_rootvis"
 echo
 echo "  Transport"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra.mk.in	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,380 @@
+@SET_MAKE@
+
+srcdir ?= @srcdir@
+top_srcdir ?= @top_srcdir@
+VPATH ?= @srcdir@
+pkgdatadir ?= $(datadir)/@PACKAGE@
+pkglibdir ?= $(libdir)/@PACKAGE@
+pkgincludedir ?= $(includedir)/@PACKAGE@
+top_builddir ?= .
+am__cd ?= CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL ?= @INSTALL@
+install_sh_DATA ?= $(install_sh) -c -m 644
+install_sh_PROGRAM ?= $(install_sh) -c
+install_sh_SCRIPT ?= $(install_sh) -c
+INSTALL_HEADER ?= $(INSTALL_DATA)
+transform ?= $(program_transform_name)
+NORMAL_INSTALL ?= :
+PRE_INSTALL ?= :
+POST_INSTALL ?= :
+NORMAL_UNINSTALL ?= :
+PRE_UNINSTALL ?= :
+POST_UNINSTALL ?= :
+build_triplet ?= @build@
+host_triplet ?= @host@
+target_triplet ?= @target@
+subdir ?= .
+ACLOCAL_M4 ?= $(top_srcdir)/aclocal.m4
+CONFIG_HEADER ?= config.h
+CONFIG_CLEAN_FILES ?= audacious.1 audacious.spec audacious.pc \
+	intl/Makefile
+SOURCES =
+DIST_SOURCES =
+man1dir ?= $(mandir)/man1
+am__installdirs ?= "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)"
+NROFF ?= nroff
+MANS ?= $(man_MANS)
+am__vpath_adj_setup ?= srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj ?= case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir ?= `echo $$p | sed -e 's|^.*/||'`;
+pkgconfigDATA_INSTALL ?= $(INSTALL_DATA)
+DATA ?= $(pkgconfig_DATA)
+ETAGS ?= etags
+CTAGS ?= ctags
+DIST_SUBDIRS ?= $(SUBDIRS)
+DISTFILES ?= $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir ?= $(PACKAGE)-$(VERSION)
+top_distdir ?= $(distdir)
+am__remove_distdir ?= \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES ?= $(distdir).tar.gz
+GZIP_ENV ?= --best
+distuninstallcheck_listfiles ?= find . -type f -print
+distcleancheck_listfiles ?= find . -type f -print
+ACLOCAL ?= @ACLOCAL@
+ALLOCA ?= @ALLOCA@
+ALSA_CFLAGS ?= @ALSA_CFLAGS@
+ALSA_LIBS ?= @ALSA_LIBS@
+AMDEP_FALSE ?= @AMDEP_FALSE@
+AMDEP_TRUE ?= @AMDEP_TRUE@
+AMIDIPLUGBACKENDDIR ?= @AMIDIPLUGBACKENDDIR@
+AMIDIPLUG_BACKENDS ?= @AMIDIPLUG_BACKENDS@
+AMTAR ?= @AMTAR@
+AR ?= @AR@
+ARCH_DEFINES ?= @ARCH_DEFINES@
+ARCH_X86_FALSE ?= @ARCH_X86_FALSE@
+ARCH_X86_TRUE ?= @ARCH_X86_TRUE@
+ARTSC_CFLAGS ?= @ARTSC_CFLAGS@
+ARTSC_LIBS ?= @ARTSC_LIBS@
+AUTOCONF ?= @AUTOCONF@
+AUTOHEADER ?= @AUTOHEADER@
+AUTOMAKE ?= @AUTOMAKE@
+AWK ?= @AWK@
+BEEP_DEFINES ?= @BEEP_DEFINES@
+BEEP_PATH ?= @BEEP_PATH@
+BINIO_CFLAGS ?= @BINIO_CFLAGS@
+BINIO_LIBS ?= @BINIO_LIBS@
+BUILDERS_INCLUDES ?= @BUILDERS_INCLUDES@
+BUILDERS_LDFLAGS ?= @BUILDERS_LDFLAGS@
+BUILD_INCLUDED_LIBINTL ?= @BUILD_INCLUDED_LIBINTL@
+CAIRO_CFLAGS ?= @CAIRO_CFLAGS@
+CAIRO_LIBS ?= @CAIRO_LIBS@
+CATOBJEXT ?= @CATOBJEXT@
+CC = @CC@
+CCAS ?= @CCAS@
+CCASFLAGS ?= @CCASFLAGS@
+CCDEPMODE ?= @CCDEPMODE@
+CFLAGS += @CFLAGS@
+CPP = @CPP@
+CPPFLAGS += @CPPFLAGS@
+CXX = @CXX@
+CXXCPP ?= @CXXCPP@
+CXXDEPMODE ?= @CXXDEPMODE@
+CXXFLAGS += @CXXFLAGS@
+CYGPATH_W ?= @CYGPATH_W@
+DATADIRNAME ?= @DATADIRNAME@
+DBUS_CFLAGS ?= @DBUS_CFLAGS@
+DBUS_LIBS ?= @DBUS_LIBS@
+DCT64 ?= @DCT64@
+DEFS ?= @DEFS@
+DEPDIR ?= @DEPDIR@
+ECHO ?= @ECHO@
+ECHO_C ?= @ECHO_C@
+ECHO_N ?= @ECHO_N@
+ECHO_T ?= @ECHO_T@
+EFFECT_PLUGINS ?= @EFFECT_PLUGINS@
+EFFECT_PLUGIN_DIR ?= @EFFECT_PLUGIN_DIR@
+EGREP ?= @EGREP@
+ENABLE_AAC_FALSE ?= @ENABLE_AAC_FALSE@
+ENABLE_AAC_TRUE ?= @ENABLE_AAC_TRUE@
+ENABLE_AMIDIPLUG_FALSE ?= @ENABLE_AMIDIPLUG_FALSE@
+ENABLE_AMIDIPLUG_TRUE ?= @ENABLE_AMIDIPLUG_TRUE@
+ENABLE_CROSSFADE_FALSE ?= @ENABLE_CROSSFADE_FALSE@
+ENABLE_CROSSFADE_TRUE ?= @ENABLE_CROSSFADE_TRUE@
+ENABLE_MPG123_FALSE ?= @ENABLE_MPG123_FALSE@
+ENABLE_MPG123_TRUE ?= @ENABLE_MPG123_TRUE@
+ENABLE_MUSEPACK_FALSE ?= @ENABLE_MUSEPACK_FALSE@
+ENABLE_MUSEPACK_TRUE ?= @ENABLE_MUSEPACK_TRUE@
+ENABLE_TIMIDITY_FALSE ?= @ENABLE_TIMIDITY_FALSE@
+ENABLE_TIMIDITY_TRUE ?= @ENABLE_TIMIDITY_TRUE@
+ENABLE_WMA_FALSE ?= @ENABLE_WMA_FALSE@
+ENABLE_WMA_TRUE ?= @ENABLE_WMA_TRUE@
+ESD_CFLAGS ?= @ESD_CFLAGS@
+ESD_LIBS ?= @ESD_LIBS@
+EXEEXT ?= @EXEEXT@
+FLUIDSYNTH_CFLAGS ?= @FLUIDSYNTH_CFLAGS@
+FLUIDSYNTH_LIBS ?= @FLUIDSYNTH_LIBS@
+GCONF_CFLAGS ?= @GCONF_CFLAGS@
+GCONF_LIBS ?= @GCONF_LIBS@
+GDKX11_CFLAGS ?= @GDKX11_CFLAGS@
+GDKX11_LIBS ?= @GDKX11_LIBS@
+GENCAT ?= @GENCAT@
+GENERAL_PLUGINS ?= @GENERAL_PLUGINS@
+GENERAL_PLUGIN_DIR ?= @GENERAL_PLUGIN_DIR@
+GLIBC21 ?= @GLIBC21@
+GLIB_CFLAGS ?= @GLIB_CFLAGS@
+GLIB_LIBS ?= @GLIB_LIBS@
+GMODULE_CFLAGS ?= @GMODULE_CFLAGS@
+GMODULE_LIBS ?= @GMODULE_LIBS@
+GMSGFMT ?= @GMSGFMT@
+GNOMEVFS_CFLAGS ?= @GNOMEVFS_CFLAGS@
+GNOMEVFS_LIBS ?= @GNOMEVFS_LIBS@
+GTK_CFLAGS ?= @GTK_CFLAGS@
+GTK_LIBS ?= @GTK_LIBS@
+HARDSID_LDADD ?= @HARDSID_LDADD@
+HAVE_ADPLUG_FALSE ?= @HAVE_ADPLUG_FALSE@
+HAVE_ADPLUG_TRUE ?= @HAVE_ADPLUG_TRUE@
+HAVE_ALSA_FALSE ?= @HAVE_ALSA_FALSE@
+HAVE_ALSA_TRUE ?= @HAVE_ALSA_TRUE@
+HAVE_CDROM_FALSE ?= @HAVE_CDROM_FALSE@
+HAVE_CDROM_TRUE ?= @HAVE_CDROM_TRUE@
+HAVE_ESD_FALSE ?= @HAVE_ESD_FALSE@
+HAVE_ESD_TRUE ?= @HAVE_ESD_TRUE@
+HAVE_FLAC_FALSE ?= @HAVE_FLAC_FALSE@
+HAVE_FLAC_TRUE ?= @HAVE_FLAC_TRUE@
+HAVE_GCONF_FALSE ?= @HAVE_GCONF_FALSE@
+HAVE_GCONF_TRUE ?= @HAVE_GCONF_TRUE@
+HAVE_GNOME_VFS_FALSE ?= @HAVE_GNOME_VFS_FALSE@
+HAVE_GNOME_VFS_TRUE ?= @HAVE_GNOME_VFS_TRUE@
+HAVE_JACK_FALSE ?= @HAVE_JACK_FALSE@
+HAVE_JACK_TRUE ?= @HAVE_JACK_TRUE@
+HAVE_NULL_TRUE ?= @HAVE_NULL_TRUE@
+HAVE_LIBSAMPLERATE_FALSE ?= @HAVE_LIBSAMPLERATE_FALSE@
+HAVE_LIBSAMPLERATE_TRUE ?= @HAVE_LIBSAMPLERATE_TRUE@
+HAVE_LIBSNDFILE_FALSE ?= @HAVE_LIBSNDFILE_FALSE@
+HAVE_LIBSNDFILE_TRUE ?= @HAVE_LIBSNDFILE_TRUE@
+HAVE_LIBVISUAL_FALSE ?= @HAVE_LIBVISUAL_FALSE@
+HAVE_LIBVISUAL_TRUE ?= @HAVE_LIBVISUAL_TRUE@
+HAVE_LINUX_JOYSTICK_FALSE ?= @HAVE_LINUX_JOYSTICK_FALSE@
+HAVE_LINUX_JOYSTICK_TRUE ?= @HAVE_LINUX_JOYSTICK_TRUE@
+HAVE_LIRC_FALSE ?= @HAVE_LIRC_FALSE@
+HAVE_LIRC_TRUE ?= @HAVE_LIRC_TRUE@
+HAVE_MODPLUG_FALSE ?= @HAVE_MODPLUG_FALSE@
+HAVE_MODPLUG_TRUE ?= @HAVE_MODPLUG_TRUE@
+HAVE_OGGVORBIS_FALSE ?= @HAVE_OGGVORBIS_FALSE@
+HAVE_OGGVORBIS_TRUE ?= @HAVE_OGGVORBIS_TRUE@
+HAVE_OSS_FALSE ?= @HAVE_OSS_FALSE@
+HAVE_OSS_TRUE ?= @HAVE_OSS_TRUE@
+HAVE_SIDPLAY_FALSE ?= @HAVE_SIDPLAY_FALSE@
+HAVE_SIDPLAY_TRUE ?= @HAVE_SIDPLAY_TRUE@
+HAVE_SOLARIS_FALSE ?= @HAVE_SOLARIS_FALSE@
+HAVE_SOLARIS_TRUE ?= @HAVE_SOLARIS_TRUE@
+HAVE_SUN_FALSE ?= @HAVE_SUN_FALSE@
+HAVE_SUN_TRUE ?= @HAVE_SUN_TRUE@
+INPUT_PLUGINS ?= @INPUT_PLUGINS@
+INPUT_PLUGIN_DIR ?= @INPUT_PLUGIN_DIR@
+INSTALL_DATA ?= @INSTALL_DATA@
+INSTALL_PROGRAM ?= @INSTALL_PROGRAM@
+INSTALL_SCRIPT ?= @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM ?= @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT ?= @INSTOBJEXT@
+INTLBISON ?= @INTLBISON@
+INTLLIBS ?= @INTLLIBS@
+INTLOBJS ?= @INTLOBJS@
+INTL_LIBTOOL_SUFFIX_PREFIX ?= @INTL_LIBTOOL_SUFFIX_PREFIX@
+JACK_CFLAGS ?= @JACK_CFLAGS@
+JACK_LIBS ?= @JACK_LIBS@
+LDFLAGS ?= @LDFLAGS@
+LEDCODE ?= @LEDCODE@
+LIBBEEP_MAJOR_VERSION ?= @LIBBEEP_MAJOR_VERSION@
+LIBBEEP_MICRO_VERSION ?= @LIBBEEP_MICRO_VERSION@
+LIBBEEP_MINOR_VERSION ?= @LIBBEEP_MINOR_VERSION@
+FLAC_CFLAGS ?= @FLAC_CFLAGS@
+FLAC_LIBS ?= @FLAC_LIBS@
+LIBGLADE_CFLAGS ?= @LIBGLADE_CFLAGS@
+LIBGLADE_LIBS ?= @LIBGLADE_LIBS@
+LIBNMS_CFLAGS ?= @LIBNMS_CFLAGS@
+LIBNMS_LIBS ?= @LIBNMS_LIBS@
+LIBNMS_SRC ?= @LIBNMS_SRC@
+LIBICONV ?= @LIBICONV@
+LIBINTL ?= @LIBINTL@
+LIBOBJS ?= @LIBOBJS@
+LIBS ?= @LIBS@
+LIBTOOL ?= @LIBTOOL@
+LIBVISUAL_CFLAGS ?= @LIBVISUAL_CFLAGS@
+LIBVISUAL_LIBS ?= @LIBVISUAL_LIBS@
+LN_S ?= @LN_S@
+LTLIBICONV ?= @LTLIBICONV@
+LTLIBINTL ?= @LTLIBINTL@
+LTLIBOBJS ?= @LTLIBOBJS@
+MAKEINFO ?= @MAKEINFO@
+MKINSTALLDIRS ?= @MKINSTALLDIRS@
+MSGFMT ?= @MSGFMT@
+MSGMERGE ?= @MSGMERGE@
+MTP_CFLAGS ?= @MTP_CFLAGS@
+MTP_LIBS ?= @MTP_LIBS@
+OBJEXT ?= @OBJEXT@
+OGG_VORBIS_CFLAGS ?= @OGG_VORBIS_CFLAGS@
+OGG_VORBIS_LIBS ?= @OGG_VORBIS_LIBS@
+OSS_LIBS ?= @OSS_LIBS@
+OUTPUT_PLUGINS ?= @OUTPUT_PLUGINS@
+OUTPUT_PLUGIN_DIR ?= @OUTPUT_PLUGIN_DIR@
+PACKAGE ?= @PACKAGE@
+PACKAGE_BUGREPORT ?= @PACKAGE_BUGREPORT@
+PACKAGE_NAME ?= @PACKAGE_NAME@
+PACKAGE_STRING ?= @PACKAGE_STRING@
+PACKAGE_TARNAME ?= @PACKAGE_TARNAME@
+PACKAGE_VERSION ?= @PACKAGE_VERSION@
+PANGO_CFLAGS ?= @PANGO_CFLAGS@
+PANGO_LIBS ?= @PANGO_LIBS@
+PANGOCAIRO_CFLAGS ?= @PANGOCAIRO_CFLAGS@
+PANGOCAIRO_LIBS ?= @PANGOCAIRO_LIBS@
+PATH_SEPARATOR ?= @PATH_SEPARATOR@
+PC_REQUIRES ?= @PC_REQUIRES@
+PKG_CONFIG ?= @PKG_CONFIG@
+PLUGIN_LDFLAGS ?= @PLUGIN_LDFLAGS@
+POSUB ?= @POSUB@
+RANLIB ?= @RANLIB@
+RESID_LDADD ?= @RESID_LDADD@
+SAMPLERATE_CFLAGS ?= @SAMPLERATE_CFLAGS@
+SAMPLERATE_LIBS ?= @SAMPLERATE_LIBS@
+SDL_CFLAGS ?= @SDL_CFLAGS@
+SDL_CONFIG ?= @SDL_CONFIG@
+SDL_LIBS ?= @SDL_LIBS@
+SET_MAKE ?= @SET_MAKE@
+SHELL ?= @SHELL@
+SIDPLAY1_INCLUDES ?= @SIDPLAY1_INCLUDES@
+SIDPLAY1_LDADD ?= @SIDPLAY1_LDADD@
+SIDPLAY2_INCLUDES ?= @SIDPLAY2_INCLUDES@
+SIDPLAY2_LDADD ?= @SIDPLAY2_LDADD@
+SNDFILE_CFLAGS ?= @SNDFILE_CFLAGS@
+SNDFILE_LIBS ?= @SNDFILE_LIBS@
+STRIP ?= @STRIP@
+TAGLIB_CFLAGS ?= @TAGLIB_CFLAGS@
+TAGLIB_CONFIG ?= @TAGLIB_CONFIG@
+TAGLIB_LIBS ?= @TAGLIB_LIBS@
+USE_INCLUDED_LIBINTL ?= @USE_INCLUDED_LIBINTL@
+USE_NLS ?= @USE_NLS@
+USE_X86ASM_FALSE ?= @USE_X86ASM_FALSE@
+USE_X86ASM_TRUE ?= @USE_X86ASM_TRUE@
+VERSION ?= @VERSION@
+VISUALIZATION_PLUGINS ?= @VISUALIZATION_PLUGINS@
+VISUALIZATION_PLUGIN_DIR ?= @VISUALIZATION_PLUGIN_DIR@
+XGETTEXT ?= @XGETTEXT@
+ac_ct_AR ?= @ac_ct_AR@
+ac_ct_CC ?= @ac_ct_CC@
+ac_ct_CXX ?= @ac_ct_CXX@
+ac_ct_RANLIB ?= @ac_ct_RANLIB@
+ac_ct_STRIP ?= @ac_ct_STRIP@
+am__fastdepCC_FALSE ?= @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE ?= @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE ?= @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE ?= @am__fastdepCXX_TRUE@
+am__include ?= @am__include@
+am__leading_dot ?= @am__leading_dot@
+am__quote ?= @am__quote@
+am__tar ?= @am__tar@
+am__untar ?= @am__untar@
+beepdir ?= @beepdir@
+bindir ?= @bindir@
+build ?= @build@
+build_alias ?= @build_alias@
+build_cpu ?= @build_cpu@
+build_os ?= @build_os@
+build_vendor ?= @build_vendor@
+datadir ?= @datadir@
+datarootdir ?= @datarootdir@
+exec_prefix ?= @exec_prefix@
+host ?= @host@
+host_alias ?= @host_alias@
+host_cpu ?= @host_cpu@
+host_os ?= @host_os@
+host_vendor ?= @host_vendor@
+includedir ?= @includedir@
+infodir ?= @infodir@
+install_sh ?= @install_sh@
+libdir ?= @libdir@
+libexecdir ?= @libexecdir@
+localedir ?= @localedir@
+localstatedir ?= @localstatedir@
+mandir ?= @mandir@
+mkdir_p ?= @mkdir_p@
+oldincludedir ?= @oldincludedir@
+plugindir ?= @plugindir@
+pluginsubs ?= @pluginsubs@
+prefix ?= @prefix@
+program_transform_name ?= @program_transform_name@
+sbindir ?= @sbindir@
+sharedstatedir ?= @sharedstatedir@
+sysconfdir ?= @sysconfdir@
+target ?= @target@
+target_alias ?= @target_alias@
+target_cpu ?= @target_cpu@
+target_os ?= @target_os@
+target_vendor ?= @target_vendor@
+WAV_SNDFILE ?= @WAV_SNDFILE@
+VFS_BACKEND ?= @VFS_BACKEND@
+CONFIGDB_BACKEND ?= @CONFIGDB_BACKEND@
+CURL_CFLAGS ?= @CURL_CFLAGS@
+CURL_LIBS ?= @CURL_LIBS@
+NEON_CFLAGS ?= @NEON_CFLAGS@
+NEON_LIBS ?= @NEON_LIBS@
+CHARDET_LIBS ?= @CHARDET_LIBS@
+SUBDIR_GUESS ?= @SUBDIR_GUESS@
+LIBNOTIFY_CFLAGS ?= @LIBNOTIFY_CFLAGS@
+LIBNOTIFY_LIBS ?= @LIBNOTIFY_LIBS@
+XML_CPPFLAGS ?= @XML_CPPFLAGS@
+XML_LIBS ?= @XML_LIBS@
+CONTAINER_PLUGIN_DIR ?= @CONTAINER_PLUGIN_DIR@
+CONTAINER_PLUGINS ?= @CONTAINER_PLUGINS@
+SHARED_SUFFIX ?= @SHARED_SUFFIX@
+PICFLAGS ?= @PICFLAGS@
+PICLDFLAGS ?= @PICLDFLAGS@
+LIBLDFLAGS ?= @LIBLDFLAGS@
+AUDLDFLAGS ?= @AUDLDFLAGS@
+WAVPACK_CFLAGS ?= @WAVPACK_CFLAGS@
+WAVPACK_LIBS ?= @WAVPACK_LIBS@
+XCOMPOSITE_CFLAGS ?= @XCOMPOSITE_CFLAGS@
+XCOMPOSITE_LIBS ?= @XCOMPOSITE_LIBS@
+XRENDER_CFLAGS ?= @XRENDER_CFLAGS@
+XRENDER_LIBS ?= @XRENDER_LIBS@
+XXF86VM_CFLAGS ?= @XXF86VM_CFLAGS@
+XXF86VM_LIBS ?= @XXF86VM_LIBS@
+LIBPROJECTM_CFLAGS ?= @LIBPROJECTM_CFLAGS@
+LIBPROJECTM_LIBS ?= @LIBPROJECTM_LIBS@
+LIBPROJECTM1_CFLAGS ?= @LIBPROJECTM1_CFLAGS@
+LIBPROJECTM1_LIBS ?= @LIBPROJECTM1_LIBS@
+MMS_CFLAGS ?= @MMS_CFLAGS@
+MMS_LIBS ?= @MMS_LIBS@
+MAD_CFLAGS ?= @MAD_CFLAGS@
+MAD_LIBS ?= @MAD_LIBS@
+IMLIB2_CFLAGS ?= @IMLIB2_CFLAGS@
+IMLIB2_LIBS ?= @IMLIB2_LIBS@
+SIMD_CFLAGS ?= @SIMD_CFLAGS@
+FILEWRITER_LIBS ?= @FILEWRITER_LIBS@
+GCC42_CFLAGS ?= @GCC42_CFLAGS@
+CDIO_LIBS ?= @CDIO_LIBS@
+CDIO_CFLAGS ?= @CDIO_CFLAGS@
+CDDB_LIBS ?= @CDDB_LIBS@
+CDDB_CFLAGS ?= @CDDB_CFLAGS@
+TRANSPORT_PLUGIN_DIR ?= @TRANSPORT_PLUGIN_DIR@
+TRANSPORT_PLUGINS ?= @TRANSPORT_PLUGINS@
+LIBFLAC_LIBS ?= @LIBFLAC_LIBS@
+LIBFLAC_CFLAGS ?= @LIBFLAC_CFLAGS@
+MOWGLI_CFLAGS ?= @MOWGLI_CFLAGS@
+MOWGLI_LIBS ?= @MOWGLI_LIBS@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m4/buildsys.m4	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,132 @@
+dnl
+dnl Copyright (c) 2007, Jonathan Schleifer <js@h3c.de>
+dnl
+dnl Permission to use, copy, modify, and/or distribute this software for any
+dnl purpose with or without fee is hereby granted, provided that the above
+dnl copyright notice and this permission notice is present in all copies.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+dnl AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+dnl ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+dnl POSSIBILITY OF SUCH DAMAGE.
+dnl
+
+AC_DEFUN([BUILDSYS_PROG_IMPLIB], [
+	AC_MSG_CHECKING(wether we need an implib)
+	case "$target" in
+		*-*-cygwin | *-*-mingw32)
+			AC_MSG_RESULT(yes)
+			PROG_IMPLIB_NEEDED='yes'
+			PROG_IMPLIB_LDFLAGS='-Wl,-export-all-symbols,--out-implib,lib${PROG}.a'
+			;;
+		*)
+			AC_MSG_RESULT(no)
+			PROG_IMPLIB_NEEDED='no'
+			PROG_IMPLIB_LDFLAGS=''
+			;;
+	esac
+	
+	AC_SUBST(PROG_IMPLIB_NEEDED)
+	AC_SUBST(PROG_IMPLIB_LDFLAGS)
+])
+
+AC_DEFUN([BUILDSYS_SHARED_LIB], [
+	AC_MSG_CHECKING(for shared library system)
+	case "$target" in
+		intel-apple-*)
+			AC_MSG_RESULT([Mac OS X (Intel)])
+			LIB_CPPFLAGS='-DPIC'
+			LIB_CFLAGS='-fPIC'
+			LIB_LDFLAGS='-dynamiclib -fPIC -install_name ${libdir}/${LIB}'
+			LIB_PREFIX='lib'
+			LIB_SUFFIX='.dylib'
+			PLUGIN_CPPFLAGS=''
+			PLUGIN_CFLAGS=''
+			PLUGIN_LDFLAGS='-bundle -fno-common -flat_namespace -undefined suppress'
+			PLUGIN_SUFFIX='.impl'
+			INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i'
+			UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib'
+			CLEAN_LIB=''
+			;;
+		*-apple-*)
+			AC_MSG_RESULT(Mac OS X)
+			LIB_CPPFLAGS='-DPIC'
+			LIB_CFLAGS=''
+			LIB_LDFLAGS='-dynamiclib -fPIC -install_name ${libdir}/${LIB}'
+			LIB_PREFIX='lib'
+			LIB_SUFFIX='.dylib'
+			PLUGIN_CPPFLAGS=''
+			PLUGIN_CFLAGS=''
+			PLUGIN_LDFLAGS='-bundle -fno-common -flat_namespace -undefined suppress'
+			PLUGIN_SUFFIX='.impl'
+			INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i'
+			UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib'
+			CLEAN_LIB=''
+			;;
+		*-*-solaris* | *-openbsd-* | *-mirbsd-*)
+			AC_MSG_RESULT(Solaris)
+			LIB_CPPFLAGS='-DPIC'
+			LIB_CFLAGS='-fPIC'
+			LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}'
+			LIB_PREFIX='lib'
+			LIB_SUFFIX='.so'
+			PLUGIN_CPPFLAGS='-DPIC'
+			PLUGIN_CFLAGS='-fPIC'
+			PLUGIN_LDFLAGS='-shared -fPIC'
+			PLUGIN_SUFFIX='.so'
+			INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR} && rm -f ${DESTDIR}${libdir}/$$i && ${LN_S} $$i.${LIB_MAJOR}.${LIB_MINOR} ${DESTDIR}${libdir}/$$i'
+			UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}'
+			CLEAN_LIB=''
+			;;
+		*-*-cygwin | *-*-mingw32)
+			AC_MSG_RESULT(Win32)
+			LIB_CPPFLAGS='-DPIC'
+			LIB_CFLAGS=''
+			LIB_LDFLAGS='-shared -Wl,--out-implib,${LIB}.a'
+			LIB_PREFIX='lib'
+			LIB_SUFFIX='.dll'
+			PLUGIN_CPPFLAGS=''
+			PLUGIN_CFLAGS=''
+			PLUGIN_LDFLAGS='-shared'
+			PLUGIN_SUFFIX='.dll'
+			INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i && ${INSTALL} -m 755 $$i.a ${DESTDIR}${libdir}/$$i.a'
+			UNINSTALL_LIB='rm -f ${DESTDIR}${bindir}/$$i ${DESTDIR}${libdir}/$$i.a'
+			CLEAN_LIB='${LIB}.a'
+			;;
+		*)
+			AC_MSG_RESULT(POSIX)
+			LIB_CPPFLAGS='-DPIC'
+			LIB_CFLAGS='-fPIC'
+			LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}.0'
+			LIB_PREFIX='lib'
+			LIB_SUFFIX='.so'
+			PLUGIN_CPPFLAGS='-DPIC'
+			PLUGIN_CFLAGS='-fPIC'
+			PLUGIN_LDFLAGS='-shared -fPIC'
+			PLUGIN_SUFFIX='.so'
+			INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i'
+			UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0'
+			CLEAN_LIB=''
+			;;
+	esac
+
+	AC_SUBST(LIB_CPPFLAGS)
+	AC_SUBST(LIB_CFLAGS)
+	AC_SUBST(LIB_LDFLAGS)
+	AC_SUBST(LIB_PREFIX)
+	AC_SUBST(LIB_SUFFIX)
+	AC_SUBST(PLUGIN_CPPFLAGS)
+	AC_SUBST(PLUGIN_CFLAGS)
+	AC_SUBST(PLUGIN_LDFLAGS)
+	AC_SUBST(PLUGIN_SUFFIX)
+	AC_SUBST(INSTALL_LIB)
+	AC_SUBST(UNINSTALL_LIB)
+	AC_SUBST(CLEAN_LIB)
+])
--- a/mk/rules.mk.in	Wed Sep 19 11:03:57 2007 -0500
+++ b/mk/rules.mk.in	Mon Oct 01 05:56:16 2007 -0500
@@ -357,6 +357,8 @@
 XXF86VM_LIBS ?= @XXF86VM_LIBS@
 LIBPROJECTM_CFLAGS ?= @LIBPROJECTM_CFLAGS@
 LIBPROJECTM_LIBS ?= @LIBPROJECTM_LIBS@
+LIBPROJECTM1_CFLAGS ?= @LIBPROJECTM1_CFLAGS@
+LIBPROJECTM1_LIBS ?= @LIBPROJECTM1_LIBS@
 MMS_CFLAGS ?= @MMS_CFLAGS@
 MMS_LIBS ?= @MMS_LIBS@
 MAD_CFLAGS ?= @MAD_CFLAGS@
--- a/src/CoreAudio/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/CoreAudio/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,17 +1,18 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libcoreaudio$(SHARED_SUFFIX)
-
-noinst_HEADERS = coreaudio.h
-
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+PLUGIN = CoreAudio${PLUGIN_SUFFIX}
+SRCS = about.c		\
+       configure.c	\
+       coreaudio.c	\
+       init.c		\
+       audio.c		\
+       convert.c	\
+       dbconvert.c	\
+       mixer.c
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -Wl,-framework,CoreAudio
-SOURCES = coreaudio.c mixer.c about.c configure.c audio.c init.c convert.c dbconvert.c
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../..intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} -I../../intl -I../.. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS}
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,12 +1,11 @@
-include ../mk/rules.mk
-include ../mk/init.mk
+include ../extra.mk
 
-SUBDIRS = $(INPUT_PLUGINS) \
-	$(OUTPUT_PLUGINS) \
-	$(EFFECT_PLUGINS) \
-	$(VISUALIZATION_PLUGINS) \
-	$(GENERAL_PLUGINS) \
-	$(CONTAINER_PLUGINS) \
-	$(TRANSPORT_PLUGINS)
+SUBDIRS = ${INPUT_PLUGINS}		\
+	  ${OUTPUT_PLUGINS}		\
+	  ${EFFECT_PLUGINS}		\
+	  ${VISUALIZATION_PLUGINS}	\
+	  ${GENERAL_PLUGINS}		\
+	  ${CONTAINER_PLUGINS}		\
+	  ${TRANSPORT_PLUGINS}
 
-include ../mk/objective.mk
+include ../buildsys.mk
--- a/src/OSS/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/OSS/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,17 +1,17 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libOSS$(SHARED_SUFFIX)
-
-noinst_HEADERS = OSS.h soundcard.h
-
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+PLUGIN = OSS${PLUGIN_SUFFIX}
+SRCS = OSS.c		\
+       mixer.c		\
+       about.c		\
+       configure.c	\
+       audio.c		\
+       init.c		\
+       convert.c
 
-LIBADD = $(OSS_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-SOURCES = OSS.c mixer.c about.c configure.c audio.c init.c convert.c
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${OSS_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. -I.
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${OSS_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/OSS/OSS.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/OSS/OSS.h	Mon Oct 01 05:56:16 2007 -0500
@@ -22,9 +22,7 @@
 #ifndef OSS_H
 #define OSS_H
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 
--- a/src/OSS4/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/OSS4/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,17 +1,16 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libOSS4$(SHARED_SUFFIX)
-
-noinst_HEADERS = OSS4.h soundcard.h
-
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+PLUGIN = OSS4${PLUGIN_SUFFIX}
+SRCS = OSS4.c		\
+       about.c		\
+       configure.c	\
+       audio.c		\
+       init.c		\
+       convert.c
 
-LIBADD = $(OSS_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-SOURCES = OSS4.c about.c configure.c audio.c init.c convert.c
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I/usr/lib/oss/include -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} -I/usr/lib/oss/include -I../../intl -I../.. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS}
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${OSS_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/OSS4/OSS4.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/OSS4/OSS4.h	Mon Oct 01 05:56:16 2007 -0500
@@ -22,9 +22,7 @@
 #ifndef OSS4_H
 #define OSS4_H
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #ifdef HAVE_SYS_SOUNDCARD_H
 #include <sys/soundcard.h>
--- a/src/aac/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/aac/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,6 +1,58 @@
-include ../../mk/rules.mk
-include ../../mk/init.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 ../../mk/objective.mk
+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	Mon Oct 01 05:56:16 2007 -0500
@@ -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 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-CFLAGS += -I../include -I../../.. -I. $(PICFLAGS) -Wall
-
-OBJECTIVE_LIBS_NOINST = libfaad.a
-
-LDFLAGS += -lm
-
-SOURCES = 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
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../../mk/objective.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/aac/libmp4.c	Mon Oct 01 05:56:16 2007 -0500
@@ -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	Mon Oct 01 05:56:16 2007 -0500
@@ -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	Mon Oct 01 05:56:16 2007 -0500
@@ -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 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS_NOINST = libmp4ff.a
-
-SOURCES = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \
-   mp4tagupdate.c
-
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) -DUSE_TAGGING=1 -fsigned-char -I../../.. -Wall
-
-include ../../../mk/objective.mk
--- a/src/aac/src/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS = libaac$(SHARED_SUFFIX)
-
-CFLAGS += $(PICFLAGS)
-
-# override objective make's LIBDIR
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-LDFLAGS += ../libfaad2/libfaad.a ../mp4ff/libmp4ff.a -lstdc++
-
-SOURCES = libmp4.c mp4_utils.c aac_utils.c tagging_mp4.c
-
-OBJECTS = ${SOURCES:.c=.o}
-
-LIBDEP = ../libfaad2/libfaad.a ../mp4ff/libmp4ff.a
-
-CFLAGS += $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../.. -I../include -I../libfaad -I../mp4ff -Wall
-
-include ../../../mk/objective.mk
--- a/src/aac/src/aac_utils.c	Wed Sep 19 11:03:57 2007 -0500
+++ /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 19 11:03:57 2007 -0500
+++ /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 19 11:03:57 2007 -0500
+++ /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 19 11:03:57 2007 -0500
+++ /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 19 11:03:57 2007 -0500
+++ /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 19 11:03:57 2007 -0500
+++ /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 19 11:03:57 2007 -0500
+++ /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	Mon Oct 01 05:56:16 2007 -0500
@@ -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	Mon Oct 01 05:56:16 2007 -0500
@@ -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	Mon Oct 01 05:56:16 2007 -0500
@@ -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/adplug/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/adplug/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,22 +1,65 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-SUBDIRS = core
-OBJECTIVE_LIBS = libadplug$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
-
-LIBADD = ./core/libadplugcore.a $(BINIO_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -lstdc++
+PLUGIN = adplug${PLUGIN_SUFFIX}
+SRCS = adplug-xmms.cc		\
+       core/fmopl.c		\
+       core/debug.c		\
+       core/adlibemu.c		\
+       core/adplug.cxx		\
+       core/emuopl.cxx		\
+       core/diskopl.cxx		\
+       core/fprovide.cxx	\
+       core/player.cxx		\
+       core/database.cxx	\
+       core/hsc.cxx		\
+       core/sng.cxx		\
+       core/imf.cxx		\
+       core/players.cxx		\
+       core/protrack.cxx	\
+       core/a2m.cxx		\
+       core/adtrack.cxx		\
+       core/amd.cxx		\
+       core/bam.cxx		\
+       core/d00.cxx		\
+       core/dfm.cxx		\
+       core/dmo.cxx		\
+       core/hsp.cxx		\
+       core/ksm.cxx		\
+       core/mad.cxx		\
+       core/mid.cxx		\
+       core/mkj.cxx		\
+       core/cff.cxx		\
+       core/dtm.cxx		\
+       core/fmc.cxx		\
+       core/mtk.cxx		\
+       core/rad.cxx		\
+       core/raw.cxx		\
+       core/sa2.cxx		\
+       core/s3m.cxx		\
+       core/xad.cxx		\
+       core/flash.cxx		\
+       core/bmf.cxx		\
+       core/hybrid.cxx		\
+       core/hyp.cxx		\
+       core/psi.cxx		\
+       core/rat.cxx		\
+       core/u6m.cxx		\
+       core/rol.cxx		\
+       core/xsm.cxx		\
+       core/dro.cxx		\
+       core/lds.cxx		\
+       core/temuopl.cxx		\
+       core/msc.cxx		\
+       core/rix.cxx		\
+       core/adl.cxx		\
+       core/jbm.cxx
 
-SOURCES = adplug-xmms.cc
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.cc=.o}
-
-LIBDEP = ./core/libadplugcore.a
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BINIO_CFLAGS) \
-	-I../../intl -I../.. -I./core
-CXXFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BINIO_CFLAGS) \
-	-I../../intl -I../.. -I./core
+LD = ${CXX}
 
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${BINIO_CFLAGS} -I../../intl -I../.. -I./core -Dstricmp=strcasecmp
+CFLAGS += ${PLUGIN_CFLAGS}
+CXXFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${BINIO_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/adplug/adplug-xmms.cc	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/adplug/adplug-xmms.cc	Mon Oct 01 05:56:16 2007 -0500
@@ -17,9 +17,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <algorithm>
 #include <sstream>
@@ -34,8 +32,8 @@
 #include "audacious/i18n.h"
 extern "C"
 {
+#include "audacious/plugin.h"
 #include "audacious/configdb.h"
-#include "audacious/plugin.h"
 #include "audacious/output.h"
 #include "audacious/util.h"
 }
--- a/src/adplug/core/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS_NOINST = libadplugcore.a
-
-C_SOURCES = fmopl.c debug.c adlibemu.c
-CXX_SOURCES = adplug.cxx emuopl.cxx diskopl.cxx fprovide.cxx \
-player.cxx database.cxx hsc.cxx sng.cxx imf.cxx players.cxx protrack.cxx \
-a2m.cxx adtrack.cxx amd.cxx bam.cxx d00.cxx dfm.cxx dmo.cxx hsp.cxx ksm.cxx \
-mad.cxx mid.cxx mkj.cxx cff.cxx dtm.cxx fmc.cxx mtk.cxx rad.cxx raw.cxx \
-sa2.cxx s3m.cxx xad.cxx flash.cxx bmf.cxx hybrid.cxx hyp.cxx psi.cxx rat.cxx \
-u6m.cxx rol.cxx xsm.cxx dro.cxx lds.cxx temuopl.cxx msc.cxx rix.cxx adl.cxx \
-jbm.cxx
-
-SOURCES = $(C_SOURCES) $(CXX_SOURCES)
-
-noinst_HEADERS = adplug.h emuopl.h fmopl.h silentopl.h opl.h diskopl.h \
-a2m.h amd.h bam.h d00.h dfm.h hsc.h hsp.h imf.h ksm.h lds.h mid.h mkj.h mtk.h \
-protrack.h rad.h raw.h sa2.h sng.h u6m.h player.h fmc.h mad.h xad.h bmf.h \
-flash.h hyp.h psi.h rat.h hybrid.h rol.h adtrack.h cff.h dtm.h fprovide.h \
-database.h players.h xsm.h adlibemu.h kemuopl.h dro.h dmo.h s3m.h temuopl.h \
-msc.h rix.h adl.h jbm.h
-
-CXXFLAGS += $(PICFLAGS) $(BINIO_CFLAGS) -I../../../../intl -I../../../.. -Dstricmp=strcasecmp $(BEEP_DEFINES)
-CFLAGS += $(PICFLAGS) $(BINIO_CFLAGS) -I../../../../intl -I../../../.. -Dstricmp=strcasecmp $(BEEP_DEFINES)
-
-OBJECTS = ${C_SOURCES:.c=.o} ${CXX_SOURCES:.cxx=.o}
-
-include ../../../mk/objective.mk
--- a/src/alac/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/alac/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,14 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libalac$(SHARED_SUFFIX)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = alac${PLUGIN_SUFFIX}
+SRCS = alac.c	\
+       demux.c	\
+       plugin.c	\
+       stream.c
 
-SOURCES = alac.c demux.c plugin.c stream.c
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+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 19 11:03:57 2007 -0500
+++ b/src/alarm/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = alarm${PLUGIN_SUFFIX}
+SRCS = alarm.c	\
+       interface.c
 
-SUBDIRS = 
-
-OBJECTIVE_LIBS = libalarm$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-LIBADD += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = alarm.c interface.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BEEP_DEFINES) -I../../intl -I../..
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/alarm/interface.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/alarm/interface.c	Mon Oct 01 05:56:16 2007 -0500
@@ -2,9 +2,7 @@
  * DO NOT EDIT THIS FILE - it is generated by Glade.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include <config.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
--- a/src/alsa/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/alsa/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,15 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libALSA$(SHARED_SUFFIX)
-
-noinst_HEADERS = alsa.h
-
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+PLUGIN = ALSA${PLUGIN_SUFFIX}
+SRCS = alsa.c		\
+       about.c		\
+       audio.c		\
+       configure.c	\
+       init.c
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(ALSA_LIBS) -lpthread
-SOURCES = alsa.c about.c audio.c configure.c init.c
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ALSA_CFLAGS) \
-	-I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ALSA_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${ALSA_LIBS}
--- a/src/alsa/alsa.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/alsa/alsa.c	Mon Oct 01 05:56:16 2007 -0500
@@ -55,8 +55,4 @@
 		free(alsa_cfg.mixer_device);
 		alsa_cfg.mixer_device = NULL;
 	}
-
-	/* release our mutex */
-	g_mutex_free(alsa_mutex);
-	alsa_mutex = NULL;
 }
--- a/src/alsa/alsa.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/alsa/alsa.h	Mon Oct 01 05:56:16 2007 -0500
@@ -81,6 +81,6 @@
 int alsa_get_written_time(void);
 void alsa_tell(AFormat * fmt, gint * rate, gint * nch);
 
-extern GMutex *alsa_mutex;
+extern GStaticMutex alsa_mutex;
 
 #endif
--- a/src/alsa/audio.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/alsa/audio.c	Mon Oct 01 05:56:16 2007 -0500
@@ -66,7 +66,7 @@
 static gboolean pause_request;	 /* pause status currently requested */
 static int flush_request;	 /* flush status (time) currently requested */
 static int prebuffer_size;
-GMutex *alsa_mutex;
+GStaticMutex alsa_mutex = G_STATIC_MUTEX_INIT;
 
 static guint mixer_timeout;
 
@@ -265,7 +265,7 @@
 
 	g_thread_join(audio_thread);
 
-	g_mutex_lock(alsa_mutex); /* alsa_loop locks alsa_mutex! */
+	g_static_mutex_lock(&alsa_mutex); /* alsa_loop locks alsa_mutex! */
 
 	alsa_cleanup_mixer();
 
@@ -284,7 +284,7 @@
 		snd_output_close(logs);
 	debug("Device closed");
 
-	g_mutex_unlock(alsa_mutex);
+	g_static_mutex_unlock(&alsa_mutex);
 }
 
 /* reopen ALSA PCM */
@@ -679,7 +679,7 @@
 	int npfds = snd_pcm_poll_descriptors_count(alsa_pcm);
 	int wr = 0;
 
-	g_mutex_lock(alsa_mutex);
+	g_static_mutex_lock(&alsa_mutex);
 
 	if (npfds <= 0)
 		goto _error;
@@ -716,7 +716,7 @@
 	}
 
  _error:
-	g_mutex_unlock(alsa_mutex);
+	g_static_mutex_unlock(&alsa_mutex);
 	alsa_close_pcm();
 	g_free(thread_buffer);
 	thread_buffer = NULL;
@@ -740,7 +740,7 @@
 		return 0;
 	}
 
-	g_mutex_lock(alsa_mutex);
+	g_static_mutex_lock(&alsa_mutex);
 
 	if (!mixer)
 		alsa_setup_mixer();
@@ -769,7 +769,7 @@
 	pause_request = FALSE;
 	flush_request = -1;
 
-	g_mutex_unlock(alsa_mutex);
+	g_static_mutex_unlock(&alsa_mutex);
 	
 	audio_thread = g_thread_create((GThreadFunc)alsa_loop, NULL, TRUE, NULL);
 	return 1;
--- a/src/alsa/init.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/alsa/init.c	Mon Oct 01 05:56:16 2007 -0500
@@ -55,6 +55,4 @@
 		g_message("Cannot load alsa library: %s", dlerror());
 		/* FIXME, this plugin wont work... */
 	}
-
-	alsa_mutex = g_mutex_new();
 }
--- a/src/amidi-plug/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/amidi-plug/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,7 +1,4 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libamidi-plug$(SHARED_SUFFIX)
+PLUGIN = amidi-plug$(PLUGIN_SUFFIX)
 SUBDIRS = pcfg $(AMIDIPLUG_BACKENDS)
 
 noinst_HEADERS = amidi-plug.h i_backend.h i_midi.h i_midievent.h \
@@ -12,19 +9,22 @@
                  amidi-plug-icon.xpm amidi-plug.logo.xpm \
                  amidi-plug.midiicon.xpm
 
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+plugindir = audacious/$(INPUT_PLUGIN_DIR)
 
-LIBADD = $(GTK_LIBS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(GMODULE_LIBS) -lpthread ./pcfg/libpcfg.a
-SOURCES = amidi-plug.c i_vfslayer.c i_midi.c i_backend.c \
+SRCS = amidi-plug.c i_vfslayer.c i_midi.c i_backend.c \
           i_configure.c i_configure-ap.c i_configure-alsa.c \
           i_configure-fluidsynth.c i_configure-dummy.c \
           i_utils.c i_fileinfo.c
 
+include ../../buildsys.mk
+include ../../extra.mk
+
 OBJECTS = ${SOURCES:.c=.o}
 
-LIBDEP = ./pcfg/libpcfg.a
+EXT_DEPS = ./pcfg/libpcfg.a
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(GMODULE_CFLAGS) -DAMIDIPLUGBACKENDDIR=\"$(AMIDIPLUGBACKENDDIR)\" \
-          -I../../intl -I../..
+CFLAGS += $(PLUGIN_CFLAGS)
+CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(GMODULE_CFLAGS) $(MOWGLI_CFLAGS) \
+	-DAMIDIPLUGBACKENDDIR=\"$(AMIDIPLUGBACKENDDIR)\" -I../../intl -I../..
 
-include ../../mk/objective.mk
+LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(GMODULE_LIBS) -lpthread ./pcfg/libpcfg.a
--- a/src/amidi-plug/pcfg/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/amidi-plug/pcfg/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,14 +1,12 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
+SRCS = i_pcfg.c
+
+STATIC_LIB_NOINST = libpcfg.a
+
+include ../../../buildsys.mk
+include ../../../extra.mk
 
 noinst_HEADERS = i_pcfg.h
 
-CFLAGS += $(PICFLAGS) $(GLIB_CFLAGS) -I../../..
-
-OBJECTIVE_LIBS_NOINST = libpcfg.a
+CFLAGS += $(PLUGIN_CFLAGS)
+CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GLIB_CFLAGS) -I../../..
 
-SOURCES = i_pcfg.c
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../../mk/objective.mk
--- a/src/aosd/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/aosd/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,18 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libaosd$(SHARED_SUFFIX)
-
-noinst_HEADERS = aosd.h aosd_osd.h aosd_style.h aosd_style_private.h aosd_trigger.h aosd_trigger_private.h aosd_ui.h aosd_cfg.h aosd_common.h ghosd.h ghosd-internal.h
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+PLUGIN = aosd${PLUGIN_SUFFIX}
+SRCS = aosd.c		\
+       aosd_osd.c	\
+       aosd_style.c	\
+       aosd_trigger.c	\
+       aosd_ui.c	\
+       aosd_cfg.c	\
+       ghosd.c		\
+       ghosd-main.c
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(CAIRO_LIBS) $(PANGOCAIRO_LIBS) $(XRENDER_LIBS) $(XCOMPOSITE_LIBS)
-SOURCES = aosd.c aosd_osd.c aosd_style.c aosd_trigger.c aosd_ui.c aosd_cfg.c ghosd.c ghosd-main.c
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(CAIRO_CFLAGS) $(PANGOCAIRO_CFLAGS) $(XRENDER_CFLAGS) $(XCOMPOSITE_CFLAGS) \
-	-I../../intl -I../.. -I..
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${CAIRO_CFLAGS} ${PANGOCAIRO_CFLAGS} ${XRENDER_CFLAGS} ${XCOMPOSITE_CFLAGS} -I../../intl -I../.. -I..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${CAIRO_LIBS} ${PANGOCAIRO_LIBS} ${XRENDER_LIBS} ${XCOMPOSITE_LIBS}
--- a/src/aosd/ghosd.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/aosd/ghosd.c	Mon Oct 01 05:56:16 2007 -0500
@@ -14,6 +14,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <cairo/cairo-xlib-xrender.h>
+#include <X11/Xlib.h>
 #include <X11/Xatom.h>
 
 #ifdef HAVE_XCOMPOSITE
--- a/src/arts/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/arts/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,17 +1,16 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
 SUBDIRS = arts_helper
 
-SOURCES = arts.c configure.c audio.c convert.c
-
-OBJECTIVE_LIBS = libarts$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+PLUGIN = arts${PLUGIN_SUFFIX}
+SRCS = arts.c		\
+       configure.c	\
+       audio.c		\
+       convert.c
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -Wall $(ARTSC_CFLAGS) -I../../intl -I../..
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(ARTSC_LIBS) -lpthread
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARTSC_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${ARTSC_LIBS} -lpthread
--- a/src/arts/arts_helper/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/arts/arts_helper/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,9 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-SOURCES = arts_helper.c
-
-OBJECTIVE_BINS = audacious-arts-helper
+PROG = audacious-arts-helper${PROG_SUFFIX}
+SRCS = arts_helper.c
 
-LDFLAGS = -Wl,-export-dynamic
-LIBADD = $(ARTSC_LIBS)
+include ../../../buildsys.mk
+include ../../../extra.mk
 
-CFLAGS += $(ARTSC_CFLAGS) -I../../../intl -I../../..
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../../mk/objective.mk
+CPPFLAGS += ${ARTSC_CFLAGS} -I../../../intl -I../../..
+LIBS += ${ARTSC_LIBS}
+LDFLAGS += -Wl,-export-dynamic
--- a/src/audiocompress/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/audiocompress/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = audiocompress${PLUGIN_SUFFIX}
+SRCS = compress.c	\
+       audacious-glue.c
 
-OBJECTIVE_LIBS = libaudiocompress$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(EFFECT_PLUGIN_DIR)
+plugindir = audacious/${EFFECT_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = compress.c audacious-glue.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/audiocompress/audacious-glue.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/audiocompress/audacious-glue.c	Mon Oct 01 05:56:16 2007 -0500
@@ -2,9 +2,7 @@
 ** Audacious effect plugin for AudioCompress
 */
 
-#ifdef HAVE_CONFIG_H
-# include "../../config.h"
-#endif
+#include <config.h>
 
 #include <stdio.h>
 #include <stdlib.h>
--- a/src/blur_scope/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/blur_scope/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = blur_scope${PLUGIN_SUFFIX}
+SRCS = blur_scope.c	\
+       config.c
 
-OBJECTIVE_LIBS = libbscope$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = blur_scope.c config.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/blur_scope/blur_scope.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/blur_scope/blur_scope.c	Mon Oct 01 05:56:16 2007 -0500
@@ -15,14 +15,11 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  w
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 #include <audacious/i18n.h>
--- a/src/blur_scope/config.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/blur_scope/config.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,6 +1,4 @@
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 #include <audacious/i18n.h>
--- a/src/cdaudio-ng/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/cdaudio-ng/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = cdaudio-ng${PLUGIN_SUFFIX}
+SRCS = cdaudio-ng.c	\
+       configure.c
 
-OBJECTIVE_LIBS = libcdaudio-ng$(SHARED_SUFFIX)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(CDIO_LIBS) $(CDDB_LIBS)
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-SOURCES = cdaudio-ng.c configure.c
-
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(CDIO_CFLAGS) $(CDDB_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${CDIO_CFLAGS} ${CDDB_CFLAGS} -I../.. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES}
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${CDIO_LIBS} ${CDDB_LIBS}
--- a/src/console/Audacious_Config.cxx	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/console/Audacious_Config.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -8,9 +8,7 @@
  * Libconsole preferences GUI by Giacomo Lozito
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 #include <audacious/i18n.h>
--- a/src/console/Audacious_Driver.cxx	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/console/Audacious_Driver.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -6,15 +6,12 @@
  * http://www.slack.net/~ant/libs/
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 #include <audacious/i18n.h>
 #include <gtk/gtk.h>
 extern "C" {
-#include "audacious/main.h"
 #include "audacious/tuple.h"
 #include "audacious/tuple_formatter.h"
 #include "audacious/util.h"
--- a/src/console/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/console/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,66 +1,63 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libconsole$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = console${PLUGIN_SUFFIX}
+SRCS = Audacious_Config.cxx    \
+       Audacious_Driver.cxx    \
+       Ay_Apu.cxx              \
+       Ay_Cpu.cxx              \
+       Ay_Emu.cxx              \
+       Blip_Buffer.cxx         \
+       Classic_Emu.cxx         \
+       Data_Reader.cxx         \
+       Dual_Resampler.cxx      \
+       Effects_Buffer.cxx      \
+       Fir_Resampler.cxx       \
+       Gbs_Emu.cxx             \
+       Gb_Apu.cxx              \
+       Gb_Cpu.cxx              \
+       Gb_Oscs.cxx             \
+       gme.cxx                 \
+       Gme_File.cxx            \
+       Gym_Emu.cxx             \
+       Gzip_Reader.cxx         \
+       Hes_Apu.cxx             \
+       Hes_Cpu.cxx             \
+       Hes_Emu.cxx             \
+       Kss_Cpu.cxx             \
+       Kss_Emu.cxx             \
+       Kss_Scc_Apu.cxx         \
+       M3u_Playlist.cxx        \
+       Multi_Buffer.cxx        \
+       Music_Emu.cxx           \
+       Nes_Apu.cxx             \
+       Nes_Cpu.cxx             \
+       Nes_Fme7_Apu.cxx        \
+       Nes_Namco_Apu.cxx       \
+       Nes_Oscs.cxx            \
+       Nes_Vrc6_Apu.cxx        \
+       Nsfe_Emu.cxx            \
+       Nsf_Emu.cxx             \
+       Sap_Apu.cxx             \
+       Sap_Cpu.cxx             \
+       Sap_Emu.cxx             \
+       Sms_Apu.cxx             \
+       Snes_Spc.cxx            \
+       Spc_Cpu.cxx             \
+       Spc_Dsp.cxx             \
+       Spc_Emu.cxx             \
+       Vfs_File.cxx            \
+       Vgm_Emu.cxx             \
+       Vgm_Emu_Impl.cxx        \
+       Ym2413_Emu.cxx          \
+       Ym2612_Emu.cxx          \
+       Zlib_Inflater.cxx
 
-SOURCES = \
-	Audacious_Config.cxx    \
-	Audacious_Driver.cxx    \
-	Ay_Apu.cxx              \
-	Ay_Cpu.cxx              \
-	Ay_Emu.cxx              \
-	Blip_Buffer.cxx         \
-	Classic_Emu.cxx         \
-	Data_Reader.cxx         \
-	Dual_Resampler.cxx      \
-	Effects_Buffer.cxx      \
-	Fir_Resampler.cxx       \
-	Gbs_Emu.cxx             \
-	Gb_Apu.cxx              \
-	Gb_Cpu.cxx              \
-	Gb_Oscs.cxx             \
-	gme.cxx                 \
-	Gme_File.cxx            \
-	Gym_Emu.cxx             \
-	Gzip_Reader.cxx         \
-	Hes_Apu.cxx             \
-	Hes_Cpu.cxx             \
-	Hes_Emu.cxx             \
-	Kss_Cpu.cxx             \
-	Kss_Emu.cxx             \
-	Kss_Scc_Apu.cxx         \
-	M3u_Playlist.cxx        \
-	Multi_Buffer.cxx        \
-	Music_Emu.cxx           \
-	Nes_Apu.cxx             \
-	Nes_Cpu.cxx             \
-	Nes_Fme7_Apu.cxx        \
-	Nes_Namco_Apu.cxx       \
-	Nes_Oscs.cxx            \
-	Nes_Vrc6_Apu.cxx        \
-	Nsfe_Emu.cxx            \
-	Nsf_Emu.cxx             \
-	Sap_Apu.cxx             \
-	Sap_Cpu.cxx             \
-	Sap_Emu.cxx             \
-	Sms_Apu.cxx             \
-	Snes_Spc.cxx            \
-	Spc_Cpu.cxx             \
-	Spc_Dsp.cxx             \
-	Spc_Emu.cxx             \
-	Vfs_File.cxx            \
-	Vgm_Emu.cxx             \
-	Vgm_Emu_Impl.cxx        \
-	Ym2413_Emu.cxx          \
-	Ym2612_Emu.cxx          \
-	Zlib_Inflater.cxx
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.cxx=.o}
+LD = ${CXX}
 
-LIBADD += -lz $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -lstdc++
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
-CXXFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+CXXFLAGS += ${PLUGIN_CFLAGS}
+LIBS += -lz ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/cue/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/cue/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = cuesheet${PLUGIN_SUFFIX}
+SRCS = cuesheet.c
 
-OBJECTIVE_LIBS = libcuesheet$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
-
-SOURCES = cuesheet.c
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../.. -Wall
+include ../../buildsys.mk
+include ../../extra.mk
 
-CXXFLAGS = $(CFLAGS)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-include ../../mk/objective.mk
+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} ${DBUS_LIB}
--- a/src/cue/cuesheet.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/cue/cuesheet.c	Mon Oct 01 05:56:16 2007 -0500
@@ -14,9 +14,8 @@
  * GNU General Public License. Please consult the file "COPYING" for
  * details.
  */
-#ifdef HAVE_CONFIG_H
+
 #include "config.h"
-#endif
 
 /* #define DEBUG 1 */
 
@@ -775,22 +774,21 @@
 		line[q] = '\0';
 		for (q++; line[q] && isspace((int) line[q]); q++);
 		if (strcasecmp(line+p, "REM") == 0) {
-			gint r;
-			for (r = q; line[r] && !isspace((int) line[r]); r++);
-			if (!line[r])
+			for (p = q; line[p] && !isspace((int) line[p]); p++);
+			if (!line[p])
 				continue;
-			line[r] = '\0';
-			for (r++; line[r] && isspace((int) line[r]); r++);
+			line[p] = '\0';
+			for (p++; line[p] && isspace((int) line[p]); p++);
 			if(strcasecmp(line+q, "GENRE") == 0) {
-				fix_cue_argument(line+r);
+				fix_cue_argument(line+p);
 				if (last_cue_track == 0)
-					cue_genre = str_to_utf8(line + r);
+					cue_genre = str_to_utf8(line + p);
 			}
 			if(strcasecmp(line+q, "DATE") == 0) {
 				gchar *tmp;
-				fix_cue_argument(line+r);
+				fix_cue_argument(line+p);
 				if (last_cue_track == 0) {
-					tmp = g_strdup(line + r);
+					tmp = g_strdup(line + p);
 					if (tmp) {
 						cue_year = strtok(tmp, "/"); // XXX: always in the same format?
 					}
@@ -808,9 +806,7 @@
 		else if (strcasecmp(line+p, "FILE") == 0) {
 			gchar *tmp = g_path_get_dirname(f);
 			fix_cue_argument(line+q);
-			cue_file = g_strdup_printf("%s/%s", tmp, line+q);
-			/* XXX: yaz might need to UTF validate this?? -nenolod */
-			/* as far as I know, all FILEs are in plain ASCII -yaz */
+			cue_file = g_strdup_printf("%s/%s", tmp, line+q); //XXX need to check encoding?
 			g_free(tmp);
 		}
 		else if (strcasecmp(line+p, "TITLE") == 0) {
@@ -838,19 +834,19 @@
 			cue_tracks[last_cue_track-1].title = NULL;
 		}
 		else if (strcasecmp(line+p, "INDEX") == 0) {
+            gint min, sec, frac;
 			for (p = q; line[p] && !isspace((int) line[p]); p++);
 			if (!line[p])
 				continue;
 			for (p++; line[p] && isspace((int) line[p]); p++);
 			for (q = p; line[q] && !isspace((int) line[q]); q++);
-			if (q-p >= 8 && line[p+2] == ':' && line[p+5] == ':') {
-				cue_tracks[last_cue_track-1].index =
-						((line[p+0]-'0')*10 + (line[p+1]-'0')) * 60000 +
-						((line[p+3]-'0')*10 + (line[p+4]-'0')) * 1000 +
-						((line[p+6]-'0')*10 + (line[p+7]-'0')) * 10;
-			}
-		}
-	}
+
+            if(sscanf(line+p, "%d:%d:%d", &min, &sec, &frac) == 3) {
+//                printf("%3d:%02d:%02d\n", min, sec, frac);
+                cue_tracks[last_cue_track-1].index = min * 60000 + sec * 1000 + frac * 10;
+            }
+        }
+    }
 
 	vfs_fclose(file);
 }
--- a/src/curl/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/curl/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,24 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-SUBDIRS = 
+PLUGIN = curl${PLUGIN_SUFFIX}
+SRCS = curl.c
 
-OBJECTIVE_LIBS = libcurlsrc$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(TRANSPORT_PLUGIN_DIR)
-
-LIBADD += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(CURL_LIBS)
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
-SOURCES = curl.c
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BEEP_DEFINES) $(CURL_CFLAGS) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-#CFLAGS += -Wpointer-arith -Wimplicit -Wnested-externs -Wcast-align \
-#-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes \
-#-Wmissing-declarations -W -Wno-unused -Wshadow -Wmissing-noreturn \
-#-Wundef -Wpacked -Wnested-externs -Wbad-function-cast -Wredundant-decls \
-#-Wfloat-equal -Wdisabled-optimization -pedantic -std=c99
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+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/curl/curl.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/curl/curl.c	Mon Oct 01 05:56:16 2007 -0500
@@ -16,9 +16,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <audacious/vfs.h>
 #include <audacious/plugin.h>
--- a/src/dockalbumart/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/dockalbumart/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = dockalbumart${PLUGIN_SUFFIX}
+SRCS = dockalbumart.c
 
-OBJECTIVE_LIBS = libdockalbumart$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GDKX11_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-SOURCES = dockalbumart.c
-
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) \
-	-I../../intl -I../.. -I..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/echo_plugin/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/echo_plugin/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = echo${PLUGIN_SUFFIX}
+SRCS = echo.c	\
+       gui.c
 
-OBJECTIVE_LIBS = libecho$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(EFFECT_PLUGIN_DIR)
+plugindir = audacious/${EFFECT_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = echo.c gui.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/echo_plugin/gui.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/echo_plugin/gui.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,6 +1,4 @@
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <gtk/gtk.h>
 #include <audacious/i18n.h>
--- a/src/esd/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/esd/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,16 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libESD$(SHARED_SUFFIX)
-
-noinst_HEADERS = esdout.h
-
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+PLUGIN = ESD${PLUGIN_SUFFIX}
+SRCS = esd.c		\
+       mixer.c		\
+       about.c		\
+       configure.c	\
+       audio.c		\
+       init.c
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(ESD_LIBS) $(OSS_LIBS)
-SOURCES = esd.c mixer.c about.c configure.c audio.c init.c
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ESD_CFLAGS) \
-	-I../../intl -I../.. -I..
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.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/esd/esdout.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/esd/esdout.h	Mon Oct 01 05:56:16 2007 -0500
@@ -22,9 +22,7 @@
 #ifndef ESDOUT_H
 #define ESDOUT_H
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 
--- a/src/evdev-plug/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/evdev-plug/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,14 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libevdev-plug$(SHARED_SUFFIX)
-
-noinst_HEADERS = ed.h ed_ui.h ed_types.h ed_internals.h ed_actions.h ed_bindings_store.h ed_common.h
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+PLUGIN = evdev-plug${PLUGIN_SUFFIX}
+SRCS = ed.c			\
+       ed_bindings_store.c	\
+       ed_internals.c		\
+       ed_ui.c
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-SOURCES = ed.c ed_ui.c ed_internals.c ed_bindings_store.c
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) \
-	-I../../intl -I../.. -I..
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/filewriter/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/filewriter/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,15 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libfilewriter$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+PLUGIN = filewriter${PLUGIN_SUFFIX}
+SRCS = filewriter.c	\
+       wav.c		\
+       mp3.c		\
+       vorbis.c		\
+       flac.c
 
-LIBADD = $(GTK_LIBS) ${FILEWRITER_LIBS}
-SOURCES = filewriter.c wav.c mp3.c vorbis.c flac.c
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) -I../../intl -I../.. -Wall
-
-include ../../mk/objective.mk
+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/filewriter/vorbis.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/filewriter/vorbis.c	Mon Oct 01 05:56:16 2007 -0500
@@ -20,6 +20,9 @@
  */
 
 #include "plugins.h"
+
+#ifdef FILEWRITER_VORBIS
+
 #include <vorbis/vorbisenc.h>
 #include <stdlib.h>
 
@@ -310,3 +313,5 @@
 
     gtk_widget_show_all(configure_win);
 }
+
+#endif
--- a/src/flacng/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/flacng/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,14 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libflacng$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = flacng${PLUGIN_SUFFIX}
+SRCS = plugin.c				\
+       tools.c				\
+       seekable_stream_callbacks.c	\
+       flac_compat112.c
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(LIBFLAC_LIBS)
-
-SOURCES = plugin.c tools.c seekable_stream_callbacks.c flac_compat112.c
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. $(LIBFLAC_CFLAGS) -Wall
-
-include ../../mk/objective.mk
+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 19 11:03:57 2007 -0500
+++ b/src/gnomeshortcuts/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = gnomeshortcuts${PLUGIN_SUFFIX}
+SRCS = gnomeshortcuts.c
 
-OBJECTIVE_LIBS = libgnomeshortcuts$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-LIBADD = $(GLIB_LIBS) $(DBUS_LIBS)
-SOURCES = gnomeshortcuts.c
-
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \
-	-I../../intl -I../.. -I..
-
-include ../../mk/objective.mk
+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 19 11:03:57 2007 -0500
+++ b/src/hotkey/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = hotkey${PLUGIN_SUFFIX}
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-OBJECTIVE_LIBS = libhotkey$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+SRCS = plugin.c
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS)
-SOURCES = plugin.c
-
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) \
-	-I../../intl -I../.. -I..
-
-include ../../mk/objective.mk
+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 19 11:03:57 2007 -0500
+++ b/src/jack/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,13 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = jackout${PLUGIN_SUFFIX}
+SRCS = jack.c		\
+       configure.c	\
+       bio2jack.c
 
-SOURCES = jack.c configure.c bio2jack.c
-
-OBJECTIVE_LIBS = libjackout$(SHARED_SUFFIX)
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -Wall $(SAMPLERATE_CFLAGS) -I../../intl -I../..
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(JACK_LIBS) $(SAMPLERATE_LIBS) -lpthread
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+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 19 11:03:57 2007 -0500
+++ b/src/ladspa/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = ladspa${PLUGIN_SUFFIX}
+SRCS = ladspa.c
 
-OBJECTIVE_LIBS = libladspa$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(EFFECT_PLUGIN_DIR)
+plugindir = audacious/${EFFECT_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = ladspa.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/lastfm/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/lastfm/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,25 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-SUBDIRS = 
+PLUGIN = lastfm${PLUGIN_SUFFIX}
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
-OBJECTIVE_LIBS = liblastfm$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(TRANSPORT_PLUGIN_DIR)
-
-LIBADD += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(CURL_LIBS)
-
-SOURCES = lastfm.c
+SRCS = lastfm.c
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BEEP_DEFINES) $(CURL_CFLAGS) -I../../intl -I../.. -ggdb -g3
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += -Wall  -pedantic -std=c99 $(GCC42_CFLAGS)
-#CFLAGS += -Wpointer-arith -Wimplicit -Wnested-externs -Wcast-align \
-#-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes \
-#-Wmissing-declarations -W -Wno-unused -Wshadow -Wmissing-noreturn \
-#-Wundef -Wpacked -Wnested-externs -Wbad-function-cast -Wredundant-decls \
-#-Wfloat-equal -Wdisabled-optimization -pedantic -std=c99
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+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/lirc/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/lirc/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = lirc$(PLUGIN_SUFFIX)
 
-OBJECTIVE_LIBS = liblirc$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+plugindir = audacious/$(GENERAL_PLUGIN_DIR)
+SRCS = about.c lirc.c
 
-LIBADD = -llirc_client $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-SOURCES = about.c lirc.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
+LIBS += -llirc_client $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+CFLAGS += $(PLUGIN_CFLAGS)
+CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GTK_CFLAGS) $(MOWGLI_CFLAGS) $(PANGO_CFLAGS) $(DBUS_CFLAGS) -I../../intl -I../..
 
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
--- a/src/lirc/about.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/lirc/about.c	Mon Oct 01 05:56:16 2007 -0500
@@ -23,9 +23,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 #include <audacious/i18n.h>
--- a/src/lirc/lirc.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/lirc/lirc.c	Mon Oct 01 05:56:16 2007 -0500
@@ -24,9 +24,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include <stdio.h>
 #include <unistd.h>
--- a/src/m3u/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/m3u/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = m3u${PLUGIN_SUFFIX}
+SRCS = m3u.c
 
-OBJECTIVE_LIBS = libm3u$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(CONTAINER_PLUGIN_DIR)
-
-SOURCES = m3u.c
+plugindir = audacious/${CONTAINER_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-CXXFLAGS = $(CFLAGS)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-include ../../mk/objective.mk
+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/madplug/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/madplug/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,25 +1,18 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libmadplug$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = madplug${PLUGIN_SUFFIX}
+SRCS = configure.c	\
+       dither.c		\
+       input.c		\
+       replaygain.c	\
+       decoder.c	\
+       fileinfo.c	\
+       plugin.c		\
+       xing.c
 
-SOURCES = \
-  configure.c \
-  dither.c \
-  input.c \
-  replaygain.c \
-  decoder.c \
-  fileinfo.c \
-  plugin.c \
-  xing.c
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS   += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(SIMD_CFLAGS) -I../../intl -I../.. -Wall
+include ../../buildsys.mk
+include ../../extra.mk
 
-LDFLAGS += $(AUDLDFLAGS)
-LIBADD = -L/opt/local/lib -L$(libdir) -laudid3tag -lmad $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${MOWGLI_CFLAGS} ${ARCH_DEFINES} ${SIMD_CFLAGS} -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += -L${libdir} -laudid3tag -lmad ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/metronom/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/metronom/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = metronom${PLUGIN_SUFFIX}
+SRCS = metronom.c
 
-OBJECTIVE_LIBS = libmetronom$(SHARED_SUFFIX)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-SOURCES = metronom.c
-
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${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 19 11:03:57 2007 -0500
+++ b/src/mms/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = mms${PLUGIN_SUFFIX}
+SRCS = mms.c
 
-OBJECTIVE_LIBS = libmms$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(TRANSPORT_PLUGIN_DIR)
-
-SOURCES = mms.c
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(MMS_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-CXXFLAGS = $(CFLAGS)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(MMS_LIBS)
-
-include ../../mk/objective.mk
+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 19 11:03:57 2007 -0500
+++ b/src/modplug/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,53 +1,56 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libmodplug$(SHARED_SUFFIX)
-SUBDIRS = archive gui
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+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
 
-CXXFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I.. -I../.. -I../../intl
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I.. -I../.. -I../../intl
-LIBADD  = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -lstdc++ ./archive/libarchive.a ./gui/libgui.a
-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
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
+include ../../extra.mk
 
-SOURCES = ${SOURCES.core} ${SOURCES.plugin}
-
-OBJECTS = ${SOURCES:.cxx=.o}
-
-LIBDEP = gui/libgui.a archive/libarchive.a
-
-include ../../mk/objective.mk
-
+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} -lstdc++
--- a/src/modplug/archive/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-CXXFLAGS += $(PICFLAGS) -I../../.. $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(AUDACIOUS_CFLAGS)
-
-OBJECTIVE_LIBS_NOINST = libarchive.a
-
-SOURCES = archive.cxx     \
-          open.cxx        \
-          arch_raw.cxx    \
-          arch_gzip.cxx   \
-          arch_zip.cxx    \
-          arch_rar.cxx    \
-          arch_bz2.cxx
-
-OBJECTS = ${SOURCES:.cxx=.o}
-
-include ../../../mk/objective.mk
--- a/src/modplug/gui/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/modplug/gui/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,12 +1,10 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
+include ../../../extra.mk
 
-CFLAGS   += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../..
-CXXFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../..
+STATIC_LIB_NOINST = libgui.a
+SRCS = main.cxx support.cxx interface.cxx callbacks.cxx
 
-OBJECTIVE_LIBS_NOINST = libgui.a
-SOURCES = main.cxx support.cxx interface.cxx callbacks.cxx
+include ../../../buildsys.mk
 
-OBJECTS = ${SOURCES:.cxx=.o}
-
-include ../../../mk/objective.mk
+CFLAGS   += $(PLUGIN_CFLAGS)
+CXXFLAGS += $(PLUGIN_CFLAGS)
+CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../..
--- a/src/modplug/gui/callbacks.cxx	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/modplug/gui/callbacks.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -1,6 +1,4 @@
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include <config.h>
 
 #include <gtk/gtk.h>
 #include <iostream>
--- a/src/modplug/gui/interface.cxx	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/modplug/gui/interface.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -2,9 +2,7 @@
  * DO NOT EDIT THIS FILE - it is generated by Glade.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include <config.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
--- a/src/modplug/gui/main.cxx	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/modplug/gui/main.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -3,9 +3,7 @@
  * Glade will not overwrite this file.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include <config.h>
 
 #include <gtk/gtk.h>
 #include <libintl.h>
--- a/src/modplug/gui/support.cxx	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/modplug/gui/support.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -2,9 +2,7 @@
  * DO NOT EDIT THIS FILE - it is generated by Glade.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include <config.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
--- a/src/modplug/gui/support.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/modplug/gui/support.h	Mon Oct 01 05:56:16 2007 -0500
@@ -2,9 +2,7 @@
  * DO NOT EDIT THIS FILE - it is generated by Glade.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include <config.h>
 
 #include <gtk/gtk.h>
 
--- a/src/mtp_up/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/mtp_up/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,19 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = mtp_up${PLUGIN_SUFFIX}
+SRCS = mtp.c filetype.c
 
-SUBDIRS = 
-
-OBJECTIVE_LIBS = libmtp_up$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-LIBADD += $(MTP_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) 
-SOURCES = mtp.c filetype.c
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BEEP_DEFINES) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += -Wall  -pedantic -std=c99 $(GCC42_CFLAGS) -D_BSD_SOURCE
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. ${MTP_CFLAGS}
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${MTP_LIBS}
--- a/src/musepack/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/musepack/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = musepack${PLUGIN_SUFFIX}
+SRCS = libmpc.cxx
 
-OBJECTIVE_LIBS = libmpc$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-SOURCES = libmpc.cxx
-
-LIBADD = -lmpcdec $(TAGLIB_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.cxx=.o}
-
-CXXFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(TAGLIB_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+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/musepack/config.h.in	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/* src/config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <mpcdec/config_types.h> header file. */
-#undef HAVE_MPCDEC_CONFIG_TYPES_H
-
-/* Define to 1 if stdbool.h conforms to C99. */
-#undef HAVE_STDBOOL_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Have TagLib */
-#undef HAVE_TAGLIB
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the <wchar.h> header file. */
-#undef HAVE_WCHAR_H
-
-/* Define to 1 if the system has the type `_Bool'. */
-#undef HAVE__BOOL
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `long' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#undef size_t
--- a/src/neon/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/neon/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,24 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-SUBDIRS = 
+PLUGIN = neon${PLUGIN_SUFFIX}
+SRCS = neon.c	\
+       rb.c
 
-OBJECTIVE_LIBS = libneonsrc$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(TRANSPORT_PLUGIN_DIR)
-
-LIBADD += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(NEON_LIBS)
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
-SOURCES = neon.c rb.c
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BEEP_DEFINES) $(NEON_CFLAGS) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-#CFLAGS += -Wpointer-arith -Wimplicit -Wnested-externs -Wcast-align \
-#-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes \
-#-Wmissing-declarations -W -Wno-unused -Wshadow -Wmissing-noreturn \
-#-Wundef -Wpacked -Wnested-externs -Wbad-function-cast -Wredundant-decls \
-#-Wfloat-equal -Wdisabled-optimization -pedantic -std=c99
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+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/neon/neon.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/neon/neon.c	Mon Oct 01 05:56:16 2007 -0500
@@ -19,6 +19,7 @@
 
 #include <audacious/vfs.h>
 #include <audacious/plugin.h>
+#include <audacious/configdb.h>
 
 #include <ne_socket.h>
 #include <ne_utils.h>
@@ -52,6 +53,28 @@
     neon_vfs_metadata_impl
 };
 
+VFSConstructor neon_https_const = {
+    "https://",
+    neon_vfs_fopen_impl,
+    neon_vfs_fclose_impl,
+    neon_vfs_fread_impl,
+    neon_vfs_fwrite_impl,
+    neon_vfs_getc_impl,
+    neon_vfs_ungetc_impl,
+    neon_vfs_fseek_impl,
+    neon_vfs_rewind_impl,
+    neon_vfs_ftell_impl,
+    neon_vfs_feof_impl,
+    neon_vfs_truncate_impl,
+    neon_vfs_fsize_impl,
+    neon_vfs_metadata_impl
+};
+
+/* bring ne_set_connect_timeout in as a weak reference, not using it
+ * unless we have it available (neon 0.27) --nenolod
+ */
+extern void ne_set_connect_timeout(ne_session *sess, int timeout) __attribute__ ((weak));
+
 /*
  * ========
  */
@@ -144,6 +167,7 @@
 
     if (0 != ne_has_support(NE_FEATURE_SSL)) {
         _DEBUG("neon compiled with thread-safe SSL, enabling https:// transport");
+        vfs_register_transport(&neon_https_const);
     }
 
     _LEAVE;
@@ -223,7 +247,7 @@
                      * End of tag name.
                      */
                     *p = '\0';
-                    strcpy(name, tstart);
+                    g_strlcpy(name, tstart, 4096);
                     _DEBUG("Found tag name: %s", name);
                     state = 2;
                 } else {
@@ -252,7 +276,7 @@
                      * End of value
                      */
                     *p = '\0';
-                    strcpy(value, tstart);
+                    g_strlcpy(value, tstart, 4096);
                     _DEBUG("Found tag value: %s", value);
                     add_icy(m, name, value);
                     state = 4;
@@ -306,7 +330,7 @@
  * -----
  */
 
-static int auth_callback(void* userdata, const char* realm, int attempt, char* username, char* password) {
+static int server_auth_callback(void* userdata, const char* realm, int attempt, char* username, char* password) {
 
     struct neon_handle* h = (struct neon_handle*)userdata;
     gchar* authcpy;
@@ -515,9 +539,39 @@
 static int open_handle(struct neon_handle* handle, unsigned long startbyte) {
 
     int ret;
+    ConfigDb* db;
+    gchar* proxy_host;
+    gchar* proxy_port_s;
+    gchar* endptr;
+    unsigned int proxy_port = 0;
+    gboolean use_proxy;
 
     _ENTER;
 
+    db = bmp_cfg_db_open();
+    if (FALSE == bmp_cfg_db_get_bool(db, NULL, "use_proxy", &use_proxy)) {
+        use_proxy = FALSE;
+    }
+
+    if (use_proxy) {
+        if (FALSE == bmp_cfg_db_get_string(db, NULL, "proxy_host", &proxy_host)) {
+            _ERROR("Could not read proxy host, disabling proxy use");
+            use_proxy = FALSE;
+        }
+        if (FALSE == bmp_cfg_db_get_string(db, NULL, "proxy_port", &proxy_port_s)) {
+            _ERROR("Could not read proxy port, disabling proxy use");
+            use_proxy = FALSE;
+        }
+        proxy_port = strtoul(proxy_port_s, &endptr, 10);
+        if (!((*proxy_port_s != '\0') && (*endptr == '\0') && (proxy_port < 65536))) {
+            /*
+             * Invalid data
+             */
+            _ERROR("Invalid proxy port, disabling proxy use");
+            use_proxy = FALSE;
+        }
+    }
+
     handle->redircount = 0;
 
     _DEBUG("Parsing URL");
@@ -534,14 +588,22 @@
 
         _DEBUG("Creating session");
         handle->session = ne_session_create(handle->purl->scheme, handle->purl->host, handle->purl->port);
-        ne_add_server_auth(handle->session, NE_AUTH_BASIC, auth_callback, (void *)handle);
+        ne_add_server_auth(handle->session, NE_AUTH_BASIC, server_auth_callback, (void *)handle);
         ne_set_session_flag(handle->session, NE_SESSFLAG_ICYPROTO, 1);
         ne_set_session_flag(handle->session, NE_SESSFLAG_PERSIST, 0);
-        ne_set_connect_timeout(handle->session, 10);
+
+        if (ne_set_connect_timeout != NULL)
+            ne_set_connect_timeout(handle->session, 10);
+
         ne_set_read_timeout(handle->session, 10);
         ne_set_useragent(handle->session, "Audacious/1.4.0");
         ne_redirect_register(handle->session);
 
+        if (use_proxy) {
+            _DEBUG("Using proxy: %s:%d", proxy_host, proxy_port);
+            ne_session_proxy(handle->session, proxy_host, proxy_port);
+        }
+
         _DEBUG("Creating request");
         ret = open_request(handle, startbyte);
 
@@ -1215,7 +1277,7 @@
 
     if (-1 == h->content_length) {
         _DEBUG("Unknown content length");
-        _LEAVE 0;
+        _LEAVE -1;
     }
 
     _LEAVE (h->content_start + h->content_length);
--- a/src/null/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/null/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = null${PLUGIN_SUFFIX}
+SRCS = null.c
 
-OBJECTIVE_LIBS = libnull${SHARED_SUFFIX}
-
-LIBDIR = ${plugindir}/${OUTPUT_PLUGIN_DIR}
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-SOURCES = null.c
-
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += ${PICFLAGS} \
-	-I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} ${MOWGLI_CFLAGS} -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/paranormal/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,35 +1,32 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libparanormal$(SHARED_SUFFIX)
-
-SUBDIRS = libcalc presets
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS) $(SDL_LIBS) libcalc/libcalc.a
+SUBDIRS = presets
 
-SOURCES =			\
-	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
 
-OBJECTS = ${SOURCES:.c=.o}
-
-LIBDEP = libcalc/libcalc.a
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) $(SDL_CFLAGS) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+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/actuators.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/actuators.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
--- a/src/paranormal/actuators.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/actuators.h	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 /* FIXME: rename actuators to pn_actuators */
 /* FIXME: add a color type to the OPT_TYPE's */
 
--- a/src/paranormal/beatdetect.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/beatdetect.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #include "paranormal.h"
 
 /*
--- a/src/paranormal/builtins.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/builtins.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
--- a/src/paranormal/cfg.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/cfg.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,14 +1,33 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 /* FIXME: prevent the user from dragging something above the root
    actuator */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
 
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <audacious/configdb.h>
 
+#include <math.h>
+
 #include "paranormal.h"
 #include "actuators.h"
 #include "containers.h"
@@ -65,6 +84,18 @@
 				    ((GtkDestroyNotify) actuator_row_data_destroyed_cb));
 }
 
+static guchar
+gdk_colour_to_paranormal_colour(gint16 colour)
+{
+  return (guchar) (colour / 255);
+}
+
+static gint16
+paranormal_colour_to_gdk_colour(guchar colour)
+{
+  return (gint16) (colour * 255);
+}
+
 static void
 int_changed_cb (GtkSpinButton *sb, int *i)
 {
@@ -87,9 +118,15 @@
 }
 
 static void
-color_changed_cb (GtkSpinButton *sb, guchar *c)
+color_changed_cb (GtkColorButton *cb, struct pn_color *c)
 {
-  *c = gtk_spin_button_get_value_as_int (sb);
+  GdkColor colour;
+
+  gtk_color_button_get_color(cb, &colour);
+
+  c->r = gdk_colour_to_paranormal_colour(colour.red);
+  c->g = gdk_colour_to_paranormal_colour(colour.green);
+  c->b = gdk_colour_to_paranormal_colour(colour.blue);
 }
 
 static void
@@ -172,42 +209,18 @@
 	case OPT_TYPE_COLOR:
 	  {
 	    /* FIXME: add some color preview */
-	    GtkWidget *hbox;
-	    hbox = gtk_hbox_new (FALSE, 0);
-	    adj = gtk_adjustment_new (a->options[j].val.cval.r,
-				      0, 255,
-				      1, 2, 0);
-	    w = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1.0, 0);
-	    gtk_widget_show (w);
-	    gtk_signal_connect (GTK_OBJECT (w), "changed",
-			       GTK_SIGNAL_FUNC (color_changed_cb),
-			       &a->options[j].val.cval.r);
-	    gtk_tooltips_set_tip (actuator_tooltips, w,
+            GdkColor *colour = g_new0(GdkColor, 1);
+
+            colour->red = paranormal_colour_to_gdk_colour(a->options[j].val.cval.r);
+            colour->green = paranormal_colour_to_gdk_colour(a->options[j].val.cval.g);
+            colour->blue = paranormal_colour_to_gdk_colour(a->options[j].val.cval.b);
+
+            w = gtk_color_button_new_with_color(colour);
+	    g_signal_connect(G_OBJECT (w), "color-set",
+			       G_CALLBACK (color_changed_cb),
+			       &a->options[j].val.cval);
+	    gtk_tooltips_set_tip (actuator_tooltips, GTK_WIDGET(w),
 				  a->desc->option_descs[j].doc, NULL);
-	    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
-	    adj = gtk_adjustment_new (a->options[j].val.cval.g,
-				      0, 255,
-				      1, 2, 0);
-	    w = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1.0, 0);
-	    gtk_widget_show (w);
-	    gtk_signal_connect (GTK_OBJECT (w), "changed",
-			       GTK_SIGNAL_FUNC (color_changed_cb),
-			       &a->options[j].val.cval.g);
-	    gtk_tooltips_set_tip (actuator_tooltips, w,
-				  a->desc->option_descs[j].doc, NULL);
-	    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 6);
-	    adj = gtk_adjustment_new (a->options[j].val.cval.b,
-				      0, 255,
-				      1, 2, 0);
-	    w = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1.0, 0);
-	    gtk_widget_show (w);
-	    gtk_signal_connect (GTK_OBJECT (w), "changed",
-			       GTK_SIGNAL_FUNC (color_changed_cb),
-			       &a->options[j].val.cval.b);
-	    gtk_tooltips_set_tip (actuator_tooltips, w,
-				  a->desc->option_descs[j].doc, NULL);
-	    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
-	    w = hbox;
 	  }
 	  break;	  
 	case OPT_TYPE_COLOR_INDEX:
@@ -488,7 +501,7 @@
     {
       /* The dialog */
       cfg_dialog = gtk_dialog_new ();
-      gtk_window_set_title (GTK_WINDOW (cfg_dialog), "Paranormal Visualization Studio - Editor (PNS " VERSION ")");
+      gtk_window_set_title (GTK_WINDOW (cfg_dialog), "Paranormal Visualization Studio - Editor");
       gtk_widget_set_usize (cfg_dialog, 530, 370);
       gtk_container_border_width (GTK_CONTAINER (cfg_dialog), 8);
       gtk_signal_connect_object (GTK_OBJECT (cfg_dialog), "delete-event",
@@ -543,7 +556,7 @@
 			0, 2, 0, 1,
 			GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0,
 			3, 3);
-      actuator_add_button = gtk_button_new_with_label ("Add");
+      actuator_add_button = gtk_button_new_from_stock(GTK_STOCK_ADD);
       gtk_widget_show (actuator_add_button);
       gtk_signal_connect (GTK_OBJECT (actuator_add_button), "clicked",
 			  GTK_SIGNAL_FUNC (add_actuator_cb), NULL);
@@ -551,7 +564,7 @@
 			0, 1, 1, 2,
 			GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0,
 			3, 3);
-      actuator_remove_button = gtk_button_new_with_label ("Remove");
+      actuator_remove_button = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
       gtk_widget_set_sensitive (actuator_remove_button, FALSE);
       gtk_widget_show (actuator_remove_button);
       gtk_signal_connect (GTK_OBJECT (actuator_remove_button), "clicked",
@@ -560,7 +573,7 @@
 			1, 2, 1, 2,
 			GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0,
 			3, 3);
-      button = gtk_button_new_with_label ("Load");
+      button = gtk_button_new_from_stock(GTK_STOCK_OPEN);
       gtk_widget_show (button);
       gtk_signal_connect (GTK_OBJECT (button), "clicked",
 			  GTK_SIGNAL_FUNC (load_button_cb), NULL);
@@ -568,7 +581,7 @@
 			0, 1, 2, 3,
 			GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0,
 			3, 3);
-      button = gtk_button_new_with_label ("Save");
+      button = gtk_button_new_from_stock(GTK_STOCK_SAVE);
       gtk_widget_show (button);
       gtk_signal_connect (GTK_OBJECT (button), "clicked",
 			  GTK_SIGNAL_FUNC (save_button_cb), NULL);
@@ -611,23 +624,26 @@
       gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), 64, 0);
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (cfg_dialog)->action_area),
 			  bbox, FALSE, FALSE, 0);
-      button = gtk_button_new_with_label ("OK");
+
+      button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
       gtk_widget_show (button);
       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
       gtk_signal_connect (GTK_OBJECT (button), "clicked",
-			  GTK_SIGNAL_FUNC (ok_button_cb), NULL);
+			  GTK_SIGNAL_FUNC (cancel_button_cb), NULL);
       gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
-      button = gtk_button_new_with_label ("Apply");
+
+      button = gtk_button_new_from_stock (GTK_STOCK_APPLY);
       gtk_widget_show (button);
       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
       gtk_signal_connect (GTK_OBJECT (button), "clicked",
 			  GTK_SIGNAL_FUNC (apply_button_cb), NULL);
       gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
-      button = gtk_button_new_with_label ("Cancel");
+
+      button = gtk_button_new_from_stock (GTK_STOCK_OK);
       gtk_widget_show (button);
       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
       gtk_signal_connect (GTK_OBJECT (button), "clicked",
-			  GTK_SIGNAL_FUNC (cancel_button_cb), NULL);
+			  GTK_SIGNAL_FUNC (ok_button_cb), NULL);
       gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
     }
 
--- a/src/paranormal/cmaps.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/cmaps.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
--- a/src/paranormal/containers.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/containers.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
--- a/src/paranormal/containers.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/containers.h	Mon Oct 01 05:56:16 2007 -0500
@@ -1,5 +1,24 @@
-#ifndef _CONTAINERS_H
-#define _CONTAINERS_H
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _PN_CONTAINERS_H
+#define _PN_CONTAINERS_H
 
 void container_add_actuator (struct pn_actuator *container, struct pn_actuator *a);
 void container_remove_actuator (struct pn_actuator *container, struct pn_actuator *a);
--- a/src/paranormal/drawing.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/drawing.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #include <math.h>
 
 #include "paranormal.h"
--- a/src/paranormal/drawing.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/drawing.h	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #include <glib.h>
 
 #ifndef PN_DRAWING_H
--- a/src/paranormal/freq.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/freq.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
--- a/src/paranormal/general.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/general.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 /* FIXME: what to name this file? */
 
 #ifdef HAVE_CONFIG_H
--- a/src/paranormal/libcalc/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS_NOINST = libcalc.a
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
-
-LIBADD = $(GTK_LIBS) $(XML_LIBS) $(SDL_LIBS)
-
-SOURCES = dict.c  execute.c  function.c  parser.c  storage.c
-
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) $(SDL_CFLAGS) -I../../intl -I../..
-
-include ../../../mk/objective.mk
--- a/src/paranormal/misc.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/misc.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
--- a/src/paranormal/paranormal.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/paranormal.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,8 +1,23 @@
-/* FIXME: add fullscreen / screenshots */
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -133,7 +148,7 @@
   resize_video (1280, 1024);
 #endif
 
-  SDL_WM_SetCaption ("Paranormal Visualization Studio " VERSION, PACKAGE);
+  SDL_WM_SetCaption ("Paranormal Visualization Studio", PACKAGE);
 
   for(i=0; i<360; i++)
     {
--- a/src/paranormal/paranormal.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/paranormal.h	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifndef _PARANORMAL_H
 #define _PARANORMAL_H
 
--- a/src/paranormal/plugin.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/plugin.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,12 +1,29 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 /* FIXME: issues with not uniniting variables between
    enables?  I wasn't too careful about that, but it
    seems to work fine.  If there are problems perhaps
    look for a bug there?
 */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
 
 #include <stdlib.h>
 #include <stdio.h>
--- a/src/paranormal/pn_utils.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/pn_utils.h	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifndef _PN_UTILS_H
 #define _PN_UTILS_H
 
--- a/src/paranormal/presets.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/presets.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 /* FIXME: add documentation support to preset files */
 /* FIXME: add multiple-presets-per-file support (maybe) */
 
--- a/src/paranormal/presets.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/presets.h	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifndef _PRESETS_H
 #define _PRESETS_H
 
--- a/src/paranormal/presets/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/presets/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,42 +1,38 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-presetsdir = $(pkgdatadir)/paranormal/Presets
+DATA = nazca_-_smoke_on_the_water.pnv		\
+       nenolod_-_3d_wave.pnv			\
+       nenolod_-_aquamarine_dream.pnv		\
+       nenolod_-_purple_flower.pnv		\
+       nenolod_-_bumblebees.pnv			\
+       nenolod_-_flying_into_pastels.pnv	\
+       nenolod_-_phosphor_flame.pnv		\
+       nenolod_-_psuedo_starfield.pnv		\
+       nenolod_-_quakingscope.pnv		\
+       nenolod_-_beatscope.pnv			\
+       nenolod_-_branchscope.pnv		\
+       nenolod_-_retroscope.pnv			\
+       nenolod_-_technicolour_nightmare.pnv	\
+       nenolod_-_trapped.pnv			\
+       nenolod_-_value_replace_fun.pnv		\
+       nenolod_-_rush.pnv			\
+       nenolod_-_worms.pnv			\
+       nenolod_-_scopefun.pnv			\
+       nenolod_-_smoke.pnv			\
+       nenolod_-_swarm.pnv			\
+       nenolod_-_interlaced.pnv			\
+       nenolod_-_cubism.pnv			\
+       nenolod_-_transform_fun.pnv		\
+       nenolod_-_tunnel_vision.pnv		\
+       nenolod_-_kaliedoscope.pnv		\
+       nenolod_-_simple_yet_pretty.pnv		\
+       nenolod_-_quasar.pnv			\
+       aerdan_-_bloody_vortex.pnv		\
+       aerdan_-_cloudscape.pnv			\
+       aerdan_-_cloudscape2.pnv			\
+       aerdan_-_dancing_snow.pnv		\
+       aerdan_-_portal_to_hell.pnv		\
+       aerdan_-_telestatic.pnv			\
+       ticpu_-_colored_beat-o-scope.pnv	
 
-OBJECTIVE_DATA = \
-	nazca_-_smoke_on_the_water.pnv:$(presetsdir)	\
-	nenolod_-_3d_wave.pnv:$(presetsdir)		\
-	nenolod_-_aquamarine_dream.pnv:$(presetsdir)	\
-	nenolod_-_purple_flower.pnv:$(presetsdir)	\
-	nenolod_-_bumblebees.pnv:$(presetsdir)		\
-	nenolod_-_flying_into_pastels.pnv:$(presetsdir)	\
-	nenolod_-_phosphor_flame.pnv:$(presetsdir)	\
-	nenolod_-_psuedo_starfield.pnv:$(presetsdir)	\
-	nenolod_-_quakingscope.pnv:$(presetsdir)	\
-	nenolod_-_beatscope.pnv:$(presetsdir)		\
-	nenolod_-_branchscope.pnv:$(presetsdir)		\
-	nenolod_-_retroscope.pnv:$(presetsdir)		\
-	nenolod_-_technicolour_nightmare.pnv:$(presetsdir) \
-	nenolod_-_trapped.pnv:$(presetsdir)	\
-	nenolod_-_value_replace_fun.pnv:$(presetsdir)	\
-	nenolod_-_rush.pnv:$(presetsdir)		\
-	nenolod_-_worms.pnv:$(presetsdir)		\
-	nenolod_-_scopefun.pnv:$(presetsdir)		\
-	nenolod_-_smoke.pnv:$(presetsdir)		\
-	nenolod_-_swarm.pnv:$(presetsdir)		\
-	nenolod_-_interlaced.pnv:$(presetsdir)		\
-	nenolod_-_cubism.pnv:$(presetsdir)		\
-	nenolod_-_transform_fun.pnv:$(presetsdir)	\
-	nenolod_-_tunnel_vision.pnv:$(presetsdir)	\
-	nenolod_-_kaliedoscope.pnv:$(presetsdir)	\
-	nenolod_-_simple_yet_pretty.pnv:$(presetsdir)	\
-	nenolod_-_quasar.pnv:$(presetsdir)		\
-	aerdan_-_bloody_vortex.pnv:${presetsdir}	\
-	aerdan_-_cloudscape.pnv:${presetsdir}		\
-	aerdan_-_cloudscape2.pnv:${presetsdir}		\
-	aerdan_-_dancing_snow.pnv:${presetsdir}		\
-	aerdan_-_portal_to_hell.pnv:${presetsdir}	\
-	aerdan_-_telestatic.pnv:${presetsdir}		\
-	ticpu_-_colored_beat-o-scope.pnv:$(presetsdir)
+include ../../../buildsys.mk
 
-include ../../../mk/objective.mk
+PACKAGE = audacious-plugins/paranormal/Presets
--- a/src/paranormal/wave.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/wave.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
--- a/src/paranormal/xform.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/paranormal/xform.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,3 +1,22 @@
+/*
+ * paranormal: iterated pipeline-driven visualization plugin
+ * Copyright (c) 2006, 2007 William Pitcock <nenolod@dereferenced.org>
+ * Portions copyright (c) 2001 Jamie Gennis <jgennis@mindspring.com>
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 /* FIXME: allow for only using an xform on part of the img? */
 /* FIXME: perhaps combine these into a single vector field
    so that only 1 apply_xform needs to be done for as many
--- a/src/pls/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/pls/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = pls${PLUGIN_SUFFIX}
+SRCS = pls.c
 
-OBJECTIVE_LIBS = libpls$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(CONTAINER_PLUGIN_DIR)
-
-SOURCES = pls.c
+plugindir = audacious/${CONTAINER_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-CXXFLAGS = $(CFLAGS)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-include ../../mk/objective.mk
+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}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/COPYING	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/ConfigFile.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,142 @@
+// ConfigFile.cpp
+
+#include "ConfigFile.h"
+
+using std::string;
+
+ConfigFile::ConfigFile( string filename, string delimiter,
+                        string comment, string sentry )
+	: myDelimiter(delimiter), myComment(comment), mySentry(sentry)
+{
+	// Construct a ConfigFile, getting keys and values from given file
+	
+	std::ifstream in( filename.c_str() );
+	
+	if( !in ) throw file_not_found( filename ); 
+	
+	in >> (*this);
+}
+
+
+ConfigFile::ConfigFile()
+	: myDelimiter( string(1,'=') ), myComment( string(1,'#') )
+{
+	// Construct a ConfigFile without a file; empty
+}
+
+
+void ConfigFile::remove( const string& key )
+{
+	// Remove key and its value
+	myContents.erase( myContents.find( key ) );
+	return;
+}
+
+
+bool ConfigFile::keyExists( const string& key ) const
+{
+	// Indicate whether key is found
+	mapci p = myContents.find( key );
+	return ( p != myContents.end() );
+}
+
+
+/* static */
+void ConfigFile::trim( string& s )
+{
+	// Remove leading and trailing whitespace
+	static const char whitespace[] = " \n\t\v\r\f";
+	s.erase( 0, s.find_first_not_of(whitespace) );
+	s.erase( s.find_last_not_of(whitespace) + 1U );
+}
+
+
+std::ostream& operator<<( std::ostream& os, const ConfigFile& cf )
+{
+	// Save a ConfigFile to os
+	for( ConfigFile::mapci p = cf.myContents.begin();
+	     p != cf.myContents.end();
+		 ++p )
+	{
+		os << p->first << " " << cf.myDelimiter << " ";
+		os << p->second << std::endl;
+	}
+	return os;
+}
+
+
+std::istream& operator>>( std::istream& is, ConfigFile& cf )
+{
+	// Load a ConfigFile from is
+	// Read in keys and values, keeping internal whitespace
+	typedef string::size_type pos;
+	const string& delim  = cf.myDelimiter;  // separator
+	const string& comm   = cf.myComment;    // comment
+	const string& sentry = cf.mySentry;     // end of file sentry
+	const pos skip = delim.length();        // length of separator
+	
+	string nextline = "";  // might need to read ahead to see where value ends
+	
+	while( is || nextline.length() > 0 )
+	{
+		// Read an entire line at a time
+		string line;
+		if( nextline.length() > 0 )
+		{
+			line = nextline;  // we read ahead; use it now
+			nextline = "";
+		}
+		else
+		{
+			std::getline( is, line );
+		}
+		
+		// Ignore comments
+		line = line.substr( 0, line.find(comm) );
+		
+		// Check for end of file sentry
+		if( sentry != "" && line.find(sentry) != string::npos ) return is;
+		
+		// Parse the line if it contains a delimiter
+		pos delimPos = line.find( delim );
+		if( delimPos < string::npos )
+		{
+			// Extract the key
+			string key = line.substr( 0, delimPos );
+			line.replace( 0, delimPos+skip, "" );
+			
+			// See if value continues on the next line
+			// Stop at blank line, next line with a key, end of stream,
+			// or end of file sentry
+			bool terminate = false;
+			while( !terminate && is )
+			{
+				std::getline( is, nextline );
+				terminate = true;
+				
+				string nlcopy = nextline;
+				ConfigFile::trim(nlcopy);
+				if( nlcopy == "" ) continue;
+				
+				nextline = nextline.substr( 0, nextline.find(comm) );
+				if( nextline.find(delim) != string::npos )
+					continue;
+				if( sentry != "" && nextline.find(sentry) != string::npos )
+					continue;
+				
+				nlcopy = nextline;
+				ConfigFile::trim(nlcopy);
+				if( nlcopy != "" ) line += "\n";
+				line += nextline;
+				terminate = false;
+			}
+			
+			// Store key and value
+			ConfigFile::trim(key);
+			ConfigFile::trim(line);
+			cf.myContents[key] = line;  // overwrites if key is repeated
+		}
+	}
+	
+	return is;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/ConfigFile.h	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,253 @@
+// ConfigFile.h
+// Class for reading named values from configuration files
+// Richard J. Wagner  v2.1  24 May 2004  wagnerr@umich.edu
+
+// Copyright (c) 2004 Richard J. Wagner
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+
+// Typical usage
+// -------------
+// 
+// Given a configuration file "settings.inp":
+//   atoms  = 25
+//   length = 8.0  # nanometers
+//   name = Reece Surcher
+// 
+// Named values are read in various ways, with or without default values:
+//   ConfigFile config( "settings.inp" );
+//   int atoms = config.read<int>( "atoms" );
+//   double length = config.read( "length", 10.0 );
+//   string author, title;
+//   config.readInto( author, "name" );
+//   config.readInto( title, "title", string("Untitled") );
+// 
+// See file example.cpp for more examples.
+
+#ifndef CONFIGFILE_H
+#define CONFIGFILE_H
+
+#include <string>
+#include <map>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+
+using std::string;
+
+class ConfigFile {
+// Data
+protected:
+	string myDelimiter;  // separator between key and value
+	string myComment;    // separator between value and comments
+	string mySentry;     // optional string to signal end of file
+	std::map<string,string> myContents;  // extracted keys and values
+	
+	typedef std::map<string,string>::iterator mapi;
+	typedef std::map<string,string>::const_iterator mapci;
+
+// Methods
+public:
+	ConfigFile( string filename,
+	            string delimiter = "=",
+	            string comment = "#",
+				string sentry = "EndConfigFile" );
+	ConfigFile();
+	
+	// Search for key and read value or optional default value
+	template<class T> T read( const string& key ) const;  // call as read<T>
+	template<class T> T read( const string& key, const T& value ) const;
+	template<class T> bool readInto( T& var, const string& key ) const;
+	template<class T>
+	bool readInto( T& var, const string& key, const T& value ) const;
+	
+	// Modify keys and values
+	template<class T> void add( string key, const T& value );
+	void remove( const string& key );
+	
+	// Check whether key exists in configuration
+	bool keyExists( const string& key ) const;
+	
+	// Check or change configuration syntax
+	string getDelimiter() const { return myDelimiter; }
+	string getComment() const { return myComment; }
+	string getSentry() const { return mySentry; }
+	string setDelimiter( const string& s )
+		{ string old = myDelimiter;  myDelimiter = s;  return old; }  
+	string setComment( const string& s )
+		{ string old = myComment;  myComment = s;  return old; }
+	
+	// Write or read configuration
+	friend std::ostream& operator<<( std::ostream& os, const ConfigFile& cf );
+	friend std::istream& operator>>( std::istream& is, ConfigFile& cf );
+	
+protected:
+	template<class T> static string T_as_string( const T& t );
+	template<class T> static T string_as_T( const string& s );
+	static void trim( string& s );
+
+
+// Exception types
+public:
+	struct file_not_found {
+		string filename;
+		file_not_found( const string& filename_ = string() )
+			: filename(filename_) {} };
+	struct key_not_found {  // thrown only by T read(key) variant of read()
+		string key;
+		key_not_found( const string& key_ = string() )
+			: key(key_) {} };
+};
+
+
+/* static */
+template<class T>
+string ConfigFile::T_as_string( const T& t )
+{
+	// Convert from a T to a string
+	// Type T must support << operator
+	std::ostringstream ost;
+	ost << t;
+	return ost.str();
+}
+
+
+/* static */
+template<class T>
+T ConfigFile::string_as_T( const string& s )
+{
+	// Convert from a string to a T
+	// Type T must support >> operator
+	T t;
+	std::istringstream ist(s);
+	ist >> t;
+	return t;
+}
+
+
+/* static */
+template<>
+inline string ConfigFile::string_as_T<string>( const string& s )
+{
+	// Convert from a string to a string
+	// In other words, do nothing
+	return s;
+}
+
+
+/* static */
+template<>
+inline bool ConfigFile::string_as_T<bool>( const string& s )
+{
+	// Convert from a string to a bool
+	// Interpret "false", "F", "no", "n", "0" as false
+	// Interpret "true", "T", "yes", "y", "1", "-1", or anything else as true
+	bool b = true;
+	string sup = s;
+	for( string::iterator p = sup.begin(); p != sup.end(); ++p )
+		*p = toupper(*p);  // make string all caps
+	if( sup==string("FALSE") || sup==string("F") ||
+	    sup==string("NO") || sup==string("N") ||
+	    sup==string("0") || sup==string("NONE") )
+		b = false;
+	return b;
+}
+
+
+template<class T>
+T ConfigFile::read( const string& key ) const
+{
+	// Read the value corresponding to key
+	mapci p = myContents.find(key);
+	if( p == myContents.end() ) throw key_not_found(key);
+	return string_as_T<T>( p->second );
+}
+
+
+template<class T>
+T ConfigFile::read( const string& key, const T& value ) const
+{
+	// Return the value corresponding to key or given default value
+	// if key is not found
+	mapci p = myContents.find(key);
+	if( p == myContents.end() ) return value;
+	return string_as_T<T>( p->second );
+}
+
+
+template<class T>
+bool ConfigFile::readInto( T& var, const string& key ) const
+{
+	// Get the value corresponding to key and store in var
+	// Return true if key is found
+	// Otherwise leave var untouched
+	mapci p = myContents.find(key);
+	bool found = ( p != myContents.end() );
+	if( found ) var = string_as_T<T>( p->second );
+	return found;
+}
+
+
+template<class T>
+bool ConfigFile::readInto( T& var, const string& key, const T& value ) const
+{
+	// Get the value corresponding to key and store in var
+	// Return true if key is found
+	// Otherwise set var to given default
+	mapci p = myContents.find(key);
+	bool found = ( p != myContents.end() );
+	if( found )
+		var = string_as_T<T>( p->second );
+	else
+		var = value;
+	return found;
+}
+
+
+template<class T>
+void ConfigFile::add( string key, const T& value )
+{
+	// Add a key with given value
+	string v = T_as_string( value );
+	trim(key);
+	trim(v);
+	myContents[key] = v;
+	return;
+}
+
+#endif  // CONFIGFILE_H
+
+// Release notes:
+// v1.0  21 May 1999
+//   + First release
+//   + Template read() access only through non-member readConfigFile()
+//   + ConfigurationFileBool is only built-in helper class
+// 
+// v2.0  3 May 2002
+//   + Shortened name from ConfigurationFile to ConfigFile
+//   + Implemented template member functions
+//   + Changed default comment separator from % to #
+//   + Enabled reading of multiple-line values
+// 
+// v2.1  24 May 2004
+//   + Made template specializations inline to avoid compiler-dependent linkage
+//   + Allowed comments within multiple-line values
+//   + Enabled blank line termination for multiple-line values
+//   + Added optional sentry to detect end of configuration file
+//   + Rewrote messy trimWhitespace() function as elegant trim()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,15 @@
+PLUGIN = projectm-1.0${PLUGIN_SUFFIX}
+SRCS = main.cxx		\
+       video_init.cxx   \
+       ConfigFile.cxx   \
+       main_visplugin.c
+
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
+
+include ../../buildsys.mk
+include ../../extra.mk
+
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${SDL_CFLAGS} ${LIBPROJECTM1_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+CXXFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${SDL_LIBS} ${LIBPROJECTM1_LIBS}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/main.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,454 @@
+/* 
+projectM v1.01 - xmms-projectm.sourceforge.net
+--------------------------------------------------
+
+Lead Developers:  Carmelo Piccione (carmelo.piccione@gmail.com) &
+                  Peter Sperl (peter@sperl.com)
+
+We have also been advised by some professors at CMU, namely Roger B. Dannenberg.
+http://www-2.cs.cmu.edu/~rbd/    
+  
+The inspiration for this program was Milkdrop by Ryan Geiss. Obviously. 
+
+This code is distributed under the GPL.
+
+
+THANKS FOR THE CODE!!!
+-------------------------------------------------
+The base for this program was andy@nobugs.org's XMMS plugin tutorial
+http://www.xmms.org/docs/vis-plugin.html
+
+We used some FFT code by Takuya OOURA instead of XMMS' built-in fft code
+fftsg.c - http://momonga.t.u-tokyo.ac.jp/~ooura/fft.html
+
+and some beat detection code was inspired by Frederic Patin @
+www.gamedev.net/reference/programming/features/beatdetection/
+
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <string>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <SDL/SDL.h>
+#include <SDL/SDL_thread.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+extern "C" {
+#include <audacious/util.h>
+#include <audacious/plugin.h>
+#include <audacious/auddrct.h>
+}
+#include <math.h>
+#include "ConfigFile.h"
+
+#include <libprojectM/BeatDetect.hpp>
+#include <libprojectM/PCM.hpp>
+#include <libprojectM/projectM.hpp>
+#include <libprojectM/KeyHandler.hpp>
+#include "sdltoprojectM.h"
+#include "video_init.h"
+
+#define CONFIG_FILE "/share/projectM/config.inp"
+
+// Forward declarations 
+extern "C" void projectM_xmms_init(void); 
+extern "C" void projectM_cleanup(void);
+extern "C" void projectM_about(void);
+extern "C" void projectM_configure(void);
+extern "C" void projectM_playback_start(void);
+extern "C" void projectM_playback_stop(void);
+extern "C" void projectM_render_pcm(gint16 pcm_data[2][512]);
+extern "C" void projectM_render_freq(gint16 pcm_data[2][256]);
+extern "C" int worker_func(void*);
+std::string read_config();
+void saveSnapshotToFile();
+
+extern "C" VisPlugin projectM_vtable;
+
+//extern preset_t * active_preset;
+
+//FILE * debugFile = fopen("./dwrite-dump", "wb");
+
+// Callback functions
+
+// Our worker thread
+SDL_Thread *worker_thread = NULL;
+SDL_sem *sem = NULL;
+SDL_mutex *mutex = NULL;
+
+SDL_Event event;
+
+SDL_Surface *screen;
+
+
+projectM * globalPM = NULL;
+
+int maxsamples=512;
+
+int texsize=512;
+int gx=32,gy=24;
+int wvw=400,wvh=400;
+int fvw=1024,fvh=768;
+int fps=35, fullscreen=0;
+
+// char *title;
+
+gint disable_projectm(void *something) {
+	projectM_vtable.disable_plugin(&projectM_vtable);
+	return 0;
+}
+
+Uint32 get_xmms_title(Uint32 something, void *somethingelse) {
+	static char check_title = 1;
+	static int last_pos;
+	static char *last_title = NULL;
+	int pos;
+	char *title = NULL;
+
+	//Nice optimization, but we want the title no matter what so I can display it when the song changes
+#if 0
+	if(!(globalPM->showtitle%2)) {
+		/* Repeat less often when not showing title */
+		return 1000;
+	}
+#endif
+
+        pos = audacious_drct_pl_get_pos();
+	/* Only check every 1 second for title change, otherwise check pos */
+	if(check_title || pos != last_pos) {
+                title = audacious_drct_pl_get_title(pos);
+		if(title && (!last_title || strcmp(last_title,title))) {
+			globalPM->renderer->title = title;
+			globalPM->renderer->drawtitle = 1;
+			g_free(last_title);
+			last_title = title;
+		} else if(title && last_title != title) {
+			/* New copy of last title */
+			g_free(title);
+		}
+		check_title = !check_title;
+	}
+	last_pos = pos;
+	/* Repeat every 500ms */
+	return 500;
+}
+
+int capture = 0;
+
+int worker_func(void*)
+{ 
+// char projectM_data[1024]; 
+ SDL_TimerID title_timer = NULL;
+ std::string config_file;
+ config_file = read_config();
+
+ ConfigFile config(config_file);
+
+ int wvw = config.read<int>( "Window Width", 512 );
+ int wvh = config.read<int>( "Window Height", 512 );
+ int fullscreen = 0;
+ if (config.read("Fullscreen", true)) fullscreen = 1;
+      else fullscreen = 0;
+
+  init_display(wvw,wvh,&fvw,&fvh,fullscreen);   
+  SDL_WM_SetCaption("projectM v1.00", "projectM v1.00");
+
+
+  /** Initialise projectM */
+    
+  globalPM = new projectM(config_file);
+         
+  title_timer = SDL_AddTimer(500, (SDL_NewTimerCallback) get_xmms_title, NULL);
+    /** Initialise the thread */
+  // SDL_SemTryWait(sem);
+  while ( SDL_SemValue(sem)==1 ) {
+        projectMEvent evt;
+        projectMKeycode key;
+        projectMModifier mod;
+
+        /** Process SDL events */
+        SDL_Event event;
+        while ( SDL_PollEvent( &event ) ) {
+            /** Translate into projectM codes and process */
+            evt = sdl2pmEvent( event );	  
+
+            key = sdl2pmKeycode( event.key.keysym.sym );
+            mod = sdl2pmModifier( event.key.keysym.mod );
+
+            if ( evt == PROJECTM_KEYDOWN ) {                 
+	   
+	      if(key == PROJECTM_K_c)
+		{
+		  //SDL_SaveBMP(screen, "/home/pete/1.bmp");
+		  saveSnapshotToFile();
+		}
+	      if(key == PROJECTM_K_v)
+		{
+		  // capture++;
+		}
+	      if(key == PROJECTM_K_f)
+		{
+		 
+
+		 int w, h;
+                    if (fullscreen == 0) {
+                        w = fvw;
+                        h = fvh;
+                    } else {
+                        w = wvw;
+                        h = wvh;
+                    }
+                    globalPM->fullscreen = fullscreen ^= 1;
+                    resize_display(w, h, fullscreen);
+                    globalPM->projectM_resetGL( w, h ); 
+                }
+	      else  globalPM->key_handler(evt,key,mod);
+
+              }
+	    else if ( evt == PROJECTM_VIDEORESIZE )
+	      {
+
+	       
+
+		wvw=event.resize.w;
+		wvh=event.resize.h;
+	       
+		
+		resize_display(wvw,wvh,fullscreen);
+		globalPM->projectM_resetGL( wvw, wvh ); 
+ 
+              } 
+	    else if ( evt == PROJECTM_VIDEOQUIT ) {
+	      
+	      (void) g_idle_add((GSourceFunc) disable_projectm, NULL);
+	    }
+	}
+	
+        /** Add the waveform data */
+      
+
+        /** Render the new frame */
+	//	 strcpy(title,xmms_remote_get_playlist_title(projectM_vtable.xmms_session, xmms_remote_get_playlist_pos(projectM_vtable.xmms_session))); 
+
+	 //printf("%s\n",title);
+	// strcpy(globalPM->title,title);
+	//SDL_mutexP(mutex);
+	  globalPM->renderFrame();
+	  //SDL_mutexV(mutex);
+      
+
+        SDL_GL_SwapBuffers();
+
+	if (capture % 2 == 1) saveSnapshotToFile();
+	//	SDL_SemPost(sem);
+      }
+
+ 
+		
+  printf("Worker thread: Exiting\n");
+ if(title_timer) 
+	SDL_RemoveTimer(title_timer);
+ delete globalPM;
+ globalPM = NULL;
+ close_display();
+
+ return 0;
+}
+
+extern "C" void projectM_xmms_init(void) 
+{
+  
+  printf("projectM plugin: Initializing\n");
+ 
+  SDL_EnableUNICODE(1);
+  
+  mutex = SDL_CreateMutex();
+  sem = SDL_CreateSemaphore(1);
+  worker_thread = SDL_CreateThread ( *worker_func, NULL);
+ 
+}
+
+
+
+extern "C"void projectM_cleanup(void)
+{
+
+  if(worker_thread) {
+      SDL_SemWait(sem);
+      SDL_WaitThread(worker_thread, NULL);
+      SDL_DestroyMutex(mutex);
+      SDL_DestroySemaphore(sem);
+      SDL_Quit();
+      worker_thread = NULL;
+      sem = NULL;
+      mutex = NULL;
+      printf("projectM plugin: Cleanup completed\n");
+  }
+}
+extern "C" void projectM_about(void)
+{
+  printf("projectM plugin: About\n");
+}
+extern "C" void projectM_configure(void)
+{
+  printf("projectM plugin: Configure\n");
+}
+extern "C" void projectM_playback_start(void)
+{//thread_control = GO;
+  printf("projectM plugin: Playback starting\n");
+}
+extern "C" void projectM_playback_stop(void)
+{//thread_control = STOP;
+  printf("projectM plugin: Playback stopping\n");
+}
+extern "C" void projectM_render_pcm(gint16 pcm_data[2][512])
+{
+  //SDL_mutexP(mutex);
+
+    if(globalPM)
+        globalPM->beatDetect->pcm->addPCM16(pcm_data);
+	 
+       	//SDL_mutexV(mutex);
+	
+}
+
+extern "C" void projectM_render_freq(gint16 freq_data[2][256])
+{
+  printf("NO GOOD\n");
+ }
+
+std::string read_config()
+{
+
+//   int n;
+   
+   char num[512];
+   FILE *in; 
+   FILE *out;
+
+   char* home;
+   char projectM_home[1024];
+   char projectM_config[1024];
+
+   strcpy(projectM_config, PROJECTM_PREFIX);
+   strcpy(projectM_config+strlen(PROJECTM_PREFIX), CONFIG_FILE);
+   projectM_config[strlen(PROJECTM_PREFIX)+strlen(CONFIG_FILE)]='\0';
+   printf("dir:%s \n",projectM_config);
+   home=getenv("HOME");
+   strcpy(projectM_home, home);
+   strcpy(projectM_home+strlen(home), "/.projectM/config.inp");
+   projectM_home[strlen(home)+strlen("/.projectM/config.inp")]='\0';
+
+  
+ if ((in = fopen(projectM_home, "r")) != 0) 
+   {
+     printf("reading ~/.projectM/config.inp \n");
+     fclose(in);
+     return std::string(projectM_home);
+   }
+ else
+   {
+     printf("trying to create ~/.projectM/config.inp \n");
+
+     strcpy(projectM_home, home);
+     strcpy(projectM_home+strlen(home), "/.projectM");
+     projectM_home[strlen(home)+strlen("/.projectM")]='\0';
+     mkdir(projectM_home,0755);
+
+     strcpy(projectM_home, home);
+     strcpy(projectM_home+strlen(home), "/.projectM/config.inp");
+     projectM_home[strlen(home)+strlen("/.projectM/config.inp")]='\0';
+     
+     if((out = fopen(projectM_home,"w"))!=0)
+       {
+	
+	 if ((in = fopen(projectM_config, "r")) != 0) 
+	   {
+	     
+	     while(fgets(num,80,in)!=NULL)
+	       {
+		 fputs(num,out);
+	       }
+	     fclose(in);
+	     fclose(out);
+	    
+
+	     if ((in = fopen(projectM_home, "r")) != 0) 
+	       { 
+		 printf("created ~/.projectM/config.inp successfully\n");  
+		 fclose(in);
+		 return std::string(projectM_home);
+	       }
+	     else{printf("This shouldn't happen, using implementation defualts\n");abort();}
+	   }
+	 else{printf("Cannot find projectM default config, using implementation defaults\n");abort();}
+       }
+     else
+       {
+	 printf("Cannot create ~/.projectM/config.inp, using default config file\n");
+	 if ((in = fopen(projectM_config, "r")) != 0) 
+	   { printf("Successfully opened default config file\n");
+	     fclose(in);
+	     return std::string(projectM_config);}
+	 else{ printf("Using implementation defaults, your system is really messed up, I'm suprised we even got this far\n");  abort();}
+	   
+       }
+
+   }
+
+
+
+ abort();
+} 
+
+int frame = 1;
+char dumpPath[128];
+
+
+void saveSnapshotToFile()
+{
+
+  SDL_Surface *	bitmap;
+       
+        GLint		viewport[4];
+        long		bytewidth;
+        GLint		width, height;
+        long		bytes;
+    
+        glReadBuffer(GL_FRONT);
+        glGetIntegerv(GL_VIEWPORT, viewport);
+        
+        width = viewport[2];
+        height = viewport[3];
+            
+        bytewidth = width * 4;
+        bytewidth = (bytewidth + 3) & ~3;
+        bytes = bytewidth * height;
+
+	/*
+        glFinish();
+        glPixelStorei(GL_PACK_ALIGNMENT, 4);
+        glPixelStorei(GL_PACK_ROW_LENGTH, 0);
+        glPixelStorei(GL_PACK_SKIP_ROWS, 0);
+        glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
+	*/
+	
+
+	bitmap = SDL_CreateRGBSurface(SDL_SWSURFACE, width,  height, 32,0,0,0,0);
+        glReadPixels(0, 0, width, height,
+                    GL_BGRA,
+                    GL_UNSIGNED_INT_8_8_8_8_REV,
+		     bitmap->pixels);
+
+	sprintf(dumpPath, "/home/pete/.projectM/%.8d.bmp", frame++);
+                
+	SDL_SaveBMP(bitmap, dumpPath);
+
+        SDL_FreeSurface(bitmap);
+        
+       
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/main_visplugin.c	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,28 @@
+#include <audacious/plugin.h>
+
+extern void projectM_xmms_init(void);
+extern void projectM_cleanup(void);
+extern void projectM_about(void);
+extern void projectM_configure(void);
+extern void projectM_playback_start(void);
+extern void projectM_playback_stop(void);
+extern void projectM_render_pcm(gint16 pcm_data[2][512]);
+extern void projectM_render_freq(gint16 pcm_data[2][256]);
+
+VisPlugin projectM_vtable = {
+    .description = "projectM v1.0",
+    .num_pcm_chs_wanted = 2,
+    .init = projectM_xmms_init,
+    .cleanup = projectM_cleanup,
+    .about = projectM_about,
+    .configure = projectM_configure,
+    .playback_start = projectM_playback_start,
+    .playback_stop = projectM_playback_stop,
+    .render_pcm = projectM_render_pcm,
+    .render_freq = projectM_render_freq,
+};
+
+VisPlugin *projectM_vplist[] = { &projectM_vtable, NULL };
+
+DECLARE_PLUGIN(projectm, NULL, NULL, NULL, NULL, NULL, NULL,
+        projectM_vplist, NULL);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/sdltoprojectM.h	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,148 @@
+/**
+ * $Id: sdltoprojectM.h,v 1.1.1.1 2005/12/23 18:42:00 psperl Exp $
+ *
+ * Translates SDL -> projectM variables
+ *
+ * $Log: sdltoprojectM.h,v $
+ * Revision 1.1.1.1  2005/12/23 18:42:00  psperl
+ * Initial Import
+ *
+ * Revision 1.1  2004/10/08 00:35:28  cvs
+ * Moved and imported
+ *
+ * Revision 1.1.1.1  2004/10/04 12:56:00  cvs
+ * Imported
+ *
+ */
+
+#ifndef _SDLTOPROJECTM_H
+#define _SDLTOPROJECTM_H
+
+#include "libprojectM/event.h"
+#ifdef WIN32
+#include <SDL.h>
+#else
+#include <SDL/SDL.h>
+#endif
+
+projectMEvent sdl2pmEvent( SDL_Event event ) { \
+							
+    switch ( event.type ) { \
+        case SDL_VIDEORESIZE:
+            return PROJECTM_VIDEORESIZE; \
+        case SDL_KEYUP: \
+            return PROJECTM_KEYUP; \
+        case SDL_KEYDOWN: \
+            return PROJECTM_KEYDOWN; \
+        case SDL_QUIT: \
+            return PROJECTM_VIDEOQUIT; \
+        default:
+            return PROJECTM_KEYUP; \
+      } \
+  } \
+
+projectMKeycode sdl2pmKeycode( SDLKey keysym ) { \
+    switch ( keysym ) { \
+        case SDLK_F1: \
+            return PROJECTM_K_F1; \
+        case SDLK_F2: \
+            return PROJECTM_K_F2; \
+        case SDLK_F3: \
+            return PROJECTM_K_F3; \
+        case SDLK_F4: \
+            return PROJECTM_K_F4; \
+        case SDLK_F5: \
+            return PROJECTM_K_F5; \
+        case SDLK_F6: \
+            return PROJECTM_K_F6; \
+        case SDLK_F7: \
+            return PROJECTM_K_F7; \
+        case SDLK_F8: \
+            return PROJECTM_K_F8; \
+        case SDLK_F9: \
+            return PROJECTM_K_F9; \
+        case SDLK_F10: \
+            return PROJECTM_K_F10; \
+        case SDLK_F11: \
+            return PROJECTM_K_F11; \
+        case SDLK_F12: \
+            return PROJECTM_K_F12; \
+	  case SDLK_ESCAPE: \
+	    return PROJECTM_K_ESCAPE; 
+    case SDLK_a:
+      return PROJECTM_K_a;
+    case SDLK_b:
+      return PROJECTM_K_b;
+    case SDLK_c:  
+      return PROJECTM_K_c;
+    case SDLK_d: 
+      return PROJECTM_K_d; 
+    case SDLK_e:
+      return PROJECTM_K_e; 
+    case SDLK_f: 
+      return PROJECTM_K_f; 
+    case SDLK_g: 
+      return PROJECTM_K_g; 
+    case SDLK_h: 
+      return PROJECTM_K_h; 
+    case SDLK_i: 
+      return PROJECTM_K_i; 
+    case SDLK_j:
+      return PROJECTM_K_j;
+    case SDLK_k:
+      return PROJECTM_K_k;
+    case SDLK_l:  
+      return PROJECTM_K_l;
+    case SDLK_m: 
+      return PROJECTM_K_m; 
+    case SDLK_n:
+      return PROJECTM_K_n; 
+    case SDLK_o: 
+      return PROJECTM_K_o; 
+    case SDLK_p: 
+      return PROJECTM_K_p; 
+    case SDLK_q: 
+      return PROJECTM_K_q; 
+    case SDLK_r: 
+      return PROJECTM_K_r; 
+    case SDLK_s: 
+      return PROJECTM_K_s; 
+    case SDLK_t:
+      return PROJECTM_K_t; 
+    case SDLK_u: 
+      return PROJECTM_K_u; 
+    case SDLK_v: 
+      return PROJECTM_K_v; 
+    case SDLK_w: 
+      return PROJECTM_K_w; 
+    case SDLK_x: 
+      return PROJECTM_K_x; 
+    case SDLK_y: 
+      return PROJECTM_K_y; 
+    case SDLK_z: 
+      return PROJECTM_K_z; 
+    case SDLK_UP:
+      return PROJECTM_K_UP;
+    case SDLK_RETURN:
+      return PROJECTM_K_RETURN;
+    case SDLK_RIGHT:
+      return PROJECTM_K_RIGHT;
+    case SDLK_LEFT:
+      return PROJECTM_K_LEFT;
+    case SDLK_DOWN:
+      return PROJECTM_K_DOWN;
+    case SDLK_PAGEUP:
+      return PROJECTM_K_PAGEUP;
+    case SDLK_PAGEDOWN:
+      return PROJECTM_K_PAGEDOWN;
+   
+        default: \
+            return PROJECTM_K_NONE; \
+      } \
+  } \
+
+projectMModifier sdl2pmModifier( SDLMod mod ) { \
+    return PROJECTM_KMOD_LSHIFT; \
+  } \
+
+#endif /** _SDLTOPROJECTM_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/video_init.cxx	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,156 @@
+//video_init.c - SDL/Opengl Windowing Creation/Resizing Functions
+//
+//by Peter Sperl
+//
+//Opens an SDL Window and creates an OpenGL session
+//also able to handle resizing and fullscreening of windows
+//just call init_display again with differant variables
+
+#include <SDL/SDL.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+extern SDL_Surface *screen;
+extern int texsize;
+void setup_opengl( int w, int h );
+
+void close_display() {
+  printf("quitting\n");
+  SDL_Quit();
+}
+
+void resize_display(int w, int h, int f) {
+  int flags;
+  if (f) flags =  SDL_OPENGL|SDL_HWSURFACE|SDL_FULLSCREEN;
+  else   flags =  SDL_OPENGL|SDL_HWSURFACE|SDL_RESIZABLE;
+//  SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+  screen = SDL_SetVideoMode( w, h, 0, flags ) ;
+  if(screen == 0 ) {
+      fprintf( stderr, "Video mode set failed: %s\n", SDL_GetError( ) );
+      return;
+  }
+  setup_opengl(w,h);
+  SDL_ShowCursor(f ? SDL_DISABLE : SDL_ENABLE);
+}
+
+//init_display
+//
+//Sets screen to new width and height (w,h)
+//Also switches between fullscreen and windowed
+//with the boolean f (fullscreen)
+void init_display(int w, int h, int *fvw, int *fvh, int f)
+{
+  
+  /* Information about the current video settings. */
+  const SDL_VideoInfo* info = NULL;
+  int bpp = 0;
+  /* Flags we will pass into SDL_SetVideoMode. */
+  int flags = 0;
+  /* First, initialize SDL's video subsystem. */
+  if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER ) < 0 ) {
+    /* Failed, exit. */
+    fprintf( stderr, "Video initialization failed: %s\n",
+             SDL_GetError( ) );
+    //projectM_vtable.disable_plugin (&projectM_vtable);
+    return;
+    
+  }
+  /* Let's get some video information. */
+  info = SDL_GetVideoInfo( );
+  if( !info ) {
+    /* This should probably never happen. */
+    fprintf( stderr, "Video query failed: %s\n",
+             SDL_GetError( ) );
+    //    projectM_vtable.disable_plugin (&projectM_vtable);
+    return;
+  }
+  
+  printf("Screen Resolution: %d x %d\n", info->current_w, info->current_h);
+  *fvw = info->current_w;
+  *fvh = info->current_h;
+  printf("set fvw and fvw\n");
+  bpp = info->vfmt->BitsPerPixel;
+  printf("set bpp\n");
+  //SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
+  //SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
+  //SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
+
+  // SDL_GL_SetAttribute( SDL_GL_ACCUM_RED_SIZE, 8 );
+  //  SDL_GL_SetAttribute( SDL_GL_ACCUM_GREEN_SIZE, 8 );
+  //  SDL_GL_SetAttribute( SDL_GL_ACCUM_BLUE_SIZE, 8 );
+  SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8 );
+  SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+  SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+  printf("set gl attributes\n");
+  if (f==0)
+     flags = SDL_OPENGL|SDL_HWSURFACE|SDL_RESIZABLE;
+  else flags = SDL_OPENGL|SDL_HWSURFACE|SDL_FULLSCREEN;
+ printf("set gl attributes2\n");
+  screen= SDL_SetVideoMode( w, h, bpp, flags ) ;
+ printf("set screen\n");
+  if(screen == 0 ) {
+    /* 
+     * This could happen for a variety of reasons,
+     * including DISPLAY not being set, the specified
+     * resolution not being available, etc.
+     */
+   fprintf( stderr, "Video mode set failed: %s\n",
+	     SDL_GetError( ) );
+    
+   // projectM_vtable.disable_plugin (&projectM_vtable);
+    return;
+    
+  }
+  
+  printf("video init done\n");
+  // setup_opengl(w,h);
+  //gluOrtho2D(0, w, 0, h);
+}
+
+
+ void setup_opengl( int w, int h )
+{
+   
+    /* Our shading model--Gouraud (smooth). */
+     glShadeModel( GL_SMOOTH);
+    /* Culling. */
+    //    glCullFace( GL_BACK );
+    //    glFrontFace( GL_CCW );
+    //    glEnable( GL_CULL_FACE );
+    /* Set the clear color. */
+    glClearColor( 0, 0, 0, 0 );
+    /* Setup our viewport. */
+     glViewport( 0, 0, w, h );
+    /*
+     * Change to the projection matrix and set
+     * our viewing volume.
+     */
+    glMatrixMode(GL_TEXTURE);
+    glLoadIdentity();
+    
+    //    gluOrtho2D(0.0, (GLfloat) width, 0.0, (GLfloat) height);
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();  
+   
+    //    glFrustum(0.0, height, 0.0,width,10,40);
+    glMatrixMode(GL_MODELVIEW);
+    glLoadIdentity();
+
+glDrawBuffer(GL_BACK); 
+  glReadBuffer(GL_BACK); 
+  glEnable(GL_BLEND); 
+
+     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 
+     // glBlendFunc(GL_SRC_ALPHA, GL_ONE); 
+  glEnable(GL_LINE_SMOOTH);
+  glEnable(GL_POINT_SMOOTH);
+  glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+  glClear(GL_COLOR_BUFFER_BIT);
+ 
+  // glCopyTexImage2D(GL_TEXTURE_2D,0,GL_RGB,0,0,texsize,texsize,0);
+  //glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,texsize,texsize);
+   glLineStipple(2, 0xAAAA);
+  
+    
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/projectm-1.0/video_init.h	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,6 @@
+ void setup_opengl( int w, int h );
+ void init_display( int w, int h, int *fvw, int *fvh, int fullscreen );
+ void resize_display( int w, int h, int fullscreen );
+ void close_display();
+
+void CreateRenderTarget(int texsize,int *RenderTargetTextureID, int *RenderTarget);
--- a/src/projectm/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/projectm/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = projectm${PLUGIN_SUFFIX}
+SRCS = main.c		\
+       video_init.c
 
-OBJECTIVE_LIBS = libprojectm$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(SDL_LIBS) $(LIBPROJECTM_LIBS) -lprojectM
-
-SOURCES = main.c video_init.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) $(SDL_CFLAGS) $(LIBPROJECTM_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+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/pulse_audio/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/pulse_audio/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = pulse_audio${PLUGIN_SUFFIX}
+SRCS = pulse_audio.c
 
-OBJECTIVE_LIBS = libpulse_audio$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+plugindir = audacious/${OUTPUT_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -lpulse
-SOURCES = pulse_audio.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += -lpulse ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/pulse_audio/pulse_audio.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/pulse_audio/pulse_audio.c	Mon Oct 01 05:56:16 2007 -0500
@@ -17,9 +17,7 @@
   USA.
 ***/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
 #include <stdio.h>
 #include <assert.h>
--- a/src/rocklight/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/rocklight/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,13 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = rocklight${PLUGIN_SUFFIX}
+SRCS = rocklight.c	\
+       sysled.c		\
+       thinklight.c
 
-OBJECTIVE_LIBS = librocklight$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = rocklight.c thinklight.c sysled.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/rootvis/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/rootvis/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,22 +1,16 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = librootvis.so
-
-CFLAGS += -I. $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(IMLIB2_CFLAGS)
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
-
-LIBADD += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(IMLIB2_LIBS)
+PLUGIN = rootvis${PLUGIN_SUFFIX}
+SRCS = config_backend.c			\
+       config_definition.c		\
+       config_frontend.c		\
+       config_frontend_widgets.c	\
+       getroot.c			\
+       rootvis.c
 
-SOURCES = \
-	config_backend.c \
-	config_definition.c \
-	config_frontend.c \
-	config_frontend_widgets.c \
-	getroot.c \
-	rootvis.c
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} -I. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${IMLIB2_CFLAGS}
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${IMLIB2_LIBS}
--- a/src/rovascope/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = librovascope$(SHARED_SUFFIX)
-
-SUBDIRS = libcalc
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS) $(SDL_LIBS) libcalc/libcalc.a
-
-SOURCES =			\
-	actuators.c		\
-	actuatorbin.c		\
-	beatdetect.c		\
-	builtins.c		\
-	cmaps.c			\
-	containers.c		\
-	drawing.c		\
-	freq.c			\
-	general.c		\
-	misc.c			\
-	paranormal.c		\
-	plugin.c		\
-	wave.c			\
-	xform.c
-
-OBJECTS = ${SOURCES:.c=.o}
-
-LIBDEP = libcalc/libcalc.a
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) $(SDL_CFLAGS) -I../../intl -I../.. -Wall
-
-include ../../mk/objective.mk
--- a/src/rovascope/TODO	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-More immediate points:
-
-- blend surface
-
-- container_stepped
-  executes <step> amount of instructions.. step increases or decreases 
-  on beat
-
-- container_repeat
-  executes the child instructions <step> amount of times.. step 
-  increases or decreases on beat
-
- 
--- a/src/rovascope/actuatorbin.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#include "paranormal.h"
-#include "actuators.h"
-
-struct pn_actuator *
-rovascope_get_random_colourmap(void)
-{
-   struct pn_actuator *out;
-
-   srand(time(NULL));
-
-   out = create_actuator("cmap_bwgradient");
-   out->options[2].val.cval.r = 255 - rand() % 255;
-   out->options[2].val.cval.g = 255 - rand() % 255;
-   out->options[2].val.cval.b = 255 - rand() % 255;
-
-   return out;
-}
-
-struct pn_actuator *
-rovascope_get_random_transform(void)
-{
-   struct pn_actuator *out;
-   gchar *candidates[] = {
-      "d = cos(d) ^ 2;",
-      "r = sin(r);",
-      "r = sin(r); d = cos(d) ^ 2;",
-   };
-
-   srand(time(NULL));
-
-   out = create_actuator("xform_movement");
-   out->options[0].val.sval = 
-	g_strdup(candidates[rand() % G_N_ELEMENTS(candidates)]);
-
-   return out;
-}
-
-struct pn_actuator *
-rovascope_get_random_general(void)
-{
-   struct pn_actuator *out;
-
-   gchar *candidates[] = {
-      "general_fade", "general_blur", "general_mosaic", 
-      "general_flip", "general_fade", "general_fade",
-   };
-
-   out = create_actuator(candidates[rand() % G_N_ELEMENTS(candidates)]);
-
-   return out;
-}
-
-struct pn_actuator *
-rovascope_get_random_normal_scope(void)
-{
-   struct pn_actuator *out;
-
-   gchar *candidates[] = {
-      "wave_horizontal", "wave_vertical", "wave_radial",
-   };
-
-   out = create_actuator(candidates[rand() % G_N_ELEMENTS(candidates)]);
-
-   return out;
-}
-
-struct pn_actuator *
-rovascope_get_random_actuator(void)
-{
-   struct pn_actuator *out;
-   struct pn_actuator *(*func)();
-
-   void *candidates[] = {
-	rovascope_get_random_colourmap,
-	rovascope_get_random_general,
-	rovascope_get_random_normal_scope,
-	rovascope_get_random_transform,
-   };
-
-   func = candidates[rand() % G_N_ELEMENTS(candidates)];
-   out = func();
-
-   return out;
-}
--- a/src/rovascope/actuators.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <glib.h>
-
-#include "actuators.h"
-//#include "containers.h"
-
-/* FIXME: container options override containees - fix this? */
-/* FIXME: add actuator groups (by a group name string) */
-
-/* FIXME: add support for copying containers' children (optionally) */
-struct pn_actuator *
-copy_actuator (const struct pn_actuator *a)
-{
-  struct pn_actuator *actuator;
-  int i;    
-
-  actuator = g_new (struct pn_actuator, 1);
-
-  actuator->desc = a->desc;
-
-  /* Make an options table */
-  if (actuator->desc->option_descs)
-    {
-      /* count the options */
-      for (i=0; actuator->desc->option_descs[i].name; i++);
-
-      actuator->options = g_new (struct pn_actuator_option, i);
-      for (i=0; actuator->desc->option_descs[i].name; i++)
-	{
-	  actuator->options[i].desc = &actuator->desc->option_descs[i];
-
-	  /* copy the default options */
-	  switch (actuator->desc->option_descs[i].type)
-	    {
-	    case OPT_TYPE_INT:
-	    case OPT_TYPE_COLOR_INDEX:
-	    case OPT_TYPE_FLOAT:
-	    case OPT_TYPE_COLOR:
-	    case OPT_TYPE_BOOLEAN:
-	      memcpy (&actuator->options[i].val,
-		      &a->options[i].val,
-		      sizeof (union actuator_option_val));
-	      break;
-	    case OPT_TYPE_STRING:
-              actuator->options[i].val.sval = g_strdup(a->options[i].val.sval);
-              break;
-	    default:
-	      break;
-	    }
-	}
-
-      /* the NULL option */
-      actuator->options[i].desc = NULL;
-    }
-  else
-    actuator->options = NULL;
-
-  if (actuator->desc->init)
-    actuator->desc->init (&actuator->data);
-
-  return actuator;
-}
-
-struct pn_actuator_desc *
-get_actuator_desc (const char *name)
-{
-  int i;
-
-  for (i=0; builtin_table[i]; i++)
-    if (! g_strcasecmp (name, builtin_table[i]->name) || ! g_strcasecmp(name, builtin_table[i]->dispname))
-      break;
-
-  /* actuator not found */
-  if (! builtin_table[i])
-    return NULL;
-
-  return builtin_table[i];
-}
-
-struct pn_actuator *
-create_actuator (const char *name)
-{
-  int i;
-  struct pn_actuator_desc *desc;
-  struct pn_actuator *actuator;
-
-  /* find the actuatoreration */
-  desc = get_actuator_desc (name);
-
-  if (! desc)
-    return NULL;
-
-  actuator = g_new (struct pn_actuator, 1);
-  actuator->desc = desc;
-
-  /* Make an options table */
-  if (actuator->desc->option_descs)
-    {
-      /* count the options */
-      for (i=0; actuator->desc->option_descs[i].name != NULL; i++);
-
-      actuator->options = g_new0 (struct pn_actuator_option, i + 1);
-      for (i=0; actuator->desc->option_descs[i].name != NULL; i++)
-	{
-	  actuator->options[i].desc = &actuator->desc->option_descs[i];
-
-	  /* copy the default options */
-	  switch (actuator->desc->option_descs[i].type)
-	    {
-	    case OPT_TYPE_INT:
-	    case OPT_TYPE_COLOR_INDEX:
-	    case OPT_TYPE_FLOAT:
-	    case OPT_TYPE_COLOR:
-	    case OPT_TYPE_BOOLEAN:
-	      memcpy (&actuator->options[i].val,
-		      &actuator->desc->option_descs[i].default_val,
-		      sizeof (union actuator_option_val));
-	      break;
-	    case OPT_TYPE_STRING:
-	      /* NOTE: It's not realloc'ed so don't free it */
-	      actuator->options[i].val.sval =
-		actuator->desc->option_descs[i].default_val.sval;
-	      break;
-	    }
-	}
-
-      /* the NULL option */
-      actuator->options[i].desc = NULL;
-    }
-  else
-    actuator->options = NULL;
-
-  if (actuator->desc->init)
-    actuator->desc->init (&actuator->data);
-
-  return actuator;
-}
-
-void
-destroy_actuator (struct pn_actuator *actuator)
-{
-  int i;
-
-  if (actuator->desc->cleanup)
-    actuator->desc->cleanup (actuator->data);
-
-  /* find any option val's that need to be freed */
-  if (actuator->options)
-    for (i=0; actuator->options[i].desc; i++)
-      switch (actuator->options[i].desc->type)
-	{
-	case OPT_TYPE_INT:
-	case OPT_TYPE_FLOAT:
-	case OPT_TYPE_COLOR:
-	case OPT_TYPE_COLOR_INDEX:
-	case OPT_TYPE_BOOLEAN:
-	  break;
-	case OPT_TYPE_STRING:
-	  if (actuator->options[i].val.sval
-	      != actuator->options[i].desc->default_val.sval)
-	    g_free ((char *)actuator->options[i].val.sval);
-	}
-
-  g_free (actuator->options);
-  g_free (actuator);
-}
-
-void
-exec_actuator (struct pn_actuator *actuator)
-{
-  g_assert (actuator);
-  g_assert (actuator->desc);
-  g_assert (actuator->desc->exec);
-  actuator->desc->exec (actuator->options, actuator->data);
-}
-
--- a/src/rovascope/actuators.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/* FIXME: rename actuators to pn_actuators */
-/* FIXME: add a color type to the OPT_TYPE's */
-
-#ifndef _ACTUATORS_H
-#define _ACTUATORS_H
-
-#include <glib.h>
-#include <SDL.h>
-#include <string.h>
-
-/* Helper macros for actuator functions */
-#define PN_ACTUATOR_INIT_FUNC(f) ((void (*) (gpointer *data))f)
-#define PN_ACTUATOR_CLEANUP_FUNC(f) ((void (*) (gpointer data))f)
-#define PN_ACTUATOR_EXEC_FUNC(f) \
-((void (*) (const struct pn_actuator_option *opts, gpointer data))f)
-
-struct pn_color
-{
-  guchar r, g, b;
-  guchar spluzz; /* gotta look like an SDL_Color */
-};
-
-
-union actuator_option_val
-{
-  int ival;
-  float fval;
-  const char *sval;
-  struct pn_color cval;
-  gboolean bval;
-};
-
-/* A actuator's option description */
-struct pn_actuator_option_desc
-{
-  const char *name;
-  const char *doc; /* option documentation */
-  enum
-  {
-    OPT_TYPE_INT = 0,
-    OPT_TYPE_FLOAT = 1,
-    OPT_TYPE_STRING = 2,
-    OPT_TYPE_COLOR = 3,
-    OPT_TYPE_COLOR_INDEX = 4, /* uses ival */
-    OPT_TYPE_BOOLEAN = 5
-  } type;
-  union actuator_option_val default_val;
-};
-
-/* The actual option instance */
-struct pn_actuator_option
-{
-  const struct pn_actuator_option_desc *desc;
-  union actuator_option_val val;
-};
-
-/* An operation's description */
-struct pn_actuator_desc
-{
-  const char *name;	/* e.g. "container_simple" */
-  const char *dispname;	/* e.g. "Simple Container" */
-  const char *doc; /* documentation txt */
-  const enum
-  {
-    ACTUATOR_FLAG_CONTAINER = 1<<0
-  } flags;
-
-  /* A null terminating (ie a actuator_option_desc == {0,...,0})
-     array - OPTIONAL (optional fields can be NULL) */
-  const struct pn_actuator_option_desc *option_descs;
-
-  /* Init function - data points to the actuator.data - OPTIONAL */
-  void (*init) (gpointer *data);
-  
-  /* Cleanup actuatortion - OPTIONAL */
-  void (*cleanup) (gpointer data);
-
-  /* Execute actuatortion - REQUIRED (duh!) */
-  void (*exec) (const struct pn_actuator_option *opts, gpointer data);
-};
-
-/* An actual operation instance */
-struct pn_actuator
-{
-  const struct pn_actuator_desc *desc;
-  struct pn_actuator_option *options;
-  gpointer data;
-};
-
-/* The array containing all operations (see builtins.c) */
-extern struct pn_actuator_desc *builtin_table[];
-
-/* functions for actuators */
-struct pn_actuator_desc *get_actuator_desc (const char *name);
-struct pn_actuator *copy_actuator (const struct pn_actuator *a);
-struct pn_actuator *create_actuator (const char *name);
-void destroy_actuator (struct pn_actuator *actuator);
-void exec_actuator (struct pn_actuator *actuator);
-
-#endif /* _ACTUATORS_H */
--- a/src/rovascope/beatdetect.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#include "paranormal.h"
-
-/*
- * This algorithm is by Janusz Gregorcyzk, the implementation is
- * mine, however.
- *
- *   -- nenolod
- */
-int
-pn_is_new_beat(void)
-{
-  gint i;
-  gint total = 0;
-  gboolean ret = FALSE;
-  static gint previous;
-
-  for (i = 1; i < 512; i++)
-    {
-       total += abs (pn_sound_data->pcm_data[0][i] -
-		     pn_sound_data->pcm_data[0][i - 1]);
-    }
-
-  total /= 512;
-
-  ret = (total > (2 * previous));
-
-  previous = total;
-
-  return ret;
-}
--- a/src/rovascope/builtins.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "actuators.h"
-
-#define DECLARE_ACTUATOR(a) extern struct pn_actuator_desc builtin_##a;
-
-/* **************** containers **************** */
-
-DECLARE_ACTUATOR (container_simple);
-DECLARE_ACTUATOR (container_once);
-DECLARE_ACTUATOR (container_cycle);
-DECLARE_ACTUATOR (container_onbeat);
-
-/* **************** cmaps **************** */
-
-DECLARE_ACTUATOR (cmap_bwgradient);
-DECLARE_ACTUATOR (cmap_gradient);
-DECLARE_ACTUATOR (cmap_dynamic);
-
-/* **************** freq **************** */
-DECLARE_ACTUATOR (freq_dots);
-DECLARE_ACTUATOR (freq_drops);
-
-/* **************** general **************** */
-DECLARE_ACTUATOR (general_fade);
-DECLARE_ACTUATOR (general_blur);
-DECLARE_ACTUATOR (general_mosaic);
-DECLARE_ACTUATOR (general_clear);
-DECLARE_ACTUATOR (general_noop);
-DECLARE_ACTUATOR (general_invert);
-DECLARE_ACTUATOR (general_replace);
-DECLARE_ACTUATOR (general_swap);
-DECLARE_ACTUATOR (general_copy);
-DECLARE_ACTUATOR (general_flip);
-
-/* **************** misc **************** */
-DECLARE_ACTUATOR (misc_floater);
-
-/* **************** wave **************** */
-DECLARE_ACTUATOR (wave_horizontal);
-DECLARE_ACTUATOR (wave_vertical);
-DECLARE_ACTUATOR (wave_normalize);
-DECLARE_ACTUATOR (wave_smooth);
-DECLARE_ACTUATOR (wave_radial);
-DECLARE_ACTUATOR (wave_scope);
-
-/* **************** xform **************** */
-DECLARE_ACTUATOR (xform_spin);
-DECLARE_ACTUATOR (xform_ripple);
-DECLARE_ACTUATOR (xform_bump_spin);
-DECLARE_ACTUATOR (xform_halfrender);
-DECLARE_ACTUATOR (xform_movement);
-DECLARE_ACTUATOR (xform_dynmovement);
-
-/* **************** builtin_table **************** */
-struct pn_actuator_desc *builtin_table[] =
-{
-  /* **************** containers **************** */
-  &builtin_container_simple,
-  &builtin_container_once,
-  &builtin_container_cycle,
-  &builtin_container_onbeat,
-
-  /* **************** cmaps **************** */
-  &builtin_cmap_bwgradient,
-  &builtin_cmap_gradient,
-  &builtin_cmap_dynamic,
-  /* **************** freq **************** */
-  &builtin_freq_dots,
-  &builtin_freq_drops,
-  /* **************** general **************** */
-  &builtin_general_fade,
-  &builtin_general_blur,
-  &builtin_general_mosaic,
-  &builtin_general_clear,
-  &builtin_general_noop,
-  &builtin_general_invert,
-  &builtin_general_replace,
-  &builtin_general_swap,
-  &builtin_general_copy,
-  &builtin_general_flip,
-  /* **************** misc **************** */
-  &builtin_misc_floater,
-  /* **************** wave **************** */
-  &builtin_wave_horizontal,
-  &builtin_wave_vertical,
-  &builtin_wave_normalize,
-  &builtin_wave_smooth,
-  &builtin_wave_radial,
-  &builtin_wave_scope,
-  /* **************** xform **************** */
-  &builtin_xform_spin,
-  &builtin_xform_ripple,
-  &builtin_xform_bump_spin,
-  &builtin_xform_halfrender,
-  &builtin_xform_movement,
-  &builtin_xform_dynmovement,
-  /* **************** the end! **************** */
-  NULL
-};
--- a/src/rovascope/cmaps.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <glib.h>
-
-#include "paranormal.h"
-#include "actuators.h"
-
-#include "libcalc/calc.h"
-
-#define STD_CMAP_OPTS { "low_index", "The lowest index of the \
-color map that should be altered", OPT_TYPE_COLOR_INDEX, { ival: 0 } },\
-{ "high_index", "The highest index of the color map that should be \
-altered", OPT_TYPE_COLOR_INDEX, { ival: 255 } }
-
-static struct pn_color black = {0, 0, 0};
-static struct pn_color white = {255, 255, 255};
-
-/* **************** cmap generation funcs **************** */
-static void
-cmap_gen_gradient (int step, const struct pn_color *a,
-		   const struct pn_color *b,
-		   struct pn_color *c)
-{
-  c->r = a->r + step * ((((float)b->r) - ((float)a->r)) / 256.0);
-  c->g = a->g + step * ((((float)b->g) - ((float)a->g)) / 256.0);
-  c->b = a->b + step * ((((float)b->b) - ((float)a->b)) / 256.0);
-}
-
-/* **************** cmap_gradient **************** */
-static struct pn_actuator_option_desc cmap_gradient_opts[] =
-{
-  STD_CMAP_OPTS,
-  { "lcolor", "The low color used in the gradient generation",
-    OPT_TYPE_COLOR, { cval: {0, 0, 0} } },
-  { "hcolor", "The high color used in the gradient generation",
-    OPT_TYPE_COLOR, { cval: {0, 0, 0} } },
-  { NULL }
-};
-
-static void
-cmap_gradient_exec (const struct pn_actuator_option *opts,
-		    gpointer data)
-{
-  int i;
-
-  for (i=opts[0].val.ival; i<=opts[1].val.ival; i++)
-    cmap_gen_gradient (((i-opts[0].val.ival)<<8)/(opts[1].val.ival
-						  - opts[0].val.ival),
-		       &opts[2].val.cval, &opts[3].val.cval,
-		       &pn_image_data->cmap[i]);
-}
-
-struct pn_actuator_desc builtin_cmap_gradient =
-{
-  "cmap_gradient",
-  "Normal colourmap",
-  "Sets the colormap to a gradient going from <lcolor> to "
-  "<hcolor>",
-  0, cmap_gradient_opts,
-  NULL, NULL, cmap_gradient_exec
-};
-
-/* **************** cmap_bwgradient **************** */
-static struct pn_actuator_option_desc cmap_bwgradient_opts[] =
-{
-  STD_CMAP_OPTS,
-  { "color", "The intermediate color to use in the gradient",
-    OPT_TYPE_COLOR, { cval: {191, 191, 191} } },
-  { NULL }
-};
-
-static void
-cmap_bwgradient_exec (const struct pn_actuator_option *opts,
-		      gpointer data)
-{
-  int i;
-
-  for (i=opts[0].val.ival; i<128 && i<=opts[1].val.ival; i++)
-    cmap_gen_gradient (i<<1, &black, &opts[2].val.cval,
-		       &pn_image_data->cmap[i]);
-
-  for (i=128; i<256 && i<=opts[1].val.ival; i++)
-    cmap_gen_gradient ((i-128)<<1, &opts[2].val.cval, &white,
-		       &pn_image_data->cmap[i]);
-}
-    
-struct pn_actuator_desc builtin_cmap_bwgradient =
-{
-  "cmap_bwgradient",
-  "Value-based colourmap",
-  "Sets the colormap to a gradient going from black to "
-  "white, via an intermediate color",
-  0, cmap_bwgradient_opts,
-  NULL, NULL, cmap_bwgradient_exec
-};
-
-/* **************** cmap_dynamic **************** */
-static struct pn_actuator_option_desc cmap_dynamic_opts[] =
-{
-  STD_CMAP_OPTS,
-  { "script", "The script to run on each step.",
-    OPT_TYPE_STRING, { sval: "red = red + 0.01; blue = blue + 0.01; green = green + 0.01;" } },
-  { NULL }
-};
-
-typedef struct {
-  expression_t *expr;
-  symbol_dict_t *dict;
-} PnDynamicColourmapData;
-
-static void
-cmap_dynamic_init(gpointer *data)
-{
-  *data = g_new0(PnDynamicColourmapData, 1);
-}
-
-static void
-cmap_dynamic_cleanup(gpointer data)
-{
-  PnDynamicColourmapData *d = (PnDynamicColourmapData *) data;
-
-  if (d->expr)
-    expr_free(d->expr);
-  if (d->dict)
-    dict_free(d->dict);
-
-  g_free(d);
-}
-
-static void
-cmap_dynamic_exec(const struct pn_actuator_option *opts,
-		  gpointer data)
-{
-  PnDynamicColourmapData *d = (PnDynamicColourmapData *) data;
-  gint i;
-  gdouble *rf, *bf, *gf, *inf;
-  gint rn, bn, gn;
-
-  if (!d->dict && !d->expr)
-    {
-       d->dict = dict_new();
-       if (!d->dict)
-         return;
-
-       d->expr = expr_compile_string(opts[2].val.sval, d->dict);
-       if (!d->expr)
-         {
-           dict_free(d->dict);
-           d->dict = NULL;
-           return;
-         }
-    }
-
-  rf = dict_variable(d->dict, "red");
-  gf = dict_variable(d->dict, "green");
-  bf = dict_variable(d->dict, "blue");
-  inf = dict_variable(d->dict, "index");
-
-  for (i = opts[0].val.ival; i < 255 && i <= opts[1].val.ival; i++)
-    {
-       *inf = ((gdouble)i / 255.0);
-
-       expr_execute(d->expr, d->dict);
-
-       /* Convert rf/bf/gf to realworld values. */
-       rn = (gdouble)(*rf * 255);
-       gn = (gdouble)(*gf * 255);
-       bn = (gdouble)(*bf * 255);
-
-       pn_image_data->cmap[i].r = rn;
-       pn_image_data->cmap[i].g = gn;
-       pn_image_data->cmap[i].b = bn;
-    }
-}
-
-struct pn_actuator_desc builtin_cmap_dynamic =
-{
-  "cmap_dynamic",
-  "Dynamic Colourmap",
-  "Scriptable colourmap modifier.",
-  0, cmap_dynamic_opts,
-  cmap_dynamic_init, cmap_dynamic_cleanup, cmap_dynamic_exec
-};
--- a/src/rovascope/containers.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-
-#include <glib.h>
-
-#include "actuators.h"
-#include "paranormal.h"
-
-/* **************** all containers **************** */
-
-/* Add a actuator to a container (end of list) */
-void
-container_add_actuator (struct pn_actuator *container, struct pn_actuator *a)
-{
-  g_assert (container->desc->flags & ACTUATOR_FLAG_CONTAINER);
-  g_assert (a);
-
-  *((GSList **)container->data) =
-    g_slist_append (*(GSList **)container->data, a);
-}  
-
-void
-container_remove_actuator (struct pn_actuator *container, struct pn_actuator *a)
-{
-  g_assert (container->desc->flags & ACTUATOR_FLAG_CONTAINER);
-  g_assert (a);
-
-  *((GSList **)container->data) =
-    g_slist_remove (*(GSList **)container->data, a);
-} 
-
-/* clear the containee list */
-void
-container_unlink_actuators (struct pn_actuator *container)
-{
-  g_assert (container->desc->flags & ACTUATOR_FLAG_CONTAINER);
-
-  g_slist_free (*(GSList **)container->data);
-  *(GSList **)container->data = NULL;
-}
-
-/* this does NOT free data */
-static void
-container_cleanup (GSList** data)
-{
-  GSList *child;
-
-  for (child = *data; child; child = child->next)
-    destroy_actuator ((struct pn_actuator *) child->data);
-
-  g_slist_free (*data);
-}
-
-/* **************** container_simple **************** */
-static void
-container_simple_init (GSList ***data)
-{
-  *data = g_new0 (GSList *, 1);
-}
-
-static void
-container_simple_cleanup (GSList **data)
-{
-  container_cleanup (data);
-  g_free (data);
-}
-
-static void
-container_simple_exec (const struct pn_actuator_option *opts,
-		     GSList **data)
-{
-  GSList *child;
-
-  for (child = *data; child; child = child->next)
-    exec_actuator ((struct pn_actuator *) child->data);
-}
-
-struct pn_actuator_desc builtin_container_simple =
-{
-  "container_simple",
-  "Simple Container",
-  "A simple (unconditional) container\n\n"
-  "This is usually used as the root actuator of a list",
-  ACTUATOR_FLAG_CONTAINER, NULL,
-  PN_ACTUATOR_INIT_FUNC (container_simple_init),
-  PN_ACTUATOR_CLEANUP_FUNC (container_simple_cleanup),
-  PN_ACTUATOR_EXEC_FUNC (container_simple_exec)
-};
-
-/* **************** container_once **************** */
-struct container_once_data
-{
-  GSList *children; /* This MUST be first! */
-
-  gboolean done;
-};
-
-static void
-container_once_init (struct container_once_data **data)
-{
-  *data = g_new0 (struct container_once_data, 1);
-}
-
-static void
-container_once_cleanup (GSList **data)
-{
-  container_cleanup (data);
-  g_free (data);
-}
-
-static void
-container_once_exec (const struct pn_actuator_option *opts,
-		     struct container_once_data *data)
-{
-  if (! data->done)
-    {
-      GSList *child;
-
-      for (child = data->children; child; child = child->next)
-	exec_actuator ((struct pn_actuator *) child->data);
-
-      data->done = TRUE;
-    }
-}
-
-struct pn_actuator_desc builtin_container_once =
-{
-  "container_once",
-  "Initialization Container",
-  "A container whose contents get executed exactly once.\n\n"
-  "This is often used to set initial graphics states such as the\n"
-  "pixel depth, or to display some text (such as credits)",
-  ACTUATOR_FLAG_CONTAINER, NULL,
-  PN_ACTUATOR_INIT_FUNC (container_once_init),
-  PN_ACTUATOR_CLEANUP_FUNC (container_once_cleanup),
-  PN_ACTUATOR_EXEC_FUNC (container_once_exec)
-};
-
-/* **************** container_cycle ***************** */
-static struct pn_actuator_option_desc container_cycle_opts[] =
-{
-  { "change_interval", "The number of seconds between changing the "
-    "child to be executed", OPT_TYPE_INT, { ival: 20 } },
-  { "beat", "Whether or not the change should only occur on a beat",
-    OPT_TYPE_BOOLEAN, { bval: TRUE } },
-  { NULL }
-};
-
-struct container_cycle_data
-{
-  GSList *children;
-  GSList *current;
-  int last_change;
-};
-
-static void
-container_cycle_init (gpointer *data)
-{
-  *data = g_new0 (struct container_cycle_data, 1);
-}
-
-static void
-container_cycle_cleanup (gpointer data)
-{
-  container_cleanup (data);
-  g_free (data);
-}
-
-static void
-container_cycle_exec (const struct pn_actuator_option *opts,
-		      gpointer data)
-{
-  struct container_cycle_data *cdata = (struct container_cycle_data*)data;
-  int now;
-
-  /*
-   * Change branch if all of the requirements are met for the branch to change.
-   */
-  if ((opts[1].val.bval == TRUE && pn_new_beat != FALSE) || opts[1].val.bval == FALSE)
-    {
-       now = SDL_GetTicks();	
-
-       if (now - cdata->last_change
-           > opts[0].val.ival * 1000)
-         {
-            cdata->last_change = now;
-
-            /* FIXME: add randomization support */
-            if (cdata->current)
-              cdata->current = cdata->current->next;
-         }
-    }
-
-  if (! cdata->current)
-    cdata->current = cdata->children;
-
-  if (cdata->current)
-    exec_actuator ((struct pn_actuator*)cdata->current->data);
-}
-
-struct pn_actuator_desc builtin_container_cycle =
-{
-  "container_cycle",
-  "Branched-execution Container",
-  "A container that alternates which of its children is executed;  it "
-  "can either change on an interval, or only on a beat.",
-  ACTUATOR_FLAG_CONTAINER, container_cycle_opts,
-  container_cycle_init, container_cycle_cleanup, container_cycle_exec
-};
-
-/* **************** container_onbeat **************** */
-static void
-container_onbeat_init (GSList ***data)
-{
-  *data = g_new0 (GSList *, 1);
-}
-
-static void
-container_onbeat_cleanup (GSList **data)
-{
-  container_cleanup (data);
-  g_free (data);
-}
-
-static void
-container_onbeat_exec (const struct pn_actuator_option *opts,
-		     GSList **data)
-{
-  GSList *child;
-
-  if (pn_new_beat == TRUE)
-    {
-      for (child = *data; child; child = child->next)
-        exec_actuator ((struct pn_actuator *) child->data);
-    }
-}
-
-struct pn_actuator_desc builtin_container_onbeat =
-{
-  "container_onbeat",
-  "OnBeat Container",
-  "A simple container which only triggers on a beat.",
-  ACTUATOR_FLAG_CONTAINER, NULL,
-  PN_ACTUATOR_INIT_FUNC (container_onbeat_init),
-  PN_ACTUATOR_CLEANUP_FUNC (container_onbeat_cleanup),
-  PN_ACTUATOR_EXEC_FUNC (container_onbeat_exec)
-};
--- a/src/rovascope/containers.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#ifndef _CONTAINERS_H
-#define _CONTAINERS_H
-
-void container_add_actuator (struct pn_actuator *container, struct pn_actuator *a);
-void container_remove_actuator (struct pn_actuator *container, struct pn_actuator *a);
-void container_unlink_actuators (struct pn_actuator *container);
-
-#endif /* _CONTAINERS_H */
--- a/src/rovascope/drawing.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#include <math.h>
-
-#include "paranormal.h"
-#include "actuators.h"
-#include "pn_utils.h"
-
-extern SDL_Surface *screen;
-
-void
-pn_draw_dot (guint x, guint y, guchar value)
-{
-  if (x > pn_image_data->width || x < 0 || y > pn_image_data->height || y < 0)
-    return;
-
-  pn_image_data->surface[0][PN_IMG_INDEX(x, y)] = value;
-}
-
-void
-pn_draw_line (guint _x0, guint _y0, guint _x1, guint _y1, guchar value)
-{
-  gint x0 = _x0;
-  gint y0 = _y0;
-  gint x1 = _x1;
-  gint y1 = _y1;
-
-  gint dx = x1 - x0;
-  gint dy = y1 - y0;
-
-  pn_draw_dot(x0, y0, value);
-
-  if (dx != 0)
-    {
-      gfloat m = (gfloat) dy / (gfloat) dx;
-      gfloat b = y0 - m * x0;
-
-      dx = (x1 > x0) ? 1 : - 1;
-      while (x0 != x1)
-        {
-          x0 += dx;
-          y0 = m * x0 + b;
-
-          pn_draw_dot(x0, y0, value);
-        }
-    }
-}
--- a/src/rovascope/drawing.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#include <glib.h>
-
-#ifndef PN_DRAWING_H
-#define PN_DRAWING_H
-
-void pn_draw_dot (guint x, guint y, guchar value);
-void pn_draw_line (guint _x0, guint _y0, guint _x1, guint _y1, guchar value);
-
-#endif
--- a/src/rovascope/freq.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <glib.h>
-
-#include "paranormal.h"
-#include "actuators.h"
-#include "pn_utils.h"
-
-/* **************** freq_dots **************** */
-/* FIXME: take this piece of crap out */
-static void
-freq_dots_exec (const struct pn_actuator_option *opts,
-		gpointer data)
-{
-  int i, basex;
-
-  basex = (pn_image_data->width>>1)-128;
-  for (i=basex < 0 ? -basex : 0 ; i < 256; i++)
-    {
-      pn_image_data->surface[0][PN_IMG_INDEX (basex+i, (pn_image_data->height>>1)
-					      - CAP (pn_sound_data->freq_data[0][i], 120))]
-	= 0xff;
-      pn_image_data->surface[0][PN_IMG_INDEX (basex+256-i, (pn_image_data->height>>1)
-					      + CAP (pn_sound_data->freq_data[1][i], 120))]
-	= 0xff;
-    }
-}
-
-struct pn_actuator_desc builtin_freq_dots =
-{
-  "freq_dots",
-  "Frequency Scope",
-  "Draws dots varying vertically with the freqency data.",
-  0, NULL,
-  NULL, NULL, freq_dots_exec
-};
-
-/* **************** freq_drops **************** */
-static void
-freq_drops_exec (const struct pn_actuator_option *opts,
-		gpointer data)
-{
-  int i,j;
-  
-  for (i=0; i<256; i++)
-    for (j=0; j<pn_sound_data->freq_data[0][i]>>3; i++)
-      pn_image_data->surface[0][PN_IMG_INDEX (rand() % pn_image_data->width,
-					      rand() % pn_image_data->height)]
-	= 0xff;
-}
-
-struct pn_actuator_desc builtin_freq_drops =
-{
-  "freq_drops",
-  "Random Dots",
-  "Draws dots at random on the image (louder music = more dots)",
-  0, NULL,
-  NULL, NULL, freq_drops_exec
-};
--- a/src/rovascope/general.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,310 +0,0 @@
-/* FIXME: what to name this file? */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "paranormal.h"
-#include "actuators.h"
-#include "pn_utils.h"
-
-/* **************** general_fade **************** */
-static struct pn_actuator_option_desc general_fade_opts[] =
-{
-  { "amount", "The amount by which the color index of each "
-    "pixel should be decreased by each frame (MAX 255)",
-    OPT_TYPE_INT, { ival: 3 } },
-  { NULL }
-};
-
-static void
-general_fade_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  int amt = opts[0].val.ival > 255 || opts[0].val.ival < 0 ? 3 : opts[0].val.ival;
-  int i, j;
-
-  for (j=0; j<pn_image_data->height; j++)
-    for (i=0; i<pn_image_data->width; i++)
-      pn_image_data->surface[0][PN_IMG_INDEX (i, j)] =
-	CAPLO (pn_image_data->surface[0][PN_IMG_INDEX (i, j)]
-	       - amt, 0);
-}
-
-struct pn_actuator_desc builtin_general_fade =
-{
-  "general_fade", "Fade-out", "Decreases the color index of each pixel",
-  0, general_fade_opts,
-  NULL, NULL, general_fade_exec
-};
-
-/* **************** general_blur **************** */
-/* FIXME: add a variable radius */
-/* FIXME: SPEEEED */
-static void
-general_blur_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  int i,j;
-  register guchar *srcptr = pn_image_data->surface[0];
-  register guchar *destptr = pn_image_data->surface[1];
-  register int sum;
-
-  for (j=0; j<pn_image_data->height; j++)
-    for (i=0; i<pn_image_data->width; i++)
-      {
-	sum = *(srcptr)<<2;
-
-	/* top */
-	if (j > 0)
-	  {
-	    sum += *(srcptr-pn_image_data->width)<<1;
-	    if (i > 0)
-	      sum += *(srcptr-pn_image_data->width-1);
-	    if (i < pn_image_data->width-1)
-	      sum += *(srcptr-pn_image_data->width+1);
-	  }
-	/* bottom */
-	if (j < pn_image_data->height-1)
-	  {
-	    sum += *(srcptr+pn_image_data->width)<<1;
-	    if (i > 0)
-	      sum += *(srcptr+pn_image_data->width-1);
-	    if (i < pn_image_data->width-1)
-	      sum += *(srcptr+pn_image_data->width+1);
-	  }
-	/* left */
-	if (i > 0)
-	  sum += *(srcptr-1)<<1;
-	/* right */
-	if (i < pn_image_data->width-1)
-	  sum += *(srcptr+1)<<1;
-
-	*destptr++ = (guchar)(sum >> 4);
-	srcptr++;
-      }
-
-  pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_general_blur = 
-{
-  "general_blur", "Blur", "A simple 1 pixel radius blur",
-  0, NULL,
-  NULL, NULL, general_blur_exec
-};
-
-/* **************** general_mosaic **************** */
-/* FIXME: add a variable radius */
-/* FIXME: SPEEEED */
-static struct pn_actuator_option_desc general_mosaic_opts[] =
-{
-  { "radius", "The pixel radius that should be used for the effect.",
-    OPT_TYPE_INT, { ival: 6 } },
-  { NULL }
-};
-
-static void
-general_mosaic_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  int i,j;
-  register guchar *srcptr = pn_image_data->surface[0];
-  register guchar *destptr = pn_image_data->surface[1];
-  int radius = opts[0].val.ival > 255 || opts[0].val.ival < 0 ? 6 : opts[0].val.ival;
-
-  for (j=0; j<pn_image_data->height; j += radius)
-    for (i=0; i<pn_image_data->width; i += radius)
-      {
-        int ii = 0, jj = 0;
-        guchar bval = 0;
-
-        /* find the brightest colour */
-        for (jj = 0; jj < radius && (j + jj < pn_image_data->height); jj++)
-          for (ii = 0; ii < radius && (i + ii < pn_image_data->width); ii++)
-            {
-               guchar val = srcptr[PN_IMG_INDEX(i + ii,  j + jj)];
-
-               if (val > bval)
-                 bval = val;
-            }
-
-        for (jj = 0; jj < radius && (j + jj < pn_image_data->height); jj++)
-          for (ii = 0; ii < radius && (i + ii < pn_image_data->width); ii++)
-            {
-               destptr[PN_IMG_INDEX(i + ii, j + jj)] = bval;
-            }
-      }
-
-  pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_general_mosaic = 
-{
-  "general_mosaic", "Mosaic", "A simple mosaic effect.",
-  0, general_mosaic_opts,
-  NULL, NULL, general_mosaic_exec
-};
-
-/* **************** general_clear **************** */
-static void
-general_clear_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-   memset(pn_image_data->surface[0], '\0',
-	  (pn_image_data->height * pn_image_data->width));
-}
-
-struct pn_actuator_desc builtin_general_clear =
-{
-  "general_clear", "Clear Surface", "Clears the surface.",
-  0, NULL,
-  NULL, NULL, general_clear_exec
-};
-
-/* **************** general_noop **************** */
-static void
-general_noop_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  return;
-}
-
-struct pn_actuator_desc builtin_general_noop =
-{
-  "general_noop", "Do Nothing", "Does absolutely nothing.",
-  0, NULL,
-  NULL, NULL, general_noop_exec
-};
-
-/* **************** general_invert **************** */
-static void
-general_invert_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  int i, j;
-
-  for (j=0; j < pn_image_data->height; j++)
-    for (i=0; i < pn_image_data->width; i++)
-      pn_image_data->surface[0][PN_IMG_INDEX (i, j)] =
-	255 - pn_image_data->surface[0][PN_IMG_INDEX (i, j)];
-}
-
-struct pn_actuator_desc builtin_general_invert =
-{
-  "general_invert", "Value Invert", "Performs a value invert.",
-  0, NULL,
-  NULL, NULL, general_invert_exec
-};
-
-/* **************** general_replace **************** */
-static struct pn_actuator_option_desc general_replace_opts[] =
-{
-  { "start", "The beginning colour value that should be replaced by the value of out.",
-    OPT_TYPE_INT, { ival: 250 } },
-  { "end", "The ending colour value that should be replaced by the value of out.",
-    OPT_TYPE_INT, { ival: 255 } },
-  { "out", "The colour value that in is replaced with.",
-    OPT_TYPE_INT, { ival: 0 } },
-  { NULL }
-};
-
-static void
-general_replace_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  register int i, j;
-  register guchar val;
-  guchar begin = opts[0].val.ival > 255 || opts[0].val.ival < 0 ? 250 : opts[0].val.ival;
-  guchar end = opts[1].val.ival > 255 || opts[1].val.ival < 0 ? 255 : opts[1].val.ival;
-  guchar out = opts[2].val.ival > 255 || opts[2].val.ival < 0 ? 0 : opts[2].val.ival;
-
-  for (j=0; j < pn_image_data->height; j++)
-    for (i=0; i < pn_image_data->width; i++)
-      {
-        val = pn_image_data->surface[0][PN_IMG_INDEX (i, j)];
-        if (val >= begin && val <= end)
-          pn_image_data->surface[0][PN_IMG_INDEX (i, j)] = out;
-      }
-}
-
-struct pn_actuator_desc builtin_general_replace =
-{
-  "general_replace", "Value Replace", "Performs a value replace on a range of values.",
-  0, general_replace_opts,
-  NULL, NULL, general_replace_exec
-};
-
-/* **************** general_swap **************** */
-static void
-general_swap_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_general_swap =
-{
-  "general_swap", "Swap Surface", "Swaps the surface.",
-  0, NULL,
-  NULL, NULL, general_swap_exec
-};
-
-/* **************** general_copy **************** */
-static void
-general_copy_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  memcpy(pn_image_data->surface[1], pn_image_data->surface[0], 
-         (pn_image_data->width * pn_image_data->height));
-}
-
-struct pn_actuator_desc builtin_general_copy =
-{
-  "general_copy", "Copy Surface", "Copies the surface to the other surface.",
-  0, NULL,
-  NULL, NULL, general_copy_exec
-};
-
-/* **************** general_flip **************** */
-static struct pn_actuator_option_desc general_flip_opts[] =
-{
-  { "direction", "Negative is horizontal, positive is vertical.",
-    OPT_TYPE_INT, { ival: -1 } },
-  { NULL }
-};
-
-static void
-general_flip_exec (const struct pn_actuator_option *opts,
-	   gpointer data)
-{
-  gint x, y;
-
-  if (opts[0].val.ival < 0)
-    {
-      for (y = 0; y < pn_image_data->height; y++)
-        for (x = 0; x < pn_image_data->width; x++)
-          {
-             pn_image_data->surface[1][PN_IMG_INDEX(pn_image_data->width - x, y)] = 
-               pn_image_data->surface[0][PN_IMG_INDEX(x, y)];
-          }
-    }
-  else
-    {
-      for (y = 0; y < pn_image_data->height; y++)
-        for (x = 0; x < pn_image_data->width; x++)
-          {
-             pn_image_data->surface[1][PN_IMG_INDEX(x, pn_image_data->height - y)] = 
-               pn_image_data->surface[0][PN_IMG_INDEX(x, y)];
-          }
-    }
-
-    pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_general_flip =
-{
-  "general_flip", "Flip Surface", "Flips the surface.",
-  0, general_flip_opts,
-  NULL, NULL, general_flip_exec
-};
--- a/src/rovascope/libcalc/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS_NOINST = libcalc.a
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
-
-LIBADD = $(GTK_LIBS) $(XML_LIBS) $(SDL_LIBS)
-
-SOURCES = dict.c  execute.c  function.c  parser.c  storage.c
-
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) $(SDL_CFLAGS) -I../../intl -I../..
-
-include ../../../mk/objective.mk
-
--- a/src/rovascope/libcalc/calc.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/* calc.h -- an all-in-one include file for libcalc
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
-
-#ifndef Included_CALC_H
-#define Included_CALC_H
-
-#include "dict.h"
-#include "execute.h"
-#include "parser.h"
-#include "storage.h"
-
-#endif /* Included_CALC_H */
--- a/src/rovascope/libcalc/dict.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/* dict.c -- symbol dictionary structures
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
- 
-#define V_SPACE_INIT 8
-#define V_SPACE_INCR 8
- 
-#include <glib.h>
-#include <string.h>
-
-#include "dict.h"
-
-static void more_variables (symbol_dict_t *dict) {
-  var_t *new_var;
-
-  dict->v_space += V_SPACE_INCR;
-
-  new_var = (var_t *)g_malloc (dict->v_space * sizeof(var_t));
-
-  memcpy (new_var, dict->variables, dict->v_count * sizeof(var_t));
-  g_free (dict->variables);
-
-  dict->variables = new_var;
-}
-
-symbol_dict_t *dict_new (void) {
-  symbol_dict_t *dict;
-  
-  dict = (symbol_dict_t *) g_malloc (sizeof(symbol_dict_t));
-
-  /* Allocate space for variables. */
-  dict->v_count = 0;
-  dict->v_space = V_SPACE_INIT;
-  dict->variables = (var_t *)g_malloc (dict->v_space * sizeof(var_t));
-  
-  return dict;
-}
-
-void dict_free (symbol_dict_t *dict) {
-  int i;
-
-  if (!dict)
-    return;
-
-  /* Free memory used by variables. */
-  for (i = 0; i < dict->v_count; i++)
-    g_free (dict->variables[i].name);
-  g_free (dict->variables);
-
-  g_free (dict);
-}
-
-static int dict_define_variable (symbol_dict_t *dict, const char *name) {
-  var_t *var;
-
-  if (dict->v_count >= dict->v_space)
-    more_variables (dict);
-
-  var = &dict->variables[dict->v_count];
-
-  var->value = 0.0;
-  var->name = g_strdup (name);
-
-  return dict->v_count++;
-}
-
-int dict_lookup (symbol_dict_t *dict, const char *name) {
-  int i;
-
-  for (i = 0; i < dict->v_count; i++) {
-    if (strcmp (dict->variables[i].name, name) == 0)
-      return i;
-  }
-  
-  /* Not defined -- define a new variable. */
-  return dict_define_variable (dict, name);
-}
-
-double *dict_variable (symbol_dict_t *dict, const char *var_name) {
-  int id = dict_lookup (dict, var_name);
-  return &dict->variables[id].value;
-}
--- a/src/rovascope/libcalc/dict.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/* dict.h -- symbol dictionary structures
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
-
-#ifndef Included_DICT_H
-#define Included_DICT_H
-
-/* A variable. */
-typedef struct {
-  char *name;
-  double value;
-} var_t;
-
-/* A symbol dictionary. */
-typedef struct {
-  /* Variables. */
-  var_t *variables;
-  int v_count;
-  int v_space;
-} symbol_dict_t;
-
-/* Prototypes. */
-symbol_dict_t *dict_new (void);
-void dict_free (symbol_dict_t *dict);
-
-int dict_lookup (symbol_dict_t *calc, const char *name);
-double* dict_variable (symbol_dict_t *calc, const char *var_name);
-
-#endif /* Included_DICT_H */
--- a/src/rovascope/libcalc/execute.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/* execute.c -- execute precompiled expression expr
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
- 
-#include <glib.h>
-#include <math.h>
- 
-#include "execute.h"
-#include "function.h"
-
-/* Execution stack. */
-
-gboolean check_stack (ex_stack *stack, int depth) {
-  if (stack->sp < depth) {
-    g_warning ("Stack error");
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-void push (ex_stack *stack, double value) {
-  g_assert (stack);
-
-  if (stack->sp < STACK_DEPTH) {
-    stack->value[stack->sp++] = value;
-  } else {
-    g_warning ("Stack overflow");
-  }
-}
-
-double pop (ex_stack *stack) {
-  g_assert (stack);
-
-  if (stack->sp > 0) {
-    return stack->value[--stack->sp];
-  } else {
-    g_warning ("Stack error (stack empty)");
-    return 0.0;
-  }
-}
-
-/* */
-
-void expr_execute (expression_t *expr, symbol_dict_t *dict) {
-  char op, *str = expr->data->str;
-  ex_stack stack = { 0, { 0.0 }};
-
-  while ((op = *str++)) {
-    switch (op) { 
-    case 'l': /* Load a variable. */
-      push (&stack, dict->variables[load_int (str)].value);
-      str += sizeof (int);
-      break;
-      
-    case 's': /* Store to a variable. */
-      dict->variables[load_int (str)].value = pop (&stack);
-      str += sizeof (int);
-      break;
-   
-    case 'f': /* Call a function. */
-      function_call (load_int (str), &stack);
-      str += sizeof (int);
-      break;
-      
-    case 'c': /* Load a constant. */
-      push (&stack, load_double (str));
-      str += sizeof (double);
-      break;
-
-    case 'n': /* Do a negation. */
-      push (&stack, -pop (&stack));
-      break;
-
-    case '+': /* Do an addition. */
-      push (&stack, pop (&stack) + pop (&stack));
-      break;
-    case '-': /* Do a subtraction. */
-      push (&stack, pop (&stack) - pop (&stack));
-      break;
-    case '*': /* Do a multiplication. */
-      push (&stack, pop (&stack) * pop (&stack));
-      break;
-    case '/': /* Do a division. */
-      if (check_stack (&stack, 2)) {
-        double y = stack.value[stack.sp - 2] / stack.value[stack.sp - 1];
-	stack.sp -= 2;
-	push (&stack, y);
-      }
-      break;
-    case '^': /* Do an exponentiation. */
-      if (check_stack (&stack, 2)) {
-        double y = pow (stack.value[stack.sp - 2], stack.value[stack.sp - 1]);
-	stack.sp -= 2;
-	push (&stack, y);
-      }
-      break;
-
-    default:
-      g_warning ("Invalid opcode: %c", op);
-      return;
-    }
-  }
-}
--- a/src/rovascope/libcalc/execute.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/* execute.h -- execute precompiled expression code
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
-
-#ifndef Included_EXECUTE_H
-#define Included_EXECUTE_H
-
-#include <glib.h>
-
-#include "dict.h"
-#include "storage.h"
-
-/* Execution stack. */
-
-typedef struct { 
-#define STACK_DEPTH 64
-  int sp;			/* stack pointer */
-  double value[STACK_DEPTH];
-} ex_stack;
-
-/* Prototypes. */
-
-gboolean check_stack (ex_stack *stack, int depth);
-void push (ex_stack *stack, double value);
-double pop (ex_stack *stack);
-
-void expr_execute (expression_t *expr, symbol_dict_t *dict);
-
-#endif /* Included_EXECUTE_H */
--- a/src/rovascope/libcalc/function.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/* function.c --
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
- 
-#include <glib.h>
-#include <math.h>
-#include <string.h>
- 
-#include "function.h"
-
-/* Function pointer type. */
-typedef struct {
-  char *name;
-  double (*funcptr)(ex_stack *stack);
-} func_t;
-
-/* */
-
-static double f_log (ex_stack *stack) {
-  return log (pop (stack));
-}
-
-static double f_sin (ex_stack *stack) {
-  return sin (pop (stack));
-}
-
-static double f_cos (ex_stack *stack) {
-  return cos (pop (stack));
-}
-
-static double f_tan (ex_stack *stack) {
-  return tan (pop (stack));
-}
-
-static double f_asin (ex_stack *stack) {
-  return asin (pop (stack));
-}
-
-static double f_acos (ex_stack *stack) {
-  return acos (pop (stack));
-}
-
-static double f_atan (ex_stack *stack) {
-  return atan (pop (stack));
-}
-
-static double f_if (ex_stack *stack) {
-  double a = pop (stack);
-  double b = pop (stack);
-  return (pop (stack) != 0.0) ? a : b;
-}
-
-static double f_div (ex_stack *stack) {
-  int y = (int)pop (stack);
-  int x = (int)pop (stack);
-  return (y == 0) ? 0 : (x / y);
-}
-
-/* */
-
-static const func_t init[] = {
-  { "sin", f_sin },
-  { "cos", f_cos },
-  { "tan", f_tan },
-  { "asin", f_asin },
-  { "acos", f_acos },
-  { "atan", f_atan },
-  { "log", f_log },
-  { "if", f_if },
-  { "div", f_div }
-};
-
-int function_lookup (const char *name) {
-  int i;
-
-  for (i = 0; i < sizeof (init) / sizeof (init[0]); i++)
-    if (strcmp (init[i].name, name) == 0)
-      return i;
-
-  g_warning ("Unknown function: %s\n", name);
-  return -1;
-}
-
-void function_call (int func_id, ex_stack *stack) {
-  g_assert (func_id >= 0);
-  g_assert (func_id < sizeof (init) / sizeof (init[0]));
-
-  push (stack, (*init[func_id].funcptr)(stack));
-}
--- a/src/rovascope/libcalc/function.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/* function.h --
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
-
-#ifndef Included_FUNCTION
-#define Included_FUNCTION
-
-#include "execute.h"
-
-/* Prototypes. */
-
-int function_lookup (const char *name);
-void function_call (int func_id, ex_stack *stack);
-
-#endif /* Included_FUNCTION */
--- a/src/rovascope/libcalc/parser.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1521 +0,0 @@
-/* A Bison parser, made by GNU Bison 1.875d.  */
-
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-
-   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, 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., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* Written by Richard Stallman by simplifying the original so called
-   ``semantic'' parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 1
-
-/* Using locations.  */
-#define YYLSP_NEEDED 0
-
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     NAME = 258,
-     NUMBER = 259,
-     NEG = 260
-   };
-#endif
-#define NAME 258
-#define NUMBER 259
-#define NEG 260
-
-
-
-
-/* Copy the first part of user declarations.  */
-#line 26 "parser.y"
-
-#include <ctype.h>
-#include <glib.h>
-#include <locale.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "dict.h"
-#include "execute.h"
-#include "function.h"
-#include "parser.h"
-#include "storage.h"
-
-#define YYPARSE_PARAM yyparam
-#define YYLEX_PARAM yyparam
-
-static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict,
-				  char *str);
-
-#define GENERATE(str) if (!expr_add_compile (((parser_control *)yyparam)->expr, \
-				        ((parser_control *)yyparam)->dict, str)) \
-                   YYABORT;
-
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 54 "parser.y"
-typedef union YYSTYPE {
-char *s_value;
-char c_value;
-double d_value;
-int i_value;
-} YYSTYPE;
-/* Line 191 of yacc.c.  */
-#line 118 "parser.c"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-
-
-/* Copy the second part of user declarations.  */
-
-
-/* Line 214 of yacc.c.  */
-#line 130 "parser.c"
-
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
-
-# ifndef YYFREE
-#  define YYFREE free
-# endif
-# ifndef YYMALLOC
-#  define YYMALLOC malloc
-# endif
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-# ifdef YYSTACK_USE_ALLOCA
-#  if YYSTACK_USE_ALLOCA
-#   define YYSTACK_ALLOC alloca
-#  endif
-# else
-#  if defined (alloca) || defined (_ALLOCA_H)
-#   define YYSTACK_ALLOC alloca
-#  else
-#   ifdef __GNUC__
-#    define YYSTACK_ALLOC __builtin_alloca
-#   endif
-#  endif
-# endif
-
-# ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning. */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-#  if defined (__STDC__) || defined (__cplusplus)
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   define YYSIZE_T size_t
-#  endif
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
-# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
-
-
-#if (! defined (yyoverflow) \
-     && (! defined (__cplusplus) \
-	 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-  short int yyss;
-  YYSTYPE yyvs;
-  };
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-# define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (short int) + sizeof (YYSTYPE))			\
-      + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined (__GNUC__) && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)		\
-      do					\
-	{					\
-	  register YYSIZE_T yyi;		\
-	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];		\
-	}					\
-      while (0)
-#  endif
-# endif
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack)					\
-    do									\
-      {									\
-	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack, Stack, yysize);				\
-	Stack = &yyptr->Stack;						\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (0)
-
-#endif
-
-#if defined (__STDC__) || defined (__cplusplus)
-   typedef signed char yysigned_char;
-#else
-   typedef short int yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL  2
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   65
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS  18
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS  5
-/* YYNRULES -- Number of rules. */
-#define YYNRULES  22
-/* YYNRULES -- Number of states. */
-#define YYNSTATES  37
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   260
-
-#define YYTRANSLATE(YYX) 						\
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const unsigned char yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-      14,    15,     8,     7,    13,     6,     2,     9,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,    12,
-      17,     5,    16,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,    11,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-      10
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const unsigned char yyprhs[] =
-{
-       0,     0,     3,     4,     7,     8,    10,    13,    16,    18,
-      22,    24,    26,    30,    35,    39,    43,    47,    51,    55,
-      59,    62,    66
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
-{
-      19,     0,    -1,    -1,    19,    20,    -1,    -1,    22,    -1,
-      20,    12,    -1,     1,    12,    -1,    22,    -1,    21,    13,
-      22,    -1,     4,    -1,     3,    -1,     3,     5,    22,    -1,
-       3,    14,    21,    15,    -1,    22,    16,    22,    -1,    22,
-      17,    22,    -1,    22,     7,    22,    -1,    22,     6,    22,
-      -1,    22,     8,    22,    -1,    22,     9,    22,    -1,     6,
-      22,    -1,    22,    11,    22,    -1,    14,    22,    15,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const unsigned char yyrline[] =
-{
-       0,    76,    76,    77,    81,    82,    84,    85,    90,    93,
-      98,   104,   110,   116,   123,   125,   128,   130,   132,   134,
-     136,   138,   140
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
-  "$end", "error", "$undefined", "NAME", "NUMBER", "'='", "'-'", "'+'",
-  "'*'", "'/'", "NEG", "'^'", "';'", "','", "'('", "')'", "'>'", "'<'",
-  "$accept", "input", "expression_list", "argument_list", "expression", 0
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
-static const unsigned short int yytoknum[] =
-{
-       0,   256,   257,   258,   259,    61,    45,    43,    42,    47,
-     260,    94,    59,    44,    40,    41,    62,    60
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const unsigned char yyr1[] =
-{
-       0,    18,    19,    19,    20,    20,    20,    20,    21,    21,
-      22,    22,    22,    22,    22,    22,    22,    22,    22,    22,
-      22,    22,    22
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const unsigned char yyr2[] =
-{
-       0,     2,     0,     2,     0,     1,     2,     2,     1,     3,
-       1,     1,     3,     4,     3,     3,     3,     3,     3,     3,
-       2,     3,     3
-};
-
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const unsigned char yydefact[] =
-{
-       2,     0,     1,     0,    11,    10,     0,     0,     3,     5,
-       7,     0,     0,    20,     0,     6,     0,     0,     0,     0,
-       0,     0,     0,    12,     0,     8,    22,    17,    16,    18,
-      19,    21,    14,    15,     0,    13,     9
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
-{
-      -1,     1,     8,    24,     9
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -10
-static const yysigned_char yypact[] =
-{
-     -10,    17,   -10,    -8,    22,   -10,    47,    47,    -3,    38,
-     -10,    47,    47,    -9,    26,   -10,    47,    47,    47,    47,
-      47,    47,    47,    38,     9,    38,   -10,    48,    48,    -9,
-      -9,    -9,    38,    38,    47,   -10,    38
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yysigned_char yypgoto[] =
-{
-     -10,   -10,   -10,   -10,    -6
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -5
-static const yysigned_char yytable[] =
-{
-      13,    14,    20,     0,    10,    23,    25,    21,    22,    15,
-      27,    28,    29,    30,    31,    32,    33,     2,     3,     0,
-       4,     5,    34,     6,    35,     0,     0,    11,    36,    -4,
-       0,     7,    16,    17,    18,    19,    12,    20,     0,     0,
-       0,    26,    21,    22,    16,    17,    18,    19,     0,    20,
-       4,     5,     0,     6,    21,    22,    18,    19,     0,    20,
-       0,     7,     0,     0,    21,    22
-};
-
-static const yysigned_char yycheck[] =
-{
-       6,     7,    11,    -1,    12,    11,    12,    16,    17,    12,
-      16,    17,    18,    19,    20,    21,    22,     0,     1,    -1,
-       3,     4,    13,     6,    15,    -1,    -1,     5,    34,    12,
-      -1,    14,     6,     7,     8,     9,    14,    11,    -1,    -1,
-      -1,    15,    16,    17,     6,     7,     8,     9,    -1,    11,
-       3,     4,    -1,     6,    16,    17,     8,     9,    -1,    11,
-      -1,    14,    -1,    -1,    16,    17
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const unsigned char yystos[] =
-{
-       0,    19,     0,     1,     3,     4,     6,    14,    20,    22,
-      12,     5,    14,    22,    22,    12,     6,     7,     8,     9,
-      11,    16,    17,    22,    21,    22,    15,    22,    22,    22,
-      22,    22,    22,    22,    13,    15,    22
-};
-
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		(-2)
-#define YYEOF		0
-
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT		goto yyabortlab
-#define YYERROR		goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-
-#define YYFAIL		goto yyerrlab
-
-#define YYRECOVERING()  (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)					\
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    {								\
-      yychar = (Token);						\
-      yylval = (Value);						\
-      yytoken = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
-      goto yybackup;						\
-    }								\
-  else								\
-    { 								\
-      yyerror ("syntax error: cannot back up");\
-      YYERROR;							\
-    }								\
-while (0)
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
-   are run).  */
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)		\
-   ((Current).first_line   = (Rhs)[1].first_line,	\
-    (Current).first_column = (Rhs)[1].first_column,	\
-    (Current).last_line    = (Rhs)[N].last_line,	\
-    (Current).last_column  = (Rhs)[N].last_column)
-#endif
-
-/* YYLEX -- calling `yylex' with the right arguments.  */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval)
-#endif
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)			\
-do {						\
-  if (yydebug)					\
-    YYFPRINTF Args;				\
-} while (0)
-
-# define YYDSYMPRINT(Args)			\
-do {						\
-  if (yydebug)					\
-    yysymprint Args;				\
-} while (0)
-
-# define YYDSYMPRINTF(Title, Token, Value, Location)		\
-do {								\
-  if (yydebug)							\
-    {								\
-      YYFPRINTF (stderr, "%s ", Title);				\
-      yysymprint (stderr, 					\
-                  Token, Value);	\
-      YYFPRINTF (stderr, "\n");					\
-    }								\
-} while (0)
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_stack_print (short int *bottom, short int *top)
-#else
-static void
-yy_stack_print (bottom, top)
-    short int *bottom;
-    short int *top;
-#endif
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (/* Nothing. */; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
-  if (yydebug)							\
-    yy_stack_print ((Bottom), (Top));				\
-} while (0)
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_reduce_print (int yyrule)
-#else
-static void
-yy_reduce_print (yyrule)
-    int yyrule;
-#endif
-{
-  int yyi;
-  unsigned int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
-             yyrule - 1, yylno);
-  /* Print the symbols being reduced, and their result.  */
-  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
-    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
-  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
-}
-
-# define YY_REDUCE_PRINT(Rule)		\
-do {					\
-  if (yydebug)				\
-    yy_reduce_print (Rule);		\
-} while (0)
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef	YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined (__GLIBC__) && defined (_STRING_H)
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-static YYSIZE_T
-#   if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-#   else
-yystrlen (yystr)
-     const char *yystr;
-#   endif
-{
-  register const char *yys = yystr;
-
-  while (*yys++ != '\0')
-    continue;
-
-  return yys - yystr - 1;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-static char *
-#   if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-#   else
-yystpcpy (yydest, yysrc)
-     char *yydest;
-     const char *yysrc;
-#   endif
-{
-  register char *yyd = yydest;
-  register const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
-
-  return yyd - 1;
-}
-#  endif
-# endif
-
-#endif /* !YYERROR_VERBOSE */
-
-
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
-{
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
-
-  if (yytype < YYNTOKENS)
-    {
-      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
-      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
-    }
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-  switch (yytype)
-    {
-      default:
-        break;
-    }
-  YYFPRINTF (yyoutput, ")");
-}
-
-#endif /* ! YYDEBUG */
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yytype, yyvaluep)
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
-{
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
-
-  switch (yytype)
-    {
-
-      default:
-        break;
-    }
-}
-
-
-/* Prevent warnings from -Wmissing-prototypes.  */
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM);
-# else
-int yyparse ();
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-
-
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
-  void *YYPARSE_PARAM;
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int
-yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
-{
-  /* The lookahead symbol.  */
-int yychar;
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far.  */
-int yynerrs;
-
-  register int yystate;
-  register int yyn;
-  int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
-  /* Lookahead token as an internal (translated) token number.  */
-  int yytoken = 0;
-
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
-
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
-
-  /* The state stack.  */
-  short int yyssa[YYINITDEPTH];
-  short int *yyss = yyssa;
-  register short int *yyssp;
-
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  register YYSTYPE *yyvsp;
-
-
-
-#define YYPOPSTACK   (yyvsp--, yyssp--)
-
-  YYSIZE_T yystacksize = YYINITDEPTH;
-
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-
-  /* When reducing, the number of symbols on the RHS of the reduced
-     rule.  */
-  int yylen;
-
-  YYDPRINTF ((stderr, "Starting parse\n"));
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss;
-  yyvsp = yyvs;
-
-
-  goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
-`------------------------------------------------------------*/
- yynewstate:
-  /* In all cases, when you get here, the value and location stacks
-     have just been pushed. so pushing a state here evens the stacks.
-     */
-  yyssp++;
-
- yysetstate:
-  *yyssp = yystate;
-
-  if (yyss + yystacksize - 1 <= yyssp)
-    {
-      /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      {
-	/* Give user a chance to reallocate the stack. Use copies of
-	   these so that the &'s don't force the real ones into
-	   memory.  */
-	YYSTYPE *yyvs1 = yyvs;
-	short int *yyss1 = yyss;
-
-
-	/* Each stack pointer address is followed by the size of the
-	   data in use in that stack, in bytes.  This used to be a
-	   conditional around just the two extra args, but that might
-	   be undefined if yyoverflow is a macro.  */
-	yyoverflow ("parser stack overflow",
-		    &yyss1, yysize * sizeof (*yyssp),
-		    &yyvs1, yysize * sizeof (*yyvsp),
-
-		    &yystacksize);
-
-	yyss = yyss1;
-	yyvs = yyvs1;
-      }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyoverflowlab;
-# else
-      /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
-	goto yyoverflowlab;
-      yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
-	yystacksize = YYMAXDEPTH;
-
-      {
-	short int *yyss1 = yyss;
-	union yyalloc *yyptr =
-	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-	if (! yyptr)
-	  goto yyoverflowlab;
-	YYSTACK_RELOCATE (yyss);
-	YYSTACK_RELOCATE (yyvs);
-
-#  undef YYSTACK_RELOCATE
-	if (yyss1 != yyssa)
-	  YYSTACK_FREE (yyss1);
-      }
-# endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + yysize - 1;
-      yyvsp = yyvs + yysize - 1;
-
-
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-		  (unsigned long int) yystacksize));
-
-      if (yyss + yystacksize - 1 <= yyssp)
-	YYABORT;
-    }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
-  goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-/* Do appropriate processing given the current state.  */
-/* Read a lookahead token if we need one and don't already have one.  */
-/* yyresume: */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-
-  yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-  if (yychar == YYEMPTY)
-    {
-      YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
-    }
-
-  if (yychar <= YYEOF)
-    {
-      yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, "Now at end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (yychar);
-      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-    goto yydefault;
-  yyn = yytable[yyn];
-  if (yyn <= 0)
-    {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-	goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Shift the lookahead token.  */
-  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
-
-  /* Discard the token being shifted unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  *++yyvsp = yylval;
-
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-  goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-  /* yyn is the number of a rule to reduce with.  */
-  yylen = yyr2[yyn];
-
-  /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
-
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
-     users should not rely upon it.  Assigning to YYVAL
-     unconditionally makes the parser a bit smaller, and it avoids a
-     GCC warning that YYVAL may be used uninitialized.  */
-  yyval = yyvsp[1-yylen];
-
-
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
-    {
-        case 5:
-#line 83 "parser.y"
-    { ;}
-    break;
-
-  case 7:
-#line 86 "parser.y"
-    { yyerrok; ;}
-    break;
-
-  case 8:
-#line 91 "parser.y"
-    {
-                            ;}
-    break;
-
-  case 9:
-#line 94 "parser.y"
-    {
-                            ;}
-    break;
-
-  case 10:
-#line 99 "parser.y"
-    { 
-                              char *buf = g_strdup_printf ("c%f:", yyvsp[0].d_value);
-                              GENERATE (buf); 
-                              g_free (buf);
-                            ;}
-    break;
-
-  case 11:
-#line 105 "parser.y"
-    { 
-                              char *buf = g_strdup_printf ("l%s:", yyvsp[0].s_value);
-                              GENERATE (buf); 
-                              g_free (buf);
-                            ;}
-    break;
-
-  case 12:
-#line 111 "parser.y"
-    { 
-                              char *buf = g_strdup_printf ("s%s:", yyvsp[-2].s_value);
-                              GENERATE (buf); 
-                              g_free (buf);
-                            ;}
-    break;
-
-  case 13:
-#line 117 "parser.y"
-    {
-                              char *buf = g_strdup_printf ("f%s:", yyvsp[-3].s_value);
-                              GENERATE (buf); 
-                              g_free (buf);
-                            ;}
-    break;
-
-  case 14:
-#line 124 "parser.y"
-    { GENERATE (">"); ;}
-    break;
-
-  case 15:
-#line 126 "parser.y"
-    { GENERATE ("<"); ;}
-    break;
-
-  case 16:
-#line 129 "parser.y"
-    { GENERATE ("+"); ;}
-    break;
-
-  case 17:
-#line 131 "parser.y"
-    { GENERATE ("-"); ;}
-    break;
-
-  case 18:
-#line 133 "parser.y"
-    { GENERATE ("*"); ;}
-    break;
-
-  case 19:
-#line 135 "parser.y"
-    { GENERATE ("/"); ;}
-    break;
-
-  case 20:
-#line 137 "parser.y"
-    { GENERATE ("n"); ;}
-    break;
-
-  case 21:
-#line 139 "parser.y"
-    { GENERATE ("^"); ;}
-    break;
-
-  case 22:
-#line 141 "parser.y"
-    { ;}
-    break;
-
-
-    }
-
-/* Line 1010 of yacc.c.  */
-#line 1140 "parser.c"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-
-
-  YY_STACK_PRINT (yyss, yyssp);
-
-  *++yyvsp = yyval;
-
-
-  /* Now `shift' the result of the reduction.  Determine what state
-     that goes to, based on the state we popped back to and the rule
-     number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
-
-  goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
-  /* If not already recovering from an error, report this error.  */
-  if (!yyerrstatus)
-    {
-      ++yynerrs;
-#if YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (YYPACT_NINF < yyn && yyn < YYLAST)
-	{
-	  YYSIZE_T yysize = 0;
-	  int yytype = YYTRANSLATE (yychar);
-	  const char* yyprefix;
-	  char *yymsg;
-	  int yyx;
-
-	  /* Start YYX at -YYN if negative to avoid negative indexes in
-	     YYCHECK.  */
-	  int yyxbegin = yyn < 0 ? -yyn : 0;
-
-	  /* Stay within bounds of both yycheck and yytname.  */
-	  int yychecklim = YYLAST - yyn;
-	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-	  int yycount = 0;
-
-	  yyprefix = ", expecting ";
-	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-	      {
-		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
-		yycount += 1;
-		if (yycount == 5)
-		  {
-		    yysize = 0;
-		    break;
-		  }
-	      }
-	  yysize += (sizeof ("syntax error, unexpected ")
-		     + yystrlen (yytname[yytype]));
-	  yymsg = (char *) YYSTACK_ALLOC (yysize);
-	  if (yymsg != 0)
-	    {
-	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
-	      yyp = yystpcpy (yyp, yytname[yytype]);
-
-	      if (yycount < 5)
-		{
-		  yyprefix = ", expecting ";
-		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-		      {
-			yyp = yystpcpy (yyp, yyprefix);
-			yyp = yystpcpy (yyp, yytname[yyx]);
-			yyprefix = " or ";
-		      }
-		}
-	      yyerror (yymsg);
-	      YYSTACK_FREE (yymsg);
-	    }
-	  else
-	    yyerror ("syntax error; also virtual memory exhausted");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror ("syntax error");
-    }
-
-
-
-  if (yyerrstatus == 3)
-    {
-      /* If just tried and failed to reuse lookahead token after an
-	 error, discard it.  */
-
-      if (yychar <= YYEOF)
-        {
-          /* If at end of input, pop the error token,
-	     then the rest of the stack, then return failure.  */
-	  if (yychar == YYEOF)
-	     for (;;)
-	       {
-		 YYPOPSTACK;
-		 if (yyssp == yyss)
-		   YYABORT;
-		 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
-		 yydestruct (yystos[*yyssp], yyvsp);
-	       }
-        }
-      else
-	{
-	  YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
-	  yydestruct (yytoken, &yylval);
-	  yychar = YYEMPTY;
-
-	}
-    }
-
-  /* Else will try to reuse lookahead token after shifting the error
-     token.  */
-  goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-#ifdef __GNUC__
-  /* Pacify GCC when the user code never invokes YYERROR and the label
-     yyerrorlab therefore never appears in user code.  */
-  if (0)
-     goto yyerrorlab;
-#endif
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-  yystate = *yyssp;
-  goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
-
-  for (;;)
-    {
-      yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
-	{
-	  yyn += YYTERROR;
-	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-	    {
-	      yyn = yytable[yyn];
-	      if (0 < yyn)
-		break;
-	    }
-	}
-
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-	YYABORT;
-
-      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
-      yydestruct (yystos[yystate], yyvsp);
-      YYPOPSTACK;
-      yystate = *yyssp;
-      YY_STACK_PRINT (yyss, yyssp);
-    }
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  YYDPRINTF ((stderr, "Shifting error token, "));
-
-  *++yyvsp = yylval;
-
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-  yyresult = 0;
-  goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-  yyresult = 1;
-  goto yyreturn;
-
-#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here.  |
-`----------------------------------------------*/
-yyoverflowlab:
-  yyerror ("parser stack overflow");
-  yyresult = 2;
-  /* Fall through.  */
-#endif
-
-yyreturn:
-#ifndef yyoverflow
-  if (yyss != yyssa)
-    YYSTACK_FREE (yyss);
-#endif
-  return yyresult;
-}
-
-
-#line 144 "parser.y"
-
-/* End of grammar */
-
-/* Called by yyparse on error. */
-int yyerror (char *s) {
-  /* Ignore errors, just print a warning. */
-  g_warning ("%s\n", s);
-  return 0;
-}
-
-int yylex (YYSTYPE *yylval, void *yyparam) {
-  int c;
-  parser_control *pc = (parser_control *) yyparam;
-  
-  /* Ignore whitespace, get first nonwhite character. */
-  while ((c = vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n');
-  
-  /* End of input ? */
-  if (c == EOF)
-    return 0;
-
-  /* Char starts a number => parse the number. */
-  if (isdigit (c)) {
-    vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */
-    {
-      char *old_locale, *saved_locale;
-
-      old_locale = setlocale (LC_ALL, NULL);
-      saved_locale = g_strdup (old_locale);
-      setlocale (LC_ALL, "C");
-      sscanf (((VFSBuffer *)(pc->input->handle))->iter, "%lf", &yylval->d_value);
-
-      while (isdigit(c) || c == '.')
-      {
-        c = vfs_getc(pc->input);
-      }
-
-      vfs_fseek(pc->input, -1, SEEK_CUR);
-
-      setlocale (LC_ALL, saved_locale);
-      g_free (saved_locale);
-    }
-    return NUMBER;
-  }
-     
-  /* Char starts an identifier => read the name. */
-  if (isalpha (c)) {
-    GString *sym_name;
-
-    sym_name = g_string_new (NULL);
-    
-    do {
-      sym_name = g_string_append_c (sym_name, c);
-
-      /* Get another character. */
-      c = vfs_getc (pc->input);
-    } while (c != EOF && isalnum (c));
-    
-    vfs_fseek (pc->input, -1, SEEK_CUR);
-
-    yylval->s_value = sym_name->str;
-    
-    g_string_free (sym_name, FALSE);
-    
-    return NAME;
-  }
-
-  /* Any other character is a token by itself. */
-  return c;
-}
-
-static int load_name (char *str, char **name) {
-  int count = 0;
-  GString *new = g_string_new (NULL);
-
-  while (*str != 0 && *str != ':') {
-    g_string_append_c (new, *str++);
-    count++;
-  }
-
-  *name = new->str;
-  g_string_free (new, FALSE);
-
-  return count;
-}
-
-static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict, 
-				  char *str) {
-  char op;
-  double dval;
-  int i;
-  char *name;
-
-  while ((op = *str++)) {
-    switch (op) {
-    case 'c':			/* A constant. */
-      store_byte (expr, 'c');
-      sscanf (str, "%lf%n", &dval, &i);
-      str += i;
-      store_double (expr, dval);
-      str++;			/* Skip ';' */
-      break;
-
-    case 'f':			/* A function call. */
-      store_byte (expr, 'f');
-      str += load_name (str, &name);
-      i = function_lookup (name);
-      if (i < 0) return FALSE;	/* Fail on error. */
-      store_int (expr, i);
-      g_free (name);
-      str++;			/* Skip ';' */
-      break;
-
-    case 'l':			/* Load a variable. */
-    case 's':			/* Store a variable. */
-      store_byte (expr, op);
-      str += load_name (str, &name);
-      i = dict_lookup (dict, name);
-      store_int (expr, i);
-      g_free (name);
-      str++;			/* Skip ';' */
-      break;
-
-    default:			/* Copy verbatim. */
-      store_byte (expr, op);
-      break;
-    }
-  }
-
-  return TRUE;
-}
-     
-expression_t *expr_compile_string (const char* str, symbol_dict_t *dict)
-{
-  parser_control pc;
-  VFSFile *stream;
-
-  g_return_val_if_fail(str != NULL && dict != NULL, NULL);
-
-  stream = vfs_buffer_new_from_string ( (char *) str );
-
-  pc.input = stream;
-  pc.expr = expr_new ();
-  pc.dict = dict;
-
-  if (yyparse (&pc) != 0) {
-    /* Check for error. */
-    expr_free (pc.expr);
-    pc.expr = NULL;
-  }
-
-  vfs_fclose (stream);
-
-  return pc.expr;
-}
-
-
--- a/src/rovascope/libcalc/parser.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/* parser.h -- header file for libexp
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
-
-#ifndef Included_PARSER_H
-#define Included_PARSER_H
-
-#include <glib.h>
-#include <stdio.h>
-#include <audacious/vfs.h>
-#include <audacious/vfs_buffer.h>
-
-#include "execute.h"
-
-/* Structure passed do yyparse. */
-typedef struct {
-  VFSFile *input;
-  expression_t *expr;
-  symbol_dict_t *dict;
-} parser_control;
-
-/* Prototypes. */
-expression_t *expr_compile_string (const char *str, symbol_dict_t *dict);
-
-#endif /* Included_PARSER_H */
--- a/src/rovascope/libcalc/parser.yacc	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,298 +0,0 @@
-/* parser.y -- Bison parser for libexp
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
-
-/* suppress conflict warnings */
-%expect 37
-
-/* C declarations. */
-%{
-#include <ctype.h>
-#include <glib.h>
-#include <locale.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "dict.h"
-#include "execute.h"
-#include "function.h"
-#include "parser.h"
-#include "storage.h"
-
-#define YYPARSE_PARAM yyparam
-#define YYLEX_PARAM yyparam
-
-static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict,
-				  char *str);
-
-#define GENERATE(str) if (!expr_add_compile (((parser_control *)yyparam)->expr, \
-				        ((parser_control *)yyparam)->dict, str)) \
-                   YYABORT;
-%}
-
-%pure_parser
-     
-/* Data types. */
-%union {
-char *s_value;
-char c_value;
-double d_value;
-int i_value;
-}
-
-/* Terminal symbols. */     
-%token <s_value> NAME
-%token <d_value> NUMBER
-
-/* Precedence rules. */     
-%right '='
-%left '-' '+'
-%left '*' '/'
-%left NEG
-%right '^'
-     
-/* Grammar follows */
-%%
-
-/* Input consits of a (possibly empty) list of expressions. */
-input:			/* empty */
-			| input expression_list
-;
-
-/* expression_list is a ';' separated list of expressions. */
-expression_list:	/* empty */
-    			| expression
-			    { } 
-                        | expression_list ';'
-    			| error ';'	
-			    { yyerrok; }
-
-/* argument list is a comma separated list od expressions */
-argument_list:
-			expression
-                            {
-                            }
-                        | argument_list ',' expression
-                            {
-                            }
-     
-/* expression is a C-like expression. */
-expression:		NUMBER
-			    { 
-                              char *buf = g_strdup_printf ("c%f:", $1);
-                              GENERATE (buf); 
-                              g_free (buf);
-                            }
-		        | NAME
-			    { 
-                              char *buf = g_strdup_printf ("l%s:", $1);
-                              GENERATE (buf); 
-                              g_free (buf);
-                            }
-    			| NAME '=' expression
-			    { 
-                              char *buf = g_strdup_printf ("s%s:", $1);
-                              GENERATE (buf); 
-                              g_free (buf);
-                            }
-                        | NAME '(' argument_list ')'
-                            {
-                              char *buf = g_strdup_printf ("f%s:", $1);
-                              GENERATE (buf); 
-                              g_free (buf);
-                            }
-
-			| expression '>' expression
-			    { GENERATE (">"); }
-			| expression '<' expression
-			    { GENERATE ("<"); }
-
-			| expression '+' expression
-			    { GENERATE ("+"); }
-			| expression '-' expression
-			    { GENERATE ("-"); }
-			| expression '*' expression
-			    { GENERATE ("*"); }
-			| expression '/' expression
-			    { GENERATE ("/"); }
-			| '-' expression %prec NEG
-			    { GENERATE ("n"); }
-			| expression '^' expression
-			    { GENERATE ("^"); }
-			| '(' expression ')'
-			    { }
-;
-
-%%
-/* End of grammar */
-
-/* Called by yyparse on error. */
-int yyerror (char *s) {
-  /* Ignore errors, just print a warning. */
-  g_warning ("%s\n", s);
-  return 0;
-}
-
-int yylex (YYSTYPE *yylval, void *yyparam) {
-  int c;
-  parser_control *pc = (parser_control *) yyparam;
-  
-  /* Ignore whitespace, get first nonwhite character. */
-  while ((c = vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n');
-  
-  /* End of input ? */
-  if (c == EOF)
-    return 0;
-
-  /* Char starts a number => parse the number. */
-  if (isdigit (c)) {
-    vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */
-    {
-      char *old_locale, *saved_locale;
-
-      old_locale = setlocale (LC_ALL, NULL);
-      saved_locale = g_strdup (old_locale);
-      setlocale (LC_ALL, "C");
-      sscanf (((VFSBuffer *)(pc->input->handle))->iter, "%lf", &yylval->d_value);
-
-      while (isdigit(c) || c == '.')
-      {
-        c = vfs_getc(pc->input);
-      }
-
-      vfs_fseek(pc->input, -1, SEEK_CUR);
-
-      setlocale (LC_ALL, saved_locale);
-      g_free (saved_locale);
-    }
-    return NUMBER;
-  }
-     
-  /* Char starts an identifier => read the name. */
-  if (isalpha (c)) {
-    GString *sym_name;
-
-    sym_name = g_string_new (NULL);
-    
-    do {
-      sym_name = g_string_append_c (sym_name, c);
-
-      /* Get another character. */
-      c = vfs_getc (pc->input);
-    } while (c != EOF && isalnum (c));
-    
-    vfs_fseek (pc->input, -1, SEEK_CUR);
-
-    yylval->s_value = sym_name->str;
-    
-    g_string_free (sym_name, FALSE);
-    
-    return NAME;
-  }
-
-  /* Any other character is a token by itself. */
-  return c;
-}
-
-static int load_name (char *str, char **name) {
-  int count = 0;
-  GString *new = g_string_new (NULL);
-
-  while (*str != 0 && *str != ':') {
-    g_string_append_c (new, *str++);
-    count++;
-  }
-
-  *name = new->str;
-  g_string_free (new, FALSE);
-
-  return count;
-}
-
-static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict, 
-				  char *str) {
-  char op;
-  double dval;
-  int i;
-  char *name;
-
-  while ((op = *str++)) {
-    switch (op) {
-    case 'c':			/* A constant. */
-      store_byte (expr, 'c');
-      sscanf (str, "%lf%n", &dval, &i);
-      str += i;
-      store_double (expr, dval);
-      str++;			/* Skip ';' */
-      break;
-
-    case 'f':			/* A function call. */
-      store_byte (expr, 'f');
-      str += load_name (str, &name);
-      i = function_lookup (name);
-      if (i < 0) return FALSE;	/* Fail on error. */
-      store_int (expr, i);
-      g_free (name);
-      str++;			/* Skip ';' */
-      break;
-
-    case 'l':			/* Load a variable. */
-    case 's':			/* Store a variable. */
-      store_byte (expr, op);
-      str += load_name (str, &name);
-      i = dict_lookup (dict, name);
-      store_int (expr, i);
-      g_free (name);
-      str++;			/* Skip ';' */
-      break;
-
-    default:			/* Copy verbatim. */
-      store_byte (expr, op);
-      break;
-    }
-  }
-
-  return TRUE;
-}
-     
-expression_t *expr_compile_string (const char* str, symbol_dict_t *dict)
-{
-  parser_control pc;
-  VFSFile *stream;
-
-  g_return_val_if_fail(str != NULL && dict != NULL, NULL);
-
-  stream = vfs_buffer_new_from_string ( (char *) str );
-
-  pc.input = stream;
-  pc.expr = expr_new ();
-  pc.dict = dict;
-
-  if (yyparse (&pc) != 0) {
-    /* Check for error. */
-    expr_free (pc.expr);
-    pc.expr = NULL;
-  }
-
-  vfs_fclose (stream);
-
-  return pc.expr;
-}
--- a/src/rovascope/libcalc/storage.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/* storage.c --
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
- 
-#include <glib.h>
-#include <stddef.h>
- 
-#include "storage.h"
-
-/* Code block. */
-
-expression_t *expr_new (void) {
-  expression_t *new_expr;
-
-  new_expr = (expression_t *)g_malloc (sizeof(expression_t));
-  new_expr->data = g_string_new (NULL);
-  return new_expr;
-}
-
-void expr_free (expression_t *expr) {
-  if (!expr)
-    return;
-
-  g_string_free (expr->data, TRUE);
-  g_free (expr);
-}
-
-static void load_data (char *str, void *dest, size_t size) {
-  char *ch = (char *)dest;
-  while (size--)
-    *ch++ = *str++;
-}
-
-int load_int (char *str) {
-  int val;
-  load_data (str, &val, sizeof(val));
-  return val;
-}
-
-double load_double (char *str) {
-  double val;
-  load_data (str, &val, sizeof(val));
-  return val;
-}
-
-static void store_data (expression_t *expr, void *src, size_t size) {
-  char *ch = (char *)src;
-  while (size--)
-    store_byte (expr, *ch++);
-}
-
-void store_byte (expression_t *expr, char byte) {
-  g_string_append_c (expr->data, byte);
-}
-
-void store_int (expression_t *expr, int val) {
-  store_data (expr, &val, sizeof(val));
-}
-
-void store_double (expression_t *expr, double val) {
-  store_data (expr, &val, sizeof(val));
-}
--- a/src/rovascope/libcalc/storage.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/* storage.h -- 
- *
- * Copyright (C) 2001 Janusz Gregorczyk <jgregor@kki.net.pl>
- *
- * This file is part of xvs.
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
-
-#ifndef Included_STORAGE_H
-#define Included_STORAGE_H
-
-#include <glib.h>
-
-typedef struct {
-  GString *data;
-} expression_t;
-
-/* Expr block. */
-expression_t *expr_new (void);
-void expr_free (expression_t *expr);
-
-int load_int (char *str);
-double load_double (char *str);
-
-void store_byte (expression_t *expr, char byte);
-void store_int (expression_t *expr, int val);
-void store_double (expression_t *expr, double val);
-
-#endif /* Included_STORAGE_H */
--- a/src/rovascope/misc.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <glib.h>
-
-#include "paranormal.h"
-#include "actuators.h"
-#include "pn_utils.h"
-
-/* ******************** misc_floater ******************** */
-static struct pn_actuator_option_desc misc_floater_opts[] =
-{
-  { "value", "The colour value for the floater.",
-    OPT_TYPE_INT, { ival: 255 } },
-  { NULL }
-};
-
-typedef enum
-{
-  float_up    = 0x1,
-  float_down  = 0x2,
-  float_left  = 0x4,
-  float_right = 0x8,
-} FloaterDirection;
-
-struct floater_state_data
-{
-  FloaterDirection dir;
-  gint x;
-  gint y;
-};
-
-static void
-misc_floater_init(gpointer *data)
-{
-  struct floater_state_data *opaque_data = g_new0(struct floater_state_data, 1);
-  *data = opaque_data;
-  opaque_data->x = rand() % pn_image_data->width;
-  opaque_data->y = rand() % pn_image_data->height;
-  opaque_data->dir = (FloaterDirection) rand() % 15; /* sum of all dir values */
-}
-
-static void
-misc_floater_cleanup(gpointer data)
-{
-  g_free(data);
-}
-
-/*
- * This implementation isn't very great.
- * Anyone want to improve it? :(
- */
-static void
-misc_floater_exec(const struct pn_actuator_option *opts, gpointer data)
-{
-  struct floater_state_data *opaque_data = (struct floater_state_data *) data;
-  guchar value = (opts[0].val.ival < 0 || opts[0].val.ival > 255) ? 255 : opts[0].val.ival;
-
-  /* determine the root coordinate first */
-  if (opaque_data->dir & float_up)
-    opaque_data->y -= 1;
-  if (opaque_data->dir & float_down)
-    opaque_data->y += 1;
-
-  if (opaque_data->dir & float_left)
-    opaque_data->x -= 1;
-  if (opaque_data->dir & float_right)
-    opaque_data->x += 1;
-
-  /* make sure we're within surface boundaries. segfaults suck, afterall. */
-  if (opaque_data->x + 1 <= pn_image_data->width &&
-       opaque_data->x - 1 >= 0 &&
-       opaque_data->y + 1 <= pn_image_data->height &&
-       opaque_data->y - 1 >= 0)
-    {
-      /* draw it. i could use a loop here, but i don't see much reason in it,
-       * so i don't think i will at this time.  -nenolod
-       */
-      pn_image_data->surface[0][PN_IMG_INDEX(opaque_data->x, opaque_data->y)]     = value;
-      pn_image_data->surface[0][PN_IMG_INDEX(opaque_data->x + 1, opaque_data->y)] = value;
-      pn_image_data->surface[0][PN_IMG_INDEX(opaque_data->x - 1, opaque_data->y)] = value;
-      pn_image_data->surface[0][PN_IMG_INDEX(opaque_data->x, opaque_data->y + 1)] = value;
-      pn_image_data->surface[0][PN_IMG_INDEX(opaque_data->x, opaque_data->y - 1)] = value;
-    }
-
-  /* check if we need to change direction yet, and if so, do so. */
-  if (pn_new_beat == TRUE)
-    opaque_data->dir = (FloaterDirection) rand() % 15; /* sum of all dir values */
-
-  /* now adjust the direction so we stay in boundary */
-  if (opaque_data->x - 1 <= 0 && opaque_data->dir & float_left)
-    {
-      opaque_data->dir &= ~float_left;
-      opaque_data->dir |= float_right;
-    }
-
-  if (opaque_data->x + 1 >= pn_image_data->width && opaque_data->dir & float_right)
-    {
-      opaque_data->dir &= ~float_right;
-      opaque_data->dir |= float_left;
-    }
-
-  if (opaque_data->y - 1 <= 0 && opaque_data->dir & float_up)
-    {
-      opaque_data->dir &= ~float_up;
-      opaque_data->dir |= float_down;
-    }
-
-  if (opaque_data->y + 1 >= pn_image_data->height && opaque_data->dir & float_down)
-    {
-      opaque_data->dir &= ~float_down;
-      opaque_data->dir |= float_up;
-    }
-}
-
-struct pn_actuator_desc builtin_misc_floater =
-{
-  "misc_floater",
-  "Floating Particle",
-  "A floating particle.",
-  0, misc_floater_opts,
-  misc_floater_init, misc_floater_cleanup, misc_floater_exec
-};
-
--- a/src/rovascope/paranormal.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/* FIXME: add fullscreen / screenshots */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <math.h>
-
-#include <SDL.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-
-#include "paranormal.h"
-#include "actuators.h"
-#include "containers.h"
-
-/* SDL stuffs */
-SDL_Surface *screen;
-
-/* Globals */
-struct pn_rc         *pn_rc;
-struct pn_image_data *pn_image_data;
-struct pn_sound_data *pn_sound_data;
-
-/* Trig Pre-Computes */
-float sin_val[360];
-float cos_val[360];
-
-gboolean pn_new_beat;
-
-extern SDL_mutex *config_mutex;
-
-/* **************** drawing doodads **************** */
-
-static void
-blit_to_screen (void)
-{
-  int j;
-
-  SDL_LockSurface (screen);
-
-  /* FIXME: add scaling support */
-
-  SDL_SetPalette (screen, SDL_LOGPAL|SDL_PHYSPAL,
-		  (SDL_Color*)pn_image_data->cmap, 0, 256);
-  SDL_SetAlpha (screen, 0, 255);
-
-  for (j=0; j<pn_image_data->height; j++)
-      memcpy (screen->pixels + j*screen->pitch,
-	      pn_image_data->surface[0] + j*pn_image_data->width,
-	      pn_image_data->width);
-
-
-  SDL_UnlockSurface (screen);
-
-  SDL_UpdateRect (screen, 0, 0, 0, 0);
-}
-
-static void
-resize_video (guint w, guint h)
-{
-  pn_image_data->width = w;
-  pn_image_data->height = h;
-
-  if (pn_image_data->surface[0])
-    g_free (pn_image_data->surface[0]);
-  if (pn_image_data->surface[1])
-    g_free (pn_image_data->surface[1]);
-
-  pn_image_data->surface[0] = g_malloc0 (w * h);
-  pn_image_data->surface[1] = g_malloc0 (w * h);
-
-  screen = SDL_SetVideoMode (w, h, 8, SDL_HWSURFACE |
-			     SDL_HWPALETTE | SDL_RESIZABLE);
-  if (! screen)
-    pn_fatal_error ("Unable to create a new SDL window: %s",
-		    SDL_GetError ());
-}
-
-static void
-take_screenshot (void)
-{
-  char fname[32];
-  struct stat buf;
-  int i=0;
-
-  do
-    sprintf (fname, "pn_%05d.bmp", ++i);
-  while (stat (fname, &buf) == 0);
-
-  SDL_SaveBMP (screen, fname);
-}
-
-/* FIXME: This should resize the video to a user-set
-   fullscreen res */
-static void
-toggle_fullscreen (void)
-{
-  SDL_WM_ToggleFullScreen (screen);  
-  if (SDL_ShowCursor (SDL_QUERY) == SDL_ENABLE)
-    SDL_ShowCursor (SDL_DISABLE);
-  else
-    SDL_ShowCursor (SDL_ENABLE);
-}
-
-/* **************** basic renderer management **************** */
-void
-pn_init (void)
-{
-  int i;
-#ifdef FULLSCREEN_HACK
-  char SDL_windowhack[32];
-  GdkScreen *screen;
-#endif
-
-  pn_sound_data = g_new0 (struct pn_sound_data, 1);
-  pn_image_data = g_new0 (struct pn_image_data, 1);
-
-#ifdef FULLSCREEN_HACK
-  screen = gdk_screen_get_default();
-  sprintf(SDL_windowhack,"SDL_WINDOWID=%d",
-          GDK_WINDOW_XWINDOW(gdk_screen_get_root_window(screen)));
-          putenv(SDL_windowhack);
-#endif
-
-  if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_NOPARACHUTE) < 0)
-    pn_fatal_error ("Unable to initialize SDL: %s", SDL_GetError ());
-
-#ifndef FULLSCREEN_HACK
-  resize_video (640, 360);
-#else
-  resize_video (1280, 1024);
-#endif
-
-  SDL_WM_SetCaption ("Rovascope " VERSION, PACKAGE);
-
-  for(i=0; i<360; i++)
-    {
-      sin_val[i] = sin(i*(M_PI/180.0));
-      cos_val[i] = cos(i*(M_PI/180.0));
-    }
-}
-
-void
-pn_cleanup (void)
-{
-  SDL_FreeSurface (screen);
-  SDL_Quit ();
-
-
-  if (pn_image_data)
-    {
-      if (pn_image_data->surface[0])
-	g_free (pn_image_data->surface[0]);
-      if (pn_image_data->surface[1])
-	g_free (pn_image_data->surface[1]);
-      g_free (pn_image_data);
-    }
-  if (pn_sound_data)
-    g_free (pn_sound_data);
-}
-
-/* Renders one frame and handles the SDL window */
-void
-pn_render (void)
-{
-  SDL_Event event;
-
-  /* Handle window events */
-  while (SDL_PollEvent (&event))
-    {
-      switch (event.type)
-	{
-	case SDL_QUIT:
-	  pn_quit ();
-	  g_assert_not_reached ();
-	case SDL_KEYDOWN:
-	  switch (event.key.keysym.sym)
-	    {
-	    case SDLK_ESCAPE:
-	      pn_quit ();
-	      g_assert_not_reached ();
-	    case SDLK_RETURN:
-	      if (event.key.keysym.mod & (KMOD_ALT | KMOD_META))
-		toggle_fullscreen ();
-	      break;
-	    case SDLK_BACKQUOTE:
-	      take_screenshot ();
-	      break;
-	    default:
-              break;
-	    }
-	  break;
-	case SDL_VIDEORESIZE:
-	  resize_video (event.resize.w, event.resize.h);	  
-	  break;
-	}
-    }
-
-  pn_new_beat = pn_is_new_beat();
-
-  if (pn_rc->actuator)
-    {
-      exec_actuator (pn_rc->actuator);
-      blit_to_screen ();
-    }
-
-  if (pn_new_beat && (rand() % 4 == 0))
-    {
-      struct pn_actuator *a;
-      GSList *list = *(GSList **)pn_rc->actuator->data;
-
-      container_remove_actuator (pn_rc->actuator, list->data);
-
-      SDL_mutexP(config_mutex);
-      a = rovascope_get_random_actuator();
-      container_add_actuator (pn_rc->actuator, a);
-      SDL_mutexV(config_mutex);
-    }
-}
-
-/* this MUST be called if a builtin's output is to surface[1]
-   (by the builtin, after it is done) */
-void
-pn_swap_surfaces (void)
-{
-  guchar *tmp = pn_image_data->surface[0];
-  pn_image_data->surface[0] = pn_image_data->surface[1];
-  pn_image_data->surface[1] = tmp;
-}
--- a/src/rovascope/paranormal.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#ifndef _PARANORMAL_H
-#define _PARANORMAL_H
-
-#include <glib.h>
-#include <math.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "actuators.h"
-
-struct pn_sound_data
-{
-  gint16 pcm_data[2][512];
-  gint16 freq_data[2][256];
-};
-
-struct pn_image_data
-{
-  int width, height;
-  struct pn_color cmap[256];
-  guchar *surface[2];
-};
-
-/* The executable (ie xmms.c or standalone.c)
-   is responsible for allocating this and filling
-   it with default/saved values */
-struct pn_rc
-{
-  struct pn_actuator *actuator;
-};
-
-/* core funcs */
-void pn_init (void);
-void pn_cleanup (void);
-void pn_render (void);
-void pn_swap_surfaces (void);
-
-/* Implemented elsewhere (ie xmms.c or standalone.c) */
-void pn_set_rc ();
-void pn_fatal_error (const char *fmt, ...);
-void pn_error (const char *fmt, ...);
-void pn_quit (void);
-
-/* Implimented in cfg.c */
-void pn_configure (void);
-
-/* globals used for rendering */
-extern struct pn_rc         *pn_rc;
-extern struct pn_sound_data *pn_sound_data;
-extern struct pn_image_data *pn_image_data;
-
-extern gboolean pn_new_beat;
-
-/* global trig pre-computes */
-extern float sin_val[360];
-extern float cos_val[360];
-
-/* beat detection */
-int pn_is_new_beat(void);
-
-struct pn_actuator *rovascope_get_random_colourmap(void);
-struct pn_actuator *rovascope_get_random_general(void);
-struct pn_actuator *rovascope_get_random_normal_scope(void);
-
-struct pn_actuator *rovascope_get_random_actuator(void);
-
-#endif /* _PARANORMAL_H */
--- a/src/rovascope/plugin.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,464 +0,0 @@
-/* FIXME: issues with not uniniting variables between
-   enables?  I wasn't too careful about that, but it
-   seems to work fine.  If there are problems perhaps
-   look for a bug there?
-*/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <memory.h>
-#include <math.h>
-#include <setjmp.h>
-#include <unistd.h>
-#include <sched.h>
-
-#include <glib.h>
-#include <audacious/i18n.h>
-
-#include <gtk/gtk.h>
-#include <audacious/plugin.h>
-#include <audacious/util.h>
-#include <SDL/SDL.h>
-#include <SDL/SDL_thread.h>
-
-#include "paranormal.h"
-#include "actuators.h"
-#include "containers.h"
-
-/* Error reporting dlg */
-static GtkWidget *err_dialog;
-
-/* Draw thread stuff */
-/* FIXME: Do I need mutex for pn_done? */
-static SDL_Thread *draw_thread = NULL;
-static SDL_mutex *sound_data_mutex;
-SDL_mutex *config_mutex;
-
-static gboolean pn_done = FALSE;
-jmp_buf quit_jmp;
-gboolean timeout_set = FALSE;
-guint quit_timeout;
-
-/* Sound stuffs */
-static gboolean new_pcm_data = FALSE;
-static gboolean new_freq_data = FALSE;
-static gint16 tmp_pcm_data[2][512];
-static gint16 tmp_freq_data[2][256];
-
-/* XMMS interface */
-static void pn_xmms_init (void);
-static void pn_xmms_cleanup (void);
-static void pn_xmms_about (void);
-static void pn_xmms_configure (void);
-static void pn_xmms_render_pcm (gint16 data[2][512]);
-static void pn_xmms_render_freq (gint16 data[2][256]);
-
-static VisPlugin pn_vp = 
-{
-  .description = "Rovascope " VERSION,
-  .num_pcm_chs_wanted = 2,
-  .num_freq_chs_wanted = 2,
-  .init = pn_xmms_init,
-  .cleanup = pn_xmms_cleanup,
-  .about = pn_xmms_about,
-  .configure = pn_xmms_configure,
-  .render_pcm = pn_xmms_render_pcm,
-  .render_freq = pn_xmms_render_freq
-};
-
-VisPlugin *rovascope_vplist[] = { &pn_vp, NULL };
-
-DECLARE_PLUGIN(rovascope, NULL, NULL, NULL, NULL, NULL, NULL, rovascope_vplist,NULL);
-
-static void
-load_pn_rc (void)
-{
-  struct pn_actuator *a, *b;
-
-  if (! pn_rc)
-      pn_rc = g_new0 (struct pn_rc, 1);
-
-  /* load a default preset */
-  pn_rc->actuator = create_actuator ("container_simple");
-  if (! pn_rc->actuator) goto ugh;
-  a = create_actuator ("container_once");
-  if (! a) goto ugh;
-
-  b = rovascope_get_random_colourmap ();
-
-  container_add_actuator (a, b);
-  container_add_actuator (pn_rc->actuator, a);
-
-  a = rovascope_get_random_normal_scope ();
-  if (! a) goto ugh;
-  container_add_actuator (pn_rc->actuator, a);
-
-  a = create_actuator ("xform_movement");
-  if (! a) goto ugh;
-  a->options[0].val.sval = g_strdup("d = cos(d)^2;");
-  container_add_actuator (pn_rc->actuator, a);
-
-  a = rovascope_get_random_general();
-  if (! a) goto ugh;
-  container_add_actuator (pn_rc->actuator, a);
-
-  a = rovascope_get_random_general();
-  if (! a) goto ugh;
-  container_add_actuator (pn_rc->actuator, a);
-
-  return;
-
- ugh:
-  if (pn_rc->actuator)
-    destroy_actuator (pn_rc->actuator);
-  pn_error ("Error loading default preset");
-}
-
-static int
-draw_thread_fn (gpointer data)
-{
-  gfloat fps = 0.0;
-  guint last_time = 0, last_second = 0;
-  guint this_time;
-  pn_init ();
-
-  /* Used when pn_quit is called from this thread */
-  if (setjmp (quit_jmp) != 0)
-    pn_done = TRUE;
-
-  while (! pn_done)
-    {
-      SDL_mutexP (sound_data_mutex);
-      if (new_freq_data)
-	{
-	  memcpy (pn_sound_data->freq_data, tmp_freq_data,
-		  sizeof (gint16) * 2 * 256);
-	  new_freq_data = FALSE;
-	}
-      if (new_pcm_data)
-	{
-	  memcpy (pn_sound_data->pcm_data, tmp_pcm_data,
-		  sizeof (gint16) * 2 * 512);
-	  new_freq_data = FALSE;
-	}
-      SDL_mutexV (sound_data_mutex);
-      SDL_mutexP (config_mutex);
-      pn_render ();
-      SDL_mutexV (config_mutex);
-
-      /* Compute the FPS */
-      this_time = SDL_GetTicks ();
-
-      fps = fps * .95 + (1000. / (gfloat) (this_time - last_time)) * .05;
-      if (this_time > 2000 + last_second)
-        {
-          last_second = this_time;
-          g_print ("FPS: %f\n", fps);
-        }
-      last_time = this_time;
-
-#ifdef _POSIX_PRIORITY_SCHEDULING
-      sched_yield();
-#endif
-    }
-
-  /* Just in case a pn_quit () was called in the loop */
-/*    SDL_mutexV (sound_data_mutex); */
-
-  pn_cleanup ();
-
-  return 0;
-}
-
-/* Is there a better way to do this? this = messy
-   It appears that calling disable_plugin () in some
-   thread other than the one that called pn_xmms_init ()
-   causes a seg fault :( */
-static int
-quit_timeout_fn (gpointer data)
-{
-  if (pn_done)
-    {
-      pn_vp.disable_plugin (&pn_vp);
-      return FALSE;
-    }
-
-  return TRUE;
-}
-
-static void
-pn_xmms_init (void)
-{
-  /* If it isn't already loaded, load the run control */
-  if (! pn_rc)
-	  load_pn_rc ();
-
-  sound_data_mutex = SDL_CreateMutex ();
-  config_mutex = SDL_CreateMutex ();
-  if (! sound_data_mutex)
-    pn_fatal_error ("Unable to create a new mutex: %s",
-		    SDL_GetError ());
-
-  pn_done = FALSE;
-  draw_thread = SDL_CreateThread (draw_thread_fn, NULL);
-  if (! draw_thread)
-    pn_fatal_error ("Unable to create a new thread: %s",
-		    SDL_GetError ());
-
-  /* Add a gtk timeout to test for quits */
-  quit_timeout = gtk_timeout_add (1000, quit_timeout_fn, NULL);
-  timeout_set = TRUE;
-}
-
-static void
-pn_xmms_cleanup (void)
-{
-  if (timeout_set)
-    {
-      gtk_timeout_remove (quit_timeout);
-      timeout_set = FALSE;
-    }
-
-  if (draw_thread)
-    {
-      pn_done = TRUE;
-      SDL_WaitThread (draw_thread, NULL);
-      draw_thread = NULL;
-    }
-
-  if (sound_data_mutex)
-    {
-      SDL_DestroyMutex (sound_data_mutex);
-      sound_data_mutex = NULL;
-    }
-
-  if (config_mutex)
-    {
-      SDL_DestroyMutex (config_mutex);
-      config_mutex = NULL;
-    }
-}
-
-#if 0
-static void
-about_close_clicked(GtkWidget *w, GtkWidget **window)
-{
-	gtk_widget_destroy(*window);
-	*window=NULL;
-}
-
-static void
-about_closed(GtkWidget *w, GdkEvent *e, GtkWidget **window)
-{
-	about_close_clicked(w,window);
-}
-#endif
-
-static void
-pn_xmms_about (void)
-{
-  audacious_info_dialog("About Rovascope", 
-
-"Rovascope " VERSION "\n\n\
-Copyright (C) 2007, William Pitcock <nenolod -at- dereferenced.org>\n\
-\
-Derived from:\
-Paranormal Visualization Studio\n\
-\n\
-Copyright (C) 2006, William Pitcock <nenolod -at- nenolod.net>\n\
-Portions Copyright (C) 2001, Jamie Gennis <jgennis -at- mindspring.com>\n\
-\n\
-This program is free software; you can redistribute it and/or modify\n\
-it under the terms of the GNU General Public License as published by\n\
-the Free Software Foundation; either version 2 of the License, or\n\
-(at your option) any later version.\n\
-\n\
-This program is distributed in the hope that it will be useful,\n\
-but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\
-GNU General Public License for more details.\n\
-\n\
-You should have received a copy of the GNU General Public License\n\
-along with this program; if not, write to the Free Software\n\
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307\n\
-USA", _("Ok"), FALSE, NULL, NULL);
-}
-
-static void
-pn_xmms_configure (void)
-{
-
-}
-
-static void
-pn_xmms_render_pcm (gint16 data[2][512])
-{
-  SDL_mutexP (sound_data_mutex);
-  memcpy (tmp_pcm_data, data, sizeof (gint16) * 2 * 512);
-  new_pcm_data = TRUE;
-  SDL_mutexV (sound_data_mutex);
-}
-
-static void
-pn_xmms_render_freq (gint16 data[2][256])
-{
-  SDL_mutexP (sound_data_mutex);
-  memcpy (tmp_freq_data, data, sizeof (gint16) * 2 * 256);
-  new_freq_data = TRUE;
-  SDL_mutexV (sound_data_mutex);
-}
-
-/* **************** paranormal.h stuff **************** */
-
-void
-pn_set_rc (struct pn_rc *new_rc)
-{
-  if (config_mutex)
-    SDL_mutexP (config_mutex);
-
-  if (! pn_rc)
-    load_pn_rc ();
-
-  if (pn_rc->actuator)
-    destroy_actuator (pn_rc->actuator);
-  pn_rc->actuator = new_rc->actuator;
-
-  if (config_mutex)
-    SDL_mutexV (config_mutex);
-}
-
-void
-pn_fatal_error (const char *fmt, ...)
-{
-  char *errstr;
-  va_list ap;
-  GtkWidget *dialog;
-  GtkWidget *close, *label;
-
-  /* Don't wanna try to lock GDK if we already have it */
-  if (draw_thread && SDL_ThreadID () == SDL_GetThreadID (draw_thread))
-    GDK_THREADS_ENTER ();
-
-  /* now report the error... */
-  va_start (ap, fmt);
-  errstr = g_strdup_vprintf (fmt, ap);
-  va_end (ap);
-
-  dialog=gtk_dialog_new();
-  gtk_window_set_title(GTK_WINDOW(dialog), "Error - Paranormal Visualization Studio - " VERSION);
-  gtk_container_border_width (GTK_CONTAINER (dialog), 8);
-
-  label=gtk_label_new(errstr);
-  fprintf (stderr, "%s\n", errstr);
-  g_free (errstr);
-
-  close = gtk_button_new_with_label ("Close");
-  gtk_signal_connect_object (GTK_OBJECT (close), "clicked",
-			     GTK_SIGNAL_FUNC (gtk_widget_destroy),
-			     GTK_OBJECT (dialog));
-
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE,
-		      FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), close,
-		      FALSE, FALSE, 0);
-  gtk_widget_show (label);
-  gtk_widget_show (close);
-
-  gtk_widget_show (dialog);
-  gtk_widget_grab_focus (dialog);
-
-  if (draw_thread && SDL_ThreadID () == SDL_GetThreadID (draw_thread))
-    GDK_THREADS_LEAVE ();
-
-  pn_quit ();
-}
-
-
-void
-pn_error (const char *fmt, ...)
-{
-  char *errstr;
-  va_list ap;
-  static GtkWidget *text;
-  static GtkTextBuffer *textbuf;
-
-  /* now report the error... */
-  va_start (ap, fmt);
-  errstr = g_strdup_vprintf (fmt, ap);
-  va_end (ap);
-  fprintf (stderr, "Rovascope-CRITICAL **: %s\n", errstr);
-
-  /* This is the easiest way of making sure we don't
-     get stuck trying to lock a mutex that this thread
-     already owns since this fn can be called from either
-     thread */
-  if (draw_thread && SDL_ThreadID () == SDL_GetThreadID (draw_thread))
-    GDK_THREADS_ENTER ();
-
-  if (! err_dialog)
-    {
-      GtkWidget *close;
-
-      err_dialog=gtk_dialog_new();
-      gtk_window_set_title (GTK_WINDOW (err_dialog), "Error - Paranormal Visualization Studio - " VERSION);
-      gtk_window_set_policy (GTK_WINDOW (err_dialog), FALSE, FALSE, FALSE);
-      gtk_widget_set_usize (err_dialog, 400, 200);
-      gtk_container_border_width (GTK_CONTAINER (err_dialog), 8);
-
-      textbuf = gtk_text_buffer_new(NULL);
-      text = gtk_text_view_new_with_buffer (textbuf);
-
-      close = gtk_button_new_with_label ("Close");
-      gtk_signal_connect_object (GTK_OBJECT (close), "clicked",
-				 GTK_SIGNAL_FUNC (gtk_widget_hide),
-				 GTK_OBJECT (err_dialog));
-      gtk_signal_connect_object (GTK_OBJECT (err_dialog), "delete-event",
-				 GTK_SIGNAL_FUNC (gtk_widget_hide),
-				 GTK_OBJECT (err_dialog));
-
-      gtk_box_pack_start (GTK_BOX (GTK_DIALOG (err_dialog)->vbox), text, FALSE,
-			  FALSE, 0);
-      gtk_box_pack_start (GTK_BOX (GTK_DIALOG (err_dialog)->action_area), close,
-			  FALSE, FALSE, 0);
-      gtk_widget_show (text);
-      gtk_widget_show (close);
-    }
-
-  gtk_text_buffer_set_text(GTK_TEXT_BUFFER(textbuf), errstr, -1);
-  g_free (errstr);
-
-  gtk_widget_show (err_dialog);
-  gtk_widget_grab_focus (err_dialog);
-
-  if (draw_thread && SDL_ThreadID () == SDL_GetThreadID (draw_thread))
-    GDK_THREADS_LEAVE ();
-}
-
-
-/* This is confusing...
-   Don't call this from anywhere but the draw thread or
-   the initialization xmms thread (ie NOT the xmms sound
-   data functions) */
-void
-pn_quit (void)
-{
-  if (draw_thread && SDL_ThreadID () == SDL_GetThreadID (draw_thread))
-    {
-      /* We're in the draw thread so be careful */
-      longjmp (quit_jmp, 1);
-    }
-  else
-    {
-      /* We're not in the draw thread, so don't sweat it...
-	 addendum: looks like we have to bend over backwards (forwards?)
-	 for xmms here too */
-      pn_vp.disable_plugin (&pn_vp);
-      while (1)
-	gtk_main_iteration ();
-    }
-}
--- a/src/rovascope/pn_utils.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#ifndef _PN_UTILS_H
-#define _PN_UTILS_H
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#define CAP(i,c) (i > c ? c : i < -(c) ? -(c) : i)
-#define CAPHILO(i,h,l) (i > h ? h : i < l ? l : i)
-#define CAPHI(i,h) (i > h ? h : i)
-#define CAPLO(i,l) (i < l ? l : i)
-
-#define PN_IMG_INDEX(x,y) ((x) + (pn_image_data->width * (y)))
-
-#endif /* _PN_UTILS_H */
--- a/src/rovascope/wave.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,526 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "paranormal.h"
-#include "actuators.h"
-#include "pn_utils.h"
-
-#include "drawing.h"
-
-#include "libcalc/calc.h"
-
-/* **************** wave_horizontal **************** */
-struct pn_actuator_option_desc wave_horizontal_opts[] =
-{
-  {"channels", "Which sound channels to use: negative = channel 1, \npositive = channel 2, "
-   "zero = both (two wave-forms.)", OPT_TYPE_INT, {ival: -1} },
-  {"value", "The colour value to use.", OPT_TYPE_INT, {ival: 255} },
-  {"lines", "Use lines instead of dots.", OPT_TYPE_BOOLEAN, {bval: TRUE} },
-  { NULL }
-};
-
-static void
-wave_horizontal_exec_dots (const struct pn_actuator_option *opts,
-		    gpointer data)
-{
-  int i;
-  int channel = ( opts[0].val.ival < 0 ) ? 0 : 1;
-  guchar value = (opts[1].val.ival < 0 || opts[1].val.ival > 255) ? 255 : opts[1].val.ival;
-
-  for (i=0; i<pn_image_data->width; i++) {
-
-    /*single channel, centered horz.*/
-    if ( opts[0].val.ival ) {
-      pn_image_data->surface[0][PN_IMG_INDEX (i, (pn_image_data->height>>1)
-					      - CAP (pn_sound_data->pcm_data[channel]
-						     [i*512/pn_image_data->width]>>8,
-						     (pn_image_data->height>>1)-1))]
-	= value;
-    }
-
-    /*both channels, at 1/4 and 3/4 of the screen*/
-    else {
-      pn_image_data->surface[0][PN_IMG_INDEX( i, (pn_image_data->height>>2) -
-					      CAP( (pn_sound_data->pcm_data[0]
-						    [i*512/pn_image_data->width]>>9),
-						   (pn_image_data->height>>2)-1))]
-	= value;
-
-      pn_image_data->surface[0][PN_IMG_INDEX( i, 3*(pn_image_data->height>>2) -
-					      CAP( (pn_sound_data->pcm_data[1]
-						    [i*512/pn_image_data->width]>>9),
-						   (pn_image_data->height>>2)-1))]
-	= value;
-    }
-  }
-}
-
-void
-wave_horizontal_exec_lines (const struct pn_actuator_option *opts,
-		    gpointer data)
-{
-  int channel = ( opts[0].val.ival < 0 ) ? 0 : 1;
-  guchar value = (opts[1].val.ival < 0 || opts[1].val.ival > 255) ? 255 : opts[1].val.ival;
-  int *x_pos, *y_pos;	/* dynamic tables which store the positions for the line */
-  int *x2_pos, *y2_pos;	/* dynamic tables which store the positions for the line */
-  int i;
-  float step;
-
-  x_pos = g_new0(int, 257);
-  y_pos = g_new0(int, 257);
-  x2_pos = g_new0(int, 257);
-  y2_pos = g_new0(int, 257);
-
-  step = pn_image_data->width / 256.;
-
-  /* calculate the line. */
-  for (i = 0; i < 256; i++)
-    {
-      if (opts[0].val.ival != 0)
-        {
-           x_pos[i] = i * step;
-           y_pos[i] = (pn_image_data->height>>1) - 
-			CAP (pn_sound_data->pcm_data[channel][i * 2]>>8, 
-			(pn_image_data->height>>1)-1);
-        }
-      else
-        {
-           x_pos[i] = i * step;
-           y_pos[i] = (pn_image_data->height>>2) - 
-			CAP (pn_sound_data->pcm_data[0][i * 2]>>9,
-			(pn_image_data->height>>2)-1);
-
-           x2_pos[i] = i * step;
-           y2_pos[i] = 3*(pn_image_data->height>>2) - 
-			CAP (pn_sound_data->pcm_data[1][i * 2]>>9,
-			(pn_image_data->height>>2)-1);
-
-        }
-    }
-
-  /* draw the line. */
-  for (i = 1; i < 256; i++)
-    {
-       pn_draw_line(x_pos[i - 1], y_pos[i - 1], x_pos[i], y_pos[i], value);
-
-       if ( opts[0].val.ival == 0 )
-         pn_draw_line(x2_pos[i - 1], y2_pos[i - 1], x2_pos[i], y2_pos[i], value);
-    }
-
-  g_free(x_pos);
-  g_free(y_pos);
-  g_free(x2_pos);
-  g_free(y2_pos);
-}
-
-static void
-wave_horizontal_exec (const struct pn_actuator_option *opts,
-		    gpointer data)
-{
-  if (opts[2].val.bval == TRUE)
-    wave_horizontal_exec_lines(opts, data);
-  else
-    wave_horizontal_exec_dots(opts, data);
-}
-
-struct pn_actuator_desc builtin_wave_horizontal =
-{
-  "wave_horizontal", "Horizontal Waveform",
-  "Draws one or two waveforms horizontally across "
-  "the drawing surface",
-  0, wave_horizontal_opts,
-  NULL, NULL, wave_horizontal_exec
-};
-
-/* **************** wave_vertical **************** */
-struct pn_actuator_option_desc wave_vertical_opts[] =
-{
-  {"channels", "Which sound channels to use: negative = channel 1, \npositive = channel 2, "
-   "zero = both (two wave-forms.)", OPT_TYPE_INT, {ival: -1} },
-  {"value", "The colour value to use.", OPT_TYPE_INT, {ival: 255} },
-  {"lines", "Use lines instead of dots.", OPT_TYPE_BOOLEAN, {bval: TRUE} },
-  { NULL }
-};
-
-static void
-wave_vertical_exec_dots (const struct pn_actuator_option *opts,
-		    gpointer data)
-{
-  int i;
-  int channel = ( opts[0].val.ival < 0 ) ? 0 : 1;
-  guchar value = (opts[1].val.ival < 0 || opts[1].val.ival > 255) ? 255 : opts[1].val.ival;
-
-  for (i=0; i<pn_image_data->height; i++) {
-    if ( opts[0].val.ival ) {
-      pn_image_data->surface[0][PN_IMG_INDEX ((pn_image_data->width>>1)
-					      - CAP (pn_sound_data->pcm_data[channel]
-						     [i*512/pn_image_data->height]>>8,
-						     (pn_image_data->width>>1)-1), i)]
-	= value;
-    }
-    else {
-      pn_image_data->surface[0][PN_IMG_INDEX ((pn_image_data->width>>2) 
-					      - CAP (pn_sound_data->pcm_data[0]
-						     [i*512/pn_image_data->height]>>9,
-						     (pn_image_data->width>>2)-1), i)]
-	= value;
-      pn_image_data->surface[0][PN_IMG_INDEX ((3*pn_image_data->width>>2) 
-						 -CAP (pn_sound_data->pcm_data[1]
-						       [i*512/pn_image_data->height]>>9,
-						       (pn_image_data->width>>2)-1), i)]
-			       
-	= value;
-    }
-  }
-}
-
-static void
-wave_vertical_exec_lines (const struct pn_actuator_option *opts,
-		    gpointer data)
-{
-  int channel = ( opts[0].val.ival < 0 ) ? 0 : 1;
-  guchar value = (opts[1].val.ival < 0 || opts[1].val.ival > 255) ? 255 : opts[1].val.ival;
-  int *x_pos, *y_pos;	/* dynamic tables which store the positions for the line */
-  int *x2_pos, *y2_pos;	/* dynamic tables which store the positions for the line */
-  int i;
-  float step;
-
-  x_pos = g_new0(int, 129);
-  y_pos = g_new0(int, 129);
-  x2_pos = g_new0(int, 129);
-  y2_pos = g_new0(int, 129);
-
-  step = pn_image_data->height / 128.;
-
-  /* calculate the line. */
-  for (i = 0; i < 128; i++)
-    {
-      if (opts[0].val.ival != 0)
-        {
-           x_pos[i] = (pn_image_data->width>>1) - 
-			CAP (pn_sound_data->pcm_data[channel]
-			[i*4]>>8,
-			(pn_image_data->width>>1)-1);
-	   y_pos[i] = i * step;
-        }
-      else
-        {
-           x_pos[i] = (pn_image_data->width>>2) 
-		      - CAP (pn_sound_data->pcm_data[0]
-		     [i*4]>>9,
-		     (pn_image_data->width>>2)-1);
-           y_pos[i] = i * step;
-
-           x2_pos[i] = 3*(pn_image_data->width>>2) 
-		      - CAP (pn_sound_data->pcm_data[1]
-		     [i*4]>>9,
-		     (pn_image_data->width>>2)-1);
-           y2_pos[i] = i * step;
-        }
-    }
-
-  /* draw the line. */
-  for (i = 1; i < 128; i++)
-    {
-       pn_draw_line(x_pos[i - 1], y_pos[i - 1], x_pos[i], y_pos[i], value);
-
-       if ( opts[0].val.ival == 0 )
-         pn_draw_line(x2_pos[i - 1], y2_pos[i - 1], x2_pos[i], y2_pos[i], value);
-    }
-
-  g_free(x_pos);
-  g_free(y_pos);
-  g_free(x2_pos);
-  g_free(y2_pos);
-}
-
-static void
-wave_vertical_exec (const struct pn_actuator_option *opts,
-		    gpointer data)
-{
-  if (opts[2].val.bval == TRUE)
-    wave_vertical_exec_lines(opts, data);
-  else
-    wave_vertical_exec_dots(opts, data);
-}
-
-struct pn_actuator_desc builtin_wave_vertical =
-{
-  "wave_vertical", "Vertical Waveform",
-  "Draws one or two waveforms vertically across "
-  "the drawing surface",
-  0, wave_vertical_opts,
-  NULL, NULL, wave_vertical_exec
-};
-
-/* FIXME: allow for only 1 channel for wave_normalize & wave_smooth */
-/* **************** wave_normalize **************** */
-static struct pn_actuator_option_desc wave_normalize_opts[] =
-{
-  { "height", "If positive, the height, in pixels, to which the waveform will be "
-    "normalized; if negative, hfrac is used", OPT_TYPE_INT, { ival: -1 } },
-  { "hfrac", "If positive, the fraction of the horizontal image size to which the "
-    "waveform will be normalized; if negative, vfrac is used",
-    OPT_TYPE_FLOAT, { fval: -1 } },
-  { "vfrac", "If positive, the fraction of the vertical image size to which the "
-    "waveform will be normalized",
-    OPT_TYPE_FLOAT, { fval: .125 } },
-  { "channels", "Which sound channel(s) to normalize: negative = channel 1,\n"
-    "\tpositive = channel 2, 0 = both channels.",
-    OPT_TYPE_INT, { ival: 0 } },
-  { NULL }
-};
-
-static void
-wave_normalize_exec (const struct pn_actuator_option *opts,
-		     gpointer data)
-{
-  int i, j, max=0;
-  float denom;
-
-  for (j=0; j<2; j++)
-    {
-      if ( !(opts[3].val.ival) || (opts[3].val.ival < 0 && j == 0) ||
-	   (opts[3].val.ival > 0 && j == 1) ) {
-	
-	for (i=0; i<512; i++)
-	  if (abs(pn_sound_data->pcm_data[j][i]) > max)
-	    max = abs(pn_sound_data->pcm_data[j][i]);
-	
-	if (opts[0].val.ival > 0)
-	  denom = max/(opts[0].val.ival<<8);
-	else if (opts[1].val.fval > 0)
-	  denom = max/(opts[1].val.fval * (pn_image_data->width<<8));
-	else
-	  denom = max/(opts[2].val.fval * (pn_image_data->height<<8));
-	
-	if (denom > 0)
-	  for (i=0; i<512; i++)
-	    pn_sound_data->pcm_data[j][i]
-	      /= denom;
-      }
-    }
-}
-
-struct pn_actuator_desc builtin_wave_normalize =
-{
-  "wave_normalize", "Normalize Waveform Data",
-  "Normalizes the waveform data used by the wave_* actuators",
-  0, wave_normalize_opts,
-  NULL, NULL, wave_normalize_exec
-};
-
-/* **************** wave_smooth **************** */
-struct pn_actuator_option_desc wave_smooth_opts[] = 
-{
-  { "channels", "Which sound channel(s) to smooth: negative = channel 1, \n"
-    "\tpositive = channel 2, 0 = both channels.",
-    OPT_TYPE_INT, { ival: 0 } },
-  {0}
-};
-
-static void
-wave_smooth_exec (const struct pn_actuator_option *opts,
-		  gpointer data)
-{
-  int i, j, k;
-  gint16 tmp[512];
-
-  for (j=0; j<2; j++)
-    {
-      if ( !(opts[0].val.ival) || (opts[0].val.ival < 0 && j == 0) ||
-	   (opts[0].val.ival > 0 && j == 1) ) { 
-	
-	for (i=4; i<508; i++)
-	  {
-	    k = (pn_sound_data->pcm_data[j][i]<<3)
-	      + (pn_sound_data->pcm_data[j][i+1]<<2)
-	      + (pn_sound_data->pcm_data[j][i-1]<<2)
-	      + (pn_sound_data->pcm_data[j][i+2]<<2)
-	      + (pn_sound_data->pcm_data[j][i-2]<<2)
-	      + (pn_sound_data->pcm_data[j][i+3]<<1)
-	      + (pn_sound_data->pcm_data[j][i-3]<<1)
-	      + (pn_sound_data->pcm_data[j][i+4]<<1)
-	      + (pn_sound_data->pcm_data[j][i-4]<<1);
-	    tmp[i] = k >> 5;
-	  }
-	memcpy (pn_sound_data->pcm_data[j]+4, tmp, sizeof (gint16) * 504);
-      } 
-    }
-}
-
-struct pn_actuator_desc builtin_wave_smooth =
-{
-  "wave_smooth", "Smooth Waveform Data",
-  "Smooth out the waveform data used by the wave_* actuators",
-  0, wave_smooth_opts,
-  NULL, NULL, wave_smooth_exec
-};
-
-/* **************** wave_radial **************** */
-static struct pn_actuator_option_desc wave_radial_opts[] =
-{
-  { "base_radius", " ", 
-    OPT_TYPE_FLOAT, { fval: 0 } },
-  {"value", "The colour value to use.", OPT_TYPE_INT, {ival: 255} },
-/*  {"lines", "Use lines instead of dots.", OPT_TYPE_BOOLEAN, {bval: TRUE} }, */
-  { NULL }
-};
-
-static void
-wave_radial_exec (const struct pn_actuator_option *opts,
-		  gpointer data)
-{
-  int i, x, y;
-  guchar value = (opts[1].val.ival < 0 || opts[1].val.ival > 255) ? 255 : opts[1].val.ival;
-  
-  for(i=0; i<360; i++)
-    {
-      x = (pn_image_data->width>>1)
-	+ (opts[0].val.fval + (pn_sound_data->pcm_data[0][(int)(i*(512.0/360.0))]>>8))
-	* cos_val[i];
-      y = (pn_image_data->height>>1) 
-	+ (opts[0].val.fval + (pn_sound_data->pcm_data[0][(int)(i*(512.0/360.0))]>>8))
-	* sin_val[i];
-
-      pn_image_data->surface[0][PN_IMG_INDEX (CAPHILO(x,pn_image_data->width,0),
-					      CAPHILO(y,pn_image_data->height,0))]
-	= value;
-    }
-};	       
-
-struct pn_actuator_desc builtin_wave_radial =
-{
-  "wave_radial", "Radial Waveform",
-  "Draws a single waveform varying"
-  " radially from the center of the image",
-  0, wave_radial_opts,
-  NULL, NULL, wave_radial_exec
-};
-
-/* **************** wave_scope **************** */
-
-static struct pn_actuator_option_desc wave_scope_opts[] =
-{
-  {"init_script", "Initialization script.", OPT_TYPE_STRING, {sval: "n = 800; t = -0.05;"} },
-  {"frame_script", "Script to run at the beginning of each frame.", OPT_TYPE_STRING, {sval: "t = t + 0.05;"} },
-  {"sample_script", "Script to run for each sample.", OPT_TYPE_STRING, {sval: "d = index + value; r = t + index * 3.141952924 * 4; x = cos(r) * d; y = sin(r) * d;"} },
-  {"lines", "Use lines instead of dots.", OPT_TYPE_BOOLEAN, {bval: TRUE} },
-  { NULL }
-};
-
-struct pn_scope_data
-{
-  expression_t *expr_on_init, *expr_on_frame, *expr_on_sample;
-  symbol_dict_t *dict;
-  gboolean reset;
-};
-
-static void
-wave_scope_init(gpointer *data)
-{
-  *data = g_new0(struct pn_scope_data, 1);
-
-  /* the expressions will need to be compiled, so prepare for that */
-  ((struct pn_scope_data *)*data)->reset = TRUE;
-}
-
-static void
-wave_scope_cleanup(gpointer op_data)
-{
-  struct pn_scope_data *data = (struct pn_scope_data *) op_data;
-
-  g_return_if_fail(data != NULL);
-
-  if (data->expr_on_init)
-    expr_free(data->expr_on_init);
-
-  if (data->expr_on_frame)
-    expr_free(data->expr_on_frame);
-
-  if (data->expr_on_sample)
-    expr_free(data->expr_on_sample);
-
-  if (data->dict)
-    dict_free(data->dict);
-
-  if (data)
-    g_free(data);
-}
-
-static void
-wave_scope_exec(const struct pn_actuator_option *opts,
-		gpointer op_data)
-{
-  struct pn_scope_data *data = (struct pn_scope_data *) op_data;
-  gint i;
-  gdouble *xf, *yf, *index, *value, *points;
-
-  if (data->reset)
-    {
-       if (data->dict)
-         dict_free(data->dict);
-
-       data->dict = dict_new();
-
-       if (opts[0].val.sval != NULL)
-         data->expr_on_init = expr_compile_string(opts[0].val.sval, data->dict);
-
-       if (opts[1].val.sval != NULL)
-         data->expr_on_frame = expr_compile_string(opts[1].val.sval, 
-		data->dict);
-
-       if (opts[2].val.sval != NULL)
-         data->expr_on_sample = expr_compile_string(opts[2].val.sval, 
-		data->dict);
-
-       if (data->expr_on_init != NULL)
-         expr_execute(data->expr_on_init, data->dict);
-
-       data->reset = FALSE;
-    }
-
-  xf = dict_variable(data->dict, "x");
-  yf = dict_variable(data->dict, "y");
-  index = dict_variable(data->dict, "index");
-  value = dict_variable(data->dict, "value");
-  points = dict_variable(data->dict, "points");
-
-  if (data->expr_on_frame != NULL)
-    expr_execute(data->expr_on_frame, data->dict);
-
-  if (*points > 513 || *points == 0)
-      *points = 513;
-
-  if (data->expr_on_sample != NULL)
-    {
-       for (i = 0; i < *points; i++)
-          {
-             gint x, y;
-             static gint oldx, oldy;
-
-             *value = 1.0 * pn_sound_data->pcm_data[0][i & 511] / 32768.0;
-             *index = i / (*points - 1);
-
-             expr_execute(data->expr_on_sample, data->dict);
-
-             x = (gint)(((*xf + 1.0) * (pn_image_data->width - 1) / 2) + 0.5);
-             y = (gint)(((*yf + 1.0) * (pn_image_data->height - 1) / 2) + 0.5);
-
-             if (i != 0)
-               pn_draw_line(oldx, oldy, x, y, 255);
-
-             oldx = x;
-             oldy = y;
-          }
-    }
-}
-
-struct pn_actuator_desc builtin_wave_scope =
-{
-  "wave_scope", "Scope",
-  "A programmable scope.",
-  0, wave_scope_opts,
-  wave_scope_init, wave_scope_cleanup, wave_scope_exec
-};
--- a/src/rovascope/xform.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,759 +0,0 @@
-/* FIXME: allow for only using an xform on part of the img? */
-/* FIXME: perhaps combine these into a single vector field
-   so that only 1 apply_xform needs to be done for as many
-   of these as someone wants to use */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <math.h>
-
-#include <glib.h>
-
-#include "paranormal.h"
-#include "actuators.h"
-#include "pn_utils.h"
-
-#include "libcalc/calc.h"
-
-struct xform_vector
-{
-  gint32 offset; /* the offset of the top left pixel */
-  guint16 w; /* 4:4:4:4 NE, NW, SE, SW pixel weights
-		  The total should be 16 */
-
-  /* if offset < 0 then w is the color index to
-     which the pixel will be set */
-};
-
-static void
-xfvec (float x, float y, struct xform_vector *v)
-{
-  float xd, yd;
-  int weight[4];
-
-  if (x >= pn_image_data->width-1 || y >= pn_image_data->height-1
-      || x < 0 || y < 0)
-    {
-      v->offset = -1;
-      v->w = 0;
-      return;
-    }
-
-  v->offset = PN_IMG_INDEX (floor(x), floor(y));
-
-  xd = x - floor (x);
-  yd = y - floor (y);
-
-  weight[3] = xd * yd * 16;
-  weight[2] = (1-xd) * yd * 16;
-  weight[1] = xd * (1-yd) * 16;
-  weight[0] = 16 - weight[3] - weight[2] - weight[1]; /* just in case */
-
-  v->w = (weight[0]<<12) | (weight[1]<<8) | (weight[2]<<4) | weight[3];
-}
-
-static void
-apply_xform (struct xform_vector *vfield)
-{
-  int i;
-  struct xform_vector *v;
-  register guchar *srcptr;
-  register guchar *destptr;
-  register int color;
-
-  if (vfield == NULL)
-      return;
-
-  for (i=0, v=vfield, destptr=pn_image_data->surface[1];
-       i<pn_image_data->width*pn_image_data->height;
-       i++, v++, destptr++)
-    {
-      /* off the screen */
-      if (v->offset < 0)
-	{
-	  *destptr = (guchar)v->w;
-	  continue;
-	}
-
-      srcptr = pn_image_data->surface[0] + v->offset;
-
-      /* exactly on the pixel */
-      if (v->w == 0)
-	  *destptr = *srcptr;
-      
-      /* gotta blend the points */
-      else
-	{
-	  color =  *srcptr * (v->w>>12);
-	  color += *++srcptr * ((v->w>>8) & 0x0f);
-	  color += *(srcptr+=pn_image_data->width) * (v->w & 0x0f);
-	  color += *(--srcptr) * ((v->w>>4) & 0x0f);
-	  color >>= 4;
-	  *destptr = (guchar)color;
-	}
-    }
-}
-
-/* **************** xform_spin **************** */
-/* FIXME: Describe these better, how they are backwards */
-/* FIXME: better name? */
-struct pn_actuator_option_desc xform_spin_opts[] =
-{
-  { "angle", "The angle of rotation", OPT_TYPE_FLOAT, { fval: -8.0 } },
-  { "r_add", "The number of pixels by which the r coordinate will be "
-    "increased (before scaling)", OPT_TYPE_FLOAT, { fval: 0.0 } },
-  { "r_scale", "The amount by which the r coordinate of each pixel will "
-    "be scaled", OPT_TYPE_FLOAT, { fval: 1.0 } },
-  { NULL }
-};
-
-struct xform_spin_data
-{
-  int width, height;
-  struct xform_vector *vfield;
-};
-
-static void
-xform_spin_init (gpointer *data)
-{
-  *data = g_new0 (struct xform_spin_data, 1);
-}
-
-static void
-xform_spin_cleanup (gpointer data)
-{
-  struct xform_spin_data *d = (struct xform_spin_data *) data;
-
-  
-  if (d)
-    {
-      if (d->vfield)
-	g_free (d->vfield);
-      g_free (d);
-    }
-}
-
-static void
-xform_spin_exec (const struct pn_actuator_option *opts,
-		 gpointer data)
-{
-  struct xform_spin_data *d = (struct xform_spin_data*)data;
-  float i, j;
-
-  if (d->width != pn_image_data->width
-      || d->height != pn_image_data->height)
-    {
-      d->width = pn_image_data->width;
-      d->height = pn_image_data->height;
-
-      if (d->vfield)
-	g_free (d->vfield);
-
-      d->vfield = g_malloc0 (sizeof(struct xform_vector)
-			    * d->width * d->height);
-
-      for (j=-(pn_image_data->height>>1)+1; j<=pn_image_data->height>>1; j++)
-	for (i=-(pn_image_data->width>>1); i<pn_image_data->width>>1; i++)
-	  {
-	    float r, t = 0;
-	    float x, y;
-
-	    r = sqrt (i*i + j*j);
-	    if (r)
-	      t = asin (j/r);
-	    if (i < 0)
-	      t = M_PI - t;
-
-	    t += opts[0].val.fval * M_PI/180.0; 
-	    r += opts[1].val.fval;
-	    r *= opts[2].val.fval;
-
-	    x = (r * cos (t)) + (pn_image_data->width>>1);
-	    y = (pn_image_data->height>>1) - (r * sin (t));
-
-	    xfvec (x, y, &d->vfield
-		   [PN_IMG_INDEX ((pn_image_data->width>>1)+(int)rint(i),
-				  ((pn_image_data->height>>1)-(int)rint(j)))]);
-	  }
-    }
-
-  apply_xform (d->vfield);
-  pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_xform_spin =
-{
-  "xform_spin", "Spin Transform", 
-  "Rotates and radially scales the image",
-  0, xform_spin_opts,
-  xform_spin_init, xform_spin_cleanup, xform_spin_exec
-};
-
-/* **************** xform_ripple **************** */
-struct pn_actuator_option_desc xform_ripple_opts[] =
-{
-  { "angle", "The angle of rotation", OPT_TYPE_FLOAT, { fval: 0 } },
-  { "ripples", "The number of ripples that fit on the screen "
-    "(horizontally)", OPT_TYPE_FLOAT, { fval: 8 } },
-  { "base_speed", "The minimum number of pixels to move each pixel",
-    OPT_TYPE_FLOAT, { fval: 1 } },
-  { "mod_speed", "The maximum number of pixels by which base_speed"
-    " will be modified", OPT_TYPE_FLOAT, { fval: 1 } },
-  { NULL }
-};
-
-struct xform_ripple_data
-{
-  int width, height;
-  struct xform_vector *vfield;
-};
-
-static void
-xform_ripple_init (gpointer *data)
-{
-  *data = g_new0 (struct xform_ripple_data, 1);
-}
-
-static void
-xform_ripple_cleanup (gpointer data)
-{
-  struct xform_ripple_data *d = (struct xform_ripple_data*) data;
-
-  if (d)
-    {
-      if (d->vfield)
-	g_free (d->vfield);
-      g_free (d);
-    }
-}
-
-static void
-xform_ripple_exec (const struct pn_actuator_option *opts,
-		 gpointer data)
-{
-  struct xform_ripple_data *d = (struct xform_ripple_data*)data;
-  float i, j;
-
-  if (d->width != pn_image_data->width
-      || d->height != pn_image_data->height)
-    {
-      d->width = pn_image_data->width;
-      d->height = pn_image_data->height;
-
-      if (d->vfield)
-	g_free (d->vfield);
-
-      d->vfield = g_malloc (sizeof(struct xform_vector)
-			    * d->width * d->height);
-
-      for (j=-(pn_image_data->height>>1)+1; j<=pn_image_data->height>>1; j++)
-	for (i=-(pn_image_data->width>>1); i<pn_image_data->width>>1; i++)
-	  {
-	    float r, t = 0;
-	    float x, y;
-
-	    r = sqrt (i*i + j*j);
-	    if (r)
-	      t = asin (j/r);
-	    if (i < 0)
-	      t = M_PI - t;
-
-	    t += opts[0].val.fval * M_PI/180.0; 
-
-	    if (r > 4)//(pn_image_data->width/(2*opts[1].val.fval)))
-	      r -=  opts[2].val.fval + (opts[3].val.fval/2) *
-		(1 + sin ((r/(pn_image_data->width/(2*opts[1].val.fval)))*M_PI));
-/*  	    else if (r > 4) */
-/*  	      r *= r/(pn_image_data->width/opts[1].val.fval); */
-	    else /* don't let it explode */
-	      r = 1000000;
-
-
-	    x = (r * cos (t)) + (pn_image_data->width>>1);
-	    y = (pn_image_data->height>>1) - (r * sin (t));
-
-	    xfvec (x, y, &d->vfield
-		   [PN_IMG_INDEX ((pn_image_data->width>>1)+(int)rint(i),
-				  ((pn_image_data->height>>1)-(int)rint(j)))]);
-	  }
-    }
-
-  apply_xform (d->vfield);
-  pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_xform_ripple =
-{
-  "xform_ripple", "Ripple Transform", "Creates an ripple effect",
-  0, xform_ripple_opts,
-  xform_ripple_init, xform_ripple_cleanup, xform_ripple_exec
-};
-
-/* **************** xform_bump_spin **************** */
-struct pn_actuator_option_desc xform_bump_spin_opts[] =
-{
-  { "angle", "The angle of rotation", OPT_TYPE_FLOAT, { fval: 0 } },
-  { "bumps", "The number of bumps that on the image",
-    OPT_TYPE_FLOAT, { fval: 8 } },
-  { "base_scale", "The base radial scale",
-    OPT_TYPE_FLOAT, { fval: 0.95 } },
-  { "mod_scale", "The maximum amount that should be "
-    "added to the base_scale to create the 'bump' effect",
-    OPT_TYPE_FLOAT, { fval: .1 } },
-  { NULL }
-};
-
-struct xform_bump_spin_data
-{
-  int width, height;
-  struct xform_vector *vfield;
-};
-
-static void
-xform_bump_spin_init (gpointer *data)
-{
-  *data = g_new0 (struct xform_bump_spin_data, 1);
-}
-
-static void
-xform_bump_spin_cleanup (gpointer data)
-{
-  struct xform_bump_spin_data *d = (struct xform_bump_spin_data*) data;
-
-  if (d)
-    {
-      if (d->vfield)
-	g_free (d->vfield);
-      g_free (d);
-    }
-}
-
-static void
-xform_bump_spin_exec (const struct pn_actuator_option *opts,
-		 gpointer data)
-{
-  struct xform_bump_spin_data *d = (struct xform_bump_spin_data*)data;
-  float i, j;
-
-  if (d->width != pn_image_data->width
-      || d->height != pn_image_data->height)
-    {
-      d->width = pn_image_data->width;
-      d->height = pn_image_data->height;
-
-      if (d->vfield)
-	g_free (d->vfield);
-
-      d->vfield = g_malloc (sizeof(struct xform_vector)
-			    * d->width * d->height);
-
-      for (j=-(pn_image_data->height>>1)+1; j<=pn_image_data->height>>1; j++)
-	for (i=-(pn_image_data->width>>1); i<pn_image_data->width>>1; i++)
-	  {
-	    float r, t = 0;
-	    float x, y;
-
-	    r = sqrt (i*i + j*j);
-	    if (r)
-	      t = asin (j/r);
-	    if (i < 0)
-	      t = M_PI - t;
-
-	    t += opts[0].val.fval * M_PI/180.0;
-
-	    r *=  opts[2].val.fval + opts[3].val.fval
-	      * (1 + sin (t*opts[1].val.fval));
-
-	    x = (r * cos (t)) + (pn_image_data->width>>1);
-	    y = (pn_image_data->height>>1) - (r * sin (t));
-
-	    xfvec (x, y, &d->vfield
-		   [PN_IMG_INDEX ((pn_image_data->width>>1)+(int)rint(i),
-				  ((pn_image_data->height>>1)-(int)rint(j)))]);
-	  }
-    }
-
-  apply_xform (d->vfield);
-  pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_xform_bump_spin =
-{
-  "xform_bump_spin", "Bump Transform", 
-  "Rotate the image at a varying speed to create "
-  "the illusion of bumps",
-  0, xform_bump_spin_opts,
-  xform_bump_spin_init, xform_bump_spin_cleanup, xform_bump_spin_exec
-};
-
-/* **************** xform_halfrender **************** */
-struct pn_actuator_option_desc xform_halfrender_opts[] =
-{
-  { "direction", "Negative is horizontal, positive is vertical.", 
-    OPT_TYPE_INT, { ival: 1 } },
-  { "render_twice", "Render the second image.",
-    OPT_TYPE_BOOLEAN, { bval: TRUE } },
-  { NULL }
-};
-
-static void
-xform_halfrender_exec (const struct pn_actuator_option *opts,
-		 gpointer data)
-{
-  gint x, y;
-
-  if (opts[0].val.ival < 0)
-    {
-       for (y = 0; y < pn_image_data->height; y += 2)
-         {
-            for (x = 0; x < pn_image_data->width; x++)
-              {
-                 pn_image_data->surface[1][PN_IMG_INDEX(x, y / 2)] =
-                   pn_image_data->surface[0][PN_IMG_INDEX(x, y)];
-	         if (opts[1].val.bval)
-                   {
-                     pn_image_data->surface[1][PN_IMG_INDEX(x, (y / 2) + (pn_image_data->height / 2))] =
-                       pn_image_data->surface[0][PN_IMG_INDEX(x, y)];
-                   }
-              }
-         }
-    }
-  else
-    {
-       for (y = 0; y < pn_image_data->height; y++)
-         {
-            for (x = 0; x < pn_image_data->width; x += 2)
-              {
-                 pn_image_data->surface[1][PN_IMG_INDEX(x / 2, y)] =
-                   pn_image_data->surface[0][PN_IMG_INDEX(x, y)];
-                 if (opts[1].val.bval)
-                   {
-                     pn_image_data->surface[1][PN_IMG_INDEX((x / 2) + (pn_image_data->width / 2), y)] =
-                       pn_image_data->surface[0][PN_IMG_INDEX(x, y)];
-                   }
-              }
-         }
-    }
-
-    pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_xform_halfrender =
-{
-  "xform_halfrender", "Halfrender Transform",
-  "Divides the surface in half and renders it twice.",
-  0, xform_halfrender_opts,
-  NULL, NULL, xform_halfrender_exec
-};
-
-/* **************** xform_movement **************** */
-struct pn_actuator_option_desc xform_movement_opts[] =
-{
-  { "formula", "The formula to evaluate.",
-    OPT_TYPE_STRING, { sval: "r = r * cos(r); d = sin(d);" } },
-  { "polar", "Whether the coordinates are polar or not.",
-    OPT_TYPE_BOOLEAN, { bval: TRUE } },
-  { NULL }
-};
-
-typedef struct {
-  int width, height;                 /* Previous width and height. */
-  struct xform_vector *vfield;
-} PnMovementData;
-
-static void
-xform_movement_init (gpointer *data)
-{
-    *data = g_new0(PnMovementData, 1);
-}
-
-static void
-xform_movement_cleanup (gpointer data)
-{
-    PnMovementData *d = (PnMovementData *) data;
-
-    if (d)
-      {
-         if (d->vfield)
- 	     g_free (d->vfield);
-         g_free (d);
-      }
-}
-
-inline void
-xform_trans_polar (struct xform_vector *vfield, gint x, gint y,
-	expression_t *expr, symbol_dict_t *dict)
-{
-  gdouble *rf, *df;
-  gdouble xf, yf;
-  gint xn, yn;
-
-  rf = dict_variable(dict, "r");
-  df = dict_variable(dict, "d");
-
-  /* Points (xf, yf) must be in a (-1..1) square. */
-  xf = 2.0 * x / (pn_image_data->width - 1) - 1.0;
-  yf = 2.0 * y / (pn_image_data->height - 1) - 1.0;
-
-  /* Now, convert to polar coordinates r and d. */
-  *rf = hypot(xf, yf);
-  *df = atan2(yf, xf);
-
-  /* Run the script. */
-  expr_execute(expr, dict);
-
-  /* Back to (-1..1) square. */
-  xf = (*rf) * cos ((*df));
-  yf = (*rf) * sin ((*df));
-
-  /* Convert back to physical coordinates. */
-  xn = (int)(((xf + 1.0) * (pn_image_data->width - 1) / 2) + 0.5);
-  yn = (int)(((yf + 1.0) * (pn_image_data->height - 1) / 2) + 0.5);
-
-  if (xn < 0 || xn >= pn_image_data->width || yn < 0 || yn >= pn_image_data->height)
-    {
-      xn = x; yn = y;
-    }
-
-  xfvec (xn, yn, &vfield[PN_IMG_INDEX (x, y)]);
-}
-
-inline void
-xform_trans_literal (struct xform_vector *vfield, gint x, gint y,
-	expression_t *expr, symbol_dict_t *dict)
-{
-  gdouble *xf, *yf;
-  gint xn, yn;
-
-  xf = dict_variable(dict, "x");
-  yf = dict_variable(dict, "y");
-
-  /* Points (xf, yf) must be in a (-1..1) square. */
-  *xf = 2.0 * x / (pn_image_data->width - 1) - 1.0;
-  *yf = 2.0 * y / (pn_image_data->height - 1) - 1.0;
-
-  /* Run the script. */
-  expr_execute(expr, dict);
-
-  /* Convert back to physical coordinates. */
-  xn = (int)(((*xf + 1.0) * (pn_image_data->width - 1) / 2) + 0.5);
-  yn = (int)(((*yf + 1.0) * (pn_image_data->height - 1) / 2) + 0.5);
-
-  if (xn < 0 || xn >= pn_image_data->width || yn < 0 || yn >= pn_image_data->height)
-    {
-      xn = x; yn = y;
-    }
-
-  xfvec (xn, yn, &vfield[PN_IMG_INDEX (x, y)]);
-}
-
-static void
-xform_movement_exec (const struct pn_actuator_option *opts,
-		 gpointer odata)
-{
-  PnMovementData *d = (PnMovementData *) odata;
-  void (*transform_func)(struct xform_vector *, gint, gint, expression_t *, symbol_dict_t *) = 
-        opts[1].val.bval == TRUE ? xform_trans_polar : xform_trans_literal;
-
-  if (d->width != pn_image_data->width
-      || d->height != pn_image_data->height)
-    {
-      gint i, j;
-      gdouble *rf, *df;
-      expression_t *expr;
-      symbol_dict_t *dict;
-
-      d->width = pn_image_data->width;
-      d->height = pn_image_data->height;
-
-      if (d->vfield)
-        {
-  	  g_free (d->vfield);
-          d->vfield = NULL;
-        }
-
-      if (opts[0].val.sval == NULL)
-        return;
-
-      dict = dict_new();
-      expr = expr_compile_string(opts[0].val.sval, dict);
-      if (!expr)
-        {
-           dict_free(dict);
-           return;
-        }
-
-      rf = dict_variable(dict, "r");
-      df = dict_variable(dict, "d");
-
-      d->vfield = g_malloc (sizeof(struct xform_vector)
-			    * d->width * d->height);
-
-      for (j = 0; j < pn_image_data->height; j++)
-	for (i = 0; i < pn_image_data->width; i++)
-	  {
-            transform_func(d->vfield, i, j, expr, dict);
-	  }
-    }
-
-  apply_xform (d->vfield);
-  pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_xform_movement =
-{
-  "xform_movement", "Movement Transform",
-  "A customizable blitter.",
-  0, xform_movement_opts,
-  xform_movement_init, xform_movement_cleanup, xform_movement_exec
-};
-
-/* **************** xform_dynmovement **************** */
-/* FIXME: really slow */
-struct pn_actuator_option_desc xform_dynmovement_opts[] =
-{
-  { "init_script", "The formula to evaluate on init.",
-    OPT_TYPE_STRING, { sval: "" } },
-  { "beat_script", "The formula to evaluate on each beat.",
-    OPT_TYPE_STRING, { sval: "" } },
-  { "frame_script", "The formula to evaluate on each frame.",
-    OPT_TYPE_STRING, { sval: "" } },
-  { "point_script", "The formula to evaluate.",
-    OPT_TYPE_STRING, { sval: "d = 0.15;" } },
-  { "polar", "Whether or not the coordinates to use are polar.",
-    OPT_TYPE_BOOLEAN, { bval: TRUE } },
-  { NULL }
-};
-
-typedef struct {
-  int width, height;                 /* Previous width and height. */
-  expression_t *expr_init;
-  expression_t *expr_frame;
-  expression_t *expr_beat;
-  expression_t *expr_point;
-  symbol_dict_t *dict;
-  struct xform_vector *vfield;
-} PnDynMovementData;
-
-static void
-xform_dynmovement_init (gpointer *data)
-{
-    *data = g_new0(PnDynMovementData, 1);
-}
-
-static void
-xform_dynmovement_cleanup (gpointer data)
-{
-    PnDynMovementData *d = (PnDynMovementData *) data;
-
-    if (d)
-      {
-         if (d->expr_init)
-             expr_free (d->expr_init);
-         if (d->expr_beat)
-             expr_free (d->expr_beat);
-         if (d->expr_frame)
-             expr_free (d->expr_frame);
-         if (d->expr_point)
-             expr_free (d->expr_point);
-         if (d->dict)
-             dict_free (d->dict);
-         if (d->vfield)
- 	     g_free (d->vfield);
-         g_free (d);
-      }
-}
-
-static void
-xform_dynmovement_exec (const struct pn_actuator_option *opts,
-		 gpointer odata)
-{
-  PnDynMovementData *d = (PnDynMovementData *) odata;
-  gint i, j;
-  gdouble *rf, *df;
-  void (*transform_func)(struct xform_vector *, gint, gint, expression_t *, symbol_dict_t *) = 
-        opts[4].val.bval == TRUE ? xform_trans_polar : xform_trans_literal;
-  gboolean make_table = FALSE;
-
-  if (d->width != pn_image_data->width
-      || d->height != pn_image_data->height)
-    {
-      d->width = pn_image_data->width;
-      d->height = pn_image_data->height;
-
-      if (d->vfield)
-        {
-  	  g_free (d->vfield);
-          d->vfield = NULL;
-        }
-
-      if (opts[3].val.sval == NULL)
-          return;
-
-      if (!d->dict)
-          d->dict = dict_new();
-      else
-        {
-          dict_free(d->dict);
-          d->dict = dict_new();
-        }
-
-      if (d->expr_init)
-        {
-          expr_free(d->expr_init);
-          d->expr_init = NULL;
-        }
-
-      /* initialize */
-      d->expr_init = expr_compile_string(opts[0].val.sval, d->dict);
-
-      if (d->expr_init != NULL)
-        {
-           expr_execute(d->expr_init, d->dict);
-        }
-
-      d->expr_beat = expr_compile_string(opts[1].val.sval, d->dict);
-      d->expr_frame = expr_compile_string(opts[2].val.sval, d->dict);
-      d->expr_point = expr_compile_string(opts[3].val.sval, d->dict);
-
-      d->vfield = g_malloc (sizeof(struct xform_vector)
-			    * d->width * d->height);
-
-      make_table = TRUE;
-   }
-
-   rf = dict_variable(d->dict, "r");
-   df = dict_variable(d->dict, "d");
-
-   if (*opts[2].val.sval != '\0' || pn_new_beat)
-       make_table = TRUE;
-
-   /* run the on-frame script. */
-   if (make_table == TRUE)
-     {
-       if (d->expr_beat != NULL)
-         expr_execute(d->expr_beat, d->dict);
-
-       if (d->expr_frame != NULL)
-         expr_execute(d->expr_frame, d->dict);
-
-       for (j = 0; j < pn_image_data->height; j++)
-         for (i = 0; i < pn_image_data->width; i++)
-           {
-             transform_func(d->vfield, i, j, d->expr_point, d->dict);
-           }
-     }
-
-  apply_xform (d->vfield);
-  pn_swap_surfaces ();
-}
-
-struct pn_actuator_desc builtin_xform_dynmovement =
-{
-  "xform_dynmovement", "Dynamic Movement Transform",
-  "A customizable blitter.",
-  0, xform_dynmovement_opts,
-  xform_dynmovement_init, xform_dynmovement_cleanup, xform_dynmovement_exec
-};
--- a/src/scrobbler/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/scrobbler/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,30 +1,22 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-SUBDIRS = 
-
-OBJECTIVE_LIBS = libscrobbler$(SHARED_SUFFIX)
-
-imagesdir = $(datadir)/audacious/images
-
-OBJECTIVE_DATA = audioscrobbler.png:$(imagesdir)	\
-	   audioscrobbler_badge.png:$(imagesdir)
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+PLUGIN = scrobbler${PLUGIN_SUFFIX}
+SRCS = fmt.c			\
+       configure.c		\
+       gtkstuff.c		\
+       md5.c			\
+       scrobbler.c		\
+       gerpok.c			\
+       plugin.c
 
-LIBADD += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(CURL_LIBS) $(MUSICBRAINZ_LIBS)
+DATA = images/audioscrobbler.png	\
+       images/audioscrobbler_badge.png
+
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-SOURCES = 			\
-	fmt.c			\
-	configure.c		\
-	gtkstuff.c		\
-	md5.c			\
-	scrobbler.c		\
-	gerpok.c		\
-	plugin.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(BEEP_DEFINES) $(CURL_CFLAGS) -I../../intl -I../.. -Wall
+PACKAGE = audacious
 
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+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}
Binary file src/scrobbler/audioscrobbler.png has changed
Binary file src/scrobbler/audioscrobbler_badge.png has changed
--- a/src/scrobbler/fmt.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/scrobbler/fmt.c	Mon Oct 01 05:56:16 2007 -0500
@@ -10,7 +10,7 @@
 char *fmt_escape(const char *str)
 {
 	if (str == NULL)
-		return "";
+		return NULL;
 
 	return curl_escape(str, 0);
 }
@@ -18,7 +18,7 @@
 char *fmt_unescape(char *str)
 {
 	if (str == NULL)
-		return "";
+		return NULL;
 
 	return curl_unescape(str, 0);
 }
Binary file src/scrobbler/images/audioscrobbler.png has changed
Binary file src/scrobbler/images/audioscrobbler_badge.png has changed
--- a/src/sexypsf/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/sexypsf/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,32 +1,22 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libsexypsf$(SHARED_SUFFIX)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+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
 
-SOURCES = \
-	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}
 
-LIBADD = -lz
-
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. -Ispu/ -I.
-
-include ../../mk/objective.mk
-
-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/sid/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/sid/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,45 +1,28 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libsid$(SHARED_SUFFIX)
-
-###
-### Source targets
-###
-EXTRA_DIST = xmms-sid-logo.xpm
-
-# Generals
-TMPFLAGS = $(PICFLAGS) -D_REENTRANT $(PLUGIN_CFLAGS) $(SIDPLAY1_INCLUDES) $(SIDPLAY2_INCLUDES) $(BUILDERS_INCLUDES) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. -DAUDACIOUS_PLUGIN
-CFLAGS   += $(TMPFLAGS)
-CXXFLAGS  += $(TMPFLAGS)
-
-# Generated libraries
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = sid${PLUGIN_SUFFIX}
+SRCS = xs_init.c	\
+       xs_about.c	\
+       xs_support.c	\
+       xs_config.c	\
+       xs_md5.c		\
+       xs_length.c	\
+       xs_genui.c	\
+       xs_glade.c	\
+       xs_interface.c	\
+       xs_stil.c	\
+       xs_fileinfo.c	\
+       xs_filter.c	\
+       xs_sidplay1.cc	\
+       xs_sidplay2.cc	\
+       xs_curve.c	\
+       xs_slsup.c	\
+       xmms-sid.c
 
-LDFLAGS += $(BUILDERS_LDFLAGS)
-LIBADD  = $(SIDPLAY1_LDADD) $(SIDPLAY2_LDADD) $(RESID_LDADD) $(HARDSID_LDADD) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -lstdc++
-SOURCES =	\
-	xs_init.c	\
-	xs_about.c	\
-	xs_support.c	\
-	xs_config.c	\
-	xs_md5.c	\
-	xs_length.c	\
-	xs_genui.c	\
-	xs_glade.c	\
-	xs_interface.c	\
-	xs_stil.c	\
-	xs_fileinfo.c	\
-	xs_filter.c	\
-	xs_sidplay1.cc	\
-	xs_sidplay2.cc	\
-	xs_curve.c	\
-	xs_slsup.c	\
-	xmms-sid.c
+plugindir = audacious/${INPUT_PLUGIN_DIR}
+
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS1 = ${SOURCES:.c=.o}
-OBJECTS = ${OBJECTS1:.cc=.o}
-
-include ../../mk/objective.mk
-
+CPPFLAGS += ${PLUGIN_CPPFLAGS} -D_REENTRANT -I../../intl -I../.. -DAUDACIOUS_PLUGIN ${MOWGLI_CFLAGS} ${SIDPLAY1_INCLUDES} ${SIDPLAY2_INCLUDES} ${BUILDERS_INCLUDES} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS}
+CFLAGS += ${PLUGIN_CFLAGS}
+CXXFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${BUILDERS_LDFLAGS} ${SIDPLAY1_LDADD} ${SIDPLAY2_LDADD} ${RESID_LDADD} ${HARDSID_LDADD} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -lstdc++
--- a/src/sid/config.h.in	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/* src/config.h.in.  Generated from configure.in by autoheader.  */
-
-/* If this macro is defined, a BMP plugin will be built instead of XMMS one.
-   */
-#undef BUILD_FOR_BMP
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if you have HardSID with libSIDPlay 2 */
-#undef HAVE_HARDSID_BUILDER
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
-   to 0 otherwise. */
-#undef HAVE_MALLOC
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
-/* Define if you have reSID with libSIDPlay 2 */
-#undef HAVE_RESID_BUILDER
-
-/* Define if you have and want to use libSIDPlay 1 */
-#undef HAVE_SIDPLAY1
-
-/* Define if you have and want to use libSIDPlay 2 */
-#undef HAVE_SIDPLAY2
-
-/* Define if you have XMMS patched with the songpos patch. */
-#undef HAVE_SONG_POSITION
-
-/* Define to 1 if `stat' has the bug that it succeeds when given the
-   zero-length file name argument. */
-#undef HAVE_STAT_EMPTY_STRING_BUG
-
-/* Define to 1 if stdbool.h conforms to C99. */
-#undef HAVE_STDBOOL_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#undef HAVE_STRCASECMP
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define if you have XMMS version 1.2.5 or later and you want XMMS-SID to
-   support some extra features. */
-#undef HAVE_XMMSEXTRA
-
-/* Define to 1 if the system has the type `_Bool'. */
-#undef HAVE__BOOL
-
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
-   slash. */
-#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Define to empty if the keyword `volatile' does not work. Warning: valid
-   code using `volatile' can become incorrect without. Disable with care. */
-#undef volatile
--- a/src/sid/xmms-sid.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/sid/xmms-sid.c	Mon Oct 01 05:56:16 2007 -0500
@@ -38,7 +38,6 @@
 #include "xs_glade.h"
 #include "xs_player.h"
 #include "xs_slsup.h"
-#include "audacious/playlist.h"
 
 
 /*
--- a/src/sid/xmms-sid.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/sid/xmms-sid.h	Mon Oct 01 05:56:16 2007 -0500
@@ -23,6 +23,7 @@
 #ifndef XMMS_SID_H
 #define XMMS_SID_H
 
+#include <config.h>
 #include "xs_support.h"
 
 #ifdef __cplusplus
--- a/src/sid/xs_fileinfo.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/sid/xs_fileinfo.c	Mon Oct 01 05:56:16 2007 -0500
@@ -141,10 +141,7 @@
 		tmpNode = xs_fileinfostil->subTunes[0];
 	
 	if (tmpNode) {
-		if (tmpNode->pName)
-			subName = tmpNode->pName;
-		else
-			subName = tmpNode->pTitle;
+		subName = tmpNode->pName;
 		subAuthor = tmpNode->pAuthor;
 		subInfo = tmpNode->pInfo;
 	} else {
--- a/src/sid/xs_stil.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/sid/xs_stil.c	Mon Oct 01 05:56:16 2007 -0500
@@ -262,6 +262,8 @@
 
 		default:
 			/* Check if we are parsing an entry */
+			xs_findnext(tmpLine, &linePos);
+			
 			if (!tmpNode) {
 				XS_STILDB_ERR(lineNum, tmpLine,
 					"Entry data encountered outside of entry or syntax error!\n");
@@ -282,8 +284,10 @@
 				tmpNode->subTunes[subEntry]->pName = g_strdup(&tmpLine[9]);
 			} else if (strncmp(tmpLine, "  TITLE:", 8) == 0) {
 				XS_STILDB_MULTI;
-				g_free(tmpNode->subTunes[subEntry]->pTitle);
-				tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]);
+				isMulti = TRUE;
+				if (!tmpNode->subTunes[subEntry]->pTitle)
+					tmpNode->subTunes[subEntry]->pTitle = g_strdup(&tmpLine[9]);
+				xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[2]);
 			} else if (strncmp(tmpLine, " AUTHOR:", 8) == 0) {
 				XS_STILDB_MULTI;
 				g_free(tmpNode->subTunes[subEntry]->pAuthor);
@@ -296,9 +300,10 @@
 				XS_STILDB_MULTI;
 				isMulti = TRUE;
 				xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), tmpLine);
-			} else if (strncmp(tmpLine, "        ", 8) == 0) {
+			} else {
 				if (isMulti) {
-					xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[8]);
+					xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), " ");
+					xs_pstrcat(&(tmpNode->subTunes[subEntry]->pInfo), &tmpLine[linePos]);
 				} else {
 					XS_STILDB_ERR(lineNum, tmpLine,
 					"Entry continuation found when isMulti == FALSE.\n");
--- a/src/sid/xs_support.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/sid/xs_support.h	Mon Oct 01 05:56:16 2007 -0500
@@ -16,7 +16,6 @@
 #include <audacious/plugin.h>
 #include <audacious/output.h>
 #include <audacious/util.h>
-#include <audacious/tuple.h>
 #define HAVE_MEMSET
 #else
 #include <xmms/plugin.h>
--- a/src/smb/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/smb/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,14 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = smb${PLUGIN_SUFFIX}
+SRCS = smb.c
 
-OBJECTIVE_LIBS = libsmb$(SHARED_SUFFIX)
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) -lsmbclient
+include ../../buildsys.mk
+include ../../extra.mk
 
-SOURCES = smb.c
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+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 19 11:03:57 2007 -0500
+++ b/src/sndstretch/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,10 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = sndstretch${PLUGIN_SUFFIX}
+SRCS = sndstretch_xmms.c sndstretch.c
 
-OBJECTIVE_LIBS = libsndstretch$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(EFFECT_PLUGIN_DIR)
+plugindir = audacious/${EFFECT_PLUGIN_DIR}
 
-SOURCES = sndstretch_xmms.c sndstretch.c
-
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) \
-	-I../../intl -I../..
-
-include ../../mk/objective.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 19 11:03:57 2007 -0500
+++ b/src/song_change/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = song_change${PLUGIN_SUFFIX}
+SRCS = song_change.c
 
-OBJECTIVE_LIBS = libsong_change$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = song_change.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(BEEP_DEFINES) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/spectrum/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/spectrum/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = spectrum${PLUGIN_SUFFIX}
+SRCS = spectrum.c
 
-OBJECTIVE_LIBS = libspectrum$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(VISUALIZATION_PLUGIN_DIR)
+plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = spectrum.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/statusicon/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/statusicon/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,14 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libstatusicon$(SHARED_SUFFIX)
-
-noinst_HEADERS = si.h si_ui.h si_cfg.h si_audacious.h si_common.h gtktrayicon.h si.xpm si2.xpm
-
-LIBDIR = $(plugindir)/$(GENERAL_PLUGIN_DIR)
+PLUGIN = statusicon${PLUGIN_SUFFIX}
+SRCS = gtktrayicon-x11.c	\
+       si.c			\
+       si_cfg.c			\
+       si_ui.c
 
-LIBADD = $(GTK_LIBS) $(GDKX11_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-SOURCES = si.c si_ui.c si_cfg.c gtktrayicon-x11.c
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GDKX11_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) \
-	-I../../intl -I../.. -I..
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/stdio/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/stdio/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = stdio${PLUGIN_SUFFIX}
+SRCS = stdio.c
 
-OBJECTIVE_LIBS = libstdio$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(TRANSPORT_PLUGIN_DIR)
-
-SOURCES = stdio.c
+plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-CXXFLAGS = $(CFLAGS)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-include ../../mk/objective.mk
+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} -lmagic
--- a/src/stdio/stdio.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/stdio/stdio.c	Mon Oct 01 05:56:16 2007 -0500
@@ -27,6 +27,8 @@
 
 #include <string.h>
 
+#include <magic.h>
+
 static gchar *
 vfs_stdio_urldecode_path(const gchar * encoded_path)
 {
@@ -249,6 +251,28 @@
     return s.st_size;
 }
 
+static magic_t mdb_handle = NULL;
+
+gchar *
+stdio_vfs_metadata_impl(VFSFile *file, const gchar *field)
+{
+    if (!g_ascii_strcasecmp(field, "content-type"))
+    {
+        gchar *decpath;
+        const gchar *out;
+
+        if (mdb_handle == NULL)
+            mdb_handle = magic_open(MAGIC_MIME);
+
+        decpath = vfs_stdio_urldecode_path(file->uri);
+        out = magic_file(mdb_handle, decpath);
+
+        return g_strdup(out);
+    }
+
+    return NULL;
+}
+
 VFSConstructor file_const = {
 	"file://",
 	stdio_vfs_fopen_impl,
@@ -262,7 +286,8 @@
 	stdio_vfs_ftell_impl,
 	stdio_vfs_feof_impl,
 	stdio_vfs_truncate_impl,
-	stdio_vfs_fsize_impl
+	stdio_vfs_fsize_impl,
+	stdio_vfs_metadata_impl
 };
 
 static void init(void)
--- a/src/stereo_plugin/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/stereo_plugin/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = stereo${PLUGIN_SUFFIX}
+SRCS = stereo.c
 
-OBJECTIVE_LIBS = libstereo$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(EFFECT_PLUGIN_DIR)
+plugindir = audacious/${EFFECT_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = stereo.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/sun/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/sun/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,19 +1,17 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-sunsources =	sun.c	    \
-		audio.c	    \
-		convert.c   \
-		mixer.c	    \
-		configure.c \
-		about.c
+SRCS =	sun.c	    \
+	audio.c	    \
+	convert.c   \
+	mixer.c	    \
+	configure.c \
+	about.c
 
-LIBDIR = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
-OBJECTIVE_LIBS = libsun$(SHARED_SUFFIX)
+PLUGIN = sun$(PLUGIN_SUFFIX)
+plugindir = audacious/$(OUTPUT_PLUGIN_DIR)
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-SOURCES= $(sunsources)
-OBJECTS= ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-include ../../mk/objective.mk
+CFLAGS += $(PLUGIN_CFLAGS)
+CPPFLAGS += $(PLUGIN_CPPFLAGS) $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
+LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+
--- a/src/timidity/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/timidity/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,6 +1,24 @@
-include ../../mk/rules.mk
-include ../../mk/init.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 ../../mk/objective.mk
+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	Mon Oct 01 05:56:16 2007 -0500
@@ -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	Mon Oct 01 05:56:16 2007 -0500
@@ -0,0 +1,2 @@
+#include <gtk/gtk.h>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/timidity/interface.c	Mon Oct 01 05:56:16 2007 -0500
@@ -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	Mon Oct 01 05:56:16 2007 -0500
@@ -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 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS_NOINST = libtimidity.a
-
-SOURCES = \
-	common.c \
-	instrum.c \
-	instrum_dls.c \
-	mix.c \
-	output.c \
-	playmidi.c \
-	readmidi.c \
-	resample.c \
-	stream.c \
-	tables.c \
-	timidity.c
-
-CFLAGS += $(PICFLAGS) -I../../..
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../../mk/objective.mk
--- a/src/timidity/src/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS = libtimidity$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
-
-LIBADD = ../libtimidity/libtimidity.a $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = \
-	callbacks.c \
-	interface.c \
-	xmms-timidity.c \
-
-OBJECTS = ${SOURCES:.c=.o}
-
-LIBDEP = ../libtimidity/libtimidity.a
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../.. -I../libtimidity
-
-include ../../../mk/objective.mk
--- a/src/timidity/src/callbacks.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-#include "callbacks.h"
-#include "interface.h"
-#include "interface.h"
-
-
--- a/src/timidity/src/callbacks.h	Wed Sep 19 11:03:57 2007 -0500
+++ /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 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,247 +0,0 @@
-/*
- * DO NOT EDIT THIS FILE - it is generated by Glade.
- */
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#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 19 11:03:57 2007 -0500
+++ /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 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,438 +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.
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#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 19 11:03:57 2007 -0500
+++ /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	Mon Oct 01 05:56:16 2007 -0500
@@ -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	Mon Oct 01 05:56:16 2007 -0500
@@ -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 19 11:03:57 2007 -0500
+++ b/src/tonegen/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,15 +1,13 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = tonegen${PLUGIN_SUFFIX}
+SRCS = tonegen.c
 
-OBJECTIVE_LIBS = libtonegen$(SHARED_SUFFIX)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-SOURCES = tonegen.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../..
 
-include ../../mk/objective.mk
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/tta/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/tta/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,17 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = tta${PLUGIN_SUFFIX}
+SRCS = libtta.c	\
+       ttadec.c
 
-OBJECTIVE_LIBS = libtta$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
-
-SOURCES = libtta.c ttadec.c
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += -fPIC -DPIC $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
+include ../../buildsys.mk
+include ../../extra.mk
 
-LDFLAGS += $(AUDLDFLAGS)
-LIBADD = -L$(libdir) -laudid3tag $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-include ../../mk/objective.mk
+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/tta/libtta.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/tta/libtta.c	Mon Oct 01 05:56:16 2007 -0500
@@ -28,9 +28,7 @@
  * information.
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdio.h>
 #include <stdlib.h>
--- a/src/voice_removal/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/voice_removal/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = voice_removal${PLUGIN_SUFFIX}
+SRCS = voice_removal.c
 
-OBJECTIVE_LIBS = libvoice_removal$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(EFFECT_PLUGIN_DIR)
+plugindir = audacious/${EFFECT_PLUGIN_DIR}
 
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = voice_removal.c
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/voice_removal/voice_removal.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/voice_removal/voice_removal.c	Mon Oct 01 05:56:16 2007 -0500
@@ -26,13 +26,11 @@
 
 #include "../../config.h"
 
-#define PLUGIN_NAME "voice_removal " PACKAGE_VERSION
-
 static int apply_effect (gpointer *d, gint length, AFormat afmt,
 			gint srate, gint nch);
 
 static EffectPlugin xmms_plugin = {
-	.description = PLUGIN_NAME,
+	.description = "Voice Removal Plugin",
 	.mod_samples = apply_effect,
 };
 
--- a/src/vorbis/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/vorbis/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,14 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libvorbisplugin$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = vorbis${PLUGIN_SUFFIX}
+SRCS = configure.c	\
+       fileinfo.c	\
+       vcedit.c		\
+       vorbis.c
 
-SOURCES = configure.c  fileinfo.c  vcedit.c  vorbis.c
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-LIBADD = $(OGG_VORBIS_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
-
-include ../../mk/objective.mk
+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/vorbis/configure.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/vorbis/configure.c	Mon Oct 01 05:56:16 2007 -0500
@@ -1,6 +1,4 @@
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include "vorbis.h"
 
--- a/src/vorbis/fileinfo.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/vorbis/fileinfo.c	Mon Oct 01 05:56:16 2007 -0500
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 #include <gtk/gtk.h>
--- a/src/vorbis/vorbis.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/vorbis/vorbis.c	Mon Oct 01 05:56:16 2007 -0500
@@ -31,9 +31,7 @@
  * thread-safe.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #define DEBUG
 
--- a/src/vtx/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/vtx/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,17 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libvtx$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = vtx${PLUGIN_SUFFIX}
+SRCS = about.c		\
+       ay8912.c		\
+       config.c		\
+       info.c		\
+       lh5dec.c		\
+       vtx.c		\
+       vtxfile.c
 
-SOURCES = lh5dec.c ay8912.c about.c config.c info.c vtx.c vtxfile.c 
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-LIBADD = $(VTX_LIBS)
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) -I. -I../../intl -I../.. -I../..
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../.. -I.
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/vtx/vtx.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/vtx/vtx.h	Mon Oct 01 05:56:16 2007 -0500
@@ -1,9 +1,7 @@
 #ifndef VTX_H
 #define VTX_H
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include <pthread.h>
 
--- a/src/wav/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/wav/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,16 +1,12 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+include ../../extra.mk
 
-OBJECTIVE_LIBS = libwav$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = wav${PLUGIN_SUFFIX}
+SRCS = wav${WAV_SNDFILE}.c
 
-SOURCES = wav$(WAV_SNDFILE).c
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-LIBADD = -L/usr/local/lib $(SNDFILE_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+include ../../buildsys.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../.. -Wall
-
-OBJECTS = ${SOURCES:.c=.o}
-
-include ../../mk/objective.mk
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. 
+CFLAGS += ${PLUGIN_CFLAGS}
+LIBS += ${MOWGLI_LIBS} ${SNDFILE_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/wav/wav-sndfile.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/wav/wav-sndfile.c	Mon Oct 01 05:56:16 2007 -0500
@@ -28,9 +28,7 @@
  *   - TITLE_LEN removed
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 #include <string.h>
@@ -114,7 +112,7 @@
 
 	tuple_associate_string(ti, FIELD_ARTIST, NULL, sf_get_string(tmp_sndfile, SF_STR_ARTIST));
 	tuple_associate_string(ti, FIELD_COMMENT, NULL, sf_get_string(tmp_sndfile, SF_STR_COMMENT));
-	tuple_associate_string(ti, -1, "date", sf_get_string(tmp_sndfile, SF_STR_DATE));
+	tuple_associate_string(ti, FIELD_DATE, NULL, sf_get_string(tmp_sndfile, SF_STR_DATE));
 	tuple_associate_string(ti, -1, "software", sf_get_string(tmp_sndfile, SF_STR_SOFTWARE));
 
 	g_free(realfn); realfn = NULL;
--- a/src/wav/wav.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/wav/wav.c	Mon Oct 01 05:56:16 2007 -0500
@@ -19,9 +19,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include "wav.h"
 
@@ -163,13 +161,6 @@
     return 0;
 }
 
-static const gchar *
-get_extension(const gchar * filename)
-{
-    const gchar *ext = strrchr(filename, '.');
-    return ext ? ext + 1 : NULL;
-}
-
 static gboolean
 is_our_file(gchar * filename)
 {
@@ -189,7 +180,6 @@
 {
     Tuple *tuple;
     gchar *title;
-    gchar *scratch;
 
     tuple = tuple_new_from_filename(filename);
 
--- a/src/wav/wav.h	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/wav/wav.h	Mon Oct 01 05:56:16 2007 -0500
@@ -18,9 +18,7 @@
 #ifndef WAV_H
 #define WAV_H
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "config.h"
 
 #include <glib.h>
 
--- a/src/wavpack/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/wavpack/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,14 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = wavpack${PLUGIN_SUFFIX}
+SRCS = tags.cxx		\
+       ui.cxx		\
+       libwavpack.cxx
 
-OBJECTIVE_LIBS = libwavpackplugin$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
-
-SOURCES = tags.cxx ui.cxx libwavpack.cxx
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-LIBADD = -L/usr/local/lib $(WAVPACK_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+include ../../buildsys.mk
+include ../../extra.mk
 
-CXXFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(WAVPACK_CFLAGS) -I../../intl -I../..
-
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${DBUS_CFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${WAVPACK_CFLAGS} -I../../intl -I../..
+CXXFLAGS += ${PLUGIN_CFLAGS}
 LDFLAGS += -lstdc++
-
-OBJECTS = ${SOURCES:.cxx=.o}
-
-include ../../mk/objective.mk
+LIBS += ${WAVPACK_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/wma/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/wma/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,20 +1,30 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libwma$(SHARED_SUFFIX)
-
-SUBDIRS = libffwma
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = wma${PLUGIN_SUFFIX}
+SRCS = wma.c			\
+       libffwma/allcodecs.c	\
+       libffwma/allformats.c	\
+       libffwma/asf.c		\
+       libffwma/avio.c		\
+       libffwma/aviobuf.c	\
+       libffwma/common.c	\
+       libffwma/cutils.c	\
+       libffwma/dsputil.c	\
+       libffwma/fft.c		\
+       libffwma/file.c		\
+       libffwma/futils.c	\
+       libffwma/mdct.c		\
+       libffwma/os_support.c	\
+       libffwma/parser.c	\
+       libffwma/simple_idct.c	\
+       libffwma/utils.c		\
+       libffwma/wmadec.c	\
+       libffwma/mem.c		\
+       libffwma/uri.c
 
-LIBADD = ./libffwma/libffwma.a $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
-
-SOURCES = wma.c
-
-OBJECTS = ${SOURCES:.c=.o}
+plugindir = audacious/${INPUT_PLUGIN_DIR}
 
-LIBDEP = ./libffwma/libffwma.a
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../.. -I./libffwma -std=c99 $(GCC42_CFLAGS)
-
-include ../../mk/objective.mk
+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}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/wma/libffwma/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS_NOINST=	libffwma.a
-
-SOURCES=	allcodecs.c allformats.c \
-		asf.c avio.c aviobuf.c \
-		common.c cutils.c dsputil.c \
-		fft.c file.c futils.c mdct.c \
-		os_support.c \
-		parser.c simple_idct.c \
-		utils.c wmadec.c mem.c uri.c
-
-CFLAGS+=	$(PICFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -I../../..
-
-OBJECTS=${SOURCES:.c=.o}
-
-include ../../../mk/objective.mk
--- a/src/wma/wma.c	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/wma/wma.c	Mon Oct 01 05:56:16 2007 -0500
@@ -23,6 +23,9 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 #define _XOPEN_SOURCE 600
+
+#include "config.h"
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <math.h>
--- a/src/xspf/Makefile	Wed Sep 19 11:03:57 2007 -0500
+++ b/src/xspf/Makefile	Mon Oct 01 05:56:16 2007 -0500
@@ -1,18 +1,11 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = xspf${PLUGIN_SUFFIX}
+SRCS = xspf.c
 
-OBJECTIVE_LIBS = libxspf$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(CONTAINER_PLUGIN_DIR)
-
-SOURCES = xspf.c
+plugindir = audacious/${CONTAINER_PLUGIN_DIR}
 
-OBJECTS = ${SOURCES:.c=.o}
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(XML_CPPFLAGS) -I../../intl -I../.. -Wall
+include ../../buildsys.mk
+include ../../extra.mk
 
-CXXFLAGS = $(CFLAGS)
-
-LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(XML_LIBS)
-
-include ../../mk/objective.mk
+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/xspf/base64.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/**
- * \file base64.c
- * \brief base-64 conversion routines.
- *
- * \author Eric S. Raymond <esr@snark.thyrsus.com>.
- *
- * For license terms, see the file COPYING.
- *
- * This base 64 encoding is defined in RFC2045 section 6.8,
- * "Base64 Content-Transfer-Encoding", but lines must not be broken in the
- * scheme used here.
- */
-#include <ctype.h>
-
-
-static const char base64digits[] =
-   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-#define BAD	-1
-static const char base64val[] = {
-    BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,
-    BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,
-    BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD, 62, BAD,BAD,BAD, 63,
-     52, 53, 54, 55,  56, 57, 58, 59,  60, 61,BAD,BAD, BAD,BAD,BAD,BAD,
-    BAD,  0,  1,  2,   3,  4,  5,  6,   7,  8,  9, 10,  11, 12, 13, 14,
-     15, 16, 17, 18,  19, 20, 21, 22,  23, 24, 25,BAD, BAD,BAD,BAD,BAD,
-    BAD, 26, 27, 28,  29, 30, 31, 32,  33, 34, 35, 36,  37, 38, 39, 40,
-     41, 42, 43, 44,  45, 46, 47, 48,  49, 50, 51,BAD, BAD,BAD,BAD,BAD
-};
-#define DECODE64(c)  (isascii(c) ? base64val[c] : BAD)
-
-/**
- * \brief Raw bytes in quasi-big-endian order to base 64 string (NUL-terminated)
- *
- * \param[out]	out	A pointer to a char to hold the converted string
- * \param[in]	in	String to convert
- * \param[in]	inlen	Length of the string to be converted
- */
-void to64frombits(unsigned char *out, const unsigned char *in, int inlen)
-{
-	for (; inlen >= 3; inlen -= 3)
-	{
-		*out++ = base64digits[in[0] >> 2];
-		*out++ = base64digits[((in[0] << 4) & 0x30) | (in[1] >> 4)];
-		*out++ = base64digits[((in[1] << 2) & 0x3c) | (in[2] >> 6)];
-		*out++ = base64digits[in[2] & 0x3f];
-		in += 3;
-	}
-
-	if (inlen > 0)
-	{
-		unsigned char fragment;
-
-		*out++ = base64digits[in[0] >> 2];
-		fragment = (in[0] << 4) & 0x30;
-
-		if (inlen > 1)
-			fragment |= in[1] >> 4;
-
-		*out++ = base64digits[fragment];
-		*out++ = (inlen < 2) ? '=' : base64digits[(in[1] << 2) & 0x3c];
-		*out++ = '=';
-	}
-	
-	*out = '\0';
-}
-
-/**
- * \brief base 64 to raw bytes in quasi-big-endian order, returning count of bytes
- *
- * \param[out]	out	Where to save the converted string
- * \param[in]	in	String to convert
- * \return Number of converted bytes.
- */
-int from64tobits(char *out, const char *in)
-{
-	int len = 0;
-	register unsigned char digit1, digit2, digit3, digit4;
-
-	if (in[0] == '+' && in[1] == ' ')
-		in += 2;
-	if (*in == '\r')
-		return(0);
-
-	do {
-		digit1 = in[0];
-		if (DECODE64(digit1) == BAD)
-			return(-1);
-		digit2 = in[1];
-		if (DECODE64(digit2) == BAD)
-			return(-1);
-		digit3 = in[2];
-		if (digit3 != '=' && DECODE64(digit3) == BAD)
-			return(-1);
-		digit4 = in[3];
-		if (digit4 != '=' && DECODE64(digit4) == BAD)
-			return(-1);
-		in += 4;
-		*out++ = (DECODE64(digit1) << 2) | (DECODE64(digit2) >> 4);
-		++len;
-		if (digit3 != '=')
-		{
-			*out++ = ((DECODE64(digit2) << 4) & 0xf0) | (DECODE64(digit3) >> 2);
-			++len;
-			if (digit4 != '=')
-			{
-				*out++ = ((DECODE64(digit3) << 6) & 0xc0) | DECODE64(digit4);
-				++len;
-			}
-		}
-	} while (*in && *in != '\r' && digit4 != '=');
-
-	return (len);
-}
--- a/src/xspf/base64.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/**
- * \file base64.h
- * \brief This file has all base64.c declarations
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * See COPYING for details.
- */
-
-#ifndef BASE64_H_
-#define BASE64_H_
-
-void to64frombits(unsigned char*,const unsigned char*,int);
-int from64tobits(char*,const char*);
-
-#endif /* BASE64_H_ */
--- a/src/xspf/urlencode.c	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/* the original code was taken from wget-1.10.2 */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-#include <ctype.h>
-#include "urlencode.h"
-
-enum {
-  /* rfc1738 reserved chars + "$" and ",".  */
-  urlchr_reserved = 1,
-
-  /* rfc1738 unsafe chars, plus non-printables.  */
-  urlchr_unsafe   = 2
-};
-
-#define urlchr_test(c, mask) (urlchr_table[(unsigned char)(c)] & (mask))
-#define URL_RESERVED_CHAR(c) urlchr_test(c, urlchr_reserved)
-#define URL_UNSAFE_CHAR(c) urlchr_test(c, urlchr_unsafe)
-#define XNUM_TO_DIGIT(x) ("0123456789ABCDEF"[x] + 0)
-#define ISXDIGIT(x) (isxdigit((unsigned char)(x)))
-#define X2DIGITS_TO_NUM(h1, h2) ((XDIGIT_TO_NUM (h1) << 4) + XDIGIT_TO_NUM (h2))
-#define XDIGIT_TO_NUM(h) ((h) < 'A' ? (h) - '0' : toupper (h) - 'A' + 10)
-
-/* Shorthands for the table: */
-#define R  urlchr_reserved
-#define U  urlchr_unsafe
-#define RU R|U
-
-static const unsigned char urlchr_table[256] =
-{
-  U,  U,  U,  U,   U,  U,  U,  U,   /* NUL SOH STX ETX  EOT ENQ ACK BEL */
-  U,  U,  U,  U,   U,  U,  U,  U,   /* BS  HT  LF  VT   FF  CR  SO  SI  */
-  U,  U,  U,  U,   U,  U,  U,  U,   /* DLE DC1 DC2 DC3  DC4 NAK SYN ETB */
-  U,  U,  U,  U,   U,  U,  U,  U,   /* CAN EM  SUB ESC  FS  GS  RS  US  */
-  U,  0,  U, RU,   R,  U,  R,  0,   /* SP  !   "   #    $   %   &   '   */
-  0,  0,  0,  R,   R,  0,  0,  R,   /* (   )   *   +    ,   -   .   /   */
-  0,  0,  0,  0,   0,  0,  0,  0,   /* 0   1   2   3    4   5   6   7   */
-  0,  0, RU,  R,   U,  R,  U,  R,   /* 8   9   :   ;    <   =   >   ?   */
- RU,  0,  0,  0,   0,  0,  0,  0,   /* @   A   B   C    D   E   F   G   */
-  0,  0,  0,  0,   0,  0,  0,  0,   /* H   I   J   K    L   M   N   O   */
-  0,  0,  0,  0,   0,  0,  0,  0,   /* P   Q   R   S    T   U   V   W   */
-  0,  0,  0, RU,   U, RU,  U,  0,   /* X   Y   Z   [    \   ]   ^   _   */
-  U,  0,  0,  0,   0,  0,  0,  0,   /* `   a   b   c    d   e   f   g   */
-  0,  0,  0,  0,   0,  0,  0,  0,   /* h   i   j   k    l   m   n   o   */
-  0,  0,  0,  0,   0,  0,  0,  0,   /* p   q   r   s    t   u   v   w   */
-  0,  0,  0,  U,   U,  U,  0,  U,   /* x   y   z   {    |   }   ~   DEL */
-
-  U, U, U, U,  U, U, U, U,  U, U, U, U,  U, U, U, U,
-  U, U, U, U,  U, U, U, U,  U, U, U, U,  U, U, U, U,
-  U, U, U, U,  U, U, U, U,  U, U, U, U,  U, U, U, U,
-  U, U, U, U,  U, U, U, U,  U, U, U, U,  U, U, U, U,
-
-  U, U, U, U,  U, U, U, U,  U, U, U, U,  U, U, U, U,
-  U, U, U, U,  U, U, U, U,  U, U, U, U,  U, U, U, U,
-  U, U, U, U,  U, U, U, U,  U, U, U, U,  U, U, U, U,
-  U, U, U, U,  U, U, U, U,  U, U, U, U,  U, U, U, U,
-};
-#undef R
-#undef U
-#undef RU
-
-/* URL-unescape the string S.
-
-   This is done by transforming the sequences "%HH" to the character
-   represented by the hexadecimal digits HH.  If % is not followed by
-   two hexadecimal digits, it is inserted literally.
-
-   The transformation is done in place.  If you need the original
-   string intact, make a copy before calling this function.  */
-
-char *
-xspf_url_decode (const char *s)
-{
-    char *copy = strdup(s);
-    char *t = copy;			/* t - tortoise */
-    char *h = copy;			/* h - hare     */
-
-    for (; *h; h++, t++)
-    {
-        if (*h != '%')
-        {
-        copychar:
-            *t = *h;
-        }
-        else
-        {
-            char c;
-            /* Do nothing if '%' is not followed by two hex digits. */
-            if (!h[1] || !h[2] || !(ISXDIGIT (h[1]) && ISXDIGIT (h[2])))
-                goto copychar;
-            c = X2DIGITS_TO_NUM (h[1], h[2]);
-            /* Don't unescape %00 because there is no way to insert it
-               into a C string without effectively truncating it. */
-            if (c == '\0')
-                goto copychar;
-            *t = c;
-            h += 2;
-        }
-    }
-    *t = '\0';
-    return copy;
-}
-
-/* The core of url_escape_* functions.  Escapes the characters that
-   match the provided mask in urlchr_table.
-
-   If ALLOW_PASSTHROUGH is non-zero, a string with no unsafe chars
-   will be returned unchanged.  If ALLOW_PASSTHROUGH is zero, a
-   freshly allocated string will be returned in all cases.  */
-
-static char *
-url_escape_1 (const char *s, unsigned char mask, int allow_passthrough)
-{
-  const char *p1;
-  char *p2, *newstr;
-  int newlen;
-  int addition = 0;
-
-  for (p1 = s; *p1; p1++)
-    if (urlchr_test (*p1, mask))
-      addition += 2;		/* Two more characters (hex digits) */
-
-  if (!addition)
-    return allow_passthrough ? (char *)s : strdup (s);
-
-  newlen = (p1 - s) + addition;
-  newstr = (char *)malloc (newlen + 1);
-
-  p1 = s;
-  p2 = newstr;
-  while (*p1)
-    {
-      /* Quote the characters that match the test mask. */
-      if (urlchr_test (*p1, mask))
-	{
-	  unsigned char c = *p1++;
-	  *p2++ = '%';
-	  *p2++ = XNUM_TO_DIGIT (c >> 4);
-	  *p2++ = XNUM_TO_DIGIT (c & 0xf);
-	}
-      else
-	*p2++ = *p1++;
-    }
-  g_return_val_if_fail (p2 - newstr == newlen, NULL);
-  *p2 = '\0';
-
-  return newstr;
-}
-
-/* URL-escape the unsafe characters (see urlchr_table) in a given
-   string, returning a freshly allocated string.  */
-
-char *
-xspf_url_encode (const char *s)
-{
-  return url_escape_1 (s, urlchr_unsafe, 0);
-}
--- a/src/xspf/urlencode.h	Wed Sep 19 11:03:57 2007 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-/* prototypes */
-
-char *xspf_url_decode(const char *url);
-char *xspf_url_encode(const char *path);