Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/time/timevalue.hpp"
Offset measures a distance in time.
It may be used to relate two points in time, or to create a modification for time-like entities. Similar to (basic) time values, offsets can be compared, but are otherwise opaque and immutable. Yet they allow to build derived values, including
Definition at line 367 of file timevalue.hpp.
Public Member Functions | |
Offset (TimeValue const &distance=Time::ZERO) | |
Offset (FSecs const &delta_in_secs) | |
Offset (FrameCnt count, FrameRate const &fps) | |
offset by the given number of frames. More... | |
Offset (TimeValue const &origin, TimeValue const &target) | |
Duration | abs () const |
interpret the distance given by this offset as a time duration | |
operator std::string () const | |
Offset | operator- () const |
flip offset direction | |
Offset | stretchedByFloatFactor (double) const |
Offset | stretchedByRationalFactor (boost::rational< int64_t >) const |
Public Member Functions inherited from TimeValue | |
TimeValue (gavl_time_t val) | |
TimeValue (TimeValue const &o) | |
copy initialisation allowed | |
bool | isRegular () const |
operator std::string () const | |
Static Public Attributes | |
static const Offset | ZERO |
Static Public Attributes inherited from TimeValue | |
static const gavl_time_t | SCALE = GAVL_TIME_SCALE |
Number of micro ticks (µs) per second as basic time scale. | |
Protected Member Functions | |
Offset & | operator= (Offset const &o) |
generally immutable, but derived classes allow some limited mutation through special API calls | |
Protected Member Functions inherited from TimeValue | |
TimeValue (TimeValue const &origin, TimeValue const &target) | |
TimeValue & | operator= (TimeValue const &o) |
Assigning of time values is not allowed, but derived classed might allow that. | |
Additional Inherited Members | |
Static Public Member Functions inherited from TimeValue | |
static TimeValue | buildRaw_ (gavl_time_t) |
Static Protected Member Functions inherited from TimeValue | |
static gavl_time_t | limitedDelta (gavl_time_t origin, gavl_time_t target) |
safe calculation of explicitly limited time offset | |
static gavl_time_t | limitedTime (gavl_time_t raw) |
explicit limit of allowed time range More... | |
Protected Attributes inherited from TimeValue | |
gavl_time_t | t_ |
the raw (internal) time value used to implement the time types | |
offset by the given number of frames.
Definition at line 355 of file time.cpp.
References TimeValue::_raw, Offset::abs(), TimeValue::buildRaw_(), lumiera_framecount_to_time(), Time::MAX, Duration::MAX, and Duration::NIL.
Offset stretchedByRationalFactor | ( | boost::rational< int64_t > | factor | ) | const |
stretch offset by a possibly fractional factor, and quantise into raw (micro tick) grid
Definition at line 334 of file time.cpp.
References TimeValue::buildRaw_(), and TimeValue::t_.
Offset stretchedByFloatFactor | ( | double | factor | ) | const |
2^52 ≈ 4.5e15
Definition at line 345 of file time.cpp.
References TimeValue::buildRaw_(), and TimeValue::t_.
operator std::string | ( | ) | const |
diagnostics, indicating ∆