]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/TimeManager.hxx
Continuous replay: use correct replay duration
[flightgear.git] / src / Time / TimeManager.hxx
index c0a89c39a036d548ae3bf677ab54dea0acaa40c9..53dffd51b1caf9b952663e2370b3e574de606dd9 100644 (file)
 #define FG_TIME_TIMEMANAGER_HXX
 
 #include <simgear/structure/subsystem_mgr.hxx>
+#include <simgear/props/props.hxx>
 
 // forward decls
 class SGTime;
 
-class TimeManager : public SGSubsystem
+class TimeManager : public SGSubsystem, public SGPropertyChangeListener
 {
 public:
   TimeManager();
@@ -36,10 +37,14 @@ public:
   virtual void init();
   virtual void reinit();
   virtual void postinit();
+  virtual void shutdown();
   
   void update(double dt);
   
+// SGPropertyChangeListener overrides
+  virtual void valueChanged(SGPropertyNode *);
 private:
+  
   /**
    * Ensure a consistent update-rate using a combination of
    * sleep()-ing and busy-waiting.  
@@ -64,14 +69,20 @@ private:
   SGPropertyNode_ptr _maxDtPerFrame;
   SGPropertyNode_ptr _clockFreeze;
   SGPropertyNode_ptr _timeOverride;
+  SGPropertyNode_ptr _warp;
+  SGPropertyNode_ptr _warpDelta;
+  
   bool _lastClockFreeze;
-
+  bool _adjustWarpOnUnfreeze;
+  
   SGPropertyNode_ptr _longitudeDeg;
   SGPropertyNode_ptr _latitudeDeg;
   
-// frame-rate / update-rate counters  
+  // frame-rate / worst-case latency / update-rate counters
   SGPropertyNode_ptr _frameRate;
+  SGPropertyNode_ptr _frameLatency;
   time_t _lastFrameTime;
+  double _frameLatencyMax;
   int _frameCount;
 };