From 5a39bf595c737dbb36666a9e718ac267e9131380 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 5 Mar 2006 19:39:16 +0000 Subject: 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 --- libs/ardour/sndfile_helpers.cc | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'libs/ardour/sndfile_helpers.cc') 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 +#include #include - #include #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 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) { -- cgit v1.2.3