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

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

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=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,D=`dcop|grep kdetv`;dcop $D KdetvIface channelNumber;dcop $D KdetvIface channelName)
KDETV_VOLDOWN=Exec(D=`dcop|grep kdetv`;dcop $D KdetvIface volumeDown)
KDETV_MUTE   =Exec(D=`dcop|grep kdetv`;dcop $D KdetvIface toggleMute)
KDETV_VOLUP  =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);

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);\
    Make(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
KEY_VOLUMEDOWN=Macro(KDETV_VOLDOWN)
KEY_MIN_INTERESTING=Macro(KDETV_MUTE)
KEY_VOLUMEUP=Macro(KDETV_VOLUP)

KEY_CHANNELUP=Macro(KDETV_CHUP)
KEY_CHANNELDOWN=Macro(KDETV_CHDN)
KEY_ZOOM=Macro(KDETV_ZOOM)
 
[End]
