%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Key aliases for default video player handling in server mode
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% In inherited modes configuration files it needs to load:
%(Init)=\
%	Include($(CfgDir)/Utils/aliases-server.cfg);\
%       Include($(CfgDir)/Utils/aliases-server-fbrowser-v3i.cfg);\

[Protocol]=Server

%
% It needs to define $(app_manage_mode) variable before
% In inherited modes APP_IS_RUN macro must define $(app_run) variable (1== app is run, 0 == app does not run)
%
[Mode]=default_video_player_init

(EnterMode)=\
	Set(popup,show,Loading...);\
	Make(var,app_run,by_value,0);\
	Make(var,open_file,by_value,);\
	Macro(APP_IS_RUN);\
	Macro(APP_MANAGE,expr 1 - $(app_run));\
	Macro(APP_CHOOSE_FILE,echo $(app_run));\
	Set(popup,hide);

APP_CHOOSE_FILE=\
	Make(mode,simple_file_manager);

APP_MANAGE=\
	Make(mode,$(app_manage_mode));

[ModeEnd]


% Variable $(open_file) should be defined in simple_file_manager mode

%
% Screen setup
%
% It needs to define $(app_name) variable before, like this:
% ...
% Make(var,app_name,by_value,Totem);\
% Macro(SETUP_DEFAULT_PLAYER);\
% ...
% It is good ides to define $(app_name) variable in (Init)
%

[Mode]=default_video_player

(EnterMode)=\
	Macro(SETUP_DEFAULT_POWER_MANAGEMENT);\
	Macro(APP_SETUP);\
	Macro(APP_START_IF);\
	Macro(APP_RAISE);\
	Macro(SETUP_DEFAULT_PLAYER);\
	Macro(APP_MENU);

SETUP_DEFAULT_PLAYER=\
        Set(layout,default);\
	Set(status,);\
	Set(title,);\
	Set(icons,$(app_name),\
		1,vol_down,\
		2,mute,\
		3,vol_up,\
		4,rewind,\
		5,play,\
		6,forward,\
		7,folder,\
		8,stop,\
		9,fullscreen,\
		*,question,\
		0,pause,\
		#,no)

1=Macro(DEFAULT_VOLUME_DOWN);
2=Macro(DEFAULT_TOGGLE_MUTE);
3=Macro(DEFAULT_VOLUME_UP);

4=Macro(RWD);
5=Macro(PLAY);
6=Macro(FF);

7=Macro(APP_QUIT);\
	Make(mode,simple_file_manager);
8=Macro(STOP);
9=Macro(APP_FULLSCREEN);

* *=Macro(DEFAULT_HELP);
0=Macro(PAUSE);
#=Macro(APP_QUIT);\
	Make(mode,simple_file_manager);

% Default menu
APP_MENU=\
	Set(menu,replace,Power Off,Suspend);\
	Macro(ALLIN1MENU);

DEFAULT_HELP=Set(text,replace,Help,1 Vol-\n2 Mute\n3 Vol+\n4 Rewind\n5 Play\n6 FF\n7 File Browser\n8 Stop\n9 Fullscreen\n* * Help\n0 Pause\n# Quit $(app_name))

% Android support
VOL-=Macro(DEFAULT_VOLUME_DOWN);
VOL+=Macro(DEFAULT_VOLUME_UP);
SlideLeft =Macro(NEXT);
SlideRight=Macro(PREV);
SlideDown =Macro(DEFAULT_VOLUME_DOWN);
SlideUp   =Macro(DEFAULT_VOLUME_UP);

InCall($$)=Macro(PAUSE);
EndCall($$)=Macro(PLAY);

% Default action on text screen closing
Back=\
	Set(text,close);\
	Macro(APP_MENU);

% Default action on list screen closing
Back($$)=\
	Set(list,close);\
	Macro(APP_MENU);
	
% by Utils/aliases-server.cfg
Power Off=\
	Macro(DEFAULT_PC_SWITCHOFF);

Suspend=\
	Macro(DEFAULT_PC_SUSPEND);
	
% Rarely used
Cancel=Macro(QUIT);Exit;

[ModeEnd]

[End]
