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