]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/xmlsound.cxx
Add a HLADataElementVisitor implementation.
[simgear.git] / simgear / sound / xmlsound.cxx
index 0c54798f7562612a854a63bd2676bb4b816de321..f3471d4ef0c2c9cfdf2d1b2203f34b8eb071c9e2 100644 (file)
@@ -30,6 +30,7 @@
 #include <string.h>
 
 #include <simgear/debug/logstream.hxx>
+#include <simgear/props/props.hxx>
 #include <simgear/props/condition.hxx>
 #include <simgear/math/SGMath.hxx>
 #include <simgear/structure/exception.hxx>
@@ -273,9 +274,10 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node,
    } else {
       _sgrp = sgrp;
    }
-   _sample = new SGSoundSample(node->getStringValue("path", ""), currentDir);
+   string soundFileStr = node->getStringValue("path", "");
+   _sample = new SGSoundSample(soundFileStr.c_str(), currentDir);
    if (!_sample->file_path().exists()) {
-      throw sg_io_exception("XML sound: couldn't find file: " + _sample->file_path().str());
+      throw sg_io_exception("XML sound: couldn't find file: '" + soundFileStr + "'");
    }
    
    _sample->set_relative_position( offset_pos );