merge glitch-free branch back into trunk
[profile/ivi/pulseaudio.git] / src / pulsecore / client.h
1 #ifndef foopulseclienthfoo
2 #define foopulseclienthfoo
3
4 /* $Id$ */
5
6 /***
7   This file is part of PulseAudio.
8
9   Copyright 2004-2006 Lennart Poettering
10
11   PulseAudio is free software; you can redistribute it and/or modify
12   it under the terms of the GNU Lesser General Public License as published
13   by the Free Software Foundation; either version 2 of the License,
14   or (at your option) any later version.
15
16   PulseAudio is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU Lesser General Public License
22   along with PulseAudio; if not, write to the Free Software
23   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24   USA.
25 ***/
26
27 #include <inttypes.h>
28
29 typedef struct pa_client pa_client;
30
31 #include <pulse/proplist.h>
32 #include <pulsecore/core.h>
33 #include <pulsecore/module.h>
34
35 /* Every connection to the server should have a pa_client
36  * attached. That way the user may generate a listing of all connected
37  * clients easily and kill them if he wants.*/
38
39 struct pa_client {
40     uint32_t index;
41     pa_core *core;
42
43     pa_proplist *proplist;
44     pa_module *module;
45     char *driver;
46
47     void (*kill)(pa_client *c);
48     void *userdata;
49 };
50
51 pa_client *pa_client_new(pa_core *c, const char *driver, const char *name);
52
53 /* This function should be called only by the code that created the client */
54 void pa_client_free(pa_client *c);
55
56 /* Code that didn't create the client should call this function to
57  * request destruction of the client */
58 void pa_client_kill(pa_client *c);
59
60 /* Rename the client */
61 void pa_client_set_name(pa_client *c, const char *name);
62
63 #endif