summaryrefslogtreecommitdiff
path: root/libs/ardour/sndfile_helpers.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-01-24 18:53:10 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-01-24 18:53:10 -0500
commit5ff6402dad5b9aa8de0ce2ac44e8f3189ef9439e (patch)
tree8d90083182355de73bad0a1c67bcbd167745b464 /libs/ardour/sndfile_helpers.cc
parentccd881d518521fa56a43a66632bedf814710105f (diff)
add function to get data width for ARDOUR::SampleFormat
Diffstat (limited to 'libs/ardour/sndfile_helpers.cc')
-rw-r--r--libs/ardour/sndfile_helpers.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/sndfile_helpers.cc b/libs/ardour/sndfile_helpers.cc
index 2e618e043b..e3e80b48e5 100644
--- a/libs/ardour/sndfile_helpers.cc
+++ b/libs/ardour/sndfile_helpers.cc
@@ -140,6 +140,19 @@ sndfile_data_width (int format)
}
}
+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)
{