From 76ccb44a3292d9ade0a87feccbafd937576b57fe Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 23 Oct 2018 03:34:23 -0500 Subject: [PATCH 1/9] Fixed control display in flow control --- DS4Windows/DS4Forms/DS4Form.Designer.cs | 11 --- DS4Windows/DS4Forms/DS4Form.cs | 1 - DS4Windows/DS4Forms/DS4Form.resx | 114 +++++++++--------------- 3 files changed, 42 insertions(+), 84 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.Designer.cs b/DS4Windows/DS4Forms/DS4Form.Designer.cs index e677699..607920c 100644 --- a/DS4Windows/DS4Forms/DS4Form.Designer.cs +++ b/DS4Windows/DS4Forms/DS4Form.Designer.cs @@ -165,7 +165,6 @@ this.linkUninstall = new System.Windows.Forms.LinkLabel(); this.linkSetup = new System.Windows.Forms.LinkLabel(); this.lLBUpdate = new System.Windows.Forms.LinkLabel(); - this.linkSplitLabel = new System.Windows.Forms.Label(); this.hidGuardWhiteList = new System.Windows.Forms.LinkLabel(); this.clrHidGuardWlistLinkLabel = new System.Windows.Forms.LinkLabel(); this.hidGuardRegLinkLabel = new System.Windows.Forms.LinkLabel(); @@ -1273,7 +1272,6 @@ this.flowLayoutPanel1.Controls.Add(this.linkUninstall); this.flowLayoutPanel1.Controls.Add(this.linkSetup); this.flowLayoutPanel1.Controls.Add(this.lLBUpdate); - this.flowLayoutPanel1.Controls.Add(this.linkSplitLabel); this.flowLayoutPanel1.Controls.Add(this.hidGuardWhiteList); this.flowLayoutPanel1.Controls.Add(this.clrHidGuardWlistLinkLabel); this.flowLayoutPanel1.Controls.Add(this.hidGuardRegLinkLabel); @@ -1316,14 +1314,6 @@ this.lLBUpdate.TabStop = true; this.lLBUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lLBUpdate_LinkClicked); // - // linkSplitLabel - // - resources.ApplyResources(this.linkSplitLabel, "linkSplitLabel"); - this.linkSplitLabel.BackColor = System.Drawing.SystemColors.ActiveBorder; - this.linkSplitLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.linkSplitLabel.ForeColor = System.Drawing.SystemColors.ControlText; - this.linkSplitLabel.Name = "linkSplitLabel"; - // // hidGuardWhiteList // resources.ApplyResources(this.hidGuardWhiteList, "hidGuardWhiteList"); @@ -1599,7 +1589,6 @@ private System.Windows.Forms.LinkLabel hidGuardWhiteList; private System.Windows.Forms.LinkLabel clrHidGuardWlistLinkLabel; private System.Windows.Forms.LinkLabel hidGuardRegLinkLabel; - private System.Windows.Forms.Label linkSplitLabel; private System.Windows.Forms.ToolStripMenuItem openProgramFolderToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripMenuItem disconToolStripMenuItem; diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 4366d9c..f1b6ee7 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -326,7 +326,6 @@ namespace DS4Windows hidGuardWhiteList.Visible = false; clrHidGuardWlistLinkLabel.Visible = false; hidGuardRegLinkLabel.Visible = false; - linkSplitLabel.Visible = false; } else { diff --git a/DS4Windows/DS4Forms/DS4Form.resx b/DS4Windows/DS4Forms/DS4Form.resx index b514f70..a184f38 100644 --- a/DS4Windows/DS4Forms/DS4Form.resx +++ b/DS4Windows/DS4Forms/DS4Form.resx @@ -445,10 +445,10 @@ NoControl - 764, 89 + 754, 89 - 129, 22 + 139, 22 50 @@ -472,7 +472,7 @@ NoControl - 360, 34 + 352, 34 39, 20 @@ -574,7 +574,7 @@ NoControl - 724, 89 + 714, 89 34, 22 @@ -604,7 +604,7 @@ NoControl - 724, 117 + 714, 117 34, 22 @@ -703,7 +703,7 @@ None - 607, 33 + 597, 33 111, 21 @@ -730,7 +730,7 @@ NoControl - 724, 61 + 714, 61 34, 22 @@ -757,7 +757,7 @@ None - 607, 61 + 597, 61 111, 21 @@ -781,7 +781,7 @@ None - 607, 89 + 597, 89 111, 21 @@ -808,7 +808,7 @@ NoControl - 724, 33 + 714, 33 34, 22 @@ -835,7 +835,7 @@ None - 607, 117 + 597, 117 111, 21 @@ -868,7 +868,7 @@ NoControl - 608, 7 + 598, 7 109, 15 @@ -940,7 +940,7 @@ NoControl - 356, 7 + 348, 7 47, 15 @@ -976,7 +976,7 @@ NoControl - 452, 7 + 443, 7 51, 15 @@ -1012,7 +1012,7 @@ NoControl - 458, 36 + 449, 36 39, 15 @@ -1048,7 +1048,7 @@ NoControl - 458, 64 + 449, 64 39, 15 @@ -1084,7 +1084,7 @@ NoControl - 458, 92 + 449, 92 39, 15 @@ -1120,7 +1120,7 @@ NoControl - 458, 120 + 449, 120 39, 15 @@ -1150,7 +1150,7 @@ NoControl - 360, 62 + 352, 62 39, 20 @@ -1180,7 +1180,7 @@ NoControl - 360, 90 + 352, 90 39, 20 @@ -1210,7 +1210,7 @@ NoControl - 360, 118 + 352, 118 39, 20 @@ -1243,10 +1243,10 @@ NoControl - 764, 33 + 754, 33 - 129, 22 + 139, 22 50 @@ -1273,10 +1273,10 @@ NoControl - 764, 61 + 754, 61 - 129, 22 + 139, 22 51 @@ -1303,10 +1303,10 @@ NoControl - 764, 117 + 754, 117 - 129, 22 + 139, 22 52 @@ -1336,7 +1336,7 @@ NoControl - 530, 0 + 520, 0 67, 30 @@ -1375,7 +1375,7 @@ NoControl - 556, 37 + 546, 37 15, 14 @@ -1408,7 +1408,7 @@ NoControl - 556, 65 + 546, 65 15, 14 @@ -1441,7 +1441,7 @@ NoControl - 556, 93 + 546, 93 15, 14 @@ -1474,7 +1474,7 @@ NoControl - 556, 121 + 546, 121 15, 14 @@ -1522,7 +1522,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="lbLinkProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,62.29144,Percent,20.02225,Percent,17.68632,Absolute,80,AutoSize,0,AutoSize,0,Absolute,134" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="lbLinkProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,62.29144,Percent,20.02225,Percent,17.68632,Absolute,80,AutoSize,0,AutoSize,0,Absolute,144" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> Fill @@ -2929,7 +2929,7 @@ languagePackComboBox1 - DS4Windows.DS4Forms.LanguagePackComboBox, DS4Windows, Version=1.5.12.0, Culture=neutral, PublicKeyToken=null + DS4Windows.DS4Forms.LanguagePackComboBox, DS4Windows, Version=1.5.13.0, Culture=neutral, PublicKeyToken=null fLPSettings @@ -3093,36 +3093,6 @@ 4 - - Left, Right - - - NoControl - - - 7, 73 - - - 3, 4, 3, 2 - - - 150, 2 - - - 56 - - - linkSplitLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 5 - True @@ -3130,7 +3100,7 @@ NoControl - 7, 77 + 7, 69 150, 13 @@ -3151,7 +3121,7 @@ flowLayoutPanel1 - 6 + 5 True @@ -3160,7 +3130,7 @@ NoControl - 7, 90 + 7, 82 141, 13 @@ -3181,7 +3151,7 @@ flowLayoutPanel1 - 7 + 6 True @@ -3190,7 +3160,7 @@ NoControl - 7, 103 + 7, 95 106, 13 @@ -3211,7 +3181,7 @@ flowLayoutPanel1 - 8 + 7 TopDown @@ -3223,7 +3193,7 @@ 4, 4, 4, 4 - 166, 122 + 204, 158 56 @@ -3766,7 +3736,7 @@ advColorDialog - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.5.12.0, Culture=neutral, PublicKeyToken=null + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.5.13.0, Culture=neutral, PublicKeyToken=null DS4Form From dfcc3250cf38d3b7af5276e49f214880b8d20b86 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Wed, 24 Oct 2018 04:17:01 -0500 Subject: [PATCH 2/9] Changed index increment placement Seems to solve #454 on my machine --- DS4Windows/DS4Control/UdpServer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DS4Windows/DS4Control/UdpServer.cs b/DS4Windows/DS4Control/UdpServer.cs index c216c46..a979715 100644 --- a/DS4Windows/DS4Control/UdpServer.cs +++ b/DS4Windows/DS4Control/UdpServer.cs @@ -183,9 +183,9 @@ namespace DS4Windows //try { udpSock.SendTo(packetData, clientEP); } SocketAsyncEventArgs args = argsList[listInd]; + listInd = ++listInd % 20; args.RemoteEndPoint = clientEP; args.SetBuffer(packetData, 0, packetData.Length); - listInd = ++listInd % 20; try { udpSock.SendToAsync(args); } @@ -643,9 +643,9 @@ namespace DS4Windows { //try { udpSock.SendTo(outputData, cl); } SocketAsyncEventArgs args = argsList[listInd]; + listInd = ++listInd % 20; args.RemoteEndPoint = cl; args.SetBuffer(outputData, 0, outputData.Length); - listInd = ++listInd % 20; try { udpSock.SendToAsync(args); } From 687ff0594886eac198829b6f37fdf6444cd9eb51 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Wed, 24 Oct 2018 21:41:29 -0500 Subject: [PATCH 3/9] Corrected unregister notify call Changed location and corrected used handle --- DS4Windows/DS4Forms/DS4Form.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index f1b6ee7..dda0fa0 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -57,6 +57,7 @@ namespace DS4Windows bool turnOffTemp; bool runningBat; private bool changingService; + private IntPtr regHandle = new IntPtr(); private static DS4Form instance; Dictionary hoverTextDict = new Dictionary(); // 0 index is used for application version text. 1 - 4 indices are used for controller status @@ -1049,8 +1050,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question { Guid hidGuid = new Guid(); NativeMethods.HidD_GetHidGuid(ref hidGuid); - IntPtr outHandle = new IntPtr(); - bool result = ScpDevice.RegisterNotify(this.Handle, hidGuid, ref outHandle); + bool result = ScpDevice.RegisterNotify(this.Handle, hidGuid, ref regHandle); if (!result) { ScpForm_Closing(this, @@ -1080,11 +1080,6 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question } break; } - case WM_CLOSE: - { - ScpDevice.UnregisterNotify(Handle); - break; - } case WM_QUERYENDSESSION: { systemShutdown = true; @@ -2176,6 +2171,14 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question e.Cancel = true; return; } + else + { + ScpDevice.UnregisterNotify(regHandle); + } + } + else + { + ScpDevice.UnregisterNotify(Handle); } } else if (userClosing && closeMini && !contextclose) From ce78793deac1fb905fc3f3ddf635290b28b092b9 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Thu, 25 Oct 2018 01:37:26 -0500 Subject: [PATCH 4/9] Removed old unused field --- DS4Windows/DS4Library/DS4Device.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index a464a12..6412903 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -150,7 +150,6 @@ namespace DS4Windows public DateTime lastActive = DateTime.UtcNow; public DateTime firstActive = DateTime.UtcNow; private bool charging; - private bool outputRumble = false; private int warnInterval = WARN_INTERVAL_USB; public int getWarnInterval() { @@ -649,7 +648,6 @@ namespace DS4Windows } //outReportBuffer.CopyTo(outputReport, 0); outputPendCount--; - outputRumble = false; } currentRumble = true; @@ -1175,7 +1173,6 @@ namespace DS4Windows if (synchronous) { - outputRumble = false; outputPendCount = 3; if (change) @@ -1215,7 +1212,6 @@ namespace DS4Windows outputPendCount = 3; } - outputRumble = true; Monitor.Pulse(outReportBuffer); } } From 32605524ff730cae11d7416948af04c72dcdbefc Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Thu, 25 Oct 2018 02:51:50 -0500 Subject: [PATCH 5/9] Added flag to allow skipping a lock when applicable --- DS4Windows/DS4Library/DS4Device.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index 6412903..f6d4fd7 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -398,6 +398,7 @@ namespace DS4Windows private bool timeoutExecuted = false; private bool timeoutEvent = false; private bool runCalib; + private bool hasInputEvts = false; public bool ShouldRunCalib() { return runCalib; @@ -1090,13 +1091,18 @@ namespace DS4Windows cState.CopyTo(pState); - lock (eventQueueLock) + if (hasInputEvts) { - Action tempAct = null; - for (int actInd = 0, actLen = eventQueue.Count; actInd < actLen; actInd++) + lock (eventQueueLock) { - tempAct = eventQueue.Dequeue(); - tempAct.Invoke(); + Action tempAct = null; + for (int actInd = 0, actLen = eventQueue.Count; actInd < actLen; actInd++) + { + tempAct = eventQueue.Dequeue(); + tempAct.Invoke(); + } + + hasInputEvts = false; } } } @@ -1467,6 +1473,7 @@ namespace DS4Windows lock (eventQueueLock) { eventQueue.Enqueue(act); + hasInputEvts = true; } } From e3ed777682f4fa2135bf61b67b74c2842aaf0478 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 26 Oct 2018 01:37:51 -0500 Subject: [PATCH 6/9] Removed unnecessary array copy for USB and SONYWA connections --- DS4Windows/DS4Library/DS4Device.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index f6d4fd7..0e62794 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -1186,10 +1186,9 @@ namespace DS4Windows if (usingBT) { Monitor.Enter(outputReport); + outReportBuffer.CopyTo(outputReport, 0); } - outReportBuffer.CopyTo(outputReport, 0); - try { if (!writeOutput()) From 49d24fce7d5ad82fbacb662f7bd66652e98c4f7f Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 26 Oct 2018 20:58:43 -0500 Subject: [PATCH 7/9] Testing new output report copying thread for USB and SONYWA --- DS4Windows/DS4Library/DS4Device.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index 0e62794..f8732c8 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -539,6 +539,14 @@ namespace DS4Windows timeoutCheckThread.IsBackground = true; timeoutCheckThread.Start(); } + else + { + ds4Output = new Thread(OutReportCopy); + ds4Output.Priority = ThreadPriority.AboveNormal; + ds4Output.Name = "DS4 Arr Copy thread: " + Mac; + ds4Output.IsBackground = true; + ds4Output.Start(); + } ds4Input = new Thread(performDs4Input); ds4Input.Priority = ThreadPriority.AboveNormal; @@ -1203,6 +1211,10 @@ namespace DS4Windows { Monitor.Exit(outputReport); } + else + { + Monitor.Pulse(outReportBuffer); + } } } else @@ -1229,6 +1241,22 @@ namespace DS4Windows } } + public void OutReportCopy() + { + try + { + while (!exitOutputThread) + { + lock (outReportBuffer) + { + outReportBuffer.CopyTo(outputReport, 0); + Monitor.Wait(outReportBuffer); + } + } + } + catch (ThreadInterruptedException) { } + } + public bool DisconnectBT(bool callRemoval = false) { if (Mac != null) From ae9e9ca1e0189794f5693b8a1399b3784ea35819 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 27 Oct 2018 12:44:19 -0500 Subject: [PATCH 8/9] Version 1.5.14 --- DS4Windows/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/Properties/AssemblyInfo.cs b/DS4Windows/Properties/AssemblyInfo.cs index 42f8705..1dfaae0 100644 --- a/DS4Windows/Properties/AssemblyInfo.cs +++ b/DS4Windows/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.13")] +[assembly: AssemblyVersion("1.5.14")] [assembly: AssemblyFileVersion("1.5.13")] [assembly: NeutralResourcesLanguage("en")] From cadcaf57a205e72f42b6a3c894b14148627e91cf Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 27 Oct 2018 13:17:17 -0500 Subject: [PATCH 9/9] Real version 1.5.14. VS did not save a change before. --- DS4Windows/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/Properties/AssemblyInfo.cs b/DS4Windows/Properties/AssemblyInfo.cs index 1dfaae0..f7f67b8 100644 --- a/DS4Windows/Properties/AssemblyInfo.cs +++ b/DS4Windows/Properties/AssemblyInfo.cs @@ -34,6 +34,6 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.5.14")] -[assembly: AssemblyFileVersion("1.5.13")] +[assembly: AssemblyFileVersion("1.5.14")] [assembly: NeutralResourcesLanguage("en")]