Lumiera  0.pre.03
»edit your freedom«
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 void applyRangeLimitStrategy (SmpteTC &)
 handle the limits of SMPTE timecode range. More...
 
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. More...
 
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.
 

Additional Inherited Members

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

Member Function Documentation

◆ 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 203 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 233 of file timecode.cpp.

References SmpteTC::invertOrientation().

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

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