]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_sound.hxx
Fix a bug in transit sound termination and adjust the minimum time we
[flightgear.git] / src / Sound / fg_sound.hxx
index 8774562b24347a594d23e97ff930e3b7c3a78867..ce66e13a3dbdd985c3f9c41313e4a0f0ca8b0e80 100644 (file)
@@ -33,6 +33,9 @@
 
 #include "soundmgr.hxx"
 
+static const double MAX_TRANSIT_TIME = 0.1;    // 10 ms.
+
+
 /**
  * Class for handling one sound event.
  *
@@ -56,11 +59,11 @@ protected:
   enum { ONCE=0, LOOPED, IN_TRANSIT };
   enum { LEVEL=0, INVERTED, FLIPFLOP };
 
-
   // Sound properties
   typedef struct {
         SGPropertyNode * prop;
         double (*fn)(double);
+        double *intern;
         double factor;
         double offset;
         double min;
@@ -72,14 +75,18 @@ private:
 
   FGSoundMgr * _mgr;
   FGSimpleSound * _sample;
-  FGCondition * _condition;
 
+  FGCondition * _condition;
   SGPropertyNode * _property;
-  double _prev_value;
 
   bool _active;
   string _name;
   int _mode;
+  double _prev_value;
+  double _dt_play;
+  double _dt_stop;
+  double _stopping;    // time after the sound should have stopped.
+                       // This is usefull for lost packets in in-trasit mode.
 
   vector<_snd_prop> _volume;
   vector<_snd_prop> _pitch;