%
% anyremote configuration file for Kaffeine management. (Server-mode)
% thanks to Massimo Robbiati for this configuration file
%
% IMPORTANT!
% This script was developed and tested with Kaffeine 0.8.6
% There are some problems:
% - Kaffeine playlist should be already created;
% - player status could be not correct, "paused" and "playing" status are guessed at start, so the wrong status can be displayed;
% - title of played tracks are not always correct in cd, vcd, dvd and dvb (dcop kaffeine KaffeineIface title does not work always correctly);
% - DVB channel list should be already created ($HOME/.kde/share/apps/kaffeine/channels.dvb).
%
% Thanks to Kaffeine's developers for the great work

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

GuiAppName=Kaffeine v.2
GuiAppBinary=kaffeine
GuiAppRun=echo 'A=`dcop 2> /dev/null|grep kaffeine`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=kaffeine.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=KDE media player. Extended version.

[Protocol]=Server

(Init)=Include($(CfgDir)/Utils/aliases-server.cfg);\
	Make(var,_current_path_,echo $HOME);\
        Make(var,_player_status_,by_value,stopped);\
	Make(var,_dvb_channels_file_, echo "$HOME/.kde/share/apps/kaffeine/channels.dvb");
	
(Connect)=Make(mode,kaffeineMain);

START_KAFFEINE=Exec(echo 'A=`dcop|grep kaffeine`; if [ "x$A" == "x" ]; then kaffeine;fi'|bash -f -s)
PLAYER_SET_PLAY=Make(var,_player_status_,by_value,playing)
PLAYER_SET_PAUSE=Make(var,_player_status_,PLAYER_STATUS=$(_player_status_);if [ $PLAYER_STATUS = paused ]; then echo playing; else echo paused;fi)
PLAYER_STATUS=Make(var,_player_status_,sleep 1;PLAYER_STATUS=$(_player_status_);if [ "$(dcop|grep kaffeine)" = "" ]; then echo ""; else if [ $(dcop kaffeine KaffeineIface isPlaying) = false ]; then echo stopped; else if [ $PLAYER_STATUS = paused ]; then echo paused; else echo playing; fi; fi; fi);ExecAndSet(status,echo $(_player_status_));ExecAndSet(volume, echo $((`dcop kaffeine KaffeineIface getTimePos`*100/`dcop kaffeine KaffeineIface getLength`)))
TOGGLE_FULLSCREEN=Exec(dcop kaffeine KaffeineIface fullscreen)


% Main Interface

MAIN_STATUS=Set(title,Main Menu);Macro(PLAYER_STATUS)

[Mode]=kaffeineMain

