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

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

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

[Protocol]=Server

(Init)=Include($(CfgDir)/Utils/aliases-server.cfg);
(Connect)=Make(mode,kdetv);

KDETV_SET_TITLE=ExecAndSet(title,echo 'D=`dcop|grep kdetv`;dcop $D KdetvIface channelNumber;dcop $D KdetvIface channelName'|bash -f -s)
KDETV_VOLDOWN=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_VOLUP  =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);

KDETV_MENU=Set(menu,replace,Close and exit);Macro(ALLIN1MENU)

[Mode]=kdetv

(EnterMode)=\
	Exec(A=`dcop 2> /dev/null|grep kdetv`;if [ "x$A" = "x" ]; then kdetv 2> /dev/null; fi);\
	Macro(KDETV_SET_TITLE);\
	Set(status,KdeTV);\
	Set(layout,default);\
	Set(icons,KdeTV,\
		1,default,2,default,3,default,\
		4,default,5,default,6,default,\
		7,default,8,default,9,default,\
		#,refresh,0,default,*,question);\
	Macro(KDETV_MENU);
	
Cancel=Exec(D=`dcop|grep kdetv`;dcop $D MainApplication-Interface quit);Exit
Close and exit=Macro(Cancel);

Back=Set(text,close);\
	Macro(KDETV_MENU);

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

* *=Set(text,replace,Help,Press numeric buttons to choose channel)
* #=Exec(D=`dcop|grep kdetv`; if [ "x$D" = "x" ]; then kdetv 2> /dev/null; else dcop $D MainApplication-Interface quit; fi)
#=Make(mode,kdetv2);

[ModeEnd]

[Mode]=kdetv2

(EnterMode)=\
	Set(icons,KdeTV,\
		1,vol_down,2,mute,3,vol_up,\
		4,prev,5,fullscreen,6,next,\
		7,default,8,default,9,default,\
		0,no,#,refresh,*,question);\
	Macro(ALLIN1MENU);

(ExitMode)=\
	Set(status,KdeTV);

Back=\
	Set(text,close);\
	Macro(KDETV_MENU);

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

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

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

* *=Set(text,replace,Help,1 - Vol-\n2 - Mute\n3 - Vol+\n4 - Ch-\n5 - Fullscreen\n6 - Ch +\n** - Help\n# - Direct)
0=Exec(D=`dcop 2> /dev/null|grep kdetv`;dcop $D MainApplication-Interface quit)
#=Make(mode,kdetv)

[ModeEnd]

% Aliases for AverMedia IR remote
VOLUMEDOWN=Macro(KDETV_VOLDOWN)
MIN_INTERESTING=Macro(KDETV_MUTE)
VOLUMEUP=Macro(KDETV_VOLUP)

CHANNELUP=Macro(KDETV_CHUP)
CHANNELDOWN=Macro(KDETV_CHDN)
ZOOM=Macro(KDETV_ZOOM)

TEXT=Macro(*)
POWER=Macro(#)
 
[End]
