fix the manual for image wps tags
[maemo-rb.git] / manual / appendix / wps_tags.tex
blob2ecd98efc146cfb0e5378e8cba3afcc81965d19d
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.\\
95 \config{\%VB} & Draw this viewport on the backdrop layer.\\
96 \end{tagmap}
98 \section{Additional Fonts}
99 \begin{tagmap}
100 \config{\%Fl('id',filename)} & See section \ref{ref:multifont}.\\
101 \end{tagmap}
103 \section{Misc Coloring Tags}
104 \begin{tagmap}
105 \config{\%dr(x,y,width,height,[color1,color2])} & Color a rectangle. \\
106 \end{tagmap}
107 width and height can be - to fill the viewport. If no color is
108 specified the viewports foreground color will be used. If two
109 colors are specified it will do a gradient fill.
112 \section{Power Related Information}
113 \begin{tagmap}
114 \config{\%bl} & Numeric battery level in percents.
115 Can also be used in a conditional:
116 \config{\%?bl<-1|0|1|2|\ldots|N>},
117 where the value $-1$ is used when the battery level isn't
118 known (it usually is). The value $N$ is only used when the
119 battery level is exactly 100 percent.
120 An image can also be used, the proportion of the image
121 shown corresponds to the battery level:
122 \config{\%bl(x,y,[width],[height],image.bmp)}\\
123 \config{\%bv} & The battery level in volts\\
124 \config{\%bt} & Estimated battery time left\\
125 \config{\%bp} & ``p'' if the charger is connected (only on targets
126 that can charge batteries)\\
127 \config{\%bc} & ``c'' if the unit is currently charging the battery (only on
128 targets that have software charge control or monitoring)\\
129 \config{\%bs} & Remaining time of the sleep timer (if it is set)\\
130 \end{tagmap}
132 \section{Information about the file}
133 \begin{tagmap}
134 \config{\%fb} & File Bitrate (in kbps)\\
135 \config{\%fc} & File Codec (e.g. ``MP3'' or ``FLAC'').
136 This tag can also be used in a conditional tag:
137 \config{\%?fc<mp1|mp2|mp3|aiff|wav|ogg|\newline
138 flac|mpcsv7|a52|wavpack|alac|aac|shn|sid|adx|nsf|\newline
139 speex|spc|ape|wma|wmpapro|mod|sap|realaudiocook|\newline
140 realaudioaac|realaudioac3|realaudioatrac3|cmc|\newline
141 cm3|cmr|cms|dmc|dlt|mpt|mpd|rmt|tmc|tm8|tm2|\newline
142 omaatrac3|smaf|au|vox|wave64|tta|wmavoice|mpcsv8|\newline
143 aache|ay|gbs|hes|sgc|vgm|kss|unknown>}.
144 The codec order is as shown above.\\
145 \config{\%ff} & File Frequency (in Hz)\\
146 \config{\%fk} & File Frequency (in kHz)\\
147 \config{\%fm} & File Name\\
148 \config{\%fn} & File Name (without extension)\\
149 \config{\%fp} & File Path\\
150 \config{\%fs} & File Size (in Kilobytes)\\
151 \config{\%fv} & ``(avg)'' if variable bit rate or empty string if constant bit rate\\
152 \config{\%d(N)} & N-th segment from the end of the file's directory
153 (N can be 1, 2, 3, \dots)\\
154 \end{tagmap}
155 Example for the \config{\%d(N)} commands: If the file is
156 ``/Rock/Kent/Isola/11 - 747.mp3'', \config{\%d(1)} is ``Isola'',
157 \config{\%d(2)} is ``Kent'' and \config{\%d(3)} is ``Rock''.
159 These tags, when written with the first letter capitalized (e.g. \config{\%Fn}
160 or \config{\%D(2)}), produce the information for the next file to be played.
162 \section{Playlist/Song Info}
163 \begin{tagmap}
164 \config{\%pb} & Progress Bar.
165 \opt{player}{
166 This will display a one character ``cup''
167 that empties as the time progresses.}
168 \opt{lcd_bitmap}{
169 This will replace the entire line with a progress bar.
170 You can set the position, width and height of the progressbar
171 (in pixels) and load a custom image for it:
172 \config{\%pb(x,y,[width],[height],image.bmp)}} \\
173 \opt{player}{%
174 \config{\%pf} & Full-line progress bar \& time display\\
176 \config{\%px} & Percentage played in song\\
177 \config{\%pc} & Current time in song\\
178 \config{\%pe} & Total number of playlist entries\\
179 \nopt{player}{%
180 \config{\%pm} & Peak Meter. The entire line is used as %
181 volume peak meter.\\%
182 \config{\%pL} & Peak meter for the left channel. Can be used as a value, %
183 a conditional tag or a bar tag.\\
184 \config{\%pR} & Peak meter for the right channel. Can be used as a value, %
185 a conditional tag or a bar tag.\\
187 \config{\%pn} & Playlist name (without path or extension)\\
188 \config{\%pp} & Playlist position\\
189 \config{\%pr} & Remaining time in song\\
190 \config{\%ps} & ``s'' if shuffle mode is enabled\\
191 \config{\%pt} & Total track time\\
192 \config{\%pv} & Current volume (in dB). Can also be used in a conditional:
193 \config{\%?pv<Mute|\ldots|0 dB|Above 0 dB>}\newline
194 Mute is 0\% volume, \ldots is the values between Mute and max, 0 dB is max volume, and Above 0 dB is amplified volume
195 \opt{lcd_bitmap}{This can also be used like \%pb to provide a continuous scale:
196 \config{\%pv(x,y,[width],[height],image.bmp)}} \\
197 \config{\%pS} & Track is starting. An optional number gives how many seconds
198 the tag remains true for after the start of the track. The default is
199 10 seconds if no number is specified.
200 \config{\%?pS(7)<in the first 7 seconds of track|in
201 the rest of the track>}\\
202 \config{\%pE} & Track is ending. An optional number gives how many seconds
203 before the end of the track the tag becomes true. The default is
204 10 seconds if no number is specified.
205 \config{\%?pE(7)<in the last 7 seconds of track|in
206 the rest of the track>}\\
207 \config{\%Sp} & Current playback pitch\\
208 \end{tagmap}
210 \section{Playlist Viewer}
211 \begin{tagmap}
212 \config{\%Vp(start,code to render)} & Display the playlist viewer in
213 the current viewport.\\
214 \end{tagmap}
216 \begin{itemize}
217 \item `start' is the offset relative to the currently playing track for the
218 playlist to display from (0 the current track, 1 is the next track, etc.).
219 \item `code to render' is a line of skin code which will be displayed for
220 each line in the viewer. All text tags are supported (including conditionals
221 and sublines)
222 \end{itemize}
224 The entire viewport will be used, so don't expect other tags in the same
225 viewport to work well. Supported tags are \%pp, all tags starting with \%i,
226 most tags starting with \%f, \%pt and \%s.\\
228 Example: \config{\%Vp(1,\%pp - \%it,\%pp - \%fn)} -- Display the playlist
229 position, then either the track title (from the tags) or
230 the filename. The viewer will display as many tracks as will fit in the
231 viewport.
233 \section{Runtime Database}
234 \begin{tagmap}
235 \config{\%rp} & Song playcount\\
236 \config{\%rr} & Song rating (0-10). This tag can also be used in a conditional tag: %
237 \config{\%?rr<0|1|2|3|4|5|6|7|8|9|10>}\\
238 \config{\%ra} & Autoscore for the song\\
239 \end{tagmap}
241 \opt{swcodec}{
242 \section{Sound (DSP) settings}
243 \begin{tagmap}
244 \config{\%Sp} & Current playback pitch \\
245 \opt{swcodec}{
246 \config{\%xf} & Crossfade setting, in the order: Off, Auto Skip, Man Skip,
247 Shuffle, Shuffle and Man Skip, Always\\
248 \config{\%rg} & ReplayGain value in use (x.y~dB). If used as a conditional,
249 Replaygain type in use: \config{\%?rg<Off|Track%
250 |Album|TrackShuffle|AlbumShuffle%
251 |No tag>}\\
253 \end{tagmap}
256 \section{Hold}
257 \begin{tagmap}
258 \config{\%mh} & ``h'' if the main unit keys are locked\\
259 \opt{remote_button_hold}{%
260 \config{\%mr} & ``r'' if the remote keys are locked\\
262 \end{tagmap}
264 \section{Virtual LED}
265 \begin{tagmap}
266 \config{\%lh} & ``h'' if the \disk\ is accessed\\
267 \end{tagmap}
269 \section{Repeat Mode}
270 \begin{tagmap}
271 \config{\%mm} & Repeat mode, 0-4, in the order: Off, All, One, Shuffle, A-B\\
272 \end{tagmap}
273 Example: \config{\%?mm<Off|All|One|Shuffle|A-B>}
275 \section{Playback Mode}
276 \begin{tagmap}
277 \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause,
278 Fast Forward, Rewind, Recording, Recording paused, FM Radio playing,
279 FM Radio muted\\
280 \end{tagmap}
281 Example: \config{\%?mp<Stop|Play|Pause|Ffwd|Rew|Rec|Rec pause|FM|FM pause>}
283 \section{Current Screen}
284 \begin{tagmap}
285 \config{\%cs} & The current screen, 1-20, in the order shown below\\
286 \end{tagmap}
288 \begin{table}
289 \begin{rbtabular}{.75\textwidth}{lX}%
290 {\textbf{Number} & \textbf{Screen}}{}{}
291 1 & Menus \\
292 2 & WPS \\
293 3 & Recording screen \\
294 4 & FM Radio screen \\
295 5 & Current Playlist screen \\
296 6 & Settings menus \\
297 7 & File browser \\
298 8 & Database browser \\
299 9 & Plugin browser \\
300 10 & Quickscreen \\
301 11 & Pitchscreen \\
302 12 & Setting chooser \\
303 13 & Playlist Catalogue Viewer \\
304 14 & Plugin \\
305 15 & Context menu \\
306 16 & System Info screen \\
307 17 & Time and Date Screen \\
308 18 & Bookmark browser \\
309 19 & Shortcuts menu \\
310 20 & Track Info screen \\
311 \end{rbtabular}
312 \end{table}
314 The tag can also be used as the switch in a conditional tag. For players without
315 certain capabilities (e.g. no FM radio) some values will never be returned.
317 Examples:
319 \config{You are in the \%?cs<Main menu|WPS|Recording screen|FM Radio screen>}
321 \config{\%?if(\%cs, =, 2)<This is the WPS>}
323 \section{List Title (\fname{.sbs} only)}
324 \begin{tagmap}
325 \config{\%Lt} & Title text. Should be used in a conditional so that non-list
326 screens don't show a title when they shouldn't\\
327 \config{\%Li} & Title icon. This uses the same order as custom icons (see
328 \wikilink{CustomIcons} in the wiki) except that here \config{0} is ``no
329 icon''\\
330 \end{tagmap}
332 This tag can be used to give custom formatting to list titles.
333 Define a viewport with the font and formatting desired, and then use
334 \config{\%?Lt<\%Lt>} to display the title within the
335 viewport. If \config{\%Lt} is present anywhere in the \fname{.sbs}, then the
336 \config{\%Vi} viewport will not show the title.
338 \section{Changing Volume}
339 \begin{tagmap}
340 \config{\%mv(t)} & ``v'' if the volume is being changed\\
341 \end{tagmap}
343 The tag produces the letter ``v'' while the volume is being changed and some
344 amount of time after that, i.e. after the volume button has been released. The
345 optional parameter \config{t} specifies that amount of time, in seconds. If it
346 is not specified, 1 second is assumed.
348 The tag can be used as the switch in a conditional tag to display different things
349 depending on whether the volume is being changed. It can produce neat effects
350 when used with conditional viewports.
352 Example: \config{\%?mv(2.5)<Volume changing|\%pv>}
354 The example above will display the text ``Volume changing'' if the volume is
355 being changed and 2.5 seconds after the volume button has been released. After
356 that, it will display the volume value.
358 \section{Settings}
359 \begin{tagmap}
360 \config{\%St(<setting\tabnlindent{}name>)} & The value of the Rockbox
361 setting with the specified name. See \reference{ref:config_file_options}
362 for the list of the available settings.\\
363 \config{\%St(...)} & Draw a bar using from the setting.
364 See \reference{ref:bar_tags} for details.\\
365 \end{tagmap}
367 Examples:
368 \begin{enumerate}
369 \item As a simple tag: \config{\%St(skip length)}
370 \item As a conditional: \config{\%?St(eq enabled)<Eq is enabled|Eq is disabled>}
371 \end{enumerate}
374 \opt{lcd_bitmap}{
375 \section{\label{ref:wps_images}Images}
376 \begin{tagmap}
377 \nopt{archos}{%
378 \config{\%X(filename.bmp)}
379 & Load and set a backdrop image for the WPS.
380 This image must be exactly the same size as your LCD.\\
382 \config{\%x(n,filename[,x,y])}
383 & Load and display an image\newline
384 \config{n}: image ID for later referencing in \config{\%xd}\newline
385 \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\newline
386 \config{x}: x coordinate (defaults to 0 if both x and y are not specified)\newline
387 \config{y}: y coordinate. (defaults to 0 if both x and y are not specified)\\
388 \config{\%xl(n,filename,[x,y],\tabnlindent[nimages])}
389 & Preload an image for later display (useful for when your images are displayed conditionally).\newline
390 \config{n}: image ID for later referencing in \config{\%xd}\newline
391 \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\newline
392 If the filename is ``\_\_list\_icons\_\_'' the list icon bitmap will be used instead\newline
393 \config{x}: x coordinate (defaults to 0 if both x and y are not specified)\newline
394 \config{y}: y coordinate. (defaults to 0 if both x and y are not specified)\newline
395 \config{nimages}: (optional) number of sub-images (tiled vertically, of the same height)
396 contained in the bitmap. Default is 1.\\
397 \config{\%xd(n[i] [,tag] [,offset])} & Display a preloaded image.
398 \config{n}: image ID as it was specified in \config{\%x} or \config{\%xl}\newline
399 \config{i}: (optional) number of the sub-image to display (a-z for 1-26 and A-Z for 27-52).
400 (ignored when \config{tag} is used). Only useable if the ID is a single letter.
401 By default the first (i.e. top most) sub-image will be used.\newline
402 \config{tag}: (optional) Another tag to calculate the subimage from e.g \config{\%xd(A, \%mh)} would
403 use the first subimage when \config{\%mh} is on and the second when it is off\newline
404 \config{offset}: (optional) Add this number to the value from the \config{tag} when
405 chosing the subimage (may be negative)\\
406 \config{\%x9(n)}
407 & Display an image as a 9-patch bitmap covering the entire viewport.\newline
408 9-patch images are bitmaps split into 9 segments where the four corners
409 are unscaled, the four middle sections are scaled along one axis and the middle
410 section is scaled on both axis.\newline
411 \config{n}: image ID\\
413 \end{tagmap}
415 Examples:
416 \begin{enumerate}
417 \item Load and display the image \fname{/.rockbox/bg.bmp} with ID ``a'' at 37, 109:\\
418 \config{\%x(a,bg.bmp,37,109)}
419 \item Load a bitmap strip containing 5 volume icon images (all the same size)
420 with image ID ``M'', and then reference the individual sub-images in a conditional:\\
421 \config{\%xl(M,volume.bmp,134,153,5)}\\
422 \config{\%?pv<\%xd(Ma)|\%xd(Mb)|\%xd(Mc)|%
423 \%xd(Md)|\%xd(Me)>}
424 \end{enumerate}
427 \note{
428 \begin{itemize}
429 \item The images must be in BMP format
430 \item The image tag must be on its own line
431 \item The ID is case sensitive
432 \item The size of the LCD screen for each \dap{} varies. See table below
433 for appropriate sizes of each device. The x and y coordinates must
434 respect each of the \daps{} limits.
435 \end{itemize}
439 \opt{albumart}{
440 \subsection{How to display the album art}
442 Once the album art files are present on your \dap, they can be displayed as
443 follows.
445 \begin{tagmap}
446 \config{\%Cl(x,y,[maxwidth],\tabnlindent[maxheight],\tabnlindent{}hor\_align,\tabnlindent{}vert\_align)}
447 & Define the settings for album art\newline
448 \config{x}: x coordinate\newline
449 \config{y}: y coordinate\newline
450 \config{maxwidth}: Maximum height\newline
451 \config{maxheight}: Maximum width\newline
452 \config{hor\_align}: Horizontal alignment, enter as `l', `c' or `r' for
453 left, centre or right. Centre is default\newline
454 \config{vert\_align}: Vertical alignment, enter as `t', `c' or `b' for
455 top, centre or bottom. Centre is default\\
456 \config{\%Cd} & Display the album art as configured. \\
457 \config{\%C} & Use in a conditional to determine if an image is available. \\
458 \end{tagmap}
460 The picture will be rescaled, preserving aspect ratio to fit the given
461 \config{maxwidth} and \config{maxheight}. If the aspect ratio doesn't match the
462 configured values, the picture will be placed according to the alignment flags.
464 Examples:
465 \begin{enumerate}
466 \item Load albumart at position 20,40 and display it without resizing:\\
467 \config{\%Cl(20,40,,)}
468 \item Load albumart at position 0,20 and resize it to be at most 100$\times$100
469 pixels. If the image isn't square, align it to the bottom-right
470 corner:\\
471 \config{\%Cl(0,20,100,100,r,b)}
472 \end{enumerate}
474 For general information where to put album art see \reference{ref:album_art}.
477 \opt{radio}{
478 \section{FM Radio}
479 \begin{tagmap}
480 \config{\%tt} & Is the tuner tuned?\\
481 \config{\%tm} & Scan or preset mode? Scan is ``true'', preset is ``false''.\\
482 \config{\%ts} & Is the station in stereo?\\
483 \config{\%ta} & Minimum frequency (region specific) in MHz.\\
484 \config{\%tb} & Maximum frequency (region specific) in MHz.\\
485 \config{\%tf} & Current frequency in MHz.\\
486 \config{\%Ti} & Current preset id, i.e. 1-based number of the preset
487 within the presets list (usable in playlist viewer).\\
488 \config{\%Tn} & Current preset name (usable in playlist viewer).\\
489 \config{\%Tf} & Current preset frequency (usable in playlist viewer).\\
490 \config{\%Tc} & Preset count, i.e. the number of stations in the current
491 preset list.\\
492 \config{\%tx} & Is RDS available?\\
493 \config{\%ty} & RDS name.\\
494 \config{\%tz} & RDS text.\\
495 \config{\%tr} & Signal strength (RSSI). Can be used in a conditional or as
496 a bar.\\
497 \end{tagmap}
499 It is also possible to show ``Radio Art'' which can be used to display images
500 associated with presets. The tags are exactly the same as for album art,
501 described above. Images need to be placed in \fname{/.rockbox/fmpresets/},
502 and must have the same name as the preset. They need to be in either
503 \fname{.bmp} or \fname{.jpg} format, and the radio must be in preset mode
504 and tuned to a preset (and not recording) in order for them to be shown.
507 \section{Alignment and language direction}
508 \begin{tagmap}
509 \config{\%al} & Align the text left\\
510 \config{\%aL} & Align the text left, or to the right if RTL language is in use\\
511 \config{\%ac} & Centre the text\\
512 \config{\%ar} & Align the text right\\
513 \config{\%aR} & Align the text right, or to the left if RTL language is in use\\
514 \config{\%ax} & The next tag should follow the set language direction. When
515 prepended to a viewport declaration, the viewport will
516 be horizontally mirrored if the user language is set to
517 a RTL language. Currently the \%Cl, \%V and \%Vl tags
518 support this.\\
519 \config{\%Sr} & Use as a conditional to define options for left to right, or
520 right to left languages. \%?Sr<RTL|LTR>\\
521 \end{tagmap}
523 All alignment tags may be present in one line, but they need to be in the
524 order left -- centre -- right. If the aligned texts overlap, they are merged.
526 Example: \config{\%ax\%V(\dots)}
528 \section{Conditional Tags}
530 \begin{tagmap}
531 \config{\%?xx<true|false>}
532 & If / Else: Evaluate for true or false case \\
533 \config{\%?xx<alt1|alt2|\tabnlindent{}alt3|\dots|else>}
534 & Enumerations: Evaluate for first / second / third / \dots / last condition \\
535 \config{\%if(tag, operator, operand, [option count])}
536 & Allows very simple comparisons with other tags.\newline
537 \config{tag}: the tag to check against.\newline
538 \config{operator}: the comparison to perform - possible options are =, !=,
539 >, >=, <, <=\newline
540 \config{operand}: either a second tag, a number, or text.\newline
541 \config{[option count]}: optional parameter used to select which parameter
542 of a tag to use when the tag has multiple options, e.g. \%?pv<a|b|c|d>\\
543 \config{\%and(tag1, tag2, ..., tagN)}\newline
544 & Logical ``and'' operator. Will be evaluate to true if all the tag parameters are true.\\
545 \config{\%or(tag1, tag2, ..., tagN)}\newline
546 & Logical ``or'' operator. Will be evaluate to true if any of the tag parameters are true.\\
547 \end{tagmap}
549 Examples of the \%if tag:\\
551 \config{\%?if(\%pv, >=, 0)<Clipping possible|Volume OK>} will display ``Clipping
552 possible'' if the volume is higher than or equal to 0 dB, ``Volume OK'' if it
553 is lower.\\
555 \config{\%?if(\%ia, =, \%Ia)<same artist>} -- this artist and the next artist
556 are the same.\\
558 \note{When performing a comparison against a string tag such as \%ia, only = and
559 != work, and the comparison is not case sensitive.}
561 \section{Subline Tags}
563 \begin{tagmap}
564 \config{\%t(time)}
565 & Set the subline display cycle time (\%t(5) or \%t(3.4) formats) \\
566 \config{;}
567 & Split items on a line into separate sublines \\
568 \end{tagmap}
570 Allows grouping of several items (sublines) onto one line, with the
571 display cycling round the defined sublines. See
572 \reference{ref:AlternatingSublines} for details.
574 \opt{rtc}{
575 \section{Time and Date}
576 \begin{tagmap}
577 \config{\%cd} & Day of month from 01 to 31\\
578 \config{\%ce} & Zero padded day of month from 1 to 31\\
579 \config{\%cf} & A conditional for 12/24 hour format.\newline
580 \config{\%?cf<24 hour stuff|12 hour stuff>}\\
581 \config{\%cH} & Zero padded hour from 00 to 23 (24 hour format)\\
582 \config{\%ck} & Hour from 0 to 23 (24 hour format)\\
583 \config{\%cI} & Zero padded hour from 01 to 12 (am/pm format)\\
584 \config{\%cl} & Hour from 1 to 12 (am/pm format)\\
585 \config{\%cm} & Month from 01 to 12\\
586 \config{\%cM} & Minutes\\
587 \config{\%cS} & Seconds\\
588 \config{\%cy} & 2-digit year\\
589 \config{\%cY} & 4-digit year\\
590 \config{\%cP} & Capital AM/PM\\
591 \config{\%cp} & Lowercase am/pm\\
592 \config{\%ca} & Weekday name\\
593 \config{\%cb} & Month name\\
594 \config{\%cu} & Day of week from 1 to 7, 1 is Monday\\
595 \config{\%cw} & Day of week from 0 to 6, 0 is Sunday\\
596 \end{tagmap}
599 \section{Text Translation}
600 \begin{tagmap}
601 \config{\%Sx(English)}
602 & Display the translation of ``English'' in the current language\\
603 \end{tagmap}
605 \begin{itemize}
606 \item ``English'' must be a phrase used in the language file.
607 \item It should match the \config{Source:} line in the language file.
608 \end{itemize}
610 \note{checkwps cannot verify that the string is correct, so please check on
611 either the simulator or on target.}
614 \opt{touchscreen}{
615 \section{Touchscreen Areas}
616 \begin{tagmap}
617 \config{\%T(x,y,width,\tabnlindent{}height, action, [options])}
618 & Invoke the action specified when the user presses in the defined
619 touchscreen area.\\
620 \end{tagmap}
622 Possible actions are:
624 \begin{description}
625 \item[none] -- Do nothing.
626 \item[play] -- Play/pause playback.
627 \item[stop] -- Stop playback and exit the WPS.
628 \item[prev] -- Previous track/item.
629 \item[next] -- Next track/item.
630 \item[wps\_prev] -- Previous track.
631 \item[wps\_next] -- Next track.
632 \item[ffwd] -- Seek forwards in the track.
633 \item[rwd] -- Seek backwards in the track.
634 \item[progressbar] -- Seek to the appropriate position in the track based on the touch.
635 \item[shuffle] -- Toggle shuffle mode.
636 \item[repmode] -- Cycle through the repeat modes.
637 \item[volume] -- Set the volume to the appropriate level based on the touch.
638 \item[voldown] -- Decrease the volume by one step.
639 \item[volup] -- Increase the volume by one step.
640 \item[mute] -- Un/Mute playback.
641 \item[createbookmark] -- Create a bookmark in the currently-playing track.
642 \item[hotkey] -- Performs the action assigned to the hotkey (see Hotkeys section).
643 \item[menu] -- Go to the main menu.
644 \item[browse] -- Go back to the file browser or database.
645 \item[resumeplayback] -- Go back to the last music screen (WPS or radio screen).
646 \item[quickscreen] -- Go to the quickscreen.
647 \item[contextmenu] -- Open the context menu.
648 \item[playlist] -- Go to the playlist viewer.
649 \item[listbookmarks] -- List the bookmarks for the currently-playing directory or playlist.
650 \item[trackinfo] -- Open the track info viewer.
651 \item[pitch] -- Open the pitchscreen.
652 \item[setting\_inc] -- Increment the subsequently specified setting (e.g
653 \config{\%T(0,0,32,32, setting\_inc, volume)} increases the volume by one step).
654 \item[setting\_dec] -- Decrement the subsequently specified setting (e.g
655 \config{\%T(0,0,32,32, setting\_dec, volume)} decreases the volume by one step).
656 \item[setting\_set] -- Set the subsequently specified setting to a specific value (e.g
657 \config{\%T(0,0,32,32, setting\_set, volume, 0)} sets the volume to 0).
658 \item[lock] -- Soft locks the touchscreen. All touch areas are disabled except for
659 areas with the lock action or ones that have the allow\_while\_locked option (see below).
660 \end{description}
661 Any (or muliple) of the following options can be used after the action is specified
662 \subsection{Options}
663 \begin{description}
664 \item[repeat\_press] -- This area will trigger mulitple times when held (i.e for seeking)
665 \item[long\_press] -- This area will trigger once after it is held for a long press
666 \item[reverse\_bar] -- Reverse the bars touch direction (i.e seek right to left)
667 \item[allow\_while\_locked] -- Allows the area to be pressable when the
668 skin is locked by the lock touch action
669 \end{description}
671 \section{Last Touchscreen Press}
672 \begin{tagmap}
673 \config{\%Tl} & Indicates that the touchscreen is pressed.\\
674 \end{tagmap}
675 This tag can be used to display text or images or a viewport when the
676 touchscreen is pressed (like an On Screen Display). If you put a number
677 straight after \%Tl it will be used as a timeout in seconds
678 (e.g \%Tl(2.5) will give a 2.5 second timeout) between the touchscreen press
679 being released and the tag going false. If no number is specified it will
680 use a 1 second timeout. It can also be used as a conditional, and can be
681 used with conditional viewports.
684 \section{\label{ref:bar_tags}Bar Tags}
685 Some tags can be used to display a bar which draws according to the value of
686 the tag. To use these tags like a bar you need to use the following parameters
687 (\%XX should be replaced with the actual tag).
689 \opt{touchscreen}{
690 Volume and progress bars automatically create touch regions the same size
691 as the bar (slightly larger actually). This can be disabled with the
692 \config{notouch} option.
695 \begin{tagmap}
696 \config{\%XX(x, y, width, height, [options])}
697 & Draw the specified tag as a bar\newline
698 \config{x}: x co-ordinate at which to start drawing the bar.\newline
699 \config{y}: y co-ordinate at which to start drawing the bar.\newline
700 \config{width}: width of the bar (- for the full viewport width).\newline
701 \config{height}: height of the bar (- to set to the font height for
702 horizontal bars and to the viewport height for vertical bars).\newline
703 \config{options}: any of the options set out below.\\
704 \end{tagmap}
706 \subsection{Options}
707 \begin{description}
708 \item[image] -- the next option is either the filename or image label to
709 use for the fill image.
710 \item[horizontal] -- force the bar to be drawn horizontally.
711 \item[vertical] -- force the bar to be drawn vertically.
712 \item[invert] -- invert the draw direction (i.e. right to left, or top to
713 bottom).
714 \item[slider] -- draw a preloaded image over the top of the bar so that
715 the centre of the image matches the current position. This must be
716 followed by the label of the desired image.
717 \item[backdrop] -- draw a preloaded image under the bar. The full
718 image will be displayed and must be the same size as the bar.
719 This must be followed by the label of the desired image.
720 \item[nofill] -- don't draw the bar, only its frame (for use with the
721 ``slider'' option).
722 \item[nobar] -- don't draw the bar or its frame (for use with the
723 ``slider'' option).
724 \opt{touchscreen}{
725 \item[notouch] -- don't create the touchregion for progress/volume bars.
727 \item[setting] -- Specify the setting name to draw the bar from (bar must be
728 \%St type), the next param is the settings config name.
729 \end{description}
731 Example: \config{\%pb(0,0,-,-,-,nofill, slider, slider\_image, invert)} -- draw
732 a horizontal progressbar which doesn't fill and draws the image
733 ``slider\_image'' which moves right to left.
735 \note{If the slider option is used, the bar will be shrunk so that the slider
736 fits inside the specified width and height. Example: A 100px bar image with a
737 16px slider image needs the bar to be 116px wide, and should be offset 8px
738 left of the backdrop image to align correctly.}
740 \section{Other Tags}
742 \begin{tagmap}
743 \config{\%ss(start, length, tag [,number]} & Get a substring from another tag.\\
744 \end{tagmap}
745 Use this tag to get a substring from another tag.
746 \begin{description}
747 \item[start] -- first character to take (0 being the start of the string, negative means from the end of the string)
748 \item[length] -- length of the substring to return (- for the rest of the string)
749 \item[tag] -- tag to get
750 \item[number] -- OPTIONAL. if this is present it will assume the
751 substring is a number so it can be used with conditionals. (i.e \config{\%cM}).
752 0 is the first conditional option
753 \end{description}
755 \begin{tagmap}
756 \config{\%(} & The character `('\\
757 \config{\%)} & The character `)'\\
758 \config{\%,} & The character `,'\\
759 \config{\%\%} & The character `\%'\\
760 \config{\%<} & The character `<'\\
761 \config{\%|} & The character `|'\\
762 \config{\%>} & The character `>'\\
763 \config{\%;} & The character `;'\\
764 \config{\%\#} & The character `\#'\\
765 \config{\%s} & Indicate that the line should scroll. Can occur
766 anywhere in a line (given that the text is
767 displayed; see conditionals above). You can specify
768 up to ten scrolling lines. Scrolling lines can not
769 contain dynamic content such as timers, peak meters
770 or progress bars.\\
771 \end{tagmap}