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.

Input.hpp 472B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include "common.hpp"
  3. #include "engine/Light.hpp"
  4. namespace rack {
  5. struct Input {
  6. /** Voltage of the port, zero if not plugged in. Read-only by Module */
  7. float value = 0.f;
  8. /** Whether a wire is plugged in */
  9. bool active = false;
  10. Light plugLights[2];
  11. /** Returns the value if a wire is plugged in, otherwise returns the given default value */
  12. float normalize(float normalValue) {
  13. return active ? value : normalValue;
  14. }
  15. };
  16. } // namespace rack