skin engine: New logical 'and' and 'or' tags to evaluate multiple tags in a single...
[maemo-rb.git] / manual / appendix / wps_tags.tex
blob009607569539392ac53f59fc7f5d10ebd2f0edaa
1 % $Id$ %
2 \chapter{\label{ref:wps_tags}Theme Tags}
3 Themeing is discussed in detail in section \reference{ref:ConfiguringtheWPS},
4 what follows is a list of the available tags.
6 \note{The ``bar-type tags'' (such as \%pb, \%pv, \%bl etc.) can be further
7 themed -- see \reference{ref:bar_tags}.}
9 \section{Status Bar}
10 \begin{tagmap}
11 \config{\%we} & Display Status Bar\\
12 \config{\%wd} & Hide Status Bar\\
13 \config{\%wi} & Display the inbuilt Status Bar in the current viewport\\
14 \end{tagmap}
15 These tags override the player setting for the display of the status bar.
16 They must be noted on their own line (which will not be shown in the WPS).
18 \section{Hardware Capabilities}
19 \begin{tagmap}
20 \config{\%cc} & Check for presence of a real time clock, returns ``c''
21 when used unconditionally\\
22 \config{\%tp} & Does this target have a radio?\\
23 \config{\%Tp} & Indicates that the target has a touchscreen\\
24 \end{tagmap}
25 With the above tags it is possible to find out about the presence of certain
26 hardware and make the theme adapt to it. This can be very useful for designing
27 a theme that works on multiple targets with differing hardware capabilities, e.g.
28 targets that do and do not have a clock. When used conditionally, the ``true''
29 branch is completely ignored if it does not apply.
31 Example:
32 \config{\%?cc<\%cH:\%cM|No clock detected>}
35 \section{Information from the track tags}
36 \begin{tagmap}
37 \config{\%ia} & Artist\\
38 \config{\%ic} & Composer\\
39 \config{\%iA} & Album Artist\\
40 \config{\%id} & Album Name\\
41 \config{\%iG} & Grouping\\
42 \config{\%ig} & Genre Name\\
43 \config{\%in} & Track Number\\
44 \config{\%it} & Track Title\\
45 \config{\%iC} & Comment\\
46 \config{\%iv} & ID3 version (1.0, 1.1, 2.2, 2.3, 2.4, or empty if not an ID3 tag)\\
47 \config{\%iy} & Year\\
48 \config{\%ik} & Disc Number\\
49 \end{tagmap}
50 Remember that this information is not always available, so use the
51 conditionals to show alternate information in preference to assuming.
53 These tags, when written with a capital ``I'' (e.g. \config{\%Ia} or \config{\%Ic}),
54 show the information for the next song to be played.
56 \nopt{lcd_charcell}{
57 \section{Viewports}
58 \begin{tagmap}
59 \nopt{lcd_non-mono}{%
60 \config{\%V(x,y,[width],\tabnlindent[height],[font])}
61 & See section \ref{ref:Viewports}\\}
63 \nopt{lcd_color}{\opt{lcd_non-mono}{%
64 \config{\%V(x,y,[width],\tabnlindent[height],[font])}\newline
65 \config{\%Vf([fgshade])}\newline
66 \config{\%Vb([bgshade])}
67 & See section \ref{ref:Viewports}\\}}
69 \opt{lcd_color}{%
70 \config{\%V(x,y,[width],\tabnlindent[height],[font])}\newline
71 \config{\%Vf([fgcolour])}\newline
72 \config{\%Vb([bgcolour])}\newline
73 \config{\%Vg(start,end \tabnlindent[,text])}
74 & See section \ref{ref:Viewports}\\}
76 \opt{lcd_non-mono}{%
77 \config{\%Vs(mode[,param])}
78 & See section \ref{ref:Viewports}\\}
80 \config{\%Vl('identifier',\newline\dots)} & Preloads a viewport for later
81 display. `identifier' is a single lowercase letter (a-z) and the `\dots'
82 parameters use the same logic as the \%V tag explained above.\\
84 \config{\%Vd('identifier')} & Display the `identifier' viewport. E.g.
85 \config{\%?C<\%Vd(a)|\%Vd(b)>}
86 will show viewport `a' if album art is found, and `b' if it isn't.\\
88 \config{\%Vi('label',\dots)} &
89 Declare a Custom UI Viewport. The `\dots' parameters use the same logic as
90 the \config{\%V} tag explained above. See section \ref{ref:Viewports}.\\
92 \config{\%VI('label')} & Set the Info Viewport to use the viewport called
93 label, as declared with the previous tag.\\
94 \end{tagmap}
96 \section{Additional Fonts}
97 \begin{tagmap}
98 \config{\%Fl('id',filename)} & See section \ref{ref:multifont}.\\
99 \end{tagmap}
103 \section{Power Related Information}
104 \begin{tagmap}
105 \config{\%bl} & Numeric battery level in percents.
106 Can also be used in a conditional:
107 \config{\%?bl<-1|0|1|2|\ldots|N>},
108 where the value $-1$ is used when the battery level isn't
109 known (it usually is). The value $N$ is only used when the
110 battery level is exactly 100 percent.
111 An image can also be used, the proportion of the image
112 shown corresponds to the battery level:
113 \config{\%bl(x,y,[width],[height],image.bmp)}\\
114 \config{\%bv} & The battery level in volts\\
115 \config{\%bt} & Estimated battery time left\\
116 \config{\%bp} & ``p'' if the charger is connected (only on targets
117 that can charge batteries)\\
118 \config{\%bc} & ``c'' if the unit is currently charging the battery (only on
119 targets that have software charge control or monitoring)\\
120 \config{\%bs} & Remaining time of the sleep timer (if it is set)\\
121 \end{tagmap}
123 \section{Information about the file}
124 \begin{tagmap}
125 \config{\%fb} & File Bitrate (in kbps)\\
126 \config{\%fc} & File Codec (e.g. ``MP3'' or ``FLAC'').
127 This tag can also be used in a conditional tag:
128 \config{\%?fc<mp1|mp2|mp3|aiff|wav|ogg|\newline
129 flac|mpcsv7|a52|wavpack|alac|aac|shn|sid|adx|nsf|\newline
130 speex|spc|ape|wma|wmpapro|mod|sap|realaudiocook|\newline
131 realaudioaac|realaudioac3|realaudioatrac3|cmc|\newline
132 cm3|cmr|cms|dmc|dlt|mpt|mpd|rmt|tmc|tm8|tm2|\newline
133 omaatrac3|smaf|au|vox|wave64|tta|wmavoice|mpcsv8|\newline
134 aache|ay|gbs|hes|sgc|vgm|kss|unknown>}.
135 The codec order is as shown above.\\
136 \config{\%ff} & File Frequency (in Hz)\\
137 \config{\%fk} & File Frequency (in kHz)\\
138 \config{\%fm} & File Name\\
139 \config{\%fn} & File Name (without extension)\\
140 \config{\%fp} & File Path\\
141 \config{\%fs} & File Size (in Kilobytes)\\
142 \config{\%fv} & ``(avg)'' if variable bit rate or empty string if constant bit rate\\
143 \config{\%d(N)} & N-th segment from the end of the file's directory
144 (N can be 1, 2, 3, \dots)\\
145 \end{tagmap}
146 Example for the \config{\%d(N)} commands: If the file is
147 ``/Rock/Kent/Isola/11 - 747.mp3'', \config{\%d(1)} is ``Isola'',
148 \config{\%d(2)} is ``Kent'' and \config{\%d(3)} is ``Rock''.
150 These tags, when written with the first letter capitalized (e.g. \config{\%Fn}
151 or \config{\%D(2)}), produce the information for the next file to be played.
153 \section{Playlist/Song Info}
154 \begin{tagmap}
155 \config{\%pb} & Progress Bar.
156 \opt{player}{
157 This will display a one character ``cup''
158 that empties as the time progresses.}
159 \opt{lcd_bitmap}{
160 This will replace the entire line with a progress bar.
161 You can set the position, width and height of the progressbar
162 (in pixels) and load a custom image for it:
163 \config{\%pb(x,y,[width],[height],image.bmp)}} \\
164 \opt{player}{%
165 \config{\%pf} & Full-line progress bar \& time display\\
167 \config{\%px} & Percentage played in song\\
168 \config{\%pc} & Current time in song\\
169 \config{\%pe} & Total number of playlist entries\\
170 \nopt{player}{%
171 \config{\%pm} & Peak Meter. The entire line is used as %
172 volume peak meter.\\%
173 \config{\%pL} & Peak meter for the left channel. Can be used as a value, %
174 a conditional tag or a bar tag.\\
175 \config{\%pR} & Peak meter for the right channel. Can be used as a value, %
176 a conditional tag or a bar tag.\\
178 \config{\%pn} & Playlist name (without path or extension)\\
179 \config{\%pp} & Playlist position\\
180 \config{\%pr} & Remaining time in song\\
181 \config{\%ps} & ``s'' if shuffle mode is enabled\\
182 \config{\%pt} & Total track time\\
183 \config{\%pv} & Current volume (in dB). Can also be used in a conditional:
184 \config{\%?pv<0|1|2|\ldots|N>}\newline
185 0 is used for mute, the last option is used for values greater than zero.
186 \opt{lcd_bitmap}{This can also be used like \%pb to provide a continuous scale:
187 \config{\%pv(x,y,[width],[height],image.bmp)}} \\
188 \config{\%pS} & Track is starting. An optional number gives how many seconds
189 the tag remains true for after the start of the track. The default is
190 10 seconds if no number is specified.
191 \config{\%?pS(7)<in the first 7 seconds of track|in
192 the rest of the track>}\\
193 \config{\%pE} & Track is ending. An optional number gives how many seconds
194 before the end of the track the tag becomes true. The default is
195 10 seconds if no number is specified.
196 \config{\%?pE(7)<in the last 7 seconds of track|in
197 the rest of the track>}\\
198 \config{\%Sp} & Current playback pitch\\
199 \end{tagmap}
201 \section{Playlist Viewer}
202 \begin{tagmap}
203 \config{\%Vp(start,code to render)} & Display the playlist viewer in
204 the current viewport.\\
205 \end{tagmap}
207 \begin{itemize}
208 \item `start' is the offset relative to the currently playing track for the
209 playlist to display from (0 the current track, 1 is the next track, etc.).
210 \item `code to render' is a line of skin code which will be displayed for
211 each line in the viewer. All text tags are supported (including conditionals
212 and sublines)
213 \end{itemize}
215 The entire viewport will be used, so don't expect other tags in the same
216 viewport to work well. Supported tags are \%pp, all tags starting with \%i,
217 most tags starting with \%f, \%pt and \%s.\\
219 Example: \config{\%Vp(1,\%pp - \%it,\%pp - \%fn)} -- Display the playlist
220 position, then either the track title (from the tags) or
221 the filename. The viewer will display as many tracks as will fit in the
222 viewport.
224 \section{Runtime Database}
225 \begin{tagmap}
226 \config{\%rp} & Song playcount\\
227 \config{\%rr} & Song rating (0-10). This tag can also be used in a conditional tag: %
228 \config{\%?rr<0|1|2|3|4|5|6|7|8|9|10>}\\
229 \config{\%ra} & Autoscore for the song\\
230 \end{tagmap}
232 \opt{swcodec}{
233 \section{Sound (DSP) settings}
234 \begin{tagmap}
235 \config{\%Sp} & Current playback pitch \\
236 \opt{swcodec}{
237 \config{\%xf} & Crossfade setting, in the order: Off, Auto Skip, Man Skip,
238 Shuffle, Shuffle and Man Skip, Always\\
239 \config{\%rg} & ReplayGain value in use (x.y~dB). If used as a conditional,
240 Replaygain type in use: \config{\%?rg<Off|Track%
241 |Album|TrackShuffle|AlbumShuffle%
242 |No tag>}\\
244 \end{tagmap}
247 \section{Hold}
248 \begin{tagmap}
249 \config{\%mh} & ``h'' if the main unit keys are locked\\
250 \opt{remote_button_hold}{%
251 \config{\%mr} & ``r'' if the remote keys are locked\\
253 \end{tagmap}
255 \section{Virtual LED}
256 \begin{tagmap}
257 \config{\%lh} & ``h'' if the \disk\ is accessed\\
258 \end{tagmap}
260 \section{Repeat Mode}
261 \begin{tagmap}
262 \config{\%mm} & Repeat mode, 0-4, in the order: Off, All, One, Shuffle, A-B\\
263 \end{tagmap}
264 Example: \config{\%?mm<Off|All|One|Shuffle|A-B>}
266 \section{Playback Mode}
267 \begin{tagmap}
268 \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause,
269 Fast Forward, Rewind, Recording, Recording paused, FM Radio playing,
270 FM Radio muted\\
271 \end{tagmap}
272 Example: \config{\%?mp<Stop|Play|Pause|Ffwd|Rew|Rec|Rec pause|FM|FM pause>}
274 \section{Current Screen}
275 \begin{tagmap}
276 \config{\%cs} & The current screen, 1-18, in the order shown below\\
277 \end{tagmap}
279 \begin{table}
280 \begin{rbtabular}{.75\textwidth}{lX}%
281 {\textbf{Number} & \textbf{Screen}}{}{}
282 1 & Menus \\
283 2 & WPS \\
284 3 & Recording screen \\
285 4 & FM Radio screen \\
286 5 & Current Playlist screen \\
287 6 & Settings menus \\
288 7 & File browser \\
289 8 & Database browser \\
290 9 & Plugin browser \\
291 10 & Quickscreen \\
292 11 & Pitchscreen \\
293 12 & Setting chooser \\
294 13 & Playlist Catalogue Viewer \\
295 14 & Plugin \\
296 15 & Context menu \\
297 16 & System Info screen \\
298 17 & Time and Date Screen \\
299 18 & Bookmark browser \\
300 19 & Shortcuts menu \\
301 \end{rbtabular}
302 \end{table}
304 The tag can also be used as the switch in a conditional tag. For players without
305 certain capabilities (e.g. no FM radio) some values will never be returned.
307 Examples:
309 \config{You are in the \%?cs<Main menu|WPS|Recording screen|FM Radio screen>}
311 \config{\%?if(\%cs, =, 2)<This is the WPS>}
313 \section{List Title (\fname{.sbs} only)}
314 \begin{tagmap}
315 \config{\%Lt} & Title text. Should be used in a conditional so that non-list
316 screens don't show a title when they shouldn't\\
317 \config{\%Li} & Title icon. This uses the same order as custom icons (see
318 \wikilink{CustomIcons} in the wiki) except that here \config{0} is ``no
319 icon''\\
320 \end{tagmap}
322 This tag can be used to give custom formatting to list titles.
323 Define a viewport with the font and formatting desired, and then use
324 \config{\%?Lt<\%Lt>} to display the title within the
325 viewport. If \config{\%Lt} is present anywhere in the \fname{.sbs}, then the
326 \config{\%Vi} viewport will not show the title.
328 \section{Changing Volume}
329 \begin{tagmap}
330 \config{\%mv(t)} & ``v'' if the volume is being changed\\
331 \end{tagmap}
333 The tag produces the letter ``v'' while the volume is being changed and some
334 amount of time after that, i.e. after the volume button has been released. The
335 optional parameter \config{t} specifies that amount of time, in seconds. If it
336 is not specified, 1 second is assumed.
338 The tag can be used as the switch in a conditional tag to display different things
339 depending on whether the volume is being changed. It can produce neat effects
340 when used with conditional viewports.
342 Example: \config{\%?mv(2.5)<Volume changing|\%pv>}
344 The example above will display the text ``Volume changing'' if the volume is
345 being changed and 2.5 seconds after the volume button has been released. After
346 that, it will display the volume value.
348 \section{Settings}
349 \begin{tagmap}
350 \config{\%St(<setting\tabnlindent{}name>)} & The value of the Rockbox
351 setting with the specified name. See \reference{ref:config_file_options}
352 for the list of the available settings.\\
353 \end{tagmap}
355 Examples:
356 \begin{enumerate}
357 \item As a simple tag: \config{\%St(skip length)}
358 \item As a conditional: \config{\%?St(eq enabled)<Eq is enabled|Eq is disabled>}
359 \end{enumerate}
362 \opt{lcd_bitmap}{
363 \section{\label{ref:wps_images}Images}
364 \begin{tagmap}
365 \nopt{archos}{%
366 \config{\%X(filename.bmp)}
367 & Load and set a backdrop image for the WPS.
368 This image must be exactly the same size as your LCD.\\
370 \config{\%x(n,filename,x,y)}
371 & Load and display an image\newline
372 \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\newline
373 \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\newline
374 \config{x}: x coordinate\newline
375 \config{y}: y coordinate.\\
376 \config{\%xl(n,filename,x,y,\tabnlindent[nimages])}
377 & Preload an image for later display (useful for when your images are displayed conditionally).\newline
378 \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\newline
379 \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\newline
380 If the filename is ``\_\_list\_icons\_\_'' the list icon bitmap will be used instead\newline
381 \config{x}: x coordinate\newline
382 \config{y}: y coordinate\newline
383 \config{nimages}: (optional) number of sub-images (tiled vertically, of the same height)
384 contained in the bitmap. Default is 1.\\
385 \config{\%xd(n[i] [,tag] [,offset])} & Display a preloaded image.
386 \config{n}: image ID (a-z and A-Z) as it was specified in \config{\%x} or \config{\%xl}\newline
387 \config{i}: (optional) number of the sub-image to display (a-z for 1-26 and A-Z for 27-52).
388 (ignored when \config{tag} is used)
389 By default the first (i.e. top most) sub-image will be used.\newline
390 \config{tag}: (optional) Another tag to calculate the subimage from e.g \config{\%xd(A, \%mh)} would
391 use the first subimage when \config{\%mh} is on and the second when it is off\newline
392 \config{offset}: (optional) Add this number to the value from the \config{tag} when
393 chosing the subimage (may be negative)\\
394 \end{tagmap}
396 Examples:
397 \begin{enumerate}
398 \item Load and display the image \fname{/.rockbox/bg.bmp} with ID ``a'' at 37, 109:\\
399 \config{\%x(a,bg.bmp,37,109)}
400 \item Load a bitmap strip containing 5 volume icon images (all the same size)
401 with image ID ``M'', and then reference the individual sub-images in a conditional:\\
402 \config{\%xl(M,volume.bmp,134,153,5)}\\
403 \config{\%?pv<\%xd(Ma)|\%xd(Mb)|\%xd(Mc)|%
404 \%xd(Md)|\%xd(Me)>}
405 \end{enumerate}
408 \note{
409 \begin{itemize}
410 \item The images must be in BMP format
411 \item The image tag must be on its own line
412 \item The ID is case sensitive, giving 52 different ID's
413 \item The size of the LCD screen for each \dap{} varies. See table below
414 for appropriate sizes of each device. The x and y coordinates must
415 respect each of the \daps{} limits.
416 \end{itemize}
420 \opt{albumart}{
421 \section{\label{ref:album_art}Album Art}
422 Rockbox allows you to put the album art, or another image related to the music
423 on your \dap{} to display it in the PictureFlow plugin\opt{albumart}{ or in the
424 theme}. For this feature to work, there are a few requirements.
426 \subsection{Limitations}
428 Rockbox supports embedded album art only for some specific formats, see
429 \reference{ref:featureset_for_generic_metadata_tags} for full details. It additionally supports
430 loading images located on the \disk{}.
431 The image files must be in either BMP or JPEG format, while embedded album art
432 is currently limited to JPEG. Rockbox does not support
433 RLE-compressed BMP files, nor does it support progressive and multi-scan
434 JPEG files. Embedded JPEG images must not be unsynchronized.
435 JPEG files must consist of a single scan with interleaved components,
436 as progessive and multi-scan images require much more memory to decode.
437 Pictureflow does not currently support embedded album art.
439 \subsection{Where to put album art}
441 The pictures can be named a number of different ways, and placed to a number of
442 different locations. You can have pictures specific to the file or the album
443 or use a generic picture. You can place the picture in the same directory
444 as the file, in the parent directory or in a fixed directory named
445 \fname{/.rockbox/albumart/}. The order Rockbox uses when looking for a picture
446 is as follows (a list in braces means that those file extensions are tried in
447 that order):
449 \begin{enumerate}
450 \item embedded (JPEG images in ID3v2 or MP4 tags only)
451 \item \fname{./filename.\{jpeg,jpg,bmp\}}
452 \item \fname{./albumtitle.\{jpeg,jpg,bmp\}}
453 \item \fname{./cover.\{jpeg,jpg,bmp\}}
454 \item \fname{./folder.jpg}
455 \item \fname{/.rockbox/albumart/albumartist-albumtitle.\{jpeg,jpg,bmp\}}
456 \item \fname{../albumtitle.\{jpeg,jpg,bmp\}}
457 \item \fname{../cover.\{jpeg,jpg,bmp\}}
458 \end{enumerate}
460 The following characters will be replaced with an underscore (\_) when looking
461 for albumtitle.bmp or albumartist-albumtitle.bmp: \textbackslash{} / : <
462 > ? * |. Doublequotes will be replaced by single quotes.
463 If no album artist is set, artist will be used instead. See \wikilink{AlbumArt}
464 in the wiki for programs that will help you automate the process of putting
465 album art on your \dap{}.
467 \subsection{How to display the album art}
469 Once the album art files are present on your \dap, they can be displayed as
470 follows.
472 \begin{tagmap}
473 \config{\%Cl(x,y,[maxwidth],\tabnlindent[maxheight],\tabnlindent{}hor\_align,\tabnlindent{}vert\_align)}
474 & Define the settings for album art\newline
475 \config{x}: x coordinate\newline
476 \config{y}: y coordinate\newline
477 \config{maxwidth}: Maximum height\newline
478 \config{maxheight}: Maximum width\newline
479 \config{hor\_align}: Horizontal alignment, enter as `l', `c' or `r' for
480 left, centre or right. Centre is default\newline
481 \config{vert\_align}: Vertical alignment, enter as `t', `c' or `b' for
482 top, centre or bottom. Centre is default\\
483 \config{\%Cd} & Display the album art as configured. \\
484 \config{\%C} & Use in a conditional to determine if an image is available. \\
485 \end{tagmap}
487 The picture will be rescaled, preserving aspect ratio to fit the given
488 \config{maxwidth} and \config{maxheight}. If the aspect ratio doesn't match the
489 configured values, the picture will be placed according to the alignment flags.
491 Examples:
492 \begin{enumerate}
493 \item Load albumart at position 20,40 and display it without resizing:\\
494 \config{\%Cl(20,40,,)}
495 \item Load albumart at position 0,20 and resize it to be at most 100$\times$100
496 pixels. If the image isn't square, align it to the bottom-right
497 corner:\\
498 \config{\%Cl(0,20,100,100,r,b)}
499 \end{enumerate}
502 \opt{radio}{
503 \section{FM Radio}
504 \begin{tagmap}
505 \config{\%tt} & Is the tuner tuned?\\
506 \config{\%tm} & Scan or preset mode? Scan is ``true'', preset is ``false''.\\
507 \config{\%ts} & Is the station in stereo?\\
508 \config{\%ta} & Minimum frequency (region specific) in MHz.\\
509 \config{\%tb} & Maximum frequency (region specific) in MHz.\\
510 \config{\%tf} & Current frequency in MHz.\\
511 \config{\%Ti} & Current preset id, i.e. 1-based number of the preset
512 within the presets list (usable in playlist viewer).\\
513 \config{\%Tn} & Current preset name (usable in playlist viewer).\\
514 \config{\%Tf} & Current preset frequency (usable in playlist viewer).\\
515 \config{\%Tc} & Preset count, i.e. the number of stations in the current
516 preset list.\\
517 \config{\%tx} & Is RDS available?\\
518 \config{\%ty} & RDS name.\\
519 \config{\%tz} & RDS text.\\
520 \config{\%tr} & Signal strength (RSSI). Can be used in a conditional or as
521 a bar.\\
522 \end{tagmap}
524 It is also possible to show ``Radio Art'' which can be used to display images
525 associated with presets. The tags are exactly the same as for album art,
526 described above. Images need to be placed in \fname{/.rockbox/fmpresets/},
527 and must have the same name as the preset. They need to be in either
528 \fname{.bmp} or \fname{.jpg} format, and the radio must be in preset mode
529 and tuned to a preset (and not recording) in order for them to be shown.
532 \section{Alignment and language direction}
533 \begin{tagmap}
534 \config{\%al} & Align the text left\\
535 \config{\%aL} & Align the text left, or to the right if RTL language is in use\\
536 \config{\%ac} & Centre the text\\
537 \config{\%ar} & Align the text right\\
538 \config{\%aR} & Align the text right, or to the left if RTL language is in use\\
539 \config{\%ax} & The next tag should follow the set language direction. When
540 prepended to a viewport declaration, the viewport will
541 be horizontally mirrored if the user language is set to
542 a RTL language. Currently the \%Cl, \%V and \%Vl tags
543 support this.\\
544 \config{\%Sr} & Use as a conditional to define options for left to right, or
545 right to left languages. \%?Sr<RTL|LTR>\\
546 \end{tagmap}
548 All alignment tags may be present in one line, but they need to be in the
549 order left -- centre -- right. If the aligned texts overlap, they are merged.
551 Example: \config{\%ax\%V(\dots)}
553 \section{Conditional Tags}
555 \begin{tagmap}
556 \config{\%?xx<true|false>}
557 & If / Else: Evaluate for true or false case \\
558 \config{\%?xx<alt1|alt2|\tabnlindent{}alt3|\dots|else>}
559 & Enumerations: Evaluate for first / second / third / \dots / last condition \\
560 \config{\%if(tag, operator, operand, [option count])}
561 & Allows very simple comparisons with other tags.\newline
562 \config{tag}: the tag to check against.\newline
563 \config{operator}: the comparison to perform - possible options are =, !=,
564 >, >=, <, <=\newline
565 \config{operand}: either a second tag, a number, or text.\newline
566 \config{[option count]}: optional parameter used to select which parameter
567 of a tag to use when the tag has multiple options, e.g. \%?pv<a|b|c|d>\\
568 \config{\%and(tag1, tag2, ..., tagN)}\newline
569 & Logical ``and'' operator. Will be evaluate to true if all the tag parameters are true.\\
570 \config{\%or(tag1, tag2, ..., tagN)}\newline
571 & Logical ``or'' operator. Will be evaluate to true if any of the tag parameters are true.\\
572 \end{tagmap}
574 Examples of the \%if tag:\\
576 \config{\%?if(\%pv, >=, 0)<Clipping possible|Volume OK>} will display ``Clipping
577 possible'' if the volume is higher than or equal to 0 dB, ``Volume OK'' if it
578 is lower.\\
580 \config{\%?if(\%ia, =, \%Ia)<same artist>} -- this artist and the next artist
581 are the same.\\
583 \note{When performing a comparison against a string tag such as \%ia, only = and
584 != work, and the comparison is not case sensitive.}
586 \section{Subline Tags}
588 \begin{tagmap}
589 \config{\%t(time)}
590 & Set the subline display cycle time (\%t(5) or \%t(3.4) formats) \\
591 \config{;}
592 & Split items on a line into separate sublines \\
593 \end{tagmap}
595 Allows grouping of several items (sublines) onto one line, with the
596 display cycling round the defined sublines. See
597 \reference{ref:AlternatingSublines} for details.
599 \opt{rtc}{
600 \section{Time and Date}
601 \begin{tagmap}
602 \config{\%cd} & Day of month from 01 to 31\\
603 \config{\%ce} & Zero padded day of month from 1 to 31\\
604 \config{\%cf} & A conditional for 12/24 hour format.\newline
605 \config{\%?cf<24 hour stuff|12 hour stuff>}\\
606 \config{\%cH} & Zero padded hour from 00 to 23 (24 hour format)\\
607 \config{\%ck} & Hour from 0 to 23 (24 hour format)\\
608 \config{\%cI} & Zero padded hour from 01 to 12 (am/pm format)\\
609 \config{\%cl} & Hour from 1 to 12 (am/pm format)\\
610 \config{\%cm} & Month from 01 to 12\\
611 \config{\%cM} & Minutes\\
612 \config{\%cS} & Seconds\\
613 \config{\%cy} & 2-digit year\\
614 \config{\%cY} & 4-digit year\\
615 \config{\%cP} & Capital AM/PM\\
616 \config{\%cp} & Lowercase am/pm\\
617 \config{\%ca} & Weekday name\\
618 \config{\%cb} & Month name\\
619 \config{\%cu} & Day of week from 1 to 7, 1 is Monday\\
620 \config{\%cw} & Day of week from 0 to 6, 0 is Sunday\\
621 \end{tagmap}
624 \section{Text Translation}
625 \begin{tagmap}
626 \config{\%Sx(English)}
627 & Display the translation of ``English'' in the current language\\
628 \end{tagmap}
630 \begin{itemize}
631 \item ``English'' must be a phrase used in the language file.
632 \item It should match the \config{Source:} line in the language file.
633 \end{itemize}
635 \note{checkwps cannot verify that the string is correct, so please check on
636 either the simulator or on target.}
639 \opt{touchscreen}{
640 \section{Touchscreen Areas}
641 \begin{tagmap}
642 \config{\%T(x,y,width,\tabnlindent{}height, action, [options])}
643 & Invoke the action specified when the user presses in the defined
644 touchscreen area.\\
645 \end{tagmap}
647 Possible actions are:
649 \begin{description}
650 \item[play] -- Play/pause playback.
651 \item[stop] -- Stop playback and exit the WPS.
652 \item[prev] -- Previous track/item.
653 \item[next] -- Next track/item.
654 \item[wps\_prev] -- Previous track.
655 \item[wps\_next] -- Next track.
656 \item[ffwd] -- Seek forwards in the track.
657 \item[rwd] -- Seek backwards in the track.
658 \item[menu] -- Go to the main menu.
659 \item[browse] -- Go back to the file browser or database.
660 \item[shuffle] -- Toggle shuffle mode.
661 \item[repmode] -- Cycle through the repeat modes.
662 \item[quickscreen] -- Go to the quickscreen.
663 \item[contextmenu] -- Open the context menu.
664 \item[playlist] -- Go to the playlist viewer.
665 \item[progressbar] -- Seek to the appropriate position in the track based on the touch.
666 \item[volume] -- Set the volume to the appropriate level based on the touch.
667 \item[pitch] -- Open the pitchscreen.
668 \item[voldown] -- Decrease the volume by one step.
669 \item[volup] -- Increase the volume by one step.
670 \item[mute] -- Un/Mute playback.
671 \item[setting\_inc] -- Increment the subsequently specified setting (e.g
672 \config{\%T(0,0, setting\_inc, volume)} increases the volume by one step).
673 \item[setting\_dec] -- Decrement the subsequently specified setting (e.g
674 \config{\%T(0,0, setting\_dec, volume)} decreases the volume by one step).
675 \end{description}
676 Any (or muliple) of the following options can be used after the action is specified
677 \subsection{Options}
678 \begin{description}
679 \item[repeat_press] -- This region will trigger mulitple times when held (i.e for seeking)
680 \item[long_press] -- This region will trigger once after it is held for a long press
681 \item[reverse_bar] -- Reverse the bars touch direction (i.e seek right to left)
682 \item[allow_while_locked] -- Allows the region to be pressable when the
683 skin is locked by the lock touch action
684 \end{description}
686 \section{Last Touchscreen Press}
687 \begin{tagmap}
688 \config{\%Tl} & Indicates that the touchscreen is pressed.\\
689 \end{tagmap}
690 This tag can be used to display text or images or a viewport when the
691 touchscreen is pressed (like an On Screen Display). If you put a number
692 straight after \%Tl it will be used as a timeout in seconds
693 (e.g \%Tl(2.5) will give a 2.5 second timeout) between the touchscreen press
694 being released and the tag going false. If no number is specified it will
695 use a 1 second timeout. It can also be used as a conditional, and can be
696 used with conditional viewports.
699 \section{\label{ref:bar_tags}Bar Tags}
700 Some tags can be used to display a bar which draws according to the value of
701 the tag. To use these tags like a bar you need to use the following parameters
702 (\%XX should be replaced with the actual tag).
704 \begin{tagmap}
705 \config{\%XX(x, y, width, height, [options])}
706 & Draw the specified tag as a bar\newline
707 \config{x}: x co-ordinate at which to start drawing the bar.\newline
708 \config{y}: y co-ordinate at which to start drawing the bar.\newline
709 \config{width}: width of the bar (- for the full viewport width).\newline
710 \config{height}: height of the bar (- to set to the font height for
711 horizontal bars and to the viewport height for vertical bars).\newline
712 \config{options}: any of the options set out below.\\
713 \end{tagmap}
715 \subsection{Options}
716 \begin{description}
717 \item[image] -- the next option is either the filename or image label to
718 use for the fill image.
719 \item[horizontal] -- force the bar to be drawn horizontally.
720 \item[vertical] -- force the bar to be drawn vertically.
721 \item[invert] -- invert the draw direction (i.e. right to left, or top to
722 bottom).
723 \item[slider] -- draw a preloaded image over the top of the bar so that
724 the centre of the image matches the current position. This must be
725 followed by the label of the desired image.
726 \item[backdrop] -- draw a preloaded image under the bar. The full
727 image will be displayed and must be the same size as the bar.
728 This must be followed by the label of the desired image.
729 \item[nofill] -- don't draw the bar, only its frame (for use with the
730 ``slider'' option).
731 \item[nobar] -- don't draw the bar or its frame (for use with the
732 ``slider'' option).
733 \end{description}
735 Example: \config{\%pb(0,0,-,-,-,nofill, slider, slider\_image, invert)} -- draw
736 a horizontal progressbar which doesn't fill and draws the image
737 ``slider\_image'' which moves right to left.
739 \note{If the slider option is used, the bar will be shrunk so that the slider
740 fits inside the specified width and height.}
742 \section{Other Tags}
743 \begin{tagmap}
744 \config{\%(} & The character `('\\
745 \config{\%)} & The character `)'\\
746 \config{\%,} & The character `,'\\
747 \config{\%\%} & The character `\%'\\
748 \config{\%<} & The character `<'\\
749 \config{\%|} & The character `|'\\
750 \config{\%>} & The character `>'\\
751 \config{\%;} & The character `;'\\
752 \config{\%\#} & The character `\#'\\
753 \config{\%s} & Indicate that the line should scroll. Can occur
754 anywhere in a line (given that the text is
755 displayed; see conditionals above). You can specify
756 up to ten scrolling lines. Scrolling lines can not
757 contain dynamic content such as timers, peak meters
758 or progress bars.\\
759 \end{tagmap}