Use XMLNode::get_property() in FileSource class
authorTim Mayberry <mojofunk@gmail.com>
Sun, 1 Jan 2017 11:44:09 +0000 (21:44 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Tue, 18 Apr 2017 23:36:50 +0000 (09:36 +1000)
libs/ardour/file_source.cc

index f313fde7baf3f6f5f553592f19208ad464cecae6..c1aa50d4a47f3c069fb8674d44cab06d26c797a9 100644 (file)
@@ -144,22 +144,13 @@ FileSource::init (const string& pathstr, bool must_exist)
 int
 FileSource::set_state (const XMLNode& node, int /*version*/)
 {
-       LocaleGuard lg;
-       XMLProperty const * prop;
-
-       if ((prop = node.property (X_("channel"))) != 0) {
-               _channel = atoi (prop->value());
-       } else {
+       if (!node.get_property (X_("channel"), _channel)) {
                _channel = 0;
        }
 
-       if ((prop = node.property (X_("origin"))) != 0) {
-               _origin = prop->value();
-       }
+       node.get_property (X_("origin"), _origin);
 
-       if ((prop = node.property (X_("gain"))) != 0) {
-               _gain = atof (prop->value());
-       } else {
+       if (!node.get_property (X_("gain"), _gain)) {
                _gain = 1.f;
        }