Public Types | Public Member Functions | Static Public Member Functions | Friends

FbxTime Class Reference

This reference page is linked to from the following overview topics: FBX SDK 2013, Transformation Data, List of Python Fbx classes.


Search for all occurrences

Detailed Description

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.

See also:
FbxTimeSpan

Definition at line 41 of file fbxtime.h.

#include <fbxtime.h>

List of all members.

Public Types

enum  EOldMode {
  eOLD_DEFAULT_MODE, eOLD_CINEMA, eOLD_PAL, eOLD_FRAMES30,
  eOLD_NTSC_DROP_FRAME, eOLD_FRAMES50, eOLD_FRAMES60, eOLD_FRAMES100,
  eOLD_FRAMES120, eOLD_NTSC_FULL_FRAME, eOLD_FRAMES30_DROP, eOLD_FRAMES1000
}

Public Member Functions

 FbxTime (const FbxLongLong pTime=0)
 Long long constructor.

Static Public Member Functions

static FbxLongLong GetOneFrameValue (EMode pTimeMode=eDefaultMode)
 One frame value for a specified time mode.

Friends

FBXSDK_DLL FbxTime::EMode FbxGetGlobalTimeMode ()
FBXSDK_DLL FbxTimeModeObject * FbxGetGlobalTimeModeObject ()
FBXSDK_DLL FbxTime::EProtocol FbxGetGlobalTimeFormat ()
FBXSDK_DLL void FbxSetGlobalTimeMode (FbxTime::EMode pTimeMode, double pFrameRate)
FBXSDK_DLL void FbxSetGlobalTimeFormat (FbxTime::EProtocol pTimeFormat)

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

  • eSMPTE SMPTE EProtocol
  • eFrameCount Frame count
  • eDefaultProtocol Default protocol (initialized to eFRAMES)
More...
static void SetGlobalTimeMode (EMode pTimeMode, double pFrameRate=0.0)
 Set default time mode.
static EMode GetGlobalTimeMode ()
 Get default time mode.
static void SetGlobalTimeProtocol (EProtocol pTimeProtocol)
 Set default time protocol.
static EProtocol GetGlobalTimeProtocol ()
 Get default time protocol.
static double GetFrameRate (EMode pTimeMode)
 Get frame rate associated with time mode, in frames per second.
static EMode ConvertFrameRateToTimeMode (double pFrameRate, double pPrecision=0.00000001)
 Get time mode associated with frame rate.

Time Conversion

void Set (FbxLongLong pTime)
 Set time in internal format.
FbxLongLong Get () const
 Get time in internal format.
void SetMilliSeconds (FbxLongLong pMilliSeconds)
 Set time in milliseconds.
FbxLongLong GetMilliSeconds () const
 Get time in milliseconds.
void SetSecondDouble (double pTime)
 Set time in seconds.
double GetSecondDouble () const
 Get time in seconds.
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.
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.
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.
FbxTime GetFramedTime (bool pRound=true)
 Snaps a time value to the time value associated with the nearest frame.
void SetFrame (FbxLongLong pFrames, EMode pTimeMode=eDefaultMode)
 Set time in frame format.
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.
FbxLongLong GetFieldCount (EMode pTimeMode=eDefaultMode) const
 Get number of fields in time.
int GetResidual (EMode pTimeMode=eDefaultMode) const
 Get residual time exceeding last full field.
char GetFrameSeparator (EMode pTimeMode=eDefaultMode) const
 Separator char between second and frame.
FBX_DEPRECATED char * GetTimeString (char *pTimeString, int pInfo=5, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol) const
 Get time in a human readable format.
char * GetTimeString (char *pTimeString, const FbxUShort &pTimeStringSize, int pInfo=5, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol) const
 Get time in a human readable format.
bool SetTimeString (const char *pTime, EMode pTimeMode=eDefaultMode, EProtocol pTimeFormat=eDefaultProtocol)
 Set time in a human readable format.
static bool IsDropFrame (EMode pTimeMode=eDefaultMode)
 Test for Drop Frame mode.

Time Operators

bool operator== (const FbxTime &pTime) const
 Equality operator.
bool operator!= (const FbxTime &pTime) const
 Inequality operator.
bool operator>= (const FbxTime &pTime) const
 Superior or equal to operator.
bool operator<= (const FbxTime &pTime) const
 Inferior or equal to operator.
bool operator> (const FbxTime &pTime) const
 Superior to operator.
bool operator< (const FbxTime &pTime) const
 Inferior to operator.
FbxTimeoperator= (const FbxTime &pTime)
 Assignment operator.
FbxTimeoperator+= (const FbxTime &pTime)
 Addition operator.
FbxTimeoperator-= (const FbxTime &pTime)
 Subtraction operator.
FbxTime operator+ (const FbxTime &pTime) const
 Addition operator.
FbxTime operator- (const FbxTime &pTime) const
 Subtraction operator.
FbxTime operator* (const int Mult) const
 Multiplication operator.
FbxTime operator/ (const FbxTime &pTime) const
 Division operator.
FbxTime operator* (const FbxTime &pTime) const
 Multiplication operator.

Member Enumeration Documentation

enum EMode

Time modes.

Remarks:
EMode 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:00
EMode eNTSCFullFrame 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.
  • eDefaultMode
  • eFrames120 120 frames/s
  • eFrames100 100 frames/s
  • eFrames60 60 frames/s
  • eFrames50 50 frames/s
  • eFrames48 48 frame/s
  • eFrames30 30 frames/s (black and white NTSC)
  • eFrames30Drop 30 frames/s (use when display in frame is selected, equivalent to NTSC drop)
  • eNTSCDropFrame ~29.97 frames/s drop color NTSC
  • eNTSCFullFrame ~29.97 frames/s color NTSC
  • ePAL 25 frames/s PAL/SECAM
  • eFrames24 24 frames/s Film/Cinema
  • eFrames1000 1000 milli/s (use for date time)
  • eFilmFullFrame ~23.976 frames/s
  • eCustom Custom frame rate value
  • eFrames96 96 frames/s
  • eFrames72 72 frames/s
  • eFrames59dot94 ~59.94 frames/s
  • eModesCount Number of time modes
Enumerator:
eDefaultMode 
eFrames120 
eFrames100 
eFrames60 
eFrames50 
eFrames48 
eFrames30 
eFrames30Drop 
eNTSCDropFrame 
eNTSCFullFrame 
ePAL 
eFrames24 
eFrames1000 
eFilmFullFrame 
eCustom 
eFrames96 
eFrames72 
eFrames59dot94 
eModesCount 

Definition at line 87 of file fbxtime.h.

enum EProtocol

Time protocols enumaration

  • eSMPTE SMPTE EProtocol
  • eFrameCount Frame count
  • eDefaultProtocol Default protocol (initialized to eFRAMES)
Enumerator:
eSMPTE 
eFrameCount 
eDefaultProtocol 

Definition at line 115 of file fbxtime.h.

enum EOldMode
Enumerator:
eOLD_DEFAULT_MODE 
eOLD_CINEMA 
eOLD_PAL 
eOLD_FRAMES30 
eOLD_NTSC_DROP_FRAME 
eOLD_FRAMES50 
eOLD_FRAMES60 
eOLD_FRAMES100 
eOLD_FRAMES120 
eOLD_NTSC_FULL_FRAME 
eOLD_FRAMES30_DROP 
eOLD_FRAMES1000 

Definition at line 454 of file fbxtime.h.

    {
        eOLD_DEFAULT_MODE,      //Default mode set using FbxTime::SetGlobalTimeMode(EMode pTimeMode)
        eOLD_CINEMA,            //24 frameOLD_s/s
        eOLD_PAL,               //25 frameOLD_s/s    PAL/SECAM
        eOLD_FRAMES30,          //30 frameOLD_s/s    BLACK & WHITE NTSC
        eOLD_NTSC_DROP_FRAME,   //29.97002617 frameOLD_s/s COLOR NTSC
        eOLD_FRAMES50,          //50 frameOLD_s/s
        eOLD_FRAMES60,          //60 frameOLD_s/s
        eOLD_FRAMES100,         //100 frameOLD_s/s
        eOLD_FRAMES120,         //120 frameOLD_s/s
        eOLD_NTSC_FULL_FRAME,   //29.97002617 frameOLD_s/s COLOR NTSC
        eOLD_FRAMES30_DROP,     //30 frameOLD_s/s
        eOLD_FRAMES1000         //1000 frameOLD_s/s
    };

