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

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

GuiAppName=TvTime
GuiAppBinary=tvtime
GuiAppRun=echo 'A=`ps -ef|grep tvtime|grep -v grep`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
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);Exit

(Init)=Include($(CfgDir)/Utils/aliases-at.cfg);\
	Macro(SETUP_DEFAULT_MIXER);\
	Make(var,TwoWayComm,by_value,false);\
	Macro(CHECK_RFCOMM_DEVICE);
	
(InCall) =Macro(DEFAULT_TOGGLE_MUTE);Exec(kdialog --msgbox "$(CallId)");Make(remote,off);
(EndCall)=Make(remote,on);Macro(DEFAULT_TOGGLE_MUTE);
(Connect)=Exec(echo 'P=`ps -ef|grep tvtime|grep -v grep|grep -v anyremote`; if [ "x$P" == "x" ]; then tvtime & fi' |bash -f -s);

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="$HOME/.anyRemote/anyrem.hlp";echo "Press numeric buttons to choose channel.">$F;echo "Use # to change mode.">>$F;kdialog -passivepopup "`cat $F`" 7' |bash -f -s)
#=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(echo 'F="$HOME/.anyRemote/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(echo 'P=`pgrep tvtime|grep -v grep|grep -v nedit`; if [ "x$P" == "x" ]; then tvtime > /dev/null& else tvtime-command QUIT; fi;' |bash -f -s)
0=Make(none)
#=Make(mode,default)

[ModeEnd]

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


% Aliases for AverMedia IR remote
VOLUMEDOWN=Macro(TVTIME_VOLDN)
MIN_INTERESTING=Macro(TVTIME_MUTE)
VOLUMEUP=Macro(TVTIME_VOLUP)

CHANNELUP=Macro(TVTIME_CHUP)
CHANNELDOWN=Macro(TVTIME_CHDN)
ZOOM=Macro(TVTIME_ZOOM)

[End]
