Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Quantiser Class Referenceabstract

#include "lib/time/quantiser.hpp"

Description

Facility to create grid-aligned time values.

Effectively, a quantiser exposes the value Grid API, but additionally also manages a set of supported (display) formats or "time code" formats. Plus there is an static API to fetch a suitable quantiser instance by-name; actually this utilises a hidden link to the Lumiera session. Time quantisation and timecode handling explicitly relies on this Quantiser interface.

Definition at line 93 of file quantiser.hpp.

Static Public Member Functions

static PQuant retrieve (Symbol gridID)
 Access an existing grid definition or quantiser, known by the given symbolic ID.
 

Public Member Functions

template<class FMT >
bool supports () const
 
TimeValue materialise (TimeValue const &raw) const
 convenience shortcut: materialise a raw time value based on this grid or time axis, but returning a raw time value.
 
virtual FrameCnt gridPoint (TimeValue const &raw) const =0
 
virtual Offset gridLocal (TimeValue const &raw) const =0
 
virtual TimeValue timeOf (FrameCnt gridPoint) const =0
 
virtual TimeValue timeOf (FSecs, int=0) const =0
 
- Public Member Functions inherited from Grid
virtual ~Grid ()
 this is an Interface
 

Protected Member Functions

 Quantiser ()
 

Protected Attributes

format::Supported supportedFormats_
 

Constructor & Destructor Documentation

◆ Quantiser()

Quantiser ( )
inlineprotected

Definition at line 99 of file quantiser.hpp.

Member Function Documentation

◆ supports()

template<class FMT >
bool supports ( ) const
inline

Definition at line 106 of file quantiser.hpp.

References Supported::check(), and Quantiser::supportedFormats_.

+ Here is the call graph for this function:

◆ retrieve()

PQuant retrieve ( Symbol  gridID)
static

Access an existing grid definition or quantiser, known by the given symbolic ID.

Note
defined in common-services.cpp

Typically this fetches a meta::TimeGrid (asset) from the session.

Exceptions
error::Logicif the given gridID wasn't registered
Returns
smart-ptr to the quantiser instance

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

Referenced by TimeFormats_test::checkTimecodeUsageCycle(), TimeMutation_test::mutate_by_Increment(), Mutation::nudge(), and FrameNr::quant().

+ Here is the caller graph for this function:

◆ materialise()

TimeValue materialise ( TimeValue const &  raw) const

convenience shortcut: materialise a raw time value based on this grid or time axis, but returning a raw time value.

Implemented as combination of the gridPoint and timeOf operations, i.e. we quantise into this scale, but transform the result back onto the global raw time value scale.

Warning
this operation incurs information loss. Values may be rounded and / or clipped, according to the grid used. And, contrary to a QuTime value, the information about the actual grid is discarded. Please resist the temptation to abuse this operation to "just get a simple number", without understanding what quantisation means!

Definition at line 157 of file quantiser.cpp.

References Quantiser::gridPoint(), and Quantiser::timeOf().

+ Here is the call graph for this function:

◆ gridPoint()

virtual FrameCnt gridPoint ( TimeValue const &  raw) const
pure virtual

Implements Grid.

Implemented in FixedFrameQuantiser.

Referenced by Quantiser::materialise().

+ Here is the caller graph for this function:

◆ gridLocal()

virtual Offset gridLocal ( TimeValue const &  raw) const
pure virtual

Implements Grid.

Implemented in FixedFrameQuantiser.

◆ timeOf() [1/2]

virtual TimeValue timeOf ( FrameCnt  gridPoint) const
pure virtual

Implements Grid.

Implemented in FixedFrameQuantiser.

Referenced by Quantiser::materialise().

+ Here is the caller graph for this function:

◆ timeOf() [2/2]

virtual TimeValue timeOf ( FSecs  ,
int  = 0 
) const
pure virtual

Implements Grid.

Implemented in FixedFrameQuantiser.

Member Data Documentation

◆ supportedFormats_

format::Supported supportedFormats_
protected

Definition at line 97 of file quantiser.hpp.

Referenced by Quantiser::supports().

+ Inheritance diagram for Quantiser:
+ Collaboration diagram for Quantiser:

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