#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"
class TerrainClearanceFilter
{
- deque< Sample<double> > samples;
+ typedef deque< Sample<double> > samples_type;
+ samples_type samples;
double value;
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
{
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); }
};
/////////////////////////////////////////////////////////////////////////
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;
+ };
};
/////////////////////////////////////////////////////////////////////////////
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,
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
{