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.

34 lines
599B

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