13 #ifndef _FBXSDK_CORE_BASE_TIME_H_
14 #define _FBXSDK_CORE_BASE_TIME_H_
23 #define FBXSDK_TIME_INFINITE FbxTime(FBXSDK_TC_INFINITY)
24 #define FBXSDK_TIME_MINUS_INFINITE FbxTime(FBXSDK_TC_MINFINITY)
25 #define FBXSDK_TIME_ZERO FbxTime(FBXSDK_TC_ZERO)
26 #define FBXSDK_TIME_EPSILON FbxTime(FBXSDK_TC_EPSILON)
27 #define FBXSDK_TIME_ONE_SECOND FbxTime(FBXSDK_TC_SECOND)
28 #define FBXSDK_TIME_ONE_MINUTE FbxTime(FBXSDK_TC_MINUTE)
29 #define FBXSDK_TIME_ONE_HOUR FbxTime(FBXSDK_TC_HOUR)
30 #define FBXSDK_TIME_ASSERT_EPSILON 0.5
31 #define FBXSDK_TIME_FORWARD 1
32 #define FBXSDK_TIME_BACKWARD -1
34 class FbxTimeModeObject;
125 static void SetGlobalTimeMode(EMode pTimeMode,
double pFrameRate=0.0);
131 static EMode GetGlobalTimeMode();
137 static void SetGlobalTimeProtocol(EProtocol pTimeProtocol);
143 static EProtocol GetGlobalTimeProtocol();
149 static double GetFrameRate(EMode pTimeMode);
157 static EMode ConvertFrameRateToTimeMode(
double pFrameRate,
double pPrecision=0.00000001);
187 void SetSecondDouble(
double pTime);
192 double GetSecondDouble()
const;
205 void SetTime(
int pHour,
int pMinute,
int pSecond,
int pFrame=0,
int pField=0, EMode pTimeMode=eDefaultMode);
224 void SetTime(
int pHour,
int pMinute,
int pSecond,
int pFrame,
int pField,
int pResidual, EMode pTimeMode);
237 bool GetTime(
int& pHour,
int& pMinute,
int& pSecond,
int& pFrame,
int& pField,
int& pResidual, EMode pTimeMode=eDefaultMode)
const;
243 FbxTime GetFramedTime(
bool pRound=
true)
const;
249 void SetFrame(
FbxLongLong pFrames, EMode pTimeMode=eDefaultMode);
255 void SetFramePrecise(
FbxDouble pFrames, EMode pTimeMode=eDefaultMode);
260 int GetHourCount()
const;
265 int GetMinuteCount()
const;
270 int GetSecondCount()
const;
276 FbxLongLong GetFrameCount(EMode pTimeMode=eDefaultMode)
const;
282 FbxDouble GetFrameCountPrecise(EMode pTimeMode=eDefaultMode)
const;
288 FbxLongLong GetFieldCount(EMode pTimeMode=eDefaultMode)
const;
294 int GetResidual(EMode pTimeMode=eDefaultMode)
const;
300 static bool IsDropFrame(EMode pTimeMode=eDefaultMode);
306 char GetFrameSeparator(EMode pTimeMode=eDefaultMode)
const;
323 char* GetTimeString(
char* pTimeString,
const FbxUShort& pTimeStringSize,
int pInfo=5, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol)
const;
333 FbxString GetTimeString(EElement pStart=eHours, EElement pEnd=eResidual, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol)
const;
347 bool SetTimeString(
const char* pTime, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol);
423 FbxTime operator*(
const int Mult)
const;
454 static FbxLongLong GetOneFrameValue(EMode pTimeMode=eDefaultMode);
459 #ifndef DOXYGEN_SHOULD_SKIP_THIS
467 eOLD_NTSC_DROP_FRAME,
472 eOLD_NTSC_FULL_FRAME,
480 static EMode gsGlobalTimeMode;
481 static EProtocol gsGlobalTimeProtocol;
482 static FbxTimeModeObject* gsTimeObject;
484 void InternalSetTime(
int pHour,
int pMinute,
int pSecond,
FbxLongLong pFrame,
int pField, EMode pTimeMode);
549 inline FbxTime GetDuration()
const {
if( mStop > mStart )
return mStop - mStart;
else return mStart - mStop; }
565 bool IsInside(
FbxTime pTime)
const;
597 #ifndef DOXYGEN_SHOULD_SKIP_THIS
bool operator<=(const FbxTime &pTime) const
Inferior or equal to operator.
FbxString operator+(const FbxString &pString1, const FbxString &pString2)
FbxString concatenation.
void Set(FbxTime pStart, FbxTime pStop)
Set start and stop time.
bool FbxIsValidCustomFrameRate(double pFramerate)
void SetStart(FbxTime pStart)
Set start time.
void SetSecondDouble(double pTime)
Set time in seconds.
FBX SDK environment definition.
void Set(FbxLongLong pTime)
Set time in internal format.
int FbxGetFrameRateStringListIndex(FbxTime::EMode pTimeMode)
FbxTime & operator-=(const FbxTime &pTime)
Subtraction operator.
FbxLongLong GetMilliSeconds() const
Get time in milliseconds.
bool operator>=(const FbxTime &pTime) const
Superior or equal to operator.
bool FbxGetNearestCustomFrameRate(double pFramerate, double &pNearestRate)
EProtocol
Time protocols enumaration.
double FbxGetFrameRate(FbxTime::EMode pTimeMode)
Utility class to manipulate strings.
const char * FbxGetGlobalFrameRateString(FbxTime::EMode pTimeMode)
FbxTime(const FbxLongLong pTime=0)
Long long constructor.
void SetStop(FbxTime pStop)
Set stop time.
FbxTime::EOldMode FbxGetOldTimeModeCorrespondance(FbxTime::EMode pMode)
#define FBXSDK_TIME_FORWARD
FbxTimeSpan(FbxTime pStart, FbxTime pStop)
Constructor.
#define FBXSDK_TC_MILLISECOND
FbxTime GetStop() const
Get stop time.
FbxTime GetSignedDuration() const
Get time interval.
FbxTime::EMode FbxSelectionToTimeMode(int pSelection)
Class to encapsulate time units.
FbxTime::EMode FbxGetGlobalTimeMode()
FbxTime::EProtocol FbxGetGlobalTimeFormat()
FbxTime FbxTimeSeconds(const FbxDouble &pTime=0.0)
FbxTime in seconds constructor.
FbxTime & operator=(const FbxTime &pTime)
Assignment operator.
FbxTime::EProtocol FbxSelectionToTimeFormat(int pSelection)
void FbxSetGlobalTimeMode(FbxTime::EMode pTimeMode, double pFrameRate=0.0)
FbxTimeSpan()
Constructor.
void FbxSetGlobalTimeFormat(FbxTime::EProtocol pTimeFormat)
bool operator<(const FbxTime &pTime) const
Inferior to operator.
const char * FbxGetGlobalTimeModeString(FbxTime::EMode pTimeMode)
int GetDirection() const
Get direction of the time interval.
void FbxGetControlStringList(char *pControlString, FbxTime::EProtocol pTimeFormat)
void FbxGetCurrentLocalTime(FbxLocalTime &pLocalTime)
bool operator!=(const FbxTime &pTime) const
Inequality operator.
Class to encapsulate time intervals.
FbxTime::EMode FbxGetTimeModeFromOldValue(FbxTime::EOldMode pOldMode)
bool operator==(const FbxTime &pTime) const
Equality operator.
bool operator>(const FbxTime &pTime) const
Superior to operator.
FbxTime::EMode FbxGetTimeModeFromFrameRate(char *pFrameRate)
void SetMilliSeconds(FbxLongLong pMilliSeconds)
Set time in milliseconds.
FbxTime GetDuration() const
Get time interval in absolute value.
int FbxTimeToSelection(FbxTime::EMode pTimeMode=FbxTime::eDefaultMode, int pTimeFormat=FbxTime::eDefaultProtocol)
FbxTimeModeObject * FbxGetGlobalTimeModeObject()
FbxTime & operator+=(const FbxTime &pTime)
Addition operator.
FbxLongLong Get() const
Get time in internal format.
#define FBXSDK_TIME_BACKWARD
const char * FbxGetTimeModeName(FbxTime::EMode pTimeMode)
FbxTime GetStart() const
Get start time.