27#include <boost/lexical_cast.hpp>
30using boost::lexical_cast;
45 if (isnil (arg))
return "";
46 string entry = arg[0];
47 arg.erase (arg.begin());
70 return lexical_cast<raw_time_64> (arg);
84 ,
quant(o,
"test_grid")
96 CHECK (o != c,
"unsuitable testdata");
101 QuTime qChange (c,
"test_grid");
126 CHECK (t.
quant == original);
128 CHECK (t.
quant != original);
129 CHECK (t.
quant == newStart);
135 CHECK (t.
dur == original);
137 CHECK (t.
dur != original);
158 CHECK (t.
span == original);
159 CHECK (t.
span != should_be);
161 CHECK (t.
span == should_be);
164 CHECK (t.
dur == should_be);
167 CHECK (t.
quant == should_be);
172 CHECK (t.
span == original);
176 CHECK (t.
span ==
Time(original) - 3*change);
187 CHECK (t.
span == original);
189 CHECK (t.
span != original);
195 Time materialised (quantiser->materialise(change));
196 CHECK (t.
span == materialised);
202 CHECK (t.
quant == original);
204 CHECK (t.
quant != original);
205 CHECK (t.
quant == materialised);
213 QuTime funny (original,
"special_funny_grid");
215 CHECK (funny == t.
quant);
217 Time doublyQuantised (
PQuant(funny)->materialise(funny));
218 CHECK (doublyQuantised != materialised);
243 Offset distance (testGrid->timeOf(0), testGrid->timeOf(change));
245 CHECK (t.
dur - t.
var == distance);
253 CHECK (t.
quant != original);
255 CHECK (frameNr_after == frameNr + change);
Template to build polymorphic value objects.
Duration is the internal Lumiera time metric.
void accept(Mutation const &)
A frame counting timecode value.
Duration duration() const
duration of one frame
static const FrameRate PAL
predefined constant for PAL framerate
static EncapsulatedMutation changeDuration(Duration)
Convenience factory: simple Mutation to adjust the duration or length of a timespan.
static EncapsulatedMutation materialise(QuTime const &)
Convenience factory: materialise the given quantised time into an explicit fixed internal time value,...
static EncapsulatedMutation nudge(int adjustment)
build a time mutation to nudge the target time value by an offset, defined as number of steps on an i...
static EncapsulatedMutation adjust(Offset)
Convenience factory: simple Mutation to adjust the duration or length of a timespan.
static EncapsulatedMutation changeTime(Time)
Convenience factory to yield a simple Mutation changing the absolute start time.
Offset measures a distance in time.
grid aligned time specification, referring to a specific scale.
void accept(Mutation const &)
receive change message, which might cause re-quantisation
format::Traits< FMT >::TimeCode formatAs() const
create new time code instance, then castInto
static PQuant retrieve(Symbol gridID)
Access an existing grid definition or quantiser, known by the given symbolic ID.
A time interval anchored at a specific point in time.
void accept(Mutation const &)
may change start / duration
basic constant internal time value.
static const raw_time_64 SCALE
Number of micro ticks (µs) per second as basic time scale.
a mutable time value, behaving like a plain number, allowing copy and re-accessing
Lumiera's internal time value datatype.
void mutate_quantised(TimeValue original, QuTime change)
void mutate_by_Increment(TimeValue original, int change)
void mutate_by_Value(TimeValue original, Time newStart)
virtual void run(Arg arg)
void mutate_by_Offset(TimeValue original, Offset change)
raw_time_64 random_or_get(string arg)
Modifying time and timecode values.
std::shared_ptr< const Quantiser > PQuant
int64_t raw_time_64
Raw µ-tick time representation used in Lumiera.
boost::rational< int64_t > FSecs
rational representation of fractional seconds
Implementation namespace for support and library code.
int rani(uint bound=_iBOUND())
Test runner and basic definitions for tests.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A collection of frequently used helper functions to support unit testing.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
To establish a reference scale for quantised time values.
Support library to represent grid-aligned time specifications This is part of Lumiera's time and time...
a family of time value like entities and their relationships.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...