mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-24 23:51:49 +01:00
Trim event handler method. Add name for timeout threads.
Decent performance boost with this change
This commit is contained in:
parent
dce5c811f2
commit
5df34b8378
@ -23,8 +23,6 @@ namespace DS4Windows
|
|||||||
public string[] arguements;
|
public string[] arguements;
|
||||||
delegate void LogDebugDelegate(DateTime Time, String Data, bool warning);
|
delegate void LogDebugDelegate(DateTime Time, String Data, bool warning);
|
||||||
delegate void NotificationDelegate(object sender, DebugEventArgs args);
|
delegate void NotificationDelegate(object sender, DebugEventArgs args);
|
||||||
delegate void BatteryStatusDelegate(object sender, BatteryReportArgs args);
|
|
||||||
delegate void ControllerRemovedDelegate(object sender, ControllerRemovedArgs args);
|
|
||||||
delegate void DeviceStatusChangedDelegate(object sender, DeviceStatusChangeEventArgs args);
|
delegate void DeviceStatusChangedDelegate(object sender, DeviceStatusChangeEventArgs args);
|
||||||
delegate void DeviceSerialChangedDelegate(object sender, SerialChangeArgs args);
|
delegate void DeviceSerialChangedDelegate(object sender, SerialChangeArgs args);
|
||||||
protected Label[] Pads, Batteries;
|
protected Label[] Pads, Batteries;
|
||||||
@ -1063,17 +1061,6 @@ namespace DS4Windows
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void BatteryStatusUpdate(object sender, BatteryReportArgs args)
|
protected void BatteryStatusUpdate(object sender, BatteryReportArgs args)
|
||||||
{
|
|
||||||
if (this.InvokeRequired)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
BatteryStatusDelegate d = new BatteryStatusDelegate(BatteryStatusUpdate);
|
|
||||||
this.BeginInvoke(d, new object[] { sender, args });
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
string battery;
|
string battery;
|
||||||
int level = args.getLevel();
|
int level = args.getLevel();
|
||||||
@ -1097,7 +1084,6 @@ namespace DS4Windows
|
|||||||
generateDeviceNotifyText(args.getIndex());
|
generateDeviceNotifyText(args.getIndex());
|
||||||
populateNotifyText();
|
populateNotifyText();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected void populateFullNotifyText()
|
protected void populateFullNotifyText()
|
||||||
{
|
{
|
||||||
|
@ -483,6 +483,8 @@ namespace DS4Windows
|
|||||||
ds4Output.Start();
|
ds4Output.Start();
|
||||||
|
|
||||||
timeoutCheckThread = new Thread(timeoutTestThread);
|
timeoutCheckThread = new Thread(timeoutTestThread);
|
||||||
|
timeoutCheckThread.Priority = ThreadPriority.BelowNormal;
|
||||||
|
timeoutCheckThread.Name = "DS4 Timeout thread: " + Mac;
|
||||||
timeoutCheckThread.IsBackground = true;
|
timeoutCheckThread.IsBackground = true;
|
||||||
timeoutCheckThread.Start();
|
timeoutCheckThread.Start();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user