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