(EnterMode)=Macro(START_KAFFEINE);\
	Set(layout,default,ticker);\
	Make(var,_dvb_,sleep 1;if [ "$(dcop kaffeine KaffeineIface | grep playDvb)" = "" ]; then echo ","; else echo ",DVB";fi);\
	Set(icons,Kaffeine,1,folder,2,default,3,default,4,default,5,play,6,default,7,default,8,default,9,default,*,question,0,default,#,no);\
	Set(menu,replace,CD,DVD,VCD$(_dvb_),Close and exit);\
	Timer(MAIN_STATUS,5,0);
(ExitMode)=Timer(MAIN_STATUS,cancel);

Cancel=Exec(dcop kaffeine KaffeineIface quit);Macro(MAIN_STATUS);
Back=Macro(Cancel);

1=Make(mode,openFileMain);
5=Make(mode,kaffeine);
7= ;
8= ;
9= ;

CD=Make(mode,cd);
VCD=Make(mode,vcd);
DVD=Make(mode,dvd);
DVB=Make(mode,dvb);

* 1= ;
* 3= ;
* *=Make(mode,helpMain);
* #= ;
0= ;
#=Macro(Cancel);

Close and exit=Macro(Cancel);

[ModeEnd]

[Mode]=helpMain

((EnterMode)=Set(text,replace,Help,Help:\n 1 - play PLAYLIST\n 2 - play CD\n 3 - play VCD\n 4 - play DVD\n 5 - play DVB\n * - Help\n # - Exit);
(ExitMode)=Set(text,close);
Back=Make(mode,kaffeineMain);

[ModeEnd]

[Mode]=openFileMain

BACK=Make(mode,kaffeineMain)
OPEN_FILE=Make(var,_current_path_,echo '$(_tmp_path_)');Macro(BACK)
LIST=Set(list,replace,Files,..);ExecAndSet(list,add,SAME,cd '$(_tmp_path_)';ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/$/,/')

(EnterMode)=Make(var,_tmp_path_,echo $(_current_path_));Make(var,_is_directory_,echo 1);Macro(LIST);Set(menu,replace,Open,Append file,Open directory);
(ExitMode)=Set(list,close);

Back($$)=Macro(BACK);
%GoTo($$)=Make(var,_tmp_path_,cd '$(_tmp_path_)';if [ -d $(Param) ]; then cd $(Param);fi;pwd);Macro(LIST);
Open($$)=Make(var,_is_directory_,cd '$(_tmp_path_)';if [ -d $(Param) ];then echo 0;else echo 1;fi);\
	Make(var,_tmp_path_,cd '$(_tmp_path_)';if [ -d $(Param) ]; then cd $(Param);fi;pwd);\
	Macro(OPEN_FILE,if [ "$(_is_directory_)" = "0" ];then echo 1;else dcop kaffeine KaffeineIface openURL '$(_tmp_path_)/'$(Param);echo 0;fi);\
	Macro(LIST,echo $(_is_directory_));
Append file($$)=Exec(dcop kaffeine KaffeineIface appendURL '$(_tmp_path_)/'$(Param));Make(var,_current_path_,echo '$(_tmp_path_)');Macro(BACK);
Open directory($$)=Make(var,_is_directory_,cd '$(_tmp_path_)';if [ -d $(Param) ];then echo 0;else echo 1;fi);\
	Macro(OPEN_FILE,if [ "$(_is_directory_)" = "0" ];then dcop kaffeine KaffeineIface openURL '$(_tmp_path_)/'$(Param);echo 0;else echo 1;fi);\
	Macro(LIST,if [ "$(_is_directory_)" = "0" ];then echo 1;else echo 0;fi);

[ModeEnd]

%Standard Interface

KAFFEINE_SETTITLE=ExecAndSet(title,if [ "$(dcop kaffeine KaffeineIface title)" = "" ]; then basename $(dcop kaffeine KaffeineIface getFileName); else echo "$(dcop kaffeine KaffeineIface title) $(dcop kaffeine KaffeineIface album) $(dcop kaffeine KaffeineIface artist)"; fi)
KAFFEINE_STATUS=Macro(PLAYER_STATUS);Macro(KAFFEINE_SETTITLE)

[Mode]=kaffeine

OPEN_FILE=Make(mode,openFile)

((EnterMode)=Macro(START_KAFFEINE);\
	Set(layout,default,ticker,volume);\
	Set(icons,Kaffeine,1,vol_down,2,mute,3,vol_up,4,rewind,5,play,6,forward,7,prev,8,stop,9,next,*,question,0,pause,#,folder);\
	Set(menu,replace,Open file,Toggle fullscreen,Next audio channel, Next subtitle channel,Back);\
	Macro(KAFFEINE_STATUS);\
	Timer(KAFFEINE_STATUS,10,0);
(ExitMode)=Timer(KAFFEINE_STATUS,cancel);

Back=Set(text,close);Make(mode,kaffeineMain);

1=Exec(dcop kaffeine KaffeineIface volDown);
2=Exec(dcop kaffeine KaffeineIface mute);
3=Exec(dcop kaffeine KaffeineIface volUp);

4=Exec(dcop kaffeine KaffeineIface posMinus);
5=Exec(dcop kaffeine KaffeineIface play);Macro(PLAYER_SET_PLAY);Macro(KAFFEINE_STATUS);
6=Exec(dcop kaffeine KaffeineIface posPlus);

7=Exec(dcop kaffeine KaffeineIface previous);Macro(PLAYER_SET_PLAY);Macro(KAFFEINE_STATUS);
8=Exec(dcop kaffeine KaffeineIface stop);Macro(KAFFEINE_STATUS);
9=Exec(dcop kaffeine KaffeineIface next);Macro(PLAYER_SET_PLAY);Macro(KAFFEINE_STATUS);


* 1=;%Exec(dcop kaffeine XinePartIface zoomOut);
* 3=;%Exec(dcop kaffeine XinePartIface zoomIn);

* *=Make(mode,helpStandard);
* #=Exec(echo 'P=`dcop|grep kaffeine`; if [ "x$P" == "x" ]; then kaffeine;sleep 2;dcop kaffeine KaffeineIface setNumber 1; else dcop kaffeine KaffeineIface quit; fi;' |bash -f -s)
0=Exec(dcop kaffeine KaffeineIface pause);Macro(PLAYER_SET_PAUSE);Macro(KAFFEINE_STATUS);
#=Macro(Playlist); %Macro(OPEN_FILE);

% Menu macro

Playlist=Make(mode,kaffeine_playlist);
Open file=Macro(OPEN_FILE);
Toggle fullscreen=Macro(TOGGLE_FULLSCREEN);
Next audio channel=Exec(dcop kaffeine XinePartIface nextAudioChannel);
Next subtitle channel=Exec(dcop kaffeine XinePartIface nextSubtitleChannel);
[ModeEnd]

[Mode]=helpStandard

(EnterMode)=Set(text,replace,Help,Help:\n 1 - volume Down\n 2 - Mute \n 3 - volume Up\n 4 - Rewind\n 5 - Play\n 6 - Fast Forward\n 7 - Previous\n 8 - Stop\n 9 - Next\n * - Help\n 0 - Pause \n # - Playlist);
(ExitMode)=Set(text,close);

Back=Make(mode,kaffeine);

[ModeEnd]

[Mode]=kaffeine_playlist

BACK=Make(mode,kaffeine)

(EnterMode)=Set(list,font,medium);\
	ExecAndSet(list,replace,Playlist,grep url $HOME/.kde/share/apps/kaffeine/playlists/`grep Playlists $HOME/.kde/share/config/kaffeinerc|head -1|sed 's/Playlists=//'`.kaffeine|sed 's/<entry.*url=\"\(.*\)\" album\(.\)*$/\1/'|xargs -i basename {}|sed 's/$/,/');\
	Set(menu,add,Choose);
(ExitMode)=Set(list,close);

Back($$)=Macro(BACK);
Choose($$)=Exec(dcop kaffeine KaffeineIface setNumber `expr $(Index)`);

[ModeEnd]

[Mode]=openFile

BACK=Make(mode,kaffeine)
OPEN_FILE=Make(var,_current_path_,echo '$(_tmp_path_)');Macro(BACK)
LIST=Set(list,replace,Files,..);ExecAndSet(list,add,SAME,cd '$(_tmp_path_)';ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/$/,/')

(EnterMode)=Make(var,_tmp_path_,echo $(_current_path_));Make(var,_is_directory_,echo 1);Macro(LIST);Set(menu,replace,Open,Append file,Open directory);
(ExitMode)=Set(list,close);

Back($$)=Macro(BACK);
%GoTo($$)=Make(var,_tmp_path_,cd '$(_tmp_path_)';if [ -d $(Param) ]; then cd $(Param);fi;pwd);Macro(LIST);
Open($$)=Make(var,_is_directory_,cd '$(_tmp_path_)';if [ -d $(Param) ];then echo 0;else echo 1;fi);\
	Make(var,_tmp_path_,cd '$(_tmp_path_)';if [ -d $(Param) ]; then cd $(Param);fi;pwd);\
	Macro(OPEN_FILE,if [ "$(_is_directory_)" = "0" ];then echo 1;else dcop kaffeine KaffeineIface openURL '$(_tmp_path_)/'$(Param);echo 0;fi);\
	Macro(LIST,echo $(_is_directory_));
Append file($$)=Exec(dcop kaffeine KaffeineIface appendURL '$(_tmp_path_)/'$(Param));Make(var,_current_path_,echo '$(_tmp_path_)');Macro(BACK);
Open directory($$)=Make(var,_is_directory_,cd '$(_tmp_path_)';if [ -d $(Param) ];then echo 0;else echo 1;fi);\
	Macro(OPEN_FILE,if [ "$(_is_directory_)" = "0" ];then dcop kaffeine KaffeineIface openURL '$(_tmp_path_)/'$(Param);echo 0;else echo 1;fi);\
	Macro(LIST,if [ "$(_is_directory_)" = "0" ];then echo 1;else echo 0;fi);

[ModeEnd]

% DVB Interface

DVB_TITLE=ExecAndSet(title,echo $(dcop kaffeine KaffeineIface title))
DVB_STATUS=Macro(PLAYER_STATUS);Macro(DVB_TITLE)
DVB_MENU_1=Set(menu,replace,Channel list,Select channel,Toggle fullscreen,Next audio channel,Next subtitle channel,Back)
DVB_MENU_2=Set(menu,replace,Select channel,Toggle fullscreen,Next audio channel,Next subtitle channel,Back)

[Mode]=dvb

(EnterMode)=Macro(START_KAFFEINE);\
	Set(layout,default,ticker);\
	Set(icons,Kaffeine - DVB,1,vol_down,2,mute,3,vol_up,4,rewind,5,play,6,forward,7,prev,8,stop,9,next,*,question,0,pause,#,file);\
	Macro(DVB_MENU_1);\
	Macro(DVB_STATUS);\
	Timer(DVB_STATUS,10,0);

	%Macro(DVB_MENU_1, echo $(_is_channel_file_));Macro(DVB_MENU_2,if [ $(_is_channel_file_) ];then echo "1";else echo "0";fi);
(ExitMode)=Timer(DVB_STATUS,cancel);

Cancel=Exec(dcop kaffeine KaffeineIface quit);
Back=Set(text,close);Make(mode,kaffeineMain);

1=Exec(dcop kaffeine KaffeineIface volDown);
2=Exec(dcop kaffeine KaffeineIface mute);
3=Exec(dcop kaffeine KaffeineIface volUp);

4=Exec(dcop kaffeine KaffeineIface posMinus);
5=Exec(dcop kaffeine KaffeineIface playDvb);Macro(PLAYER_SET_PLAY);Macro(DVB_STATUS);
6=Exec(dcop kaffeine KaffeineIface posPlus);

7=Exec(dcop kaffeine KaffeineIface previous);Macro(PLAYER_SET_PLAY);Macro(DVB_STATUS);
8=Exec(dcop kaffeine KaffeineIface stop);Macro(DVB_STATUS);
9=Exec(dcop kaffeine KaffeineIface next);Macro(PLAYER_SET_PLAY);Macro(DVB_STATUS);


* 1= ;
* 3= ;

* *=Make(mode,helpDVB);
* #=%Exec(echo 'P=`dcop|grep kaffeine`; if [ "x$P" == "x" ]; then kaffeine;sleep 2;dcop kaffeine KaffeineIface setNumber 1; else dcop kaffeine KaffeineIface quit; fi;' |bash -f -s)
0=Exec(dcop kaffeine KaffeineIface pause);Macro(PLAYER_SET_PAUSE);Macro(DVB_STATUS);
#=Exec(dcop kaffeine KaffeineIface dvbOSD);

%Playlist=Make(mode,kaffeine_playlist)
Select channel=Make(mode,dvb_select_channel);
Channel list=Make(mode,dvb_channel_list);
Toggle fullscreen=Macro(TOGGLE_FULLSCREEN);
Next audio channel=Exec(dcop kaffeine XinePartIface nextAudioChannel);
Next subtitle channel=Exec(dcop kaffeine XinePartIface nextSubtitleChannel);

[ModeEnd]

[Mode]=helpDVB

(EnterMode)=Set(text,replace,Help,Help:\n 1 - Volume Down\n 2 - Mute\n 3 - Volume Up\n 4 - Rewind\n 5 - Play\n 6 - Fast Forward\n 7 - Previous\n 8 - Stop\n 9 - Next\n * - Help\n 0 - Pause\n # - On Screen Display);
(ExitMode)=Set(text,close);

Back=Make(mode,dvb);

[ModeEnd]

[Mode]=dvb_select_channel

BACK=Make(mode,dvb)

(EnterMode)=Set(editfield,Select channel,Insert channel number,1);
(ExitMode)=Set(text,close);

Back($$)=Macro(BACK);
Ok($$)=Exec(dcop kaffeine KaffeineIface setNumber $(Param));Macro(BACK);

[ModeEnd]

[Mode]=dvb_channel_list

BACK=Make(mode,dvb)
LIST=ExecAndSet(list,replace,Channels,grep TV $(_dvb_channels_file_) | cut -f2,20 -d'|'| sed 's/\(^.*|\)\([0-9][0-9]*$\)/\10000\2/g' | sed 's/\(^.*\)|0*\([0-9]\{4\}\)/\2|\1/g' | sort | cut -f2 -d'|'|sed 's/\*//;s/,/\r/g;s/$/,/')

(EnterMode)=Macro(LIST);Set(menu,replace,Choose);
(ExitMode)=Set(list,close);

Back($$)=Macro(BACK);
Choose($$)=Exec(dcop kaffeine KaffeineIface setNumber `grep '|$(Param)|' '$(_dvb_channels_file_)' | cut -f20 -d'|' | head --lines=1`);Macro(BACK);

[ModeEnd]


% CD Interface

CD_SETTITLE=ExecAndSet(title,echo "$(dcop kaffeine KaffeineIface title) $(dcop kaffeine KaffeineIface album) $(dcop kaffeine KaffeineIface artist)")
CD_STATUS=Macro(PLAYER_STATUS);Macro(CD_SETTITLE);

[Mode]=cd

(EnterMode)=Macro(START_KAFFEINE);\
	Set(layout,default,ticker,volume);\
	Set(icons,Kaffeine - CD,1,vol_down,2,mute,3,vol_up,4,rewind,5,play,6,forward,7,prev,8,stop,9,next,*,question,0,pause,#,default);\
	Set(menu,replace,Back);\
	Macro(CD_STATUS);\
	Timer(CD_STATUS,10,0);
(ExitMode)=Timer(CD_STATUS,cancel);

Back=Make(mode,kaffeineMain);

1=Exec(dcop kaffeine KaffeineIface volDown);
2=Exec(dcop kaffeine KaffeineIface mute);
3=Exec(dcop kaffeine KaffeineIface volUp);

4=Exec(dcop kaffeine KaffeineIface posMinus);
5=Exec(dcop kaffeine KaffeineIface playAudioCD);Macro(PLAYER_SET_PLAY);Macro(CD_STATUS);
6=Exec(dcop kaffeine KaffeineIface posPlus);

7=Exec(dcop kaffeine KaffeineIface previous);Macro(PLAYER_SET_PLAY);Macro(CD_STATUS);
8=Exec(dcop kaffeine KaffeineIface stop);Macro(CD_STATUS);
9=Exec(dcop kaffeine KaffeineIface next);Macro(PLAYER_SET_PLAY);Macro(CD_STATUS);


* 1= ;
* 3= ;

* *=Make(mode,helpCD);
* #= %Exec(echo 'P=`dcop|grep kaffeine`; if [ "x$P" == "x" ]; then kaffeine;sleep 2;dcop kaffeine KaffeineIface setNumber 1; else dcop kaffeine KaffeineIface quit; fi;' |bash -f -s)
0=Exec(dcop kaffeine KaffeineIface pause);Macro(PLAYER_SET_PAUSE);Macro(CD_STATUS);
#=%Exec(dcop kaffeine KaffeineIface dvbOSD)

%Playlist=Make(mode,kaffeine_playlist)
Toggle fullscreen=Macro(TOGGLE_FULLSCREEN);

[ModeEnd]

[Mode]=helpCD

(EnterMode)=Set(text,replace,Help,Help:\n 1 - Volume Down\n 2 - Mute\n 3 - Volume Up\n 4 - Rewind\n 5 - Play\n 6 - Fast Forward\n 7 - Previous\n 8 - Stop\n 9 - Next\n * Help\n 0 - Pause);
(ExitMode)=Set(text,close);

Back=Set(text,close);Make(mode,cd);

[ModeEnd]


% VCD Interface

VCD_SETTITLE=ExecAndSet(title,echo "$(dcop kaffeine KaffeineIface title) $(dcop kaffeine KaffeineIface album) $(dcop kaffeine KaffeineIface artist)")
VCD_STATUS=Macro(PLAYER_STATUS);Macro(VCD_SETTITLE)

[Mode]=vcd

(EnterMode)=Macro(START_KAFFEINE);\
	Set(layout,default,ticker,volume);\
	Set(icons,Kaffeine - VCD,1,vol_down,2,mute,3,vol_up,4,rewind,5,play,6,forward,7,prev,8,stop,9,next,*,question,0,pause,#,fullscreen);\
	Set(menu,replace,Toggle fullscreen,Back);\
	Macro(VCD_STATUS);\
	Timer(VCD_STATUS,10,0);
(ExitMode)=Timer(VCD_STATUS,cancel);

Back=Make(mode,kaffeineMain);

1=Exec(dcop kaffeine KaffeineIface volDown);
2=Exec(dcop kaffeine KaffeineIface mute);
3=Exec(dcop kaffeine KaffeineIface volUp);

4=Exec(dcop kaffeine KaffeineIface posMinus);
5=Exec(dcop kaffeine KaffeineIface playVCD);Macro(PLAYER_SET_PLAY);Macro(VCD_STATUS);
6=Exec(dcop kaffeine KaffeineIface posPlus);

7=Exec(dcop kaffeine KaffeineIface previous);Macro(PLAYER_SET_PLAY);Macro(VCD_STATUS);
8=Exec(dcop kaffeine KaffeineIface stop);Macro(VCD_STATUS);
9=Exec(dcop kaffeine KaffeineIface next);Macro(PLAYER_SET_PLAY);Macro(VCD_STATUS);


* 1= ;
* 3= ;

* *=Make(mode,helpVCD);
* #= %Exec(echo 'P=`dcop|grep kaffeine`; if [ "x$P" == "x" ]; then kaffeine;sleep 2;dcop kaffeine KaffeineIface setNumber 1; else dcop kaffeine KaffeineIface quit; fi;' |bash -f -s)
0=Exec(dcop kaffeine KaffeineIface pause);Macro(PLAYER_SET_PAUSE);Macro(VCD_STATUS);
#=Macro(TOGGLE_FULLSCREEN);

%Playlist=Make(mode,kaffeine_playlist)
Toggle fullscreen=Macro(TOGGLE_FULLSCREEN);

[ModeEnd]

[Mode]=helpVCD

(EnterMode)=Set(text,replace,Help,Help:\n 1 - Volume Down\n 2 - Mute\n 3 - Volume Up\n 4 - Rewind\n 5 - Play\n 6 - Fast Forward\n 7 - Previous\n 8 - Stop\n 9 - Next\n * - Help\n 0 - Pause\n # - Toggle fullscreen);
(ExitMode)=Set(text,close);

Back=Make(mode,vcd);

[ModeEnd]

DVD_SETTITLE=ExecAndSet(title,echo "$(dcop kaffeine KaffeineIface title) $(dcop kaffeine KaffeineIface album) $(dcop kaffeine KaffeineIface artist)")
DVD_STATUS=Macro(PLAYER_STATUS);Macro(DVD_SETTITLE)

[Mode]=dvd

(EnterMode)=Macro(START_KAFFEINE);\
	Set(layout,default,ticker,volume);\
	Set(icons,Kaffeine - DVD,1,vol_down,2,mute,3,vol_up,4,rewind,5,play,6,forward,7,prev,8,stop,9,next,*,question,0,pause,#,fullscreen);\
	Set(menu,replace,Toggle fullscreen,Dvd menu,Next audio channel,Next subtitle channel,Back);\
	Timer(DVD_STATUS,10,0);
(ExitMode)=Timer(DVD_STATUS,cancel);

Back=Make(mode,kaffeineMain);

1=Exec(dcop kaffeine KaffeineIface volDown);
2=Exec(dcop kaffeine KaffeineIface mute);
3=Exec(dcop kaffeine KaffeineIface volUp);

4=Exec(dcop kaffeine KaffeineIface posMinus);
5=Exec(dcop kaffeine KaffeineIface playDVD);Macro(PLAYER_SET_PLAY);Macro(DVD_STATUS);
6=Exec(dcop kaffeine KaffeineIface posPlus);

7=Exec(dcop kaffeine KaffeineIface previous);Macro(PLAYER_SET_PLAY);Macro(DVD_STATUS);
8=Exec(dcop kaffeine KaffeineIface stop);Macro(DVD_STATUS);
9=Exec(dcop kaffeine KaffeineIface next);Macro(PLAYER_SET_PLAY);Macro(DVD_STATUS);


* 1= ;
* 3= ;

* *=Make(mode,helpDVD);
* #= %Exec(echo 'P=`dcop|grep kaffeine`; if [ "x$P" == "x" ]; then kaffeine;sleep 2;dcop kaffeine KaffeineIface setNumber 1; else dcop kaffeine KaffeineIface quit; fi;' |bash -f -s)
0=Exec(dcop kaffeine KaffeineIface pause);Macro(PLAYER_SET_PAUSE);Macro(DVD_STATUS);
#=Macro(TOGGLE_FULLSCREEN);

%Playlist=Make(mode,kaffeine_playlist)
Toggle fullscreen=Macro(TOGGLE_FULLSCREEN);
Dvd menu=Make(mode,dvdMenu);
Next audio channel=Exec(dcop kaffeine XinePartIface nextAudioChannel);
Next subtitle channel=Exec(dcop kaffeine XinePartIface nextSubtitleChannel);

[ModeEnd]

[Mode]=helpDVD

(EnterMode)=Set(text,replace,Help,1 - Volume Down\n2 - Mute\n3 - Volume Up\n4 - Rewind\n5 - Play\n6 - Fast Forward\n7 - Previous\n8 - Stop\n9 - Next\n* Help\n0 - Pause\n# - Toggle fullscreen);
(ExitMode)=Set(text,close);

Back=Make(mode,dvd);

[ModeEnd]

[Mode]=dvdMenu

(EnterMode)=Set(icons,Kaffeine - DVD - Menu,1,default,2,up,3,default,4,prev,5,refresh,6,next,7,default,8,down,9,default,*,question,0,fit,#,default);\
	Set(layout,default,ticker);\
	Set(menu,replace,Back);
Back=Make(mode,dvd);

1=;
2=Exec(dcop kaffeine XinePartIface dvdMenuUp);
3=;

4=Exec(dcop kaffeine XinePartIface dvdMenuLeft);
5=Exec(dcop kaffeine XinePartIface dvdMenuSelect);
6=Exec(dcop kaffeine XinePartIface dvdMenuRight);

7=;
8=Exec(dcop kaffeine XinePartIface dvdMenuDown);
9=;


* 1= ;
* 3= ;

* *=Make(mode,helpDVDmenu);
* #=;
0=Exec(dcop kaffeine XinePartIface dvdMenuToggle);;
#=;

[ExitMode]

[Mode]=helpDVDmenu

(EnterMode)=Set(text,replace,Help,2 - Up\n4 - Left\n5 - Ok\n6 - Right\n8 - Down\n0 - Toggle DVD Menu\n* Help);
(ExitMode)=Set(text,close);

Back=Make(mode,dvdMenu);

[ModeEnd]

[End]
