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.

37 lines
640B

  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. /** Accessing this directly is deprecated.
  10. Use getVoltage() and setVoltage() instead
  11. */
  12. float value;
  13. float values[PORT_MAX_CHANNELS] = {};
  14. };
  15. /** Number of polyphonic channels */
  16. int numChannels = 1;
  17. /** Whether a cable is plugged in */
  18. bool active = false;
  19. Light plugLights[2];
  20. float getVoltage(int index = 0) {
  21. return values[index];
  22. }
  23. void setVoltage(float voltage, int index = 0) {
  24. values[index] = voltage;
  25. }
  26. };
  27. } // namespace rack