[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
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
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
38 D: List audio files.
39 U: ls [-l=mode] [-p] [-a] [-r] [-d] [-s=order] [pattern...]
40 H: Print a list of all audio files matching pattern.
41 H:
42 H: Options:
43 H:
44 H: -l=mode Change listing mode. Defaults to short listing if not given.
45 H:
46 H: Available modes:
47 H: s: short listing mode
48 H: l: long listing mode (equivalent to -l)
49 H: v: verbose listing mode
50 H: p: parser-friendly mode
51 H: m: mbox listing mode
52 H: c: chunk-table listing mode
53 H:
54 H: -p List full paths. If this option is 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=order Change sort order. Defaults to alphabetical path sort if not given.
65 H:
66 H: Possible values for order:
67 H: p: by path
68 H: l: by last played time
69 H: s: by score (implies -a)
70 H: n: by num played count
71 H: f: by frequency
72 H: c: by number of channels
73 H: i: by image id
74 H: y: by lyrics id
75 H: b: by bit rate
76 H: d: by duration
77 H: a: by audio format
78 ---
79 N: lsatt
81 D: List attributes.
82 U: lsatt [-i] [-l] [-r] [pattern]
83 H: Print the list of all defined attributes which match the given
84 H: pattern. If no pattern is given, the full list is 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
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+ pop- '*foo.mp3'
103 H:
104 H: sets the 'rock' and the 'punk' attribute and unsets the 'pop'
105 H: attribute of all files ending with 'foo.mp3'.
106 ---
107 N: addatt
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
116 D: Rename an attribute.
117 U: mvatt old new
118 H: Rename attribute old to new.
119 ---
120 N: check
122 D: Run integrity checks against osl tables.
123 U: check [-a] [-A] [-m] [-p]
124 H: Check the audio file table, the attribute table, the mood definitions
125 H: and all defined playlists. Report any inconsistencies.
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: -A Check the attribute table against the afs attribute bitmask of
135 H: each audio file in the audio file table. Reports audio files
136 H: whose attribute bitmask is invalid, i.e., has a bit set which
137 H: does not correspond to any attribute of the attribute table.
138 H:
139 H: -m Run syntax checks on all defined moods in the mood table.
140 H:
141 H: -p Check all playlists for lines that correspond to files not contained
142 H: in the audio file table.
143 H:
144 H: If called without arguments, all checks are run.
145 ---
146 N: rmatt
148 D: Remove attribute(s).
149 U: rmatt pattern...
150 H: Remove all attributes matching any given pattern. All information
151 H: about this attribute in the audio file table is lost.
152 ---
153 N: rm
155 D: Remove entries from the audio file table.
156 U: rm [-v] [-f] [-p] pattern...
157 H: Delete all entries in the audio file table that match any given pattern. Note
158 H: that this affects the table entries only; the command won't touch your audio
159 H: files on disk.
160 H:
161 H: Options:
162 H:
163 H: -v Verbose mode. Explain what is being done.
164 H:
165 H: -f Force mode. Ignore nonexistent files. Don't complain if nothing
166 H: was removed.
167 H:
168 H: -p Pathname match. Match a slash in the path only with a slash
169 H: in pattern and not by an asterisk (*) or a question mark
170 H: (?) metacharacter, nor by a bracket expression ([]) containing
171 H: a slash (see fnmatch(3)).
172 ---
173 N: touch
175 D: Manipulate the afs entry of audio files.
176 U: touch [-n=numplayed] [-l=lastplayed] [-y=lyrics_id] [-i=image_id] [-a=amp] [-v] [-p] pattern
177 H: If no option is given, the lastplayed field is set to the current time
178 H: and the value of the numplayed field is increased by one. Otherwise,
179 H: only the given options are taken into account.
180 H:
181 H: Options:
182 H:
183 H: -n Set the numplayed count, i.e. the number of times this audio
184 H: file was selected for streaming so far.
185 H:
186 H: -l Set the lastplayed time, i.e. the last time this audio file was
187 H: selected for streaming. The argument must be a number of seconds
188 H: since the epoch. Example:
189 H:
190 H: touch -l=$(date +%s) file
191 H:
192 H: sets the lastplayed time of 'file' to the current time.
193 H:
194 H: -y Set the lyrics ID which specifies the lyrics data file associated
195 H: with the audio file.
196 H:
197 H: -i Like -y, but sets the image ID.
198 H:
199 H: -a Set the amplification value (0-255). This determines a scaling
200 H: factor by which the amplitude should be multiplied in order to
201 H: normalize the volume of the audio file. A value of zero means
202 H: no amplification, 64 means the amplitude should be multiplied
203 H: by a factor of two, 128 by three and so on.
204 H:
205 H: This value is used by the amp filter.
206 H:
207 H: -v Verbose mode. Explain what is being done.
208 H:
209 H: -p Pathname match. Match a slash in the path only with a slash
210 H: in pattern and not by an asterisk (*) or a question mark
211 H: (?) metacharacter, nor by a bracket expression ([]) containing
212 H: a slash (see fnmatch(3)).
213 ---
214 N: cpsi
216 D: Copy audio file selector info.
217 U: cpsi [-a] [-y] [-i] [-l] [-n] [-v] source pattern...
218 H: If no option, or only the -v option is given, all fields of the
219 H: audio file selector info are copied to all files matching pattern.
220 H: Otherwise, only the given options are taken into account.
221 H:
222 H: Options:
223 H:
224 H: -a Copy attributes.
225 H:
226 H: -y Copy the lyrics id.
227 H:
228 H: -i Copy the image id.
229 H:
230 H: -l Copy the lastplayed time.
231 H:
232 H: -n Copy the numplayed count.
233 H:
234 H: -v Verbose mode.
235 ---
236 N: select
238 D: Activate a mood or a playlist.
239 U: select specifier/name
240 H: The specifier is either 'm' or 'p' to indicate whether a playlist or
241 H: a mood should be activated. Example:
242 H:
243 H: select m/foo
244 H:
245 H: loads the mood named 'foo'.
246 ---
247 T: add
248 N: add@member@
249 O: int com_add@member@(struct command_context *cc);
251 D: Add stdin as a blob to the @member@ table.
252 U: add@member@ @member@_name
253 H: Read from stdin and ask the audio file selector to create a blob in the
254 H: corresponding osl table. If the named blob already exists, it gets replaced
255 H: with the new data.
256 ---
257 T: cat
258 N: cat@member@
259 O: int com_cat@member@(struct command_context *cc);
261 D: Dump the contents of a blob of type @member@ to stdout.
262 U: cat@member@ @member@_name
263 H: Retrieve the named blob and write it to stdout.
264 ---
265 T: ls
266 N: ls@member@
267 O: int com_ls@member@(struct command_context *cc);
269 D: List blobs of type @member@ which match a pattern.
270 U: ls@member@ [-i] [-l] [-r] [pattern]
271 H: Print the list of all blobs which match the given pattern. If no
272 H: pattern is given, the full list is printed.
273 H:
274 H: Options:
275 H:
276 H: -i Sort by identifier. The default is to sort alphabetically by name.
277 H:
278 H: -l Print identifier and name. The default is to print only the name.
279 H:
280 H: -r Reverse sort order.
281 ---
282 T: rm
283 N: rm@member@
284 O: int com_rm@member@(struct command_context *cc);
286 D: Remove blob(s) of type @member@ from the @member@ table.
287 U: rm@member@ pattern...
288 H: Remove all blobs whose name matches any of the given patterns.
289 ---
290 T: mv
291 N: mv@member@
292 O: int com_mv@member@(struct command_context *cc);
294 D: Rename a blob of type @member@.
295 U: mv@member@ source_@member@_name dest_@member@_name
296 H: Rename the blob identified by the source blob name to the destination blob
297 H: name. The command fails if the source does not exist, or if the destination
298 H: already exists.