%
% anyremote configuration file for BMP management (AT-mode)
% prerequisites: xmmsctrl package
%

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

GuiAppName=BMP
GuiAppBinary=beep-media-player
GuiAppRun=echo 'P=`ps -ef|grep beep-media-player|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=beep-media-player.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=The Beep Media Player is a free audio player, based on the XMMS multimedia player.

[Protocol]=AT

(Init)=Include($(CfgDir)/Utils/aliases-at.cfg);\
	Make(var,TwoWayComm,by_value,false);\
	Macro(CHECK_RFCOMM_DEVICE);

(Connect)=Make(var,bmp_volume,by_value,-1);Exec(sh -c "if xmmsctrl running;then xmmsctrl play;else beep-media-player& fi")
(Disconnect)=Exec(xmmsctrl pause);Exec(kdialog --msgbox Disconnected)

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

1=Exec(xmmsctrl vol -5)
2=Make(var,bmp_volume,echo 'if [ "x$(bmp_volume)" == "x-1" ]; then xmmsctrl print %v; xmmsctrl vol 0; else xmmsctrl vol $(bmp_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;kdialog -passivepopup "`cat $F`" 7' |bash -f -s)
* #=Exec(sh -c "if xmmsctrl running;then xmmsctrl quit;else beep-media-player& fi")
0=Exec(xmmsctrl pause)
#=Exec(xmmsctrl quit)

[End]
