%
% anyremote configuration file for kdetv management. (AT-mode)
%

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

GuiAppName=KdeTV
GuiAppBinary=kdetv
GuiAppRun=echo 'A=`dcop 2> /dev/null|grep kdetv`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi' | bash -f -s
GuiAppIcon=kdetv.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=kdetv is a KDE application to watch TV on the desktop.

[Protocol]=AT

% aliased keys
Answer=Make(disconnect);
Cancel=Exec(echo 'D=`dcop|grep kdetv`;dcop $D MainApplication-Interface quit;'|bash -f -s);SendCKPD(E);Exit

(InCall)=Make(remote,off);
(EndCall)=Make(remote,on);

(Init)=Make(var,TwoWayComm,by_value,false);\
	Macro(CHECK_RFCOMM_DEVICE);

(Connect)=Exec(echo 'A=`dcop|grep kdetv`;if [ "x$A" == "x" ]; then kdetv 2> /dev/null; fi'|bash -f -s);

KDETV_VOLUP=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface volumeDown'|bash -f -s)
KDETV_MUTE=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface toggleMute'|bash -f -s)
KDETV_VOLDN=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface volumeUp'|bash -f -s)

KDETV_CHUP=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface channelDown'|bash -f -s);
KDETV_ZOOM=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvViewIface toggleFullScreen'|bash -f -s)
KDETV_CHDN=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface channelUp'|bash -f -s);

0=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 0'|bash -f -s);
1=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 1'|bash -f -s);
2=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 2'|bash -f -s);
3=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 3'|bash -f -s);
4=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 4'|bash -f -s);
5=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 5'|bash -f -s);
6=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 6'|bash -f -s);
7=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 7'|bash -f -s);
8=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 8'|bash -f -s);
9=Exec(echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface processNumberKeyEvent 9'|bash -f -s);

* *=Exec(F="$HOME/.anyRemote/anyrem.hlp";echo "Press numeric buttons to choose channel.">$F;echo "Use # to change mode.">>$F;echo "* # Run/Quit kdetv">>$F);\
	Macro(SHOW_HELP);
* #=Exec(echo 'D=`dcop|grep kdetv`; if [ "x$D" == "x" ]; then kdetv 2> /dev/null; else dcop $D MainApplication-Interface quit; fi;'|bash -f -s)
#=Make(mode,kdetv2);

[Mode]=kdetv2

1=Macro(KDETV_VOLUP)
2=Macro(KDETV_MUTE)
3=Macro(KDETV_VOLDN)

4=Macro(KDETV_CHUP)
5=Macro(KDETV_ZOOM)
6=Macro(KDETV_CHDN)

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

* *=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 "0 - Kill">>$F;echo "# - Direct">>$F;kdialog -passivepopup "`cat $F`" 7'|bash -f -s)
0=Exec(echo 'D=`dcop|grep kdetv`;dcop $D MainApplication-Interface quit;'|bash -f -s)
#=Make(mode,default)

[ModeEnd]

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

% Motorola - Red and Green buttons
S=Macro(Answer);
E=Macro(Cancel);

% SE's - SwitchOff and C buttons
c=Macro(Answer);
L=Macro(Cancel);
p=Macro(Cancel);

% Sagem - Red and Green buttons
83=Macro(Answer);
69=Macro(Cancel);

% Sockets & Sagem
42=Macro(*)
35=Macro(#)
48=Macro(0)
49=Macro(1)
50=Macro(2)
51=Macro(3)
52=Macro(4)
53=Macro(5)
54=Macro(6)
55=Macro(7)
56=Macro(8)
57=Macro(9)

% Aliases for AverMedia IR remote
TEXT=Macro(*)
POWER=Macro(#)

VOLUMEDOWN=Macro(KDETV_VOLUP)
MIN_INTERESTING=Macro(KDETV_MUTE)
VOLUMEUP=Macro(KDETV_VOLDN)
CHANNELUP=Macro(KDETV_CHUP)
CHANNELDOWN=Macro(KDETV_CHDN)
ZOOM=Macro(KDETV_ZOOM)

[End]
