%
% anyRemote template configuration file for an player management (Server-mode)
% prerequisites: amixer/pactl utility
%

% STATUS testing
% XTEST no
% SOUND mixer
% ENV no
% DEF_PLAYER   
% ALL_IN_ONE 
% MEDIACENTER audio 

GuiAppName=Some player
GuiAppBinary=player.exe
GuiAppRun= P=`ps -ef|grep player.exe|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi
GuiAppIcon=some_player.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=anyRemote template configuration file for an player management

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Macro(SETUP_DEFAULT_MIXER);\
	Make(var,player_name,by_value,Some player);\
	Include($(CfgDir)/Utils/aliases-server-player.cfg);
	
(Connect)=\
	Make(mode,some_player);

[Mode]=some_player : default_player

% (EnterMode) by Utils/aliases-server-player.cfg

APP_PRE_SETUP=\
	Exec(echo "add some specific actions, if needed");
	
APP_POST_SETUP=\
	Exec(echo "add some specific actions, if needed");

APP_MENU=\
	Set(menu,replace,Add,Some,Custom,Items,PowerMgmt);\
	Macro(ALLIN1MENU);\
	Macro(MEDIACENTER_MENU);

% PowerMgmt by Utils/aliases-server.cfg

Add=Exec(echo "Custom Action 1");
Some=Exec(echo "Custom Action 2");
Custom=Exec(echo "Custom Action 3");
Items=Exec(echo "Custom Action 4");

% Volume control and 0-9,*,# assignments by Utils/aliases-server-player.cfg

PLAY =Exec(echo play);
RWD  =Exec(echo rewind)
FF   =Exec(echo fastforward)
PREV =Exec(echo previous)
STOP =Exec(echo stop);
NEXT =Exec(echo next)
PAUSE=Exec(echo pause);

RUN_OR_QUIT=\
	Make(var,player_exec_cmd,\
	     P=`ps -ef|grep player.exe|grep -v grep|grep -v anyremote|grep -v edit`;\
	     if [ "x$P" = "x" ]; then echo RUN_IF_NEED else echo APP_QUIT; fi);\
	Macro($(player_exec_cmd));

RUN_IF_NEED=\
	Exec(P=`ps -ef|grep player.exe|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$P" = "x" ]; then echo "run player"; fi);


APP_QUIT=\
	Exec(echo "quit player");

[ModeEnd]

[End]
