Fix sketchy casts.
[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 // Use this define when initializing arrarys for use in sndfile_*_format()
27 #define SNDFILE_STR_LENGTH 32
28
29 #define SNDFILE_HEADER_FORMATS 7
30 extern const char * const sndfile_header_formats_strings[SNDFILE_HEADER_FORMATS+1];
31 extern const char * const sndfile_file_endings_strings[SNDFILE_HEADER_FORMATS+1];
32
33 extern int sndfile_header_formats[SNDFILE_HEADER_FORMATS];
34
35 #define SNDFILE_BITDEPTH_FORMATS 5
36 extern const char * const sndfile_bitdepth_formats_strings[SNDFILE_BITDEPTH_FORMATS+1];
37
38 extern int sndfile_bitdepth_formats[SNDFILE_BITDEPTH_FORMATS];
39
40 #define SNDFILE_ENDIAN_FORMATS 2
41 extern const char * const sndfile_endian_formats_strings[SNDFILE_ENDIAN_FORMATS+1];
42
43 extern int sndfile_endian_formats[SNDFILE_ENDIAN_FORMATS];
44
45 int sndfile_bitdepth_format_from_string (std::string);
46 int sndfile_header_format_from_string (std::string);
47 int sndfile_endian_format_from_string (std::string);
48 std::string sndfile_file_ending_from_string (std::string);
49
50 int sndfile_data_width (int format);
51
52 // It'd be nice if libsndfile did this for us
53 std::string sndfile_major_format (int);
54 std::string sndfile_minor_format (int);
55
56 #endif /* __sndfile_helpers_h__ */