AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
AJATimeCode Class Reference

Utility class for timecodes. More...

#include <timecode.h>

Public Member Functions

 AJATimeCode ()
 
 AJATimeCode (uint32_t frame)
 
 AJATimeCode (const std::string &str, const AJATimeBase &timeBase, bool bDropFrame, bool bStdTc=false)
 
 AJATimeCode (const std::string &str, const AJATimeBase &timeBase)
 
 AJATimeCode (const AJATimeCode &other)
 
virtual ~AJATimeCode ()
 
void QueryString (std::string &str, const AJATimeBase &timeBase, bool bDropFrame)
 
void QueryString (char *pString, const AJATimeBase &timeBase, bool bDropFrame)
 
void QuerySMPTEString (char *pString, const AJATimeBase &timeBase, bool bDropFrame)
 
uint32_t QueryFrame (void) const
 
bool QueryStdTimecodeForHfr ()
 
void QueryHmsf (uint32_t &h, uint32_t &m, uint32_t &s, uint32_t &f, const AJATimeBase &timeBase, bool bDropFrame) const
 
void Set (uint32_t frame)
 
void Set (const std::string &str, const AJATimeBase &timeBase)
 
void SetWithCleanup (const std::string &str, const AJATimeBase &timeBase, bool bDrop)
 
void Set (const std::string &str, const AJATimeBase &timeBase, bool bDropFrame)
 
void SetHmsf (uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase &timeBase, bool bDropFrame)
 
void SetSMPTEString (const char *pBufr, const AJATimeBase &timeBase)
 
void SetRP188 (const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi, const AJATimeBase &inTimeBase)
 
void QueryRP188 (uint32_t *pDbb, uint32_t *pLow, uint32_t *pHigh, const AJATimeBase &timeBase, bool bDrop)
 
void QueryRP188 (uint32_t &outDBB, uint32_t &outLo, uint32_t &outHi, const AJATimeBase &timeBase, const bool bDrop)
 
void SetStdTimecodeForHfr (bool bStdTc)
 
AJATimeCodeoperator= (const AJATimeCode &val)
 
AJATimeCodeoperator+= (const AJATimeCode &val)
 
AJATimeCodeoperator-= (const AJATimeCode &val)
 
AJATimeCodeoperator+= (const int32_t val)
 
AJATimeCodeoperator-= (const int32_t val)
 
const AJATimeCode operator+ (const AJATimeCode &val) const
 
const AJATimeCode operator+ (const int32_t val) const
 
const AJATimeCode operator- (const AJATimeCode &val) const
 
const AJATimeCode operator- (const int32_t val) const
 
bool operator== (const AJATimeCode &val) const
 
bool operator< (const AJATimeCode &val) const
 
bool operator< (const int32_t val) const
 
bool operator> (const AJATimeCode &val) const
 
bool operator> (const int32_t val) const
 
bool operator!= (const AJATimeCode &val) const
 

Static Public Member Functions

static int QuerySMPTEStringSize (void)
 
static bool QueryIsDropFrame (const std::string &str)
 
static int QueryStringSize (void)
 
static bool QueryIsRP188DropFrame (const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi)
 

Public Attributes

uint32_t m_frame
 
bool m_stdTimecodeForHfr
 

Detailed Description

Utility class for timecodes.

This is a storage and conversion class for timecodes.

Definition at line 17 of file timecode.h.

Constructor & Destructor Documentation

◆ AJATimeCode() [1/5]

AJATimeCode::AJATimeCode ( )

Definition at line 44 of file timecode.cpp.

◆ AJATimeCode() [2/5]

AJATimeCode::AJATimeCode ( uint32_t  frame)

Definition at line 50 of file timecode.cpp.

◆ AJATimeCode() [3/5]

AJATimeCode::AJATimeCode ( const std::string &  str,
const AJATimeBase timeBase,
bool  bDropFrame,
bool  bStdTc = false 
)

Definition at line 56 of file timecode.cpp.

◆ AJATimeCode() [4/5]

AJATimeCode::AJATimeCode ( const std::string &  str,
const AJATimeBase timeBase 
)

Definition at line 62 of file timecode.cpp.

◆ AJATimeCode() [5/5]

AJATimeCode::AJATimeCode ( const AJATimeCode other)

Definition at line 68 of file timecode.cpp.

◆ ~AJATimeCode()

AJATimeCode::~AJATimeCode ( )
virtual

Definition at line 77 of file timecode.cpp.

Member Function Documentation

◆ operator!=()

bool AJATimeCode::operator!= ( const AJATimeCode val) const

Definition at line 589 of file timecode.cpp.

◆ operator+() [1/2]

const AJATimeCode AJATimeCode::operator+ ( const AJATimeCode val) const

Definition at line 635 of file timecode.cpp.

◆ operator+() [2/2]

const AJATimeCode AJATimeCode::operator+ ( const int32_t  val) const

Definition at line 640 of file timecode.cpp.

◆ operator+=() [1/2]

AJATimeCode & AJATimeCode::operator+= ( const AJATimeCode val)

