changeset 2038:04155ce9e72e

Automated merge with file:/home/ccr/audacious/plugins
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 13 Oct 2007 21:53:47 +0300
parents 33d6f1dc7cfb (current diff) b8fbf081bdfa (diff)
children 0be10f2f78ca
files .depend mk/init.mk mk/objective.mk mk/rules.mk.in src/aac/Makefile src/cdaudio-ng/cdaudio-ng.c src/curl/Makefile src/curl/curl.c src/sid/xs_support.h src/timidity/Makefile
diffstat 200 files changed, 1921 insertions(+), 3716 deletions(-) [+]
line wrap: on
line diff
--- a/buildsys.mk.in	Sat Oct 13 21:53:37 2007 +0300
+++ b/buildsys.mk.in	Sat Oct 13 21:53:47 2007 +0300
@@ -58,7 +58,7 @@
 exec_prefix = @exec_prefix@
 bindir = @bindir@
 libdir = @libdir@
-plugindir ?= ${PACKAGE}
+plugindir ?= ${libdir}/${PACKAGE}
 datarootdir = @datarootdir@
 datadir = @datadir@
 includedir = @includedir@
@@ -91,6 +91,7 @@
 
 depend: pre-depend ${SRCS}
 	regen=0; \
+	test -f .deps || regen=1; \
 	for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \
 	if test x"$$regen" = x"1"; then \
 		list=""; \
@@ -106,7 +107,6 @@
 			if ${CPP} ${CPPFLAGS} -M $$list >.deps; then \
 				${DEPEND_OK}; \
 			else \
-				rm -f .deps; \
 				${DEPEND_FAILED}; \
 			fi; \
 		fi; \
@@ -221,7 +221,7 @@
 
 	for i in ${PLUGIN}; do \
 		${INSTALL_STATUS}; \
-		if ${MKDIR_P} ${DESTDIR}${libdir}/${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/${plugindir}/$$i; then \
+		if ${MKDIR_P} ${DESTDIR}${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i; then \
 			${INSTALL_OK}; \
 		else \
 			${INSTALL_FAILED}; \
@@ -294,15 +294,15 @@
 	done
 
 	for i in ${PLUGIN}; do \
-		if test -f ${DESTDIR}${libdir}/${plugindir}/$$i; then \
-			if rm -f ${DESTDIR}${libdir}/${plugindir}/$$i; then \
+		if test -f ${DESTDIR}${plugindir}/$$i; then \
+			if rm -f ${DESTDIR}${plugindir}/$$i; then \
 				${DELETE_OK}; \
 			else \
 				${DELETE_FAILED}; \
 			fi \
 		fi \
 	done
-	-rmdir ${DESTDIR}${libdir}/${plugindir} >/dev/null 2>&1
+	-rmdir ${DESTDIR}${plugindir} >/dev/null 2>&1
 
 	for i in ${DATA}; do \
 		if test -f ${DESTDIR}${datadir}/${PACKAGE}/$$i; then \
@@ -371,7 +371,7 @@
 		${DIR_LEAVE}; \
 	done
 	
-	for i in ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST}  ${PLUGIN} ${PLUGIN_NOINST} ${DISTCLEAN} *~; do \
+	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}; \
@@ -381,21 +381,21 @@
 		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
+DIR_ENTER = printf "\033[K\033[0;36mEntering directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd $$i || exit 1
+DIR_LEAVE = printf "\033[K\033[0;36mLeaving directory \033[1;36m$$i\033[0;36m.\033[0m\n"; cd .. || exit 1
+DEPEND_STATUS = printf "\033[K\033[0;33mGenerating dependencies...\033[0m\r"
+DEPEND_OK = printf "\033[K\033[0;32mSuccessfully generated dependencies.\033[0m\n"
+DEPEND_FAILED = printf "\033[K\033[0;31mFailed to generate dependencies!\033[0m\n"; exit 1
+COMPILE_STATUS = printf "\033[K\033[0;33mCompiling \033[1;33m$<\033[0;33m...\033[0m\r"
+COMPILE_OK = printf "\033[K\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m.\033[0m\n"
+COMPILE_FAILED = printf "\033[K\033[0;31mFailed to compile \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
+LINK_STATUS = printf "\033[K\033[0;33mLinking \033[1;33m$@\033[0;33m...\033[0m\r"
+LINK_OK = printf "\033[K\033[0;32mSuccessfully linked \033[1;32m$@\033[0;32m.\033[0m\n"
+LINK_FAILED = printf "\033[K\033[0;31mFailed to link \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
+INSTALL_STATUS = printf "\033[K\033[0;33mInstalling \033[1;33m$$i\033[0;33m...\033[0m\r"
+INSTALL_OK = printf "\033[K\033[0;32mSuccessfully installed \033[1;32m$$i\033[0;32m.\033[0m\n"
+INSTALL_FAILED = printf "\033[K\033[0;31mFailed to install \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1
+DELETE_OK = printf "\033[K\033[0;34mDeleted \033[1;34m$$i\033[0;34m.\033[0m\n"
+DELETE_FAILED = printf "\033[K\033[0;31mFailed to delete \033[1;31m$$i\033[0;31m!\033[0m\n"; exit 1
 
 -include .deps
--- a/configure.ac	Sat Oct 13 21:53:37 2007 +0300
+++ b/configure.ac	Sat Oct 13 21:53:47 2007 +0300
@@ -41,6 +41,10 @@
 AC_ISC_POSIX
 AC_C_BIGENDIAN
 
+if test x"$GCC" = x"yes"; then
+	CFLAGS="$CFLAGS -pipe -Wall"
+	CXXFLAGS="$CXXFLAGS -pipe -Wall"
+fi
 
 dnl Locate a program and check that its version is acceptable.
 dnl AC_PROG_CHECK_VER(var, namelist, version-switch,
@@ -605,6 +609,7 @@
 
 if test "$have_adplug" = "yes"; then
 	INPUT_PLUGINS="$INPUT_PLUGINS adplug"
+	AC_SUBST(BINIO_CFLAGS)
 fi
 
 dnl *** Ogg Vorbis
@@ -748,6 +753,7 @@
 
 if test "$enable_musepack" = "yes"; then
         INPUT_PLUGINS="$INPUT_PLUGINS musepack"
+        AC_SUBST(TAGLIB_CFLAGS)
 fi
 
 dnl *** WMA
@@ -1057,8 +1063,8 @@
   INPUT_PLUGINS="$INPUT_PLUGINS amidi-plug"
   PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.6.0],,)
   PKG_CHECK_MODULES(GMODULE, [gmodule-2.0 >= 2.6.0],,)
-  AMIDIPLUGBACKENDDIR=${libdir}/audacious/amidi-plug
-  AC_SUBST(AMIDIPLUGBACKENDDIR)
+  AMIDIPLUG_BACKEND_DIR=amidi-plug
+  AC_SUBST(AMIDIPLUG_BACKEND_DIR)
   if test "x$enable_amidiplug_alsa" = "xauto" -o "x$enable_amidiplug_alsa" = "xyes"; then
     if test "x$alsalib_available" = "xcheck"; then
       PKG_CHECK_MODULES(ALSA, [alsa >= 1.0],
@@ -1254,6 +1260,7 @@
 dnl *** Scrobbler ***
 
 scrobbler="yes"
+have_lastfm="no"
 
 dnl libcurl check
 
@@ -1263,13 +1270,9 @@
 dnl check_hex must be UPPERCASE if any hex letters are present
 check_hex="070907"
 
-have_curl="no"
-have_lastfm="no"
-PKG_CHECK_MODULES(CURL, [libcurl >= 7.9.7],
-[
-	TRANSPORT_PLUGINS="$TRANSPORT_PLUGINS curl"
-	have_curl="yes"
-], [scrobbler="no"])
+PKG_CHECK_MODULES(CURL, [libcurl >= 7.9.7], [], [scrobbler="no"])
+AC_SUBST(CURL_CFLAGS)
+AC_SUBST(CURL_LIBS)
 
 if test "x$scrobbler" = "xyes"; then
 	GENERAL_PLUGINS="$GENERAL_PLUGINS scrobbler"
@@ -1277,9 +1280,6 @@
 	have_lastfm="yes"
 fi
 
-AC_SUBST(CURL_CFLAGS)
-AC_SUBST(CURL_LIBS)
-
 dnl *** End of Scrobbler checks ***
 
 dnl *** neon http plugin ***
@@ -1287,7 +1287,7 @@
 AC_ARG_ENABLE(neon,
 [  --enable-neon           enable neon support (experimental).  (default=disabled)],
 [have_neon=$enableval],
-[have_neon=no])
+[have_neon=yes])
 
 if test "x$have_neon" = "xyes"; then
     PKG_CHECK_MODULES(NEON, [neon >= 0.26], [TRANSPORT_PLUGINS="$TRANSPORT_PLUGINS neon" ], [have_neon="no"])
@@ -1577,7 +1577,6 @@
 AC_CONFIG_FILES([
 	buildsys.mk
 	extra.mk
-	mk/rules.mk
 	po/Makefile.in
 ])
 
@@ -1669,7 +1668,6 @@
 echo "  Transport"
 echo "  ---------"
 echo "  stdio transport:                        yes"
-echo "  curl-based http/https:                  $have_curl"
 echo "  neon-based http/https:                  $have_neon"
 echo "  libmms-based mms:                       $have_mms"
 echo "  lastfm transport:                       $have_lastfm"
--- a/extra.mk.in	Sat Oct 13 21:53:37 2007 +0300
+++ b/extra.mk.in	Sat Oct 13 21:53:47 2007 +0300
@@ -62,7 +62,7 @@
 ALSA_LIBS ?= @ALSA_LIBS@
 AMDEP_FALSE ?= @AMDEP_FALSE@
 AMDEP_TRUE ?= @AMDEP_TRUE@
-AMIDIPLUGBACKENDDIR ?= @AMIDIPLUGBACKENDDIR@
+AMIDIPLUG_BACKEND_DIR ?= @AMIDIPLUG_BACKEND_DIR@
 AMIDIPLUG_BACKENDS ?= @AMIDIPLUG_BACKENDS@
 AMTAR ?= @AMTAR@
 AR ?= @AR@
@@ -315,7 +315,6 @@
 mandir ?= @mandir@
 mkdir_p ?= @mkdir_p@
 oldincludedir ?= @oldincludedir@
-plugindir ?= @plugindir@
 pluginsubs ?= @pluginsubs@
 prefix ?= @prefix@
 program_transform_name ?= @program_transform_name@
@@ -378,3 +377,4 @@
 LIBFLAC_CFLAGS ?= @LIBFLAC_CFLAGS@
 MOWGLI_CFLAGS ?= @MOWGLI_CFLAGS@
 MOWGLI_LIBS ?= @MOWGLI_LIBS@
+plugindir = @plugindir@
--- a/m4/buildsys.m4	Sat Oct 13 21:53:37 2007 +0300
+++ b/m4/buildsys.m4	Sat Oct 13 21:53:47 2007 +0300
@@ -19,7 +19,7 @@
 dnl
 
 AC_DEFUN([BUILDSYS_PROG_IMPLIB], [
-	AC_MSG_CHECKING(wether we need an implib)
+	AC_MSG_CHECKING(whether we need an implib)
 	case "$target" in
 		*-*-cygwin | *-*-mingw32)
 			AC_MSG_RESULT(yes)
--- a/mk/init.mk	Sat Oct 13 21:53:37 2007 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-# Shut up GNU make
-.SILENT:
-
-OBJECTIVE_DIRECTORIES = 
-OBJECTIVE_LIBS = 
-OBJECTIVE_LIBS_NOINST = 
-OBJECTIVE_BINS = 
-OBJECTIVE_DATA = 
-SUBDIRS = 
-HEADERS = 
-V = 0
-VERBOSE ?= $(V)
-VERBOSITY = 0
-SHOW_CFLAGS ?= $(VERBOSE)
-
-LIBDIR = $(libdir)
-BINDIR = $(bindir)
-INCLUDEDIR = $(pkgincludedir)
-CFLAGS += -DHAVE_CONFIG_H -I/usr/pkg/include -I/usr/pkg/xorg/include
-CXXFLAGS += -DHAVE_CONFIG_H -I/usr/pkg/include -I/usr/pkg/xorg/include
--- a/mk/objective.mk	Sat Oct 13 21:53:37 2007 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,284 +0,0 @@
-default: all
-all: build
-
-.SUFFIXES: .cxx .cc
-
-install: build
-	$(MAKE) install-prehook
-	@for i in $(BINDIR) $(LIBDIR) $(INCLUDEDIR); do \
-		if [ ! -d $(DESTDIR)/$$i ]; then \
-			$(INSTALL) -d -m 755 $(DESTDIR)/$$i; \
-		fi; \
-	done;
-	@if [ "x$(OVERLAYS)" != "x" ]; then \
-		for i in `find $(OVERLAYS) -type d -maxdepth 1 -mindepth 1`; do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[installing overlay: $$i]"; \
-			fi; \
-			cd $$i; OVERLAYS="" $(MAKE) install || exit; cd ..; \
-		done; \
-	fi
-	@if [ "x$(SUBDIRS)" != "x" ]; then \
-		for i in $(SUBDIRS); do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[installing subobjective: $$i]"; \
-			fi; \
-			cd $$i; OVERLAYS="" $(MAKE) install || exit; cd ..; \
-		done; \
-	fi
-	@if [ "x$(OBJECTIVE_DIRECTORIES)" != "x" ]; then \
-		for i in $(OBJECTIVE_DIRECTORIES); do \
-			printf "%10s     %-20s\n" MKDIR $$i; \
-			$(INSTALL) -d -m 755 $(DESTDIR)/$$i; \
-		done; \
-	fi
-	@if [ "x$(HEADERS)" != "x" ]; then \
-		for i in $(HEADERS); do \
-			printf "%10s     %-20s\n" INSTALL $$i; \
-			$(INSTALL_DATA) $(INSTALL_OVERRIDE) $$i $(DESTDIR)/$(INCLUDEDIR)/$$i; \
-		done; \
-	fi
-	@if [ "x$(OBJECTIVE_LIBS)" != "x" ]; then \
-		for i in $(OBJECTIVE_LIBS); do \
-			printf "%10s     %-20s\n" INSTALL $$i; \
-			$(INSTALL) $(INSTALL_OVERRIDE) $$i $(DESTDIR)/$(LIBDIR)/$$i; \
-		done; \
-	fi
-	@if [ "x$(OBJECTIVE_BINS)" != "x" ]; then \
-		for i in $(OBJECTIVE_BINS); do \
-			printf "%10s     %-20s\n" INSTALL $$i; \
-			$(INSTALL) $(INSTALL_OVERRIDE) $$i $(DESTDIR)/$(BINDIR)/$$i; \
-		done; \
-	fi;
-	@if [ "x$(OBJECTIVE_DATA)" != "x" ]; then \
-		for i in $(OBJECTIVE_DATA); do \
-			source=`echo $$i | cut -d ":" -f1`; \
-			destination=`echo $$i | cut -d ":" -f2`; \
-			if [ ! -d $(DESTDIR)/$$destination ]; then \
-				$(INSTALL) -d -m 755 $(DESTDIR)/$$destination; \
-			fi; \
-			printf "%10s     %-20s\n" INSTALL $$source; \
-			$(INSTALL_DATA) $(INSTALL_OVERRIDE) $$source $(DESTDIR)/$$destination; \
-		done; \
-	fi
-	$(MAKE) install-posthook
-	@if [ $(VERBOSITY) -gt 0 ]; then \
-		echo "[all objectives installed]"; \
-	fi
-
-clean:
-	$(MAKE) clean-prehook
-	@if [ "x$(OVERLAYS)" != "x" ]; then \
-		for i in `find $(OVERLAYS) -type d -maxdepth 1 -mindepth 1`; do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[cleaning overlay: $$i]"; \
-			fi; \
-			cd $$i; OVERLAYS="" $(MAKE) clean || exit; cd ..; \
-		done; \
-	fi
-	@if [ "x$(SUBDIRS)" != "x" ]; then \
-		for i in $(SUBDIRS); do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[cleaning subobjective: $$i]"; \
-			fi; \
-			cd $$i; OVERLAYS="" $(MAKE) clean || exit; cd ..; \
-		done; \
-	fi
-	$(MAKE) clean-posthook
-	rm -f *.o *.lo *.so *.a *.sl .depend-done .depend
-	touch .depend
-	@if [ "x$(OBJECTIVE_BINS)" != "x" ]; then \
-		for i in $(OBJECTIVE_BINS); do \
-			rm -f $$i; \
-		done; \
-	fi
-	@if [ "x$(OBJECTIVE_LIBS)" != "x" ]; then \
-		for i in $(OBJECTIVE_LIBS); do \
-			rm -f $$i; \
-		done; \
-	fi
-	@if [ "x$(OBJECTIVE_LIBS_NOINST)" != "x" ]; then \
-		for i in $(OBJECTIVE_LIBS_NOINST); do \
-			rm -f $$i; \
-		done; \
-	fi
-	@if [ $(VERBOSITY) -gt 0 ]; then \
-		echo "[all objectives cleaned]"; \
-	fi
-
-distclean: clean
-	@if [ "x$(OVERLAYS)" != "x" ]; then \
-		for i in `find $(OVERLAYS) -type d -maxdepth 1 -mindepth 1`; do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[distcleaning overlay: $$i]"; \
-			fi; \
-			cd $$i; OVERLAYS="" $(MAKE) distclean || exit; cd ..; \
-		done; \
-	fi
-	@if [ "x$(SUBDIRS)" != "x" ]; then \
-		for i in $(SUBDIRS); do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[distcleaning subobjective: $$i]"; \
-			fi; \
-			cd $$i; OVERLAYS="" $(MAKE) distclean || exit; cd ..; \
-		done; \
-	fi
-	@if [ -f Makefile.in ]; then \
-		rm -f Makefile; \
-	fi
-	@if [ -f mk/rules.mk.in ]; then \
-		rm -f mk/rules.mk; \
-	fi
-	rm -f config.log config.status
-
-build: depend
-	$(MAKE) build-prehook
-	@if [ "x$(OVERLAYS)" != "x" ]; then \
-		for i in `find $(OVERLAYS) -type d -maxdepth 1 -mindepth 1`; do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[building overlay: $$i]"; \
-			fi; \
-			cd $$i; OVERLAYS="" $(MAKE) || exit; cd ..; \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[finished overlay: $$i]"; \
-			fi; \
-		done; \
-	fi
-	@if [ "x$(SUBDIRS)" != "x" ]; then \
-		for i in $(SUBDIRS); do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[building subobjective: $$i]"; \
-			fi; \
-			cd $$i; OVERLAYS="" $(MAKE) || exit; cd ..; \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[finished subobjective: $$i]"; \
-			fi; \
-		done; \
-	fi
-	@if [ "x$(OBJECTIVE_LIBS)" != "x" ]; then \
-		for i in $(OBJECTIVE_LIBS); do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[building library objective: $$i]"; \
-			fi; \
-			$(MAKE) $$i || exit; \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[finished library objective: $$i]"; \
-			fi; \
-		done; \
-	fi
-	@if [ "x$(OBJECTIVE_LIBS_NOINST)" != "x" ]; then \
-		for i in $(OBJECTIVE_LIBS_NOINST); do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[building library dependency: $$i]"; \
-			fi; \
-			$(MAKE) $$i || exit; \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[finished library dependency: $$i]"; \
-			fi; \
-		done; \
-	fi
-	@if test "x$(OBJECTIVE_BINS)" != "x"; then \
-		for i in $(OBJECTIVE_BINS); do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[building binary objective: $$i]"; \
-			fi; \
-			$(MAKE) $$i || exit; \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[finished binary objective: $$i]"; \
-			fi; \
-		done; \
-	fi
-	$(MAKE) build-posthook
-	@if [ $(VERBOSITY) -gt 0 ]; then \
-		echo "[all objectives built]"; \
-	fi
-
-.c.o:
-	@if [ $(SHOW_CFLAGS) -eq 1 ]; then	\
-		printf "%10s     %-20s (%s)\n" CC $< "${CFLAGS}";	\
-	else \
-		printf "%10s     %-20s\n" CC $<;	\
-	fi;
-	$(CC) $(CFLAGS) -c $< -o $@
-
-.cc.o .cxx.o:
-	@if [ $(SHOW_CFLAGS) -eq 1 ]; then	\
-		printf "%10s     %-20s (%s)\n" CXX $< "${CXXFLAGS}";	\
-	else \
-		printf "%10s     %-20s\n" CXX $<;	\
-	fi;
-	$(CXX) $(CXXFLAGS) -c $< -o $@
-
-$(OBJECTIVE_LIBS): $(OBJECTS)
-	if [ "x$(OBJECTS)" != "x" ]; then \
-		$(MAKE) $(OBJECTS) || exit;		\
-		printf "%10s     %-20s\n" LINK $@; \
-		(if [ "x$(SHARED_SUFFIX)" = "x.so" ]; then \
-			(if [ "x$(OBJECTIVE_SONAME_SUFFIX)" != "x" ]; then \
-				$(CC) $(PICLDFLAGS) -o $@ -Wl,-h$@.$(OBJECTIVE_SONAME_SUFFIX) $(OBJECTS) $(LDFLAGS) $(LIBADD); \
-			else \
-				$(CC) $(PICLDFLAGS) -o $@ -Wl,-h$@ $(OBJECTS) $(LDFLAGS) $(LIBADD); \
-			fi;) \
-		 else \
-			$(CC) $(PICLDFLAGS) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBADD); \
-		 fi;) \
-	fi
-
-$(OBJECTIVE_LIBS_NOINST): $(OBJECTS)
-	if [ "x$(OBJECTS)" != "x" ]; then \
-		$(MAKE) $(OBJECTS) || exit;		\
-		printf "%10s     %-20s\n" LINK $@; \
-		$(AR) cr $@ $(OBJECTS); \
-	fi
-
-$(OBJECTIVE_BINS): $(OBJECTS)
-	if [ "x$(OBJECTS)" != "x" ]; then \
-		$(MAKE) $(OBJECTS) || exit;		\
-		printf "%10s     %-20s\n" LINK $@; \
-		$(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBADD); \
-	fi
-
-clean-prehook:
-clean-posthook:
-build-prehook:
-build-posthook:
-install-prehook:
-install-posthook:
-
-mk/rules.mk:
-	@if [ -f "configure" ]; then \
-		echo "[building rules.mk for posix target, run configure manually if you do not want this]"; \
-		sh configure $(CONFIG_OPTS); \
-		echo "[complete]"; \
-	fi
-
-.PHONY: .depend depend depend-prehook clean distclean
-.depend:
-depend-prehook:
-
-# default depend rule. if something else is needed -- override depend target
-depend:
-	$(MAKE) depend-prehook
-	@if [ "x$(SUBDIRS)" != "x" ]; then \
-		for i in $(SUBDIRS); do \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[building depend file for subobjective: $$i]"; \
-			fi; \
-			cd $$i; touch .depend; $(MAKE) depend || exit; cd ..; \
-			if [ $(VERBOSITY) -gt 0 ]; then \
-				echo "[finished subobjective: $$i]"; \
-			fi; \
-		done; \
-	fi
-	if [ ! -f .depend-done ]; then \
-		for i in ${SOURCES}; do \
-			echo "[generating dependencies for objective: $$i]"; \
-			${CC} -MM ${PICFLAGS} ${CPPFLAGS} ${CFLAGS} $$i >> .depend; \
-		done; \
-		touch .depend-done; \
-	fi;
-
-# compatibility with automake follows
-am--refresh:
-
-include .depend
--- a/mk/rules.mk.in	Sat Oct 13 21:53:37 2007 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,378 +0,0 @@
-@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@
--- a/po/de.po	Sat Oct 13 21:53:37 2007 +0300
+++ b/po/de.po	Sat Oct 13 21:53:47 2007 +0300
@@ -3,7 +3,7 @@
 "Project-Id-Version: de\n"
 "Report-Msgid-Bugs-To: http://bugs.audacious-media-player.org\n"
 "POT-Creation-Date: 2007-09-05 00:28+0200\n"
-"PO-Revision-Date: 2007-09-09 21:45+0100\n"
+"PO-Revision-Date: 2007-10-05 23:23+0100\n"
 "Last-Translator: Michael Färber <0102@gmx.at>\n"
 "Language-Team: german <0102@gmx.at>\n"
 "MIME-Version: 1.0\n"
@@ -1718,6 +1718,14 @@
 "\n"
 "This was a Google Summer of Code 2007 project."
 msgstr ""
+"Copyright (c) 2007, von Calin Crisan <ccrisan@gmail.com> und dem Audacious-Team.\n"
+"\n"
+"Vielen Dank an die libcdio-Entwickler <http://www.gnu.org/software/libcdio/>\n"
+"\tund die libcddb-Entwickler <http://libcddb.sourceforge.net/>.\n"
+"\n"
+"Danke auch an Tony Vroon für die Beratung und die Hilfe.\n"
+"\n"
+"Das war ein Google Summer of Code 2007 Projektt."
 
 #: src/cdaudio-ng/cdaudio-ng.c:206
 msgid "About CD Audio Plugin NG"
@@ -1837,6 +1845,10 @@
 "Audacious implementation by: William Pitcock <nenolod@nenolod.net>, \n"
 "        Shay Green <gblargg@gmail.com>"
 msgstr ""
+"Console music decoder engine basierend auf Game_Music_Emu 0.5.2.\n"
+"Unterstützte Formate: AY, GBS, GYM, HES, KSS, NSF, NSFE, SAP, SPC, VGM, VGZ\n"
+"Implementierung für Audacious von: William Pitcock <nenolod@nenolod.net>, \n"
+"        Shay Green <gblargg@gmail.com>"
 
 #: src/echo_plugin/gui.c:12
 msgid ""
@@ -2646,35 +2658,35 @@
 
 #: src/madplug/configure.c:148
 msgid "MPEG Audio Plugin Configuration"
-msgstr ""
+msgstr "MPEG-Audio-Plugin-Konfiguration"
 
 #: src/madplug/configure.c:161
 msgid "Dither output when rounding to 16-bit"
-msgstr ""
+msgstr "Ausgabe beim Runden auf 16-Bit dithern"
 
 #: src/madplug/configure.c:167
 msgid "Enable fast play-length calculation"
-msgstr ""
+msgstr "Schnelle Spieldauer-Berechnung aktivieren"
 
 #: src/madplug/configure.c:172
 msgid "Parse XING headers"
-msgstr ""
+msgstr "XING-Header parsen"
 
 #: src/madplug/configure.c:177
 msgid "Use SJIS to write ID3 tags instead of UTF-8"
-msgstr ""
+msgstr "SJIS anstatt UTF-8 zum Schreiben von ID3-Tags benutzen"
 
 #: src/madplug/configure.c:181
 msgid "Display average bitrate for VBR"
-msgstr ""
+msgstr "Durchschnittliche Bitrate für VBR anzeigen"
 
 #: src/madplug/configure.c:186
 msgid "Force reopen audio when audio type changed"
-msgstr ""
+msgstr "Neuöffnen von Audio bei Änderung des Audiotyps erzwingen"
 
 #: src/madplug/configure.c:196
 msgid "Enable ReplayGain processing"
-msgstr ""
+msgstr "ReplayGain-Bearbeitung aktivieren"
 
 #: src/madplug/configure.c:201
 #, fuzzy
@@ -2683,7 +2695,7 @@
 
 #: src/madplug/configure.c:208
 msgid "6dB hard limiting"
-msgstr ""
+msgstr "6dB fest beschränken"
 
 #: src/madplug/configure.c:213
 msgid "Default gain (dB):"
@@ -2691,7 +2703,7 @@
 
 #: src/madplug/configure.c:224
 msgid "Preamp (dB):"
-msgstr ""
+msgstr "Vorverstärkung (dB):"
 
 #: src/madplug/configure.c:233
 #: src/musepack/libmpc.cxx:223
@@ -2703,7 +2715,7 @@
 #: src/madplug/configure.c:238
 #: src/vorbis/configure.c:137
 msgid "Override generic titles"
-msgstr ""
+msgstr "Allgemeine Titel überschreiben"
 
 #: src/madplug/configure.c:251
 msgid "ID3 format:"
@@ -2878,6 +2890,19 @@
 "ReplayGain support by:\n"
 "    Samuel Krempp"
 msgstr ""
+"Audacious MPEG Audio Plugin\n"
+"\n"
+"Kompiliert gegen libMAD Version: %d.%d.%d%s\n"
+"\n"
+"Geschrieben von:\n"
+"    William Pitcock <nenolod@sacredspiral.co.uk>\n"
+"    Yoshiki Yazawa <yaz@cc.rim.or.jp>\n"
+"\n"
+"Teile abgeleitet von XMMS-MAD durch:\n"
+"    Sam Clegg\n"
+"\n"
+"ReplayGain-Unterstützung von:\n"
+"    Samuel Krempp"
 
 #: src/madplug/plugin.c:595
 msgid "About MPEG Audio Plugin"
@@ -2929,7 +2954,7 @@
 
 #: src/modplug/gui/interface.cxx:203
 msgid "Mono (downmix)"
-msgstr ""
+msgstr "Mono (downmix)"
 
 #: src/modplug/gui/interface.cxx:218
 #: src/timidity/src/interface.c:76
@@ -2954,19 +2979,19 @@
 
 #: src/modplug/gui/interface.cxx:278
 msgid "Nearest (fastest)"
-msgstr ""
+msgstr "Am nähesten (schnellstes)"
 
 #: src/modplug/gui/interface.cxx:286
 msgid "Linear (fast)"
-msgstr ""
+msgstr "Linear (schnell)"
 
 #: src/modplug/gui/interface.cxx:294
 msgid "Spline (good quality)"
-msgstr ""
+msgstr "Spline (gute Qualität)"
 
 #: src/modplug/gui/interface.cxx:302
 msgid "8-tap Fir (extremely high quality)"
-msgstr ""
+msgstr "8-tap Fir (extrem hohe Qualität)"
 
 #: src/modplug/gui/interface.cxx:346
 msgid "Use Filename as Song Title"
@@ -2974,26 +2999,26 @@
 
 #: src/modplug/gui/interface.cxx:353
 msgid "Fast Playlist Info"
-msgstr ""
+msgstr "Schnelle Wiedergabenliste-Information"
 
 #: src/modplug/gui/interface.cxx:368
 msgid "Noise Reduction"
-msgstr ""
+msgstr "Geräuschreduktion"
 
 #: src/modplug/gui/interface.cxx:376
 msgid "Play Amiga MOD"
-msgstr ""
+msgstr "Amiga MOD abspielen"
 
 #: src/modplug/gui/interface.cxx:384
 msgid "Reverb"
-msgstr ""
+msgstr "Hall"
 
 #: src/modplug/gui/interface.cxx:398
 #: src/modplug/gui/interface.cxx:470
 #: src/modplug/gui/interface.cxx:542
 #: src/modplug/gui/interface.cxx:628
 msgid "Enable"
-msgstr ""
+msgstr "Aktivieren"
 
 #: src/modplug/gui/interface.cxx:438
 #: src/modplug/gui/interface.cxx:582
@@ -3023,7 +3048,7 @@
 
 #: src/modplug/gui/interface.cxx:600
 msgid "Preamp"
-msgstr ""
+msgstr "Vorverstärkung"
 
 #: src/modplug/gui/interface.cxx:614
 msgid ""
@@ -3033,15 +3058,15 @@
 
 #: src/modplug/gui/interface.cxx:649
 msgid "Looping"
-msgstr ""
+msgstr "Loopen"
 
 #: src/modplug/gui/interface.cxx:663
 msgid "Don't loop"
-msgstr ""
+msgstr "Nicht loopen"
 
 #: src/modplug/gui/interface.cxx:678
 msgid "Loop"
-msgstr ""
+msgstr "Loop"
 
 #: src/modplug/gui/interface.cxx:694
 msgid "time(s)"
@@ -3049,7 +3074,7 @@
 
 #: src/modplug/gui/interface.cxx:701
 msgid "Loop forever"
-msgstr ""
+msgstr "Für immer loopen"
 
 #: src/modplug/gui/interface.cxx:709
 msgid "Effects"
@@ -3072,10 +3097,20 @@
 "Patterns:\n"
 "Channels:"
 msgstr ""
+"Dateiname:\n"
+"Titel:\n"
+"Typ:\n"
+"Länge:\n"
+"Geschwindigkeit:\n"
+"Tempo:\n"
+"Samples:\n"
+"Instrumente:\n"
+"Patterns:\n"
+"Kanäle:"
 
 #: src/modplug/gui/interface.cxx:866
 msgid "Samples"
-msgstr ""
+msgstr "Samples"
 
 #: src/modplug/gui/interface.cxx:899
 msgid "Instruments"
@@ -3087,7 +3122,7 @@
 
 #: src/modplug/gui/main.cxx:43
 msgid "Modplug Input Plugin for Audacious ver"
-msgstr ""
+msgstr "Modplug-Input-Plugin für Audacious Version"
 
 #: src/modplug/gui/main.cxx:44
 msgid ""
@@ -3098,6 +3133,12 @@
 "Updates and Maintainance by Konstanty Bialkowski.\n"
 "Ported to BMP by Theofilos Intzoglou."
 msgstr ""
+"\n"
+"Modplug sound engine geschrieben von Olivier Lapicque.\n"
+"XMMS interface für Modplug von Kenton Varda.\n"
+"(c)2000 Olivier Lapicque und Kenton Varda.\n"
+"Updates und Betreunung von Konstanty Bialkowski.\n"
+"Portiert für BMP von Theofilos Intzoglou."
 
 #: src/modplug/gui/main.cxx:45
 msgid "About Modplug"
@@ -3108,16 +3149,16 @@
 #: src/sid/xs_glade.c:114
 #, c-format
 msgid "Couldn't find pixmap file: %s"
-msgstr ""
+msgstr "Konnte Pixmap-Datei nicht finden: %s"
 
 #: src/modplug/gui/support.cxx:127
 #, c-format
 msgid "Error loading pixmap file: %s"
-msgstr ""
+msgstr "Fehler beim Laden der Pixmap-Datei: %s"
 
 #: src/musepack/libmpc.cxx:145
 msgid "Musepack Decoder Plugin 1.2"
-msgstr ""
+msgstr "Musepack-Dekoder-Plugin 1.2"
 
 #: src/musepack/libmpc.cxx:146
 msgid ""
@@ -3128,6 +3169,12 @@
 "\n"
 "Get latest version at http://musepack.net\n"
 msgstr ""
+"Plugin-Code von\n"
+"Benoit Amiaux\n"
+"Martin Spuler\n"
+"Kuniklo\n"
+"\n"
+"Die neueste Version ist erhältlich auf http://musepack.net\n"
 
 #: src/musepack/libmpc.cxx:147
 msgid "Nevermind"
@@ -3144,7 +3191,7 @@
 #: src/musepack/libmpc.cxx:182
 #: src/wavpack/ui.cxx:490
 msgid "Enable Dynamic Bitrate Display"
-msgstr ""
+msgstr "Dynamische-Bitraten-Anzeige aktivieren"
 
 #: src/musepack/libmpc.cxx:186
 #: src/wavpack/ui.cxx:496
@@ -3159,13 +3206,13 @@
 #: src/vorbis/configure.c:172
 #: src/wavpack/ui.cxx:508
 msgid "Enable Clipping Prevention"
-msgstr ""
+msgstr "Clipping-Verhinderung aktivieren"
 
 #: src/musepack/libmpc.cxx:201
 #: src/vorbis/configure.c:177
 #: src/wavpack/ui.cxx:513
 msgid "Enable ReplayGain"
-msgstr ""
+msgstr "ReplayGain aktivieren"
 
 #: src/musepack/libmpc.cxx:206
 msgid "ReplayGain Type"
@@ -3173,11 +3220,11 @@
 
 #: src/musepack/libmpc.cxx:214
 msgid "Use Track Gain"
-msgstr ""
+msgstr "Track Gain benutzen"
 
 #: src/musepack/libmpc.cxx:218
 msgid "Use Album Gain"
-msgstr ""
+msgstr "Album Gain benutzen"
 
 #: src/musepack/libmpc.cxx:490
 #: src/sid/xmms-sid.glade:2994
@@ -3214,7 +3261,7 @@
 #: src/musepack/libmpc.cxx:594
 #, c-format
 msgid "Streamversion %d"
-msgstr ""
+msgstr "Streamversion %d"
 
 #: src/musepack/libmpc.cxx:595
 #, c-format
@@ -3254,22 +3301,22 @@
 #: src/musepack/libmpc.cxx:602
 #, c-format
 msgid "Track Peak: %5u"
-msgstr ""
+msgstr "Track Peak: %5u"
 
 #: src/musepack/libmpc.cxx:603
 #, c-format
 msgid "Track Gain: %-+2.2f dB"
-msgstr ""
+msgstr "Track Gain: %-+2.2f dB"
 
 #: src/musepack/libmpc.cxx:604
 #, c-format
 msgid "Album Peak: %5u"
-msgstr ""
+msgstr "Album Peak: %5u"
 
 #: src/musepack/libmpc.cxx:605
 #, c-format
 msgid "Album Gain: %-+5.2f dB"
-msgstr ""
+msgstr "Album Gain: %-+5.2f dB"
 
 #: src/null/null.c:61
 msgid "Null output plugin "
@@ -3604,12 +3651,12 @@
 #: src/sid/xmms-sid.glade:750
 #: src/sid/xs_interface.c:469
 msgid "MOS 6581"
-msgstr ""
+msgstr "MOS 6581"
 
 #: src/sid/xmms-sid.glade:769
 #: src/sid/xs_interface.c:477
 msgid "MOS 8580"
-msgstr ""
+msgstr "MOS 8580"
 
 #: src/sid/xmms-sid.glade:790
 #: src/sid/xs_interface.c:484
@@ -3679,7 +3726,7 @@
 #: src/sid/xmms-sid.glade:1095
 #: src/sid/xs_interface.c:590
 msgid "Optimization mode (faster, inaccurate)"
-msgstr ""
+msgstr "Optimierungs-Modus (schneller, ungenau)"
 
 #: src/sid/xmms-sid.glade:1113
 #: src/sid/xs_interface.c:600
--- a/src/CoreAudio/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/CoreAudio/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = CoreAudio${PLUGIN_SUFFIX}
+
 SRCS = about.c		\
        configure.c	\
        coreaudio.c	\
@@ -8,11 +9,11 @@
        dbconvert.c	\
        mixer.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} -I../../intl -I../.. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS}
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} -I../../intl -I../.. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS}
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/OSS/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/OSS/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = OSS${PLUGIN_SUFFIX}
+
 SRCS = OSS.c		\
        mixer.c		\
        about.c		\
@@ -7,11 +8,11 @@
        init.c		\
        convert.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${OSS_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. -I.
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${OSS_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. -I.
 LIBS += ${OSS_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/OSS/audio.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/OSS/audio.c	Sat Oct 13 21:53:47 2007 +0300
@@ -261,9 +261,6 @@
 static void
 oss_write_audio(gpointer data, int length)
 {
-
-    audio_buf_info abuf_info;
-
     if (oss_convert_func != NULL)
         length = oss_convert_func(&data, length);
 
--- a/src/OSS4/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/OSS4/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = OSS4${PLUGIN_SUFFIX}
+
 SRCS = OSS4.c		\
        about.c		\
        configure.c	\
@@ -6,11 +7,11 @@
        init.c		\
        convert.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} -I/usr/lib/oss/include -I../../intl -I../.. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS}
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} -I/usr/lib/oss/include -I../../intl -I../.. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS}
 LIBS += ${OSS_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/OSS4/audio.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/OSS4/audio.c	Sat Oct 13 21:53:47 2007 +0300
@@ -261,9 +261,6 @@
 static void
 oss_write_audio(gpointer data, int length)
 {
-
-    audio_buf_info abuf_info;
-
     if (oss_convert_func != NULL)
         length = oss_convert_func(&data, length);
 
@@ -655,12 +652,6 @@
 }
 
 //-----------------------------OSS4 MIXER CODE-----------------------------
-static int
-open_mixer_device()  //i think we dont need this anymore
-{
-    return 0;
-}
-
 void oss_get_volume(int *l, int *r)
 {
     int v;
--- a/src/OSS4/configure.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/OSS4/configure.c	Sat Oct 13 21:53:47 2007 +0300
@@ -101,8 +101,8 @@
 
     menu = gtk_menu_new();
 
-    if ((file = vfs_fopen("/dev/sndstat", "r"))) {
-        while (vfs_fgets(buffer, 255, file)) {
+    if ((file = aud_vfs_fopen("/dev/sndstat", "r"))) {
+        while (aud_vfs_fgets(buffer, 255, file)) {
             if (found && buffer[0] == '\n')
                 break;
             if (buffer[strlen(buffer) - 1] == '\n')
@@ -132,7 +132,7 @@
                 found = 1;
 
         }
-        vfs_fclose(file);
+        aud_vfs_fclose(file);
     }
     else {
         item = gtk_menu_item_new_with_label(_("Default"));
@@ -149,7 +149,7 @@
 {
     GtkWidget *vbox, *notebook;
     GtkWidget *dev_vbox, *adevice_frame, *adevice_box, *adevice;
-    GtkWidget *mdevice_frame, *mdevice_box, *mdevice;
+    /* GtkWidget *mdevice_frame, *mdevice_box, *mdevice; */
     GtkWidget *buffer_frame, *buffer_vbox, *buffer_table;
     GtkWidget *buffer_size_box, *buffer_size_label;
     GtkObject *buffer_size_adj, *buffer_pre_adj;
--- a/src/aac/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/aac/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = aac${PLUGIN_SUFFIX}
+
 SRCS = libmp4.c			\
        mp4_utils.c		\
        aac_utils.c		\
@@ -48,11 +49,11 @@
        mp4ff/mp4util.c		\
        mp4ff/mp4tagupdate.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../.. -I. -I./include -I./libfaad2 -I./mp4ff -DUSE_TAGGING=1
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS} -fsigned-char
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../.. -I. -I./include -I./libfaad2 -I./mp4ff -DUSE_TAGGING=1
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -lm
--- a/src/aac/libmp4.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/aac/libmp4.c	Sat Oct 13 21:53:47 2007 +0300
@@ -16,8 +16,6 @@
 #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
@@ -90,7 +88,7 @@
     if (data == NULL || buffer == NULL)
         return -1;
 
-    return vfs_fread(buffer, 1, len, (VFSFile *) data);
+    return aud_vfs_fread(buffer, 1, len, (VFSFile *) data);
 }
 
 static guint32 mp4_seek_callback(void *data, guint64 pos)
@@ -98,7 +96,7 @@
     if (data == NULL)
         return -1;
 
-    return vfs_fseek((VFSFile *) data, pos, SEEK_SET);
+    return aud_vfs_fseek((VFSFile *) data, pos, SEEK_SET);
 }
 
 static void mp4_init(void)
@@ -162,28 +160,28 @@
         off_t init, probed;
 	static guchar buf[8];
 
-        init = probed = vfs_ftell(stream);
+        init = probed = aud_vfs_ftell(stream);
         while(probed-init <= 32768 && cnt < 8)
         {
                 c = 0;
                 while(probed-init <= 32768 && c != 0xFF)
                 {
-                        c = vfs_getc(stream);
+                        c = aud_vfs_getc(stream);
                         if(c < 0)
                                 return FALSE;
-	                probed = vfs_ftell(stream);
+	                probed = aud_vfs_ftell(stream);
                 }
                 buf[0] = 0xFF;
-                if(vfs_fread(&(buf[1]), 1, 7, stream) < 7)
+                if(aud_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);
+                        aud_vfs_fseek(stream, len - 8, SEEK_CUR);
                 }
-                probed = vfs_ftell(stream);
+                probed = aud_vfs_ftell(stream);
         }
 
         if(cnt < 8)
@@ -227,15 +225,15 @@
   memset(magic, '\0', 8);
 
   extension = strrchr(filename, '.');
-  if ((file = vfs_fopen(filename, "rb"))) {
-      vfs_fread(magic, 1, 8, file);
-      vfs_rewind(file);
+  if ((file = aud_vfs_fopen(filename, "rb"))) {
+      aud_vfs_fread(magic, 1, 8, file);
+      aud_vfs_rewind(file);
       if (parse_aac_stream(file) == TRUE) {
-           vfs_fclose(file);
+           aud_vfs_fclose(file);
            return TRUE;
       }
       if (!memcmp(magic, "ID3", 3)) {       // ID3 tag bolted to the front, obfuscated magic bytes
-           vfs_fclose(file);
+           aud_vfs_fclose(file);
            if (extension &&(
           !strcasecmp(extension, ".mp4") || // official extension
           !strcasecmp(extension, ".m4a") || // Apple mp4 extension
@@ -246,10 +244,10 @@
           return 0;
       }
       if (!memcmp(&magic[4], "ftyp", 4)) {
-           vfs_fclose(file);
+           aud_vfs_fclose(file);
            return 1;
       }
-      vfs_fclose(file);
+      aud_vfs_fclose(file);
   }
   return 0;
 }
@@ -260,8 +258,8 @@
   gchar magic[8];
 
   extension = strrchr(filename, '.');
-  vfs_fread(magic, 1, 8, file);
-  vfs_rewind(file);
+  aud_vfs_fread(magic, 1, 8, file);
+  aud_vfs_rewind(file);
   if (parse_aac_stream(file) == TRUE)
     return 1;
   if (!memcmp(&magic[4], "ftyp", 4))
@@ -314,28 +312,28 @@
 {
 }
 
-static Tuple *mp4_get_song_tuple_base(char *filename, VFSFile *mp4fh)
+static Tuple *mp4_get_song_aud_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);
+    Tuple *ti = aud_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"));
+        aud_tuple_associate_string(ti, FIELD_TITLE, NULL, aud_vfs_get_metadata(mp4fh, "track-name"));
+        aud_tuple_associate_string(ti, FIELD_ALBUM, NULL, aud_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");
+        aud_tuple_associate_string(ti, FIELD_CODEC, NULL, "Advanced Audio Coding (AAC)");
+        aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
 
-        vfs_fclose(mp4fh);
+        aud_vfs_fclose(mp4fh);
         return ti;
     }
 
-    vfs_rewind(mp4fh);
+    aud_vfs_rewind(mp4fh);
 
     mp4cb->read = mp4_read_callback;
     mp4cb->seek = mp4_seek_callback;
@@ -343,7 +341,7 @@
 
     if (!(mp4file = mp4ff_open_read(mp4cb))) {
         g_free(mp4cb);
-        vfs_fclose(mp4fh);
+        aud_vfs_fclose(mp4fh);
     } else {
         gint mp4track= getAACTrack(mp4file);
         gint numSamples = mp4ff_num_samples(mp4file, mp4track);
@@ -385,48 +383,48 @@
         faacDecClose(decoder);
 
         msDuration = ((float)numSamples * (float)(framesize - 1.0)/(float)samplerate) * 1000;
-        tuple_associate_int(ti, FIELD_LENGTH, NULL, msDuration);
+        aud_tuple_associate_int(ti, FIELD_LENGTH, NULL, msDuration);
 
         mp4ff_meta_get_title(mp4file, &tmpval);
         if (tmpval)
         {
-            tuple_associate_string(ti, FIELD_TITLE, NULL, tmpval);
+            aud_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);
+            aud_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);
+            aud_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);
+            aud_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));
+            aud_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");
+        aud_tuple_associate_string(ti, FIELD_CODEC, NULL, "Advanced Audio Coding (AAC)");
+        aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
 
         free (mp4cb);
-        vfs_fclose(mp4fh);
+        aud_vfs_fclose(mp4fh);
     }
 
     return ti;
@@ -439,9 +437,9 @@
     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");
+    mp4fh = remote ? aud_vfs_buffered_file_new_from_uri(filename) : aud_vfs_fopen(filename, "rb");
 
-    tuple = mp4_get_song_tuple_base(filename, mp4fh);
+    tuple = mp4_get_song_aud_tuple_base(filename, mp4fh);
 
     return tuple;
 }
@@ -457,9 +455,9 @@
     gchar *title;
     Tuple *tuple = mp4_get_song_tuple(filename);
 
-    title = tuple_formatter_make_title_string(tuple, get_gentitle_format());
+    title = aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
 
-    tuple_free(tuple);
+    aud_tuple_free(tuple);
 
     return title;
 }
@@ -520,7 +518,7 @@
     playback->output->open_audio(FMT_S16_NE, samplerate, channels);
     playback->output->flush(0);
 
-    mp4_ip.set_info(xmmstitle, msDuration,
+    playback->set_params(playback, xmmstitle, msDuration,
             mp4ff_get_avg_bitrate( mp4file, mp4track ),
             samplerate,channels);
 
@@ -602,7 +600,7 @@
             playback->output->close_audio();
             return FALSE;
         }
-        produce_audio(playback->output->written_time(),
+        playback->pass_audio(playback,
                    FMT_S16_NE,
                    channels,
                    frameInfo.samples<<1,
@@ -629,18 +627,18 @@
     gboolean    remote = str_has_prefix_nocase(filename, "http:") ||
 			 str_has_prefix_nocase(filename, "https:");
 
-    vfs_rewind(file);
+    aud_vfs_rewind(file);
     if((decoder = faacDecOpen()) == NULL){
         g_print("AAC: Open Decoder Error\n");
-        vfs_fclose(file);
+        aud_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){
+    if((buffervalid = aud_vfs_fread(streambuffer, 1, BUFFER_SIZE, file))==0){
         g_print("AAC: Error reading file\n");
-        vfs_fclose(file);
+        aud_vfs_fclose(file);
         buffer_playing = FALSE;
         playback->playing = 0;
         faacDecClose(decoder);
@@ -650,15 +648,15 @@
     if(!strncmp((char*)streambuffer, "ID3", 3)){
         gint size = 0;
 
-        vfs_fseek(file, 0, SEEK_SET);
+        aud_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);
+        aud_vfs_fread(streambuffer, 1, size, file);
+        buffervalid = aud_vfs_fread(streambuffer, 1, BUFFER_SIZE, file);
     }
 
-    ttemp = vfs_get_metadata(file, "stream-name");
+    ttemp = aud_vfs_get_metadata(file, "stream-name");
 
     if (ttemp != NULL)
     {
@@ -672,7 +670,7 @@
     if(bufferconsumed) {
       buffervalid -= bufferconsumed;
       memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid);
-      buffervalid += vfs_fread(&streambuffer[buffervalid], 1,
+      buffervalid += aud_vfs_fread(&streambuffer[buffervalid], 1,
                      BUFFER_SIZE-buffervalid, file);
       bufferconsumed = 0;
     }
@@ -688,7 +686,7 @@
     if(playback->output->open_audio(FMT_S16_NE,samplerate,channels) == FALSE){
         g_print("AAC: Output Error\n");
         faacDecClose(decoder);
-        vfs_fclose(file);
+        aud_vfs_fclose(file);
         playback->output->close_audio();
         g_free(xmmstitle);
         buffer_playing = FALSE;
@@ -697,7 +695,7 @@
         return;
     }
 
-    mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
+    playback->set_params(playback, xmmstitle, -1, -1, samplerate, channels);
     playback->output->flush(0);
 
     while(buffer_playing && buffervalid > 0 && streambuffer != NULL)
@@ -710,14 +708,14 @@
         {
             buffervalid -= bufferconsumed;
             memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid);
-            buffervalid += vfs_fread(&streambuffer[buffervalid], 1,
+            buffervalid += aud_vfs_fread(&streambuffer[buffervalid], 1,
                          BUFFER_SIZE-buffervalid, file);
             bufferconsumed = 0;
 
-            ttemp = vfs_get_metadata(file, "stream-name");
+            ttemp = aud_vfs_get_metadata(file, "stream-name");
 
             if (ttemp != NULL)
-                stemp = vfs_get_metadata(file, "track-name");
+                stemp = aud_vfs_get_metadata(file, "track-name");
 
             if (stemp != NULL)
             {
@@ -735,7 +733,7 @@
 
                     ostmp = stemp;
 
-                    mp4_ip.set_info(xmmstitle, -1, -1, samplerate, channels);
+                    playback->set_params(playback, xmmstitle, -1, -1, samplerate, channels);
                 }
             }
 
@@ -754,7 +752,7 @@
             memmove(streambuffer, &streambuffer[1], buffervalid);
             if(buffervalid < BUFFER_SIZE) {
                buffervalid +=
-                 vfs_fread(&streambuffer[buffervalid], 1, BUFFER_SIZE-buffervalid, file);
+                 aud_vfs_fread(&streambuffer[buffervalid], 1, BUFFER_SIZE-buffervalid, file);
 	    }
             bufferconsumed = aac_probe(streambuffer, buffervalid);
             if(bufferconsumed) {
@@ -772,7 +770,7 @@
             continue;
         }
 
-        produce_audio(playback->output->written_time(),
+        playback->pass_audio(playback,
                    FMT_S16_LE, channels,
                    samplesdecoded<<1, sample_buffer, &buffer_playing);
     }
@@ -782,7 +780,7 @@
     playback->playing = 0;
     faacDecClose(decoder);
     g_free(xmmstitle);
-    vfs_fclose(file);
+    aud_vfs_fclose(file);
     seekPosition = -1;
 
     buffer_playing = FALSE;
@@ -800,7 +798,7 @@
     InputPlayback *playback = args;
     char *filename = playback->filename;
 
-    mp4fh = vfs_buffered_file_new_from_uri(filename);
+    mp4fh = aud_vfs_buffered_file_new_from_uri(filename);
 
     g_static_mutex_lock(&mutex);
     seekPosition= -1;
@@ -813,10 +811,10 @@
     ret = parse_aac_stream(mp4fh);
 
     if( ret == TRUE )
-        vfs_fseek(mp4fh, 0, SEEK_SET);
+        aud_vfs_fseek(mp4fh, 0, SEEK_SET);
     else {
-        vfs_fclose(mp4fh);
-        mp4fh = vfs_fopen(filename, "rb");
+        aud_vfs_fclose(mp4fh);
+        mp4fh = aud_vfs_fopen(filename, "rb");
     }
 
     mp4cb->read = mp4_read_callback;
--- a/src/adplug/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/adplug/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = adplug${PLUGIN_SUFFIX}
+
 SRCS = adplug-xmms.cc		\
        core/fmopl.c		\
        core/debug.c		\
@@ -52,14 +53,12 @@
        core/adl.cxx		\
        core/jbm.cxx
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-LD = ${CXX}
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
 
-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}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${BINIO_CFLAGS} -I../../intl -I../.. -I./core -Dstricmp=strcasecmp
 LIBS += ${BINIO_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/adplug/adplug-xmms.cc	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/adplug/adplug-xmms.cc	Sat Oct 13 21:53:47 2007 +0300
@@ -93,9 +93,6 @@
 
 static InputPlayback *playback;
 
-// XXX: this function is not in the public API yet.
-extern "C" VFSFile * vfs_buffered_file_new_from_uri (gchar * uri);
-
 /***** Debugging *****/
 
 #ifdef DEBUG
@@ -508,7 +505,7 @@
 adplug_info_box (char *filename)
 {
   CSilentopl tmpopl;
-  VFSFile *fd = vfs_buffered_file_new_from_uri (filename);
+  VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename);
 
   if (!fd)
     return;
@@ -681,7 +678,7 @@
 adplug_get_tuple (char *filename)
 {
   CSilentopl tmpopl;
-  VFSFile *fd = vfs_buffered_file_new_from_uri (filename);
+  VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename);
 
   if (!fd)
     return NULL;
@@ -690,18 +687,18 @@
 
   if (p)
   {
-    Tuple *ti = tuple_new_from_filename(filename);
+    Tuple *ti = aud_tuple_new_from_filename(filename);
     if (! p->getauthor().empty())
-      tuple_associate_string(ti, FIELD_ARTIST, NULL, p->getauthor().c_str());
+      aud_tuple_associate_string(ti, FIELD_ARTIST, NULL, p->getauthor().c_str());
     if (! p->gettitle().empty())
-      tuple_associate_string(ti, FIELD_TITLE, NULL, p->gettitle().c_str());
+      aud_tuple_associate_string(ti, FIELD_TITLE, NULL, p->gettitle().c_str());
     else if (! p->getdesc().empty())
-      tuple_associate_string(ti, FIELD_TITLE, NULL, p->getdesc().c_str());
+      aud_tuple_associate_string(ti, FIELD_TITLE, NULL, p->getdesc().c_str());
     else
-      tuple_associate_string(ti, FIELD_TITLE, NULL, g_path_get_basename(filename));
-    tuple_associate_string(ti, FIELD_CODEC, NULL, p->gettype().c_str());
-    tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced");
-    tuple_associate_int(ti, FIELD_LENGTH, NULL, p->songlength (plr.subsong));
+      aud_tuple_associate_string(ti, FIELD_TITLE, NULL, g_path_get_basename(filename));
+    aud_tuple_associate_string(ti, FIELD_CODEC, NULL, p->gettype().c_str());
+    aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced");
+    aud_tuple_associate_int(ti, FIELD_LENGTH, NULL, p->songlength (plr.subsong));
     delete p;
     return ti;
   }
@@ -711,10 +708,10 @@
 
 static char* format_and_free_ti( Tuple* ti, int* length )
 {
-  char* result = tuple_formatter_make_title_string(ti, get_gentitle_format());
+  char* result = aud_tuple_formatter_make_title_string(ti, get_gentitle_format());
   if ( result )
-    *length = tuple_get_int(ti, FIELD_LENGTH, NULL);
-  tuple_free((void *) ti);
+    *length = aud_tuple_get_int(ti, FIELD_LENGTH, NULL);
+  aud_tuple_free((void *) ti);
 
   return result;
 }
@@ -760,7 +757,7 @@
   // we use VfsBufferedFile class here because adplug does a lot of
   // probing. a short delay before probing begins is better than
   // a lot of delay during probing.
-  VFSFile *fd = vfs_buffered_file_new_from_uri (playback->filename);
+  VFSFile *fd = aud_vfs_buffered_file_new_from_uri (playback->filename);
 
   if (!fd)
   {
@@ -801,7 +798,7 @@
 
   // Set XMMS main window information
   dbg_printf ("xmms, ");
-  adplug_ip.set_info (plr.songtitle, plr.songlength, freq * sampsize * 8,
+  playback->set_params (playback, plr.songtitle, plr.songlength, freq * sampsize * 8,
                       freq, stereo ? 2 : 1);
 
   // Rewind player to right subsong
@@ -850,9 +847,7 @@
     }
 
     // write sound buffer
-    while (playback->output->buffer_free () < SNDBUFSIZE * sampsize)
-      g_usleep (10000);
-    produce_audio (playback->output->written_time (),
+    playback->pass_audio(playback,
                    bit16 ? FORMAT_16 : FORMAT_8,
                    stereo ? 2 : 1, SNDBUFSIZE * sampsize, sndbuf, NULL);
 
@@ -888,7 +883,7 @@
   free (sndbuf);
   plr.playing = false;          // important! XMMS won't get a self-ended song without it.
   dbg_printf (".\n");
-  vfs_fclose (fd);
+  aud_vfs_fclose (fd);
   return (NULL);
 }
 
@@ -921,7 +916,7 @@
 adplug_is_our_file (char *filename)
 {
   CSilentopl tmpopl;
-  VFSFile *fd = vfs_buffered_file_new_from_uri (filename);
+  VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename);
   if (!fd)
     return FALSE;
 
--- a/src/adplug/core/adplug.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/adplug/core/adplug.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -149,7 +149,7 @@
       if (fp.extension (fd->uri, (*i)->get_extension (j)))
       {
         AdPlug_LogWrite ("Trying direct hit: %s\n", (*i)->filetype.c_str ());
-        vfs_rewind (fd);
+        aud_vfs_rewind (fd);
         if ((p = (*i)->factory (opl)))
           if (p->load (fd, fp))
           {
--- a/src/adplug/core/adtrack.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/adplug/core/adtrack.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -70,12 +70,12 @@
   AdPlug_LogWrite ("CadtrackLoader::load(,\"%s\"): Checking for \"%s\"...\n",
                    filename.c_str (), instfilename.c_str ());
 
-  VFSFile *instfd = vfs_fopen (instfilename.c_str (), "rb");
+  VFSFile *instfd = aud_vfs_fopen (instfilename.c_str (), "rb");
   instf = fp.open (instfd);
   if (!instf || fp.filesize (instf) != 468)
   {
     fp.close (f);
-    vfs_fclose (instfd);
+    aud_vfs_fclose (instfd);
     return false;
   }
 
--- a/src/adplug/core/binio_virtual.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/adplug/core/binio_virtual.h	Sat Oct 13 21:53:47 2007 +0300
@@ -12,7 +12,10 @@
 #include <string>
 
 #include <glib.h>
-#include <audacious/vfs.h>
+
+extern "C" {
+#include <audacious/plugin.h>
+};
 
 class vfsistream : public binistream, virtual public binio {
 private:
@@ -27,24 +30,24 @@
 	};
 
 	vfsistream(const char *file) {
-		this->fd = vfs_fopen(file, "rb");
+		this->fd = aud_vfs_fopen(file, "rb");
 	};
 
 	vfsistream(std::string &file) {
-		this->fd = vfs_fopen(file.c_str(), "rb");
+		this->fd = aud_vfs_fopen(file.c_str(), "rb");
 	};
 
 	void open(const char *file) {
-		this->fd = vfs_fopen(file, "rb");
+		this->fd = aud_vfs_fopen(file, "rb");
 	};
 
 	void open(std::string &file) {
-		this->fd = vfs_fopen(file.c_str(), "rb");
+		this->fd = aud_vfs_fopen(file.c_str(), "rb");
 	};
 
 	// XXX: this sucks because binio won't let us do sanity checking
 	Byte getByte(void) {
-		int c = vfs_getc(this->fd);
+		int c = aud_vfs_getc(this->fd);
 
 		if (c == EOF) err |= Eof;
 
@@ -55,21 +58,21 @@
 		switch (offs)
 		{
 			case Add:
-				vfs_fseek(this->fd, pos, SEEK_CUR);
+				aud_vfs_fseek(this->fd, pos, SEEK_CUR);
 				break;
 			case End:
-				vfs_fseek(this->fd, pos, SEEK_END);
+				aud_vfs_fseek(this->fd, pos, SEEK_END);
 				break;
 			case Set:
 			default:
-				vfs_fseek(this->fd, pos, SEEK_SET);
+				aud_vfs_fseek(this->fd, pos, SEEK_SET);
 				break;
 		}
 
 	}
 
 	long pos(void) {
-		return vfs_ftell(this->fd);
+		return aud_vfs_ftell(this->fd);
 	}
 };
 
@@ -87,45 +90,45 @@
 	};
 
 	vfsostream(const char *file) {
-		this->fd = vfs_fopen(file, "wb");
+		this->fd = aud_vfs_fopen(file, "wb");
 	};
 
 	vfsostream(std::string &file) {
-		this->fd = vfs_fopen(file.c_str(), "wb");
+		this->fd = aud_vfs_fopen(file.c_str(), "wb");
 	};
 
 	void open(const char *file) {
-		this->fd = vfs_fopen(file, "wb");
+		this->fd = aud_vfs_fopen(file, "wb");
 	};
 
 	void open(std::string &file) {
-		this->fd = vfs_fopen(file.c_str(), "wb");
+		this->fd = aud_vfs_fopen(file.c_str(), "wb");
 	};
 
 	// XXX: this sucks because binio won't let us do sanity checking
 	void putByte(Byte b) {
-		vfs_fwrite(&b, 1, 1, this->fd);
+		aud_vfs_fwrite(&b, 1, 1, this->fd);
 	};
 
 	void seek(long pos, Offset offs = Set) {
 		switch (offs)
 		{
 			case Add:
-				vfs_fseek(this->fd, pos, SEEK_CUR);
+				aud_vfs_fseek(this->fd, pos, SEEK_CUR);
 				break;
 			case End:
-				vfs_fseek(this->fd, pos, SEEK_END);
+				aud_vfs_fseek(this->fd, pos, SEEK_END);
 				break;
 			case Set:
 			default:
-				vfs_fseek(this->fd, pos, SEEK_SET);
+				aud_vfs_fseek(this->fd, pos, SEEK_SET);
 				break;
 		}
 
 	}
 
 	long pos(void) {
-		return vfs_ftell(this->fd);
+		return aud_vfs_ftell(this->fd);
 	}
 };
 
--- a/src/adplug/core/ksm.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/adplug/core/ksm.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -67,7 +67,7 @@
       break;
   strcpy (fn + i + 1, "insts.dat");
   AdPlug_LogWrite ("Instruments file: \"%s\"\n", fn);
-  VFSFile *instfd = vfs_fopen (fn, "rb");
+  VFSFile *instfd = aud_vfs_fopen (fn, "rb");
   f = fp.open (instfd);
   delete[]fn;
   if (!f)
@@ -78,7 +78,7 @@
   }
   loadinsts (f);
   fp.close (f);
-  vfs_fclose (instfd);
+  aud_vfs_fclose (instfd);
 
   f = fp.open (fd);
   if (!f)
--- a/src/adplug/core/mid.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/adplug/core/mid.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -214,12 +214,12 @@
     }
   sprintf (pfilename + j + 3, "patch.003");
 
-  VFSFile *instfd = vfs_fopen (pfilename, "rb");
+  VFSFile *instfd = aud_vfs_fopen (pfilename, "rb");
   f = fp.open (instfd);
   free (pfilename);
   if (!f)
   {
-    vfs_fclose (instfd);
+    aud_vfs_fclose (instfd);
     return false;
   }
 
@@ -259,7 +259,7 @@
   }
 
   fp.close (f);
-  vfs_fclose (instfd);
+  aud_vfs_fclose (instfd);
   memcpy (smyinsbank, myinsbank, 128 * 16);
   return true;
 }
--- a/src/adplug/core/rol.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/adplug/core/rol.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -469,7 +469,7 @@
 bool CrolPlayer::load_voice_data( binistream *f, std::string const &bnk_filename, const CFileProvider &fp )
 {
     SBnkHeader bnk_header;
-    VFSFile *fd = vfs_fopen(bnk_filename.c_str(), "rb");
+    VFSFile *fd = aud_vfs_fopen(bnk_filename.c_str(), "rb");
     binistream *bnk_file = fp.open(fd);
 
     if( bnk_file )
@@ -492,7 +492,7 @@
         }
 
         fp.close(bnk_file);
-        vfs_fclose(fd);
+        aud_vfs_fclose(fd);
 
         return true;
     }
--- a/src/alac/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/alac/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,14 +1,15 @@
 PLUGIN = alac${PLUGIN_SUFFIX}
+
 SRCS = alac.c	\
        demux.c	\
        plugin.c	\
        stream.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/alac/plugin.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/alac/plugin.c	Sat Oct 13 21:53:47 2007 +0300
@@ -64,6 +64,7 @@
 
 extern void set_endian();
 
+/*
 static gchar *
 extname(const char *filename)
 {
@@ -74,6 +75,7 @@
 
     return ext;
 }
+*/
 
 static void alac_about(void)
 {
@@ -117,25 +119,25 @@
     return TRUE;
 }
 
-Tuple *build_tuple_from_demux(demux_res_t *demux_res, char *path)
+Tuple *build_aud_tuple_from_demux(demux_res_t *demux_res, char *path)
 {
-    Tuple *ti = tuple_new_from_filename(path);
+    Tuple *ti = aud_tuple_new_from_filename(path);
 
     if (demux_res->tuple.art != NULL)
-        tuple_associate_string(ti, FIELD_ARTIST, NULL, demux_res->tuple.art);
+        aud_tuple_associate_string(ti, FIELD_ARTIST, NULL, demux_res->tuple.art);
     if (demux_res->tuple.nam != NULL)
-        tuple_associate_string(ti, FIELD_TITLE, NULL, demux_res->tuple.nam);
+        aud_tuple_associate_string(ti, FIELD_TITLE, NULL, demux_res->tuple.nam);
     if (demux_res->tuple.alb != NULL)
-        tuple_associate_string(ti, FIELD_ALBUM, NULL, demux_res->tuple.alb);
+        aud_tuple_associate_string(ti, FIELD_ALBUM, NULL, demux_res->tuple.alb);
     if (demux_res->tuple.gen != NULL)
-        tuple_associate_string(ti, FIELD_GENRE, NULL, demux_res->tuple.gen);
+        aud_tuple_associate_string(ti, FIELD_GENRE, NULL, demux_res->tuple.gen);
     if (demux_res->tuple.cmt != NULL)
-        tuple_associate_string(ti, FIELD_COMMENT, NULL, demux_res->tuple.cmt);
+        aud_tuple_associate_string(ti, FIELD_COMMENT, NULL, demux_res->tuple.cmt);
     if (demux_res->tuple.day != NULL)
-        tuple_associate_int(ti, FIELD_YEAR, NULL, atoi(demux_res->tuple.day));
+        aud_tuple_associate_int(ti, FIELD_YEAR, NULL, atoi(demux_res->tuple.day));
 
-    tuple_associate_string(ti, FIELD_CODEC, NULL, "Apple Lossless (ALAC)");
-    tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossless");
+    aud_tuple_associate_string(ti, FIELD_CODEC, NULL, "Apple Lossless (ALAC)");
+    aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossless");
 
     return ti;
 }
@@ -146,14 +148,14 @@
     VFSFile *input_file;
     stream_t *input_stream;
 
-    input_file = vfs_fopen(filename, "rb");
+    input_file = aud_vfs_fopen(filename, "rb");
     input_stream = stream_create_file(input_file, 1);
 
     set_endian();
 
     if (!input_stream)
     {
-	vfs_fclose(input_file);
+	aud_vfs_fclose(input_file);
         return NULL;
     }
 
@@ -162,14 +164,14 @@
     if (!qtmovie_read(input_stream, &demux_res))
     {
         stream_destroy(input_stream);
-        vfs_fclose(input_file);
+        aud_vfs_fclose(input_file);
         return NULL;
     }
 
     stream_destroy(input_stream);
-    vfs_fclose(input_file);
+    aud_vfs_fclose(input_file);
 
-    return build_tuple_from_demux(&demux_res, filename);
+    return build_aud_tuple_from_demux(&demux_res, filename);
 }
 
 static InputPlayback *playback;
@@ -283,7 +285,7 @@
         /* write */
         bytes_read += outputBytes;
 
-        produce_audio(playback->output->written_time(), FMT_S16_LE, demux_res->num_channels, outputBytes, pDestBuffer, &going);
+        playback->pass_audio(playback, FMT_S16_LE, demux_res->num_channels, outputBytes, pDestBuffer, &going);
     }
 
     free(buffer);
@@ -321,7 +323,7 @@
 
     set_endian();
 
-    input_file = vfs_fopen((char *) args, "rb");
+    input_file = aud_vfs_fopen((char *) args, "rb");
     input_stream = stream_create_file(input_file, 1);
 
     if (!input_stream)
@@ -335,8 +337,8 @@
     demux_res.stream = input_stream;
 
     /* Get the titlestring ready. */
-    ti = build_tuple_from_demux(&demux_res, (char *) args);
-    title = tuple_formatter_make_title_string(ti, get_gentitle_format());
+    ti = build_aud_tuple_from_demux(&demux_res, (char *) args);
+    title = aud_tuple_formatter_make_title_string(ti, get_gentitle_format());
 
     /* initialise the sound converter */
     demux_res.alac = create_alac(demux_res.sample_size, demux_res.num_channels);
@@ -347,7 +349,7 @@
 	(float)(demux_res.sample_rate / 251));
 
     playback->output->open_audio(FMT_S16_LE, demux_res.sample_rate, demux_res.num_channels);
-    alac_ip.set_info(title, duration, -1, demux_res.sample_rate, demux_res.num_channels);
+    playback->set_params(playback, title, duration, -1, demux_res.sample_rate, demux_res.num_channels);
 
     /* will convert the entire buffer */
     GetBuffer(&demux_res);
@@ -357,7 +359,7 @@
     stream_destroy(input_stream);
 
     if (input_opened)
-        vfs_fclose(input_file);
+        aud_vfs_fclose(input_file);
 
     playback->output->close_audio();
 
--- a/src/alac/stream.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/alac/stream.c	Sat Oct 13 21:53:47 2007 +0300
@@ -71,8 +71,8 @@
 {
     size_t ret;
 
-    ret = vfs_fread(buf, 4, size >> 2, stream->f) * 4;
-    ret += vfs_fread((char*)buf + ret, 1, size - ret, stream->f);
+    ret = aud_vfs_fread(buf, 4, size >> 2, stream->f) * 4;
+    ret += aud_vfs_fread((char*)buf + ret, 1, size - ret, stream->f);
 
     if (ret == 0 && size != 0) stream->eof = 1;
 }
@@ -142,7 +142,7 @@
 
 void stream_skip(stream_t *stream, size_t skip)
 {
-    if (vfs_fseek(stream->f, (long)skip, SEEK_CUR) == 0) return;
+    if (aud_vfs_fseek(stream->f, (long)skip, SEEK_CUR) == 0) return;
     if (errno == ESPIPE)
     {
         char *buffer = malloc(skip);
@@ -158,12 +158,12 @@
 
 long stream_tell(stream_t *stream)
 {
-    return vfs_ftell(stream->f); /* returns -1 on error */
+    return aud_vfs_ftell(stream->f); /* returns -1 on error */
 }
 
 int stream_setpos(stream_t *stream, long pos)
 {
-    return vfs_fseek(stream->f, pos, SEEK_SET);
+    return aud_vfs_fseek(stream->f, pos, SEEK_SET);
 }
 
 stream_t *stream_create_file(VFSFile *file,
--- a/src/alarm/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/alarm/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 PLUGIN = alarm${PLUGIN_SUFFIX}
-SRCS = alarm.c	\
+
+SRCS = alarm.c		\
        interface.c
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/alsa/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/alsa/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,15 +1,16 @@
 PLUGIN = ALSA${PLUGIN_SUFFIX}
+
 SRCS = alsa.c		\
        about.c		\
        audio.c		\
        configure.c	\
        init.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ALSA_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ALSA_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${ALSA_LIBS}
--- a/src/alsa/audio.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/alsa/audio.c	Sat Oct 13 21:53:47 2007 +0300
@@ -141,7 +141,7 @@
 	/* if debug mode is enabled, dump ALSA state to console */
 	if (alsa_cfg.debug)
 	{
-		snd_pcm_status_t *alsa_status;
+		snd_pcm_status_t *alsa_status = NULL;
 		snd_pcm_status_alloca(&alsa_status);
 		if (snd_pcm_status(alsa_pcm, alsa_status) < 0)
 			g_warning("xrun_recover(): snd_pcm_status() failed");
@@ -587,11 +587,6 @@
  */
 static void alsa_do_write(gpointer data, int length)
 {
-	EffectPlugin *ep = NULL;
-	int new_freq;
-	int new_chn;
-	AFormat f;
-
 	if (paused)
 		return;
 
@@ -826,8 +821,8 @@
 static int alsa_setup(struct snd_format *f)
 {
 	int err;
-	snd_pcm_hw_params_t *hwparams;
-	snd_pcm_sw_params_t *swparams;
+	snd_pcm_hw_params_t *hwparams = NULL;
+	snd_pcm_sw_params_t *swparams = NULL;
 	unsigned int alsa_buffer_time, alsa_period_time;
 	snd_pcm_uframes_t alsa_buffer_size, alsa_period_size;
 
@@ -859,12 +854,12 @@
 
 	if (alsa_cfg.debug)
 	{
-		snd_pcm_info_t *info;
+		snd_pcm_info_t *info = NULL;
 		int alsa_card, alsa_device, alsa_subdevice;
 
 		snd_pcm_info_alloca(&info);
 		snd_pcm_info(alsa_pcm, info);
-		alsa_card =  snd_pcm_info_get_card(info);
+		alsa_card = snd_pcm_info_get_card(info);
 		alsa_device = snd_pcm_info_get_device(info);
 		alsa_subdevice = snd_pcm_info_get_subdevice(info);
 		printf("Card %i, Device %i, Subdevice %i\n",
--- a/src/alsa/configure.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/alsa/configure.c	Sat Oct 13 21:53:47 2007 +0300
@@ -128,7 +128,7 @@
 {
 	GtkWidget *item;
 	int pcm_device = -1, err;
-	snd_pcm_info_t *pcm_info;
+	snd_pcm_info_t *pcm_info = NULL;
 	snd_ctl_t *ctl;
 	char dev[64], *card_name;
 
--- a/src/amidi-plug/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/amidi-plug/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,30 +1,25 @@
-PLUGIN = amidi-plug$(PLUGIN_SUFFIX)
-SUBDIRS = pcfg $(AMIDIPLUG_BACKENDS)
+PLUGIN = amidi-plug${PLUGIN_SUFFIX}
 
-noinst_HEADERS = amidi-plug.h i_backend.h i_midi.h i_midievent.h \
-                 i_vfslayer.h i_configure.h i_configure_private.h \
-                 i_configure_file.h i_configure-ap.h i_configure-alsa.h \
-                 i_configure-fluidsynth.h i_configure-dummy.h \
-                 i_fileinfo.h i_utils.h i_common.h \
-                 amidi-plug-icon.xpm amidi-plug.logo.xpm \
-                 amidi-plug.midiicon.xpm
+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
 
-plugindir = audacious/$(INPUT_PLUGIN_DIR)
-
-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
+SUBDIRS = pcfg ${AMIDIPLUG_BACKENDS}
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
-
-EXT_DEPS = ./pcfg/libpcfg.a
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
 
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(GMODULE_CFLAGS) $(MOWGLI_CFLAGS) \
-	-DAMIDIPLUGBACKENDDIR=\"$(AMIDIPLUGBACKENDDIR)\" -I../../intl -I../..
-
-LIBS += $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(GMODULE_LIBS) -lpthread ./pcfg/libpcfg.a
+CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${GMODULE_CFLAGS} ${MOWGLI_CFLAGS} \
+	-DAMIDIPLUGBACKENDDIR=\"${plugindir}/${AMIDIPLUG_BACKEND_DIR}\" -I../../intl -I../..
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${GMODULE_LIBS} -lpthread ./pcfg/libpcfg.a
--- a/src/amidi-plug/amidi-plug.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/amidi-plug/amidi-plug.c	Sat Oct 13 21:53:47 2007 +0300
@@ -445,7 +445,7 @@
       /* our length is in microseconds, but the player wants milliseconds */
       filename = g_filename_from_uri( filename_uri , NULL , NULL );
       if ( !filename ) filename = g_strdup( filename_uri );
-      amidiplug_ip.set_info( G_PATH_GET_BASENAME(filename) ,
+      playback->set_params( playback , G_PATH_GET_BASENAME(filename) ,
                              (gint)(midifile.length / 1000) ,
                              au_bitdepth * au_samplerate * au_channels / 8 ,
                              au_samplerate , au_channels );
@@ -757,9 +757,7 @@
   {
     if ( backend.seq_output( &buffer , &buffer_size ) )
     {
-      while( ( playback->output->buffer_free() < buffer_size ) && ( going == TRUE ) )
-        G_USLEEP(10000);
-      produce_audio( playback->output->written_time() ,
+      playback->pass_audio( playback ,
                      FMT_S16_NE , 2 , buffer_size , buffer , &going );
     }
     g_mutex_lock( amidiplug_playing_mutex );
--- a/src/amidi-plug/amidi-plug.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/amidi-plug/amidi-plug.h	Sat Oct 13 21:53:47 2007 +0300
@@ -102,7 +102,7 @@
   .get_song_info = amidiplug_get_song_info,		/* get_song_info */
   .file_info_box = amidiplug_file_info_box,		/* file_info_box */
   .is_our_file_from_vfs = amidiplug_is_our_file_from_vfs,	/* is_our_file_from_vfs */
-  .vfs_extensions = amidiplug_vfs_extensions		/* vfs_extensions */
+  .vfs_extensions = amidiplug_vfs_extensions		/* aud_vfs_extensions */
 };
 
 #endif /* !_I_AMIDIPLUG_H */
--- a/src/amidi-plug/backend-alsa/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/amidi-plug/backend-alsa/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,19 +1,12 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
+PLUGIN = ap-alsa${PLUGIN_SUFFIX}
 
-noinst_HEADERS = b-alsa.h b-alsa-config.h backend-alsa-icon.xpm
-
-CFLAGS += $(PICFLAGS) $(GLIB_CFLAGS) $(ALSA_CFLAGS) -I../../..
-
-libdir = $(AMIDIPLUGBACKENDDIR)
+SRCS = b-alsa.c
 
-OBJECTIVE_LIBS = ap-alsa$(SHARED_SUFFIX)
-
-LIBADD = $(GLIB_LIBS) $(ALSA_LIBS) ../pcfg/libpcfg.a
-SOURCES = b-alsa.c
+include ../../../buildsys.mk
+include ../../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}/${AMIDIPLUG_BACKEND_DIR}
 
-LIBDEP =  ../pcfg/libpcfg.a
-
-include ../../../mk/objective.mk
+CFLAGS += ${PLUGIN_CFLAGS} ${ALSA_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${ALSA_CFLAGS} ${GLIB_CFLAGS} -I../../..
+LIBS += ${ALSA_LIBS} ../pcfg/libpcfg.a
--- a/src/amidi-plug/backend-dummy/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/amidi-plug/backend-dummy/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,19 +1,12 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
+PLUGIN = ap-dummy${PLUGIN_SUFFIX}
 
-noinst_HEADERS = b-dummy.h b-dummy-config.h backend-dummy-icon.xpm
-
-CFLAGS += $(PICFLAGS) $(GLIB_CFLAGS) -I../../..
-
-libdir = $(AMIDIPLUGBACKENDDIR)
+SRCS = b-dummy.c
 
-OBJECTIVE_LIBS = ap-dummy$(SHARED_SUFFIX)
-
-LIBADD = $(GLIB_LIBS) ../pcfg/libpcfg.a
-SOURCES = b-dummy.c
+include ../../../buildsys.mk
+include ../../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}/${AMIDIPLUG_BACKEND_DIR}
 
-LIBDEP = ../pcfg/libpcfg.a
-
-include ../../../mk/objective.mk
+CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GLIB_CFLAGS} -I../../..
+LIBS += ../pcfg/libpcfg.a
--- a/src/amidi-plug/backend-fluidsynth/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/amidi-plug/backend-fluidsynth/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,19 +1,12 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
+PLUGIN = ap-fluidsynth${PLUGIN_SUFFIX}
 
-noinst_HEADERS = b-fluidsynth.h b-fluidsynth-config.h backend-fluidsynth-icon.xpm
-
-CFLAGS += $(PICFLAGS) $(GLIB_CFLAGS) $(FLUIDSYNTH_CFLAGS) -I../../..
-
-libdir = $(AMIDIPLUGBACKENDDIR)
+SRCS = b-fluidsynth.c
 
-OBJECTIVE_LIBS = ap-fluidsynth$(SHARED_SUFFIX)
-
-LIBADD = -lm $(GLIB_LIBS) $(FLUIDSYNTH_LIBS) ../pcfg/libpcfg.a
-SOURCES = b-fluidsynth.c
+include ../../../buildsys.mk
+include ../../../extra.mk
 
-OBJECTS = ${SOURCES:.c=.o}
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}/${AMIDIPLUG_BACKEND_DIR}
 
-LIBDEP =  ../pcfg/libpcfg.a
-
-include ../../../mk/objective.mk
+CFLAGS += ${PLUGIN_CFLAGS} ${FLUIDSYNTH_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${FLUIDSYNTH_CFLAGS} ${GLIB_CFLAGS} -I../../..
+LIBS += ${FLUIDSYNTH_LIBS} ../pcfg/libpcfg.a
--- a/src/amidi-plug/i_vfslayer.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/amidi-plug/i_vfslayer.h	Sat Oct 13 21:53:47 2007 +0300
@@ -23,16 +23,16 @@
 #define _I_VFSLAYER_H 1
 
 #include "i_common.h"
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 
 
-#define VFS_FOPEN( x , y )		vfs_fopen( x , y )
-#define VFS_FCLOSE( x )			vfs_fclose( x )
-#define VFS_FREAD( x , y , z , w )	vfs_fread( x , y , z , w )
-#define VFS_FSEEK( x , y , z )		vfs_fseek( x , y , z )
-#define VFS_FEOF( x )			vfs_feof( x )
-#define VFS_GETC( x )			vfs_getc( x )
-#define VFS_UNGETC( x , y )		vfs_ungetc( x , y )
+#define VFS_FOPEN( x , y )		aud_vfs_fopen( x , y )
+#define VFS_FCLOSE( x )			aud_vfs_fclose( x )
+#define VFS_FREAD( x , y , z , w )	aud_vfs_fread( x , y , z , w )
+#define VFS_FSEEK( x , y , z )		aud_vfs_fseek( x , y , z )
+#define VFS_FEOF( x )			aud_vfs_feof( x )
+#define VFS_GETC( x )			aud_vfs_getc( x )
+#define VFS_UNGETC( x , y )		aud_vfs_ungetc( x , y )
 
 
 #endif /* !_I_VFSLAYER_H */
--- a/src/amidi-plug/pcfg/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/amidi-plug/pcfg/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,9 @@
-SRCS = i_pcfg.c
+STATIC_LIB_NOINST = libpcfg.a
 
-STATIC_LIB_NOINST = libpcfg.a
+SRCS = i_pcfg.c
 
 include ../../../buildsys.mk
 include ../../../extra.mk
 
-noinst_HEADERS = i_pcfg.h
-
-CFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(PLUGIN_CPPFLAGS) $(GLIB_CFLAGS) -I../../..
-
+CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GLIB_CFLAGS} -I../../..
--- a/src/aosd/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/aosd/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = aosd${PLUGIN_SUFFIX}
+
 SRCS = aosd.c		\
        aosd_osd.c	\
        aosd_style.c	\
@@ -8,11 +9,11 @@
        ghosd.c		\
        ghosd-main.c
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.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..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+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..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${CAIRO_LIBS} ${PANGOCAIRO_LIBS} ${XRENDER_LIBS} ${XCOMPOSITE_LIBS}
--- a/src/aosd/aosd_cfg.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/aosd/aosd_cfg.c	Sat Oct 13 21:53:47 2007 +0300
@@ -22,6 +22,7 @@
 #include "aosd_style.h"
 #include <glib.h>
 #include <stdlib.h>
+#include <audacious/plugin.h>
 #include <audacious/configdb.h>
 
 
--- a/src/arts/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/arts/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,16 +1,17 @@
-SUBDIRS = arts_helper
+PLUGIN = arts${PLUGIN_SUFFIX}
 
-PLUGIN = arts${PLUGIN_SUFFIX}
 SRCS = arts.c		\
        configure.c	\
        audio.c		\
        convert.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
+SUBDIRS = arts_helper
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARTSC_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARTSC_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${ARTSC_LIBS} -lpthread
--- a/src/arts/arts_helper/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/arts/arts_helper/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PROG = audacious-arts-helper${PROG_SUFFIX}
+
 SRCS = arts_helper.c
 
 include ../../../buildsys.mk
--- a/src/audiocompress/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/audiocompress/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 PLUGIN = audiocompress${PLUGIN_SUFFIX}
+
 SRCS = compress.c	\
        audacious-glue.c
 
-plugindir = audacious/${EFFECT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${EFFECT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/blur_scope/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/blur_scope/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 PLUGIN = blur_scope${PLUGIN_SUFFIX}
+
 SRCS = blur_scope.c	\
        config.c
 
-plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${VISUALIZATION_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/blur_scope/config.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/blur_scope/config.c	Sat Oct 13 21:53:47 2007 +0300
@@ -4,6 +4,7 @@
 #include <audacious/i18n.h>
 #include <gtk/gtk.h>
 
+#include <audacious/plugin.h>
 #include <audacious/configdb.h>
 #include "blur_scope.h"
 
--- a/src/cdaudio-ng/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/cdaudio-ng/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 PLUGIN = cdaudio-ng${PLUGIN_SUFFIX}
+
 SRCS = cdaudio-ng.c	\
        configure.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.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}
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${CDIO_CFLAGS} ${CDDB_CFLAGS} ${ARCH_DEFINES} -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${CDIO_LIBS} ${CDDB_LIBS}
--- a/src/cdaudio-ng/cdaudio-ng.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/cdaudio-ng/cdaudio-ng.c	Sat Oct 13 21:53:47 2007 +0300
@@ -84,7 +84,7 @@
 static Tuple			*cdaudio_get_song_tuple(gchar *filename);
 
 static void				menu_click();
-static Tuple			*create_tuple_from_trackinfo(char *filename);
+static Tuple			*create_aud_tuple_from_trackinfo(char *filename);
 static void				dae_play_loop(dae_params_t *pdae_params);
 static int				calculate_track_length(int startlsn, int endlsn);
 static int				find_trackno_from_filename(char *filename);
@@ -198,7 +198,7 @@
 	audacious_menu_plugin_item_add(AUDACIOUS_MENU_PLAYLIST, playlist_menu_item);
 	g_signal_connect(G_OBJECT(playlist_menu_item), "button_press_event", G_CALLBACK(menu_click), NULL);  
 	
-	uri_set_plugin("cdda://", &inputplugin);
+	aud_uri_set_plugin("cdda://", &inputplugin);
 }
 
 static void cdaudio_about()
@@ -453,7 +453,7 @@
 			}
 
 		if (strlen(trackinfo[trackno].name) == 0)
-			snprintf(trackinfo[trackno].name, trackno, "CD Audio Track %02u", sizeof(trackinfo[trackno].name));
+			snprintf(trackinfo[trackno].name, sizeof(trackinfo[trackno].name), "CD Audio Track %02u", trackno);
 
 	}
 
@@ -510,12 +510,12 @@
 	playing_track = trackno;
 	is_paused = FALSE;
 
-	tuple = create_tuple_from_trackinfo(pinputplayback->filename);
-	title = tuple_formatter_make_title_string(tuple, get_gentitle_format());
+	tuple = create_aud_tuple_from_trackinfo(pinputplayback->filename);
+	title = aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
 
-	inputplugin.set_info(title, calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn), 1411200, 44100, 2);
+	pinputplayback->set_params(pinputplayback, title, calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn), 1411200, 44100, 2);
 	g_free(title);
-	tuple_free(tuple);
+	aud_tuple_free(tuple);
 
 	if (use_dae) {
 		CDDEBUG("using digital audio extraction\n");
@@ -749,11 +749,11 @@
 	CDDEBUG("cdaudio_get_song_info(\"%s\")\n", filename);
 
 	gint trackno = find_trackno_from_filename(filename);
-	Tuple *tuple = create_tuple_from_trackinfo(filename);
+	Tuple *tuple = create_aud_tuple_from_trackinfo(filename);
 
 	if(tuple) {
-		*title = tuple_formatter_process_string(tuple, get_gentitle_format());
-		tuple_free(tuple);
+		*title = aud_tuple_formatter_process_string(tuple, get_gentitle_format());
+		aud_tuple_free(tuple);
 		tuple = NULL;
 	}
 	*length = calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn);
@@ -763,7 +763,7 @@
 {
 	CDDEBUG("cdaudio_get_song_tuple(\"%s\")\n", filename);
 
-	return create_tuple_from_trackinfo(filename);
+	return create_aud_tuple_from_trackinfo(filename);
 }
 
 
@@ -800,32 +800,32 @@
 	g_list_free(list);
 }
 
-Tuple *create_tuple_from_trackinfo(char *filename)
+Tuple *create_aud_tuple_from_trackinfo(char *filename)
 {
 	if (trackinfo == NULL)
 		return NULL;
 
-	Tuple *tuple = tuple_new_from_filename(filename);
+	Tuple *tuple = aud_tuple_new_from_filename(filename);
 	gint trackno = find_trackno_from_filename(filename);
 
 	if (trackno < firsttrackno || trackno > lasttrackno)
 		return NULL;
 
 	if(strlen(trackinfo[trackno].performer)) {
-		tuple_associate_string(tuple, FIELD_ARTIST, NULL, trackinfo[trackno].performer);
+		aud_tuple_associate_string(tuple, FIELD_ARTIST, NULL, trackinfo[trackno].performer);
 	}
 	if(strlen(trackinfo[0].name)) {
-		tuple_associate_string(tuple, FIELD_ALBUM, NULL, trackinfo[0].name);
+		aud_tuple_associate_string(tuple, FIELD_ALBUM, NULL, trackinfo[0].name);
 	}
 	if(strlen(trackinfo[trackno].name)) {
-		tuple_associate_string(tuple, FIELD_TITLE, NULL, trackinfo[trackno].name);
+		aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, trackinfo[trackno].name);
 	}
-	tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, trackno);
-	tuple_associate_string(tuple, -1, "ext", "cda"); //XXX should do? --yaz
+	aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, trackno);
+	aud_tuple_associate_string(tuple, -1, "ext", "cda"); //XXX should do? --yaz
 
-	tuple_associate_int(tuple, FIELD_LENGTH, NULL, calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn));
+	aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, calculate_track_length(trackinfo[trackno].startlsn, trackinfo[trackno].endlsn));
 	if(strlen(trackinfo[trackno].genre)) {
-		tuple_associate_string(tuple, FIELD_GENRE, NULL,  trackinfo[trackno].genre);
+		aud_tuple_associate_string(tuple, FIELD_GENRE, NULL,  trackinfo[trackno].genre);
 	}
 	//tuple->year = 0; todo: set the year
 
@@ -903,7 +903,8 @@
 				usleep(1000);
 				/* play the sound :) */
 			if (pdae_params->pplayback->playing && pdae_params->seektime == -1)
-				produce_audio(pdae_params->pplayback->output->written_time(), FMT_S16_LE, 2, bytecount, bytebuff, &pdae_params->pplayback->playing);
+				pdae_params->pplayback->pass_audio(pdae_params->pplayback, FMT_S16_LE, 2, 
+					bytecount, bytebuff, &pdae_params->pplayback->playing);
 			remainingbytes -= bytecount;
 			bytebuff += bytecount;
 		}
--- a/src/console/Audacious_Driver.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Audacious_Driver.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -34,7 +34,6 @@
 AudaciousConsoleConfig audcfg =
 { 180, FALSE, 32000, 0, 0, FALSE, 0, FALSE };
 static GThread* decode_thread;
-static GStaticMutex playback_mutex = G_STATIC_MUTEX_INIT;
 static int console_ip_is_going;
 static volatile long pending_seek;
 extern InputPlugin console_ip;
@@ -84,7 +83,7 @@
 	~File_Handler();
 private:
 	char header [4];
-	Vfs_File_Reader vfs_in;
+	Vfs_File_Reader aud_vfs_in;
 	Gzip_Reader in;
 };
 
@@ -117,12 +116,12 @@
 	
 	// open vfs
 	if ( fd )
-		vfs_in.reset( fd );
-	else if ( log_err( vfs_in.open( path ) ) )
+		aud_vfs_in.reset( fd );
+	else if ( log_err( aud_vfs_in.open( path ) ) )
 		return;
 	
 	// now open gzip_reader on top of vfs
-	if ( log_err( in.open( &vfs_in ) ) )
+	if ( log_err( in.open( &aud_vfs_in ) ) )
 		return;
 	
 	// read and identify header
@@ -165,7 +164,7 @@
 	
 	// files can be closed now
 	in.close();
-	vfs_in.close();
+	aud_vfs_in.close();
 	
 	log_warning( emu );
 	
@@ -201,28 +200,28 @@
 
 static Tuple* get_track_ti( const char* path, track_info_t const& info, int track )
 {
-	Tuple* ti = tuple_new();
+	Tuple* ti = aud_tuple_new();
 	if ( ti )
 	{
-		tuple_associate_string(ti, FIELD_FILE_NAME, NULL, g_path_get_basename(path));
-		tuple_associate_string(ti, FIELD_FILE_PATH, NULL, g_path_get_dirname(path));
-		tuple_associate_string(ti, FIELD_ARTIST, NULL, info.author);
-		tuple_associate_string(ti, FIELD_ALBUM, NULL, info.game);
-		tuple_associate_string(ti, -1, "game", info.game);
-		tuple_associate_string(ti, FIELD_TITLE, NULL, info.song ? info.song : g_path_get_basename(path));
+		aud_tuple_associate_string(ti, FIELD_FILE_NAME, NULL, g_path_get_basename(path));
+		aud_tuple_associate_string(ti, FIELD_FILE_PATH, NULL, g_path_get_dirname(path));
+		aud_tuple_associate_string(ti, FIELD_ARTIST, NULL, info.author);
+		aud_tuple_associate_string(ti, FIELD_ALBUM, NULL, info.game);
+		aud_tuple_associate_string(ti, -1, "game", info.game);
+		aud_tuple_associate_string(ti, FIELD_TITLE, NULL, info.song ? info.song : g_path_get_basename(path));
 		if ( info.track_count > 1 )
 		{
-			tuple_associate_int(ti, FIELD_TRACK_NUMBER, NULL, track + 1);
-			tuple_associate_int(ti, -1, "subsong", track + 1);
-			tuple_associate_int(ti, FIELD_SUBSONG_ID, NULL, track + 1);
-			tuple_associate_int(ti, FIELD_SUBSONG_NUM, NULL, info.track_count);
+			aud_tuple_associate_int(ti, FIELD_TRACK_NUMBER, NULL, track + 1);
+			aud_tuple_associate_int(ti, -1, "subsong", track + 1);
+			aud_tuple_associate_int(ti, FIELD_SUBSONG_ID, NULL, track + 1);
+			aud_tuple_associate_int(ti, FIELD_SUBSONG_NUM, NULL, info.track_count);
 		}
-		tuple_associate_string(ti, FIELD_COPYRIGHT, NULL, info.copyright);
-		tuple_associate_string(ti, -1, "console", info.system);
-		tuple_associate_string(ti, FIELD_CODEC, NULL, info.system);
-		tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced");
-		tuple_associate_string(ti, -1, "dumper", info.dumper);
-		tuple_associate_string(ti, FIELD_COMMENT, NULL, info.comment);
+		aud_tuple_associate_string(ti, FIELD_COPYRIGHT, NULL, info.copyright);
+		aud_tuple_associate_string(ti, -1, "console", info.system);
+		aud_tuple_associate_string(ti, FIELD_CODEC, NULL, info.system);
+		aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced");
+		aud_tuple_associate_string(ti, -1, "dumper", info.dumper);
+		aud_tuple_associate_string(ti, FIELD_COMMENT, NULL, info.comment);
 
 		int length = info.length;
 		if ( length <= 0 )
@@ -231,17 +230,17 @@
 			length = audcfg.loop_length * 1000;
 		else if ( length >= fade_threshold )
 			length += fade_length;
-		tuple_associate_int(ti, FIELD_LENGTH, NULL, length);
+		aud_tuple_associate_int(ti, FIELD_LENGTH, NULL, length);
 	}
 	return ti;
 }
 
 static char* format_and_free_ti( Tuple* ti, int* length )
 {
-	char* result = tuple_formatter_make_title_string(ti, get_gentitle_format());
+	char* result = aud_tuple_formatter_make_title_string(ti, get_gentitle_format());
 	if ( result )
-		*length = tuple_get_int(ti, FIELD_LENGTH, NULL);
-	tuple_free((void *) ti);
+		*length = aud_tuple_get_int(ti, FIELD_LENGTH, NULL);
+	aud_tuple_free((void *) ti);
 
 	return result;
 }
@@ -274,7 +273,6 @@
 static void* play_loop_track( gpointer arg )
 {
         InputPlayback *playback = (InputPlayback *) arg;
-	g_static_mutex_lock( &playback_mutex );
 
 	int end_delay = 0;	
 	while ( console_ip_is_going )
@@ -309,7 +307,7 @@
 				end_delay = emu->sample_rate() * (int) (seconds * 2) / buf_size;
 			}
 		}
-		produce_audio( playback->output->written_time(), 
+		playback->pass_audio( playback, 
 			FMT_S16_NE, 1, sizeof buf, buf, 
 			&console_ip_is_going );
 	}
@@ -318,7 +316,6 @@
 	unload_file();
 	playback->output->close_audio();
 	console_ip_is_going = 0;
-	g_static_mutex_unlock( &playback_mutex );
 	return NULL;
 }
 
@@ -377,7 +374,7 @@
 			char* title = format_and_free_ti( ti, &length );
 			if ( title )
 			{
-				console_ip.set_info( title, length, fh.emu->voice_count() * 1000, sample_rate, 2 );
+				playback->set_params( playback, title, length, fh.emu->voice_count() * 1000, sample_rate, 2 );
 				g_free( title );
 			}
 		}
@@ -485,7 +482,7 @@
 	if (!is_our_file_from_vfs(filename, fd))
 		return NULL;
 
-	vfs_rewind(fd);
+	aud_vfs_rewind(fd);
 
 	return get_song_tuple(filename);
 }
--- a/src/console/Ay_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Ay_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -116,7 +116,7 @@
 static Music_Emu* new_ay_emu () { return BLARGG_NEW Ay_Emu ; }
 static Music_Emu* new_ay_file() { return BLARGG_NEW Ay_File; }
 
-gme_type_t_ const gme_ay_type [1] = { "ZX Spectrum", 0, &new_ay_emu, &new_ay_file, "AY", 1 };
+gme_type_t_ const gme_ay_type [1] = {{ "ZX Spectrum", 0, &new_ay_emu, &new_ay_file, "AY", 1 }};
 
 // Setup
 
--- a/src/console/Gbs_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Gbs_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -99,7 +99,7 @@
 static Music_Emu* new_gbs_emu () { return BLARGG_NEW Gbs_Emu ; }
 static Music_Emu* new_gbs_file() { return BLARGG_NEW Gbs_File; }
 
-gme_type_t_ const gme_gbs_type [1] = { "Game Boy", 0, &new_gbs_emu, &new_gbs_file, "GBS", 1 };
+gme_type_t_ const gme_gbs_type [1] = {{ "Game Boy", 0, &new_gbs_emu, &new_gbs_file, "GBS", 1 }};
 
 // Setup
 
--- a/src/console/Gym_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Gym_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -161,7 +161,7 @@
 static Music_Emu* new_gym_emu () { return BLARGG_NEW Gym_Emu ; }
 static Music_Emu* new_gym_file() { return BLARGG_NEW Gym_File; }
 
-gme_type_t_ const gme_gym_type [1] = { "Sega Genesis", 1, &new_gym_emu, &new_gym_file, "GYM", 0 };
+gme_type_t_ const gme_gym_type [1] = {{ "Sega Genesis", 1, &new_gym_emu, &new_gym_file, "GYM", 0 }};
 
 // Setup
 
--- a/src/console/Hes_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Hes_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -132,7 +132,7 @@
 static Music_Emu* new_hes_emu () { return BLARGG_NEW Hes_Emu ; }
 static Music_Emu* new_hes_file() { return BLARGG_NEW Hes_File; }
 
-gme_type_t_ const gme_hes_type [1] = { "PC Engine", 256, &new_hes_emu, &new_hes_file, "HES", 1 };
+gme_type_t_ const gme_hes_type [1] = {{ "PC Engine", 256, &new_hes_emu, &new_hes_file, "HES", 1 }};
 
 // Setup
 
--- a/src/console/Kss_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Kss_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -101,7 +101,7 @@
 static Music_Emu* new_kss_emu () { return BLARGG_NEW Kss_Emu ; }
 static Music_Emu* new_kss_file() { return BLARGG_NEW Kss_File; }
 
-gme_type_t_ const gme_kss_type [1] = { "MSX", 256, &new_kss_emu, &new_kss_file, "KSS", 0x03 };
+gme_type_t_ const gme_kss_type [1] = {{ "MSX", 256, &new_kss_emu, &new_kss_file, "KSS", 0x03 }};
 
 // Setup
 
--- a/src/console/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = console${PLUGIN_SUFFIX}
+
 SRCS = Audacious_Config.cxx    \
        Audacious_Driver.cxx    \
        Ay_Apu.cxx              \
@@ -50,14 +51,14 @@
        Ym2612_Emu.cxx          \
        Zlib_Inflater.cxx
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 LD = ${CXX}
 
-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}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -lz
--- a/src/console/Nsf_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Nsf_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -127,7 +127,7 @@
 static Music_Emu* new_nsf_emu () { return BLARGG_NEW Nsf_Emu ; }
 static Music_Emu* new_nsf_file() { return BLARGG_NEW Nsf_File; }
 
-gme_type_t_ const gme_nsf_type [1] = { "Nintendo NES", 0, &new_nsf_emu, &new_nsf_file, "NSF", 1 };
+gme_type_t_ const gme_nsf_type [1] = {{ "Nintendo NES", 0, &new_nsf_emu, &new_nsf_file, "NSF", 1 }};
 
 // Setup
 
--- a/src/console/Nsfe_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Nsfe_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -297,7 +297,7 @@
 static Music_Emu* new_nsfe_emu () { return BLARGG_NEW Nsfe_Emu ; }
 static Music_Emu* new_nsfe_file() { return BLARGG_NEW Nsfe_File; }
 
-gme_type_t_ const gme_nsfe_type [1] = { "Nintendo NES", 0, &new_nsfe_emu, &new_nsfe_file, "NSFE", 1 };
+gme_type_t_ const gme_nsfe_type [1] = {{ "Nintendo NES", 0, &new_nsfe_emu, &new_nsfe_file, "NSFE", 1 }};
 
 blargg_err_t Nsfe_Emu::load_( Data_Reader& in )
 {
--- a/src/console/Sap_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Sap_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -235,7 +235,7 @@
 static Music_Emu* new_sap_emu () { return BLARGG_NEW Sap_Emu ; }
 static Music_Emu* new_sap_file() { return BLARGG_NEW Sap_File; }
 
-gme_type_t_ const gme_sap_type [1] = { "Atari XL", 0, &new_sap_emu, &new_sap_file, "SAP", 1 };
+gme_type_t_ const gme_sap_type [1] = {{ "Atari XL", 0, &new_sap_emu, &new_sap_file, "SAP", 1 }};
 
 // Setup
 
--- a/src/console/Spc_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Spc_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -241,7 +241,7 @@
 static Music_Emu* new_spc_emu () { return BLARGG_NEW Spc_Emu ; }
 static Music_Emu* new_spc_file() { return BLARGG_NEW Spc_File; }
 
-gme_type_t_ const gme_spc_type [1] = { "Super Nintendo", 1, &new_spc_emu, &new_spc_file, "SPC", 0 };
+gme_type_t_ const gme_spc_type [1] = {{ "Super Nintendo", 1, &new_spc_emu, &new_spc_file, "SPC", 0 }};
 
 // Setup
 
--- a/src/console/Vfs_File.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Vfs_File.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -13,7 +13,7 @@
 Vfs_File_Reader::error_t Vfs_File_Reader::open( const char* path )
 {
 	close();
-	file_ = owned_file_ = vfs_fopen( path, "rb" );
+	file_ = owned_file_ = aud_vfs_fopen( path, "rb" );
 	if ( !file_ )
 		return "Couldn't open file";
 	return 0;
@@ -22,27 +22,27 @@
 long Vfs_File_Reader::size() const
 {
 	long pos = tell();
-	vfs_fseek( file_, 0, SEEK_END );
+	aud_vfs_fseek( file_, 0, SEEK_END );
 	long result = tell();
-	vfs_fseek( file_, pos, SEEK_SET );
+	aud_vfs_fseek( file_, pos, SEEK_SET );
 	return result;
 }
 
 long Vfs_File_Reader::read_avail( void* p, long s )
 {
-	return (long) vfs_fread( p, 1, s, file_ );
+	return (long) aud_vfs_fread( p, 1, s, file_ );
 }
 
 long Vfs_File_Reader::tell() const
 {
-	return vfs_ftell( file_ );
+	return aud_vfs_ftell( file_ );
 }
 
 Vfs_File_Reader::error_t Vfs_File_Reader::seek( long n )
 {
 	if ( n == 0 ) // optimization
-		vfs_rewind( file_ );
-	else if ( vfs_fseek( file_, n, SEEK_SET ) != 0 )
+		aud_vfs_rewind( file_ );
+	else if ( aud_vfs_fseek( file_, n, SEEK_SET ) != 0 )
 		return eof_error;
 	return 0;
 }
@@ -52,7 +52,7 @@
 	file_ = 0;
 	if ( owned_file_ )
 	{
-		vfs_fclose( owned_file_ );
+		aud_vfs_fclose( owned_file_ );
 		owned_file_ = 0;
 	}
 }
--- a/src/console/Vfs_File.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Vfs_File.h	Sat Oct 13 21:53:47 2007 +0300
@@ -5,7 +5,7 @@
 
 #include "Data_Reader.h"
 
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 
 class Vfs_File_Reader : public File_Reader {
 public:
--- a/src/console/Vgm_Emu.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/Vgm_Emu.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -203,8 +203,8 @@
 static Music_Emu* new_vgm_emu () { return BLARGG_NEW Vgm_Emu ; }
 static Music_Emu* new_vgm_file() { return BLARGG_NEW Vgm_File; }
 
-gme_type_t_ const gme_vgm_type [1] = { "Sega SMS/Genesis", 1, &new_vgm_emu, &new_vgm_file, "VGM", 1 };
-gme_type_t_ const gme_vgz_type [1] = { "Sega SMS/Genesis", 1, &new_vgm_emu, &new_vgm_file, "VGZ", 1 };
+gme_type_t_ const gme_vgm_type [1] = {{ "Sega SMS/Genesis", 1, &new_vgm_emu, &new_vgm_file, "VGM", 1 }};
+gme_type_t_ const gme_vgz_type [1] = {{ "Sega SMS/Genesis", 1, &new_vgm_emu, &new_vgm_file, "VGZ", 1 }};
 
 // Setup
 
--- a/src/console/abstract_file.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/console/abstract_file.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -143,7 +143,7 @@
 
 error_t Std_File_Reader::open( const char* path )
 {
-	file_ = vfs_fopen( path, "rb" );
+	file_ = aud_vfs_fopen( path, "rb" );
 	if ( !file_ )
 		RAISE_ERROR( "Couldn't open file" );
 	return NULL;
@@ -152,23 +152,23 @@
 long Std_File_Reader::size() const
 {
 	long pos = tell();
-	vfs_fseek( file_, 0, SEEK_END );
+	aud_vfs_fseek( file_, 0, SEEK_END );
 	long result = tell();
-	vfs_fseek( file_, pos, SEEK_SET );
+	aud_vfs_fseek( file_, pos, SEEK_SET );
 	return result;
 }
 
 long Std_File_Reader::read_avail( void* p, long s ) {
-	return (long) vfs_fread( p, 1, s, file_ );
+	return (long) aud_vfs_fread( p, 1, s, file_ );
 }
 
 long Std_File_Reader::tell() const {
-	return vfs_ftell( file_ );
+	return aud_vfs_ftell( file_ );
 }
 
 error_t Std_File_Reader::seek( long n )
 {
-	if ( vfs_fseek( file_, n, SEEK_SET ) != 0 )
+	if ( aud_vfs_fseek( file_, n, SEEK_SET ) != 0 )
 		RAISE_ERROR( "Error seeking in file" );
 	return NULL;
 }
@@ -176,7 +176,7 @@
 void Std_File_Reader::close()
 {
 	if ( file_ ) {
-		vfs_fclose( file_ );
+		aud_vfs_fclose( file_ );
 		file_ = NULL;
 	}
 }
@@ -192,7 +192,7 @@
 
 error_t Std_File_Writer::open( const char* path )
 {
-	file_ = vfs_fopen( path, "wb" );
+	file_ = aud_vfs_fopen( path, "wb" );
 	if ( !file_ )
 		RAISE_ERROR( "Couldn't open file for writing" );
 		
@@ -204,7 +204,7 @@
 
 error_t Std_File_Writer::write( const void* p, long s )
 {
-	long result = (long) vfs_fwrite( p, 1, s, file_ );
+	long result = (long) aud_vfs_fwrite( p, 1, s, file_ );
 	if ( result != s )
 		RAISE_ERROR( "Couldn't write to file" );
 	return NULL;
@@ -213,7 +213,7 @@
 void Std_File_Writer::close()
 {
 	if ( file_ ) {
-		vfs_fclose( file_ );
+		aud_vfs_fclose( file_ );
 		file_ = NULL;
 	}
 }
--- a/src/cue/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/cue/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = cuesheet${PLUGIN_SUFFIX}
+
 SRCS = cuesheet.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${DBUS_LIB}
--- a/src/cue/cuesheet.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/cue/cuesheet.c	Sat Oct 13 21:53:47 2007 +0300
@@ -44,7 +44,7 @@
 static void stop(InputPlayback *data);
 static void cue_pause(InputPlayback *data, short);
 static Tuple *get_tuple(gchar *uri);
-static Tuple *get_tuple_uri(gchar *uri);
+static Tuple *get_aud_tuple_uri(gchar *uri);
 static void cue_init(void);
 static void cue_cleanup(void);
 static gpointer watchdog_func(gpointer data);
@@ -122,7 +122,7 @@
 #ifdef DEBUG
     g_print("watchdog_thread = %p\n", watchdog_thread);
 #endif
-    uri_set_plugin("cue://", &cue_ip);
+    aud_uri_set_plugin("cue://", &cue_ip);
 }
 
 static void cue_cleanup(void)
@@ -213,22 +213,22 @@
 	if (strncasecmp("cue://", uri, 6))
 	{
 		gchar *tmp = g_strdup_printf("cue://%s?0", uri);
-		ret = get_tuple_uri(tmp);
+		ret = get_aud_tuple_uri(tmp);
 		g_free(tmp);
 		return ret;
 	}
 
-	return get_tuple_uri(uri);
+	return get_aud_tuple_uri(uri);
 }
 
-static void _tuple_copy_field(Tuple *tuple, Tuple *tuple2, const gint nfield, const gchar *field)
+static void _aud_tuple_copy_field(Tuple *tuple, Tuple *tuple2, const gint nfield, const gchar *field)
 {
-    const gchar *str = tuple_get_string(tuple, nfield, field);
-    tuple_disassociate(tuple2, nfield, field);
-    tuple_associate_string(tuple2, nfield, field, str);
+    const gchar *str = aud_tuple_get_string(tuple, nfield, field);
+    aud_tuple_disassociate(tuple2, nfield, field);
+    aud_tuple_associate_string(tuple2, nfield, field, str);
 }
 
-static Tuple *get_tuple_uri(gchar *uri)
+static Tuple *get_aud_tuple_uri(gchar *uri)
 {
     gchar *path2 = g_strdup(uri + 6);
     gchar *_path = strchr(path2, '?');
@@ -268,28 +268,28 @@
     if(!phys_tuple)
         return NULL;
 
-    out = tuple_new();
+    out = aud_tuple_new();
 
-    _tuple_copy_field(phys_tuple, out, FIELD_FILE_PATH, NULL);
-    _tuple_copy_field(phys_tuple, out, FIELD_FILE_NAME, NULL);
-    _tuple_copy_field(phys_tuple, out, FIELD_FILE_EXT, NULL);
-    _tuple_copy_field(phys_tuple, out, FIELD_CODEC, NULL);
-    _tuple_copy_field(phys_tuple, out, FIELD_QUALITY, NULL);
-    _tuple_copy_field(phys_tuple, out, FIELD_COPYRIGHT, NULL);
-    _tuple_copy_field(phys_tuple, out, FIELD_COMMENT, NULL);
+    _aud_tuple_copy_field(phys_tuple, out, FIELD_FILE_PATH, NULL);
+    _aud_tuple_copy_field(phys_tuple, out, FIELD_FILE_NAME, NULL);
+    _aud_tuple_copy_field(phys_tuple, out, FIELD_FILE_EXT, NULL);
+    _aud_tuple_copy_field(phys_tuple, out, FIELD_CODEC, NULL);
+    _aud_tuple_copy_field(phys_tuple, out, FIELD_QUALITY, NULL);
+    _aud_tuple_copy_field(phys_tuple, out, FIELD_COPYRIGHT, NULL);
+    _aud_tuple_copy_field(phys_tuple, out, FIELD_COMMENT, NULL);
 
-    tuple_associate_int(out, FIELD_LENGTH, NULL, tuple_get_int(phys_tuple, FIELD_LENGTH, NULL));
+    aud_tuple_associate_int(out, FIELD_LENGTH, NULL, aud_tuple_get_int(phys_tuple, FIELD_LENGTH, NULL));
 
-    tuple_free(phys_tuple);
+    aud_tuple_free(phys_tuple);
 
-    tuple_associate_string(out, FIELD_TITLE, NULL, cue_tracks[track].title);
-    tuple_associate_string(out, FIELD_ARTIST, NULL, cue_tracks[track].performer ?
+    aud_tuple_associate_string(out, FIELD_TITLE, NULL, cue_tracks[track].title);
+    aud_tuple_associate_string(out, FIELD_ARTIST, NULL, cue_tracks[track].performer ?
 				  cue_tracks[track].performer : cue_performer);
-    tuple_associate_string(out, FIELD_ALBUM, NULL, cue_title);
-    tuple_associate_string(out, FIELD_GENRE, NULL, cue_genre);
+    aud_tuple_associate_string(out, FIELD_ALBUM, NULL, cue_title);
+    aud_tuple_associate_string(out, FIELD_GENRE, NULL, cue_genre);
     if(cue_year)
-        tuple_associate_int(out, FIELD_YEAR, NULL, atoi(cue_year));
-    tuple_associate_int(out, FIELD_TRACK_NUMBER, NULL, track + 1);
+        aud_tuple_associate_int(out, FIELD_YEAR, NULL, atoi(cue_year));
+    aud_tuple_associate_int(out, FIELD_TRACK_NUMBER, NULL, track + 1);
 
     return out;
 }
@@ -458,7 +458,7 @@
 	cur_cue_track = track;
 	cache_cue_file(path2); //path2 should be uri.
 
-    if (cue_file == NULL || !vfs_file_test(cue_file, G_FILE_TEST_EXISTS))
+    if (cue_file == NULL || !aud_vfs_file_test(cue_file, G_FILE_TEST_EXISTS))
         return;
 
 	pr = input_check_file(cue_file, FALSE);
@@ -471,22 +471,14 @@
 	{
 		if (real_ip)
 			g_free(real_ip);
-		real_ip = g_new0(InputPlayback, 1);
+
+		/* duplicate original playback and modify */
+		real_ip = (InputPlayback *)g_memdup(data, sizeof(InputPlayback));
 		real_ip->plugin = real_ip_plugin;
 		real_ip->plugin->set_info = set_info_override;
 		real_ip->plugin->output = cue_ip.output;
 		real_ip->filename = cue_file;
 
-		/* need to pass playback->output to real_ip */
-		real_ip->output = data->output;
-		real_ip->data = data->data;
-
-		/* we have to copy set_pb_ready things too. */
-		real_ip->pb_ready_mutex = data->pb_ready_mutex;
-		real_ip->pb_ready_cond = data->pb_ready_cond;
-		real_ip->pb_ready_val = data->pb_ready_val;
-		real_ip->set_pb_ready = data->set_pb_ready;
-
 		real_play_thread = g_thread_create((GThreadFunc)(real_ip->plugin->play_file), (gpointer)real_ip, TRUE, NULL);
 		g_usleep(50000); // wait for 50msec while real input plugin is initializing.
 
@@ -508,8 +500,8 @@
 
         tuple = real_ip->plugin->get_song_tuple(cue_file);
         if(tuple) {
-            cue_tracks[last_cue_track].index = tuple_get_int(tuple, FIELD_LENGTH, NULL);
-            tuple_free(tuple); tuple = NULL;
+            cue_tracks[last_cue_track].index = aud_tuple_get_int(tuple, FIELD_LENGTH, NULL);
+            aud_tuple_free(tuple); tuple = NULL;
         }
 
         /* kick watchdog thread */
@@ -749,7 +741,7 @@
 
 static void cache_cue_file(char *f)
 {
-	VFSFile *file = vfs_fopen(f, "rb");
+	VFSFile *file = aud_vfs_fopen(f, "rb");
 	gchar line[MAX_CUE_LINE_LENGTH+1];
 
 	if(!file)
@@ -759,8 +751,8 @@
 		gint p;
 		gint q;
 
-		if (vfs_fgets(line, MAX_CUE_LINE_LENGTH+1, file) == NULL) {
-			vfs_fclose(file);
+		if (aud_vfs_fgets(line, MAX_CUE_LINE_LENGTH+1, file) == NULL) {
+			aud_vfs_fclose(file);
 			return;
         }
 
@@ -847,7 +839,7 @@
         }
     }
 
-	vfs_fclose(file);
+	aud_vfs_fclose(file);
 }
 
 static void fix_cue_argument(char *line)
--- a/src/curl/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-PLUGIN = curl${PLUGIN_SUFFIX}
-SRCS = curl.c
-
-plugindir = audacious/${TRANSPORT_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} ${CURL_CFLAGS} -I../../intl -I../..
-CFLAGS += ${PLUGIN_CFLAGS}
-LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} ${CURL_LIBS}
--- a/src/curl/curl.c	Sat Oct 13 21:53:37 2007 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1091 +0,0 @@
-/*  Audacious
- *  Copyright (c) 2007 Daniel Barkalow
- *
- *  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 "config.h"
-
-#include <audacious/plugin.h>
-#include <audacious/configdb.h>
-
-#include <curl/curl.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#define BUFFER_SIZE 256 * 1024
-#define REVERSE_SEEK_SIZE 2048
-#define DEFAULT_CONNECT_TIMEOUT 3
-
-#define DEBUG_CONNECTION 0
-#define DEBUG_OPEN_CLOSE 1
-#define DEBUG_SEEK 0
-#define DEBUG_READ 0
-#define DEBUG_HEADERS 1
-#define DEBUG_ICY 0
-#define DEBUG_ICY_WRAP 0
-#define DEBUG_ICY_VERBOSE 0
-#define DEBUG_METADATA_REPORT 0
-#define DEBUG_CURL 0
-#define DEBUG_SETTINGS 1
-
-#if DEBUG_SETTINGS>0
-#define DEBUG_SETTINGS_MSG(...) g_print(__VA_ARGS__);
-#else
-#define DEBUG_SETTINGS_MSG(...)
-#endif
-
-typedef struct _CurlHandle CurlHandle;
-
-struct _CurlHandle {
-  CURL *curl;
-
-  gchar *url; // URL string, must remain present until curl no longer needs it
-
-  gssize length; // the length of the file
-  gssize rd_abs; // the absolute position for reading from the stream
-  gssize wr_abs; // the absolute position where the input connection is
-
-  gssize icy_left;
-  gssize icy_interval;
-  gint in_icy_meta; // 0=no, 1=before size, 2=in data
-  gssize meta_abs; // the absolute position where the metadata changes
-
-  gssize buffer_length;
-  gchar *buffer;
-
-  gssize rd_index;
-  gssize wr_index;
-
-  gssize hdr_index;
-
-  GSList *stream_stack; // stack for stream functions (getc, ungetc)
-
-  gboolean header; // true if we haven't finished the header yet
-  gboolean no_data; // true if we're only looking for length currently
-  gboolean cancel; // true if the thread should be cancelled
-  gboolean failed; // true if we've tried and failed already
-  GThread *thread; // the thread that's reading from the connection
-
-  VFSFile *download; // file to write to as we download
-
-  gchar *name;
-  gchar *title;
-
-  struct {
-    gchar *proxy_host;
-    gchar *proxy_auth;
-  } proxy_info;
-  
-  gchar *local_ip;
-
-  GMutex *curl_mutex;
-  GCond *curl_cond;
-};
-
-typedef struct {
-  gint connect_timeout;
-} CurlOptions;
-
-CurlOptions curl_options;
-
-void curl_vfs_rewind_impl(VFSFile * file);
-glong curl_vfs_ftell_impl(VFSFile * file);
-gboolean curl_vfs_feof_impl(VFSFile * file);
-gint curl_vfs_truncate_impl(VFSFile * file, glong size);
-gchar *curl_vfs_metadata_impl(VFSFile * file, const gchar * field);
-size_t curl_vfs_fwrite_impl(gconstpointer ptr, size_t size,
-		     size_t nmemb,
-		     VFSFile * file);
-size_t curl_vfs_fread_impl(gpointer ptr_, size_t size,
-		     size_t nmemb,
-		     VFSFile * file);
-gint curl_vfs_fclose_impl(VFSFile * file);
-gint curl_vfs_getc_impl(VFSFile *stream);
-gint curl_vfs_ungetc_impl(gint c, VFSFile *stream);
-gint curl_vfs_fseek_impl(VFSFile * file, glong offset, gint whence);
-VFSFile *curl_vfs_fopen_impl(const gchar * path,
-		    const gchar * mode);
-
-VFSConstructor curl_const;
-
-/* TODO:
- *  - Fix hang if the server closes the connection in the middle
- *  - Clever buffer stuff when you read a bit of the beginning and a bit of the
- *    end of a file
- */
-
-/* The goal here is to have a buffering system which handles the following:
- *  1) open, seek, read (without fetching the beginning of the file)
- *  2) open, seek END, tell (using HEAD only)
- *  3) open, read, seek 0, read (without restarting fetch)
- */
-
-static ssize_t buf_space(CurlHandle *handle)
-{
-  ssize_t rd_edge = handle->rd_abs - REVERSE_SEEK_SIZE;
-  ssize_t buffer_limit;
-  ssize_t cont_limit;
-  if (rd_edge < 0)
-    rd_edge = 0;
-  buffer_limit = handle->buffer_length - 
-    (handle->wr_abs - rd_edge);
-  cont_limit = handle->buffer_length - handle->wr_index;
-  if (cont_limit < buffer_limit)
-    buffer_limit = cont_limit;
-  if (handle->icy_interval && handle->icy_left)
-    {
-      if (handle->icy_left < buffer_limit)
-	buffer_limit = handle->icy_left;
-    }
-  return buffer_limit;
-}
-
-static size_t buf_available(CurlHandle *handle)
-{
-  size_t buffer_limit;
-  size_t cont_limit;
-  if (handle->header)
-    return 0;
-  buffer_limit = handle->wr_abs - handle->rd_abs;
-  cont_limit = handle->buffer_length - handle->rd_index;
-  if (buffer_limit <= 0)
-    return 0;
-  return buffer_limit < cont_limit ? buffer_limit : cont_limit;
-}
-
-static void check(CurlHandle *handle)
-{
-  if (!((handle->wr_abs - handle->wr_index) % handle->buffer_length ==
-	(handle->rd_abs - handle->rd_index) % handle->buffer_length))
-    printf("%p Not aligned! wr %d rd %d\n", handle,
-           (int)((handle->wr_abs - handle->wr_index) % handle->buffer_length),
-           (int)((handle->rd_abs - handle->rd_index) % handle->buffer_length));
-}
-
-static void update_length(CurlHandle *handle)
-{
-  if (handle->length == -1)
-    {
-      double value;
-      int retcode =
-	curl_easy_getinfo(handle->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, 
-			  &value);
-      if (retcode == CURLE_OK)
-	{
-	  handle->length = value;
-	  if (handle->length == 0)
-	    handle->length = -2;
-	  //g_print("Length: %d\n", handle->length);
-	}
-      else
-	{
-	  handle->length = -2;
-	  g_print("getinfo gave error\n");
-	}
-    }
-}
-
-#define PROBE 262140
-
-#define ICE_NAME "ice-name:"
-#define ICY_NAME "icy-name:"
-#define ICY_METAINT "icy-metaint:"
-
-static gboolean match_header(CurlHandle *handle, size_t size,
-			     const char *header)
-{
-  if (strlen(header) > size)
-    return FALSE;
-  // XXXX wrapped headers
-  return !(strncasecmp(handle->buffer + handle->hdr_index,
-		   header, strlen(header)));
-}
-
-static gchar *get_value(CurlHandle *handle, size_t size, const char *header)
-{
-  // XXXX wrapped headers
-  return g_strdup(handle->buffer + 
-		(handle->hdr_index + strlen(header)) % handle->buffer_length);
-}
-
-static void got_header(CurlHandle *handle, ssize_t size)
-{
-  if (DEBUG_HEADERS)
-    g_print("Got header %d bytes\n", (int)size);
-  if (match_header(handle, size, ICY_NAME))
-    {
-      handle->name = get_value(handle, size, ICY_NAME);
-      if (DEBUG_HEADERS)
-	{
-	  g_print("Stream name: %s\n", handle->name);
-	}
-    }
-  if (match_header(handle, size, ICE_NAME))
-    {
-      handle->name = get_value(handle, size, ICE_NAME);
-      if (DEBUG_HEADERS)
-	{
-	  g_print("Stream name: %s\n", handle->name);
-	}
-    }
-  if (match_header(handle, size, ICY_METAINT))
-    {
-      gchar *value = get_value(handle, size, ICY_METAINT);
-      handle->icy_interval = atoi(value);
-      g_free(value);
-      if (DEBUG_HEADERS)
-        g_print("Metadata interval: %d\n", (int)handle->icy_interval);
-    }
-}
-
-#define TITLE_INLINE "StreamTitle="
-
-static gboolean match_inline(CurlHandle *handle, size_t posn, 
-			     const char *name)
-{
-  size_t len = strlen(name);
-  size_t i;
-  if (DEBUG_ICY_WRAP)
-    g_print("Posn=%d\n", (int)posn);
-  if (DEBUG_ICY_WRAP && posn + len > handle->buffer_length)
-    g_print("Wrapped inline key\n");
-  if (((handle->wr_index - posn + handle->buffer_length) %
-       handle->buffer_length) <= len)
-    return FALSE;
-  for (i = 0; i < len; i++)
-    if (handle->buffer[(posn + i) % handle->buffer_length] != name[i])
-      {
-	return FALSE;
-      }
-  return TRUE;
-}
-
-static gchar *get_inline_value(CurlHandle *handle, size_t posn,
-			       const char *name)
-{
-  size_t end;
-  size_t sz;
-  gchar *ret;
-  posn = (posn + strlen(name) + 1) % handle->buffer_length;
-  end = posn;
-  while (handle->buffer[end % handle->buffer_length] != ';')
-    end++;
-  sz = (end - posn + handle->buffer_length) % handle->buffer_length;
-  ret = g_malloc(sz);
-  if (end % handle->buffer_length < posn % handle->buffer_length)
-    {
-      size_t prewrap = handle->buffer_length - posn;
-      memcpy(ret, handle->buffer + posn, prewrap);
-      memcpy(ret + prewrap, handle->buffer, sz - prewrap);
-      if (DEBUG_ICY_WRAP)
-	g_print("Wrapped inline metadata value\n");
-    }
-  else
-    {
-      memcpy(ret, handle->buffer + posn, sz);
-    }
-  ret[sz - 1] = '\0';
-  return ret;
-}
-
-static void got_inline_metadata(CurlHandle *handle)
-{
-  size_t i = (handle->hdr_index + 1) % handle->buffer_length;
-  if (match_inline(handle, i, TITLE_INLINE))
-    {
-      if (handle->title)
-	g_free(handle->title);
-      handle->title = get_inline_value(handle, i, TITLE_INLINE);
-      if (DEBUG_ICY)
-	g_print("Title: '%s'\n", handle->title);
-    }
-  handle->meta_abs = handle->wr_abs;
-}
-
-static size_t curl_writecb(unsigned char *ptr, size_t size, size_t nmemb, void *stream)
-{
-  CurlHandle *handle = stream;
-  gint sz = size * nmemb;
-  gint ret = 0;
-  gint trans;
-
-  if (!handle->header)
-    update_length(handle);
-
-  g_cond_signal(handle->curl_cond);
-
-  while (ret < sz)
-    {
-      while (!(trans = buf_space(handle)) && !handle->cancel)
-	{
-	  //g_print("Wait for free space on %p\n", handle);
-	  g_usleep(10000);
-	}
-      if (handle->cancel)
-	break;
-      if (trans > sz - ret)
-	trans = sz - ret;
-      memcpy(handle->buffer + handle->wr_index, ptr + ret, trans);
-
-      if (!handle->header)
-	{
-	  if (handle->icy_interval)
-	    handle->icy_left -= trans;
-	  if (!handle->in_icy_meta)
-	    {
-	      handle->wr_abs += trans;
-	      if (handle->download)
-		{
-		  vfs_fwrite(ptr + ret, trans, 1, handle->download);
-		}
-	      if (handle->icy_interval && !handle->icy_left)
-		{
-		  if (DEBUG_ICY)
-        g_print("Metadata inline after %d\n", (int)handle->wr_abs);
-		  handle->in_icy_meta = 1;
-		  handle->icy_left = 1;
-		}
-	    }
-	  else if (handle->in_icy_meta == 1)
-	    {
-	      // Track where the header insert starts
-	      handle->hdr_index = handle->wr_index;
-	      handle->icy_left = 
-		((unsigned char)(handle->buffer[handle->wr_index])) * 16;
-	      if (DEBUG_ICY)
-          g_print("Metadata of size %d\n", (int)handle->icy_left);
-	      if (handle->icy_left)
-		{
-		  handle->in_icy_meta = 2;
-		}
-	      else
-		{
-		  handle->in_icy_meta = 0;
-		  handle->icy_left = handle->icy_interval;
-		  handle->wr_index--;
-		}
-	    }
-	  else
-	    {
-	      if (!handle->icy_left)
-		{
-		  handle->wr_index = (handle->wr_index + trans) % 
-		    handle->buffer_length;
-		  if (DEBUG_ICY_VERBOSE)
-		    {
-		      if (handle->wr_index < handle->hdr_index)
-			{
-			  // wrapped
-			  fwrite(handle->buffer + handle->hdr_index + 1,
-				 handle->buffer_length - handle->hdr_index - 1,
-				 1, stdout);
-			  fwrite(handle->buffer, handle->wr_index, 1, stdout);
-			}
-		      else
-			{
-			  fwrite(handle->buffer + handle->hdr_index, 
-				 handle->wr_index - handle->hdr_index, 1, 
-				 stdout);
-			}
-		      g_print("\n");
-		    }
-		    got_inline_metadata(handle);
-
-		  // Rewind the buffer usage to write over the
-		  // metadata with content. -trans because we're about
-		  // to add it.
-		  handle->wr_index = handle->hdr_index - trans;
-		  handle->in_icy_meta = 0;
-		  handle->icy_left = handle->icy_interval;
-		}
-	    }
-	}
-      handle->wr_index = (handle->wr_index + trans) % handle->buffer_length;
-      ret += trans;
-
-      if (handle->header)
-	{
-	  gssize i = handle->hdr_index;
-	  while (1)
-	    {
-	      if ((i + 1) % handle->buffer_length == handle->wr_index)
-		break;
-	      if (handle->buffer[i] == '\r' &&
-		  handle->buffer[(i + 1) % handle->buffer_length] == '\n')
-		{
-		  gssize size_ = (handle->buffer_length + i - 
-				handle->hdr_index) % handle->buffer_length;
-		  handle->buffer[i] = '\0';
-		  got_header(handle, size_);
-		  if (i == handle->hdr_index)
-		    {
-		      size_t leftover;
-		      // Empty header means the end of the headers
-		      handle->header = 0;
-		      handle->hdr_index = (i + 2) % handle->buffer_length;
-		      // We read from the start of the data in the request
-		      handle->rd_index = handle->hdr_index;
-		      // We've already written the amount that's after
-		      // the header.
-		      leftover = (handle->wr_index - handle->hdr_index + handle->buffer_length) % handle->buffer_length;
-		      handle->wr_abs += leftover;
-		      if (handle->download)
-			{
-			  // the data which has to go into the
-			  // beginning of the file must be at the end
-			  // of the input that we've dealt with.
-			  vfs_fwrite(ptr + ret - leftover, leftover, 1, 
-				     handle->download);
-			}
-		      handle->icy_left = handle->icy_interval;
-		      if (handle->icy_interval)
-			{
-			  handle->icy_left -=
-			    (handle->wr_index - handle->hdr_index + handle->buffer_length) % handle->buffer_length;
-			}
-		      if (DEBUG_ICY)
-            g_print("Left %d\n", (int)handle->icy_left);
-		      handle->in_icy_meta = 0;
-		      break;
-		    }
-		  handle->hdr_index = (i + 2) % handle->buffer_length;
-		}
-	      i = (i + 1) % handle->buffer_length;
-	    }
-	}
-    }
-  return ret;
-}
-
-static gpointer
-curl_manage_request(gpointer arg)
-{
-  CurlHandle *handle = arg;
-  CURLcode result;
-  if (DEBUG_CONNECTION)
-    g_print("Connect %p\n", handle);
-
-  if (handle->no_data)
-    curl_easy_setopt(handle->curl, CURLOPT_NOBODY, 1);
-  else
-    {
-      if (DEBUG_CONNECTION)
-        g_print("Start from %d\n", (int)handle->wr_abs);
-      curl_easy_setopt(handle->curl, CURLOPT_RESUME_FROM, handle->wr_abs);
-
-      curl_easy_setopt(handle->curl, CURLOPT_NOBODY, 0);
-      curl_easy_setopt(handle->curl, CURLOPT_HTTPGET, 1);
-    }
-
-  handle->header = 1;
-  handle->hdr_index = 0;
-  handle->icy_interval = 0;
-
-  result = curl_easy_perform(handle->curl);
-  if (result == CURLE_OK)
-    update_length(handle);
-  // We expect to get CURLE_WRITE_ERROR if we cancel.
-  // We get CURLE_GOT_NOTHING if we send a HEAD request to a shoutcast server.
-  // We get CURLE_HTTP_RANGE_ERROR if we try to use range with shoutcast.
-  if (result != CURLE_OK && result != CURLE_WRITE_ERROR && 
-      result != CURLE_GOT_NOTHING && result != CURLE_HTTP_RANGE_ERROR &&
-      result != CURLE_PARTIAL_FILE)
-    {
-      g_print("Got curl error %d: %s\n", result, curl_easy_strerror(result));
-      handle->failed = 1;
-    }
-  if (DEBUG_CONNECTION)
-    g_print("Done %p%s", handle, handle->cancel ? " (aborted)\n" : "\n");
-  handle->cancel = 1;
-
-  g_cond_signal(handle->curl_cond);
-  handle->thread = NULL;
-
-  return NULL;
-}
-
-static void curl_req_xfer(CurlHandle *handle)
-{
-  if (handle->failed)
-    {
-      handle->cancel = 1;
-      return;
-    }
-  if (!handle->thread)
-    {
-      handle->cancel = 0;
-      handle->wr_index = 0;
-      handle->rd_index = 0;
-      handle->wr_abs = handle->rd_abs;
-      if (DEBUG_CONNECTION)
-        g_print("Starting connection %p at %d\n", handle, (int)handle->wr_abs);
-      handle->thread = g_thread_create(curl_manage_request, handle, 
-				       TRUE, NULL);
-
-      g_mutex_lock(handle->curl_mutex);
-      g_cond_wait(handle->curl_cond, handle->curl_mutex);
-      g_mutex_unlock(handle->curl_mutex);
-    }
-}
-
-static void curl_req_sync_xfer(CurlHandle *handle, size_t old_rd_abs)
-{
-  handle->rd_index = (handle->rd_index + handle->rd_abs - old_rd_abs +
-		      handle->buffer_length) % handle->buffer_length;
-}
-
-static void curl_req_no_xfer(CurlHandle *handle)
-{
-  if (handle->thread)
-    {
-      handle->cancel = 1;
-      g_thread_join(handle->thread);
-      handle->thread = NULL;
-      handle->cancel = 0;
-    }
-}
-
-VFSFile *
-curl_vfs_fopen_impl(const gchar * path,
-		    const gchar * mode)
-{
-  CurlHandle *handle;
-  VFSFile *file;
-  if (!path || !mode)
-    return NULL;
-
-  file = g_new0(VFSFile, 1);
-
-  handle = g_new0(CurlHandle, 1);
-  handle->url = g_strdup(path);
-  handle->curl = curl_easy_init();
-  handle->rd_index = 0;
-  handle->wr_index = 0;
-  handle->meta_abs = 0;
-  handle->rd_abs = 0;
-  handle->wr_abs = 0;
-  handle->buffer_length = BUFFER_SIZE;
-  handle->buffer = g_malloc(handle->buffer_length);
-  handle->thread = NULL;
-  handle->length = -1;
-  handle->cancel = 0;
-  handle->failed = 0;
-  handle->no_data = 0;
-  handle->stream_stack = NULL;
-  handle->curl_mutex = g_mutex_new();
-  handle->curl_cond = g_cond_new();
-
-  curl_easy_setopt(handle->curl, CURLOPT_URL, handle->url);
-  curl_easy_setopt(handle->curl, CURLOPT_WRITEFUNCTION, curl_writecb);
-  curl_easy_setopt(handle->curl, CURLOPT_WRITEDATA, handle);
-  curl_easy_setopt(handle->curl, CURLOPT_HEADERDATA, handle);
-
-  if ( curl_options.connect_timeout > 0 )
-    curl_easy_setopt(handle->curl, CURLOPT_CONNECTTIMEOUT, curl_options.connect_timeout);
-  else
-    curl_easy_setopt(handle->curl, CURLOPT_CONNECTTIMEOUT, DEFAULT_CONNECT_TIMEOUT);
-  curl_easy_setopt(handle->curl, CURLOPT_NOSIGNAL, 1);
-
-  curl_easy_setopt(handle->curl, CURLOPT_SSL_VERIFYPEER, 0);
-  curl_easy_setopt(handle->curl, CURLOPT_SSL_VERIFYHOST, 0);
-
-  curl_easy_setopt(handle->curl, CURLOPT_FOLLOWLOCATION, 1);
-
-  if (DEBUG_CURL)
-    curl_easy_setopt(handle->curl, CURLOPT_VERBOSE, 1);
-
-  {
-    gboolean tmp = FALSE;
-    ConfigDb *db;
-
-    db = bmp_cfg_db_open();
-
-    bmp_cfg_db_get_bool(db, NULL, "use_local_ip", &tmp);
-    if (tmp == TRUE)
-    {
-      bmp_cfg_db_get_string(db, NULL, "local_ip", &handle->local_ip);
-      curl_easy_setopt(handle->curl, CURLOPT_INTERFACE, handle->local_ip);
-    }
-    tmp = FALSE;
-
-    bmp_cfg_db_get_bool(db, NULL, "use_proxy", &tmp);
-    if (tmp == TRUE)
-    {
-      gint proxy_port = 0;
-
-      bmp_cfg_db_get_string(db, NULL, "proxy_host", 
-        &handle->proxy_info.proxy_host);
-      bmp_cfg_db_get_int(db, NULL, "proxy_port", &proxy_port);
-
-      curl_easy_setopt(handle->curl, CURLOPT_PROXY, handle->proxy_info.proxy_host);
-      curl_easy_setopt(handle->curl, CURLOPT_PROXYPORT, proxy_port);
-
-      tmp = FALSE;
-
-      bmp_cfg_db_get_bool(db, NULL, "proxy_use_auth", &tmp);
-      if (tmp == TRUE)
-      {
-        gchar *proxy_user = NULL, *proxy_pass = NULL;
-
-        bmp_cfg_db_get_string(db, NULL, "proxy_user", &proxy_user);
-        bmp_cfg_db_get_string(db, NULL, "proxy_pass", &proxy_pass);
-
-        handle->proxy_info.proxy_auth = g_strdup_printf("%s:%s",
-          proxy_user != NULL ? proxy_user : "", 
-          proxy_pass != NULL ? proxy_pass : "");
-
-        curl_easy_setopt(handle->curl, CURLOPT_PROXYUSERPWD, 
-	  handle->proxy_info.proxy_auth);
-      }
-    }
-
-    bmp_cfg_db_close(db);
-  }
-
-  {
-    struct curl_slist *hdr = NULL;
-    hdr = curl_slist_append(hdr, "Icy-MetaData: 1");
-    hdr = curl_slist_append(hdr, "User-Agent: Audacious/" VERSION " (curl transport)");
-    curl_easy_setopt(handle->curl, CURLOPT_HTTPHEADER, hdr);
-  }
-
-  //handle->download = vfs_fopen(FILENAME, "wb");
-
-  file->handle = handle;
-  file->base = &curl_const;
-
-  if (DEBUG_OPEN_CLOSE)
-    g_print("Open %s with curl => %p\n", handle->url, handle);
-
-  return file;
-}
-
-gint
-curl_vfs_fclose_impl(VFSFile * file)
-{
-  gint ret = 0;
-  if (file == NULL)
-    return -1;
-  if (DEBUG_OPEN_CLOSE)
-    g_print("Close %p\n", file->handle);
-  if (file->handle)
-    {
-      CurlHandle *handle = file->handle;
-      if (DEBUG_CONNECTION)
-	g_print("Cancel transfer\n");
-      curl_req_no_xfer(handle);
-      if (DEBUG_CONNECTION)
-	g_print("Okay\n");
-
-      g_free(handle->buffer);
-      if (handle->name)
-	g_free(handle->name);
-      if (handle->stream_stack != NULL)
-        g_slist_free(handle->stream_stack);
-      curl_easy_cleanup(handle->curl);
-
-      g_mutex_free(handle->curl_mutex);
-      g_cond_free(handle->curl_cond);
-
-      if (handle->local_ip != NULL)
-        g_free(handle->local_ip);
-
-      if (handle->proxy_info.proxy_host != NULL)
-        g_free(handle->proxy_info.proxy_host);
-
-      if (handle->proxy_info.proxy_auth != NULL)
-        g_free(handle->proxy_info.proxy_auth);
-
-      if (handle->download)
-	{
-	  vfs_fclose(handle->download);
-	}
-
-      if (handle->url != NULL)
-        g_free(handle->url);
-
-      g_free(handle);
-      file->handle = NULL;
-    }
-  return ret;
-}
-
-size_t
-curl_vfs_fread_impl(gpointer ptr_,
-		    size_t size,
-		    size_t nmemb,
-		    VFSFile * file)
-{
-  unsigned char *ptr = ptr_;
-  CurlHandle *handle = file->handle;
-  ssize_t sz = size * nmemb;
-  ssize_t ret = 0;
-
-  if (sz < 0)
-    return 0;
-
-//  g_print("Reading %d*%d=%d from %p\n", size, nmemb, sz, handle);
-
-  memset(ptr, '\0', sz);
-
-  /* check if there are ungetted chars that should be picked before the real fread */
-  if ( handle->stream_stack != NULL )
-  {
-    guchar uc;
-    while ( (ret < sz) && (handle->stream_stack != NULL) )
-    {
-      uc = GPOINTER_TO_INT(handle->stream_stack->data);
-      handle->stream_stack = g_slist_delete_link( handle->stream_stack , handle->stream_stack );
-      memcpy( ptr + ret , &uc , 1 );
-      handle->rd_abs++;
-      ret++;
-    }
-  }
-
-  curl_req_xfer(handle);
-
-  if (handle->failed == 1)
-  {
-      g_print("failed!\n");
-      return 0;
-  }
-
-  if (DEBUG_SEEK)
-    check(handle);
-
-  while (ret < sz)
-    {
-      ssize_t available;
-      while (!(available = buf_available(handle)) && !handle->cancel)
-	{
-	  //g_print("Wait for data on %p\n", handle);
-	  g_usleep(10000);
-	}
-      if (available > sz - ret)
-	available = sz - ret;
-      memcpy(ptr + ret, handle->buffer + handle->rd_index, available);
-
-      handle->rd_index = 
-	(handle->rd_index + available) % handle->buffer_length;
-      if (handle->rd_abs < handle->meta_abs &&
-	  handle->rd_abs + available >= handle->meta_abs)
-	{
-	  if (DEBUG_METADATA_REPORT)
-	    g_print("New song: '%s'\n", handle->title);
-	}
-      handle->rd_abs += available;
-      ret += available;
-      if (!available)
-	{
-	  //g_print("EOF reading from %p\n", handle);
-	  break;
-	}
-    }
-
-//  g_print("Read %d from %p\n", ret, handle);
-
-  return (size_t)(ret / size);
-}
-
-size_t
-curl_vfs_fwrite_impl(gconstpointer ptr,
-		     size_t size,
-		     size_t nmemb,
-		     VFSFile * file)
-{
-  return 0;
-}
-
-gint
-curl_vfs_getc_impl(VFSFile *stream)
-{
-  CurlHandle *handle = (CurlHandle *) stream->handle;
-  guchar uc;
-
-  g_return_val_if_fail(handle != NULL, EOF);
-
-  if ( handle->stream_stack != NULL ) /* check if some char was ungetc'ed before */
-  {
-    uc = GPOINTER_TO_INT(handle->stream_stack->data);
-    handle->stream_stack = g_slist_delete_link( handle->stream_stack , handle->stream_stack );
-    handle->rd_abs++;
-    return uc;
-  }
-  else if (curl_vfs_fread_impl(&uc, 1, 1, stream) != 1)
-    return EOF;
-  return uc;
-}
-
-gint
-curl_vfs_ungetc_impl(gint c, VFSFile *stream)
-{
-  CurlHandle *handle = (CurlHandle *) stream->handle;
-
-  g_return_val_if_fail(handle != NULL, EOF);
-
-  handle->stream_stack = g_slist_prepend( handle->stream_stack , GINT_TO_POINTER(c) );
-  if ( handle->stream_stack != NULL )
-  {
-    handle->rd_abs--;
-    return c;
-  }
-  else
-    return EOF;
-}
-
-gint
-curl_vfs_fseek_impl(VFSFile * file,
-		    glong offset,
-		    gint whence)
-{
-  size_t posn;
-  CurlHandle *handle = file->handle;
-  /* when a seek is requested, trash the stack of ungetted chars */
-  if ( handle->stream_stack != NULL )
-  {
-    g_slist_free( handle->stream_stack );
-    handle->stream_stack = NULL;
-  }
-  if (DEBUG_SEEK)
-    g_print("Seek %p to %d %d\n", handle, (int)offset, whence);
-  if (whence == SEEK_END && handle->length == -1)
-    {
-      if (!handle->thread)
-	{
-	  // We need a HEAD to find out the length
-	  handle->no_data = 1;
-	  if (DEBUG_CONNECTION)
-	    g_print("Request for head info\n");
-	  curl_manage_request(handle);
-	  if (DEBUG_CONNECTION)
-	    g_print("Completed\n");
-	  handle->no_data = 0;
-	}
-      else
-	{
-	  // Wait a bit?
-	}
-    }
-
-  if (whence == SEEK_END && handle->length <= 0)
-    {
-      if (DEBUG_SEEK)
-	g_print("Tried to seek to the end of a file with unknown length\n");
-      // don't know how long it is...
-      return -1;
-    }
-
-  posn = handle->rd_abs;
-
-  if (whence == SEEK_SET)
-    handle->rd_abs = offset;
-  else if (whence == SEEK_END)
-    handle->rd_abs = handle->length + offset;
-  else
-    handle->rd_abs = handle->rd_abs + offset;
-
-  // XXXX
-  // There's a race here between finding available space and
-  // allocating it and the check below.
-
-  if (handle->thread)
-    {
-      if (handle->rd_abs + handle->buffer_length < handle->wr_abs ||
-	  handle->rd_abs > handle->wr_abs)
-	{
-	  if (DEBUG_CONNECTION)
-	    g_print("Stop transfer\n");
-	  curl_req_no_xfer(handle);
-	  if (DEBUG_CONNECTION)
-	    g_print("Okay\n");
-	}
-      else
-	{
-	  if (DEBUG_CONNECTION)
-	    g_print("Continue transfer\n");
-	  curl_req_sync_xfer(handle, posn);
-	}
-    }
-
-  if (DEBUG_SEEK)
-    g_print("Seeked %p from %d to %d\n", handle, (int)posn, (int)handle->rd_abs);
-  return 0;
-}
-
-void
-curl_vfs_rewind_impl(VFSFile * file)
-{
-  curl_vfs_fseek_impl(file, 0, SEEK_SET);
-}
-
-glong
-curl_vfs_ftell_impl(VFSFile * file)
-{
-  CurlHandle *handle = file->handle;
-  return handle->rd_abs;
-}
-
-gboolean
-curl_vfs_feof_impl(VFSFile * file)
-{
-  CurlHandle *handle = file->handle;
-  return handle->rd_abs == handle->length;
-}
-
-gint
-curl_vfs_truncate_impl(VFSFile * file, glong size)
-{
-  return -1;
-}
-
-off_t
-curl_vfs_fsize_impl(VFSFile * file)
-{
-  CurlHandle *handle = file->handle;
-
-  if (handle->length == -1)
-    {
-      if (!handle->thread)
-	{
-	  // We need a HEAD to find out the length
-	  handle->no_data = 1;
-	  if (DEBUG_CONNECTION)
-	    g_print("Request for head info\n");
-	  curl_manage_request(handle);
-	  if (DEBUG_CONNECTION)
-	    g_print("Completed\n");
-	  handle->no_data = 0;
-	}
-      else
-	{
-	  // Wait a bit?
-	}
-    }
-
-  if (handle->length <= 0)
-    {
-      if (DEBUG_SEEK)
-	g_print("Tried to get the length of a file with unknown length\n");
-      // don't know how long it is...
-      return -1;
-    }
-    return handle->length;
-}
-
-gchar *
-curl_vfs_metadata_impl(VFSFile * file, const gchar * field)
-{
-  CurlHandle *handle = file->handle;
-  if (!strcmp(field, "stream-name") && handle->name != NULL)
-    return g_strdup(handle->name);
-  if (!strcmp(field, "track-name") && handle->title != NULL)
-    return g_strdup(handle->title);
-  if (!strcmp(field, "content-length"))
-    return g_strdup_printf("%ld", handle->length);
-  if (!strcmp(field, "content-type"))
-    {
-      char *out = NULL;
-      curl_easy_getinfo(handle->curl, CURLINFO_CONTENT_TYPE, &out);
-
-      if (out)
-        return g_strdup(out);
-    }
-  return NULL;
-}
-
-VFSConstructor curl_const = {
-  "http://",
-  curl_vfs_fopen_impl,
-  curl_vfs_fclose_impl,
-  curl_vfs_fread_impl,
-  curl_vfs_fwrite_impl,
-  curl_vfs_getc_impl,
-  curl_vfs_ungetc_impl,
-  curl_vfs_fseek_impl,
-  curl_vfs_rewind_impl,
-  curl_vfs_ftell_impl,
-  curl_vfs_feof_impl,
-  curl_vfs_truncate_impl,
-  curl_vfs_fsize_impl,
-  curl_vfs_metadata_impl
-};
-
-VFSConstructor curl_https_const = {
-  "https://",
-  curl_vfs_fopen_impl,
-  curl_vfs_fclose_impl,
-  curl_vfs_fread_impl,
-  curl_vfs_fwrite_impl,
-  curl_vfs_getc_impl,
-  curl_vfs_ungetc_impl,
-  curl_vfs_fseek_impl,
-  curl_vfs_rewind_impl,
-  curl_vfs_ftell_impl,
-  curl_vfs_feof_impl,
-  curl_vfs_truncate_impl,
-  curl_vfs_fsize_impl,
-  curl_vfs_metadata_impl
-};
-
-static void curl_load_settings(void)
-{
-  ConfigDb *cfgfile = bmp_cfg_db_open();
-  DEBUG_SETTINGS_MSG("curl - load settings called\n");
-  
-  if ( ( !bmp_cfg_db_get_int( cfgfile , "curl" ,
-         "connect_timeout" , &(curl_options.connect_timeout) ) ) ||
-       ( curl_options.connect_timeout < 1 ) )
-  {
-    curl_options.connect_timeout = -1; /* -1 means "use default value" */
-    DEBUG_SETTINGS_MSG("curl - connect_timeout set to default value (%i)\n", DEFAULT_CONNECT_TIMEOUT);
-  }
-  DEBUG_SETTINGS_MSG("curl - connect_timeout value set (%i)\n", curl_options.connect_timeout);
-  
-  bmp_cfg_db_close( cfgfile );
-  return;
-}
-
-static void curl_save_settings(void)
-{
-  ConfigDb *cfgfile = bmp_cfg_db_open();
-  DEBUG_SETTINGS_MSG("curl - save settings called\n");
-  
-  bmp_cfg_db_set_int( cfgfile , "curl" ,
-    "connect_timeout" , curl_options.connect_timeout );
-  DEBUG_SETTINGS_MSG("curl - connect_timeout value saved (%i)\n", curl_options.connect_timeout);
-  
-  bmp_cfg_db_close( cfgfile );
-  return;
-}
-
-static void init(void)
-{
-  curl_load_settings();
-  vfs_register_transport(&curl_const);
-  vfs_register_transport(&curl_https_const);
-}
-
-static void cleanup(void)
-{
-  curl_save_settings();
-#if 0
-  vfs_unregister_transport(&curl_const);
-  vfs_unregister_transport(&curl_https_const);
-#endif
-}
-
-DECLARE_PLUGIN(curl, init, cleanup, NULL, NULL, NULL, NULL, NULL, NULL);
--- a/src/daap/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/daap/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,32 +1,22 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
+PLUGIN = libdaap${PLUGIN_SUFFIX}
 
-OBJECTIVE_LIBS = libdaap$(SHARED_SUFFIX)
+SRCS = daap.c
 
 SUBDIRS = xmms2-daap
 
-LIBDIR = $(plugindir)/$(TRANSPORT_PLUGIN_DIR)
+include ../../buildsys.mk
+include ../../extra.mk
+
+plugindir := ${plugindir}/${TRANSPORT_PLUGIN_DIR}
 
 #For the moment i'm hardcoding it but it will be configurable
 #MDNS_LIBS=-ldns_sd
 MDNS_LIBS=-lavahi-glib -lavahi-common -lavahi-client
 #MDNS_LIBS= 
 
-
-
-
-LIBADD += ./xmms2-daap/xmms2-daap.a $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(MDNS_LIBS)
-
-SOURCES = daap.c
-
-OBJECTS = ${SOURCES:.c=.o}
+INC = -I../.. -I./xmms2-daap
+WARN = -Wall -pedantic -std=c99 
 
-LIBDEP = ./xmms2-daap/xmms2-daap.a
-
-INC = -I../.. -I./xmms2-daap
-
-WARN = -Wall  -pedantic -std=c99 
-
-CFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(INC) $(WARN)  $(GCC42_CFLAGS)
-
-include ../../mk/objective.mk
+CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${PICFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${INC} ${WARN} ${GCC42_CFLAGS}
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${MDNS_LIBS} ./xmms2-daap/xmms2-daap.a
--- a/src/daap/daap.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/daap/daap.c	Sat Oct 13 21:53:47 2007 +0300
@@ -306,7 +306,7 @@
 
 
 
-VFSFile * daap_vfs_fopen_impl(const gchar * path, const gchar * mode)
+VFSFile * daap_aud_vfs_fopen_impl(const gchar * path, const gchar * mode)
 {
     VFSFile *file=NULL;
     daap_handle_t *handle = g_new0(daap_handle_t, 1);
@@ -330,7 +330,7 @@
 
     if (handle->fd < 0) 
     {
-        g_print("vfs_fopen got a negative FD \n");
+        g_print("aud_vfs_fopen got a negative FD \n");
         g_free(file);
         file = NULL;
     } 
@@ -339,7 +339,7 @@
     return file;
 }
 
-gint daap_vfs_fclose_impl(VFSFile * file)
+gint daap_aud_vfs_fclose_impl(VFSFile * file)
 {
     gint ret=0;
     daap_handle_t * handle = (daap_handle_t *)file->handle;
@@ -363,7 +363,7 @@
 return -1;
 }
 
-size_t daap_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file)
+size_t daap_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file)
 {
     daap_handle_t *handle= (daap_handle_t *)file->handle;
     size_t ret=0;
@@ -378,12 +378,12 @@
     return 0;
 }
 
-size_t daap_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file)
+size_t daap_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file)
 {
     return -1;
 }
 
-gint daap_vfs_getc_impl(VFSFile * file)
+gint daap_aud_vfs_getc_impl(VFSFile * file)
 {
 guchar ret=EOF;
 daap_handle_t *handle = (daap_handle_t *)file->handle;
@@ -401,44 +401,44 @@
 }
 }
 
-gint daap_vfs_fseek_impl(VFSFile * file, glong offset, gint whence)
+gint daap_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence)
 {
     return -1;
 }
 
-gint daap_vfs_ungetc_impl(gint c, VFSFile * stream)
+gint daap_aud_vfs_ungetc_impl(gint c, VFSFile * stream)
 {
 return c;
 }
 
-void daap_vfs_rewind_impl(VFSFile * stream)
+void daap_aud_vfs_rewind_impl(VFSFile * stream)
 {
     return;
 }
 
-glong daap_vfs_ftell_impl(VFSFile * stream)
+glong daap_aud_vfs_ftell_impl(VFSFile * stream)
 {
     daap_handle_t *handle=stream->handle;
    return handle->pos;
 }
 
-gboolean daap_vfs_feof_impl(VFSFile * file)
+gboolean daap_aud_vfs_feof_impl(VFSFile * file)
 {
    daap_handle_t *handle=file->handle;
-  off_t at = daap_vfs_ftell_impl(file);
+  off_t at = daap_aud_vfs_ftell_impl(file);
   return (gboolean) (at >= handle->length) ? TRUE : FALSE;
 }
 
-gint daap_vfs_truncate_impl(VFSFile * file, glong size)
+gint daap_aud_vfs_truncate_impl(VFSFile * file, glong size)
 {
     return -1;
 }
-off_t daap_vfs_fsize_impl(VFSFile * file)
+off_t daap_aud_vfs_fsize_impl(VFSFile * file)
 {
 return 0;
 }
 
-gchar *daap_vfs_metadata_impl(VFSFile * file, const gchar * field)
+gchar *daap_aud_vfs_metadata_impl(VFSFile * file, const gchar * field)
 {
 daap_handle_t *handle;
 g_print("Requested metadata: '%s' \n",field);
@@ -462,26 +462,26 @@
 
 VFSConstructor daap_const = {
     "daap://",
-    daap_vfs_fopen_impl,
-    daap_vfs_fclose_impl,
-    daap_vfs_fread_impl,
-    daap_vfs_fwrite_impl,
-    daap_vfs_getc_impl,
-    daap_vfs_ungetc_impl,
-    daap_vfs_fseek_impl,
-    daap_vfs_rewind_impl,
-    daap_vfs_ftell_impl,
-    daap_vfs_feof_impl,
-    daap_vfs_truncate_impl,
-    daap_vfs_fsize_impl,
-    daap_vfs_metadata_impl
+    daap_aud_vfs_fopen_impl,
+    daap_aud_vfs_fclose_impl,
+    daap_aud_vfs_fread_impl,
+    daap_aud_vfs_fwrite_impl,
+    daap_aud_vfs_getc_impl,
+    daap_aud_vfs_ungetc_impl,
+    daap_aud_vfs_fseek_impl,
+    daap_aud_vfs_rewind_impl,
+    daap_aud_vfs_ftell_impl,
+    daap_aud_vfs_feof_impl,
+    daap_aud_vfs_truncate_impl,
+    daap_aud_vfs_fsize_impl,
+    daap_aud_vfs_metadata_impl
 };
 
 static void init(void)
 {   
     mutex_init = g_mutex_new();        
     mutex_discovery = g_mutex_new();        
-    vfs_register_transport(&daap_const);
+    aud_vfs_register_transport(&daap_const);
     daap_mdns_initialize ();
     if (!login_sessions) 
         login_sessions = g_hash_table_new (g_str_hash, g_str_equal);
--- a/src/daap/xmms2-daap/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/daap/xmms2-daap/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,27 +1,26 @@
-include ../../../mk/rules.mk
-include ../../../mk/init.mk
-
-OBJECTIVE_LIBS_NOINST= xmms2-daap.a
+STATIC_LIB_NOINST = xmms2-daap.a
 
-SOURCES= cc_handlers.c \
-		 daap_conn.c \
-		 daap_cmd.c \
-		 daap_md5.c \
-		 daap_util.c \
-		 daap_mdns_dnssd.c \
-		 daap_mdns_avahi.c \
-		 daap_mdns_dummy.c 
+SRCS = cc_handlers.c	\
+       daap_conn.c	\
+       daap_cmd.c	\
+       daap_md5.c	\
+       daap_util.c	\
+       daap_mdns_dnssd.c \
+       daap_mdns_avahi.c \
+       daap_mdns_dummy.c
+#       daap_xform.c 
 
-#		 daap_xform.c 
-LIBADD = $(GLIB_LIBS) 
+include ../../../buildsys.mk
+include ../../../extra.mk
 
 #For the moment i'm hardcoding it but it will be configurable
 #MDNS_IMPL=DAAP_MDNS_DNSSD
 MDNS_IMPL=DAAP_MDNS_AVAHI
 #MDNS_IMPL=DAAP_MDNS_DUMMY 
 
-CFLAGS = $(GLIB_CFLAGS) $(PICFLAGS) -std=c99 -Wall -D_POSIX_SOURCE -D$(MDNS_IMPL) 
+WARN = -Wall -std=c99
+DEFINES = -D${MDNS_IMPL} -D_POSIX_SOURCE
 
-OBJECTS=${SOURCES:.c=.o}
-
-include ../../../mk/objective.mk
+CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GLIB_CFLAGS} ${PICFLAGS} ${WARN} ${DEFINES}
+LIBS += ${GLIB_LIBS} 
--- a/src/dockalbumart/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/dockalbumart/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = dockalbumart${PLUGIN_SUFFIX}
+
 SRCS = dockalbumart.c
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/dockalbumart/dockalbumart.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/dockalbumart/dockalbumart.c	Sat Oct 13 21:53:47 2007 +0300
@@ -83,8 +83,8 @@
     gchar *tmp;
     const gchar *file_path, *file_name;
 
-    file_name = tuple_get_string(tuple, FIELD_FILE_NAME, NULL);
-    file_path = tuple_get_string(tuple, FIELD_FILE_PATH, NULL);
+    file_name = aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL);
+    file_path = aud_tuple_get_string(tuple, FIELD_FILE_PATH, NULL);
 
     if (file_name != NULL && file_path != NULL)
     {
--- a/src/echo_plugin/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/echo_plugin/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 PLUGIN = echo${PLUGIN_SUFFIX}
+
 SRCS = echo.c	\
        gui.c
 
-plugindir = audacious/${EFFECT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${EFFECT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/echo_plugin/gui.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/echo_plugin/gui.c	Sat Oct 13 21:53:47 2007 +0300
@@ -1,6 +1,7 @@
 #include "config.h"
 
 #include <gtk/gtk.h>
+#include <audacious/plugin.h>
 #include <audacious/i18n.h>
 #include <audacious/util.h>
 #include <audacious/configdb.h>
--- a/src/esd/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/esd/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = ESD${PLUGIN_SUFFIX}
+
 SRCS = esd.c		\
        mixer.c		\
        about.c		\
@@ -6,11 +7,11 @@
        audio.c		\
        init.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ESD_CFLAGS} -I../../intl -I../.. -I..
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ESD_CFLAGS} -I../../intl -I../.. -I..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${ESD_LIBS} ${OSS_LIBS}
--- a/src/evdev-plug/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/evdev-plug/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,14 +1,15 @@
 PLUGIN = evdev-plug${PLUGIN_SUFFIX}
+
 SRCS = ed.c			\
        ed_bindings_store.c	\
        ed_internals.c		\
        ed_ui.c
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/filewriter/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/filewriter/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,15 +1,16 @@
 PLUGIN = filewriter${PLUGIN_SUFFIX}
+
 SRCS = filewriter.c	\
        wav.c		\
        mp3.c		\
        vorbis.c		\
        flac.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GLIB_CFLAGS} ${GTK_CFLAGS} ${PANGO_CFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GLIB_CFLAGS} ${GTK_CFLAGS} ${PANGO_CFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${FILEWRITER_LIBS}
--- a/src/filewriter/filewriter.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/filewriter/filewriter.c	Sat Oct 13 21:53:47 2007 +0300
@@ -203,7 +203,7 @@
 
     if (filenamefromtags)
     {
-        gchar *utf8 = tuple_formatter_make_title_string(tuple, get_gentitle_format());
+        gchar *utf8 = aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
 
         g_strchomp(utf8); //chop trailing ^J --yaz
 
@@ -214,7 +214,7 @@
     }
     if (filename == NULL)
     {
-        filename = g_strdup(tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
+        filename = g_strdup(aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
         if (!use_suffix)
             if ((temp = strrchr(filename, '.')) != NULL)
                 *temp = '\0';
@@ -225,7 +225,7 @@
 
     if (prependnumber)
     {
-        gint number = tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL);
+        gint number = aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL);
         if (!tuple || !number)
             number = pos + 1;
 
@@ -235,7 +235,7 @@
     }
 
     if (save_original)
-        directory = tuple_get_string(tuple, FIELD_FILE_PATH, NULL);
+        directory = aud_tuple_get_string(tuple, FIELD_FILE_PATH, NULL);
     else
         directory = file_path;
 
@@ -244,7 +244,7 @@
     g_free(filename);
     filename = temp;
 
-    output_file = vfs_fopen(filename, "w");
+    output_file = aud_vfs_fopen(filename, "w");
     g_free(filename);
 
     if (!output_file)
@@ -328,7 +328,7 @@
     if (output_file)
     {
         written = 0;
-        vfs_fclose(output_file);
+        aud_vfs_fclose(output_file);
     }
     output_file = NULL;
 }
--- a/src/filewriter/flac.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/filewriter/flac.c	Sat Oct 13 21:53:47 2007 +0300
@@ -51,7 +51,7 @@
 static FLAC__StreamEncoderWriteStatus flac_write_cb(const FLAC__StreamEncoder *encoder,
     const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, gpointer data)
 {
-    written += vfs_fwrite(buffer, bytes, 1, (VFSFile *) data);
+    written += aud_vfs_fwrite(buffer, bytes, 1, (VFSFile *) data);
 
     return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
 }
@@ -61,7 +61,7 @@
 {
     VFSFile *file = (VFSFile *) data;
 
-    if (vfs_fseek(file, absolute_byte_offset, SEEK_SET) < 0)
+    if (aud_vfs_fseek(file, absolute_byte_offset, SEEK_SET) < 0)
         return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR;
 
     return FLAC__STREAM_ENCODER_SEEK_STATUS_OK;
@@ -72,7 +72,7 @@
 {
     VFSFile *file = (VFSFile *) data;
 
-    *absolute_byte_offset = vfs_ftell(file);
+    *absolute_byte_offset = aud_vfs_ftell(file);
 
     return FLAC__STREAM_ENCODER_TELL_STATUS_OK;
 }
@@ -107,14 +107,14 @@
 
         meta = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
 
-        INSERT_VORBIS_COMMENT(tuple_get_string(tuple, FIELD_TITLE, NULL), "title=%s");
-        INSERT_VORBIS_COMMENT(tuple_get_string(tuple, FIELD_ARTIST, NULL), "artist=%s");
-        INSERT_VORBIS_COMMENT(tuple_get_string(tuple, FIELD_ALBUM, NULL), "album=%s");
-        INSERT_VORBIS_COMMENT(tuple_get_string(tuple, FIELD_GENRE, NULL), "genre=%s");
-        INSERT_VORBIS_COMMENT(tuple_get_string(tuple, FIELD_COMMENT, NULL), "comment=%s");
-        INSERT_VORBIS_COMMENT(tuple_get_string(tuple, FIELD_DATE, NULL), "date=%s");
-        INSERT_VORBIS_COMMENT(tuple_get_int(tuple, FIELD_YEAR, NULL), "year=%d");
-        INSERT_VORBIS_COMMENT(tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL), "tracknumber=%d");
+        INSERT_VORBIS_COMMENT(aud_tuple_get_string(tuple, FIELD_TITLE, NULL), "title=%s");
+        INSERT_VORBIS_COMMENT(aud_tuple_get_string(tuple, FIELD_ARTIST, NULL), "artist=%s");
+        INSERT_VORBIS_COMMENT(aud_tuple_get_string(tuple, FIELD_ALBUM, NULL), "album=%s");
+        INSERT_VORBIS_COMMENT(aud_tuple_get_string(tuple, FIELD_GENRE, NULL), "genre=%s");
+        INSERT_VORBIS_COMMENT(aud_tuple_get_string(tuple, FIELD_COMMENT, NULL), "comment=%s");
+        INSERT_VORBIS_COMMENT(aud_tuple_get_string(tuple, FIELD_DATE, NULL), "date=%s");
+        INSERT_VORBIS_COMMENT(aud_tuple_get_int(tuple, FIELD_YEAR, NULL), "year=%d");
+        INSERT_VORBIS_COMMENT(aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL), "tracknumber=%d");
 
         FLAC__stream_encoder_set_metadata(flac_encoder, &meta, 1);
     }
--- a/src/filewriter/mp3.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/filewriter/mp3.c	Sat Oct 13 21:53:47 2007 +0300
@@ -207,24 +207,24 @@
     if (tuple) {
         /* XXX write UTF-8 even though libmp3lame does id3v2.3. --yaz */
 #ifdef DEBUG
-        g_print("track_name = %s\n", tuple_get_string(tuple, FIELD_TITLE, NULL));
+        g_print("track_name = %s\n", aud_tuple_get_string(tuple, FIELD_TITLE, NULL));
 #endif
-        lameid3.track_name = g_strdup(tuple_get_string(tuple, FIELD_TITLE, NULL));
+        lameid3.track_name = g_strdup(aud_tuple_get_string(tuple, FIELD_TITLE, NULL));
         id3tag_set_title(gfp, lameid3.track_name);
 
-        lameid3.performer = g_strdup(tuple_get_string(tuple, FIELD_ARTIST, NULL));
+        lameid3.performer = g_strdup(aud_tuple_get_string(tuple, FIELD_ARTIST, NULL));
         id3tag_set_artist(gfp, lameid3.performer);
 
-        lameid3.album_name = g_strdup(tuple_get_string(tuple, FIELD_ALBUM, NULL));
+        lameid3.album_name = g_strdup(aud_tuple_get_string(tuple, FIELD_ALBUM, NULL));
         id3tag_set_album(gfp, lameid3.album_name);
 
-        lameid3.genre = g_strdup(tuple_get_string(tuple, FIELD_GENRE, NULL));
+        lameid3.genre = g_strdup(aud_tuple_get_string(tuple, FIELD_GENRE, NULL));
         id3tag_set_genre(gfp, lameid3.genre);
 
-        lameid3.year = g_strdup_printf("%d", tuple_get_int(tuple, FIELD_YEAR, NULL));
+        lameid3.year = g_strdup_printf("%d", aud_tuple_get_int(tuple, FIELD_YEAR, NULL));
         id3tag_set_year(gfp, lameid3.year);
 
-        lameid3.track_number = g_strdup_printf("%d", tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL));
+        lameid3.track_number = g_strdup_printf("%d", aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL));
         id3tag_set_track(gfp, lameid3.track_number);
 
         //        id3tag_write_v1(gfp);
@@ -299,7 +299,7 @@
                                            ENCBUFFER_SIZE);
     }
 
-    vfs_fwrite(encbuffer, 1, encout, output_file);
+    aud_vfs_fwrite(encbuffer, 1, encout, output_file);
     written += encout;
     olen += length;
 }
@@ -309,7 +309,7 @@
     if (output_file)
     {
         encout = lame_encode_flush_nogap(gfp, encbuffer, ENCBUFFER_SIZE);
-        vfs_fwrite(encbuffer, 1, encout, output_file);
+        aud_vfs_fwrite(encbuffer, 1, encout, output_file);
 
         //        lame_mp3_tags_fid(gfp, output_file); // will erase id3v2 tag??
 
--- a/src/filewriter/vorbis.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/filewriter/vorbis.c	Sat Oct 13 21:53:47 2007 +0300
@@ -91,26 +91,26 @@
         gchar tmpstr[32];
         gint scrint;
 
-        if ((scratch = tuple_get_string(tuple, FIELD_TITLE, NULL)))
+        if ((scratch = aud_tuple_get_string(tuple, FIELD_TITLE, NULL)))
             vorbis_comment_add_tag(&vc, "title", (gchar *) scratch);
-        if ((scratch = tuple_get_string(tuple, FIELD_ARTIST, NULL)))
+        if ((scratch = aud_tuple_get_string(tuple, FIELD_ARTIST, NULL)))
             vorbis_comment_add_tag(&vc, "artist", (gchar *) scratch);
-        if ((scratch = tuple_get_string(tuple, FIELD_ALBUM, NULL)))
+        if ((scratch = aud_tuple_get_string(tuple, FIELD_ALBUM, NULL)))
             vorbis_comment_add_tag(&vc, "album", (gchar *) scratch);
-        if ((scratch = tuple_get_string(tuple, FIELD_GENRE, NULL)))
+        if ((scratch = aud_tuple_get_string(tuple, FIELD_GENRE, NULL)))
             vorbis_comment_add_tag(&vc, "genre", (gchar *) scratch);
-        if ((scratch = tuple_get_string(tuple, FIELD_DATE, NULL)))
+        if ((scratch = aud_tuple_get_string(tuple, FIELD_DATE, NULL)))
             vorbis_comment_add_tag(&vc, "date", (gchar *) scratch);
-        if ((scratch = tuple_get_string(tuple, FIELD_COMMENT, NULL)))
+        if ((scratch = aud_tuple_get_string(tuple, FIELD_COMMENT, NULL)))
             vorbis_comment_add_tag(&vc, "comment", (gchar *) scratch);
 
-        if ((scrint = tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL)))
+        if ((scrint = aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL)))
         {
             g_snprintf(tmpstr, sizeof(tmpstr), "%d", scrint);
             vorbis_comment_add_tag(&vc, "tracknumber", tmpstr);
         }
 
-        if ((scrint = tuple_get_int(tuple, FIELD_YEAR, NULL)))
+        if ((scrint = aud_tuple_get_int(tuple, FIELD_YEAR, NULL)))
         {
             g_snprintf(tmpstr, sizeof(tmpstr), "%d", scrint);
             vorbis_comment_add_tag(&vc, "year", tmpstr);
@@ -140,8 +140,8 @@
         if (result == 0)
             break;
 
-        written += vfs_fwrite(og.header, 1, og.header_len, output_file);
-        written += vfs_fwrite(og.body, 1, og.body_len, output_file);
+        written += aud_vfs_fwrite(og.header, 1, og.header_len, output_file);
+        written += aud_vfs_fwrite(og.body, 1, og.body_len, output_file);
     }
 
     return 1;
@@ -194,8 +194,8 @@
                 if (result == 0)
                     break;
 
-                written += vfs_fwrite(og.header, 1, og.header_len, output_file);
-                written += vfs_fwrite(og.body, 1, og.body_len, output_file);
+                written += aud_vfs_fwrite(og.header, 1, og.header_len, output_file);
+                written += aud_vfs_fwrite(og.body, 1, og.body_len, output_file);
             }
         }
     }
--- a/src/filewriter/wav.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/filewriter/wav.c	Sat Oct 13 21:53:47 2007 +0300
@@ -78,14 +78,14 @@
     header.byte_p_spl = GUINT16_TO_LE((GUINT16_FROM_LE(header.bit_p_spl) / (8 / input.channels)));
     memcpy(&header.data_chunk, "data", 4);
     header.data_length = GUINT32_TO_LE(0);
-    vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
+    aud_vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
 
     return 1;
 }
 
 static void wav_write(void *ptr, gint length)
 {
-    written += vfs_fwrite(ptr, 1, length, output_file);
+    written += aud_vfs_fwrite(ptr, 1, length, output_file);
 }
 
 static void wav_close(void)
@@ -95,8 +95,8 @@
         header.length = GUINT32_TO_LE(written + sizeof (struct wavhead) - 8);
 
         header.data_length = GUINT32_TO_LE(written);
-        vfs_fseek(output_file, 0, SEEK_SET);
-        vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
+        aud_vfs_fseek(output_file, 0, SEEK_SET);
+        aud_vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
     }
 }
 
--- a/src/flacng/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/flacng/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,14 +1,15 @@
 PLUGIN = flacng${PLUGIN_SUFFIX}
+
 SRCS = plugin.c				\
        tools.c				\
        seekable_stream_callbacks.c	\
        flac_compat112.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. ${LIBFLAC_CFLAGS}
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${LIBFLAC_LIBS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${LIBFLAC_CFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+LIBS += ${LIBFLAC_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/flacng/plugin.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/flacng/plugin.c	Sat Oct 13 21:53:47 2007 +0300
@@ -20,7 +20,7 @@
 #include "flacng.h"
 #include <audacious/util.h>
 #include <audacious/output.h>
-#include <glib/gi18n.h>
+#include <audacious/i18n.h>
 #include "tools.h"
 #include "plugin.h"
 #include "seekable_stream_callbacks.h"
@@ -232,14 +232,14 @@
     /*
      * Open the file
      */
-    if (NULL == (fd = vfs_fopen(filename, "rb"))) {
+    if (NULL == (fd = aud_vfs_fopen(filename, "rb"))) {
         _ERROR("Could not open file for reading! (%s)", filename);
         _LEAVE FALSE;
     }
 
     ret = flac_is_our_fd(filename, fd);
 
-    vfs_fclose(fd);
+    aud_vfs_fclose(fd);
 
     _LEAVE ret;
 }
@@ -446,7 +446,7 @@
 
             _DEBUG("Copying %d samples to output plugin", sample_count);
 
-            produce_audio(flac_ip.output->written_time(), FMT_S16_NE, main_info->frame.channels, sample_count * sizeof(gint16), play_buffer, NULL);
+            playback->pass_audio(playback, FMT_S16_NE, main_info->frame.channels, sample_count * sizeof(gint16), play_buffer, NULL);
 
             read_pointer += sample_count;
             elements_left -= sample_count;
@@ -536,7 +536,7 @@
     /*
      * Open the file
      */
-    if (NULL == (fd = vfs_fopen(input->filename, "rb"))) {
+    if (NULL == (fd = aud_vfs_fopen(input->filename, "rb"))) {
         _ERROR("Could not open file for reading! (%s)", input->filename);
         _LEAVE;
     }
@@ -558,7 +558,7 @@
 
     input->playing = TRUE;
 
-    flac_ip.set_info(get_title(input->filename, main_info), l, -1, main_info->stream.samplerate, main_info->stream.channels);
+    input->set_params(input, get_title(input->filename, main_info), l, -1, main_info->stream.samplerate, main_info->stream.channels);
 
     thread = g_thread_self();
     input->set_pb_ready(input);
@@ -633,7 +633,7 @@
     /*
      * Open the file
      */
-    if (NULL == (fd = vfs_fopen(filename, "rb"))) {
+    if (NULL == (fd = aud_vfs_fopen(filename, "rb"))) {
         _ERROR("Could not open file for reading! (%s)", filename);
         _LEAVE;
     }
@@ -682,7 +682,7 @@
     /*
      * Open the file
      */
-    if (NULL == (fd = vfs_fopen(filename, "rb"))) {
+    if (NULL == (fd = aud_vfs_fopen(filename, "rb"))) {
         _ERROR("Could not open file for reading! (%s)", filename);
         _LEAVE NULL;
     }
--- a/src/flacng/seekable_stream_callbacks.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/flacng/seekable_stream_callbacks.c	Sat Oct 13 21:53:47 2007 +0300
@@ -55,7 +55,7 @@
         _LEAVE FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
     }
 
-    read = vfs_fread(buffer, 1, to_read, info->input_stream);
+    read = aud_vfs_fread(buffer, 1, to_read, info->input_stream);
 
     if ((0 < read) && (0 < info->read_max)) {
         info->read_max -= read;
@@ -93,7 +93,7 @@
 
     _DEBUG("Seeking to %lld", absolute_byte_offset);
 
-    if (0 != vfs_fseek(info->input_stream, absolute_byte_offset, SEEK_SET)) {
+    if (0 != aud_vfs_fseek(info->input_stream, absolute_byte_offset, SEEK_SET)) {
         _ERROR("Could not seek to %lld!", (long long)absolute_byte_offset);
         _LEAVE FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
     }
@@ -113,7 +113,7 @@
     info = (callback_info*) client_data;
     _DEBUG("Using callback_info %s", info->name);
 
-    if (-1 == (position = vfs_ftell(info->input_stream))) {
+    if (-1 == (position = aud_vfs_ftell(info->input_stream))) {
         _ERROR("Could not tell current position!");
         _LEAVE FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
     }
@@ -147,7 +147,7 @@
         _LEAVE TRUE;
     }
 
-    eof = vfs_feof(info->input_stream);
+    eof = aud_vfs_feof(info->input_stream);
 
     _LEAVE eof;
 }
@@ -164,7 +164,7 @@
     info = (callback_info*) client_data;
     _DEBUG("Using callback_info %s", info->name);
 
-    if (-1 == (size = vfs_fsize(info->input_stream))) {
+    if (-1 == (size = aud_vfs_fsize(info->input_stream))) {
         /*
          * Could not get the stream size. This is not necessarily an
          * error, maybe the stream has no fixed size (think streaming
--- a/src/flacng/tools.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/flacng/tools.c	Sat Oct 13 21:53:47 2007 +0300
@@ -83,7 +83,7 @@
 
     if (close_fd && (NULL != info->input_stream)) {
         _DEBUG("Closing fd");
-        vfs_fclose(info->input_stream);
+        aud_vfs_fclose(info->input_stream);
     }
     info->input_stream = NULL;
 
@@ -239,31 +239,31 @@
 
     _DEBUG("Using callback_info %s", info->name);
 
-    out = tuple_new_from_filename(filename);
+    out = aud_tuple_new_from_filename(filename);
 
-    tuple_associate_string(out, FIELD_CODEC, NULL, "Free Lossless Audio Codec (FLAC)");
-    tuple_associate_string(out, FIELD_CODEC, NULL, "lossless");
+    aud_tuple_associate_string(out, FIELD_CODEC, NULL, "Free Lossless Audio Codec (FLAC)");
+    aud_tuple_associate_string(out, FIELD_CODEC, NULL, "lossless");
 
-    tuple_associate_string(out, FIELD_ARTIST, NULL, info->comment.artist);
-    tuple_associate_string(out, FIELD_TITLE, NULL, info->comment.title);
-    tuple_associate_string(out, FIELD_ALBUM, NULL, info->comment.album);
-    tuple_associate_string(out, FIELD_GENRE, NULL, info->comment.genre);
+    aud_tuple_associate_string(out, FIELD_ARTIST, NULL, info->comment.artist);
+    aud_tuple_associate_string(out, FIELD_TITLE, NULL, info->comment.title);
+    aud_tuple_associate_string(out, FIELD_ALBUM, NULL, info->comment.album);
+    aud_tuple_associate_string(out, FIELD_GENRE, NULL, info->comment.genre);
 
     if (info->comment.tracknumber != NULL)
-        tuple_associate_int(out, FIELD_TRACK_NUMBER, NULL, atoi(info->comment.tracknumber));
+        aud_tuple_associate_int(out, FIELD_TRACK_NUMBER, NULL, atoi(info->comment.tracknumber));
 
     if (info->comment.date != NULL)
-        tuple_associate_int(out, FIELD_YEAR, NULL, atoi(info->comment.date));
+        aud_tuple_associate_int(out, FIELD_YEAR, NULL, atoi(info->comment.date));
 
     /*
      * Calculate the stream length (milliseconds)
      */
     if (0 == info->stream.samplerate) {
         _ERROR("Invalid sample rate for stream!");
-        tuple_associate_int(out, FIELD_LENGTH, NULL, -1);
+        aud_tuple_associate_int(out, FIELD_LENGTH, NULL, -1);
     } else {
-        tuple_associate_int(out, FIELD_LENGTH, NULL, (info->stream.samples / info->stream.samplerate) * 1000);
-        _DEBUG("Stream length: %d seconds", tuple_get_int(out, FIELD_LENGTH, NULL));
+        aud_tuple_associate_int(out, FIELD_LENGTH, NULL, (info->stream.samples / info->stream.samplerate) * 1000);
+        _DEBUG("Stream length: %d seconds", aud_tuple_get_int(out, FIELD_LENGTH, NULL));
     }
 
     _DEBUG("Tuple created: [%p]", out);
@@ -284,9 +284,9 @@
 
     input = get_tuple(filename, info);
 
-    title = tuple_formatter_make_title_string(input, get_gentitle_format());
+    title = aud_tuple_formatter_make_title_string(input, get_gentitle_format());
 
-    tuple_free(input);
+    aud_tuple_free(input);
 
     _DEBUG("Title created: <%s>", title);
 
--- a/src/gnomeshortcuts/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/gnomeshortcuts/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = gnomeshortcuts${PLUGIN_SUFFIX}
+
 SRCS = gnomeshortcuts.c
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${MOWGLI_CFLAGS} ${GLIB_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. -I..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${MOWGLI_CFLAGS} ${GLIB_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. -I..
 LIBS += ${GLIB_LIBS} ${DBUS_LIBS}
--- a/src/hotkey/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/hotkey/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = hotkey${PLUGIN_SUFFIX}
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
 
 SRCS = plugin.c
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${MOWGLI_CFLAGS} ${GLIB_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. -I..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${MOWGLI_CFLAGS} ${GLIB_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. -I..
 LIBS += ${GLIB_LIBS} ${DBUS_LIBS}
--- a/src/jack/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/jack/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,13 +1,14 @@
 PLUGIN = jackout${PLUGIN_SUFFIX}
+
 SRCS = jack.c		\
        configure.c	\
        bio2jack.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${SAMPLERATE_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${SAMPLERATE_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${JACK_LIBS} ${SAMPLERATE_LIBS} -pthread
--- a/src/jack/configure.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/jack/configure.c	Sat Oct 13 21:53:47 2007 +0300
@@ -24,6 +24,7 @@
 
 #include "jack.h"
 
+#include <audacious/plugin.h>
 #include <audacious/configdb.h>
 #include <audacious/i18n.h>
 # include "config.h"
--- a/src/ladspa/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/ladspa/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = ladspa${PLUGIN_SUFFIX}
+
 SRCS = ladspa.c
 
-plugindir = audacious/${EFFECT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${EFFECT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/lastfm/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/lastfm/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = lastfm${PLUGIN_SUFFIX}
-plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
 
 SRCS = lastfm.c
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${CURL_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${TRANSPORT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${CURL_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} ${CURL_LIBS}
--- a/src/lastfm/lastfm.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/lastfm/lastfm.c	Sat Oct 13 21:53:47 2007 +0300
@@ -424,7 +424,7 @@
         return NULL;
 }
 
-VFSFile *lastfm_vfs_fopen_impl(const gchar * path, const gchar * mode)
+VFSFile *lastfm_aud_vfs_fopen_impl(const gchar * path, const gchar * mode)
 {
         VFSFile *file = g_new0(VFSFile, 1);
         LastFM  *handle = g_new0(LastFM, 1);
@@ -453,7 +453,7 @@
         g_thread_create(lastfm_adjust,temp_path,FALSE,NULL);
         metadata_thread = g_thread_create(lastfm_metadata_thread_func, handle, FALSE, NULL);
         thread_count++;
-        handle->proxy_fd = vfs_fopen(handle->lastfm_mp3_stream_url, mode);
+        handle->proxy_fd = aud_vfs_fopen(handle->lastfm_mp3_stream_url, mode);
         file->handle = handle;
 #if DEBUG
         g_print("LASTFM: (fopen) Thread_count: %d\n",thread_count);
@@ -461,7 +461,7 @@
         return file;
 }
 
-gint lastfm_vfs_fclose_impl(VFSFile * file)
+gint lastfm_aud_vfs_fclose_impl(VFSFile * file)
 {
         gint ret = 0;
 
@@ -471,7 +471,7 @@
         {
                 g_mutex_lock(metadata_mutex);
                 LastFM *handle = file->handle;
-                ret = vfs_fclose(handle->proxy_fd);
+                ret = aud_vfs_fclose(handle->proxy_fd);
                 if (!ret)
                         handle->proxy_fd = NULL;
                 g_free(handle);
@@ -482,65 +482,65 @@
         return ret;
 }
 
-size_t lastfm_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file)
+size_t lastfm_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file)
 {
         LastFM *handle = file->handle;
-        size_t ret = vfs_fread(ptr, size, nmemb, handle->proxy_fd);
+        size_t ret = aud_vfs_fread(ptr, size, nmemb, handle->proxy_fd);
         return ret;
 }
 
-size_t lastfm_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file)
+size_t lastfm_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file)
 {
         return -1;
 }
 
-gint lastfm_vfs_getc_impl(VFSFile * stream)
+gint lastfm_aud_vfs_getc_impl(VFSFile * stream)
 {
         LastFM *handle = stream->handle;
-        return vfs_getc(handle->proxy_fd);
+        return aud_vfs_getc(handle->proxy_fd);
 }
 
-gint lastfm_vfs_ungetc_impl(gint c, VFSFile * stream)
+gint lastfm_aud_vfs_ungetc_impl(gint c, VFSFile * stream)
 {
         LastFM *handle = stream->handle;
-        return vfs_ungetc(c, handle->proxy_fd);
+        return aud_vfs_ungetc(c, handle->proxy_fd);
 }
 
-gint lastfm_vfs_fseek_impl(VFSFile * file, glong offset, gint whence)
+gint lastfm_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence)
 {
         return -1;
 }
 
-void lastfm_vfs_rewind_impl(VFSFile * file)
+void lastfm_aud_vfs_rewind_impl(VFSFile * file)
 {
         return;
 }
 
-glong lastfm_vfs_ftell_impl(VFSFile * file)
+glong lastfm_aud_vfs_ftell_impl(VFSFile * file)
 {
         LastFM *handle = file->handle;
 
-        return vfs_ftell(handle->proxy_fd);
+        return aud_vfs_ftell(handle->proxy_fd);
 }
 
-gboolean lastfm_vfs_feof_impl(VFSFile * file)
+gboolean lastfm_aud_vfs_feof_impl(VFSFile * file)
 {
         LastFM *handle = file->handle;
 
-        return vfs_feof(handle->proxy_fd);
+        return aud_vfs_feof(handle->proxy_fd);
 }
 
-gint lastfm_vfs_truncate_impl(VFSFile * file, glong size)
+gint lastfm_aud_vfs_truncate_impl(VFSFile * file, glong size)
 {
         return -1;
 }
 
-off_t lastfm_vfs_fsize_impl(VFSFile * file)
+off_t lastfm_aud_vfs_fsize_impl(VFSFile * file)
 {
         return 0;
 }
 
-gchar *lastfm_vfs_metadata_impl(VFSFile * file, const gchar * field)
+gchar *lastfm_aud_vfs_metadata_impl(VFSFile * file, const gchar * field)
 {
         LastFM * handle;
         if(file->handle!= NULL)
@@ -560,24 +560,24 @@
 
 VFSConstructor lastfm_const = {
         "lastfm://",
-        lastfm_vfs_fopen_impl,
-        lastfm_vfs_fclose_impl,
-        lastfm_vfs_fread_impl,
-        lastfm_vfs_fwrite_impl,
-        lastfm_vfs_getc_impl,
-        lastfm_vfs_ungetc_impl,
-        lastfm_vfs_fseek_impl,
-        lastfm_vfs_rewind_impl,
-        lastfm_vfs_ftell_impl,
-        lastfm_vfs_feof_impl,
-        lastfm_vfs_truncate_impl,
-        lastfm_vfs_fsize_impl,
-        lastfm_vfs_metadata_impl
+        lastfm_aud_vfs_fopen_impl,
+        lastfm_aud_vfs_fclose_impl,
+        lastfm_aud_vfs_fread_impl,
+        lastfm_aud_vfs_fwrite_impl,
+        lastfm_aud_vfs_getc_impl,
+        lastfm_aud_vfs_ungetc_impl,
+        lastfm_aud_vfs_fseek_impl,
+        lastfm_aud_vfs_rewind_impl,
+        lastfm_aud_vfs_ftell_impl,
+        lastfm_aud_vfs_feof_impl,
+        lastfm_aud_vfs_truncate_impl,
+        lastfm_aud_vfs_fsize_impl,
+        lastfm_aud_vfs_metadata_impl
 };
 
 static void init(void)
 {       
-        vfs_register_transport(&lastfm_const);
+        aud_vfs_register_transport(&lastfm_const);
         if (!metadata_mutex)
                 metadata_mutex = g_mutex_new ();
         t0=g_new0(GTimeVal,1);
--- a/src/lastfm/lastfm.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/lastfm/lastfm.h	Sat Oct 13 21:53:47 2007 +0300
@@ -32,31 +32,31 @@
 gint thread_count=0;
 static GMutex * metadata_mutex = NULL;
 static gchar * login_url=NULL;
-VFSFile *lastfm_vfs_fopen_impl(const gchar * path, const gchar * mode);
+VFSFile *lastfm_aud_vfs_fopen_impl(const gchar * path, const gchar * mode);
 
-size_t lastfm_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file);
+size_t lastfm_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file);
 
-size_t lastfm_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file);
+size_t lastfm_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file);
 
-gint lastfm_vfs_getc_impl(VFSFile * stream);
+gint lastfm_aud_vfs_getc_impl(VFSFile * stream);
 
-gint lastfm_vfs_ungetc_impl(gint c, VFSFile * stream);
+gint lastfm_aud_vfs_ungetc_impl(gint c, VFSFile * stream);
 
-gint lastfm_vfs_fseek_impl(VFSFile * file, glong offset, gint whence);
+gint lastfm_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence);
 
-void lastfm_vfs_rewind_impl(VFSFile * file);
+void lastfm_aud_vfs_rewind_impl(VFSFile * file);
 
-glong lastfm_vfs_ftell_impl(VFSFile * file);
+glong lastfm_aud_vfs_ftell_impl(VFSFile * file);
 
-gboolean lastfm_vfs_feof_impl(VFSFile * file);
+gboolean lastfm_aud_vfs_feof_impl(VFSFile * file);
 
-gint lastfm_vfs_truncate_impl(VFSFile * file, glong size);
+gint lastfm_aud_vfs_truncate_impl(VFSFile * file, glong size);
 
-off_t lastfm_vfs_fsize_impl(VFSFile * file);
+off_t lastfm_aud_vfs_fsize_impl(VFSFile * file);
 
-gint lastfm_vfs_fclose_impl(VFSFile * file);
+gint lastfm_aud_vfs_fclose_impl(VFSFile * file);
 
-gchar *lastfm_vfs_metadata_impl(VFSFile * file, const gchar * field);
+gchar *lastfm_aud_vfs_metadata_impl(VFSFile * file, const gchar * field);
 
 gboolean parse_metadata(LastFM * handle,gchar **res);
 
--- a/src/lirc/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/lirc/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
-PLUGIN = lirc$(PLUGIN_SUFFIX)
+PLUGIN = lirc${PLUGIN_SUFFIX}
 
-plugindir = audacious/$(GENERAL_PLUGIN_DIR)
-SRCS = about.c lirc.c
+SRCS = about.c \
+       lirc.c
 
 include ../../buildsys.mk
 include ../../extra.mk
 
-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../..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
 
+CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${MOWGLI_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../..
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -llirc_client
--- a/src/m3u/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/m3u/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = m3u${PLUGIN_SUFFIX}
+
 SRCS = m3u.c
 
-plugindir = audacious/${CONTAINER_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} -I../../intl -I../.. -Wall
+plugindir := ${plugindir}/${CONTAINER_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../.. -Wall
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS}
--- a/src/m3u/m3u.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/m3u/m3u.c	Sat Oct 13 21:53:47 2007 +0300
@@ -88,17 +88,17 @@
     
     uri = g_filename_to_uri(filename, NULL, NULL);
 
-    if ((file = vfs_fopen(uri ? uri : filename, "rb")) == NULL)
+    if ((file = aud_vfs_fopen(uri ? uri : filename, "rb")) == NULL)
         return;
 
     g_free(uri);
 
     line = g_malloc(line_len);
-    while (vfs_fgets(line, line_len, file)) {
+    while (aud_vfs_fgets(line, line_len, file)) {
         while (strlen(line) == line_len - 1 && line[strlen(line) - 1] != '\n') {
             line_len += 1024;
             line = g_realloc(line, line_len);
-            vfs_fgets(&line[strlen(line)], 1024, file);
+            aud_vfs_fgets(&line[strlen(line)], 1024, file);
         }
 
         while (line[strlen(line) - 1] == '\r' ||
@@ -141,7 +141,7 @@
             pos++;
     }
 
-    vfs_fclose(file);
+    aud_vfs_fclose(file);
     g_free(line);
 }
 
@@ -158,12 +158,12 @@
     g_return_if_fail(playlist != NULL);
 
     fn = g_filename_to_uri(filename, NULL, NULL);
-    file = vfs_fopen(fn ? fn : filename, "wb");
+    file = aud_vfs_fopen(fn ? fn : filename, "wb");
     g_free(fn);
     g_return_if_fail(file != NULL);
 
     if (cfg.use_pl_metadata)
-        vfs_fprintf(file, "#EXTM3U\n");
+        aud_vfs_fprintf(file, "#EXTM3U\n");
 
     PLAYLIST_LOCK(playlist);
 
@@ -180,22 +180,22 @@
 
             outstr = g_locale_from_utf8(entry->title, -1, NULL, NULL, NULL);
             if(outstr) {
-                vfs_fprintf(file, "#EXTINF:%d,%s\n", seconds, outstr);
+                aud_vfs_fprintf(file, "#EXTINF:%d,%s\n", seconds, outstr);
                 g_free(outstr);
                 outstr = NULL;
             } else {
-                vfs_fprintf(file, "#EXTINF:%d,%s\n", seconds, entry->title);
+                aud_vfs_fprintf(file, "#EXTINF:%d,%s\n", seconds, entry->title);
             }
         }
 
         fn = g_filename_from_uri(entry->filename, NULL, NULL);
-        vfs_fprintf(file, "%s\n", fn ? fn : entry->filename);
+        aud_vfs_fprintf(file, "%s\n", fn ? fn : entry->filename);
         g_free(fn);
     }
 
     PLAYLIST_UNLOCK(playlist);
 
-    vfs_fclose(file);
+    aud_vfs_fclose(file);
 }
 
 PlaylistContainer plc_m3u = {
--- a/src/madplug/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/madplug/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = madplug${PLUGIN_SUFFIX}
+
 SRCS = configure.c	\
        dither.c		\
        input.c		\
@@ -8,11 +9,11 @@
        plugin.c		\
        xing.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${MOWGLI_CFLAGS} ${ARCH_DEFINES} ${SIMD_CFLAGS} -I../..
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBS += -L${libdir} -laudid3tag -lmad ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${MOWGLI_CFLAGS} ${ARCH_DEFINES} ${SIMD_CFLAGS} -I../..
+LIBS += -L${libdir} -lmad -laudid3tag ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/madplug/decoder.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/madplug/decoder.c	Sat Oct 13 21:53:47 2007 +0300
@@ -155,7 +155,7 @@
     assert(pos == olen);
     if (!info->playback->playing)
         return;
-    produce_audio(info->playback->output->written_time(),
+    info->playback->pass_audio(info->playback,
                   FMT_S16_LE, MAD_NCHANNELS(header), olen, output, &(info->playback->playing));
     if (!info->playback->playing)
         return;
@@ -192,7 +192,7 @@
     info->duration = mad_timer_zero; // should be cleared before loop, if we use it as break condition.
 
     if(info->fileinfo_request == TRUE) {
-        tuple_associate_int(info->tuple, FIELD_LENGTH, NULL, -1);
+        aud_tuple_associate_int(info->tuple, FIELD_LENGTH, NULL, -1);
         info->fileinfo_request = FALSE;
     }
 
@@ -270,10 +270,10 @@
             g_message("size = %d", stream.next_frame - stream.this_frame);
 #endif
 #endif
-            if(tuple_get_int(info->tuple, FIELD_LENGTH, NULL) == -1)
+            if(aud_tuple_get_int(info->tuple, FIELD_LENGTH, NULL) == -1)
                 mad_timer_add(&info->duration, header.duration);
             else {
-                gint length = tuple_get_int(info->tuple, FIELD_LENGTH, NULL);
+                gint length = aud_tuple_get_int(info->tuple, FIELD_LENGTH, NULL);
 
                 info->duration.seconds = length / 1000;
                 info->duration.fraction = length % 1000;
@@ -357,7 +357,7 @@
 #ifdef DEBUG
                 g_message("info->frames = %d", info->frames);
 #endif
-                if(tuple_get_int(info->tuple, FIELD_LENGTH, NULL) == -1) {
+                if(aud_tuple_get_int(info->tuple, FIELD_LENGTH, NULL) == -1) {
                     if(xing_bitrate > 0.0) {
                         /* calc duration with xing info */
                         double tmp = 8 * (double)info->xing.bytes * 1000 / xing_bitrate;
@@ -371,7 +371,7 @@
                     }
                 }
                 else {
-                    gint length = tuple_get_int(info->tuple, FIELD_LENGTH, NULL);
+                    gint length = aud_tuple_get_int(info->tuple, FIELD_LENGTH, NULL);
 
                     info->duration.seconds = length / 1000;
                     info->duration.fraction = length % 1000;
@@ -482,11 +482,11 @@
     /* set mainwin title */
     if (info->title)
         g_free(info->title);
-    info->title = tuple_formatter_make_title_string(info->tuple, audmad_config.title_override == TRUE ?
+    info->title = aud_tuple_formatter_make_title_string(info->tuple, audmad_config.title_override == TRUE ?
                                        audmad_config.id3_format : get_gentitle_format());
 
     tlen = (gint) mad_timer_count(info->duration, MAD_UNITS_MILLISECONDS),
-        mad_plugin->set_info(info->title,
+        info->playback->set_params(info->playback, info->title,
                              (tlen == 0 || info->size <= 0) ? -1 : tlen,
                              info->bitrate, info->freq, info->channels);
 #ifdef DEBUG
@@ -571,7 +571,7 @@
 #ifdef DEBUG
                 g_message("seeking to: %d bytes", new_position);
 #endif
-                if (vfs_fseek(info->infile, new_position, SEEK_SET) == -1)
+                if (aud_vfs_fseek(info->infile, new_position, SEEK_SET) == -1)
                     audmad_error("failed to seek to: %d", new_position);
                 mad_frame_mute(&frame);
                 mad_synth_mute(&synth);
@@ -613,7 +613,7 @@
                 g_message("decode vbr tlen = %d", tlen);
 #endif
 #endif
-                mad_plugin->set_info(info->title,
+                info->playback->set_params(info->playback, info->title,
                                      (tlen == 0 || info->size <= 0) ? -1 : tlen,
                                      info->bitrate, info->freq, info->channels);
             }
@@ -708,7 +708,7 @@
     g_message("e: decode");
 #endif                          /* DEBUG */
 
-    tuple_free(info->tuple);
+    aud_tuple_free(info->tuple);
     info->tuple = NULL;
 
     info->playback->output->close_audio();
--- a/src/madplug/fileinfo.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/madplug/fileinfo.c	Sat Oct 13 21:53:47 2007 +0300
@@ -596,7 +596,7 @@
     }
 #endif
 
-    if(!vfs_is_remote(fileurl) && !vfs_file_test(fileurl, G_FILE_TEST_EXISTS)) {
+    if(!aud_vfs_is_remote(fileurl) && !aud_vfs_file_test(fileurl, G_FILE_TEST_EXISTS)) {
         return;
     }
 
@@ -604,7 +604,7 @@
 
     if(audmad_is_remote(fileurl)) {
         info.remote = TRUE;
-        if(vfs_is_streaming(info.infile))
+        if(aud_vfs_is_streaming(info.infile))
            return; //file info dialog for remote streaming doesn't make sense.
     }
 
--- a/src/madplug/input.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/madplug/input.c	Sat Oct 13 21:53:47 2007 +0300
@@ -94,20 +94,20 @@
     info->mp3gain_minmax = -77;
 
     if(!fd){
-        info->infile = vfs_fopen(info->filename, "rb");
+        info->infile = aud_vfs_fopen(info->filename, "rb");
         if (info->infile == NULL) {
             return FALSE;
         }
     }
     else{
 #ifdef DEBUG
-        printf("input_init: vfs_dup\n");
+        printf("input_init: aud_vfs_dup\n");
 #endif
-        info->infile = vfs_dup(fd);
+        info->infile = aud_vfs_dup(fd);
     }
 
     // obtain file size
-    info->size = vfs_fsize(info->infile);
+    info->size = aud_vfs_fsize(info->infile);
     info->remote = info->size == 0 ? TRUE : FALSE; //proxy connection may result in non-zero size.
     if(audmad_is_remote((gchar *)url))
         info->remote = TRUE;
@@ -326,8 +326,8 @@
 {
     gchar *scratch = input_id3_get_string(tag, frame);
 
-    tuple_associate_string(tuple, nfield, NULL, scratch);
-    tuple_associate_string(tuple, -1, frame, scratch);
+    aud_tuple_associate_string(tuple, nfield, NULL, scratch);
+    aud_tuple_associate_string(tuple, -1, frame, scratch);
 
     g_free(scratch);
 }
@@ -337,9 +337,9 @@
     Tuple *tuple;
 
     if (info->tuple == NULL) {
-        tuple = tuple_new();
+        tuple = aud_tuple_new();
         info->tuple = tuple;
-        tuple_associate_int(info->tuple, FIELD_LENGTH, NULL, -1);
+        aud_tuple_associate_int(info->tuple, FIELD_LENGTH, NULL, -1);
     }
 }
 
@@ -356,13 +356,13 @@
     g_message("f: input_read_tag");
 #endif
     if (info->tuple != NULL)
-        tuple_free(info->tuple);
+        aud_tuple_free(info->tuple);
         
-    tuple = tuple_new_from_filename(info->filename);
+    tuple = aud_tuple_new_from_filename(info->filename);
     info->tuple = tuple;
 
     if(info->infile) {
-        curpos = vfs_ftell(info->infile);
+        curpos = aud_vfs_ftell(info->infile);
         info->id3file = id3_file_vfsopen(info->infile, ID3_FILE_MODE_READONLY);
     }
     else {
@@ -392,7 +392,7 @@
 
     string = input_id3_get_string(info->tag, ID3_FRAME_TRACK);
     if (string) {
-        tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi(string));
+        aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi(string));
         g_free(string);
         string = NULL;
     }
@@ -404,7 +404,7 @@
         string = input_id3_get_string(info->tag, "TYER");
 
     if (string) {
-        tuple_associate_int(tuple, FIELD_YEAR, NULL, atoi(string));
+        aud_tuple_associate_int(tuple, FIELD_YEAR, NULL, atoi(string));
         g_free(string);
         string = NULL;
     }
@@ -412,25 +412,25 @@
     // length
     string = input_id3_get_string(info->tag, "TLEN");
     if (string) {
-        tuple_associate_int(tuple, FIELD_LENGTH, NULL, atoi(string));
+        aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, atoi(string));
 #ifdef DEBUG
         g_message("input_read_tag: TLEN = %d", atoi(string));
 #endif	
         g_free(string);
         string = NULL;
     } else
-        tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
+        aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
     
-    tuple_associate_string(tuple, FIELD_CODEC, NULL, "MPEG Audio (MP3)");
-    tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossy");
+    aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "MPEG Audio (MP3)");
+    aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossy");
 
-    info->title = tuple_formatter_make_title_string(tuple, audmad_config.title_override == TRUE ?
+    info->title = aud_tuple_formatter_make_title_string(tuple, audmad_config.title_override == TRUE ?
         audmad_config.id3_format : get_gentitle_format());
 
     // for connection via proxy, we have to stop transfer once. I can't explain the reason.
     if (info->infile != NULL) {
-        vfs_fseek(info->infile, -1, SEEK_SET); // an impossible request
-        vfs_fseek(info->infile, curpos, SEEK_SET);
+        aud_vfs_fseek(info->infile, -1, SEEK_SET); // an impossible request
+        aud_vfs_fseek(info->infile, curpos, SEEK_SET);
     }
     
 #ifdef DEBUG
@@ -452,30 +452,30 @@
 
         g_free(info->title);
         info->title = NULL;
-        tuple_disassociate(info->tuple, FIELD_TITLE, NULL);
-        tuple_disassociate(info->tuple, FIELD_ALBUM, NULL);
+        aud_tuple_disassociate(info->tuple, FIELD_TITLE, NULL);
+        aud_tuple_disassociate(info->tuple, FIELD_ALBUM, NULL);
 
-        tmp = vfs_get_metadata(info->infile, "track-name");
+        tmp = aud_vfs_get_metadata(info->infile, "track-name");
         if(tmp){
             metadata = TRUE;
             gchar *scratch;
 
             scratch = str_to_utf8(tmp);
-            tuple_associate_string(info->tuple, FIELD_TITLE, NULL, scratch);
+            aud_tuple_associate_string(info->tuple, FIELD_TITLE, NULL, scratch);
             g_free(scratch);
 
             g_free(tmp);
             tmp = NULL;
         }
 
-        tmp = vfs_get_metadata(info->infile, "stream-name");
+        tmp = aud_vfs_get_metadata(info->infile, "stream-name");
         if(tmp){
             metadata = TRUE;
             gchar *scratch;
 
             scratch = str_to_utf8(tmp);
-            tuple_associate_string(info->tuple, FIELD_ALBUM, NULL, scratch);
-            tuple_associate_string(info->tuple, -1, "stream", scratch);
+            aud_tuple_associate_string(info->tuple, FIELD_ALBUM, NULL, scratch);
+            aud_tuple_associate_string(info->tuple, -1, "stream", scratch);
             g_free(scratch);
 
             g_free(tmp);
@@ -483,7 +483,7 @@
         }
 
         if (metadata)
-            tmp = tuple_formatter_process_string(info->tuple, "${?title:${title}}${?stream: (${stream})");
+            tmp = aud_tuple_formatter_process_string(info->tuple, "${?title:${title}}${?stream: (${stream})");
         else {
             gchar *realfn = g_filename_from_uri(info->filename, NULL, NULL);
             gchar *tmp2 = g_path_get_basename(realfn ? realfn : info->filename); // info->filename is uri. --yaz
@@ -497,7 +497,7 @@
         if ( ( ( info->prev_title != NULL ) && ( strcmp(info->prev_title,tmp) ) ) ||
              ( info->prev_title == NULL ) )
         {
-            mad_plugin->set_info(tmp,
+            info->playback->set_params(info->playback, tmp,
                                  -1, // indicate the stream is unseekable
                                  info->bitrate, info->freq, info->channels);
             if (info->prev_title)
@@ -538,7 +538,7 @@
     }
 
     /* reset the input file to the start */
-    vfs_fseek(info->infile, 0, SEEK_SET);
+    aud_vfs_fseek(info->infile, 0, SEEK_SET);
     info->offset = 0;
 
     /* use the filename for the title as a last resort */
@@ -576,7 +576,7 @@
 #endif
 #endif
     /* simply read to data from the file */
-    len = vfs_fread(buffer, 1, buffer_size, info->infile); //vfs_fread returns num of elements.
+    len = aud_vfs_fread(buffer, 1, buffer_size, info->infile); //aud_vfs_fread returns num of elements.
 
     if(len == 0 && info->playback){
         info->playback->eof = TRUE;
@@ -607,7 +607,7 @@
     if (info->filename)
         g_free(info->filename);
     if (info->infile)
-        vfs_fclose(info->infile);
+        aud_vfs_fclose(info->infile);
     if (info->id3file)
         id3_file_close(info->id3file);
 
@@ -625,7 +625,7 @@
         g_free(info->mp3gain_minmax_str);
 
     if (info->tuple) {
-        tuple_free(info->tuple);
+        aud_tuple_free(info->tuple);
         info->tuple = NULL;
     }
 
--- a/src/madplug/plugin.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/madplug/plugin.c	Sat Oct 13 21:53:47 2007 +0300
@@ -177,7 +177,7 @@
 
     init_gen_rand(4357);
 
-    mime_set_plugin("audio/mpeg", mad_plugin);
+    aud_mime_set_plugin("audio/mpeg", mad_plugin);
 }
 
 static void audmad_cleanup()
@@ -292,7 +292,7 @@
 
 gboolean audmad_is_remote(gchar *url)
 {
-    gboolean rv = vfs_is_remote(url);
+    gboolean rv = aud_vfs_is_remote(url);
     return rv;
 }
 
@@ -325,9 +325,9 @@
         return 0;
     }
 
-    if(vfs_fread(buf, 1, 4, fin) == 0) {
+    if(aud_vfs_fread(buf, 1, 4, fin) == 0) {
         gchar *tmp = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
-        g_message("vfs_fread failed @1 %s", tmp);
+        g_message("aud_vfs_fread failed @1 %s", tmp);
         g_free(tmp);
         return 0;
     }
@@ -340,10 +340,10 @@
         return 0;
     else if (memcmp(buf, "RIFF", 4) == 0)
     {
-        vfs_fseek(fin, 4, SEEK_CUR);
-        if(vfs_fread(buf, 1, 4, fin) == 0) {
+        aud_vfs_fseek(fin, 4, SEEK_CUR);
+        if(aud_vfs_fread(buf, 1, 4, fin) == 0) {
             gchar *tmp = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
-            g_message("vfs_fread failed @2 %s", tmp);
+            g_message("aud_vfs_fread failed @2 %s", tmp);
             g_free(tmp);
             return 0;
         }
@@ -355,9 +355,9 @@
     // check data for frame header
     while (!mp3_head_check(check, &frameSize))
     {
-        if((ret = vfs_fread(tmp, 1, chksize, fin)) == 0){
+        if((ret = aud_vfs_fread(tmp, 1, chksize, fin)) == 0){
             gchar *tmp = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
-            g_message("vfs_fread failed @3 %s", tmp);
+            g_message("aud_vfs_fread failed @3 %s", tmp);
             g_free(tmp);
             return 0;
         }
@@ -372,7 +372,7 @@
                  * next header ... also reduce the check size.
                  */
                 if (++chkcount >= 3) return 1;
-                vfs_fseek(fin, frameSize-4, SEEK_CUR);
+                aud_vfs_fseek(fin, frameSize-4, SEEK_CUR);
                 check = 0;
                 chksize = 8;
             }
@@ -391,13 +391,13 @@
     VFSFile *fin = NULL;
     gint rtn;
 
-    fin = vfs_fopen(filename, "rb");
+    fin = aud_vfs_fopen(filename, "rb");
 
     if (fin == NULL)
         return 0;
 
     rtn = audmad_is_our_fd(filename, fin);
-    vfs_fclose(fin);
+    aud_vfs_fclose(fin);
 
     return rtn;
 }
@@ -516,12 +516,12 @@
     }
 
     if (input_get_info(&myinfo, info.remote ? TRUE : audmad_config.fast_play_time_calc) == TRUE) {
-        if(tuple_get_string(myinfo.tuple, -1, "track-name"))
-            *title = g_strdup(tuple_get_string(myinfo.tuple, -1, "track-name"));
+        if(aud_tuple_get_string(myinfo.tuple, -1, "track-name"))
+            *title = g_strdup(aud_tuple_get_string(myinfo.tuple, -1, "track-name"));
         else
             *title = g_strdup(url);
 
-        *length = tuple_get_int(myinfo.tuple, FIELD_LENGTH, NULL);
+        *length = aud_tuple_get_int(myinfo.tuple, FIELD_LENGTH, NULL);
         if(*length == -1)
             *length = mad_timer_count(myinfo.duration, MAD_UNITS_MILLISECONDS);
     }
@@ -553,7 +553,7 @@
     }
 
     if (input_get_info(&myinfo, info.remote ? TRUE : audmad_config.fast_play_time_calc) == TRUE) {
-        *length = tuple_get_int(myinfo.tuple, FIELD_LENGTH, NULL);
+        *length = aud_tuple_get_int(myinfo.tuple, FIELD_LENGTH, NULL);
         if(*length == -1)
             *length = mad_timer_count(myinfo.duration, MAD_UNITS_MILLISECONDS);
     }
@@ -630,7 +630,7 @@
 
 static void __set_and_free(Tuple *tuple, gint nfield, gchar *name, gchar *value)
 {
-    tuple_associate_string(tuple, nfield, name, value);
+    aud_tuple_associate_string(tuple, nfield, name, value);
     g_free(value);
 }
 
@@ -654,31 +654,31 @@
 #endif
 
     if(info.remote && mad_timer_count(info.duration, MAD_UNITS_SECONDS) <= 0){
-        if((fd && vfs_is_streaming(fd)) || (info.playback && info.playback->playing)) {
+        if((fd && aud_vfs_is_streaming(fd)) || (info.playback && info.playback->playing)) {
             gchar *tmp = NULL;
-            tuple = tuple_new_from_filename(filename);
+            tuple = aud_tuple_new_from_filename(filename);
 
 #ifdef DEBUG
             if(info.playback)
                 g_message("info.playback->playing = %d",info.playback->playing);
 #endif
-            tmp = vfs_get_metadata(info.infile ? info.infile : fd, "track-name");
+            tmp = aud_vfs_get_metadata(info.infile ? info.infile : fd, "track-name");
             if(tmp){
                 gchar *scratch;
 
                 scratch = str_to_utf8(tmp);
-                tuple_associate_string(tuple, FIELD_TITLE, NULL, scratch);
+                aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, scratch);
                 g_free(tmp);
                 g_free(scratch);
 
                 tmp = NULL;
             }
-            tmp = vfs_get_metadata(info.infile ? info.infile : fd, "stream-name");
+            tmp = aud_vfs_get_metadata(info.infile ? info.infile : fd, "stream-name");
             if(tmp){
                 gchar *scratch;
 
                 scratch = str_to_utf8(tmp);
-                tuple_associate_string(tuple, FIELD_TITLE, NULL, scratch);
+                aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, scratch);
                 g_free(tmp);
                 g_free(scratch);
 
@@ -686,11 +686,11 @@
             }
 
 #ifdef DEBUG
-            g_message("audmad_get_song_tuple: track_name = %s", tuple_get_string(tuple, -1, "track-name"));
-            g_message("audmad_get_song_tuple: stream_name = %s", tuple_get_string(tuple, -1, "stream-name"));
+            g_message("audmad_get_song_tuple: track_name = %s", aud_tuple_get_string(tuple, -1, "track-name"));
+            g_message("audmad_get_song_tuple: stream_name = %s", aud_tuple_get_string(tuple, -1, "stream-name"));
 #endif
-            tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
-            tuple_associate_int(tuple, FIELD_MTIME, NULL, 0); // this indicates streaming
+            aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
+            aud_tuple_associate_int(tuple, FIELD_MTIME, NULL, 0); // this indicates streaming
 #ifdef DEBUG
             g_message("get_song_tuple: remote: tuple");
 #endif
@@ -702,16 +702,16 @@
 //        return NULL;
     } /* info.remote  */
 
-    // if !fd, pre-open the file with vfs_fopen() and reuse fd.
+    // if !fd, pre-open the file with aud_vfs_fopen() and reuse fd.
     if(!fd) {
-        fd = vfs_fopen(filename, "rb");
+        fd = aud_vfs_fopen(filename, "rb");
         if(!fd)
             return NULL;
         local_fd = TRUE;
     }
 
-    tuple = tuple_new();
-    tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
+    tuple = aud_tuple_new();
+    aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
 
     id3file = id3_file_vfsopen(fd, ID3_FILE_MODE_READONLY);
 
@@ -730,22 +730,22 @@
                 string = input_id3_get_string(tag, "TYER");
 
             if (string) {
-                tuple_associate_int(tuple, FIELD_YEAR, NULL, atoi(string));
+                aud_tuple_associate_int(tuple, FIELD_YEAR, NULL, atoi(string));
                 g_free(string);
                 string = NULL;
             }
             realfn = g_filename_from_uri(filename, NULL, NULL);
             __set_and_free(tuple, FIELD_FILE_NAME, NULL, g_path_get_basename(realfn ? realfn : filename));
             __set_and_free(tuple, FIELD_FILE_PATH, NULL, g_path_get_dirname(realfn ? realfn : filename));
-            tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, extname(realfn ? realfn : filename));
+            aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, extname(realfn ? realfn : filename));
             g_free(realfn); realfn = NULL;
 
             // length
             string = input_id3_get_string(tag, "TLEN");
             if (string) {
-                tuple_associate_int(tuple, FIELD_LENGTH, NULL, atoi(string));
+                aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, atoi(string));
 #ifdef DEBUG
-                g_message("get_song_tuple: TLEN = %d", tuple_get_int(tuple, FIELD_LENGTH, NULL));
+                g_message("get_song_tuple: TLEN = %d", aud_tuple_get_int(tuple, FIELD_LENGTH, NULL));
 #endif
                 g_free(string);
                 string = NULL;
@@ -754,14 +754,14 @@
                 char *dummy = NULL;
                 int length = 0;
                 audmad_get_song_length(filename, &length, fd);
-                tuple_associate_int(tuple, FIELD_LENGTH, NULL, length);
+                aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, length);
                 g_free(dummy);
             }
 
             // track number
             string = input_id3_get_string(tag, ID3_FRAME_TRACK);
             if (string) {
-                tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi(string));
+                aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi(string));
                 g_free(string);
                 string = NULL;
             }
@@ -769,7 +769,7 @@
             __set_and_free(tuple, FIELD_GENRE, NULL, input_id3_get_string(tag, ID3_FRAME_GENRE));
             __set_and_free(tuple, FIELD_COMMENT, NULL, input_id3_get_string(tag, ID3_FRAME_COMMENT));
 #ifdef DEBUG
-            g_message("genre = %s", tuple_get_string(tuple, FIELD_GENRE, NULL));
+            g_message("genre = %s", aud_tuple_get_string(tuple, FIELD_GENRE, NULL));
 #endif
         }
         id3_file_close(id3file);
@@ -778,25 +778,25 @@
         realfn = g_filename_from_uri(filename, NULL, NULL);
         __set_and_free(tuple, FIELD_FILE_NAME, NULL, g_path_get_basename(realfn ? realfn : filename));
         __set_and_free(tuple, FIELD_FILE_PATH, NULL, g_path_get_dirname(realfn ? realfn : filename));
-        tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, extname(realfn ? realfn : filename));
+        aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, extname(realfn ? realfn : filename));
         g_free(realfn); realfn = NULL;
         // length
         {
             char *dummy = NULL;
             int length = 0;
-            if(tuple_get_int(tuple, FIELD_LENGTH, NULL) == -1) {
+            if(aud_tuple_get_int(tuple, FIELD_LENGTH, NULL) == -1) {
                 audmad_get_song_length(filename, &length, fd);
-                tuple_associate_int(tuple, FIELD_LENGTH, NULL, length);
+                aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, length);
             }
             g_free(dummy);
         }
     }
 
-    tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossy");
-    tuple_associate_string(tuple, FIELD_CODEC, NULL, "MPEG Audio (MP3)");
+    aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossy");
+    aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "MPEG Audio (MP3)");
 
     if(local_fd)
-        vfs_fclose(fd);
+        aud_vfs_fclose(fd);
 
 #ifdef DEBUG
     g_message("e: mad: audmad_get_song_tuple");
@@ -814,7 +814,7 @@
     if (!audmad_is_our_fd(filename, fd))
         return NULL;
 
-    vfs_rewind(fd);
+    aud_vfs_rewind(fd);
 
     return __audmad_get_song_tuple(filename, fd);
 }
--- a/src/madplug/replaygain.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/madplug/replaygain.c	Sat Oct 13 21:53:47 2007 +0300
@@ -72,9 +72,9 @@
 
     tp = &T;
 
-    if (vfs_fseek(fp, -sizeof(T), SEEK_CUR) != 0)
+    if (aud_vfs_fseek(fp, -sizeof(T), SEEK_CUR) != 0)
         return 18;
-    if (vfs_fread(tp, 1, sizeof(T), fp) != sizeof T)
+    if (aud_vfs_fread(tp, 1, sizeof(T), fp) != sizeof T)
         return 2;
     if (memcmp(tp->ID, "APETAGEX", sizeof(tp->ID)) != 0)
         return 3;
@@ -83,12 +83,12 @@
     TagLen = Read_LE_Uint32(tp->Length);
     if (TagLen < sizeof(T))
         return 5;
-    if (vfs_fseek(fp, -TagLen, SEEK_CUR) != 0)
+    if (aud_vfs_fseek(fp, -TagLen, SEEK_CUR) != 0)
         return 6;
     if ((buff = (char *) malloc(TagLen)) == NULL) {
         return 7;
     }
-    if (vfs_fread(buff, 1, TagLen - sizeof(T), fp) != TagLen - sizeof(T)) {
+    if (aud_vfs_fread(buff, 1, TagLen - sizeof(T), fp) != TagLen - sizeof(T)) {
         free(buff);
         return 8;
     }
@@ -170,8 +170,8 @@
     static const char *key = "APETAGEX";
     char buff[20000];
     int N = 0;
-    if (vfs_fseek(fp, -20000, SEEK_CUR) != 0);
-    if ((N = vfs_fread(buff, 1, 20000, fp)) < 16)
+    if (aud_vfs_fseek(fp, -20000, SEEK_CUR) != 0);
+    if ((N = aud_vfs_fread(buff, 1, 20000, fp)) < 16)
         return 1;
     int matched = 0;
     int i, last_match = -1;
@@ -285,36 +285,36 @@
 
     /* APEv2 stuff */
     if (file_info->infile) {
-        fp = vfs_dup(file_info->infile);
-        curpos = vfs_ftell(fp);
+        fp = aud_vfs_dup(file_info->infile);
+        curpos = aud_vfs_ftell(fp);
     }
     else {
-        if ((fp = vfs_fopen(file_info->filename, "rb")) == NULL)
+        if ((fp = aud_vfs_fopen(file_info->filename, "rb")) == NULL)
             return;
     }
 
-    if (vfs_fseek(fp, 0L, SEEK_END) != 0) {
-        vfs_fclose(fp);
+    if (aud_vfs_fseek(fp, 0L, SEEK_END) != 0) {
+        aud_vfs_fclose(fp);
         return;
     }
     
-    long pos = vfs_ftell(fp);
+    long pos = aud_vfs_ftell(fp);
     int res = -1;
     int try = 0;
     while (res != 0 && try < 10) {
         // try skipping an id3 tag
-        vfs_fseek(fp, pos, SEEK_SET);
-        vfs_fseek(fp, try * -128, SEEK_CUR);
+        aud_vfs_fseek(fp, pos, SEEK_SET);
+        aud_vfs_fseek(fp, try * -128, SEEK_CUR);
         res = ReadAPE2Tag(fp, file_info);
         ++try;
     }
     if (res != 0) {
         // try brute search (don't want to parse all possible kinds of tags..)
-        vfs_fseek(fp, pos, SEEK_SET);
+        aud_vfs_fseek(fp, pos, SEEK_SET);
         int offs = find_offset(fp);
         if (offs <= 0) {        // found !
-            vfs_fseek(fp, pos, SEEK_SET);
-            vfs_fseek(fp, offs, SEEK_CUR);
+            aud_vfs_fseek(fp, pos, SEEK_SET);
+            aud_vfs_fseek(fp, offs, SEEK_CUR);
             res = ReadAPE2Tag(fp, file_info);
             if (res != 0) {
                 g_message
@@ -342,9 +342,9 @@
         file_info->has_replaygain = TRUE;
 
     if (file_info->infile)
-        vfs_fseek(fp, curpos, SEEK_SET);
+        aud_vfs_fseek(fp, curpos, SEEK_SET);
 
-    vfs_fclose(fp);
+    aud_vfs_fclose(fp);
 
 #ifdef DEBUG
     g_message("e: read_replaygain");
--- a/src/metronom/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/metronom/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = metronom${PLUGIN_SUFFIX}
+
 SRCS = metronom.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/metronom/metronom.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/metronom/metronom.c	Sat Oct 13 21:53:47 2007 +0300
@@ -19,6 +19,7 @@
 
 #include "config.h"
 #include <audacious/plugin.h>
+#include <audacious/output.h>
 #include <audacious/util.h>
 #include <audacious/i18n.h>
 #include <glib.h>
@@ -76,7 +77,7 @@
 
 static void metronom_init(void)
 {
-	uri_set_plugin("tact://", &metronom_ip);
+	aud_uri_set_plugin("tact://", &metronom_ip);
 }
 
 static void metronom_about(void)
@@ -101,7 +102,7 @@
 #define BUF_BYTES BUF_SAMPLES * 2
 #define MAX_AMPL (GINT16_TO_LE((1<<15) - 1))
 
-static void* play_loop(void *arg)
+static void play_loop(void *arg)
 {
 	gint16 data[BUF_SAMPLES];
 	InputPlayback *playback = arg;
@@ -147,10 +148,8 @@
 			datagoal=(datamiddle+7*datagoal)/8;
 			t++;
 		}
-		while(playback->output->buffer_free() < BUF_BYTES && going)
-			g_usleep(30000);
 		if (going)
-			produce_audio(playback->output->written_time(), FMT_S16_LE, 1, BUF_BYTES, data, &going);
+			playback->pass_audio(playback, FMT_S16_LE, 1, BUF_BYTES, data, &going);
 	}
 	/* Make sure the output plugin stops prebuffering */
 	playback->output->buffer_free();
@@ -200,7 +199,7 @@
 	} else {
 		name = g_strdup_printf(_("Tact generator: %d bpm %d/%d"), pmetronom->bpm,pmetronom->num,pmetronom->den);
 	}
-	metronom_ip.set_info(name, -1, 16 * 44100, 44100, 1);
+	playback->set_params(playback, name, -1, 16 * 44100, 44100, 1);
 	g_free(name);
 	playback->data = pmetronom;
 	play_thread = g_thread_self();
--- a/src/mms/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/mms/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = mms${PLUGIN_SUFFIX}
+
 SRCS = mms.c
 
-plugindir = audacious/${TRANSPORT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
+plugindir := ${plugindir}/${TRANSPORT_PLUGIN_DIR}
+
 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/mms/mms.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/mms/mms.c	Sat Oct 13 21:53:47 2007 +0300
@@ -41,7 +41,7 @@
 } MMSHandle;
 
 VFSFile *
-mms_vfs_fopen_impl(const gchar * path,
+mms_aud_vfs_fopen_impl(const gchar * path,
           const gchar * mode)
 {
     VFSFile *file;
@@ -72,7 +72,7 @@
 }
 
 gint
-mms_vfs_fclose_impl(VFSFile * file)
+mms_aud_vfs_fclose_impl(VFSFile * file)
 {
     gint ret = 0;
 
@@ -92,7 +92,7 @@
 }
 
 size_t
-mms_vfs_fread_impl(gpointer ptr,
+mms_aud_vfs_fread_impl(gpointer ptr,
           size_t size,
           size_t nmemb,
           VFSFile * file)
@@ -117,7 +117,7 @@
 }
 
 size_t
-mms_vfs_fwrite_impl(gconstpointer ptr,
+mms_aud_vfs_fwrite_impl(gconstpointer ptr,
            size_t size,
            size_t nmemb,
            VFSFile * file)
@@ -126,7 +126,7 @@
 }
 
 gint
-mms_vfs_getc_impl(VFSFile *stream)
+mms_aud_vfs_getc_impl(VFSFile *stream)
 {
     MMSHandle *handle = (MMSHandle *) stream->handle;
     guchar c;
@@ -147,7 +147,7 @@
 }
 
 gint
-mms_vfs_ungetc_impl(gint c, VFSFile *stream)
+mms_aud_vfs_ungetc_impl(gint c, VFSFile *stream)
 {
     MMSHandle *handle = (MMSHandle *) stream->handle;
 
@@ -160,7 +160,7 @@
 }
 
 gint
-mms_vfs_fseek_impl(VFSFile * file,
+mms_aud_vfs_fseek_impl(VFSFile * file,
           glong offset,
           gint whence)
 {
@@ -168,13 +168,13 @@
 }
 
 void
-mms_vfs_rewind_impl(VFSFile * file)
+mms_aud_vfs_rewind_impl(VFSFile * file)
 {
     return;
 }
 
 glong
-mms_vfs_ftell_impl(VFSFile * file)
+mms_aud_vfs_ftell_impl(VFSFile * file)
 {
     MMSHandle *handle = (MMSHandle *) file->handle;
 
@@ -182,7 +182,7 @@
 }
 
 gboolean
-mms_vfs_feof_impl(VFSFile * file)
+mms_aud_vfs_feof_impl(VFSFile * file)
 {
     MMSHandle *handle = (MMSHandle *) file->handle;
 
@@ -191,42 +191,42 @@
 }
 
 gint
-mms_vfs_truncate_impl(VFSFile * file, glong size)
+mms_aud_vfs_truncate_impl(VFSFile * file, glong size)
 {
     return -1;
 }
 
 off_t
-mms_vfs_fsize_impl(VFSFile * file)
+mms_aud_vfs_fsize_impl(VFSFile * file)
 {
     return -1;
 }
 
 VFSConstructor mms_const = {
 	"mms://",
-	mms_vfs_fopen_impl,
-	mms_vfs_fclose_impl,
-	mms_vfs_fread_impl,
-	mms_vfs_fwrite_impl,
-	mms_vfs_getc_impl,
-	mms_vfs_ungetc_impl,
-	mms_vfs_fseek_impl,
-	mms_vfs_rewind_impl,
-	mms_vfs_ftell_impl,
-	mms_vfs_feof_impl,
-	mms_vfs_truncate_impl,
-	mms_vfs_fsize_impl
+	mms_aud_vfs_fopen_impl,
+	mms_aud_vfs_fclose_impl,
+	mms_aud_vfs_fread_impl,
+	mms_aud_vfs_fwrite_impl,
+	mms_aud_vfs_getc_impl,
+	mms_aud_vfs_ungetc_impl,
+	mms_aud_vfs_fseek_impl,
+	mms_aud_vfs_rewind_impl,
+	mms_aud_vfs_ftell_impl,
+	mms_aud_vfs_feof_impl,
+	mms_aud_vfs_truncate_impl,
+	mms_aud_vfs_fsize_impl
 };
 
 static void init(void)
 {
-	vfs_register_transport(&mms_const);
+	aud_vfs_register_transport(&mms_const);
 }
 
 static void cleanup(void)
 {
 #if 0
-	vfs_unregister_transport(&mms_const);
+	aud_vfs_unregister_transport(&mms_const);
 #endif
 }
 
--- a/src/modplug/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/modplug/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = modplug${PLUGIN_SUFFIX}
+
 SRCS = plugin.cxx		\
        modplugbmp.cxx		\
        tables.cxx		\
@@ -45,12 +46,12 @@
        gui/interface.cxx	\
        gui/callbacks.cxx
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I.. -I../.. -I../../intl
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
 CXXFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I.. -I../.. -I../../intl
 LIBS += ${MOWGLI_LIBS} ${DBUS_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -lstdc++
--- a/src/modplug/archive/arch_raw.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/modplug/archive/arch_raw.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -16,7 +16,7 @@
 
 arch_Raw::arch_Raw(const string& aFileName)
 {
-	mFileDesc = vfs_fopen(aFileName.c_str(), "rb");
+	mFileDesc = aud_vfs_fopen(aFileName.c_str(), "rb");
 
 	//open and mmap the file
 	if(mFileDesc == NULL)
@@ -24,12 +24,12 @@
 		mSize = 0;
 		return;
 	}
-	vfs_fseek(mFileDesc, 0, SEEK_END);
-	mSize = vfs_ftell(mFileDesc);
-	vfs_fseek(mFileDesc, 0, SEEK_SET);
+	aud_vfs_fseek(mFileDesc, 0, SEEK_END);
+	mSize = aud_vfs_ftell(mFileDesc);
+	aud_vfs_fseek(mFileDesc, 0, SEEK_SET);
 
 	mMap = malloc(mSize);
-	vfs_fread(mMap, 1, mSize, mFileDesc);
+	aud_vfs_fread(mMap, 1, mSize, mFileDesc);
 }
 
 arch_Raw::~arch_Raw()
@@ -37,7 +37,7 @@
 	if(mSize != 0)
 	{
 		free(mMap);
-		vfs_fclose(mFileDesc);
+		aud_vfs_fclose(mFileDesc);
 	}
 }
 
--- a/src/modplug/archive/arch_raw.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/modplug/archive/arch_raw.h	Sat Oct 13 21:53:47 2007 +0300
@@ -11,7 +11,7 @@
 #include <string>
 
 extern "C" {
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 };
 
 class arch_Raw: public Archive
--- a/src/modplug/gui/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/modplug/gui/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,10 +1,13 @@
+STATIC_LIB_NOINST = libgui.a
+
+SRCS = main.cxx		\
+       support.cxx	\
+       interface.cxx	\
+       callbacks.cxx
+
+include ../../../buildsys.mk
 include ../../../extra.mk
 
-STATIC_LIB_NOINST = libgui.a
-SRCS = main.cxx support.cxx interface.cxx callbacks.cxx
-
-include ../../../buildsys.mk
-
-CFLAGS   += $(PLUGIN_CFLAGS)
-CXXFLAGS += $(PLUGIN_CFLAGS)
-CPPFLAGS += $(MOWGLI_CFLAGS) $(DBUS_CFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../..
+CFLAGS   += ${PLUGIN_CFLAGS}
+CXXFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../..
--- a/src/modplug/modplugbmp.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/modplug/modplugbmp.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -21,10 +21,10 @@
 
 static char* format_and_free_ti( Tuple* ti, int* length )
 {
-        char* result = tuple_formatter_make_title_string(ti, get_gentitle_format());
+        char* result = aud_tuple_formatter_make_title_string(ti, get_gentitle_format());
         if ( result )
-                *length = tuple_get_int(ti, FIELD_LENGTH, NULL);
-        tuple_free((void *) ti);
+                *length = aud_tuple_get_int(ti, FIELD_LENGTH, NULL);
+        aud_tuple_free((void *) ti);
 
         return result;
 }
@@ -111,7 +111,7 @@
 	const int magicSize = 32;
 	char magic[magicSize];
 
-	vfs_fread(magic, 1, magicSize, file);
+	aud_vfs_fread(magic, 1, magicSize, file);
 	if (!memcmp(magic, UMX_MAGIC, 4))
 		return true;
 	if (!memcmp(magic, "Extended Module:", 16))
@@ -125,13 +125,13 @@
 	if (!memcmp(magic, PSM_MAGIC, 4))
 		return true;
 
-	vfs_fseek(file, 44, SEEK_SET);
-	vfs_fread(magic, 1, 4, file);
+	aud_vfs_fseek(file, 44, SEEK_SET);
+	aud_vfs_fread(magic, 1, 4, file);
 	if (!memcmp(magic, S3M_MAGIC, 4))
 		return true;
 
-	vfs_fseek(file, 1080, SEEK_SET);
-	vfs_fread(magic, 1, 4, file);
+	aud_vfs_fseek(file, 1080, SEEK_SET);
+	aud_vfs_fread(magic, 1, 4, file);
 	
 	// Check for Fast Tracker multichannel modules (xCHN, xxCH)
 	if (magic[1] == 'C' && magic[2] == 'H' && magic[3] == 'N') {
@@ -242,7 +242,7 @@
 	return false;
 }
 
-void ModplugXMMS::PlayLoop()
+void ModplugXMMS::PlayLoop(InputPlayback *playback)
 {
 	uint32 lLength;
 	//the user might change the number of channels while playing.
@@ -303,9 +303,9 @@
 		if(mStopped)
 			break;
 		
-		produce_audio
+		playback->pass_audio
 		(
-			mPlayed,
+			playback,
 			mFormat,
 			lChannels,
 			mBufSize,
@@ -426,8 +426,9 @@
         if ( ti )
                 aModName = format_and_free_ti( ti, &aLength );
 
-	mInPlug->set_info
+	ipb->set_params
 	(
+		ipb,
 		aModName,
 		aLength,
 		mSoundFile->GetNumChannels() * 1000,
@@ -451,7 +452,7 @@
 
 	mDecodeThread = g_thread_self();
 	ipb->set_pb_ready(ipb);
-	this->PlayLoop();
+	this->PlayLoop(ipb);
 }
 
 void ModplugXMMS::Stop(void)
@@ -513,7 +514,7 @@
                 return NULL;
         }
 
-	Tuple *ti = tuple_new_from_filename(aFilename.c_str());
+	Tuple *ti = aud_tuple_new_from_filename(aFilename.c_str());
 	lSoundFile = new CSoundFile;
 	lSoundFile->Create((uchar*)lArchive->Map(), lArchive->Size());
 	
@@ -542,16 +543,16 @@
 	case MOD_TYPE_PSM:	tmps = "Protracker Studio Module"; break;
 	default:		tmps = "ModPlug unknown"; break;
 	}
-	tuple_associate_string(ti, FIELD_CODEC, NULL, tmps.c_str());
-	tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced");
-	tuple_associate_int(ti, FIELD_LENGTH, NULL, lSoundFile->GetSongTime() * 1000);
+	aud_tuple_associate_string(ti, FIELD_CODEC, NULL, tmps.c_str());
+	aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "sequenced");
+	aud_tuple_associate_int(ti, FIELD_LENGTH, NULL, lSoundFile->GetSongTime() * 1000);
 
 	/* NOTICE! FIXME? This is actually incorrect. We _cannot_ know what charset
 	 * an arbitrary module file uses .. typically it is some DOS CP-variant,
 	 * except for true Amiga modules.
 	 */
 	gchar *tmps2 = str_to_utf8(lSoundFile->GetTitle());
-	tuple_associate_string(ti, FIELD_TITLE, NULL, tmps2);
+	aud_tuple_associate_string(ti, FIELD_TITLE, NULL, tmps2);
 	g_free(tmps2);
 	
 	//unload the file
--- a/src/modplug/modplugbmp.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/modplug/modplugbmp.h	Sat Oct 13 21:53:47 2007 +0300
@@ -130,7 +130,7 @@
 	
 	float mPreampFactor;
 
-	void PlayLoop();
+	void PlayLoop(InputPlayback *);
 	static void* PlayThread(void* arg);
 	const char* Bool2OnOff(bool aValue);
 };
--- a/src/mtp_up/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/mtp_up/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = mtp_up${PLUGIN_SUFFIX}
+
 SRCS = mtp.c filetype.c
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. ${MTP_CFLAGS}
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. ${MTP_CFLAGS}
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${MTP_LIBS}
--- a/src/mtp_up/mtp.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/mtp_up/mtp.c	Sat Oct 13 21:53:47 2007 +0300
@@ -135,17 +135,17 @@
     uint32_t parent_id = 0;
     struct stat sb;
 
-    from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, FIELD_FILE_PATH, NULL), tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL));
+    from_path = g_strdup_printf("%s/%s", aud_tuple_get_string(from_tuple, FIELD_FILE_PATH, NULL), aud_tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL));
     gchar *tmp;
     tmp = g_strescape(from_path,NULL);
     filename=g_filename_from_uri(tmp,NULL,NULL);
     /* dealing the stream upload (invalidating)*/
     if(filename)
     {
-        f = vfs_fopen(from_path,"r");
-        if(vfs_is_streaming(f)) 
+        f = aud_vfs_fopen(from_path,"r");
+        if(aud_vfs_is_streaming(f)) 
         {
-            vfs_fclose(f);
+            aud_vfs_fclose(f);
             return NULL;
         }
     }       
@@ -162,15 +162,15 @@
 
     /* track metadata*/
     tr = LIBMTP_new_track_t();
-    tr->title = g_strdup((gchar*) tuple_get_string(from_tuple, FIELD_TITLE, NULL)); 
-    tr->artist = g_strdup((gchar*) tuple_get_string(from_tuple, FIELD_ARTIST, NULL));
-    tr->album = g_strdup((gchar*)tuple_get_string(from_tuple, FIELD_ALBUM, NULL));
+    tr->title = g_strdup((gchar*) aud_tuple_get_string(from_tuple, FIELD_TITLE, NULL)); 
+    tr->artist = g_strdup((gchar*) aud_tuple_get_string(from_tuple, FIELD_ARTIST, NULL));
+    tr->album = g_strdup((gchar*)aud_tuple_get_string(from_tuple, FIELD_ALBUM, NULL));
     tr->filesize = filesize;
-    tr->filename = g_strdup(tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL));
-    tr->duration = (uint32_t)tuple_get_int(from_tuple, FIELD_LENGTH, NULL);
+    tr->filename = g_strdup(aud_tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL));
+    tr->duration = (uint32_t)aud_tuple_get_int(from_tuple, FIELD_LENGTH, NULL);
     tr->filetype = find_filetype (from_path);
-    tr->genre = g_strdup((gchar*)tuple_get_string(from_tuple, FIELD_GENRE, NULL));
-    tr->date = g_strdup_printf("%d",tuple_get_int(from_tuple, FIELD_YEAR, NULL));
+    tr->genre = g_strdup((gchar*)aud_tuple_get_string(from_tuple, FIELD_GENRE, NULL));
+    tr->date = g_strdup_printf("%d",aud_tuple_get_int(from_tuple, FIELD_YEAR, NULL));
     g_free(filename);
     g_free(from_path);
     g_free(tmp); 
@@ -184,7 +184,7 @@
     uint32_t parent_id = 0;
     LIBMTP_track_t *gentrack;
     gentrack = track_metadata(from_tuple);
-    from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, FIELD_FILE_PATH, NULL), tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL));
+    from_path = g_strdup_printf("%s/%s", aud_tuple_get_string(from_tuple, FIELD_FILE_PATH, NULL), aud_tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL));
     if(gentrack == NULL) return 1;
     comp = g_strescape(from_path,NULL);
     g_free(from_path);
--- a/src/musepack/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/musepack/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = musepack${PLUGIN_SUFFIX}
+
 SRCS = libmpc.cxx
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${TAGLIB_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CXXFLAGS += ${PLUGIN_CFLAGS}
-LIBS += -lmpcdec ${TAGLIB_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${TAGLIB_CFLAGS} -I../../intl -I../..
+LIBS += ${TAGLIB_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -lmpcdec
--- a/src/musepack/libmpc.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/musepack/libmpc.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -60,34 +60,34 @@
  * This _IS_ very sick, but it works. -nenolod
  */
 static mpc_int32_t
-vfs_fread_impl(void *data, void *ptr, mpc_int32_t size)
+aud_vfs_fread_impl(void *data, void *ptr, mpc_int32_t size)
 {
     mpc_reader_file *d = (mpc_reader_file *) data;
     VFSFile *file = (VFSFile *) d->file;
 
-    return (mpc_int32_t) vfs_fread(ptr, 1, size, file);
+    return (mpc_int32_t) aud_vfs_fread(ptr, 1, size, file);
 }
 
 static mpc_bool_t
-vfs_fseek_impl(void *data, mpc_int32_t offset)
+aud_vfs_fseek_impl(void *data, mpc_int32_t offset)
 {
     mpc_reader_file *d = (mpc_reader_file *) data;
     VFSFile *file = (VFSFile *) d->file;
 
-    return d->is_seekable ? vfs_fseek(file, offset, SEEK_SET) == 0 : FALSE;
+    return d->is_seekable ? aud_vfs_fseek(file, offset, SEEK_SET) == 0 : FALSE;
 }
 
 static mpc_int32_t
-vfs_ftell_impl(void *data)
+aud_vfs_ftell_impl(void *data)
 {
     mpc_reader_file *d = (mpc_reader_file *) data;
     VFSFile *file = (VFSFile *) d->file;
 
-    return vfs_ftell(file);
+    return aud_vfs_ftell(file);
 }
 
 static mpc_int32_t
-vfs_getsize_impl(void *data)
+aud_vfs_getsize_impl(void *data)
 {
     mpc_reader_file *d = (mpc_reader_file *) data;
 
@@ -95,7 +95,7 @@
 }
 
 static mpc_bool_t
-vfs_canseek_impl(void *data)
+aud_vfs_canseek_impl(void *data)
 {
     mpc_reader_file *d = (mpc_reader_file *) data;
 
@@ -110,19 +110,19 @@
 void
 mpc_reader_setup_file_vfs(mpc_reader_file *p_reader, VFSFile *input)
 {
-    p_reader->reader.seek = vfs_fseek_impl;
-    p_reader->reader.read = vfs_fread_impl;
-    p_reader->reader.tell = vfs_ftell_impl;
-    p_reader->reader.get_size = vfs_getsize_impl;
-    p_reader->reader.canseek = vfs_canseek_impl;
+    p_reader->reader.seek = aud_vfs_fseek_impl;
+    p_reader->reader.read = aud_vfs_fread_impl;
+    p_reader->reader.tell = aud_vfs_ftell_impl;
+    p_reader->reader.get_size = aud_vfs_getsize_impl;
+    p_reader->reader.canseek = aud_vfs_canseek_impl;
     p_reader->reader.data = p_reader;
 
     p_reader->file = (FILE *) input; // no worries, it gets cast back -nenolod
     p_reader->is_seekable = TRUE;    // XXX streams
 
-    vfs_fseek(input, 0, SEEK_END);
-    p_reader->file_size = vfs_ftell(input);
-    vfs_fseek(input, 0, SEEK_SET);
+    aud_vfs_fseek(input, 0, SEEK_END);
+    p_reader->file_size = aud_vfs_ftell(input);
+    aud_vfs_fseek(input, 0, SEEK_SET);
 }
 
 static void mpcOpenPlugin()
@@ -279,13 +279,13 @@
 {
     VFSFile *file;
     gchar magic[3];
-    if ((file = vfs_fopen(p_Filename, "rb"))) {
-        vfs_fread(magic, 1, 3, file);
+    if ((file = aud_vfs_fopen(p_Filename, "rb"))) {
+        aud_vfs_fread(magic, 1, 3, file);
         if (!memcmp(magic, "MP+", 3)) {
-             vfs_fclose(file);
+             aud_vfs_fclose(file);
              return 1;
         }
-        vfs_fclose(file);
+        aud_vfs_fclose(file);
     }
     return 0;
 }
@@ -293,7 +293,7 @@
 static int mpcIsOurFD(char* p_Filename, VFSFile* file)
 {
     gchar magic[3];
-    vfs_fread(magic, 1, 3, file);
+    aud_vfs_fread(magic, 1, 3, file);
     if (!memcmp(magic, "MP+", 3))
         return 1;
     return 0;
@@ -307,7 +307,7 @@
     mpcDecoder.isPause  = false;
     threadHandle = g_thread_self();
     data->set_pb_ready(data);
-    decodeStream((void *) g_strdup(data->filename));
+    decodeStream(data);
 }
 
 static void mpcStop(InputPlayback *data)
@@ -350,23 +350,23 @@
 
 static Tuple *mpcGetSongTuple(char* p_Filename)
 {
-    VFSFile *input = vfs_fopen(p_Filename, "rb");
+    VFSFile *input = aud_vfs_fopen(p_Filename, "rb");
     Tuple *tuple = NULL;
 
     if(input)
     {
-        tuple = tuple_new_from_filename(p_Filename);
+        tuple = aud_tuple_new_from_filename(p_Filename);
 
         MpcInfo tags = getTags(p_Filename);
 
-        tuple_associate_string(tuple, FIELD_DATE, NULL, tags.date);
-        tuple_associate_string(tuple, FIELD_TITLE, NULL, tags.title);
-        tuple_associate_string(tuple, FIELD_ARTIST, NULL, tags.artist);
-        tuple_associate_string(tuple, FIELD_ALBUM, NULL, tags.album);
-        tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, tags.track);
-        tuple_associate_int(tuple, FIELD_YEAR, NULL, tags.year);
-        tuple_associate_string(tuple, FIELD_GENRE, NULL, tags.genre);
-        tuple_associate_string(tuple, FIELD_COMMENT, NULL, tags.comment);
+        aud_tuple_associate_string(tuple, FIELD_DATE, NULL, tags.date);
+        aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, tags.title);
+        aud_tuple_associate_string(tuple, FIELD_ARTIST, NULL, tags.artist);
+        aud_tuple_associate_string(tuple, FIELD_ALBUM, NULL, tags.album);
+        aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, tags.track);
+        aud_tuple_associate_int(tuple, FIELD_YEAR, NULL, tags.year);
+        aud_tuple_associate_string(tuple, FIELD_GENRE, NULL, tags.genre);
+        aud_tuple_associate_string(tuple, FIELD_COMMENT, NULL, tags.comment);
 
         freeTags(tags);
 
@@ -375,17 +375,17 @@
         mpc_reader_setup_file_vfs(&reader, input);
         mpc_streaminfo_read(&info, &reader.reader);
 
-        tuple_associate_int(tuple, FIELD_LENGTH, NULL, static_cast<int> (1000 * mpc_streaminfo_get_length(&info)));
+        aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, static_cast<int> (1000 * mpc_streaminfo_get_length(&info)));
 
         gchar *scratch = g_strdup_printf("Musepack v%d (encoder %s)", info.stream_version, info.encoder);
-        tuple_associate_string(tuple, FIELD_CODEC, NULL, scratch);
+        aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, scratch);
         g_free(scratch);
 
         scratch = g_strdup_printf("lossy (%s)", info.profile_name);
-        tuple_associate_string(tuple, FIELD_QUALITY, NULL, scratch);
+        aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, scratch);
         g_free(scratch);
 
-        vfs_fclose(input);
+        aud_vfs_fclose(input);
     }
     else
     {
@@ -399,7 +399,7 @@
 
 static void mpcGetSongInfo(char* p_Filename, char** p_Title, int* p_Length)
 {
-    VFSFile *input = vfs_fopen(p_Filename, "rb");
+    VFSFile *input = aud_vfs_fopen(p_Filename, "rb");
     if(input)
     {
         MpcInfo tags = getTags(p_Filename);
@@ -410,7 +410,7 @@
         mpc_reader_setup_file_vfs(&reader, input);
         mpc_streaminfo_read(&info, &reader.reader);
         *p_Length = static_cast<int> (1000 * mpc_streaminfo_get_length(&info));
-        vfs_fclose(input);
+        aud_vfs_fclose(input);
     }
     else
     {
@@ -580,7 +580,7 @@
         GtkWidget* albumPeakLabel = mpcGtkLabel(infoVbox);
         GtkWidget* albumGainLabel = mpcGtkLabel(infoVbox);
 
-        VFSFile *input = vfs_fopen(p_Filename, "rb");
+        VFSFile *input = aud_vfs_fopen(p_Filename, "rb");
         if(input)
         {
             mpc_streaminfo info;
@@ -621,7 +621,7 @@
             gtk_entry_set_text(GTK_ENTRY(fileEntry), entry);
             free(entry);
             freeTags(tags);
-            vfs_fclose(input);
+            aud_vfs_fclose(input);
         }
         else
         {
@@ -743,9 +743,9 @@
 {
     Tuple* tuple = mpcGetSongTuple(p_Filename);
 
-    char* title = tuple_formatter_make_title_string(tuple, get_gentitle_format());
+    char* title = aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
 
-    tuple_free((void *) tuple);
+    aud_tuple_free((void *) tuple);
     return title;
 }
 
@@ -762,7 +762,7 @@
     }
     setAlive(false);
     if(p_FileHandle)
-        vfs_fclose(p_FileHandle);
+        aud_vfs_fclose(p_FileHandle);
     if(track.display)
     {
         free(track.display);
@@ -771,11 +771,11 @@
     return 0;
 }
 
-static void* decodeStream(void* data)
+static void* decodeStream(InputPlayback *data)
 {
     lockAcquire();
-    char* filename = static_cast<char*> (data);
-    VFSFile *input = vfs_fopen(filename, "rb");
+    char* filename = data->filename;
+    VFSFile *input = aud_vfs_fopen(filename, "rb");
     if (!input)
     {
         mpcDecoder.isError = g_strdup_printf("[xmms-musepack] decodeStream is unable to open %s", filename);
@@ -800,7 +800,7 @@
     track.channels   = info.channels;
     freeTags(tags);
 
-    MpcPlugin.set_info(track.display, track.length, track.bitrate, track.sampleFreq, track.channels);
+    data->set_params(data, track.display, track.length, track.bitrate, track.sampleFreq, track.channels);
 
     mpc_decoder decoder;
     mpc_decoder_setup(&decoder, &reader.reader);
@@ -841,7 +841,7 @@
         int iFree = MpcPlugin.output->buffer_free();
         if (!mpcDecoder.isPause &&  iFree >= ((1152 * 4) << iPlaying))
         {
-            unsigned status = processBuffer(sampleBuffer, xmmsBuffer, decoder);
+            unsigned status = processBuffer(data, sampleBuffer, xmmsBuffer, decoder);
             if (status == (unsigned) (-1))
             {
                 mpcDecoder.isError = g_strdup_printf("[xmms-musepack] error from internal decoder on %s", filename);
@@ -857,7 +857,7 @@
                 counter -= status;
                 if(counter < 0)
                 {
-                    MpcPlugin.set_info(track.display, track.length, track.bitrate, track.sampleFreq, track.channels);
+                    data->set_params(data, track.display, track.length, track.bitrate, track.sampleFreq, track.channels);
                     counter = 2 * track.sampleFreq / 3;
                 }
             }
@@ -871,7 +871,8 @@
     return endThread(filename, input, false);
 }
 
-static int processBuffer(MPC_SAMPLE_FORMAT* sampleBuffer, char* xmmsBuffer, mpc_decoder& decoder)
+static int processBuffer(InputPlayback *playback, 
+    MPC_SAMPLE_FORMAT* sampleBuffer, char* xmmsBuffer, mpc_decoder& decoder)
 {
     mpc_uint32_t vbrAcc = 0;
     mpc_uint32_t vbrUpd = 0;
@@ -884,7 +885,7 @@
         track.bitrate = static_cast<int> (vbrUpd * track.sampleFreq / 1152);
     }
 
-    produce_audio(MpcPlugin.output->written_time(), FMT_S16_LE, track.channels, status * 4, xmmsBuffer, NULL);
+    playback->pass_audio(playback, FMT_S16_LE, track.channels, status * 4, xmmsBuffer, NULL);
     return status;
 }
 
--- a/src/musepack/libmpc.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/musepack/libmpc.h	Sat Oct 13 21:53:47 2007 +0300
@@ -108,7 +108,7 @@
 static void       mpcStop(InputPlayback *data);
 static void       mpcPause(InputPlayback *data, short);
 static void       mpcSeek(InputPlayback *data, int);
-static void       mpcSetEq(int, float, float*);
+//static void       mpcSetEq(int, float, float*);
 static int        mpcGetTime(InputPlayback *data);
 static void       mpcGetSongInfo(char*, char**, int*);
 static void       freeTags(MpcInfo&);
@@ -125,9 +125,9 @@
 static char*      mpcGenerateTitle(const MpcInfo&, char*);
 static void       lockAcquire();
 static void       lockRelease();
-static void*      decodeStream(void*);
-static int        processBuffer(MPC_SAMPLE_FORMAT*, char*, mpc_decoder&);
-static void*      endThread(char*, FILE*, bool);
+static void*      decodeStream(InputPlayback*);
+static int        processBuffer(InputPlayback*, MPC_SAMPLE_FORMAT*, char*, mpc_decoder&);
+//static void*      endThread(char*, FILE*, bool);
 static bool       isAlive();
 static void       setAlive(bool);
 static double     getOffset();
--- a/src/neon/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/neon/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 PLUGIN = neon${PLUGIN_SUFFIX}
+
 SRCS = neon.c	\
        rb.c
 
-plugindir = audacious/${TRANSPORT_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} ${NEON_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${TRANSPORT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${NEON_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} ${NEON_LIBS}
--- a/src/neon/neon.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/neon/neon.c	Sat Oct 13 21:53:47 2007 +0300
@@ -38,36 +38,36 @@
 
 VFSConstructor neon_http_const = {
     "http://",
-    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
+    neon_aud_vfs_fopen_impl,
+    neon_aud_vfs_fclose_impl,
+    neon_aud_vfs_fread_impl,
+    neon_aud_vfs_fwrite_impl,
+    neon_aud_vfs_getc_impl,
+    neon_aud_vfs_ungetc_impl,
+    neon_aud_vfs_fseek_impl,
+    neon_aud_vfs_rewind_impl,
+    neon_aud_vfs_ftell_impl,
+    neon_aud_vfs_feof_impl,
+    neon_aud_vfs_truncate_impl,
+    neon_aud_vfs_fsize_impl,
+    neon_aud_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
+    neon_aud_vfs_fopen_impl,
+    neon_aud_vfs_fclose_impl,
+    neon_aud_vfs_fread_impl,
+    neon_aud_vfs_fwrite_impl,
+    neon_aud_vfs_getc_impl,
+    neon_aud_vfs_ungetc_impl,
+    neon_aud_vfs_fseek_impl,
+    neon_aud_vfs_rewind_impl,
+    neon_aud_vfs_ftell_impl,
+    neon_aud_vfs_feof_impl,
+    neon_aud_vfs_truncate_impl,
+    neon_aud_vfs_fsize_impl,
+    neon_aud_vfs_metadata_impl
 };
 
 /* bring ne_set_connect_timeout in as a weak reference, not using it
@@ -163,11 +163,11 @@
         _LEAVE;
     }
 
-    vfs_register_transport(&neon_http_const);
+    aud_vfs_register_transport(&neon_http_const);
 
     if (0 != ne_has_support(NE_FEATURE_SSL)) {
         _DEBUG("neon compiled with thread-safe SSL, enabling https:// transport");
-        vfs_register_transport(&neon_https_const);
+        aud_vfs_register_transport(&neon_https_const);
     }
 
     _LEAVE;
@@ -511,7 +511,7 @@
             /* We hit a redirect. Handle it. */
             _DEBUG("Redirect encountered");
             handle->redircount += 1;
-            handle->purl = ne_redirect_location(handle->session);
+            handle->purl = (ne_uri*)ne_redirect_location(handle->session);
             ne_request_destroy(handle->request);
             if (NULL == handle->purl) {
                 _ERROR("Could not parse redirect response");
@@ -571,6 +571,7 @@
             use_proxy = FALSE;
         }
     }
+    bmp_cfg_db_close(db);
 
     handle->redircount = 0;
 
@@ -724,7 +725,7 @@
                  * Set the error flag and terminate the
                  * reader thread.
                  */
-                _DEBUG("Error while reading from the network. Terminating reader thread");
+                _ERROR("Error while reading from the network. Terminating reader thread");
                 h->reader_status.status = NEON_READER_ERROR;
                 g_mutex_unlock(h->reader_status.mutex);
                 _LEAVE NULL;
@@ -774,7 +775,7 @@
  * -----
  */
 
-VFSFile* neon_vfs_fopen_impl(const gchar* path, const gchar* mode) {
+VFSFile* neon_aud_vfs_fopen_impl(const gchar* path, const gchar* mode) {
 
     VFSFile* file;
     struct neon_handle* handle;
@@ -783,7 +784,7 @@
 
     _DEBUG("Trying to open '%s' with neon", path);
 
-    if (NULL == (file = malloc(sizeof(VFSFile)))) {
+    if (NULL == (file = g_new0(VFSFile, 1))) {
         _ERROR("Could not allocate memory for filehandle");
         _LEAVE NULL;
     }
@@ -818,7 +819,7 @@
  * ----
  */
 
-gint neon_vfs_fclose_impl(VFSFile* file) {
+gint neon_aud_vfs_fclose_impl(VFSFile* file) {
 
     struct neon_handle* h = (struct neon_handle *)file->handle;
 
@@ -845,7 +846,7 @@
  * -----
  */
 
-size_t neon_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file) {
+size_t neon_aud_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file) {
 
     struct neon_handle* h = (struct neon_handle*)file->handle;
     int belem;
@@ -889,6 +890,7 @@
                 /*
                  * Reader thread did not terminate gracefully.
                  */
+                _ERROR("Reader thread did not terminate gracefully: %d", h->reader_status.status);
                 _LEAVE 0;
             }
         } else {
@@ -1051,7 +1053,7 @@
  * -----
  */
 
-size_t neon_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file) {
+size_t neon_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file) {
 
     _ENTER;
 
@@ -1064,13 +1066,13 @@
  * -----
  */
 
-gint neon_vfs_getc_impl(VFSFile* file) {
+gint neon_aud_vfs_getc_impl(VFSFile* file) {
 
     gchar c;
 
     _ENTER;
 
-    if (1 != neon_vfs_fread_impl(&c, 1, 1, file)) {
+    if (1 != neon_aud_vfs_fread_impl(&c, 1, 1, file)) {
         _ERROR("Could not getc()!");
         _LEAVE -1;
     }
@@ -1082,7 +1084,7 @@
  * -----
  */
 
-gint neon_vfs_ungetc_impl(gint c, VFSFile* stream) {
+gint neon_aud_vfs_ungetc_impl(gint c, VFSFile* stream) {
 
     _ENTER;
 
@@ -1095,11 +1097,11 @@
  * -----
  */
 
-void neon_vfs_rewind_impl(VFSFile* file) {
+void neon_aud_vfs_rewind_impl(VFSFile* file) {
 
     _ENTER;
 
-    (void)neon_vfs_fseek_impl(file, 0L, SEEK_SET);
+    (void)neon_aud_vfs_fseek_impl(file, 0L, SEEK_SET);
 
     _LEAVE;
 }
@@ -1108,7 +1110,7 @@
  * -----
  */
 
-glong neon_vfs_ftell_impl(VFSFile* file) {
+glong neon_aud_vfs_ftell_impl(VFSFile* file) {
 
     struct neon_handle* h = (struct neon_handle *)file->handle;
 
@@ -1123,7 +1125,7 @@
  * -----
  */
 
-gboolean neon_vfs_feof_impl(VFSFile* file) {
+gboolean neon_aud_vfs_feof_impl(VFSFile* file) {
 
     struct neon_handle* h = (struct neon_handle*)file->handle;
 
@@ -1136,7 +1138,7 @@
  * -----
  */
 
-gint neon_vfs_truncate_impl(VFSFile* file, glong size) {
+gint neon_aud_vfs_truncate_impl(VFSFile* file, glong size) {
 
     _ENTER;
 
@@ -1149,7 +1151,7 @@
  * -----
  */
 
-gint neon_vfs_fseek_impl(VFSFile* file, glong offset, gint whence) {
+gint neon_aud_vfs_fseek_impl(VFSFile* file, glong offset, gint whence) {
 
     struct neon_handle* h = (struct neon_handle*)file->handle;
     long newpos;
@@ -1188,7 +1190,7 @@
     _DEBUG("Position to seek to: %ld, current: %ld", newpos, h->pos);
     if (0 > newpos) {
         _ERROR("Can not seek before start of stream");
-        _LEAVE -1;
+	_LEAVE -1;
     }
 
     if (newpos > content_length) {
@@ -1242,7 +1244,7 @@
  * -----
  */
 
-gchar *neon_vfs_metadata_impl(VFSFile* file, const gchar* field) {
+gchar *neon_aud_vfs_metadata_impl(VFSFile* file, const gchar* field) {
 
     struct neon_handle* h = (struct neon_handle*)file->handle;
 
@@ -1269,7 +1271,7 @@
  * -----
  */
 
-off_t neon_vfs_fsize_impl(VFSFile* file) {
+off_t neon_aud_vfs_fsize_impl(VFSFile* file) {
 
     struct neon_handle* h = (struct neon_handle*)file->handle;
 
--- a/src/neon/neon.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/neon/neon.h	Sat Oct 13 21:53:47 2007 +0300
@@ -33,19 +33,19 @@
 static void init(void);
 static void fini(void);
 
-VFSFile *neon_vfs_fopen_impl(const gchar* path, const gchar* mode);
-gint neon_vfs_fclose_impl(VFSFile* file);
-size_t neon_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file);
-size_t neon_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file);
-gint neon_vfs_getc_impl(VFSFile* file);
-gint neon_vfs_ungetc_impl(gint c, VFSFile* file);
-void neon_vfs_rewind_impl(VFSFile* file);
-glong neon_vfs_ftell_impl(VFSFile* file);
-gboolean neon_vfs_feof_impl(VFSFile* file);
-gint neon_vfs_truncate_impl(VFSFile* file, glong size);
-gint neon_vfs_fseek_impl(VFSFile* file, glong offset, gint whence);
-gchar *neon_vfs_metadata_impl(VFSFile* file, const gchar * field);
-off_t neon_vfs_fsize_impl(VFSFile* file);
+VFSFile *neon_aud_vfs_fopen_impl(const gchar* path, const gchar* mode);
+gint neon_aud_vfs_fclose_impl(VFSFile* file);
+size_t neon_aud_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file);
+size_t neon_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file);
+gint neon_aud_vfs_getc_impl(VFSFile* file);
+gint neon_aud_vfs_ungetc_impl(gint c, VFSFile* file);
+void neon_aud_vfs_rewind_impl(VFSFile* file);
+glong neon_aud_vfs_ftell_impl(VFSFile* file);
+gboolean neon_aud_vfs_feof_impl(VFSFile* file);
+gint neon_aud_vfs_truncate_impl(VFSFile* file, glong size);
+gint neon_aud_vfs_fseek_impl(VFSFile* file, glong offset, gint whence);
+gchar *neon_aud_vfs_metadata_impl(VFSFile* file, const gchar * field);
+off_t neon_aud_vfs_fsize_impl(VFSFile* file);
 
 ne_uri purl;
 
--- a/src/null/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/null/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = null${PLUGIN_SUFFIX}
+
 SRCS = null.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} ${MOWGLI_CFLAGS} -I../..
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} ${MOWGLI_CFLAGS} -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/paranormal/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/paranormal/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,6 +1,5 @@
-SUBDIRS = presets
+PLUGIN = paranormal${PLUGIN_SUFFIX}
 
-PLUGIN = paranormal${PLUGIN_SUFFIX}
 SRCS = actuators.c		\
        beatdetect.c		\
        builtins.c		\
@@ -22,11 +21,13 @@
        libcalc/parser.c		\
        libcalc/storage.c
 
-plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
+SUBDIRS = presets
 
 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} -I../../intl -I../.. -I.
+plugindir := ${plugindir}/${VISUALIZATION_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${SDL_CFLAGS} -I../../intl -I../.. -I.
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} ${SDL_LIBS}
--- a/src/paranormal/libcalc/parser.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/paranormal/libcalc/parser.c	Sat Oct 13 21:53:47 2007 +0300
@@ -1377,7 +1377,7 @@
   parser_control *pc = (parser_control *) yyparam;
   
   /* Ignore whitespace, get first nonwhite character. */
-  while ((c = vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n');
+  while ((c = aud_vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n');
   
   /* End of input ? */
   if (c == EOF)
@@ -1385,7 +1385,7 @@
 
   /* Char starts a number => parse the number. */
   if (isdigit (c)) {
-    vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */
+    aud_vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */
     {
       char *old_locale, *saved_locale;
 
@@ -1396,10 +1396,10 @@
 
       while (isdigit(c) || c == '.')
       {
-        c = vfs_getc(pc->input);
+        c = aud_vfs_getc(pc->input);
       }
 
-      vfs_fseek(pc->input, -1, SEEK_CUR);
+      aud_vfs_fseek(pc->input, -1, SEEK_CUR);
 
       setlocale (LC_ALL, saved_locale);
       g_free (saved_locale);
@@ -1417,10 +1417,10 @@
       sym_name = g_string_append_c (sym_name, c);
 
       /* Get another character. */
-      c = vfs_getc (pc->input);
+      c = aud_vfs_getc (pc->input);
     } while (c != EOF && isalnum (c));
     
-    vfs_fseek (pc->input, -1, SEEK_CUR);
+    aud_vfs_fseek (pc->input, -1, SEEK_CUR);
 
     yylval->s_value = sym_name->str;
     
@@ -1501,7 +1501,7 @@
 
   g_return_val_if_fail(str != NULL && dict != NULL, NULL);
 
-  stream = vfs_buffer_new_from_string ( (char *) str );
+  stream = aud_vfs_buffer_new_from_string ( (char *) str );
 
   pc.input = stream;
   pc.expr = expr_new ();
@@ -1513,7 +1513,7 @@
     pc.expr = NULL;
   }
 
-  vfs_fclose (stream);
+  aud_vfs_fclose (stream);
 
   return pc.expr;
 }
--- a/src/paranormal/libcalc/parser.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/paranormal/libcalc/parser.h	Sat Oct 13 21:53:47 2007 +0300
@@ -24,7 +24,7 @@
 
 #include <glib.h>
 #include <stdio.h>
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 #include <audacious/vfs_buffer.h>
 
 #include "execute.h"
--- a/src/paranormal/presets/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/paranormal/presets/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -35,4 +35,4 @@
 
 include ../../../buildsys.mk
 
-PACKAGE = audacious-plugins/paranormal/Presets
+PACKAGE = audacious/paranormal/Presets
--- a/src/pls/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/pls/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,11 @@
 PLUGIN = pls${PLUGIN_SUFFIX}
 SRCS = pls.c
 
-plugindir = audacious/${CONTAINER_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} -I../../intl -I../..
+plugindir := ${plugindir}/${CONTAINER_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS}
--- a/src/pls/pls.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/pls/pls.c	Sat Oct 13 21:53:47 2007 +0300
@@ -100,14 +100,14 @@
 playlist_save_pls(const gchar *filename, gint pos)
 {
     GList *node;
-    VFSFile *file = vfs_fopen(filename, "wb");
+    VFSFile *file = aud_vfs_fopen(filename, "wb");
     Playlist *playlist = playlist_get_active();
 
     g_return_if_fail(file != NULL);
     g_return_if_fail(playlist != NULL);
 
-    vfs_fprintf(file, "[playlist]\n");
-    vfs_fprintf(file, "NumberOfEntries=%d\n", playlist_get_length(playlist));
+    aud_vfs_fprintf(file, "[playlist]\n");
+    aud_vfs_fprintf(file, "NumberOfEntries=%d\n", playlist_get_length(playlist));
 
     PLAYLIST_LOCK(playlist);
 
@@ -115,12 +115,12 @@
         PlaylistEntry *entry = PLAYLIST_ENTRY(node->data);
         gchar *fn;
 
-        if (vfs_is_remote(entry->filename))
+        if (aud_vfs_is_remote(entry->filename))
             fn = g_strdup(entry->filename);
         else
             fn = g_filename_from_uri(entry->filename, NULL, NULL);
 
-        vfs_fprintf(file, "File%d=%s\n", g_list_position(playlist->entries, node) + 1,
+        aud_vfs_fprintf(file, "File%d=%s\n", g_list_position(playlist->entries, node) + 1,
                     fn);
 
         g_free(fn);
@@ -128,7 +128,7 @@
 
     PLAYLIST_UNLOCK(playlist);
 
-    vfs_fclose(file);
+    aud_vfs_fclose(file);
 }
 
 PlaylistContainer plc_pls = {
--- a/src/projectm-1.0/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/projectm-1.0/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,15 +1,16 @@
 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../..
+plugindir := ${plugindir}/${VISUALIZATION_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
 CXXFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${SDL_CFLAGS} ${LIBPROJECTM1_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${SDL_LIBS} ${LIBPROJECTM1_LIBS}
--- a/src/projectm-1.0/main.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/projectm-1.0/main.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -34,23 +34,22 @@
 #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"
 
+#include <GL/gl.h>
 #define CONFIG_FILE "/share/projectM/config.inp"
 
 // Forward declarations 
@@ -72,13 +71,9 @@
 
 //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;
@@ -121,8 +116,11 @@
 	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;
+		  //globalPM->renderer->title = title;
+			//globalPM->renderer->drawtitle = 1;
+
+		  std::string titlepp(title);
+		  globalPM->projectM_setTitle(titlepp);
 			g_free(last_title);
 			last_title = title;
 		} else if(title && last_title != title) {
@@ -144,24 +142,23 @@
  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);   
+  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);
+  SDL_SemPost(sem);
+  title_timer = SDL_AddTimer(500, get_xmms_title, NULL);
     /** Initialise the thread */
   // SDL_SemTryWait(sem);
   while ( SDL_SemValue(sem)==1 ) {
@@ -197,11 +194,13 @@
                     if (fullscreen == 0) {
                         w = fvw;
                         h = fvh;
+			fullscreen = 1;
                     } else {
                         w = wvw;
                         h = wvh;
+			fullscreen = 0;
                     }
-                    globalPM->fullscreen = fullscreen ^= 1;
+                  
                     resize_display(w, h, fullscreen);
                     globalPM->projectM_resetGL( w, h ); 
                 }
@@ -223,7 +222,7 @@
               } 
 	    else if ( evt == PROJECTM_VIDEOQUIT ) {
 	      
-	      (void) g_idle_add((GSourceFunc) disable_projectm, NULL);
+	      (void) g_idle_add ((GSourceFunc) disable_projectm, NULL);
 	    }
 	}
 	
@@ -235,9 +234,9 @@
 
 	 //printf("%s\n",title);
 	// strcpy(globalPM->title,title);
-	//SDL_mutexP(mutex);
+	
 	  globalPM->renderFrame();
-	  //SDL_mutexV(mutex);
+	
       
 
         SDL_GL_SwapBuffers();
@@ -246,14 +245,10 @@
 	//	SDL_SemPost(sem);
       }
 
- 
-		
-  printf("Worker thread: Exiting\n");
  if(title_timer) 
-	SDL_RemoveTimer(title_timer);
+  	SDL_RemoveTimer(title_timer);
  delete globalPM;
- globalPM = NULL;
- close_display();
+
 
  return 0;
 }
@@ -261,32 +256,44 @@
 extern "C" void projectM_xmms_init(void) 
 {
   
-  printf("projectM plugin: Initializing\n");
+  /* First, initialize SDL's video subsystem. */
+ // std::cerr << "sdl init begin" << std::endl;  
+  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;
+    
+  }
+  sem = SDL_CreateSemaphore(0);
+ // 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)
+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");
-  }
+  if(!sem) return;
+  SDL_SemWait(sem);
+  if(worker_thread) SDL_WaitThread(worker_thread, NULL);
+  // SDL_KillThread(worker_thread);
+  //printf("killed thread\n");
+
+  SDL_DestroySemaphore(sem);
+  //printf("Destroy Mutex\n");
+  SDL_Quit();
+
+  sem = NULL;
+  worker_thread = NULL;
+  
+ // printf("projectM plugin: Cleanup completed\n");
 }
 extern "C" void projectM_about(void)
 {
@@ -306,10 +313,9 @@
 }
 extern "C" void projectM_render_pcm(gint16 pcm_data[2][512])
 {
-  //SDL_mutexP(mutex);
-
-    if(globalPM)
-        globalPM->beatDetect->pcm->addPCM16(pcm_data);
+  //SDL_mutexP(mutex); while ( SDL_SemValue(sem)==1 )
+  if ( SDL_SemValue(sem)==1 )
+        globalPM->pcm->addPCM16(pcm_data);
 	 
        	//SDL_mutexV(mutex);
 	
@@ -336,7 +342,7 @@
    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);
+   //printf("dir:%s \n",projectM_config);
    home=getenv("HOME");
    strcpy(projectM_home, home);
    strcpy(projectM_home+strlen(home), "/.projectM/config.inp");
@@ -345,7 +351,7 @@
   
  if ((in = fopen(projectM_home, "r")) != 0) 
    {
-     printf("reading ~/.projectM/config.inp \n");
+     //printf("reading ~/.projectM/config.inp \n");
      fclose(in);
      return std::string(projectM_home);
    }
@@ -361,13 +367,13 @@
      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);
@@ -394,61 +400,63 @@
 	     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()
 {
-
+  char dumpPath[512];
+  char Home[512];
+  //char *home;
+  
   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];
+  
+  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);
-        
+  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, "/.projectM/%.8d.bmp", frame++);
+  // home=getenv("HOME");
+  strcpy(Home, getenv("HOME"));
+  strcpy(Home+strlen(Home), dumpPath);
+  Home[strlen(Home)]='\0';
+  SDL_SaveBMP(bitmap, Home);
+     
+  SDL_FreeSurface(bitmap);
+ 
        
 }
 
--- a/src/projectm-1.0/video_init.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/projectm-1.0/video_init.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -9,15 +9,10 @@
 #include <SDL/SDL.h>
 #include <GL/gl.h>
 #include <GL/glu.h>
-
+#include "video_init.h"
+#include <iostream>
 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;
@@ -29,7 +24,7 @@
       fprintf( stderr, "Video mode set failed: %s\n", SDL_GetError( ) );
       return;
   }
-  setup_opengl(w,h);
+  
   SDL_ShowCursor(f ? SDL_DISABLE : SDL_ENABLE);
 }
 
@@ -46,15 +41,8 @@
   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 ) {
@@ -65,12 +53,10 @@
     return;
   }
   
-  printf("Screen Resolution: %d x %d\n", info->current_w, info->current_h);
+//  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 );
@@ -81,13 +67,10 @@
   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");
+ screen= SDL_SetVideoMode( w, h, bpp, flags ) ;
   if(screen == 0 ) {
     /* 
      * This could happen for a variety of reasons,
@@ -102,55 +85,8 @@
     
   }
   
-  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);
-  
-    
-}
-
--- a/src/projectm-1.0/video_init.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/projectm-1.0/video_init.h	Sat Oct 13 21:53:47 2007 +0300
@@ -1,6 +1,5 @@
- 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	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/projectm/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 PLUGIN = projectm${PLUGIN_SUFFIX}
+
 SRCS = main.c		\
        video_init.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} ${LIBPROJECTM_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${VISUALIZATION_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} ${SDL_CFLAGS} ${LIBPROJECTM_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${SDL_LIBS} ${LIBPROJECTM_LIBS} -lprojectM
--- a/src/pulse_audio/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/pulse_audio/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = pulse_audio${PLUGIN_SUFFIX}
+
 SRCS = pulse_audio.c
 
-plugindir = audacious/${OUTPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += -lpulse ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/rocklight/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/rocklight/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,13 +1,14 @@
 PLUGIN = rocklight${PLUGIN_SUFFIX}
+
 SRCS = rocklight.c	\
        sysled.c		\
        thinklight.c
 
-plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${VISUALIZATION_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/rootvis/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/rootvis/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = rootvis${PLUGIN_SUFFIX}
+
 SRCS = config_backend.c			\
        config_definition.c		\
        config_frontend.c		\
@@ -6,11 +7,11 @@
        getroot.c			\
        rootvis.c
 
-plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} -I. ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${IMLIB2_CFLAGS}
+plugindir := ${plugindir}/${VISUALIZATION_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${IMLIB2_CFLAGS} -I.
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${IMLIB2_LIBS}
--- a/src/scrobbler/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/scrobbler/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = scrobbler${PLUGIN_SUFFIX}
+
 SRCS = fmt.c			\
        configure.c		\
        gtkstuff.c		\
@@ -10,13 +11,13 @@
 DATA = images/audioscrobbler.png	\
        images/audioscrobbler_badge.png
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
 PACKAGE = audacious
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${BEEP_DEFINES} ${CURL_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${BEEP_DEFINES} ${CURL_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${CURL_LIBS} ${MUSICBRAINZ_LIBS}
--- a/src/scrobbler/configure.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/scrobbler/configure.c	Sat Oct 13 21:53:47 2007 +0300
@@ -3,6 +3,7 @@
 #include <config.h>
 
 #include <audacious/util.h>
+#include <audacious/plugin.h>
 #include <audacious/configdb.h>
 
 #include <sys/types.h>
--- a/src/scrobbler/gerpok.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/scrobbler/gerpok.c	Sat Oct 13 21:53:47 2007 +0300
@@ -13,7 +13,7 @@
 #include "config.h"
 #include <glib.h>
 
-#include <audacious/tuple.h>
+#include <audacious/plugin.h>
 #include <audacious/util.h>
 
 #define SCROBBLER_HS_URL "http://post.gerpok.com"
@@ -92,8 +92,8 @@
 
 	item = malloc(sizeof(item_t));
 
-	item->artist = fmt_escape(tuple_get_string(tuple, FIELD_ARTIST, NULL));
-	item->title = fmt_escape(tuple_get_string(tuple, FIELD_TITLE, NULL));
+	item->artist = fmt_escape(aud_tuple_get_string(tuple, FIELD_ARTIST, NULL));
+	item->title = fmt_escape(aud_tuple_get_string(tuple, FIELD_TITLE, NULL));
 	item->utctime = fmt_escape(fmt_timestr(time(NULL), 1));
 	g_snprintf(item->len, sizeof(item->len), "%d", len);
 
@@ -106,7 +106,7 @@
 		item->mb = fmt_escape((char*)tuple->mb);
 #endif
 
-	if((album = tuple_get_string(tuple, FIELD_ALBUM, NULL)))
+	if((album = aud_tuple_get_string(tuple, FIELD_ALBUM, NULL)))
 		item->album = fmt_escape("");
 	else
 		item->album = fmt_escape((char*) album);
--- a/src/scrobbler/plugin.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/scrobbler/plugin.c	Sat Oct 13 21:53:47 2007 +0300
@@ -240,19 +240,19 @@
 			if (tuple == NULL)
 				continue;
 
-			if (ishttp(tuple_get_string(tuple, FIELD_FILE_NAME, NULL)))
+			if (ishttp(aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL)))
 				continue;
 
-			if (tuple_get_string(tuple, FIELD_ARTIST, NULL) != NULL &&
-				tuple_get_string(tuple, FIELD_TITLE, NULL) != NULL)
+			if (aud_tuple_get_string(tuple, FIELD_ARTIST, NULL) != NULL &&
+				aud_tuple_get_string(tuple, FIELD_TITLE, NULL) != NULL)
 			{
 				pdebug(fmt_vastr(
 					"submitting artist: %s, title: %s",
-					tuple_get_string(tuple, FIELD_ARTIST, NULL),
-					tuple_get_string(tuple, FIELD_TITLE, NULL)), DEBUG);
+					aud_tuple_get_string(tuple, FIELD_ARTIST, NULL),
+					aud_tuple_get_string(tuple, FIELD_TITLE, NULL)), DEBUG);
 				
-				sc_addentry(m_scrobbler, tuple, tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000);
-				gerpok_sc_addentry(m_scrobbler, tuple, tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000);
+				sc_addentry(m_scrobbler, tuple, aud_tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000);
+				gerpok_sc_addentry(m_scrobbler, tuple, aud_tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000);
 			}
 			else
 				pdebug("tuple does not contain an artist or a title, not submitting.", DEBUG);
--- a/src/scrobbler/scrobbler.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/scrobbler/scrobbler.c	Sat Oct 13 21:53:47 2007 +0300
@@ -12,7 +12,7 @@
 #include "settings.h"
 #include <glib.h>
 
-#include <audacious/tuple.h>
+#include <audacious/plugin.h>
 #include <audacious/util.h>
 
 #define SCROBBLER_HS_URL "http://post.audioscrobbler.com"
@@ -131,12 +131,12 @@
 
 	item = malloc(sizeof(item_t));
 
-	item->artist = fmt_escape(tuple_get_string(tuple, FIELD_ARTIST, NULL));
-	item->title = fmt_escape(tuple_get_string(tuple, FIELD_TITLE, NULL));
+	item->artist = fmt_escape(aud_tuple_get_string(tuple, FIELD_ARTIST, NULL));
+	item->title = fmt_escape(aud_tuple_get_string(tuple, FIELD_TITLE, NULL));
 	g_snprintf(item->utctime, sizeof(item->utctime), "%ld", time(NULL));
 	g_snprintf(item->len, sizeof(item->len), "%d", len);
 	g_snprintf(item->track, sizeof(item->track), "%d",
-		tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL));
+		aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL));
 
 #ifdef NOTYET
 	if(tuple->mb == NULL)
@@ -147,7 +147,7 @@
 		item->mb = fmt_escape((char*)tuple->mb);
 #endif
 
-	if((album = tuple_get_string(tuple, FIELD_ALBUM, NULL)) != NULL)
+	if((album = aud_tuple_get_string(tuple, FIELD_ALBUM, NULL)) != NULL)
 		item->album = fmt_escape("");
 	else
 		item->album = fmt_escape((char*) album);
@@ -674,11 +674,11 @@
 	/*cfa(&post, &last, "debug", "failed");*/
 
 	entry = g_strdup_printf("s=%s&a=%s&t=%s&b=%s&l=%d&n=%d&m=", sc_session_id,
-		tuple_get_string(tuple, FIELD_ARTIST, NULL),
-		tuple_get_string(tuple, FIELD_TITLE, NULL),
-		tuple_get_string(tuple, FIELD_ALBUM, NULL) ? tuple_get_string(tuple, FIELD_ALBUM, NULL) : "",
-		tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000,
-		tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL));
+		aud_tuple_get_string(tuple, FIELD_ARTIST, NULL),
+		aud_tuple_get_string(tuple, FIELD_TITLE, NULL),
+		aud_tuple_get_string(tuple, FIELD_ALBUM, NULL) ? aud_tuple_get_string(tuple, FIELD_ALBUM, NULL) : "",
+		aud_tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000,
+		aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL));
 
 	curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char *) entry);
 	memset(sc_curl_errbuf, 0, sizeof(sc_curl_errbuf));
@@ -883,15 +883,15 @@
 		ptr1 = ptr2 + 1;
 
 		{
-			Tuple *tuple = tuple_new();
+			Tuple *tuple = aud_tuple_new();
 
-			tuple_associate_string(tuple, FIELD_ARTIST, NULL, xmms_urldecode_plain(artist));
-			tuple_associate_string(tuple, FIELD_TITLE, NULL, xmms_urldecode_plain(title));
-			tuple_associate_string(tuple, FIELD_ALBUM, NULL, xmms_urldecode_plain(album));
+			aud_tuple_associate_string(tuple, FIELD_ARTIST, NULL, xmms_urldecode_plain(artist));
+			aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, xmms_urldecode_plain(title));
+			aud_tuple_associate_string(tuple, FIELD_ALBUM, NULL, xmms_urldecode_plain(album));
 
 			item = q_put(tuple, atoi(len));
 
-			tuple_free(tuple);
+			aud_tuple_free(tuple);
 		}
 
 		pdebug(fmt_vastr("a[%d]=%s t[%d]=%s l[%d]=%s i[%d]=%s m[%d]=%s b[%d]=%s",
--- a/src/sexypsf/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sexypsf/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = sexypsf${PLUGIN_SUFFIX}
+
 SRCS = PsxBios.c 	\
        PsxCounters.c	\
        PsxDma.c		\
@@ -12,11 +13,11 @@
        spu/spu.c	\
        plugin.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. -Ispu/ -I.
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBS += -lz ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../.. -Ispu/ -I.
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -lz
--- a/src/sexypsf/Misc.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sexypsf/Misc.c	Sat Oct 13 21:53:47 2007 +0300
@@ -16,7 +16,7 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -236,13 +236,13 @@
 	PSFINFO *psfi;
 	PSFINFO *tmpi;
 
-        if(!(fp=vfs_fopen(path,"rb")))
+        if(!(fp=aud_vfs_fopen(path,"rb")))
  	{
          printf("path %s failed to load\n", path);
 	 return(0);
 	}
  
-	vfs_fread(head,1,4,fp);
+	aud_vfs_fread(head,1,4,fp);
 	if(memcmp(head,"PSF\x01",4)) return(0);
 
 	psfi=malloc(sizeof(PSFINFO));
@@ -250,22 +250,22 @@
         psfi->stop=~0;
         psfi->fade=0; 
 
-        vfs_fread(&reserved,1,4,fp);
-        vfs_fread(&complen,1,4,fp);
+        aud_vfs_fread(&reserved,1,4,fp);
+        aud_vfs_fread(&complen,1,4,fp);
 	complen=BFLIP32(complen);
 
-        vfs_fread(&crc32,1,4,fp);
+        aud_vfs_fread(&crc32,1,4,fp);
 	crc32=BFLIP32(crc32);
 
-        vfs_fseek(fp,reserved,SEEK_CUR);
+        aud_vfs_fseek(fp,reserved,SEEK_CUR);
 
         if(type)
-	 vfs_fseek(fp,complen,SEEK_CUR);
+	 aud_vfs_fseek(fp,complen,SEEK_CUR);
         else
         {
          in=malloc(complen);
          out=malloc(1024*1024*2+0x800);
-         vfs_fread(in,1,complen,fp);
+         aud_vfs_fread(in,1,complen,fp);
          outlen=1024*1024*2;
          uncompress(out,&outlen,in,complen);
          free(in);
@@ -284,13 +284,13 @@
 
         {
          u8 tagdata[5];
-         if(vfs_fread(tagdata,1,5,fp)==5)
+         if(aud_vfs_fread(tagdata,1,5,fp)==5)
          {
           if(!memcmp(tagdata,"[TAG]",5))
           {
            char linebuf[1024];
 
-           while(vfs_fgets(linebuf,1024,fp))
+           while(aud_vfs_fgets(linebuf,1024,fp))
            {
             int x;
 	    char *key=0,*value=0;
@@ -332,7 +332,7 @@
 	      free(value);
 	      free(tmpfn);
  	      if(!level) free(out);
-	      vfs_fclose(fp);
+	      aud_vfs_fclose(fp);
 	      FreeTags(psfi->tags);
 	      free(psfi);
 	      return(0);
@@ -346,7 +346,7 @@
          }
         }  
 
-        vfs_fclose(fp);
+        aud_vfs_fclose(fp);
 
 	/* Now, if we're at level 0(main PSF), load the main executable, and any libN stuff */
         if(!level && !type)
@@ -406,7 +406,7 @@
             //free(key);
             //free(value);
             //free(tmpfn);
-            //vfs_fclose(fp);
+            //aud_vfs_fclose(fp);
             //return(0);
            }
            free(tmpfn);
--- a/src/sexypsf/plugin.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sexypsf/plugin.c	Sat Oct 13 21:53:47 2007 +0300
@@ -44,7 +44,7 @@
 
 static int is_our_fd(gchar *filename, VFSFile *file) {
     gchar magic[4];
-    vfs_fread(magic, 1, 4, file);
+    aud_vfs_fread(magic, 1, 4, file);
 
     // only allow PSF1 for now
     if (!memcmp(magic, "PSF\x01", 4))
@@ -60,13 +60,12 @@
     {
         int t = playback->output->buffer_free() & mask;
         if (t > count)     
-            produce_audio(playback->output->written_time(),
+            playback->pass_audio(playback,
                           FMT_S16_NE, 2, count, buffer, NULL);
         else
         {
             if (t)
-                produce_audio(playback->output->written_time(),
-                              FMT_S16_NE, 2, t, buffer, NULL);
+                playback->pass_audio(playback, FMT_S16_NE, 2, t, buffer, NULL);
             g_usleep((count-t)*1000*5/441/2);
         }
         count -= t;
@@ -150,7 +149,7 @@
         stop = seek = 0;
 
         gchar *name = get_title_psf(data->filename);
-        sexypsf_ip.set_info(name, PSFInfo->length, 44100*2*2*8, 44100, 2);
+        data->set_params(data, name, PSFInfo->length, 44100*2*2*8, 44100, 2);
         g_free(name);
 
         playing = 1;
@@ -217,24 +216,24 @@
     }
 }
 
-static Tuple *get_tuple_psf(gchar *fn) {
+static Tuple *get_aud_tuple_psf(gchar *fn) {
     Tuple *tuple = NULL;
     PSFINFO *tmp = sexypsf_getpsfinfo(fn);
 
     if (tmp->length) {
-        tuple = tuple_new_from_filename(fn);
-	tuple_associate_int(tuple, FIELD_LENGTH, NULL, tmp->length);
-	tuple_associate_string(tuple, FIELD_ARTIST, NULL, tmp->artist);
-	tuple_associate_string(tuple, FIELD_ALBUM, NULL, tmp->game);
-	tuple_associate_string(tuple, -1, "game", tmp->game);
-        tuple_associate_string(tuple, FIELD_TITLE, NULL, tmp->title);
-        tuple_associate_string(tuple, FIELD_GENRE, NULL, tmp->genre);
-        tuple_associate_string(tuple, FIELD_COPYRIGHT, NULL, tmp->copyright);
-        tuple_associate_string(tuple, FIELD_QUALITY, NULL, "sequenced");
-        tuple_associate_string(tuple, FIELD_CODEC, NULL, "PlayStation Audio");
-        tuple_associate_string(tuple, -1, "console", "PlayStation");
-        tuple_associate_string(tuple, -1, "dumper", tmp->psfby);
-        tuple_associate_string(tuple, FIELD_COMMENT, NULL, tmp->comment);
+        tuple = aud_tuple_new_from_filename(fn);
+	aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, tmp->length);
+	aud_tuple_associate_string(tuple, FIELD_ARTIST, NULL, tmp->artist);
+	aud_tuple_associate_string(tuple, FIELD_ALBUM, NULL, tmp->game);
+	aud_tuple_associate_string(tuple, -1, "game", tmp->game);
+        aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, tmp->title);
+        aud_tuple_associate_string(tuple, FIELD_GENRE, NULL, tmp->genre);
+        aud_tuple_associate_string(tuple, FIELD_COPYRIGHT, NULL, tmp->copyright);
+        aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "sequenced");
+        aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "PlayStation Audio");
+        aud_tuple_associate_string(tuple, -1, "console", "PlayStation");
+        aud_tuple_associate_string(tuple, -1, "dumper", tmp->psfby);
+        aud_tuple_associate_string(tuple, FIELD_COMMENT, NULL, tmp->comment);
 
         sexypsf_freepsfinfo(tmp);
     }
@@ -244,11 +243,11 @@
 
 static gchar *get_title_psf(gchar *fn) {
     gchar *title = NULL;
-    Tuple *tuple = get_tuple_psf(fn);
+    Tuple *tuple = get_aud_tuple_psf(fn);
 
     if (tuple != NULL) {
-        title = tuple_formatter_make_title_string(tuple, get_gentitle_format());
-        tuple_free(tuple);
+        title = aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
+        aud_tuple_free(tuple);
     }
     else
         title = g_path_get_basename(fn);
@@ -267,7 +266,7 @@
     .seek = sexypsf_xmms_seek,
     .get_time = sexypsf_xmms_gettime,
     .get_song_info = sexypsf_xmms_getsonginfo,
-    .get_song_tuple = get_tuple_psf,
+    .get_song_tuple = get_aud_tuple_psf,
     .is_our_file_from_vfs = is_our_fd,
     .vfs_extensions = sexypsf_fmts,
 };
--- a/src/shnplug/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/shnplug/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,30 +1,29 @@
-include ../../mk/rules.mk
-include ../../mk/init.mk
-
-OBJECTIVE_LIBS = libshnplug$(SHARED_SUFFIX)
-
-LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
+PLUGIN = libshnplug${PLUGIN_SUFFIX}
 
-SOURCES = \
-  array.c \
-  convert.c \
-  fixio.c \
-  gtk.c \
-  id3v2.c \
-  misc.c \
-  output.c \
-  seek.c \
-  shn.c \
-  shorten.c \
-  sulawalaw.c \
-  vario.c \
-  wave.c
+SRCS = array.c		\
+       convert.c	\
+       fixio.c		\
+       gtk.c		\
+       id3v2.c		\
+       misc.c		\
+       output.c		\
+       seek.c		\
+       shn.c		\
+       shorten.c	\
+       sulawalaw.c	\
+       vario.c		\
+       wave.c
 
-OBJECTS = ${SOURCES:.c=.o}
+include ../../buildsys.mk
+include ../../extra.mk
 
-CFLAGS   += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(SIMD_CFLAGS) -I../../intl -I../.. -Wall
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
 
-LDFLAGS += $(AUDLDFLAGS)
-LIBADD = -L/opt/local/lib -L$(plugindir) -Wl,-rpath=$(plugindir) -laudid3tag $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+CFLAGS += ${PLUGIN_CFLAGS}
+LDFLAGS += ${AUDLDFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${PICFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${MOWGLI_CFLAGS} \
+	    ${PANGO_CFLAGS} ${ARCH_DEFINES} ${SIMD_CFLAGS} -I../../intl -I../.. -Wall
+LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
 
-include ../../mk/objective.mk
+# These were the additional link flags in the old Makefile:
+# -L/opt/local/lib -L${plugindir} -laudid3tag -Wl,-rpath=${plugindir}
--- a/src/shnplug/id3v2.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/shnplug/id3v2.c	Sat Oct 13 21:53:47 2007 +0300
@@ -58,7 +58,7 @@
   unsigned long tag_size;
 
   /* read an ID3v2 header's size worth of data */
-  if (sizeof(_id3v2_header) != vfs_fread(&id3v2_header,1,sizeof(_id3v2_header),f)) {
+  if (sizeof(_id3v2_header) != aud_vfs_fread(&id3v2_header,1,sizeof(_id3v2_header),f)) {
     return 0;
   }
 
@@ -83,7 +83,7 @@
   VFSFile *f;
   unsigned long tag_size;
 
-  if (NULL == (f = vfs_fopen(filename,"rb"))) {
+  if (NULL == (f = aud_vfs_fopen(filename,"rb"))) {
     return NULL;
   }
 
@@ -95,8 +95,8 @@
 
   /* check for ID3v2 tag on input */
   if (0 == (tag_size = check_for_id3v2_tag(f))) {
-    vfs_fclose(f);
-    return vfs_fopen(filename,"rb");
+    aud_vfs_fclose(f);
+    return aud_vfs_fopen(filename,"rb");
   }
 
   if (file_has_id3v2_tag)
@@ -107,10 +107,10 @@
 
   shn_debug("Discarding %lu-byte ID3v2 tag at beginning of file '%s'.",tag_size+sizeof(_id3v2_header),filename);
 
-  if (0 != vfs_fseek(f,(long)tag_size,SEEK_CUR)) {
+  if (0 != aud_vfs_fseek(f,(long)tag_size,SEEK_CUR)) {
     shn_debug("Error while discarding ID3v2 tag in file '%s'.",filename);
-    vfs_fclose(f);
-    return vfs_fopen(filename,"rb");
+    aud_vfs_fclose(f);
+    return aud_vfs_fopen(filename,"rb");
   }
 
   return f;
--- a/src/shnplug/seek.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/shnplug/seek.c	Sat Oct 13 21:53:47 2007 +0300
@@ -53,16 +53,16 @@
 
 	shn_debug("Looking for seek table in separate file: '%s'",filename);
 
-	if (!(f=vfs_fopen(filename,"rb")))
+	if (!(f=aud_vfs_fopen(filename,"rb")))
 	{
 		return 0;
 	}
 
-	vfs_fseek(f,0,SEEK_END);
-	seek_table_len = (slong)vfs_ftell(f) - SEEK_HEADER_SIZE;
-	vfs_fseek(f,0,SEEK_SET);
+	aud_vfs_fseek(f,0,SEEK_END);
+	seek_table_len = (slong)aud_vfs_ftell(f) - SEEK_HEADER_SIZE;
+	aud_vfs_fseek(f,0,SEEK_SET);
 
-	if (vfs_fread((void *)this_shn->seek_header.data,1,SEEK_HEADER_SIZE,f) == SEEK_HEADER_SIZE)
+	if (aud_vfs_fread((void *)this_shn->seek_header.data,1,SEEK_HEADER_SIZE,f) == SEEK_HEADER_SIZE)
 	{
 		this_shn->seek_header.version = (slong)shn_uchar_to_ulong_le(this_shn->seek_header.data+4);
 		this_shn->seek_header.shnFileSize = shn_uchar_to_ulong_le(this_shn->seek_header.data+8);
@@ -76,7 +76,7 @@
 
 			if ((this_shn->seek_table = malloc(seek_table_len)))
 			{
-				if (vfs_fread((void *)this_shn->seek_table,1,seek_table_len,f) == seek_table_len)
+				if (aud_vfs_fread((void *)this_shn->seek_table,1,seek_table_len,f) == seek_table_len)
 				{
 					shn_debug("Successfully loaded seek table in separate file: '%s'",filename);
 
@@ -87,7 +87,7 @@
 					else
 						this_shn->vars.seek_resolution = SEEK_RESOLUTION;
 
-					vfs_fclose(f);
+					aud_vfs_fclose(f);
 
 					return 1;
 				}
@@ -95,7 +95,7 @@
 		}
 	}
 
-	vfs_fclose(f);
+	aud_vfs_fclose(f);
 	return 0;
 }
 
@@ -114,21 +114,21 @@
 			break;
 	}
 
-	vfs_fseek(this_shn->vars.fd,-(SEEK_TRAILER_SIZE+bytes_from_end),SEEK_END);
-	if (vfs_fread((void *)this_shn->seek_trailer.data,1,SEEK_TRAILER_SIZE,this_shn->vars.fd) == SEEK_TRAILER_SIZE)
+	aud_vfs_fseek(this_shn->vars.fd,-(SEEK_TRAILER_SIZE+bytes_from_end),SEEK_END);
+	if (aud_vfs_fread((void *)this_shn->seek_trailer.data,1,SEEK_TRAILER_SIZE,this_shn->vars.fd) == SEEK_TRAILER_SIZE)
 	{
 		this_shn->seek_trailer.seekTableSize = shn_uchar_to_ulong_le(this_shn->seek_trailer.data);
 		if (memcmp(this_shn->seek_trailer.data+4,SEEK_TRAILER_SIGNATURE,strlen(SEEK_TRAILER_SIGNATURE)) == 0)
 		{
-			vfs_fseek(this_shn->vars.fd,-(this_shn->seek_trailer.seekTableSize+bytes_from_end),SEEK_END);
+			aud_vfs_fseek(this_shn->vars.fd,-(this_shn->seek_trailer.seekTableSize+bytes_from_end),SEEK_END);
 			this_shn->seek_trailer.seekTableSize -= (SEEK_HEADER_SIZE + SEEK_TRAILER_SIZE);
-			if (vfs_fread((void *)this_shn->seek_header.data,1,SEEK_HEADER_SIZE,this_shn->vars.fd) == SEEK_HEADER_SIZE)
+			if (aud_vfs_fread((void *)this_shn->seek_header.data,1,SEEK_HEADER_SIZE,this_shn->vars.fd) == SEEK_HEADER_SIZE)
 			{
 				this_shn->seek_header.version = (slong)shn_uchar_to_ulong_le(this_shn->seek_header.data+4);
 				this_shn->seek_header.shnFileSize = shn_uchar_to_ulong_le(this_shn->seek_header.data+8);
 				if ((this_shn->seek_table = malloc(this_shn->seek_trailer.seekTableSize)))
 				{
-					if (vfs_fread((void *)this_shn->seek_table,1,this_shn->seek_trailer.seekTableSize,this_shn->vars.fd) == this_shn->seek_trailer.seekTableSize)
+					if (aud_vfs_fread((void *)this_shn->seek_table,1,this_shn->seek_trailer.seekTableSize,this_shn->vars.fd) == this_shn->seek_trailer.seekTableSize)
 					{
 						shn_debug("Successfully loaded seek table appended to file: '%s'",filename);
 
--- a/src/shnplug/shn.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/shnplug/shn.c	Sat Oct 13 21:53:47 2007 +0300
@@ -223,7 +223,7 @@
       version = MAX_VERSION + 1;
       while(version > MAX_VERSION)
       {
-        int byte = vfs_getc(this_shn->vars.fd);
+        int byte = aud_vfs_getc(this_shn->vars.fd);
         this_shn->vars.bytes_read++;
         if(byte == EOF)
           return 0;
@@ -553,7 +553,7 @@
 	{
 		if (this_shn->vars.fd)
 		{
-			vfs_fclose(this_shn->vars.fd);
+			aud_vfs_fclose(this_shn->vars.fd);
 			this_shn->vars.fd = NULL;
 		}
 
@@ -671,13 +671,13 @@
 
 	if (tmp_file->wave_header.file_has_id3v2_tag)
 	{
-		vfs_fseek(tmp_file->vars.fd,tmp_file->wave_header.id3v2_tag_size,SEEK_SET);
+		aud_vfs_fseek(tmp_file->vars.fd,tmp_file->wave_header.id3v2_tag_size,SEEK_SET);
 		tmp_file->vars.bytes_read += tmp_file->wave_header.id3v2_tag_size;
 		tmp_file->vars.seek_offset = tmp_file->wave_header.id3v2_tag_size;
 	}
     else
 	{
-		vfs_fseek(tmp_file->vars.fd,0,SEEK_SET);
+		aud_vfs_fseek(tmp_file->vars.fd,0,SEEK_SET);
 	}
 
 	if (0 == shn_verify_header(tmp_file))
@@ -747,7 +747,7 @@
 {
 	char data[4];
 
-	if (vfs_fread((void *)data,1,4,fd) != 4)
+	if (aud_vfs_fread((void *)data,1,4,fd) != 4)
 		return FALSE;
 
 	if (memcmp(data,MAGIC,4))
@@ -865,7 +865,7 @@
       version = MAX_VERSION + 1;
       while(version > MAX_VERSION)
       {
-  	int byte = vfs_getc(this_shn->vars.fd);
+  	int byte = aud_vfs_getc(this_shn->vars.fd);
  	if(byte == EOF) {
 	  shn_error_fatal(this_shn,"No magic number");
           goto exit_thread;
@@ -1142,8 +1142,8 @@
 
                 seekto_offset = shn_uchar_to_ulong_le(seek_info->data+8) + this_shn->vars.seek_offset;
 
-                vfs_fseek(this_shn->vars.fd,(slong)seekto_offset,SEEK_SET);
-                vfs_fread((uchar*) this_shn->decode_state->getbuf, 1, BUFSIZ, this_shn->vars.fd);
+                aud_vfs_fseek(this_shn->vars.fd,(slong)seekto_offset,SEEK_SET);
+                aud_vfs_fread((uchar*) this_shn->decode_state->getbuf, 1, BUFSIZ, this_shn->vars.fd);
 
                 this_shn->decode_state->getbufp = this_shn->decode_state->getbuf + shn_uchar_to_ushort_le(seek_info->data+14);
                 this_shn->decode_state->nbitget = shn_uchar_to_ushort_le(seek_info->data+16);
@@ -1183,7 +1183,7 @@
                 if(maxnlpc > 0 && qlpc)
                   free((void *) qlpc);
 
-                vfs_fseek(this_shn->vars.fd,0,SEEK_SET);
+                aud_vfs_fseek(this_shn->vars.fd,0,SEEK_SET);
                 goto restart;
               }
               else
@@ -1261,7 +1261,7 @@
 		return;
 	}
 
-	vfs_fseek(shnfile->vars.fd,0,SEEK_SET);
+	aud_vfs_fseek(shnfile->vars.fd,0,SEEK_SET);
 
 	playback->playing = TRUE;
 
--- a/src/shnplug/shorten.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/shnplug/shorten.h	Sat Oct 13 21:53:47 2007 +0300
@@ -166,7 +166,7 @@
 
 extern int getc_exit_val;
 #define getc_exit(stream)\
-(((getc_exit_val = vfs_getc(stream)) == EOF) ? \
+(((getc_exit_val = aud_vfs_getc(stream)) == EOF) ? \
   complain("FATALERROR: read failed: getc returns EOF"), 0: getc_exit_val)
 
 /************************/
--- a/src/shnplug/vario.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/shnplug/vario.c	Sat Oct 13 21:53:47 2007 +0300
@@ -50,7 +50,7 @@
   {
     this_shn->vars.last_file_position = this_shn->vars.bytes_read;
 
-    bytes = vfs_fread((uchar*) this_shn->decode_state->getbuf, 1, BUFSIZ, this_shn->vars.fd);
+    bytes = aud_vfs_fread((uchar*) this_shn->decode_state->getbuf, 1, BUFSIZ, this_shn->vars.fd);
     this_shn->decode_state->nbyteget += bytes;
 
     if(this_shn->decode_state->nbyteget < 4) {
--- a/src/sid/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sid/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = sid${PLUGIN_SUFFIX}
+
 SRCS = xs_init.c	\
        xs_about.c	\
        xs_support.c	\
@@ -17,12 +18,12 @@
        xs_slsup.c	\
        xmms-sid.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.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}
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
 CXXFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} -D_REENTRANT -I../../intl -I../.. -DAUDACIOUS_PLUGIN ${MOWGLI_CFLAGS} ${SIDPLAY1_INCLUDES} ${SIDPLAY2_INCLUDES} ${BUILDERS_INCLUDES} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS}
 LIBS += ${BUILDERS_LDFLAGS} ${SIDPLAY1_LDADD} ${SIDPLAY2_LDADD} ${RESID_LDADD} ${HARDSID_LDADD} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -lstdc++
--- a/src/sid/xmms-sid.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sid/xmms-sid.c	Sat Oct 13 21:53:47 2007 +0300
@@ -87,7 +87,7 @@
 XS_MUTEX(xs_status);
 static XS_THREAD_T xs_decode_thread;
 
-void xs_get_song_tuple_info(Tuple *pResult, t_xs_tuneinfo *pInfo, gint subTune);
+void xs_get_song_aud_tuple_info(Tuple *pResult, t_xs_tuneinfo *pInfo, gint subTune);
 
 /*
  * Error messages
@@ -395,15 +395,15 @@
 	XSDEBUG("foobar #1\n");
 	xs_status.sidPlayer->plrUpdateSIDInfo(&xs_status);
 	XS_MUTEX_UNLOCK(xs_status);
-	tmpTuple = tuple_new_from_filename(tmpTune->sidFilename);
-	xs_get_song_tuple_info(tmpTuple, tmpTune, xs_status.currSong);
+	tmpTuple = aud_tuple_new_from_filename(tmpTune->sidFilename);
+	xs_get_song_aud_tuple_info(tmpTuple, tmpTune, xs_status.currSong);
 
-	tmpTitle = tuple_formatter_process_string(tmpTuple,
+	tmpTitle = aud_tuple_formatter_process_string(tmpTuple,
 		xs_cfg.titleOverride ? xs_cfg.titleFormat : get_gentitle_format());
 	
 	XSDEBUG("foobar #4\n");
 	XS_MUTEX_LOCK(xs_status);
-	xs_plugin_ip.set_info(
+	pb->set_params(pb,
 		tmpTitle,
 		(tmpLength > 0) ? (tmpLength * 1000) : 0,
 		-1,
@@ -440,8 +440,7 @@
 		}
 
 		/* I <3 visualice/haujobb */
-		produce_audio(pb->output->written_time(),
-			xs_status.audioFormat, xs_status.audioChannels,
+		pb->pass_audio(pb, xs_status.audioFormat, xs_status.audioChannels,
 			audioGot, audioBuffer, NULL);
 		
 		XS_MUTEX_UNLOCK(xs_status);
@@ -592,20 +591,20 @@
 /*
  * Return song information Tuple
  */
-void xs_get_song_tuple_info(Tuple *pResult, t_xs_tuneinfo *pInfo, gint subTune)
+void xs_get_song_aud_tuple_info(Tuple *pResult, t_xs_tuneinfo *pInfo, gint subTune)
 {
 	gchar *tmpStr, tmpStr2[64];
 
-	tuple_associate_string(pResult, FIELD_TITLE, NULL, pInfo->sidName);
-	tuple_associate_string(pResult, FIELD_ARTIST, NULL, pInfo->sidComposer);
-	tuple_associate_string(pResult, FIELD_GENRE, NULL, "SID-tune");
-	tuple_associate_string(pResult, FIELD_COPYRIGHT, NULL, pInfo->sidCopyright);
+	aud_tuple_associate_string(pResult, FIELD_TITLE, NULL, pInfo->sidName);
+	aud_tuple_associate_string(pResult, FIELD_ARTIST, NULL, pInfo->sidComposer);
+	aud_tuple_associate_string(pResult, FIELD_GENRE, NULL, "SID-tune");
+	aud_tuple_associate_string(pResult, FIELD_COPYRIGHT, NULL, pInfo->sidCopyright);
 
 	if (xs_cfg.subAutoEnable)
-		tuple_associate_int(pResult, FIELD_SUBSONG_NUM, NULL, pInfo->nsubTunes);
+		aud_tuple_associate_int(pResult, FIELD_SUBSONG_NUM, NULL, pInfo->nsubTunes);
 
-	tuple_associate_int(pResult, -1, "subtunes", pInfo->nsubTunes);
-	tuple_associate_string(pResult, -1, "sid-format", pInfo->sidFormat);
+	aud_tuple_associate_int(pResult, -1, "subtunes", pInfo->nsubTunes);
+	aud_tuple_associate_string(pResult, -1, "sid-format", pInfo->sidFormat);
 
 	switch (pInfo->sidModel) {
 		case XS_SIDMODEL_6581: tmpStr = "6581"; break;
@@ -613,7 +612,7 @@
 		case XS_SIDMODEL_ANY: tmpStr = "ANY"; break;
 		default: tmpStr = "?"; break;
 	}
-	tuple_associate_string(pResult, -1, "sid-model", tmpStr);
+	aud_tuple_associate_string(pResult, -1, "sid-model", tmpStr);
 	
 	/* Get sub-tune information, if available */
 	if (subTune < 0 || pInfo->startTune > pInfo->nsubTunes)
@@ -621,7 +620,7 @@
 	
 	if ((subTune > 0) && (subTune <= pInfo->nsubTunes)) {
 		gint tmpInt = pInfo->subTunes[subTune - 1].tuneLength;
-		tuple_associate_int(pResult, FIELD_LENGTH, NULL, (tmpInt < 0) ? -1 : tmpInt * 1000);
+		aud_tuple_associate_int(pResult, FIELD_LENGTH, NULL, (tmpInt < 0) ? -1 : tmpInt * 1000);
 		
 		tmpInt = pInfo->subTunes[subTune - 1].tuneSpeed;
 		if (tmpInt > 0) {
@@ -639,16 +638,16 @@
 		} else
 			tmpStr = "?";
 
-		tuple_associate_string(pResult, -1, "sid-speed", tmpStr);
+		aud_tuple_associate_string(pResult, -1, "sid-speed", tmpStr);
 	} else
 		subTune = 1;
 
-	tuple_associate_int(pResult, -1, "subtune", subTune);
-	tuple_associate_int(pResult, FIELD_SUBSONG_ID, NULL, subTune);
-	tuple_associate_int(pResult, FIELD_TRACK_NUMBER, NULL, subTune);
+	aud_tuple_associate_int(pResult, -1, "subtune", subTune);
+	aud_tuple_associate_int(pResult, FIELD_SUBSONG_ID, NULL, subTune);
+	aud_tuple_associate_int(pResult, FIELD_TRACK_NUMBER, NULL, subTune);
 
 	if (xs_cfg.titleOverride)
-		tuple_associate_string(pResult, FIELD_FORMATTER, NULL, xs_cfg.titleFormat);
+		aud_tuple_associate_string(pResult, FIELD_FORMATTER, NULL, xs_cfg.titleFormat);
 }
 
 
@@ -662,7 +661,7 @@
 	/* Get information from URL */
 	xs_get_trackinfo(songFilename, &tmpFilename, &tmpTune);
 
-	tmpResult = tuple_new_from_filename(tmpFilename);
+	tmpResult = aud_tuple_new_from_filename(tmpFilename);
 	if (!tmpResult) {
 		g_free(tmpFilename);
 		return NULL;
@@ -677,7 +676,7 @@
 	if (!tmpInfo)
 		return tmpResult;
 	
-	xs_get_song_tuple_info(tmpResult, tmpInfo, tmpTune);
+	xs_get_song_aud_tuple_info(tmpResult, tmpInfo, tmpTune);
 	xs_tuneinfo_free(tmpInfo);
 
 	return tmpResult;
@@ -707,7 +706,7 @@
 	/* Get information from URL */
 	xs_get_trackinfo(songFilename, &tmpFilename, &tmpTune);
 
-	tmpResult = tuple_new_from_filename(tmpFilename);
+	tmpResult = aud_tuple_new_from_filename(tmpFilename);
 	if (!tmpResult) {
 		g_free(tmpFilename);
 		return NULL;
@@ -722,7 +721,7 @@
 	if (!tmpInfo)
 		return tmpResult;
 	
-	xs_get_song_tuple_info(tmpResult, tmpInfo, tmpTune);
+	xs_get_song_aud_tuple_info(tmpResult, tmpInfo, tmpTune);
 	xs_tuneinfo_free(tmpInfo);
 
 	return tmpResult;
--- a/src/sid/xs_config.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sid/xs_config.c	Sat Oct 13 21:53:47 2007 +0300
@@ -356,7 +356,7 @@
 		return pResult;
 }
 
-
+#if 0
 static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, t_xs_sid2_filter *pFilter, gint nFilter)
 {
 	gchar *tmpValue, tmpKey[64];
@@ -387,7 +387,7 @@
 	g_free(tmpValue);
 	return TRUE;
 }
-
+#endif
 
 /* Filter exporting and importing. These functions export/import
  * filter settings to/from SIDPlay2 INI-type files.
--- a/src/sid/xs_support.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sid/xs_support.h	Sat Oct 13 21:53:47 2007 +0300
@@ -70,14 +70,14 @@
 #ifdef __AUDACIOUS_NEWVFS__
 #include <audacious/vfs.h>
 #define t_xs_file VFSFile
-#define xs_fopen(a,b) vfs_fopen(a,b)
-#define xs_fclose(a) vfs_fclose(a)
-#define xs_fgetc(a) vfs_getc(a)
-#define xs_fread(a,b,c,d) vfs_fread(a,b,c,d)
-#define xs_feof(a) vfs_feof(a)
+#define xs_fopen(a,b) aud_vfs_fopen(a,b)
+#define xs_fclose(a) aud_vfs_fclose(a)
+#define xs_fgetc(a) aud_vfs_getc(a)
+#define xs_fread(a,b,c,d) aud_vfs_fread(a,b,c,d)
+#define xs_feof(a) aud_vfs_feof(a)
 #define xs_ferror(a) (0)
-#define xs_ftell(a) vfs_ftell(a)
-#define xs_fseek(a,b,c) vfs_fseek(a,b,c)
+#define xs_ftell(a) aud_vfs_ftell(a)
+#define xs_fseek(a,b,c) aud_vfs_fseek(a,b,c)
 #else
 #define t_xs_file FILE
 t_xs_file *xs_fopen(const gchar *, const gchar *);
--- a/src/smb/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/smb/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = smb${PLUGIN_SUFFIX}
+
 SRCS = smb.c
 
-plugindir = audacious/${TRANSPORT_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} -I../../intl -I../..
+plugindir := ${plugindir}/${TRANSPORT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS} -lsmbclient
--- a/src/smb/smb.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/smb/smb.c	Sat Oct 13 21:53:47 2007 +0300
@@ -41,7 +41,7 @@
 } SMBFile;
 
 /* TODO: make writing work. */
-VFSFile *smb_vfs_fopen_impl(const gchar * path, const gchar * mode)
+VFSFile *smb_aud_vfs_fopen_impl(const gchar * path, const gchar * mode)
 {
   VFSFile *file;
   SMBFile *handle;
@@ -66,7 +66,7 @@
   return file;
 }
 
-gint smb_vfs_fclose_impl(VFSFile * file)
+gint smb_aud_vfs_fclose_impl(VFSFile * file)
 {
   gint ret = 0;
   SMBFile *handle;
@@ -85,7 +85,7 @@
   return ret;
 }
 
-size_t smb_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file)
+size_t smb_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file)
 {
   SMBFile *handle;
   if (file == NULL)
@@ -94,12 +94,12 @@
   return smbc_read(handle->fd, ptr, size * nmemb);
 }
 
-size_t smb_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file)
+size_t smb_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file)
 {
   return 0;
 }
 
-gint smb_vfs_getc_impl(VFSFile *file)
+gint smb_aud_vfs_getc_impl(VFSFile *file)
 {
   SMBFile *handle;
   char temp;
@@ -108,7 +108,7 @@
   return (gint) temp;
 }
 
-gint smb_vfs_fseek_impl(VFSFile * file, glong offset, gint whence)
+gint smb_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence)
 {
   SMBFile *handle;
   glong roffset = offset;
@@ -138,19 +138,19 @@
   return ret;
 }
 
-gint smb_vfs_ungetc_impl(gint c, VFSFile *file)
+gint smb_aud_vfs_ungetc_impl(gint c, VFSFile *file)
 {
-  smb_vfs_fseek_impl(file, -1, SEEK_CUR);
+  smb_aud_vfs_fseek_impl(file, -1, SEEK_CUR);
   return c;
 }
 
-void smb_vfs_rewind_impl(VFSFile * file)
+void smb_aud_vfs_rewind_impl(VFSFile * file)
 {
-  smb_vfs_fseek_impl(file, 0, SEEK_SET);
+  smb_aud_vfs_fseek_impl(file, 0, SEEK_SET);
 }
 
 glong
-smb_vfs_ftell_impl(VFSFile * file)
+smb_aud_vfs_ftell_impl(VFSFile * file)
 {
   SMBFile *handle;
   handle = (SMBFile *)file->handle;
@@ -158,25 +158,25 @@
 }
 
 gboolean
-smb_vfs_feof_impl(VFSFile * file)
+smb_aud_vfs_feof_impl(VFSFile * file)
 {
   SMBFile *handle;
   off_t at;
 
-  at = smb_vfs_ftell_impl(file);
+  at = smb_aud_vfs_ftell_impl(file);
 
   //printf("%d %d %ld %ld\n",sizeof(int), sizeof(off_t), at, handle->length);
   return (gboolean) (at == handle->length) ? TRUE : FALSE;
 }
 
 gint
-smb_vfs_truncate_impl(VFSFile * file, glong size)
+smb_aud_vfs_truncate_impl(VFSFile * file, glong size)
 {
   return -1;
 }
 
 off_t
-smb_vfs_fsize_impl(VFSFile * file)
+smb_aud_vfs_fsize_impl(VFSFile * file)
 {
     SMBFile *handle = (SMBFile *)file->handle;
 
@@ -185,18 +185,18 @@
 
 VFSConstructor smb_const = {
 	"smb://",
-	smb_vfs_fopen_impl,
-	smb_vfs_fclose_impl,
-	smb_vfs_fread_impl,
-	smb_vfs_fwrite_impl,
-	smb_vfs_getc_impl,
-	smb_vfs_ungetc_impl,
-	smb_vfs_fseek_impl,
-	smb_vfs_rewind_impl,
-	smb_vfs_ftell_impl,
-	smb_vfs_feof_impl,
-	smb_vfs_truncate_impl,
-	smb_vfs_fsize_impl
+	smb_aud_vfs_fopen_impl,
+	smb_aud_vfs_fclose_impl,
+	smb_aud_vfs_fread_impl,
+	smb_aud_vfs_fwrite_impl,
+	smb_aud_vfs_getc_impl,
+	smb_aud_vfs_ungetc_impl,
+	smb_aud_vfs_fseek_impl,
+	smb_aud_vfs_rewind_impl,
+	smb_aud_vfs_ftell_impl,
+	smb_aud_vfs_feof_impl,
+	smb_aud_vfs_truncate_impl,
+	smb_aud_vfs_fsize_impl
 };
 
 static void init(void)
@@ -210,13 +210,13 @@
 		return;
 	}
 
-	vfs_register_transport(&smb_const);
+	aud_vfs_register_transport(&smb_const);
 }
 
 static void cleanup(void)
 {
 #if 0
-	vfs_unregister_transport(&smb_const);
+	aud_vfs_unregister_transport(&smb_const);
 #endif
 }
 
--- a/src/sndstretch/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sndstretch/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,10 +1,12 @@
 PLUGIN = sndstretch${PLUGIN_SUFFIX}
-SRCS = sndstretch_xmms.c sndstretch.c
 
-plugindir = audacious/${EFFECT_PLUGIN_DIR}
+SRCS = sndstretch_xmms.c \
+       sndstretch.c
 
 include ../../buildsys.mk
 include ../../extra.mk
 
+plugindir := ${plugindir}/${EFFECT_PLUGIN_DIR}
+
+CFLAGS += ${PLUGIN_CFLAGS}
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${MOWGLI_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
-CFLAGS += ${PLUGIN_CFLAGS}
--- a/src/song_change/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/song_change/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = song_change${PLUGIN_SUFFIX}
+
 SRCS = song_change.c
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/spectrum/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/spectrum/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = spectrum${PLUGIN_SUFFIX}
+
 SRCS = spectrum.c
 
-plugindir = audacious/${VISUALIZATION_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${VISUALIZATION_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/statusicon/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/statusicon/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,14 +1,15 @@
 PLUGIN = statusicon${PLUGIN_SUFFIX}
+
 SRCS = gtktrayicon-x11.c	\
        si.c			\
        si_cfg.c			\
        si_ui.c
 
-plugindir = audacious/${GENERAL_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${BEEP_DEFINES} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/statusicon/si_cfg.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/statusicon/si_cfg.c	Sat Oct 13 21:53:47 2007 +0300
@@ -20,6 +20,7 @@
 
 #include "si_cfg.h"
 #include "si_common.h"
+#include <audacious/plugin.h>
 #include <audacious/configdb.h>
 
 si_cfg_t si_cfg;
--- a/src/statusicon/si_ui.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/statusicon/si_ui.c	Sat Oct 13 21:53:47 2007 +0300
@@ -150,7 +150,7 @@
     GtkWidget *popup = g_object_get_data( G_OBJECT(evbox) , "popup" );
 
     tuple = playlist_get_tuple( pl_active , pos );
-    if ( ( tuple == NULL ) || ( tuple_get_int(tuple, FIELD_LENGTH, NULL) < 1 ) )
+    if ( ( tuple == NULL ) || ( aud_tuple_get_int(tuple, FIELD_LENGTH, NULL) < 1 ) )
     {
       gchar *title = playlist_get_songtitle( pl_active , pos );
       audacious_fileinfopopup_show_from_title( popup , title );
--- a/src/stdio/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/stdio/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = stdio${PLUGIN_SUFFIX}
+
 SRCS = stdio.c
 
-plugindir = audacious/${TRANSPORT_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} -I../../intl -I../..
+plugindir := ${plugindir}/${TRANSPORT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS}
--- a/src/stdio/stdio.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/stdio/stdio.c	Sat Oct 13 21:53:47 2007 +0300
@@ -28,7 +28,7 @@
 #include <string.h>
 
 static gchar *
-vfs_stdio_urldecode_path(const gchar * encoded_path)
+aud_vfs_stdio_urldecode_path(const gchar * encoded_path)
 {
     const gchar *cur, *ext;
     gchar *path, *tmp;
@@ -71,7 +71,7 @@
 }
 
 VFSFile *
-stdio_vfs_fopen_impl(const gchar * path,
+stdio_aud_vfs_fopen_impl(const gchar * path,
           const gchar * mode)
 {
     VFSFile *file;
@@ -80,7 +80,7 @@
     if (!path || !mode)
 	return NULL;
 
-    decpath = vfs_stdio_urldecode_path(path);
+    decpath = aud_vfs_stdio_urldecode_path(path);
 
     file = g_new(VFSFile, 1);
 
@@ -98,7 +98,7 @@
 }
 
 gint
-stdio_vfs_fclose_impl(VFSFile * file)
+stdio_aud_vfs_fclose_impl(VFSFile * file)
 {
     gint ret = 0;
 
@@ -118,7 +118,7 @@
 }
 
 size_t
-stdio_vfs_fread_impl(gpointer ptr,
+stdio_aud_vfs_fread_impl(gpointer ptr,
           size_t size,
           size_t nmemb,
           VFSFile * file)
@@ -134,7 +134,7 @@
 }
 
 size_t
-stdio_vfs_fwrite_impl(gconstpointer ptr,
+stdio_aud_vfs_fwrite_impl(gconstpointer ptr,
            size_t size,
            size_t nmemb,
            VFSFile * file)
@@ -150,7 +150,7 @@
 }
 
 gint
-stdio_vfs_getc_impl(VFSFile *stream)
+stdio_aud_vfs_getc_impl(VFSFile *stream)
 {
   FILE *handle = (FILE *) stream->handle;
 
@@ -158,7 +158,7 @@
 }
 
 gint
-stdio_vfs_ungetc_impl(gint c, VFSFile *stream)
+stdio_aud_vfs_ungetc_impl(gint c, VFSFile *stream)
 {
   FILE *handle = (FILE *) stream->handle;
 
@@ -166,7 +166,7 @@
 }
 
 gint
-stdio_vfs_fseek_impl(VFSFile * file,
+stdio_aud_vfs_fseek_impl(VFSFile * file,
           glong offset,
           gint whence)
 {
@@ -181,7 +181,7 @@
 }
 
 void
-stdio_vfs_rewind_impl(VFSFile * file)
+stdio_aud_vfs_rewind_impl(VFSFile * file)
 {
     FILE *handle;
 
@@ -194,7 +194,7 @@
 }
 
 glong
-stdio_vfs_ftell_impl(VFSFile * file)
+stdio_aud_vfs_ftell_impl(VFSFile * file)
 {
     FILE *handle;
 
@@ -207,7 +207,7 @@
 }
 
 gboolean
-stdio_vfs_feof_impl(VFSFile * file)
+stdio_aud_vfs_feof_impl(VFSFile * file)
 {
     FILE *handle;
 
@@ -220,7 +220,7 @@
 }
 
 gint
-stdio_vfs_truncate_impl(VFSFile * file, glong size)
+stdio_aud_vfs_truncate_impl(VFSFile * file, glong size)
 {
     FILE *handle;
 
@@ -233,7 +233,7 @@
 }
 
 off_t
-stdio_vfs_fsize_impl(VFSFile * file)
+stdio_aud_vfs_fsize_impl(VFSFile * file)
 {
     FILE *handle;
     struct stat s;
@@ -251,29 +251,29 @@
 
 VFSConstructor file_const = {
 	.uri_id = "file://",
-	.vfs_fopen_impl = stdio_vfs_fopen_impl,
-	.vfs_fclose_impl = stdio_vfs_fclose_impl,
-	.vfs_fread_impl = stdio_vfs_fread_impl,
-	.vfs_fwrite_impl = stdio_vfs_fwrite_impl,
-	.vfs_getc_impl = stdio_vfs_getc_impl,
-	.vfs_ungetc_impl = stdio_vfs_ungetc_impl,
-	.vfs_fseek_impl = stdio_vfs_fseek_impl,
-	.vfs_rewind_impl = stdio_vfs_rewind_impl,
-	.vfs_ftell_impl = stdio_vfs_ftell_impl,
-	.vfs_feof_impl = stdio_vfs_feof_impl,
-	.vfs_truncate_impl = stdio_vfs_truncate_impl,
-	.vfs_fsize_impl = stdio_vfs_fsize_impl
+	.vfs_fopen_impl = stdio_aud_vfs_fopen_impl,
+	.vfs_fclose_impl = stdio_aud_vfs_fclose_impl,
+	.vfs_fread_impl = stdio_aud_vfs_fread_impl,
+	.vfs_fwrite_impl = stdio_aud_vfs_fwrite_impl,
+	.vfs_getc_impl = stdio_aud_vfs_getc_impl,
+	.vfs_ungetc_impl = stdio_aud_vfs_ungetc_impl,
+	.vfs_fseek_impl = stdio_aud_vfs_fseek_impl,
+	.vfs_rewind_impl = stdio_aud_vfs_rewind_impl,
+	.vfs_ftell_impl = stdio_aud_vfs_ftell_impl,
+	.vfs_feof_impl = stdio_aud_vfs_feof_impl,
+	.vfs_truncate_impl = stdio_aud_vfs_truncate_impl,
+	.vfs_fsize_impl = stdio_aud_vfs_fsize_impl
 };
 
 static void init(void)
 {
-	vfs_register_transport(&file_const);
+	aud_vfs_register_transport(&file_const);
 }
 
 static void cleanup(void)
 {
 #if 0
-	vfs_unregister_transport(&file_const);
+	aud_vfs_unregister_transport(&file_const);
 #endif
 }
 
--- a/src/stereo_plugin/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/stereo_plugin/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = stereo${PLUGIN_SUFFIX}
+
 SRCS = stereo.c
 
-plugindir = audacious/${EFFECT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${EFFECT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/sun/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/sun/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,3 +1,5 @@
+PLUGIN = sun${PLUGIN_SUFFIX}
+
 SRCS =	sun.c	    \
 	audio.c	    \
 	convert.c   \
@@ -5,13 +7,11 @@
 	configure.c \
 	about.c
 
-PLUGIN = sun$(PLUGIN_SUFFIX)
-plugindir = audacious/$(OUTPUT_PLUGIN_DIR)
-
 include ../../buildsys.mk
 include ../../extra.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)
+plugindir := ${plugindir}/${OUTPUT_PLUGIN_DIR}
 
+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	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/timidity/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = timidity${PLUGIN_SUFFIX}
+
 SRCS = callbacks.c			\
        interface.c			\
        xmms-timidity.c			\
@@ -14,11 +15,11 @@
        libtimidity/tables.c		\
        libtimidity/timidity.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 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}
--- a/src/timidity/libtimidity/common.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/timidity/libtimidity/common.c	Sat Oct 13 21:53:47 2007 +0300
@@ -51,7 +51,7 @@
   /* First try the given name */
 
   DEBUG_MSG("Trying to open %s\n", name);
-  if ((fp = vfs_fopen(g_filename_to_uri(name, NULL, NULL), OPEN_MODE)))
+  if ((fp = aud_vfs_fopen(g_filename_to_uri(name, NULL, NULL), OPEN_MODE)))
     return fp;
 
   if (name[0] != PATH_SEP)
@@ -75,7 +75,7 @@
 	  }
 	strcat(current_filename, name);
 	DEBUG_MSG("Trying to open %s\n", current_filename);
-	if ((fp = vfs_fopen(g_filename_to_uri(current_filename, NULL, NULL), OPEN_MODE)))
+	if ((fp = aud_vfs_fopen(g_filename_to_uri(current_filename, NULL, NULL), OPEN_MODE)))
 	  return fp;
 	plp = plp->next;
       }
--- a/src/timidity/libtimidity/instrum.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/timidity/libtimidity/instrum.c	Sat Oct 13 21:53:47 2007 +0300
@@ -202,7 +202,7 @@
   /* Read some headers and do cursory sanity checks. There are loads
      of magic offsets. This could be rewritten... */
 
-  if ((239 != vfs_fread(tmp, 1, 239, fp)) ||
+  if ((239 != aud_vfs_fread(tmp, 1, 239, fp)) ||
       (memcmp(tmp, "GF1PATCH110\0ID#000002", 22) &&
        memcmp(tmp, "GF1PATCH100\0ID#000002", 22))) /* don't know what the
 						      differences are */
@@ -236,18 +236,18 @@
       uint8 tmpchar;
 
 #define READ_CHAR(thing) \
-      if (1 != vfs_fread(&tmpchar, 1, 1, fp)) goto fail; \
+      if (1 != aud_vfs_fread(&tmpchar, 1, 1, fp)) goto fail; \
       thing = tmpchar;
 #define READ_SHORT(thing) \
-      if (1 != vfs_fread(&tmpshort, 2, 1, fp)) goto fail; \
+      if (1 != aud_vfs_fread(&tmpshort, 2, 1, fp)) goto fail; \
       thing = SWAPLE16(tmpshort);
 #define READ_LONG(thing) \
-      if (1 != vfs_fread(&tmplong, 4, 1, fp)) goto fail; \
+      if (1 != aud_vfs_fread(&tmplong, 4, 1, fp)) goto fail; \
       thing = SWAPLE32(tmplong);
 
-      vfs_fseek(fp, 7, SEEK_CUR); /* Skip the wave name */
+      aud_vfs_fseek(fp, 7, SEEK_CUR); /* Skip the wave name */
 
-      if (1 != vfs_fread(&fractions, 1, 1, fp))
+      if (1 != aud_vfs_fread(&fractions, 1, 1, fp))
 	{
 	fail:
 	  DEBUG_MSG("Error reading sample %d\n", i);
@@ -269,7 +269,7 @@
       READ_LONG(sp->root_freq);
       sp->low_vel = 0;
       sp->high_vel = 127;
-      vfs_fseek(fp, 2, SEEK_CUR); /* Why have a "root frequency" and then
+      aud_vfs_fseek(fp, 2, SEEK_CUR); /* Why have a "root frequency" and then
 				    * "tuning"?? */
       
       READ_CHAR(tmp[0]);
@@ -280,7 +280,7 @@
 	sp->panning=(uint8)(panning & 0x7F);
 
       /* envelope, tremolo, and vibrato */
-      if (18 != vfs_fread(tmp, 1, 18, fp)) goto fail; 
+      if (18 != aud_vfs_fread(tmp, 1, 18, fp)) goto fail; 
 
       if (!tmp[13] || !tmp[14])
 	{
@@ -318,7 +318,7 @@
 
       READ_CHAR(sp->modes);
 
-      vfs_fseek(fp, 40, SEEK_CUR); /* skip the useless scale frequency, scale
+      aud_vfs_fseek(fp, 40, SEEK_CUR); /* skip the useless scale frequency, scale
 				       factor (what's it mean?), and reserved
 				       space */
 
@@ -392,7 +392,7 @@
 
       /* Then read the sample data */
       sp->data = safe_malloc(sp->data_length);
-      if (1 != vfs_fread(sp->data, sp->data_length, 1, fp))
+      if (1 != aud_vfs_fread(sp->data, sp->data_length, 1, fp))
 	goto fail;
       
       if (!(sp->modes & MODES_16BIT)) /* convert to 16-bit data */
@@ -507,7 +507,7 @@
 	}
     }
 
-  vfs_fclose(fp);
+  aud_vfs_fclose(fp);
   return ip;
 }
 
--- a/src/timidity/libtimidity/stream.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/timidity/libtimidity/stream.c	Sat Oct 13 21:53:47 2007 +0300
@@ -22,7 +22,7 @@
 size_t
 stdio_istream_read (void *ctx, void *ptr, size_t size, size_t nmemb)
 {
-  return vfs_fread (ptr, size, nmemb, ((StdIOContext *) ctx)->fp);
+  return aud_vfs_fread (ptr, size, nmemb, ((StdIOContext *) ctx)->fp);
 }
 
 int
@@ -30,7 +30,7 @@
 {
   int ret = 0;
   if (((StdIOContext *) ctx)->autoclose)
-    ret = vfs_fclose (((StdIOContext *) ctx)->fp);
+    ret = aud_vfs_fclose (((StdIOContext *) ctx)->fp);
   free (ctx);
   return ret;
 }
@@ -101,7 +101,7 @@
 {
   VFSFile *fp;
 
-  fp = vfs_fopen (file, "rb");
+  fp = aud_vfs_fopen (file, "rb");
   if (fp == NULL)
     return NULL;
 
--- a/src/timidity/libtimidity/timidity.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/timidity/libtimidity/timidity.c	Sat Oct 13 21:53:47 2007 +0300
@@ -51,7 +51,7 @@
 
     while (num_read < size && !newline)
     {
-	if (vfs_fread(&s[num_read], 1, 1, fp) != 1)
+	if (aud_vfs_fread(&s[num_read], 1, 1, fp) != 1)
 	    break;
 
 	/* Unlike fgets(), don't store newline. Under Windows/DOS we'll
@@ -387,7 +387,7 @@
       }
     }
   }
-  vfs_fclose(fp);
+  aud_vfs_fclose(fp);
   return 0;
 }
 
--- a/src/timidity/libtimidity/timidity.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/timidity/libtimidity/timidity.h	Sat Oct 13 21:53:47 2007 +0300
@@ -23,7 +23,7 @@
 #ifndef TIMIDITY_H
 #define TIMIDITY_H
 
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 #include <stdlib.h>
 
 #ifdef __cplusplus
--- a/src/timidity/xmms-timidity.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/timidity/xmms-timidity.c	Sat Oct 13 21:53:47 2007 +0300
@@ -223,7 +223,7 @@
 {
 	gchar magic_bytes[4];
 
-	vfs_fread( magic_bytes , 1 , 4 , fp );
+	aud_vfs_fread( magic_bytes , 1 , 4 , fp );
 
 	if ( !memcmp( magic_bytes , "MThd" , 4 ) )
 		return TRUE;
@@ -232,8 +232,8 @@
 	{
 	/* skip the four bytes after RIFF,
 	   then read the next four */
-	vfs_fseek( fp , 4 , SEEK_CUR );
-	vfs_fread( magic_bytes , 1 , 4 , fp );
+	aud_vfs_fseek( fp , 4 , SEEK_CUR );
+	aud_vfs_fread( magic_bytes , 1 , 4 , fp );
 	if ( !memcmp( magic_bytes , "RMID" , 4 ) )
 		return TRUE;
 	}
@@ -261,7 +261,7 @@
 				buffer, buffer_size);
 
 		if (bytes_read != 0)
-			produce_audio(mid_song_get_time(xmmstimid_song),
+			playback->pass_audio(playback,
 					fmt, xmmstimid_opts.channels,
 					bytes_read, buffer, &playback->playing);
 		else {
@@ -289,13 +289,13 @@
 	Tuple *input;
 	gchar *title;
 
-	input = tuple_new_from_filename(filename);
+	input = aud_tuple_new_from_filename(filename);
 
-	title = tuple_formatter_make_title_string(input, get_gentitle_format());
+	title = aud_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));
+		title = g_strdup(aud_tuple_get_string(input, FIELD_FILE_NAME, NULL));
 
-	tuple_free(input);
+	aud_tuple_free(input);
 
 	return title;
 }
@@ -330,7 +330,7 @@
 	mid_istream_close(stream);
 
 	if (xmmstimid_song == NULL) {
-		xmmstimid_ip.set_info_text(_("Couldn't load MIDI file"));
+		playback->set_title(playback, _("Couldn't load MIDI file"));
 		return;
 	}
 
@@ -345,7 +345,7 @@
 	}
 
 	title = xmmstimid_get_title(filename);
-	xmmstimid_ip.set_info(title,
+	playback->set_params(playback, title,
 			mid_song_get_total_time(xmmstimid_song),
 			0, xmmstimid_opts.rate, xmmstimid_opts.channels);
 	g_free(title);
--- a/src/tonegen/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/tonegen/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,13 +1,12 @@
 PLUGIN = tonegen${PLUGIN_SUFFIX}
+
 SRCS = tonegen.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../..
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
 
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/tonegen/tonegen.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/tonegen/tonegen.c	Sat Oct 13 21:53:47 2007 +0300
@@ -44,7 +44,7 @@
 
 static void tone_init(void)
 {
-	uri_set_plugin("tone://", &tone_ip);
+	aud_uri_set_plugin("tone://", &tone_ip);
 }
 
 static void tone_about(void)
@@ -114,9 +114,7 @@
 			data[i] = rint(((1 << 15) - 1) *
 				       (sum_sines / frequencies->len));
 		}
-		while (playback->output->buffer_free() < BUF_BYTES && going)
-		        g_usleep(30000);
-		produce_audio(playback->output->written_time(), FMT_S16_NE, 1, BUF_BYTES, data, &going);
+		playback->pass_audio(playback, FMT_S16_NE, 1, BUF_BYTES, data, &going);
 	}
 
 	g_array_free(frequencies, TRUE);
@@ -203,7 +201,7 @@
 	}
 
 	name = tone_title(filename);
-	tone_ip.set_info(name, -1, 16 * OUTPUT_FREQ, OUTPUT_FREQ, 1);
+	playback->set_params(playback, name, -1, 16 * OUTPUT_FREQ, OUTPUT_FREQ, 1);
 	g_free(name);
 	playback->data = frequencies;
 	play_thread = g_thread_self();
--- a/src/tta/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/tta/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 PLUGIN = tta${PLUGIN_SUFFIX}
+
 SRCS = libtta.c	\
        ttadec.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
-LIBS += -L${libdir} -laudid3tag ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+LIBS += -L${libdir} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} -laudid3tag
--- a/src/tta/libtta.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/tta/libtta.c	Sat Oct 13 21:53:47 2007 +0300
@@ -106,11 +106,11 @@
 	VFSFile *f;
 	size_t size = -1;
 
-	if ((f = vfs_fopen (filename, "r")))
+	if ((f = aud_vfs_fopen (filename, "r")))
 	{
-	    vfs_fseek (f, 0, SEEK_END);
-	    size = vfs_ftell (f);
-	    vfs_fclose (f);
+	    aud_vfs_fseek (f, 0, SEEK_END);
+	    size = aud_vfs_ftell (f);
+	    aud_vfs_fclose (f);
 	}
 	return size;
 }
@@ -157,7 +157,7 @@
 static gchar *
 get_song_title(Tuple *tuple)
 {
-	return tuple_formatter_make_title_string(tuple, get_gentitle_format());
+	return aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
 }
 
 static void
@@ -169,11 +169,11 @@
 	*title = NULL;
 
 	if ((tuple = get_song_tuple(filename)) != NULL) {
-    	    *length = tuple_get_int(tuple, FIELD_LENGTH, NULL);
+    	    *length = aud_tuple_get_int(tuple, FIELD_LENGTH, NULL);
     	    *title = get_song_title(tuple);
 	}
 
-	tuple_free(tuple);
+	aud_tuple_free(tuple);
 }
 
 static void *
@@ -199,7 +199,7 @@
             }
             if (seek_position == -1)
             {
-                produce_audio(playback->output->written_time(),
+                playback->pass_audio(playback,
                               ((info.BPS == 8) ? FMT_U8 : FMT_S16_LE),
                               info.NCH,
                               read_samples * info.NCH * info.BSIZE,
@@ -483,7 +483,7 @@
 
 	tuple = get_song_tuple(filename);
 	title = get_song_title(tuple);
-	tuple_free(tuple);
+	aud_tuple_free(tuple);
 
 	datasize = file_size(filename) - info.DATAPOS;
 	origsize = info.DATALENGTH * info.BSIZE * info.NCH;
@@ -491,7 +491,7 @@
 	bitrate  = (int) ((float) datasize / origsize *
 	        (info.SAMPLERATE * info.NCH * info.BPS));
 
-	tta_ip.set_info (title, 1000 * info.LENGTH, bitrate, info.SAMPLERATE, info.NCH);
+	playback->set_params(playback, title, 1000 * info.LENGTH, bitrate, info.SAMPLERATE, info.NCH);
 
 	if (title)
 	    g_free (title);
@@ -553,38 +553,38 @@
 
 	ttainfo = g_malloc0(sizeof(tta_info));
 
-	if((file = vfs_fopen(filename, "rb")) != NULL) {
+	if((file = aud_vfs_fopen(filename, "rb")) != NULL) {
 		if(open_tta_file(filename, ttainfo, 0) >= 0) {
-			tuple = tuple_new_from_filename(filename);
+			tuple = aud_tuple_new_from_filename(filename);
 
-			tuple_associate_string(tuple, FIELD_CODEC, NULL, "True Audio (TTA)");
-			tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossless");
+			aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "True Audio (TTA)");
+			aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossless");
 
 			if (ttainfo->ID3.id3has) {
 				if (ttainfo->ID3.artist)
-					tuple_associate_string(tuple, FIELD_ARTIST, NULL, (gchar *) ttainfo->ID3.artist);
+					aud_tuple_associate_string(tuple, FIELD_ARTIST, NULL, (gchar *) ttainfo->ID3.artist);
 
 				if (ttainfo->ID3.album)
-					tuple_associate_string(tuple, FIELD_ALBUM, NULL, (gchar *) ttainfo->ID3.album);
+					aud_tuple_associate_string(tuple, FIELD_ALBUM, NULL, (gchar *) ttainfo->ID3.album);
 
 				if (ttainfo->ID3.title)
-					tuple_associate_string(tuple, FIELD_TITLE, NULL, (gchar *) ttainfo->ID3.title);
+					aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, (gchar *) ttainfo->ID3.title);
 
 				if (ttainfo->ID3.year)
-					tuple_associate_int(tuple, FIELD_YEAR, NULL, atoi((char *)ttainfo->ID3.year));
+					aud_tuple_associate_int(tuple, FIELD_YEAR, NULL, atoi((char *)ttainfo->ID3.year));
 
 				if(ttainfo->ID3.track)
-					tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi((char *)ttainfo->ID3.track));
+					aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi((char *)ttainfo->ID3.track));
 
 				if(ttainfo->ID3.genre)
-					tuple_associate_string(tuple, FIELD_GENRE, NULL, (gchar *) ttainfo->ID3.genre);
+					aud_tuple_associate_string(tuple, FIELD_GENRE, NULL, (gchar *) ttainfo->ID3.genre);
 
 				if(ttainfo->ID3.comment)
-					tuple_associate_string(tuple, FIELD_COMMENT, NULL, (gchar *) ttainfo->ID3.comment);
+					aud_tuple_associate_string(tuple, FIELD_COMMENT, NULL, (gchar *) ttainfo->ID3.comment);
 			}
 			close_tta_file (ttainfo);
 		}
-		vfs_fclose(file);
+		aud_vfs_fclose(file);
 	}
 	return tuple;
 }
--- a/src/tta/ttadec.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/tta/ttadec.c	Sat Oct 13 21:53:47 2007 +0300
@@ -87,7 +87,7 @@
 __inline void get_binary(unsigned int *value, unsigned int bits) {
 	while (bit_count < bits) {
 		if (bitpos == iso_buffers_end) {
-			int res = vfs_fread(isobuffers, 1,
+			int res = aud_vfs_fread(isobuffers, 1,
 				ISO_BUFFERS_SIZE, ttainfo->HANDLE);
 			if (!res) {
 				ttainfo->STATE = READ_ERROR;
@@ -113,7 +113,7 @@
 
 	while (!(bit_cache ^ bit_mask[bit_count])) {
 		if (bitpos == iso_buffers_end) {
-			int res = vfs_fread(isobuffers, 1,
+			int res = aud_vfs_fread(isobuffers, 1,
 				ISO_BUFFERS_SIZE, ttainfo->HANDLE);
 			if (!res) {
 				ttainfo->STATE = READ_ERROR;
@@ -145,7 +145,7 @@
 	rbytes = iso_buffers_end - bitpos;
 	if (rbytes < sizeof(int)) {
 		memcpy(isobuffers, bitpos, 4);
-		res = vfs_fread(isobuffers + rbytes, 1,
+		res = aud_vfs_fread(isobuffers + rbytes, 1,
 			ISO_BUFFERS_SIZE - rbytes, ttainfo->HANDLE);
 		if (!res) {
 			ttainfo->STATE = READ_ERROR;
@@ -260,7 +260,7 @@
 	} __ATTRIBUTE_PACKED__ id3v2;
 	unsigned int len = 0;
 
-	if (!vfs_fread(&id3v2, sizeof(id3v2), 1, ttainfo->HANDLE) || 
+	if (!aud_vfs_fread(&id3v2, sizeof(id3v2), 1, ttainfo->HANDLE) || 
 	    memcmp(id3v2.id, "ID3", 3) ||
 	    id3v2.size[0] & 0x80)
 	{
@@ -286,7 +286,7 @@
 	// clear the memory
 	memset (info, 0, sizeof(tta_info));
 
-	info->HANDLE = infile = vfs_fopen(filename, "rb");
+	info->HANDLE = infile = aud_vfs_fopen(filename, "rb");
 	if (!infile) return OPEN_ERROR;
 
 	// read id3v2 header
@@ -294,18 +294,18 @@
 //		data_offset = id3v2_header_length(info);
 
 	data_offset = get_id3_tags (filename, info);
-	vfs_fseek (infile, data_offset, SEEK_SET);
+	aud_vfs_fseek (infile, data_offset, SEEK_SET);
 
 	// read TTA header
-	if (vfs_fread (&ttahdr, 1, sizeof (ttahdr), infile) == 0) {
-		vfs_fclose (infile);
+	if (aud_vfs_fread (&ttahdr, 1, sizeof (ttahdr), infile) == 0) {
+		aud_vfs_fclose (infile);
 		info->STATE = READ_ERROR;
 		return -1;
 	}
 
 	// check for TTA3 signature
 	if (ENDSWAP_INT32(ttahdr.TTAid) != TTA1_SIGN) {
-		vfs_fclose (infile);
+		aud_vfs_fclose (infile);
 		info->STATE = FORMAT_ERROR;
 		return -1;
 	}
@@ -314,7 +314,7 @@
 	checksum = crc32((unsigned char *) &ttahdr,
 	sizeof(tta_hdr) - sizeof(int));
 	if (checksum != ttahdr.CRC32) {
-		vfs_fclose (infile);
+		aud_vfs_fclose (infile);
 		info->STATE = FILE_ERROR;
 		return -1;
 	}
@@ -338,7 +338,7 @@
 		ttahdr.SampleRate != 64000 &&
 		ttahdr.SampleRate != 88200 &&
 		ttahdr.SampleRate != 96000)) {
-		vfs_fclose (infile);
+		aud_vfs_fclose (infile);
 		info->STATE = FORMAT_ERROR;
 		return FORMAT_ERROR;
 	}
@@ -398,7 +398,7 @@
 	}
 
 	seek_pos = ttainfo->DATAPOS + seek_table[data_pos = pos];
-	vfs_fseek(ttainfo->HANDLE, seek_pos, SEEK_SET);
+	aud_vfs_fseek(ttainfo->HANDLE, seek_pos, SEEK_SET);
 
 	data_cur = 0;
 	framelen = 0;
@@ -432,7 +432,7 @@
 	}
 
 	// read seek table
-	if (!vfs_fread(seek_table, st_size, 1, ttainfo->HANDLE)) {
+	if (!aud_vfs_fread(seek_table, st_size, 1, ttainfo->HANDLE)) {
 		ttainfo->STATE = READ_ERROR;
 		return -1;
 	}
@@ -455,7 +455,7 @@
 
 void close_tta_file (tta_info *info) {
 	if (info->HANDLE) {
-		vfs_fclose (info->HANDLE);
+		aud_vfs_fclose (info->HANDLE);
 		info->HANDLE = NULL;
 	}
 }
--- a/src/tta/ttalib.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/tta/ttalib.h	Sat Oct 13 21:53:47 2007 +0300
@@ -30,17 +30,17 @@
 #ifndef TTALIB_H_
 #define TTALIB_H_
 
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 
 // audacious support
 #define FILE	VFSFile
-#define fopen	vfs_fopen
-#define fclose	vfs_fclose
-#define fwrite	vfs_fwrite
-#define fread	vfs_fread
-#define frewind vfs_frewind
-#define ftell	vfs_ftell
-#define fseek	vfs_fseek
+#define fopen	aud_vfs_fopen
+#define fclose	aud_vfs_fclose
+#define fwrite	aud_vfs_fwrite
+#define fread	aud_vfs_fread
+#define frewind aud_vfs_frewind
+#define ftell	aud_vfs_ftell
+#define fseek	aud_vfs_fseek
 
 #define MAX_BPS         24	// Max supported Bit resolution
 #define MAX_NCH         8	// Max supported number of channels
--- a/src/voice_removal/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/voice_removal/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = voice_removal${PLUGIN_SUFFIX}
+
 SRCS = voice_removal.c
 
-plugindir = audacious/${EFFECT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${EFFECT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/vorbis/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vorbis/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,14 +1,15 @@
 PLUGIN = vorbis${PLUGIN_SUFFIX}
+
 SRCS = configure.c	\
        fileinfo.c	\
        vcedit.c		\
        vorbis.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${OGG_VORBIS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${OGG_VORBIS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} -I../../intl -I../..
 LIBS += ${OGG_VORBIS_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/vorbis/fileinfo.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vorbis/fileinfo.c	Sat Oct 13 21:53:47 2007 +0300
@@ -359,7 +359,7 @@
 static gint
 init_files(vcedit_state * state)
 {
-    if ((vte.in = vfs_fopen(vte.filename, "rb")) == NULL) {
+    if ((vte.in = aud_vfs_fopen(vte.filename, "rb")) == NULL) {
 #ifdef DEBUG
         g_message("fileinfo.c: couldn't open file %s", vte.filename);
 #endif
@@ -371,7 +371,7 @@
         g_message("fileinfo.c: couldn't open file for editing %s",
                   vte.filename);
 #endif
-        vfs_fclose(vte.in);
+        aud_vfs_fclose(vte.in);
         return -1;
     }
 
@@ -394,7 +394,7 @@
 
     if ((ofh = mkstemp(tmpfn)) < 0) {
         g_free(tmpfn);
-        vfs_fclose(vte.in);
+        aud_vfs_fclose(vte.in);
 #ifdef DEBUG
         g_critical("fileinfo.c: couldn't create temp file");
 #endif
@@ -406,11 +406,11 @@
 #endif
     }
 
-    if ((out = vfs_fopen(tmpfn, "wb")) == NULL) {
+    if ((out = aud_vfs_fopen(tmpfn, "wb")) == NULL) {
         close(ofh);
         remove(tmpfn);
         g_free(tmpfn);
-        vfs_fclose(vte.in);
+        aud_vfs_fclose(vte.in);
 #ifdef DEBUG
         g_critical("fileinfo.c: couldn't open temp file");
 #endif
@@ -429,9 +429,9 @@
         retval = -1;
     }
 
-    vfs_fclose(vte.in);
+    aud_vfs_fclose(vte.in);
 
-    if (vfs_fclose(out) != 0) {
+    if (aud_vfs_fclose(out) != 0) {
 #ifdef DEBUG
         g_critical("fileinfo.c: couldn't close out file");
 #endif
@@ -927,7 +927,7 @@
     gtk_label_set_text(GTK_LABEL(filesize_label), _("File size:"));
     gtk_label_set_text(GTK_LABEL(filesize_label_val), _("N/A"));
 
-    if ((fh->fd = vfs_fopen(vte.filename, "r")) != NULL) {
+    if ((fh->fd = aud_vfs_fopen(vte.filename, "r")) != NULL) {
         g_mutex_lock(vf_mutex);
 
         if (ov_open_callbacks(fh, &vf, NULL, 0, vorbis_callbacks) == 0) {
@@ -951,8 +951,8 @@
             time = ov_time_total(&vf, -1);
             minutes = time / 60;
             seconds = time % 60;
-            vfs_fseek(fh->fd, 0, SEEK_END);
-            filesize = vfs_ftell(fh->fd);
+            aud_vfs_fseek(fh->fd, 0, SEEK_END);
+            filesize = aud_vfs_ftell(fh->fd);
 
             label_set_text(GTK_LABEL(bitrate_label_val),
                            _("%d KBit/s (nominal)"), bitrate);
@@ -965,7 +965,7 @@
 
         }
         else
-            vfs_fclose(fh->fd);
+            aud_vfs_fclose(fh->fd);
     }
 
     rg_track_gain = get_comment(comment, "replaygain_track_gain");
@@ -1048,7 +1048,7 @@
     g_mutex_unlock(vf_mutex);
 
 
-    gtk_widget_set_sensitive(tag_frame, vfs_is_writeable(vte.filename));
+    gtk_widget_set_sensitive(tag_frame, aud_vfs_is_writeable(vte.filename));
 
     g_signal_connect_swapped(title_entry, "changed", change_buttons,
                              save_button);
--- a/src/vorbis/vcedit.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vorbis/vcedit.c	Sat Oct 13 21:53:47 2007 +0300
@@ -179,8 +179,8 @@
 vcedit_open(vcedit_state * state, VFSFile * in)
 {
     return vcedit_open_callbacks(state, (void *) in,
-                                 (vcedit_read_func) vfs_fread,
-                                 (vcedit_write_func) vfs_fwrite);
+                                 (vcedit_read_func) aud_vfs_fread,
+                                 (vcedit_write_func) aud_vfs_fwrite);
 }
 
 int
--- a/src/vorbis/vcedit.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vorbis/vcedit.h	Sat Oct 13 21:53:47 2007 +0300
@@ -17,7 +17,7 @@
 #include <stdio.h>
 #include <ogg/ogg.h>
 #include <vorbis/codec.h>
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 
 typedef size_t (*vcedit_read_func)(void *, size_t, size_t, void *);
 typedef size_t (*vcedit_write_func)(const void *, size_t, size_t, void *);
--- a/src/vorbis/vorbis.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vorbis/vorbis.c	Sat Oct 13 21:53:47 2007 +0300
@@ -134,7 +134,7 @@
     gint result;
     VFSVorbisFile *fd;
 
-    if (!(stream = vfs_fopen(filename, "r"))) {
+    if (!(stream = aud_vfs_fopen(filename, "r"))) {
         return FALSE;
     }
 
@@ -160,7 +160,7 @@
         g_message("** vorbis.c: Media read error: %s", filename);
 #endif
         g_mutex_unlock(vf_mutex);
-        vfs_fclose(stream);
+        aud_vfs_fclose(stream);
         return FALSE;
         break;
     case OV_ENOTVORBIS:
@@ -168,7 +168,7 @@
         g_message("** vorbis.c: Not Vorbis data: %s", filename);
 #endif
         g_mutex_unlock(vf_mutex);
-        vfs_fclose(stream);
+        aud_vfs_fclose(stream);
         return FALSE;
         break;
     case OV_EVERSION:
@@ -176,7 +176,7 @@
         g_message("** vorbis.c: Version mismatch: %s", filename);
 #endif
         g_mutex_unlock(vf_mutex);
-        vfs_fclose(stream);
+        aud_vfs_fclose(stream);
         return FALSE;
         break;
     case OV_EBADHEADER:
@@ -185,7 +185,7 @@
                   filename);
 #endif
         g_mutex_unlock(vf_mutex);
-        vfs_fclose(stream);
+        aud_vfs_fclose(stream);
         return FALSE;
         break;
     case OV_EFAULT:
@@ -194,7 +194,7 @@
                   filename);
 #endif
         g_mutex_unlock(vf_mutex);
-        vfs_fclose(stream);
+        aud_vfs_fclose(stream);
         return FALSE;
         break;
     case 0:
@@ -389,15 +389,14 @@
 
     g_mutex_unlock(vf_mutex);
 
+    playback->pass_audio(playback, FMT_S16_NE, channels, bytes, pcmout, &playback->playing);
+
     if (!playback->playing)
         return current_section;
 
     if (seekneeded != -1)
         do_seek(playback);
 
-    produce_audio(playback->output->written_time(),
-                  FMT_S16_NE, channels, bytes, pcmout, &playback->playing);
-
     return current_section;
 }
 
@@ -423,7 +422,7 @@
 
     memset(&vf, 0, sizeof(vf));
 
-    if ((stream = vfs_fopen(filename, "r")) == NULL) {
+    if ((stream = aud_vfs_fopen(filename, "r")) == NULL) {
         playback->eof = TRUE;
         goto play_cleanup;
     }
@@ -473,7 +472,7 @@
 
     g_mutex_unlock(vf_mutex);
 
-    vorbis_ip.set_info(title, time, br, samplerate, channels);
+    playback->set_params(playback, title, time, br, samplerate, channels);
     if (!playback->output->open_audio(FMT_S16_NE, vi->rate, vi->channels)) {
         playback->error = TRUE;
         goto play_cleanup;
@@ -521,7 +520,7 @@
 
             g_mutex_unlock(vf_mutex);
 
-            vorbis_ip.set_info(title, time, br, samplerate, channels);
+            playback->set_params(playback, title, time, br, samplerate, channels);
             timercount = playback->output->output_time();
 
             last_section = current_section;
@@ -591,13 +590,14 @@
 {
     Tuple *tuple = get_song_tuple(filename);
 
-    *length = tuple_get_int(tuple, FIELD_LENGTH, NULL);
-    *title = tuple_formatter_make_title_string(tuple, vorbis_cfg.tag_override ?
+    *length = aud_tuple_get_int(tuple, FIELD_LENGTH, NULL);
+    *title = aud_tuple_formatter_make_title_string(tuple, vorbis_cfg.tag_override ?
                                             vorbis_cfg.tag_format : get_gentitle_format());
 
-    tuple_free(tuple);
+    aud_tuple_free(tuple);
 }
 
+/*
 static const gchar *
 get_extension(const gchar * filename)
 {
@@ -606,6 +606,7 @@
         ++ext;
     return ext;
 }
+*/
 
 /* Make sure you've locked vf_mutex */
 static gboolean
@@ -714,11 +715,11 @@
     return 2 * ch * samples;
 }
 
-static void _tuple_associate_string(Tuple *tuple, const gint nfield, const gchar *field, const gchar *string)
+static void _aud_tuple_associate_string(Tuple *tuple, const gint nfield, const gchar *field, const gchar *string)
 {
     if (string) {
         gchar *str = str_to_utf8(string);
-        tuple_associate_string(tuple, nfield, field, str);
+        aud_tuple_associate_string(tuple, nfield, field, str);
         g_free(str);
     }
 }
@@ -727,38 +728,38 @@
  * Ok, nhjm449! Are you *happy* now?!  -nenolod
  */
 static Tuple *
-get_tuple_for_vorbisfile(OggVorbis_File * vorbisfile, gchar *filename, gboolean is_stream)
+get_aud_tuple_for_vorbisfile(OggVorbis_File * vorbisfile, gchar *filename, gboolean is_stream)
 {
     Tuple *tuple = NULL;
     vorbis_comment *comment;
-    tuple = tuple_new_from_filename(filename);
+    tuple = aud_tuple_new_from_filename(filename);
 
     /* Retrieve the length */
-    tuple_associate_int(tuple, FIELD_LENGTH, NULL,
+    aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL,
         is_stream ? -1 : (ov_time_total(vorbisfile, -1) * 1000));
 
     if ((comment = ov_comment(vorbisfile, -1))) {
         gchar *tmps;
-        _tuple_associate_string(tuple, FIELD_TITLE, NULL, vorbis_comment_query(comment, "title", 0));
-        _tuple_associate_string(tuple, FIELD_ARTIST, NULL, vorbis_comment_query(comment, "artist", 0));
-        _tuple_associate_string(tuple, FIELD_ALBUM, NULL, vorbis_comment_query(comment, "album", 0));
-        _tuple_associate_string(tuple, -1, "date", vorbis_comment_query(comment, "date", 0));
-        _tuple_associate_string(tuple, FIELD_GENRE, NULL, vorbis_comment_query(comment, "genre", 0));
-        _tuple_associate_string(tuple, FIELD_COMMENT, NULL, vorbis_comment_query(comment, "comment", 0));
+        _aud_tuple_associate_string(tuple, FIELD_TITLE, NULL, vorbis_comment_query(comment, "title", 0));
+        _aud_tuple_associate_string(tuple, FIELD_ARTIST, NULL, vorbis_comment_query(comment, "artist", 0));
+        _aud_tuple_associate_string(tuple, FIELD_ALBUM, NULL, vorbis_comment_query(comment, "album", 0));
+        _aud_tuple_associate_string(tuple, -1, "date", vorbis_comment_query(comment, "date", 0));
+        _aud_tuple_associate_string(tuple, FIELD_GENRE, NULL, vorbis_comment_query(comment, "genre", 0));
+        _aud_tuple_associate_string(tuple, FIELD_COMMENT, NULL, vorbis_comment_query(comment, "comment", 0));
 
         if ((tmps = vorbis_comment_query(comment, "tracknumber", 0)) != NULL)
-            tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi(tmps));
+            aud_tuple_associate_int(tuple, FIELD_TRACK_NUMBER, NULL, atoi(tmps));
 
-        tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossy");
+        aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossy");
 
         if (comment && comment->vendor)
         {
             gchar *codec = g_strdup_printf("Ogg Vorbis [%s]", comment->vendor);
-            tuple_associate_string(tuple, FIELD_CODEC, NULL, codec);
+            aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, codec);
             g_free(codec);
         }
         else
-            tuple_associate_string(tuple, FIELD_CODEC, NULL, "Ogg Vorbis");
+            aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "Ogg Vorbis");
     }
 
     return tuple;
@@ -773,7 +774,7 @@
     gboolean is_stream = FALSE;
     VFSVorbisFile *fd = NULL;
 
-    if ((stream = vfs_fopen(filename, "r")) == NULL)
+    if ((stream = aud_vfs_fopen(filename, "r")) == NULL)
         return NULL;
 
     fd = g_new0(VFSVorbisFile, 1);
@@ -786,11 +787,11 @@
      */
     if (ov_open_callbacks(fd, &vfile, NULL, 0, vorbis_callbacks) < 0) {
         if (is_stream == FALSE)
-            vfs_fclose(stream);
+            aud_vfs_fclose(stream);
         return NULL;
     }
 
-    tuple = get_tuple_for_vorbisfile(&vfile, filename, is_stream);
+    tuple = get_aud_tuple_for_vorbisfile(&vfile, filename, is_stream);
 
     /*
      * once the ov_open succeeds, the stream belongs to
@@ -809,25 +810,25 @@
     Tuple *input;
     gchar *tmp;
 
-    input = get_tuple_for_vorbisfile(vorbisfile, filename, vorbis_is_streaming);
+    input = get_aud_tuple_for_vorbisfile(vorbisfile, filename, vorbis_is_streaming);
 
-    displaytitle = tuple_formatter_make_title_string(input, vorbis_cfg.tag_override ?
+    displaytitle = aud_tuple_formatter_make_title_string(input, vorbis_cfg.tag_override ?
                                                   vorbis_cfg.tag_format : get_gentitle_format());
 
-    if ((tmp = vfs_get_metadata(((VFSVorbisFile *) vorbisfile->datasource)->fd, "stream-name")) != NULL)
+    if ((tmp = aud_vfs_get_metadata(((VFSVorbisFile *) vorbisfile->datasource)->fd, "stream-name")) != NULL)
     {
         gchar *old = displaytitle;
 
-        tuple_associate_string(input, -1, "stream", tmp);
-        tuple_associate_string(input, FIELD_TITLE, NULL, old);
+        aud_tuple_associate_string(input, -1, "stream", tmp);
+        aud_tuple_associate_string(input, FIELD_TITLE, NULL, old);
 
-        displaytitle = tuple_formatter_process_string(input, "${?title:${title}}${?stream: (${stream})}");
+        displaytitle = aud_tuple_formatter_process_string(input, "${?title:${title}}${?stream: (${stream})}");
 
 	g_free(old);
 	g_free(tmp);
     }
 
-    tuple_free(input);
+    aud_tuple_free(input);
 
     return displaytitle;
 }
@@ -924,6 +925,8 @@
     bmp_cfg_db_close(db);
 
     vf_mutex = g_mutex_new();
+
+    aud_mime_set_plugin("application/ogg", &vorbis_ip);
 }
 
 static void
@@ -968,7 +971,7 @@
 {
     VFSVorbisFile *handle = (VFSVorbisFile *) datasource;
 
-    return vfs_fread(ptr, size, nmemb, handle->fd);
+    return aud_vfs_fread(ptr, size, nmemb, handle->fd);
 }
 
 static int
@@ -976,7 +979,7 @@
 {
     VFSVorbisFile *handle = (VFSVorbisFile *) datasource;
 
-    return vfs_fseek(handle->fd, offset, whence);
+    return aud_vfs_fseek(handle->fd, offset, whence);
 }
 
 static int
@@ -988,7 +991,7 @@
 
     if (handle->probe == FALSE)
     {
-        ret = vfs_fclose(handle->fd);
+        ret = aud_vfs_fclose(handle->fd);
 //        g_free(handle); // it causes double free. i'm not really sure that commenting out at here is correct. --yaz
     }
 
@@ -1000,5 +1003,5 @@
 {
     VFSVorbisFile *handle = (VFSVorbisFile *) datasource;
 
-    return vfs_ftell(handle->fd);
+    return aud_vfs_ftell(handle->fd);
 }
--- a/src/vorbis/vorbis.h	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vorbis/vorbis.h	Sat Oct 13 21:53:47 2007 +0300
@@ -3,7 +3,7 @@
 
 #include <vorbis/vorbisfile.h>
 
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 
 typedef struct {
     VFSFile *fd;
--- a/src/vtx/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vtx/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = vtx${PLUGIN_SUFFIX}
+
 SRCS = about.c		\
        ay8912.c		\
        config.c		\
@@ -7,11 +8,11 @@
        vtx.c		\
        vtxfile.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../.. -I.
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} -I../../intl -I../.. -I.
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/vtx/vtx.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vtx/vtx.c	Sat Oct 13 21:53:47 2007 +0300
@@ -75,7 +75,7 @@
 {
   char buf[2];
     
-  vfs_fread (buf, 2, 1, fp);
+  aud_vfs_fread (buf, 2, 1, fp);
   return (!strncasecmp (buf, "ay", 2) || !strncasecmp (buf, "ym", 2));
 }
 
@@ -85,33 +85,33 @@
   gboolean ret;
   VFSFile *fp;
 
-  fp = vfs_fopen(filename, "rb");    
+  fp = aud_vfs_fopen(filename, "rb");    
   ret = vtx_is_our_fd(filename, fp);
-  vfs_fclose(fp);
+  aud_vfs_fclose(fp);
 
   return ret;
 }
 
 Tuple *
-vtx_get_song_tuple_from_vtx(const gchar *filename, ayemu_vtx_t *in)
+vtx_get_song_aud_tuple_from_vtx(const gchar *filename, ayemu_vtx_t *in)
 {
-  Tuple *out = tuple_new_from_filename(filename);
+  Tuple *out = aud_tuple_new_from_filename(filename);
   gchar *string;
 
-  tuple_associate_string(out, FIELD_ARTIST, NULL, in->hdr.author);
-  tuple_associate_string(out, FIELD_TITLE, NULL, in->hdr.title);
+  aud_tuple_associate_string(out, FIELD_ARTIST, NULL, in->hdr.author);
+  aud_tuple_associate_string(out, FIELD_TITLE, NULL, in->hdr.title);
 
-  tuple_associate_int(out, FIELD_LENGTH, NULL, in->hdr.regdata_size / 14 * 1000 / 50);
+  aud_tuple_associate_int(out, FIELD_LENGTH, NULL, in->hdr.regdata_size / 14 * 1000 / 50);
 
-  tuple_associate_string(out, FIELD_GENRE, NULL, (in->hdr.chiptype == AYEMU_AY)? "AY chiptunes" : "YM chiptunes");
-  tuple_associate_string(out, FIELD_ALBUM, NULL, in->hdr.from);
-  tuple_associate_string(out, -1, "game", in->hdr.from);
+  aud_tuple_associate_string(out, FIELD_GENRE, NULL, (in->hdr.chiptype == AYEMU_AY)? "AY chiptunes" : "YM chiptunes");
+  aud_tuple_associate_string(out, FIELD_ALBUM, NULL, in->hdr.from);
+  aud_tuple_associate_string(out, -1, "game", in->hdr.from);
 
-  tuple_associate_string(out, FIELD_QUALITY, NULL, "sequenced");
-  tuple_associate_string(out, FIELD_CODEC, NULL, in->hdr.tracker);
-  tuple_associate_string(out, -1, "tracker", in->hdr.tracker);
+  aud_tuple_associate_string(out, FIELD_QUALITY, NULL, "sequenced");
+  aud_tuple_associate_string(out, FIELD_CODEC, NULL, in->hdr.tracker);
+  aud_tuple_associate_string(out, -1, "tracker", in->hdr.tracker);
 
-  tuple_associate_int(out, FIELD_YEAR, NULL, in->hdr.year);
+  aud_tuple_associate_int(out, FIELD_YEAR, NULL, in->hdr.year);
 
   return out;
 }
@@ -123,7 +123,7 @@
 
   if (ayemu_vtx_open (&tmp, filename))
     {
-      Tuple *ti = vtx_get_song_tuple_from_vtx(filename, &tmp);
+      Tuple *ti = vtx_get_song_aud_tuple_from_vtx(filename, &tmp);
       ayemu_vtx_free(&tmp);
       return ti;
     }
@@ -178,7 +178,7 @@
 	g_usleep(10000);
 
       if (playback->playing && seek_to == -1)
-        produce_audio(playback->output->written_time (), FMT_S16_NE,
+        playback->pass_audio(playback, FMT_S16_NE,
   			  chans , SNDBUFSIZE, sndbuf, &playback->playing);
     
       if (playback->eof)
@@ -233,15 +233,15 @@
       playback->eof = FALSE;
       seek_to = -1;
 
-      ti = vtx_get_song_tuple_from_vtx(playback->filename, &vtx);
-      buf = tuple_formatter_make_title_string(ti, get_gentitle_format());
+      ti = vtx_get_song_aud_tuple_from_vtx(playback->filename, &vtx);
+      buf = aud_tuple_formatter_make_title_string(ti, get_gentitle_format());
 
-      vtx_ip.set_info (buf, vtx.hdr.regdata_size / 14 * 1000 / 50,
+      playback->set_params (playback, buf, vtx.hdr.regdata_size / 14 * 1000 / 50,
  	  	       14 * 50 * 8, freq, bits / 8);
 
       g_free (buf);
 
-      tuple_free(ti);
+      aud_tuple_free(ti);
 
       playback->playing = TRUE;
       play_thread = g_thread_self();
@@ -296,13 +296,13 @@
   (*title) = NULL;
 
   if (ayemu_vtx_open (&tmp, filename)) {
-    Tuple *ti = vtx_get_song_tuple_from_vtx(filename, &tmp);
+    Tuple *ti = vtx_get_song_aud_tuple_from_vtx(filename, &tmp);
 
-    *title = tuple_formatter_process_string(ti, get_gentitle_format());
-    *length = tuple_get_int(ti, FIELD_LENGTH, NULL);
+    *title = aud_tuple_formatter_process_string(ti, get_gentitle_format());
+    *length = aud_tuple_get_int(ti, FIELD_LENGTH, NULL);
 
     ayemu_vtx_free (&tmp);
-    tuple_free(ti);
+    aud_tuple_free(ti);
   }
 }
 
--- a/src/vtx/vtxfile.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/vtx/vtxfile.c	Sat Oct 13 21:53:47 2007 +0300
@@ -5,6 +5,8 @@
 #include <ctype.h>
 #include <inttypes.h>
 
+#include <audacious/plugin.h>
+
 #include "ayemu.h"
 
 /* defined in lh5dec.c */
@@ -17,7 +19,7 @@
 static int read_byte(VFSFile *fp, int *p)
 {
   int c;
-  if ((c = vfs_getc(fp)) == EOF) {
+  if ((c = aud_vfs_getc(fp)) == EOF) {
     perror("libayemu: read_byte()");
     return 1;
   }
@@ -31,13 +33,13 @@
 static int read_word16(VFSFile *fp, int *p)
 {
   int c;
-  if ((c = vfs_getc(fp)) == EOF) {
+  if ((c = aud_vfs_getc(fp)) == EOF) {
     perror("libayemu: read_word16()");
     return 1;
   }
   *p = c;
 
-  if ((c = vfs_getc(fp)) == EOF) {
+  if ((c = aud_vfs_getc(fp)) == EOF) {
     perror("libayemu: read_word16()");
     return 1;
   }
@@ -53,25 +55,25 @@
 {
   int c;
 
-  if ((c = vfs_getc(fp)) == EOF) {
+  if ((c = aud_vfs_getc(fp)) == EOF) {
     perror("libayemu: read_word32()");
     return 1;
   }
   *p = c;
 
-  if ((c = vfs_getc(fp)) == EOF) {
+  if ((c = aud_vfs_getc(fp)) == EOF) {
     perror("libayemu: read_word32()");
     return 1;
   }
   *p += c << 8;
 
-  if ((c = vfs_getc(fp)) == EOF) {
+  if ((c = aud_vfs_getc(fp)) == EOF) {
     perror("libayemu: read_word32()");
     return 1;
   }
   *p += c << 16;
 
-  if ((c = vfs_getc(fp)) == EOF) {
+  if ((c = aud_vfs_getc(fp)) == EOF) {
     perror("libayemu: read_word32()");
     return 1;
   }
@@ -86,7 +88,7 @@
 static int read_NTstring(VFSFile *fp, char s[])
 {
   int i, c;
-  for (i = 0 ; i < AYEMU_VTX_NTSTRING_MAX && (c = vfs_getc(fp)) != EOF && c ; i++)
+  for (i = 0 ; i < AYEMU_VTX_NTSTRING_MAX && (c = aud_vfs_getc(fp)) != EOF && c ; i++)
     s[i] = c;
   s[i] = '\0';
   if (c == EOF) {
@@ -109,12 +111,12 @@
 
   vtx->regdata = NULL;
 
-  if ((vtx->fp = vfs_fopen (filename, "rb")) == NULL) {
+  if ((vtx->fp = aud_vfs_fopen (filename, "rb")) == NULL) {
     fprintf(stderr, "ayemu_vtx_open: Cannot open file %s: %s\n", filename, strerror(errno));
     return 0;
   }
 
-  if (vfs_fread(buf, 2, 1, vtx->fp) != 1) {
+  if (aud_vfs_fread(buf, 2, 1, vtx->fp) != 1) {
     fprintf(stderr,"ayemu_vtx_open: Can't read from %s: %s\n", filename, strerror(errno));
     error = 1;
   }
@@ -149,7 +151,7 @@
   if (!error) error = read_NTstring (vtx->fp, vtx->hdr.comment);
 
   if (error) {
-    vfs_fclose(vtx->fp);
+    aud_vfs_fclose(vtx->fp);
     vtx->fp = NULL;
   }
   return !error;
@@ -175,19 +177,19 @@
   buf_alloc = 4096;
   packed_data = (char *) malloc (buf_alloc);
   /* read packed AY register data to end of file. */
-  while ((c = vfs_getc (vtx->fp)) != EOF) {
+  while ((c = aud_vfs_getc (vtx->fp)) != EOF) {
     if (buf_alloc < packed_size) {              
       buf_alloc *= 2;
       packed_data = (char *) realloc (packed_data, buf_alloc);
       if (packed_data == NULL) {
 	fprintf (stderr, "ayemu_vtx_load_data: Packed data out of memory!\n");
-	vfs_fclose (vtx->fp);
+	aud_vfs_fclose (vtx->fp);
 	return NULL;
       }
     }
     packed_data[packed_size++] = c;
   }  
-  vfs_fclose (vtx->fp);
+  aud_vfs_fclose (vtx->fp);
   vtx->fp = NULL;
   if ((vtx->regdata = (char *) malloc (vtx->hdr.regdata_size)) == NULL) {
     fprintf (stderr, "ayemu_vtx_load_data: Can allocate %d bytes for unpack register data\n", vtx->hdr.regdata_size);
@@ -316,7 +318,7 @@
 void ayemu_vtx_free (ayemu_vtx_t *vtx)
 {
   if (vtx->fp) {
-    vfs_fclose(vtx->fp);
+    aud_vfs_fclose(vtx->fp);
     vtx->fp = NULL;
   }
 
--- a/src/wav/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wav/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,12 +1,13 @@
 include ../../extra.mk
 
 PLUGIN = wav${PLUGIN_SUFFIX}
+
 SRCS = wav${WAV_SNDFILE}.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. 
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${DBUS_CFLAGS} -I../../intl -I../.. 
 LIBS += ${MOWGLI_LIBS} ${SNDFILE_LIBS} ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/wav/wav-sndfile.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wav/wav-sndfile.c	Sat Oct 13 21:53:47 2007 +0300
@@ -104,14 +104,14 @@
 	realfn = g_filename_from_uri(filename, NULL, NULL);
 	tmp_sndfile = sf_open (realfn ? realfn : filename, SFM_READ, &tmp_sfinfo);
 	if ( sf_get_string(tmp_sndfile, SF_STR_TITLE) == NULL)
-		tuple_associate_string(ti, FIELD_TITLE, NULL, g_path_get_basename(realfn ? realfn : filename));
+		aud_tuple_associate_string(ti, FIELD_TITLE, NULL, g_path_get_basename(realfn ? realfn : filename));
 	else
-		tuple_associate_string(ti, FIELD_TITLE, NULL, sf_get_string(tmp_sndfile, SF_STR_TITLE));
+		aud_tuple_associate_string(ti, FIELD_TITLE, NULL, sf_get_string(tmp_sndfile, SF_STR_TITLE));
 
-	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, 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));
+	aud_tuple_associate_string(ti, FIELD_ARTIST, NULL, sf_get_string(tmp_sndfile, SF_STR_ARTIST));
+	aud_tuple_associate_string(ti, FIELD_COMMENT, NULL, sf_get_string(tmp_sndfile, SF_STR_COMMENT));
+	aud_tuple_associate_string(ti, FIELD_DATE, NULL, sf_get_string(tmp_sndfile, SF_STR_DATE));
+	aud_tuple_associate_string(ti, -1, "software", sf_get_string(tmp_sndfile, SF_STR_SOFTWARE));
 
 	g_free(realfn); realfn = NULL;
 
@@ -122,7 +122,7 @@
 	tmp_sndfile = NULL;
 
 	if (tmp_sfinfo.samplerate > 0)
-		tuple_associate_int(ti, FIELD_LENGTH, NULL, (int) ceil (1000.0 * tmp_sfinfo.frames / tmp_sfinfo.samplerate));
+		aud_tuple_associate_int(ti, FIELD_LENGTH, NULL, (int) ceil (1000.0 * tmp_sfinfo.frames / tmp_sfinfo.samplerate));
 
 	switch (tmp_sfinfo.format & SF_FORMAT_TYPEMASK)
 	{
@@ -279,12 +279,12 @@
 		g_string_append_printf(codec_gs, "%s", format);
 	codec = g_strdup(codec_gs->str);
 	g_string_free(codec_gs, TRUE);
-	tuple_associate_string(ti, FIELD_CODEC, NULL, codec);
+	aud_tuple_associate_string(ti, FIELD_CODEC, NULL, codec);
 
 	if (lossy != 0)
-		tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
+		aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
 	else
-		tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossless");
+		aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossless");
 }
 
 static gchar *get_title(char *filename)
@@ -292,16 +292,16 @@
 	Tuple *tuple;
 	gchar *title;
 
-	tuple = tuple_new_from_filename(filename);
+	tuple = aud_tuple_new_from_filename(filename);
 	fill_song_tuple(filename, tuple);
-	title = tuple_formatter_make_title_string(tuple, get_gentitle_format());
+	title = aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
 	if (*title == '\0')
 	{
 		g_free(title);
-		title = g_strdup(tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
+		title = g_strdup(aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
 	}
 
-	tuple_free(tuple);
+	aud_tuple_free(tuple);
 	return title;
 }
 
@@ -372,7 +372,7 @@
 					break;	
 			}
 
-			produce_audio (playback->output->written_time (), FMT_S16_NE, sfinfo.channels, 
+			playback->pass_audio(playback, FMT_S16_NE, sfinfo.channels, 
 				samples * sizeof (short), buffer, &playback->playing);
 		}
 		else {
@@ -449,7 +449,7 @@
 		return;
 	}
 
-	wav_ip.set_info (song_title, song_length, bit_rate, sfinfo.samplerate, sfinfo.channels);
+	playback->set_params(playback, song_title, song_length, bit_rate, sfinfo.samplerate, sfinfo.channels);
 	g_free (song_title);
 
 	playback->playing = TRUE;
@@ -512,7 +512,7 @@
 static Tuple*
 get_song_tuple (gchar *filename)
 {
-	Tuple *ti = tuple_new_from_filename(filename);
+	Tuple *ti = aud_tuple_new_from_filename(filename);
 	fill_song_tuple(filename, ti);
 	return ti;
 }
--- a/src/wav/wav.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wav/wav.c	Sat Oct 13 21:53:47 2007 +0300
@@ -65,7 +65,7 @@
 static gint
 read_n_bytes(VFSFile * file, guint8 * buf, gsize n)
 {
-    if (vfs_fread(buf, 1, n, file) != n) {
+    if (aud_vfs_fread(buf, 1, n, file) != n) {
         return FALSE;
     }
     return TRUE;
@@ -94,21 +94,21 @@
     guint32 head;
     glong seek;
 
-    if (!(file = vfs_fopen(filename, "rb"))) {  /* Could not open file */
+    if (!(file = aud_vfs_fopen(filename, "rb"))) {  /* Could not open file */
         return 0;
     }
     if (!(read_n_bytes(file, buf, 4))) {
-        vfs_fclose(file);
+        aud_vfs_fclose(file);
         return 0;
     }
     head = convert_to_header(buf);
     if (head == ('R' << 24) + ('I' << 16) + ('F' << 8) + 'F') { /* Found a riff -- maybe WAVE */
-        if (vfs_fseek(file, 4, SEEK_CUR) != 0) {    /* some error occured */
-            vfs_fclose(file);
+        if (aud_vfs_fseek(file, 4, SEEK_CUR) != 0) {    /* some error occured */
+            aud_vfs_fclose(file);
             return 0;
         }
         if (!(read_n_bytes(file, buf, 4))) {
-            vfs_fclose(file);
+            aud_vfs_fclose(file);
             return 0;
         }
         head = convert_to_header(buf);
@@ -120,18 +120,18 @@
                    We'll skip all chunks until we find the "data"-one which could contain
                    mpeg-data */
                 if (seek != 0) {
-                    if (vfs_fseek(file, seek, SEEK_CUR) != 0) { /* some error occured */
-                        vfs_fclose(file);
+                    if (aud_vfs_fseek(file, seek, SEEK_CUR) != 0) { /* some error occured */
+                        aud_vfs_fclose(file);
                         return 0;
                     }
                 }
                 if (!(read_n_bytes(file, buf, 4))) {
-                    vfs_fclose(file);
+                    aud_vfs_fclose(file);
                     return 0;
                 }
                 head = convert_to_header(buf);
                 if (!(read_n_bytes(file, buf, 4))) {
-                    vfs_fclose(file);
+                    aud_vfs_fclose(file);
                     return 0;
                 }
                 seek = convert_to_long(buf);
@@ -139,13 +139,13 @@
                 if (seek >= 2
                     && head == ('f' << 24) + ('m' << 16) + ('t' << 8) + ' ') {
                     if (!(read_n_bytes(file, buf, 2))) {
-                        vfs_fclose(file);
+                        aud_vfs_fclose(file);
                         return 0;
                     }
                     wavid = buf[0] + 256 * buf[1];
                     seek -= 2;
                     /* we could go on looking for other things, but all we wanted was the wavid */
-                    vfs_fclose(file);
+                    aud_vfs_fclose(file);
                     return wavid;
                 }
             }
@@ -155,7 +155,7 @@
         /* it's RIFF */
     }
     /* it's not even RIFF */
-    vfs_fclose(file);
+    aud_vfs_fclose(file);
     return 0;
 }
 
@@ -179,19 +179,19 @@
     Tuple *tuple;
     gchar *title;
 
-    tuple = tuple_new_from_filename(filename);
+    tuple = aud_tuple_new_from_filename(filename);
 
-    tuple_associate_string(tuple, FIELD_CODEC, NULL, "RIFF/WAV Audio (ADPCM)");
-    tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossless");
+    aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "RIFF/WAV Audio (ADPCM)");
+    aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossless");
 
-    title = tuple_formatter_make_title_string(tuple, get_gentitle_format());
+    title = aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
     if (*title == '\0')
     {
         g_free(title);
-        title = g_strdup(tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
+        title = g_strdup(aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
     }
 
-    tuple_free(tuple);
+    aud_tuple_free(tuple);
 
     return title;
 }
@@ -201,7 +201,7 @@
 {
     guchar buf[4];
 
-    if (vfs_fread(buf, 1, 4, file) != 4)
+    if (aud_vfs_fread(buf, 1, 4, file) != 4)
         return 0;
 
     *ret = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
@@ -215,7 +215,7 @@
 {
     guchar buf[2];
 
-    if (vfs_fread(buf, 1, 2, file) != 2)
+    if (aud_vfs_fread(buf, 1, 2, file) != 2)
         return 0;
 
     *ret = (buf[1] << 8) | buf[0];
@@ -240,13 +240,13 @@
             if (wav_file->length - wav_file->position < bytes)
                 bytes = wav_file->length - wav_file->position;
             if (bytes > 0) {
-                actual_read = vfs_fread(data, 1, bytes, wav_file->file);
+                actual_read = aud_vfs_fread(data, 1, bytes, wav_file->file);
 
                 if (actual_read == 0)
                     playback->eof = TRUE;
                 else {
                     if (wav_file->seek_to == -1)
-                        produce_audio(playback->output->written_time(),
+                        playback->pass_audio(playback,
                                       (wav_file->bits_per_sample ==
                                        16) ? FMT_S16_LE : FMT_U8,
                                       wav_file->channels, bytes, data,
@@ -267,14 +267,14 @@
 
         if (wav_file->seek_to != -1) {
             wav_file->position = (unsigned long)((gint64)wav_file->seek_to * (gint64)rate / 1000L);
-            vfs_fseek(wav_file->file,
+            aud_vfs_fseek(wav_file->file,
                       wav_file->position + wav_file->data_offset, SEEK_SET);
             playback->output->flush(wav_file->seek_to);
             wav_file->seek_to = -1;
         }
 
     }
-    vfs_fclose(wav_file->file);
+    aud_vfs_fclose(wav_file->file);
     return NULL;
 }
 
@@ -289,36 +289,36 @@
     audio_error = FALSE;
 
     wav_file = g_new0(WaveFile, 1);
-    if ((wav_file->file = vfs_fopen(filename, "rb"))) {
-        vfs_fread(magic, 1, 4, wav_file->file);
+    if ((wav_file->file = aud_vfs_fopen(filename, "rb"))) {
+        aud_vfs_fread(magic, 1, 4, wav_file->file);
         if (strncmp(magic, "RIFF", 4)) {
-            vfs_fclose(wav_file->file);
+            aud_vfs_fclose(wav_file->file);
             g_free(wav_file);
             wav_file = NULL;
             return;
         }
         read_le_ulong(wav_file->file, &len);
-        vfs_fread(magic, 1, 4, wav_file->file);
+        aud_vfs_fread(magic, 1, 4, wav_file->file);
         if (strncmp(magic, "WAVE", 4)) {
-            vfs_fclose(wav_file->file);
+            aud_vfs_fclose(wav_file->file);
             g_free(wav_file);
             wav_file = NULL;
             return;
         }
         for (;;) {
-            vfs_fread(magic, 1, 4, wav_file->file);
+            aud_vfs_fread(magic, 1, 4, wav_file->file);
             if (!read_le_ulong(wav_file->file, &len)) {
-                vfs_fclose(wav_file->file);
+                aud_vfs_fclose(wav_file->file);
                 g_free(wav_file);
                 wav_file = NULL;
                 return;
             }
             if (!strncmp("fmt ", magic, 4))
                 break;
-            vfs_fseek(wav_file->file, len, SEEK_CUR);
+            aud_vfs_fseek(wav_file->file, len, SEEK_CUR);
         }
         if (len < 16) {
-            vfs_fclose(wav_file->file);
+            aud_vfs_fclose(wav_file->file);
             g_free(wav_file);
             wav_file = NULL;
             return;
@@ -335,7 +335,7 @@
         case IBM_FORMAT_MULAW:
         case IBM_FORMAT_ALAW:
         case IBM_FORMAT_ADPCM:
-            vfs_fclose(wav_file->file);
+            aud_vfs_fclose(wav_file->file);
             g_free(wav_file);
             wav_file = NULL;
             return;
@@ -346,29 +346,29 @@
         read_le_short(wav_file->file, &wav_file->block_align);
         read_le_short(wav_file->file, &wav_file->bits_per_sample);
         if (wav_file->bits_per_sample != 8 && wav_file->bits_per_sample != 16) {
-            vfs_fclose(wav_file->file);
+            aud_vfs_fclose(wav_file->file);
             g_free(wav_file);
             wav_file = NULL;
             return;
         }
         len -= 16;
         if (len)
-            vfs_fseek(wav_file->file, len, SEEK_CUR);
+            aud_vfs_fseek(wav_file->file, len, SEEK_CUR);
 
         for (;;) {
-            vfs_fread(magic, 4, 1, wav_file->file);
+            aud_vfs_fread(magic, 4, 1, wav_file->file);
 
             if (!read_le_ulong(wav_file->file, &len)) {
-                vfs_fclose(wav_file->file);
+                aud_vfs_fclose(wav_file->file);
                 g_free(wav_file);
                 wav_file = NULL;
                 return;
             }
             if (!strncmp("data", magic, 4))
                 break;
-            vfs_fseek(wav_file->file, len, SEEK_CUR);
+            aud_vfs_fseek(wav_file->file, len, SEEK_CUR);
         }
-        wav_file->data_offset = vfs_ftell(wav_file->file);
+        wav_file->data_offset = aud_vfs_ftell(wav_file->file);
         wav_file->length = len;
 
         wav_file->position = 0;
@@ -379,7 +379,7 @@
                         16) ? FMT_S16_LE : FMT_U8,
                        wav_file->samples_per_sec, wav_file->channels) == 0) {
             audio_error = TRUE;
-            vfs_fclose(wav_file->file);
+            aud_vfs_fclose(wav_file->file);
             g_free(wav_file);
             wav_file = NULL;
             return;
@@ -388,7 +388,7 @@
         rate =
             wav_file->samples_per_sec * wav_file->channels *
             (wav_file->bits_per_sample / 8);
-        wav_ip.set_info(name, 1000 * (wav_file->length / rate), 8 * rate,
+        playback->set_params(playback, name, 1000 * (wav_file->length / rate), 8 * rate,
                         wav_file->samples_per_sec, wav_file->channels);
         g_free(name);
         wav_file->seek_to = -1;
@@ -459,38 +459,38 @@
 
     wav_file = g_malloc(sizeof(WaveFile));
     memset(wav_file, 0, sizeof(WaveFile));
-    if (!(wav_file->file = vfs_fopen(filename, "rb")))
+    if (!(wav_file->file = aud_vfs_fopen(filename, "rb")))
         return;
 
-    vfs_fread(magic, 1, 4, wav_file->file);
+    aud_vfs_fread(magic, 1, 4, wav_file->file);
     if (strncmp(magic, "RIFF", 4)) {
-        vfs_fclose(wav_file->file);
+        aud_vfs_fclose(wav_file->file);
         g_free(wav_file);
         wav_file = NULL;
         return;
     }
     read_le_ulong(wav_file->file, &len);
-    vfs_fread(magic, 1, 4, wav_file->file);
+    aud_vfs_fread(magic, 1, 4, wav_file->file);
     if (strncmp(magic, "WAVE", 4)) {
-        vfs_fclose(wav_file->file);
+        aud_vfs_fclose(wav_file->file);
         g_free(wav_file);
         wav_file = NULL;
         return;
     }
     for (;;) {
-        vfs_fread(magic, 1, 4, wav_file->file);
+        aud_vfs_fread(magic, 1, 4, wav_file->file);
         if (!read_le_ulong(wav_file->file, &len)) {
-            vfs_fclose(wav_file->file);
+            aud_vfs_fclose(wav_file->file);
             g_free(wav_file);
             wav_file = NULL;
             return;
         }
         if (!strncmp("fmt ", magic, 4))
             break;
-        vfs_fseek(wav_file->file, len, SEEK_CUR);
+        aud_vfs_fseek(wav_file->file, len, SEEK_CUR);
     }
     if (len < 16) {
-        vfs_fclose(wav_file->file);
+        aud_vfs_fclose(wav_file->file);
         g_free(wav_file);
         wav_file = NULL;
         return;
@@ -507,7 +507,7 @@
     case IBM_FORMAT_MULAW:
     case IBM_FORMAT_ALAW:
     case IBM_FORMAT_ADPCM:
-        vfs_fclose(wav_file->file);
+        aud_vfs_fclose(wav_file->file);
         g_free(wav_file);
         wav_file = NULL;
         return;
@@ -518,27 +518,27 @@
     read_le_short(wav_file->file, &wav_file->block_align);
     read_le_short(wav_file->file, &wav_file->bits_per_sample);
     if (wav_file->bits_per_sample != 8 && wav_file->bits_per_sample != 16) {
-        vfs_fclose(wav_file->file);
+        aud_vfs_fclose(wav_file->file);
         g_free(wav_file);
         wav_file = NULL;
         return;
     }
     len -= 16;
     if (len)
-        vfs_fseek(wav_file->file, len, SEEK_CUR);
+        aud_vfs_fseek(wav_file->file, len, SEEK_CUR);
 
     for (;;) {
-        vfs_fread(magic, 4, 1, wav_file->file);
+        aud_vfs_fread(magic, 4, 1, wav_file->file);
 
         if (!read_le_ulong(wav_file->file, &len)) {
-            vfs_fclose(wav_file->file);
+            aud_vfs_fclose(wav_file->file);
             g_free(wav_file);
             wav_file = NULL;
             return;
         }
         if (!strncmp("data", magic, 4))
             break;
-        vfs_fseek(wav_file->file, len, SEEK_CUR);
+        aud_vfs_fseek(wav_file->file, len, SEEK_CUR);
     }
     rate =
         wav_file->samples_per_sec * wav_file->channels *
@@ -546,7 +546,7 @@
     (*length) = 1000 * (len / rate);
     (*title) = get_title(filename);
 
-    vfs_fclose(wav_file->file);
+    aud_vfs_fclose(wav_file->file);
     g_free(wav_file);
     wav_file = NULL;
 }
--- a/src/wavpack/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wavpack/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,13 +1,14 @@
 PLUGIN = wavpack${PLUGIN_SUFFIX}
+
 SRCS = tags.cxx		\
        ui.cxx		\
        libwavpack.cxx
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CPPFLAGS += ${PLUGIN_CPPFLAGS} ${DBUS_CFLAGS} ${MOWGLI_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${WAVPACK_CFLAGS} -I../../intl -I../..
 CXXFLAGS += ${PLUGIN_CFLAGS}
 LDFLAGS += -lstdc++
--- a/src/wavpack/libwavpack.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wavpack/libwavpack.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -98,27 +98,27 @@
 
 int32_t read_bytes (void *id, void *data, int32_t bcount)
 {
-    return vfs_fread (data, 1, bcount, (VFSFile *) id);
+    return aud_vfs_fread (data, 1, bcount, (VFSFile *) id);
 }
 
 uint32_t get_pos (void *id)
 {
-    return vfs_ftell ((VFSFile *) id);
+    return aud_vfs_ftell ((VFSFile *) id);
 }
 
 int set_pos_abs (void *id, uint32_t pos)
 {
-    return vfs_fseek ((VFSFile *) id, pos, SEEK_SET);
+    return aud_vfs_fseek ((VFSFile *) id, pos, SEEK_SET);
 }
 
 int set_pos_rel (void *id, int32_t delta, int mode)
 {
-    return vfs_fseek ((VFSFile *) id, delta, mode);
+    return aud_vfs_fseek ((VFSFile *) id, delta, mode);
 }
 
 int push_back_byte (void *id, int c)
 {
-    return vfs_ungetc (c, (VFSFile *) id);
+    return aud_vfs_ungetc (c, (VFSFile *) id);
 }
 
 uint32_t get_length (void *id)
@@ -129,9 +129,9 @@
     if (file == NULL)
         return 0;
 
-    vfs_fseek(file, 0, SEEK_END);
-    sz = vfs_ftell(file);
-    vfs_fseek(file, 0, SEEK_SET);
+    aud_vfs_fseek(file, 0, SEEK_END);
+    sz = aud_vfs_ftell(file);
+    aud_vfs_fseek(file, 0, SEEK_SET);
 
     return sz;
 }
@@ -144,7 +144,7 @@
 
 int32_t write_bytes (void *id, void *data, int32_t bcount)
 {
-    return vfs_fwrite (data, 1, bcount, (VFSFile *) id);
+    return aud_vfs_fwrite (data, 1, bcount, (VFSFile *) id);
 }
 
 WavpackStreamReader reader = {
@@ -185,10 +185,10 @@
         }
         if (ctx != NULL) {
             if (wv_Input)
-                vfs_fclose(wv_Input);
+                aud_vfs_fclose(wv_Input);
 
             if (wvc_Input)
-                vfs_fclose(wvc_Input);
+                aud_vfs_fclose(wvc_Input);
             g_free(ctx);
             ctx = NULL;
         }
@@ -196,11 +196,11 @@
 
     bool attach(const char *filename)
     {
-        wv_Input = vfs_fopen(filename, "rb");
+        wv_Input = aud_vfs_fopen(filename, "rb");
 
         char *corrFilename = g_strconcat(filename, "c", NULL);
 
-        wvc_Input = vfs_fopen(corrFilename, "rb");
+        wvc_Input = aud_vfs_fopen(corrFilename, "rb");
 
         g_free(corrFilename);
 
@@ -223,13 +223,13 @@
         return true;
     }
 
-    bool attach_to_play(const char *filename)
+    bool attach_to_play(InputPlayback *playback)
     {
-        wv_Input = vfs_fopen(filename, "rb");
+        wv_Input = aud_vfs_fopen(playback->filename, "rb");
 
-        char *corrFilename = g_strconcat(filename, "c", NULL);
+        char *corrFilename = g_strconcat(playback->filename, "c", NULL);
 
-        wvc_Input = vfs_fopen(corrFilename, "rb");
+        wvc_Input = aud_vfs_fopen(corrFilename, "rb");
 
         g_free(corrFilename);
 
@@ -242,7 +242,7 @@
         num_channels = WavpackGetNumChannels(ctx);
         input = (int32_t *)calloc(BUFFER_SIZE, num_channels * sizeof(int32_t));
         output = (int16_t *)calloc(BUFFER_SIZE, num_channels * sizeof(int16_t));
-        mod->set_info(generate_title(filename, ctx),
+        playback->set_params(playback, generate_title(playback->filename, ctx),
                       (int) (WavpackGetNumSamples(ctx) / sample_rate) * 1000,
                       (int) WavpackGetAverageBitrate(ctx, num_channels),
                       (int) sample_rate, num_channels);
@@ -254,13 +254,13 @@
         return mod->output->open_audio(FMT_S16_NE, sample_rate, num_channels);
     }
 
-    void process_buffer(size_t num_samples)
+    void process_buffer(InputPlayback *playback, size_t num_samples)
     {
         /* TODO: dithering */
-        for (int i = 0; i < num_samples * num_channels; i++)
+        for (unsigned int i = 0; i < num_samples * num_channels; i++)
             output[i] = input[i];
 
-        produce_audio(mod->output->output_time(), FMT_S16_NE, 
+        playback->pass_audio(playback, FMT_S16_NE, 
 		num_channels, 
 		num_samples * num_channels * sizeof(int16_t),
 		output,
@@ -303,16 +303,16 @@
 }
 
 static void *
-DecodeThread(void *a)
+DecodeThread(InputPlayback *playback)
 {
     ape_tag tag;
-    char *filename = (char *) a;
+    char *filename = playback->filename;
     int bps_updateCounter = 0;
     int bps;
     int i;
     WavpackDecoder d(&mod);
 
-    if (!d.attach_to_play(filename)) {
+    if (!d.attach_to_play(playback)) {
         killDecodeThread = true;
         return end_thread();
     }
@@ -354,7 +354,7 @@
                 break;
             }
             else {
-                d.process_buffer(status);
+                d.process_buffer(playback, status);
             }
         }
         else {
@@ -373,7 +373,7 @@
     AudioError = false;
     thread_handle = g_thread_self();
     data->set_pb_ready(data);
-    DecodeThread((void *) data->filename);
+    DecodeThread(data);
     return;
 }
 
@@ -392,28 +392,28 @@
 }
 
 static Tuple *
-tuple_from_WavpackContext(const char *fn, WavpackContext *ctx)
+aud_tuple_from_WavpackContext(const char *fn, WavpackContext *ctx)
 {
     ape_tag tag;
     Tuple *ti;
     int sample_rate = WavpackGetSampleRate(ctx);
 
-    ti = tuple_new_from_filename(fn);
+    ti = aud_tuple_new_from_filename(fn);
 
     load_tag(&tag, ctx);
 
-    tuple_associate_string(ti, FIELD_TITLE, NULL, tag.title);
-    tuple_associate_string(ti, FIELD_ARTIST, NULL, tag.artist);
-    tuple_associate_string(ti, FIELD_ALBUM, NULL, tag.album);
-    tuple_associate_string(ti, FIELD_GENRE, NULL, tag.genre);
-    tuple_associate_string(ti, FIELD_COMMENT, NULL, tag.comment);
-    tuple_associate_string(ti, FIELD_DATE, NULL, tag.year);
-    tuple_associate_string(ti, FIELD_QUALITY, NULL, WavpackPluginGetQualityString(ctx).c_str());
-    tuple_associate_string(ti, FIELD_CODEC, NULL, "WavPack");
+    aud_tuple_associate_string(ti, FIELD_TITLE, NULL, tag.title);
+    aud_tuple_associate_string(ti, FIELD_ARTIST, NULL, tag.artist);
+    aud_tuple_associate_string(ti, FIELD_ALBUM, NULL, tag.album);
+    aud_tuple_associate_string(ti, FIELD_GENRE, NULL, tag.genre);
+    aud_tuple_associate_string(ti, FIELD_COMMENT, NULL, tag.comment);
+    aud_tuple_associate_string(ti, FIELD_DATE, NULL, tag.year);
+    aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, WavpackPluginGetQualityString(ctx).c_str());
+    aud_tuple_associate_string(ti, FIELD_CODEC, NULL, "WavPack");
 
-    tuple_associate_int(ti, FIELD_TRACK_NUMBER, NULL, atoi(tag.track));
-    tuple_associate_int(ti, FIELD_YEAR, NULL, atoi(tag.year));
-    tuple_associate_int(ti, FIELD_LENGTH, NULL, (int)(WavpackGetNumSamples(ctx) / sample_rate) * 1000);
+    aud_tuple_associate_int(ti, FIELD_TRACK_NUMBER, NULL, atoi(tag.track));
+    aud_tuple_associate_int(ti, FIELD_YEAR, NULL, atoi(tag.year));
+    aud_tuple_associate_int(ti, FIELD_LENGTH, NULL, (int)(WavpackGetNumSamples(ctx) / sample_rate) * 1000);
 
     return ti;
 }
@@ -424,13 +424,13 @@
     static char *displaytitle = NULL;
     Tuple *ti;
 
-    ti = tuple_from_WavpackContext(fn, ctx);
+    ti = aud_tuple_from_WavpackContext(fn, ctx);
 
-    displaytitle = tuple_formatter_make_title_string(ti, cfg.gentitle_format);
+    displaytitle = aud_tuple_formatter_make_title_string(ti, cfg.gentitle_format);
     if (!displaytitle || *displaytitle == '\0')
         displaytitle = g_strdup(fn);
 
-    tuple_free((void *) ti);
+    aud_tuple_free((void *) ti);
 
     return displaytitle;
 }
@@ -446,7 +446,7 @@
         return NULL;
     }
 
-    ti = tuple_from_WavpackContext(filename, d.ctx);
+    ti = aud_tuple_from_WavpackContext(filename, d.ctx);
 
     return ti;
 }
@@ -460,7 +460,7 @@
     if (!d.attach(filename, file))
         return NULL;
 
-    ti = tuple_from_WavpackContext(filename, d.ctx);
+    ti = aud_tuple_from_WavpackContext(filename, d.ctx);
 
     return ti;
 }
--- a/src/wavpack/tags.cxx	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wavpack/tags.cxx	Sat Oct 13 21:53:47 2007 +0300
@@ -6,6 +6,7 @@
 #include <wchar.h>
 #include <audacious/util.h>
 #include <audacious/vfs.h>
+#include <audacious/plugin.h>
 #include "tags.h"
 
 struct APETagFooterStruct {
@@ -143,18 +144,18 @@
         return TAG_NONE;
     }
 
-    if (vfs_fseek(fp, 0, SEEK_END) != 0)
+    if (aud_vfs_fseek(fp, 0, SEEK_END) != 0)
         return TAG_NONE;
-    size = vfs_ftell(fp);
-    if (vfs_fseek(fp, size - sizeof T, SEEK_SET) != 0)
+    size = aud_vfs_ftell(fp);
+    if (aud_vfs_fseek(fp, size - sizeof T, SEEK_SET) != 0)
         return TAG_NONE;
-    if (vfs_fread(&T, 1, sizeof T, fp) != sizeof T)
+    if (aud_vfs_fread(&T, 1, sizeof T, fp) != sizeof T)
         return TAG_NONE;
     if (memcmp(T.ID, "APETAGEX", sizeof T.ID) == 0)
         return TAG_APE;
-    if (vfs_fseek(fp, -128L, SEEK_END) != 0)
+    if (aud_vfs_fseek(fp, -128L, SEEK_END) != 0)
         return TAG_NONE;
-    if (vfs_fread(tagheader, 1, 3, fp) != 3)
+    if (aud_vfs_fread(tagheader, 1, 3, fp) != 3)
         return TAG_NONE;
     if (0 == memcmp(tagheader, "TAG", 3))
         return TAG_ID3;
@@ -179,9 +180,9 @@
     *(Tag->track) = '\0';
     *(Tag->year) = '\0';
 
-    if (vfs_fseek(fp, -128L, SEEK_END) != 0)
+    if (aud_vfs_fseek(fp, -128L, SEEK_END) != 0)
         return 0;
-    if (vfs_fread(buff, 1, 128, fp) != 128)
+    if (aud_vfs_fread(buff, 1, 128, fp) != 128)
         return 0;
     tag = buff;
     tag_insert(Tag->title, (tag + 3), 30, 32, false);
@@ -222,12 +223,12 @@
     *(Tag->track) = '\0';
     *(Tag->year) = '\0';
 
-    if (vfs_fseek(fp, 0, SEEK_END) != 0)
+    if (aud_vfs_fseek(fp, 0, SEEK_END) != 0)
         return 0;
-    size = vfs_ftell(fp);
-    if (vfs_fseek(fp, size - sizeof T, SEEK_SET) != 0)
+    size = aud_vfs_ftell(fp);
+    if (aud_vfs_fseek(fp, size - sizeof T, SEEK_SET) != 0)
         return 0;
-    if (vfs_fread(&T, 1, sizeof T, fp) != sizeof T)
+    if (aud_vfs_fread(&T, 1, sizeof T, fp) != sizeof T)
         return 0;
     if (memcmp(T.ID, "APETAGEX", sizeof T.ID) != 0)
         return 0;
@@ -236,11 +237,11 @@
     TagLen = Read_LE_Uint32(T.Length);
     if (TagLen < sizeof T)
         return 0;
-    if (vfs_fseek(fp, size - TagLen, SEEK_SET) != 0)
+    if (aud_vfs_fseek(fp, size - TagLen, SEEK_SET) != 0)
         return 0;
     if ((buff = (unsigned char *) malloc(TagLen)) == NULL)
         return 0;
-    if (vfs_fread(buff, 1, TagLen - sizeof T, fp) != TagLen - sizeof T) {
+    if (aud_vfs_fread(buff, 1, TagLen - sizeof T, fp) != TagLen - sizeof T) {
         free(buff);
         return 0;
     }
@@ -296,7 +297,7 @@
 DeleteTag(char *filename)
 {
 
-    VFSFile *fp = vfs_fopen(filename, "rb+");
+    VFSFile *fp = aud_vfs_fopen(filename, "rb+");
     int tagtype;
     int fd;
     long filelength = 0;
@@ -317,8 +318,8 @@
     tagtype = GetTageType(fp);
 
     // get Length of File
-    vfs_fseek(fp, 0L, SEEK_END);
-    filelength = vfs_ftell(fp);
+    aud_vfs_fseek(fp, 0L, SEEK_END);
+    filelength = aud_vfs_ftell(fp);
 
     apelength = (unsigned long *) malloc(4);
     tagheader = (char *) malloc(9);
@@ -327,11 +328,11 @@
         dellength = 128L;
     }
     else if (tagtype == TAG_APE) {
-        vfs_fseek(fp, -32L, SEEK_END);
-        vfs_fread(tagheader, 8, 1, fp);
+        aud_vfs_fseek(fp, -32L, SEEK_END);
+        aud_vfs_fread(tagheader, 8, 1, fp);
         if (0 == memcmp(tagheader, "APETAGEX", 8)) {
-            vfs_fseek(fp, -20L, SEEK_END);
-            vfs_fread(apelength, 4, 1, fp);
+            aud_vfs_fseek(fp, -20L, SEEK_END);
+            aud_vfs_fread(apelength, 4, 1, fp);
             dellength = *apelength + 32;
         }
     }
@@ -379,7 +380,7 @@
 
 
     // Delete Tag if there is one
-    fp = vfs_fopen(filename, "rb+");
+    fp = aud_vfs_fopen(filename, "rb+");
     if (fp == NULL) {
         char text[256];
 
@@ -481,7 +482,7 @@
         free(value);
     }
     // Start writing the new Ape2 Tag
-    vfs_fseek(fp, 0L, SEEK_END);
+    aud_vfs_fseek(fp, 0L, SEEK_END);
 
     if (TagCount == 0) {
         printf("no tag to write");
@@ -509,7 +510,7 @@
     H[19] = TagCount >> 24;
 
     H[23] = 0x80 | 0x20;
-    writtenbytes += vfs_fwrite(H, 1, 32, fp);
+    writtenbytes += aud_vfs_fwrite(H, 1, 32, fp);
 
     for (unsigned int i = 0; i < TagCount; i++) {
         dw[0] = T[i].valuelen >> 0;
@@ -520,19 +521,19 @@
         dw[5] = T[i].flags >> 8;
         dw[6] = T[i].flags >> 16;
         dw[7] = T[i].flags >> 24;
-        writtenbytes += vfs_fwrite(dw, 1, 8, fp);
-        writtenbytes += vfs_fwrite(T[i].key, 1, T[i].keylen, fp);
-        writtenbytes += vfs_fwrite("", 1, 1, fp);
+        writtenbytes += aud_vfs_fwrite(dw, 1, 8, fp);
+        writtenbytes += aud_vfs_fwrite(T[i].key, 1, T[i].keylen, fp);
+        writtenbytes += aud_vfs_fwrite("", 1, 1, fp);
         if (T[i].valuelen > 0)
-            writtenbytes += vfs_fwrite(T[i].value, 1, T[i].valuelen, fp);
+            writtenbytes += aud_vfs_fwrite(T[i].value, 1, T[i].valuelen, fp);
     }
 
     H[23] = 0x80;
-    writtenbytes += vfs_fwrite(H, 1, 32, fp);
+    writtenbytes += aud_vfs_fwrite(H, 1, 32, fp);
 
     if (estimatedbytes != (unsigned long) writtenbytes)
         printf("\nError writing APE tag.\n");
-    vfs_fclose(fp);
+    aud_vfs_fclose(fp);
     TagCount = 0;
     return 0;
 }
--- a/src/wma/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wma/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,4 +1,5 @@
 PLUGIN = wma${PLUGIN_SUFFIX}
+
 SRCS = wma.c			\
        libffwma/allcodecs.c	\
        libffwma/allformats.c	\
@@ -20,11 +21,11 @@
        libffwma/mem.c		\
        libffwma/uri.c
 
-plugindir = audacious/${INPUT_PLUGIN_DIR}
-
 include ../../buildsys.mk
 include ../../extra.mk
 
-CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${SIMD_CFLAGS} -I../.. -I./libffwma -std=c99 ${GCC42_CFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${SIMD_CFLAGS} -I../.. -I./libffwma -std=c99 ${GCC42_CFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS}
--- a/src/wma/libffwma/file.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wma/libffwma/file.c	Sat Oct 13 21:53:47 2007 +0300
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
-#include <audacious/vfs.h>
+#include <audacious/plugin.h>
 
 /* standard file protocol */
 
@@ -31,9 +31,9 @@
     VFSFile *file;
 
     if (flags & URL_WRONLY) {
-	file = vfs_fopen(filename, "wb");
+	file = aud_vfs_fopen(filename, "wb");
     } else {
-	file = vfs_fopen(filename, "rb");
+	file = aud_vfs_fopen(filename, "rb");
     }
     
     if (file == NULL)
@@ -46,14 +46,14 @@
 {
     VFSFile *file;
     file = h->priv_data;
-    return vfs_fread(buf, 1, size, file);
+    return aud_vfs_fread(buf, 1, size, file);
 }
 
 static int file_write(URLContext *h, unsigned char *buf, int size)
 {
     VFSFile *file;
     file = h->priv_data;
-    return vfs_fwrite(buf, 1, size, file);
+    return aud_vfs_fwrite(buf, 1, size, file);
 }
 
 /* XXX: use llseek */
@@ -62,9 +62,9 @@
     int result = 0;
     VFSFile *file;
     file = h->priv_data;
-    result = vfs_fseek(file, pos, whence);
+    result = aud_vfs_fseek(file, pos, whence);
     if (result == 0)
-	result = vfs_ftell(file);
+	result = aud_vfs_ftell(file);
     else
         result = -1;
     return result;
@@ -74,7 +74,7 @@
 {
     VFSFile *file;
     file = h->priv_data;
-    return vfs_fclose(file);
+    return aud_vfs_fclose(file);
 }
 
 URLProtocol file_protocol = {
--- a/src/wma/wma.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/wma/wma.c	Sat Oct 13 21:53:47 2007 +0300
@@ -246,25 +246,25 @@
 static void _assoc_string(Tuple *tuple, const gint nfield, const gchar *str)
 {
     if (strlen(str) > 0)
-        tuple_associate_string(tuple, nfield, NULL, str);
+        aud_tuple_associate_string(tuple, nfield, NULL, str);
 }
 
 static void _assoc_int(Tuple *tuple, const gint nfield, const gint val)
 {
     if (val > 0)
-        tuple_associate_int(tuple, nfield, NULL, val);
+        aud_tuple_associate_int(tuple, nfield, NULL, val);
 }
 
 static Tuple *wma_get_song_tuple(gchar * filename)
 {
-    Tuple *ti = tuple_new_from_filename(filename);
+    Tuple *ti = aud_tuple_new_from_filename(filename);
     AVFormatContext *in = NULL;
 
     if (av_open_input_file(&in, str_twenty_to_space(filename), NULL, 0, NULL) < 0)
 	return NULL;
 
-    tuple_associate_string(ti, FIELD_CODEC, NULL, "Windows Media Audio (WMA)");
-    tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
+    aud_tuple_associate_string(ti, FIELD_CODEC, NULL, "Windows Media Audio (WMA)");
+    aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
 
     av_find_stream_info(in);
 
@@ -285,10 +285,10 @@
 static gchar *get_song_title(AVFormatContext *in, gchar * filename)
 {
     gchar *ret = NULL;
-    Tuple *ti = tuple_new_from_filename(filename);
+    Tuple *ti = aud_tuple_new_from_filename(filename);
 
-    tuple_associate_string(ti, FIELD_CODEC, NULL, "Windows Media Audio (WMA)");
-    tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
+    aud_tuple_associate_string(ti, FIELD_CODEC, NULL, "Windows Media Audio (WMA)");
+    aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy");
 
     _assoc_string(ti, FIELD_TITLE, in->title);
     _assoc_string(ti, FIELD_ARTIST, in->author);
@@ -299,7 +299,7 @@
     _assoc_int(ti, FIELD_TRACK_NUMBER, in->track);
     _assoc_int(ti, FIELD_LENGTH, in->duration / 1000);
     
-    ret = tuple_formatter_make_title_string(ti, get_gentitle_format());
+    ret = aud_tuple_formatter_make_title_string(ti, get_gentitle_format());
 
     return ret;
 }
@@ -319,8 +319,8 @@
     if (tuple == NULL)
         return;
 
-    (*len_real) = tuple_get_int(tuple, FIELD_LENGTH, NULL);
-    (*title_real) = tuple_formatter_make_title_string(tuple, get_gentitle_format());
+    (*len_real) = aud_tuple_get_int(tuple, FIELD_LENGTH, NULL);
+    (*title_real) = aud_tuple_formatter_make_title_string(tuple, get_gentitle_format());
 }
 
 static void wma_playbuff(InputPlayback *playback, int out_size)
@@ -334,9 +334,8 @@
     {
         sst_buff = wma_st_buff;
 	if(wma_pause) memset(wma_s_outbuf, 0, sst_buff);	
-    	while(playback->output->buffer_free() < wma_st_buff) g_usleep(20000);
-	produce_audio(playback->output->written_time(), FMT_S16_NE,
-    			    c->channels, sst_buff, (short *)wma_s_outbuf, NULL);
+	playback->pass_audio(playback, FMT_S16_NE,
+            c->channels, sst_buff, (short *)wma_s_outbuf, NULL);
 	memset(wma_s_outbuf, 0, sst_buff);
     }
     fifo_free(&f);
@@ -419,7 +418,7 @@
 
     wma_st_buff  = ST_BUFF;
 	
-    wma_ip.set_info(wsong_title, wsong_time, c->bit_rate, c->sample_rate, c->channels);
+    playback->set_params(playback, wsong_title, wsong_time, c->bit_rate, c->sample_rate, c->channels);
 
     /* av_malloc() will wrap posix_memalign() if necessary -nenolod */
     wma_s_outbuf = av_malloc(wma_st_buff);
--- a/src/xspf/Makefile	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/xspf/Makefile	Sat Oct 13 21:53:47 2007 +0300
@@ -1,11 +1,12 @@
 PLUGIN = xspf${PLUGIN_SUFFIX}
+
 SRCS = xspf.c
 
-plugindir = audacious/${CONTAINER_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} -I../../intl -I../..
+plugindir := ${plugindir}/${CONTAINER_PLUGIN_DIR}
+
 CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += ${PLUGIN_CPPFLAGS} ${MOWGLI_CFLAGS} ${DBUS_CFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} ${PANGO_CFLAGS} ${ARCH_DEFINES} ${XML_CPPFLAGS} -I../../intl -I../..
 LIBS += ${GTK_LIBS} ${GLIB_LIBS} ${PANGO_LIBS} ${XML_LIBS}
--- a/src/xspf/xspf.c	Sat Oct 13 21:53:37 2007 +0300
+++ b/src/xspf/xspf.c	Sat Oct 13 21:53:47 2007 +0300
@@ -132,9 +132,9 @@
     Playlist *playlist = playlist_get_active();
 
 
-    tuple = tuple_new();
-    tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
-    tuple_associate_int(tuple, FIELD_MTIME, NULL, -1);
+    tuple = aud_tuple_new();
+    aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
+    aud_tuple_associate_int(tuple, FIELD_MTIME, NULL, -1);
 
 
     for (nptr = track->children; nptr != NULL; nptr = nptr->next) {
@@ -172,11 +172,11 @@
                     xmlChar *str = xmlNodeGetContent(nptr);
                     switch (xspf_entries[i].type) {
                         case TUPLE_STRING:
-                            tuple_associate_string(tuple, xspf_entries[i].tupleField, NULL, (gchar *)str);
+                            aud_tuple_associate_string(tuple, xspf_entries[i].tupleField, NULL, (gchar *)str);
                             break;
                         
                         case TUPLE_INT:
-                            tuple_associate_int(tuple, xspf_entries[i].tupleField, NULL, atol((char *)str));
+                            aud_tuple_associate_int(tuple, xspf_entries[i].tupleField, NULL, atol((char *)str));
                             break;
                         
                         default:
@@ -196,17 +196,17 @@
         gchar *scratch;
 
         scratch = g_path_get_basename(location);
-        tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch);
+        aud_tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch);
         g_free(scratch);
 
         scratch = g_path_get_dirname(location);
-        tuple_associate_string(tuple, FIELD_FILE_PATH, NULL, scratch);
+        aud_tuple_associate_string(tuple, FIELD_FILE_PATH, NULL, scratch);
         g_free(scratch);
 
-        tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, strrchr(location, '.'));
+        aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, strrchr(location, '.'));
 
-        XSDEBUG("tuple->file_name = %s\n", tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
-        XSDEBUG("tuple->file_path = %s\n", tuple_get_string(tuple, FIELD_FILE_PATH, NULL));
+        XSDEBUG("tuple->file_name = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
+        XSDEBUG("tuple->file_path = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_PATH, NULL));
 
         // add file to playlist
         uri = g_filename_to_uri(location, NULL, NULL);
@@ -504,7 +504,7 @@
                 
                 switch (xs->type) {
                     case TUPLE_STRING:
-                        scratch = tuple_get_string(entry->tuple, xs->tupleField, NULL);
+                        scratch = aud_tuple_get_string(entry->tuple, xs->tupleField, NULL);
                         switch (xs->compare) {
                             case CMP_DEF: isOK = (scratch != NULL); break;
                             case CMP_NULL: isOK = (scratch == NULL); break;
@@ -514,7 +514,7 @@
                         break;
                     
                     case TUPLE_INT:
-                        scratchi = tuple_get_int(entry->tuple, xs->tupleField, NULL);
+                        scratchi = aud_tuple_get_int(entry->tuple, xs->tupleField, NULL);
                         switch (xs->compare) {
                             case CMP_DEF: isOK = (scratchi != 0); break;
                             case CMP_GT:  isOK = (scratchi > 0); break;
@@ -531,7 +531,7 @@
 
             /* Write mtime unconditionally to support staticlist */
             xspf_add_node(track, TUPLE_INT, TRUE, "mtime", NULL,
-                tuple_get_int(entry->tuple, FIELD_MTIME, NULL));
+                aud_tuple_get_int(entry->tuple, FIELD_MTIME, NULL));
         } else {
 
             if (entry->title != NULL && g_utf8_validate(entry->title, -1, NULL))