add set_from_string() method for ConfigVariableWithMutation so that it gets set corre...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 9 Nov 2010 22:18:27 +0000 (22:18 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 9 Nov 2010 22:18:27 +0000 (22:18 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7988 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/configuration_variable.h

index ec02a86fc58246f683e8643661943cfa31454674..ec954e8d9c4f0206a93b4e11371a60c73a2bdff5 100644 (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;