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
686B

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