Closed paulsonnentag closed 6 years ago
Let me know when you're happy with the PR, then I'll merge it. 👍
Ready to merge
Sorry for the late response 😞; and now it looks like there's a merge conflict. Let me know when it's resolved and I'll merge!
I've resolved the merge conflicts now
Summary API Changes
as discussed in original issue: #49
Creation / Removal of whiskers
Currently, the API is missing a way to remove whiskers again. I would like to add a whisker only if the paper has something connected to the output. The program can change audio nodes dynamically so it should be possible to remove whiskers again if there is no longer anything connected to the sound output.
Different whisker color
If a paper has multiple whiskers it would be nice if you could change the color of the whisker to differentiate them better. Instead of a color change the "connected" state is indicated by the moving dot animation. If the paper is not connected a static line is rendered without the moving dot.
Separate event handlers for placement and removal of papers
I think it would be cleaner to have two separate events for when a paper is placed and when it's removed. This makes it easier to explain the API. It's not necessary to check for null and in the removed paper event handler we can also pass in the information about the paper which was removed.