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