|
|
|||
File indexing completed on 2026-09-28 09:20:54
0001 // Created by: Kirill Gavrilov 0002 // Copyright (c) 2016 OPEN CASCADE SAS 0003 // 0004 // This file is part of Open CASCADE Technology software library. 0005 // 0006 // This library is free software; you can redistribute it and/or modify it under 0007 // the terms of the GNU Lesser General Public License version 2.1 as published 0008 // by the Free Software Foundation, with special exception defined in the file 0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0010 // distribution for complete text of the license and disclaimer of any warranty. 0011 // 0012 // Alternatively, this file may be used under the terms of Open CASCADE 0013 // commercial license or contractual agreement. 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 //! Auxiliary class defining the animation timer. 0023 class Media_Timer : public Standard_Transient 0024 { 0025 DEFINE_STANDARD_RTTIEXT(Media_Timer, Standard_Transient) 0026 public: 0027 //! Empty constructor. 0028 Media_Timer() 0029 : myTimerFrom(0.0), 0030 myTimerSpeed(1.0) 0031 { 0032 } 0033 0034 //! Return elapsed time in seconds. 0035 double ElapsedTime() const { return myTimerFrom + myTimer.ElapsedTime() * myTimerSpeed; } 0036 0037 //! Return playback speed coefficient (1.0 means normal speed). 0038 double PlaybackSpeed() const { return myTimerSpeed; } 0039 0040 //! Setup playback speed coefficient. 0041 Standard_EXPORT void SetPlaybackSpeed(const double theSpeed); 0042 0043 //! Return true if timer has been started. 0044 bool IsStarted() const { return myTimer.IsStarted(); } 0045 0046 //! Start the timer. 0047 void Start() { myTimer.Start(); } 0048 0049 //! Pause the timer. 0050 Standard_EXPORT void Pause(); 0051 0052 //! Stop the timer. 0053 Standard_EXPORT void Stop(); 0054 0055 //! Seek the timer to specified position. 0056 Standard_EXPORT void Seek(const double theTime); 0057 0058 protected: 0059 OSD_Timer myTimer; 0060 double myTimerFrom; 0061 double myTimerSpeed; 0062 }; 0063 0064 #endif // _Media_Timer_HeaderFile
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|