chiark / gitweb /
Merge playlist branch against trunk to date.
[disorder] / doc / disorder_protocol.5.in
CommitLineData
460b9539 1.\"
964e027d 2.\" Copyright (C) 2004-2008 Richard Kettlewell
460b9539 3.\"
e7eb3a27 4.\" This program is free software: you can redistribute it and/or modify
460b9539 5.\" it under the terms of the GNU General Public License as published by
e7eb3a27 6.\" the Free Software Foundation, either version 3 of the License, or
460b9539 7.\" (at your option) any later version.
e7eb3a27
RK
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.\"
460b9539 14.\" You should have received a copy of the GNU General Public License
e7eb3a27 15.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
460b9539 16.\"
17.TH disorder_protocol 5
18.SH NAME
19disorder_protocol \- DisOrder communication protocol
20.SH DESCRIPTION
21The DisOrder client and server communicate via the protocol described
22in this man page.
23.PP
c0c23a60
RK
24The protocol is liable to change without notice.
25You are recommended to check the implementation before believing this document.
460b9539 26.SH "GENERAL SYNTAX"
c0c23a60
RK
27Everything is encoded using UTF-8.
28See
f9635e06
RK
29.B "CHARACTER ENCODING"
30below for more detail on character encoding issues.
460b9539 31.PP
f9635e06
RK
32Commands and responses consist of a line perhaps followed (depending on the
33command or response) by a body.
460b9539 34.PP
35The line syntax is the same as described in \fBdisorder_config\fR(5) except
36that comments are prohibited.
37.PP
38Bodies borrow their syntax from RFC821; they consist of zero or more ordinary
39lines, with any initial full stop doubled up, and are terminated by a line
40consisting of a full stop and a line feed.
fc80bbcd
RK
41.PP
42Commands only have a body if explicitly stated below.
43If they do have a body then the body should always be sent immediately;
44unlike (for instance) the SMTP "DATA" command there is no intermediate step
45where the server asks for the body to be sent.
46.PP
47Replies also only have a body if stated below.
48The presence of a reply body can always be inferred from the response code;
49if the last digit is a 3 then a body is present, otherwise it is not.
460b9539 50.SH COMMANDS
51Commands always have a command name as the first field of the line; responses
c0c23a60
RK
52always have a 3-digit response code as the first field.
53See below for more details about this field.
460b9539 54.PP
55All commands require the connection to have been already authenticated unless
c0c23a60
RK
56stated otherwise.
57If not stated otherwise, the \fBread\fR right is sufficient to execute
58the command.
460b9539 59.TP
0f55e905 60.B adduser \fIUSERNAME PASSWORD \fR[\fIRIGHTS\fR]
c0c23a60
RK
61Create a new user with the given username and password.
62The new user's rights list can be specified; if it is not
63then the \fBdefault_rights\fR setting applies instead.
64Requires the \fBadmin\fR right, and only works on local
0f55e905 65connections.
eb5dc014 66.TP
d42e98ca
RK
67.B adopt \fIID\fR
68Adopts a randomly picked track, leaving it in a similar state to if it was
69picked by this user. Requires the \fBplay\fR right.
70.TP
460b9539 71.B allfiles \fIDIRECTORY\fR [\fIREGEXP\fR]
5818980a 72List all the files and directories in \fIDIRECTORY\fR in a response body.
460b9539 73If \fIREGEXP\fR is present only matching files and directories are returned.
74.TP
ba39faf6 75.B confirm \fICONFIRMATION
c0c23a60
RK
76Confirm user registration.
77\fICONFIRMATION\fR is as returned from \fBregister\fR below.
78This command can be used without logging in.
ba39faf6 79.TP
eb5dc014 80.B cookie \fICOOKIE
0d350ff0 81Log a user back in using a cookie created with \fBmake\-cookie\fR.
c0c23a60 82The response contains the username.
eb5dc014
RK
83.TP
84.B deluser \fIUSERNAME
c0c23a60
RK
85Delete the named user.
86Requires the \fBadmin\fR right, and only works on local connections.
460b9539 87.TP
88.B dirs \fIDIRECTORY\fR [\fIREGEXP\fR]
5818980a 89List all the directories in \fIDIRECTORY\fR in a response body.
460b9539 90If \fIREGEXP\fR is present only matching directories are returned.
91.TP
92.B disable \fR[\fBnow\fR]
c0c23a60
RK
93Disable further playing.
94If the optional \fBnow\fR argument is present then the current track
95is stopped.
96Requires the \fBglobal prefs\fR right.
eb5dc014
RK
97.TP
98.B edituser \fIUSERNAME PROPERTY VALUE
c0c23a60
RK
99Set a user property.
100With the \fBadmin\fR right any username and property may be specified.
101Otherwise the \fBuserinfo\fR right is required and only the
eb5dc014 102\fBemail\fR and \fBpassword\fR properties may be set.
0517868c
RK
103.IP
104User properties are syntax-checked before setting. For instance \fBemail\fR
105must contain an "@" sign or you will get an error. (Setting an empty value for
106\fBemail\fR is allowed and removes the property.)
460b9539 107.TP
108.B enable
c0c23a60
RK
109Re-enable further playing, and is the opposite of \fBdisable\fR.
110Requires the \fBglobal prefs\fR right.
460b9539 111.TP
112.B enabled
c0c23a60
RK
113Report whether playing is enabled.
114The second field of the response line will be \fByes\fR or \fBno\fR.
460b9539 115.TP
116.B exists \fITRACK\fR
c0c23a60
RK
117Report whether the named track exists.
118The second field of the response line will be \fByes\fR or \fBno\fR.
460b9539 119.TP
120.B files \fIDIRECTORY\fR [\fIREGEXP\fR]
5818980a 121List all the files in \fIDIRECTORY\fR in a response body.
460b9539 122If \fIREGEXP\fR is present only matching files are returned.
123.TP
124.B get \fITRACK\fR \fIPREF\fR
c0c23a60
RK
125Getsa preference value.
126On success the second field of the response line will have the value.
fb1bc1f5
RK
127.IP
128If the track or preference do not exist then the response code is 555.
460b9539 129.TP
0d350ff0 130.B get\-global \fIKEY\fR
460b9539 131Get a global preference.
fb1bc1f5
RK
132.IP
133If the preference does not exist then the response code is 555.
460b9539 134.TP
135.B length \fITRACK\fR
c0c23a60
RK
136Get the length of the track in seconds.
137On success the second field of the response line will have the value.
460b9539 138.TP
139.B log
c0c23a60
RK
140Send event log messages in a response body.
141The command will never terminate.
142Any further data sent to the server will be discarded (explicitly;
143i.e. it will not accumulate in a buffer somewhere).
460b9539 144.IP
145See \fBEVENT LOG\fR below for more details.
146.TP
0d350ff0 147.B make\-cookie
eb5dc014
RK
148Returns an opaque string that can be used by the \fBcookie\fR command to log
149this user back in on another connection (until the cookie expires).
150.TP
460b9539 151.B move \fITRACK\fR \fIDELTA\fR
c0c23a60
RK
152Move a track in the queue.
153The track may be identified by ID (preferred) or name (which might cause
154confusion if it's there twice).
155\fIDELTA\fR should be an negative or positive integer and indicates how
156many steps towards the head of the queue the track should be moved.
eb5dc014
RK
157.IP
158Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights
159depending on how the track came to be added to the queue.
460b9539 160.TP
161.B moveafter \fITARGET\fR \fIID\fR ...
c0c23a60
RK
162Move all the tracks in the \fIID\fR list after ID \fITARGET\fR.
163If \fITARGET\fR is the empty string then the listed tracks are put
164at the head of the queue.
165If \fITARGET\fR is listed in the ID list then the tracks are moved
460b9539 166to just after the first non-listed track before it, or to the head if there is
167no such track.
eb5dc014
RK
168.IP
169Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights
170depending on how the tracks came to be added to the queue.
460b9539 171.TP
2a10b70b 172.B new \fR[\fIMAX\fR]
c0c23a60
RK
173Send the most recently added \fIMAX\fR tracks in a response body.
174If the argument is ommitted, the \fBnew_max\fR most recent tracks are
175listed (see \fBdisorder_config\fR(5)).
2a10b70b 176.TP
7858930d 177.B nop
c0c23a60
RK
178Do nothing.
179Used by
7858930d 180.BR disobedience (1)
c0c23a60
RK
181as a keepalive measure.
182This command does not require authentication.
7858930d 183.TP
460b9539 184.B part \fITRACK\fR \fICONTEXT\fI \fIPART\fR
c0c23a60
RK
185Get a track name part.
186Returns an empty string if a name part cannot be constructed.
460b9539 187.IP
188.I CONTEXT
189is one of
190.B sort
191or
192.B display
193and
194.I PART
195is usually one of
196.BR artist ,
197.B album
198or
199.BR title .
200.TP
201.B pause
c0c23a60
RK
202Pause the current track.
203Requires the \fBpause\fR right.
460b9539 204.TP
205.B play \fITRACK\fR
c0c23a60
RK
206Add a track to the queue.
207The response contains the queue ID of the track.
eb5dc014 208Requires the \fBplay\fR right.
460b9539 209.TP
210.B playing
5818980a 211Report what track is playing.
460b9539 212.IP
213If the response is \fB252\fR then the rest of the response line consists of
214track information (see below).
215.IP
216If the response is \fB259\fR then nothing is playing.
217.TP
fc80bbcd
RK
218.B playlist-delete \fIPLAYLIST\fR
219Delete a playlist.
220Requires permission to modify that playlist and the \fBplay\fR right.
221.TP
222.B playlist-get \fIPLAYLIST\fR
223Get the contents of a playlist, in a response body.
224Requires permission to read that playlist and the \fBread\fR right.
225.TP
226.B playlist-get-share \fIPLAYLIST\fR
227Get the sharing status of a playlist.
228The result will be \fBpublic\fR, \fBprivate\fR or \fBshared\fR.
229Requires permission to read that playlist and the \fBread\fR right.
230.TP
231.B playlist-lock \fIPLAYLIST\fR
232Lock a playlist.
233Requires permission to modify that playlist and the \fBplay\fR right.
234Only one playlist may be locked at a time on a given connection and the lock
235automatically expires when the connection is closed.
236.TP
237.B playlist-set \fIPLAYLIST\fR
238Set the contents of a playlist.
239The new contents should be supplied in a command body.
240Requires permission to modify that playlist and the \fBplay\fR right.
241The playlist must be locked.
242.TP
243.B playlist-set-share \fIPLAYLIST\fR \fISHARE\fR
244Set the sharing status of a playlist to
245\fBpublic\fR, \fBprivate\fR or \fBshared\fR.
246Requires permission to modify that playlist and the \fBplay\fR right.
247.TP
248.B playlist-unlock\fR
249Unlock the locked playlist.
250.TP
251.B playlists
252List all playlists that this connection has permission to read.
253Requires the \fBread\fR right.
254.TP
460b9539 255.B prefs \fBTRACK\fR
5818980a 256Send back the preferences for \fITRACK\fR in a response body.
460b9539 257Each line of the response has the usual line syntax, the first field being the
258name of the pref and the second the value.
259.TP
260.B queue
5818980a 261Send back the current queue in a response body, one track to a line, the track
c0c23a60
RK
262at the head of the queue (i.e. next to be be played) first.
263See below for the track information syntax.
460b9539 264.TP
0d350ff0 265.B random\-disable
c0c23a60
RK
266Disable random play (but don't stop the current track).
267Requires the \fBglobal prefs\fR right.
460b9539 268.TP
0d350ff0 269.B random\-enable
c0c23a60
RK
270Enable random play.
271Requires the \fBglobal prefs\fR right.
460b9539 272.TP
0d350ff0 273.B random\-enabled
c0c23a60
RK
274Report whether random play is enabled.
275The second field of the response line will be \fByes\fR or \fBno\fR.
460b9539 276.TP
277.B recent
5818980a 278Send back the current recently-played list in a response body, one track to a
c0c23a60
RK
279line, the track most recently played last.
280See below for the track information syntax.
460b9539 281.TP
282.B reconfigure
c0c23a60
RK
283Request that DisOrder reconfigure itself.
284Requires the \fBadmin\fR right.
460b9539 285.TP
90ad6c6e 286.B register \fIUSERNAME PASSWORD EMAIL
c0c23a60
RK
287Register a new user.
288Requires the \fBregister\fR right.
289The result contains a confirmation string; the user will be be able
290to log in until this has been presented back to the server via the
291\fBconfirm\fR command.
ba39faf6 292.TP
90ad6c6e
RK
293.B reminder \fIUSERNAME\fR
294Send a password reminder to user \fIUSERNAME\fR.
c0c23a60
RK
295If the user has no valid email address, or no password, or a
296reminder has been sent too recently, then no reminder will be sent.
6207d2f3 297.TP
460b9539 298.B remove \fIID\fR
c0c23a60
RK
299Remove the track identified by \fIID\fR.
300Requires one of the \fBremove mine\fR, \fBremove random\fR or
301\fBremove any\fR rights depending on how the
eb5dc014 302track came to be added to the queue.
460b9539 303.TP
dd9af5cb 304.B rescan \fR[\fBwait\fR] \fR[\fBfresh\fR]
c0c23a60
RK
305Rescan all roots for new or obsolete tracks.
306Requires the \fBrescan\fR right.
dd9af5cb
RK
307.IP
308If the \fBwait\fR flag is present then the response is delayed until the rescan
309completes.
310Otherwise the response arrives immediately.
311This is primarily intended for testing.
312.IP
313If the \fBfresh\fR flag is present a rescan is already underway then a second
314rescan will be started when it completes.
315The default behavior is to piggyback on the existing rescan.
316.IP
317NB that \fBfresh\fR is currently disabled in the server source, so using this
318flag will just provoke an error.
460b9539 319.TP
320.B resolve \fITRACK\fR
321Resolve a track name, i.e. if this is an alias then return the real track name.
322.TP
323.B resume
c0c23a60
RK
324Resume the current track after a \fBpause\fR command.
325Requires the \fBpause\fR right.
eb5dc014
RK
326.TP
327.B revoke \fBcookie\fR
0d350ff0 328Revoke a cookie previously created with \fBmake\-cookie\fR.
c0c23a60 329It will not be possible to use this cookie in the future.
460b9539 330.TP
0d350ff0 331.B rtp\-address
5818980a 332Report the RTP broadcast (or multicast) address, in the form \fIADDRESS
c0c23a60
RK
333PORT\fR.
334This command does not require authentication.
ca831831 335.TP
460b9539 336.B scratch \fR[\fIID\fR]
337Remove the track identified by \fIID\fR, or the currently playing track if no
c0c23a60
RK
338\fIID\fR is specified.
339Requires one of the \fBscratch mine\fR, \fBscratch random\fR or
340\fBscratch any\fR rights depending on how the track came to be
eb5dc014 341added to the queue.
460b9539 342.TP
2b33c4cf
RK
343.B schedule-add \fIWHEN\fR \fIPRIORITY\fR \fIACTION\fR ...
344Schedule an event for the future.
345.IP
346.I WHEN
347is the time when it should happen, as \fBtime_t\fR value.
348It must refer to a time in the future.
349.IP
350.I PRIORITY
351is the event priority.
352This can be \fBnormal\fR, in which case the event will be run at startup if its
353time has past, or \fBjunk\fR in which case it will be discarded if it is found
354to be in the past at startup.
355The meaning of other values is not defined.
356.IP
357.I ACTION
358is the action to perform.
359The choice of action determines the meaning of the remaining arguments.
360Possible actions are:
361.RS
362.TP
363.B play
364Play a track.
365The next argument is the track name.
366Requires the \fBplay\fR right.
367.TP
368.B set-global
369Set a global preference.
370The next argument is the preference name and the final argument is the value to
371set it to (omit it to unset it).
372Requires the \fBglobal prefs\fR right.
373.RE
374.IP
375You need the right at the point you create the event.
376It is not possible to create scheduled events in expectation of a future change
377in rights.
378.TP
379.B schedule-del \fIEVENT\fR
380Deletes a scheduled event.
381Users can always delete their own scheduled events; with the \fBadmin\fR
382right you can delete any event.
383.TP
384.B schedule-get \fIEVENT\fR
385Sends the details of scheduled event \fIEVENT\fR in a response body.
386Each line is a pair of strings quoted in the usual way, the first being the key
387ane the second the value.
388No particular order is used.
389.IP
390Scheduled events are considered public information.
391Right \fBread\fR is sufficient to see details of all events.
392.TP
393.B schedule-list
394Sends the event IDs of all scheduled events in a response body, in no
395particular order.
396Use \fBschedule-get\fR to get the details of each event.
397.TP
460b9539 398.B search \fITERMS\fR
c0c23a60
RK
399Search for tracks matching the search terms.
400The results are put in a response body, one to a line.
460b9539 401.IP
402The search string is split in the usual way, with quoting supported, into a
c0c23a60
RK
403list of terms.
404Only tracks matching all terms are included in the results.
460b9539 405.IP
406Any terms of the form \fBtag:\fITAG\fR limits the search to tracks with that
407tag.
408.IP
409All other terms are interpreted as individual words which must be present in
410the track name.
411.IP
412Spaces in terms don't currently make sense, but may one day be interpreted to
413allow searching for phrases.
414.TP
415.B \fBset\fR \fITRACK\fR \fIPREF\fR \fIVALUE\fR
c0c23a60
RK
416Set a preference.
417Requires the \fBprefs\fR right.
460b9539 418.TP
0d350ff0 419.B set\-global \fIKEY\fR \fIVALUE\fR
c0c23a60
RK
420Set a global preference.
421Requires the \fBglobal prefs\fR right.
460b9539 422.TP
423.B stats
424Send server statistics in plain text in a response body.
425.TP
426.B \fBtags\fR
427Send the list of currently known tags in a response body.
428.TP
429.B \fBunset\fR \fITRACK\fR \fIPREF\fR
c0c23a60
RK
430Unset a preference.
431Requires the \fBprefs\fR right.
460b9539 432.TP
0d350ff0 433.B \fBunset\-global\fR \fIKEY\fR
c0c23a60
RK
434Unset a global preference.
435Requires the \fBglobal prefs\fR right.
460b9539 436.TP
90ad6c6e
RK
437.B user \fIUSERNAME\fR \fIRESPONSE\fR
438Authenticate as user \fIUSERNAME\fR.
c0c23a60 439See
5e3f9e08
RK
440.B AUTHENTICATION
441below.
460b9539 442.TP
90ad6c6e 443.B userinfo \fIUSERNAME PROPERTY
3e3566ad
RK
444Get a user property.
445.TP
eb5dc014 446.B users
5818980a 447Send the list of currently known users in a response body.
eb5dc014 448.TP
460b9539 449.B version
450Send back a response with the server version as the second field.
451.TP
452.B volume \fR[\fILEFT\fR [\fIRIGHT\fR]]
453Get or set the volume.
454.IP
455With zero parameters just gets the volume and reports the left and right sides
456as the 2nd and 3rd fields of the response.
457.IP
c0c23a60
RK
458With one parameter sets both sides to the same value.
459With two parameters sets each side independently.
460Setting the volume requires the \fBvolume\fR right.
460b9539 461.SH RESPONSES
c0c23a60
RK
462Responses are three-digit codes.
463The first digit distinguishes errors from succesful responses:
460b9539 464.TP
465.B 2
466Operation succeeded.
467.TP
468.B 5
469Operation failed.
470.PP
471The second digit breaks down the origin of the response:
472.TP
473.B 0
c0c23a60
RK
474Generic responses not specific to the handling of the command.
475Mostly this is parse errors.
460b9539 476.TP
b4a80f69 477.B 1
47851x errors indicate that the user had insufficient rights for the command.
479.TP
460b9539 480.B 3
481Authentication responses.
482.TP
483.B 5
484Responses specific to the handling of the command.
485.PP
486The third digit provides extra information about the response:
487.TP
488.B 0
489Text part is just commentary.
490.TP
491.B 1
492Text part is a constant result e.g. \fBversion\fR.
493.TP
494.B 2
495Text part is a potentially variable result.
496.TP
497.B 3
498Text part is just commentary; a dot-stuffed body follows.
499.TP
500.B 4
c0c23a60
RK
501Text part is just commentary; an indefinite dot-stuffed body follows.
502(Used for \fBlog\fR.)
460b9539 503.TP
fb1bc1f5 504.B 5
c0c23a60
RK
505Used with "normal" errors, for instance a preference not being found.
506The text part is commentary.
fb1bc1f5 507.TP
460b9539 508.B 9
509The text part is just commentary (but would normally be a response for this
510command) e.g. \fBplaying\fR.
7b32e917
RK
511.PP
512Result strings (not bodies) intended for machine parsing (i.e. xx1 and xx2
513responses) are quoted.
460b9539 514.SH AUTHENTICATION
5e3f9e08 515When a connection is made the server sends a \fB231\fR response before any
c0c23a60
RK
516command is received.
517This contains a protocol generation, an algorithm name and a
518challenge encoded in hex, all separated by whitespace.
7b32e917
RK
519.PP
520The current protocol generation is \fB2\fR.
5e3f9e08 521.PP
b3141726 522The possible algorithms are (currently) \fBsha1\fR, \fBsha256\fR, \fBsha384\fR
c0c23a60
RK
523and \fBsha512\fR.
524\fBSHA1\fR etc work as synonyms.
460b9539 525.PP
5e3f9e08
RK
526The \fBuser\fR response consists of the selected hash of the user's password
527concatenated with the challenge, encoded in hex.
460b9539 528.SH "TRACK INFORMATION"
529Track information is encoded in a line (i.e. using the usual line syntax) as
c0c23a60
RK
530pairs of fields.
531The first is a name, the second a value.
532The names have the following meanings:
460b9539 533.TP 12
534.B expected
535The time the track is expected to be played at.
536.TP
537.B id
538A string uniquely identifying this queue entry.
539.TP
540.B played
541The time the track was played at.
542.TP
543.B scratched
544The user that scratched the track.
545.TP
d42e98ca
RK
546.B origin
547The origin of the track. Valid origins are:
548.RS
549.TP 12
550.B adopted
551The track was originally randomly picked but has been adopted by a user.
552.TP
553.B picked
554The track was picked by a user.
555.TP
556.B random
557The track was randomly picked.
558.TP
559.B scheduled
560The track was played from a scheduled action.
561.TP
562.B scratch
563The track is a scratch sound.
564.RE
565.TP
460b9539 566.B state
c0c23a60
RK
567The current track state.
568Valid states are:
460b9539 569.RS
570.TP 12
571.B failed
572The player failed (exited with nonzero status but wasn't scratched).
573.TP
460b9539 574.B ok
575The track was played without any problems.
576.TP
577.B scratched
578The track was scratched.
579.TP
580.B started
581The track is currently playing.
582.TP
d42e98ca
RK
583.B paused
584Track is playing but paused.
585.TP
460b9539 586.B unplayed
587In the queue, hasn't been played yet.
588.TP
589.B quitting
590The track was terminated because the server is shutting down.
591.RE
592.TP
593.B submitter
594The user that submitted the track.
595.TP
596.B track
597The filename of the track.
598.TP
599.B when
600The time the track was added to the queue.
601.TP
602.B wstat
603The wait status of the player in decimal.
d42e98ca
RK
604.PP
605Note that \fBorigin\fR is new with DisOrder 4.3, and obsoletes some old
606\fBstate\fR values.
460b9539 607.SH NOTES
608Times are decimal integers using the server's \fBtime_t\fR.
609.PP
610For file listings, the regexp applies to the basename of the returned file, not
c0c23a60
RK
611the whole filename, and letter case is ignored.
612\fBpcrepattern\fR(3) describes the regexp syntax.
460b9539 613.PP
614Filenames are in UTF-8 even if the collection they come from uses some other
615encoding - if you want to access the real file (in such cases as the filenames
616actually correspond to a real file) you'll have to convert to whatever the
617right encoding is.
618.SH "EVENT LOG"
619The event log consists of lines starting with a hexadecimal timestamp and a
c0c23a60
RK
620keyword followed by (optionally) parameters.
621The parameters are quoted in the usual DisOrder way.
622Currently the following keywords are used:
460b9539 623.TP
d42e98ca
RK
624.B adopted \fIID\fR \fIUSERNAME\fR
625\fIUSERNAME\fR adopted track \fIID\fR.
626.TP
460b9539 627.B completed \fITRACK\fR
628Completed playing \fITRACK\fR
629.TP
630.B failed \fITRACK\fR \fIERROR\fR
631Completed playing \fITRACK\fR with an error status
632.TP
90ad6c6e
RK
633.B moved \fIUSERNAME\fR
634User \fIUSERNAME\fR moved some track(s).
c0c23a60 635Further details aren't included any more.
460b9539 636.TP
90ad6c6e 637.B playing \fITRACK\fR [\fIUSERNAME\fR]
460b9539 638Started playing \fITRACK\fR.
639.TP
5c102112
RK
640.B playlist_created \fIPLAYLIST\fR \fISHARING\fR
641Sent when a playlist is created.
642For private playlists this is intended to be sent only to the owner (but
643this is not currently implemented).
644.TP
645.B playlist_deleted \fIPLAYLIST\fR
646Sent when a playlist is deleted.
647For private playlists this is intended to be sent only to the owner (but
648this is not currently implemented).
649.TP
650.B playlist_modified \fIPLAYLIST\fR \fISHARING\fR
651Sent when a playlist is modified (either its contents or its sharing status).
652For private playlists this is intended to be sent only to the owner (but
653this is not currently implemented).
654.TP
460b9539 655.B queue \fIQUEUE-ENTRY\fR...
656Added \fITRACK\fR to the queue.
657.TP
658.B recent_added \fIQUEUE-ENTRY\fR...
659Added \fIID\fR to the recently played list.
660.TP
661.B recent_removed \fIID\fR
662Removed \fIID\fR from the recently played list.
663.TP
90ad6c6e 664.B removed \fIID\fR [\fIUSERNAME\fR]
c0c23a60 665Queue entry \fIID\fR was removed.
90ad6c6e 666This is used both for explicit removal (when \fIUSERNAME\fR is present)
c0c23a60 667and when playing a track (when it is absent).
460b9539 668.TP
e025abff
RK
669.B rescanned
670A rescan completed.
671.TP
90ad6c6e
RK
672.B scratched \fITRACK\fR \fIUSERNAME\fR
673\fITRACK\fR was scratched by \fIUSERNAME\fR.
460b9539 674.TP
675.B state \fIKEYWORD\fR
c0c23a60
RK
676Some state change occurred.
677The current set of keywords is:
460b9539 678.RS
679.TP
5abe307a
RK
680.B completed
681The current track completed successfully.
682.TP
460b9539 683.B disable_play
684Playing was disabled.
685.TP
686.B disable_random
687Random play was disabled.
688.TP
689.B enable_play
690Playing was enabled.
691.TP
692.B enable_random
693Random play was enabled.
694.TP
5abe307a
RK
695.B failed
696The current track failed.
697.TP
460b9539 698.B pause
699The current track was paused.
700.TP
5abe307a
RK
701.B playing
702A track started playing.
703.TP
460b9539 704.B resume
705The current track was resumed.
5abe307a 706.TP
75e7b7c3 707.B rights_changed \fIRIGHTS\fR
ad492e00
RK
708User's rights were changed.
709.TP
5abe307a
RK
710.B scratched
711The current track was scratched.
712.PP
713To simplify client implementation, \fBstate\fR commands reflecting the current
714state are sent at the start of the log.
460b9539 715.RE
bb03d79d 716.TP
75e7b7c3 717.B user_add \fIUSERNAME\fR
58d2aad2
RK
718A user was created.
719.TP
75e7b7c3 720.B user_delete \fIUSERNAME\fR
58d2aad2
RK
721A user was deleted.
722.TP
75e7b7c3 723.B user_edit \fIUSERNAME\fR \fIPROPERTY\fR
58d2aad2
RK
724Some property of a user was edited.
725.TP
75e7b7c3 726.B user_confirm \fIUSERNAME\fR
58d2aad2 727A user's login was confirmed (via the web interface).
460b9539 728.TP
729.B volume \fILEFT\fR \fIRIGHT\fR
730The volume changed.
731.PP
732.IR QUEUE-ENTRY ...
733is as defined in
734.B "TRACK INFORMATION"
735above.
58d2aad2
RK
736.PP
737The \fBuser-*\fR messages are only sent to admin users, and are not sent over
738non-local connections unless \fBremote_userman\fR is enabled.
f9635e06 739.SH "CHARACTER ENCODING"
c0c23a60
RK
740All data sent by both server and client is encoded using UTF-8.
741Moreover it must be valid UTF-8, i.e. non-minimal sequences are not
742permitted, nor are surrogates, nor are code points outside the
743Unicode code space.
f9635e06
RK
744.PP
745There are no particular normalization requirements on either side of the
c0c23a60
RK
746protocol.
747The server currently converts internally to NFC, the client must
f9635e06
RK
748normalize the responses returned if it needs some normalized form for further
749processing.
750.PP
751The various characters which divide up lines may not be followed by combining
c0c23a60
RK
752characters.
753For instance all of the following are prohibited:
f9635e06
RK
754.TP
755.B o
c0c23a60
RK
756LINE FEED followed by a combining character.
757For example the sequence LINE FEED, COMBINING GRAVE ACCENT is never permitted.
f9635e06
RK
758.TP
759.B o
760APOSTROPHE or QUOTATION MARK followed by a combining character when used to
c0c23a60
RK
761delimit fields.
762For instance a line starting APOSTROPHE, COMBINING CEDILLA is prohibited.
f9635e06
RK
763.IP
764Note that such sequences are not prohibited when the quote character cannot be
c0c23a60
RK
765interpreted as a field delimiter.
766For instance APOSTROPHE, REVERSE SOLIDUS, APOSTROPHE, COMBINING CEDILLA,
767APOSTROPHE would be permitted.
f9635e06
RK
768.TP
769.B o
770REVERSE SOLIDUS (BACKSLASH) followed by a combining character in a quoted
c0c23a60
RK
771string when it is the first character of an escape sequence.
772For instance a line starting APOSTROPHE, REVERSE SOLIDUS, COMBINING TILDE
773is prohibited.
f9635e06
RK
774.IP
775As above such sequences are not prohibited when the character is not being used
c0c23a60
RK
776to start an escape sequence.
777For instance APOSTROPHE, REVERSE SOLIDUS, REVERSE SOLIDS, COMBINING TILDE,
778APOSTROPHE is permitted.
f9635e06
RK
779.TP
780.B o
781Any of the field-splitting whitespace characters followed by a combining
c0c23a60
RK
782character when not part of a quoted field.
783For instance a line starting COLON, SPACE, COMBINING CANDRABINDU is prohibited.
f9635e06
RK
784.IP
785As above non-delimiter uses are fine.
786.TP
787.B o
788The FULL STOP characters used to quote or delimit a body.
789.PP
790Furthermore none of these characters are permitted to appear in the context of
791a canonical decomposition (i.e. they must still be present when converted to
c0c23a60
RK
792NFC).
793In practice however this is not an issue in Unicode 5.0.
f9635e06
RK
794.PP
795These rules are consistent with the observation that the split() function is
c0c23a60
RK
796essentially a naive ASCII parser.
797The implication is not that these sequences never actually appear in
798the protocol, merely that the server is not required to honor them in
799any useful way nor be consistent between versions: in current
f9635e06
RK
800versions the result will be lines and fields that start with combining
801characters and are not necessarily split where you expect, but future versions
802may remove them, reject them or ignore some or all of the delimiters that have
803following combining characters, and no notice will be given of any change.
460b9539 804.SH "SEE ALSO"
805\fBdisorder\fR(1),
806\fBtime\fR(2),
807\fBdisorder\fR(3),
808\fBpcrepattern\fR(3)
809\fBdisorder_config\fR(5),
810\fBdisorderd\fR(8),
811\fButf8\fR(7)
812.\" Local Variables:
813.\" mode:nroff
814.\" fill-column:79
815.\" End: