Microsoft DirectX 8.0 |
Helper class to manage reference times.
Declaration: Reftime.h
A reference time is a unit of time represented in 100-nanosecond units. This class shares the same data layout as the REFERENCE_TIME data type, but adds some methods and operators that provide comparison, conversion, and arithmetic functions. For more information about reference times, see Time and Clocks in DirectShow.
Public Member Variables | |
---|---|
m_time | REFERENCE_TIME value. |
Public Methods | |
CRefTime | Constructor method. |
GetUnits | Retrieves the reference time in 100-nanosecond units. |
Millisecs | Converts the reference time to milliseconds. |
Operators | |
operator REFERENCE_TIME() | Casts the object to a REFERENCE_TIME data type. |
operator = | Assigns a new reference time. |
operator += | Adds two reference times. |
operator = | Subtracts one reference time from another. |
REFERENCE_TIME value.
Syntax
REFERENCE_TIME m_time;
Constructor method.
Syntax
CRefTime(void); CRefTime( LONG msecs ); CRefTime( REFERENCE_TIME rt );
Parameters
- msecs
- Time in milliseconds.
- rt
- Time in 100-nanosecond units.
Remarks
The reference time defaults to zero.
Retrieves the reference time in 100-nanosecond units.
Syntax
LONGLONG GetUnits(void);
Return Value
Returns the value of m_time.
Converts the reference time to milliseconds.
Syntax
LONG Millisecs(void);
Return Value
Returns the reference time in milliseconds.
Casts the object to a REFERENCE_TIME data type.
Syntax
operator REFERENCE_TIME() const;
Return Value
Returns the value of m_time.
Remarks
The following example shows how to use this cast operator:
CRefTime cRT(1000); REFERENCE_TIME rt = (REFERENCE_TIME)cRT;
Assigns a new reference time.
Syntax
CRefTime& operator=( const CRefTime& rt ); CRefTime& operator=( const LONGLONG ll );
Parameters
- rt
- Reference to a CRefTime object that specifies the new reference time.
- ll
- New reference time, in 100-nanosecond units.
Return Value
Returns a reference to the object.
Adds two reference times.
Syntax
CRefTime& operator+=( const CRefTime& rt );
Parameters
- rt
- Reference to a CRefTime object.
Return Value
Returns a reference to the object.
Subtracts one reference time from another.
Syntax
CRefTime& operator-=( const CRefTime& rt );
Parameters
- rt
- Reference to a CRefTime object.
Return Value
Returns a reference to the object.