FS#8961 - Anti-Aliased Fonts.
[kugel-rb.git] / manual / appendix / wps_tags.tex
blob9be085d01a1a918bb9e271b86f466f6acaace965
1 % $Id$ %
2 \chapter{\label{ref:wps_tags}WPS Tags}
3 \section{Status Bar}
4 \begin{table}
5 \begin{tagmap}{}{}
6 \config{\%we} & Display Status Bar\\
7 \config{\%wd} & Hide Status Bar\\
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 (which will not be shown in the WPS).
13 \section{Information from the track tags}
14 \begin{table}
15 \begin{tagmap}{}{}
16 \config{\%ia} & Artist\\
17 \config{\%ic} & Composer\\
18 \config{\%id} & Album Name\\
19 \config{\%ig} & Genre Name\\
20 \config{\%in} & Track Number\\
21 \config{\%it} & Track Title\\
22 \config{\%iv} & ID3 version (1.0, 1.1, 2.2, 2.3, 2.4, or empty if not an ID3 tag)\\
23 \config{\%iy} & 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 These tags, when written with a capital ``I'' (e.g. \config{\%Ia} or \config{\%Ic}),
30 produce the information for the next song to be played.
32 \section{Power Related Information}
33 \begin{table}
34 \begin{tagmap}{}{}
35 \config{\%bl} & Numeric battery level in percents\\
36 & Can also be used in a conditional:
37 \config{\%?bl{\textless}-1{\textbar}0{\textbar}1{\textbar}%
38 2{\textbar}\ldots{\textbar}N{\textgreater}},
39 where the value $-1$ is used when the battery level isn't
40 known (it usually is)\\
41 \config{\%bv} & The battery level in volts\\
42 \config{\%bt} & Estimated battery time left\\
43 \config{\%bp} & ``p'' if the charger is connected (only on targets
44 that can charge batteries)\\
45 \config{\%bc} & ``c'' if the unit is currently charging the battery (only on
46 targets that have software charge control or monitoring)\\
47 \config{\%bs} & Remaining time of the sleep timer (if it is set)\\
48 \end{tagmap}
49 \end{table}
51 \section{Information about the file}
52 \begin{table}
53 \begin{tagmap}{}{}
54 \config{\%fb} & File Bitrate (in kbps)\\
55 \config{\%fc} & File Codec (e.g. ``MP3'' or ``FLAC''). %
56 This tag can also be used in a conditional tag, %
57 \config{\%?fc{\textless}mp1\-{\textbar}mp2\-{\textbar}mp3\-%
58 {\textbar}aiff\-{\textbar}wav\-{\textbar}ogg\-{\textbar}flac\-%
59 {\textbar}mpc\-{\textbar}a52\-{\textbar}wavpack\-{\textbar}alac\-%
60 {\textbar}aac\-{\textbar}shn\-{\textbar}sid\-{\textbar}adx\-%
61 {\textbar}nsf\-{\textbar}speex\-{\textbar}spc\-{\textbar}ape\-%
62 {\textbar}wma\-{\textbar}mod\-{\textbar}sap%
63 {\textbar}unknown{\textgreater}}.\\
64 & The codec order is as follows: MP1, MP2, MP3, AIFF, WAV,
65 Ogg Vorbis (OGG), FLAC, MPC, AC3, WavPack (WV), ALAC, AAC,
66 Shorten (SHN), SID, ADX, NSF, Speex, SPC, APE, WMA, MOD, SAP.\\
67 \config{\%ff} & File Frequency (in Hz)\\
68 \config{\%fm} & File Name\\
69 \config{\%fn} & File Name (without extension)\\
70 \config{\%fp} & File Path\\
71 \config{\%fs} & File Size (in Kilobytes)\\
72 \config{\%fv} & ``(avg)'' if variable bit rate or empty string if constant bit rate\\
73 \config{\%d1} & First directory from the end of the file path\\
74 \config{\%d2} & Second directory from the end of the file path\\
75 \config{\%d3} & Third directory from the end of the file path\\
76 \end{tagmap}
77 \end{table}
78 Example for the \config{\%dN} commands: If the path is
79 ``/Rock/Kent/Isola/11 - 747.mp3'', \config{\%d1} is ``Isola'',
80 \config{\%d2} is ``Kent'' and \config{\%d3} is ``Rock''.
82 These tags, when written with the first letter capitalized (e.g. \config{\%Fn} or \config{\%D2}),
83 produce the information for the next file to be played.
85 \section{Playlist/Song Info}
86 \begin{table}
87 \begin{tagmap}{}{}
88 \config{\%pb} & Progress Bar\\
89 \opt{player}{
90 & This will display a one character ``cup''
91 that empties as the time progresses.}
92 \opt{lcd_bitmap}{
93 & This will replace the entire line with a progress bar. \\
94 & You can set the height, position and width of the progressbar %
95 (in pixels): \config{\%pb{\textbar}height{\textbar}leftpos%
96 {\textbar}rightpos{\textbar}toppos{\textbar}}} \\
97 \opt{player}{%
98 \config{\%pf} & Full-line progress bar \& time display\\
100 \config{\%px} & Percentage Played In Song\\
101 \config{\%pc} & Current Time In Song\\
102 \config{\%pe} & Total Number of Playlist Entries\\
103 \nopt{player}{%
104 \config{\%pm} & Peak Meter. The entire line is used as %
105 volume peak meter.\\%
107 \config{\%pn} & Playlist Name (without path or extension)\\
108 \config{\%pp} & Playlist Position\\
109 \config{\%pr} & Remaining Time In Song\\
110 \config{\%ps} & ``s'' if shuffle mode is enabled\\
111 \config{\%pt} & Total Track Time\\
112 \config{\%pv} & Current volume (in dB). Can also be used in a conditional: \\
113 & \config{\%?pv{\textless}0{\textbar}1{\textbar}2{\textbar}\ldots%
114 {\textbar}N{\textgreater}}\\
115 & 0 is used for mute, the last option is used for values greater than zero.\\
116 \end{tagmap}
117 \end{table}
119 \section{Runtime Database}
120 \begin{table}
121 \begin{tagmap}{}{}
122 \config{\%rp} & Song playcount\\
123 \config{\%rr} & Song rating (0-10). This tag can also be used in a conditional tag: %
124 \config{\%?rr{\textless}0{\textbar}1{\textbar}2{\textbar}3{\textbar}%
125 4{\textbar}5{\textbar}6{\textbar}7{\textbar}8{\textbar}9{\textbar}%
126 10{\textgreater}}\\
127 \end{tagmap}
128 \end{table}
130 \opt{swcodec}{
131 \section{Sound (DSP) settings}
132 \begin{table}
133 \begin{tagmap}{}{}
134 \config{\%Sp} & Current playback pitch \\
135 \opt{swcodec}{
136 \config{\%xf} & Crossfade setting, in the order: Off, Shuffle, Skip, Always\\
137 \config{\%rg} & ReplayGain value in use (x.y dB). If used as a conditional,
138 Replaygain type in use: \config{\%?rg{\textless}Off{\textbar}Track%
139 {\textbar}Album{\textbar}TrackShuffle{\textbar}AlbumShuffle%
140 {\textbar}No tag{\textgreater}}\\
142 \end{tagmap}
143 \end{table}
146 % this will not include the "remote hold switch" tag for targets lacking
147 % a main unit hold switch
148 \opt{hold_button}{
149 \opt{remote_button_hold}{
150 \section{Hold Switches}
151 \begin{table}
152 \begin{tagmap}{}{}
153 \config{\%mh} & ``h'' if the main unit hold switch is on\\
154 \config{\%mr} & ``r'' if the remote hold switch is on\\
155 \end{tagmap}
156 \end{table}
158 \nopt{remote_button_hold}{
159 \section{Hold Switch}
160 \begin{table}
161 \begin{tagmap}{}{}
162 \config{\%mh} & ``h'' if the hold switch is on\\
163 \end{tagmap}
164 \end{table}
168 \section{Virtual LED}
169 \begin{table}
170 \begin{tagmap}{}{}
171 \config{\%lh} & ``h'' if the \disk\ is accessed\\
172 \end{tagmap}
173 \end{table}
175 \section{Repeat Mode}
176 \begin{table}
177 \begin{tagmap}{}{}
178 \config{\%mm} & Repeat mode, 0-4, in the order: Off, All, One, Shuffle
179 \opt{player,recorder,recorderv2fm}{, A-B}\\
180 \end{tagmap}
181 \end{table}
182 Example: \config{\%?mm{\textless}Off{\textbar}All{\textbar}One{\textbar}Shuffle%
183 {\textbar}A-B{\textgreater}}
185 \section{Playback Mode Tags}
186 \begin{table}
187 \begin{tagmap}{}{}
188 \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause,
189 Fast Forward, Rewind\\
190 \end{tagmap}
191 \end{table}
192 Example: \config{\%?mp{\textless}Stop{\textbar}Play{\textbar}Pause{\textbar}%
193 Ffwd{\textbar}Rew{\textgreater}}
195 \section{Changing Volume}
196 \begin{table}
197 \begin{tagmap}{}{}
198 \config{\%mv[t]} & ``v'' if the volume is being changed\\
199 \end{tagmap}
200 \end{table}
202 The tag produces the letter ``v'' while the volume is being changed and some
203 amount of time after that, i.e. after the volume button has been released. The
204 optional parameter \config{t} specifies that amount of time, in seconds. If it
205 is not specified, 1 second is assumed.
207 The tag can be used as the switch in a conditional tag to display different things
208 depending on whether the volume is being changed. It can produce neat effects
209 when used with conditional viewports.
211 Example: \config{\%?mv2.5{\textless}Volume changing{\textbar}\%pv{\textgreater}}
213 The example above will display the text ``Volume changing'' if the volume is
214 being changed and 2.5 secs after the volume button has been released. After
215 that, it will display the volume value.
217 \section{Settings}
218 \begin{table}
219 \begin{tagmap}{}{}
220 \config{\%St{\textbar}<setting name>{\textbar}} & The value of the Rockbox
221 setting with the specified name. See \reference{ref:config_file_options}
222 for the list of the available settings.\\
223 \end{tagmap}
224 \end{table}
226 Examples:
227 \begin{enumerate}
228 \item As a simple tag: \config{\%St{\textbar}skip length{\textbar}}
229 \item As a conditional: \config{\%?St{\textbar}eq enabled{\textbar}{\textless}Eq is enabled{\textbar}Eq is disabled{\textgreater}}
230 \end{enumerate}
233 \opt{lcd_bitmap}{
234 \section{Images}
235 \begin{table}
236 \begin{tagmap}{}{}
237 \nopt{archos}{%
238 \config{\%X{\textbar}filename.bmp{\textbar}}
239 & Load and set a backdrop image for the WPS.
240 This image must be exactly the same size as your LCD.\\
242 \config{\%P{\textbar}filename.bmp{\textbar}}
243 & Load a Progress Bar image for the WPS. Use \config{\%pb} tag to show the
244 progress bar\\
245 \config{\%x{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}}
246 & Load and display an image\\
247 & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\
248 & \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\\
249 & \config{x}: x coordinate\\
250 & \config{y}: y coordinate.\\
251 \config{\%xl{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}[nimages{\textbar}]}
252 & Preload an image for later display (useful for when your images are displayed conditionally)\\
253 & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\
254 & \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\\
255 & \config{x}: x coordinate\\
256 & \config{y}: y coordinate\\
257 & \config{nimages}: (optional) number of sub-images (tiled vertically, of the same height)
258 contained in the bitmap. Default is 1.\\
259 \config{\%xdn[i]} & Display a preloaded image\\
260 & \config{n}: image ID (a-z and A-Z) as it was specified in \config{\%x} or \config{\%xl}\\
261 & \config{i}: (optional) number of the sub-image to display (a-z for 1-26 and A-Z for 27-52).
262 By default the first (i.e. top most) sub-image will be used.\\
263 \end{tagmap}
264 \end{table}
266 Examples:
267 \begin{enumerate}
268 \item Load and display the image \fname{/.rockbox/bg.bmp} with ID ``a'' at 37, 109:\\
269 \config{\%x{\textbar}a{\textbar}bg.bmp{\textbar}37{\textbar}109{\textbar}}
270 \item Load a bitmap strip containing 5 volume icon images (all the same size)
271 with image ID ``M'', and then reference the individual sub-images in a conditional:\\
272 \config{\%xl{\textbar}M{\textbar}volume.bmp{\textbar}134{\textbar}153{\textbar}5{\textbar}}\\
273 \config{\%?pv<\%xdMa{\textbar}\%xdMb{\textbar}\%xdMc{\textbar}\%xdMd{\textbar}%
274 \%xdMe>}
275 \end{enumerate}
278 \note{
279 \begin{itemize}
280 \item The images must be in BMP format
281 \item The image tag must be on its own line
282 \item The ID is case sensitive, giving 52 different ID's
283 \item The size of the LCD screen for each player varies. See table below
284 for appropriate sizes of each device. The x and y coordinates must
285 repect each of the players' limits.
286 \end{itemize}
290 \opt{albumart}{
291 \section{Album Art}
292 \begin{table}
293 \begin{tagmap}{}{}
294 \config{\%Cl{\textbar}x{\textbar}y{\textbar}[[l{\textbar}c{\textbar}r]maxwidth]{\textbar}[[t{\textbar}c{\textbar}b]maxheight]{\textbar}}
295 & Define the settings for albumart\\
296 & \config{x}: x coordinate\\
297 & \config{y}: y coordinate\\
298 & \config{maxwidth}: Maximum height\\
299 & \config{maxheight}: Maximum width\\
300 \config{\%C} & Display the album art as configured. This tag can also be used as a conditional.\\
301 \end{tagmap}
302 \end{table}
304 The picture will be rescaled, preserving aspect ratio to fit the given
305 \config{maxwidth} and \config{maxheight}. If the aspect ratio doesn't match the
306 configured values, the picture will be placed according to the flags to the
307 \config{maxwidth} and \config{maxheight} parameters:
308 \begin{itemize}
309 \item \config{maxwidth}:
310 \begin{description}
311 \item[\config{l}.] Align left
312 \item[\config{c}.] Align center (default)
313 \item[\config{r}.] Align right
314 \end{description}
315 \item \config{maxheight}:
316 \begin{description}
317 \item[\config{t}.] Align left
318 \item[\config{c}.] Align center (default)
319 \item[\config{b}.] Align right
320 \end{description}
321 \end{itemize}
323 Examples:
324 \begin{enumerate}
325 \item Load albumart at position 20,40 and display it without resizing:\\
326 \config{\%Cl{\textbar}20{\textbar}40{\textbar}{\textbar}{\textbar}}
327 \item Load albumart at position 0,20 and resize it to be at most 100x100
328 pixels. If the image isn't square, align it to the bottom-right
329 corner:\\
330 \config{\%CL{\textbar}0{\textbar}20{\textbar}r100{\textbar}b100{\textbar}}
331 \end{enumerate}
334 \section{Alignment}
335 \begin{table}
336 \begin{tagmap}{}{}
337 \config{\%al} & Align the text left\\
338 \config{\%ac} & Center the text\\
339 \config{\%ar} & Align the text right\\
340 \end{tagmap}
341 \end{table}
342 All alignment tags may be present in one line, but they need to be in the
343 order left -- center -- right. If the aligned texts overlap, they are merged.
345 \section{Conditional Tags}
347 \begin{table}
348 \begin{tagmap}{}{}
349 \config{\%?xx{\textless}true{\textbar}false{\textgreater}}
350 & If / Else: Evaluate for true or false case \\
351 \config{\%?xx{\textless}alt1{\textbar}alt2{\textbar}alt3{\textbar}\dots{\textbar}else{\textgreater}}
352 & Enumerations: Evaluate for first / second / third / \dots / last condition \\
353 \end{tagmap}
354 \end{table}
356 \section{Subline Tags}
358 \begin{table}
359 \begin{tagmap}{}{}
360 \config{\%t{\textless}time{\textgreater}}
361 & Set the subline display cycle time (\%t5 or \%t3.4 formats) \\
362 \config{;}
363 & Split items on a line into separate sublines \\
364 \end{tagmap}
365 \end{table}
367 Allows grouping of several items (sublines) onto one line, with the
368 display cycling round the defined sublines. See
369 \reference{ref:AlternatingSublines} for details.
372 \section{Time and Date}
373 \begin{table}
374 \begin{tagmap}{}{}
375 \opt{rtc}{
376 \config{\%cd} & Day of month\\
377 \config{\%ce} & Zero padded day of month\\
378 \config{\%cH} & Zero padded hour from 00 to 23 (24 hour format)\\
379 \config{\%ck} & Hour from 0 to 23 (24 hour format)\\
380 \config{\%cI} & Zero padded hour from 12 to 12 (am/pm format)\\
381 \config{\%cl} & Hour from 12 to 12 (am/pm format)\\
382 \config{\%cm} & Month\\
383 \config{\%cM} & Minutes\\
384 \config{\%cS} & Seconds\\
385 \config{\%cy} & 2-digit year\\
386 \config{\%cY} & 4-digit year\\
387 \config{\%cP} & Capital AM/PM\\
388 \config{\%cp} & Lowercase am/pm\\
389 \config{\%ca} & Weekday name\\
390 \config{\%cb} & Month name\\
391 \config{\%cu} & Day of week from 1 to 7, 1 is Monday\\
392 \config{\%cw} & Day of week from 0 to 6, 0 is Sunday\\
394 \config{\%cc} & Check for presence of the clock hardware\\
395 \end{tagmap}
396 \end{table}
397 The \%cc tag returns ``c'' if the necessary hardware is present and can also be
398 used as a conditional. This can be very useful for designing a WPS that works on
399 multiple targets, some with and some without a clock. By using this tag as a
400 conditional it is possible to display current date and time on those targets that
401 support this
402 \opt{rtc}{ (like the \playertype)},
403 or alternate information on those that do not
404 \nopt{rtc}{ (like the \playertype)}%
407 Example:
408 \config{\%?cc{\textless}\%cH:\%cM{\textbar}No clock detected{\textgreater}}
411 \section{Other Tags}
412 \begin{table}
413 \begin{tagmap}{}{}
414 \config{\%\%} & The character `\%'\\
415 \config{\%{\textless}} & The character `{\textless}'\\
416 \config{\%{\textbar}} & The character `{\textbar}'\\
417 \config{\%{\textgreater}} & The character `{\textgreater}'\\
418 \config{\%;} & The character `;'\\
419 \config{\%s} & Indicate that the line should scroll. Can occur
420 anywhere in a line (given that the text is
421 displayed; see conditionals above). You can specify
422 up to ten scrolling lines. Scrolling lines can not
423 contain dynamic content such as timers, peak meters
424 or progress bars.\\
425 \end{tagmap}
426 \end{table}