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.

42 lines
680B

  1. #pragma once
  2. #pragma GCC diagnostic push
  3. #pragma GCC diagnostic ignored "-Wsuggest-override"
  4. #include "rtmidi/RtMidi.h"
  5. #pragma GCC diagnostic pop
  6. namespace rack {
  7. struct MidiIO {
  8. RtMidi *midi;
  9. int port = -1;
  10. /* For MIDI output, the channel to output messages.
  11. For MIDI input, the channel to filter.
  12. Set to -1 to allow all MIDI channels (for input).
  13. Zero indexed.
  14. */
  15. int channel = -1;
  16. virtual ~MidiIO() {}
  17. virtual int getPortCount();
  18. virtual std::string getPortName(int port);
  19. virtual void openPort(int port);
  20. };
  21. struct MidiInput : MidiIO {
  22. MidiInput();
  23. ~MidiInput();
  24. };
  25. struct MidiOutput : MidiIO {
  26. MidiOutput();
  27. ~MidiOutput();
  28. };
  29. } // namespace rack