vvvv.js
vvvv.js copied to clipboard
Node.add(In|Out)putPin() should handle pre-existing pins of the same name
When a patch is loaded from XML, pins are created that are mentioned in links but do not exist on nodes themselves. When pins of the same name are created after the patch is loaded, addInputPin() and addOutputPin() overwrite those pre-existing pins without properly destroying them. I think addInputPin() and addOutputPin() should handle this case by not creating a new pin. Instead, they should reconfigure the existing pin according to the new pin type and default value and return it. Code like this already exists in GenericShader (EX9.Effect) and I have written some for the Web Audio nodes, but I really think it should be moved to the mentioned functions in order to avoid code duplication and bugs in the future.
Good point, I agree.