92 #ifndef LIB_TIME_CONTROL_POLICY_H 93 #define LIB_TIME_CONTROL_POLICY_H 98 #include <boost/utility/enable_if.hpp> 99 #include <type_traits> 100 #include <functional> 108 using boost::disable_if;
111 using std::placeholders::_1;
124 return is_same<T, Duration>::value;
131 return is_same<T, TimeSpan>::value;
136 maybeMaterialise (T
const& non_grid_aligned_TimeValue)
138 return non_grid_aligned_TimeValue;
141 #ifdef LIB_TIME_TIMEQUANT_H 143 maybeMaterialise (
QuTime const& alignedTime)
145 PQuant const& grid(alignedTime);
146 return QuTime(grid->materialise(alignedTime), grid);
148 #endif //--quantised-time-support 157 template<
class TI,
class TAR>
161 buildChangedValue (TAR
const& target)
170 buildChangedValue (TAR
const& target)
179 buildChangedValue (
Duration const& targetDuration)
181 return TimeSpan (Time::ZERO, targetDuration);
188 buildChangedValue (
TimeSpan const& target)
193 #ifdef LIB_TIME_TIMEQUANT_H 198 buildChangedValue (TAR
const& target)
200 return QuTime (target
209 buildChangedValue (QuTime
const& target)
214 #endif //--quantised-time-support 227 template<
class TI,
class TAR>
237 imposeChange (target, maybeMaterialise(change));
238 return Link::buildChangedValue (maybeMaterialise(target));
242 useLengthAsChange (TAR& target,
TimeSpan const& change)
244 return processValueChange(target, change.duration());
250 imposeChange (target.duration(), change);
257 imposeChange (target.duration(), change.duration());
258 imposeChange (target,change.start());
265 return Link::buildChangedValue(target);
285 template<
class TI,
class SRC,
class TAR>
288 static function<TI(SRC const&)>
289 buildChangeHandler (TAR& target)
301 : __or_< is_same<T,Duration>
309 : __or_< is_same<T,Duration>
310 , is_same<T,TimeSpan>
322 template<
class TI,
class SRC>
323 struct Policy<TI,SRC, typename disable_if< canMutateDuration<SRC>,
326 static function<TI(SRC const&)>
327 buildChangeHandler (
Duration& target)
343 static function<Duration(Duration const&)>
344 buildChangeHandler (TAR&)
346 return bind ( ignore_change_and_return_Zero );
350 ignore_change_and_return_Zero()
359 static function<TI(TimeSpan const&)>
360 buildChangeHandler (
Duration& target)
372 static function<TI(Duration const&)>
373 buildChangeHandler (
TimeSpan& target)
382 static function<TimeSpan(TimeSpan const&)>
383 buildChangeHandler (
TimeSpan& target)
static TI dontChange(TAR &target)
static TI processValueChange(TAR &target, SRC const &change)
Modifying time and timecode values.
Interface: an opaque change imposed onto some time value.
static const Duration NIL
constant to indicate "no duration"
Implementation namespace for support and library code.
PQuant getDefaultGridFallback()
Policy how to impose changes onto a connected target time value entity This policy will be parametris...
Duration is the internal Lumiera time metric.
Policy to tie the various detail policies together for providing actual value change operations...
Implementation policy: how to build a new notification value of type TI, given a target time value en...
A time interval anchored at a specific point in time.
a family of time value like entities and their relationships.
grid aligned time specification, referring to a specific scale.