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.

CableContainer.hpp 751B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include "app/common.hpp"
  3. #include "widgets/TransparentWidget.hpp"
  4. #include "app/CableWidget.hpp"
  5. #include "app/PortWidget.hpp"
  6. namespace rack {
  7. struct CableContainer : TransparentWidget {
  8. CableWidget *activeCable = NULL;
  9. /** Takes ownership of `w` and adds it as a child if it isn't already */
  10. void setActiveCable(CableWidget *w);
  11. /** "Drops" the cable onto the port, making an engine connection if successful */
  12. void commitActiveCable();
  13. void removeTopCable(PortWidget *port);
  14. void removeAllCables(PortWidget *port);
  15. /** Returns the most recently added cable connected to the given Port, i.e. the top of the stack */
  16. CableWidget *getTopCable(PortWidget *port);
  17. void draw(NVGcontext *vg) override;
  18. };
  19. } // namespace rack