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.

36 lines
682B

  1. #pragma once
  2. #include "common.hpp"
  3. #include "midi.hpp"
  4. namespace rack {
  5. namespace gamepad {
  6. struct InputDevice : MidiInputDevice {
  7. int deviceId;
  8. std::vector<uint8_t> ccs;
  9. std::vector<bool> states;
  10. void step();
  11. };
  12. struct Driver : MidiDriver {
  13. InputDevice devices[16];
  14. Driver();
  15. std::string getName() override {return "Gamepad";}
  16. std::vector<int> getInputDeviceIds() override;
  17. std::string getInputDeviceName(int deviceId) override;
  18. MidiInputDevice *subscribeInputDevice(int deviceId, MidiInput *midiInput) override;
  19. void unsubscribeInputDevice(int deviceId, MidiInput *midiInput) override;
  20. };
  21. void init();
  22. void step();
  23. } // namespace gamepad
  24. } // namespace rack