Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Smpte Struct Reference

#include "lib/time/formats.hpp"

Description

Widely used standard media timecode format.

A SMPTE timestamp addresses individual frames, by specifying time as hour-minute-second plus the frame number within the actual second.

Definition at line 90 of file formats.hpp.

Static Public Member Functions

static TimeValue parse (string const &, QuantR)
 
static void rebuild (SmpteTC &, QuantR, TimeValue const &)
 build up a SMPTE timecode by quantising the given time value and then splitting it into hours, minutes, seconds and frame offset.
 
static TimeValue evaluate (SmpteTC const &, QuantR)
 calculate the time point denoted by this SMPTE timecode, by summing up the timecode's components
 
static uint getFramerate (QuantR, TimeValue const &)
 yield the Framerate in effect at that point.
 
static void applyRangeLimitStrategy (SmpteTC &)
 handle the limits of SMPTE timecode range.
 

Additional Inherited Members

- Public Member Functions inherited from NoInstance< X >
 NoInstance ()
 
 NoInstance (NoInstance const &)
 

Member Function Documentation

◆ parse()

TimeValue parse ( string const &  ,
QuantR   
)
static

Definition at line 77 of file timecode.cpp.

◆ rebuild()

void rebuild ( SmpteTC tc,
QuantR  quantiser,
TimeValue const &  rawTime 
)
static

build up a SMPTE timecode by quantising the given time value and then splitting it into hours, minutes, seconds and frame offset.

Definition at line 168 of file timecode.cpp.

References SmpteTC::clear(), and SmpteTC::frames.

Referenced by SmpteTC::rebuild().

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

◆ evaluate()

TimeValue evaluate ( SmpteTC const &  tc,
QuantR  quantiser 
)
static

calculate the time point denoted by this SMPTE timecode, by summing up the timecode's components

Definition at line 178 of file timecode.cpp.

References SmpteTC::frames, SmpteTC::getFps(), SmpteTC::hours, SmpteTC::mins, SmpteTC::secs, and SmpteTC::sgn.

Referenced by SmpteTC::rebuild(), and SmpteTC::value().

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

◆ getFramerate()

uint getFramerate ( QuantR  quantiser_,
TimeValue const &  rawTime 
)
static

yield the Framerate in effect at that point.

Especially Timecode in SMPTE format exposes a "frames" field to contain the remainder of frames in addition to the h:m:s value. Obviously this value has to be kept below the number of frames for a full second and wrap around accordingly.

Note
SMPTE format assumes this framerate to be constant. Actually, in this implementation the value returned here neither needs to be constant (independent of the given rawTime), nor does it need to be the actual framerate used by the quantiser. Especially in case of NTSC drop-frame, the timecode uses 30fps here, while the quantisation uses 29.97
Todo:
this design just doesn't feel quite right...

Definition at line 202 of file timecode.cpp.

◆ applyRangeLimitStrategy()

void applyRangeLimitStrategy ( SmpteTC tc)
static

handle the limits of SMPTE timecode range.

This is an extension and configuration point to control how to handle values beyond the official SMPTE timecode range of 0:0:0:0 to 23:59:59:##. When this strategy function is invoked, the frames, seconds, minutes and hours fields have already been processed and stored into the component digxels, under the assumption the overall value stays in range.

Note
currently the range is extended "naturally" (i.e. mathematically). The representation is flipped around the zero point and the value of the hours is just allowed to increase beyond 23
Todo:
If necessary, this extension point should be converted into a configurable strategy. Possible variations
  • clip values beyond the boundaries
  • throw an exception on illegal values
  • wrap around from 23:59:59:## to 0:0:0:0
  • just make the hour negative, but continue with the same orientation (0:0:0:0 - 1sec = -1:59:59:0)

Definition at line 232 of file timecode.cpp.

References SmpteTC::hours, and SmpteTC::invertOrientation().

Referenced by lib::time::anonymous_namespace{timecode.cpp}::wrapHours().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Inheritance diagram for Smpte:
+ Collaboration diagram for Smpte:

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