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.

44 lines
839B

  1. #pragma once
  2. #include "util/common.hpp"
  3. #include "midi.hpp"
  4. #pragma GCC diagnostic push
  5. #ifndef __clang__
  6. #pragma GCC diagnostic ignored "-Wsuggest-override"
  7. #endif
  8. #include "rtmidi/RtMidi.h"
  9. #pragma GCC diagnostic pop
  10. namespace rack {
  11. struct RtMidiInputDriver : MidiInputDriver {
  12. /** Just for querying MIDI driver information */
  13. RtMidiIn *rtMidiIn;
  14. RtMidiInputDriver(int driver);
  15. ~RtMidiInputDriver();
  16. int getDeviceCount() override;
  17. std::string getDeviceName(int device) override;
  18. MidiInputDevice *getDevice(int device) override;
  19. };
  20. struct RtMidiInputDevice : MidiInputDevice {
  21. RtMidiIn *rtMidiIn;
  22. /** Cached */
  23. std::string deviceName;
  24. RtMidiInputDevice(int driver, int device);
  25. ~RtMidiInputDevice();
  26. };
  27. std::vector<int> rtmidiGetDrivers();
  28. MidiInputDriver *rtmidiGetInputDriver(int driver);
  29. } // namespace rack