]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_sound.cxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Sound / fg_sound.cxx
index 5af54d59f78d1ffa1160f4b6288c4a88316cf75f..28ebafb708e195814335c886d671db41d2f2d397 100644 (file)
@@ -31,7 +31,6 @@
 #include <string.h>
 
 #include <simgear/debug/logstream.hxx>
-#include <simgear/math/sg_random.h>
 
 #include <Main/fg_props.hxx>
 
@@ -64,14 +63,14 @@ static const struct {
 
 FGSound::FGSound()
   : _sample(NULL),
-    _active(false),
     _condition(NULL),
     _property(NULL),
-    _dt_play(0.0),
-    _dt_stop(0.0),
-    _prev_value(0),
+    _active(false),
     _name(""),
-    _mode(FGSound::ONCE)    
+    _mode(FGSound::ONCE),
+    _prev_value(0),
+    _dt_play(0.0),
+    _dt_stop(0.0)
 {
 }
 
@@ -137,8 +136,6 @@ FGSound::init(SGPropertyNode *node)
          volume.intern = &_dt_play;
       else if (!strcmp(intern_str, "dt_stop"))
          volume.intern = &_dt_stop;
-      else if (!strcmp(intern_str, "random"))
-         volume.intern = &_random;
 
       if ((volume.factor = kids[i]->getDoubleValue("factor", 1.0)) != 0.0)
          if (volume.factor < 0.0) {
@@ -272,16 +269,16 @@ FGSound::update (double dt)
       )
    {
 
-      _active = false;
-      _dt_stop += dt;
-      _dt_play = 0.0;
-
       if (_sample->is_playing()) {
          SG_LOG(SG_GENERAL, SG_INFO, "Stopping audio after " << _dt_play
                                       << " sec: " << _name );
          _sample->stop( _mgr->get_scheduler() );
       }
 
+      _active = false;
+      _dt_stop += dt;
+      _dt_play = 0.0;
+
       return;
 
    }
@@ -303,11 +300,10 @@ FGSound::update (double dt)
    }
 
    //
-   // Update playtime, cache the current value and feed the random number
+   // Update playing time and cache the current value.
    //
     _dt_play += dt;
    _prev_value = curr_value;
-   _random = sg_random();
 
    //
    // Update the volume