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.

44 lines
971B

  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <widget/OpaqueWidget.hpp>
  4. #include <app/MultiLightWidget.hpp>
  5. #include <engine/Module.hpp>
  6. namespace rack {
  7. namespace app {
  8. /** Manages an engine::Port on a ModuleWidget. */
  9. struct PortWidget : widget::OpaqueWidget {
  10. engine::Module *module = NULL;
  11. int portId;
  12. bool hovered = false;
  13. enum Type {
  14. OUTPUT,
  15. INPUT
  16. };
  17. Type type;
  18. MultiLightWidget *plugLight;
  19. PortWidget();
  20. ~PortWidget();
  21. void step() override;
  22. void draw(const DrawArgs &args) override;
  23. void onButton(const event::Button &e) override;
  24. void onEnter(const event::Enter &e) override;
  25. void onLeave(const event::Leave &e) override;
  26. void onDragStart(const event::DragStart &e) override;
  27. void onDragEnd(const event::DragEnd &e) override;
  28. void onDragDrop(const event::DragDrop &e) override;
  29. void onDragEnter(const event::DragEnter &e) override;
  30. void onDragLeave(const event::DragLeave &e) override;
  31. };
  32. } // namespace app
  33. } // namespace rack