]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_fx.cxx
- Added ultra-light traffic is now a separate traffic class that can have its
[flightgear.git] / src / Sound / fg_fx.cxx
index b04d9a46fc14ef90018b77778144bbebe2b29686..de5f4e152bd7882b8a6a7d3333042ebaa27394af 100644 (file)
@@ -74,7 +74,7 @@ FGFX::init()
    string path_str = node->getStringValue("path");
    SGPath path( globals->get_fg_root() );
    if (path_str.empty()) {
-      SG_LOG(SG_GENERAL, SG_ALERT, "Incorrect path in configuration file.");
+      SG_LOG(SG_GENERAL, SG_ALERT, "No path in /sim/sound/path");
       return;
    }
 
@@ -87,7 +87,7 @@ FGFX::init()
       readProperties(path.str(), &root);
    } catch (const sg_exception &) {
       SG_LOG(SG_GENERAL, SG_ALERT,
-       "Incorrect path specified in configuration file");
+       "Error reading file '" << path.str() << '\'');
       return;
    }
 
@@ -129,6 +129,10 @@ FGFX::update (double dt)
 {
     SGSoundMgr *smgr = globals->get_soundmgr();
 
+    if (smgr->is_working() == false) {
+        return;
+    }
+
     // command sound manger
     bool pause = _pause->getBoolValue();
     if ( pause != last_pause ) {
@@ -183,14 +187,17 @@ FGFX::update (double dt)
 void
 FGFX::play_message( SGSoundSample *_sample )
 {
-    _sample->set_volume( 1.0 );
     _samplequeue.push( _sample );
 }
 void
-FGFX::play_message( const string path, const string fname )
+FGFX::play_message( const string path, const string fname, double volume )
 {
+    if (globals->get_soundmgr()->is_working() == false) {
+        return;
+    }
     SGSoundSample *sample;
     sample = new SGSoundSample( path.c_str(), fname.c_str() );
+    sample->set_volume( volume );
     play_message( sample );
 }