Git init
[framework/multimedia/pulseaudio.git] / src / pulsecore / sndfile-util.h
1 #ifndef foopulsecoresndfileutilhfoo
2 #define foopulsecoresndfileutilhfoo
3
4 /***
5   This file is part of PulseAudio.
6
7   Copyright 2009 Lennart Poettering
8
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.1 of the License,
12   or (at your option) any later version.
13
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.
18
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
22   USA.
23 ***/
24
25 #include <sndfile.h>
26
27 #include <pulse/sample.h>
28 #include <pulse/channelmap.h>
29 #include <pulse/proplist.h>
30
31 int pa_sndfile_read_sample_spec(SNDFILE *sf, pa_sample_spec *ss);
32 int pa_sndfile_read_channel_map(SNDFILE *sf, pa_channel_map *cm);
33
34 int pa_sndfile_write_sample_spec(SF_INFO *sfi, pa_sample_spec *ss);
35 int pa_sndfile_write_channel_map(SNDFILE *sf, pa_channel_map *cm);
36
37 void pa_sndfile_init_proplist(SNDFILE *sf, pa_proplist *p);
38
39 typedef sf_count_t (*pa_sndfile_readf_t)(SNDFILE *sndfile, void *ptr, sf_count_t frames);
40 typedef sf_count_t (*pa_sndfile_writef_t)(SNDFILE *sndfile, const void *ptr, sf_count_t frames);
41
42 /* Returns NULL if sf_read_raw() shall be used */
43 pa_sndfile_readf_t pa_sndfile_readf_function(const pa_sample_spec *ss);
44
45 /* Returns NULL if sf_write_raw() shall be used */
46 pa_sndfile_writef_t pa_sndfile_writef_function(const pa_sample_spec *ss);
47
48 int pa_sndfile_format_from_string(const char *extension);
49
50 void pa_sndfile_dump_formats(void);
51
52 #endif