]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_sound.hxx
This is step "1" of probably "many" in the process of separating out the
[flightgear.git] / src / Sound / fg_sound.hxx
index 6681dc26153a4ca2bf6bcaf464d42f2cb2b0b10c..c1aaa567998b4aa4545257fb3b6707489fe4459f 100644 (file)
 #endif
 
 #include <simgear/compiler.h>
+#include <simgear/props/condition.hxx>
+
 #include <Main/fgfs.hxx>
 #include <Main/globals.hxx>
 
 #include "soundmgr.hxx"
 
+static const double MAX_TRANSIT_TIME = 0.1;    // 100 ms.
+
+
 /**
  * Class for handling one sound event.
  *
@@ -50,13 +55,14 @@ public:
   virtual void unbind ();
   virtual void update (double dt);
 
+  void stop();
+
 protected:
 
   enum { MAXPROP=5 };
   enum { ONCE=0, LOOPED, IN_TRANSIT };
   enum { LEVEL=0, INVERTED, FLIPFLOP };
 
-
   // Sound properties
   typedef struct {
         SGPropertyNode * prop;
@@ -77,11 +83,14 @@ private:
   FGCondition * _condition;
   SGPropertyNode * _property;
 
+  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;