Go to the
documentation of this file.
00001 #ifndef __FBTIME_H__
00002 #define __FBTIME_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00043 #include <kaydaradef.h>
00044
00045 #ifndef FBSDK_DLL
00046
00049 #define FBSDK_DLL K_DLLIMPORT
00050 #endif
00051
00052 #include <fbsdk/fbstring.h>
00053
00054 #ifdef FBSDKUseNamespace
00055 namespace FBSDKNamespace {
00056 #endif
00057
00059
00061
00063 enum FBTimeMode {
00064 kFBTimeModeDefault,
00065 kFBTimeModeCinema,
00066 kFBTimeModePAL,
00067 kFBTimeMode30Frames,
00068 kFBTimeModeNTSC_Drop,
00069 kFBTimeMode50Frames,
00070 kFBTimeMode60Frames,
00071 kFBTimeMode100Frames,
00072 kFBTimeMode120Frames,
00073 kFBTimeModeFullFrame,
00074 kFBTimeModeCinemaND,
00075 kFBTimeModeCustom
00076 };
00077
00078 FB_FORWARD( FBTime );
00079
00081 class FBSDK_DLL FBTime
00082 {
00083 private:
00084 kLongLong mTime;
00085 public:
00086
00087
00088
00089 FBTime( kLongLong pTime=0);
00090
00100 FBTime (int pHour,int pMinute,int pSecond=0,int pFrame=0,int pField=0, FBTimeMode pTimeMode=kFBTimeModeDefault, double pFramerate = 0.0);
00101
00105 FBString GetTimeString();
00106
00110 void SetTimeString(char *pTime);
00111
00123 bool GetTime(kLongLong &pHour, kLongLong &pMinute, kLongLong &pSecond, kLongLong &pFrame, kLongLong &pField, kLongLong &pMilliSecond, FBTimeMode pTimeMode=kFBTimeModeDefault, double pFramerate =0.0 );
00127 kLongLong GetMilliSeconds();
00128
00132 void SetMilliSeconds(kLongLong pMilliSeconds);
00133
00137 kLongLong& Get();
00138
00142 const kLongLong& Get() const;
00143
00147 void Set( kLongLong pTime );
00148
00152 double GetSecondDouble();
00153
00157 void SetSecondDouble(double pTime);
00158
00168 void SetTime (int pHour,int pMinute=0,int pSecond=0,int pFrame=0,int pField=0, FBTimeMode pTimeMode=kFBTimeModeDefault, double pFramerate = 0.0);
00169
00171
00175 FBTime& operator= (const FBTime& pTime);
00176 FBTime& operator+= (const FBTime& pTime);
00177 FBTime& operator-= (const FBTime& pTime);
00178 FBTime& operator*= (const FBTime& pTime);
00179 FBTime& operator/= (const FBTime& pTime);
00181
00183
00187 FBTime& operator= (double pConstant);
00188 FBTime& operator+= (double pConstant);
00189 FBTime& operator-= (double pConstant);
00190 FBTime& operator*= (double pConstant);
00191 FBTime& operator/= (double pConstant);
00193
00195
00199 FBTime operator- (const FBTime &pTime);
00200 FBTime operator+ (const FBTime &pTime);
00201 FBTime operator/ (const FBTime &pTime);
00202 FBTime operator* (const FBTime &pTime);
00204
00206
00210 FBTime operator- (double pConstant);
00211 FBTime operator+ (double pConstant);
00212 FBTime operator/ (double pConstant);
00213 FBTime operator* (double pConstant);
00215
00217
00221 bool operator== (const FBTime& pTime);
00222 bool operator!= (const FBTime& pTime);
00223 bool operator>= (const FBTime& pTime);
00224 bool operator<= (const FBTime& pTime);
00225 bool operator> (const FBTime& pTime);
00226 bool operator< (const FBTime& pTime);
00228
00236 kLongLong GetFrame(bool pCummul=false, FBTimeMode pTimeMode=kFBTimeModeDefault, double pFramerate=0.0);
00237
00239 static const FBTime Infinity;
00240
00242 static const FBTime MinusInfinity;
00243
00245 static const FBTime Zero;
00246
00248 static const FBTime Epsilon;
00249
00251 static const FBTime OneSecond;
00252
00254 static const FBTime OneMinute;
00255
00257 static const FBTime OneHour;
00258 };
00259
00260 FB_FORWARD( FBTimeCode );
00261
00263 class FBSDK_DLL FBTimeCode
00264 {
00265 private:
00266 double mSecond;
00267 double mFrame;
00268 double mRate;
00269 public:
00270
00271
00272
00273 FBTimeCode();
00274
00282 FBTimeCode(int pHour,int pMinute=0,int pSecond=0,float pFrame=0,float pRate=0);
00283
00287 FBString GetTimeCodeString();
00288
00292 void SetTimeCodeString(char *pTime);
00293
00296 FBTime GetTime() const;
00297
00302 void SetTime(FBTime pTime, float pFrameRate = 0);
00303
00305 static const float NTSC_DROP;
00306 static const float NTSC_FULL;
00307 static const float PAL25;
00308 static const float MPAL_30;
00309 static const float FILM_24;
00310 static const float FILM_23976;
00311 };
00312
00314
00316
00317 FB_FORWARD( FBTimeSpan )
00318
00319
00320 class FBSDK_DLL FBTimeSpan
00321 {
00322 private:
00323 FBTime mStart;
00324 FBTime mStop;
00325 public:
00330 FBTimeSpan( FBTime pStart=0,FBTime pStop=0);
00331
00333
00336 FBTime& GetStart();
00337 FBTime& GetStop();
00338 const FBTime& GetStart() const;
00339 const FBTime& GetStop() const;
00341
00346 void Set( FBTime pStart, FBTime pStop );
00347
00351 FBTime GetDuration();
00352
00356 FBTime GetSignedDuration();
00357
00362 int GetDirection();
00363
00368 bool operator& (FBTime &pTime);
00369
00373 FBTimeSpan operator& (FBTimeSpan &pTimeSpan);
00374 };
00376
00378 #ifdef FBSDKUseNamespace
00379 }
00380 #endif
00381
00382 #endif
00383