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.

PortWidget.hpp 931B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. struct PortWidget : widget::OpaqueWidget {
  9. engine::Module *module = NULL;
  10. int portId;
  11. bool hovered = false;
  12. enum Type {
  13. OUTPUT,
  14. INPUT
  15. };
  16. Type type;
  17. MultiLightWidget *plugLight;
  18. PortWidget();
  19. ~PortWidget();
  20. void step() override;
  21. void draw(const widget::DrawContext &ctx) override;
  22. void onButton(const event::Button &e) override;
  23. void onEnter(const event::Enter &e) override;
  24. void onLeave(const event::Leave &e) override;
  25. void onDragStart(const event::DragStart &e) override;
  26. void onDragEnd(const event::DragEnd &e) override;
  27. void onDragDrop(const event::DragDrop &e) override;
  28. void onDragEnter(const event::DragEnter &e) override;
  29. void onDragLeave(const event::DragLeave &e) override;
  30. };
  31. } // namespace app
  32. } // namespace rack