%
% anyremote configuration file for Exaile management (Server-mode Bemused emulation)
% Prerequisites: amixer/pactl utility, Bemused client installed on cell phone
%

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

GuiAppName=Exaile
GuiAppBinary=exaile
GuiAppRun=echo 'P=`ps -ef|grep exaile |grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=exaile.png
GuiAppType=Application
GuiAppProtocols=Bemused
GuiAppDesc=Exaile is a music player aiming to be similar to KDE's Amarok, but for GTK+ and written in Python.

[Protocol]=Bemused

(Init)=\
	Include($(CfgDir)/Utils/aliases-bemused.cfg);\
	Macro(BEMUSED_SETUP);\
	Macro(SETUP_DEFAULT_MIXER);
	
(Connect)=\
	Exec(echo 'P=`ps -ef|grep exaile|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" == "x" ]; then xterm -geometry "1x1+0+0" -e exaile& fi' |bash -f -s);

EXAILE_ARTIST=\
	Make(var,exaile_artist,exaile --get-artist);
EXAILE_TITLE=\
	Make(var,exaile_title,exaile --get-title);

EXIT=Exec(pkill -f 'python (.)*exaile')
FFWD=Exec(exaile --next)

INF2=Send(string,INF2ACK);\
	Send(bytes,128,0,0,0,128,0,0,0,1,0,0);\
	Macro(EXAILE_ARTIST);\
	Macro(EXAILE_TITLE);\
	Send(string,$(exaile_artist) $(exaile_title));\
	Send(bytes,0,0)

INFO=Send(string,INFOACK);\
	Send(bytes,128,0,0,0,128,0,0,0,1,0,0);\
	Macro(EXAILE_ARTIST);\
	Macro(EXAILE_TITLE);\
	Send(string,$(exaile_artist) $(exaile_title));
	
NEXT=Exec(exaile --next)
PAUS=Exec(exaile --play-pause)
PLAY=Exec(exaile --play)
PREV=Exec(exaile --prev)
RWND=Exec(exaile --prev)
STOP=Exec(exaile --stop)
VOLM($$)=Make(var,default_mixer_value,by_value,$(Param)%);Macro(DEFAULT_VOLUME_SET)

GVOL=Macro(DEFAULT_GVOL);
FADE=Macro(DEFAULT_FADE);

PLEN=Macro(DEFAULT_PLEN);
PLST=Macro(DEFAULT_PLST);

%REPT=Exec()
%SHFL=Exec()
%SEEK=
%SLCT=

[End]
