7 This file is part of PulseAudio.
9 PulseAudio 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.
14 PulseAudio 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.
19 You should have received a copy of the GNU Lesser General Public License
20 along with PulseAudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 typedef struct pa_source pa_source
;
29 #include <pulse/sample.h>
30 #include <pulse/channelmap.h>
31 #include <pulse/volume.h>
32 #include <pulsecore/core-def.h>
33 #include <pulsecore/core.h>
34 #include <pulsecore/idxset.h>
35 #include <pulsecore/memblock.h>
36 #include <pulsecore/memchunk.h>
37 #include <pulsecore/sink.h>
38 #include <pulsecore/module.h>
40 #define PA_MAX_OUTPUTS_PER_SOURCE 16
42 typedef enum pa_source_state
{
44 PA_SOURCE_DISCONNECTED
51 pa_source_state_t state
;
54 char *description
, *driver
; /* may be NULL */
56 pa_module
*owner
; /* may be NULL */
58 pa_sample_spec sample_spec
;
59 pa_channel_map channel_map
;
62 pa_sink
*monitor_of
; /* may be NULL */
64 pa_cvolume hw_volume
, sw_volume
;
65 int hw_muted
, sw_muted
;
69 void (*notify
)(pa_source
*source
); /* may be NULL */
70 pa_usec_t (*get_latency
)(pa_source
*s
); /* dito */
71 int (*set_hw_volume
)(pa_source
*s
); /* dito */
72 int (*get_hw_volume
)(pa_source
*s
); /* dito */
73 int (*set_hw_mute
)(pa_source
*s
); /* dito */
74 int (*get_hw_mute
)(pa_source
*s
); /* dito */
79 pa_source
* pa_source_new(
84 const pa_sample_spec
*spec
,
85 const pa_channel_map
*map
);
87 void pa_source_disconnect(pa_source
*s
);
88 void pa_source_unref(pa_source
*s
);
89 pa_source
* pa_source_ref(pa_source
*c
);
91 /* Pass a new memory block to all output streams */
92 void pa_source_post(pa_source
*s
, const pa_memchunk
*b
);
94 void pa_source_notify(pa_source
*s
);
96 void pa_source_set_owner(pa_source
*s
, pa_module
*m
);
98 pa_usec_t
pa_source_get_latency(pa_source
*s
);
100 void pa_source_set_volume(pa_source
*source
, pa_mixer_t m
, const pa_cvolume
*volume
);
101 const pa_cvolume
*pa_source_get_volume(pa_source
*source
, pa_mixer_t m
);
102 void pa_source_set_mute(pa_source
*source
, pa_mixer_t m
, int mute
);
103 int pa_source_get_mute(pa_source
*source
, pa_mixer_t m
);
105 void pa_source_set_description(pa_source
*s
, const char *description
);
107 unsigned pa_source_used_by(pa_source
*s
);