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.

30 lines
717B

  1. #include "ValleyWidgets.hpp"
  2. void DynamicModuleLightWidget::step() {
  3. if(visibility != nullptr) {
  4. if(*visibility) {
  5. visible = true;
  6. }
  7. else {
  8. visible = false;
  9. }
  10. if(viewMode == ACTIVE_LOW_VIEW) {
  11. visible = !visible;
  12. }
  13. }
  14. else {
  15. visible = true;
  16. }
  17. assert(module);
  18. assert(module->lights.size() >= firstLightId + baseColors.size());
  19. std::vector<float> values(baseColors.size());
  20. for (size_t i = 0; i < baseColors.size(); i++) {
  21. float value = module->lights[firstLightId + i].getBrightness();
  22. value = clamp(value, 0.0, 1.0);
  23. values[i] = value;
  24. }
  25. setValues(values);
  26. }