]> git.tuebingen.mpg.de Git - paraslash.git/blob - m4/lls/server_cmd.suite.m4
Merge topic branch t/afs-select into master
[paraslash.git] / m4 / lls / server_cmd.suite.m4
1 [suite server_cmd]
2 caption = list of server commands
3 aux_info_prefix = Permissions:
4
5 [introduction]
6         The server process listens on a network socket and accepts connections
7         from para_client or para_audiod. For the connection to succeed the
8         connecting peer must authenticate as one of the users stored in the
9         user table of para_server. Each entry of the user table contains the
10         set of permission bits that are granted to the user. Authenticated
11         users may execute one of the commands below if the set of permission
12         bits of the command is a subset of the permission bits that are
13         granted to the user.
14 [/introduction]
15
16 [subcommand add]
17         purpose = add or update audio files
18         non-opts-name = path...
19         aux_info = AFS_READ | AFS_WRITE
20         [description]
21                 Each path must be absolute and refer to either an audio file or a
22                 directory. In case of a directory, all audio files in that directory
23                 are added recursively. Note that the given paths refer to files or
24                 directories on the host on which para_server is running.
25         [/description]
26         [option all]
27                 short_opt = a
28                 summary = add all files
29                 [help]
30                         The default is to add only files ending in a known suffix for a
31                         supported audio format.
32                 [/help]
33         [option lazy]
34                 short_opt = l
35                 summary = add files lazily
36                 [help]
37                         If the path already exists in the database, skip this file. This
38                         operation is really cheap. Useful to update large directories after
39                         some files have been added.
40                 [/help]
41         [option force]
42                 short_opt = f
43                 summary = force adding/updating
44                 [help]
45                         Recompute the audio format handler data even if a file with the same
46                         path and the same hash value exists.
47                 [/help]
48         [option verbose]
49                 short_opt = v
50                 summary = enable verbose mode
51                 [help]
52                         Print what is being done.
53                 [/help]
54
55 [subcommand addatt]
56         purpose = add new attribute(s)
57         non-opts-name = attribute...
58         aux_info = AFS_READ | AFS_WRITE
59         [description]
60                 This adds new attributes to the attribute table. At most 64 attributes
61                 may be defined.
62         [/description]
63
64 [subcommand check]
65         purpose = run integrity checks on database tables
66         aux_info = AFS_READ
67         [description]
68                 If no options are given, all checks are run.
69         [/description]
70         [option aft]
71                 short_opt = a
72                 summary = run audio file table checks
73                 [help]
74                         Report stale paths and invalid image and lyrics ids of the audio
75                         file table.
76                 [/help]
77         [option attribute]
78                 short_opt = A
79                 summary = check for invalid attributes
80                 [help]
81                         Report audio files whose attribute bitmask is invalid, i.e., has a bit
82                         set which does not correspond to any attribute of the attribute table.
83                 [/help]
84         [option mood]
85                 short_opt = m
86                 summary = check for invalid mood definitions
87                 [help]
88                         Run syntax checks on all moods of the mood table.
89                 [/help]
90         [option playlist]
91                 short_opt = p
92                 summary = find invalid paths in playlists
93                 [help]
94                         Check all playlists for paths not contained in the audio file table.
95                 [/help]
96
97 [subcommand cpsi]
98         purpose = copy selected parts of the audio file selector info
99         non-opts-name = source pattern...
100         aux_info = AFS_READ | AFS_WRITE
101         [description]
102                 If no option, or only --verbose is given, all fields of the audio
103                 file selector info structure are copied to each row of the audio file
104                 table whose path matches at least one of the given patterns. Otherwise,
105                 only those fields which correspond to the given options are copied.
106         [/description]
107         [option attribute-bitmap]
108                 short_opt = a
109                 summary = copy the attribute bitmap
110         [option image-id]
111                 short_opt = i
112                 summary = copy the image id
113         [option lyrics-id]
114                 short_opt = y
115                 summary = copy the lyrics id
116         [option lastplayed]
117                 short_opt = l
118                 summary = copy the lastplayed timestamp
119         [option numplayed]
120                 short_opt = n
121                 summary = copy the numplayed counter
122         [option verbose]
123                 short_opt = v
124                 summary = enable verbose mode
125
126 [subcommand ff]
127         purpose = jump forward or backward in the current audio file
128         synopsis = seconds
129         aux_info = VSS_READ | VSS_WRITE
130         [description]
131                 This enqueues a request to reposition the audio stream according to
132                 the argument, which may be a signed or an unsigned integer. Negative
133                 values correspond to backward jumps.
134
135                 If a negative number is given whose absolute value exceeds the current
136                 postition of the stream, a jump to the beginning of the audio file
137                 is performed. If a positive amount of seconds is given which exceeds
138                 the remaining time of the audio file, the next audio file is loaded.
139
140         [/description]
141
142 [subcommand help]
143         purpose = list available commands or print command-specific help
144         non-opts-name = [command]
145         aux_info = NO_PERMISSION_REQUIRED
146         [description]
147                 When executed without any arguments, the available server commands
148                 are listed. Otherwise, if the first argument is the name of a server
149                 command, the description of this command is shown.
150         [/description]
151         m4_include(`long-help.m4')
152
153 [subcommand hup]
154         purpose = reload config file, log file and user list
155         aux_info = VSS_WRITE
156         [description]
157                 Reread the config file and the user list file, close and reopen the log
158                 file, and ask the afs process to do the same. Sending the HUP signal
159                 to the server process has the same effect as running this command.
160         [/description]
161
162 [subcommand init]
163         purpose = initialize the database tables for the audio file selector
164         synopsis = [table_name...]
165         aux_info = AFS_READ | AFS_WRITE
166         [description]
167                 When invoked without arguments, this command creates all
168                 tables: audio_files, attributes, scores, moods, lyrics, images,
169                 playlists. Otherwise only the given tables are created.
170         [/description]
171
172 m4_include(`com_ll.m4')
173
174 [subcommand jmp]
175         purpose = reposition the current stream
176         non-opts-name = n
177         aux_info = VSS_READ | VSS_WRITE
178         [description]
179                 Set the 'R' (reposition request) bit of the vss status flags and
180                 enqueue a request to jump to n% of the current audio file, where 0 <=
181                 n <= 100.
182         [/description]
183
184 [subcommand ls]
185         purpose = list audio files which match a pattern
186         non-opts-name = [pattern...]
187         aux_info = AFS_READ
188         [description]
189                 If no pattern is given, all files are listed.  Otherwise, the command
190                 lists all files of the audio file table whose path matches at least
191                 one of the given patterns.
192         [/description]
193         [option listing-mode]
194                 short_opt = l
195                 summary = use alternative output format
196                 arg_type = string
197                 arg_info = optional_arg
198                 typestr = mode
199                 default_val = long
200                 [help]
201                         The optional mode argument is either a single character or a word
202                         according to the following list.
203
204                         short (s). List only the path or basename (last component of the path),
205                         depending on whether -p is also given. This listing mode acts as if
206                         --listing-mode had not been given.
207
208                         long (l). Show detailed information. This is the default if no argument
209                         to --listing-mode is supplied.
210
211                         verbose (v). Multi-line output, one row per data field stored in the
212                         audio file table.
213
214                         parser-friendly (p). Like verbose listing mode, but use numerical
215                         values for the names of the output fields and prefix each line with
216                         a length field.
217
218                         mbox (m). Generate output suitable to be viewed with a mail
219                         program. One "mail" per matching audio file.
220
221                         chunk-table (c). Print path (or basename, depending on whether -p is
222                         also given), chunk time and chunk offsets.
223
224                 [/help]
225         [option basename]
226                 short_opt = b
227                 summary = list and match basenames only
228                 [help]
229                         Print only the basename of each matching file and match only the
230                         basenames of the paths stored in the audio file table against the
231                         given patterns. The default is to print and match the full path.
232                 [/help]
233         [option admissible]
234                 short_opt = a
235                 summary = list only admissible files
236                 arg_type = string
237                 arg_info = optional_arg
238                 typestr = specifier/name
239                 default_val = .
240                 [help]
241                         If the optional argument is supplied, it must be of the form "p/foo"
242                         or "m/bar" (which refer to the playlist named "foo" and the mood named
243                         "bar", respectively). The command then restricts its output to the set
244                         of files which are admissible with respect to the thusly identified
245                         mood or playlist.
246
247                         If no argument is given, or if the argument is the special value ".",
248                         the current mood or playlist is assumed.
249                 [/help]
250         [option reverse]
251                 short_opt = r
252                 summary = reverse sort order
253         [option unix-date]
254                 short_opt = d
255                 summary = print dates as seconds after the epoch
256         [option sort]
257                 short_opt = s
258                 summary = change sort order
259                 arg_type = string
260                 arg_info = required_arg
261                 typestr = order
262                 default_val = path
263                 [help]
264                         The sort order must be given as an required argument. Like for
265                         --listing-mode, this argument may either be a single character or a
266                         word, according to the following list.
267
268                         path (p). Sort alphabetically by path or basename, depending on
269                         whether -b is given. This is the default if --sort is not given.
270
271                         score (s). Iterate over the entries of the score table, rather than
272                         the audio file table. This sort order implies --admissible, since
273                         the score table contains only admissible files.
274
275                         lastplayed (l)
276
277                         numplayed (n)
278
279                         frequency (f)
280
281                         channels (c)
282
283                         image-id (i)
284
285                         lyrics-id (y)
286
287                         bitrate (b)
288
289                         duration (d)
290
291                         audio-format (a)
292
293                         hash (h)
294
295                         If --sort is not given, path sort is implied.
296                 [/help]
297
298 [subcommand lsatt]
299         purpose = list attributes
300         aux_info = AFS_READ
301         [description]
302                 Print the list of all defined attributes which match the given
303                 pattern. If no pattern is given, the full list is printed.
304         [/description]
305
306         [option id-sort]
307                 short_opt = i
308                 summary = sort attributes by id
309                 [help]
310                         The default is to sort alphabetically by name.
311
312                         Attributes are internally represented as an 64 bit array. The attribute
313                         id is the bit number in this array.
314                 [/help]
315         [option long]
316                 short_opt = l
317                 summary = print long listing
318                 [help]
319                         The long listing prints the attribute id in addition to the name of
320                         the attribute. The id is printed as a decimal number and is separated
321                         from the name by a tab character.
322                 [/help]
323         [option reverse]
324                 short_opt = r
325                 summary = reverse sort order
326
327 [subcommand mvatt]
328         purpose = rename an attribute
329         synopsis = source dest
330         aux_info = AFS_READ | AFS_WRITE
331         [description]
332                 Rename the attribute given by the first argument to the destination
333                 given by the second argument. It is an error if the destination
334                 attribute exists.
335         [/description]
336
337 [subcommand next]
338         purpose = close the stream and start to stream the next audio file
339         aux_info = VSS_READ | VSS_WRITE
340         [description]
341                 Set the 'N' (next audio file) bit of the vss status flags. This
342                 instructs the server to close the current stream, if any. The 'P'
343                 (playing) bit is not modified by this command. If it is on, playing
344                 continues with the next audio file.
345
346                 This command is equivalent to stop if paused, and has no effect
347                 if stopped.
348         [/description]
349
350 [subcommand nomore]
351         purpose = stop playing after current audio file
352         aux_info = VSS_READ | VSS_WRITE
353         [description]
354                 Set the 'O' (no more) bit of the vss status flags which asks
355                 para_server to clear the 'P' (playing) bit after the 'N' (next audio
356                 file) bit transitions from off to on (because the end of the current
357                 audio file is reached). Use this command instead of stop if you don't
358                 like sudden endings.
359         [/description]
360
361 [subcommand pause]
362         purpose = suspend the current stream
363         aux_info = VSS_READ | VSS_WRITE
364         [description]
365                 Clear the 'P' (playing) bit of the vss status flags.
366         [/description]
367
368 [subcommand play]
369         purpose = start or resume playback
370         aux_info = VSS_READ | VSS_WRITE
371         [description]
372                 Set the 'P' (playing) bit of the vss status flags.
373         [/description]
374
375 [subcommand rm]
376         purpose = remove rows from the audio file table
377         non-opts-name = pattern...
378         aux_info = AFS_READ | AFS_WRITE
379         [description]
380                 Remove all rows of the audio file table which match any of the given
381                 patterns. Note that this affects only the database table; the command
382                 won't touch your audio files on disk.
383         [/description]
384         [option verbose]
385                 short_opt = v
386                 summary = print paths of deleted rows
387         [option force]
388                 short_opt = f
389                 summary = don't complain if nothing was removed
390         [option pathname-match]
391                 short_opt = p
392                 summary = modify matching behaviour
393                 [help]
394                         Match a slash in the path only with a slash in pattern and not by an
395                         asterisk (*) or a question mark (?) metacharacter, nor by a bracket
396                         expression ([]) containing a slash (see fnmatch(3)).
397                 [/help]
398
399 [subcommand rmatt]
400         purpose = remove attribute(s)
401         non-opts-name = pattern...
402         aux_info = AFS_READ | AFS_WRITE
403         [description]
404                 Remove all attributes which match any given pattern. All information
405                 about the removed attributes in the audio file table is lost.
406         [/description]
407
408 [subcommand select]
409         purpose = activate a mood or a playlist
410         non-opts-name = specifier/name
411         aux_info = AFS_READ | AFS_WRITE
412         [description]
413                 The specifier is either 'm' or 'p' to indicate whether a playlist or
414                 a mood should be activated. Example:
415
416                         select m/foo
417
418                 activates the mood named 'foo'.
419         [/description]
420         [option verbose]
421                 short_opt = v
422                 summary = print information about the loaded mood or playlist
423
424 [subcommand sender]
425         purpose = control paraslash senders
426         synopsis = [sender subcmd [arguments]]
427         aux_info = VSS_READ | VSS_WRITE
428         [description]
429                 This command executes a subcommand for the given sender, which is
430                 one of "http", "dccp" or "udp". Various subcommands exist to print
431                 information about the sender, to activate and deactivate the sender,
432                 and to change the access permissions and targets. The following
433                 subcommands are available:
434
435                        help, status, on, off, allow, deny, add, delete.
436
437                 All senders support the first four commands. The "allow" and "deny"
438                 commands are supported by the http and the dccp senders while "add"
439                 and "delete" are only supported by the udp sender. If no sender is
440                 given, the list of available senders is shown.
441
442                 Examples:
443
444                 Get help for the udp sender (contains further examples):
445
446                         sender udp help
447
448                 Show the access control list and the number of connected clients of
449                 the http sender:
450
451                         sender http status
452
453                 Senders may be activated and deactivated independently of each
454                 other. The following command switches off the dccp sender:
455
456                         sender dccp off
457
458                 Add an UDP unicast for a client to the target list of the UDP sender:
459
460                         sender udp add client.foo.org
461
462                 Start UDP multicast, using the default multicast address:
463
464                         sender udp add 224.0.1.38
465
466         [/description]
467
468 [subcommand setatt]
469         purpose = set or unset attributes
470         synopsis = attribute{+|-}... pattern...
471         aux_info = AFS_READ | AFS_WRITE
472         [description]
473                 Set ('+') or unset ('-') the given attributes for all audio files
474                 matching the given pattern. Example:
475
476                         setatt rock+ punk+ pop- '*foo.mp3'
477
478                 sets the 'rock' and the 'punk' attribute and unsets the 'pop' attribute
479                 of all files ending with 'foo.mp3'.
480         [/description]
481
482 [subcommand si]
483         purpose = print server info
484         aux_info = NO_PERMISSION_REQUIRED
485         [description]
486                 Show server and afs PID, number of connections, uptime and more.
487         [/description]
488
489 [subcommand stat]
490         purpose = print information about the current audio file
491         aux_info = VSS_READ
492         [option num]
493                 short_opt = n
494                 summary = number of times to show the status info
495                 arg_info = required_arg
496                 arg_type = uint32
497                 typestr = num
498                 [help]
499                         Exit after the status information has been shown num times. If this
500                         option is not given, the command runs in an endless loop.
501                 [/help]
502         [option parser-friendly]
503                 short_opt = p
504                 summary = enable parser-friendly output
505                 [help]
506                         Show status item identifiers as numerical values and prefix each
507                         status item with its size in bytes.
508                 [/help]
509
510 [subcommand stop]
511         purpose = stop playback
512         aux_info = VSS_READ | VSS_WRITE
513         [description]
514                 Clear the 'P' (playing) bit and set the 'N' (next audio file) bit of
515                 the vss status flags, effectively stopping playback.
516         [/description]
517
518 [subcommand term]
519         purpose = ask the server to terminate
520         aux_info = VSS_READ | VSS_WRITE
521         [description]
522                 Shut down the server. Instead of this command, you can also send
523                 SIGINT or SIGTERM to the para_server process. It should never be
524                 necessary to send SIGKILL.
525         [/description]
526
527 [subcommand touch]
528         purpose = manipulate the afs information of audio files
529         non-opts-name = pattern...
530         aux_info = AFS_READ | AFS_WRITE
531         [description]
532                 This command modifies the afs info structure of all rows of the audio
533                 file table whose path matches at least one of the given patters.
534
535                 If at least one option is given which takes a number as its argument,
536                 only those fields of the afs info structure are updated which
537                 correspond to the given options while all other fields stay unmodified.
538
539                 If no such option is given, the lastplayed field is set to the current
540                 time and the value of the numplayed field is increased by one while
541                 all other fields are left unchanged. This mimics what happens when
542                 the virtual streaming system selects the file for streaming.
543
544                 If the file is admissible for the current mood (or contained in the
545                 current playlist), its score is recomputed according to the changed
546                 values.
547         [/description]
548         [option numplayed]
549                 short_opt = n
550                 summary = set the numplayed count manually
551                 arg_type = uint32
552                 arg_info = required_arg
553                 typestr = num
554                 [help]
555                         The numplayed count of an audio file is the number of times the file
556                         was selected for streaming. It is one of the inputs to the scoring
557                         function which determines the order in which admissible files are
558                         streamed.
559
560                         The virtual streaming system increases this number automatically each
561                         time it opens the file for streaming.
562                 [/help]
563         [option lastplayed]
564                 short_opt = l
565                 summary = set the lastplayed time manually
566                 arg_type = uint64
567                 arg_info = required_arg
568                 typestr = num
569                 [help]
570                         The lastplayed time of an audio file is the time when the file was
571                         last opened for streaming.
572
573                         Like the numplayed count, it is an input for the scoring function
574                         and is updated automatically by the virtual streaming system.
575
576                         The argument must be a number of seconds since the epoch. Example:
577
578                                 touch -l=$(date +%s) file
579
580                         sets the lastplayed time of 'file' to the current time.
581                 [/help]
582         [option image-id]
583                 short_opt = i
584                 summary = set the image id
585                 arg_type = uint32
586                 arg_info = required_arg
587                 typestr = num
588                 [help]
589                         The afs info structure of each row of the audio file table contains
590                         a slot for the image id of the audio file that corresponds to the
591                         row. The image id stored in this slot refers to the key in the image
592                         table that identifies the blob.
593
594                         When a new audio file is added to the audio file table, its image
595                         id starts out as zero, indicating that there is no image associated
596                         with the file. Setting the image id to a non-zero number associates
597                         the file with a particular blob of the image table, for example the
598                         cover art of the album in jpg format.
599                 [/help]
600         [option lyrics-id]
601                 short_opt = y
602                 summary = set the lyrics id
603                 arg_type = uint32
604                 arg_info = required_arg
605                 typestr = num
606                 [help]
607                         This option works just like --image-id, but sets the lyrics ID rather
608                         than the image id.
609                 [/help]
610         [option amp]
611                 short_opt = a
612                 summary = set the amplification value (0-255)
613                 arg_type = uint32
614                 arg_info = required_arg
615                 typestr = num
616                 [help]
617                         The amplification value of an audio file is a number which is stored
618                         in the afs info structure.
619
620                         The value determines the scaling factor by which the amplitude of
621                         the decoded samples should be multiplied in order to normalize the
622                         volume. A value of zero means no amplification, 64 means the amplitude
623                         should be multiplied by a factor of two, 128 by three and so on.
624
625                         The amp filter of para_audiod amplifies the volume according to
626                         this value.
627                 [/help]
628         [option verbose]
629                 short_opt = v
630                 summary = explain what is being done
631         [option pathname-match]
632                 short_opt = p
633                 summary = modify matching behaviour
634                 [help]
635                         Match a slash in the path only with a slash in pattern and not by an
636                         asterisk (*) or a question mark (?) metacharacter, nor by a bracket
637                         expression ([]) containing a slash (see fnmatch(3)).
638                 [/help]
639
640 [subcommand version]
641         purpose = print the git version string of para_server
642         aux_info = NO_PERMISSION_REQUIRED
643         [option verbose]
644                 short_opt = v
645                 summary = print detailed (multi-line) version text
646
647 m4_define(`BLOB_COMMANDS', `
648 [subcommand rm`$2']
649         purpose = remove `$1' blob(s)
650         non-opts-name = pattern...
651         aux_info = AFS_READ | AFS_WRITE
652         [description]
653                 Remove all `$1' blobs which match any of the given patterns.
654         [/description]
655
656 [subcommand mv`$2']
657         purpose = rename `$1' blob(s)
658         non-opts-name = source dest
659         aux_info = AFS_READ | AFS_WRITE
660         [description]
661                 Rename `$1' source to dest. The command fails if the source `$1'
662                 does not exist or if the destination `$1' already exists.
663         [/description]
664
665 [subcommand add`$2']
666         purpose = add a blob to the `$1' table
667         non-opts-name = `$1'_name
668         aux_info = AFS_READ | AFS_WRITE
669         [description]
670                 Read from stdin and ask the audio file selector to create a blob in
671                 the `$1' table. If the named blob already exists, it gets replaced
672                 with the new data.
673         [/description]
674
675 [subcommand cat`$2']
676         purpose = dump a `$1' blob to stdout
677         non-opts-name = `$1'_name
678         aux_info = AFS_READ
679
680 [subcommand ls`$2']
681         purpose = list blobs of type `$1' which match a pattern
682         non-opts-name = [pattern...]
683         aux_info = AFS_READ
684         [description]
685                 Print the list of all blobs which match the given pattern. If no
686                 pattern is given, the full list is printed.
687         [/description]
688         [option id-sort]
689                 short_opt = i
690                 summary = sort by identifier
691                 [help]
692                         The default is to sort alphabetically by name.
693                 [/help]
694         [option long]
695                 short_opt = l
696                 summary = long listing
697                 [help]
698                         Print identifier and name. The default is to print only the name.
699                 [/help]
700         [option reverse]
701                 short_opt = r
702                 summary = reverse sort order
703 ')
704
705 BLOB_COMMANDS(`moods', `mood')
706 BLOB_COMMANDS(`playlist', `pl')
707 BLOB_COMMANDS(`image', `img')
708 BLOB_COMMANDS(`lyrics', `lyr')