%
% anyremote configuration file for xdtv management. (AT-mode)
% prerequisites: xdtv, xdtv_cmd, amixer/pactl utility
%

% STATUS stable
% XTEST no
% SOUND mixer
% ENV no

GuiAppName=XdTV
GuiAppBinary=xdtv
GuiAppRun=echo 'P=`ps -ef|grep xdtv|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$P" == "x" ]; then echo NOK; else echo OK; fi' | bash -f -s
GuiAppIcon=xdtv.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=XdTV is a software to watch, record and stream TV

[Protocol]=AT

Answer=SendCKPD(E);Make(disconnect);
Cancel=Exec(xdtv_cmd quit);SendCKPD(E);

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

(Connect)=Exec(echo 'P=`ps -ef|grep xdtv|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$P" == "x" ]; then xdtv -capt_width 720 -capt_height 576& fi' |bash -f -s)

%XDTV_VOLDN=Exec(xdtv_cmd "volume dec")
%XDTV_MUTE=Exec(xdtv_cmd "volume tvmute")
%XDTV_VOLUP=Exec(xdtv_cmd "volume inc")
XDTV_VOLDN=Macro(DEFAULT_VOLUME_DOWN)
XDTV_MUTE=Macro(DEFAULT_TOGGLE_MUTE)
XDTV_VOLUP=Macro(DEFAULT_VOLUME_UP)

XDTV_CHDN=Exec(xdtv_cmd "setchannel prev");
XDTV_ZOOM=Exec(xdtv_cmd fullscreen)
XDTV_CHUP=Exec(xdtv_cmd "setchannel next");

0=Exec(xdtv_cmd "keypad 0");
1=Exec(xdtv_cmd "keypad 1");
2=Exec(xdtv_cmd "keypad 2");
3=Exec(xdtv_cmd "keypad 3");
4=Exec(xdtv_cmd "keypad 4");
5=Exec(xdtv_cmd "keypad 5");
6=Exec(xdtv_cmd "keypad 6");
7=Exec(xdtv_cmd "keypad 7");
8=Exec(xdtv_cmd "keypad 8");
9=Exec(xdtv_cmd "keypad 9");

* *=Exec(echo 'F="$HOME/.anyRemote/anyrem.hlp";echo "Press numeric buttons to choose channel">$F;echo "* # - Run/Quit">>$F;echo "# - to switch mode">>$F;kdialog -passivepopup "`cat $F`" 7'|bash -f -s)
* #=Exec(echo 'D=`ps -ef|grep xdtv|grep -v anyremote`; if [ "x$D" == "x" ]; then xdtv -capt_width 720 -capt_height 576 & else xdtv_cmd quit; fi;'|bash -f -s)
#=Make(mode,xdtv2);

[Mode]=xdtv2

1=Macro(XDTV_VOLDN)
2=Macro(XDTV_MUTE)
3=Macro(XDTV_VOLUP)

4=Macro(XDTV_CHDN)
5=Macro(XDTV_ZOOM)
6=Macro(XDTV_CHUP)

* *=Exec(echo 'F="$HOME/.anyRemote/anyrem.hlp";echo "1 - Vol-">$F;echo "2 - Mute">>$F;echo "3 - Vol+">>$F;echo "4 - Ch-">>$F;echo "5 - Fullscreen">>$F;echo "6 - Ch +">>$F;echo "** - Help">>$F;echo "# - switch mode">>$F;kdialog -passivepopup "`cat $F`" 7'|bash -f -s)
#=Make(mode,default)

[ModeEnd]

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

VOLUMEDOWN=Macro(XDTV_VOLDN)
MIN_INTERESTING=Macro(XDTV_MUTE)
VOLUMEUP=Macro(XDTV_VOLUP)

CHANNELUP=Macro(XDTV_CHUP)
CHANNELDOWN=Macro(XDTV_CHDN)
ZOOM=Macro(XDTV_ZOOM)

[End]
