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