]> code.delx.au - pulseaudio/blob - src/pulsecore/device-port.h
device-port: Make it impossible to have dual-direction ports
[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 typedef struct pa_device_port pa_device_port;
28
29 #ifdef HAVE_CONFIG_H
30 #include <config.h>
31 #endif
32
33 #include <inttypes.h>
34
35 #include <pulse/def.h>
36 #include <pulsecore/object.h>
37 #include <pulsecore/hashmap.h>
38 #include <pulsecore/core.h>
39 #include <pulsecore/card.h>
40
41 struct pa_device_port {
42 pa_object parent; /* Needed for reference counting */
43 pa_core *core;
44 pa_card *card;
45
46 char *name;
47 char *description;
48
49 unsigned priority;
50 pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */
51
52 pa_proplist *proplist;
53 pa_hashmap *profiles; /* Does not own the profiles */
54 pa_direction_t direction;
55 int64_t latency_offset;
56
57 /* .. followed by some implementation specific data */
58 };
59
60 PA_DECLARE_PUBLIC_CLASS(pa_device_port);
61 #define PA_DEVICE_PORT(s) (pa_device_port_cast(s))
62
63 #define PA_DEVICE_PORT_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_device_port))))
64
65 pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *description, pa_direction_t direction, size_t extra);
66
67 /* The port's available status has changed */
68 void pa_device_port_set_available(pa_device_port *p, pa_available_t available);
69
70 void pa_device_port_set_latency_offset(pa_device_port *p, int64_t offset);
71
72 #endif