private void PreviewPlay() { if (_previewContext == null) { _previewContext = VixenSystem.Contexts.CreateLiveContext("Effect Preview"); _previewContext.Start(); } IEnumerable <EffectNode> orderedNodes = Elements.Select(x => x.EffectNode).OrderBy(x => x.StartTime).ToList(); if (orderedNodes.Any()) { TimeSpan startOffset = orderedNodes.First().StartTime; TimeSpan duration = orderedNodes.Last().EndTime - startOffset; List <EffectNode> nodesToPlay = orderedNodes.Select(effectNode => new EffectNode(effectNode.Effect, effectNode.StartTime - startOffset)).ToList(); _previewContext.Execute(nodesToPlay); _previewLoopTimer.Interval = duration.TotalMilliseconds; _previewLoopTimer.Start(); } }
private void _inputManagement_InputsChanged(object sender, InputsChangedEventArgs e) { LiveContext systemContext = VixenSystem.Contexts.GetSystemLiveContext(); systemContext.Execute(e.EffectNodes); }