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.1 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, see <http://www.gnu.org/licenses/>.
21***/
22
23#include <inttypes.h>
24
25#include <pulsecore/typedefs.h>
26#include <pulse/proplist.h>
27#include <pulsecore/core.h>
28#include <pulsecore/module.h>
29
30/* Every connection to the server should have a pa_client
31 * attached. That way the user may generate a listing of all connected
32 * clients easily and kill them if they want.*/
33
34struct pa_client {
35    uint32_t index;
36    pa_core *core;
37
38    pa_proplist *proplist;
39    pa_module *module;
40    char *driver;
41
42    pa_idxset *sink_inputs;
43    pa_idxset *source_outputs;
44
45    void *userdata;
46
47    void (*kill)(pa_client *c);
48
49    void (*send_event)(pa_client *c, const char *name, pa_proplist *data);
50};
51
52typedef struct pa_client_new_data {
53    pa_proplist *proplist;
54    const char *driver;
55    pa_module *module;
56} pa_client_new_data;
57
58pa_client_new_data *pa_client_new_data_init(pa_client_new_data *data);
59void pa_client_new_data_done(pa_client_new_data *data);
60
61pa_client *pa_client_new(pa_core *c, pa_client_new_data *data);
62
63/* This function should be called only by the code that created the client */
64void pa_client_free(pa_client *c);
65
66/* Code that didn't create the client should call this function to
67 * request destruction of the client */
68void pa_client_kill(pa_client *c);
69
70/* Rename the client */
71void pa_client_set_name(pa_client *c, const char *name);
72
73void pa_client_update_proplist(pa_client *c, pa_update_mode_t mode, pa_proplist *p);
74
75void pa_client_send_event(pa_client *c, const char *event, pa_proplist *data);
76
77typedef struct pa_client_send_event_hook_data {
78    pa_client *client;
79    const char *event;
80    pa_proplist *data;
81} pa_client_send_event_hook_data;
82
83#endif
84