Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
SmpteTC Class Reference

#include "lib/time/timecode.hpp"

Description

Classical Timecode value reminiscent to SMPTE format.

After quantisation, the resulting (materialised) time value is decimated into a hours, a minutes, a seconds part and the remainder is cast into a frame number relative to the seconds. Consequently, a SmpteTC representation is always linked implicitly to a specific framerate.

range extensions
Historically, SMPTE timecode format was focused mainly on how to encode a unique timestamp in a way allowing to 'piggyback' these timestamps into an existing (analogue) media data format. As a side effect, quite tight limits had to be imposed on the possible component values in such a fixed-length format. This whole concern is completely beyond the scope of a typical computer based video implementation; thus we can consider ways to extend the value range to be represented in this SMPTE-like timecode format:
  • we can allow time values below the zero point
  • we can allow time values beyond 24 hours. Several different schemes how to do this extensions could be devised (and in addition, we could also wrap around the hours field, jumping from 23:59:59:## to 0:0:0:0). Currently, we implement an extension, where the timecode representation is symmetrical to the zero point and the hours field is just extended beyond 23 hours. To give an example: 0:0:0:0 minus 1 frame yields -0:0:0:1
Todo:
the range extension scheme could be a configurable strategy

Definition at line 144 of file timecode.hpp.

Public Types

using Format = format::Smpte
 

Public Attributes

HourDigit hours
 
SexaDigit mins
 
SexaDigit secs
 
SexaDigit frames
 
Signum sgn
 

Public Member Functions

 SmpteTC (QuTime const &quantisedTime)
 
 SmpteTC (SmpteTC const &)
 
SmpteTCoperator= (SmpteTC const &)
 
uint getFps () const
 
void clear ()
 
void rebuild ()
 
void invertOrientation ()
 flip the orientation of min, sec, and frames.
 
SmpteTCoperator++ ()
 
SmpteTCoperator-- ()
 
- Public Member Functions inherited from TCode
virtual ~TCode ()
 
 operator string () const
 
string describe () const
 
Time getTime () const
 

Private Member Functions

virtual string show () const
 
virtual Literal tcID () const
 
virtual TimeValue value () const
 

Private Attributes

uint effectiveFramerate_
 

Additional Inherited Members

- Protected Member Functions inherited from TCode
 TCode (PQuant const &quant)
 
- Protected Attributes inherited from TCode
PQuant quantiser_
 

Constructor & Destructor Documentation

◆ SmpteTC() [1/2]

SmpteTC ( QuTime const &  quantisedTime)

Definition at line 303 of file timecode.cpp.

References QuTime::castInto().

+ Here is the call graph for this function:

◆ SmpteTC() [2/2]

SmpteTC ( SmpteTC const &  o)

Definition at line 312 of file timecode.cpp.

References SmpteTC::frames, SmpteTC::hours, SmpteTC::mins, SmpteTC::secs, and SmpteTC::sgn.

Member Typedef Documentation

◆ Format

Definition at line 156 of file timecode.hpp.

Member Function Documentation

◆ show()

string show ( ) const
privatevirtual

Implements TCode.

Definition at line 416 of file timecode.cpp.

References SmpteTC::frames, SmpteTC::hours, SmpteTC::mins, SmpteTC::secs, SmpteTC::sgn, and Digxel< NUM, FMT >::show().

+ Here is the call graph for this function:

◆ tcID()

virtual Literal tcID ( ) const
inlineprivatevirtual

Implements TCode.

Definition at line 151 of file timecode.hpp.

◆ value()

virtual TimeValue value ( ) const
inlineprivatevirtual

Implements TCode.

Definition at line 152 of file timecode.hpp.

References Smpte::evaluate(), and TCode::quantiser_.

+ Here is the call graph for this function:

◆ operator=()

SmpteTC & operator= ( SmpteTC const &  o)

◆ getFps()

uint getFps ( ) const

Definition at line 409 of file timecode.cpp.

References SmpteTC::effectiveFramerate_.

Referenced by Smpte::evaluate(), SmpteTC::invertOrientation(), and lib::time::anonymous_namespace{timecode.cpp}::wrapFrames().

+ Here is the caller graph for this function:

◆ clear()

void clear ( )

Definition at line 358 of file timecode.cpp.

References SmpteTC::frames, SmpteTC::hours, SmpteTC::mins, SmpteTC::secs, Digxel< NUM, FMT >::setValueRaw(), and SmpteTC::sgn.

Referenced by Smpte::rebuild().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rebuild()

void rebuild ( )

Definition at line 369 of file timecode.cpp.

References Smpte::evaluate(), TCode::quantiser_, and Smpte::rebuild().

Referenced by TimeFormats_test::checkSmpte().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ invertOrientation()

void invertOrientation ( )

flip the orientation of min, sec, and frames.

Besides changing the sign, this will flip the meaning of the component fields, which by definition are always oriented towards zero.

Normalised value fields are defined positive, with automatic overflow to next higher field. This might cause the hours to become negative. When invoked in this case, the meaning changes from -h + (m+s+f) to -(h+m+s+f)

Definition at line 388 of file timecode.cpp.

References SmpteTC::frames, SmpteTC::getFps(), SmpteTC::hours, SmpteTC::mins, SmpteTC::secs, Digxel< NUM, FMT >::setValueRaw(), and SmpteTC::sgn.

Referenced by Smpte::applyRangeLimitStrategy(), and TimeFormats_test::checkSmpte().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator++()

SmpteTC & operator++ ( )

Definition at line 432 of file timecode.cpp.

References SmpteTC::frames, and SmpteTC::sgn.

◆ operator--()

SmpteTC & operator-- ( )

Definition at line 439 of file timecode.cpp.

References SmpteTC::frames, and SmpteTC::sgn.

Member Data Documentation

◆ effectiveFramerate_

uint effectiveFramerate_
private

Definition at line 148 of file timecode.hpp.

Referenced by SmpteTC::getFps(), and SmpteTC::operator=().

◆ hours

◆ mins

◆ secs

◆ frames

◆ sgn

+ Inheritance diagram for SmpteTC:
+ Collaboration diagram for SmpteTC:

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