%
% anyremote configuration file for kaffeine management. (Server-mode Bemused emulation)
% Prerequisites amixer utility, Bemused client installed on cell phone
%

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

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=Bemused
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]=Bemused

(Init)=Include($(CfgDir)/Utils/aliases-bemused.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)=Exec(kplayer)

EXIT=Exec(dcop kplayer MainApplication-Interface quit)  
FADE=Exec(dcop kplayer kplayer-mainwindow#1 activateAction audio_mute) 
FFWD=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_forward) 
INF2=Send(string,INF2ACK);Send(bytes,128,0,0,0,128,0,0,0,1,0,0);ExecAndSend(string,dcop kplayer kplayer-mainwindow#1 caption);Send(bytes,0,0)
INFO=Send(string,INFOACK);Send(bytes,128,0,0,0,128,0,0,0,1,0,0);ExecAndSend(string,dcop kplayer kplayer-mainwindow#1 caption);
NEXT=Exec(dcop kplayer kplayer-mainwindow#1 activateAction playlist_next) 
PAUS=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_pause) 
PLAY=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_play) 
PREV=Exec(dcop kplayer kplayer-mainwindow#1 activateAction playlist_previous) 
RWND=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_backward) 
SHFL=Exec(dcop kplayer kplayer-mainwindow#1 activateAction playlist_shuffle)
STOP=Exec(dcop kplayer kplayer-mainwindow#1 activateAction player_stop) 

VOLM($$)=Exec(amixer sset Master,0 $(Param)% -q)

%GVOL=Send(string,GVOLNAK)
GVOL=Send(string,GVOLACK);Make(var,s_volume,echo 'V=`amixer sget Master,0|grep "Left: Playback"|tail -1|cut -f 1 -d "%"|cut -f 2 -d "["`;echo "$V*255/100"|bc'|bash -f -s);Send(bytes,$(s_volume))

%REPT

% The following is a trick. Replays are not real, just to satisfy client.
CHCK=Send(string,Y);
DINF=Send(string,DINFACK);Send(bytes,0,0,0,244,0,0,32,0,0,0,0,2);
DLST=Send(bytes,255,0)
DOWN=Send(bytes,0,100);Send(string,NoName)
FINF=Send(string,FINFACK);Send(bytes,0,0,0,100);
LIST=Send(bytes,255,0)
PLEN=Send(bytes,0,100)
PLST=Send(string,PLSTACK);Send(bytes,0,1,35,10);Send(string,NoName);Send(bytes,10,0)
%SEEK=
%SLCT=
VERS=Send(string,VERSACK);Send(bytes,1,73);
[End]
