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

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

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

[Protocol]=AT


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

(Connect)=\
	Exec(A=`dcop|grep kdetv`;if [ "x$A" = "x" ]; then kdetv 2> /dev/null; fi);

%InCall($$)=\
%	Make(remote,off);

%EndCall($$)=\
%	Make(remote,on);

% aliased keys
Answer=\
	Make(disconnect);

Cancel=\
	Exec(D=`dcop|grep kdetv`;dcop $D MainApplication-Interface quit;);\
	SendCKPD(E);\
	Make(exit);

KDETV_VOLUP=Exec(D=`dcop|grep kdetv`;dcop $D KdetvIface volumeDown)
KDETV_MUTE=Exec(D=`dcop|grep kdetv`;dcop $D KdetvIface toggleMute)
KDETV_VOLDN=Exec(D=`dcop|grep kdetv`;dcop $D KdetvIface volumeUp)

KDETV_CHUP=Exec(D=`dcop|grep kdetv`;dcop $D KdetvIface channelDown);
KDETV_ZOOM=Exec(D=`dcop|grep kdetv`;dcop $D KdetvViewIface toggleFullScreen)
KDETV_CHDN=Exec(D=`dcop|grep kdetv`;dcop $D KdetvIface channelUp);

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

* *=Exec(F="$(TmpDir)/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(D=`dcop|grep kdetv`; if [ "x$D" = "x" ]; then kdetv 2> /dev/null; else dcop $D MainApplication-Interface quit; fi)
#=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(F="$(TmpDir)/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;$(CfgDir)/Utils/message.sh "`cat $F`")
0=Exec(D=`dcop|grep kdetv`;dcop $D MainApplication-Interface quit)
#=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
KEY_TEXT=Macro(*)
KEY_POWER=Macro(#)

KEY_VOLUMEDOWN=Macro(KDETV_VOLUP)
KEY_MIN_INTERESTING=Macro(KDETV_MUTE)
KEY_VOLUMEUP=Macro(KDETV_VOLDN)
KEY_CHANNELUP=Macro(KDETV_CHUP)
KEY_CHANNELDOWN=Macro(KDETV_CHDN)
KEY_ZOOM=Macro(KDETV_ZOOM)

[End]
