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.

Port.hpp 544B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include "common.hpp"
  3. #include "engine/Light.hpp"
  4. namespace rack {
  5. static const int PORT_MAX_CHANNELS = 16;
  6. struct Port {
  7. /** Voltage of the port */
  8. union {
  9. float value;
  10. float values[PORT_MAX_CHANNELS] = {};
  11. };
  12. /** Number of polyphonic channels */
  13. int numChannels = 1;
  14. /** Whether a wire is plugged in */
  15. bool active = false;
  16. Light plugLights[2];
  17. float getValue(int index = 0) {
  18. return values[index];
  19. }
  20. void setValue(float value, int index = 0) {
  21. this->values[index] = value;
  22. }
  23. };
  24. } // namespace rack