1%
2% anyremote configuration file for VLC management. (Server-mode CommandFusion iViewer emulation)
3% prerequisites: Iviewer client installed on Ipod touch/Iphone 2.x and Iviewer free winamp GUI
4%
5
6% STATUS nonstable
7% XTEST yes
8% SOUND mixer
9% ENV no
10
11GuiAppName=VLC
12GuiAppBinary=vlc
13GuiAppRun= P=`ps -ef|grep vlc|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi
14GuiAppIcon=vlc.png
15GuiAppType=Application
16GuiAppProtocols=iViewer
17GuiAppDesc=VLC media player is a highly portable multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols.
18
19[Protocol]=iViewer
20
21% Init update
22%T current title
23%M song len mm:ss
24%m playback time mm:ss
25%p playback time in persents
26%S song len sec
27
28%s1 = artist
29%s2 = track
30
31%s6 = song length min:sec.
32%s5 = current playback in min:sec
33%a2 = needs a constent update to. its the seek bar
34%a1 = volume
35
36% play/pause
37d1(1)=Exec($(vlc_dbus) org.mpris.MediaPlayer2.Player.Play);
38
39% next
40d5(1)=Exec($(vlc_dbus) org.mpris.MediaPlayer2.Player.Next);
41
42% prev
43d6(1)=Exec($(vlc_dbus) org.mpris.MediaPlayer2.Player.Previous);
44
45% toggle repeat
46d12(1)=Make(none);
47
48% toggle shuffle
49d9(1)=Make(none);
50
51% volume contol
52a1($$)=\
53	Make(var,default_mixer_value,by_value,$(Index));\
54	Macro(DEFAULT_VOLUME_SET);\
55	Macro(VOLUME);
56
57% seek >> and <<
58a2($$)=\
59	Make(var,seek_command,if [ $(Index) \> 32750 ]; then echo VLC_SEEK_FWD; else echo VLC_SEEK_RW; fi);\
60	Macro($(seek_command));\
61	Macro(PLAYBACK);
62
63% Feedback
64PLAYBACK=\
65	Make(none)
66
67VLC_SEEK_FWD=\
68	Emulate(keydown,Alt_L,key,Right,keyup,Alt_L);
69
70VLC_SEEK_RW=\
71	Emulate(keydown,Alt_L,key,Left,keyup,Alt_L);
72
73% get volume: 0 - 65535
74VOLUME=\
75	Macro(DEFAULT_VOLUME_GET);\
76        Send(string,a1=$(default_mixer_value));\
77	Send(bytes,3);
78
79% Artist name
80ARTIST=\
81	ExecAndSend(string,echo "");
82
83% Track
84TRACK=\
85	ExecAndSend(string,echo "");
86
87% Song length sec
88SONG_LEN=\
89	ExecAndSend(string,echo "");
90
91%
92% The following is a common part. In general, it should not be changed.
93%
94
95TITLE=\
96	Send(string,s1=);Macro(ARTIST);Send(bytes,3);\
97	Send(string,s2=);Macro(TRACK);Send(bytes,3);\
98	Send(string,s6=);Macro(SONG_LEN);Send(bytes,3);
99
100d5(0)=Macro(TITLE);
101d6(0)=Macro(TITLE);
102
103% Init
104i(1)=Macro(TITLE);\
105	Macro(VOLUME);
106
107% Password p(PASSWORD)"
108p($$)=Send(string,p=ok);Send(bytes,3);
109
110% Heartbeat
111DISC=\
112	Macro(STOP_TIMERS);\
113	Make(disconnect);
114
115h(0)=Timer(DISC,reset);
116
117% no needs to send "h=1\03" replay directly because this will be done
118% automatically - that controlled by $(IViewer) variable
119% If $(IViewer) variable is not set it needs to use the following command:
120% h(0)=Send(bytes,104,61,49,3);Timer(DISC,reset);
121
122STOP_TIMERS=\
123	Timer(PLAYBACK,cancel);\
124	Timer(VOLUME,cancel);\
125	Timer(TITLE,cancel);
126
127% Event timers
128(Init)=\
129	Include($(CfgDir)/Utils/aliases-iviewer.cfg);\
130	Macro(SETUP_DEFAULT_MIXER);\
131	Make(var,IViewer,by_value,true);
132
133(Connect)= \
134	Exec(P=`ps -ef|grep vlc|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" = "x" ]; then vlc& fi);\
135	Make(var,vlc_dbus,by_value,qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2);\
136	Timer(DISC,10,1);\
137	Timer(PLAYBACK,3,0);\
138	Timer(VOLUME,10,0);\
139	Timer(TITLE,5,0);
140
141
142(Disconnect)=\
143	Macro(STOP_TIMERS);
144
145[End]
146
147