Lumiera  0.pre.03
»edit your freedom«
Mutation Class Referenceabstract

#include "lib/time/mutation.hpp"

Description

Interface: an opaque change imposed onto some time value.

See also
time::TimeSpan::accept(Mutation const&)
TimeMutation_test
polymorphic-value.hpp

Definition at line 100 of file mutation.hpp.

Public Member Functions

virtual void change (Duration &) const =0
 
virtual void change (TimeSpan &) const =0
 
virtual void change (QuTime &) const =0
 

Static Public Member Functions

static EncapsulatedMutation adjust (Offset)
 Convenience factory: simple Mutation to adjust the duration or length of a timespan. More...
 
static EncapsulatedMutation changeDuration (Duration)
 Convenience factory: simple Mutation to adjust the duration or length of a timespan. More...
 
static EncapsulatedMutation changeTime (Time)
 Convenience factory to yield a simple Mutation changing the absolute start time. More...
 
static EncapsulatedMutation materialise (QuTime const &)
 Convenience factory: materialise the given quantised time into an explicit fixed internal time value, according to the underlying time grid; impose the resulting value then as new time point or start point to the target. More...
 
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 implicit nudge grid. More...
 
static EncapsulatedMutation nudge (int adjustment, Symbol gridID)
 build a time mutation to nudge the target time value in steps based on a pre-defined grid. More...
 

Static Protected Member Functions

static TimeValueimposeChange (TimeValue &, TimeValue const &)
 
static TimeValueimposeChange (TimeValue &, Offset const &)
 
static TimeValueimposeChange (TimeValue &, int)
 
static TimeValueimposeChange (QuTime &, int)
 

Member Function Documentation

◆ changeTime()

EncapsulatedMutation changeTime ( Time  newStartTime)
static

Convenience factory to yield a simple Mutation changing the absolute start time.

This whole procedure might look quite inefficient, but actually most of the abstractions are removed at runtime, leaving only a single indirection through the VTable of the Mutation Interface.

Exceptions
error::Logicwhen attempting to change the (non existent) start time of a Duration
Returns
EncapsulatedMutation, which is an "polymorphic value object", actually carrying an embedded Mutation subclass with the new start time

Definition at line 294 of file mutation.cpp.

Referenced by TimelineState::TimelineState().

+ Here is the caller graph for this function:

◆ changeDuration()

EncapsulatedMutation changeDuration ( Duration  changedDur)
static

Convenience factory: simple Mutation to adjust the duration or length of a timespan.

Exceptions
error::Logicwhen attempting to change the "duration" of a quantised time point
Returns
EncapsulatedMutation, carrying the new duration value to impose

Definition at line 305 of file mutation.cpp.

◆ adjust()

EncapsulatedMutation adjust ( Offset  change)
static

Convenience factory: simple Mutation to adjust the duration or length of a timespan.

Exceptions
error::Logicwhen attempting to change the "duration" of a quantised time point
Returns
EncapsulatedMutation, carrying the new duration value to impose

Definition at line 316 of file mutation.cpp.

◆ materialise()

EncapsulatedMutation materialise ( QuTime const &  gridAlignedTime)
static

Convenience factory: materialise the given quantised time into an explicit fixed internal time value, according to the underlying time grid; impose the resulting value then as new time point or start point to the target.

Note
same as materialising and then invoking changeTime

Definition at line 328 of file mutation.cpp.

◆ nudge() [1/2]

EncapsulatedMutation nudge ( int  adjustment)
static

build a time mutation to nudge the target time value by an offset, defined as number of steps on an implicit nudge grid.

If the target is an continuous (not quantised) time value or duration, an internal 'default nudge grid' will be used to calculate the offset value. Typically, this grid counts in seconds. To the contrary, when the target is a quantised value, it will be aligned to the grid point relative to the current value's next grid point, measured in number of steps. This includes materialising the internal time to the exact grid position. If especially the adjustment is zero, the internal value will be changed to literally equal the current value's next grid point.

Definition at line 345 of file mutation.cpp.

◆ nudge() [2/2]

EncapsulatedMutation nudge ( int  adjustment,
Symbol  gridID 
)
static

build a time mutation to nudge the target time value in steps based on a pre-defined grid.

Note
defined in common-services.cpp
Parameters
adjustmentnumber of grid steps to apply as offset
gridIDsymbolic reference to a grid, which needs to be defined "somewhere" within the system, typically within the session.
See also
#nudge(int,PQuant) variant of this function using a direct grid reference

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

References Quantiser::retrieve().

+ Here is the call graph for this function:

◆ imposeChange() [1/3]

TimeValue & imposeChange ( TimeValue target,
TimeValue const &  valueToSet 
)
inlinestaticprotected

actually force a change into a target time entity to mutate. Mutation is declared fried to TimeValue and thus is allowed to influence the basic value stored in each time entity

Definition at line 147 of file mutation.hpp.

Referenced by SetNewStartTimeMutation::change(), ImposeOffsetMutation::change(), NaturalNudgeMutation::change(), and Mutation::imposeChange().

+ Here is the caller graph for this function:

◆ imposeChange() [2/3]

TimeValue & imposeChange ( TimeValue target,
Offset const &  offset 
)
inlinestaticprotected

variation to mutate a target time value by applying an offset

Definition at line 154 of file mutation.hpp.

References Mutation::imposeChange().

+ Here is the call graph for this function:

◆ imposeChange() [3/3]

TimeValue & imposeChange ( TimeValue target,
int  steps 
)
inlinestaticprotected

nudge a target time value by a step wise offset. The standard case uses a fixed offset of 1 second per step //////////////////TICKET #810

Definition at line 163 of file mutation.hpp.

References Mutation::imposeChange().

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

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