%
% 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=Kaffeine
GuiAppBinary=kaffeine
GuiAppRun=echo 'A=`dcop 2> /dev/null|grep kaffeine`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=kplayer.png
GuiAppType=Application
GuiAppProtocols=Bemused
GuiAppDesc=KDE media player

[Protocol]=Bemused

(Init)=Include($(CfgDir)/Utils/aliases-bemused.cfg);
(Connect)=Exec(kaffeine)

EXIT=Exec(dcop kaffeine KaffeineIface quit)  
FADE=Exec(amixer sset Master,0 0 -q) 
FFWD=Exec(dcop kaffeine KaffeineIface posPlus) 
INF2=Send(string,INF2ACK);Send(bytes,128,0,0,0,128,0,0,0,1,0,0);ExecAndSend(string,basename "`dcop kaffeine KaffeineIface getFileName`");Send(bytes,0,0)
INFO=Send(string,INFOACK);Send(bytes,128,0,0,0,128,0,0,0,1,0,0);ExecAndSend(string,basename "`dcop kaffeine KaffeineIface getFileName`")
NEXT=Exec(dcop kaffeine KaffeineIface previous) 
PAUS=Exec(dcop kaffeine KaffeineIface pause) 
PLAY=Exec(dcop kaffeine KaffeineIface play) 
PREV=Exec(dcop kaffeine KaffeineIface next) 
RWND=Exec(dcop kaffeine KaffeineIface posMinus) 
STOP=Exec(dcop kaffeine KaffeineIface 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
%SHFL

% 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);
GVOL=Send(string,GVOLNAK)
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]
