Implement pattern matching for com_lsatt().
[paraslash.git] / afs.cmd
1 OF: afs_command_list
2 SF: afs.c aft.c attribute.c
3 HC: Prototypes for the commands of the audio file selector.
4 CC: Array of commands for the audio file selector.
5 AT: server_command
6 IN: para afh server list user_list
7 SN: list of afs commands
8 TM: mood lyr img pl
9 ---
10 N: add
12 D: Add new audio files to the database.
13 U: add [-l] [-f] [-v] path1 ...
14 H: Each given path may be either the full path to an audio file, or the full path
15 H: of a directory. In case of a directory, all audio files in that directory
16 H: are added recursively.
17 H:
18 H: Options:
19 H:
20 H: -l Add files lazily. If a file already exists in the database, skip this file.
21 H: This operation is really cheap. Use it when adding large directories if only a
22 H: few files where added.
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: afs_ls
38 D: List audio files.
39 U: ls [-l[s|l|v|m]] -p -a -r -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: -ls: short listing mode
46 H: -ll: long listing mode (equivalent to -l)
47 H: -lv: verbose listing mode
48 H: -lm: mbox listing mode
49 H:
50 H: -p List full path of audio file. If not specified, only the basename
51 H: of each file is printed.
52 H:
53 H: -a List only file that are admissible with respect to the current mood or
54 H: playlist.
55 H:
56 H: -r Reverse sort order.
57 H:
58 H: -s Change sort order. Defaults to alphabetical path sort if not given.
59 H:
60 H: -sp: sort by path.
61 H:
62 H: -sl: sort by last played time.
63 H:
64 H: -ss: sort by score (implies -a).
65 H:
66 H: -sn: sort by num played count.
67 H:
68 H: -sf: sort by frequency.
69 H:
70 H: -sc: sort by number of channels.
71 H:
72 H: -si: sort by image id.
73 H:
74 H: -sy: sort by lyrics id.
75 H:
76 H: -sb: sort by bitrate.
77 H:
78 H: -sd: sort by duration.
79 H:
80 H: -sa: sort by audio format.
81 ---
82 N: lsatt
84 D: List attributes
85 U: lsatt [-a] [-l] [-r]
86 H:
87 H: Print the list of all defined attributes.
88 H:
89 H: Options:
90 H:
91 H: -a Sort attributes alphabetically by name. The default is to sort by
92 H: identifier.
93 H:
94 H: -l Print a long listing containing both identifier and attribute name. The
95 H: default is to print only the name.
96 H:
97 H: -l Reverse sort order.
98 ---
99 N: setatt
101 D: Set attribute(s) for all files matching a pattern.
102 U: setatt attribute{+|-}... pattern
103 H: Set ('+') or unset ('-') the given attributes for all audio files matching
104 H: pattern. Example:
105 H:
106 H: sa rock+ punk+ classic- '*foo.mp3'
107 H:
108 H: sets the 'rock' and the 'punk' attribute but unsets the 'classic'
109 H: attribute of all files ending with 'foo.mp3'.
110 ---
111 N: addatt
113 D: Add new attribute(s).
114 U: addatt attribute1...
115 H: This adds new attributes to the attribute table. At most 64 attributes
116 H: may be defined.
117 ---
118 N: check
120 D: Run integrity checks against osl tables.
121 U: check [-a] [-m] [-p]
122 H: This command checks the audio file table, the mood definitions and all
123 H: defined playlists and reports 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 filesystem. 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
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: afs_rm
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.
151 H: Note that affects the table entries only; paraslash won't touch your
152 H: audio files in any way.
153 H: Options:
154 H:
155 H: -v Verbose mode. Explain what is being done.
156 H:
157 H: -f Force mode. Ignore nonexistent files. Don't complain if nothing
158 H: was removed.
159 H:
160 H: -p Pathname match. Match a slash in the path only with a slash
161 H: in pattern and not by an asterisk (*) or a question mark
162 H: (?) metacharacter, nor by a bracket expression ([]) containing
163 H: a slash (see fnmatch(3)).
164 ---
165 N: touch
167 D: Manupulate the afs data for all audio files matching a pattern.
168 U: touch [-n numplayed] [-l lastplayed] [-y lyrics_id] [-i image_id] [-v] [-p] pattern
169 H: If no option is given, lastplayed is set to the current time and numplayed is
170 H: increased by one. Otherwise, only the given options are taken into account.
171 H:
172 H: Options:
173 H:
174 H: -n Set numplayed count. The number of times afs has selected this
175 H: audio file for streaming.
176 H:
177 H: -l Set lastplayed time. The last time this audio file was selected.
178 H: Must be given as the number of sectonds since the epoch. Example:
179 H:
180 H: touch -l $(date +%s) file
181 H:
182 H: sets the lastplayed time of 'file' to the current time.
183 H:
184 H: -y Set the lyrics id. Specify the lyrics data file associated with
185 H: this audio file.
186 H:
187 H: -i Set the image id. Same as -y, but sets the image.
188 H:
189 H: -v Verbose mode. Explain what is being done.
190 H:
191 H: -p Pathname match. Match a slash in the path only with a slash
192 H: in pattern and not by an asterisk (*) or a question mark
193 H: (?) metacharacter, nor by a bracket expression ([]) containing
194 H: a slash (see fnmatch(3)).
195 ---
196 T: add
197 N: add@member@
198 O: int com_add@member@(int fd, int argc, char * const * const argv);
200 D: Read data from stdin and add it as a blob to an osl table.
201 U: add@member@ @member@_name
202 H: Each command of this family reads arbitrary binary data from stdin and sends
203 H: that data to the audio file selector process. The afs process then creates a
204 H: new blob for the data in the corresponding osl table. Example:
205 H:
206 H: addimg foo.jpg < bar.jpg
207 H:
208 H: adds the contents of the file 'bar.jpg' as a blob named 'foo.jpg' to the image
209 H: table. The names of the blobs of a table must be unique, i.e. it is an error
210 H: if an entry named 'foo.jpg' already exists.
211 ---
212 T: cat
213 N: cat@member@
214 O: int com_cat@member@(int fd, int argc, char * const * const argv);
216 D: Dump the contents of a blob to stdout.
217 U: cat@member@ @member@_name
218 H: These commands may be used to retrieve the blob identified by the given name from
219 H: the corresponding osl table to which they were previously added.
220 ---
221 T: ls
222 N: ls@member@
223 O: int com_ls@member@(int fd, int argc, char * const * const argv);
225 D: List blobs of an osl table matching a pattern.
226 U: ls@member@ [-v] [pattern]
227 H: Print a list of the names of all blobs in the corresponding osl table which
228 H: match the given pattern. If no pattern is given, the full list is printed. If
229 H: the optional -v pattern is given, the blob id is printed as well.
230 ---
231 T: rm
232 N: rm@member@
233 O: int com_rm@member@(int fd, int argc, char * const * const argv);
235 D: Remove blob(s) from an osl table.
236 U: rm@member@ pattern...
237 H: Remove all blobs from the corresponding table which match any given pattern.
238 ---
239 T: mv
240 N: mv@member@
241 O: int com_mv@member@(int fd, int argc, char * const * const argv);
243 D: Rename a blob.
244 U: mv@member@ old_@member@_name new_@member@_name
245 H: Rename the blob identified by the first name as the second name.