]> code.delx.au - pulseaudio/blob - src/polyp/browser.h
1ff58d8c758f02c61620e3f056d0db93a59e4523
[pulseaudio] / src / polyp / browser.h
1 #ifndef foobrowserhfoo
2 #define foobrowserhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of polypaudio.
8
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version.
13
14 polypaudio 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
20 License along with polypaudio; 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 <polyp/mainloop-api.h>
26 #include <polyp/sample.h>
27 #include <polyp/channelmap.h>
28 #include <polyp/cdecl.h>
29
30 PA_C_DECL_BEGIN
31
32 typedef struct pa_browser pa_browser;
33
34 typedef enum pa_browse_opcode {
35 PA_BROWSE_NEW_SERVER = 0,
36 PA_BROWSE_NEW_SINK,
37 PA_BROWSE_NEW_SOURCE,
38 PA_BROWSE_REMOVE_SERVER,
39 PA_BROWSE_REMOVE_SINK,
40 PA_BROWSE_REMOVE_SOURCE
41 } pa_browse_opcode_t;
42
43 pa_browser *pa_browser_new(pa_mainloop_api *mainloop);
44 pa_browser *pa_browser_ref(pa_browser *z);
45 void pa_browser_unref(pa_browser *z);
46
47 typedef struct pa_browse_info {
48 /* Unique service name */
49 const char *name; /* always available */
50
51 /* Server info */
52 const char *server; /* always available */
53 const char *server_version, *user_name, *fqdn; /* optional */
54 const uint32_t *cookie; /* optional */
55
56 /* Device info */
57 const char *device; /* always available when this information is of a sink/source */
58 const char *description; /* optional */
59 const pa_sample_spec *sample_spec; /* optional */
60 } pa_browse_info;
61
62 typedef void (*pa_browse_cb_t)(pa_browser *z, pa_browse_opcode_t c, const pa_browse_info *i, void *userdata);
63
64 void pa_browser_set_callback(pa_browser *z, pa_browse_cb_t cb, void *userdata);
65
66 PA_C_DECL_END
67
68 #endif