]> code.delx.au - pulseaudio/blob - src/pulsecore/device-port.h
f38702152f5b2b3e9c7c0e3ef5b82eecd60473ed
[pulseaudio] / src / pulsecore / device-port.h
1 #ifndef foopulsedeviceporthfoo
2 #define foopulsedeviceporthfoo
3
4 /***
5 This file is part of PulseAudio.
6
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
9 Copyright 2011 David Henningsson, Canonical Ltd.
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.1 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
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31
32 #include <inttypes.h>
33
34 #include <pulse/def.h>
35 #include <pulsecore/object.h>
36 #include <pulsecore/hashmap.h>
37
38 /* Note: Including core.h here leads to circular references
39 (device-port.h -> core.h -> sink.h -> device-port.h), hence the line below instead */
40 typedef struct pa_core pa_core;
41
42 typedef struct pa_device_port pa_device_port;
43
44 struct pa_device_port {
45 pa_object parent; /* Needed for reference counting */
46 pa_core *core;
47
48 char *name;
49 char *description;
50
51 unsigned priority;
52 pa_port_available_t available; /* PA_PORT_AVAILABLE_UNKNOWN, PA_PORT_AVAILABLE_NO or PA_PORT_AVAILABLE_YES */
53
54 pa_hashmap *profiles; /* Can be NULL. Does not own the profiles */
55 pa_bool_t is_input:1;
56 pa_bool_t is_output:1;
57
58 /* .. followed by some implementation specific data */
59 };
60
61 PA_DECLARE_PUBLIC_CLASS(pa_device_port);
62 #define PA_DEVICE_PORT(s) (pa_device_port_cast(s))
63
64 #define PA_DEVICE_PORT_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_device_port))))
65
66 pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *description, size_t extra);
67
68 void pa_device_port_hashmap_free(pa_hashmap *h);
69
70 #include <pulsecore/core.h>
71
72 /* The port's available status has changed */
73 void pa_device_port_set_available(pa_device_port *p, pa_port_available_t available);
74
75 #endif