]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/mk_viii.hxx
James Turner:
[flightgear.git] / src / Instrumentation / mk_viii.hxx
index 60a3f94588c83593e4396dccc9bcf0f05ee92596..d3d581e649fab712108fae749b8da0402a0903eb 100755 (executable)
@@ -32,9 +32,9 @@
 #include <simgear/sound/sample_openal.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 
-SG_USING_STD(vector);
-SG_USING_STD(deque);
-SG_USING_STD(map);
+using std::vector;
+using std::deque;
+using std::map;
 
 #include "Airports/runways.hxx"
 #include "Airports/simple.hxx"
@@ -621,7 +621,8 @@ public:
 
     class TerrainClearanceFilter
     {
-      deque< Sample<double> >  samples;
+      typedef deque< Sample<double> > samples_type;
+      samples_type             samples;
       double                   value;
 
     public:
@@ -654,7 +655,8 @@ public:
     bool last_landing_gear;
     bool last_real_flaps_down;
 
-    deque< Sample< Parameter<double> > > altitude_samples;
+    typedef deque< Sample< Parameter<double> > > altitude_samples_type;
+    altitude_samples_type altitude_samples;
 
     struct
     {
@@ -745,10 +747,10 @@ public:
        inline SampleElement (SGSoundSample *sample, double volume = 1.0)
          : _sample(sample), _volume(volume) { silence = false; }
 
-       virtual inline void play (double volume) { set_volume(volume); _sample->play_once(); }
-       virtual inline void stop () { _sample->stop(); }
-       virtual inline bool is_playing () { return _sample->is_playing(); }
-       virtual inline void set_volume (double volume) { _sample->set_volume(volume * _volume); }
+        virtual inline void play (double volume) { if (_sample) { set_volume(volume); _sample->play_once(); } }
+       virtual inline void stop () { if (_sample) _sample->stop(); }
+        virtual inline bool is_playing () { return _sample ? _sample->is_playing() : false; }
+       virtual inline void set_volume (double volume) { if (_sample) _sample->set_volume(volume * _volume); }
       };
 
       /////////////////////////////////////////////////////////////////////////
@@ -1502,6 +1504,18 @@ private:
     bool is_high_bank_angle ();
     unsigned int get_bank_angle_alerts ();
     void update_bank_angle ();
+    
+    class AirportFilter : public FGAirportSearchFilter
+    {
+    public: 
+      AirportFilter(Mode6Handler *s)
+        : self(s) {}
+        
+      virtual bool pass(FGAirport *a);
+      
+    private:
+      Mode6Handler* self;
+    };
   };
 
   /////////////////////////////////////////////////////////////////////////////
@@ -1550,7 +1564,6 @@ private:
     double get_azimuth_difference (const FGRunway *_runway);
 
     void select_runway (const FGAirport *airport, FGRunway *_runway);
-    bool test_airport (const FGAirport *airport);
     void update_runway ();
 
     void get_bias_area_edges (Position *edge,
@@ -1565,6 +1578,17 @@ private:
     bool is_tcf ();
     bool is_rfcf ();
 
+    class AirportFilter : public FGAirportSearchFilter
+    {
+    public: 
+      AirportFilter(MK_VIII *device)
+        : mk(device) {}
+        
+      virtual bool pass(FGAirport *a);
+      
+    private:
+      MK_VIII* mk;
+    };
   public:
     struct
     {