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.

gamepad.hpp 684B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "common.hpp"
  3. #include "midi.hpp"
  4. namespace rack {
  5. namespace gamepad {
  6. struct InputDevice : midi::InputDevice {
  7. int deviceId;
  8. std::vector<uint8_t> ccs;
  9. std::vector<bool> states;
  10. void step();
  11. };
  12. struct Driver : midi::Driver {
  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. midi::InputDevice *subscribeInputDevice(int deviceId, midi::Input *input) override;
  19. void unsubscribeInputDevice(int deviceId, midi::Input *input) override;
  20. };
  21. void init();
  22. void step();
  23. } // namespace gamepad
  24. } // namespace rack