5a3615bf1bc8f79771da9bd0a6c54f8877dff711
[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: ls
7 P: AFS_READ
8 D: List audio files.
9 U: ls [-l=mode] [-p] [-a] [-r] [-d] [-s=order] [pattern...]
10 H: Print a list of all audio files matching pattern.
11 H:
12 H: Options:
13 H:
14 H: -l=mode Change listing mode. Defaults to short listing if not given.
15 H:
16 H: Available modes:
17 H: s: short listing mode
18 H: l: long listing mode (equivalent to -l)
19 H: v: verbose listing mode
20 H: p: parser-friendly mode
21 H: m: mbox listing mode
22 H: c: chunk-table listing mode
23 H:
24 H: -F List full paths. If this option is not specified, only the basename
25 H: of each file is printed.
26 H: -p Synonym for -F. Deprecated.
27 H:
28 H: -b Print only the basename of each matching file. This is the default, so
29 H: the option is currently a no-op. It is recommended to specify this option,
30 H: though, as the default might change in a future release.
31 H:
32 H: -a List only files that are admissible with respect to the current mood or
33 H: playlist.
34 H:
35 H: -r Reverse sort order.
36 H:
37 H: -d Print dates as seconds after the epoch.
38 H:
39 H: -s=order
40 H: Change sort order. Defaults to alphabetical path sort if not given.
41 H:
42 H: Possible values for order:
43 H: p: by path
44 H: l: by last played time
45 H: s: by score (implies -a)
46 H: n: by num played count
47 H: f: by frequency
48 H: c: by number of channels
49 H: i: by image id
50 H: y: by lyrics id
51 H: b: by bit rate
52 H: d: by duration
53 H: a: by audio format
54 ---
55 N: setatt
56 P: AFS_READ | AFS_WRITE
57 D: Set attribute(s) for all files matching a pattern.
58 U: setatt attribute{+|-}... pattern
59 H: Set ('+') or unset ('-') the given attributes for all audio files matching
60 H: pattern. Example:
61 H:
62 H: setatt rock+ punk+ pop- '*foo.mp3'
63 H:
64 H: sets the 'rock' and the 'punk' attribute and unsets the 'pop'
65 H: attribute of all files ending with 'foo.mp3'.
66 ---
67 N: addatt
68 P: AFS_READ | AFS_WRITE
69 D: Add new attribute(s).
70 U: addatt attribute1...
71 H: This adds new attributes to the attribute table. At most 64
72 H: attributes may be defined.
73 ---
74 N: mvatt
75 P: AFS_READ | AFS_WRITE
76 D: Rename an attribute.
77 U: mvatt old new
78 H: Rename attribute old to new.
79 ---
80 N: check
81 P: AFS_READ
82 D: Run integrity checks against osl tables.
83 U: check [-a] [-A] [-m] [-p]
84 H: Check the audio file table, the attribute table, the mood definitions
85 H: and all defined playlists. Report any inconsistencies.
86 H:
87 H: Options:
88 H:
89 H: -a Run audio file table checks. Checks for entries in the audio file
90 H: table which are not present in the file system. Moreover, it checks
91 H: whether the lyrics id and all entries in the audio file table are
92 H: valid.
93 H:
94 H: -A Check the attribute table against the afs attribute bitmask of
95 H: each audio file in the audio file table. Reports audio files
96 H: whose attribute bitmask is invalid, i.e., has a bit set which
97 H: does not correspond to any attribute of the attribute table.
98 H:
99 H: -m Run syntax checks on all defined moods in the mood table.
100 H:
101 H: -p Check all playlists for lines that correspond to files not contained
102 H: in the audio file table.
103 H:
104 H: If called without arguments, all checks are run.
105 ---
106 N: rmatt
107 P: AFS_READ | AFS_WRITE
108 D: Remove attribute(s).
109 U: rmatt pattern...
110 H: Remove all attributes matching any given pattern. All information
111 H: about this attribute in the audio file table is lost.
112 ---
113 N: rm
114 P: AFS_READ | AFS_WRITE
115 D: Remove entries from the audio file table.
116 U: rm [-v] [-f] [-p] pattern...
117 H: Delete all entries in the audio file table that match any given pattern. Note
118 H: that this affects the table entries only; the command won't touch your audio
119 H: files on disk.
120 H:
121 H: Options:
122 H:
123 H: -v Verbose mode. Explain what is being done.
124 H:
125 H: -f Force mode. Ignore nonexistent files. Don't complain if nothing
126 H: was removed.
127 H:
128 H: -p Pathname match. Match a slash in the path only with a slash
129 H: in pattern and not by an asterisk (*) or a question mark
130 H: (?) metacharacter, nor by a bracket expression ([]) containing
131 H: a slash (see fnmatch(3)).
132 ---
133 N: touch
134 P: AFS_READ | AFS_WRITE
135 D: Manipulate the afs entry of audio files.
136 U: touch [-n=numplayed] [-l=lastplayed] [-y=lyrics_id] [-i=image_id] [-a=amp] [-v] [-p] pattern
137 H: If no option is given, the lastplayed field is set to the current time
138 H: and the value of the numplayed field is increased by one. Otherwise,
139 H: only the given options are taken into account.
140 H:
141 H: Options:
142 H:
143 H: -n Set the numplayed count, i.e. the number of times this audio
144 H: file was selected for streaming so far.
145 H:
146 H: -l Set the lastplayed time, i.e. the last time this audio file was
147 H: selected for streaming. The argument must be a number of seconds
148 H: since the epoch. Example:
149 H:
150 H: touch -l=$(date +%s) file
151 H:
152 H: sets the lastplayed time of 'file' to the current time.
153 H:
154 H: -y Set the lyrics ID which specifies the lyrics data file associated
155 H: with the audio file.
156 H:
157 H: -i Like -y, but sets the image ID.
158 H:
159 H: -a Set the amplification value (0-255). This determines a scaling
160 H: factor by which the amplitude should be multiplied in order to
161 H: normalize the volume of the audio file. A value of zero means
162 H: no amplification, 64 means the amplitude should be multiplied
163 H: by a factor of two, 128 by three and so on.
164 H:
165 H: This value is used by the amp filter.
166 H:
167 H: -v Verbose mode. Explain what is being done.
168 H:
169 H: -p Pathname match. Match a slash in the path only with a slash
170 H: in pattern and not by an asterisk (*) or a question mark
171 H: (?) metacharacter, nor by a bracket expression ([]) containing
172 H: a slash (see fnmatch(3)).
173 ---
174 N: cpsi
175 P: AFS_READ | AFS_WRITE
176 D: Copy audio file selector info.
177 U: cpsi [-a] [-y] [-i] [-l] [-n] [-v] source pattern...
178 H: If no option, or only the -v option is given, all fields of the
179 H: audio file selector info are copied to all files matching pattern.
180 H: Otherwise, only the given options are taken into account.
181 H:
182 H: Options:
183 H:
184 H: -a Copy attributes.
185 H:
186 H: -y Copy the lyrics id.
187 H:
188 H: -i Copy the image id.
189 H:
190 H: -l Copy the lastplayed time.
191 H:
192 H: -n Copy the numplayed count.
193 H:
194 H: -v Verbose mode.
195 ---
196 N: select
197 P: AFS_READ | AFS_WRITE
198 D: Activate a mood or a playlist.
199 U: select specifier/name
200 H: The specifier is either 'm' or 'p' to indicate whether a playlist or
201 H: a mood should be activated. Example:
202 H:
203 H: select m/foo
204 H:
205 H: loads the mood named 'foo'.
206 ---
207 T: add
208 N: add@member@
209 O: int com_add@member@(struct command_context *cc);
210 P: AFS_READ | AFS_WRITE
211 D: Add stdin as a blob to the @member@ table.
212 U: add@member@ @member@_name
213 H: Read from stdin and ask the audio file selector to create a blob in the
214 H: corresponding osl table. If the named blob already exists, it gets replaced
215 H: with the new data.
216 ---
217 T: cat
218 N: cat@member@
219 O: int com_cat@member@(struct command_context *cc);
220 P: AFS_READ
221 D: Dump the contents of a blob of type @member@ to stdout.
222 U: cat@member@ @member@_name
223 H: Retrieve the named blob and write it to stdout.
224 ---
225 T: ls
226 N: ls@member@
227 O: int com_ls@member@(struct command_context *cc);
228 P: AFS_READ
229 D: List blobs of type @member@ which match a pattern.
230 U: ls@member@ [-i] [-l] [-r] [pattern]
231 H: Print the list of all blobs which match the given pattern. If no
232 H: pattern is given, the full list is printed.
233 H:
234 H: Options:
235 H:
236 H: -i Sort by identifier. The default is to sort alphabetically by name.
237 H:
238 H: -l Print identifier and name. The default is to print only the name.
239 H:
240 H: -r Reverse sort order.
241 ---
242 T: rm
243 N: rm@member@
244 O: int com_rm@member@(struct command_context *cc);
245 P: AFS_READ | AFS_WRITE
246 D: Remove blob(s) of type @member@ from the @member@ table.
247 U: rm@member@ pattern...
248 H: Remove all blobs whose name matches any of the given patterns.
249 ---
250 T: mv
251 N: mv@member@
252 O: int com_mv@member@(struct command_context *cc);
253 P: AFS_READ | AFS_WRITE
254 D: Rename a blob of type @member@.
255 U: mv@member@ source_@member@_name dest_@member@_name
256 H: Rename the blob identified by the source blob name to the destination blob
257 H: name. The command fails if the source does not exist, or if the destination
258 H: already exists.