summaryrefslogtreecommitdiff
path: root/wrapper/wrapper.cpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2021-04-01 22:08:01 -0700
committerJacob Palecki <[email protected]>2021-04-01 22:08:01 -0700
commitebfd5a8af07bc5fdf5b463714d8030e49eac53ba (patch)
treea31b8b3350cdde51cfdaa86260d9788c3e75d010 /wrapper/wrapper.cpp
parentAdd lookuptable json (diff)
downloadrawaccel-ebfd5a8af07bc5fdf5b463714d8030e49eac53ba.tar.xz
rawaccel-ebfd5a8af07bc5fdf5b463714d8030e49eac53ba.zip
Add differing table types
Diffstat (limited to 'wrapper/wrapper.cpp')
-rw-r--r--wrapper/wrapper.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp
index 84756af..7583312 100644
--- a/wrapper/wrapper.cpp
+++ b/wrapper/wrapper.cpp
@@ -25,7 +25,7 @@ ra::settings default_settings;
[JsonConverter(Converters::StringEnumConverter::typeid)]
public enum class AccelMode
{
- classic, jump, natural, power, motivity, noaccel
+ classic, jump, natural, power, motivity, lut, noaccel
};
public enum class TableMode
@@ -33,12 +33,20 @@ public enum class TableMode
off, binlog, linear
};
+public enum class TableType
+{
+ spaced, arbitrary
+};
+
[StructLayout(LayoutKind::Sequential)]
public value struct TableArgs
{
[JsonIgnore]
TableMode mode;
+ [JsonIgnore]
+ TableType type;
+
[MarshalAs(UnmanagedType::U1)]
bool transfer;
@@ -50,6 +58,7 @@ public value struct TableArgs
double stop;
};
+
generic <typename T>
[StructLayout(LayoutKind::Sequential)]
public value struct Vec2
@@ -58,6 +67,24 @@ public value struct Vec2
T y;
};
+public ref struct SpacedTable
+{
+ [JsonProperty("Arguments for spacing in table")]
+ TableArgs args;
+
+ [JsonProperty("Series of points for use in curve")]
+ List<double>^ points;
+};
+
+public ref struct ArbitraryTable
+{
+ [JsonProperty("Whether points affect velocity (true) or sensitivity (false)")]
+ bool transfer;
+
+ [JsonProperty("Series of points for use in curve")]
+ List<Vec2<double>>^ points;
+};
+
[StructLayout(LayoutKind::Sequential)]
public value struct AccelArgs
{
@@ -144,6 +171,12 @@ public ref struct DriverSettings
[MarshalAs(UnmanagedType::ByValTStr, SizeConst = ra::MAX_DEV_ID_LEN)]
String^ deviceID = "";
+ [JsonIgnore]
+ SpacedTable^ SpacedTable;
+
+ [JsonIgnore]
+ ArbitraryTable^ ArbitraryTable;
+
bool ShouldSerializeminimumTime()
{
return minimumTime != ra::DEFAULT_TIME_MIN;