%
% anyremote configuration file for tvtime management.
% prerequisites: utility
%

% STATUS stable
% XTEST no
% SOUND app
% ENV no

GuiAppName=TvTime
GuiAppBinary=tvtime
GuiAppRun= A=`ps -ef|grep tvtime|grep -v grep`; if [ "x$A" = "x" ]; then echo NOK; else echo OK; fi
GuiAppIcon=tvtime.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=Tvtime is a high quality television application for use with video capture cards on Linux systems.

[Protocol]=AT

% aliased keys
Answer=\
    Make(disconnect);

Cancel=\
    Exec(tvtime-command QUIT);\
    Make(exit);

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

(Connect)=\
	Exec(P=`ps -ef|grep tvtime|grep -v grep|grep -v anyremote`; if [ "x$P" = "x" ]; then tvtime & fi);

InCall($$)=\
	Macro(DEFAULT_TOGGLE_MUTE);\
	Make(remote,off);

EndCall($$)=\
	Make(remote,on);\
	Macro(DEFAULT_TOGGLE_MUTE);

TVTIME_CHDN=Exec(tvtime-command DOWN              > /dev/null)
TVTIME_ZOOM=Exec(tvtime-command TOGGLE_FULLSCREEN > /dev/null)
TVTIME_CHUP=Exec(tvtime-command UP                > /dev/null)

TVTIME_VOLUP=Exec(tvtime-command MIXER_UP    > /dev/null)
TVTIME_MUTE =Exec(tvtime-command TOGGLE_MUTE > /dev/null)
TVTIME_VOLDN=Exec(tvtime-command MIXER_DOWN  > /dev/null)

0=Exec(tvtime-command CHANNEL_0 > /dev/null)
1=Exec(tvtime-command CHANNEL_1 > /dev/null)
2=Exec(tvtime-command CHANNEL_2 > /dev/null)
3=Exec(tvtime-command CHANNEL_3 > /dev/null)
4=Exec(tvtime-command CHANNEL_4 > /dev/null)
5=Exec(tvtime-command CHANNEL_5 > /dev/null)
6=Exec(tvtime-command CHANNEL_6 > /dev/null)
7=Exec(tvtime-command CHANNEL_7 > /dev/null)
8=Exec(tvtime-command CHANNEL_8 > /dev/null)
9=Exec(tvtime-command CHANNEL_9 > /dev/null)

* *=Exec(F="$(TmpDir)/anyrem.hlp";echo "Press numeric buttons to choose channel.">$F;echo "Use # to change mode.">>$F);
	Macro(SHOW_HELP);
#=Make(mode,tvtime2)


[Mode]=tvtime2

1=Macro(TVTIME_VOLDN)
2=Exec(tvtime-command TOGGLE_MUTE > /dev/null)
3=Macro(TVTIME_VOLUP)

4=Macro(TVTIME_CHDN)
5=Macro(TVTIME_ZOOM)
6=Macro(TVTIME_CHUP)

7=Make(none)
8=Make(none)
9=Make(none)

* *=Exec(F="$(TmpDir)/anyrem.hlp";echo "1 - Vol-       2 - Mute         3 - Vol+" > $F;echo "4 - Ch-        5 - Fullscreen   6 - Ch +" >> $F;echo "* * - Help     0                # - change mode" >> $F;echo "* # - Run/Quit">> $F);\
	Macro(SHOW_HELP);

* #=Exec(P=`pgrep tvtime|grep -v grep|grep -v nedit`; if [ "x$P" = "x" ]; then tvtime > /dev/null& else tvtime-command QUIT; fi)
0=Make(none)
#=Make(mode,default)

[ModeEnd]

%%%%%%%%%%%%%%
%
% Key aliases
%
%%%%%%%%%%%%%%


% Aliases for AverMedia IR remote
KEY_VOLUMEDOWN=Macro(TVTIME_VOLDN)
KEY_MIN_INTERESTING=Macro(TVTIME_MUTE)
KEY_VOLUMEUP=Macro(TVTIME_VOLUP)

KEY_CHANNELUP=Macro(TVTIME_CHUP)
KEY_CHANNELDOWN=Macro(TVTIME_CHDN)
KEY_ZOOM=Macro(TVTIME_ZOOM)

[End]