Constructor & Destructor Documentation

FbxTime ( const FbxLongLong  pTime = 0) [inline]

Long long constructor.

Parameters:
pTimeInitial value defined as a 64bit integer.

Definition at line 47 of file fbxtime.h.

{ mTime = pTime; }

Member Function Documentation

static void SetGlobalTimeMode ( EMode  pTimeMode,
double  pFrameRate = 0.0 
) [static]

Set default time mode.

Parameters:
pTimeModeTime mode identifier.
pFrameRateCustom framerate, only have effect in case of pTimeMode = FbxTime::eCustom
Remarks:
It is meaningless to set default time mode to eDefaultMode.
static EMode GetGlobalTimeMode ( ) [static]

Get default time mode.

Returns:
Currently set time mode identifier.
Remarks:
Default time mode initial value is eFrames30.
static void SetGlobalTimeProtocol ( EProtocol  pTimeProtocol) [static]

Set default time protocol.

Parameters:
pTimeProtocolTime protocol identifier.
Remarks:
It is meaningless to set default time protocol to eDefaultProtocol.
static EProtocol GetGlobalTimeProtocol ( ) [static]

Get default time protocol.

Returns:
Currently set time protocol identifier.
Remarks:
Default time protocol initial value is eSMPTE.
static double GetFrameRate ( EMode  pTimeMode) [static]

Get frame rate associated with time mode, in frames per second.

Parameters:
pTimeModeTime mode identifier.
Returns:
Frame rate value.
static EMode ConvertFrameRateToTimeMode ( double  pFrameRate,
double  pPrecision = 0.00000001 
) [static]

Get time mode associated with frame rate.

Parameters:
pFrameRateThe frame rate value.
lPrecisionThe tolerance value.
Returns:
The corresponding time mode identifier or eDefaultMode if no time mode associated to the given frame rate is found.
void Set ( FbxLongLong  pTime) [inline]

Set time in internal format.

Parameters:
pTimeTime value to set.

Definition at line 164 of file fbxtime.h.

{ mTime = pTime; }
FbxLongLong Get ( ) const [inline]

Get time in internal format.

Returns:
Time value.

Definition at line 169 of file fbxtime.h.

{ return mTime; }
void SetMilliSeconds ( FbxLongLong  pMilliSeconds) [inline]

Set time in milliseconds.

Parameters:
pMilliSecondsTime value to set.

Definition at line 174 of file fbxtime.h.

{ mTime = pMilliSeconds * FBXSDK_TC_MILLISECOND; }
FbxLongLong GetMilliSeconds ( ) const [inline]

Get time in milliseconds.

Returns:
Time value.

Definition at line 179 of file fbxtime.h.

{ return mTime / FBXSDK_TC_MILLISECOND; }
void SetSecondDouble ( double  pTime)

Set time in seconds.

Parameters:
pTimeTime value to set.
double GetSecondDouble ( ) const

Get time in seconds.

Returns:
Time value.
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.

Parameters:
pHourThe hours value.
pMinuteThe minutes value.
pSecondThe seconds value.
pFrameThe frames values.
pFieldThe field value.
pTimeModeTime mode identifier.
Remarks:
Parameters pHour, pMinute, pSecond, pFrame and pField are summed together. For example, it is possible to set the time to 83 seconds in the following ways: SetTime(0,1,23) or SetTime(0,0,83).
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.

Parameters:
pHourThe hours value.
pMinuteThe minutes value.
pSecondThe seconds value.
pFrameThe frames values.
pFieldThe field value.
pResidualThe hundredths of frame value.
pTimeModeTime mode identifier.
Remarks:
Parameters pHour, pMinute, pSecond, pFrame, pField and pResidual are summed together, just like above. pResidual represents hundredths of frame, and won't necessarily correspond to an exact internal value.
The time mode can't have a default value, because otherwise SetTime(int, int, int, int, int, int) would be ambiguous. Please specify DEFAULT_MODE.
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.

Parameters:
pHourThe returned hours value.
pMinuteThe returned minutes value.
pSecondThe returned seconds value.
pFrameThe returned frames values.
pFieldThe returned field value.
pResidualThe returned hundredths of frame value.
pTimeModeThe time mode identifier which will dictate the extraction algorithm.
Returns:
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)

