Lumiera  0.pre.03
»edit your freedom«
stage::model::anonymous_namespace{zoom-window.hpp} Namespace Reference

Functions

FSecs _FSecs (TimeValue const &timeVal)
 
double approx (Rat r)
 
bool isMicroGridAligned (FSecs duration)
 
TimeVar operator+ (Time const &tval, TimeVar const &tvar)
 
TimeVar operator- (Time const &tval, TimeVar const &tvar)
 
int toxicDegree (Rat poison, const int64_t THRESHOLD=HAZARD_DEGREE)
 

Variables

const FSecs DEFAULT_CANVAS {23}
 
const Rat DEFAULT_METRIC {25}
 
const int64_t HAZARD_DEGREE {util::ilog2(LIM_HAZARD)}
 
const int64_t LIM_HAZARD {int64_t{1} << 40 }
 Maximum quantiser to be handled in fractional arithmetics without hazard. More...
 
const uint MAX_PX_WIDTH {100000}
 
const FSecs MAX_TIMESPAN {_FSecs(Duration::MAX)}
 
const int64_t MAXDIM {util::ilog2 (std::numeric_limits<int64_t>::max())}
 
const FSecs MICRO_TICK {1_r/Time::SCALE}
 

Function Documentation

◆ _FSecs()

FSecs stage::model::anonymous_namespace{zoom-window.hpp}::_FSecs ( TimeValue const &  timeVal)
inline
Todo:
preliminary helper to enter into fractional integer calculations
  • FSecs (maybe better called RSec) should be a light-weight wrapper on top of util::Rat = boost::rational<int64_t>
  • a conversion function like in TimeVar should be in the base type
  • however, cross conversion from raw int64_t should be prohibited to avoid ill-guided automatic conversions from µ-tick to seconds

Definition at line 135 of file zoom-window.hpp.

References TimeValue::SCALE.

Referenced by ZoomWindow::expandVisibleRange(), and ZoomWindow::setVisibleDuration().

+ Here is the caller graph for this function:

◆ isMicroGridAligned()

bool stage::model::anonymous_namespace{zoom-window.hpp}::isMicroGridAligned ( FSecs  duration)
inline
Returns
true if the given duration can be represented cleanly as µ-ticks.
Remarks
decision can be broken down to the remainder term: n/d = i + r/d; when expanding with *u/u, result is clean if u/d is non-fractional.
Todo:
should likewise be member of a FSecs wrapper type...

Definition at line 147 of file zoom-window.hpp.

References TimeValue::SCALE.

◆ operator+()

TimeVar stage::model::anonymous_namespace{zoom-window.hpp}::operator+ ( Time const &  tval,
TimeVar const &  tvar 
)
inline
Todo:
we need these only because the blurry distinction between lib::time::TimeValue and lib::time::Time, which in turn is caused by a lack of clarity in the fundamental conception (see #1261)

Definition at line 164 of file zoom-window.hpp.

Variable Documentation

◆ LIM_HAZARD

const int64_t LIM_HAZARD {int64_t{1} << 40 }

Maximum quantiser to be handled in fractional arithmetics without hazard.

Remarks
due to the common divisor normalisation, and the typical time computations, DENOMINATOR * Time::Scale has to stay below INT_MAX, with some safety margin

Definition at line 190 of file zoom-window.hpp.

Referenced by ZoomWindow_test::safeguard_verySmall().