Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
lib::time::anonymous_namespace{time.cpp} Namespace Reference

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
 
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"}
 

Function Documentation

◆ TIME_SCALE_MS()

const raw_time_64 TIME_SCALE_MS ( lib::time::TimeValue::SCALE 1000)

scale factor used locally within this implementation header.

TimeValue::SCALE (µ-ticks, i.e. 1e6) is the correct factor or dividend when using raw_time_64 for display on a scale with seconds. Since we want to use milliseconds, we need a factor of 1000 to get correct results.

References TIME_SCALE_MS().

Referenced by build_time_from(), and TIME_SCALE_MS().

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

◆ build_time_from() [1/2]

raw_time_64 build_time_from ( FSecs const &  fractionalSeconds)

Converts a fraction of seconds to Lumiera's internal opaque time scale.

Parameters
fractionalSecondsgiven as rational number
Note
inconsistent with Lumiera's general quantisation behaviour, here negative fractional micro-ticks are truncated towards zero. This was deemed irrelevant in practice.
Todo:
2022 this utility function could be factored out into a FSecs or RSec class /////////////////TICKET #1262

Definition at line 107 of file time.cpp.

References build_time_from(), util::reQuant(), and TimeValue::SCALE.

Referenced by build_time_from(), and build_time_from().

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

◆ build_time_from() [2/2]

raw_time_64 build_time_from ( long  millis,
uint  secs,
uint  mins,
uint  hours 
)

Definition at line 122 of file time.cpp.

References build_time_from(), and TIME_SCALE_MS().

+ Here is the call graph for this function:

◆ renderFraction()

template<typename RAT >
string renderFraction ( RAT const &  frac,
Literal  postfx 
)
noexcept

Definition at line 244 of file time.cpp.

References renderFraction().

Referenced by renderFraction().

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

◆ framecount_to_time()

raw_time_64 framecount_to_time ( uint64_t  frameCount,
FrameRate const &  fps 
)

Definition at line 379 of file time.cpp.

References framecount_to_time(), and TimeValue::SCALE.

Referenced by framecount_to_time().

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

Variable Documentation

◆ FSEC_MAX

const FSecs FSEC_MAX {std::numeric_limits<int64_t>::max() / lib::time::TimeValue::SCALE}

Definition at line 93 of file time.cpp.

◆ DIAGNOSTIC_FORMAT

Literal DIAGNOSTIC_FORMAT {"%s%01d:%02d:%02d.%03d"}

Definition at line 95 of file time.cpp.