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

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

GuiAppName=Kplayer
GuiAppBinary=kplayer
GuiAppRun=echo 'A=`dcop 2> /dev/null|grep kplayer`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=kplayer.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=KPlayer is a KDE multimedia player.
GuiAppVersion=echo 'V=`kplayer -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,kplayer);

[Mode]=kplayer

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

Cancel=Macro(QUIT);

Browse files=Macro(QUIT);Macro(FillList);Macro(UpdateMenu);
Toggle fullscreen=Exec(dcop kplayer kplayer-mainwindow#1 activateAction view_full_screen);
Quit and exit=Macro(Cancel);
KPLAYER_MENU=Set(menu,add,Browse files,Toggle fullscreen,Quit and exit);

QUIT=Exec(dcop kplayer MainApplication-Interface quit;killall mplayer)

Back      =Set(text,close);Macro(KPLAYER_MENU);Macro(ALLIN1MENU)
Back($$)  =Set(list,close);Macro(KPLAYER_MENU);Macro(ALLIN1MENU);
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(title,$(Param));\
	Set(menu,clear);\
	Exec(echo 'P=`dcop|grep kplayer`; if [ "x$P" == "x" ]; then cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";kplayer "$(Param)"& fi' |bash -f -s);\
	Macro(KPLAYER_MENU);\
	Macro(ALLIN1MENU);

1=Exec(dcop kplayer kplayer-mainwindow#1 activateAction audio_volume_down)
2=Exec(dcop kplayer kplayer-mainwindow#1 activateAction audio_mute)
3=Exec(dcop kplayer kplayer-mainwindow#1 activateAction audio_volume_up)

4=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_backward)
5=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_next;dcop kplayer kplayer-mainwindow#1 activateAction player_play);\
	ExecAndSet(title,dcop kplayer kplayer-mainwindow#1 caption);
6=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_forward)

% Upon start-up KPlayer forgot to set up playlist
%7=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_previous);\
%	ExecAndSet(title,dcop kplayer kplayer-mainwindow#1 caption);
7=Macro(QUIT);\
	Macro(FillList);\
	Macro(UpdateMenu);
8=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_stop)

%9=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_next);\
%	ExecAndSet(title,dcop kplayer kplayer-mainwindow#1 caption);

* *=Set(text,replace,Help,1 Vol-\n2 Mute\n3 Vol+\n4 Rew\n5 Play\n6 FF\n7 Browse files\n8 Stop\n** Help\n0 Pause\n# Exit\n* # - Run/Quit)
* #=Exec(echo 'P=`dcop|grep kplayer`; if [ "x$P" == "x" ]; then kplayer; dcop kplayer kplayer-mainwindow#1 activateAction view_full_screen; else dcop kplayer MainApplication-Interface quit; fi' |bash -f -s)
0=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_pause)
#=Macro(QUIT)

[ModeEnd]

[End]
