%
% anyremote configuration file for kmid management. (Server-mode)
%

% STATUS stable
% XTEST no
% SOUND no
% ENV no
% FBROWSER v.3i

GuiAppName=Kmid
GuiAppBinary=kmid
GuiAppRun=echo 'A=`dcop 2> /dev/null|grep kmid`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=kmid.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=KMid is a X11/KDE based midi player for Linux and FreeBSD. 
GuiAppVersion=echo 'V=`kmid -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`; if [ "x$V" == "x3" ]; then echo OK; else echo NOK; fi'|bash -f -s

[Protocol]=Server

(Init)=Include($(CfgDir)/Utils/aliases-server.cfg);\
	Exec(echo 'V=`amarok -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`; if [ "x$V" == "x4" ]; then $(CfgDir)/Utils/message.sh "ERROR: this configuration file is for KDE3"; fi'|bash -f -s);

(Connect)=Make(mode,kmid);

[Mode]=kmid

(EnterMode)=Set(layout,default);\
	Set(icons,KMid,1,folder,2,default,3,default,4,rewind,5,play,6,forward,7,prev,8,stop,9,next,*,question,0,pause,#,no);\
	Set(title,);\
	Set(status,);\
	Macro(ALLIN1MENU);

Cancel=Macro(QUIT);

QUIT=Exec(echo 'K=`dcop|grep kmid`;dcop $K MainApplication-Interface quit'|bash -f -s);
Back=Set(text,close);Macro(ALLIN1MENU)
Back($$)=Set(list,close);
UpdateMenu=Set(menu,replace,GoTo,Open,Go Home);

% FBROWSER v.3i 
FillList=Set(iconlist,replace,Files,folder:..);\
	Macro(FillDir);\
        Macro(FillFile);
FillDir =ExecAndSet(iconlist,add,SAME,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/@//;s/$/,/'|grep '/'| xargs -d '\n' -i echo "folder:" {});
FillFile=ExecAndSet(iconlist,add,SAME,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/@//;s/$/,/'|grep -v '/'| xargs -d '\n' -i echo "file:"{});
GoTo($$)=Make(var,goto,by_value,$(Param));\
	ExecAndSet(iconlist,replace,Files,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";echo "if [ -d $(goto) ]; then cd $(goto);fi;pwd>$HOME/.anyRemote/ar_storedir.tmp;"|bash -f -s;echo "folder:..");\
	Macro(FillDir);\
        Macro(FillFile);
Go Home($$)=ExecAndSet(iconlist,replace,Files,cd;pwd>$HOME/.anyRemote/ar_storedir.tmp;echo "folder:..");\
	Macro(FillDir);\
        Macro(FillFile);
% FBROWSER v.3i 

Open($$)=Set(list,close);\
	Set(menu,clear);\
	Exec(cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";kmid "$(Param)");

1=Macro(QUIT);Macro(FillList);Macro(UpdateMenu);

4=Exec(echo 'K=`dcop|grep kmid`;dcop $K KMidIface rewind'|bash -f -s) 
5=Exec(echo 'K=`dcop|grep kmid`;dcop $K KMidIface play'|bash -f -s);
6=Exec(echo 'K=`dcop|grep kmid`;dcop $K KMidIface forward'|bash -f -s) 

7=Exec(echo 'K=`dcop|grep kmid`;dcop $K KMidIface prevSong'|bash -f -s) 
8=Exec(echo 'K=`dcop|grep kmid`;dcop $K KMidIface stop'|bash -f -s);
9=Exec(echo 'K=`dcop|grep kmid`;dcop $K KMidIface nextSong'|bash -f -s) 

0=Exec(echo 'K=`dcop|grep kmid`;dcop $K KMidIface pause'|bash -f -s) 
* *=Set(text,replace,Help,1- Files\n4 - Rew\n5 - Play\n6 - FF\n7 - Prew\n8 - Stop\n9 - Next\n* * - Help\n0 - Pause\n# - Quit)
#=Macro(QUIT);

[ModeEnd]

[End]
