1 #ifndef foomixhfoo 2 #define foomixhfoo 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 2013 Peter Meerwald <pmeerw@pmeerw.net> 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, see <http://www.gnu.org/licenses/>. 23 ***/ 24 25 #include <pulse/sample.h> 26 #include <pulse/volume.h> 27 #include <pulsecore/memchunk.h> 28 29 typedef struct pa_mix_info { 30 pa_memchunk chunk; 31 pa_cvolume volume; 32 void *userdata; 33 34 /* The following fields are used internally by pa_mix(), should 35 * not be initialised by the caller of pa_mix(). */ 36 void *ptr; 37 union { 38 int32_t i; 39 float f; 40 } linear[PA_CHANNELS_MAX]; 41 } pa_mix_info; 42 43 size_t pa_mix( 44 pa_mix_info channels[], 45 unsigned nchannels, 46 void *data, 47 size_t length, 48 const pa_sample_spec *spec, 49 const pa_cvolume *volume, 50 bool mute); 51 52 typedef void (*pa_do_mix_func_t) (pa_mix_info streams[], unsigned nstreams, unsigned channels, void *data, unsigned length); 53 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); 56 57 void pa_volume_memchunk( 58 pa_memchunk*c, 59 const pa_sample_spec *spec, 60 const pa_cvolume *volume); 61 62 #endif 63