Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
time.cpp File Reference

Lumiera time handling core implementation unit. More...

Go to the source code of this file.

Description

Lumiera time handling core implementation unit.

This translation unit generates code for the Lumiera internal time wrapper, based on 64bit integral µ-tick values, associated constants, marker classes for the derived time entities (TimeVar, Offset, Duration, TimeSpan, FrameRate) and for the basic time and frame rate conversion functions.

Client code includes either timevalue.hpp (for the time entities), or timequant.hpp for grid aligned time values, or timecode.hpp.

See also
Time
TimeValue
Grid
TimeValue_test
QuantiserBasics_test

Definition in file time.cpp.

#include "lib/error.hpp"
#include "lib/rational.hpp"
#include "lib/time/timevalue.hpp"
#include "lib/format-string.hpp"
#include "lib/util-quant.hpp"
#include "lib/util.hpp"
#include <limits>
#include <string>
#include <sstream>
#include <boost/rational.hpp>
#include <boost/lexical_cast.hpp>

Namespaces

namespace  lib
 Implementation namespace for support and library code.
 
namespace  lib::meta
 
namespace  lib::time
 
namespace  lib::time::anonymous_namespace{time.cpp}
 
namespace  util
 

Functions

const raw_time_64 TIME_SCALE_MS (lib::time::TimeValue::SCALE/1000)
 scale factor used locally within this implementation header.
 
raw_time_64 build_time_from (FSecs const &fractionalSeconds)
 Converts a fraction of seconds to Lumiera's internal opaque time scale.
 
raw_time_64 build_time_from (long millis, uint secs, uint mins, uint hours)
 
template<typename RAT >
string renderFraction (RAT const &frac, Literal postfx) noexcept
 
boost::rational< uint__framerate_approximation (double fps)
 
boost::rational< uint__framerate_approximation (size_t cnt, Duration timeReference)
 
raw_time_64 framecount_to_time (uint64_t frameCount, FrameRate const &fps)
 

Variables

const FSecs FSEC_MAX {std::numeric_limits<int64_t>::max() / lib::time::TimeValue::SCALE}
 
Literal DIAGNOSTIC_FORMAT {"%s%01d:%02d:%02d.%03d"}
 
const uint RATE_LIMIT {std::numeric_limits<uint>::max() / 1024}
 a rather arbitrary safety limit imposed on internal numbers used to represent a frame rate.