5 This file is part of PulseAudio.
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
9 Copyright 2013 Peter Meerwald <pmeerw@pmeerw.net>
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.
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.
21 You should have received a copy of the GNU Lesser General Public License
22 along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
25 #include <pulse/sample.h>
26 #include <pulse/volume.h>
27 #include <pulsecore/memchunk.h>
29 typedef struct pa_mix_info {
34 /* The following fields are used internally by pa_mix(), should
35 * not be initialised by the caller of pa_mix(). */
40 } linear[PA_CHANNELS_MAX];
44 pa_mix_info channels[],
48 const pa_sample_spec *spec,
49 const pa_cvolume *volume,
52 typedef void (*pa_do_mix_func_t) (pa_mix_info streams[], unsigned nstreams, unsigned channels, void *data, unsigned length);
54 pa_do_mix_func_t pa_get_mix_func(pa_sample_format_t f);
55 void pa_set_mix_func(pa_sample_format_t f, pa_do_mix_func_t func);
57 void pa_volume_memchunk(
59 const pa_sample_spec *spec,
60 const pa_cvolume *volume);
63 typedef struct pa_volume_ramp_int_t {
64 pa_volume_ramp_type_t type;
73 typedef struct pa_cvolume_ramp_int {
75 pa_volume_ramp_int ramps[PA_CHANNELS_MAX];
77 } pa_cvolume_ramp_int;
79 pa_cvolume_ramp_int* pa_cvolume_ramp_convert(const pa_cvolume_ramp *src, pa_cvolume_ramp_int *dst, int sample_rate);
80 bool pa_cvolume_ramp_active(pa_cvolume_ramp_int *ramp);
81 bool pa_cvolume_ramp_target_active(pa_cvolume_ramp_int *ramp);
82 pa_cvolume_ramp_int* pa_cvolume_ramp_start_from(pa_cvolume_ramp_int *src, pa_cvolume_ramp_int *dst);
83 pa_cvolume_ramp_int* pa_cvolume_ramp_int_init(pa_cvolume_ramp_int *src, pa_volume_t vol, int channels);
84 pa_cvolume * pa_cvolume_ramp_get_targets(pa_cvolume_ramp_int *ramp, pa_cvolume *volume);
86 void pa_volume_ramp_memchunk(
88 const pa_sample_spec *spec,
89 pa_cvolume_ramp_int *ramp);