diff --git a/simgear/sound/xmlsound.cxx b/simgear/sound/xmlsound.cxx index a0ac5cf0..07e0e73e 100644 --- a/simgear/sound/xmlsound.cxx +++ b/simgear/sound/xmlsound.cxx @@ -33,12 +33,13 @@ #include #include +#include #include -#include -#include -#include #include #include +#include +#include +#include #include "sample_group.hxx" #include "sample.hxx" @@ -123,10 +124,10 @@ SGXmlSound::init( SGPropertyNode *root, if (condition != nullptr) _condition = sgReadCondition(root, condition); - if (!_property && !_condition) - SG_LOG(SG_SOUND, SG_DEV_WARN, - " Neither a condition nor a property specified" - " in section: " << _name); + if (!_property && !_condition) { + simgear::reportFailure(simgear::LoadFailure::Misconfigured, simgear::ErrorCode::AudioFX, + "SGXmlSound: node:" + _name, path); + } _delay = node->getDoubleValue("delay-sec", 0.0); @@ -315,8 +316,9 @@ SGXmlSound::init( SGPropertyNode *root, string soundFileStr = node->getStringValue("path", ""); _sample = new SGSoundSample(soundFileStr.c_str(), path); if (!_sample->file_path().exists()) { - SG_LOG(SG_SOUND, SG_WARN, "XML sound: couldn't find file: '" + soundFileStr + "'"); - return false; + simgear::reportFailure(simgear::LoadFailure::NotFound, simgear::ErrorCode::AudioFX, + "SGXmlSound: node:" + _name + "; can't find:" + soundFileStr, path); + return false; } _sample->set_relative_position( offset_pos );