]> git.mxchange.org Git - flightgear.git/blobdiff - src/Controls/controls.hxx
- adjusted for no-value constructor for FGPanel
[flightgear.git] / src / Controls / controls.hxx
index 91e27738c58c3929bfd186dad92ddcb392985079..ba2a92d5bae1d8dbd2f1cdd5f514e6b3ea9e00a8 100644 (file)
@@ -25,7 +25,9 @@
 #define _CONTROLS_HXX
 
 #include <simgear/misc/props.hxx>
+
 #include <Main/fgfs.hxx>
+#include <Main/globals.hxx>
 
 #ifndef __cplusplus                                                          
 # error This library requires C++
@@ -64,7 +66,7 @@ private:
     double brake[MAX_WHEELS];
     bool throttle_idle;
 
-    SGValue * auto_coordination;
+    SGPropertyNode * auto_coordination;
 
     inline void CLAMP(double *x, double min, double max ) {
        if ( *x < min ) { *x = min; }
@@ -144,10 +146,16 @@ public:
        CLAMP( &rudder, -1.0, 1.0 );
     }
     inline void set_flaps( double pos ) {
+       if ( flaps != pos ) {
+           globals->get_soundmgr()->play_once( "flaps" );
+       }
        flaps = pos;
        CLAMP( &flaps, 0.0, 1.0 );
     }
     inline void move_flaps( double amt ) {
+       if ( fabs(amt) > 0.0 ) {
+           globals->get_soundmgr()->play_once( "flaps" );
+       }
        flaps += amt;
        CLAMP( &flaps, 0.0, 1.0 );
     }