%
% 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=`qdbus 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" == "x4" ]; then echo OK; else echo NOK; fi'|bash -f -s

[Protocol]=Server

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

(Exit)=\
	Macro(FBROWSER_IC_EXIT);

(Connect)=Make(mode,kmid);

[Mode]=kmid

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

KMID_MENU=Set(menu,replace,);Macro(ALLIN1MENU)

Cancel=Macro(QUIT);

QUIT=Exec(qdbus `qdbus|grep kmid` /MainApplication org.kde.KApplication.quit > /dev/null);
Back=Set(text,close);Macro(KMID_MENU)
Back($$)=Set(list,close);
UpdateMenu=Set(menu,replace,GoTo,Open,Go Home);

Open($$)=\
	Set(list,close);\
	Set(menu,clear);\
	Set(title,$(Param));\
	Exec(cd "$(fbrowser_dir)";kmid "$(Param)");

GoTo($$)    =Macro(FBROWSER_IC_GO_TO);
Go Home($$) =Macro(FBROWSER_IC_GO_HOME);
%Push($$) use from aliases-server-fbrowser-v3i.cfg

1=Macro(QUIT);Macro(FBROWSER_IC_FILL_LIST);Macro(UpdateMenu);
3=Exec(qdbus `qdbus|grep kmid` /kmid/MainWindow_1 activateAction song_loop > /dev/null);

4=Exec(qdbus `qdbus|grep kmid` /kmid/MainWindow_1 activateAction song_rewind > /dev/null);
5=Exec(qdbus `qdbus|grep kmid` /kmid/MainWindow_1 activateAction song_play > /dev/null);
6=Exec(qdbus `qdbus|grep kmid` /kmid/MainWindow_1 activateAction song_forward > /dev/null);

7=Exec(qdbus `qdbus|grep kmid` /kmid/MainWindow_1 activateAction song_previous > /dev/null);
8=Exec(qdbus `qdbus|grep kmid` /kmid/MainWindow_1 activateAction song_stop > /dev/null);
9=Exec(qdbus `qdbus|grep kmid` /kmid/MainWindow_1 activateAction song_next > /dev/null); 

* *=Set(text,replace,Help,1 - Files\n3 - Toogle Repeat\n4 - Rew\n5 - Play\n6 - FF\n7 - Prew\n8 - Stop\n9 - Next\n* * - Help\n0 - Pause\n# - Quit)
0=Exec(qdbus `qdbus|grep kmid` /kmid/MainWindow_1 activateAction song_pause > /dev/null); 
#=Macro(QUIT);

[ModeEnd]

[End]
