diff --git a/vvvv45/addonpack/lib/nodes/plugins/Delay (Animation Framebased) help.v4p b/vvvv45/addonpack/lib/nodes/plugins/Delay (Animation Framebased) help.v4p new file mode 100644 index 000000000..f919f76a9 --- /dev/null +++ b/vvvv45/addonpack/lib/nodes/plugins/Delay (Animation Framebased) help.v4p @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vvvv45/addonpack/src/nodes/plugins/Animation/DelayFramebased/DelayFramebased.csproj b/vvvv45/addonpack/src/nodes/plugins/Animation/DelayFramebased/DelayFramebased.csproj new file mode 100644 index 000000000..391d8ef78 --- /dev/null +++ b/vvvv45/addonpack/src/nodes/plugins/Animation/DelayFramebased/DelayFramebased.csproj @@ -0,0 +1,54 @@ + + + + {6A0AFB1F-8219-4A08-85F7-B7F19B66AC16} + Debug + x86 + Library + VVVV.Nodes + DelayFramebased + v4.0 + bin\$(Platform)\$(Configuration)\ + True + ..\..\..\..\..\OmniPlus\DATA\vvvv_45beta34.2_x86\lib\core\;..\..\..\..\..\OmniPlus\DATA\vvvv_45beta34.2_x86\lib\nodes\plugins\;..\..\vvvv_45beta34.2_x86\lib\core\;..\..\vvvv_45beta34.2_x86\lib\nodes\plugins\ + + + DEBUG;TRACE + False + True + Full + True + + + TRACE + True + False + None + False + + + AnyCPU + + + x86 + + + x64 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vvvv45/addonpack/src/nodes/plugins/Animation/DelayFramebased/DelayFramebasedNode.cs b/vvvv45/addonpack/src/nodes/plugins/Animation/DelayFramebased/DelayFramebasedNode.cs new file mode 100644 index 000000000..26ec48dbd --- /dev/null +++ b/vvvv45/addonpack/src/nodes/plugins/Animation/DelayFramebased/DelayFramebasedNode.cs @@ -0,0 +1,117 @@ +#region usings +using System; +using System.ComponentModel.Composition; + +using System.Collections.Generic; +using System.Collections; + +using VVVV.PluginInterfaces.V1; +using VVVV.PluginInterfaces.V2; +using VVVV.Utils.VColor; +using VVVV.Utils.VMath; + +using VVVV.Core.Logging; +#endregion usings + +namespace VVVV.Nodes +{ + #region PluginInfo + [PluginInfo(Name = "Delay", Category = "Animation", Version ="Framebased", Help = "Framebased delay with adjustable frame count")] + #endregion PluginInfo + public class DelayFramebased : IPluginEvaluate + { + #region fields & pins + [Input("Input", DefaultValue = 1.0)] + public ISpread FInput; + + [Input("Skip")] + public ISpread FSkip; + + [Input("Reset")] + public ISpread FReset; + + [Input("Delay", DefaultValue = 1.0, MinValue = 0)] + public ISpread FDelayFrames; + + [Output("Output")] + public ISpread FOutput; + + [Import()] + public ILogger FLogger; + #endregion fields & pins + + List> listOfQueue = new List>(); + + public void Evaluate(int SpreadMax) + { + FOutput.SliceCount = SpreadMax; + + + if(SpreadMax != listOfQueue.Count){ + + int difference = SpreadMax - listOfQueue.Count; + + if(difference < 0){ + + int temp = difference * -1; + listOfQueue.RemoveRange(SpreadMax-1,temp); + } + + if(difference > 0){ + for(int i = 0; i()); + } + } + } + + for(int index = 0; index=0){ + SetDelayQueue(index, SpreadMax, difference); + } + + else{ + FOutput[index] = FInput[index]; + } + } + + if(FReset[index]){ + listOfQueue[index].Clear(); + } + + listOfQueue[index].Enqueue(FInput[index]); + + if(FSkip[index]){ + FOutput[index] = FInput[index]; + } + + else{ + FOutput[index] = listOfQueue[index].Dequeue(); + } + } + } + + public void SetDelayQueue(int index, int SMax, int diff){ + + if(diff > 0){ + for(int i = 0; i < diff; i++){ + listOfQueue[index].Enqueue(FInput[index]); + } + } + + if(diff < 0){ + + int temp = diff * -1; + + for(int i = 0; i