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