X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=m4%2Flls%2Fserver_cmd.suite.m4;h=079589d1f36eee98fb9a0c1252906b5d9b1e43a4;hp=e5bdcedec25dd0fdb59deb6678b003112581c529;hb=7e611b37e41f0ec7ec6d3173b7e88ed5b9b3a276;hpb=ba0a963f0a31848e7f622c45c56fa6ebf0b67057 diff --git a/m4/lls/server_cmd.suite.m4 b/m4/lls/server_cmd.suite.m4 index e5bdcede..079589d1 100644 --- a/m4/lls/server_cmd.suite.m4 +++ b/m4/lls/server_cmd.suite.m4 @@ -52,6 +52,77 @@ aux_info_prefix = Permissions: Print what is being done. [/help] +[subcommand addatt] + purpose = add new attribute(s) + non-opts-name = attribute... + aux_info = AFS_READ | AFS_WRITE + [description] + This adds new attributes to the attribute table. At most 64 attributes + may be defined. + [/description] + +[subcommand check] + purpose = run integrity checks on database tables + aux_info = AFS_READ + [description] + If no options are given, all checks are run. + [/description] + [option aft] + short_opt = a + summary = run audio file table checks + [help] + Report stale paths and invalid image and lyrics ids of the audio + file table. + [/help] + [option attribute] + short_opt = A + summary = check for invalid attributes + [help] + Report audio files whose attribute bitmask is invalid, i.e., has a bit + set which does not correspond to any attribute of the attribute table. + [/help] + [option mood] + short_opt = m + summary = check for invalid mood definitions + [help] + Run syntax checks on all moods of the mood table. + [/help] + [option playlist] + short_opt = p + summary = find invalid paths in playlists + [help] + Check all playlists for paths not contained in the audio file table. + [/help] + +[subcommand cpsi] + purpose = copy selected parts of the audio file selector info + non-opts-name = source pattern... + aux_info = AFS_READ | AFS_WRITE + [description] + If no option, or only --verbose is given, all fields of the audio + file selector info structure are copied to each row of the audio file + table whose path matches at least one of the given patterns. Otherwise, + only those fields which correspond to the given options are copied. + [/description] + [option attribute-bitmap] + short_opt = a + summary = copy the attribute bitmap + [option image-id] + short_opt = i + summary = copy the image id + [option lyrics-id] + short_opt = y + summary = copy the lyrics id + [option lastplayed] + short_opt = l + summary = copy the lastplayed timestamp + [option numplayed] + short_opt = n + summary = copy the numplayed counter + [option verbose] + short_opt = v + summary = enable verbose mode + [subcommand ff] purpose = jump N seconds forward or backward synopsis = n[-] @@ -73,10 +144,11 @@ aux_info_prefix = Permissions: non-opts-name = [command] aux_info = NO_PERMISSION_REQUIRED [description] - Without any arguments, help prints a list of available commands. When - called with a command name as first argument, it prints the description - of this command. + When executed without any arguments, the available server commands + are listed. Otherwise, if the first argument is the name of a server + command, the description of this command is shown. [/description] + m4_include(`long-help.m4') [subcommand hup] purpose = reload config file, log file and user list @@ -87,6 +159,16 @@ aux_info_prefix = Permissions: to the server process has the same effect as running this command. [/description] +[subcommand init] + purpose = initialize the database tables for the audio file selector + synopsis = [table_name...] + aux_info = AFS_READ | AFS_WRITE + [description] + When invoked without arguments, this command creates all + tables: audio_files, attributes, scores, moods, lyrics, images, + playlists. Otherwise only the given tables are created. + [/description] + [subcommand jmp] purpose = reposition the current stream non-opts-name = n @@ -97,6 +179,149 @@ aux_info_prefix = Permissions: n <= 100. [/description] +[subcommand ls] + purpose = list audio files which match a pattern + non-opts-name = [pattern...] + aux_info = AFS_READ + [description] + If no pattern is given, all files are listed. Otherwise, the command + lists all files of the audio file table whose path matches at least + one of the given patterns. + [/description] + [option listing-mode] + short_opt = l + summary = use alternative output format + arg_type = string + arg_info = optional_arg + typestr = mode + default_val = long + [help] + The optional mode argument is either a single character or a word + according to the following list. + + short (s). List only the path or basename (last component of the path), + depending on whether -p is also given. This listing mode acts as if + --listing-mode had not been given. + + long (l). Show detailed information. This is the default if no argument + to --listing-mode is supplied. + + verbose (v). Multi-line output, one row per data field stored in the + audio file table. + + parser-friendly (p). Like verbose listing mode, but use numerical + values for the names of the output fields and prefix each line with + a length field. + + mbox (m). Generate output suitable to be viewed with a mail + program. One "mail" per matching audio file. + + chunk-table (c). Print path (or basename, depending on whether -p is + also given), chunk time and chunk offsets. + + [/help] + [option basename] + short_opt = b + summary = list and match basenames only + [help] + Print only the basename of each matching file and match only the + basenames of the paths stored in the audio file table against the + given patterns. The default is to print and match the full path. + [/help] + [option admissible] + short_opt = a + summary = list only admissible files + [help] + List only files which are admissible with respect to the current mood + or playlist. + [/help] + [option reverse] + short_opt = r + summary = reverse sort order + [option unix-date] + short_opt = d + summary = print dates as seconds after the epoch + [option sort] + short_opt = s + summary = change sort order + arg_type = string + arg_info = required_arg + typestr = order + default_val = path + [help] + The sort order must be given as an required argument. Like for + --listing-mode, this argument may either be a single character or a + word, according to the following list. + + path (p). Sort alphabetically by path or basename, depending on + whether -b is given. This is the default if --sort is not given. + + score (s). Iterate over the entries of the score table, rather than + the audio file table. This sort order implies --admissible, since + the score table contains only admissible files. + + lastplayed (l) + + numplayed (n) + + frequency (f) + + channels (c) + + image-id (i) + + lyrics-id (y) + + bitrate (b) + + duration (d) + + audio-format (a) + + hash (h) + + If --sort is not given, path sort is implied. + [/help] + +[subcommand lsatt] + purpose = list attributes + aux_info = AFS_READ + [description] + Print the list of all defined attributes which match the given + pattern. If no pattern is given, the full list is printed. + [/description] + + [option id-sort] + short_opt = i + summary = sort attributes by id + [help] + The default is to sort alphabetically by name. + + Attributes are internally represented as an 64 bit array. The attribute + id is the bit number in this array. + [/help] + [option long] + short_opt = l + summary = print long listing + [help] + The long listing prints the attribute id in addition to the name of + the attribute. The id is printed as a decimal number and is separated + from the name by a tab character. + [/help] + [option reverse] + short_opt = r + summary = reverse sort order + +[subcommand mvatt] + purpose = rename an attribute + synopsis = source dest + aux_info = AFS_READ | AFS_WRITE + [description] + Rename the attribute given by the first argument to the destination + given by the second argument. It is an error if the destination + attribute exists. + [/description] + [subcommand next] purpose = close the stream and start to stream the next audio file aux_info = VSS_READ | VSS_WRITE @@ -135,23 +360,108 @@ aux_info_prefix = Permissions: Set the 'P' (playing) bit of the vss status flags. [/description] +[subcommand rm] + purpose = remove rows from the audio file table + non-opts-name = pattern... + aux_info = AFS_READ | AFS_WRITE + [description] + Remove all rows of the audio file table which match any of the given + patterns. Note that this affects only the database table; the command + won't touch your audio files on disk. + [/description] + [option verbose] + short_opt = v + summary = print paths of deleted rows + [option force] + short_opt = f + summary = don't complain if nothing was removed + [option pathname-match] + short_opt = p + summary = modify matching behaviour + [help] + Match a slash in the path only with a slash in pattern and not by an + asterisk (*) or a question mark (?) metacharacter, nor by a bracket + expression ([]) containing a slash (see fnmatch(3)). + [/help] + +[subcommand rmatt] + purpose = remove attribute(s) + non-opts-name = pattern... + aux_info = AFS_READ | AFS_WRITE + [description] + Remove all attributes which match any given pattern. All information + about the removed attributes in the audio file table is lost. + [/description] + +[subcommand select] + purpose = activate a mood or a playlist + non-opts-name = specifier/name + aux_info = AFS_READ | AFS_WRITE + [description] + The specifier is either 'm' or 'p' to indicate whether a playlist or + a mood should be activated. Example: + + select m/foo + + activates the mood named 'foo'. + [/description] + [subcommand sender] purpose = control paraslash senders - synopsis = [sender cmd [arguments]] + synopsis = [sender subcmd [arguments]] aux_info = VSS_READ | VSS_WRITE [description] - Send a command to a specific sender. The following commands are - available, but not all senders support every command. + This command executes a subcommand for the given sender, which is + one of "http", "dccp" or "udp". Various subcommands exist to print + information about the sender, to activate and deactivate the sender, + and to change the access permissions and targets. The following + subcommands are available: - help, on, off, add, delete, allow, deny, status. + help, status, on, off, allow, deny, add, delete. - The help command prints the help text of the given sender. If no - command is given the list of available senders is shown. + All senders support the first four commands. The "allow" and "deny" + commands are supported by the http and the dccp senders while "add" + and "delete" are only supported by the udp sender. If no sender is + given, the list of available senders is shown. - Example: + Examples: + + Get help for the udp sender (contains further examples): + + sender udp help + + Show the access control list and the number of connected clients of + the http sender: + + sender http status + + Senders may be activated and deactivated independently of each + other. The following command switches off the dccp sender: + + sender dccp off + + Add an UDP unicast for a client to the target list of the UDP sender: + + sender udp add client.foo.org + + Start UDP multicast, using the default multicast address: + + sender udp add 224.0.1.38 + + [/description] + +[subcommand setatt] + purpose = set or unset attributes + synopsis = attribute{+|-}... pattern... + aux_info = AFS_READ | AFS_WRITE + [description] + Set ('+') or unset ('-') the given attributes for all audio files + matching the given pattern. Example: - para_client sender http help + setatt rock+ punk+ pop- '*foo.mp3' + sets the 'rock' and the 'punk' attribute and unsets the 'pop' attribute + of all files ending with 'foo.mp3'. [/description] [subcommand si] @@ -191,11 +501,12 @@ aux_info_prefix = Permissions: [/description] [subcommand tasks] - purpose = list active server tasks + purpose = list active server tasks (deprecated) aux_info = NO_PERMISSION_REQUIRED [description] - For each task, print ID, status and name. This is mostly useful - for debugging. + This used to print the ID, the status and the name of each task, + mainly for debugging purposes. As of version 0.6.2, the subcommand + prints nothing. It will be removed in 0.7.0. Don't use. [/description] [subcommand term] @@ -207,6 +518,119 @@ aux_info_prefix = Permissions: necessary to send SIGKILL. [/description] +[subcommand touch] + purpose = manipulate the afs information of audio files + non-opts-name = pattern... + aux_info = AFS_READ | AFS_WRITE + [description] + This command modifies the afs info structure of all rows of the audio + file table whose path matches at least one of the given patters. + + If at least one option is given which takes a number as its argument, + only those fields of the afs info structure are updated which + correspond to the given options while all other fields stay unmodified. + + If no such option is given, the lastplayed field is set to the current + time and the value of the numplayed field is increased by one while + all other fields are left unchanged. This mimics what happens when + the virtual streaming system selects the file for streaming. + + If the file is admissible for the current mood (or contained in the + current playlist), its score is recomputed according to the changed + values. + [/description] + [option numplayed] + short_opt = n + summary = set the numplayed count manually + arg_type = uint32 + arg_info = required_arg + typestr = num + [help] + The numplayed count of an audio file is the number of times the file + was selected for streaming. It is one of the inputs to the scoring + function which determines the order in which admissible files are + streamed. + + The virtual streaming system increases this number automatically each + time it opens the file for streaming. + [/help] + [option lastplayed] + short_opt = l + summary = set the lastplayed time manually + arg_type = uint64 + arg_info = required_arg + typestr = num + [help] + The lastplayed time of an audio file is the time when the file was + last opened for streaming. + + Like the numplayed count, it is an input for the scoring function + and is updated automatically by the virtual streaming system. + + The argument must be a number of seconds since the epoch. Example: + + touch -l=$(date +%s) file + + sets the lastplayed time of 'file' to the current time. + [/help] + [option image-id] + short_opt = i + summary = set the image id + arg_type = uint32 + arg_info = required_arg + typestr = num + [help] + The afs info structure of each row of the audio file table contains + a slot for the image id of the audio file that corresponds to the + row. The image id stored in this slot refers to the key in the image + table that identifies the blob. + + When a new audio file is added to the audio file table, its image + id starts out as zero, indicating that there is no image associated + with the file. Setting the image id to a non-zero number associates + the file with a particular blob of the image table, for example the + cover art of the album in jpg format. + [/help] + [option lyrics-id] + short_opt = y + summary = set the lyrics id + arg_type = uint32 + arg_info = required_arg + typestr = num + [help] + This option works just like --image-id, but sets the lyrics ID rather + than the image id. + [/help] + [option amp] + short_opt = a + summary = set the amplification value (0-255) + arg_type = uint32 + arg_info = required_arg + typestr = num + [help] + The amplification value of an audio file is a number which is stored + in the afs info structure. + + The value determines the scaling factor by which the amplitude of + the decoded samples should be multiplied in order to normalize the + volume. A value of zero means no amplification, 64 means the amplitude + should be multiplied by a factor of two, 128 by three and so on. + + The amp filter of para_audiod amplifies the volume according to + this value. + [/help] + [option verbose] + short_opt = v + summary = explain what is being done + [option pathname-match] + short_opt = p + summary = modify matching behaviour + [help] + Match a slash in the path only with a slash in pattern and not by an + asterisk (*) or a question mark (?) metacharacter, nor by a bracket + expression ([]) containing a slash (see fnmatch(3)). + [/help] + [subcommand version] purpose = print the git version string of para_server aux_info = NO_PERMISSION_REQUIRED @@ -214,3 +638,65 @@ aux_info_prefix = Permissions: short_opt = v summary = print detailed (multi-line) version text +m4_define(`BLOB_COMMANDS', ` +[subcommand rm`$2'] + purpose = remove `$1' blob(s) + non-opts-name = pattern... + aux_info = AFS_READ | AFS_WRITE + [description] + Remove all `$1' blobs which match any of the given patterns. + [/description] + +[subcommand mv`$2'] + purpose = rename `$1' blob(s) + non-opts-name = source dest + aux_info = AFS_READ | AFS_WRITE + [description] + Rename `$1' source to dest. The command fails if the source `$1' + does not exist or if the destination `$1' already exists. + [/description] + +[subcommand add`$2'] + purpose = add a blob to the `$1' table + non-opts-name = `$1'_name + aux_info = AFS_READ | AFS_WRITE + [description] + Read from stdin and ask the audio file selector to create a blob in + the `$1' table. If the named blob already exists, it gets replaced + with the new data. + [/description] + +[subcommand cat`$2'] + purpose = dump a `$1' blob to stdout + non-opts-name = `$1'_name + aux_info = AFS_READ + +[subcommand ls`$2'] + purpose = list blobs of type `$1' which match a pattern + non-opts-name = [pattern...] + aux_info = AFS_READ + [description] + Print the list of all blobs which match the given pattern. If no + pattern is given, the full list is printed. + [/description] + [option id-sort] + short_opt = i + summary = sort by identifier + [help] + The default is to sort alphabetically by name. + [/help] + [option long] + short_opt = l + summary = long listing + [help] + Print identifier and name. The default is to print only the name. + [/help] + [option reverse] + short_opt = r + summary = reverse sort order +') + +BLOB_COMMANDS(`moods', `mood') +BLOB_COMMANDS(`playlist', `pl') +BLOB_COMMANDS(`image', `img') +BLOB_COMMANDS(`lyrics', `lyr')