Colour targets: Revert an optimisation from almost 18 months ago that actually turned...
[Rockbox.git] / manual / advanced_topics / main.tex
blob92ea5d88b6fd8c78d28bd4b487dda3f5a5f00256
1 % $Id$ %
2 \chapter{Advanced Topics}
4 \section{\label{ref:CustomisingUI}Customising the User Interface}
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}.
48 \subsection{Changing Filetype Colours}
49 Rockbox has the capability to modify the File Browser to show different
50 filetypes in different colours depending upon the file extension.
51 See the \wikilink{CustomFiletypeColours} Wiki page for details.
54 \nopt{archos,mrobe100}{%
55 \subsection{\label{ref:LoadingBackdrops}Loading Backdrops}
56 Rockbox supports showing an image as a backdrop in the \setting{File Browser}
57 and the menus. The backdrop image must be a \fname{.bmp} file of the exact
58 same dimensions as the display in your \dap{} (\genericimg{} with the last
59 number giving the colour depth in bits). To use an image as a backdrop browse
60 to it in the \setting{File Browser} and open the \setting{Context Menu}
61 (see \reference{ref:Contextmenu}) on it and select the option
62 \setting{Set As Backdrop}. If you want rockbox to remember your
63 backdrop the next time you start your \dap{} the backdrop must be placed in
64 the \fname{/.rockbox/backdrops} directory.
67 \section{\label{ref:ConfiguringtheWPS}Configuring the WPS}
69 \subsection{WPS -- General Info}
71 \begin{description}
72 \item[Description: ] The WPS or While Playing Screen is the name used to
73 describe the information displayed on the \daps\ screen whilst an audio track
74 is being played. The default WPS is a relatively simple screen displaying
75 Track name, Artist, Album etc. in the default font as a purely text based
76 layout. There are a number of WPS files included in Rockbox, and you can
77 load one of these at anytime by selecting it in
78 \setting{General Settings $\rightarrow$ Display $\rightarrow$ Browse .wps files}.
79 \opt{HAVE_REMOTE_LCD}{There is a related option to browse \fname{.rwps}
80 files for \daps{} with LCD remote controls installed. This will load a
81 similar WPS screen for the remote but with usually a simpler and more
82 concise layout.}
84 \note{``Playing'' a \fname{.wps} from the 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{h1xx,h300}{128x64x1}\opt{x5}{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 or settings every time Rockbox starts up (e.g. to set the volume to a safe level).
337 Format a new configuration file as above with the required setting(s) and save it into the \fname{/.rockbox} directory with the filename \fname{fixed.cfg}.
339 \subsection{\label{ref:manage_settings_menu}The \setting{Manage Settings}
340 menu} The \setting{Manage Settings} menu can be found in the \setting{Main
341 Menu}. The \setting{Manage Settings} menu allows you to save and load
342 \fname{.cfg} files. \opt{MASCODEC}{The \setting{Manage Settings} menu also
343 allows you to load or save different firmware versions.}
345 \begin{description}
347 \item [Browse .cfg Files]Opens the file browser in the \fname{/.rockbox}
348 directory and displays all \fname{.cfg} (configuration) files. Selecting a
349 \fname{.cfg} file will cause Rockbox to load the settings contained in that
350 file. Pressing \ButtonLeft\ will exit back to the \setting{Manage Settings}
351 menu. See the \setting{Write .cfg files} option on the
352 \setting{Manage Settings} menu for details of how to save and edit a
353 configuration file.
355 \item [Reset Settings]This wipes the saved settings
356 in the \dap\ and resets all settings to their default values.
358 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{
359 \note{You can also reset all settings to their default
360 values by turning off the \dap, turning it back on, and holding the
361 \ButtonRec\ button immediately after the \dap\ turns on.}
363 \opt{IRIVER_H10_PAD}{\note{You can also reset all settings to
364 their default values by turning off the \dap, and turning it back on
365 with the \ButtonHold\ button on.}
367 \opt{IPOD_4G_PAD}{\note{You can also reset all settings to their default
368 values by turning off the \dap, turning it back on, and activating the
369 \ButtonHold\ button immediately after the backlight comes on.}
371 \opt{GIGABEAT_PAD}{\note{You can also reset all settings to their default
372 values by turning off the \dap, turning it back on and pressing the
373 \ButtonA\ button immediately after the \dap\ turns on.}
376 \item [Save .cfg File]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 user settings that are described
379 throughout this manual.
381 Hint: Use the \setting{Save .cfg File} feature (\setting{Main Menu
382 $\rightarrow$ General Settings}) to save the current settings, then
383 use a text editor to customize the settings file. See Appendix
384 \reference{ref:config_file_options} for the full reference of available
385 options.
387 \item [Save Sound Settings]This option writes a \fname{.cfg} file to
388 your \daps\ disk. The configuration file has the \fname{.cfg}
389 extension and is used to store all of the sound related settings.
391 \item [Save Theme 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 theme related settings.
395 \end{description}
397 \section{\label{ref:FirmwareLoading}Firmware Loading}
398 \opt{player,recorder,recorderv2fm,ondio}{
399 When your \dap{} powers on, it loads the Archos firmware in ROM, which
400 automatically checks your \daps{} root directory for a file named
401 \firmwarefilename. Note that Archos firmware can only read the first
402 ten characters of each filename in this process, so do not rename your old
403 firmware files with names like \firmwarefilename.\fname{old} and so on,
404 because it is possible that the \dap{} will load a file other than the one
405 you intended.
408 \subsection{\label{ref:using_rolo}Using ROLO (Rockbox Loader)}
409 Rockbox is able to load and start another firmware file without rebooting.
410 You just ``play'' a file with the extension %
411 \opt{recorder,recorderv2fm,ondio}{\fname{.ajz}.} %
412 \opt{player}{\fname{.mod}.} %
413 \opt{h1xx,h300}{\fname{.iriver}.} %
414 \opt{ipod}{\fname{.ipod}.} %
415 \opt{iaudio}{\fname{.iaudio}.} %
416 \opt{sansa,h10,h10_5gb}{\fname{.mi4}.} %
417 This can be used to test new firmware versions without deleting your
418 current version.
420 \opt{archos}{\input{advanced_topics/archos-flashing.tex}}