afs: Rename callback_function to afs_callback.
[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] [-A] [-m] [-p]
122 H: Check the audio file table, the attribute table, the mood definitions
123 H: and all defined playlists. Report any inconsistencies.
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: -A   Check the attribute table against the afs attribute bitmask of
133 H:      each audio file in the audio file table. Reports audio files
134 H:      whose attribute bitmask is invalid, i.e., has a bit set which
135 H:      does not correspond to any attribute of the attribute table.
136 H:
137 H: -m   Run syntax checks on all defined moods in the mood table.
138 H:
139 H: -p   Check all playlists for lines that correspond to files not contained
140 H:      in the audio file table.
141 H:
142 H: If called without arguments, all checks are run.
143 ---
144 N: rmatt
145 P: AFS_READ | AFS_WRITE
146 D: Remove attribute(s).
147 U: rmatt pattern...
148 H: Remove all attributes matching any given pattern. All information
149 H: about this attribute in the audio file table is lost.
150 ---
151 N: rm
152 P: AFS_READ | AFS_WRITE
153 D: Remove entries from the audio file table.
154 U: rm [-v] [-f] [-p] pattern...
155 H: Delete all entries in the audio file table that match any given pattern.  Note
156 H: that this affects the table entries only; the command won't touch your audio
157 H: files on disk.
158 H:
159 H: Options:
160 H:
161 H: -v   Verbose mode. Explain what is being done.
162 H:
163 H: -f   Force mode. Ignore nonexistent files. Don't complain if nothing
164 H:      was removed.
165 H:
166 H: -p   Pathname match. Match a slash in the path only with a slash
167 H:      in pattern and not by an asterisk (*) or a question mark
168 H:      (?) metacharacter, nor by a bracket expression ([]) containing
169 H:      a slash (see fnmatch(3)).
170 ---
171 N: touch
172 P: AFS_READ | AFS_WRITE
173 D: Manipulate the afs entry of audio files.
174 U: touch [-n=numplayed] [-l=lastplayed] [-y=lyrics_id] [-i=image_id] [-a=amp] [-v] [-p] pattern
175 H: If no option is given, the lastplayed field is set to the current time
176 H: and the value of the numplayed field is increased by one. Otherwise,
177 H: only the given options are taken into account.
178 H:
179 H: Options:
180 H:
181 H: -n   Set the numplayed count, i.e. the number of times this audio
182 H:      file was selected for streaming so far.
183 H:
184 H: -l   Set the lastplayed time, i.e. the last time this audio file was
185 H:      selected for streaming. The argument must be a number of seconds
186 H:      since the epoch. Example:
187 H:
188 H:              touch -l=$(date +%s) file
189 H:
190 H:      sets the lastplayed time of 'file' to the current time.
191 H:
192 H: -y   Set the lyrics ID which specifies the lyrics data file associated
193 H:      with the audio file.
194 H:
195 H: -i   Like -y, but sets the image ID.
196 H:
197 H: -a   Set the amplification value (0-255). This determines a scaling
198 H:      factor by which the amplitude should be multiplied in order to
199 H:      normalize the volume of the audio file.  A value of zero means
200 H:      no amplification, 64 means the amplitude should be multiplied
201 H:      by a factor of two, 128 by three and so on.
202 H:
203 H:      This value is used by the amp filter.
204 H:
205 H: -v   Verbose mode. Explain what is being done.
206 H:
207 H: -p   Pathname match. Match a slash in the path only with a slash
208 H:      in pattern and not by an asterisk (*) or a question mark
209 H:      (?) metacharacter, nor by a bracket expression ([]) containing
210 H:      a slash (see fnmatch(3)).
211 ---
212 N: cpsi
213 P: AFS_READ | AFS_WRITE
214 D: Copy audio file selector info.
215 U: cpsi [-a] [-y] [-i] [-l] [-n] [-v] source pattern...
216 H: If no option, or only the -v option is given, all fields of the
217 H: audio file selector info are copied to all files matching pattern.
218 H: Otherwise, only the given options are taken into account.
219 H:
220 H: Options:
221 H:
222 H: -a   Copy attributes.
223 H:
224 H: -y   Copy the lyrics id.
225 H:
226 H: -i   Copy the image id.
227 H:
228 H: -l   Copy the lastplayed time.
229 H:
230 H: -n   Copy the numplayed count.
231 H:
232 H: -v   Verbose mode.
233 ---
234 N: select
235 P: AFS_READ | AFS_WRITE
236 D: Activate a mood or a playlist.
237 U: select specifier/name
238 H: The specifier is either 'm' or 'p' to indicate whether a playlist or
239 H: a mood should be activated. Example:
240 H:
241 H:      select m/foo
242 H:
243 H: loads the mood named 'foo'.
244 ---
245 T: add
246 N: add@member@
247 O: int com_add@member@(struct command_context *cc);
248 P: AFS_READ | AFS_WRITE
249 D: Add stdin as a blob to the @member@ table.
250 U: add@member@ @member@_name
251 H: Read from stdin and ask the audio file selector to create a blob in the
252 H: corresponding osl table. If the named blob already exists, it gets replaced
253 H: with the new data.
254 ---
255 T: cat
256 N: cat@member@
257 O: int com_cat@member@(struct command_context *cc);
258 P: AFS_READ
259 D: Dump the contents of a blob of type @member@ to stdout.
260 U: cat@member@ @member@_name
261 H: Retrieve the named blob and write it to stdout.
262 ---
263 T: ls
264 N: ls@member@
265 O: int com_ls@member@(struct command_context *cc);
266 P: AFS_READ
267 D: List blobs of type @member@ which match a pattern.
268 U: ls@member@ [-i] [-l] [-r] [pattern]
269 H: Print the list of all blobs which match the given pattern. If no
270 H: pattern is given, the full list is printed.
271 H:
272 H: Options:
273 H:
274 H: -i   Sort by identifier. The default is to sort alphabetically by name.
275 H:
276 H: -l   Print identifier and name. The default is to print only the name.
277 H:
278 H: -r   Reverse sort order.
279 ---
280 T: rm
281 N: rm@member@
282 O: int com_rm@member@(struct command_context *cc);
283 P: AFS_READ | AFS_WRITE
284 D: Remove blob(s) of type @member@ from the @member@ table.
285 U: rm@member@ pattern...
286 H: Remove all blobs whose name matches any of the given patterns.
287 ---
288 T: mv
289 N: mv@member@
290 O: int com_mv@member@(struct command_context *cc);
291 P: AFS_READ | AFS_WRITE
292 D: Rename a blob of type @member@.
293 U: mv@member@ old_@member@_name new_@member@_name
294 H: Rename the blob identified by old_@member@_name to new_@member@_name.
295 H: This command fails if new_@member@_name already exists.