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.

23 lines
447B

  1. #include "app.hpp"
  2. #include "engine.hpp"
  3. namespace rack {
  4. void ModuleLightWidget::step() {
  5. assert(module);
  6. assert(module->lights.size() >= firstLightId + baseColors.size());
  7. std::vector<float> values(baseColors.size());
  8. for (size_t i = 0; i < baseColors.size(); i++) {
  9. float value = module->lights[firstLightId + i].getBrightness();
  10. value = clampf(value, 0.0, 1.0);
  11. values[i] = value;
  12. }
  13. setValues(values);
  14. }
  15. } // namespace rack