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.

ModuleLightWidget.hpp 829B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <app/MultiLightWidget.hpp>
  4. #include <ui/Tooltip.hpp>
  5. #include <engine/Module.hpp>
  6. namespace rack {
  7. namespace app {
  8. /** A MultiLightWidget that points to a module's Light or a range of lights
  9. Will access firstLightId, firstLightId + 1, etc. for each added color
  10. */
  11. struct ModuleLightWidget : MultiLightWidget {
  12. struct Internal;
  13. Internal* internal;
  14. engine::Module* module = NULL;
  15. int firstLightId = -1;
  16. ModuleLightWidget();
  17. ~ModuleLightWidget();
  18. engine::Light* getLight(int colorId);
  19. engine::LightInfo* getLightInfo();
  20. void createTooltip();
  21. void destroyTooltip();
  22. void step() override;
  23. void onHover(const HoverEvent& e) override;
  24. void onEnter(const EnterEvent& e) override;
  25. void onLeave(const LeaveEvent& e) override;
  26. };
  27. } // namespace app
  28. } // namespace rack