Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuStopWatch.h

Go to the documentation of this file.
00001 /*      Written by Christopher Steinbach
00002         March 2002
00003 
00004         written to add a timer that could fast forward and rewind and bounce
00005         and loop easily to the key framer.
00006 
00007         uses the wxStopwatch
00008 */
00009 
00010 #ifndef vuStopWatch_h__
00011 #define vuStopWatch_h__
00012 
00013 #include <iostream.h>
00014 
00029 class vuStopWatch
00030 
00031 {
00032         public: // constructors and destructors.
00033 
00037                 vuStopWatch (int time_in_ms = 0);
00038 
00040                 virtual ~vuStopWatch ();
00041 
00042         public: // member functions - start and stop functions.
00043 
00049                 void Start (int time_in_ms = 0);
00050 
00054                 int Time ();
00055 
00058                 void Pause ();
00059 
00062                 void Resume ();
00063 
00066                 int TotalTime ();
00067 
00068         public: // member functions, state controlling functions.
00069 
00072                 void setIsReversing (bool isit);
00073 
00075                 void setIsRewinding (bool isit);
00076 
00079                 void setIsFastForwarding (bool isit);
00080 
00088                 void setIsLooping (bool isit);
00089 
00097                 void setIsBouncing (bool isit);
00098 
00099         public: // member functions, get the current state of the watch.
00100 
00102                 bool IsReversing ();
00103 
00105                 bool IsRewinding ();
00106 
00108                 bool IsFastForwarding ();
00109 
00111                 bool IsLooping ();
00112 
00114                 bool IsBouncing ();
00115 
00116         public: // member functions, state setters.
00117 
00122                 void setFastSpeed (float mul);
00123 
00125                 float getFastSpeed ();
00126 
00130                 void setMaxTime (int maxtime_in_ms);
00131 
00134                 int getMaxTime ();
00135 
00136         private:        // member data, stopwatches.
00137 
00138 //              wxStopWatch m_timer_1;  /**< This is the main timer, it will keep track of the time
00139 //                                              that the watch should be outpouting (but this time may
00140 //                                              need to be modified if the watch is reversing, rewinding
00141 //                                              or fast forwarding, by a multiple of the second watch. */
00142 //              wxStopWatch m_timer_2;  /**< This is the secondary timer.  It will be reset on every call
00143 //                                              to Time (), and will be used to work out how the first
00144 //                                              watch and the output time should be changed. */
00145 //              wxStopWatch m_timer_3;  /**< This is to keep track of the total time since the last
00146 //                                              call to Start. */
00147 
00148                 void * m_timer_1;       
00152                 void * m_timer_2;       
00155                 void * m_timer_3;       
00157         private:        // member data, state information
00158 
00159                 bool mb_reversing;      
00160 
00161                 bool mb_fastforwarding; 
00162                 bool mb_rewinding;      
00163 
00164                 bool mb_looping;        
00165                 bool mb_bouncing;       
00166 
00167         private:        // member data, statse information.
00168 
00169                 int m_maxtime;          
00170                 float m_fastspeed;      
00172 };
00173 
00174 #endif
00175 
00176 
00177 

Generated on Wed Dec 15 21:20:38 2004 for vuVolume by  doxygen 1.3.9.1