summaryrefslogtreecommitdiff
path: root/libs/ardour/sndfile_helpers.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-03-05 19:39:16 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-03-05 19:39:16 +0000
commit5a39bf595c737dbb36666a9e718ac267e9131380 (patch)
tree12219a08eec7305a135eafff4210a037ff5f8804 /libs/ardour/sndfile_helpers.cc
parentcaeb564748e7ece1025f55f005fe5591795ec234 (diff)
export range markers patch (revisited), change selection model, copy-drag tempo+meter marker patch
git-svn-id: svn://localhost/trunk/ardour2@349 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/sndfile_helpers.cc')
-rw-r--r--libs/ardour/sndfile_helpers.cc31
1 files changed, 30 insertions, 1 deletions
diff --git a/libs/ardour/sndfile_helpers.cc b/libs/ardour/sndfile_helpers.cc
index 2fd9e63ce2..21d8c72b2b 100644
--- a/libs/ardour/sndfile_helpers.cc
+++ b/libs/ardour/sndfile_helpers.cc
@@ -1,12 +1,13 @@
#include <map>
+#include <vector>
#include <sndfile.h>
-
#include <ardour/sndfile_helpers.h>
#include "i18n.h"
using std::map;
+using namespace std;
const char * const sndfile_header_formats_strings[SNDFILE_HEADER_FORMATS+1] = {
N_("WAV"),
@@ -19,6 +20,17 @@ const char * const sndfile_header_formats_strings[SNDFILE_HEADER_FORMATS+1] = {
0
};
+const char* const sndfile_file_endings_strings[SNDFILE_HEADER_FORMATS+1] = {
+ N_(".wav"),
+ N_(".aiff"),
+ N_(".raw"),
+ N_(".paf"),
+ N_(".au"),
+ N_(".ircam"),
+ N_(".w64"),
+ 0
+};
+
int sndfile_header_formats[SNDFILE_HEADER_FORMATS] = {
SF_FORMAT_WAV,
SF_FORMAT_AIFF,
@@ -90,6 +102,23 @@ sndfile_endian_format_from_string (string str)
return -1;
}
+string
+sndfile_file_ending_from_string (string str)
+{
+ static vector<string> file_endings;
+
+ if (file_endings.empty()) {
+ file_endings = internationalize((const char **) sndfile_file_endings_strings);
+ }
+
+ for (int n = 0; sndfile_header_formats_strings[n]; ++n) {
+ if (str == sndfile_header_formats_strings[n]) {
+ return file_endings[n];
+ }
+ }
+ return 0;
+}
+
int
sndfile_data_width (int format)
{