cf6b15f3a4f523c862e7ba8c913d830d7e00e620
[ardour.git] / libs / ardour / ardour / sndfile_helpers.h
1 /*
2     Copyright (C) 2000-2007 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __sndfile_helpers_h__
21 #define __sndfile_helpers_h__
22
23 #include <string>
24 #include <stdint.h>
25
26 using std::string;
27
28 // Use this define when initializing arrarys for use in sndfile_*_format()
29 #define SNDFILE_STR_LENGTH 32
30
31 #define SNDFILE_HEADER_FORMATS 5
32 extern const char * const sndfile_header_formats_strings[SNDFILE_HEADER_FORMATS+1];
33 extern const char * const sndfile_file_endings_strings[SNDFILE_HEADER_FORMATS+1];
34
35 extern int sndfile_header_formats[SNDFILE_HEADER_FORMATS];
36
37 #define SNDFILE_BITDEPTH_FORMATS 5
38 extern const char * const sndfile_bitdepth_formats_strings[SNDFILE_BITDEPTH_FORMATS+1];
39
40 extern int sndfile_bitdepth_formats[SNDFILE_BITDEPTH_FORMATS];
41
42 #define SNDFILE_ENDIAN_FORMATS 2
43 extern const char * const sndfile_endian_formats_strings[SNDFILE_ENDIAN_FORMATS+1];
44
45 extern int sndfile_endian_formats[SNDFILE_ENDIAN_FORMATS];
46
47 int sndfile_bitdepth_format_from_string(string);
48 int sndfile_header_format_from_string(string);
49 int sndfile_endian_format_from_string(string);
50 string sndfile_file_ending_from_string(string);
51
52 int sndfile_data_width (int format);
53
54 // It'd be nice if libsndfile did this for us
55 string sndfile_major_format(int);
56 string sndfile_minor_format(int);
57
58 #endif /* __sndfile_helpers_h__ */