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