#!/bin/sh

##################################################
#
#		This script is originally created to fix
#		Winamp equalizer presets to Audacious, XMMS
#		and BMP.
#
#   Written by: orrie <code@orrie.org>
#   Web: http://projects.orrie.org
#   Contact: http://www.orrie.no/contact/
#
##################################################

echo	"BE AWARE!\nYou need Audacious, XMMS or BMP installed before running this script.\nIf you don't have one of those installed, then quit the script and install them and run the script again.\n\n"

leave=no
while [ $leave = no ]
	do
	echo "Choose a mediaplayer you want to have the equalizer-preset:"
	echo "1) Audacious"
	echo "2) XMMS"
	echo "3) BMP"
	echo "4) None of these (quit)"
	read selection
	case $selection in
	1)
		if [ -d "$HOME/.config/audacious" ]; then
			mkdir $HOME/.config/audacious
		fi

		wget http://pub.orrie.org/winamp-preset/winamp_presets.gz
		gunzip -c winamp_presets.gz > $HOME/.config/audacious/eq.preset
		unlink winamp_presets.gz
		if [ -f "$HOME/.config/audacious/eq.preset" ]; then
			echo	"The setup of the equalizer preset for Audacious is done."
		else
			echo	"The setup of the equalizer preset for Audacious didn't succeed.\nIf any problems, report it on http://www.orrie.no\nPerhaps you get credits by reporting the fault ;)"
		fi
		leave=yes
	;;
	2)
		if [ -d "$HOME/.config/xmms" ]; then
			mkdir $HOME/.config/xmms
		fi

		wget http://pub.orrie.org/winamp-preset/winamp_presets.gz
		gunzip -c winamp_presets.gz > $HOME/.config/audacious/eq.preset
		unlink winamp_presets.gz
		if [ -f "$HOME/.config/xmms/eq.preset" ]; then
			echo	"The setup of the equalizer preset for XMMS is done."
		else
			echo	"The setup of the equalizer preset for XMMS didn't succeed.\nIf any problems, report it on http://www.orrie.no\nPerhaps you get credits by reporting the fault ;)"
		fi
		leave=yes
	;;
	3)
		if [ -d "$HOME/.config/bmp" ]; then
			mkdir $HOME/.config/bmp
		fi

		wget http://pub.orrie.org/winamp-preset/winamp_presets.gz
		gunzip -c winamp_presets.gz > $HOME/.config/audacious/eq.preset
		unlink winamp_presets.gz
		if [ -f "$HOME/.config/bmp/eq.preset" ]; then
			echo	"The setup of the equalizer preset for BMP is done."
		else
			echo	"The setup of the equalizer preset for BMP didn't succeed.\nIf any problems, report it on http://www.orrie.no\nPerhaps you get credits by reporting the fault ;)"
		fi
		leave=yes
	;;
	4)
	leave=yes
esac
done

