summaryrefslogtreecommitdiff
path: root/libs/pbd/convert.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-07-20 16:05:00 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-07-20 16:05:00 +0000
commitab3020cee102913aa6399d6fb5535e7e55093120 (patch)
tree65d00ee6ff10dc58be876d541b51927481240758 /libs/pbd/convert.cc
parente644ddc4c8efa1b134a61b7a5a7f4112d2e90465 (diff)
permit MIDI port removal now, and save MIDI ports back to the ardour.rc file
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2163 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/convert.cc')
-rw-r--r--libs/pbd/convert.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/pbd/convert.cc b/libs/pbd/convert.cc
index 832c54acd8..ff426cfb80 100644
--- a/libs/pbd/convert.cc
+++ b/libs/pbd/convert.cc
@@ -18,6 +18,8 @@
*/
#include <cmath>
+#include <locale>
+#include <algorithm>
#include <stdint.h>
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
@@ -234,4 +236,22 @@ length2string (const int64_t frames, const double sample_rate)
return duration_str;
}
+static bool
+chars_equal_ignore_case(char x, char y)
+{
+ static std::locale loc;
+ return toupper(x, loc) == toupper(y, loc);
+}
+
+bool
+strings_equal_ignore_case (const string& a, const string& b)
+{
+ if (a.length() == b.length()) {
+ return std::equal (a.begin(), a.end(), b.begin(), chars_equal_ignore_case);
+ }
+ return false;
+}
+
+
+
} // namespace PBD