Definition at line 597 of file timecode.cpp.

◆ operator+=() [2/2]

AJATimeCode & AJATimeCode::operator+= ( const int32_t  val)

Definition at line 603 of file timecode.cpp.

◆ operator-() [1/2]

const AJATimeCode AJATimeCode::operator- ( const AJATimeCode val) const

Definition at line 648 of file timecode.cpp.

◆ operator-() [2/2]

const AJATimeCode AJATimeCode::operator- ( const int32_t  val) const

Definition at line 653 of file timecode.cpp.

◆ operator-=() [1/2]

AJATimeCode & AJATimeCode::operator-= ( const AJATimeCode val)

Definition at line 612 of file timecode.cpp.

◆ operator-=() [2/2]

AJATimeCode & AJATimeCode::operator-= ( const int32_t  val)

Definition at line 622 of file timecode.cpp.

◆ operator<() [1/2]

bool AJATimeCode::operator< ( const AJATimeCode val) const

Definition at line 557 of file timecode.cpp.

◆ operator<() [2/2]

bool AJATimeCode::operator< ( const int32_t  val) const

Definition at line 563 of file timecode.cpp.

◆ operator=()

AJATimeCode & AJATimeCode::operator= ( const AJATimeCode val)

Definition at line 531 of file timecode.cpp.

◆ operator==()

bool AJATimeCode::operator== ( const AJATimeCode val) const

Definition at line 544 of file timecode.cpp.

◆ operator>() [1/2]

bool AJATimeCode::operator> ( const AJATimeCode val) const

Definition at line 573 of file timecode.cpp.

◆ operator>() [2/2]

bool AJATimeCode::operator> ( const int32_t  val) const

Definition at line 579 of file timecode.cpp.

◆ QueryFrame()

uint32_t AJATimeCode::QueryFrame ( void  ) const

Query frame number.

Returns
frame number.

Definition at line 94 of file timecode.cpp.

◆ QueryHmsf()

void AJATimeCode::QueryHmsf ( uint32_t &  h,
uint32_t &  m,
uint32_t &  s,
uint32_t &  f,
const AJATimeBase timeBase,
bool  bDropFrame 
) const

Query hmsf values showing timecode for current frame count given the passed parameters.

Parameters
[out]hplace in which to put hours value.
[out]mplace in which to put minutes value.
[out]splace in which to put seconds value.
[out]fplace in which to put frames value.
[in]timeBaseframe rate from which to calculate string.
[in]bDropFramedrop frame value for string.

Definition at line 109 of file timecode.cpp.

◆ QueryIsDropFrame()

bool AJATimeCode::QueryIsDropFrame ( const std::string &  str)
static

Query string showing timecode for current frame count given the passed parameters.

Parameters
[in]strstring with timecode

Definition at line 81 of file timecode.cpp.

◆ QueryIsRP188DropFrame()

bool AJATimeCode::QueryIsRP188DropFrame ( const uint32_t  inDBB,
const uint32_t  inLo,
const uint32_t  inHi 
)
static

Query if rp188 data is drop frame or not

Parameters
[in]inDBBSpecifies the DBB bits of the RP188 struct.
[in]inLoSpecifies the lo-order 32-bit word of the RP188 struct.
[in]inHiSpecifies the hi-order 32-bit word of the RP188 struct.

Definition at line 449 of file timecode.cpp.

◆ QueryRP188() [1/2]

void AJATimeCode::QueryRP188 ( uint32_t &  outDBB,
uint32_t &  outLo,
uint32_t &  outHi,
const AJATimeBase timeBase,
const bool  bDrop 
)

Get RP188 register values using the given timebase, and drop frame.

Parameters
[out]outDBBReceives the DBB component.
[out]outLoReceives the low byte component.
[out]outHiReceives the high byte component.
[in]timeBaseSpecifies the AJATimeBase to use.
[in]bDropSpecify true if forcing drop-frame; otherwise false.
Bug:
Unimplemented.
Todo:
Needs to be implemented.

Definition at line 513 of file timecode.cpp.

◆ QueryRP188() [2/2]

void AJATimeCode::QueryRP188 ( uint32_t *  pDbb,
uint32_t *  pLow,
uint32_t *  pHigh,
const AJATimeBase timeBase,
bool  bDrop 
)

Get RP188 register values using the given timebase, and drop frame.

Parameters
[in]pDbbIf non-NULL, points to the variable to receive the DBB component.
[in]pLowIf non-NULL, points to the variable to receive the low byte component.
[in]pHighIf non-NULL, points to the variable to receive the high byte component.
[in]timeBaseSpecifies the AJATimeBase to use.
[in]bDropSpecify true if forcing drop-frame; otherwise false.
Bug:
Unimplemented.
Todo:
Needs to be implemented.

Definition at line 504 of file timecode.cpp.

◆ QuerySMPTEString()

void AJATimeCode::QuerySMPTEString ( char *  pString,
const AJATimeBase timeBase,
bool  bDropFrame 
)

Query SMPTE string showing timecode for current frame count given the passed parameters.

