File indexing completed on 2025-01-18 10:04:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _Media_Timer_HeaderFile
0016 #define _Media_Timer_HeaderFile
0017
0018 #include <OSD_Timer.hxx>
0019 #include <Standard_Transient.hxx>
0020 #include <Standard_Type.hxx>
0021
0022
0023 class Media_Timer : public Standard_Transient
0024 {
0025 DEFINE_STANDARD_RTTIEXT(Media_Timer, Standard_Transient)
0026 public:
0027
0028
0029 Media_Timer() : myTimerFrom (0.0), myTimerSpeed (1.0) {}
0030
0031
0032 Standard_Real ElapsedTime() const
0033 {
0034 return myTimerFrom + myTimer.ElapsedTime() * myTimerSpeed;
0035 }
0036
0037
0038 Standard_Real PlaybackSpeed() const { return myTimerSpeed; }
0039
0040
0041 Standard_EXPORT void SetPlaybackSpeed (const Standard_Real theSpeed);
0042
0043
0044 Standard_Boolean IsStarted() const
0045 {
0046 return myTimer.IsStarted();
0047 }
0048
0049
0050 void Start()
0051 {
0052 myTimer.Start();
0053 }
0054
0055
0056 Standard_EXPORT void Pause();
0057
0058
0059 Standard_EXPORT void Stop();
0060
0061
0062 Standard_EXPORT void Seek (const Standard_Real theTime);
0063
0064 protected:
0065
0066 OSD_Timer myTimer;
0067 Standard_Real myTimerFrom;
0068 Standard_Real myTimerSpeed;
0069
0070 };
0071
0072 DEFINE_STANDARD_HANDLE(Media_Timer, Standard_Transient)
0073
0074 #endif