Restore the author's original punctuation
[kugel-rb/myfork.git] / manual / advanced_topics / main.tex
blob2d3cf55974b724dcb3b889f81affd047b93efd67
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{\label{ref:ChangingFiletypeColours}Changing Filetype Colours}
43 Rockbox has the capability to modify the \setting{File Browser} to show
44 files of different types in different colours, depending on the file extension.
46 \subsubsection{Set-up}
47 There are two steps to changing the filetype colours -- creating
48 a file with the extension \fname{.colours} and then activating it using
49 a config file. The \fname{.colours} files \emph{must} be stored in
50 the \fname{/.rockbox/themes/} directory.
51 The \fname{.colours} file is just a text file, and can be edited with
52 your text editor of choice.
54 \subsubsection{Creating the .colours file}
55 The \fname{.colours} file consists of the file extension
56 (or \fname{folder}) followed by a colon and then the colour desired
57 as an RGB value in hexadecimal, as in the following example:\\*
59 \config{folder:808080}\\
60 \config{mp3:00FF00}\\
61 \config{ogg:00FF00}\\
62 \config{txt:FF0000}\\
63 \config{???:FFFFFF}\\*
65 The permissible extensions are as follows:\\*
66 \\
67 \config{folder, m3u, m3u8, cfg, wps, lng, rock, bmark, cue, colours, mpa,
68 \firmwareextension{}, %
69 \opt{swcodec}{mp1, }mp2, mp3%
70 \opt{swcodec}{, ogg, oga, wma, wmv, asf, wav, flac, ac3, a52, mpc,
71 wv, m4a, m4b, mp4, mod, shn, aif, aiff, spx, sid, adx, nsf, nsfe,
72 spc, ape, mac, sap}%
73 \opt{lcd_bitmap}{\opt{swcodec}{, mpg, mpeg}}%
74 \opt{HAVE_REMOTE_LCD}{, rwps}%
75 \opt{lcd_non-mono}{, bmp}%
76 \opt{radio}{, fmr}%
77 \opt{lcd_bitmap}{, fnt, kbd}}\\*
78 %It'd be ideal to get these from filetypes.c
80 All file extensions that are not either specifically listed in the
81 \fname{.colours} files or are not in the list above will be
82 set to the colour given by \config{???}. Extensions that
83 are in the above list but not in the \fname{.colours}
84 file will be set to the foreground colour as normal.
86 \subsubsection{Activating}
87 To activate the filetype colours, the \fname{.colours} file needs to be
88 invoked from a \fname{.cfg} configuration file. The easiest way to do
89 this is to create a new text file containing the following single
90 line:\\*
92 \config{filetype colours: /.rockbox/themes/filename.colours}\\*
94 where filename is replaced by the filename you used when creating the
95 \fname{.colours} file. Save this file as e.g. \fname{colours.cfg} in the
96 \fname{/.rockbox/themes} directory and then activate the config file
97 from the menu as normal
98 (\setting{Settings} $\rightarrow$ \setting{Theme Settings}%
99 $\rightarrow$ \setting{Browse Themes}).
101 \subsubsection{Editing}
102 The built-in \setting{Text Editor} (see \reference{sec:text_editor})
103 automatically understands the
104 \fname{.colours} file format, but an external text editor can
105 also be used. To edit the \fname{.colours} file using Rockbox,
106 ``play'' it in the \setting{File Browser}. The file will open in
107 the \setting{Text Editor}. Upon selecting a line, the following choices
108 will appear:\\*
110 \config{Extension}\\
111 \config{Colour}\\*
113 If \config{Extension} is selected, the \setting{virtual keyboard}
114 (see \reference{sec:virtual_keyboard}) appears,
115 allowing the file extension to be modified. If \config{Colour}
116 is selected, the colour selector screen appears. Choose the desired
117 colour, then save the \fname{.colours} file using the standard
118 \setting{Text Editor} controls.
121 \opt{lcd_non-mono}{%
122 \subsection{\label{ref:LoadingBackdrops}Loading Backdrops}
123 Rockbox supports showing an image as a backdrop in the \setting{File Browser}
124 and the menus. The backdrop image must be a \fname{.bmp} file of the exact
125 same dimensions as the display in your \dap{} (\genericimg{} with the last
126 number giving the colour depth in bits). To use an image as a backdrop browse
127 to it in the \setting{File Browser} and open the \setting{Context Menu}
128 (see \reference{ref:Contextmenu}) on it and select the option
129 \setting{Set As Backdrop}. If you want rockbox to remember your
130 backdrop the next time you start your \dap{} the backdrop must be placed in
131 the \fname{/.rockbox/backdrops} directory.
134 \section{\label{ref:ConfiguringtheWPS}Configuring the WPS}
136 \subsection{WPS -- General Info}
138 \begin{description}
139 \item[Description: ] The WPS or \setting{While Playing Screen} is the name used
140 to describe the information displayed on the \daps{} screen whilst an audio
141 track is being played. The default WPS is a relatively simple screen
142 displaying Track name, Artist, Album etc. in the default font as a purely
143 text based layout. There are a number of WPS files included in Rockbox, and
144 you can load one of these at any time by selecting it in
145 \setting{Settings $\rightarrow$ Theme Settings $\rightarrow$ Browse .wps files}.
146 \opt{HAVE_REMOTE_LCD}{There is a related option to browse \fname{.rwps}
147 files for \daps{} with LCD remote controls installed. This will load a
148 similar WPS screen for the remote.}
150 \note{``Playing'' a \fname{.wps} from the \setting{File Browser} has the same effect.}
152 \item [File Location: ]Custom WPS files may be located anywhere on the drive.
153 The only restriction is that they must end in \fname{.wps}. When you ``play''
154 a \fname{.wps} file, it will be used for future WPS screens, and if the
155 ``played'' \fname{.wps} file is located in the \fname{/.rockbox/wps} directory, it
156 will be remembered and used after reboot. The \fname{.wps} filename must be
157 no more than 24 characters long for it to be remembered.
158 \end{description}
160 \subsection{\label{ref:CreateYourOwnWPS}WPS -- Build Your Own}
161 Quite simply, enter the WPS code in your favourite text editor, Notepad on
162 Windows works fine. When you save it, instead of saving it as a \fname{.txt}
163 file, save it as a \fname{.wps} file. Example: Instead of \fname{Rockbox.txt},
164 save the file as \fname{Rockbox.wps}. To make sure non english characters
165 display correctly in your WPS you must save the .wps file with UTF-8 character
166 encoding. This can be done in most editors, for example Notepad in Windows 2000
167 or XP (but not in 9x/ME) can do this. See appendix \reference{ref:wps_tags} for
168 all the tags that are available.
170 \begin{itemize}
171 \item All characters not preceded by \% are displayed as typed.
172 \item Lines beginning with \# are comments and will be ignored.
173 \item Maximum file size used is
174 \opt{lcd_bitmap}{1600}
175 \opt{player}{400} bytes.
176 If you have a bigger WPS file, only the first part of it will be
177 loaded and used.
178 \end{itemize}
180 \note{Keep in mind that your \dap{} resolution is \genericimg{} (with
181 the last number giving the colour depth in bits) when
182 designing your own WPS, or if you use a WPS designed for another target.
183 \opt{HAVE_REMOTE_LCD}{The resolution of the remote is
184 \opt{h100,h300}{128x64x1}\opt{x5,m5}{128x96x2} pixels.}}
186 \subsubsection{Conditional Tags}
188 \begin{description}
189 \item[If/else: ]
190 Syntax: \config{\%?xx{\textless}true{\textbar}false{\textgreater}}
192 If the tag specified by ``\config{xx}'' has a value, the text between the
193 ``\config{{\textless}}'' and the ``\config{{\textbar}}'' is displayed (the true
194 part), else the text between the ``\config{{\textbar}}'' and the
195 ``\config{{\textgreater}}'' is displayed (the false part).
196 The else part is optional, so the ``\config{{\textbar}}'' does not have to be
197 specified if no else part is desired. The conditionals nest, so the text in the
198 if and else part can contain all \config{\%} commands, including conditionals.
200 \item[Enumerations: ]
201 Syntax: \config{\%?xx{\textless}alt1{\textbar}alt2{\textbar}alt3{\textbar}\dots{\textbar}else{\textgreater}}
203 For tags with multiple values, like Play status, the conditional can hold a
204 list of alternatives, one for each value the tag can have.
205 Example enumeration:
206 \begin{example}
207 \%?mp{\textless}Stop{\textbar}\%Play{\textbar}Pause{\textbar}Ffwd{\textbar}Rew{\textgreater}
208 \end{example}
210 The last else part is optional, and will be displayed if the tag has no value.
211 The WPS parser will always display the last part if the tag has no value, or if
212 the list of alternatives is too short.
213 \end{description}
215 \subsubsection{Next Song Info}
216 You can display information about the next song -- the song that is
217 about to play after the one currently playing (unless you change the
218 plan).
220 If you use the upper-case versions of the
221 three tags: \config{F}, \config{I} and \config{D}, they will instead refer to
222 the next song instead of the current one. Example: \config{\%Ig} is the genre
223 name used in the next song and \config{\%Ff} is the mp3 frequency.
225 \note{The next song information \emph{will not} be available at all
226 times, but will most likely be available at the end of a song. We
227 suggest you use the conditional display tag a lot when displaying
228 information about the next song!}
230 \subsubsection{Alternating Sublines}
232 It is possible to group items on each line into 2 or more groups or
233 ``sublines''. Each subline will be displayed in succession on the line for a
234 specified time, alternating continuously through each defined subline.
236 Items on a line are broken into sublines with the semicolon
237 '\config{;}' character. The display time for
238 each subline defaults to 2 seconds unless modified by using the
239 '\config{\%t}' tag to specify an alternate
240 time (in seconds and optional tenths of a second) for the subline to be
241 displayed.
243 Subline related special characters and tags:
244 \begin{description}
245 \item[;] Split items on a line into separate sublines
246 \item[\%t] Set the subline display time. The
247 '\config{\%t}' is followed by either integer
248 seconds (\config{\%t5}), or seconds and tenths of a second (\config{\%t3.5}).
249 \end{description}
251 Each alternating subline can still be optionally scrolled while it is
252 being displayed, and scrollable formats can be displayed on the same
253 line with non{}-scrollable formats (such as track elapsed time) as long
254 as they are separated into different sublines.
255 Example subline definition:
256 \begin{example}
257 %s%t4%ia;%s%it;%t3%pc %pr : Display id3 artist for 4 seconds,
258 Display id3 title for 2 seconds,
259 Display current and remaining track time
260 for 3 seconds,
261 repeat...
262 \end{example}
264 Conditionals can be used with sublines to display a different set and/or number
265 of sublines on the line depending on the evaluation of the conditional.
266 Example subline with conditionals:
267 \begin{example}
268 %?it{\textless}%t8%s%it{\textbar}%s%fn{\textgreater};%?ia{\textless}%t3%s%ia{\textbar}%t0{\textgreater}\\
269 \end{example}
271 The format above will do two different things depending if ID3 tags are
272 present. If the ID3 artist and title are present:
273 \begin{itemize}
274 \item Display id3 title for 8 seconds,
275 \item Display id3 artist for 3 seconds,
276 \item repeat\dots
277 \end{itemize}
278 If the ID3 artist and title are not present:
279 \begin{itemize}
280 \item Display the filename continuously.
281 \end{itemize}
282 Note that by using a subline display time of 0 in one branch of a conditional,
283 a subline can be skipped (not displayed) when that condition is met.
285 \subsubsection{Using Images}
286 You can have as many as 52 images in your WPS. There are various ways of
287 displaying images:
288 \begin{enumerate}
289 \item Load and always show the image, using the \config{\%x} tag
290 \item Preload the image with \config{\%xl} and show it with \config{\%xd}.
291 This way you can have your images displayed conditionally.
292 \nopt{archos}{%
293 \item Load an image and show as backdrop using the \config{\%X} tag. The
294 image must be of the same exact dimensions as your display.
296 \end{enumerate}
298 \optv{swcodec}{% This doesn't depend on swcodec but we don't have a \noptv
299 % command.
300 Example on background image use:
301 \begin{example}
302 %X|background.bmp|
303 \end{example}
304 The image with filename \fname{background.bmp} is loaded and used in the WPS.
307 Example on bitmap preloading and use:
308 \begin{example}
309 %x|a|static_icon.bmp|50|50|
310 %xl|b|rep\_off.bmp|16|64|
311 %xl|c|rep\_all.bmp|16|64|
312 %xl|d|rep\_one.bmp|16|64|
313 %xl|e|rep\_shuffle.bmp|16|64|
314 %?mm<%xdb|%xdc|%xdd|%xde>
315 \end{example}
316 Four images at the same x and y position are preloaded in the example. Which
317 image to display is determined by the \config{\%mm} tag (the repeat mode).
319 \subsubsection{Example File}
320 \begin{example}
321 %s%?in<%in - >%?it<%it|%fn> %?ia<[%ia%?id<, %id>]>
322 %pb%pc/%pt
323 \end{example}
324 That is, ``tracknum -- title [artist, album]'', where most fields are only
325 displayed if available. Could also be rendered as ``filename'' or ``tracknum --
326 title [artist]''.
328 %\opt{lcd_bitmap}{
329 % \begin{verbatim}
330 % %s%?it<%?in<%in. |>%it|%fn>
331 % %s%?ia<%ia|%?d2<%d2|(root)>>
332 % %s%?id<%id|%?d1<%d1|(root)>> %?iy<(%iy)|>
334 % %al%pc/%pt%ar[%pp:%pe]
335 % %fbkBit %?fv<avg|> %?iv<(id3v%iv)|(no id3)>
336 % %pb
337 % %pm
338 % % \end{verbatim}
341 \section{\label{ref:manage_settings}Managing Rockbox Settings}
343 \subsection{Introduction to \fname{.cfg} Files.}
344 Rockbox allows users to store and load multiple settings through the use of
345 configuration files. A configuration file is simply a text file with the
346 extension \fname{.cfg}.
348 A configuration file may reside anywhere on the disk. Multiple
349 configuration files are permitted. So, for example, you could have
350 a \fname{car.cfg} file for the settings that you use while playing your
351 jukebox in your car, and a \fname{headphones.cfg} file to store the
352 settings that you use while listening to your \dap{} through headphones.
354 See \reference{ref:cfg_specs} below for an explanation of the format
355 for configuration files. See \reference{ref:manage_settings_menu} for an
356 explanation of how to create, edit and load configuration files.
358 \subsection{\label{ref:cfg_specs}Specifications for \fname{.cfg}
359 Files.}
361 The Rockbox configuration file is a plain text file, so once you use the
362 \setting{Save .cfg file} option to create the file, you can edit the file on
363 your computer using any text editor program. See
364 Appendix \reference{ref:config_file_options} for available settings. Configuration
365 files use the following formatting rules: %
367 \begin{enumerate}
368 \item Each setting must be on a separate line.
369 \item Each line has the format ``setting: value''.
370 \item Values must be within the ranges specified in this manual for each
371 setting.
372 \item Lines starting with \# are ignored. This lets you write comments into
373 your configuration files.
374 \end{enumerate}
376 Example of a configuration file:
377 \begin{example}
378 # Example configuration file
379 # volume: 70
380 # bass: 11
381 # treble: 12
382 # balance: 0
383 # time format: 12hour
384 # volume display: numeric
385 # show files: supported
386 # wps: /.rockbox/car.wps
387 # lang: /.rockbox/afrikaans.lng
388 \end{example}
390 \note{As you can see from the example, configuration files do not need to
391 contain all of the Rockbox options. You can create configuration files
392 that change only certain settings. So, for example, supppose you
393 typically use the \dap{} at one volume in the car, and another when using
394 headphones. Further, suppose you like to use an inverse LCD when you are
395 in the car, and a regular LCD setting when you are using headphones. You
396 could create configuration files that control only the volume and LCD
397 settings. Create a few different files with different settings, give
398 each file a different name (such as \fname{car.cfg},
399 \fname{headphones.cfg}, etc.), and you can then use the \setting{Browse .cfg
400 files} option to quickly change settings.}
402 A special case configuration file can be used to force a particular setting
403 or settings every time Rockbox starts up (e.g. to set the volume to a safe
404 level). Format a new configuration file as above with the required setting(s)
405 and save it into the \fname{/.rockbox} directory with the filename
406 \fname{fixed.cfg}.
408 \subsection{\label{ref:manage_settings_menu}The \setting{Manage Settings}
409 menu} The \setting{Manage Settings} menu can be found in the \setting{Main
410 Menu}. The \setting{Manage Settings} menu allows you to save and load
411 \fname{.cfg} files.
412 \opt{MASCODEC}{The \setting{Manage Settings} menu also
413 allows you to load or save different firmware versions.}
415 \begin{description}
417 \item [Browse .cfg Files]Opens the \setting{File Browser} in the
418 \fname{/.rockbox} directory and displays all \fname{.cfg} (configuration)
419 files. Selecting a \fname{.cfg} file will cause Rockbox to load the settings
420 contained in that file. Pressing \ButtonLeft{} will exit back to the
421 \setting{Manage Settings} menu. See the \setting{Write .cfg files} option on
422 the \setting{Manage Settings} menu for details of how to save and edit a
423 configuration file.
425 \item [Reset Settings]This wipes the saved settings
426 in the \dap{} and resets all settings to their default values.
428 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{
429 \note{You can also reset all settings to their default
430 values by turning off the \dap, turning it back on, and holding the
431 \ButtonRec{} button immediately after the \dap{} turns on.}
433 \opt{IRIVER_H10_PAD}{\note{You can also reset all settings to
434 their default values by turning off the \dap, and turning it back on
435 with the \ButtonHold{} button on.}
437 \opt{IPOD_4G_PAD}{\note{You can also reset all settings to their default
438 values by turning off the \dap, turning it back on, and activating the
439 \ButtonHold{} button immediately after the backlight comes on.}
441 \opt{GIGABEAT_PAD}{\note{You can also reset all settings to their default
442 values by turning off the \dap, turning it back on and pressing the
443 \ButtonA{} button immediately after the \dap{} turns on.}
446 \item [Save .cfg File]This option writes a \fname{.cfg} file to
447 your \daps{} disk. The configuration file has the \fname{.cfg}
448 extension and is used to store all of the user settings that are described
449 throughout this manual.
451 Hint: Use the \setting{Save .cfg File} feature (\setting{Main Menu
452 $\rightarrow$ Manage Settings}) to save the current settings, then
453 use a text editor to customize the settings file. See Appendix
454 \reference{ref:config_file_options} for the full reference of available
455 options.
457 \item [Save Sound Settings]This option writes a \fname{.cfg} file to
458 your \daps{} disk. The configuration file has the \fname{.cfg}
459 extension and is used to store all of the sound related settings.
461 \item [Save Theme Settings]This option writes a \fname{.cfg} file to
462 your \daps{} disk. The configuration file has the \fname{.cfg}
463 extension and is used to store all of the theme related settings.
465 \end{description}
467 \section{\label{ref:FirmwareLoading}Firmware Loading}
468 \opt{player,recorder,recorderv2fm,ondio}{
469 When your \dap{} powers on, it loads the Archos firmware in ROM, which
470 automatically checks your \daps{} root directory for a file named
471 \firmwarefilename. Note that Archos firmware can only read the first
472 ten characters of each filename in this process, so do not rename your old
473 firmware files with names like \firmwarefilename.\fname{old} and so on,
474 because it is possible that the \dap{} will load a file other than the one
475 you intended.
478 \subsection{\label{ref:using_rolo}Using ROLO (Rockbox Loader)}
479 Rockbox is able to load and start another firmware file without rebooting.
480 You just ``play'' a file with the extension %
481 \opt{recorder,recorderv2fm,ondio}{\fname{.ajz}.} %
482 \opt{player}{\fname{.mod}.} %
483 \opt{h100,h300}{\fname{.iriver}.} %
484 \opt{ipod}{\fname{.ipod}.} %
485 \opt{iaudio}{\fname{.iaudio}.} %
486 \opt{sansa,h10,h10_5gb}{\fname{.mi4}.} %
487 This can be used to test new firmware versions without deleting your
488 current version.
490 \opt{archos}{\input{advanced_topics/archos-flashing.tex}}