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.

48 lines
1.1KB

  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <widget/OpaqueWidget.hpp>
  4. #include <ui/Tooltip.hpp>
  5. #include <app/MultiLightWidget.hpp>
  6. #include <engine/Module.hpp>
  7. #include <engine/PortInfo.hpp>
  8. namespace rack {
  9. namespace app {
  10. /** Manages an engine::Port on a ModuleWidget. */
  11. struct PortWidget : widget::OpaqueWidget {
  12. struct Internal;
  13. Internal* internal;
  14. engine::Module* module = NULL;
  15. engine::Port::Type type = engine::Port::INPUT;
  16. int portId = -1;
  17. MultiLightWidget* plugLight;
  18. PortWidget();
  19. ~PortWidget();
  20. engine::Port* getPort();
  21. engine::PortInfo* getPortInfo();
  22. void createTooltip();
  23. void destroyTooltip();
  24. void step() override;
  25. void draw(const DrawArgs& args) override;
  26. void onButton(const ButtonEvent& e) override;
  27. void onEnter(const EnterEvent& e) override;
  28. void onLeave(const LeaveEvent& e) override;
  29. void onDragStart(const DragStartEvent& e) override;
  30. void onDragEnd(const DragEndEvent& e) override;
  31. void onDragDrop(const DragDropEvent& e) override;
  32. void onDragEnter(const DragEnterEvent& e) override;
  33. void onDragLeave(const DragLeaveEvent& e) override;
  34. };
  35. } // namespace app
  36. } // namespace rack