]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_sound.hxx
Sound patch from Erik Hofman:
[flightgear.git] / src / Sound / fg_sound.hxx
index 2ceb2ae80cd5d23cc1df6dbf344cd5335cfc0a9f..37b2d21241c84c77e1bcf0c8917f22c1489901fb 100644 (file)
@@ -42,11 +42,6 @@ class FGSound : public FGSubsystem
 
 public:
 
-  enum { MAXPROP=5 };
-  enum { LIN=0, LOG, LN };
-  enum { ONCE=0, LOOPED };
-  enum { LEVEL=0, INVERTED, FLIPFLOP };
-
   FGSound(const SGPropertyNode *);
   virtual ~FGSound();
 
@@ -55,6 +50,34 @@ public:
   virtual void unbind ();
   virtual void update (int dt);
 
+protected:
+
+  enum { MAXPROP=5 };
+  enum { ONCE=0, LOOPED };
+  enum { LEVEL=0, INVERTED, FLIPFLOP, RAISE, FALL };
+
+
+  // Sound properties
+  typedef struct {
+        const SGPropertyNode * prop;
+        double (*fn)(double);
+        double factor;
+        double offset;
+        double min;
+        double max;
+        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;
@@ -67,28 +90,8 @@ private:
   int _mode;
   int _type;
   string _name;
-  float _factor;
-
-#if 0
-  // Sound source (distance, horizontal position in degrees and 
-  // vertical position in degrees)
-  struct {
-       float dist;
-       float hor;
-       float vert;
-  } _pos;
-#endif
-
-  // Sound properties
-  typedef struct {
-        const SGPropertyNode * prop;
-        float factor;
-        int type;
-        float offset;
-        float min;
-        float max;
-       bool subtract;
-  } _snd_prop;
+  double _factor;
+  double _offset;
 
   vector<_snd_prop> _volume;
   vector<_snd_prop> _pitch;