Comment out lightbar color changing from virtual DS4

Seemed to contribute to infinite rumble for some people
but can't verify anything on my end
This commit is contained in:
Travis Nickles 2020-03-25 20:20:51 -05:00
parent 0717ba1212
commit b614366ec7

View File

@ -413,57 +413,58 @@ namespace DS4Windows
int devIndex = index; int devIndex = index;
tempDS4.cont.FeedbackReceived += (sender, args) => tempDS4.cont.FeedbackReceived += (sender, args) =>
{ {
bool useRumble = false; bool useLight = false; //bool useRumble = false; bool useLight = false;
byte largeMotor = args.LargeMotor; byte largeMotor = args.LargeMotor;
byte smallMotor = args.SmallMotor; byte smallMotor = args.SmallMotor;
DS4Color color = new DS4Color(args.LightbarColor.Red,
args.LightbarColor.Green,
args.LightbarColor.Blue);
/*Console.WriteLine("IN EVENT");
Console.WriteLine("Rumble ({0}, {1}) | Light ({2}, {3}, {4}) {5}",
largeMotor, smallMotor, color.red, color.green, color.blue, DateTime.Now.ToLongTimeString());
*/
if (largeMotor != 0 || smallMotor != 0)
{
useRumble = true;
}
if (color.red != 0 || color.green != 0 || color.blue != 0)
{
useLight = true;
}
if (!useRumble && !useLight)
{
//Console.WriteLine("Fallback");
if (device.LeftHeavySlowRumble != 0 || device.RightLightFastRumble != 0)
{
useRumble = true;
}
/*else if (device.LightBarColor.red != 0 ||
device.LightBarColor.green != 0 ||
device.LightBarColor.blue != 0)
{
useLight = true;
}
*/
}
if (useRumble)
{
//Console.WriteLine("Perform rumble");
SetDevRumble(device, largeMotor, smallMotor, devIndex); SetDevRumble(device, largeMotor, smallMotor, devIndex);
} //DS4Color color = new DS4Color(args.LightbarColor.Red,
// args.LightbarColor.Green,
// args.LightbarColor.Blue);
///*Console.WriteLine("IN EVENT");
//Console.WriteLine("Rumble ({0}, {1}) | Light ({2}, {3}, {4}) {5}",
// largeMotor, smallMotor, color.red, color.green, color.blue, DateTime.Now.ToLongTimeString());
// */
//if (largeMotor != 0 || smallMotor != 0)
//{
// useRumble = true;
//}
if (useLight) //if (color.red != 0 || color.green != 0 || color.blue != 0)
{ //{
//Console.WriteLine("Change lightbar color"); // useLight = true;
DS4HapticState haptics = new DS4HapticState //}
{
LightBarColor = color, //if (!useRumble && !useLight)
}; //{
device.SetHapticState(ref haptics); // //Console.WriteLine("Fallback");
} // if (device.LeftHeavySlowRumble != 0 || device.RightLightFastRumble != 0)
// {
// useRumble = true;
// }
// /*else if (device.LightBarColor.red != 0 ||
// device.LightBarColor.green != 0 ||
// device.LightBarColor.blue != 0)
// {
// useLight = true;
// }
// */
//}
//if (useRumble)
//{
// //Console.WriteLine("Perform rumble");
// SetDevRumble(device, largeMotor, smallMotor, devIndex);
//}
//if (useLight)
//{
// //Console.WriteLine("Change lightbar color");
// DS4HapticState haptics = new DS4HapticState
// {
// LightBarColor = color,
// };
// device.SetHapticState(ref haptics);
//}
//Console.WriteLine(); //Console.WriteLine();
}; };