chiark / gitweb /
Columns are now resizable and wide columns are ellipsized. Columns
[disorder] / lib / client.h
CommitLineData
460b9539 1/*
2 * This file is part of DisOrder.
5aff007d 3 * Copyright (C) 2004-2008 Richard Kettlewell
460b9539 4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 * USA
19 */
c4e2cfdd
RK
20/** @file lib/client.h
21 * @brief Simple C client
22 *
158d0961 23 * See @ref lib/eclient.h for an asynchronous-capable client
c4e2cfdd
RK
24 * implementation.
25 */
460b9539 26
27#ifndef CLIENT_H
28#define CLIENT_H
29
05b75f8d
RK
30#include <time.h>
31
c4e2cfdd 32/** @brief Client data */
460b9539 33typedef struct disorder_client disorder_client;
34
35struct queue_entry;
36struct kvp;
37struct sink;
38
460b9539 39disorder_client *disorder_new(int verbose);
460b9539 40int disorder_connect(disorder_client *c);
fdf98378 41int disorder_connect_user(disorder_client *c,
42 const char *username,
43 const char *password);
0227f67d 44int disorder_connect_cookie(disorder_client *c, const char *cookie);
460b9539 45int disorder_close(disorder_client *c);
460b9539 46int disorder_version(disorder_client *c, char **versionp);
460b9539 47int disorder_play(disorder_client *c, const char *track);
460b9539 48int disorder_remove(disorder_client *c, const char *track);
460b9539 49int disorder_move(disorder_client *c, const char *track, int delta);
460b9539 50int disorder_enable(disorder_client *c);
460b9539 51int disorder_disable(disorder_client *c);
460b9539 52int disorder_scratch(disorder_client *c, const char *id);
460b9539 53int disorder_shutdown(disorder_client *c);
460b9539 54int disorder_reconfigure(disorder_client *c);
460b9539 55int disorder_rescan(disorder_client *c);
460b9539 56int disorder_playing(disorder_client *c, struct queue_entry **qp);
460b9539 57int disorder_recent(disorder_client *c, struct queue_entry **qp);
460b9539 58int disorder_queue(disorder_client *c, struct queue_entry **qp);
460b9539 59int disorder_directories(disorder_client *c, const char *dir, const char *re,
60 char ***vecp, int *nvecp);
460b9539 61int disorder_files(disorder_client *c, const char *dir, const char *re,
62 char ***vecp, int *nvecp);
460b9539 63int disorder_allfiles(disorder_client *c, const char *dir, const char *re,
64 char ***vecp, int *nvecp);
460b9539 65char *disorder_user(disorder_client *c);
460b9539 66int disorder_exists(disorder_client *c, const char *track, int *existsp);
460b9539 67int disorder_enabled(disorder_client *c, int *enabledp);
460b9539 68int disorder_set(disorder_client *c, const char *track,
69 const char *key, const char *value);
70int disorder_unset(disorder_client *c, const char *track,
71 const char *key);
72int disorder_get(disorder_client *c, const char *track, const char *key,
73 char **valuep);
74int disorder_prefs(disorder_client *c, const char *track,
75 struct kvp **kp);
460b9539 76int disorder_length(disorder_client *c, const char *track,
77 long *valuep);
460b9539 78int disorder_search(disorder_client *c, const char *terms,
79 char ***vecp, int *nvecp);
460b9539 80int disorder_random_enable(disorder_client *c);
460b9539 81int disorder_random_disable(disorder_client *c);
460b9539 82int disorder_random_enabled(disorder_client *c, int *enabledp);
460b9539 83int disorder_stats(disorder_client *c,
84 char ***vecp, int *nvecp);
460b9539 85int disorder_set_volume(disorder_client *c, int left, int right);
86int disorder_get_volume(disorder_client *c, int *left, int *right);
460b9539 87int disorder_log(disorder_client *c, struct sink *s);
460b9539 88int disorder_part(disorder_client *c, char **partp,
89 const char *track, const char *context, const char *part);
460b9539 90int disorder_resolve(disorder_client *c, char **trackp, const char *track);
460b9539 91int disorder_pause(disorder_client *c);
460b9539 92int disorder_resume(disorder_client *c);
460b9539 93int disorder_tags(disorder_client *c,
94 char ***vecp, int *nvecp);
460b9539 95int disorder_set_global(disorder_client *c,
96 const char *key, const char *value);
97int disorder_unset_global(disorder_client *c, const char *key);
98int disorder_get_global(disorder_client *c, const char *key, char **valuep);
2a10b70b
RK
99int disorder_new_tracks(disorder_client *c,
100 char ***vecp, int *nvecp,
101 int max);
ca831831 102int disorder_rtp_address(disorder_client *c, char **addressp, char **portp);
f0feb22e 103int disorder_adduser(disorder_client *c,
0f55e905
RK
104 const char *user, const char *password,
105 const char *rights);
f0feb22e 106int disorder_deluser(disorder_client *c, const char *user);
a55c70c7
RK
107int disorder_userinfo(disorder_client *c, const char *user, const char *key,
108 char **valuep);
5df73aeb
RK
109int disorder_edituser(disorder_client *c, const char *user,
110 const char *key, const char *value);
c3be4f19
RK
111int disorder_users(disorder_client *c,
112 char ***vecp, int *nvecp);
ba39faf6
RK
113int disorder_register(disorder_client *c, const char *user,
114 const char *password, const char *email,
115 char **confirmp);
116int disorder_confirm(disorder_client *c, const char *confirm);
07969f9b 117int disorder_make_cookie(disorder_client *c, char **cookiep);
bb037be2 118const char *disorder_last(disorder_client *c);
b42ffad6 119int disorder_revoke(disorder_client *c);
6207d2f3 120int disorder_reminder(disorder_client *c, const char *user);
758aa6c3
RK
121int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp);
122int disorder_schedule_del(disorder_client *c, const char *id);
123int disorder_schedule_get(disorder_client *c, const char *id,
124 struct kvp **actiondatap);
125int disorder_schedule_add(disorder_client *c,
126 time_t when,
127 const char *priority,
128 const char *action,
129 ...);
f0feb22e 130
460b9539 131#endif /* CLIENT_H */
132
133/*
134Local Variables:
135c-basic-offset:2
136comment-column:40
137End:
138*/