fca60466e347f3243e298afd3c11479871a45ef4
[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
11 P: AFS_READ | AFS_WRITE
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
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: afs_ls
37 P: AFS_READ
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
83 P: AFS_READ
84 D: List attributes
85 U: lsatt [-a] [-l]
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 ---
97 N: setatt
98 P: AFS_READ | AFS_WRITE
99 D: Set attribute(s) for all files matching a pattern.
100 U: setatt attribute{+|-}... pattern
101 H: Set ('+') or unset ('-') the given attributes for all audio files matching
102 H: pattern. Example:
103 H:
104 H: sa rock+ punk+ classic- '*foo.mp3'
105 H:
106 H: sets the 'rock' and the 'punk' attribute but unsets the 'classic'
107 H: attribute of all files ending with 'foo.mp3'.
108 ---
109 N: addatt
110 P: AFS_READ | AFS_WRITE
111 D: Add new attribute(s).
112 U: addatt attribute1 [attribute2 ...]
113 H: This adds new attributes to the attribute table. At most 64 attributes
114 H: may be defined.
115 ---
116 N: check
117 P: AFS_READ
118 D: Run integrity checks against osl tables.
119 U: check [-a] [-m] [-p]
120 H: This command checks the audio file table, the mood definitions and all
121 H: defined playlists and reports any inconsistencies found.
122 H:
123 H: Options:
124 H:
125 H: -a Run audio file table checks. Checks for entries in the audio file
126 H: table which are not present in the filesystem. Moreover, it checks
127 H: whether the lyrics id and all entries in the audio file table are
128 H: valid.
129 H:
130 H: -m Run syntax checks on all defined moods in the mood table.
131 H:
132 H: -p Check all playlists for lines that correspond to files not contained
133 H: in the audio file table.
134 H:
135 H: If called without arguments, all three checks are run.
136 ---
137 N: rmatt
138 P: AFS_READ | AFS_WRITE
139 D: Remove attribute(s).
140 U: rmatt pattern...
141 H: Remove all attributes matching any given pattern. All information
142 H: about this attribute in the audio file table is lost.
143 ---
144 N: afs_rm
145 P: AFS_READ | AFS_WRITE
146 D: Remove entries from the audio file table.
147 U: rm pattern...
148 H: Delete all entries in the audio file table that match any given pattern.
149 H: Note that affects the table entries only; paraslash won't touch your
150 H: audio files in any way.
151 ---
152 N: touch
153 P: AFS_READ | AFS_WRITE
154 D: Manupulate the afs data for all audio files matching a pattern.
155 U: touch [-n numplayed] [-l lastplayed] [-y lyrics_id] [-i image_id] pattern
156 H: If no option is given, lastplayed is set to the current time and numplayed is
157 H: increased by one. Otherwise, only the given options are taken into account.
158 H:
159 H: Options:
160 H:
161 H: -n Set numplayed count. The number of times afs has selected this
162 H: audio file for streaming.
163 H:
164 H: -l Set lastplayed time. The last time this audio file was selected.
165 H: Must be given as the number of sectonds since the epoch. Example:
166 H:
167 H: touch -l $(date +%s) file
168 H:
169 H: sets the lastplayed time of 'file' to the current time.
170 H:
171 H: -y Set the lyrics id. Specify the lyrics data file associated with
172 H: this audio file.
173 H:
174 H: -i Set the image id. Same as -y, but sets the image.
175 ---
176 T: add
177 N: add@member@
178 O: int com_add@member@(int fd, int argc, char * const * const argv);
179 P: AFS_READ | AFS_WRITE
180 D: Read data from stdin and add it as a blob to an osl table.
181 U: add@member@ @member@_name
182 H: Each command of this family reads arbitrary binary data from stdin and sends
183 H: that data to the audio file selector process. The afs process then creates a
184 H: new blob for the data in the corresponding osl table. Example:
185 H:
186 H: addimg foo.jpg < bar.jpg
187 H:
188 H: adds the contents of the file 'bar.jpg' as a blob named 'foo.jpg' to the image
189 H: table. The names of the blobs of a table must be unique, i.e. it is an error
190 H: if an entry named 'foo.jpg' already exists.
191 ---
192 T: cat
193 N: cat@member@
194 O: int com_cat@member@(int fd, int argc, char * const * const argv);
195 P: AFS_READ
196 D: Dump the contents of a blob to stdout.
197 U: cat@member@ @member@_name
198 H: These commands may be used to retrieve the blob identified by the given name from
199 H: the corresponding osl table to which they were previously added.
200 ---
201 T: ls
202 N: ls@member@
203 O: int com_ls@member@(int fd, int argc, char * const * const argv);
204 P: AFS_READ
205 D: List blobs of an osl table matching a pattern.
206 U: ls@member@ [-v] [pattern]
207 H: Print a list of the names of all blobs in the corresponding osl table which
208 H: match the given pattern. If no pattern is given, the full list is printed. If
209 H: the optional -v pattern is given, the blob id is printed as well.
210 ---
211 T: rm
212 N: rm@member@
213 O: int com_rm@member@(int fd, int argc, char * const * const argv);
214 P: AFS_READ | AFS_WRITE
215 D: Remove blob(s) from an osl table.
216 U: rm@member@ pattern...
217 H: Remove all blobs from the corresponding table which match any given pattern.
218 ---
219 T: mv
220 N: mv@member@
221 O: int com_mv@member@(int fd, int argc, char * const * const argv);
222 P: AFS_READ | AFS_WRITE
223 D: Rename a blob.
224 U: mv@member@ old_@member@_name new_@member@_name
225 H: Rename the blob identified by the first name as the second name.