chiark / gitweb /
Guess sox generation in configure script
[disorder] / doc / disorder_config.5.in
1 .\"
2 .\" Copyright (C) 2004-2008 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 3 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,
10 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 .\" GNU 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, see <http://www.gnu.org/licenses/>.
16 .\"
17 .TH disorder_config 5
18 .SH NAME
19 pkgconfdir/config - DisOrder jukebox configuration
20 .SH DESCRIPTION
21 The purpose of DisOrder is to organize and play digital audio files, under the
22 control of multiple users.
23 \fIpkgconfdir/config\fR is the primary configuration file; the web interface
24 uses a number of others (see \fBdisorder.cgi\fR(8)).
25 .SS Tracks
26 DisOrder can be configured with multiple collections of tracks, indexing them
27 by their filename, and picking players on the basis of filename patterns (for
28 instance, "*.mp3").
29 .PP
30 Although the model is of filenames, it is not inherent that there are
31 corresponding real files - merely that they can be interpreted by the chosen
32 player.
33 See \fBdisorder\fR(3) for more details about this.
34 .PP
35 Each track can have a set of preferences associated with it.
36 These are simple key-value pairs; they can be used for anything you
37 like, but a number of keys have specific meanings.
38 See \fBdisorder_preferences\fR(5) 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.
43 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 See \fBdisorder_preferences\fR(5) for more information.
52 .SS "Users And Access Control"
53 DisOrder distinguishes between multiple users.
54 This is for access control and reporting, not to provide different
55 views of the world: i.e. preferences and so on are global.
56 .PP
57 Each user has an associated set of rights which contorl which commands they may
58 execute.
59 Normally you would give all users most rights, and expect them to
60 cooperate (they are after all presumed to be in a shared sound environment).
61 .PP
62 The full set of rights are:
63 .TP
64 .B read
65 User can perform read-only operations
66 .TP
67 .B play
68 User can add tracks to the queue
69 .TP
70 .B "move any"
71 User can move any track
72 .TP
73 .B "move mine"
74 User can move their own tracks
75 .TP
76 .B "move random"
77 User can move randomly chosen tracks
78 .TP
79 .B "remove any"
80 User can remove any track
81 .TP
82 .B "remove mine"
83 User can remove their own tracks
84 .TP
85 .B "remove random"
86 User can remove randomly chosen tracks
87 .TP
88 .B "scratch any"
89 User can scratch any track
90 .TP
91 .B "scratch mine"
92 User can scratch their own tracks
93 .TP
94 .B "scratch random"
95 User can scratch randomly chosen tracks
96 .TP
97 .B volume
98 User can change the volume
99 .TP
100 .B admin
101 User can perform admin operations
102 .TP
103 .B rescan
104 User can initiate a rescan
105 .TP
106 .B register
107 User can register new users.
108 Normally only the
109 .B guest
110 user would have this right.
111 .TP
112 .B userinfo
113 User can edit their own userinfo
114 .TP
115 .B prefs
116 User can modify track preferences
117 .TP
118 .B "global prefs"
119 User can modify global preferences
120 .TP
121 .B pause
122 User can pause/resume 
123 .PP
124 Access control is entirely used-based.
125 If you configure DisOrder to listen for TCP/IP connections then it will
126 accept a connection from anywhere provided the right password is
127 available.
128 Passwords are never transmitted over TCP/IP connections in clear,
129 but everything else is.
130 The expected model is that host-based access control is imposed at
131 the network layer.
132 .SS "Web Interface"
133 The web interface is controlled by a collection of template files, one for each
134 kind of page, and a collection of option files.
135 These are split up and separate from the main configuration file to
136 .PP
137 See \fBdisorder.cgi\fR(8) for more information.
138 .SS "Searching And Tags"
139 Search strings contain a list of search terms separated by spaces.
140 A search term can either be a single word or a tag, prefixed with "tag:".
141 .PP
142 Search words are compared without regard to letter case or accents; thus, all
143 of the following will be considered to be equal to one another:
144 .PP
145 .nf
146   LATIN CAPITAL LETTER E
147   LATIN SMALL LETTER E
148   LATIN CAPITAL LETTER E WITH GRAVE
149   LATIN SMALL LETTER E WITH GRAVE
150   LATIN CAPITAL LETTER E plus COMBINING GRAVE ACCENT
151   LATIN SMALL LETTER E plus COMBINING GRAVE ACCENT
152 .fi
153 .PP
154 The same rules apply to tags but in addition leading and trailing whitespace is
155 disregarded and all whitespace sequences are treated as equal when they appear
156 as internal whitespace.
157 .PP
158 Where several tags are listed, for instance the tags preference for a track,
159 the tags are separated by commas.
160 Therefore tags may not contain commas.
161 .SH "CONFIGURATION FILE"
162 .SS "General Syntax"
163 Lines are split into fields separated by whitespace (space, tab, line
164 feed, carriage return, form feed).
165 Comments are started by the number sign ("#").
166 .PP
167 Fields may be unquoted (in which case they may not contain spaces and
168 may not start with a quotation mark or apostrophe) or quoted by either
169 quotation marks or apostrophes.
170 Inside quoted fields every character stands for itself, except that
171 a backslash can only appear as part of one of the following escape sequences:
172 .TP
173 .B \e\e
174 Backslash
175 .TP
176 .B \e"
177 Quotation mark
178 .\" "
179 .TP
180 .B \e'
181 Apostrophe
182 .TP
183 .B \en
184 Line feed
185 .PP
186 No other escape sequences are allowed.
187 .PP
188 Within any line the first field is a configuration command and any
189 further fields are parameters.
190 Lines with no fields are ignored.
191 .PP
192 After editing the config file use \fBdisorder reconfigure\fR to make
193 it re-read it.
194 If there is anything wrong with it the daemon will record a log
195 message and ignore the new config file.
196 (You should fix it before next terminating and restarting the daemon,
197 as it cannot start up without a valid config file.)
198 .SS "Configuration Files"
199 Configuration files are read in the following order:
200 .TP
201 .I pkgconfdir/config
202 .TP
203 .I pkgconfdir/config.private
204 Should be readable only by the jukebox group.
205 Not really useful any more and will be abolished in future.
206 .TP
207 .I ~\fRUSERNAME\fI/.disorder/passwd
208 Per-user client configuration.
209 Optional but if it exists must be readable only by the relevant user.
210 Would normally contain a \fBpassword\fR directive.
211 .TP
212 .I pkgconfdir/config.\fRUSERNAME
213 Per-user system-controlled client configuration.
214 Optional but if it exists must be readable only by the relevant user.
215 Would normally contain a \fBpassword\fR directive.
216 .IP
217 The prefererred location for per-user passwords is \fI~/.disorder/passwd\fR and
218 \fBdisorder authorize\fR writes there now.
219 .SS "Global Configuration"
220 .TP
221 .B home \fIDIRECTORY\fR
222 The home directory for state files.
223 Defaults to
224 .IR pkgstatedir .
225 The server will create this directory on startup if it does not exist.
226 .TP
227 .B plugins \fIPATH\fR
228 Adds a directory to the plugin path.
229 (This is also used by the web interface.)
230 .IP
231 Plugins are opened the first time they are required and never after,
232 so after changing a plugin you must restart the server before it is
233 guaranteed to take effect.
234 .IP
235 If
236 .B plugins
237 is used without arguments the plugin path is cleared.
238 .SS "Server Configuration"
239 .TP
240 .B alias \fIPATTERN\fR
241 Defines the pattern use construct virtual filenames from \fBtrackname_\fR
242 preferences.
243 .IP
244 Most characters stand for themselves, the exception being \fB{\fR which is used
245 to insert a track name part in the form \fB{\fIname\fB}\fR or
246 \fB{/\fIname\fB}\fR.
247 .IP
248 The difference is that the first form just inserts the name part while the
249 second prefixes it with a \fB/\fR if it is nonempty.
250 .IP
251 The pattern should not attempt to include the collection root, which is
252 automatically included, but should include the proper extension.
253 .IP
254 The default is \fB{/artist}{/album}{/title}{ext}\fR.
255 .TP
256 .B api \fINAME\fR
257 Selects the backend used to play sound and to set the volume.
258 The following options are available:
259 .RS
260 .TP
261 .B alsa
262 Use the ALSA API.
263 This is only available on Linux systems, on which it is the default.
264 .TP
265 .B coreaudio
266 Use Apple Core Audio.
267 This only available on OS X systems, on which it is the default.
268 .TP
269 .B oss
270 Use the OSS (/dev/dsp) API.
271 Not available on all platforms.
272 .TP
273 .B command
274 Execute a command.
275 This is the default if
276 .B speaker_command
277 is specified, or if no native is available.
278 .TP
279 .B network
280 Transmit audio over the network.
281 This is the default if \fBbroadcast\fR is specified.
282 You can use
283 .BR disorder-playrtp (1)
284 to receive and play the resulting stream on Linux and OS X.
285 .RE
286 .TP
287 .B authorization_algorithm \fIALGORITHM\fR
288 Defines the algorithm used to authenticate clients.
289 The valid options are sha1 (the default), sha256, sha384 and sha512.
290 See
291 .BR disorder_protocol (5)
292 for more details.
293 .TP
294 .B broadcast \fIADDRESS\fR \fIPORT\fR
295 Transmit sound data to \fIADDRESS\fR using UDP port \fIPORT\fR.
296 This implies \fBapi network\fR.
297 .IP
298 See also \fBmulticast_loop\fR and \fBmulticast_ttl\fR.
299 .TP
300 .B broadcast_from \fIADDRESS\fR \fIPORT\fR
301 Sets the (local) source address used by \fBbroadcast\fR.
302 .TP
303 .B channel \fICHANNEL\fR
304 The mixer channel that the volume control should use.
305 .IP
306 For \fBapi oss\fR the possible values are:
307 .RS
308 .TP 8
309 .B pcm
310 Output level for the audio device.
311 This is probably what you want and is the default.
312 .TP
313 .B speaker
314 Output level for the PC speaker, if that is connected to the sound card.
315 .TP
316 .B pcm2
317 Output level for alternative codec device.
318 .TP
319 .B vol
320 Master output level.
321 The OSS documentation recommends against using this, as it affects all
322 output devices.
323 .RE
324 .IP
325 You can also specify channels by number, if you know the right value.
326 .IP
327 For \fBapi alsa\fR, this is the name of the mixer control to use.
328 The default is \fBPCM\fR.
329 Use \fBamixer scontrols\fR or similar to get a full list.
330 .IP
331 For \fBapi coreaudio\fR, volume setting is not currently supported.
332 .TP
333 .B collection \fIMODULE\fR \fIENCODING\fR \fIROOT\fR
334 .TP
335 .B collection \fIMODULE\fR \fIROOT\fR
336 .TP
337 .B collection \fIROOT\fR
338 Define a collection of tracks.
339 .IP
340 \fIMODULE\fR defines which plugin module should be used for this
341 collection.
342 Use the supplied \fBfs\fR module for tracks that exist as ordinary
343 files in the filesystem.
344 If no \fIMODULE\fR is specified then \fBfs\fR is assumed.
345 .IP
346 \fIENCODING\fR defines the encoding of filenames in this collection.
347 For \fBfs\fR this would be the encoding you use for filenames.
348 Examples might be \fBiso\-8859\-1\fR or \fButf\-8\fR.
349 If no encoding is specified then the current locale's character encoding
350 is used.
351 .IP
352 NB that this default depends on the locale the server runs in, which is not
353 necessarily the same as that of ordinary users, depending how the system is
354 configured.
355 It's best to explicitly specify it to be certain.
356 .IP
357 \fIROOT\fR is the root in the filesystem of the filenames and is
358 passed to the plugin module.
359 It must be an absolute path and should not end with a "/".
360 .TP
361 .B cookie_key_lifetime \fISECONDS\fR
362 Lifetime of the signing key used in constructing cookies.  The default is one
363 week.
364 .TP
365 .B cookie_login_lifetime \fISECONDS\fR
366 Lifetime of a cookie enforced by the server.  When the cookie expires the user
367 will have to log in again even if their browser has remembered the cookie that
368 long.  The default is one day.
369 .TP
370 .B default_rights \fIRIGHTS\fR
371 Defines the set of rights given to new users.
372 The argument is a comma-separated list of rights.
373 For the possible values see
374 .B "Users And Access Control"
375 above.
376 .IP
377 The default is to allow everything except \fBadmin\fR and \fBregister\fR
378 (modified in legacy configurations by the obsolete \fBrestrict\fR directive).
379 .TP
380 .B device \fINAME\fR
381 Sound output device.
382 .IP
383 For \fBapi oss\fR this is the path to the device to use.
384 If it is set to \fBdefault\fR then \fI/dev/dsp\fR and \fI/dev/audio\fR
385 will be tried.
386 .IP
387 For \fBapi alsa\fR this is the device name to use.
388 .IP
389 For \fBapi coreaudio\fR this is currently ignored.
390 .IP
391 The default is \fBdefault\fR, which is intended to map to whatever the system's
392 default is.
393 .TP
394 .B gap \fISECONDS\fR
395 Specifies the number of seconds to leave between tracks.
396 The default is 0.
397 .IP
398 NB this option currently DOES NOT WORK.  If there is genuine demand it might be
399 reinstated.
400 .TP
401 .B history \fIINTEGER\fR
402 Specifies the number of recently played tracks to remember (including
403 failed tracks and scratches).
404 .TP
405 .B listen \fR[\fIHOST\fR] \fISERVICE\fR
406 Listen for connections on the address specified by \fIHOST\fR and port
407 specified by \fISERVICE\fR.
408 If \fIHOST\fR is omitted then listens on all local addresses.
409 .IP
410 Normally the server only listens on a UNIX domain socket.
411 .TP
412 .B lock yes\fR|\fBno
413 Determines whether the server locks against concurrent operation.
414 Default is \fByes\fR.
415 There is no good reason to set this to \fBno\fR and the option will
416 probably be removed in a future version.
417 .TP
418 .B mixer \fIDEVICE\fR
419 The mixer device name, if it needs to be specified separately from
420 \fBdevice\fR.
421 .IP
422 For \fBapi oss\fR this should be the path to the mixer device and the default
423 is \fI/dev/mixer\fR.
424 .IP
425 For \fBapi alsa\fR, this is the index of the mixer control to use.
426 The default is 0.
427 .IP
428 For \fBapi coreaudio\fR, volume setting is not currently supported.
429 .TP
430 .B multicast_loop yes\fR|\fBno
431 Determines whether multicast packets are loop backed to the sending host.
432 The default is \fByes\fR.
433 This only applies if \fBapi\fR is set to \fBnetwork\fR and \fBbroadcast\fR
434 is actually a multicast address.
435 .TP
436 .B multicast_ttl \fIHOPS\fR
437 Set the maximum number of hops to send multicast packets.
438 This only applies if \fBapi\fR is set to \fBnetwork\fR and
439 \fBbroadcast\fR is actually a multicast address.
440 The default is 1.
441 .TP
442 .B namepart \fIPART\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
443 Determines how to extract trackname part \fIPART\fR from a 
444 track name (with the collection root part removed).
445 Used in \fB@recent@\fR, \fB@playing@\fR and \fB@search@\fR.
446 .IP
447 Track names can be different in different contexts.
448 For instance the sort string might include an initial track number,
449 but this would be stripped for the display string.
450 \fICONTEXT\fR should be a glob pattern matching the
451 contexts in which this directive will be used.
452 .IP
453 Valid contexts are \fBsort\fR and \fBdisplay\fR.
454 .IP
455 All the \fBnamepart\fR directives are considered in order.
456 The first directive for the right part, that matches the desired context,
457 and with a \fIREGEXP\fR that
458 matches the track is used, and the value chosen is constructed from
459 \fISUBST\fR according to the substitution rules below.
460 .IP
461 Note that searches use the raw track name and \fBtrackname_\fR preferences but
462 not (currently) the results of \fBnamepart\fR, so generating words via this option
463 that aren't in the original track name will lead to confusing results.
464 .IP
465 If you supply no \fBnamepart\fR directives at all then a default set will be
466 supplied automatically.
467 But if you supply even one then you must supply all of them.
468 The defaults are equivalent to:
469 .PP
470 .nf
471 namepart title  "/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
472 namepart title  "/([^/]+)\\.[a-zA-Z0-9]+$"                  $1 sort
473 namepart album  "/([^/]+)/[^/]+$"                          $1 *
474 namepart artist "/([^/]+)/[^/]+/[^/]+$"                    $1 *
475 namepart ext    "(\\.[a-zA-Z0-9]+)$"                        $1 *
476 .fi
477 .TP
478 .B new_bias \fIWEIGHT\fR
479 The weight for new tracks.
480 The default is 450000, i.e. recently added tracks are a fifty times as likely
481 to be picked as normal.
482 .TP
483 .B new_bias_age \fISECONDS\fR
484 The maximum age of tracks that \fBnew_bias\fR applies to, in seconds.
485 The default is one week.
486 .TP
487 .B new_max \fIMAX\fR
488 The maximum number of tracks to list when reporting newly noticed tracks.
489 The default is 100.
490 .TP
491 .B nice_rescan \fIPRIORITY\fR
492 Set the recan subprocess priority.
493 The default is 10.
494 .IP
495 (Note that higher values mean the process gets less CPU time; UNIX priority
496 values are backwards.)
497 .TP
498 .B nice_server \fIPRIORITY\fR
499 Set the server priority.
500 This is applied to the server at startup time (and not when you reload
501 configuration).
502 The server does not use much CPU itself but this value is inherited
503 by programs it executes.
504 If you have limited CPU then it might help to set this to a small
505 negative value.
506 The default is 0.
507 .TP
508 .B nice_speaker \fIPRIORITY\fR
509 Set the speaker process priority.
510 This is applied to the speaker process at startup time (and not when
511 you reload the configuration).
512 The speaker process is not massively CPU intensive by today's
513 standards but depends on reasonably timely scheduling.
514 If you have limited CPU then it might help to set this to a small
515 negative value.
516 The default is 0.
517 .TP
518 .B noticed_history
519 The maximum days that a track can survive in the database of newly added
520 tracks.
521 The default is 31.
522 .TP
523 .B player \fIPATTERN\fR \fIMODULE\fR [\fIOPTIONS.. [\fB\-\-\fR]] \fIARGS\fR...
524 Specifies the player for files matching the glob \fIPATTERN\fR.
525 \fIMODULE\fR specifies which plugin module to use.
526 .IP
527 The following options are supported:
528 .RS
529 .TP
530 .B \-\-wait\-for\-device\fR[\fB=\fIDEVICE\fR]
531 Waits (for up to a couple of seconds) for the default, or specified, libao
532 device to become openable.
533 .TP
534 .B \-\-
535 Defines the end of the list of options.
536 Needed if the first argument to the plugin starts with a "\-".
537 .RE
538 .IP
539 The following are the standard modules:
540 .RS
541 .TP
542 .B exec \fICOMMAND\fR \fIARGS\fR...
543 The command is executed via \fBexecvp\fR(3), not via the shell.
544 The \fBPATH\fR environment variable is searched for the executable if it is not
545 an absolute path.
546 The command is expected to know how to open its own sound device.
547 .TP
548 .B execraw \fICOMMAND\fR \fIARGS\fR...
549 Identical to the \fBexec\fR except that the player is expected to use the
550 DisOrder raw player protocol.
551 .BR disorder-decode (8)
552 can decode several common audio file formats to this format.
553 If your favourite format is not supported, but you have a player
554 which uses libao, there is also a libao driver which supports this format;
555 see below for more information about this.
556 .TP
557 .B shell \fR[\fISHELL\fR] \fICOMMAND\fR
558 The command is executed using the shell.
559 If \fISHELL\fR is specified then that is used, otherwise \fBsh\fR will be used.
560 In either case the \fBPATH\fR environment variable is searched for the shell
561 executable if it is not an absolute path.
562 The track name is stored in the environment variable
563 \fBTRACK\fR.
564 .IP
565 Be careful of the interaction between the configuration file quoting rules and
566 the shell quoting rules.
567 .RE
568 .IP
569 If multiple player commands match a track then the first match is used.
570 .IP
571 For the server to be able to calculate track lengths, there should be a
572 .B tracklength
573 command corresponding to each
574 .B player
575 command.
576 .IP
577 If
578 .B player
579 is used without arguments, the list of players is cleared.
580 .TP
581 .B prefsync \fISECONDS\fR
582 The interval at which the preferences log file will be synchronised.
583 Defaults to 3600, i.e. one hour.
584 .TP
585 .B queue_pad \fICOUNT\fR
586 The target size of the queue.
587 If random play is enabled then randomly picked tracks will be added until
588 the queue is at least this big.
589 The default is 10.
590 .TP
591 .B reminder_interval \fISECONDS\fR
592 The minimum number of seconds that must elapse between password reminders.
593 The default is 600, i.e. 10 minutes.
594 .TP
595 .B remote_userman yes\fR|\fBno
596 User management over TCP connection is only allowed if this is set to
597 \fByes\fR.  By default it is set to \fBno\fR.
598 .TP
599 .B replay_min \fISECONDS\fR
600 The minimum number of seconds that must elapse after a track has been played
601 before it can be picked at random.  The default is 8 hours.  If this is set to
602 0 then there is no limit, though current \fBdisorder-choose\fR will not pick
603 anything currently listed in the recently-played list.
604 .TP
605 .B sample_format \fIBITS\fB/\fIRATE\fB/\fICHANNELS
606 Describes the sample format expected by the \fBspeaker_command\fR (below).
607 The components of the format specification are as follows:
608 .RS
609 .TP 10
610 .I BITS
611 The number of bits per sample.
612 Optionally, may be suffixed by \fBb\fR or \fBl\fR for big-endian and
613 little-endian words.
614 If neither is used the native byte order is assumed.
615 .TP
616 .I RATE
617 The number of samples per second.
618 .TP
619 .I CHANNELS
620 The number of channels.
621 .PP
622 The default is
623 .BR 16/44100/2 .
624 .PP
625 With the
626 .B network
627 backend the sample format is forced to
628 .B 16b/44100/2
629 and with the
630 .B coreaudio
631 backend it is forced to
632 .BR 16/44100/2 ,
633 in both cases regardless of what is specified in the configuration file.
634 .RE
635 .TP
636 .B signal \fINAME\fR
637 Defines the signal to be sent to track player process groups when tracks are
638 scratched.
639 The default is \fBSIGKILL\fR.
640 .IP
641 Signals are specified by their full C name, i.e. \fBSIGINT\fR and not \fBINT\fR
642 or \fBInterrupted\fR or whatever.
643 .TP
644 .B sox_generation \fB0\fR|\fB1
645 Determines whether calls to \fBsox\fR(1) should use \fB\-b\fR, \fB\-x\fR, etc (if
646 the generation is 0) or \fB\-\fIbits\fR, \fB\-L\fR etc (if it is 1).
647 See the documentation for your installed copy of \fBsox\fR to determine
648 which you need.
649 The default is set according to the version of sox found when DisOrder was
650 built.
651 If you run on a system with a different version of sox, you will need to
652 set this option.
653 .TP
654 .B speaker_backend \fINAME
655 This is an alias for \fBapi\fR; see above.
656 .TP
657 .B speaker_command \fICOMMAND
658 Causes the speaker subprocess to pipe audio data into shell command
659 \fICOMMAND\fR, rather than writing to a local sound card.
660 The sample format is determine by
661 .B sample_format
662 above.
663 .IP
664 Note that if the sample format is wrong then
665 .BR sox (1)
666 is invoked to translate it.
667 If
668 .B sox
669 is not installed then this will not work.
670 .TP
671 .B scratch \fIPATH\fR
672 Specifies a scratch.
673 When a track is scratched, a scratch track is played at random.
674 Scratches are played using the same logic as other tracks.
675 .IP
676 At least for the time being, path names of scratches must be encoded using
677 UTF-8 (which means that ASCII will do).
678 .IP
679 If \fBscratch\fR is used without arguments then the list of scratches is
680 cleared.
681 .TP
682 .B stopword \fIWORD\fR ...
683 Specifies one or more stopwords that should not take part in searches
684 over track names.
685 .IP
686 If \fBstopword\fR is used without arguments then the list of stopwords is
687 cleared.
688 .IP
689 There is a default set of stopwords built in, but this option can be used to
690 augment or replace that list.
691 .TP
692 .B tracklength \fIPATTERN\fR \fIMODULE\fR
693 Specifies the module used to calculate the length of files matching
694 \fIPATTERN\fR.
695 \fIMODULE\fR specifies which plugin module to use.
696 .IP
697 If \fBtracklength\fR is used without arguments then the list of modules is
698 cleared.
699 .TP
700 .B user \fIUSERNAME\fR
701 Specifies the user to run as.
702 Only makes sense if invoked as root (or the target user).
703 .SS "Client Configuration"
704 These options would normally be used in \fI~\fRUSERNAME\fI/.disorder/passwd\fR
705 or
706 \fIpkgconfdir/config.\fRUSERNAME.
707 .TP
708 .B connect \fIHOST SERVICE\fR
709 Connect to the address specified by \fIHOST\fR and port specified by
710 \fISERVICE\fR.
711 .TP
712 .B password \fIPASSWORD\fR
713 Specify password.
714 .TP
715 .B username \fIUSERNAME\fR
716 Specify username.
717 The default is inferred from the current UID.
718 .SS "Web Interface Configuration"
719 .\" TODO this section is misnamed really...
720 .TP
721 .B mail_sender \fIADDRESS\fR
722 The email address that appears in the From: field of any mail messages sent by
723 the web interface.
724 This must be set if you have online registration enabled.
725 .TP
726 .B refresh \fISECONDS\fR
727 Specifies the maximum refresh period in seconds.
728 Default 15.
729 .TP
730 .B sendmail \fIPATH\fR
731 The path to the Sendmail executable.
732 This must support the \fB-bs\fR option (Postfix, Exim and Sendmail should all
733 work).
734 The default is the sendmail executable found at compile time.
735 .TP
736 .B short_display \fICHARACTERS\fR
737 Defines the maximum number of characters to include in a \fBshort\fR name
738 part.
739 Default 30.
740 .TP
741 .B smtp_server \fIHOSTNAME\fR
742 The hostname (or address) of the SMTP server to use for sending mail.
743 The default is 127.0.0.1.
744 If \fBsendmail\fR is set then that is used instead.
745 .TP
746 .B transform \fITYPE\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
747 Determines how names are sorted and displayed in track choice displays.
748 .IP
749 \fITYPE\fR is the type of transformation; usually \fBtrack\fR or
750 \fBdir\fR but you can define your own.
751 .IP
752 \fICONTEXT\fR is a glob pattern matching the context.
753 Standard contexts are \fBsort\fR (which determines how directory names
754 are sorted) and \fBdisplay\fR (which determines how they are displayed).
755 Again, you can define your own.
756 .IP
757 All the \fBtransform\fR directives are considered in order.
758 If the \fITYPE\fR, \fIREGEXP\fR and the \fICONTEXT\fR match
759 then a new track name is constructed from
760 \fISUBST\fR according to the substitution rules below.
761 If several match then each is executed in order.
762 .IP
763 If you supply no \fBtransform\fR directives at all then a default set will be
764 supplied automatically.
765 But if you supply even one then you must supply all of them.
766 The defaults are:
767 .PP
768 .nf
769 transform track "^.*/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
770 transform track "^.*/([^/]+)\\.[a-zA-Z0-9]+$"        $1 sort
771 transform dir   "^.*/([^/]+)$"                      $1 *
772 transform dir   "^(the) ([^/]*)"                    "$2 $1" sort i
773 transform dir   "[[:punct:]]"                       "" sort g
774 .fi
775 .TP
776 .B url \fIURL\fR
777 Specifies the URL of the web interface.
778 This URL will be used in generated web pages.
779 The default is inferred at runtime, so this option no
780 longer needs to be specified.
781 .IP
782 This must be the full URL, e.g. \fBhttp://myhost/cgi-bin/jukebox\fR and not
783 \fB/cgi-bin/jukebox\fR.
784 .SH "GLOBAL PREFERENCES"
785 .SH "LIBAO DRIVER"
786 .SS "Raw Protocol Players"
787 Raw protocol players are expected to use the \fBdisorder\fR libao driver.
788 Programs that use libao generally have command line options to select the
789 driver and pass options to it.
790 .SS "Driver Options"
791 The known driver options are:
792 .TP
793 .B fd
794 The file descriptor to write to.
795 If this is not specified then the driver looks like the environment
796 variable \fBDISORDER_RAW_FD\fR.
797 If that is not set then the default is 1 (i.e. standard output).
798 .TP
799 .B fragile
800 If this is set to a nonzero value then the driver will call \fB_exit\fR(2) if a
801 write to the output file descriptor fails.
802 This is a workaround for buggy players such as \fBogg123\fR that ignore
803 write errors.
804 .SH "REGEXP SUBSTITUTION RULES"
805 Regexps are PCRE regexps, as defined in \fBpcrepattern\fR(3).
806 The only option used is \fBPCRE_UTF8\fR.
807 Remember that the configuration file syntax means you have to
808 escape backslashes and quotes inside quoted strings.
809 .PP
810 In a \fISUBST\fR string the following sequences are interpreted
811 specially:
812 .TP
813 .B $1 \fR... \fB$9
814 These expand to the first to ninth bracketed subexpression.
815 .TP
816 .B $&
817 This expands to the matched part of the subject string.
818 .TP
819 .B $$
820 This expands to a single \fB$\fR symbol.
821 .PP
822 All other pairs starting with \fB$\fR are undefined (and might be used
823 for something else in the future, so don't rely on the current
824 behaviour.)
825 .PP
826 If \fBi\fR is present in \fIREFLAGS\fR then the match is case-independent.
827 If \fBg\fR is present then all matches are replaced, otherwise only the first
828 match is replaced.
829 .SH "TRACK NAME PARTS"
830 The traditional track name parts are \fBartist\fR, \fBalbum\fR and \fBtitle\fR,
831 with the obvious intended meaning.
832 These are controlled by configuration and by \fBtrackname_\fR preferences.
833 .PP
834 In addition there are two built-in parts, \fBpath\fR which is the whole path
835 name and \fBext\fR which is the filename extension, including the initial dot
836 (or the empty string if there is not extension).
837 .SH "SEE ALSO"
838 \fBdisorder\fR(1), \fBsox\fR(1), \fBdisorderd\fR(8), \fBdisorder\-dump\fR(8),
839 \fBpcrepattern\fR(3), \fBdisorder_templates\fR(5), \fBdisorder_actions\fR(5),
840 \fBdisorder.cgi\fR(8), \fBdisorder_preferences\fR(5)
841 .\" Local Variables:
842 .\" mode:nroff
843 .\" fill-column:79
844 .\" End: