You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
580B

  1. #pragma once
  2. #include "common.hpp"
  3. namespace rack {
  4. struct Port;
  5. struct WireWidget : OpaqueWidget {
  6. Port *outputPort = NULL;
  7. Port *inputPort = NULL;
  8. Port *hoveredOutputPort = NULL;
  9. Port *hoveredInputPort = NULL;
  10. Wire *wire = NULL;
  11. NVGcolor color;
  12. WireWidget();
  13. ~WireWidget();
  14. /** Synchronizes the plugged state of the widget to the owned wire */
  15. void updateWire();
  16. math::Vec getOutputPos();
  17. math::Vec getInputPos();
  18. json_t *toJson();
  19. void fromJson(json_t *rootJ);
  20. void draw(NVGcontext *vg) override;
  21. void drawPlugs(NVGcontext *vg);
  22. };
  23. } // namespace rack