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.

38 lines
736B

  1. #pragma once
  2. #include "util/common.hpp"
  3. #include "midi.hpp"
  4. namespace rack {
  5. const int GAMEPAD_DRIVER = -10;
  6. struct GamepadInputDevice : MidiInputDevice {
  7. int deviceId;
  8. std::vector<uint8_t> ccs;
  9. std::vector<bool> states;
  10. void step();
  11. };
  12. struct GamepadDriver : MidiDriver {
  13. GamepadInputDevice devices[16];
  14. GamepadDriver();
  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 gamepadStep();
  22. GamepadDriver *gamepadGetDriver();
  23. } // namespace rack