30#ifndef LIB_TIME_QUANTISER_H
31#define LIB_TIME_QUANTISER_H
52 template<
typename NUM>
58 static int asInt (
int val) {
return val; }
59 static double asDouble (
int val) {
return val; }
65 static int asInt (
double val) {
return std::floor(0.5+val); }
66 static double asDouble (
double val) {
return val; }
Token or Atom with distinct identity.
Duration is the internal Lumiera time metric.
Simple stand-alone Quantiser implementation based on a constant sized gird.
FrameCnt gridPoint(TimeValue const &) const override
grid quantisation (alignment).
Offset gridLocal(TimeValue const &) const override
transform into the local time scale grid aligned.
TimeValue timeOf(FrameCnt gridPoint) const override
calculate time value of a grid interval (frame) start point
static int64_t grid_aligned(TimeValue const &, TimeValue const &)
Quantise the given time into a fixed grid, relative to the origin.
Framerate specified as frames per second.
Abstraction of a value alignment grid.
Offset measures a distance in time.
Facility to create grid-aligned time values.
TimeValue materialise(TimeValue const &raw) const
convenience shortcut: materialise a raw time value based on this grid or time axis,...
virtual TimeValue timeOf(FSecs, int=0) const =0
virtual TimeValue timeOf(FrameCnt gridPoint) const =0
virtual Offset gridLocal(TimeValue const &raw) const =0
static PQuant retrieve(Symbol gridID)
Access an existing grid definition or quantiser, known by the given symbolic ID.
virtual FrameCnt gridPoint(TimeValue const &raw) const =0
format::Supported supportedFormats_
basic constant internal time value.
Lumiera's internal time value datatype.
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Lumiera error handling (C++ interface).
definition of a time grid abstraction for time and timecode handling.
Helper template(s) for creating Lumiera Forward Iterators.
int64_t FrameCnt
relative framecount or frame number.
PQuant getDefaultGridFallback()
std::shared_ptr< const Quantiser > PQuant
boost::rational< int64_t > FSecs
rational representation of fractional seconds
Implementation namespace for support and library code.
static int asInt(double val)
in accordance with Lumiera's time handling RfC
static double asDouble(double val)
static int asInt(int val)
static double asDouble(int val)
a family of time value like entities and their relationships.