Killed unnecessary global variables by making them static.
[kugel-rb.git] / manual / advanced_topics / main.tex
blobbf2fdeab2fb2a38e0f5c53d24290ef556079d28d
1 % $Id$ %
2 \chapter{Advanced Topics}
4 \section{\label{ref:CustomisingUI}Customising the userinterface}
5 \subsection{\label{ref:GettingExtras}Getting Extras}
6 \opt{lcd_bitmap}{
7 Rockbox supports custom fonts. A collection of fonts is available for download
8 in the font package at \url{http://www.rockbox.org/daily.shtml}}.
10 \opt{lcd_bitmap}{
11 \subsection{\label{ref:Loadingfonts}Loading Fonts}\index{Fonts}
12 Rockbox can load fonts dynamically. Simply copy the \fname{.fnt} file to the
13 \dap{} and ``play'' it in the \setting{File Browser}. If you want a font to
14 be loaded automatically every time you start up, it must be located in the
15 \fname{/.rockbox/fonts} directory and the filename must be at most 24 characters
16 long. You can browse the fonts in \fname{/.rockbox/fonts} under
17 \setting{Settings $\rightarrow$ General Settings $\rightarrow$ Display
18 $\rightarrow$ Browse Fonts} in the \setting{Main Menu}.
19 \warn{Advanced Users Only: Any BDF font file up to 16 pixels high should
20 be usable with Rockbox. To convert from \fname{.bdf} to \fname{.fnt}, use
21 the \fname{convbdf} tool. This tool can be found in the \fname{tools}
22 directory of the Rockbox source code.}
25 \subsection{\label{ref:Loadinglanguages}Loading Languages}
26 \index{Language files}%
27 Rockbox can load language files at runtime. Simply copy the \fname{.lng} file
28 \emph{(do not use the .lang file)} to the \dap\ and ``play'' it in the
29 Rockbox directory browser or select \setting{Settings $\rightarrow$
30 General Settings $\rightarrow$ Languages }from the \setting{Main Menu}.
32 \note{If you want a language to be loaded automatically every time you start
33 up, it must be located in the \fname{/.rockbox/langs} directory and the filename
34 must be a maximum of 24 characters long.}
36 If your language is not yet supported and you want to write your own language
37 file find the instructions on the Rockbox website:
38 \wikilink{LangFiles}
40 \opt{lcd_color}{
41 \subsection{Changing Colours}
42 The colours used in the Rockbox interface can be changed to any combination
43 of background and foreground colour you like. To do this go to the
44 \setting{Settings $\rightarrow$ General Settings $\rightarrow$ Display}
45 and select \setting{Background Colour} or \setting{Foreground Colour}.
46 The colours set here are used in all menus, browsers and in the
47 \setting{While Playing Screen}.
50 \nopt{archos,mrobe100}{%
51 \subsection{\label{ref:LoadingBackdrops}Loading Backdrops}
52 Rockbox supports showing an image as a backdrop in the \setting{File Browser}
53 and the menus. The backdrop image must be a \fname{.bmp} file of the exact
54 same dimensions as the display in your \dap{} (\genericimg{} with the last
55 number giving the colour depth in bits). To use an image as a backdrop browse
56 to it in the \setting{File Browser} and open the \setting{Context Menu}
57 (see \reference{ref:Contextmenu}) on it and select the option
58 \setting{Set As Backdrop}. If you want rockbox to remember your
59 backdrop the next time you start your \dap{} the backdrop must be placed in
60 the \fname{/.rockbox/backdrops} directory.
63 \section{\label{ref:ConfiguringtheWPS}Configuring the WPS}
65 \subsection{WPS -- General Info}
67 \begin{description}
68 \item[Description: ] The WPS or While Playing Screen is the name used to
69 describe the information displayed on the \daps\ screen whilst an audio track
70 is being played. The default WPS is a relatively simple screen displaying
71 Track name, Artist, Album etc. in the default font as a purely text based
72 layout. There are a number of WPS files included in Rockbox, and you can
73 load one of these at anytime by selecting it in
74 \setting{General Settings $\rightarrow$ Display $\rightarrow$ Browse .wps files}.
75 \opt{HAVE_REMOTE_LCD}{There is a related option to browse \fname{.rwps}
76 files for \daps{} with LCD remote controls installed. This will load a
77 similar WPS screen for the remote but with usually a simpler and more
78 concise layout.}
80 \note{``Playing'' a \fname{.wps} from the file browser has the same effect.}
82 \item [File Location: ]Custom WPS files may be located anywhere on the drive.
83 The only restriction is that they must end in \fname{.wps}. When you ``play''
84 a \fname{.wps} file, it will be used for future WPS screens, and if the
85 ``played'' \fname{.wps} file is located in the \fname{/.rockbox/wps} directory, it
86 will be remembered and used after reboot. The \fname{.wps} filename must be
87 no more than 24 characters long for it to be remembered.
88 \end{description}
90 \subsection{\label{ref:CreateYourOwnWPS}WPS -- Build Your Own}
91 Quite simply, enter the WPS code in your favourite text editor, Notepad on
92 Windows works fine. When you save it, instead of saving it as a \fname{.txt}
93 file, save it as a \fname{.wps} file. Example: Instead of \fname{Rockbox.txt},
94 save the file as \fname{Rockbox.wps}. To make sure non english characters
95 display correctly in your WPS you must save the .wps file with UTF-8 character
96 encoding. This can be done in most editors, for example Notepad in Windows 2000
97 or XP (but not in 9x/ME) can do this. See appendix \reference{ref:wps_tags} for
98 all the tags that are available.
100 \begin{itemize}
101 \item All characters not preceded by \% are displayed as typed.
102 \item Lines beginning with \# are comments and will be ignored.
103 \item Maximum file size used is
104 \opt{lcd_bitmap}{1600}
105 \opt{player}{400} bytes.
106 If you have a bigger WPS file, only the first part of it will be
107 loaded and used.
108 \end{itemize}
110 \note{Keep in mind that your \dap{} resolution is \genericimg{} (with
111 the last number giving the colour depth in bits) when
112 designing your own WPS, or if you use a WPS designed for another target.
113 \opt{HAVE_REMOTE_LCD}{The resolution of the remote is
114 \opt{h1xx,h300}{128x64x1}\opt{x5}{128x96x2} pixels.}}
116 \subsubsection{Conditional Tags}
118 \begin{description}
119 \item[If/else: ]
120 Syntax: \config{\%?xx{\textless}true{\textbar}false{\textgreater}}
122 If the tag specified by ``\config{xx}'' has a value, the text between the
123 ``\config{{\textless}}'' and the ``\config{{\textbar}}'' is displayed (the true
124 part), else the text between the ``\config{{\textbar}}'' and the
125 ``\config{{\textgreater}}'' is displayed (the false part).
126 The else part is optional, so the ``\config{{\textbar}}'' does not have to be
127 specified if no else part is desired. The conditionals nest, so the text in the
128 if and else part can contain all \config{\%} commands, including conditionals.
130 \item[Enumerations: ]
131 Syntax: \config{\%?xx{\textless}alt1{\textbar}alt2{\textbar}alt3{\textbar}\dots{\textbar}else{\textgreater}}
133 For tags with multiple values, like Play status, the conditional can hold a
134 list of alternatives, one for each value the tag can have.
135 Example enumeration:
136 \begin{example}
137 \%?mp{\textless}Stop{\textbar}\%Play{\textbar}Pause{\textbar}Ffwd{\textbar}Rew{\textgreater}
138 \end{example}
140 The last else part is optional, and will be displayed if the tag has no value.
141 The WPS parser will always display the last part if the tag has no value, or if
142 the list of alternatives is too short.
143 \end{description}
145 \subsubsection{Next Song info}
146 You can display information about the next song -- the song that is
147 about to play after the one currently playing (unless you change the
148 plan).
150 If you use the upper-case versions of the
151 three tags: \config{F}, \config{I} and \config{D}, they will instead refer to
152 the next song instead of the current one. Example: \config{\%Ig} is the genre
153 name used in the next song and \config{\%Ff} is the mp3 frequency.
155 \note{The next song information \emph{will not} be available at all
156 times, but will most likely be available at the end of a song. We
157 suggest you use the conditional display tag a lot when displaying
158 information about the next song!}
160 \subsubsection{Alternating sublines}
162 It is possible to group items on each line into 2 or more groups or
163 ``sublines''. Each subline will be displayed in succession on the line for a
164 specified time, alternating continuously through each defined subline.
166 Items on a line are broken into sublines with the semicolon
167 '\config{;}' character. The display time for
168 each subline defaults to 2 seconds unless modified by using the
169 '\config{\%t}' tag to specify an alternate
170 time (in seconds and optional tenths of a second) for the subline to be
171 displayed.
173 Subline related special characters and tags:
174 \begin{description}
175 \item[;] Split items on a line into separate sublines
176 \item[\%t] Set the subline display time. The
177 '\config{\%t}' is followed by either integer
178 seconds (\config{\%t5}), or seconds and tenths of a second (\config{\%t3.5}).
179 \end{description}
181 Each alternating subline can still be optionally scrolled while it is
182 being displayed, and scrollable formats can be displayed on the same
183 line with non{}-scrollable formats (such as track elapsed time) as long
184 as they are separated into different sublines.
185 Example subline definition:
186 \begin{example}
187 %s%t4%ia;%s%it;%t3%pc %pr : Display id3 artist for 4 seconds,
188 Display id3 title for 2 seconds,
189 Display current and remaining track time
190 for 3 seconds,
191 repeat...
192 \end{example}
194 Conditionals can be used with sublines to display a different set and/or number
195 of sublines on the line depending on the evaluation of the conditional.
196 Example subline with conditionals:
197 \begin{example}
198 %?it{\textless}%t8%s%it{\textbar}%s%fn{\textgreater};%?ia{\textless}%t3%s%ia{\textbar}%t0{\textgreater}\\
199 \end{example}
201 The format above will do two different things depending if ID3 tags are
202 present. If the ID3 artist and title are present:
203 \begin{itemize}
204 \item Display id3 title for 8 seconds,
205 \item Display id3 artist for 3 seconds,
206 \item repeat\dots
207 \end{itemize}
208 If the ID3 artist and title are not present:
209 \begin{itemize}
210 \item Display the filename continuously.
211 \end{itemize}
212 Note that by using a subline display time of 0 in one branch of a conditional,
213 a subline can be skipped (not displayed) when that condition is met.
215 \subsubsection{Using Images}
216 You can have as many as 52 images in your WPS. There are various ways of
217 displaying images:
218 \begin{enumerate}
219 \item Load and always show the image, using the \config{\%x} tag
220 \item Preload the image with \config{\%xl} and show it with \config{\%xd}.
221 This way you can have your images displayed conditionally.
222 \nopt{archos}{%
223 \item Load an image and show as backdrop using the \config{\%X} tag. The
224 image must be of the same exact dimensions as your display.
226 \end{enumerate}
228 \optv{swcodec}{% This doesn't depend on swcodec but we don't have a \noptv
229 % command.
230 Example on background image use:
231 \begin{example}
232 %X|background.bmp|
233 \end{example}
234 The image with filename \fname{background.bmp} is loaded and used in the WPS.
237 Example on bitmap preloading and use:
238 \begin{example}
239 %x|a|static_icon.bmp|50|50|
240 %xl|b|rep\_off.bmp|16|64|
241 %xl|c|rep\_all.bmp|16|64|
242 %xl|d|rep\_one.bmp|16|64|
243 %xl|e|rep\_shuffle.bmp|16|64|
244 %?mm<%xdb|%xdc|%xdd|%xde>
245 \end{example}
246 Four images at the same x and y position are preloaded in the example. Which
247 image to display is determined by the \config{\%mm} tag (the repeat mode).
249 \subsubsection{Example File}
250 \begin{example}
251 %s%?in<%in - >%?it<%it|%fn> %?ia<[%ia%?id<, %id>]>
252 %pb%pc/%pt
253 \end{example}
254 That is, ``tracknum -- title [artist, album]'', where most fields are only
255 displayed if available. Could also be rendered as ``filename'' or ``tracknum --
256 title [artist]''.
258 %\opt{lcd_bitmap}{
259 % \begin{verbatim}
260 % %s%?it<%?in<%in. |>%it|%fn>
261 % %s%?ia<%ia|%?d2<%d2|(root)>>
262 % %s%?id<%id|%?d1<%d1|(root)>> %?iy<(%iy)|>
264 % %al%pc/%pt%ar[%pp:%pe]
265 % %fbkBit %?fv<avg|> %?iv<(id3v%iv)|(no id3)>
266 % %pb
267 % %pm
268 % % \end{verbatim}
271 \section{\label{ref:manage_settings}Managing Rockbox settings}
273 \subsection{Introduction to \fname{.cfg} files.}
274 Rockbox allows users to store and load multiple settings through the use of
275 configuration files. A configuration file is simply a text file with the
276 extension \fname{.cfg}.
278 A configuration file may reside anywhere on the disk. Multiple
279 configuration files are permitted. So, for example, you could have
280 a \fname{car.cfg} file for the settings that you use while playing your
281 jukebox in your car, and a \fname{headphones.cfg} file to store the
282 settings that you use while listening to your \dap\ through headphones.
284 See \reference{ref:cfg_specs} below for an explanation of the format
285 for configuration files. See \reference{ref:manage_settings_menu} for an
286 explanation of how to create, edit and load configuration files.
288 \subsection{\label{ref:cfg_specs}Specifications for \fname{.cfg}
289 files.}
291 The Rockbox configuration file is a plain text file, so once you use the
292 \setting{Save .cfg file} option to create the file, you can edit the file on
293 your computer using any text editor program. See
294 Appendix \reference{ref:config_file_options} for available settings. Configuration
295 files use the following formatting rules: %
297 \begin{enumerate}
298 \item Each setting must be on a separate line.
299 \item Each line has the format ``setting: value''.
300 \item Values must be within the ranges specified in this manual for each
301 setting.
302 \item Lines starting with \# are ignored. This lets you write comments into
303 your configuration files.
304 \end{enumerate}
306 Example of a configuration file:
307 \begin{example}
308 # Example configuration file
309 # volume: 70
310 # bass: 11
311 # treble: 12
312 # balance: 0
313 # time format: 12hour
314 # volume display: numeric
315 # show files: supported
316 # wps: /.rockbox/car.wps
317 # lang: /.rockbox/afrikaans.lng
318 \end{example}
320 \note{As you can see from the example, configuration files do not need to
321 contain all of the Rockbox options. You can create configuration files
322 that change only certain settings. So, for example, supppose you
323 typically use the \dap{} at one volume in the car, and another when using
324 headphones. Further, suppose you like to use an inverse LCD when you are
325 in the car, and a regular LCD setting when you are using headphones. You
326 could create configuration files that control only the volume and LCD
327 settings. Create a few different files with different settings, give
328 each file a different name (such as \fname{car.cfg},
329 \fname{headphones.cfg}, etc.), and you can then use the \setting{Browse .cfg
330 files} option to quickly change settings.}
332 \subsection{\label{ref:manage_settings_menu}The \setting{Manage Settings}
333 menu} The \setting{Manage Settings} menu can be found in the \setting{Main
334 Menu}. The \setting{Manage Settings} menu allows you to save and load
335 \fname{.cfg} files. \opt{MASCODEC}{The \setting{Manage Settings} menu also
336 allows you to load or save different firmware versions.}
338 \begin{description}
340 \item [Browse .cfg Files.]Opens the file browser in the \fname{/.rockbox}
341 directory and displays all \fname{.cfg} (configuration) files. Selecting a
342 \fname{.cfg} file will cause Rockbox to load the settings contained in that
343 file. Pressing \ButtonLeft\ will exit back to the \setting{Manage Settings}
344 menu. See the \setting{Write .cfg files} option on the
345 \setting{Manage Settings} menu for details of how to save and edit a
346 configuration file.
348 \item [Reset Settings.]This wipes the saved settings in the \dap\ and
349 resets all settings to their default values.
351 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{
352 \note{You can also reset all settings to their default
353 values by turning off the \dap, turning it back on, and pressing the
354 \ButtonRec\ button immediately after the \dap\ turns on.}
356 \opt{IPOD_4G_PAD,IRIVER_H10_PAD}{\note{You can also reset all settings to
357 their default values by turning off the \dap, and turning it back on
358 with the \ButtonHold\ button on.}
360 \opt{GIGABEAT_PAD}{\note{You can also reset all settings to their default
361 values by turning off the \dap, turning it back on and pressing the
362 \ButtonA\ button immediately after the \dap\ turns on.}
365 \item [Save .cfg file.]This option writes a \fname{.cfg} file to
366 your \daps{} disk. The configuration file has the \fname{.cfg}
367 extension and is used to store all of the user settings that are described
368 throughout this manual.
370 Hint: Use the \setting{Save .cfg file} feature (\setting{Main Menu
371 $\rightarrow$ General Settings}) to save the current settings, then
372 use a text editor to customize the settings file. See Appendix
373 \reference{ref:config_file_options} for the full reference of available
374 options.
376 \item [Save Sound Settings.]This option writes a \fname{.cfg} file to
377 your \daps\ disk. The configuration file has the \fname{.cfg}
378 extension and is used to store all of the sound related settings.
380 \item [Save Theme Settings.]This option writes a \fname{.cfg} file to
381 your \daps\ disk. The configuration file has the \fname{.cfg}
382 extension and is used to store all of the theme related settings.
384 \end{description}
386 \section{\label{ref:FirmwareLoading}Firmware Loading}
387 \opt{player,recorder,recorderv2fm,ondio}{
388 When your \dap{} powers on, it loads the Archos firmware in ROM, which
389 automatically checks your \daps{} root directory for a file named
390 \firmwarefilename. Note that Archos firmware can only read the first
391 ten characters of each filename in this process, so do not rename your old
392 firmware files with names like \firmwarefilename.\fname{old} and so on,
393 because it is possible that the \dap{} will load a file other than the one
394 you intended.
397 \subsection{\label{ref:using_rolo}Using ROLO (Rockbox loader)}
398 Rockbox is able to load and start another firmware file without rebooting.
399 You just ``play'' a file with the extension %
400 \opt{recorder,recorderv2fm,ondio}{\fname{.ajz}.} %
401 \opt{player}{\fname{.mod}.} %
402 \opt{h1xx,h300}{\fname{.iriver}.} %
403 \opt{ipod}{\fname{.ipod}.} %
404 \opt{iaudio}{\fname{.iaudio}.} %
405 \opt{sansa,h10,h10_5gb}{\fname{.mi4}.} %
406 This can be used to test new firmware versions without deleting your
407 current version.
409 \opt{gigabeat}{\note{This feature does not work on the gigabeat currently.}}
411 \opt{archos}{\input{advanced_topics/archos-flashing.tex}}