From ebfd5a8af07bc5fdf5b463714d8030e49eac53ba Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 1 Apr 2021 22:08:01 -0700 Subject: Add differing table types --- wrapper/wrapper.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'wrapper/wrapper.cpp') 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 [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^ 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>^ 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; -- cgit v1.2.3