public override IDuration Clone(int cloneFlags = 0) { var d = new RandomDuration(); CopyTo(d, cloneFlags); return(d); }
public override void AddToUI(IDuration d) { duration_ = d as RandomDuration; if (duration_ == null) { return; } foreach (var w in timeWidgets_.GetWidgets()) { widgets_.AddToUI(w); } }
public Delay(IDuration d, bool halfway, bool endForwards) { if (d == null) { HalfwayDuration = new RandomDuration(); } else { HalfwayDuration = d; } EndForwardsDuration = new RandomDuration(); EndBackwardsDuration = new RandomDuration(); halfway_.Value = halfway; endForwards_.Value = endForwards; }
public UnsyncedModifier(IDuration d, Delay delay = null) { if (d == null) { Duration = new RandomDuration(1); } else { Duration = d; } if (delay == null) { Delay = new Delay(); } else { Delay = delay; } }
public void Clear() { if (modifiers_ != null) { while (modifiers_.Count > 0) { DeleteModifier(modifiers_[0]); } } enabled_.Value = true; name_ = null; Duration = new RandomDuration(); Repeat = new RandomizableTime(0); Delay = new Delay(new RandomDuration(), false, false); halfMove_.Value = false; inFirstHalf_ = true; modifiers_ = new List <ModifierContainer>(); enabledModifiers_ = new List <ModifierContainer>(); }
public bool FromJSON(J.Node n) { var o = n.AsObject("StepDelay"); if (o == null) { return(false); } IDuration d = null; if (o.HasKey("duration")) { // migration from v3 o.Opt <DurationFactory, IDuration>("duration", ref d); HalfwayDuration = d; EndForwardsDuration = new RandomDuration(); EndBackwardsDuration = new RandomDuration(); } else { o.Opt <DurationFactory, IDuration>("halfwayDuration", ref d); HalfwayDuration = d; o.Opt <DurationFactory, IDuration>("endForwardsDuration", ref d); EndForwardsDuration = d; o.Opt <DurationFactory, IDuration>("endBackwardsDuration", ref d); EndBackwardsDuration = d; } o.Opt("halfway", halfway_); o.Opt("endForwards", endForwards_); o.Opt("endBackwards", endBackwards_); o.Opt("sameDelay", ref sameDelay_); return(true); }
public AudioModifier(Atom a = null) { Atom = a; Delay = new RandomDuration(1); CheckSource(); }
private void CopyTo(RandomDuration d, int cloneFlags) { d.Time = Time.Clone(cloneFlags); }
public override List <IWidget> GetWidgets(IDuration d) { duration_ = d as RandomDuration; return(timeWidgets_.GetWidgets()); }