Snaps a time value to the time value associated with the nearest frame.

Parameters:
pRoundIf true the return value is rounded to the nearest integer.
Returns:
The snapped time value.
void SetFrame ( FbxLongLong  pFrames,
EMode  pTimeMode = eDefaultMode 
)

Set time in frame format.

Parameters:
pFramesThe number of frames.
pTimeModeThe time mode identifier which will dictate the extraction algorithm.
int GetHourCount ( ) const

Get number of hours in time.

Returns:
Hours value.
int GetMinuteCount ( ) const

Get number of minutes in time.

Returns:
Minutes value.
int GetSecondCount ( ) const

Get number of seconds in time.

Returns:
Seconds value.
FbxLongLong GetFrameCount ( EMode  pTimeMode = eDefaultMode) const

Get number of frames in time.

frames exceeding last full second.

Parameters:
pTimeModeTime mode identifier.
Returns:
Frames values.
FbxLongLong GetFieldCount ( EMode  pTimeMode = eDefaultMode) const

Get number of fields in time.

Parameters:
pTimeModeTime mode identifier.
Returns:
Fields value.
int GetResidual ( EMode  pTimeMode = eDefaultMode) const

Get residual time exceeding last full field.

Parameters:
pTimeModeTime mode identifier.
Returns:
Residual value.
static bool IsDropFrame ( EMode  pTimeMode = eDefaultMode) [static]

Test for Drop Frame mode.

Parameters:
pTimeModeTime mode identifier.
Returns:
True if the pTimeMode is a Drop Frame mode.
char GetFrameSeparator ( EMode  pTimeMode = eDefaultMode) const

Separator char between second and frame.

Parameters:
pTimeModeTime mode identifier.
Returns:
';' is returned if pTimeMode is a DropFrame mode otherwise ':'.
FBX_DEPRECATED char* GetTimeString ( char *  pTimeString,
int  pInfo = 5,
EMode  pTimeMode = eDefaultMode,
EProtocol  pTimeFormat = eDefaultProtocol 
) const

Get time in a human readable format.

Parameters:
pTimeStringAn array large enough to contain a minimum of 19 characters.
pInfoThe amount of information if time protocol is eSMPTE:
  • 1 means hours only
  • 2 means hours and minutes
  • 3 means hours, minutes and seconds
  • 4 means hours, minutes, seconds and frames
  • 5 means hours, minutes, seconds, frames and field
  • 6 means hours, minutes, seconds, frames, field and residual value
pTimeModeRequested time mode.
pTimeFormatRequested time protocol.
Returns:
pTimeString parameter filled with a time value or set to a empty string if parameter pInfo is not valid.
Remarks:
Until it gets removed, this function will simply call the secure version passing 50 in the /e pTimeStringSize.
char* GetTimeString ( char *  pTimeString,
const FbxUShort pTimeStringSize,
int  pInfo = 5,
EMode  pTimeMode = eDefaultMode,
EProtocol  pTimeFormat = eDefaultProtocol 
) const

Get time in a human readable format.

Parameters:
pTimeStringAn array large enough to contain a minimum of 19 characters.
pTimeStringSizeSize of the pTimeString buffer used with secure functions.
pInfoThe amount of information if time protocol is eSMPTE:
  • 1 means hours only
  • 2 means hours and minutes
  • 3 means hours, minutes and seconds
  • 4 means hours, minutes, seconds and frames
  • 5 means hours, minutes, seconds, frames and field
  • 6 means hours, minutes, seconds, frames, field and residual value
pTimeModeRequested time mode.
pTimeFormatRequested time protocol.
Returns:
pTimeString parameter filled with a time value or set to a empty string if parameter pInfo is not valid.
bool SetTimeString ( const char *  pTime,
EMode  pTimeMode = eDefaultMode,
EProtocol  pTimeFormat = eDefaultProtocol 
)

Set time in a human readable format.

Parameters:
pTimeAn 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.
pTimeModeGiven time mode.
pTimeFormatGiven time protocol.
Returns:
True if the set time string succeed, otherwise return false.
bool operator== ( const FbxTime pTime) const [inline]

Equality operator.

Parameters:
pTimeThe FbxTime to be compared.
Returns:
true if equal, false otherwise.

Definition at line 351 of file fbxtime.h.

