Rockbox supports not only 1bpp BMPs
[kugel-rb/myfork.git] / manual / appendix / wps_tags.tex
blobfa053687518f2eae0abf33490fe24d6d8a913fbb
1 % $Id$ %
2 \chapter{\label{ref:wps_tags}WPS Tags}
3 \section{Status Bar}
4 \begin{table}
5 \begin{tagmap}{}{}
6 \config{\%we} & Display Status Bar\\
7 \config{\%wd} & Hide Status Bar\\
8 \end{tagmap}
9 \end{table}
10 These tags override the player setting for the display of the status bar.
11 They must be noted on their own line (which will not be shown in the WPS).
13 \section{Information from the track tags}
14 \begin{table}
15 \begin{tagmap}{}{}
16 \config{\%ia} & Artist\\
17 \config{\%ic} & Composer\\
18 \config{\%id} & Album Name\\
19 \config{\%ig} & Genre Name\\
20 \config{\%in} & Track Number\\
21 \config{\%it} & Track Title\\
22 \config{\%iv} & ID3 version (1.0, 1.1, 2.2, 2.3, 2.4, or empty if not an ID3 tag)\\
23 \config{\%iy} & Year\\
24 \end{tagmap}
25 \end{table}
26 Remember that this information is not always available, so use the
27 conditionals to show alternate information in preference to assuming.
29 These tags, when written with a capital ``I'' (e.g. \config{\%Ia} or \config{\%Ic}),
30 produce the information for the next song to be played.
32 \section{Power Related Information}
33 \begin{table}
34 \begin{tagmap}{}{}
35 \config{\%bl} & Numeric battery level in percents\\
36 & Can also be used in a conditional:
37 \config{\%?bl{\textless}-1{\textbar}0{\textbar}1{\textbar}%
38 2{\textbar}\ldots{\textbar}N{\textgreater}},
39 where the value $-1$ is used when the battery level isn't
40 known (it usually is)\\
41 \config{\%bv} & The battery level in volts\\
42 \config{\%bt} & Estimated battery time left\\
43 \config{\%bp} & ``p'' if the charger is connected (only on targets
44 that can charge batteries)\\
45 \config{\%bc} & ``c'' if the unit is currently charging the battery (only on
46 targets that have software charge control or monitoring)\\
47 \config{\%bs} & Remaining time of the sleep timer (if it is set)\\
48 \end{tagmap}
49 \end{table}
51 \section{Information about the file}
52 \begin{table}
53 \begin{tagmap}{}{}
54 \config{\%fb} & File Bitrate (in kbps)\\
55 \config{\%fc} & File Codec (e.g. ``MP3'' or ``FLAC''). %
56 This tag can also be used in a conditional tag, %
57 \config{\%?fc{\textless}mp1\-{\textbar}mp2\-{\textbar}mp3\-%
58 {\textbar}aiff\-{\textbar}wav\-{\textbar}ogg\-{\textbar}flac\-%
59 {\textbar}mpc\-{\textbar}a52\-{\textbar}wavpack\-{\textbar}alac\-%
60 {\textbar}aac\-{\textbar}shn\-{\textbar}sid\-{\textbar}adx\-%
61 {\textbar}nsf\-{\textbar}speex\-{\textbar}spc\-{\textbar}ape\-%
62 {\textbar}wma\-{\textbar}mod\-{\textbar}sap%
63 {\textbar}unknown{\textgreater}}.\\
64 & The codec order is as follows: MP1, MP2, MP3, AIFF, WAV,
65 Ogg Vorbis (OGG), FLAC, MPC, AC3, WavPack (WV), ALAC, AAC,
66 Shorten (SHN), SID, ADX, NSF, Speex, SPC, APE, WMA, MOD, SAP.\\
67 \config{\%ff} & File Frequency (in Hz)\\
68 \config{\%fm} & File Name\\
69 \config{\%fn} & File Name (without extension)\\
70 \config{\%fp} & File Path\\
71 \config{\%fs} & File Size (in Kilobytes)\\
72 \config{\%fv} & ``(avg)'' if variable bit rate or empty string if constant bit rate\\
73 \config{\%d1} & First directory from the end of the file path\\
74 \config{\%d2} & Second directory from the end of the file path\\
75 \config{\%d3} & Third directory from the end of the file path\\
76 \end{tagmap}
77 \end{table}
78 Example for the \config{\%dN} commands: If the path is
79 ``/Rock/Kent/Isola/11 - 747.mp3'', \config{\%d1} is ``Isola'',
80 \config{\%d2} is ``Kent'' and \config{\%d3} is ``Rock''.
82 These tags, when written with the first letter capitalized (e.g. \config{\%Fn} or \config{\%D2}),
83 produce the information for the next file to be played.
85 \section{Playlist/Song Info}
86 \begin{table}
87 \begin{tagmap}{}{}
88 \config{\%pb} & Progress Bar\\
89 \opt{player}{
90 & This will display a one character ``cup''
91 that empties as the time progresses.}
92 \opt{lcd_bitmap}{
93 & This will replace the entire line with a progress bar. \\
94 & You can set the height, position and width of the progressbar %
95 (in pixels): \config{\%pb{\textbar}height{\textbar}leftpos%
96 {\textbar}rightpos{\textbar}toppos{\textbar}}} \\
97 \opt{player}{%
98 \config{\%pf} & Full-line progress bar \& time display\\
100 \config{\%px} & Percentage Played In Song\\
101 \config{\%pc} & Current Time In Song\\
102 \config{\%pe} & Total Number of Playlist Entries\\
103 \nopt{player}{%
104 \config{\%pm} & Peak Meter. The entire line is used as %
105 volume peak meter.\\%
107 \config{\%pn} & Playlist Name (without path or extension)\\
108 \config{\%pp} & Playlist Position\\
109 \config{\%pr} & Remaining Time In Song\\
110 \config{\%ps} & ``s'' if shuffle mode is enabled\\
111 \config{\%pt} & Total Track Time\\
112 \config{\%pv} & Current volume (in dB). Can also be used in a conditional: \\
113 & \config{\%?pv{\textless}0{\textbar}1{\textbar}2{\textbar}\ldots%
114 {\textbar}N{\textgreater}}\\
115 & 0 is used for mute, the last option is used for values greater than zero.\\
116 \end{tagmap}
117 \end{table}
119 \section{Runtime Database}
120 \begin{table}
121 \begin{tagmap}{}{}
122 \config{\%rp} & Song playcount\\
123 \config{\%rr} & Song rating (0-10). This tag can also be used in a conditional tag: %
124 \config{\%?rr{\textless}0{\textbar}1{\textbar}2{\textbar}3{\textbar}%
125 4{\textbar}5{\textbar}6{\textbar}7{\textbar}8{\textbar}9{\textbar}%
126 10{\textgreater}}\\
127 \end{tagmap}
128 \end{table}
130 \opt{swcodec}{
131 \section{Sound (DSP) settings}
132 \begin{table}
133 \begin{tagmap}{}{}
134 \config{\%Sp} & Current playback pitch \\
135 \opt{swcodec}{
136 \config{\%xf} & Crossfade setting, in the order: Off, Shuffle, Skip, Always\\
137 \config{\%rg} & ReplayGain value in use (x.y dB). If used as a conditional,
138 Replaygain type in use: \config{\%?rg{\textless}Off{\textbar}Track%
139 {\textbar}Album{\textbar}TrackShuffle{\textbar}AlbumShuffle%
140 {\textbar}No tag{\textgreater}}\\
142 \end{tagmap}
143 \end{table}
145 \opt{h100,h300}{
146 \section{Hold Switches}
147 \begin{table}
148 \begin{tagmap}{}{}
149 \config{\%mh} & ``h'' if the main unit hold switch is on\\
150 \config{\%mr} & ``r'' if the remote hold switch is on\\
151 \end{tagmap}
152 \end{table}
155 \section{Virtual LED}
156 \begin{table}
157 \begin{tagmap}{}{}
158 \config{\%lh} & ``h'' if the \disk\ is accessed\\
159 \end{tagmap}
160 \end{table}
162 \section{Repeat Mode}
163 \begin{table}
164 \begin{tagmap}{}{}
165 \config{\%mm} & Repeat mode, 0-4, in the order: Off, All, One, Shuffle
166 \opt{player,recorder,recorderv2fm}{, A-B}\\
167 \end{tagmap}
168 \end{table}
169 Example: \config{\%?mm{\textless}Off{\textbar}All{\textbar}One{\textbar}Shuffle%
170 {\textbar}A-B{\textgreater}}
172 \section{Playback Mode Tags}
173 \begin{table}
174 \begin{tagmap}{}{}
175 \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause,
176 Fast Forward, Rewind\\
177 \end{tagmap}
178 \end{table}
179 Example: \config{\%?mp{\textless}Stop{\textbar}Play{\textbar}Pause{\textbar}%
180 Ffwd{\textbar}Rew{\textgreater}}
182 \section{Changing Volume}
183 \begin{table}
184 \begin{tagmap}{}{}
185 \config{\%mv[t]} & ``v'' if the volume is being changed\\
186 \end{tagmap}
187 \end{table}
189 The tag produces the letter ``v'' while the volume is being changed and some
190 amount of time after that, i.e. after the volume button has been released. The
191 optional parameter \config{t} specifies that amount of time, in seconds. If it
192 is not specified, 1 second is assumed.
194 The tag can be used as the switch in a conditional tag to display different things
195 depending on whether the volume is being changed. It can produce neat effects
196 when used with conditional viewports.
198 Example: \config{\%?mv2.5{\textless}Volume changing{\textbar}\%pv{\textgreater}}
200 The example above will display the text ``Volume changing'' if the volume is
201 being changed and 2.5 secs after the volume button has been released. After
202 that, it will display the volume value.
204 \section{Settings}
205 \begin{table}
206 \begin{tagmap}{}{}
207 \config{\%St{\textbar}<setting name>{\textbar}} & The value of the Rockbox
208 setting with the specified name. See \reference{ref:config_file_options}
209 for the list of the available settings.\\
210 \end{tagmap}
211 \end{table}
213 Examples:
214 \begin{enumerate}
215 \item As a simple tag: \config{\%St{\textbar}skip length{\textbar}}
216 \item As a conditional: \config{\%?St{\textbar}eq enabled{\textbar}{\textless}Eq is enabled{\textbar}Eq is disabled{\textgreater}}
217 \end{enumerate}
220 \opt{lcd_bitmap}{
221 \section{Images}
222 \begin{table}
223 \begin{tagmap}{}{}
224 \nopt{archos}{%
225 \config{\%X{\textbar}filename.bmp{\textbar}}
226 & Load and set a backdrop image for the WPS.
227 This image must be exactly the same size as your LCD.\\
229 \config{\%P{\textbar}filename.bmp{\textbar}}
230 & Load a Progress Bar image for the WPS. Use \config{\%pb} tag to show the
231 progress bar\\
232 \config{\%x{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}}
233 & Load and display an image\\
234 & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\
235 & \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\\
236 & \config{x}: x coordinate\\
237 & \config{y}: y coordinate.\\
238 \config{\%xl{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}[nimages{\textbar}]}
239 & Preload an image for later display (useful for when your images are displayed conditionally)\\
240 & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\
241 & \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\\
242 & \config{x}: x coordinate\\
243 & \config{y}: y coordinate\\
244 & \config{nimages}: (optional) number of sub-images (tiled vertically, of the same height)
245 contained in the bitmap. Default is 1.\\
246 \config{\%xdn[i]} & Display a preloaded image\\
247 & \config{n}: image ID (a-z and A-Z) as it was specified in \config{\%x} or \config{\%xl}\\
248 & \config{i}: (optional) number of the sub-image to display (a-z for 1-26 and A-Z for 27-52).
249 By default the first (i.e. top most) sub-image will be used.\\
250 \end{tagmap}
251 \end{table}
253 Examples:
254 \begin{enumerate}
255 \item Load and display the image \fname{/.rockbox/bg.bmp} with ID ``a'' at 37, 109:\\
256 \config{\%x{\textbar}a{\textbar}bg.bmp{\textbar}37{\textbar}109{\textbar}}
257 \item Load a bitmap strip containing 5 volume icon images (all the same size)
258 with image ID ``M'', and then reference the individual sub-images in a conditional:\\
259 \config{\%xl{\textbar}M{\textbar}volume.bmp{\textbar}134{\textbar}153{\textbar}5{\textbar}}\\
260 \config{\%?pv<\%xdMa{\textbar}\%xdMb{\textbar}\%xdMc{\textbar}\%xdMd{\textbar}%
261 \%xdMe>}
262 \end{enumerate}
265 \note{
266 \begin{itemize}
267 \item The images must be in BMP format
268 \item The image tag must be on its own line
269 \item The ID is case sensitive, giving 52 different ID's
270 \item The size of the LCD screen for each player varies. See table below
271 for appropriate sizes of each device. The x and y coordinates must
272 repect each of the players' limits.
273 \end{itemize}
277 \opt{albumart}{
278 \section{Album Art}
279 \begin{table}
280 \begin{tagmap}{}{}
281 \config{\%Cl{\textbar}x{\textbar}y{\textbar}[[l{\textbar}c{\textbar}r]maxwidth]{\textbar}[[t{\textbar}c{\textbar}b]maxheight]{\textbar}}
282 & Define the settings for albumart\\
283 & \config{x}: x coordinate\\
284 & \config{y}: y coordinate\\
285 & \config{maxwidth}: Maximum height\\
286 & \config{maxheight}: Maximum width\\
287 \config{\%C} & Display the album art as configured. This tag can also be used as a conditional.\\
288 \end{tagmap}
289 \end{table}
291 The picture will be rescaled, preserving aspect ratio to fit the given
292 \config{maxwidth} and \config{maxheight}. If the aspect ratio doesn't match the
293 configured values, the picture will be placed according to the flags to the
294 \config{maxwidth} and \config{maxheight} parameters:
295 \begin{itemize}
296 \item \config{maxwidth}:
297 \begin{description}
298 \item[\config{l}.] Align left
299 \item[\config{c}.] Align center (default)
300 \item[\config{r}.] Align right
301 \end{description}
302 \item \config{maxheight}:
303 \begin{description}
304 \item[\config{t}.] Align left
305 \item[\config{c}.] Align center (default)
306 \item[\config{b}.] Align right
307 \end{description}
308 \end{itemize}
310 Examples:
311 \begin{enumerate}
312 \item Load albumart at position 20,40 and display it without resizing:\\
313 \config{\%Cl{\textbar}20{\textbar}40{\textbar}{\textbar}{\textbar}}
314 \item Load albumart at position 0,20 and resize it to be at most 100x100
315 pixels. If the image isn't square, align it to the bottom-right
316 corner:\\
317 \config{\%CL{\textbar}0{\textbar}20{\textbar}r100{\textbar}b100{\textbar}}
318 \end{enumerate}
321 \section{Alignment}
322 \begin{table}
323 \begin{tagmap}{}{}
324 \config{\%al} & Align the text left\\
325 \config{\%ac} & Center the text\\
326 \config{\%ar} & Align the text right\\
327 \end{tagmap}
328 \end{table}
329 All alignment tags may be present in one line, but they need to be in the
330 order left -- center -- right. If the aligned texts overlap, they are merged.
332 \section{Conditional Tags}
334 \begin{table}
335 \begin{tagmap}{}{}
336 \config{\%?xx{\textless}true{\textbar}false{\textgreater}}
337 & If / Else: Evaluate for true or false case \\
338 \config{\%?xx{\textless}alt1{\textbar}alt2{\textbar}alt3{\textbar}\dots{\textbar}else{\textgreater}}
339 & Enumerations: Evaluate for first / second / third / \dots / last condition \\
340 \end{tagmap}
341 \end{table}
343 \opt{rtc}{
344 \section{Real Time Clock}
345 \begin{table}
346 \begin{tagmap}{}{}
347 \config{\%cd} & Day of month\\
348 \config{\%ce} & Zero padded day of month\\
349 \config{\%cH} & Zero padded hour from 00 to 23 (24 hour format)\\
350 \config{\%ck} & Hour from 0 to 23 (24 hour format)\\
351 \config{\%cI} & Zero padded hour from 12 to 12 (am/pm format)\\
352 \config{\%cl} & Hour from 12 to 12 (am/pm format)\\
353 \config{\%cm} & Month\\
354 \config{\%cM} & Minutes\\
355 \config{\%cS} & Seconds\\
356 \config{\%cy} & 2-digit year\\
357 \config{\%cY} & 4-digit year\\
358 \config{\%cP} & Capital AM/PM\\
359 \config{\%cp} & Lowercase am/pm\\
360 \config{\%ca} & Weekday name\\
361 \config{\%cb} & Month name\\
362 \config{\%cu} & Day of week from 1 to 7, 1 is Monday\\
363 \config{\%cw} & Day of week from 0 to 6, 0 is Sunday\\
364 \end{tagmap}
365 \end{table}
368 \section{Other Tags}
369 \begin{table}
370 \begin{tagmap}{}{}
371 \config{\%\%} & The character `\%'\\
372 \config{\%{\textless}} & The character `{\textless}'\\
373 \config{\%{\textbar}} & The character `{\textbar}'\\
374 \config{\%{\textgreater}} & The character `{\textgreater}'\\
375 \config{\%;} & The character `;'\\
376 \config{\%s} & Indicate that the line should scroll. Can occur
377 anywhere in a line (given that the text is
378 displayed; see conditionals above). You can specify
379 up to ten scrolling lines. Scrolling lines can not
380 contain dynamic content such as timers, peak meters
381 or progress bars.\\
382 \end{tagmap}
383 \end{table}