summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-04-12 11:45:40 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-04-12 11:45:40 +0000
commitd6051c9953ea8778399ad72fc91c334c242d25e0 (patch)
tree34c9725486c0c7b9242c8b645aa2e4290218273a /libs/ardour
parent81a76cc0fdf569e96697c4cea58debb74d6e5545 (diff)
move string_is_affirmative() into libpbd
git-svn-id: svn://localhost/ardour2/branches/3.0@11936 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/configuration_variable.h3
-rw-r--r--libs/ardour/ardour/utils.h2
-rw-r--r--libs/ardour/midi_clock_slave.cc1
-rw-r--r--libs/ardour/mute_master.cc3
-rw-r--r--libs/ardour/utils.cc20
5 files changed, 5 insertions, 24 deletions
diff --git a/libs/ardour/ardour/configuration_variable.h b/libs/ardour/ardour/configuration_variable.h
index da8fc1b9a1..a7fe8def48 100644
--- a/libs/ardour/ardour/configuration_variable.h
+++ b/libs/ardour/ardour/configuration_variable.h
@@ -24,6 +24,7 @@
#include <sstream>
#include "pbd/xml++.h"
+#include "pbd/convert.h"
#include "ardour/types.h"
#include "ardour/utils.h"
@@ -153,7 +154,7 @@ class ConfigVariable<bool> : public ConfigVariableBase
}
void set_from_string (std::string const & s) {
- value = string_is_affirmative (s);
+ value = PBD::string_is_affirmative (s);
}
protected:
diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h
index 52b7c3053e..7eba3fa18c 100644
--- a/libs/ardour/ardour/utils.h
+++ b/libs/ardour/ardour/utils.h
@@ -32,8 +32,6 @@
#include <CoreFoundation/CoreFoundation.h>
#endif /* __APPLE__ */
-bool string_is_affirmative (const std::string&);
-
#include "ardour/ardour.h"
#include "ardour/data_type.h"
#include "ardour/dB.h"
diff --git a/libs/ardour/midi_clock_slave.cc b/libs/ardour/midi_clock_slave.cc
index 892bc800ff..87ea05738d 100644
--- a/libs/ardour/midi_clock_slave.cc
+++ b/libs/ardour/midi_clock_slave.cc
@@ -26,6 +26,7 @@
#include "pbd/error.h"
#include "pbd/failed_constructor.h"
#include "pbd/pthread_utils.h"
+#include "pbd/convert.h"
#include "midi++/port.h"
diff --git a/libs/ardour/mute_master.cc b/libs/ardour/mute_master.cc
index a58bb8a421..9f2ed08dab 100644
--- a/libs/ardour/mute_master.cc
+++ b/libs/ardour/mute_master.cc
@@ -20,6 +20,7 @@
#include "pbd/enumwriter.h"
#include "pbd/xml++.h"
+#include "pbd/convert.h"
#include "ardour/types.h"
#include "ardour/mute_master.h"
@@ -144,7 +145,7 @@ MuteMaster::set_state (const XMLNode& node, int /*version*/)
}
if ((prop = node.property ("muted")) != 0) {
- _muted_by_self = string_is_affirmative (prop->value());
+ _muted_by_self = PBD::string_is_affirmative (prop->value());
} else {
_muted_by_self = (_mute_point != MutePoint (0));
}
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index 4933cd7e5c..beb003e713 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -627,26 +627,6 @@ bool_as_string (bool yn)
return (yn ? "yes" : "no");
}
-bool
-string_is_affirmative (const std::string& str)
-{
- /* to be used only with XML data - not intended to handle user input */
-
- if (str.empty ()) {
- return false;
- }
-
- /* the use of g_strncasecmp() is solely to get around issues with
- * charsets posed by trying to use C++ for the same
- * comparison. switching a std::string to its lower- or upper-case
- * version has several issues, but handled by default
- * in the way we desire when doing it in C.
- */
-
- return str == "1" || str == "y" || str == "Y" || (!g_strncasecmp(str.c_str(), "yes", str.length())) ||
- (!g_strncasecmp(str.c_str(), "true", str.length()));
-}
-
const char*
native_header_format_extension (HeaderFormat hf, const DataType& type)
{