7 This file is part of PulseAudio.
9 Copyright 2004-2006 Lennart Poettering
10 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
12 PulseAudio is free software; you can redistribute it and/or modify
13 it under the terms of the GNU Lesser General Public License as published
14 by the Free Software Foundation; either version 2 of the License,
15 or (at your option) any later version.
17 PulseAudio is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with PulseAudio; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28 typedef struct pa_source pa_source;
32 #include <pulse/sample.h>
33 #include <pulse/channelmap.h>
34 #include <pulse/volume.h>
35 #include <pulsecore/core-def.h>
36 #include <pulsecore/core.h>
37 #include <pulsecore/idxset.h>
38 #include <pulsecore/memblock.h>
39 #include <pulsecore/memchunk.h>
40 #include <pulsecore/sink.h>
41 #include <pulsecore/module.h>
43 #define PA_MAX_OUTPUTS_PER_SOURCE 16
45 typedef enum pa_source_state {
47 PA_SOURCE_DISCONNECTED
54 pa_source_state_t state;
57 char *description, *driver; /* may be NULL */
59 pa_module *owner; /* may be NULL */
61 pa_sample_spec sample_spec;
62 pa_channel_map channel_map;
65 pa_sink *monitor_of; /* may be NULL */
67 pa_cvolume hw_volume, sw_volume;
68 int hw_muted, sw_muted;
72 void (*notify)(pa_source*source); /* may be NULL */
73 pa_usec_t (*get_latency)(pa_source *s); /* dito */
74 int (*set_hw_volume)(pa_source *s); /* dito */
75 int (*get_hw_volume)(pa_source *s); /* dito */
76 int (*set_hw_mute)(pa_source *s); /* dito */
77 int (*get_hw_mute)(pa_source *s); /* dito */
82 pa_source* pa_source_new(
87 const pa_sample_spec *spec,
88 const pa_channel_map *map);
90 void pa_source_disconnect(pa_source *s);
91 void pa_source_unref(pa_source *s);
92 pa_source* pa_source_ref(pa_source *c);
94 /* Pass a new memory block to all output streams */
95 void pa_source_post(pa_source*s, const pa_memchunk *b);
97 void pa_source_notify(pa_source *s);
99 void pa_source_set_owner(pa_source *s, pa_module *m);
101 pa_usec_t pa_source_get_latency(pa_source *s);
103 void pa_source_set_volume(pa_source *source, pa_mixer_t m, const pa_cvolume *volume);
104 const pa_cvolume *pa_source_get_volume(pa_source *source, pa_mixer_t m);
105 void pa_source_set_mute(pa_source *source, pa_mixer_t m, int mute);
106 int pa_source_get_mute(pa_source *source, pa_mixer_t m);
108 void pa_source_set_description(pa_source *s, const char *description);
110 unsigned pa_source_used_by(pa_source *s);