chiark / gitweb /
More commands.
[disorder] / lib / client.h
1 /*
2  * This file is part of DisOrder.
3  * Copyright (C) 2004-2008 Richard Kettlewell
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 3 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,
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  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 /** @file lib/client.h
19  * @brief Simple C client
20  *
21  * See @ref lib/eclient.h for an asynchronous-capable client
22  * implementation.
23  */
24
25 #ifndef CLIENT_H
26 #define CLIENT_H
27
28 #include <time.h>
29 #include "configuration.h"
30
31 /** @brief Client data */
32 typedef struct disorder_client disorder_client;
33
34 struct queue_entry;
35 struct kvp;
36 struct sink;
37
38 disorder_client *disorder_new(int verbose);
39 int disorder_connect(disorder_client *c);
40 int disorder_connect_user(disorder_client *c,
41                           const char *username,
42                           const char *password);
43 int disorder_connect_cookie(disorder_client *c, const char *cookie);
44 int disorder_connect_generic(struct config *conf,
45                              disorder_client *c,
46                              const char *username,
47                              const char *password,
48                              const char *cookie);
49 int disorder_close(disorder_client *c);
50 int disorder_playing(disorder_client *c, struct queue_entry **qp);
51 char *disorder_user(disorder_client *c);
52 int disorder_prefs(disorder_client *c, const char *track,
53                    struct kvp **kp);
54 int disorder_set_volume(disorder_client *c, int left, int right);
55 int disorder_get_volume(disorder_client *c, int *left, int *right);
56 int disorder_log(disorder_client *c, struct sink *s);
57 int disorder_new_tracks(disorder_client *c,
58                         char ***vecp, int *nvecp,
59                         int max);
60 int disorder_rtp_address(disorder_client *c, char **addressp, char **portp);
61 const char *disorder_last(disorder_client *c);
62 int disorder_schedule_get(disorder_client *c, const char *id,
63                           struct kvp **actiondatap);
64 int disorder_schedule_add(disorder_client *c,
65                           time_t when,
66                           const char *priority,
67                           const char *action,
68                           ...);
69
70 #include "client-stubs.h"
71
72 #endif /* CLIENT_H */
73
74 /*
75 Local Variables:
76 c-basic-offset:2
77 comment-column:40
78 End:
79 */