{ return mTime == pTime.mTime; }
bool operator!= ( const FbxTime pTime) const [inline]

Inequality operator.

Parameters:
pTimeThe FbxTime to be compared.
Returns:
true if unequal, false otherwise.

Definition at line 357 of file fbxtime.h.

{ return mTime != pTime.mTime; }
bool operator>= ( const FbxTime pTime) const [inline]

Superior or equal to operator.

Parameters:
pTimeThe FbxTime to be compared.
Returns:
true if this FbxTime is superior or equal to the passed FbxTime, false otherwise.

Definition at line 363 of file fbxtime.h.

{ return mTime >= pTime.mTime; }
bool operator<= ( const FbxTime pTime) const [inline]

Inferior or equal to operator.

Parameters:
pTimeThe FbxTime to be compared.
Returns:
true if this FbxTime is inferior or equal to the passed FbxTime, false otherwise.

Definition at line 369 of file fbxtime.h.

{ return mTime <= pTime.mTime; }
bool operator> ( const FbxTime pTime) const [inline]

Superior to operator.

Parameters:
pTimeThe FbxTime to be compared.
Returns:
true if this FbxTime is superior to the passed FbxTime, false otherwise.

Definition at line 375 of file fbxtime.h.

{ return mTime > pTime.mTime; }
bool operator< ( const FbxTime pTime) const [inline]

Inferior to operator.

Parameters:
pTimeThe FbxTime to be compared.
Returns:
true if this FbxTime is inferior to the passed FbxTime, false otherwise.

Definition at line 381 of file fbxtime.h.

{ return mTime < pTime.mTime; } 
FbxTime& operator= ( const FbxTime pTime) [inline]

Assignment operator.

Parameters:
pTimeThe FbxTime to be assigned.

Definition at line 386 of file fbxtime.h.

{ mTime = pTime.mTime; return *this; }
FbxTime& operator+= ( const FbxTime pTime) [inline]

Addition operator.

Parameters:
pTimeThe FbxTime to be added.
Returns:
This FbxTime after addition.

Definition at line 392 of file fbxtime.h.

{ mTime += pTime.mTime; return *this; }
FbxTime& operator-= ( const FbxTime pTime) [inline]

Subtraction operator.

Parameters:
pTimeThe FbxTime to be subtracted.
Returns:
This FbxTime after subtraction.

Definition at line 398 of file fbxtime.h.

{ mTime -= pTime.mTime; return *this; }
FbxTime operator+ ( const FbxTime pTime) const

Addition operator.

Parameters:
pTimeThe FbxTime to be added.
Returns:
A temporary FbxTime after addition.
FbxTime operator- ( const FbxTime pTime) const

Subtraction operator.

Parameters:
pTimeThe FbxTime to be subtracted.
Returns:
A temporary FbxTime after subtraction.
FbxTime operator* ( const int  Mult) const

Multiplication operator.

Parameters:
MultMultiply this FbxTime by int Mult.
Returns:
A temporary FbxTime after multiplication.
FbxTime operator/ ( const FbxTime pTime) const

Division operator.

Parameters:
pTimeDivide this FbxTime by pTime.
Returns:
A temporary FbxTime after division.
FbxTime operator* ( const FbxTime pTime) const

Multiplication operator.

Parameters:
pTimeMultiply this FbxTime by pTime.
Returns:
A temporary FbxTime after multiplication.
static FbxLongLong GetOneFrameValue ( EMode  pTimeMode = eDefaultMode) [static]

One frame value for a specified time mode.

Parameters:
pTimeModeTime mode identifier.
Returns:
the time code of a one frame.

Friends And Related Function Documentation

FBXSDK_DLL FbxTime::EMode FbxGetGlobalTimeMode ( ) [friend]
FBXSDK_DLL FbxTimeModeObject* FbxGetGlobalTimeModeObject ( ) [friend]
FBXSDK_DLL FbxTime::EProtocol FbxGetGlobalTimeFormat ( ) [friend]
FBXSDK_DLL void FbxSetGlobalTimeMode ( FbxTime::EMode  pTimeMode,
double  pFrameRate 
) [friend]
FBXSDK_DLL void FbxSetGlobalTimeFormat ( FbxTime::EProtocol  pTimeFormat) [friend]

The documentation for this class was generated from the following file:

FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime
FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime FbxTime