Lumiera  0.pre.03
»edit your freedom«
timequant.hpp File Reference

Go to the source code of this file.

Description

Support library to represent grid-aligned time specifications This is part of Lumiera's time and time code handling framework.

The QuTime entity represents the link between the internal precise time specifications and external representation formatted according to some well established time code format: QuTime both holds a precise internal time::TimeValue entry, plus a reference to the time grid to be used, when it comes to quantising (grid-aligning) those values. And it offers a dedicated API to "materialise" this (still complete and precise) time value into an external representation.

Collaborations

lib::time::Time is the ubiquitous yet opaque internal time "instant" used in Lumiera to designate time points (and by extension also a TimeSpan). What such an internal time instant actually means, depends on the context, yet it is the implementation's (not the user's) responsibility to keep that meaning straight.

However, by creating a Quantised Time, the association to some time scale or time grid is made explicit; the time value within QuTime is stored in full precision though, without performing any "rounding" yet.

Only by building or casting into a time code, the actual quantisation is performed, which means to align the time value to the next grid point and discard excess timing information. There are several time formats available to choose from, like Hour-Minute-Second, or SMPTE (h-m-s + frame) or fractional seconds or just a frame count with implicit frame rate.

How the quantisation or grid alignment is actually performed is up to the discretion of the lib::time::Quantiser; an actually Quantiser instance also represents a common notion of some specific time grid, together with a usage context. Notably, a "25 fps grid" means to start timing when the playback starts, and to proceed in steps of 1/25sec. Conceptually (not-yet-implemented as of 11/2022) a frame grid could also imply to anchor the time at some global time zone, allowing to integrate live content into the timeline – and the actual link to wall-clock time would be made explicit by some placement somewhere on the actual timeline.

Definition in file timequant.hpp.

#include "lib/time/timevalue.hpp"
#include "lib/time/quantiser.hpp"
#include "lib/time/timecode.hpp"
#include "lib/symbol.hpp"
#include <string>

Classes

class  QuTime
 grid aligned time specification, referring to a specific scale. More...
 

Namespaces

 lib
 Implementation namespace for support and library code.