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

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

GuiAppName=Banshee
GuiAppBinary= B=`which banshee 2> /dev/null`;if [ "x$B" = "x" ]; then echo banshee-1; else echo banshee; fi
GuiAppRun= P=`ps -ef|grep banshee|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi
GuiAppIcon=media-player-banshee.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=Music management and playback for Gnome

[Protocol]=AT

(Init)=\
	Include($(CfgDir)/Utils/aliases-at.cfg);\
	Macro(SETUP_DEFAULT_MIXER);\
	Make(var,TwoWayComm,by_value,false);\
	Macro(CHECK_RFCOMM_DEVICE);\
	Make(var, banshee_exec, which banshee 2> /dev/null);\
	Make(var, banshee_exec, if [ "x$(banshee_exec)" = "x" ]; then which banshee-1; else echo $(banshee_exec); fi);

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

[Mode]=banshee : default_player_at

RUN_IF_NEED=\
	Exec(P=`ps -ef|grep banshee|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" = "x" ]; then $(banshee_exec) > /dev/null&  fi);

RUN_OR_QUIT=\
	Exec(P=`ps -ef|grep banshee|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" = "x" ]; then $(banshee_exec) > /dev/null& else killall -r "banshee.*" ; fi);

QUIT=\
	Exec(killall -r "banshee.*");

%InCall($$)=Exec($(banshee_exec) --pause);Make(remote,off);
%EndCall($$)=Make(remote,on);Exec($(banshee_exec) --toggle-playing)

PLAY=Exec($(banshee_exec) --toggle-playing);
RWD=Emulate(keydown,Control_L,key,Left,keyup,Control_L);
FF=Emulate(keydown,Control_L,key,Right,keyup,Control_L);
PREV=Exec($(banshee_exec) --previous);
NEXT=Exec($(banshee_exec) --next);
STOP=Exec($(banshee_exec) --pause);
PAUSE=Exec($(banshee_exec) --pause);

[ModeEnd]

[End]
