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