FBX C++ API Reference
|
#include <fbxtime.h>
Class to encapsulate time units.
FbxTime can measure time in hour, minute, second, frame, field, residual and also combination of these units. It is recommended to use FbxTime for all time related operations. For example, currently it is used in FbxGlobalSettings, FbxGlobalTimeSettings, FbxCache, all curve filters and all animation-related classes, etc. FbxTime is just used to represent a moment, to represent a period of time, FbxTimeSpan should be used.
Public Member Functions | |
FbxTime (const FbxLongLong pTime=0) | |
Long long constructor. More... | |
Static Public Member Functions | |
static FbxLongLong | GetOneFrameValue (EMode pTimeMode=eDefaultMode) |
One frame value for a specified time mode. More... | |
Time Modes and Protocols | |
enum | EMode { eDefaultMode, eFrames120, eFrames100, eFrames60, eFrames50, eFrames48, eFrames30, eFrames30Drop, eNTSCDropFrame, eNTSCFullFrame, ePAL, eFrames24, eFrames1000, eFilmFullFrame, eCustom, eFrames96, eFrames72, eFrames59dot94, eModesCount } |
Time modes. More... | |
enum | EProtocol { eSMPTE, eFrameCount, eDefaultProtocol } |
Time protocols enumaration. More... | |
static void | SetGlobalTimeMode (EMode pTimeMode, double pFrameRate=0.0) |
Set default time mode. More... | |
static EMode | GetGlobalTimeMode () |
Get default time mode. More... | |
static void | SetGlobalTimeProtocol (EProtocol pTimeProtocol) |
Set default time protocol. More... | |
static EProtocol | GetGlobalTimeProtocol () |
Get default time protocol. More... | |
static double | GetFrameRate (EMode pTimeMode) |
Get frame rate associated with time mode, in frames per second. More... | |
static EMode | ConvertFrameRateToTimeMode (double pFrameRate, double pPrecision=0.00000001) |
Get time mode associated with frame rate. More... | |
Time Conversion | |
enum | EElement { eHours, eMinutes, eSeconds, eFrames, eField, eResidual } |
void | Set (FbxLongLong pTime) |
Set time in internal format. More... | |
FbxLongLong | Get () const |
Get time in internal format. More... | |
void | SetMilliSeconds (FbxLongLong pMilliSeconds) |
Set time in milliseconds. More... | |
FbxLongLong | GetMilliSeconds () const |
Get time in milliseconds. More... | |
void | SetSecondDouble (double pTime) |
Set time in seconds. More... | |
double | GetSecondDouble () const |
Get time in seconds. More... | |
void | SetTime (int pHour, int pMinute, int pSecond, int pFrame=0, int pField=0, EMode pTimeMode=eDefaultMode) |
Set time in hour/minute/second/frame/field format. More... | |
void | SetTime (int pHour, int pMinute, int pSecond, int pFrame, int pField, int pResidual, EMode pTimeMode) |
Set time in hour/minute/second/frame/field/residual format. More... | |
bool | GetTime (int &pHour, int &pMinute, int &pSecond, int &pFrame, int &pField, int &pResidual, EMode pTimeMode=eDefaultMode) const |
Get time in hour/minute/second/frame/field/residual format. More... | |
FbxTime | GetFramedTime (bool pRound=true) const |
Snaps a time value to the time value associated with the nearest frame. More... | |
void | SetFrame (FbxLongLong pFrames, EMode pTimeMode=eDefaultMode) |
Set time in frame format. More... | |
void | SetFramePrecise (FbxDouble pFrames, EMode pTimeMode=eDefaultMode) |
Set time in frame format, including fractions. More... | |
int | GetHourCount () const |
Get number of hours in time. More... | |
int | GetMinuteCount () const |
Get number of minutes in time. More... | |
int | GetSecondCount () const |
Get number of seconds in time. More... | |
FbxLongLong | GetFrameCount (EMode pTimeMode=eDefaultMode) const |
Get number of frames in time. More... | |
FbxDouble | GetFrameCountPrecise (EMode pTimeMode=eDefaultMode) const |
Get precise number of frames in time, including fractions. More... | |
FbxLongLong | GetFieldCount (EMode pTimeMode=eDefaultMode) const |
Get number of fields in time. More... | |
int | GetResidual (EMode pTimeMode=eDefaultMode) const |
Get residual time exceeding last full field. More... | |
char | GetFrameSeparator (EMode pTimeMode=eDefaultMode) const |
Separator char between second and frame. More... | |
char * | GetTimeString (char *pTimeString, const FbxUShort &pTimeStringSize, int pInfo=5, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol) const |
Get time in a human readable format. More... | |
FbxString | GetTimeString (EElement pStart=eHours, EElement pEnd=eResidual, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol) const |
Get the time in a human readable format. More... | |
bool | SetTimeString (const char *pTime, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol) |
Set time in a human readable format. More... | |
static bool | IsDropFrame (EMode pTimeMode=eDefaultMode) |
Test for Drop Frame mode. More... | |
Time Operators | |
bool | operator== (const FbxTime &pTime) const |
Equality operator. More... | |
bool | operator!= (const FbxTime &pTime) const |
Inequality operator. More... | |
bool | operator>= (const FbxTime &pTime) const |
Superior or equal to operator. More... | |
bool | operator<= (const FbxTime &pTime) const |
Inferior or equal to operator. More... | |
bool | operator> (const FbxTime &pTime) const |
Superior to operator. More... | |
bool | operator< (const FbxTime &pTime) const |
Inferior to operator. More... | |
FbxTime & | operator= (const FbxTime &pTime) |
Assignment operator. More... | |
FbxTime & | operator+= (const FbxTime &pTime) |
Addition operator. More... | |
FbxTime & | operator-= (const FbxTime &pTime) |
Subtraction operator. More... | |
FbxTime | operator+ (const FbxTime &pTime) const |
Addition operator. More... | |
FbxTime | operator- (const FbxTime &pTime) const |
Subtraction operator. More... | |
FbxTime | operator* (const int Mult) const |
Multiplication operator. More... | |
FbxTime | operator/ (const FbxTime &pTime) const |
Division operator. More... | |
FbxTime | operator* (const FbxTime &pTime) const |
Multiplication operator. More... | |
enum EMode |
Time modes.
eNTSCDropFrame
is used for broadcasting operations where clock time must be (almost) in sync with time code. To bring back color NTSC time code with clock time, this mode drops 2 frames per minute except for every 10 minutes (00, 10, 20, 30, 40, 50). 108 frames are dropped per hour. Over 24 hours the error is 2 frames and 1/4 of a frame. A time-code of 01:00:03:18 equals a clock time of 01:00:00:00eNTSCFullFrame
represents a time address and therefore is NOT IN SYNC with clock time. A time code of 01:00:00:00 equals a clock time of 01:00:03:18.Definition at line 90 of file fbxtime.h.
enum EProtocol |
Time protocols enumaration.
Enumerator | |
---|---|
eSMPTE | |
eFrameCount | |
eDefaultProtocol |
enum EElement |
Enumerator | |
---|---|
eHours | |
eMinutes | |
eSeconds | |
eFrames | |
eField | |
eResidual |
Definition at line 325 of file fbxtime.h.
|
inline |
|
static |
Set default time mode.
pTimeMode | Time mode identifier. |
pFrameRate | Custom framerate, only have effect in case of pTimeMode = FbxTime::eCustom |
eDefaultMode
.
|
static |
Get default time mode.
|
static |
Set default time protocol.
pTimeProtocol | Time protocol identifier. |
eDefaultProtocol
.
|
static |
Get default time protocol.
|
static |
Get frame rate associated with time mode, in frames per second.
pTimeMode | Time mode identifier. |
|
static |
Get time mode associated with frame rate.
pFrameRate | The frame rate value. |
pPrecision | The tolerance value. |
eDefaultMode
if no time mode associated to the given frame rate is found.
|
inline |
|
inline |
|
inline |
Set time in milliseconds.
pMilliSeconds | Time value to set. |
Definition at line 177 of file fbxtime.h.
|
inline |
void SetSecondDouble | ( | double | pTime | ) |
Set time in seconds.
pTime | Time value to set. |
double GetSecondDouble | ( | ) | const |
void SetTime | ( | int | pHour, |
int | pMinute, | ||
int | pSecond, | ||
int | pFrame = 0 , |
||
int | pField = 0 , |
||
EMode | pTimeMode = eDefaultMode |
||
) |
Set time in hour/minute/second/frame/field format.
pHour | The hours value. |
pMinute | The minutes value. |
pSecond | The seconds value. |
pFrame | The frames values. |
pField | The field value. |
pTimeMode | Time mode identifier. |
void SetTime | ( | int | pHour, |
int | pMinute, | ||
int | pSecond, | ||
int | pFrame, | ||
int | pField, | ||
int | pResidual, | ||
EMode | pTimeMode | ||
) |
Set time in hour/minute/second/frame/field/residual format.
pHour | The hours value. |
pMinute | The minutes value. |
pSecond | The seconds value. |
pFrame | The frames values. |
pField | The field value. |
pResidual | The hundredths of frame value. |
pTimeMode | Time mode identifier. |
bool GetTime | ( | int & | pHour, |
int & | pMinute, | ||
int & | pSecond, | ||
int & | pFrame, | ||
int & | pField, | ||
int & | pResidual, | ||
EMode | pTimeMode = eDefaultMode |
||
) | const |
Get time in hour/minute/second/frame/field/residual format.
pHour | The returned hours value. |
pMinute | The returned minutes value. |
pSecond | The returned seconds value. |
pFrame | The returned frames values. |
pField | The returned field value. |
pResidual | The returned hundredths of frame value. |
pTimeMode | The time mode identifier which will dictate the extraction algorithm. |
true
if the pTimeMode parameter is a valid identifier and thus the extraction succeeded. If the function returns false
, all the values are set to 0. FbxTime GetFramedTime | ( | bool | pRound = true | ) | const |
Snaps a time value to the time value associated with the nearest frame.
pRound | If true the return value is rounded to the nearest integer. |
void SetFrame | ( | FbxLongLong | pFrames, |
EMode | pTimeMode = eDefaultMode |
||
) |
Set time in frame format.
pFrames | The number of frames. |
pTimeMode | The time mode identifier which will dictate the extraction algorithm. |
void SetFramePrecise | ( | FbxDouble | pFrames, |
EMode | pTimeMode = eDefaultMode |
||
) |
Set time in frame format, including fractions.
pFrames | The number of frames in decimal value. |
pTimeMode | The time mode identifier which will dictate the extraction algorithm. |
int GetHourCount | ( | ) | const |
Get number of hours in time.
int GetMinuteCount | ( | ) | const |
Get number of minutes in time.
int GetSecondCount | ( | ) | const |
Get number of seconds in time.
FbxLongLong GetFrameCount | ( | EMode | pTimeMode = eDefaultMode | ) | const |
Get number of frames in time.
pTimeMode | Time mode identifier. |
FbxDouble GetFrameCountPrecise | ( | EMode | pTimeMode = eDefaultMode | ) | const |
Get precise number of frames in time, including fractions.
pTimeMode | Time mode identifier. |
FbxLongLong GetFieldCount | ( | EMode | pTimeMode = eDefaultMode | ) | const |
Get number of fields in time.
pTimeMode | Time mode identifier. |
int GetResidual | ( | EMode | pTimeMode = eDefaultMode | ) | const |
Get residual time exceeding last full field.
pTimeMode | Time mode identifier. |
|
static |
Test for Drop Frame mode.
pTimeMode | Time mode identifier. |
char GetFrameSeparator | ( | EMode | pTimeMode = eDefaultMode | ) | const |
Separator char between second and frame.
pTimeMode | Time mode identifier. |
char* GetTimeString | ( | char * | pTimeString, |
const FbxUShort & | pTimeStringSize, | ||
int | pInfo = 5 , |
||
EMode | pTimeMode = eDefaultMode , |
||
EProtocol | pTimeFormat = eDefaultProtocol |
||
) | const |
Get time in a human readable format.
pTimeString | An array large enough to contain a minimum of 19 characters. |
pTimeStringSize | Size of the pTimeString buffer used with secure functions. |
pInfo | The amount of information if time protocol is eSMPTE:
|
pTimeMode | Requested time mode. |
pTimeFormat | Requested time protocol. |
FbxString GetTimeString | ( | EElement | pStart = eHours , |
EElement | pEnd = eResidual , |
||
EMode | pTimeMode = eDefaultMode , |
||
EProtocol | pTimeFormat = eDefaultProtocol |
||
) | const |
Get the time in a human readable format.
pStart | The starting element type used to format the time string. |
pEnd | The last element type used to format the time string. |
pTimeMode | The time mode requested. |
pTimeFormat | The time format requested. |
bool SetTimeString | ( | const char * | pTime, |
EMode | pTimeMode = eDefaultMode , |
||
EProtocol | pTimeFormat = eDefaultProtocol |
||
) |
Set time in a human readable format.
pTime | An array of a maximum of 18 characters. If time protocol is eSMPTE , pTimeString must be formatted this way: "[hours:]minutes[:seconds[.frames[.fields]]]". Hours, minutes, seconds, frames and fields are parsed as integers and brackets indicate optional parts. If time protocol is eFRAME , pTimeString must be formatted this way: "frames". Frames is parsed as a 64 bits integer. |
pTimeMode | Given time mode. |
pTimeFormat | Given time protocol. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
FbxTime operator* | ( | const int | Mult | ) | const |
|
static |
One frame value for a specified time mode.
pTimeMode | Time mode identifier. |