2 Copyright (C) 2000-2007 Paul Davis
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.
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.
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.
20 #ifndef __sndfile_helpers_h__
21 #define __sndfile_helpers_h__
26 // Use this define when initializing arrarys for use in sndfile_*_format()
27 #define SNDFILE_STR_LENGTH 32
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];
33 extern int sndfile_header_formats
[SNDFILE_HEADER_FORMATS
];
35 #define SNDFILE_BITDEPTH_FORMATS 5
36 extern const char * const sndfile_bitdepth_formats_strings
[SNDFILE_BITDEPTH_FORMATS
+1];
38 extern int sndfile_bitdepth_formats
[SNDFILE_BITDEPTH_FORMATS
];
40 #define SNDFILE_ENDIAN_FORMATS 2
41 extern const char * const sndfile_endian_formats_strings
[SNDFILE_ENDIAN_FORMATS
+1];
43 extern int sndfile_endian_formats
[SNDFILE_ENDIAN_FORMATS
];
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
);
50 int sndfile_data_width (int format
);
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);
56 #endif /* __sndfile_helpers_h__ */