Parameters
[out]pStringbuffer in which to place string.
[in]timeBaseframe rate from which to calculate string.
[in]bDropFramedrop frame value for string.

Definition at line 261 of file timecode.cpp.

◆ QuerySMPTEStringSize()

int AJATimeCode::QuerySMPTEStringSize ( void  )
static

Query SMPTE string byte count.

Returns
number of bytes in SMPTE timecode string.

Definition at line 256 of file timecode.cpp.

◆ QueryStdTimecodeForHfr()

bool AJATimeCode::QueryStdTimecodeForHfr ( )
inline

Query HFR divide-by-two flag.

Returns
bStdTc Return true when using standard TC notation for HFR (e.g 01:00:00:59 -> 01:00:00:29*), set to true by default

Definition at line 67 of file timecode.h.

◆ QueryString() [1/2]

void AJATimeCode::QueryString ( char *  pString,
const AJATimeBase timeBase,
bool  bDropFrame 
)
Deprecated:
Use QueryString(std::string) instead.

Definition at line 248 of file timecode.cpp.

◆ QueryString() [2/2]

void AJATimeCode::QueryString ( std::string &  str,
const AJATimeBase timeBase,
bool  bDropFrame 
)

Query string showing timecode for current frame count given the passed parameters.

Parameters
[out]strstring in which to place timecode.
[in]timeBaseframe rate from which to calculate string.
[in]bDropFramedrop frame value for string.

Definition at line 225 of file timecode.cpp.

◆ QueryStringSize()

int AJATimeCode::QueryStringSize ( void  )
static
Deprecated:
Not needed when using std::string.

Definition at line 89 of file timecode.cpp.

◆ Set() [1/3]

void AJATimeCode::Set ( const std::string &  str,
const AJATimeBase timeBase 
)

Set current frame number.

Parameters
[in]strxx:xx:xx:xx style string representing new frame number.
[in]timeBaseframe rate associated with pString.

Definition at line 370 of file timecode.cpp.

◆ Set() [2/3]

void AJATimeCode::Set ( const std::string &  str,
const AJATimeBase timeBase,
bool  bDropFrame 
)

Set current frame number.

Parameters
[in]strxx:xx:xx:xx style string representing new frame number.
[in]timeBaseframe rate associated with pString.
[in]bDropFrametrue if forcing dropframe, false otherwise.

Definition at line 337 of file timecode.cpp.

◆ Set() [3/3]

void AJATimeCode::Set ( uint32_t  frame)

Set current frame number.

Parameters
[in]framenew frame number.

Definition at line 279 of file timecode.cpp.

◆ SetHmsf()

void AJATimeCode::SetHmsf ( uint32_t  h,
uint32_t  m,
uint32_t  s,
uint32_t  f,
const AJATimeBase timeBase,
bool  bDropFrame 
)

Set current frame number.

Parameters
[in]hhours value.
[in]mminutes value.
[in]sseconds value.
[in]fframes value.
[in]timeBaseframe rate associated with hmsf.
[in]bDropFrametrue if forcing dropframe, false otherwise.

Definition at line 284 of file timecode.cpp.

◆ SetRP188()

void AJATimeCode::SetRP188 ( const uint32_t  inDBB,
const uint32_t  inLo,
const uint32_t  inHi,
const AJATimeBase inTimeBase 
)

Set timecode via RP188 bytes.

Parameters
[in]inDBBSpecifies the DBB bits of the RP188 struct.
[in]inLoSpecifies the lo-order 32-bit word of the RP188 struct.
[in]inHiSpecifies the hi-order 32-bit word of the RP188 struct.
[in]inTimeBaseSpecifies the time base to use.

Definition at line 457 of file timecode.cpp.

◆ SetSMPTEString()

void AJATimeCode::SetSMPTEString ( const char *  pBufr,
const AJATimeBase timeBase 
)

Set timecode via a SMPTE string.

Parameters
[in]pBufrpointer to string.
[in]timeBasetime base associated with string.

Definition at line 435 of file timecode.cpp.

◆ SetStdTimecodeForHfr()

void AJATimeCode::SetStdTimecodeForHfr ( bool  bStdTc)
inline

Set HFR divide-by-two flag.

Parameters
[in]bStdTcSet true when using standard TC notation for HFR (e.g 01:00:00:59 -> 01:00:00:29*), set to true by default

Definition at line 175 of file timecode.h.

◆ SetWithCleanup()

void AJATimeCode::SetWithCleanup ( const std::string &  str,
const AJATimeBase timeBase,
bool  bDrop 
)

Set current frame number. A variant which may have junk in the string.

Parameters
[in]strxx:xx:xx:xx style string representing new frame number.
[in]timeBaseframe rate associated with pString.
[in]bDroptrue if drop frame

Definition at line 386 of file timecode.cpp.

Member Data Documentation

◆ m_frame

uint32_t AJATimeCode::m_frame

Definition at line 213 of file timecode.h.

◆ m_stdTimecodeForHfr

bool AJATimeCode::m_stdTimecodeForHfr

Definition at line 214 of file timecode.h.


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