Updated German translation
[dasher.git] / Src / DasherCore / FrameRate.h
blob6e44b83d502fa09c38da9b1c815ac774400388cd
1 // FrameRate.h
2 //
3 /////////////////////////////////////////////////////////////////////////////
4 //
5 // Copyright (c) 2002 David Ward
6 //
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef __FrameRate_h__
10 #define __FrameRate_h__
12 #include <cmath>
13 #include "../Common/Common.h"
14 #include "SettingsStore.h"
15 #include "DasherModel.h"
17 namespace Dasher {
18 /// \ingroup Model
19 /// \{
21 /// keeps the framerate (LP_FRAMERATE / 100.0) up-to-date,
22 /// computes the Steps parameter,
23 /// computes RXmax - which controls the maximum rate of zooming in
24 class CFrameRate : public CSettingsUserObserver {
25 public:
26 CFrameRate(CSettingsUser *pCreator);
28 //Responds to a change to LP_FRAMERATE or LP_MAX_BITRATE
29 // by recomputing the Steps() parameter.
30 virtual void HandleEvent(int iParameter);
32 ///The number of frames, in which we will attempt to bring
33 /// the target location (under the cursor, or in dynamic button
34 /// modes) to the crosshair. See DJW thesis.
35 int Steps() const {
36 return m_iSteps;
37 };
39 ///
40 /// Reset the framerate class
41 /// TODO: Need to check semantics here
42 /// Called from CDasherInterfaceBase::UnPause;
43 ///
44 void Reset_framerate(unsigned long Time) {
45 m_iFrames = 0;
46 m_iTime = Time;
49 void RecordFrame(unsigned long Time);
51 private:
52 ///number of frames that have been sampled
53 int m_iFrames;
54 ///time at which first sampled frame was rendered
55 unsigned long m_iTime;
56 ///number of frames over which we will compute average framerate
57 int m_iSamples;
59 int m_iSteps;
61 double m_dBitsAtLimX;
63 /// \}
65 #endif /* #ifndef __FrameRate_h__ */