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