#include <string>
#include <stdint.h>
+#include "ardour/types.h"
+
// Use this define when initializing arrarys for use in sndfile_*_format()
#define SNDFILE_STR_LENGTH 32
int sndfile_endian_format_by_index (int);
int sndfile_data_width (int format);
+int sndfile_data_width (ARDOUR::SampleFormat);
// It'd be nice if libsndfile did this for us
std::string sndfile_major_format (int);
}
}
+int
+sndfile_data_width (ARDOUR::SampleFormat format)
+{
+ switch (format) {
+ case ARDOUR::FormatInt16:
+ return sndfile_data_width (SF_FORMAT_PCM_16);
+ case ARDOUR::FormatInt24:
+ return sndfile_data_width (SF_FORMAT_PCM_24);
+ default:
+ return sndfile_data_width (SF_FORMAT_FLOAT);
+ }
+}
+
string
sndfile_major_format(int format)
{