Cleaner solution to plugin-included core files.
[kugel-rb.git] / manual / appendix / wps_tags.tex
blob2c505f90dc70484e684b8ef4a476db87781832d4
1 % $Id$ %
2 \chapter{\label{ref:wps_tags}WPS Tags}
3 \section{Status Bar}
4 \begin{table}
5 \begin{tagmap}{}{}
6 \config{\%we} & Status Bar Enabled\\
7 \config{\%wd} & Status Bar Disabled\\
8 \end{tagmap}
9 \end{table}
10 These tags override the player setting for the display of the status bar.
11 They must be noted on their own line.
13 \section{ID3 Info}
14 \begin{table}
15 \begin{tagmap}{}{}
16 \config{\%ia} & ID3 Artist\\
17 \config{\%ic} & ID3 Composer\\
18 \config{\%id} & ID3 Album Name\\
19 \config{\%ig} & ID3 Genre Name\\
20 \config{\%in} & ID3 Track Number\\
21 \config{\%it} & ID3 Track Title\\
22 \config{\%iv} & ID3 Version (1.0, 1.1, 2.2, 2.3, 2.4 or empty if no id3 tag)\\
23 \config{\%iy} & ID3 Year\\
24 \end{tagmap}
25 \end{table}
26 Remember that this information is not always available, so use the
27 conditionals to show alternate information in preference to assuming.
29 \section{Power Related Information}
30 \begin{table}
31 \begin{tagmap}{}{}
32 \config{\%bl} & Show numeric battery level in percent.\\
33 & Can also be used in a conditional:
34 \config{\%?bl{\textless}-1{\textbar}0{\textbar}1{\textbar}%
35 2{\textbar}\ldots{\textbar}N{\textgreater}}\\
36 & Where the -1 value is used when the battery level isn't
37 known (it usually is).\\
38 \config{\%bv} & Show the battery level in volts\\
39 \config{\%bt} & Show estimated battery time left\\
40 \config{\%bp} & ``p'' if the charger is connected \\
41 & (only on targets that can charge batteries)\\
42 \config{\%bc} & ``c'' if the unit is currently charging the battery\\
43 & (only on targets that have software charge control or monitoring)\\
44 \config{\%bs} & Sleep timer. Shows the remaining time if the sleeptimer is set\\
45 \end{tagmap}
46 \end{table}
48 \section{File Info}
49 \begin{table}
50 \begin{tagmap}{}{}
51 \config{\%fb} & File Bitrate (in kbps)\\
52 \config{\%fc} & File Codec (e.g. ``MP3'' or ``FLAC''). %
53 This tag can also be used in a conditional tag, %
54 \config{\%?fc{\textless}mp1\-{\textbar}mp2\-{\textbar}mp3\-%
55 {\textbar}aiff\-{\textbar}wav\-{\textbar}vorbis\-{\textbar}flac\-%
56 {\textbar}mpc\-{\textbar}a52\-{\textbar}wavpack\-{\textbar}alac\-%
57 {\textbar}aac\-{\textbar}shn\-{\textbar}sid\-{\textbar}adx\-%
58 {\textbar}unknown{\textgreater}}.\\
59 & The codec order is as follows: MP1, MP2, MP3, AIFF, WAV,%
60 Ogg Vorbis (OGG), FLAC, MPC, AC3, WavPack (WV), ALAC, AAC,%
61 Shorten (SHN), SID, ADX, NSF, Speex, SPC, APE.\\
62 \config{\%ff} & File Frequency (in Hz)\\
63 \config{\%fm} & File Name\\
64 \config{\%fn} & File Name (without extension)\\
65 \config{\%fp} & File Path\\
66 \config{\%fs} & File Size (In Kilobytes)\\
67 \config{\%fv} & ``(avg)'' if variable bit rate or ``'' if constant bit rate\\
68 \config{\%d1} & First directory from end of file path.\\
69 \config{\%d2} & Second directory from end of file path.\\
70 \config{\%d3} & Third directory from end of file path.\\
71 \end{tagmap}
72 \end{table}
73 Example for the \config{\%dN} commands: If the path is
74 ``/Rock/Kent/Isola/11 - 747.mp3'', \config{\%d1} is ``Isola'',
75 \config{\%d2} is ``Kent'' \dots{} You get the picture.
77 \section{Playlist/Song Info}
78 \begin{table}
79 \begin{tagmap}{}{}
80 \config{\%pb} & Progress Bar\\
81 \opt{player}{
82 & This will display a 1 character ``cup'' %
83 that empties as the time progresses.}
84 \opt{lcd_bitmap}{
85 & This will replace the entire line with a progress bar. \\
86 & You can set the height, position and width of the progressbar %
87 (in pixels): \config{\%pb{\textbar}height{\textbar}leftpos%
88 {\textbar}rightpos{\textbar}toppos{\textbar}}} \\
89 \opt{player}{%
90 \config{\%pf} & Full-line progress bar \& time display\\
92 \config{\%px} & Percentage Played In Song\\
93 \config{\%pc} & Current Time In Song\\
94 \config{\%pe} & Total Number of Playlist Entries\\
95 \nopt{player}{%
96 \config{\%pm} & Peak Meter. The entire line is used as %
97 volume peak meter.\\%
99 \config{\%pn} & Playlist Name (Without path or extension)\\
100 \config{\%pp} & Playlist Position\\
101 \config{\%pr} & Remaining Time In Song\\
102 \config{\%ps} & Shuffle. Shows 's' if shuffle mode is enabled.\\
103 \config{\%pt} & Total Track Time\\
104 \config{\%pv} & Current volume (x dB). Can also be used in a conditional: \\
105 & \config{\%?pv{\textless}0{\textbar}1{\textbar}2{\textbar}\ldots%
106 {\textbar}N{\textgreater}}\\
107 \end{tagmap}
108 \end{table}
110 \section{Runtime Database}
111 \begin{table}
112 \begin{tagmap}{}{}
113 \config{\%rp} & Song playcount\\
114 \config{\%rr} & Song rating (0-10). This tag can also be used in a conditional tag, %
115 \config{\%?rr{\textless}0{\textbar}1{\textbar}2{\textbar}3{\textbar}%
116 4{\textbar}5{\textbar}6{\textbar}7{\textbar}8{\textbar}9{\textbar}%
117 10{\textgreater}}\\
118 \end{tagmap}
119 \end{table}
121 \opt{swcodec}{
122 \section{Sound (DSP) settings}
123 \begin{table}
124 \begin{tagmap}{}{}
125 \config{\%Sp} & Display current playback pitch \\
126 \opt{swcodec}{
127 \config{\%xf} & Crossfade setting, in the order: Off, Shuffle, Skip, Always\\
128 \config{\%rg} & ReplayGain value in use (x.y dB). If used as a conditional,
129 Replaygain type in use: \config{\%?rg{\textless}Off{\textbar}Track%
130 {\textbar}Album{\textbar}TrackShuffle{\textbar}AlbumShuffle%
131 {\textbar}No tag{\textgreater}}\\
133 \end{tagmap}
134 \end{table}
136 \opt{h100,h300}{
137 \section{Hold Switches}
138 \begin{table}
139 \begin{tagmap}{}{}
140 \config{\%mh} & ``h'' if the main unit hold switch is on\\
141 \config{\%mr} & ``r'' if the remote hold switch is on\\
142 \end{tagmap}
143 \end{table}
146 \section{Virtual LED}
147 \begin{table}
148 \begin{tagmap}{}{}
149 \config{\%lh} & ``h'' if the \disk\ is accessed\\
150 \end{tagmap}
151 \end{table}
153 \section{Repeat Mode}
154 \begin{table}
155 \begin{tagmap}{}{}
156 \config{\%mm} & Repeat mode, 0-4, in the order: Off, All, One, Shuffle
157 \opt{player,recorder,recorderv2fm}{, A-B}\\
158 \end{tagmap}
159 \end{table}
160 Example: \config{\%?mm{\textless}Off{\textbar}All{\textbar}One{\textbar}Shuffle%
161 {\textbar}A-B{\textgreater}}
163 \section{Playback Mode Tags}
164 \begin{table}
165 \begin{tagmap}{}{}
166 \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause,
167 Fast forward, Rewind\\
168 \end{tagmap}
169 \end{table}
170 Example: \config{\%?mp{\textless}Stop{\textbar}Play{\textbar}Pause{\textbar}%
171 Ffwd{\textbar}Rew{\textgreater}}
173 \section{Changing Volume}
174 \begin{table}
175 \begin{tagmap}{}{}
176 \config{\%mv[t]} & ``v'' if the volume is being changed\\
177 \end{tagmap}
178 \end{table}
180 The tag produces the letter ``v'' while the volume is being changed and some
181 amount of time after that, i.e. after the volume button has been released. The
182 optional parameter \config{t} specifies that amout of time. If it is not
183 specified, 1 sec is assumed.
185 The tag can be used as the switch in a conditional tag to display different things
186 depending on whether the volume is being changed. It can produce neat effects
187 when used with conditional viewports.
189 Example: \config{\%?mv2.5{\textless}Volume changing{\textbar}\%pv{\textgreater}}
191 The example above will display the text ``Volume changing'' if the volume is
192 being changed and 2.5 secs after the volume button has been released. After
193 that, it will display the volume value.
195 \section{Settings}
196 \begin{table}
197 \begin{tagmap}{}{}
198 \config{\%St{\textbar}<setting name>{\textbar}} & Display the value of any Rockbox setting\\
199 \end{tagmap}
200 \end{table}
201 Example: Can be used as a simple tag \config{\%St{\textbar}skip length{\textbar}} or with conditionals
202 \config{\%?St{\textbar}eq enabled{\textbar}{\textless}Equalizer is enabled{\textbar}Equalizer is disabled{\textgreater}}.
204 \section{Images}
205 \begin{table}
206 \begin{tagmap}{}{}
207 \nopt{archos}{%
208 \config{\%X{\textbar}filename.bmp{\textbar}}
209 & Load and set a backdrop image for the WPS.
210 This image must be exactly the same size as your LCD.\\
212 \config{\%P{\textbar}filename.bmp{\textbar}}
213 & Load a Progress bar image for the WPS. Use \config{\%pb} tag to show the
214 progress bar\\
215 \config{\%x{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}}
216 & Load and display an image\\
217 & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\
218 & \config{filename}: filename relative to \fname{/.rockbox/} and including .bmp\\
219 & \config{x}: x coordinate\\
220 & \config{y}: y coordinate.\\
221 \config{\%xl{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}[nimages{\textbar}]}
222 & Preload an image for later display (useful for when your images are displayed conditionally)\\
223 & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\
224 & \config{filename}: filename relative to \fname{/.rockbox/} and including .bmp\\
225 & \config{x}: x coordinate\\
226 & \config{y}: y coordinate.\\
227 & \config{nimages}: (optional) number of sub-images (tiled vertically, of the same height)
228 contained in the bitmap. Default is 1.\\
229 \config{\%xdn[i]} & Display a preloaded image\\
230 & \config{n}: image ID (a-z and A-Z) as it was specified in \config{\%x} or \config{\%xl}\\
231 & \config{i}: (optional) number of the sub-image to display (a-z for 1-26 and A-Z for 27-52).
232 By default the first (i.e. top most) sub-image will be used.\\
233 \end{tagmap}
234 \end{table}
236 Examples:
237 \begin{enumerate}
238 \item Load and display the image \fname{/.rockbox/bg.bmp} with ID ``a'' at 37, 109:\\
239 \config{\%x{\textbar}a{\textbar}bg.bmp{\textbar}37{\textbar}109{\textbar}}
240 \item Load a bitmap strip containing 5 volume icon images (all the same size)
241 with image ID ``M'', and then reference the individual sub-images in a conditional:\\
242 \config{\%xl{\textbar}M{\textbar}volume.bmp{\textbar}134{\textbar}153{\textbar}5{\textbar}}\\
243 \config{\%?pv<\%xdMa{\textbar}\%xdMb{\textbar}\%xdMc{\textbar}\%xdMd{\textbar}%
244 \%xdMe>}
245 \end{enumerate}
248 \note{
249 \begin{itemize}
250 \item The images must be in a rockbox compatible format (1 bit per pixel BMP)
251 \item The image tag must be on its own line
252 \item The ID is case sensitive, giving 52 different ID's
253 \item The size of the LCD screen for each player varies. See table below
254 for appropriate sizes of each device. The x and y coordinates must
255 repect each of the players' limits.
256 \end{itemize}
259 \section{Alignment}
260 \begin{table}
261 \begin{tagmap}{}{}
262 \config{\%al} & Text is left aligned\\
263 \config{\%ac} & Text is center aligned\\
264 \config{\%ar} & Text is right aligned\\
265 \end{tagmap}
266 \end{table}
267 All alignment tags may be present in one line, but they need to be in the
268 order left -- center -- right. If the aligned texts overlap, they are merged.
270 \section{Conditional Tags}
272 \begin{table}
273 \begin{tagmap}{}{}
274 \config{\%?xx{\textless}true{\textbar}false{\textgreater}}
275 & If / Else: Evaluate for true or false case \\
276 \config{\%?xx{\textless}alt1{\textbar}alt2{\textbar}alt3{\textbar}\dots{\textbar}else{\textgreater}}
277 & Enumerations: Evaluate for first / second / third / \dots / last condition \\
278 \end{tagmap}
279 \end{table}
281 \opt{rtc}{
282 \section{Real Time Clock}
283 \begin{table}
284 \begin{tagmap}{}{}
285 \config{\%cd} & Day of month\\
286 \config{\%ce} & Zero padded day of month\\
287 \config{\%cH} & Zero padded hour from 00 to 24\\
288 \config{\%ck} & Hour from 0 to 24\\
289 \config{\%cI} & Zero padded hour from 12 to 12\\
290 \config{\%cl} & Hour from 12 to 12\\
291 \config{\%cm} & Month\\
292 \config{\%cM} & Minutes\\
293 \config{\%cS} & Seconds\\
294 \config{\%cy} & 2-digit year\\
295 \config{\%cY} & 4-digit year\\
296 \config{\%cP} & Capital AM/PM\\
297 \config{\%cp} & Lowercase am/pm\\
298 \config{\%ca} & Weekday name\\
299 \config{\%cb} & Month name\\
300 \config{\%cu} & Day of week from 1 to 7, 1 is Monday\\
301 \config{\%cw} & Day of week from 0 to 6, 0 is Sunday\\
302 \end{tagmap}
303 \end{table}
306 \section{Other Tags}
307 \begin{table}
308 \begin{tagmap}{}{}
309 \config{\%\%} & Display a `\%'\\
310 \config{\%{\textless}} & Display a `{\textless}'\\
311 \config{\%{\textbar}} & Display a `{\textbar}'\\
312 \config{\%{\textgreater}} & Display a `{\textgreater}'\\
313 \config{\%;} & Display a `;'\\
314 \config{\%s} & Indicate that the line should scroll. Can occur
315 anywhere in a line (given that the text is
316 displayed; see conditionals above). You can specify
317 up to 10 scrolling lines. Scrolling lines can not
318 contain dynamic content such as timers, peak meters
319 or progress bars.\\
320 \end{tagmap}
321 \end{table}