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