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

% STATUS stable
% XTEST no
% SOUND mixer
% ENV no
% FBROWSER v.4i
% DEF_VIDEO_PLAYER   
% ALL_IN_ONE 
% MEDIACENTER video

GuiAppName=Totem
GuiAppBinary=totem
GuiAppRun= A=`ps -ef|grep totem|grep -v totem-plugin-viewer|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$A" = "x" ]; then echo NOK; else echo OK; fi
GuiAppIcon=totem.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=Totem is the official movie player of the GNOME desktop environment based on xine-lib or GStreamer.

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Macro(SETUP_DEFAULT_MIXER);\
	Include($(CfgDir)/Utils/aliases-server-fbrowser-v4i.cfg);\
	Macro(FBROWSER_IC_INIT);\
	Include($(CfgDir)/Utils/aliases-server-video-player.cfg);\
	Make(var,app_name,by_value,Totem);\
	Make(var,do_app_init,by_value,1);\
	Make(var,open_file,by_value,);\
	Make(var,totem_layout,\
	     V=`$(CfgDir)/Utils/registry.sh $(TmpDir) get totem_layout`;\
	     if [ "x$V" = "x" ]; then echo "3x4"; else echo $V; fi);\
	Make(var,app_manage_mode,by_value,totem_$(totem_layout));

(Exit)=\
	Macro(FBROWSER_IC_EXIT);\
	Exec($(CfgDir)/Utils/registry.sh $(TmpDir) set totem_layout $(totem_layout));

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

[Mode]=totem_init : default_video_player_init

APP_IS_RUN=\
	Make(var,app_run,\
	     ID=`id -u`;P=`ps -fu $ID|grep totem|grep -v grep|grep -v anyremote|grep -v edit`;\
	     if [ "x$P" = "x" ]; then echo 0; else echo 1; fi);

[ModeEnd]

[Mode]=totem_general  		  

APP_START_IF=\
	Exec(ID=`id -u`;\
	     P=`ps -fu $ID|grep totem|grep -v grep|grep -v anyremote|grep -v edit`;\
	     if [ "x$P" = "x" ]; then cd "$(fbrowser_dir)"; totem $(open_file)& fi);

% Application window should be present in output of "wmctrl -l"
APP_RAISE=\
	Exec($(CfgDir)/Utils/run-or-switch-to.sh -switch totem);

APP_QUIT=\
	Exec(P=`ps -ef|grep totem|grep -v totem-plugin-viewer|grep -v grep|grep -v anyremote|grep -v edit`;\
	     if [ "x$P" != "x" ]; then totem --quit; killall totem; fi);

APP_FULLSCREEN=\
	Exec(totem --fullscreen);

PLAY =Exec(totem --play-pause);
RWD  =Exec(totem --seek-bwd);
FF   =Exec(totem --seek-fwd);
STOP =Exec(totem --pause)
PAUSE=Exec(totem --pause);

Layout 5x1=\
	Make(mode,totem_5x1);

Layout 3x4=\
	Make(mode,totem_3x4);

[ModeEnd]

[Mode]=totem_3x4 : totem_general,default_video_player  		  

% (EnterMode), volume control and 0-9,*,# assignment sby Utils/aliases-server-video-player.cfg

%1=Exec(totem --volume-down);
%3=Exec(totem --volume-up);

APP_POST_SETUP=\
	Make(var,totem_layout,by_value,3x4);\
	Make(var,app_manage_mode,by_value,totem_$(totem_layout));

APP_MENU=\
	Set(menu,replace,Layout 5x1,PowerMgmt);\
	Macro(ALLIN1MENU);\
	Macro(MEDIACENTER_MENU);

% PowerMgmt by Utils/aliases-server.cfg

[ModeEnd]

[Mode]=totem_5x1 : totem_general,default_video_player_5x1  		  

% (EnterMode), volume control and 0-9,*,# assignmentsby Utils/aliases-server-video-player.cfg

APP_POST_SETUP=\
	Make(var,totem_layout,by_value,5x1);\
	Make(var,app_manage_mode,by_value,totem_$(totem_layout));

APP_MENU=\
	Set(menu,replace,Help,Mute,Quit,Fullscreen,Files,Layout 3x4,IMDB,PowerMgmt);\
	Macro(ALLIN1MENU);\
	Macro(MEDIACENTER_MENU);

% Help,Mute,Run/Quit by Utils/aliases-server-video-player.cfg
% PowerMgmt by Utils/aliases-server.cfg

Fullscreen=\
	Macro(APP_FULLSCREEN);

[ModeEnd]

[End]
