1%
2% anyremote configuration file for Xine management. (Server-mode Command Fusion iViewer)
3% prerequisites: Iviewer client installed on Ipod touch/Iphone 2.x and Iviewer free winamp GUI
4%
5
6% STATUS stable
7% XTEST no
8% SOUND mixer
9% ENV no
10
11GuiAppName=Xine
12GuiAppBinary=true
13GuiAppRun= P=`ps -ef|grep xine|grep -v grep|grep -v anyremote|grep -v edit|grep -v xinetd`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi
14GuiAppIcon=xine.png
15GuiAppType=Application
16GuiAppProtocols=iViewer
17GuiAppDesc=Xine is a free multimedia player. It plays back CDs, DVDs, and VCDs.
18
19[Protocol]=iViewer
20
21%a1 = volume
22%a2 = needs a constent update to. its the seek bar
23
24%s1 = artist
25%s2 = track
26%s5 = current playback in min:sec
27%s6 = song length min:sec.
28
29% play
30d1(1)=Exec(xine-remote -c play);
31
32% stop
33d30(1)=Exec(xine-remote -c stop);
34
35% pause
36d31(1)=Exec(xine-remote -c pause);
37
38% next
39d5(1)=Exec(xine-remote -c "seek +10");\
40	Macro(TITLE);
41
42% prev
43d6(1)=Exec(xine-remote -c "seek -10");\
44	Macro(TITLE);
45
46% toggle repeat
47d12(1)=Exec(echo "Toggle repeat")
48
49% toggle shuffle
50d9(1)=Exec(echo "Toggle shuffle")
51
52% volume contol
53a1($$)=Make(var,default_mixer_value,by_value,$(Index));\
54        Macro(DEFAULT_VOLUME_SET);\
55	Macro(VOLUME);
56
57% seek >> and <<
58a2($$)=Make(var,seek,echo "$(Index)*100/65535"|bc);\
59	Exec(echo "got $(Index)");\
60        Exec(echo "set position to $(seek)%");\
61	Macro(PLAYBACK);
62
63% Feedback
64PLAYBACK=\
65	Send(string,s5=);ExecAndSend(string,echo "01:00");Send(bytes,3);\
66        Make(var,playback_persent,echo "65535*"`echo 50`"/100"|bc);\
67        Send(string,a2=$(playback_persent));Send(bytes,3);
68
69% get volume: 0 - 65535
70VOLUME=\
71	Macro(DEFAULT_VOLUME_GET);\
72        Send(string,a1=$(default_mixer_value));Send(bytes,3);
73
74% Artist name
75ARTIST=\
76	ExecAndSend(string,echo "Artist is ...");
77
78% Track
79TRACK=\
80	ExecAndSend(string,echo "Track is ...");
81
82% Song length mm:ss
83SONG_LEN=\
84	ExecAndSend(string,echo "00:00");
85
86%
87% The following is a common part. In general, it should not be changed.
88%
89
90TITLE=\
91	Send(string,s1=);Macro(ARTIST);Send(bytes,3);\
92	Send(string,s2=);Macro(TRACK);Send(bytes,3);\
93	Send(string,s6=);Macro(SONG_LEN);Send(bytes,3);
94
95d5(0)=Macro(TITLE);
96d6(0)=Macro(TITLE);
97
98% Init
99i(1)=Macro(TITLE);
100
101% Password p(PASSWORD)"
102p($$)=Send(string,p=ok);Send(bytes,3);
103
104% Heartbeat
105DISC=\
106	Macro(STOP_TIMERS);\
107	Make(disconnect);
108
109h(0)=Timer(DISC,reset);
110
111% no needs to send "h=1\03" replay directly because this will be done
112% automatically - that controlled by $(IViewer) variable
113% If $(IViewer) variable is not set it needs to use the following command:
114% h(0)=Send(bytes,104,61,49,3);Timer(DISC,reset);
115
116STOP_TIMERS=\
117	Timer(PLAYBACK,cancel);\
118	Timer(VOLUME,cancel);\
119	Timer(TITLE,cancel);
120
121(Init)=\
122	Include($(CfgDir)/Utils/aliases-iviewer.cfg);\
123	Macro(SETUP_DEFAULT_MIXER);\
124	Make(var,IViewer,by_value,true);\
125	Exec(if [ -f $HOME/.xine/passwd ]; then true; else echo "ALL:ALLOW" > $HOME/.xine/passwd; fi);
126
127% Event timers
128(Connect)=\
129	Exec(P=`ps -ef|grep xine|grep -v grep|grep -v anyremote|grep -v edit|grep -v xinetd`; if [ "x$P" = "x" ]; then xine -n; fi);
130	Timer(DISC,10,1);\
131	Timer(PLAYBACK,3,0);\
132	Timer(VOLUME,10,0);\
133	Timer(TITLE,5,0);
134
135(Disconnect)=\
136	Macro(STOP_TIMERS);
137
138[End]
139
140