]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_sound.hxx
Major overhaul:
[flightgear.git] / src / Sound / fg_sound.hxx
index 37b2d21241c84c77e1bcf0c8917f22c1489901fb..8774562b24347a594d23e97ff930e3b7c3a78867 100644 (file)
 #include "soundmgr.hxx"
 
 /**
- * Class for handling one sound.
+ * Class for handling one sound event.
  *
  */
-class FGSound : public FGSubsystem
+class FGSound
 {
 
 public:
 
-  FGSound(const SGPropertyNode *);
+  FGSound();
   virtual ~FGSound();
 
-  virtual void init ();
+  virtual void init (SGPropertyNode *);
   virtual void bind ();
   virtual void unbind ();
-  virtual void update (int dt);
+  virtual void update (double dt);
 
 protected:
 
   enum { MAXPROP=5 };
-  enum { ONCE=0, LOOPED };
-  enum { LEVEL=0, INVERTED, FLIPFLOP, RAISE, FALL };
+  enum { ONCE=0, LOOPED, IN_TRANSIT };
+  enum { LEVEL=0, INVERTED, FLIPFLOP };
 
 
   // Sound properties
   typedef struct {
-        const SGPropertyNode * prop;
+        SGPropertyNode * prop;
         double (*fn)(double);
         double factor;
         double offset;
@@ -68,30 +68,18 @@ protected:
         bool subtract;
   } _snd_prop;
 
-#if 0
-  // Sound source (distance, horizontal position in degrees and
-  // vertical position in degrees)
-  typedef struct {
-        float dist;
-        float hor;
-        float vert;
-  } _pos_prop;
-#endif
-
 private:
 
-  const SGPropertyNode * _node;
-
+  FGSoundMgr * _mgr;
   FGSimpleSound * _sample;
-  const SGPropertyNode * _property;
+  FGCondition * _condition;
 
-  bool _active;
+  SGPropertyNode * _property;
+  double _prev_value;
 
-  int _mode;
-  int _type;
+  bool _active;
   string _name;
-  double _factor;
-  double _offset;
+  int _mode;
 
   vector<_snd_prop> _volume;
   vector<_snd_prop> _pitch;