%
% anyremote configuration file for XMMS management.
% prerequisites: xmmsctrl package
%

% STATUS stable
% XTEST no
% SOUND app
% ENV no

GuiAppName=XMMS
GuiAppBinary=xmms
GuiAppRun=echo 'P=`ps -ef|grep xmms|grep -v xmms2|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$P" == "x" ]; then echo NOK; else echo OK; fi' | bash -f -s
GuiAppIcon=xmms.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=XMMS is a multimedia player for unix systems. XMMS stands for X MultiMedia System and can play media files such as MP3, MOD's, WAV and others with the use of Input plugins.

[Protocol]=AT

(Init)=\
	Include($(CfgDir)/Utils/aliases-at.cfg);\
	Make(var,TwoWayComm,by_value,false);\
	Macro(CHECK_RFCOMM_DEVICE);\
	Exec(echo 'P=`which xmmsctrl|grep xmmsctrl|grep -v no|wc -l|tr -d " "`;if [ "x$P" == "x1" ]; then true; else $(CfgDir)/Utils/message.sh "ERROR: xmmsctrl package is not installed"; fi'|bash -f -s);

(Connect)=\
	Make(var,xmms_volume,by_value,-1);\
	Exec(sh -c "if xmmsctrl running;then xmmsctrl play;else xmmsctrl launch; fi");

(Disconnect)=\
	Exec(xmmsctrl pause);

Answer=\
	Make(disconnect);
	
Cancel=\
	Exec(xmmsctrl quit);\
	Make(exit);

%InCall($$)=\
%	Exec(xmmsctrl pause;kdialog --msgbox "$(Param)");\
%	Make(remote,off);

%EndCall($$)=\
%	Make(remote,on);\
%	Exec(xmmsctrl play)

1=Exec(xmmsctrl vol -5)
2=Make(var,xmms_volume,echo 'if [ "x$(xmms_volume)" == "x-1" ]; then xmmsctrl print %v; xmmsctrl vol 0; else xmmsctrl vol $(xmms_volume); echo "-1"; fi;'|bash -f -s)
3=Exec(xmmsctrl vol +5)

4=Exec(xmmsctrl time -10)
5=Exec(sh -c "if xmmsctrl playing;then xmmsctrl stop;else xmmsctrl play; fi")
6=Exec(xmmsctrl time +10)

7=Exec(xmmsctrl prev)
8=Exec(xmmsctrl stop)
9=Exec(xmmsctrl next)

* *=Exec(echo 'F="$HOME/.anyRemote/anyrem.hlp";echo "1 - Vol-    2 - Mute       3 - Vol+" > $F;echo "4 - Rew     5 - Play/Stop  6 - FF" >> $F;echo "7 - Prev    8 - Stop       9 - Next" >> $F;echo "* * - Help  0 - Pause      # - Quit" >> $F;echo "* # - Run/Quit" >> $F;kdialog -passivepopup "`cat $F`" 7' |bash -f -s)
* #=Exec(sh -c "if xmmsctrl running;then xmmsctrl quit;else xmmsctrl launch; fi")
0=Exec(xmmsctrl pause)
#=Exec(xmmsctrl quit)

[End]
