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