Commit | Line | Data |
---|---|---|
ad131c25 RK |
1 | /* |
2 | * Automatically generated file, see scripts/protocol | |
3 | * | |
4 | * DO NOT EDIT. | |
5 | */ | |
6 | /* | |
7 | * This file is part of DisOrder. | |
8 | * Copyright (C) 2010-11 Richard Kettlewell | |
9 | * | |
10 | * This program is free software: you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation, either version 3 of the License, or | |
13 | * (at your option) any later version. | |
14 | * | |
15 | * This program is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 | */ | |
23 | #ifndef ECLIENT_STUBS_H | |
24 | #define ECLIENT_STUBS_H | |
25 | ||
26 | /** @brief Adopt a track | |
27 | * | |
28 | * Makes the calling user owner of a randomly picked track. | |
29 | * | |
30 | * @param c Client | |
31 | * @param completed Called upon completion | |
32 | * @param id Track ID | |
33 | * @param v Passed to @p completed | |
34 | * @return 0 if the command was queued successfuly, non-0 on error | |
35 | */ | |
36 | int disorder_eclient_adopt(disorder_eclient *c, disorder_eclient_no_response *completed, const char *id, void *v); | |
37 | ||
38 | /** @brief Create a user | |
39 | * | |
40 | * Create a new user. Requires the 'admin' right. Email addresses etc must be filled in in separate commands. | |
41 | * | |
42 | * @param c Client | |
43 | * @param completed Called upon completion | |
44 | * @param user New username | |
45 | * @param password Initial password | |
46 | * @param rights Initial rights (optional) | |
47 | * @param v Passed to @p completed | |
48 | * @return 0 if the command was queued successfuly, non-0 on error | |
49 | */ | |
50 | int disorder_eclient_adduser(disorder_eclient *c, disorder_eclient_no_response *completed, const char *user, const char *password, const char *rights, void *v); | |
51 | ||
52 | /** @brief List files and directories in a directory | |
53 | * | |
54 | * See 'files' and 'dirs' for more specific lists. | |
55 | * | |
56 | * @param c Client | |
57 | * @param completed Called upon completion | |
58 | * @param dir Directory to list (optional) | |
59 | * @param re Regexp that results must match (optional) | |
60 | * @param v Passed to @p completed | |
61 | * @return 0 if the command was queued successfuly, non-0 on error | |
62 | */ | |
63 | int disorder_eclient_allfiles(disorder_eclient *c, disorder_eclient_list_response *completed, const char *dir, const char *re, void *v); | |
64 | ||
65 | /** @brief Delete user | |
66 | * | |
67 | * Requires the 'admin' right. | |
68 | * | |
69 | * @param c Client | |
70 | * @param completed Called upon completion | |
71 | * @param user User to delete | |
72 | * @param v Passed to @p completed | |
73 | * @return 0 if the command was queued successfuly, non-0 on error | |
74 | */ | |
75 | int disorder_eclient_deluser(disorder_eclient *c, disorder_eclient_no_response *completed, const char *user, void *v); | |
76 | ||
77 | /** @brief List directories in a directory | |
78 | * | |
79 | * | |
80 | * | |
81 | * @param c Client | |
82 | * @param completed Called upon completion | |
83 | * @param dir Directory to list (optional) | |
84 | * @param re Regexp that results must match (optional) | |
85 | * @param v Passed to @p completed | |
86 | * @return 0 if the command was queued successfuly, non-0 on error | |
87 | */ | |
88 | int disorder_eclient_dirs(disorder_eclient *c, disorder_eclient_list_response *completed, const char *dir, const char *re, void *v); | |
89 | ||
90 | /** @brief Disable play | |
91 | * | |
92 | * Play will stop at the end of the current track, if one is playing. Requires the 'global prefs' right. | |
93 | * | |
94 | * @param c Client | |
95 | * @param completed Called upon completion | |
96 | * @param v Passed to @p completed | |
97 | * @return 0 if the command was queued successfuly, non-0 on error | |
98 | */ | |
99 | int disorder_eclient_disable(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
100 | ||
101 | /** @brief Set a user property | |
102 | * | |
103 | * With the 'admin' right you can do anything. Otherwise you need the 'userinfo' right and can only set 'email' and 'password'. | |
104 | * | |
105 | * @param c Client | |
106 | * @param completed Called upon completion | |
107 | * @param username User to modify | |
108 | * @param property Property name | |
109 | * @param value New property value | |
110 | * @param v Passed to @p completed | |
111 | * @return 0 if the command was queued successfuly, non-0 on error | |
112 | */ | |
113 | int disorder_eclient_edituser(disorder_eclient *c, disorder_eclient_no_response *completed, const char *username, const char *property, const char *value, void *v); | |
114 | ||
115 | /** @brief Enable play | |
116 | * | |
117 | * Requires the 'global prefs' right. | |
118 | * | |
119 | * @param c Client | |
120 | * @param completed Called upon completion | |
121 | * @param v Passed to @p completed | |
122 | * @return 0 if the command was queued successfuly, non-0 on error | |
123 | */ | |
124 | int disorder_eclient_enable(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
125 | ||
126 | /** @brief Detect whether play is enabled | |
127 | * | |
128 | * | |
129 | * | |
130 | * @param c Client | |
131 | * @param completed Called upon completion | |
132 | * @param v Passed to @p completed | |
133 | * @return 0 if the command was queued successfuly, non-0 on error | |
134 | */ | |
135 | int disorder_eclient_enabled(disorder_eclient *c, disorder_eclient_integer_response *completed, void *v); | |
136 | ||
137 | /** @brief Test whether a track exists | |
138 | * | |
139 | * | |
140 | * | |
141 | * @param c Client | |
142 | * @param completed Called upon completion | |
143 | * @param track Track name | |
144 | * @param v Passed to @p completed | |
145 | * @return 0 if the command was queued successfuly, non-0 on error | |
146 | */ | |
147 | int disorder_eclient_exists(disorder_eclient *c, disorder_eclient_integer_response *completed, const char *track, void *v); | |
148 | ||
149 | /** @brief List files in a directory | |
150 | * | |
151 | * | |
152 | * | |
153 | * @param c Client | |
154 | * @param completed Called upon completion | |
155 | * @param dir Directory to list (optional) | |
156 | * @param re Regexp that results must match (optional) | |
157 | * @param v Passed to @p completed | |
158 | * @return 0 if the command was queued successfuly, non-0 on error | |
159 | */ | |
160 | int disorder_eclient_files(disorder_eclient *c, disorder_eclient_list_response *completed, const char *dir, const char *re, void *v); | |
161 | ||
162 | /** @brief Get a track preference | |
163 | * | |
164 | * If the track does not exist that is an error. If the track exists but the preference does not then a null value is returned. | |
165 | * | |
166 | * @param c Client | |
167 | * @param completed Called upon completion | |
168 | * @param track Track name | |
169 | * @param pref Preference name | |
170 | * @param v Passed to @p completed | |
171 | * @return 0 if the command was queued successfuly, non-0 on error | |
172 | */ | |
173 | int disorder_eclient_get(disorder_eclient *c, disorder_eclient_string_response *completed, const char *track, const char *pref, void *v); | |
174 | ||
175 | /** @brief Get a global preference | |
176 | * | |
177 | * If the preference does exist not then a null value is returned. | |
178 | * | |
179 | * @param c Client | |
180 | * @param completed Called upon completion | |
181 | * @param pref Global preference name | |
182 | * @param v Passed to @p completed | |
183 | * @return 0 if the command was queued successfuly, non-0 on error | |
184 | */ | |
185 | int disorder_eclient_get_global(disorder_eclient *c, disorder_eclient_string_response *completed, const char *pref, void *v); | |
186 | ||
187 | /** @brief Get a track's length | |
188 | * | |
189 | * If the track does not exist an error is returned. | |
190 | * | |
191 | * @param c Client | |
192 | * @param completed Called upon completion | |
193 | * @param track Track name | |
194 | * @param v Passed to @p completed | |
195 | * @return 0 if the command was queued successfuly, non-0 on error | |
196 | */ | |
197 | int disorder_eclient_length(disorder_eclient *c, disorder_eclient_integer_response *completed, const char *track, void *v); | |
198 | ||
199 | /** @brief Create a login cookie for this user | |
200 | * | |
201 | * The cookie may be redeemed via the 'cookie' command | |
202 | * | |
203 | * @param c Client | |
204 | * @param completed Called upon completion | |
205 | * @param v Passed to @p completed | |
206 | * @return 0 if the command was queued successfuly, non-0 on error | |
207 | */ | |
208 | int disorder_eclient_make_cookie(disorder_eclient *c, disorder_eclient_string_response *completed, void *v); | |
209 | ||
210 | /** @brief Move a track | |
211 | * | |
212 | * Requires one of the 'move mine', 'move random' or 'move any' rights depending on how the track came to be added to the queue. | |
213 | * | |
214 | * @param c Client | |
215 | * @param completed Called upon completion | |
216 | * @param track Track ID or name | |
217 | * @param delta How far to move the track towards the head of the queue | |
218 | * @param v Passed to @p completed | |
219 | * @return 0 if the command was queued successfuly, non-0 on error | |
220 | */ | |
221 | int disorder_eclient_move(disorder_eclient *c, disorder_eclient_no_response *completed, const char *track, long delta, void *v); | |
222 | ||
223 | /** @brief Move multiple tracks | |
224 | * | |
225 | * Requires one of the 'move mine', 'move random' or 'move any' rights depending on how the track came to be added to the queue. | |
226 | * | |
227 | * @param c Client | |
228 | * @param completed Called upon completion | |
229 | * @param target Move after this track, or to head if "" | |
230 | * @param ids List of tracks to move by ID | |
231 | * @param nids Length of ids | |
232 | * @param v Passed to @p completed | |
233 | * @return 0 if the command was queued successfuly, non-0 on error | |
234 | */ | |
235 | int disorder_eclient_moveafter(disorder_eclient *c, disorder_eclient_no_response *completed, const char *target, char **ids, int nids, void *v); | |
236 | ||
237 | /** @brief List recently added tracks | |
238 | * | |
239 | * | |
240 | * | |
241 | * @param c Client | |
242 | * @param completed Called upon completion | |
243 | * @param max Maximum tracks to fetch, or 0 for all available | |
244 | * @param v Passed to @p completed | |
245 | * @return 0 if the command was queued successfuly, non-0 on error | |
246 | */ | |
247 | int disorder_eclient_new_tracks(disorder_eclient *c, disorder_eclient_list_response *completed, long max, void *v); | |
248 | ||
249 | /** @brief Do nothing | |
250 | * | |
251 | * Used as a keepalive. No authentication required. | |
252 | * | |
253 | * @param c Client | |
254 | * @param completed Called upon completion | |
255 | * @param v Passed to @p completed | |
256 | * @return 0 if the command was queued successfuly, non-0 on error | |
257 | */ | |
258 | int disorder_eclient_nop(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
259 | ||
260 | /** @brief Get a track name part | |
261 | * | |
262 | * If the name part cannot be constructed an empty string is returned. | |
263 | * | |
264 | * @param c Client | |
265 | * @param completed Called upon completion | |
266 | * @param track Track name | |
267 | * @param context Context ("sort" or "display") | |
268 | * @param part Name part ("artist", "album" or "title") | |
269 | * @param v Passed to @p completed | |
270 | * @return 0 if the command was queued successfuly, non-0 on error | |
271 | */ | |
272 | int disorder_eclient_part(disorder_eclient *c, disorder_eclient_string_response *completed, const char *track, const char *context, const char *part, void *v); | |
273 | ||
274 | /** @brief Pause the currently playing track | |
275 | * | |
276 | * Requires the 'pause' right. | |
277 | * | |
278 | * @param c Client | |
279 | * @param completed Called upon completion | |
280 | * @param v Passed to @p completed | |
281 | * @return 0 if the command was queued successfuly, non-0 on error | |
282 | */ | |
283 | int disorder_eclient_pause(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
284 | ||
285 | /** @brief Play a track | |
286 | * | |
287 | * Requires the 'play' right. | |
288 | * | |
289 | * @param c Client | |
290 | * @param completed Called upon completion | |
291 | * @param track Track to play | |
292 | * @param v Passed to @p completed | |
293 | * @return 0 if the command was queued successfuly, non-0 on error | |
294 | */ | |
295 | int disorder_eclient_play(disorder_eclient *c, disorder_eclient_string_response *completed, const char *track, void *v); | |
296 | ||
297 | /** @brief Play multiple tracks | |
298 | * | |
299 | * Requires the 'play' right. | |
300 | * | |
301 | * @param c Client | |
302 | * @param completed Called upon completion | |
303 | * @param target Insert into queue after this track, or at head if "" | |
304 | * @param tracks List of track names to play | |
305 | * @param ntracks Length of tracks | |
306 | * @param v Passed to @p completed | |
307 | * @return 0 if the command was queued successfuly, non-0 on error | |
308 | */ | |
309 | int disorder_eclient_playafter(disorder_eclient *c, disorder_eclient_no_response *completed, const char *target, char **tracks, int ntracks, void *v); | |
310 | ||
311 | /** @brief Retrieve the playing track | |
312 | * | |
313 | * | |
314 | * | |
315 | * @param c Client | |
316 | * @param completed Called upon completion | |
317 | * @param v Passed to @p completed | |
318 | * @return 0 if the command was queued successfuly, non-0 on error | |
319 | */ | |
320 | int disorder_eclient_playing(disorder_eclient *c, disorder_eclient_playing_response *completed, void *v); | |
321 | ||
322 | /** @brief Delete a playlist | |
323 | * | |
324 | * Requires the 'play' right and permission to modify the playlist. | |
325 | * | |
326 | * @param c Client | |
327 | * @param completed Called upon completion | |
328 | * @param playlist Playlist to delete | |
329 | * @param v Passed to @p completed | |
330 | * @return 0 if the command was queued successfuly, non-0 on error | |
331 | */ | |
332 | int disorder_eclient_playlist_delete(disorder_eclient *c, disorder_eclient_no_response *completed, const char *playlist, void *v); | |
333 | ||
334 | /** @brief List the contents of a playlist | |
335 | * | |
336 | * Requires the 'read' right and oermission to read the playlist. | |
337 | * | |
338 | * @param c Client | |
339 | * @param completed Called upon completion | |
340 | * @param playlist Playlist name | |
341 | * @param v Passed to @p completed | |
342 | * @return 0 if the command was queued successfuly, non-0 on error | |
343 | */ | |
344 | int disorder_eclient_playlist_get(disorder_eclient *c, disorder_eclient_list_response *completed, const char *playlist, void *v); | |
345 | ||
346 | /** @brief Get a playlist's sharing status | |
347 | * | |
348 | * Requires the 'read' right and permission to read the playlist. | |
349 | * | |
350 | * @param c Client | |
351 | * @param completed Called upon completion | |
352 | * @param playlist Playlist to read | |
353 | * @param v Passed to @p completed | |
354 | * @return 0 if the command was queued successfuly, non-0 on error | |
355 | */ | |
356 | int disorder_eclient_playlist_get_share(disorder_eclient *c, disorder_eclient_string_response *completed, const char *playlist, void *v); | |
357 | ||
358 | /** @brief Lock a playlist | |
359 | * | |
360 | * Requires the 'play' right and permission to modify the playlist. A given connection may lock at most one playlist. | |
361 | * | |
362 | * @param c Client | |
363 | * @param completed Called upon completion | |
364 | * @param playlist Playlist to delete | |
365 | * @param v Passed to @p completed | |
366 | * @return 0 if the command was queued successfuly, non-0 on error | |
367 | */ | |
368 | int disorder_eclient_playlist_lock(disorder_eclient *c, disorder_eclient_no_response *completed, const char *playlist, void *v); | |
369 | ||
370 | /** @brief Set the contents of a playlist | |
371 | * | |
372 | * Requires the 'play' right and permission to modify the playlist, which must be locked. | |
373 | * | |
374 | * @param c Client | |
375 | * @param completed Called upon completion | |
376 | * @param playlist Playlist to modify | |
377 | * @param tracks New list of tracks for playlist | |
378 | * @param ntracks Length of tracks | |
379 | * @param v Passed to @p completed | |
380 | * @return 0 if the command was queued successfuly, non-0 on error | |
381 | */ | |
382 | int disorder_eclient_playlist_set(disorder_eclient *c, disorder_eclient_no_response *completed, const char *playlist, char **tracks, int ntracks, void *v); | |
383 | ||
384 | /** @brief Set a playlist's sharing status | |
385 | * | |
386 | * Requires the 'play' right and permission to modify the playlist. | |
387 | * | |
388 | * @param c Client | |
389 | * @param completed Called upon completion | |
390 | * @param playlist Playlist to modify | |
391 | * @param share New sharing status ("public", "private" or "shared") | |
392 | * @param v Passed to @p completed | |
393 | * @return 0 if the command was queued successfuly, non-0 on error | |
394 | */ | |
395 | int disorder_eclient_playlist_set_share(disorder_eclient *c, disorder_eclient_no_response *completed, const char *playlist, const char *share, void *v); | |
396 | ||
397 | /** @brief Unlock the locked playlist playlist | |
398 | * | |
399 | * The playlist to unlock is implicit in the connection. | |
400 | * | |
401 | * @param c Client | |
402 | * @param completed Called upon completion | |
403 | * @param v Passed to @p completed | |
404 | * @return 0 if the command was queued successfuly, non-0 on error | |
405 | */ | |
406 | int disorder_eclient_playlist_unlock(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
407 | ||
408 | /** @brief List playlists | |
409 | * | |
410 | * Requires the 'read' right. Only playlists that you have permission to read are returned. | |
411 | * | |
412 | * @param c Client | |
413 | * @param completed Called upon completion | |
414 | * @param v Passed to @p completed | |
415 | * @return 0 if the command was queued successfuly, non-0 on error | |
416 | */ | |
417 | int disorder_eclient_playlists(disorder_eclient *c, disorder_eclient_list_response *completed, void *v); | |
418 | ||
419 | /** @brief List the queue | |
420 | * | |
421 | * | |
422 | * | |
423 | * @param c Client | |
424 | * @param completed Called upon completion | |
425 | * @param v Passed to @p completed | |
426 | * @return 0 if the command was queued successfuly, non-0 on error | |
427 | */ | |
428 | int disorder_eclient_queue(disorder_eclient *c, disorder_eclient_queue_response *completed, void *v); | |
429 | ||
430 | /** @brief Disable random play | |
431 | * | |
432 | * Requires the 'global prefs' right. | |
433 | * | |
434 | * @param c Client | |
435 | * @param completed Called upon completion | |
436 | * @param v Passed to @p completed | |
437 | * @return 0 if the command was queued successfuly, non-0 on error | |
438 | */ | |
439 | int disorder_eclient_random_disable(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
440 | ||
441 | /** @brief Enable random play | |
442 | * | |
443 | * Requires the 'global prefs' right. | |
444 | * | |
445 | * @param c Client | |
446 | * @param completed Called upon completion | |
447 | * @param v Passed to @p completed | |
448 | * @return 0 if the command was queued successfuly, non-0 on error | |
449 | */ | |
450 | int disorder_eclient_random_enable(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
451 | ||
452 | /** @brief Detect whether random play is enabled | |
453 | * | |
454 | * Random play counts as enabled even if play is disabled. | |
455 | * | |
456 | * @param c Client | |
457 | * @param completed Called upon completion | |
458 | * @param v Passed to @p completed | |
459 | * @return 0 if the command was queued successfuly, non-0 on error | |
460 | */ | |
461 | int disorder_eclient_random_enabled(disorder_eclient *c, disorder_eclient_integer_response *completed, void *v); | |
462 | ||
463 | /** @brief List recently played tracks | |
464 | * | |
465 | * | |
466 | * | |
467 | * @param c Client | |
468 | * @param completed Called upon completion | |
469 | * @param v Passed to @p completed | |
470 | * @return 0 if the command was queued successfuly, non-0 on error | |
471 | */ | |
472 | int disorder_eclient_recent(disorder_eclient *c, disorder_eclient_queue_response *completed, void *v); | |
473 | ||
474 | /** @brief Re-read configuraiton file. | |
475 | * | |
476 | * Requires the 'admin' right. | |
477 | * | |
478 | * @param c Client | |
479 | * @param completed Called upon completion | |
480 | * @param v Passed to @p completed | |
481 | * @return 0 if the command was queued successfuly, non-0 on error | |
482 | */ | |
483 | int disorder_eclient_reconfigure(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
484 | ||
485 | /** @brief Register a new user | |
486 | * | |
487 | * Requires the 'register' right which is usually only available to the 'guest' user. Redeem the confirmation string via 'confirm' to complete registration. | |
488 | * | |
489 | * @param c Client | |
490 | * @param completed Called upon completion | |
491 | * @param username Requested new username | |
492 | * @param password Requested initial password | |
493 | * @param email New user's email address | |
494 | * @param v Passed to @p completed | |
495 | * @return 0 if the command was queued successfuly, non-0 on error | |
496 | */ | |
497 | int disorder_eclient_register(disorder_eclient *c, disorder_eclient_string_response *completed, const char *username, const char *password, const char *email, void *v); | |
498 | ||
499 | /** @brief Send a password reminder. | |
500 | * | |
501 | * If the user has no valid email address, or no password, or a reminder has been sent too recently, then no reminder will be sent. | |
502 | * | |
503 | * @param c Client | |
504 | * @param completed Called upon completion | |
505 | * @param username User to remind | |
506 | * @param v Passed to @p completed | |
507 | * @return 0 if the command was queued successfuly, non-0 on error | |
508 | */ | |
509 | int disorder_eclient_reminder(disorder_eclient *c, disorder_eclient_no_response *completed, const char *username, void *v); | |
510 | ||
511 | /** @brief Remove a track form the queue. | |
512 | * | |
513 | * Requires one of the 'remove mine', 'remove random' or 'remove any' rights depending on how the track came to be added to the queue. | |
514 | * | |
515 | * @param c Client | |
516 | * @param completed Called upon completion | |
517 | * @param id Track ID | |
518 | * @param v Passed to @p completed | |
519 | * @return 0 if the command was queued successfuly, non-0 on error | |
520 | */ | |
521 | int disorder_eclient_remove(disorder_eclient *c, disorder_eclient_no_response *completed, const char *id, void *v); | |
522 | ||
523 | /** @brief Rescan all collections for new or obsolete tracks. | |
524 | * | |
525 | * Requires the 'rescan' right. | |
526 | * | |
527 | * @param c Client | |
528 | * @param completed Called upon completion | |
529 | * @param v Passed to @p completed | |
530 | * @return 0 if the command was queued successfuly, non-0 on error | |
531 | */ | |
532 | int disorder_eclient_rescan(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
533 | ||
534 | /** @brief Resolve a track name | |
535 | * | |
536 | * Converts aliases to non-alias track names | |
537 | * | |
538 | * @param c Client | |
539 | * @param completed Called upon completion | |
540 | * @param track Track name (might be an alias) | |
541 | * @param v Passed to @p completed | |
542 | * @return 0 if the command was queued successfuly, non-0 on error | |
543 | */ | |
544 | int disorder_eclient_resolve(disorder_eclient *c, disorder_eclient_string_response *completed, const char *track, void *v); | |
545 | ||
546 | /** @brief Resume the currently playing track | |
547 | * | |
548 | * Requires the 'pause' right. | |
549 | * | |
550 | * @param c Client | |
551 | * @param completed Called upon completion | |
552 | * @param v Passed to @p completed | |
553 | * @return 0 if the command was queued successfuly, non-0 on error | |
554 | */ | |
555 | int disorder_eclient_resume(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
556 | ||
557 | /** @brief Revoke a cookie. | |
558 | * | |
559 | * It will not subsequently be possible to log in with the cookie. | |
560 | * | |
561 | * @param c Client | |
562 | * @param completed Called upon completion | |
563 | * @param v Passed to @p completed | |
564 | * @return 0 if the command was queued successfuly, non-0 on error | |
565 | */ | |
566 | int disorder_eclient_revoke(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
567 | ||
568 | /** @brief Terminate the playing track. | |
569 | * | |
570 | * Requires one of the 'scratch mine', 'scratch random' or 'scratch any' rights depending on how the track came to be added to the queue. | |
571 | * | |
572 | * @param c Client | |
573 | * @param completed Called upon completion | |
574 | * @param id Track ID (optional) | |
575 | * @param v Passed to @p completed | |
576 | * @return 0 if the command was queued successfuly, non-0 on error | |
577 | */ | |
578 | int disorder_eclient_scratch(disorder_eclient *c, disorder_eclient_no_response *completed, const char *id, void *v); | |
579 | ||
580 | /** @brief Schedule a track to play in the future | |
581 | * | |
582 | * | |
583 | * | |
584 | * @param c Client | |
585 | * @param completed Called upon completion | |
586 | * @param when When to play the track | |
587 | * @param priority Event priority ("normal" or "junk") | |
588 | * @param track Track to play | |
589 | * @param v Passed to @p completed | |
590 | * @return 0 if the command was queued successfuly, non-0 on error | |
591 | */ | |
592 | int disorder_eclient_schedule_add_play(disorder_eclient *c, disorder_eclient_no_response *completed, time_t when, const char *priority, const char *track, void *v); | |
593 | ||
594 | /** @brief Schedule a global setting to be changed in the future | |
595 | * | |
596 | * | |
597 | * | |
598 | * @param c Client | |
599 | * @param completed Called upon completion | |
600 | * @param when When to change the setting | |
601 | * @param priority Event priority ("normal" or "junk") | |
602 | * @param pref Global preference to set | |
603 | * @param value New value of global preference | |
604 | * @param v Passed to @p completed | |
605 | * @return 0 if the command was queued successfuly, non-0 on error | |
606 | */ | |
607 | int disorder_eclient_schedule_add_set_global(disorder_eclient *c, disorder_eclient_no_response *completed, time_t when, const char *priority, const char *pref, const char *value, void *v); | |
608 | ||
609 | /** @brief Schedule a global setting to be unset in the future | |
610 | * | |
611 | * | |
612 | * | |
613 | * @param c Client | |
614 | * @param completed Called upon completion | |
615 | * @param when When to change the setting | |
616 | * @param priority Event priority ("normal" or "junk") | |
617 | * @param pref Global preference to set | |
618 | * @param v Passed to @p completed | |
619 | * @return 0 if the command was queued successfuly, non-0 on error | |
620 | */ | |
621 | int disorder_eclient_schedule_add_unset_global(disorder_eclient *c, disorder_eclient_no_response *completed, time_t when, const char *priority, const char *pref, void *v); | |
622 | ||
623 | /** @brief Delete a scheduled event. | |
624 | * | |
625 | * Users can always delete their own scheduled events; with the admin right you can delete any event. | |
626 | * | |
627 | * @param c Client | |
628 | * @param completed Called upon completion | |
629 | * @param event ID of event to delete | |
630 | * @param v Passed to @p completed | |
631 | * @return 0 if the command was queued successfuly, non-0 on error | |
632 | */ | |
633 | int disorder_eclient_schedule_del(disorder_eclient *c, disorder_eclient_no_response *completed, const char *event, void *v); | |
634 | ||
635 | /** @brief List scheduled events | |
636 | * | |
637 | * This just lists IDs. Use 'schedule-get' to retrieve more detail | |
638 | * | |
639 | * @param c Client | |
640 | * @param completed Called upon completion | |
641 | * @param v Passed to @p completed | |
642 | * @return 0 if the command was queued successfuly, non-0 on error | |
643 | */ | |
644 | int disorder_eclient_schedule_list(disorder_eclient *c, disorder_eclient_list_response *completed, void *v); | |
645 | ||
646 | /** @brief Search for tracks | |
647 | * | |
648 | * Terms are either keywords or tags formatted as 'tag:TAG-NAME'. | |
649 | * | |
650 | * @param c Client | |
651 | * @param completed Called upon completion | |
652 | * @param terms List of search terms | |
653 | * @param v Passed to @p completed | |
654 | * @return 0 if the command was queued successfuly, non-0 on error | |
655 | */ | |
656 | int disorder_eclient_search(disorder_eclient *c, disorder_eclient_list_response *completed, const char *terms, void *v); | |
657 | ||
658 | /** @brief Set a track preference | |
659 | * | |
660 | * Requires the 'prefs' right. | |
661 | * | |
662 | * @param c Client | |
663 | * @param completed Called upon completion | |
664 | * @param track Track name | |
665 | * @param pref Preference name | |
666 | * @param value New value | |
667 | * @param v Passed to @p completed | |
668 | * @return 0 if the command was queued successfuly, non-0 on error | |
669 | */ | |
670 | int disorder_eclient_set(disorder_eclient *c, disorder_eclient_no_response *completed, const char *track, const char *pref, const char *value, void *v); | |
671 | ||
672 | /** @brief Set a global preference | |
673 | * | |
674 | * Requires the 'global prefs' right. | |
675 | * | |
676 | * @param c Client | |
677 | * @param completed Called upon completion | |
678 | * @param pref Preference name | |
679 | * @param value New value | |
680 | * @param v Passed to @p completed | |
681 | * @return 0 if the command was queued successfuly, non-0 on error | |
682 | */ | |
683 | int disorder_eclient_set_global(disorder_eclient *c, disorder_eclient_no_response *completed, const char *pref, const char *value, void *v); | |
684 | ||
685 | /** @brief Request server shutdown | |
686 | * | |
687 | * Requires the 'admin' right. | |
688 | * | |
689 | * @param c Client | |
690 | * @param completed Called upon completion | |
691 | * @param v Passed to @p completed | |
692 | * @return 0 if the command was queued successfuly, non-0 on error | |
693 | */ | |
694 | int disorder_eclient_shutdown(disorder_eclient *c, disorder_eclient_no_response *completed, void *v); | |
695 | ||
696 | /** @brief Get server statistics | |
697 | * | |
698 | * The details of what the server reports are not really defined. The returned strings are intended to be printed out one to a line. | |
699 | * | |
700 | * @param c Client | |
701 | * @param completed Called upon completion | |
702 | * @param v Passed to @p completed | |
703 | * @return 0 if the command was queued successfuly, non-0 on error | |
704 | */ | |
705 | int disorder_eclient_stats(disorder_eclient *c, disorder_eclient_list_response *completed, void *v); | |
706 | ||
707 | /** @brief Get a list of known tags | |
708 | * | |
709 | * Only tags which apply to at least one track are returned. | |
710 | * | |
711 | * @param c Client | |
712 | * @param completed Called upon completion | |
713 | * @param v Passed to @p completed | |
714 | * @return 0 if the command was queued successfuly, non-0 on error | |
715 | */ | |
716 | int disorder_eclient_tags(disorder_eclient *c, disorder_eclient_list_response *completed, void *v); | |
717 | ||
718 | /** @brief Unset a track preference | |
719 | * | |
720 | * Requires the 'prefs' right. | |
721 | * | |
722 | * @param c Client | |
723 | * @param completed Called upon completion | |
724 | * @param track Track name | |
725 | * @param pref Preference name | |
726 | * @param v Passed to @p completed | |
727 | * @return 0 if the command was queued successfuly, non-0 on error | |
728 | */ | |
729 | int disorder_eclient_unset(disorder_eclient *c, disorder_eclient_no_response *completed, const char *track, const char *pref, void *v); | |
730 | ||
731 | /** @brief Set a global preference | |
732 | * | |
733 | * Requires the 'global prefs' right. | |
734 | * | |
735 | * @param c Client | |
736 | * @param completed Called upon completion | |
737 | * @param pref Preference name | |
738 | * @param v Passed to @p completed | |
739 | * @return 0 if the command was queued successfuly, non-0 on error | |
740 | */ | |
741 | int disorder_eclient_unset_global(disorder_eclient *c, disorder_eclient_no_response *completed, const char *pref, void *v); | |
742 | ||
743 | /** @brief Get a user property. | |
744 | * | |
745 | * If the user does not exist an error is returned, if the user exists but the property does not then a null value is returned. | |
746 | * | |
747 | * @param c Client | |
748 | * @param completed Called upon completion | |
749 | * @param username User to read | |
750 | * @param property Property to read | |
751 | * @param v Passed to @p completed | |
752 | * @return 0 if the command was queued successfuly, non-0 on error | |
753 | */ | |
754 | int disorder_eclient_userinfo(disorder_eclient *c, disorder_eclient_string_response *completed, const char *username, const char *property, void *v); | |
755 | ||
756 | /** @brief Get a list of users | |
757 | * | |
758 | * | |
759 | * | |
760 | * @param c Client | |
761 | * @param completed Called upon completion | |
762 | * @param v Passed to @p completed | |
763 | * @return 0 if the command was queued successfuly, non-0 on error | |
764 | */ | |
765 | int disorder_eclient_users(disorder_eclient *c, disorder_eclient_list_response *completed, void *v); | |
766 | ||
767 | /** @brief Get the server version | |
768 | * | |
769 | * | |
770 | * | |
771 | * @param c Client | |
772 | * @param completed Called upon completion | |
773 | * @param v Passed to @p completed | |
774 | * @return 0 if the command was queued successfuly, non-0 on error | |
775 | */ | |
776 | int disorder_eclient_version(disorder_eclient *c, disorder_eclient_string_response *completed, void *v); | |
777 | ||
778 | /** @brief Set the volume | |
779 | * | |
780 | * | |
781 | * | |
782 | * @param c Client | |
783 | * @param completed Called upon completion | |
784 | * @param left Left channel volume | |
785 | * @param right Right channel volume | |
786 | * @param v Passed to @p completed | |
787 | * @return 0 if the command was queued successfuly, non-0 on error | |
788 | */ | |
789 | int disorder_eclient_set_volume(disorder_eclient *c, disorder_eclient_no_response *completed, long left, long right, void *v); | |
790 | ||
791 | /** @brief Get the volume | |
792 | * | |
793 | * | |
794 | * | |
795 | * @param c Client | |
796 | * @param completed Called upon completion | |
797 | * @param v Passed to @p completed | |
798 | * @return 0 if the command was queued successfuly, non-0 on error | |
799 | */ | |
800 | int disorder_eclient_get_volume(disorder_eclient *c, disorder_eclient_pair_integer_response *completed, void *v); | |
801 | ||
802 | #endif |