Manual: add %Vg and %Vs tags. Closes FS#12230.
[maemo-rb.git] / manual / appendix / wps_tags.tex
blob5b3549d2ab89df9dabde2e03e6925a0850787c30
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|mpc|a52|wavpack|alac|aac|shn|sid|adx|nsf|\newline
130 speex|spc|ape|wma|mod|sap|unknown>}.
131 The codec order is as follows: MP1, MP2, MP3, AIFF, WAV,
132 Ogg Vorbis (OGG), FLAC, MPC, AC3, WavPack (WV), ALAC, AAC,
133 Shorten (SHN), SID, ADX, NSF, Speex, SPC, APE, WMA, MOD, SAP.\\
134 \config{\%ff} & File Frequency (in Hz)\\
135 \config{\%fk} & File Frequency (in kHz)\\
136 \config{\%fm} & File Name\\
137 \config{\%fn} & File Name (without extension)\\
138 \config{\%fp} & File Path\\
139 \config{\%fs} & File Size (in Kilobytes)\\
140 \config{\%fv} & ``(avg)'' if variable bit rate or empty string if constant bit rate\\
141 \config{\%d(N)} & N-th segment from the end of the file's directory
142 (N can be 1, 2, 3, \dots)\\
143 \end{tagmap}
144 Example for the \config{\%d(N)} commands: If the file is
145 ``/Rock/Kent/Isola/11 - 747.mp3'', \config{\%d(1)} is ``Isola'',
146 \config{\%d(2)} is ``Kent'' and \config{\%d(3)} is ``Rock''.
148 These tags, when written with the first letter capitalized (e.g. \config{\%Fn}
149 or \config{\%D(2)}), produce the information for the next file to be played.
151 \section{Playlist/Song Info}
152 \begin{tagmap}
153 \config{\%pb} & Progress Bar.
154 \opt{player}{
155 This will display a one character ``cup''
156 that empties as the time progresses.}
157 \opt{lcd_bitmap}{
158 This will replace the entire line with a progress bar.
159 You can set the position, width and height of the progressbar
160 (in pixels) and load a custom image for it:
161 \config{\%pb(x,y,[width],[height],image.bmp)}} \\
162 \opt{player}{%
163 \config{\%pf} & Full-line progress bar \& time display\\
165 \config{\%px} & Percentage played in song\\
166 \config{\%pc} & Current time in song\\
167 \config{\%pe} & Total number of playlist entries\\
168 \nopt{player}{%
169 \config{\%pm} & Peak Meter. The entire line is used as %
170 volume peak meter.\\%
171 \config{\%pL} & Peak meter for the left channel. Can be used as a value, %
172 a conditional tag or a bar tag.\\
173 \config{\%pR} & Peak meter for the right channel. Can be used as a value, %
174 a conditional tag or a bar tag.\\
176 \config{\%pn} & Playlist name (without path or extension)\\
177 \config{\%pp} & Playlist position\\
178 \config{\%pr} & Remaining time in song\\
179 \config{\%ps} & ``s'' if shuffle mode is enabled\\
180 \config{\%pt} & Total track time\\
181 \config{\%pv} & Current volume (in dB). Can also be used in a conditional:
182 \config{\%?pv<0|1|2|\ldots|N>}\newline
183 0 is used for mute, the last option is used for values greater than zero.
184 \opt{lcd_bitmap}{This can also be used like \%pb to provide a continuous scale:
185 \config{\%pv(x,y,[width],[height],image.bmp)}} \\
186 \config{\%pS} & Track is starting. An optional number gives how many seconds
187 the tag remains true for after the start of the track. The default is
188 10 seconds if no number is specified.
189 \config{\%?pS(7)<in the first 7 seconds of track|in
190 the rest of the track>}\\
191 \config{\%pE} & Track is ending. An optional number gives how many seconds
192 before the end of the track the tag becomes true. The default is
193 10 seconds if no number is specified.
194 \config{\%?pE(7)<in the last 7 seconds of track|in
195 the rest of the track>}\\
196 \config{\%Sp} & Current playback pitch\\
197 \end{tagmap}
199 \section{Playlist Viewer}
200 \begin{tagmap}
201 \config{\%Vp(start,code to render)} & Display the playlist viewer in
202 the current viewport.\\
203 \end{tagmap}
205 \begin{itemize}
206 \item `start' is the offset relative to the currently playing track for the
207 playlist to display from (0 the current track, 1 is the next track, etc.).
208 \item `code to render' is a line of skin code which will be displayed for
209 each line in the viewer. All text tags are supported (including conditionals
210 and sublines)
211 \end{itemize}
213 The entire viewport will be used, so don't expect other tags in the same
214 viewport to work well. Supported tags are \%pp, all tags starting with \%i,
215 most tags starting with \%f, \%pt and \%s.\\
217 Example: \config{\%Vp(1,\%pp - \%it,\%pp - \%fn)} -- Display the playlist
218 position, then either the track title (from the tags) or
219 the filename. The viewer will display as many tracks as will fit in the
220 viewport.
222 \section{Runtime Database}
223 \begin{tagmap}
224 \config{\%rp} & Song playcount\\
225 \config{\%rr} & Song rating (0-10). This tag can also be used in a conditional tag: %
226 \config{\%?rr<0|1|2|3|4|5|6|7|8|9|10>}\\
227 \config{\%ra} & Autoscore for the song\\
228 \end{tagmap}
230 \opt{swcodec}{
231 \section{Sound (DSP) settings}
232 \begin{tagmap}
233 \config{\%Sp} & Current playback pitch \\
234 \opt{swcodec}{
235 \config{\%xf} & Crossfade setting, in the order: Off, Auto Skip, Man Skip,
236 Shuffle, Shuffle and Man Skip, Always\\
237 \config{\%rg} & ReplayGain value in use (x.y~dB). If used as a conditional,
238 Replaygain type in use: \config{\%?rg<Off|Track%
239 |Album|TrackShuffle|AlbumShuffle%
240 |No tag>}\\
242 \end{tagmap}
245 \section{Hold}
246 \begin{tagmap}
247 \config{\%mh} & ``h'' if the main unit keys are locked\\
248 \opt{remote_button_hold}{%
249 \config{\%mr} & ``r'' if the remote keys are locked\\
251 \end{tagmap}
253 \section{Virtual LED}
254 \begin{tagmap}
255 \config{\%lh} & ``h'' if the \disk\ is accessed\\
256 \end{tagmap}
258 \section{Repeat Mode}
259 \begin{tagmap}
260 \config{\%mm} & Repeat mode, 0-4, in the order: Off, All, One, Shuffle, A-B\\
261 \end{tagmap}
262 Example: \config{\%?mm<Off|All|One|Shuffle|A-B>}
264 \section{Playback Mode}
265 \begin{tagmap}
266 \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause,
267 Fast Forward, Rewind, Recording, Recording paused, FM Radio playing,
268 FM Radio muted\\
269 \end{tagmap}
270 Example: \config{\%?mp<Stop|Play|Pause|Ffwd|Rew|Rec|Rec pause|FM|FM pause>}
272 \section{Current Screen}
273 \begin{tagmap}
274 \config{\%cs} & The current screen, 1-18, in the order shown below\\
275 \end{tagmap}
277 \begin{table}
278 \begin{rbtabular}{.75\textwidth}{lX}%
279 {\textbf{Number} & \textbf{Screen}}{}{}
280 1 & Menus \\
281 2 & WPS \\
282 3 & Recording screen \\
283 4 & FM Radio screen \\
284 5 & Current Playlist screen \\
285 6 & Settings menus \\
286 7 & File browser \\
287 8 & Database browser \\
288 9 & Plugin browser \\
289 10 & Quickscreen \\
290 11 & Pitchscreen \\
291 12 & Setting chooser \\
292 13 & Playlist Catalogue Viewer \\
293 14 & Plugin \\
294 15 & Context menu \\
295 16 & System Info screen \\
296 17 & Time and Date Screen \\
297 18 & Bookmark browser \\
298 \end{rbtabular}
299 \end{table}
301 The tag can also be used as the switch in a conditional tag. For players without
302 certain capabilities (e.g. no FM radio) some values will never be returned.
304 Examples:
306 \config{You are in the \%?cs<Main menu|WPS|Recording screen|FM Radio screen>}
308 \config{\%?if(\%cs, =, 2)<This is the WPS>}
310 \section{List Title (\fname{.sbs} only)}
311 \begin{tagmap}
312 \config{\%Lt} & Title text. Should be used in a conditional so that non-list
313 screens don't show a title when they shouldn't\\
314 \config{\%Li} & Title icon. This uses the same order as custom icons (see
315 \wikilink{CustomIcons} in the wiki) except that here \config{0} is ``no
316 icon''\\
317 \end{tagmap}
319 This tag can be used to give custom formatting to list titles.
320 Define a viewport with the font and formatting desired, and then use
321 \config{\%?Lt<\%Lt>} to display the title within the
322 viewport. If \config{\%Lt} is present anywhere in the \fname{.sbs}, then the
323 \config{\%Vi} viewport will not show the title.
325 \section{Changing Volume}
326 \begin{tagmap}
327 \config{\%mv(t)} & ``v'' if the volume is being changed\\
328 \end{tagmap}
330 The tag produces the letter ``v'' while the volume is being changed and some
331 amount of time after that, i.e. after the volume button has been released. The
332 optional parameter \config{t} specifies that amount of time, in seconds. If it
333 is not specified, 1 second is assumed.
335 The tag can be used as the switch in a conditional tag to display different things
336 depending on whether the volume is being changed. It can produce neat effects
337 when used with conditional viewports.
339 Example: \config{\%?mv(2.5)<Volume changing|\%pv>}
341 The example above will display the text ``Volume changing'' if the volume is
342 being changed and 2.5 seconds after the volume button has been released. After
343 that, it will display the volume value.
345 \section{Settings}
346 \begin{tagmap}
347 \config{\%St(<setting\tabnlindent{}name>)} & The value of the Rockbox
348 setting with the specified name. See \reference{ref:config_file_options}
349 for the list of the available settings.\\
350 \end{tagmap}
352 Examples:
353 \begin{enumerate}
354 \item As a simple tag: \config{\%St(skip length)}
355 \item As a conditional: \config{\%?St(eq enabled)<Eq is enabled|Eq is disabled>}
356 \end{enumerate}
359 \opt{lcd_bitmap}{
360 \section{\label{ref:wps_images}Images}
361 \begin{tagmap}
362 \nopt{archos}{%
363 \config{\%X(filename.bmp)}
364 & Load and set a backdrop image for the WPS.
365 This image must be exactly the same size as your LCD.\\
367 \config{\%x(n,filename,x,y)}
368 & Load and display an image\newline
369 \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\newline
370 \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\newline
371 \config{x}: x coordinate\newline
372 \config{y}: y coordinate.\\
373 \config{\%xl(n,filename,x,y,\tabnlindent[nimages])}
374 & Preload an image for later display (useful for when your images are displayed conditionally).\newline
375 \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\newline
376 \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\newline
377 If the filename is ``\_\_list\_icons\_\_'' the list icon bitmap will be used instead\newline
378 \config{x}: x coordinate\newline
379 \config{y}: y coordinate\newline
380 \config{nimages}: (optional) number of sub-images (tiled vertically, of the same height)
381 contained in the bitmap. Default is 1.\\
382 \config{\%xd(n[i] [,tag] [,offset])} & Display a preloaded image.
383 \config{n}: image ID (a-z and A-Z) as it was specified in \config{\%x} or \config{\%xl}\newline
384 \config{i}: (optional) number of the sub-image to display (a-z for 1-26 and A-Z for 27-52).
385 (ignored when \config{tag} is used)
386 By default the first (i.e. top most) sub-image will be used.\newline
387 \config{tag}: (optional) Another tag to calculate the subimage from e.g \config{\%xd(A, \%mh)} would
388 use the first subimage when \config{\%mh} is on and the second when it is off\newline
389 \config{offset}: (optional) Add this number to the value from the \config{tag} when
390 chosing the subimage (may be negative)\\
391 \end{tagmap}
393 Examples:
394 \begin{enumerate}
395 \item Load and display the image \fname{/.rockbox/bg.bmp} with ID ``a'' at 37, 109:\\
396 \config{\%x(a,bg.bmp,37,109)}
397 \item Load a bitmap strip containing 5 volume icon images (all the same size)
398 with image ID ``M'', and then reference the individual sub-images in a conditional:\\
399 \config{\%xl(M,volume.bmp,134,153,5)}\\
400 \config{\%?pv<\%xd(Ma)|\%xd(Mb)|\%xd(Mc)|%
401 \%xd(Md)|\%xd(Me)>}
402 \end{enumerate}
405 \note{
406 \begin{itemize}
407 \item The images must be in BMP format
408 \item The image tag must be on its own line
409 \item The ID is case sensitive, giving 52 different ID's
410 \item The size of the LCD screen for each \dap{} varies. See table below
411 for appropriate sizes of each device. The x and y coordinates must
412 respect each of the \daps{} limits.
413 \end{itemize}
417 \opt{albumart}{
418 \section{\label{ref:album_art}Album Art}
419 Rockbox allows you to put the album art, or another image related to the music
420 on your \dap{} to display it in the PictureFlow plugin\opt{albumart}{ or in the
421 theme}. For this feature to work, there are a few requirements.
423 \subsection{Limitations}
425 Rockbox supports embedded album art only for formats that use ID3v2 tags, such
426 as MP3. It additionally supports loading images located on the \disk{}.
427 The image files must be in either BMP or JPEG format, while embedded album art
428 is currently limited to JPEG. Rockbox does not support
429 RLE-compressed BMP files, nor does it support progressive and multi-scan
430 JPEG files. Embedded JPEG images must not be unsynchronized.
431 JPEG files must consist of a single scan with interleaved components,
432 as progessive and multi-scan images require much more memory to decode.
433 Pictureflow does not currently support embedded album art.
435 \subsection{Where to put album art}
437 The pictures can be named a number of different ways, and placed to a number of
438 different locations. You can have pictures specific to the file or the album
439 or use a generic picture. You can place the picture in the same directory
440 as the file, in the parent directory or in a fixed directory named
441 \fname{/.rockbox/albumart/}. The order Rockbox uses when looking for a picture
442 is as follows (a list in braces means that those file extensions are tried in
443 that order):
445 \begin{enumerate}
446 \item embedded (JPEG images in ID3v2 or MP4 tags only)
447 \item \fname{./filename.\{jpeg,jpg,bmp\}}
448 \item \fname{./albumtitle.\{jpeg,jpg,bmp\}}
449 \item \fname{./cover.\{jpeg,jpg,bmp\}}
450 \item \fname{./folder.jpg}
451 \item \fname{/.rockbox/albumart/albumartist-albumtitle.\{jpeg,jpg,bmp\}}
452 \item \fname{../albumtitle.\{jpeg,jpg,bmp\}}
453 \item \fname{../cover.\{jpeg,jpg,bmp\}}
454 \end{enumerate}
456 The following characters will be replaced with an underscore (\_) when looking
457 for albumtitle.bmp or albumartist-albumtitle.bmp: \textbackslash{} / : <
458 > ? * |. Doublequotes will be replaced by single quotes.
459 If no album artist is set, artist will be used instead. See \wikilink{AlbumArt}
460 in the wiki for programs that will help you automate the process of putting
461 album art on your \dap{}.
463 \subsection{How to display the album art}
465 Once the album art files are present on your \dap, they can be displayed as
466 follows.
468 \begin{tagmap}
469 \config{\%Cl(x,y,[maxwidth],\tabnlindent[maxheight],\tabnlindent{}hor\_align,\tabnlindent{}vert\_align)}
470 & Define the settings for album art\newline
471 \config{x}: x coordinate\newline
472 \config{y}: y coordinate\newline
473 \config{maxwidth}: Maximum height\newline
474 \config{maxheight}: Maximum width\newline
475 \config{hor\_align}: Horizontal alignment, enter as `l', `c' or `r' for
476 left, centre or right. Centre is default\newline
477 \config{vert\_align}: Vertical alignment, enter as `t', `c' or `b' for
478 top, centre or bottom. Centre is default\\
479 \config{\%Cd} & Display the album art as configured. \\
480 \config{\%C} & Use in a conditional to determine if an image is available. \\
481 \end{tagmap}
483 The picture will be rescaled, preserving aspect ratio to fit the given
484 \config{maxwidth} and \config{maxheight}. If the aspect ratio doesn't match the
485 configured values, the picture will be placed according to the alignment flags.
487 Examples:
488 \begin{enumerate}
489 \item Load albumart at position 20,40 and display it without resizing:\\
490 \config{\%Cl(20,40,,)}
491 \item Load albumart at position 0,20 and resize it to be at most 100$\times$100
492 pixels. If the image isn't square, align it to the bottom-right
493 corner:\\
494 \config{\%Cl(0,20,100,100,r,b)}
495 \end{enumerate}
498 \opt{radio}{
499 \section{FM Radio}
500 \begin{tagmap}
501 \config{\%tt} & Is the tuner tuned?\\
502 \config{\%tm} & Scan or preset mode? Scan is ``true'', preset is ``false''.\\
503 \config{\%ts} & Is the station in stereo?\\
504 \config{\%ta} & Minimum frequency (region specific) in MHz.\\
505 \config{\%tb} & Maximum frequency (region specific) in MHz.\\
506 \config{\%tf} & Current frequency in MHz.\\
507 \config{\%Ti} & Current preset id, i.e. 1-based number of the preset
508 within the presets list (usable in playlist viewer).\\
509 \config{\%Tn} & Current preset name (usable in playlist viewer).\\
510 \config{\%Tf} & Current preset frequency (usable in playlist viewer).\\
511 \config{\%Tc} & Preset count, i.e. the number of stations in the current
512 preset list.\\
513 \config{\%tx} & Is RDS available?\\
514 \config{\%ty} & RDS name.\\
515 \config{\%tz} & RDS text.\\
516 \config{\%tr} & Signal strength (RSSI). Can be used in a conditional or as
517 a bar.\\
518 \end{tagmap}
520 It is also possible to show ``Radio Art'' which can be used to display images
521 associated with presets. The tags are exactly the same as for album art,
522 described above. Images need to be placed in \fname{/.rockbox/fmpresets/},
523 and must have the same name as the preset. They need to be in either
524 \fname{.bmp} or \fname{.jpg} format, and the radio must be in preset mode
525 and tuned to a preset (and not recording) in order for them to be shown.
528 \section{Alignment and language direction}
529 \begin{tagmap}
530 \config{\%al} & Align the text left\\
531 \config{\%aL} & Align the text left, or to the right if RTL language is in use\\
532 \config{\%ac} & Centre the text\\
533 \config{\%ar} & Align the text right\\
534 \config{\%aR} & Align the text right, or to the left if RTL language is in use\\
535 \config{\%ax} & The next tag should follow the set language direction. When
536 prepended to a viewport declaration, the viewport will
537 be horizontally mirrored if the user language is set to
538 a RTL language. Currently the \%Cl, \%V and \%Vl tags
539 support this.\\
540 \config{\%Sr} & Use as a conditional to define options for left to right, or
541 right to left languages. \%?Sr<RTL|LTR>\\
542 \end{tagmap}
544 All alignment tags may be present in one line, but they need to be in the
545 order left -- centre -- right. If the aligned texts overlap, they are merged.
547 Example: \config{\%ax\%V(\dots)}
549 \section{Conditional Tags}
551 \begin{tagmap}
552 \config{\%?xx<true|false>}
553 & If / Else: Evaluate for true or false case \\
554 \config{\%?xx<alt1|alt2|\tabnlindent{}alt3|\dots|else>}
555 & Enumerations: Evaluate for first / second / third / \dots / last condition \\
556 \config{\%if(tag, operator, operand, [option count])}
557 & Allows very simple comparisons with other tags.\newline
558 \config{tag}: the tag to check against.\newline
559 \config{operator}: the comparison to perform - possible options are =, !=,
560 >, >=, <, <=\newline
561 \config{operand}: either a second tag, a number, or text.\newline
562 \config{[option count]}: optional parameter used to select which parameter
563 of a tag to use when the tag has multiple options, e.g. \%?pv<a|b|c|d>\\
564 \end{tagmap}
566 Examples of the \%if tag:\\
568 \config{\%?if(\%pv, >=, 0)<Clipping possible|Volume OK>} will display ``Clipping
569 possible'' if the volume is higher than or equal to 0 dB, ``Volume OK'' if it
570 is lower.\\
572 \config{\%?if(\%ia, =, \%Ia)<same artist>} -- this artist and the next artist
573 are the same.\\
575 \note{When performing a comparison against a string tag such as \%ia, only = and
576 != work, and the comparison is not case sensitive.}
578 \section{Subline Tags}
580 \begin{tagmap}
581 \config{\%t(time)}
582 & Set the subline display cycle time (\%t(5) or \%t(3.4) formats) \\
583 \config{;}
584 & Split items on a line into separate sublines \\
585 \end{tagmap}
587 Allows grouping of several items (sublines) onto one line, with the
588 display cycling round the defined sublines. See
589 \reference{ref:AlternatingSublines} for details.
591 \opt{rtc}{
592 \section{Time and Date}
593 \begin{tagmap}
594 \config{\%cd} & Day of month from 01 to 31\\
595 \config{\%ce} & Zero padded day of month from 1 to 31\\
596 \config{\%cf} & A conditional for 12/24 hour format.\newline
597 \config{\%?cf<24 hour stuff|12 hour stuff>}\\
598 \config{\%cH} & Zero padded hour from 00 to 23 (24 hour format)\\
599 \config{\%ck} & Hour from 0 to 23 (24 hour format)\\
600 \config{\%cI} & Zero padded hour from 01 to 12 (am/pm format)\\
601 \config{\%cl} & Hour from 1 to 12 (am/pm format)\\
602 \config{\%cm} & Month from 01 to 12\\
603 \config{\%cM} & Minutes\\
604 \config{\%cS} & Seconds\\
605 \config{\%cy} & 2-digit year\\
606 \config{\%cY} & 4-digit year\\
607 \config{\%cP} & Capital AM/PM\\
608 \config{\%cp} & Lowercase am/pm\\
609 \config{\%ca} & Weekday name\\
610 \config{\%cb} & Month name\\
611 \config{\%cu} & Day of week from 1 to 7, 1 is Monday\\
612 \config{\%cw} & Day of week from 0 to 6, 0 is Sunday\\
613 \end{tagmap}
616 \section{Text Translation}
617 \begin{tagmap}
618 \config{\%Sx(English)}
619 & Display the translation of ``English'' in the current language\\
620 \end{tagmap}
622 \begin{itemize}
623 \item ``English'' must be a phrase used in the language file.
624 \item It should match the \config{Source:} line in the language file.
625 \end{itemize}
627 \note{checkwps cannot verify that the string is correct, so please check on
628 either the simulator or on target.}
631 \opt{touchscreen}{
632 \section{Touchscreen Areas}
633 \begin{tagmap}
634 \config{\%T(x,y,width,\tabnlindent{}height, action, [options])}
635 & Invoke the action specified when the user presses in the defined
636 touchscreen area.\\
637 \end{tagmap}
639 Possible actions are:
641 \begin{description}
642 \item[play] -- Play/pause playback.
643 \item[stop] -- Stop playback and exit the WPS.
644 \item[prev] -- Previous track/item.
645 \item[next] -- Next track/item.
646 \item[wps\_prev] -- Previous track.
647 \item[wps\_next] -- Next track.
648 \item[ffwd] -- Seek forwards in the track.
649 \item[rwd] -- Seek backwards in the track.
650 \item[menu] -- Go to the main menu.
651 \item[browse] -- Go back to the file browser or database.
652 \item[shuffle] -- Toggle shuffle mode.
653 \item[repmode] -- Cycle through the repeat modes.
654 \item[quickscreen] -- Go to the quickscreen.
655 \item[contextmenu] -- Open the context menu.
656 \item[playlist] -- Go to the playlist viewer.
657 \item[progressbar] -- Seek to the appropriate position in the track based on the touch.
658 \item[volume] -- Set the volume to the appropriate level based on the touch.
659 \item[pitch] -- Open the pitchscreen.
660 \item[voldown] -- Decrease the volume by one step.
661 \item[volup] -- Increase the volume by one step.
662 \item[mute] -- Un/Mute playback.
663 \item[setting\_inc] -- Increment the subsequently specified setting (e.g
664 \config{\%T(0,0, setting\_inc, volume)} increases the volume by one step).
665 \item[setting\_dec] -- Decrement the subsequently specified setting (e.g
666 \config{\%T(0,0, setting\_dec, volume)} decreases the volume by one step).
667 \end{description}
668 Any (or muliple) of the following options can be used after the action is specified
669 \subsection{Options}
670 \begin{description}
671 \item[repeat_press] -- This region will trigger mulitple times when held (i.e for seeking)
672 \item[long_press] -- This region will trigger once after it is held for a long press
673 \item[reverse_bar] -- Reverse the bars touch direction (i.e seek right to left)
674 \item[allow_while_locked] -- Allows the region to be pressable when the
675 skin is locked by the lock touch action
676 \end{description}
678 \section{Last Touchscreen Press}
679 \begin{tagmap}
680 \config{\%Tl} & Indicates that the touchscreen is pressed.\\
681 \end{tagmap}
682 This tag can be used to display text or images or a viewport when the
683 touchscreen is pressed (like an On Screen Display). If you put a number
684 straight after \%Tl it will be used as a timeout in seconds
685 (e.g \%Tl(2.5) will give a 2.5 second timeout) between the touchscreen press
686 being released and the tag going false. If no number is specified it will
687 use a 1 second timeout. It can also be used as a conditional, and can be
688 used with conditional viewports.
691 \section{\label{ref:bar_tags}Bar Tags}
692 Some tags can be used to display a bar which draws according to the value of
693 the tag. To use these tags like a bar you need to use the following parameters
694 (\%XX should be replaced with the actual tag).
696 \begin{tagmap}
697 \config{\%XX(x, y, width, height, [options])}
698 & Draw the specified tag as a bar\newline
699 \config{x}: x co-ordinate at which to start drawing the bar.\newline
700 \config{y}: y co-ordinate at which to start drawing the bar.\newline
701 \config{width}: width of the bar (- for the full viewport width).\newline
702 \config{height}: height of the bar (- to set to the font height for
703 horizontal bars and to the viewport height for vertical bars).\newline
704 \config{options}: any of the options set out below.\\
705 \end{tagmap}
707 \subsection{Options}
708 \begin{description}
709 \item[image] -- the next option is either the filename or image label to
710 use for the fill image.
711 \item[horizontal] -- force the bar to be drawn horizontally.
712 \item[vertical] -- force the bar to be drawn vertically.
713 \item[invert] -- invert the draw direction (i.e. right to left, or top to
714 bottom).
715 \item[slider] -- draw a preloaded image over the top of the bar so that
716 the centre of the image matches the current position. This must be
717 followed by the label of the desired image.
718 \item[backdrop] -- draw a preloaded image under the bar. The full
719 image will be displayed and must be the same size as the bar.
720 This must be followed by the label of the desired image.
721 \item[nofill] -- don't draw the bar, only its frame (for use with the
722 ``slider'' option).
723 \item[nobar] -- don't draw the bar or its frame (for use with the
724 ``slider'' option).
725 \end{description}
727 Example: \config{\%pb(0,0,-,-,-,nofill, slider, slider\_image, invert)} -- draw
728 a horizontal progressbar which doesn't fill and draws the image
729 ``slider\_image'' which moves right to left.
731 \note{If the slider option is used, the bar will be shrunk so that the slider
732 fits inside the specified width and height.}
734 \section{Other Tags}
735 \begin{tagmap}
736 \config{\%(} & The character `('\\
737 \config{\%)} & The character `)'\\
738 \config{\%,} & The character `,'\\
739 \config{\%\%} & The character `\%'\\
740 \config{\%<} & The character `<'\\
741 \config{\%|} & The character `|'\\
742 \config{\%>} & The character `>'\\
743 \config{\%;} & The character `;'\\
744 \config{\%\#} & The character `\#'\\
745 \config{\%s} & Indicate that the line should scroll. Can occur
746 anywhere in a line (given that the text is
747 displayed; see conditionals above). You can specify
748 up to ten scrolling lines. Scrolling lines can not
749 contain dynamic content such as timers, peak meters
750 or progress bars.\\
751 \end{tagmap}