2 * This file is part of DisOrder.
3 * Copyright (C) 2004-2008 Richard Kettlewell
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.
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.
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
20 /** @file lib/client.h
21 * @brief Simple C client
23 * See @ref lib/eclient.h for an asynchronous-capable client
32 /** @brief Client data */
33 typedef struct disorder_client disorder_client;
39 disorder_client *disorder_new(int verbose);
40 int disorder_connect(disorder_client *c);
41 int disorder_connect_user(disorder_client *c,
43 const char *password);
44 int disorder_connect_cookie(disorder_client *c, const char *cookie);
45 int disorder_close(disorder_client *c);
46 int disorder_version(disorder_client *c, char **versionp);
47 int disorder_play(disorder_client *c, const char *track);
48 int disorder_remove(disorder_client *c, const char *track);
49 int disorder_move(disorder_client *c, const char *track, int delta);
50 int disorder_enable(disorder_client *c);
51 int disorder_disable(disorder_client *c);
52 int disorder_scratch(disorder_client *c, const char *id);
53 int disorder_shutdown(disorder_client *c);
54 int disorder_reconfigure(disorder_client *c);
55 int disorder_rescan(disorder_client *c);
56 int disorder_playing(disorder_client *c, struct queue_entry **qp);
57 int disorder_recent(disorder_client *c, struct queue_entry **qp);
58 int disorder_queue(disorder_client *c, struct queue_entry **qp);
59 int disorder_directories(disorder_client *c, const char *dir, const char *re,
60 char ***vecp, int *nvecp);
61 int disorder_files(disorder_client *c, const char *dir, const char *re,
62 char ***vecp, int *nvecp);
63 int disorder_allfiles(disorder_client *c, const char *dir, const char *re,
64 char ***vecp, int *nvecp);
65 char *disorder_user(disorder_client *c);
66 int disorder_exists(disorder_client *c, const char *track, int *existsp);
67 int disorder_enabled(disorder_client *c, int *enabledp);
68 int disorder_set(disorder_client *c, const char *track,
69 const char *key, const char *value);
70 int disorder_unset(disorder_client *c, const char *track,
72 int disorder_get(disorder_client *c, const char *track, const char *key,
74 int disorder_prefs(disorder_client *c, const char *track,
76 int disorder_length(disorder_client *c, const char *track,
78 int disorder_search(disorder_client *c, const char *terms,
79 char ***vecp, int *nvecp);
80 int disorder_random_enable(disorder_client *c);
81 int disorder_random_disable(disorder_client *c);
82 int disorder_random_enabled(disorder_client *c, int *enabledp);
83 int disorder_stats(disorder_client *c,
84 char ***vecp, int *nvecp);
85 int disorder_set_volume(disorder_client *c, int left, int right);
86 int disorder_get_volume(disorder_client *c, int *left, int *right);
87 int disorder_log(disorder_client *c, struct sink *s);
88 int disorder_part(disorder_client *c, char **partp,
89 const char *track, const char *context, const char *part);
90 int disorder_resolve(disorder_client *c, char **trackp, const char *track);
91 int disorder_pause(disorder_client *c);
92 int disorder_resume(disorder_client *c);
93 int disorder_tags(disorder_client *c,
94 char ***vecp, int *nvecp);
95 int disorder_set_global(disorder_client *c,
96 const char *key, const char *value);
97 int disorder_unset_global(disorder_client *c, const char *key);
98 int disorder_get_global(disorder_client *c, const char *key, char **valuep);
99 int disorder_new_tracks(disorder_client *c,
100 char ***vecp, int *nvecp,
102 int disorder_rtp_address(disorder_client *c, char **addressp, char **portp);
103 int disorder_adduser(disorder_client *c,
104 const char *user, const char *password,
106 int disorder_deluser(disorder_client *c, const char *user);
107 int disorder_userinfo(disorder_client *c, const char *user, const char *key,
109 int disorder_edituser(disorder_client *c, const char *user,
110 const char *key, const char *value);
111 int disorder_users(disorder_client *c,
112 char ***vecp, int *nvecp);
113 int disorder_register(disorder_client *c, const char *user,
114 const char *password, const char *email,
116 int disorder_confirm(disorder_client *c, const char *confirm);
117 int disorder_make_cookie(disorder_client *c, char **cookiep);
118 const char *disorder_last(disorder_client *c);
119 int disorder_revoke(disorder_client *c);
120 int disorder_reminder(disorder_client *c, const char *user);
121 int disorder_schedule_list(disorder_client *c, char ***idsp, int *nidsp);
122 int disorder_schedule_del(disorder_client *c, const char *id);
123 int disorder_schedule_get(disorder_client *c, const char *id,
124 struct kvp **actiondatap);
125 int disorder_schedule_add(disorder_client *c,
127 const char *priority,
131 #endif /* CLIENT_H */