]> git.tuebingen.mpg.de Git - paraslash.git/blob - m4/lls/server_cmd.suite.m4
8784fe7816f60e25503e7b19f4107714dca56587
[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                 [help]
237                         List only files which are admissible with respect to the current mood
238                         or playlist.
239                 [/help]
240         [option reverse]
241                 short_opt = r
242                 summary = reverse sort order
243         [option unix-date]
244                 short_opt = d
245                 summary = print dates as seconds after the epoch
246         [option sort]
247                 short_opt = s
248                 summary = change sort order
249                 arg_type = string
250                 arg_info = required_arg
251                 typestr = order
252                 default_val = path
253                 [help]
254                         The sort order must be given as an required argument. Like for
255                         --listing-mode, this argument may either be a single character or a
256                         word, according to the following list.
257
258                         path (p). Sort alphabetically by path or basename, depending on
259                         whether -b is given. This is the default if --sort is not given.
260
261                         score (s). Iterate over the entries of the score table, rather than
262                         the audio file table. This sort order implies --admissible, since
263                         the score table contains only admissible files.
264
265                         lastplayed (l)
266
267                         numplayed (n)
268
269                         frequency (f)
270
271                         channels (c)
272
273                         image-id (i)
274
275                         lyrics-id (y)
276
277                         bitrate (b)
278
279                         duration (d)
280
281                         audio-format (a)
282
283                         hash (h)
284
285                         If --sort is not given, path sort is implied.
286                 [/help]
287
288 [subcommand lsatt]
289         purpose = list attributes
290         aux_info = AFS_READ
291         [description]
292                 Print the list of all defined attributes which match the given
293                 pattern. If no pattern is given, the full list is printed.
294         [/description]
295
296         [option id-sort]
297                 short_opt = i
298                 summary = sort attributes by id
299                 [help]
300                         The default is to sort alphabetically by name.
301
302                         Attributes are internally represented as an 64 bit array. The attribute
303                         id is the bit number in this array.
304                 [/help]
305         [option long]
306                 short_opt = l
307                 summary = print long listing
308                 [help]
309                         The long listing prints the attribute id in addition to the name of
310                         the attribute. The id is printed as a decimal number and is separated
311                         from the name by a tab character.
312                 [/help]
313         [option reverse]
314                 short_opt = r
315                 summary = reverse sort order
316
317 [subcommand mvatt]
318         purpose = rename an attribute
319         synopsis = source dest
320         aux_info = AFS_READ | AFS_WRITE
321         [description]
322                 Rename the attribute given by the first argument to the destination
323                 given by the second argument. It is an error if the destination
324                 attribute exists.
325         [/description]
326
327 [subcommand next]
328         purpose = close the stream and start to stream the next audio file
329         aux_info = VSS_READ | VSS_WRITE
330         [description]
331                 Set the 'N' (next audio file) bit of the vss status flags. This
332                 instructs the server to close the current stream, if any. The 'P'
333                 (playing) bit is not modified by this command. If it is on, playing
334                 continues with the next audio file.
335
336                 This command is equivalent to stop if paused, and has no effect
337                 if stopped.
338         [/description]
339
340 [subcommand nomore]
341         purpose = stop playing after current audio file
342         aux_info = VSS_READ | VSS_WRITE
343         [description]
344                 Set the 'O' (no more) bit of the vss status flags which asks
345                 para_server to clear the 'P' (playing) bit after the 'N' (next audio
346                 file) bit transitions from off to on (because the end of the current
347                 audio file is reached). Use this command instead of stop if you don't
348                 like sudden endings.
349         [/description]
350
351 [subcommand pause]
352         purpose = suspend the current stream
353         aux_info = VSS_READ | VSS_WRITE
354         [description]
355                 Clear the 'P' (playing) bit of the vss status flags.
356         [/description]
357
358 [subcommand play]
359         purpose = start or resume playback
360         aux_info = VSS_READ | VSS_WRITE
361         [description]
362                 Set the 'P' (playing) bit of the vss status flags.
363         [/description]
364
365 [subcommand rm]
366         purpose = remove rows from the audio file table
367         non-opts-name = pattern...
368         aux_info = AFS_READ | AFS_WRITE
369         [description]
370                 Remove all rows of the audio file table which match any of the given
371                 patterns. Note that this affects only the database table; the command
372                 won't touch your audio files on disk.
373         [/description]
374         [option verbose]
375                 short_opt = v
376                 summary = print paths of deleted rows
377         [option force]
378                 short_opt = f
379                 summary = don't complain if nothing was removed
380         [option pathname-match]
381                 short_opt = p
382                 summary = modify matching behaviour
383                 [help]
384                         Match a slash in the path only with a slash in pattern and not by an
385                         asterisk (*) or a question mark (?) metacharacter, nor by a bracket
386                         expression ([]) containing a slash (see fnmatch(3)).
387                 [/help]
388
389 [subcommand rmatt]
390         purpose = remove attribute(s)
391         non-opts-name = pattern...
392         aux_info = AFS_READ | AFS_WRITE
393         [description]
394                 Remove all attributes which match any given pattern. All information
395                 about the removed attributes in the audio file table is lost.
396         [/description]
397
398 [subcommand select]
399         purpose = activate a mood or a playlist
400         non-opts-name = specifier/name
401         aux_info = AFS_READ | AFS_WRITE
402         [description]
403                 The specifier is either 'm' or 'p' to indicate whether a playlist or
404                 a mood should be activated. Example:
405
406                         select m/foo
407
408                 activates the mood named 'foo'.
409         [/description]
410         [option verbose]
411                 short_opt = v
412                 summary = print information about the loaded mood or playlist
413
414 [subcommand sender]
415         purpose = control paraslash senders
416         synopsis = [sender subcmd [arguments]]
417         aux_info = VSS_READ | VSS_WRITE
418         [description]
419                 This command executes a subcommand for the given sender, which is
420                 one of "http", "dccp" or "udp". Various subcommands exist to print
421                 information about the sender, to activate and deactivate the sender,
422                 and to change the access permissions and targets. The following
423                 subcommands are available:
424
425                        help, status, on, off, allow, deny, add, delete.
426
427                 All senders support the first four commands. The "allow" and "deny"
428                 commands are supported by the http and the dccp senders while "add"
429                 and "delete" are only supported by the udp sender. If no sender is
430                 given, the list of available senders is shown.
431
432                 Examples:
433
434                 Get help for the udp sender (contains further examples):
435
436                         sender udp help
437
438                 Show the access control list and the number of connected clients of
439                 the http sender:
440
441                         sender http status
442
443                 Senders may be activated and deactivated independently of each
444                 other. The following command switches off the dccp sender:
445
446                         sender dccp off
447
448                 Add an UDP unicast for a client to the target list of the UDP sender:
449
450                         sender udp add client.foo.org
451
452                 Start UDP multicast, using the default multicast address:
453
454                         sender udp add 224.0.1.38
455
456         [/description]
457
458 [subcommand setatt]
459         purpose = set or unset attributes
460         synopsis = attribute{+|-}... pattern...
461         aux_info = AFS_READ | AFS_WRITE
462         [description]
463                 Set ('+') or unset ('-') the given attributes for all audio files
464                 matching the given pattern. Example:
465
466                         setatt rock+ punk+ pop- '*foo.mp3'
467
468                 sets the 'rock' and the 'punk' attribute and unsets the 'pop' attribute
469                 of all files ending with 'foo.mp3'.
470         [/description]
471
472 [subcommand si]
473         purpose = print server info
474         aux_info = NO_PERMISSION_REQUIRED
475         [description]
476                 Show server and afs PID, number of connections, uptime and more.
477         [/description]
478
479 [subcommand stat]
480         purpose = print information about the current audio file
481         aux_info = VSS_READ
482         [option num]
483                 short_opt = n
484                 summary = number of times to show the status info
485                 arg_info = required_arg
486                 arg_type = uint32
487                 typestr = num
488                 [help]
489                         Exit after the status information has been shown num times. If this
490                         option is not given, the command runs in an endless loop.
491                 [/help]
492         [option parser-friendly]
493                 short_opt = p
494                 summary = enable parser-friendly output
495                 [help]
496                         Show status item identifiers as numerical values and prefix each
497                         status item with its size in bytes.
498                 [/help]
499
500 [subcommand stop]
501         purpose = stop playback
502         aux_info = VSS_READ | VSS_WRITE
503         [description]
504                 Clear the 'P' (playing) bit and set the 'N' (next audio file) bit of
505                 the vss status flags, effectively stopping playback.
506         [/description]
507
508 [subcommand term]
509         purpose = ask the server to terminate
510         aux_info = VSS_READ | VSS_WRITE
511         [description]
512                 Shut down the server. Instead of this command, you can also send
513                 SIGINT or SIGTERM to the para_server process. It should never be
514                 necessary to send SIGKILL.
515         [/description]
516
517 [subcommand touch]
518         purpose = manipulate the afs information of audio files
519         non-opts-name = pattern...
520         aux_info = AFS_READ | AFS_WRITE
521         [description]
522                 This command modifies the afs info structure of all rows of the audio
523                 file table whose path matches at least one of the given patters.
524
525                 If at least one option is given which takes a number as its argument,
526                 only those fields of the afs info structure are updated which
527                 correspond to the given options while all other fields stay unmodified.
528
529                 If no such option is given, the lastplayed field is set to the current
530                 time and the value of the numplayed field is increased by one while
531                 all other fields are left unchanged. This mimics what happens when
532                 the virtual streaming system selects the file for streaming.
533
534                 If the file is admissible for the current mood (or contained in the
535                 current playlist), its score is recomputed according to the changed
536                 values.
537         [/description]
538         [option numplayed]
539                 short_opt = n
540                 summary = set the numplayed count manually
541                 arg_type = uint32
542                 arg_info = required_arg
543                 typestr = num
544                 [help]
545                         The numplayed count of an audio file is the number of times the file
546                         was selected for streaming. It is one of the inputs to the scoring
547                         function which determines the order in which admissible files are
548                         streamed.
549
550                         The virtual streaming system increases this number automatically each
551                         time it opens the file for streaming.
552                 [/help]
553         [option lastplayed]
554                 short_opt = l
555                 summary = set the lastplayed time manually
556                 arg_type = uint64
557                 arg_info = required_arg
558                 typestr = num
559                 [help]
560                         The lastplayed time of an audio file is the time when the file was
561                         last opened for streaming.
562
563                         Like the numplayed count, it is an input for the scoring function
564                         and is updated automatically by the virtual streaming system.
565
566                         The argument must be a number of seconds since the epoch. Example:
567
568                                 touch -l=$(date +%s) file
569
570                         sets the lastplayed time of 'file' to the current time.
571                 [/help]
572         [option image-id]
573                 short_opt = i
574                 summary = set the image id
575                 arg_type = uint32
576                 arg_info = required_arg
577                 typestr = num
578                 [help]
579                         The afs info structure of each row of the audio file table contains
580                         a slot for the image id of the audio file that corresponds to the
581                         row. The image id stored in this slot refers to the key in the image
582                         table that identifies the blob.
583
584                         When a new audio file is added to the audio file table, its image
585                         id starts out as zero, indicating that there is no image associated
586                         with the file. Setting the image id to a non-zero number associates
587                         the file with a particular blob of the image table, for example the
588                         cover art of the album in jpg format.
589                 [/help]
590         [option lyrics-id]
591                 short_opt = y
592                 summary = set the lyrics id
593                 arg_type = uint32
594                 arg_info = required_arg
595                 typestr = num
596                 [help]
597                         This option works just like --image-id, but sets the lyrics ID rather
598                         than the image id.
599                 [/help]
600         [option amp]
601                 short_opt = a
602                 summary = set the amplification value (0-255)
603                 arg_type = uint32
604                 arg_info = required_arg
605                 typestr = num
606                 [help]
607                         The amplification value of an audio file is a number which is stored
608                         in the afs info structure.
609
610                         The value determines the scaling factor by which the amplitude of
611                         the decoded samples should be multiplied in order to normalize the
612                         volume. A value of zero means no amplification, 64 means the amplitude
613                         should be multiplied by a factor of two, 128 by three and so on.
614
615                         The amp filter of para_audiod amplifies the volume according to
616                         this value.
617                 [/help]
618         [option verbose]
619                 short_opt = v
620                 summary = explain what is being done
621         [option pathname-match]
622                 short_opt = p
623                 summary = modify matching behaviour
624                 [help]
625                         Match a slash in the path only with a slash in pattern and not by an
626                         asterisk (*) or a question mark (?) metacharacter, nor by a bracket
627                         expression ([]) containing a slash (see fnmatch(3)).
628                 [/help]
629
630 [subcommand version]
631         purpose = print the git version string of para_server
632         aux_info = NO_PERMISSION_REQUIRED
633         [option verbose]
634                 short_opt = v
635                 summary = print detailed (multi-line) version text
636
637 m4_define(`BLOB_COMMANDS', `
638 [subcommand rm`$2']
639         purpose = remove `$1' blob(s)
640         non-opts-name = pattern...
641         aux_info = AFS_READ | AFS_WRITE
642         [description]
643                 Remove all `$1' blobs which match any of the given patterns.
644         [/description]
645
646 [subcommand mv`$2']
647         purpose = rename `$1' blob(s)
648         non-opts-name = source dest
649         aux_info = AFS_READ | AFS_WRITE
650         [description]
651                 Rename `$1' source to dest. The command fails if the source `$1'
652                 does not exist or if the destination `$1' already exists.
653         [/description]
654
655 [subcommand add`$2']
656         purpose = add a blob to the `$1' table
657         non-opts-name = `$1'_name
658         aux_info = AFS_READ | AFS_WRITE
659         [description]
660                 Read from stdin and ask the audio file selector to create a blob in
661                 the `$1' table. If the named blob already exists, it gets replaced
662                 with the new data.
663         [/description]
664
665 [subcommand cat`$2']
666         purpose = dump a `$1' blob to stdout
667         non-opts-name = `$1'_name
668         aux_info = AFS_READ
669
670 [subcommand ls`$2']
671         purpose = list blobs of type `$1' which match a pattern
672         non-opts-name = [pattern...]
673         aux_info = AFS_READ
674         [description]
675                 Print the list of all blobs which match the given pattern. If no
676                 pattern is given, the full list is printed.
677         [/description]
678         [option id-sort]
679                 short_opt = i
680                 summary = sort by identifier
681                 [help]
682                         The default is to sort alphabetically by name.
683                 [/help]
684         [option long]
685                 short_opt = l
686                 summary = long listing
687                 [help]
688                         Print identifier and name. The default is to print only the name.
689                 [/help]
690         [option reverse]
691                 short_opt = r
692                 summary = reverse sort order
693 ')
694
695 BLOB_COMMANDS(`moods', `mood')
696 BLOB_COMMANDS(`playlist', `pl')
697 BLOB_COMMANDS(`image', `img')
698 BLOB_COMMANDS(`lyrics', `lyr')