summaryrefslogtreecommitdiff
path: root/libs/pbd/locale_guard.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-10-28 21:36:40 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-10-28 21:36:40 +0000
commitc4ac43749048c4c0e0ab3656d39384112a628742 (patch)
tree72d3452034c1a0a661587611a63d00509684ca27 /libs/pbd/locale_guard.cc
parentee4493301a8247fb8032dd949f4c44cd4c641221 (diff)
* libardour uses ARDOUR::nframes_t and ARDOUR::nframes64_t explicitly in headers
* use explicit operator<< and operator>> that in turn use PBD::EnumWriter when serializing and deserializing to/from rc files * adds scrolling in mixer window (from 2.X) * BBT math stuff - untested, but basically operational * move LocaleGuard into its own file(s) in libs/pbd * Tempo now uses nframes64_t everywhere (except for sample rate values) * as in 2.X, use mkstemp and hack to avoid temp file nonsense, and remove erroneous free() from disk stats output git-svn-id: svn://localhost/ardour2/branches/3.0@5961 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/locale_guard.cc')
-rw-r--r--libs/pbd/locale_guard.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/pbd/locale_guard.cc b/libs/pbd/locale_guard.cc
new file mode 100644
index 0000000000..7d6c0708b8
--- /dev/null
+++ b/libs/pbd/locale_guard.cc
@@ -0,0 +1,22 @@
+#include <stdlib.h>
+#include <string.h>
+#include <locale.h>
+
+#include "pbd/locale_guard.h"
+
+using namespace PBD;
+
+LocaleGuard::LocaleGuard (const char* str)
+{
+ old = strdup (setlocale (LC_NUMERIC, NULL));
+ if (strcmp (old, str)) {
+ setlocale (LC_NUMERIC, str);
+ }
+}
+
+LocaleGuard::~LocaleGuard ()
+{
+ setlocale (LC_NUMERIC, old);
+ free ((char*)old);
+}
+