%
% anyremote configuration file for quodlibet. (AT-mode) From cfg for rhythmbox
% 
% Thanks to Van Wout Heeswijk for this cfg.file
%

% STATUS stable
% XTEST no
% SOUND app
% ENV no
% DEF_PLAYER   

GuiAppName=Quodlibet
GuiAppBinary=quodlibet
GuiAppRun=echo 'A=`ps -ef|grep quodlibet|grep -v grep`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi' | bash -f -s
GuiAppIcon=quodlibet.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=Quod Libet is a GTK+-based audio player written in Python. It's designed around the idea that you know how to organize your music better than we do

[Protocol]=AT

(Init)=\
	Include($(CfgDir)/Utils/aliases-at.cfg);\
	Make(var,TwoWayComm,by_value,false);\
	Macro(CHECK_RFCOMM_DEVICE);
		
(Connect)=Make(mode,quodlibet);

[Mode]=quodlibet : default_player_at

(EnterMode)=\
	Macro(SETUP_DEFAULT_POWER_MANAGEMENT);\
	Macro(RUN_IF_NEED);\
	Make(var,quodlibet_volume,by_value,-1);
	
RUN_IF_NEED=Exec(P=`ps -ef|grep quodlibet|grep -v grep|grep -v quodlibet.cfg`; if [ "x$P" = "x" ]; then quodlibet > /dev/null & fi);
RUN_OR_QUIT=Exec(P=`ps -ef|grep quodlibet|grep -v grep|grep -v quodlibet.cfg`; if [ "x$P" = "x" ]; then quodlibet > /dev/null & else quodlibet --quit; fi)
QUIT=Exec(quodlibet --quit);

% Override
1=Exec(quodlibet --volume-down)
2=Make(var,quodlibet_volume,if [ "x$(quodlibet_volume)" = "x-1" ]; then V=`quodlibet --status|cut -f 3 -d ' '|grep '.'`;echo "$V * 100"|bc|cut -f 1 -d '.';quodlibet --volume=0; else quodlibet --volume=$(quodlibet_volume);echo "-1"; fi)
3=Exec(quodlibet --volume-up)

PLAY=Exec(quodlibet --play);
RWD=Exec(quodlibet --seek=-10)
FF=Exec(quodlibet --seek=+10)
PREV=Exec(quodlibet --previous);
NEXT=Exec(quodlibet --next);
STOP=Exec(quodlibet --play-pause)
PAUSE=Exec(quodlibet --play-pause)

[ModeEnd]

[End]
