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