X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fmk_viii.hxx;h=d3d581e649fab712108fae749b8da0402a0903eb;hb=bb2b03c7e392e107aeaf7dbc4eecc59064b28512;hp=60a3f94588c83593e4396dccc9bcf0f05ee92596;hpb=e48967cb1de18922fb148f05fe56966af917688f;p=flightgear.git diff --git a/src/Instrumentation/mk_viii.hxx b/src/Instrumentation/mk_viii.hxx index 60a3f9458..d3d581e64 100755 --- a/src/Instrumentation/mk_viii.hxx +++ b/src/Instrumentation/mk_viii.hxx @@ -32,9 +32,9 @@ #include #include -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 > samples; + typedef deque< Sample > 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 > > altitude_samples; + typedef deque< Sample< Parameter > > 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 {