chiark / gitweb /
Use users.db. trackdb* moves to lib/, as it's now used by client.c to
[disorder] / doc / disorder_config.5.in
1 .\"
2 .\" Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
3 .\"
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU General Public License as published by
6 .\" the Free Software Foundation; either version 2 of the License, or
7 .\" (at your option) any later version.
8 .\"
9 .\" This program is distributed in the hope that it will be useful, but
10 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 .\" General Public License for more details.
13 .\"
14 .\" You should have received a copy of the GNU General Public License
15 .\" along with this program; if not, write to the Free Software
16 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17 .\" USA
18 .\"
19 .TH disorder_config 5
20 .SH NAME
21 pkgconfdir/config - DisOrder jukebox configuration
22 .SH DESCRIPTION
23 The purpose of DisOrder is to organize and play digital audio files, under the
24 control of multiple users.  \fIpkgconfdir/config\fR is the primary
25 configuration file but this man page currently documents all of its various
26 configuration files.
27 .SS Tracks
28 DisOrder can be configured with multiple collections of tracks, indexing them
29 by their filename, and picking players on the basis of filename patterns (for
30 instance, "*.mp3").
31 .PP
32 Although the model is of filenames, it is not inherent that there are
33 corresponding real files - merely that they can be interpreted by the chosen
34 player.  See \fBdisorder\fR(3) for more details about this.
35 .PP
36 Each track can have a set of preferences associated with it.  These are simple
37 key-value pairs; they can be used for anything you like, but a number of keys
38 have specific meanings.  See \fBdisorder\fR(1) for more details about these.
39 .SS "Track Names"
40 Track names are derived from filenames under the control of regular
41 expressions, rather than attempting to interpret format-specific embedded name
42 information.  They can be overridden by setting preferences.
43 .PP
44 Names for display are distinguished from names for sorting, so with the right
45 underlying filenames an album can be displayed in its original order even if
46 the displayed track titles are not lexically sorted.
47 .SS "Server State"
48 A collection of global preferences define various bits of server state: whether
49 random play is enabled, what tags to check for when picking at random, etc.
50 .SS "Users And Access Control"
51 DisOrder distinguishes between multiple users.  This is for access control and
52 reporting, not to provide different views of the world: i.e. preferences and so
53 on are global.
54 .PP
55 It's possible to restrict a small number of operations to a specific subset of
56 users.  However, it is assumed that every user is supposed to be able to do
57 most operations - since the users are all sharing the same audio environment
58 they are expected to cooperate with each other.
59 .PP
60 Access control is entirely used-based.  If you configure DisOrder to listen for
61 TCP/IP connections then it will accept a connection from anywhere provided the
62 right password is available.  Passwords are never transmitted over TCP/IP
63 connections in clear, but everything else is.  The expected model is that
64 host-based access control is imposed at the network layer.
65 .SS "Web Interface"
66 The web interface is controlled by a collection of template files, one for each
67 kind of page, and a collection of option files.  These are split up and
68 separate from the main configuration file to make it more convenient to
69 override specific bits.
70 .PP
71 The web interface connects to the DisOrder server like any other user, though
72 it is given a special privilege to "become" any other user.  (Thus, any process
73 with the same UID as the web interface is very powerful as far as DisOrder
74 goes.  This model will be changed in a future version.)
75 .PP
76 Access control to the web interface is (currently) separate from DisOrder's own
77 access control (HTTP authentication is required) but uses the same user
78 namespace.
79 .SS "Searching And Tags"
80 Search strings contain a list of search terms separated by spaces.  A search
81 term can either be a single word or a tag, prefixed with "tag:".
82 .PP
83 Search words are compared without regard to letter case or accents; thus, all
84 of the following will be considered to be equal to one another:
85 .PP
86 .nf
87   LATIN CAPITAL LETTER E
88   LATIN SMALL LETTER E
89   LATIN CAPITAL LETTER E WITH GRAVE
90   LATIN SMALL LETTER E WITH GRAVE
91   LATIN CAPITAL LETTER E plus COMBINING GRAVE ACCENT
92   LATIN SMALL LETTER E plus COMBINING GRAVE ACCENT
93 .fi
94 .PP
95 The same rules apply to tags but in addition leading and trailing whitespace is
96 disregarded and all whitespace sequences are treated as equal when they appear
97 as internal whitespace.
98 .PP
99 Where several tags are listed, for instance the tags preference for a track,
100 the tags are separated by commas.  Therefore tags may not contain commas.
101 .SH "CONFIGURATION FILE"
102 .SS "General Syntax"
103 Lines are split into fields separated by whitespace (space, tab, line
104 feed, carriage return, form feed).  Comments are started by the number
105 sign ("#").
106 .PP
107 Fields may be unquoted (in which case they may not contain spaces and
108 may not start with a quotation mark or apostrophe) or quoted by either
109 quotation marks or apostrophes.  Inside quoted fields every character
110 stands for itself, except that a backslash can only appear as part of
111 one of the following escape sequences:
112 .TP
113 .B \e\e
114 Backslash
115 .TP
116 .B \e"
117 Quotation mark
118 .\" "
119 .TP
120 .B \e'
121 Apostrophe
122 .TP
123 .B \en
124 Line feed
125 .PP
126 No other escape sequences are allowed.
127 .PP
128 Within any line the first field is a configuration command and any
129 further fields are parameters.  Lines with no fields are ignored.
130 .PP
131 After editing the config file use \fBdisorder reconfigure\fR to make
132 it re-read it.  If there is anything wrong with it the daemon will
133 record a log message and ignore the new config file.  (You should fix
134 it before next terminating and restarting the daemon, as it cannot
135 start up without a valid config file.)
136 .SS "Global Configuration"
137 .TP
138 .B home \fIDIRECTORY\fR
139 The home directory for state files.  Defaults to
140 .IR pkgstatedir .
141 The server will create this directory on startup if it does not exist.
142 .TP
143 .B plugins \fIPATH\fR
144 Adds a directory to the plugin path.  (This is also used by the web
145 interface.)
146 .IP
147 Plugins are opened the first time they are required and never after,
148 so after changing a plugin you must restart the server before it is
149 guaranteed to take effect.
150 .IP
151 If
152 .B plugins
153 is used without arguments the plugin path is cleared.
154 .SS "Server Configuration"
155 .TP
156 .B alias \fIPATTERN\fR
157 Defines the pattern use construct virtual filenames from \fBtrackname_\fR
158 preferences.
159 .IP
160 Most characters stand for themselves, the exception being \fB{\fR which is used
161 to insert a track name part in the form \fB{\fIname\fB}\fR or
162 \fB{/\fIname\fB}\fR.
163 .IP
164 The difference is that the first form just inserts the name part while the
165 second prefixes it with a \fB/\fR if it is nonempty.
166 .IP
167 The pattern should not attempt to include the collection root, which is
168 automatically included, but should include the proper extension.
169 .IP
170 The default is \fB{/artist}{/album}{/title}{ext}\fR.
171 .TP
172 .B authorization_algorithm \fIALGORITHM\fR
173 Defines the algorithm used to authenticate clients.  The valid options
174 are sha1 (the default), sha256, sha384 and sha512.  See
175 .BR disorder_protocol (5)
176 for more details.
177 .TP
178 .B broadcast \fIADDRESS\fR \fIPORT\fR
179 Transmit sound data to \fIADDRESS\fR using UDP port \fIPORT\fR.  This implies
180 \fBspeaker_backend network\fR.
181 .IP
182 See also \fBmulticast_loop\fR and \fBmulticast_ttl\fR.
183 .TP
184 .B broadcast_from \fIADDRESS\fR \fIPORT\fR
185 Sets the (local) source address used by \fBbroadcast\fR.
186 .TP
187 .B channel \fICHANNEL\fR
188 The mixer channel that the volume control should use.  Valid names depend on
189 your operating system and hardware, but some standard ones that might be useful
190 are:
191 .RS
192 .TP 8
193 .B pcm
194 Output level for the audio device.  This is probably what you want and is the
195 default.
196 .TP
197 .B speaker
198 Output level for the PC speaker, if that is connected to the sound card.
199 .TP
200 .B pcm2
201 Output level for alternative codec device.
202 .TP
203 .B vol
204 Master output level.  The OSS documentation recommends against using this, as
205 it affects all output devices.
206 .RE
207 .IP
208 You can also specify channels by number, if you know the right value.  NB that
209 volume setting only works on OSS systems (including ALSA, via emulation).
210 .TP
211 .B collection \fIMODULE\fR \fIENCODING\fR \fIROOT\fR
212 Define a collection of tracks.
213 .IP
214 \fIMODULE\fR defines which plugin module should be used for this
215 collection.  Use the supplied \fBfs\fR module for tracks that exists
216 as ordinary files in the filesystem.
217 .IP
218 \fIENCODING\fR defines the encoding of filenames in this collection.
219 For \fBfs\fR this would be the encoding you use for filenames.
220 Examples might be \fBiso-8859-1\fR or \fButf-8\fR.
221 .IP
222 \fIROOT\fR is the root in the filesystem of the filenames and is
223 passed to the plugin module.
224 .TP
225 .B device \fINAME\fR
226 ALSA device to play raw-format audio.  Default is \fBdefault\fR, i.e. to use
227 the whatever the ALSA configured default is.
228 .TP
229 .B gap \fISECONDS\fR
230 Specifies the number of seconds to leave between tracks.  The default
231 is 2.
232 .TP
233 .B history \fIINTEGER\fR
234 Specifies the number of recently played tracks to remember (including
235 failed tracks and scratches).
236 .TP
237 .B listen \fR[\fIHOST\fR] \fISERVICE\fR
238 Listen for connections on the address specified by \fIHOST\fR and port
239 specified by \fISERVICE\fR.  If \fIHOST\fR is omitted then listens on all
240 local addresses.
241 .IP
242 Normally the server only listens on a UNIX domain socket.
243 .TP
244 .B lock yes\fR|\fBno
245 Determines whether the server locks against concurrent operation.  Default is
246 \fByes\fR.  There is no good reason to set this to \fBno\fR and the option will
247 probably be removed in a future version.
248 .TP
249 .B mixer \fIPATH\fR
250 The path to the mixer device, if you want access to the volume control,
251 e.g. \fB/dev/mixer\fR (the default).
252 .TP
253 .B multicast_loop yes\fR|\fBno
254 Determines whether multicast packets are loop backed to the sending host.  The
255 default is \fByes\fR.  This only applies if
256 \fBspeaker_backend\fR is set to \fBnetwork\fR and \fBbroadcast\fR is actually a
257 multicast address.
258 .TP
259 .B multicast_ttl \fIHOPS\fR
260 Set the maximum number of hops to send multicast packets.  This only applies if
261 \fBspeaker_backend\fR is set to \fBnetwork\fR and \fBbroadcast\fR is actually a
262 multicast address.  The default is 1.
263 .TP
264 .B namepart \fIPART\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
265 Determines how to extract trackname part \fIPART\fR from a 
266 track name (with the collection root part removed).
267 Used in \fB@recent@\fR, \fB@playing@\fR and \fB@search@\fR.
268 .IP
269 Track names can be different in different contexts.  For instance the sort
270 string might include an initial track number, but this would be stripped for
271 the display string.  \fICONTEXT\fR should be a glob pattern matching the
272 contexts in which this directive will be used.
273 .IP
274 Valid contexts are \fBsort\fR and \fBdisplay\fR.
275 .IP
276 All the \fBnamepart\fR directives are considered in order.  The
277 first directive for the right part, that matches the desired context,
278 and with a \fIREGEXP\fR that
279 matches the track is used, and the value chosen is constructed from
280 \fISUBST\fR according to the substitution rules below.
281 .IP
282 Note that searches use the raw track name and \fBtrackname_\fR preferences but
283 not (currently) the results of \fBnamepart\fR, so generating words via this option
284 that aren't in the original track name will lead to confusing results.
285 .IP
286 If you supply no \fBnamepart\fR directives at all then a default set will be
287 supplied automatically.  But if you supply even one then you must supply all of
288 them.  The defaults are equivalent to:
289 .PP
290 .nf
291 namepart title  "/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
292 namepart title  "/([^/]+)\\.[a-zA-Z0-9]+$"                  $1 sort
293 namepart album  "/([^/]+)/[^/]+$"                          $1 *
294 namepart artist "/([^/]+)/[^/]+/[^/]+$"                    $1 *
295 namepart ext    "(\\.[a-zA-Z0-9]+)$"                        $1 *
296 .fi
297 .TP
298 .B nice_rescan \fIPRIORITY\fR
299 Set the recan subprocess priority.  The default is 10.
300 .IP
301 (Note that higher values mean the process gets less CPU time; UNIX priority
302 values are backwards.)
303 .TP
304 .B nice_server \fIPRIORITY\fR
305 Set the server priority.  This is applied to the server at startup time (and
306 not when you reload configuration).  The server does not use much CPU itself
307 but this value is inherited by programs it executes.  If you have limited CPU
308 then it might help to set this to a small negative value.  The default is 0.
309 .TP
310 .B nice_speaker \fIPRIORITY\fR
311 Set the speaker process priority.  This is applied to the speaker process at
312 startup time (and not when you reload the configuration).  The speaker process
313 is not massively CPU intensive by today's standards but depends on reasonably
314 timely scheduling.  If you have limited CPU then it might help to set this to a
315 small negative value.  The default is 0.
316 .TP
317 .B noticed_history
318 The maximum days that a track can survive in the database of newly added
319 tracks.  The default is 31.
320 .TP
321 .B player \fIPATTERN\fR \fIMODULE\fR [\fIOPTIONS.. [\fB--\fR]] \fIARGS\fR...
322 Specifies the player for files matching the glob \fIPATTERN\fR.  \fIMODULE\fR
323 specifies which plugin module to use.
324 .IP
325 The following options are supported:
326 .RS
327 .TP
328 .B --wait-for-device\fR[\fB=\fIDEVICE\fR]
329 Waits (for up to a couple of seconds) for the default, or specified, libao
330 device to become openable.
331 .TP
332 .B --
333 Defines the end of the list of options.  Needed if the first argument to the
334 plugin starts with a "-".
335 .RE
336 .IP
337 The following are the standard modules:
338 .RS
339 .TP
340 .B exec \fICOMMAND\fR \fIARGS\fR...
341 The command is executed via \fBexecvp\fR(3), not via the shell.
342 The \fBPATH\fR environment variable is searched for the executable if it is not
343 an absolute path.
344 The command is expected to know how to open its own sound device.
345 .TP
346 .B execraw \fICOMMAND\fR \fIARGS\fR...
347 Identical to the \fBexec\fR except that the player is expected to use the
348 DisOrder raw player protocol.
349 .BR disorder-decode (8)
350 can decode several common audio file formats to this format.  If your favourite
351 format is not supported, but you have a player which uses libao, there is also
352 a libao driver which supports this format; see below for more information about
353 this.
354 .TP
355 .B shell \fR[\fISHELL\fR] \fICOMMAND\fR
356 The command is executed using the shell.  If \fISHELL\fR is specified then that
357 is used, otherwise \fBsh\fR will be used.  In either case the \fBPATH\fR
358 environment variable is searched for the shell executable if it is not an
359 absolute path.  The track name is stored in the environment variable
360 \fBTRACK\fR.
361 .IP
362 Be careful of the interaction between the configuration file quoting rules and
363 the shell quoting rules.
364 .RE
365 .IP
366 If multiple player commands match a track then the first match is used.
367 .IP
368 For the server to be able to calculate track lengths, there should be a
369 .B tracklength
370 command corresponding to each
371 .B player
372 command.
373 .IP
374 If
375 .B player
376 is used without arguments, the list of players is cleared.
377 .TP
378 .B prefsync \fISECONDS\fR
379 The interval at which the preferences log file will be synchronised.  Defaults
380 to 3600, i.e. one hour.
381 .TP
382 .B queue_pad \fICOUNT\fR
383 The target size of the queue.  If random play is enabled then randomly picked
384 tracks will be added until the queue is at least this big.  The default is 10.
385 .TP
386 .B restrict \fR[\fBscratch\fR] [\fBremove\fR] [\fBmove\fR]
387 Determine which operations are restricted to the submitter of a
388 track.  By default, no operations are restricted, i.e. anyone can
389 scratch or remove anything.
390 .IP
391 If \fBrestrict scratch\fR or \fBrestrict remove\fR are set then only the user
392 that submitted a track can scratch or remove it, respectively.
393 .IP
394 If \fBrestrict move\fR is set then only trusted users can move tracks around in
395 the queue.
396 .IP
397 If \fBrestrict\fR is used more than once then only the final use has any
398 effect.
399 .TP
400 .B sample_format \fIBITS\fB/\fIRATE\fB/\fICHANNELS
401 Describes the sample format expected by the \fBspeaker_command\fR (below).  The
402 components of the format specification are as follows:
403 .RS
404 .TP 10
405 .I BITS
406 The number of bits per sample.  Optionally, may be suffixed by \fBb\fR or
407 \fBl\fR for big-endian and little-endian words.  If neither is used the native
408 byte order is assumed.
409 .TP
410 .I RATE
411 The number of samples per second.
412 .TP
413 .I CHANNELS
414 The number of channels.
415 .PP
416 The default is
417 .BR 16/44100/2 .
418 .PP
419 With the
420 .B network
421 backend the sample format is forced to
422 .B 16b/44100/2
423 and with the
424 .B coreaudio
425 backend it is forced to
426 .BR 16/44100/2 ,
427 in both cases regardless of what is specified in the configuration file.
428 .RE
429 .TP
430 .B signal \fINAME\fR
431 Defines the signal to be sent to track player process groups when tracks are
432 scratched.  The default is \fBSIGKILL\fR.
433 .IP
434 Signals are specified by their full C name, i.e. \fBSIGINT\fR and not \fBINT\fR
435 or \fBInterrupted\fR or whatever.
436 .TP
437 .B speaker_backend \fINAME\fR
438 Selects the backend use by the speaker process.  The following options are
439 available:
440 .RS
441 .TP
442 .B alsa
443 Use the ALSA API.  This is only available on Linux systems, on which it is the
444 default.
445 .TP
446 .B coreaudio
447 Use Apple Core Audio.  This only available on OS X systems, on which it is the
448 default.
449 .TP
450 .B oss
451 Use the OSS (/dev/dsp) API.  Not available on all platforms.
452 .TP
453 .B command
454 Execute a command.  This is the default if
455 .B speaker_command
456 is specified, or if no native is available.
457 .TP
458 .B network
459 Transmit audio over the network.  This is the default if
460 \fBbroadcast\fR is specified.  You can use
461 .BR disorder-playrtp (1)
462 to receive and play the resulting stream on Linux and OS X.
463 .RE
464 .TP
465 .B sox_generation \fB0\fR|\fB1
466 Determines whether calls to \fBsox\fR(1) should use \fB-b\fR, \fB-x\fR, etc (if
467 the generation is 0) or \fB-\fIbits\fR, \fB-L\fR etc (if it is 1).  See the
468 documentation for your installed copy of \fBsox\fR to determine which you need.
469 The default is 0.
470 .TP
471 .B speaker_command \fICOMMAND
472 Causes the speaker subprocess to pipe audio data into shell command
473 \fICOMMAND\fR, rather than writing to a local sound card.  The sample format is
474 determine by
475 .B sample_format
476 above.
477 .IP
478 Note that if the sample format is wrong then
479 .BR sox (1)
480 is invoked to translate it.  If
481 .B sox
482 is not installed then this will not work.
483 .TP
484 .B scratch \fIPATH\fR
485 Specifies a scratch.  When a track is scratched, a scratch track is
486 played at random.
487 Scratches are played using the same logic as other tracks.
488 .IP
489 At least for the time being, path names of scratches must be encoded using
490 UTF-8 (which means that ASCII will do).
491 .IP
492 If \fBscratch\fR is used without arguments then the list of scratches is
493 cleared.
494 .TP
495 .B stopword \fIWORD\fR ...
496 Specifies one or more stopwords that should not take part in searches
497 over track names.
498 .IP
499 If \fBstopword\fR is used without arguments then the list of stopwords is
500 cleared.
501 .TP
502 .B tracklength \fIPATTERN\fR \fIMODULE\fR
503 Specifies the module used to calculate the length of files matching
504 \fIPATTERN\fR.  \fIMODULE\fR specifies which plugin module to use.
505 .IP
506 If \fBtracklength\fR is used without arguments then the list of modules is
507 cleared.
508 .SS "Client Configuration"
509 .TP
510 .B connect \fIHOST SERVICE\fR
511 Connect to the address specified by \fIHOST\fR and port specified by
512 \fISERVICE\fR.
513 .SS "Web Interface Configuration"
514 .TP
515 .B refresh \fISECONDS\fR
516 Specifies the maximum refresh period in seconds.  Default 15.
517 .TP
518 .B short_display \fICHARACTERS\fR
519 Defines the maximum number of characters to include in a \fBshort\fR name
520 part.  Default 30.
521 .TP
522 .B templates \fIPATH\fR ...
523 Specifies the directory containing templates used by the web
524 interface.  If a template appears in more than one template directory
525 then the one in the earliest directory specified is chosen.
526 .IP
527 See below for further details.
528 .IP
529 If \fBtemplates\fR is used without arguments then the template path is cleared.
530 .TP
531 .B transform \fITYPE\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
532 Determines how names are sorted and displayed in track choice displays.
533 .IP
534 \fITYPE\fR is the type of transformation; usually \fBtrack\fR or
535 \fBdir\fR but you can define your own.
536 .IP
537 \fICONTEXT\fR is a glob pattern matching the context.  Standard contexts are
538 \fBsort\fR (which determines how directory names are sorted) and \fBdisplay\fR
539 (which determines how they are displayed).  Again, you can define your
540 own.
541 .IP
542 All the \fBtransform\fR directives are considered in order.  If
543 the \fITYPE\fR, \fIREGEXP\fR and the \fICONTEXT\fR match
544 then a new track name is constructed from
545 \fISUBST\fR according to the substitution rules below.  If several
546 match then each is executed in order.
547 .IP
548 If you supply no \fBtransform\fR directives at all then a default set will be
549 supplied automatically.  But if you supply even one then you must supply all of
550 them.  The defaults are:
551 .PP
552 .nf
553 transform track "^.*/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
554 transform track "^.*/([^/]+)\\.[a-zA-Z0-9]+$"        $1 sort
555 transform dir   "^.*/([^/]+)$"                      $1 *
556 transform dir   "^(the) ([^/]*)"                    "$2 $1" sort i
557 transform dir   "[[:punct:]]"                       "" sort g
558 .fi
559 .TP
560 .B url \fIURL\fR
561 Specifies the URL of the web interface.  This URL will be used in
562 generated web pages.
563 .IP
564 This must be the full URL, e.g. \fBhttp://myhost/cgi-bin/jukebox\fR and not
565 \fB/cgi-bin/jukebox\fR.
566 .SS "Authentication Configuration"
567 .TP
568 .B password \fIPASSWORD\fR
569 Specify password.
570 .TP
571 .B trust \fIUSERNAME\fR
572 Allow \fIUSERNAME\fR to perform privileged operations such as shutting
573 down or reconfiguring the daemon, or becoming another user.
574 .IP
575 If \fBtrust\fR is used without arguments then the list of trusted users is
576 cleared.
577 .TP
578 .B user \fIUSER\fR
579 Specifies the user to run as.  Only makes sense if invoked as root (or
580 the target user).
581 .TP
582 .B username \fIUSERNAME\fR
583 Specify username.  The default is taken from the environment variable
584 \fBLOGNAME\fR.
585 .PP
586 Configuration files are read in the following order:
587 .TP
588 .I pkgconfdir/config
589 .TP
590 .I pkgconfdir/config.private
591 Should be readable only by the jukebox group, and contain \fBallow\fR
592 commands for authorised users.
593 .IP
594 If this file does not exist at startup then the server will create it with a
595 randomly chosen password for the root user.
596 .TP
597 .I pkgconfdir/config.\fRUSER
598 Per-user system-controlled client configuration.  Optional but if it
599 exists must be readable only by the relevant user.  Would normally
600 contain a \fBpassword\fR directive.
601 .TP
602 .I ~\fRUSER\fI/.disorder/passwd
603 Per-user client configuration.  Optional but if it exists must be
604 readable only by the relevant user.  Would normally contain a
605 \fBpassword\fR directive.
606 .SH "GLOBAL PREFERENCES"
607 These are the values set with \fBset-global\fR.
608 .TP
609 .B required-tags
610 If this is set an nonempty then randomly played tracks will always have at
611 least one of the listed tags.
612 .TP
613 .B prohibited-tags
614 If this is set an nonempty then randomly played tracks will never have any of
615 the listed tags.
616 .TP
617 .B playing
618 If unset or \fByes\fR then play is enabled.  Otherwise it is disabled.  Use
619 \fBdisable\fR rather than setting it directly.
620 .TP
621 .B random-play
622 If unset or \fByes\fR then random play is enabled.  Otherwise it is disabled.
623 Use \fBdisable\fR rather than setting it directly.
624 .PP
625 Global preferences starting '_' are read-only (in the sense that you cannot
626 modify them; the server may modify them as part of its normal operation).  They
627 are:
628 .TP
629 .B _dbversion
630 The database version string.  This is used by DisOrder to detect when it must
631 modify the database after an upgrade.
632 .SH "LIBAO DRIVER"
633 .SS "Raw Protocol Players"
634 Raw protocol players are expected to use the \fBdisorder\fR libao driver.
635 Programs that use libao generally have command line options to select the
636 driver and pass options to it.
637 .SS "Driver Options"
638 The known driver options are:
639 .TP
640 .B fd
641 The file descriptor to write to.  If this is not specified then the driver
642 looks like the environment variable \fBDISORDER_RAW_FD\fR.  If that is not set
643 then the default is 1 (i.e. standard output).
644 .TP
645 .B fragile
646 If this is set to a nonzero value then the driver will call \fB_exit\fR(2) if a
647 write to the output file descriptor fails.  This is a workaround for buggy
648 players such as \fBogg123\fR that ignore write errors.
649 .SH "WEB TEMPLATES"
650 When \fBdisorder.cgi\fR wants to generate a page for an action it searches the
651 directories specified with \fBtemplates\fR for a matching file.  It is
652 suggested that you leave the distributed templates unchanged and put
653 any customisations in an earlier entry in the template path.
654 .PP
655 The supplied templates are:
656 .TP
657 .B about.html
658 Display information about DisOrder.
659 .TP
660 .B choose.html
661 Navigates through the track database to choose a track to play.  The
662 \fBdir\fR argument gives the directory to look in; if it is missing
663 then the root directory is used.
664 .TP
665 .B choosealpha.html
666 Provides a front end to \fBchoose.html\fR which allows subsets of the top level
667 directories to be selected by initial letter.
668 .TP
669 .B new.html
670 Lists newly added tracks.
671 .TP
672 .B playing.html
673 The "front page", which usually shows the currently playing tracks and
674 the queue.
675 Gets an HTTP \fBRefresh\fR header.
676 .IP
677 If the \fBmgmt\fR CGI argument is set to \fBtrue\fR then we include extra
678 buttons for moving tracks up and down in the queue.  There is some logic in
679 \fBdisorder.cgi\fR to ensure that \fBmgmt=true\fR is preserved across refreshes
680 and redirects back into itself, but URLs embedded in web pages must include it
681 explicitly.
682 .TP
683 .B prefs.html
684 Views preferences.  If the \fBfile\fR, \fBname\fR and \fBvalue\fR arguments are
685 all set then that preference is modified; if \fBfile\fR and \fBname\fR are set
686 but not \fBvalue\fR then the preference is deleted.
687 .TP
688 .B recent.html
689 Lists recently played tracks.
690 .TP
691 .B search.html
692 Presents search results.
693 .TP
694 .B volume.html
695 Primitive volume control.
696 .PP
697 Additionally, other standard files are included by these:
698 .TP
699 .B credits.html
700 Included at the end of the main content \fB<DIV>\fR element.
701 .TP
702 .B topbar.html
703 Included at the start of the \fB<BODY>\fR element.  (This supplants
704 \fBsidebar.html\fR, though the latter is still available; override label
705 \fBmenu\fR to choose between them.)
706 .TP
707 .B stdhead.html
708 Included in the \fB<HEAD>\fR element.
709 .TP
710 .B stylesheet.html
711 Contains the default DisOrder stylesheet.  You can override this by editing the
712 CSS or by replacing it all with a \fB<LINK>\fR to an external stylesheet.
713 .PP
714 Templates are ASCII files containing HTML documents, with an expansion
715 syntax to enable data supplied by the implementation to be inserted.
716 .PP
717 If you want to use characters outside the ASCII range, use either the
718 appropriate HTML entity, e.g. \fB&eacute;\fR, or an SGML numeric
719 character reference, e.g. \fB&#253;\fR.  Use \fB&#64;\fR to insert a
720 literal \fB@\fR without falling foul of the expansion syntax.
721 .SS "Expansion Syntax"
722 Expansions are surrounded by at ("@") symbols take the form of a keyword
723 followed by zero or more arguments.  Arguments may either be quoted by curly
724 brackets ("{" and "}") or separated by colons (":").  Both kinds may be mixed
725 in a single expansion, though doing so seems likely to cause confusion.
726 The descriptions below contain suggested forms for each
727 expansion.
728 .PP
729 Leading and trailing whitespace in unquoted arguments is ignored, as is
730 whitespace (including newlines) following a close bracket ("}").
731 .PP
732 Arguments are recursively expanded before being interpreted, except for
733 \fITEMPLATE\fR arguments.  These are expanded (possibly more than once) to
734 produce the final expansion.
735 (More than once means the same argument being expanded more than once
736 for different tracks or whatever, not the result of the first
737 expansion itself being re-expanded.)
738 .PP
739 Strings constructed by expansions (i.e. not literally copied from the template
740 text) are SGML-quoted: any character which does not stand for itself in #PCDATA
741 or a quoted attribute value is replaced by the appropriate numeric character
742 reference.
743 .PP
744 The exception to this is that such strings are \fInot\fR quoted when they are
745 generated in the expansion of a parameter.
746 .PP
747 In the descriptions below, the current track means the one set by
748 \fB@playing@\fR, \fB@recent@\fR or \fB@queue@\fR, not the one that is playing.
749 If none of these expansions are in force then there is no current track.
750 \fIBOOL\fR should always be either \fBtrue\fR or \fBfalse\fR.
751 .SS "Expansions"
752 The following expansion keywords are defined:
753 .TP
754 .B @#{\fICOMMENT\fB}@
755 Ignored.
756 .TP
757 .B @action@
758 The current action.  This reports
759 .B manage
760 if the action is really
761 .B playing
762 but
763 .B mgmt=true
764 was set.
765 .TP
766 .B @and{\fIBOOL\fB}{\fIBOOL\fB}\fR...\fB@
767 If there are no arguments, or all the arguments are \fBtrue\fB, then expands to
768 \fBtrue\fR, otherwise to \fBfalse\fR.
769 .TP
770 .B @arg:\fINAME\fB@
771 Expands to the value of CGI argument \fINAME\fR.
772 .TP
773 .B @basename@
774 The basename of the current directory component, in \fB@navigate@\fR.
775 .TP
776 .B @basename{\fIPATH\fB}@
777 The base name part of \fIPATH\fR.
778 .TP
779 .B @choose{\fIWHAT\fB}{\fITEMPLATE\fB}@
780 Expands \fITEMPLATE\fR repeatedly for each file or directory under
781 \fB@arg:directory@\fR.
782 \fIWHAT\fR should be either \fBfile\fR or \fBdirectory\fR.
783 Use \fB@file@\fR to get the display name or filename of the file or
784 directory.
785 Usually used in \fBchoose.html\fR.
786 .TP
787 .B @dirname@
788 The directory of the current directory component, in \fB@navigate@\fR.
789 .TP
790 .B @dirname{\fIPATH\fB}@
791 The directory part of \fIPATH\fR.
792 .TP
793 .B @enabled@
794 Expands to \fBtrue\fR if play is currently enabled, otherwise to \fBfalse\fR.
795 .TP
796 .B @eq{\fIA\fB}{\fIB\fB}
797 Expands to \fBtrue\fR if \fIA\fR and \fIB\fR are identical, otherwise to
798 \fBfalse\fR.
799 .TP
800 .B @file@
801 Expands to the filename of the current file or directory, inside the template
802 argument to \fBchoose\fR.
803 .TP
804 .B @files{\fITEMPLATE\fB}
805 Expands \fITEMPLATE\fR once for each file indicated by the \fBdirectory\fR CGI
806 arg if it is present, or otherwise for the list of files counted by \fBfiles\fR
807 with names \fB0_file\fR, \fB1_file\fR etc.
808 .TP
809 .B @fullname@
810 The full path of the current directory component, in \fB@navigate@\fR.
811 .TP
812 .B @id@
813 The ID of the current track.
814 .TP
815 .B @if{\fIBOOL\fB}{\fITRUEPART\fB}{\fIFALSEPART\fB}@
816 If \fIBOOL\fR expands to \fBtrue\fR then expands to \fITRUEPART\fR, otherwise
817 to \fIFALSEPART\fR (which may be omitted).
818 .TP
819 .B @include:\fIPATH\fR@
820 Include the named file as if it were a template file.  If \fIPATH\fR
821 starts with a \fB/\fR then it is used as-is; otherwise, ".html" is
822 appended and the template path is searched.
823 .TP
824 .B @index@
825 Expands to the index of the current file in \fB@queue@\fR, \fB@recent@\fR or
826 \fB@files@\fR.
827 .TP
828 .B @isdirectories@
829 Expands to \fBtrue\fR if there are any directories in \fB@arg:directory@\fR,
830 otherwise to \fBfalse\fR.
831 .TP
832 .B @isfiles@
833 Expands to \fBtrue\fR if there are any files in \fB@arg:directory@\fR,
834 otherwise to \fBfalse\fR.
835 .TP
836 .B @isfirst@
837 Expands to \fBtrue\fR if this is the first repetition of a \fITEMPLATE\fR
838 argument in a loop (\fB@queue\fR or similar), otherwise to \fBfalse\fR.
839 .TP
840 .B @islast@
841 Expands to \fBtrue\fR if this is the last repetition of a \fITEMPLATE\fR in a
842 loop, otherwise to \fBfalse\fR.
843 .TP
844 .B @isnew@
845 Expands to \fBtrue\fR if the newly added tracks list has any tracks in it,
846 otherwise to \fBfalse\fR.
847 .TP
848 .B @isplaying@
849 Expands to \fBtrue\fR if a track is playing, otherwise to \fBfalse\fR.
850 .TP
851 .B @isqueue@
852 Expands to \fBtrue\fR if there are any tracks in the queue, otherwise to
853 \fBfalse\fR.
854 .TP
855 .B @isrecent@
856 Expands to \fBtrue\fR if the recently played list has any tracks in it,
857 otherwise to \fBfalse\fR.
858 .TP
859 .B @label:\fINAME\fR\fB@
860 Expands to the value of label \fINAME\fR.  See the shipped \fIoptions.labels\fR
861 file for full documentation of the labels used by the standard templates.
862 .TP
863 .B @length@
864 Expands to the length of the current track.
865 .TP
866 .B @navigate{\fIDIRECTORY\fB}{\fITEMPLATE\fB}
867 Expands \fITEMPLATE\fR for each component of \fIDIRECTORY\fR in turn.
868 Use \fB@dirname\fR and \fB@basename@\fR to get the components of the path to
869 each component.
870 Usually used in \fBchoose.html\fR.
871 .TP
872 .B @ne{\fIA\fB}{\fIB\fB}
873 Expands to \fBtrue\fR if \fIA\fR and \fIB\fR differ, otherwise to \fBfalse\fR.
874 .TP
875 .B @new{\fITEMPLATE\fB}
876 Expands \fITEMPLATE\fR for each track in the newly added tracks list, starting
877 with the most recent.  Used in \fBnew.html\fR.
878 .TP
879 .B @nfiles@
880 Expands to the number of files from \fB@files\fR (above).
881 .TP
882 .B @nonce@
883 Expands to a string including the time and process ID, intended to be
884 unique across invocations.
885 .TP
886 .B @not{\fIBOOL\fB}@
887 Expands to \fBfalse\fR if \fIBOOL\fR is \fBtrue\fR, otherwise to
888 \fBfalse\fR.
889 .TP
890 .B @or{\fIBOOL\fB}{\fIBOOL\fB}\fR...\fB@
891 If at least one argument is \fBtrue\fB, then expands to \fBtrue\fR, otherwise
892 to \fBfalse\fR.
893 .TP
894 .B @parity@
895 Expands to \fBeven\fR or \fBodd\fR depending on whether the current track is at
896 an even or odd position in \fB@queue@\fR, \fB@recent@\fR or \fB@files@\fR.
897 .TP
898 .B @part{\fICONTEXT\fB}{\fIPART\fB}@
899 Expands to track name part \fIPART\fR using context \fICONTEXT\fR for the
900 current track.  The context may be omitted and defaults
901 to \fBdisplay\fR.
902 .IP
903 The special context \fBshort\fR is equivalent to \fBdisplay\fR but limited to
904 the \fBshort_display\fR limit.
905 .TP
906 .B @part{\fICONTEXT\fB}{\fIPART\fB}{\fITRACK\fB}@
907 Expands to track name part \fIPART\fR using context \fICONTEXT\fR for
908 \fITRACK\fR.  In this usage the context may not be omitted.
909 .IP
910 The special context \fBshort\fR is equivalent to \fBdisplay\fR but limited to
911 the \fBshort_display\fR limit.
912 .TP
913 .B @paused@
914 Expands to \fBtrue\fR if the current track is paused, else \fBfalse\fR.
915 .TP
916 .B @playing{\fITEMPLATE\fB}@
917 Expands \fITEMPLATE\fR using the playing track as the current track.
918 .TP
919 .B @pref{\fITRACK\fB}{\fIKEY\fB}@
920 Expand to the track preference, or the empty string if it is not set.
921 .TP
922 .B @prefname@
923 Expands to the name of the current preference, in the template
924 argument of \fB@prefs@\fR.
925 .TP
926 .B @prefs{\fIFILE\fB}{\fITEMPLATE\fB}@
927 Expands \fITEMPLATE\fR repeatedly, for each preference of track
928 \fIFILE\fR.
929 Use \fB@prefname@\fR and \fB@prefvalue@\fR to get the name and value.
930 .TP
931 .B @prefvalue@
932 Expands to the value of the current preference, in the template
933 argument of \fB@prefs@\fR.
934 .TP
935 .B @queue{\fITEMPLATE\fB}@
936 Expands \fITEMPLATE\fR repeatedly using the each track on the queue in turn as
937 the current track.  The track at the head of the queue comes first.
938 .TP
939 .B @random-enabled@
940 Expands to \fBtrue\fR if random play is currently enabled, otherwise to
941 \fBfalse\fR.
942 .TP
943 .B @recent{\fITEMPLATE\fB}@
944 Expands \fITEMPLATE\fR repeatedly using the each recently played track in turn
945 as the current track.  The most recently played track comes first.
946 .TP
947 .B @resolve{\fITRACK\fB}@
948 Resolve aliases for \fITRACK\fR and expands to the result.
949 .TP
950 .B @search{\fIPART\fB}\fR[\fB{\fICONTEXT\fB}\fR]\fB{\fITEMPLATE\fB}@
951 Expands \fITEMPLATE\fR once for each group of search results that have
952 a common value of track part \fIPART\fR.
953 The groups are sorted by the value of the part.
954 .IP
955 .B @part@
956 and
957 .B @file@
958 within the template will apply to one of the tracks in the group.
959 .IP
960 If \fICONTEXT\fR is specified it should be either \fBsort\fR or \fBdisplay\fR,
961 and determines the context for \fIPART\fR.  The default is \fBsort\fR.  Usually
962 you want \fBdisplay\fR for everything except the title and \fBsort\fR for the
963 title.  If you use \fBsort\fR for artist and album then you are likely to get
964 strange effects.
965 .TP
966 .B @server-version@
967 Expands to the server's version string.
968 .TP
969 .B @shell{\fICOMMAND\fB}@
970 Expands to the output of \fICOMMAND\fR executed via the shell.  \fBsh\fR is
971 searched for using \fBPATH\fR.  If the command fails then this is logged but
972 otherwise ignored.
973 .TP
974 .B @state@
975 In \fB@queue@\fR and \fB@recent@\fR, expands to the state of the current
976 track.  Otherwise the empty string.  Known states are:
977 .RS
978 .TP 12
979 .B failed
980 The player terminated with nonzero status, but not because the track was
981 scratched.
982 .TP
983 .B isscratch
984 A scratch, in the queue.
985 .TP
986 .B no_player
987 No player could be found.
988 .TP
989 .B ok
990 Played successfully.
991 .TP
992 .B random
993 A randomly chosen track, in the queue.
994 .TP
995 .B scratched
996 This track was scratched.
997 .TP
998 .B unplayed
999 An explicitly queued track, in the queue.
1000 .RE
1001 .IP
1002 Some additional states only apply to playing tracks, so will never be seen in
1003 the queue or recently-played list:
1004 .RS
1005 .TP 12
1006 .B paused
1007 The track has been paused.
1008 .TP
1009 .B quitting
1010 Interrupted because the server is shutting down.
1011 .TP
1012 .B started
1013 This track is currently playing.
1014 .RE
1015 .TP
1016 .B @stats@
1017 Expands to the server statistics.
1018 .TP
1019 .B @thisurl@
1020 Expands to the URL of the current page.  Typically used in
1021 .B back
1022 arguments.  If there is a
1023 .B nonce
1024 argument then it is changed to a fresh value.
1025 .TP
1026 .B @track@
1027 The current track.
1028 .TP
1029 .B @trackstate{\fIPATH\fB}@
1030 Expands to the current track state: \fBplaying\fR if the track is actually
1031 playing now, \fBqueued\fR if it is queued or the empty string otherwise.
1032 .TP
1033 .B @transform{\fIPATH\fB}{\fITYPE\fB}{\fICONTEXT\fB}@
1034 Transform a path according to \fBtransform\fR (see above).
1035 \fIPATH\fR should be a raw filename (of a track or directory).
1036 \fITYPE\fR should be the transform type (e.g. \fItrack\fR or \fIdir\fR).
1037 \fICONTEXT\fR should be the context, and can be omitted (the default
1038 is \fBdisplay\fR).
1039 .TP
1040 .B @url@
1041 Expands to the canonical URL as defined in \fIpkgconfdir/config\fR.
1042 .TP
1043 .B @urlquote{\fISTRING\fB}@
1044 URL-quote \fISTRING\fR.
1045 .TP
1046 .B @version@
1047 Expands to \fBdisorder.cgi\fR's version string.
1048 .TP
1049 .B @volume:\fISPEAKER\fB@
1050 The volume on the left or right speaker.  \fISPEAKER\fR must be \fBleft\fR or
1051 \fBright\fR.
1052 .TP
1053 .B @when@
1054 When the current track was played (or when it is expected to be played, if it
1055 has not been played yet)
1056 .TP
1057 .B @who@
1058 Who submitted the current track.
1059 .SH "WEB OPTIONS"
1060 This is a file called \fIoptions\fR, searched for in the same manner
1061 as templates.  It includes numerous options for the control of the web
1062 interface.  The general syntax is the same as the main configuration
1063 file, except that it should be encoded using UTF-8 (though this might
1064 change to the current locale's character encoding; stick to ASCII to
1065 be safe).
1066 .PP
1067 The shipped \fIoptions\fR file includes four standard options files.
1068 In order, they are:
1069 .TP
1070 .I options.labels
1071 The default labels file.  You wouldn't normally edit this directly - instead
1072 supply your own commands in \fIoptions.user\fR.  Have a look at the shipped
1073 version of the file for documentation of labels used by the standard templates.
1074 .TP
1075 .I options.user
1076 A user options file.  Here you should put any overrides for the default
1077 labels and any extra labels required by your modified templates.
1078 .PP
1079 Valid directives are:
1080 .TP
1081 .B columns \fINAME\fR \fIHEADING\fR...
1082 Defines the columns used in \fB@playing@\fR and \fB@recent@\fB.  \fINAME\fR
1083 must be either \fBplaying\fR, \fBrecent\fR or \fBsearch\fR.
1084 \fIHEADING\fR...  is a list of
1085 heading names.  If a column is defined more than once then the last definitions
1086 is used.
1087 .IP
1088 The heading names \fBbutton\fR, \fBlength\fR, \fBwhen\fR and \fBwho\fR
1089 are built in.
1090 .TP
1091 .B include \fIPATH\fR
1092 Includes another file.  If \fIPATH\fR starts with a \fB/\fR then it is
1093 taken as is, otherwise it is searched for in the template path.
1094 .TP
1095 .B label \fINAME\fR \fIVALUE\fR
1096 Define a label.  If a label is defined more than once then the last definition
1097 is used.
1098 .SS Labels
1099 Some labels are defined inside \fBdisorder.cgi\fR and others by the
1100 default templates.  You can define your own labels and use them inside
1101 a template.
1102 .PP
1103 When an undefined label is expanded, if it has a dot in its name then
1104 the part after the final dot is used as its value.  Otherwise the
1105 whole name is used as the value.
1106 .PP
1107 Labels are no longer documented here, see the shipped \fIoptions.labels\fR file
1108 instead.
1109 .SH "REGEXP SUBSTITUTION RULES"
1110 Regexps are PCRE regexps, as defined in \fBpcrepattern\fR(3).  The
1111 only option used is \fBPCRE_UTF8\fR.  Remember that the configuration
1112 file syntax means you have to escape backslashes and quotes inside
1113 quoted strings.
1114 .PP
1115 In a \fISUBST\fR string the following sequences are interpreted
1116 specially:
1117 .TP
1118 .B $1 \fR... \fB$9
1119 These expand to the first to ninth bracketed subexpression.
1120 .TP
1121 .B $&
1122 This expands to the matched part of the subject string.
1123 .TP
1124 .B $$
1125 This expands to a single \fB$\fR symbol.
1126 .PP
1127 All other pairs starting with \fB$\fR are undefined (and might be used
1128 for something else in the future, so don't rely on the current
1129 behaviour.)
1130 .PP
1131 If \fBi\fR is present in \fIREFLAGS\fR then the match is case-independent.  If
1132 \fBg\fR is present then all matches are replaced, otherwise only the first
1133 match is replaced.
1134 .SH "ACTIONS"
1135 What the web interface actually does is terminated by the \fBaction\fR CGI
1136 argument.  The values listed below are supported.
1137 .PP
1138 Except as specified, all actions redirect back to the \fBplaying.html\fR
1139 template unless the \fBback\fR argument is present, in which case the URL it
1140 gives is used instead.
1141 .PP
1142 Redirection to \fBplaying.html\fR preserves \fBmgmt=true\fR if it is present.
1143 .TP 8
1144 .B "move"
1145 Move track \fBid\fR by offset \fBdelta\fR.
1146 .TP
1147 .B "play"
1148 Play track \fBfile\fR, or if that is missing then play all the tracks in
1149 \fBdirectory\fR.
1150 .TP
1151 .B "playing"
1152 Don't change any state, but instead compute a suitable refresh time and include
1153 that in an HTTP header.  Expands the \fBplaying.html\fR template rather than
1154 redirecting.
1155 .IP
1156 This is the default if \fBaction\fR is missing.
1157 .TP
1158 .B "random-disable"
1159 Disables random play.
1160 .TP
1161 .B "random-enable"
1162 Enables random play.
1163 .TP
1164 .B "disable"
1165 Disables play completely.
1166 .TP
1167 .B "enable"
1168 Enables play.
1169 .TP
1170 .B "pause"
1171 Pauses the current track.
1172 .TP
1173 .B "remove"
1174 Remove track \fBid\fR.
1175 .TP
1176 .B "resume"
1177 Resumes play after a pause.
1178 .TP
1179 .B "scratch"
1180 Scratch the playing track.  If \fBid\fR is present it must match the playing
1181 track.
1182 .TP
1183 .B "volume"
1184 Change the volume by \fBdelta\fR, or if that is missing then set it to the
1185 values of \fBleft\fR and \fBright\fR.  Expands to the \fBvolume.html\fR template
1186 rather than redirecting.
1187 .TP
1188 .B "prefs"
1189 Adjust preferences from the \fBprefs.html\fR template (which it then expands
1190 rather than redirecting).
1191 .IP
1192 If
1193 .B parts
1194 is set then the cooked interface is assumed.  The value of
1195 .B parts
1196 is used to determine which trackname preferences are set.  By default the
1197 .B display
1198 context is adjusted but this can be overridden with the
1199 .B context
1200 argument.  Also the
1201 .B random
1202 argument is checked; if it is set then random play is enabled for that track,
1203 otherwise it is disabled.
1204 .IP
1205 Otherwise if the
1206 .B name
1207 and
1208 .B value
1209 arguments are set then they are used to set a single preference.
1210 .IP
1211 Otherwise if just the
1212 .B name
1213 argument is set then that preference is deleted.
1214 .IP
1215 It is recommended that links to the \fBprefs\fR action use \fB@resolve@\fR to
1216 enure that the real track name is always used.  Otherwise if the preferences
1217 page is used to adjust a trackname_ preference, the alias may change, leading
1218 to the URL going stale.
1219 .TP
1220 .B "error"
1221 This action is generated automatically when an error occurs connecting to the
1222 server.  The \fBerror\fR label is set to an indication of what the error is.
1223 .SH "TRACK NAME PARTS"
1224 The traditional track name parts are \fBartist\fR, \fBalbum\fR and \fBtitle\fR,
1225 with the obvious intended meaning.  These are controlled by configuration and
1226 by \fBtrackname_\fR preferences.
1227 .PP
1228 In addition there are two built-in parts, \fBpath\fR which is the whole path
1229 name and \fBext\fR which is the filename extension, including the initial dot
1230 (or the empty string if there is not extension).
1231 .SH "SEE ALSO"
1232 \fBdisorder\fR(1), \fBsox\fR(1), \fBdisorderd\fR(8), \fBdisorder-dump\fR(8),
1233 \fBpcrepattern\fR(3)
1234 .\" Local Variables:
1235 .\" mode:nroff
1236 .\" fill-column:79
1237 .\" End: