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.

CableWidget.hpp 694B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "app/common.hpp"
  3. #include "widgets/OpaqueWidget.hpp"
  4. #include "app/PortWidget.hpp"
  5. #include "engine/Cable.hpp"
  6. namespace rack {
  7. struct CableWidget : OpaqueWidget {
  8. PortWidget *outputPort = NULL;
  9. PortWidget *inputPort = NULL;
  10. PortWidget *hoveredOutputPort = NULL;
  11. PortWidget *hoveredInputPort = NULL;
  12. Cable *cable = NULL;
  13. NVGcolor color;
  14. CableWidget();
  15. ~CableWidget();
  16. /** Synchronizes the plugged state of the widget to the owned cable */
  17. void updateCable();
  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