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