13
0

add set_from_string() method for ConfigVariableWithMutation so that it gets set correctly from XML and elsewhere

git-svn-id: svn://localhost/ardour2/branches/3.0@7988 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-11-09 22:18:27 +00:00
parent ed80aec2d6
commit 2575a3907b

View File

@ -77,7 +77,7 @@ class ConfigVariable : public ConfigVariableBase
return true;
}
void set_from_string (std::string const & s) {
virtual void set_from_string (std::string const & s) {
std::stringstream ss;
ss << s;
ss >> value;
@ -140,6 +140,14 @@ class ConfigVariableWithMutation : public ConfigVariable<T>
return false;
}
void set_from_string (std::string const & s) {
T v;
std::stringstream ss;
ss << s;
ss >> v;
set (v);
}
protected:
virtual T get_for_save() { return unmutated_value; }
T unmutated_value;