Skip to content

Commit 39c47f7

Browse files
authored
Merge pull request #12 from OpenTabletDriver/0.5.0-prep
Add DefaultPropertyValue and update to 0.5.0
2 parents a93a57d + 40ddaba commit 39c47f7

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

.modules/OpenTabletDriver

Submodule OpenTabletDriver updated 142 files

DevocubFilters/AntiChatter.cs

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,43 +92,40 @@ public Vector2 Filter(Vector2 calcTarget)
9292

9393
public static FilterStage FilterStage => FilterStage.PostTranspose;
9494

95-
[SliderProperty("Latency", 0f, 1000f, 2f)]
95+
private float TimerInterval => 1000 / Frequency;
96+
97+
[SliderProperty("Latency", 0f, 1000f, 2f), DefaultPropertyValue(2)]
9698
public float Latency
9799
{
98100
set => this.latency = Math.Clamp(value, 0, 1000);
99101
get => this.latency;
100102
}
101103

102-
public float TimerInterval
103-
{
104-
get => 1000 / Hertz;
105-
}
106-
107-
[Property("Antichatter Strength")]
108-
public float AntichatterStrength { set; get; } = 3;
104+
[Property("Antichatter Strength"), DefaultPropertyValue(3)]
105+
public float AntichatterStrength { set; get; }
109106

110-
[Property("Antichatter Multiplier")]
111-
public float AntichatterMultiplier { set; get; } = 1;
107+
[Property("Antichatter Multiplier"), DefaultPropertyValue(1)]
108+
public float AntichatterMultiplier { set; get; }
112109

113110
[Property("Antichatter Offset X")]
114111
public float AntichatterOffsetX { set; get; }
115112

116-
[Property("Antichatter Offset Y")]
117-
public float AntichatterOffsetY { set; get; } = 1;
113+
[Property("Antichatter Offset Y"), DefaultPropertyValue(1)]
114+
public float AntichatterOffsetY { set; get; }
118115

119116
[BooleanProperty("Prediction", "")]
120117
public bool PredictionEnabled { set; get; }
121118

122-
[Property("Prediction Strength")]
123-
public float PredictionStrength { set; get; } = 1.1f;
119+
[Property("Prediction Strength"), DefaultPropertyValue(1.1f)]
120+
public float PredictionStrength { set; get; }
124121

125-
[Property("Prediction Sharpness")]
126-
public float PredictionSharpness { set; get; } = 1;
122+
[Property("Prediction Sharpness"), DefaultPropertyValue(1)]
123+
public float PredictionSharpness { set; get; }
127124

128-
[Property("Prediction Offset X")]
129-
public float PredictionOffsetX { set; get; } = 3;
125+
[Property("Prediction Offset X"), DefaultPropertyValue(3)]
126+
public float PredictionOffsetX { set; get; }
130127

131-
[Property("Prediction Offset Y")]
132-
public float PredictionOffsetY { set; get; } = 0.3f;
128+
[Property("Prediction Offset Y"), DefaultPropertyValue(0.3f)]
129+
public float PredictionOffsetY { set; get; }
133130
}
134131
}

HawkuFilters/NoiseReduction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class TabletDriverNoiseReduction : IFilter
1212
private readonly LinkedList<Vector2> buffer = new LinkedList<Vector2>();
1313
private float distThreshold, distMax;
1414
private const int iterations = 10;
15-
private int samples = 10;
15+
private int samples;
1616
private Vector2 lastPoint;
1717

1818
public Vector2 Filter(Vector2 point)
@@ -164,7 +164,7 @@ private bool GetAverageVector(ref Vector2 point)
164164
return true;
165165
}
166166

167-
[Property("Buffer")]
167+
[Property("Buffer"), DefaultPropertyValue(10)]
168168
public int Samples
169169
{
170170
set

HawkuFilters/Smoothing.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ public Vector3 Filter(Vector3 point)
6060

6161
public static FilterStage FilterStage => FilterStage.PostTranspose;
6262

63-
[SliderProperty("Latency", 0f, 1000f, 2f)]
64-
public float Latency { set; get; } = 2f;
63+
[SliderProperty("Latency", 0f, 1000f, 2f), DefaultPropertyValue(2)]
64+
public float Latency { set; get; }
6565

6666
public float TimerInterval
6767
{
68-
get => 1000 / Hertz;
68+
get => 1000 / Frequency;
6969
}
7070
}
7171
}

0 commit comments

Comments
 (0)