Lumiera  0.pre.03
»edit your freedom«
QuTime Class Reference

#include "lib/time/timequant.hpp"

Description

grid aligned time specification, referring to a specific scale.

A quantised time value allows to access the time specification as numeric value in one of the supported timecode formats, and relative to the defined time scale. Usually this time scale exists already in the Lumiera session and is referred simply by symbolic ID, it will be fetched on demand through the advice system.

By creating a QuTime value, the relation to such a predefined time scale is made explicit. This doesn't change the internal time value, but the actual creation of a timecode formatted value (formatAs) usually implies to quantise or grid align the time to the frame grid specific to this time scale.

Definition at line 90 of file timequant.hpp.

Public Member Functions

 QuTime (TimeValue raw, Symbol gridID)
 build a quantised time value, referring the time grid by-name. More...
 
 QuTime (TimeValue raw, PQuant quantisation_to_use)
 build a quantised time value by explicitly specifying a grid alignment facility and without any hidden reference to the Lumiera session. More...
 
void accept (Mutation const &)
 receive change message, which might cause re-quantisation
 
template<class TC >
void castInto (TC &timecode) const
 quantise into implicit grid, then rebuild the timecode More...
 
template<class FMT >
format::Traits< FMT >::TimeCode formatAs () const
 create new time code instance, then castInto
 
 operator PQuant () const
 
template<class FMT >
bool supports () const
 does our implicit time grid support building that timecode format?
 
- Public Member Functions inherited from Time
 Time (TimeValue const &val=TimeValue(0))
 
 Time (TimeVar const &calcResult)
 
 Time (FSecs const &fractionalSeconds)
 convenience constructor to build an Time value from a fraction of seconds, given as rational number. More...
 
 Time (long millis, uint secs, uint mins=0, uint hours=0)
 convenience constructor to build an internal Lumiera Time value from the usual parts of an sexagesimal time specification. More...
 
 operator std::string () const
 
TimeVar operator+ (TimeValue const &tval) const
 convenience start for time calculations
 
TimeVar operator- (TimeValue const &tval) const
 
TimeVar operator- () 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
 

Private Attributes

PQuant quantiser_
 

Additional Inherited Members

- Static Public Member Functions inherited from TimeValue
static TimeValue buildRaw_ (gavl_time_t)
 
- Static Public Attributes inherited from Time
static const Time ANYTIME
 border condition marker value. ANYTIME <= any time value
 
static const Time MAX
 
static const Time MIN
 
static const Time NEVER
 border condition marker value. NEVER >= any time value
 
static const Time 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 inherited from TimeValue
 TimeValue (TimeValue const &origin, TimeValue const &target)
 
TimeValueoperator= (TimeValue const &o)
 Assigning of time values is not allowed, but derived classed might allow that.
 
- 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
 

Constructor & Destructor Documentation

◆ QuTime() [1/2]

QuTime ( TimeValue  raw,
Symbol  gridID 
)

build a quantised time value, referring the time grid by-name.

Note
defined in common-services.cpp

This is the preferred standard way of establishing a quantisation, but it requires an existing time scale defined in the Lumiera Session, as TimeGrid (meta asset). Usually, such a time scale gets built based on the format and parameters of an output bus.

Definition at line 85 of file common-services.cpp.

◆ QuTime() [2/2]

QuTime ( TimeValue  raw,
PQuant  quantisation_to_use 
)

build a quantised time value by explicitly specifying a grid alignment facility and without any hidden reference to the Lumiera session.

This is mainly intended for debugging and unit testing.

Definition at line 64 of file quantiser.cpp.

Member Function Documentation

◆ operator PQuant()

operator PQuant ( ) const
inline
Returns
shared-ptr to the associated time grid (or time scale)

Definition at line 122 of file timequant.hpp.

◆ castInto()

void castInto ( TC &  timecode) const
inline

quantise into implicit grid, then rebuild the timecode

Template Parameters
TCthe kind of time code to use as target
Parameters
timecodeexisting instance of that timecode, to be overwritten
Remarks
this is the basic operation to convert an (internal) time value into a time code format. QuTime is already associated with some time grid for quantisation, but the internal value is precise. This operation creates a quantised (frame aligned) transient copy, and uses this to adjust/modify the fields in the given timecode.

Definition at line 156 of file timequant.hpp.

References TimeValue::TimeValue().

+ Here is the call graph for this function:
+ Inheritance diagram for QuTime:
+ Collaboration diagram for QuTime:

The documentation for this class was generated from the following files: