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 687B

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