X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSound%2Ffg_sound.hxx;h=c1aaa567998b4aa4545257fb3b6707489fe4459f;hb=198b88ca9b4a4b123b2e9ccdc85ea17eeaea70c6;hp=fb871d2cbfaeb9fdf15130ce6f6a890b495810cb;hpb=63eb4d8668580f5bd7678caee5db766f3909019d;p=flightgear.git diff --git a/src/Sound/fg_sound.hxx b/src/Sound/fg_sound.hxx index fb871d2cb..c1aaa5679 100644 --- a/src/Sound/fg_sound.hxx +++ b/src/Sound/fg_sound.hxx @@ -28,11 +28,16 @@ #endif #include +#include + #include
#include
#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; @@ -81,9 +87,10 @@ private: string _name; int _mode; double _prev_value; - double _random; 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;