Merge commit 'meins/maint' into maint
[paraslash.git] / afs.cmd
1 OF: afs_command_list
2 SF: afs.c aft.c attribute.c
3 HC: Prototypes for the commands of the audio file selector.
4 CC: Array of commands for the audio file selector.
5 AT: server_command
6 IN: para error string afh afs server list user_list
7 SN: list of afs commands
8 TM: mood lyr img pl
9 ---
10 N: add
11 P: AFS_READ | AFS_WRITE
12 D: Add new audio files to the database.
13 U: add [-l] [-f] [-v] path...
14 H: Each given path may be either the full path to an audio
15 H: file, or the full path of a directory. In case of a
16 H: directory, all audio files in that directory are added
17 H: recursively. Only absolute paths are accepted.
18 H:
19 H: Options:
20 H:
21 H: -a   Add all files. The default is to add only files ending in a
22 H:      known suffix for a supported audio format.
23 H:
24 H: -l   Add files lazily. If the path already exists in the
25 H:      database, skip this file.  This operation is really cheap.
26 H:      Use it when adding large directories if only a few files
27 H:      where added.
28 H:
29 H:-f    Force adding/updating. Recompute the audio format handler data
30 H:      even if a file with the same path and the same hash value exists.
31 H:
32 H: -v   Verbose mode. Print what is being done.
33 ---
34 N: init
35 P: AFS_READ | AFS_WRITE
36 D: Initialize the osl tables for the audio file selector.
37 U: init [table_name ...]
38 H: When invoked without arguments, this command creates all tables. Otherwise
39 H: only the tables given by table_name... are created.
40 ---
41 N: ls
42 P: AFS_READ
43 D: List audio files.
44 U: ls [-l[s|l|v|m]] [-p] [-a] [-r] [-d] [-s{p|s|l|n|f|c|i|y|b|d|a}] [pattern...]
45 H: Print a list of all audio files matching pattern.
46 H:
47 H: Options:
48 H:
49 H: -l   Change listing mode. Defaults to short listing if not given.
50 H:
51 H:              -ls:   short listing mode
52 H:
53 H:              -ll:   long listing mode (equivalent to -l)
54 H:
55 H:              -lv:   verbose listing mode
56 H:
57 H:              -lm:   mbox listing mode
58 H:
59 H:              -lc:   chunk-table listing mode
60 H:
61 H: -p   List full path of audio file. If not specified, only the basename
62 H:      of each file is printed.
63 H:
64 H: -a   List only files that are admissible with respect to the current mood or
65 H:      playlist.
66 H:
67 H: -r   Reverse sort order.
68 H:
69 H: -d   Print dates as seconds after the epoch.
70 H:
71 H: -s   Change sort order. Defaults to alphabetical path sort if not given.
72 H:
73 H:              -sp:  sort by path.
74 H:
75 H:              -sl:  sort by last played time.
76 H:
77 H:              -ss:  sort by score (implies -a).
78 H:
79 H:              -sn:  sort by num played count.
80 H:
81 H:              -sf:  sort by frequency.
82 H:
83 H:              -sc:  sort by number of channels.
84 H:
85 H:              -si:  sort by image id.
86 H:
87 H:              -sy:  sort by lyrics id.
88 H:
89 H:              -sb:  sort by bit rate.
90 H:
91 H:              -sd:  sort by duration.
92 H:
93 H:              -sa:  sort by audio format.
94 ---
95 N: lsatt
96 P: AFS_READ
97 D: List attributes
98 U: lsatt [-i] [-l] [-r] [pattern]
99 H: Print the list of all defined attributes which match the
100 H: given pattern. If no pattern is given, the full list is
101 H: printed.
102 H:
103 H: Options:
104 H:
105 H: -i   Sort attributes by id. The default is to sort alphabetically by name.
106 H:
107 H: -l   Print a long listing containing both identifier and attribute name. The
108 H:      default is to print only the name.
109 H:
110 H: -r   Reverse sort order.
111 ---
112 N: setatt
113 P: AFS_READ | AFS_WRITE
114 D: Set attribute(s) for all files matching a pattern.
115 U: setatt attribute{+|-}... pattern
116 H: Set ('+') or unset ('-') the given attributes for all audio files matching
117 H: pattern.  Example:
118 H:
119 H:         setatt rock+ punk+ classic- '*foo.mp3'
120 H:
121 H: sets the 'rock' and the 'punk' attribute but unsets the 'classic'
122 H: attribute of all files ending with 'foo.mp3'.
123 ---
124 N: addatt
125 P: AFS_READ | AFS_WRITE
126 D: Add new attribute(s).
127 U: addatt attribute1...
128 H: This adds new attributes to the attribute table. At most 64
129 H: attributes may be defined.
130 ---
131 N: mvatt
132 P: AFS_READ | AFS_WRITE
133 D: Rename an attribute.
134 U: mvatt old new
135 H: Rename attribute old to new.
136 ---
137 N: check
138 P: AFS_READ
139 D: Run integrity checks against osl tables.
140 U: check [-a] [-m] [-p]
141 H: Check the audio file table, the mood definitions and all
142 H: defined playlists and report any inconsistencies found.
143 H:
144 H: Options:
145 H:
146 H: -a   Run audio file table checks. Checks for entries in the audio file
147 H:      table which are not present in the file system. Moreover, it checks
148 H:      whether the lyrics id and all entries in the audio file table are
149 H:      valid.
150 H:
151 H: -m   Run syntax checks on all defined moods in the mood table.
152 H:
153 H: -p   Check all playlists for lines that correspond to files not contained
154 H:      in the audio file table.
155 H:
156 H: If called without arguments, all three checks are run.
157 ---
158 N: rmatt
159 P: AFS_READ | AFS_WRITE
160 D: Remove attribute(s).
161 U: rmatt pattern...
162 H: Remove all attributes matching any given pattern. All information
163 H: about this attribute in the audio file table is lost.
164 ---
165 N: rm
166 P: AFS_READ | AFS_WRITE
167 D: Remove entries from the audio file table.
168 U: rm [-v] [-f] [-p] pattern...
169 H: Delete all entries in the audio file table that match any given pattern.
170 H: Note that affects the table entries only; paraslash won't touch your
171 H: audio files in any way.
172 H: Options:
173 H:
174 H: -v   Verbose mode. Explain what is being done.
175 H:
176 H: -f   Force mode. Ignore nonexistent files. Don't complain if nothing
177 H:      was removed.
178 H:
179 H: -p   Pathname match. Match a slash in the path only with a slash
180 H:      in pattern and not by an asterisk (*) or a question mark
181 H:      (?) metacharacter, nor by a bracket expression ([]) containing
182 H:      a slash (see fnmatch(3)).
183 ---
184 N: touch
185 P: AFS_READ | AFS_WRITE
186 D: Manipulate the afs data for all audio files matching a pattern.
187 U: touch [-n numplayed] [-l lastplayed] [-y lyrics_id] [-i image_id] [-a amp] [-v] [-p] pattern
188 H: If no option is given, lastplayed is set to the current time
189 H: and numplayed is increased by one. Otherwise, only the given
190 H: options are taken into account.
191 H:
192 H: Options:
193 H:
194 H: -n   Set numplayed count. The number of times afs has selected this
195 H:      audio file for streaming.
196 H:
197 H: -l   Set lastplayed time. The last time this audio file was selected.
198 H:      Must be given as the number of seconds since the epoch. Example:
199 H:
200 H:              touch -l $(date +%s) file
201 H:
202 H:      sets the lastplayed time of 'file' to the current time.
203 H:
204 H: -y   Set the lyrics id. Specify the lyrics data file associated with
205 H:      this audio file.
206 H:
207 H: -i   Set the image id. Same as -y, but sets the image.
208 H:
209 H: -a   Set the amplification value (0-255). This determines a scaling
210 H:      factor by which the amplitude should be multiplied in order to
211 H:      normalize the volume of the audio file.  A value of zero means
212 H:      no amplification, 64 means the amplitude should be multiplied
213 H:      by a factor of two, 128 by three and so on.
214 H:
215 H:      This value is used by the compress filter.
216 H:
217 H: -v   Verbose mode. Explain what is being done.
218 H:
219 H: -p   Pathname match. Match a slash in the path only with a slash
220 H:      in pattern and not by an asterisk (*) or a question mark
221 H:      (?) metacharacter, nor by a bracket expression ([]) containing
222 H:      a slash (see fnmatch(3)).
223 ---
224 N: cpsi
225 P: AFS_READ | AFS_WRITE
226 D: Copy audio file selector info.
227 U: cpsi [-a] [-y] [-i] [-l] [-n] [-v] source pattern...
228 H: If no option, or only the -v option is given, all fields of
229 H: the audio file selector info are copied to all files
230 H: matching pattern.  Otherwise, only the given options are
231 H: taken into account.
232 H:
233 H: Options:
234 H:
235 H: -a   Copy attributes.
236 H:
237 H: -y   Copy the lyrics id.
238 H:
239 H: -i   Copy the image id.
240 H:
241 H: -l   Copy the lastplayed time.
242 H:
243 H: -n   Copy the numplayed count.
244 H:
245 H: -v   Verbose mode.
246 ---
247 N: select
248 P: AFS_READ | AFS_WRITE
249 D: Activate a mood or a playlist.
250 U: select specifier/name
251 H: The specifier is either 'm' or 'p' to indicate whether a playlist or
252 H: a mood should be activated. Example:
253 H:
254 H:      select m/foo
255 H:
256 H: loads the mood named 'foo'.
257 ---
258 T: add
259 N: add@member@
260 O: int com_add@member@(int fd, int argc, char * const * const argv);
261 P: AFS_READ | AFS_WRITE
262 D: Read data from stdin and add it as a blob to the @member@ table.
263 U: add@member@ @member@_name
264 H: Read arbitrary binary data from stdin and send that data to
265 H: the audio file selector process which creates a new blob for
266 H: the data in the corresponding osl table.
267 H:
268 H: The names of the blobs of a table are unique. If an entry with the
269 H: given name already exists, its contents are replaced by the new data.
270 ---
271 T: cat
272 N: cat@member@
273 O: int com_cat@member@(int fd, int argc, char * const * const argv);
274 P: AFS_READ
275 D: Dump the contents of a blob of type @member@ to stdout.
276 U: cat@member@ @member@_name
277 H: This command may be used to retrieve the blob identified by
278 H: the given name from the corresponding osl table to which
279 H: they were previously added.
280 ---
281 T: ls
282 N: ls@member@
283 O: int com_ls@member@(int fd, int argc, char * const * const argv);
284 P: AFS_READ
285 D: List blobs of type @member@ matching a pattern.
286 U: ls@member@ [-i] [-l] [-r] [pattern]
287 H: Print a list of the names of all blobs in the corresponding
288 H: osl table which match the given pattern. If no pattern is
289 H: given, the full list is printed.
290 H:
291 H: Options:
292 H:
293 H: -i   Sort attributes by id. The default is to sort
294 H:      alphabetically by name.
295 H:
296 H: -l   Print a long listing containing both identifier and
297 H:      attribute name. The default is to print only the name.
298 H:
299 H: -r   Reverse sort order.
300 ---
301 T: rm
302 N: rm@member@
303 O: int com_rm@member@(int fd, int argc, char * const * const argv);
304 P: AFS_READ | AFS_WRITE
305 D: Remove blob(s) of type @member@ from the @member@ table.
306 U: rm@member@ pattern...
307 H: Remove all blobs from the corresponding table which match
308 H: any given pattern.
309 ---
310 T: mv
311 N: mv@member@
312 O: int com_mv@member@(int fd, int argc, char * const * const argv);
313 P: AFS_READ | AFS_WRITE
314 D: Rename a blob of type @member@.
315 U: mv@member@ old_@member@_name new_@member@_name
316 H: Rename the blob identified by the first name as the second name.