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:
parent
ed80aec2d6
commit
2575a3907b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user