mgunyho / Little-Utils

Little Utils plugin for VCV Rack
European Union Public License 1.2
15 stars 5 forks source link

Teleport: mirror port labels, attempt 3 #13

Closed mgunyho closed 2 years ago

mgunyho commented 2 years ago

On mouse-over, the teleport output label will show the label of the connected port on the other end.

This is an alternative to #11 and #12. Compared to those, this implementation overrides the port label tooltip implementation instead of messing with the port label. This is cleaner, avoids problems with looping, and ensures that the displayed label is always up to date, even if the source port has a dynamically updated label.

mgunyho commented 2 years ago

@EnigmaCurry sorry for still bothering you, but could you take a look at this version and see if you can make it segfault?

I'm pretty happy with the result, even though I had to copy-paste a bunch of implementation details from the Rack sources, which is a bit hacky. But at least it works well.

EnigmaCurry commented 2 years ago

Looks great!

mgunyho commented 2 years ago

Seems like there is a nominal CPU usage increase

This shouldn't really be the case, the tooltip is rendered by the GUI thread, which is completely separate from the audio thread which is what the CPU meter measures AFAIK.

one drawback is that it doesn't show the teleported name on the final destination, only the port number

Yeah, that is true. But I don't think there's a way to avoid problems with looping in that case.

Thanks a lot for the feedback! I think I'll go with this version. I'll make a new release soon.