summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/Device.h
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2019-01-08 09:28:24 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2019-01-17 12:10:50 -0600
commit52aa39991ca9964f491ee241f04f31eb6864ae9e (patch)
treefa6ca09437cab28e0e53ae0ecf6422116b56fa24 /Source/Core/InputCommon/ControllerInterface/Device.h
parent3627ef8a0489765eb10ab29a7988866b52493239 (diff)
ControllerInterface: evdev: Cleanup rumble effect processing so effects aren't removed and re-uploaded with every SetState() call. Split the "LeftRight" output into separate "Strong" and "Weak" outputs. Other minor cleanups.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Device.h')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Device.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Device.h b/Source/Core/InputCommon/ControllerInterface/Device.h
index 2012941a83..7b36da934a 100644
--- a/Source/Core/InputCommon/ControllerInterface/Device.h
+++ b/Source/Core/InputCommon/ControllerInterface/Device.h
@@ -16,13 +16,17 @@ typedef double ControlState;
namespace ciface
{
+// 100Hz which homebrew docs very roughly imply is within WiiMote normal
+// range, used for periodic haptic effects though often ignored by devices
+// TODO: Make this configurable.
+constexpr int RUMBLE_PERIOD_MS = 10;
+// This needs to be at least as long as the longest rumble that might ever be played.
+// Too short and it's going to stop in the middle of a long effect.
+// Infinite values are invalid for ramp effects and probably not sensible.
+constexpr int RUMBLE_LENGTH_MS = 1000 * 10;
+
namespace Core
{
-//
-// Device
-//
-// A device class
-//
class Device
{
public:
@@ -163,5 +167,5 @@ protected:
mutable std::mutex m_devices_mutex;
std::vector<std::shared_ptr<Device>> m_devices;
};
-}
-}
+} // namespace Core
+} // namespace ciface