%
% anyremote configuration file for Listen management (AT-mode)
% prerequisites: amixer/pactl utility
%

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

GuiAppName=Listen
GuiAppBinary=listen
GuiAppRun= P=`ps -ef|grep listen|grep -v grep|grep -v nolisten|grep -v listening|grep -v anyremote|grep -v edit`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi
GuiAppIcon=listen.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=Listen is an audio player written in Python

[Protocol]=AT

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

(Connect)=\
	Make(mode,listen);

[Mode]=listen : default_player_at

% (EnterMode) by Utils/aliases-at.cfg

RUN_IF_NEED=\
	Exec(P=`pgrep listen`; if [ "x$P" = "x" ]; then listen & fi);

RUN_OR_QUIT=\
	Exec(P=`pgrep listen`; if [ "x$P" = "x" ]; then listen & else qdbus org.gnome.Listen /org/gnome/listen quit; fi);

QUIT=\
	Exec(pkill listen)

PREV=Exec(listen --previous);
PLAY=Exec(listen --play-pause);
NEXT=Exec(listen --next);

PAUSE=Exec(listen --play-pause);
STOP=Exec(listen --play-pause);

% override
* *=Macro(DEFAULT_HELP_NO_FF_RWD);

[ModeEnd]

[End]
