#!/bin/sh

case "$1" in
play)
	if [ -f /usr/pkg/etc/timidity/timidity.cfg ]
	then
		TIMIDITY_CFG=""
	else
		TIMIDITY_CFG="-L /usr/pkg/share/freepats -c timidity.cfg"
	fi
	/usr/pkg/bin/timidity $TIMIDITY_CFG -U -idq -Or -o - -s 44100 "$2"
	exit 0
	;;
isOurFile)
	file - <"$2" | grep -q MIDI
	if [ $? -eq 0 ]
	then
		exit 0
	else
		exit 1
	fi
	;;
esac
exit 1
