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