% OBSOLETED
% anyremote configuration file for Kaboodle management. (Server-mode)
%
% prerequisites: amixer utility

% STATUS stable
% XTEST no
% SOUND mixer
% ENV no

GuiAppName=Kaboodle
GuiAppBinary=kaboodle
GuiAppRun=echo 'A=`dcop 2> /dev/null|grep kaboodle`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=kaboodle.png
GuiAppType=Example
GuiAppProtocols=Server
GuiAppDesc=Simple media player for KDE.

[Protocol]=Server

(Init)=Include($(CfgDir)/Utils/aliases-server.cfg);
(Connect)=Set(icons,Kaboodle,1,vol_down,2,mute,3,vol_up,4,rewind,5,play,6,forward,7,folder,8,stop,9,folder,*,question,0,pause,#,no);\
	Exec(echo 'P=`dcop|grep kaboodle`; if [ "x$P" == "x" ]; then kaboodle; fi'|bash -f -s);

SHOWLIST  =Macro(FILLLIST);Macro(UPDATEMENU)
UPDATEMENU=Set(menu,replace,GoTo,Select);
FILLLIST  =Set(list,replace,Files,..);ExecAndSet(list,add,SAME,cd "`cat $HOME/.anyRemote/ar_kaboodledir.tmp`";pwd>$HOME/.anyRemote/ar_kaboodledir.tmp;ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/$/,/');

GoTo($$)  =Set(list,replace,SAME,..);ExecAndSet(list,add,SAME,echo 'cd "`cat $HOME/.anyRemote/ar_kaboodledir.tmp`";if [ -d "$(Param)" ]; then cd "$(Param)";fi;pwd>$HOME/.anyRemote/ar_kaboodledir.tmp;ls -F --quoting-style=shell|sed "s/\*//;s/,/\r/g;s/$/,/";'|bash -f -s);
Select($$)=Exec(echo 'K=`dcop|grep kaboodle`;F="`cat $HOME/.anyRemote/ar_kaboodledir.tmp`/$(Param)";dcop $K KMediaPlayer openURL "$F"'|bash -f -s);
Back($$)  =Set(list,close);
Back      =Set(text,close);

1=Exec(amixer sset Master,0 5%-    -q)
2=Exec(amixer sset Master,0 toggle -q)
3=Exec(amixer sset Master,0 5%+    -q)

4=Exec(echo 'K=`dcop|grep kaboodle`;P=`dcop $K KMediaPlayer position`;P2=`expr $P - 5000`;dcop $K KMediaPlayer seek $P2'|bash -f -s) 
5=Exec(echo 'K=`dcop|grep kaboodle`;dcop $K KMediaPlayer play'|bash -f -s);
6=Exec(echo 'K=`dcop|grep kaboodle`;P=`dcop $K KMediaPlayer position`;P2=`expr $P + 5000`;dcop $K KMediaPlayer seek $P2'|bash -f -s) 

7=Macro(SHOWLIST);
8=Exec(echo 'K=`dcop|grep kaboodle`;dcop $K KMediaPlayer stop'|bash -f -s);
9=Macro(SHOWLIST);

* #=Exec(echo 'P=`dcop|grep kaboodle`; if [ "x$P" == "x" ]; then kaboodle; else K=`dcop|grep kaboodle`;dcop $K KMediaPlayer pause; fi'|bash -f -s);
* *=Set(text,replace,Help,1 Vol-  2 Mute  3 Vol+\n4 Rew   5 Play  6 FF\n7 Files 8 Stop  9 Files\n* Help  0 Pause # Quit\n* # Run/Quit Kaboodle);
0=Exec(echo 'K=`dcop|grep kaboodle`;dcop $K KMediaPlayer pause'|bash -f -s);
#=Exec(echo 'K=`dcop|grep kaboodle`;dcop $K MainApplication-Interface quit'|bash -f -s);

[End]
