Implement vibrations (#2468)

* First working vibration implementation

* Fix Infinite Rumble in SDL2Mouse

* Stop ignoring one vibValues every 2

* Remove RumbleInfinity as suggested

* Reworked all the vibration handle / calculation

* Revert HidVibrationDevicePosition changes

* Add UI to enable and tune rumble

* Remove some stub logs

* Add PlayerIndex in rumble debug log

* Fix all requested changes

* Implements hid::GetVibrationDeviceInfo

* Better implements HidVibrationValue.Equals/GetHashCode

* Added requested changes from code review

* Last fixes from review

* Update configuration file version for rebase
This commit is contained in:
mpnico 2021-08-05 00:39:40 +02:00 committed by GitHub
parent 46ffc81d90
commit 70f79e689b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 468 additions and 50 deletions

View file

@ -7,6 +7,20 @@
<property name="step_increment">1</property>
<property name="page_increment">4</property>
</object>
<object class="GtkAdjustment" id="_controllerStrongRumble">
<property name="lower">0.1</property>
<property name="upper">10</property>
<property name="value">1.0</property>
<property name="step_increment">0.1</property>
<property name="page_increment">1.0</property>
</object>
<object class="GtkAdjustment" id="_controllerWeakRumble">
<property name="lower">0.1</property>
<property name="upper">10</property>
<property name="value">1.0</property>
<property name="step_increment">0.1</property>
<property name="page_increment">1.0</property>
</object>
<object class="GtkAdjustment" id="_controllerDeadzoneLeft">
<property name="upper">1</property>
<property name="value">0.050000000000000003</property>
@ -1249,6 +1263,130 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="_rumbleBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="margin_bottom">5</property>
<property name="label" translatable="yes">Rumble</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="_enableRumble">
<property name="label" translatable="yes">Enable</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="_StrongMultiBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Strong rumble multiplier</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">_controllerStrongRumble</property>
<property name="round_digits">1</property>
<property name="digits">1</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="_WeakMultiBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Weak rumble multiplier</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">_controllerWeakRumble</property>
<property name="round_digits">1</property>
<property name="digits">1</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>