mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-10 22:28:03 -05:00
core/hid: Add output devices
This commit is contained in:
@ -38,6 +38,27 @@ enum class BatteryLevel {
|
||||
Charging,
|
||||
};
|
||||
|
||||
enum class PollingMode {
|
||||
Active,
|
||||
Pasive,
|
||||
Camera,
|
||||
NCF,
|
||||
IR,
|
||||
};
|
||||
|
||||
enum class VibrationError {
|
||||
None,
|
||||
NotSupported,
|
||||
Disabled,
|
||||
Unknown,
|
||||
};
|
||||
|
||||
enum class PollingError {
|
||||
None,
|
||||
NotSupported,
|
||||
Unknown,
|
||||
};
|
||||
|
||||
struct AnalogProperties {
|
||||
float deadzone{};
|
||||
float range{1.0f};
|
||||
@ -149,6 +170,24 @@ private:
|
||||
InputCallback callback;
|
||||
};
|
||||
|
||||
/// An abstract class template for an output device (rumble, LED pattern, polling mode).
|
||||
class OutputDevice {
|
||||
public:
|
||||
virtual ~OutputDevice() = default;
|
||||
|
||||
virtual void SetLED([[maybe_unused]] LedStatus led_status) {
|
||||
return;
|
||||
}
|
||||
|
||||
virtual VibrationError SetVibration([[maybe_unused]] VibrationStatus vibration_status) {
|
||||
return VibrationError::NotSupported;
|
||||
}
|
||||
|
||||
virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) {
|
||||
return PollingError::NotSupported;
|
||||
}
|
||||
};
|
||||
|
||||
/// An abstract class template for a factory that can create input devices.
|
||||
template <typename InputDeviceType>
|
||||
class Factory {
|
||||
|
Reference in New Issue
Block a user