]> code.delx.au - pulseaudio/blob - src/polypcore/sink.h
Cleaned up the includes after the restructuring. Indicate which headers are
[pulseaudio] / src / polypcore / sink.h
1 #ifndef foosinkhfoo
2 #define foosinkhfoo
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 published
11 by the Free Software Foundation; either version 2 of the License,
12 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 License
20 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 <inttypes.h>
26
27 typedef struct pa_sink pa_sink;
28
29 #include <polyp/sample.h>
30 #include <polyp/channelmap.h>
31 #include <polyp/volume.h>
32 #include <polypcore/core.h>
33 #include <polypcore/idxset.h>
34 #include <polypcore/source.h>
35 #include <polypcore/module.h>
36
37 #define PA_MAX_INPUTS_PER_SINK 6
38
39 typedef enum pa_sink_state {
40 PA_SINK_RUNNING,
41 PA_SINK_DISCONNECTED
42 } pa_sink_state_t;
43
44 typedef enum pa_mixer {
45 PA_MIXER_SOFTWARE,
46 PA_MIXER_HARDWARE
47 } pa_mixer_t;
48
49 struct pa_sink {
50 int ref;
51 uint32_t index;
52 pa_core *core;
53 pa_sink_state_t state;
54
55 char *name, *description, *driver;
56 pa_module *owner;
57
58 pa_sample_spec sample_spec;
59 pa_channel_map channel_map;
60
61 pa_idxset *inputs;
62 pa_source *monitor_source;
63
64 pa_cvolume hw_volume, sw_volume;
65
66 void (*notify)(pa_sink*sink);
67 pa_usec_t (*get_latency)(pa_sink *s);
68 int (*set_hw_volume)(pa_sink *s);
69 int (*get_hw_volume)(pa_sink *s);
70
71 void *userdata;
72 };
73
74 pa_sink* pa_sink_new(
75 pa_core *core,
76 const char *driver,
77 const char *name,
78 int namereg_fail,
79 const pa_sample_spec *spec,
80 const pa_channel_map *map);
81
82 void pa_sink_disconnect(pa_sink* s);
83 void pa_sink_unref(pa_sink*s);
84 pa_sink* pa_sink_ref(pa_sink *s);
85
86 int pa_sink_render(pa_sink*s, size_t length, pa_memchunk *result);
87 void pa_sink_render_full(pa_sink *s, size_t length, pa_memchunk *result);
88 int pa_sink_render_into(pa_sink*s, pa_memchunk *target);
89 void pa_sink_render_into_full(pa_sink *s, pa_memchunk *target);
90
91 pa_usec_t pa_sink_get_latency(pa_sink *s);
92
93 void pa_sink_notify(pa_sink*s);
94
95 void pa_sink_set_owner(pa_sink *sink, pa_module *m);
96
97 void pa_sink_set_volume(pa_sink *sink, pa_mixer_t m, const pa_cvolume *volume);
98 const pa_cvolume *pa_sink_get_volume(pa_sink *sink, pa_mixer_t m);
99
100 #endif