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.

36 lines
671B

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