-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framebased Delay #284
base: develop
Are you sure you want to change the base?
Framebased Delay #284
Conversation
Framebased Delay added for Addonpack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some cosmetics
namespace VVVV.Nodes | ||
{ | ||
#region PluginInfo | ||
[PluginInfo(Name = "Delay", Category = "Animation", Version ="Framebased", Help = "Framebased delay with adjustable frame count.", Tags = "Whiplash/joshuavh")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Whiplash/joshuavh" doesn't sound like a proper tag..please elaborate
public ISpread<double> FInput; | ||
|
||
[Input("Skip", IsBang = false)] | ||
public ISpread<bool> skip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all fields should start with a capital F, like FSkip, FReset, FDelayFrames, FListOfQueues
[Input("Input", DefaultValue = 1.0)] | ||
public ISpread<double> FInput; | ||
|
||
[Input("Skip", IsBang = false)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsBang=false is not needed. bools are toggles by default.
|
||
public void Evaluate(int SpreadMax) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove superfluous linebreaks.
//////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
public void setDelayQueue(int index, int SMax, int diff){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Operations start with a capital letter
minor changes
hey joreg, we updated the forked repo with the requested cosmetics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for my late answer and thanks for your changes so far. i hope you don't understand this to be to annoy you. i'm just hoping that those changes would contribute to a more concise code-base in the future.
public class DelayFramebased : IPluginEvaluate | ||
{ | ||
#region fields & pins | ||
[Input("Input", DefaultValue = 1.0)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for the default being 1.0 here instead of 0? if not, then simply remove the default value
[Input("Reset")] | ||
public ISpread<bool> FReset; | ||
|
||
[Input("Delay", DefaultValue = 1.0, MinValue = 0)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the Delay (Animation) node this parameter is called "Time". for consistency reasons i'd suggest to name this pin "Frames"
[Input("Skip")] | ||
public ISpread<bool> FSkip; | ||
|
||
[Input("Reset")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a "Reset" pin would typically be the last pin on a node. just checked with Delay (Animation) where it is not, but that should not stop you from doing it right here. also the original node has a "Reset Value" input, wouldn't that also be useful here?
[Input("Input", DefaultValue = 1.0)] | ||
public ISpread<double> FInput; | ||
|
||
[Input("Skip")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in Delay (Animation) the input is called "Insert". is that the same only in reverse? so not skip = insert? if so i'd suggest to name it "Insert" here also
|
||
[Input("Delay", DefaultValue = 1.0, MinValue = 0)] | ||
public ISpread<int> FDelayFrames; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also i suggest to adapt the order of pins to the original node. that would be: Input, Frames, Insert, Reset (Reset Value)
public ILogger FLogger; | ||
#endregion fields & pins | ||
|
||
List<Queue<double>> listOfQueue = new List<Queue<double>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listOfQueue is also a field just like the inputs. therefore it would also be called: FListOfQueue
FOutput.SliceCount = SpreadMax; | ||
|
||
|
||
if(SpreadMax != listOfQueue.Count){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in most c# coding guidlines you'll learn to place opening brackets on a new line for good style and better readability.
|
||
int difference = SpreadMax - listOfQueue.Count; | ||
|
||
if(difference < 0){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while i'm at it: it is good practice to put a space between if and the opening bracket. same with "for ("
@timothymclure are you still interested in getting this into the addonpack? if so please answer my review.. |
@joreg -- of course. I don´t mean to be disrespectful, but the Plugin works and I think creative decisions and how to format the code should be up to the coder. Made this small plugin for ourselves and wanted to share it in case someone else might find it helpful. |
hei @timothymclure thanks for getting back on this.
i want to explain why each is important and not a creative choice:
having said that, i hope you understand why both reasons are important. we haven't been very strict about coding-style in the past so please consider my remarks regarding coding-style more as a recommendation. regarding the node-signature though i'll have to enforce my remarks for the sanity of all vvvv users. so please either fix those or of course feel free to close this pullrequest if you prefer not to. you'll then still have the option to share your plugin as a contribution: https://vvvv.org/contributions |
Hey @joreg, point one accepted, but think it should be communicated way better beforehand. This still is not a plugin especially made for the addonpack, so there was no need to follow guidelines in the first place. |
thanks for your understanding. looking fwd to your update anytime... |
Framebased Delay added for Addonpack