diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index d64bc46..dd26991 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -1094,10 +1094,11 @@ namespace DS4Windows { if (!useDInputOnly[ind]) { + string tempType = outputDevices[ind].GetDeviceType(); outputDevices[ind].Disconnect(); outputDevices[ind] = null; useDInputOnly[ind] = true; - LogDebug("Controller #" + (ind + 1) + " unplugged"); + LogDebug(tempType + " Controller #" + (ind + 1) + " unplugged"); } } else @@ -1167,11 +1168,12 @@ namespace DS4Windows CurrentState[ind].Battery = PreviousState[ind].Battery = 0; // Reset for the next connection's initial status change. if (!useDInputOnly[ind]) { + string tempType = outputDevices[ind].GetDeviceType(); outputDevices[ind].Disconnect(); outputDevices[ind] = null; //x360controls[ind].Disconnect(); //x360controls[ind] = null; - LogDebug("X360 Controller # " + (ind + 1) + " unplugged"); + LogDebug(tempType + " Controller # " + (ind + 1) + " unplugged"); } // Use Task to reset device synth state and commit it diff --git a/DS4Windows/DS4Control/DS4OutDevice.cs b/DS4Windows/DS4Control/DS4OutDevice.cs index a1fef13..ec1346b 100644 --- a/DS4Windows/DS4Control/DS4OutDevice.cs +++ b/DS4Windows/DS4Control/DS4OutDevice.cs @@ -11,6 +11,8 @@ namespace DS4Windows { class DS4OutDevice : OutputDevice { + public const string devtype = "DS4"; + public DualShock4Controller cont; private DualShock4Report report; @@ -79,5 +81,6 @@ namespace DS4Windows public override void Connect() => cont.Connect(); public override void Disconnect() => cont.Disconnect(); + public override string GetDeviceType() => devtype; } } diff --git a/DS4Windows/DS4Control/OutputDevice.cs b/DS4Windows/DS4Control/OutputDevice.cs index 37d76ef..3e46f52 100644 --- a/DS4Windows/DS4Control/OutputDevice.cs +++ b/DS4Windows/DS4Control/OutputDevice.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace DS4Windows { @@ -11,5 +7,6 @@ namespace DS4Windows public abstract void ConvertandSendReport(DS4State state, int device); public abstract void Connect(); public abstract void Disconnect(); + public abstract string GetDeviceType(); } } diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index 93268ff..27316a2 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -3214,10 +3214,11 @@ namespace DS4Windows } else if (xinputStatus && !xinputPlug) { + string tempType = control.outputDevices[device].GetDeviceType(); control.outputDevices[device].Disconnect(); control.outputDevices[device] = null; Global.useDInputOnly[device] = true; - AppLogger.LogToGui("Controller #" + (device + 1) + " unplugged", false); + AppLogger.LogToGui(tempType + " Controller #" + (device + 1) + " unplugged", false); } tempDev.setRumble(0, 0); diff --git a/DS4Windows/DS4Control/Xbox360OutDevice.cs b/DS4Windows/DS4Control/Xbox360OutDevice.cs index f2f83d2..5c9d7ba 100644 --- a/DS4Windows/DS4Control/Xbox360OutDevice.cs +++ b/DS4Windows/DS4Control/Xbox360OutDevice.cs @@ -14,6 +14,7 @@ namespace DS4Windows private const int inputResolution = 127 - (-128); private const float reciprocalInputResolution = 1 / (float)inputResolution; private const int outputResolution = 32767 - (-32768); + public const string devType = "X360"; public Xbox360Controller cont; private Xbox360Report report; @@ -137,5 +138,6 @@ namespace DS4Windows public override void Connect() => cont.Connect(); public override void Disconnect() => cont.Disconnect(); + public override string GetDeviceType() => devType; } }