Moved rumble to other tab, as well as revised it, removed rumble swap

Signed-off-by: jays2kings <jays2kings@gmail.com>
This commit is contained in:
jays2kings 2014-05-05 03:31:24 -04:00
parent cd77f86cde
commit 371353029c
5 changed files with 444 additions and 477 deletions

View File

@ -57,7 +57,7 @@ namespace DS4Control
LogDebug("Starting..."); LogDebug("Starting...");
DS4Devices.isExclusiveMode = Global.getUseExclusiveMode(); DS4Devices.isExclusiveMode = Global.getUseExclusiveMode();
LogDebug("Searching for controllers...."); LogDebug("Searching for controllers....");
LogDebug("Using " + (DS4Devices.isExclusiveMode ? "Exclusive Mode": "Shared Mode")); LogDebug("Using " + (DS4Devices.isExclusiveMode ? "Exclusive Mode" : "Shared Mode"));
try try
{ {
DS4Devices.findControllers(); DS4Devices.findControllers();
@ -94,7 +94,7 @@ namespace DS4Control
Log.LogToTray(e.Message); Log.LogToTray(e.Message);
} }
running = true; running = true;
} }
return true; return true;
} }
@ -160,7 +160,7 @@ namespace DS4Control
//TPadModeSwitcher m_switcher = new TPadModeSwitcher(device, Index); //TPadModeSwitcher m_switcher = new TPadModeSwitcher(device, Index);
//m_switcher.Debug += OnDebug; //m_switcher.Debug += OnDebug;
//modeSwitcher[Index] = m_switcher; //modeSwitcher[Index] = m_switcher;
touchPad[Index] = new Mouse(Index, device); touchPad[Index] = new Mouse(Index, device);
device.LightBarColor = Global.loadColor(Index); device.LightBarColor = Global.loadColor(Index);
device.Report += this.On_Report; device.Report += this.On_Report;
x360Bus.Plugin(Index); x360Bus.Plugin(Index);
@ -269,12 +269,12 @@ namespace DS4Control
DS4Device device = (DS4Device)sender; DS4Device device = (DS4Device)sender;
int ind=-1; int ind = -1;
for (int i=0; i<DS4Controllers.Length; i++) for (int i = 0; i < DS4Controllers.Length; i++)
if(device == DS4Controllers[i]) if (device == DS4Controllers[i])
ind = i; ind = i;
if (ind!=-1) if (ind != -1)
{ {
device.getExposedState(ExposedState[ind], CurrentState[ind]); device.getExposedState(ExposedState[ind], CurrentState[ind]);
DS4State cState = CurrentState[ind]; DS4State cState = CurrentState[ind];
@ -289,9 +289,9 @@ namespace DS4Control
{ {
//ButtonMouse mode = (ButtonMouse)modeSwitcher[ind].getCurrentMode(); //ButtonMouse mode = (ButtonMouse)modeSwitcher[ind].getCurrentMode();
// XXX so disgusting, need to virtualize this again // XXX so disgusting, need to virtualize this again
// mode.getDS4State().CopyTo(cState); // mode.getDS4State().CopyTo(cState);
} }
if (Global.getHasCustomKeysorButtons(ind)) if (Global.getHasCustomKeysorButtons(ind))
{ {
Mapping.MapCustom(ind, cState, MappedState[ind], pState); Mapping.MapCustom(ind, cState, MappedState[ind], pState);
@ -382,10 +382,7 @@ namespace DS4Control
uint heavyBoosted = ((uint)heavyMotor * (uint)boost) / 100; uint heavyBoosted = ((uint)heavyMotor * (uint)boost) / 100;
if (heavyBoosted > 255) if (heavyBoosted > 255)
heavyBoosted = 255; heavyBoosted = 255;
if (Global.getRumbleSwap(deviceNum)) DS4Controllers[deviceNum].setRumble((byte)lightBoosted, (byte)heavyBoosted);
DS4Controllers[deviceNum].setRumble((byte)heavyBoosted, (byte)lightBoosted);
else
DS4Controllers[deviceNum].setRumble((byte)lightBoosted, (byte)heavyBoosted);
} }
} }
} }

View File

@ -119,15 +119,6 @@ namespace DS4Control
m_Config.m_Rumble[device] = boost; m_Config.m_Rumble[device] = boost;
} }
public static bool getRumbleSwap(int device)
{
return m_Config.rumbleSwap[device];
}
public static void setRumbleSwap(int device, bool swap)
{
m_Config.rumbleSwap[device] = swap;
}
public static double getRainbow(int device) public static double getRainbow(int device)
{ {
return m_Config.rainbow[device]; return m_Config.rainbow[device];
@ -393,7 +384,6 @@ namespace DS4Control
public double[] m_LeftTriggerMiddle = { 0.5, 0.5, 0.5, 0.5 }, m_RightTriggerMiddle = { 0.5, 0.5, 0.5, 0.5 }; public double[] m_LeftTriggerMiddle = { 0.5, 0.5, 0.5, 0.5 }, m_RightTriggerMiddle = { 0.5, 0.5, 0.5, 0.5 };
public String[] profilePath = { String.Empty, String.Empty, String.Empty, String.Empty }; public String[] profilePath = { String.Empty, String.Empty, String.Empty, String.Empty };
public Byte[] m_Rumble = { 100, 100, 100, 100 }; public Byte[] m_Rumble = { 100, 100, 100, 100 };
public Boolean[] rumbleSwap = { false, false, false, false };
public Byte[] touchSensitivity = { 100, 100, 100, 100 }; public Byte[] touchSensitivity = { 100, 100, 100, 100 };
public Byte[] tapSensitivity = {0, 0, 0, 0}; public Byte[] tapSensitivity = {0, 0, 0, 0};
public bool[] doubleTap = { false, false, false, false }; public bool[] doubleTap = { false, false, false, false };
@ -486,7 +476,6 @@ namespace DS4Control
XmlNode xmlGreen = m_Xdoc.CreateNode(XmlNodeType.Element, "Green", null); xmlGreen.InnerText = m_Leds[device][1].ToString(); Node.AppendChild(xmlGreen); XmlNode xmlGreen = m_Xdoc.CreateNode(XmlNodeType.Element, "Green", null); xmlGreen.InnerText = m_Leds[device][1].ToString(); Node.AppendChild(xmlGreen);
XmlNode xmlBlue = m_Xdoc.CreateNode(XmlNodeType.Element, "Blue", null); xmlBlue.InnerText = m_Leds[device][2].ToString(); Node.AppendChild(xmlBlue); XmlNode xmlBlue = m_Xdoc.CreateNode(XmlNodeType.Element, "Blue", null); xmlBlue.InnerText = m_Leds[device][2].ToString(); Node.AppendChild(xmlBlue);
XmlNode xmlRumbleBoost = m_Xdoc.CreateNode(XmlNodeType.Element, "RumbleBoost", null); xmlRumbleBoost.InnerText = m_Rumble[device].ToString(); Node.AppendChild(xmlRumbleBoost); XmlNode xmlRumbleBoost = m_Xdoc.CreateNode(XmlNodeType.Element, "RumbleBoost", null); xmlRumbleBoost.InnerText = m_Rumble[device].ToString(); Node.AppendChild(xmlRumbleBoost);
XmlNode xmlRumbleSwap = m_Xdoc.CreateNode(XmlNodeType.Element, "rumbleSwap", null); xmlRumbleSwap.InnerText = rumbleSwap[device].ToString(); Node.AppendChild(xmlRumbleSwap);
XmlNode xmlLedAsBatteryIndicator = m_Xdoc.CreateNode(XmlNodeType.Element, "ledAsBatteryIndicator", null); xmlLedAsBatteryIndicator.InnerText = ledAsBattery[device].ToString(); Node.AppendChild(xmlLedAsBatteryIndicator); XmlNode xmlLedAsBatteryIndicator = m_Xdoc.CreateNode(XmlNodeType.Element, "ledAsBatteryIndicator", null); xmlLedAsBatteryIndicator.InnerText = ledAsBattery[device].ToString(); Node.AppendChild(xmlLedAsBatteryIndicator);
XmlNode xmlLowBatteryFlash = m_Xdoc.CreateNode(XmlNodeType.Element, "lowBatteryFlash", null); xmlLowBatteryFlash.InnerText = flashLedLowBattery[device].ToString(); Node.AppendChild(xmlLowBatteryFlash); XmlNode xmlLowBatteryFlash = m_Xdoc.CreateNode(XmlNodeType.Element, "lowBatteryFlash", null); xmlLowBatteryFlash.InnerText = flashLedLowBattery[device].ToString(); Node.AppendChild(xmlLowBatteryFlash);
XmlNode xmlTouchSensitivity = m_Xdoc.CreateNode(XmlNodeType.Element, "touchSensitivity", null); xmlTouchSensitivity.InnerText = touchSensitivity[device].ToString(); Node.AppendChild(xmlTouchSensitivity); XmlNode xmlTouchSensitivity = m_Xdoc.CreateNode(XmlNodeType.Element, "touchSensitivity", null); xmlTouchSensitivity.InnerText = touchSensitivity[device].ToString(); Node.AppendChild(xmlTouchSensitivity);
@ -683,9 +672,6 @@ namespace DS4Control
try { Item = m_Xdoc.SelectSingleNode("/ScpControl/RumbleBoost"); Byte.TryParse(Item.InnerText, out m_Rumble[device]); } try { Item = m_Xdoc.SelectSingleNode("/ScpControl/RumbleBoost"); Byte.TryParse(Item.InnerText, out m_Rumble[device]); }
catch { missingSetting = true; } catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/ScpControl/rumbleSwap"); Boolean.TryParse(Item.InnerText, out rumbleSwap[device]); }
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/ScpControl/ledAsBatteryIndicator"); Boolean.TryParse(Item.InnerText, out ledAsBattery[device]); } try { Item = m_Xdoc.SelectSingleNode("/ScpControl/ledAsBatteryIndicator"); Boolean.TryParse(Item.InnerText, out ledAsBattery[device]); }
catch { missingSetting = true; } catch { missingSetting = true; }
@ -831,9 +817,6 @@ namespace DS4Control
try { Item = m_Xdoc.SelectSingleNode("/ScpControl/RumbleBoost"); Byte.TryParse(Item.InnerText, out m_Rumble[device]); } try { Item = m_Xdoc.SelectSingleNode("/ScpControl/RumbleBoost"); Byte.TryParse(Item.InnerText, out m_Rumble[device]); }
catch { missingSetting = true; } catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/ScpControl/rumbleSwap"); Boolean.TryParse(Item.InnerText, out rumbleSwap[device]); }
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/ScpControl/ledAsBatteryIndicator"); Boolean.TryParse(Item.InnerText, out ledAsBattery[device]); } try { Item = m_Xdoc.SelectSingleNode("/ScpControl/ledAsBatteryIndicator"); Boolean.TryParse(Item.InnerText, out ledAsBattery[device]); }
catch { missingSetting = true; } catch { missingSetting = true; }

View File

@ -37,16 +37,6 @@
this.blueValLabel = new System.Windows.Forms.Label(); this.blueValLabel = new System.Windows.Forms.Label();
this.greenValLabel = new System.Windows.Forms.Label(); this.greenValLabel = new System.Windows.Forms.Label();
this.redValLabel = new System.Windows.Forms.Label(); this.redValLabel = new System.Windows.Forms.Label();
this.rumbleBoostMotorValLabel = new System.Windows.Forms.Label();
this.leftMotorValLabel = new System.Windows.Forms.Label();
this.rightMotorValLabel = new System.Windows.Forms.Label();
this.rightMotorLabel = new System.Windows.Forms.Label();
this.leftMotorLabel = new System.Windows.Forms.Label();
this.rumbleBoostLabel = new System.Windows.Forms.Label();
this.rightMotorBar = new System.Windows.Forms.TrackBar();
this.leftMotorBar = new System.Windows.Forms.TrackBar();
this.rumbleBoostBar = new System.Windows.Forms.TrackBar();
this.rumbleLabel = new System.Windows.Forms.Label();
this.colorLabel = new System.Windows.Forms.Label(); this.colorLabel = new System.Windows.Forms.Label();
this.saveButton = new System.Windows.Forms.Button(); this.saveButton = new System.Windows.Forms.Button();
this.batteryLed = new System.Windows.Forms.CheckBox(); this.batteryLed = new System.Windows.Forms.CheckBox();
@ -66,10 +56,7 @@
this.colorChooserButton = new System.Windows.Forms.Button(); this.colorChooserButton = new System.Windows.Forms.Button();
this.label11 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
this.rightTriggerMiddlePoint = new System.Windows.Forms.TextBox();
this.leftTriggerMiddlePoint = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.cbSixaxis = new System.Windows.Forms.CheckBox();
this.flushHIDQueue = new System.Windows.Forms.CheckBox(); this.flushHIDQueue = new System.Windows.Forms.CheckBox();
this.touchpadJitterCompensation = new System.Windows.Forms.CheckBox(); this.touchpadJitterCompensation = new System.Windows.Forms.CheckBox();
this.tabOptions = new System.Windows.Forms.TabControl(); this.tabOptions = new System.Windows.Forms.TabControl();
@ -127,24 +114,37 @@
this.numUDRainbow = new System.Windows.Forms.NumericUpDown(); this.numUDRainbow = new System.Windows.Forms.NumericUpDown();
this.pBRainbow = new System.Windows.Forms.PictureBox(); this.pBRainbow = new System.Windows.Forms.PictureBox();
this.lBspc = new System.Windows.Forms.Label(); this.lBspc = new System.Windows.Forms.Label();
this.tabRumble = new System.Windows.Forms.TabPage();
this.rumbleSwap = new System.Windows.Forms.CheckBox();
this.tabOther = new System.Windows.Forms.TabPage(); this.tabOther = new System.Windows.Forms.TabPage();
this.lBButtonMouseSens = new System.Windows.Forms.Label(); this.lBButtonMouseSens = new System.Windows.Forms.Label();
this.lBMouseSens = new System.Windows.Forms.Label(); this.lBMouseSens = new System.Windows.Forms.Label();
this.idleDisconnectTimeout = new System.Windows.Forms.NumericUpDown(); this.idleDisconnectTimeout = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.lBControllerOff = new System.Windows.Forms.Label();
this.tBMouseSens = new System.Windows.Forms.TrackBar();
this.tBProfile = new System.Windows.Forms.TextBox(); this.tBProfile = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.numUDR2 = new System.Windows.Forms.NumericUpDown();
this.numUDL2 = new System.Windows.Forms.NumericUpDown();
this.rumbleLabel = new System.Windows.Forms.Label();
this.rumbleBoostLabel = new System.Windows.Forms.Label();
this.leftMotorLabel = new System.Windows.Forms.Label();
this.rightMotorLabel = new System.Windows.Forms.Label();
this.rumbleBoostBar = new System.Windows.Forms.NumericUpDown();
this.numUDHeavyRumble = new System.Windows.Forms.NumericUpDown();
this.numUDLightRumble = new System.Windows.Forms.NumericUpDown();
this.btnRumbleTest = new System.Windows.Forms.Button();
this.tBMouseSens = new System.Windows.Forms.TrackBar();
this.tBsixaxisAccelZ = new System.Windows.Forms.TrackBar();
this.tBsixaxisAccelY = new System.Windows.Forms.TrackBar();
this.tBsixaxisAccelX = new System.Windows.Forms.TrackBar();
this.tBsixaxisGyroZ = new System.Windows.Forms.TrackBar();
this.tBsixaxisGyroY = new System.Windows.Forms.TrackBar();
this.tBsixaxisGyroX = new System.Windows.Forms.TrackBar();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.advColorDialog = new ScpServer.AdvancedColorDialog(); this.advColorDialog = new ScpServer.AdvancedColorDialog();
((System.ComponentModel.ISupportInitialize)(this.blueBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.blueBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.greenBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.greenBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.redBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.redBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rightMotorBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.leftMotorBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rumbleBoostBar)).BeginInit();
this.lowLedPanel.SuspendLayout(); this.lowLedPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.lowBlueBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lowBlueBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.lowGreenBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lowGreenBar)).BeginInit();
@ -163,10 +163,20 @@
this.tabLightBar.SuspendLayout(); this.tabLightBar.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numUDRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pBRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pBRainbow)).BeginInit();
this.tabRumble.SuspendLayout();
this.tabOther.SuspendLayout(); this.tabOther.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.idleDisconnectTimeout)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.idleDisconnectTimeout)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDR2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDL2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rumbleBoostBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDHeavyRumble)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDLightRumble)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBMouseSens)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBMouseSens)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelZ)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelY)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroZ)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroY)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroX)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// BlueLabel // BlueLabel
@ -271,116 +281,6 @@
this.redValLabel.Text = "255"; this.redValLabel.Text = "255";
this.redValLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.redValLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// rumbleBoostMotorValLabel
//
this.rumbleBoostMotorValLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.rumbleBoostMotorValLabel.Location = new System.Drawing.Point(354, 43);
this.rumbleBoostMotorValLabel.Name = "rumbleBoostMotorValLabel";
this.rumbleBoostMotorValLabel.Size = new System.Drawing.Size(30, 13);
this.rumbleBoostMotorValLabel.TabIndex = 27;
this.rumbleBoostMotorValLabel.Text = "100";
this.rumbleBoostMotorValLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// leftMotorValLabel
//
this.leftMotorValLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.leftMotorValLabel.Location = new System.Drawing.Point(354, 72);
this.leftMotorValLabel.Name = "leftMotorValLabel";
this.leftMotorValLabel.Size = new System.Drawing.Size(30, 13);
this.leftMotorValLabel.TabIndex = 26;
this.leftMotorValLabel.Text = "0";
this.leftMotorValLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// rightMotorValLabel
//
this.rightMotorValLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.rightMotorValLabel.Location = new System.Drawing.Point(354, 103);
this.rightMotorValLabel.Name = "rightMotorValLabel";
this.rightMotorValLabel.Size = new System.Drawing.Size(30, 13);
this.rightMotorValLabel.TabIndex = 25;
this.rightMotorValLabel.Text = "0";
this.rightMotorValLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// rightMotorLabel
//
this.rightMotorLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.rightMotorLabel.AutoSize = true;
this.rightMotorLabel.Location = new System.Drawing.Point(9, 108);
this.rightMotorLabel.Name = "rightMotorLabel";
this.rightMotorLabel.Size = new System.Drawing.Size(30, 13);
this.rightMotorLabel.TabIndex = 24;
this.rightMotorLabel.Text = "Light";
//
// leftMotorLabel
//
this.leftMotorLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.leftMotorLabel.AutoSize = true;
this.leftMotorLabel.Location = new System.Drawing.Point(5, 77);
this.leftMotorLabel.Name = "leftMotorLabel";
this.leftMotorLabel.Size = new System.Drawing.Size(38, 13);
this.leftMotorLabel.TabIndex = 23;
this.leftMotorLabel.Text = "Heavy";
//
// rumbleBoostLabel
//
this.rumbleBoostLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.rumbleBoostLabel.AutoSize = true;
this.rumbleBoostLabel.Location = new System.Drawing.Point(7, 48);
this.rumbleBoostLabel.Name = "rumbleBoostLabel";
this.rumbleBoostLabel.Size = new System.Drawing.Size(34, 13);
this.rumbleBoostLabel.TabIndex = 22;
this.rumbleBoostLabel.Text = "Boost";
//
// rightMotorBar
//
this.rightMotorBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.rightMotorBar.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.rightMotorBar.Location = new System.Drawing.Point(63, 100);
this.rightMotorBar.Maximum = 255;
this.rightMotorBar.Name = "rightMotorBar";
this.rightMotorBar.Size = new System.Drawing.Size(288, 45);
this.rightMotorBar.TabIndex = 21;
this.rightMotorBar.TickFrequency = 25;
this.rightMotorBar.TickStyle = System.Windows.Forms.TickStyle.None;
this.rightMotorBar.ValueChanged += new System.EventHandler(this.rightMotorBar_ValueChanged);
//
// leftMotorBar
//
this.leftMotorBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.leftMotorBar.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.leftMotorBar.Location = new System.Drawing.Point(63, 70);
this.leftMotorBar.Maximum = 255;
this.leftMotorBar.Name = "leftMotorBar";
this.leftMotorBar.Size = new System.Drawing.Size(288, 45);
this.leftMotorBar.TabIndex = 20;
this.leftMotorBar.TickFrequency = 25;
this.leftMotorBar.TickStyle = System.Windows.Forms.TickStyle.None;
this.leftMotorBar.ValueChanged += new System.EventHandler(this.leftMotorBar_ValueChanged);
//
// rumbleBoostBar
//
this.rumbleBoostBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.rumbleBoostBar.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.rumbleBoostBar.Location = new System.Drawing.Point(63, 40);
this.rumbleBoostBar.Maximum = 200;
this.rumbleBoostBar.Name = "rumbleBoostBar";
this.rumbleBoostBar.Size = new System.Drawing.Size(288, 45);
this.rumbleBoostBar.TabIndex = 19;
this.rumbleBoostBar.TickFrequency = 25;
this.rumbleBoostBar.TickStyle = System.Windows.Forms.TickStyle.None;
this.rumbleBoostBar.Value = 100;
this.rumbleBoostBar.ValueChanged += new System.EventHandler(this.rumbleBoostBar_ValueChanged);
//
// rumbleLabel
//
this.rumbleLabel.AutoSize = true;
this.rumbleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rumbleLabel.Location = new System.Drawing.Point(3, 23);
this.rumbleLabel.Name = "rumbleLabel";
this.rumbleLabel.Size = new System.Drawing.Size(44, 13);
this.rumbleLabel.TabIndex = 28;
this.rumbleLabel.Text = "Levels";
//
// colorLabel // colorLabel
// //
this.colorLabel.AutoSize = true; this.colorLabel.AutoSize = true;
@ -592,7 +492,7 @@
// label11 // label11
// //
this.label11.AutoSize = true; this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(93, 41); this.label11.Location = new System.Drawing.Point(165, 77);
this.label11.Name = "label11"; this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(21, 13); this.label11.Size = new System.Drawing.Size(21, 13);
this.label11.TabIndex = 78; this.label11.TabIndex = 78;
@ -601,52 +501,21 @@
// label10 // label10
// //
this.label10.AutoSize = true; this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(37, 41); this.label10.Location = new System.Drawing.Point(67, 77);
this.label10.Name = "label10"; this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(19, 13); this.label10.Size = new System.Drawing.Size(19, 13);
this.label10.TabIndex = 77; this.label10.TabIndex = 77;
this.label10.Text = "L2"; this.label10.Text = "L2";
// //
// rightTriggerMiddlePoint
//
this.rightTriggerMiddlePoint.Location = new System.Drawing.Point(77, 56);
this.rightTriggerMiddlePoint.Margin = new System.Windows.Forms.Padding(2);
this.rightTriggerMiddlePoint.MaxLength = 20;
this.rightTriggerMiddlePoint.Name = "rightTriggerMiddlePoint";
this.rightTriggerMiddlePoint.Size = new System.Drawing.Size(52, 20);
this.rightTriggerMiddlePoint.TabIndex = 76;
this.rightTriggerMiddlePoint.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// leftTriggerMiddlePoint
//
this.leftTriggerMiddlePoint.Location = new System.Drawing.Point(21, 56);
this.leftTriggerMiddlePoint.Margin = new System.Windows.Forms.Padding(2);
this.leftTriggerMiddlePoint.MaxLength = 20;
this.leftTriggerMiddlePoint.Name = "leftTriggerMiddlePoint";
this.leftTriggerMiddlePoint.Size = new System.Drawing.Size(52, 20);
this.leftTriggerMiddlePoint.TabIndex = 75;
this.leftTriggerMiddlePoint.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label9 // label9
// //
this.label9.AutoSize = true; this.label9.AutoSize = true;
this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label9.Location = new System.Drawing.Point(34, 13); this.label9.Location = new System.Drawing.Point(4, 77);
this.label9.Name = "label9"; this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(90, 13); this.label9.Size = new System.Drawing.Size(57, 13);
this.label9.TabIndex = 74; this.label9.TabIndex = 74;
this.label9.Text = "Trigger Threshold"; this.label9.Text = "Threshold:";
//
// cbSixaxis
//
this.cbSixaxis.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cbSixaxis.AutoSize = true;
this.cbSixaxis.Location = new System.Drawing.Point(177, 59);
this.cbSixaxis.Name = "cbSixaxis";
this.cbSixaxis.Size = new System.Drawing.Size(141, 17);
this.cbSixaxis.TabIndex = 79;
this.cbSixaxis.Text = "Sixaxis Gyro/Accel Data";
this.cbSixaxis.CheckedChanged += new System.EventHandler(this.cbSixaxis_CheckedChanged);
// //
// flushHIDQueue // flushHIDQueue
// //
@ -654,11 +523,12 @@
this.flushHIDQueue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.flushHIDQueue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.flushHIDQueue.AutoSize = true; this.flushHIDQueue.AutoSize = true;
this.flushHIDQueue.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.flushHIDQueue.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.flushHIDQueue.Location = new System.Drawing.Point(177, 36); this.flushHIDQueue.Location = new System.Drawing.Point(311, 12);
this.flushHIDQueue.Name = "flushHIDQueue"; this.flushHIDQueue.Name = "flushHIDQueue";
this.flushHIDQueue.Size = new System.Drawing.Size(195, 17); this.flushHIDQueue.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.flushHIDQueue.Size = new System.Drawing.Size(106, 17);
this.flushHIDQueue.TabIndex = 80; this.flushHIDQueue.TabIndex = 80;
this.flushHIDQueue.Text = "Flush HID queue after each reading"; this.flushHIDQueue.Text = "Flush HID queue";
this.flushHIDQueue.UseVisualStyleBackColor = true; this.flushHIDQueue.UseVisualStyleBackColor = true;
this.flushHIDQueue.CheckedChanged += new System.EventHandler(this.flushHIDQueue_CheckedChanged); this.flushHIDQueue.CheckedChanged += new System.EventHandler(this.flushHIDQueue_CheckedChanged);
// //
@ -684,7 +554,6 @@
this.tabOptions.Controls.Add(this.tabAnalogSticks); this.tabOptions.Controls.Add(this.tabAnalogSticks);
this.tabOptions.Controls.Add(this.tabTouchPad); this.tabOptions.Controls.Add(this.tabTouchPad);
this.tabOptions.Controls.Add(this.tabLightBar); this.tabOptions.Controls.Add(this.tabLightBar);
this.tabOptions.Controls.Add(this.tabRumble);
this.tabOptions.Controls.Add(this.tabOther); this.tabOptions.Controls.Add(this.tabOther);
this.tabOptions.Location = new System.Drawing.Point(12, 12); this.tabOptions.Location = new System.Drawing.Point(12, 12);
this.tabOptions.Name = "tabOptions"; this.tabOptions.Name = "tabOptions";
@ -1708,53 +1577,35 @@
this.lBspc.Text = "seconds per cycle"; this.lBspc.Text = "seconds per cycle";
this.lBspc.Visible = false; this.lBspc.Visible = false;
// //
// tabRumble
//
this.tabRumble.Controls.Add(this.rumbleSwap);
this.tabRumble.Controls.Add(this.rightMotorBar);
this.tabRumble.Controls.Add(this.leftMotorBar);
this.tabRumble.Controls.Add(this.rumbleLabel);
this.tabRumble.Controls.Add(this.rumbleBoostBar);
this.tabRumble.Controls.Add(this.rumbleBoostLabel);
this.tabRumble.Controls.Add(this.leftMotorLabel);
this.tabRumble.Controls.Add(this.rightMotorLabel);
this.tabRumble.Controls.Add(this.rightMotorValLabel);
this.tabRumble.Controls.Add(this.leftMotorValLabel);
this.tabRumble.Controls.Add(this.rumbleBoostMotorValLabel);
this.tabRumble.Location = new System.Drawing.Point(4, 22);
this.tabRumble.Name = "tabRumble";
this.tabRumble.Padding = new System.Windows.Forms.Padding(3);
this.tabRumble.Size = new System.Drawing.Size(425, 170);
this.tabRumble.TabIndex = 1;
this.tabRumble.Text = "Rumble";
this.tabRumble.UseVisualStyleBackColor = true;
//
// rumbleSwap
//
this.rumbleSwap.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rumbleSwap.AutoSize = true;
this.rumbleSwap.Location = new System.Drawing.Point(6, 137);
this.rumbleSwap.Name = "rumbleSwap";
this.rumbleSwap.Size = new System.Drawing.Size(349, 17);
this.rumbleSwap.TabIndex = 36;
this.rumbleSwap.Text = "Swap rumble input (matches left/right instead of heavy/light aspects)";
this.rumbleSwap.UseVisualStyleBackColor = true;
this.rumbleSwap.CheckedChanged += new System.EventHandler(this.rumbleSwap_CheckedChanged);
//
// tabOther // tabOther
// //
this.tabOther.Controls.Add(this.tBsixaxisAccelZ);
this.tabOther.Controls.Add(this.tBsixaxisAccelY);
this.tabOther.Controls.Add(this.tBsixaxisAccelX);
this.tabOther.Controls.Add(this.tBsixaxisGyroZ);
this.tabOther.Controls.Add(this.tBsixaxisGyroY);
this.tabOther.Controls.Add(this.tBsixaxisGyroX);
this.tabOther.Controls.Add(this.label6);
this.tabOther.Controls.Add(this.label5);
this.tabOther.Controls.Add(this.btnRumbleTest);
this.tabOther.Controls.Add(this.numUDLightRumble);
this.tabOther.Controls.Add(this.numUDHeavyRumble);
this.tabOther.Controls.Add(this.rumbleBoostBar);
this.tabOther.Controls.Add(this.rumbleLabel);
this.tabOther.Controls.Add(this.rumbleBoostLabel);
this.tabOther.Controls.Add(this.leftMotorLabel);
this.tabOther.Controls.Add(this.rightMotorLabel);
this.tabOther.Controls.Add(this.lBButtonMouseSens); this.tabOther.Controls.Add(this.lBButtonMouseSens);
this.tabOther.Controls.Add(this.lBMouseSens); this.tabOther.Controls.Add(this.lBMouseSens);
this.tabOther.Controls.Add(this.numUDL2);
this.tabOther.Controls.Add(this.numUDR2);
this.tabOther.Controls.Add(this.idleDisconnectTimeout); this.tabOther.Controls.Add(this.idleDisconnectTimeout);
this.tabOther.Controls.Add(this.label3); this.tabOther.Controls.Add(this.label3);
this.tabOther.Controls.Add(this.label2); this.tabOther.Controls.Add(this.lBControllerOff);
this.tabOther.Controls.Add(this.cbSixaxis);
this.tabOther.Controls.Add(this.label11); this.tabOther.Controls.Add(this.label11);
this.tabOther.Controls.Add(this.flushHIDQueue); this.tabOther.Controls.Add(this.flushHIDQueue);
this.tabOther.Controls.Add(this.label10); this.tabOther.Controls.Add(this.label10);
this.tabOther.Controls.Add(this.label9); this.tabOther.Controls.Add(this.label9);
this.tabOther.Controls.Add(this.rightTriggerMiddlePoint);
this.tabOther.Controls.Add(this.leftTriggerMiddlePoint);
this.tabOther.Controls.Add(this.tBMouseSens); this.tabOther.Controls.Add(this.tBMouseSens);
this.tabOther.Location = new System.Drawing.Point(4, 22); this.tabOther.Location = new System.Drawing.Point(4, 22);
this.tabOther.Name = "tabOther"; this.tabOther.Name = "tabOther";
@ -1766,15 +1617,17 @@
// lBButtonMouseSens // lBButtonMouseSens
// //
this.lBButtonMouseSens.AutoSize = true; this.lBButtonMouseSens.AutoSize = true;
this.lBButtonMouseSens.Location = new System.Drawing.Point(158, 11); this.lBButtonMouseSens.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lBButtonMouseSens.Location = new System.Drawing.Point(7, 13);
this.lBButtonMouseSens.Name = "lBButtonMouseSens"; this.lBButtonMouseSens.Name = "lBButtonMouseSens";
this.lBButtonMouseSens.Size = new System.Drawing.Size(134, 13); this.lBButtonMouseSens.Size = new System.Drawing.Size(137, 13);
this.lBButtonMouseSens.TabIndex = 87; this.lBButtonMouseSens.TabIndex = 87;
this.lBButtonMouseSens.Text = "Mouse Sensitivity (Buttons)"; this.lBButtonMouseSens.Text = "Mouse Sensitivity (Buttons):";
this.lBButtonMouseSens.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// lBMouseSens // lBMouseSens
// //
this.lBMouseSens.Location = new System.Drawing.Point(392, 13); this.lBMouseSens.Location = new System.Drawing.Point(275, 13);
this.lBMouseSens.Name = "lBMouseSens"; this.lBMouseSens.Name = "lBMouseSens";
this.lBMouseSens.Size = new System.Drawing.Size(30, 13); this.lBMouseSens.Size = new System.Drawing.Size(30, 13);
this.lBMouseSens.TabIndex = 86; this.lBMouseSens.TabIndex = 86;
@ -1783,7 +1636,7 @@
// //
// idleDisconnectTimeout // idleDisconnectTimeout
// //
this.idleDisconnectTimeout.Location = new System.Drawing.Point(6, 107); this.idleDisconnectTimeout.Location = new System.Drawing.Point(107, 43);
this.idleDisconnectTimeout.Maximum = new decimal(new int[] { this.idleDisconnectTimeout.Maximum = new decimal(new int[] {
3600, 3600,
0, 0,
@ -1797,32 +1650,21 @@
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(63, 109); this.label3.Location = new System.Drawing.Point(165, 45);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(110, 13); this.label3.Size = new System.Drawing.Size(106, 13);
this.label3.TabIndex = 83; this.label3.TabIndex = 83;
this.label3.Text = "seconds (0 to disable)"; this.label3.Text = "minutes (0 to disable)";
// //
// label2 // lBControllerOff
// //
this.label2.AutoSize = true; this.lBControllerOff.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 91); this.lBControllerOff.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Name = "label2"; this.lBControllerOff.Location = new System.Drawing.Point(4, 45);
this.label2.Size = new System.Drawing.Size(130, 13); this.lBControllerOff.Name = "lBControllerOff";
this.label2.TabIndex = 81; this.lBControllerOff.Size = new System.Drawing.Size(96, 13);
this.label2.Text = "Idle disconnection timeout"; this.lBControllerOff.TabIndex = 81;
// this.lBControllerOff.Text = "Controller Auto-Off:";
// tBMouseSens
//
this.tBMouseSens.BackColor = System.Drawing.Color.White;
this.tBMouseSens.Location = new System.Drawing.Point(292, 8);
this.tBMouseSens.Maximum = 117;
this.tBMouseSens.Name = "tBMouseSens";
this.tBMouseSens.Size = new System.Drawing.Size(104, 45);
this.tBMouseSens.TabIndex = 85;
this.tBMouseSens.TickStyle = System.Windows.Forms.TickStyle.None;
this.tBMouseSens.Value = 50;
this.tBMouseSens.Scroll += new System.EventHandler(this.tBMouseSens_Scroll);
// //
// tBProfile // tBProfile
// //
@ -1846,6 +1688,246 @@
this.label4.TabIndex = 84; this.label4.TabIndex = 84;
this.label4.Text = "Profile Name:"; this.label4.Text = "Profile Name:";
// //
// numUDR2
//
this.numUDR2.DecimalPlaces = 1;
this.numUDR2.Location = new System.Drawing.Point(203, 75);
this.numUDR2.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.numUDR2.Name = "numUDR2";
this.numUDR2.Size = new System.Drawing.Size(52, 20);
this.numUDR2.TabIndex = 84;
this.numUDR2.Value = new decimal(new int[] {
5,
0,
0,
65536});
this.numUDR2.ValueChanged += new System.EventHandler(this.numUDR2_ValueChanged);
//
// numUDL2
//
this.numUDL2.DecimalPlaces = 1;
this.numUDL2.Location = new System.Drawing.Point(107, 75);
this.numUDL2.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.numUDL2.Name = "numUDL2";
this.numUDL2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.numUDL2.Size = new System.Drawing.Size(52, 20);
this.numUDL2.TabIndex = 84;
this.numUDL2.Value = new decimal(new int[] {
5,
0,
0,
65536});
this.numUDL2.ValueChanged += new System.EventHandler(this.numUDL2_ValueChanged);
//
// rumbleLabel
//
this.rumbleLabel.AutoSize = true;
this.rumbleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rumbleLabel.Location = new System.Drawing.Point(4, 109);
this.rumbleLabel.Name = "rumbleLabel";
this.rumbleLabel.Size = new System.Drawing.Size(46, 13);
this.rumbleLabel.TabIndex = 98;
this.rumbleLabel.Text = "Rumble:";
//
// rumbleBoostLabel
//
this.rumbleBoostLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.rumbleBoostLabel.AutoSize = true;
this.rumbleBoostLabel.Location = new System.Drawing.Point(67, 109);
this.rumbleBoostLabel.Name = "rumbleBoostLabel";
this.rumbleBoostLabel.Size = new System.Drawing.Size(34, 13);
this.rumbleBoostLabel.TabIndex = 92;
this.rumbleBoostLabel.Text = "Boost";
//
// leftMotorLabel
//
this.leftMotorLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.leftMotorLabel.AutoSize = true;
this.leftMotorLabel.Location = new System.Drawing.Point(264, 109);
this.leftMotorLabel.Name = "leftMotorLabel";
this.leftMotorLabel.Size = new System.Drawing.Size(38, 13);
this.leftMotorLabel.TabIndex = 93;
this.leftMotorLabel.Text = "Heavy";
//
// rightMotorLabel
//
this.rightMotorLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.rightMotorLabel.AutoSize = true;
this.rightMotorLabel.Location = new System.Drawing.Point(165, 109);
this.rightMotorLabel.Name = "rightMotorLabel";
this.rightMotorLabel.Size = new System.Drawing.Size(30, 13);
this.rightMotorLabel.TabIndex = 94;
this.rightMotorLabel.Text = "Light";
//
// rumbleBoostBar
//
this.rumbleBoostBar.Location = new System.Drawing.Point(107, 107);
this.rumbleBoostBar.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.rumbleBoostBar.Name = "rumbleBoostBar";
this.rumbleBoostBar.Size = new System.Drawing.Size(52, 20);
this.rumbleBoostBar.TabIndex = 99;
this.rumbleBoostBar.Value = new decimal(new int[] {
100,
0,
0,
0});
//
// numUDHeavyRumble
//
this.numUDHeavyRumble.Location = new System.Drawing.Point(308, 107);
this.numUDHeavyRumble.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.numUDHeavyRumble.Name = "numUDHeavyRumble";
this.numUDHeavyRumble.Size = new System.Drawing.Size(52, 20);
this.numUDHeavyRumble.TabIndex = 99;
//
// numUDLightRumble
//
this.numUDLightRumble.Location = new System.Drawing.Point(203, 107);
this.numUDLightRumble.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.numUDLightRumble.Name = "numUDLightRumble";
this.numUDLightRumble.Size = new System.Drawing.Size(52, 20);
this.numUDLightRumble.TabIndex = 99;
//
// btnRumbleTest
//
this.btnRumbleTest.Location = new System.Drawing.Point(368, 105);
this.btnRumbleTest.Name = "btnRumbleTest";
this.btnRumbleTest.Size = new System.Drawing.Size(53, 23);
this.btnRumbleTest.TabIndex = 100;
this.btnRumbleTest.Text = "Test";
this.btnRumbleTest.UseVisualStyleBackColor = true;
this.btnRumbleTest.Click += new System.EventHandler(this.btnRumbleTest_Click);
//
// tBMouseSens
//
this.tBMouseSens.BackColor = System.Drawing.Color.White;
this.tBMouseSens.Location = new System.Drawing.Point(144, 10);
this.tBMouseSens.Maximum = 117;
this.tBMouseSens.Name = "tBMouseSens";
this.tBMouseSens.Size = new System.Drawing.Size(131, 45);
this.tBMouseSens.TabIndex = 85;
this.tBMouseSens.TickStyle = System.Windows.Forms.TickStyle.None;
this.tBMouseSens.Value = 50;
this.tBMouseSens.Scroll += new System.EventHandler(this.tBMouseSens_Scroll);
//
// tBsixaxisAccelZ
//
this.tBsixaxisAccelZ.AutoSize = false;
this.tBsixaxisAccelZ.BackColor = System.Drawing.SystemColors.Window;
this.tBsixaxisAccelZ.Enabled = false;
this.tBsixaxisAccelZ.Location = new System.Drawing.Point(374, 146);
this.tBsixaxisAccelZ.Maximum = 32767;
this.tBsixaxisAccelZ.Minimum = -32768;
this.tBsixaxisAccelZ.Name = "tBsixaxisAccelZ";
this.tBsixaxisAccelZ.Size = new System.Drawing.Size(50, 19);
this.tBsixaxisAccelZ.TabIndex = 103;
this.tBsixaxisAccelZ.TickFrequency = 16384;
//
// tBsixaxisAccelY
//
this.tBsixaxisAccelY.AutoSize = false;
this.tBsixaxisAccelY.BackColor = System.Drawing.SystemColors.Window;
this.tBsixaxisAccelY.Enabled = false;
this.tBsixaxisAccelY.Location = new System.Drawing.Point(327, 146);
this.tBsixaxisAccelY.Maximum = 32767;
this.tBsixaxisAccelY.Minimum = -32768;
this.tBsixaxisAccelY.Name = "tBsixaxisAccelY";
this.tBsixaxisAccelY.Size = new System.Drawing.Size(50, 19);
this.tBsixaxisAccelY.TabIndex = 104;
this.tBsixaxisAccelY.TickFrequency = 16384;
//
// tBsixaxisAccelX
//
this.tBsixaxisAccelX.AutoSize = false;
this.tBsixaxisAccelX.BackColor = System.Drawing.SystemColors.Window;
this.tBsixaxisAccelX.Enabled = false;
this.tBsixaxisAccelX.Location = new System.Drawing.Point(281, 146);
this.tBsixaxisAccelX.Maximum = 32767;
this.tBsixaxisAccelX.Minimum = -32768;
this.tBsixaxisAccelX.Name = "tBsixaxisAccelX";
this.tBsixaxisAccelX.Size = new System.Drawing.Size(50, 19);
this.tBsixaxisAccelX.TabIndex = 105;
this.tBsixaxisAccelX.TickFrequency = 16384;
//
// tBsixaxisGyroZ
//
this.tBsixaxisGyroZ.AutoSize = false;
this.tBsixaxisGyroZ.BackColor = System.Drawing.SystemColors.Window;
this.tBsixaxisGyroZ.Enabled = false;
this.tBsixaxisGyroZ.Location = new System.Drawing.Point(162, 146);
this.tBsixaxisGyroZ.Maximum = 32767;
this.tBsixaxisGyroZ.Minimum = -32768;
this.tBsixaxisGyroZ.Name = "tBsixaxisGyroZ";
this.tBsixaxisGyroZ.Size = new System.Drawing.Size(50, 19);
this.tBsixaxisGyroZ.TabIndex = 106;
this.tBsixaxisGyroZ.TickFrequency = 16384;
//
// tBsixaxisGyroY
//
this.tBsixaxisGyroY.AutoSize = false;
this.tBsixaxisGyroY.BackColor = System.Drawing.SystemColors.Window;
this.tBsixaxisGyroY.Enabled = false;
this.tBsixaxisGyroY.Location = new System.Drawing.Point(115, 146);
this.tBsixaxisGyroY.Maximum = 32767;
this.tBsixaxisGyroY.Minimum = -32768;
this.tBsixaxisGyroY.Name = "tBsixaxisGyroY";
this.tBsixaxisGyroY.Size = new System.Drawing.Size(50, 19);
this.tBsixaxisGyroY.TabIndex = 107;
this.tBsixaxisGyroY.TickFrequency = 16384;
//
// tBsixaxisGyroX
//
this.tBsixaxisGyroX.AutoSize = false;
this.tBsixaxisGyroX.BackColor = System.Drawing.SystemColors.Window;
this.tBsixaxisGyroX.Enabled = false;
this.tBsixaxisGyroX.Location = new System.Drawing.Point(68, 146);
this.tBsixaxisGyroX.Maximum = 32767;
this.tBsixaxisGyroX.Minimum = -32768;
this.tBsixaxisGyroX.Name = "tBsixaxisGyroX";
this.tBsixaxisGyroX.Size = new System.Drawing.Size(50, 19);
this.tBsixaxisGyroX.TabIndex = 108;
this.tBsixaxisGyroX.TickFrequency = 16384;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label6.Location = new System.Drawing.Point(212, 146);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(72, 13);
this.label6.TabIndex = 101;
this.label6.Text = "Sixaxis Accel:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(4, 146);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(67, 13);
this.label5.TabIndex = 102;
this.label5.Text = "Sixaxis Gyro:";
//
// advColorDialog // advColorDialog
// //
this.advColorDialog.AnyColor = true; this.advColorDialog.AnyColor = true;
@ -1872,9 +1954,6 @@
((System.ComponentModel.ISupportInitialize)(this.blueBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.blueBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.greenBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.greenBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.redBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.redBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rightMotorBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.leftMotorBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rumbleBoostBar)).EndInit();
this.lowLedPanel.ResumeLayout(false); this.lowLedPanel.ResumeLayout(false);
this.lowLedPanel.PerformLayout(); this.lowLedPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.lowBlueBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lowBlueBar)).EndInit();
@ -1899,12 +1978,21 @@
this.tabLightBar.PerformLayout(); this.tabLightBar.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numUDRainbow)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numUDRainbow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pBRainbow)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pBRainbow)).EndInit();
this.tabRumble.ResumeLayout(false);
this.tabRumble.PerformLayout();
this.tabOther.ResumeLayout(false); this.tabOther.ResumeLayout(false);
this.tabOther.PerformLayout(); this.tabOther.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.idleDisconnectTimeout)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.idleDisconnectTimeout)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDR2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDL2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rumbleBoostBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDHeavyRumble)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDLightRumble)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBMouseSens)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tBMouseSens)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelZ)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelY)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroZ)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroY)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroX)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -1920,16 +2008,6 @@
private System.Windows.Forms.Label blueValLabel; private System.Windows.Forms.Label blueValLabel;
private System.Windows.Forms.Label greenValLabel; private System.Windows.Forms.Label greenValLabel;
private System.Windows.Forms.Label redValLabel; private System.Windows.Forms.Label redValLabel;
private System.Windows.Forms.Label rumbleBoostMotorValLabel;
private System.Windows.Forms.Label leftMotorValLabel;
private System.Windows.Forms.Label rightMotorValLabel;
private System.Windows.Forms.Label rightMotorLabel;
private System.Windows.Forms.Label leftMotorLabel;
private System.Windows.Forms.Label rumbleBoostLabel;
private System.Windows.Forms.TrackBar rightMotorBar;
private System.Windows.Forms.TrackBar leftMotorBar;
private System.Windows.Forms.TrackBar rumbleBoostBar;
private System.Windows.Forms.Label rumbleLabel;
private System.Windows.Forms.Label colorLabel; private System.Windows.Forms.Label colorLabel;
private System.Windows.Forms.TrackBar redBar; private System.Windows.Forms.TrackBar redBar;
private System.Windows.Forms.Button saveButton; private System.Windows.Forms.Button saveButton;
@ -1950,20 +2028,15 @@
//private System.Windows.Forms.TrackBar tBsixaxisGyroY; //private System.Windows.Forms.TrackBar tBsixaxisGyroY;
private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox rightTriggerMiddlePoint;
private System.Windows.Forms.TextBox leftTriggerMiddlePoint;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.CheckBox cbSixaxis;
private System.Windows.Forms.CheckBox flushHIDQueue; private System.Windows.Forms.CheckBox flushHIDQueue;
private System.Windows.Forms.CheckBox touchpadJitterCompensation; private System.Windows.Forms.CheckBox touchpadJitterCompensation;
private System.Windows.Forms.TabControl tabOptions; private System.Windows.Forms.TabControl tabOptions;
private System.Windows.Forms.TabPage tabLightBar; private System.Windows.Forms.TabPage tabLightBar;
private System.Windows.Forms.TabPage tabRumble;
private System.Windows.Forms.TabPage tabTouchPad; private System.Windows.Forms.TabPage tabTouchPad;
private System.Windows.Forms.TabPage tabOther; private System.Windows.Forms.TabPage tabOther;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label lBControllerOff;
private System.Windows.Forms.CheckBox rumbleSwap;
private System.Windows.Forms.TabPage tabControls; private System.Windows.Forms.TabPage tabControls;
private System.Windows.Forms.TabPage tabAnalogSticks; private System.Windows.Forms.TabPage tabAnalogSticks;
private System.Windows.Forms.NumericUpDown numUDScroll; private System.Windows.Forms.NumericUpDown numUDScroll;
@ -2017,7 +2090,6 @@
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox cBDoubleTap; private System.Windows.Forms.CheckBox cBDoubleTap;
private System.Windows.Forms.Label lBMouseSens; private System.Windows.Forms.Label lBMouseSens;
private System.Windows.Forms.TrackBar tBMouseSens;
private System.Windows.Forms.Label lBButtonMouseSens; private System.Windows.Forms.Label lBButtonMouseSens;
private System.Windows.Forms.NumericUpDown numUDRainbow; private System.Windows.Forms.NumericUpDown numUDRainbow;
private System.Windows.Forms.PictureBox pBRainbow; private System.Windows.Forms.PictureBox pBRainbow;
@ -2025,6 +2097,25 @@
private System.Windows.Forms.TrackBar lowBlueBar; private System.Windows.Forms.TrackBar lowBlueBar;
private System.Windows.Forms.TrackBar lowGreenBar; private System.Windows.Forms.TrackBar lowGreenBar;
private System.Windows.Forms.TrackBar lowRedBar; private System.Windows.Forms.TrackBar lowRedBar;
private System.Windows.Forms.NumericUpDown numUDL2;
private System.Windows.Forms.NumericUpDown numUDR2;
private System.Windows.Forms.Label rumbleLabel;
private System.Windows.Forms.Label rumbleBoostLabel;
private System.Windows.Forms.Label leftMotorLabel;
private System.Windows.Forms.Label rightMotorLabel;
private System.Windows.Forms.NumericUpDown numUDLightRumble;
private System.Windows.Forms.NumericUpDown numUDHeavyRumble;
private System.Windows.Forms.NumericUpDown rumbleBoostBar;
private System.Windows.Forms.Button btnRumbleTest;
private System.Windows.Forms.TrackBar tBsixaxisAccelZ;
private System.Windows.Forms.TrackBar tBsixaxisAccelY;
private System.Windows.Forms.TrackBar tBsixaxisAccelX;
private System.Windows.Forms.TrackBar tBsixaxisGyroZ;
private System.Windows.Forms.TrackBar tBsixaxisGyroY;
private System.Windows.Forms.TrackBar tBsixaxisGyroX;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TrackBar tBMouseSens;
} }
} }
 

View File

@ -15,11 +15,8 @@ namespace ScpServer
private string filename; private string filename;
private ScpForm mainWin; private ScpForm mainWin;
Byte[] oldLedColor, oldLowLedColor; Byte[] oldLedColor, oldLowLedColor;
TrackBar tBsixaxisGyroX, tBsixaxisGyroY, tBsixaxisGyroZ,
tBsixaxisAccelX, tBsixaxisAccelY, tBsixaxisAccelZ;
Timer sixaxisTimer = new Timer(); Timer sixaxisTimer = new Timer();
private List<Button> buttons = new List<Button>(); private List<Button> buttons = new List<Button>();
//private Dictionary<string, string> defaults = new Dictionary<string, string>();
private Button lastSelected; private Button lastSelected;
private int alphacolor; private int alphacolor;
private Color reg, full; private Color reg, full;
@ -49,15 +46,14 @@ namespace ScpServer
lowBlueBar.Value = lowColor.blue; lowBlueBar.Value = lowColor.blue;
rumbleBoostBar.Value = DS4Control.Global.loadRumbleBoost(device); rumbleBoostBar.Value = DS4Control.Global.loadRumbleBoost(device);
rumbleSwap.Checked = Global.getRumbleSwap(device);
flashLed.Checked = DS4Control.Global.getFlashWhenLowBattery(device); flashLed.Checked = DS4Control.Global.getFlashWhenLowBattery(device);
numUDTouch.Value = Global.getTouchSensitivity(device); numUDTouch.Value = Global.getTouchSensitivity(device);
numUDScroll.Value = Global.getScrollSensitivity(device); numUDScroll.Value = Global.getScrollSensitivity(device);
numUDTap.Value = Global.getTapSensitivity(device); numUDTap.Value = Global.getTapSensitivity(device);
cBTap.Checked = Global.getTap(device); cBTap.Checked = Global.getTap(device);
cBDoubleTap.Checked = Global.getDoubleTap(device); cBDoubleTap.Checked = Global.getDoubleTap(device);
leftTriggerMiddlePoint.Text = Global.getLeftTriggerMiddle(device).ToString(); numUDL2.Value = (decimal)Global.getLeftTriggerMiddle(device);
rightTriggerMiddlePoint.Text = Global.getRightTriggerMiddle(device).ToString(); numUDL2.Value = (decimal)Global.getRightTriggerMiddle(device);
touchpadJitterCompensation.Checked = Global.getTouchpadJitterCompensation(device); touchpadJitterCompensation.Checked = Global.getTouchpadJitterCompensation(device);
cBlowerRCOn.Checked = Global.getLowerRCOn(device); cBlowerRCOn.Checked = Global.getLowerRCOn(device);
flushHIDQueue.Checked = Global.getFlushHIDQueue(device); flushHIDQueue.Checked = Global.getFlushHIDQueue(device);
@ -93,88 +89,24 @@ namespace ScpServer
} }
else else
Set(); Set();
sixaxisTimer.Start();
#region watch sixaxis data #region watch sixaxis data
// Control Positioning
int horizontalOffset = cbSixaxis.Location.X,
verticalOffset = cbSixaxis.Location.Y + cbSixaxis.Height + 5,
tWidth = 100, tHeight = 19,
horizontalMargin = 10 + tWidth,
verticalMargin = 1 + tHeight;
sixaxisTimer.Tick += sixaxisTimer.Tick +=
(delegate (delegate
{ {
if (tBsixaxisGyroX == null) // MEMS gyro data is all calibrated to roughly -1G..1G for values -0x2000..0x1fff
{ // Enough additional acceleration and we are no longer mostly measuring Earth's gravity...
tBsixaxisGyroX = new TrackBar(); // We should try to indicate setpoints of the calibration when exposing this measurement....
tBsixaxisGyroY = new TrackBar(); SetDynamicTrackBarValue(tBsixaxisGyroX, (scpDevice.ExposedState[device].GyroX + tBsixaxisGyroX.Value * 2) / 3);
tBsixaxisGyroZ = new TrackBar(); SetDynamicTrackBarValue(tBsixaxisGyroY, (scpDevice.ExposedState[device].GyroY + tBsixaxisGyroY.Value * 2) / 3);
tBsixaxisAccelX = new TrackBar(); SetDynamicTrackBarValue(tBsixaxisGyroZ, (scpDevice.ExposedState[device].GyroZ + tBsixaxisGyroZ.Value * 2) / 3);
tBsixaxisAccelY = new TrackBar(); SetDynamicTrackBarValue(tBsixaxisAccelX, (scpDevice.ExposedState[device].AccelX + tBsixaxisAccelX.Value * 2) / 3);
tBsixaxisAccelZ = new TrackBar(); SetDynamicTrackBarValue(tBsixaxisAccelY, (scpDevice.ExposedState[device].AccelY + tBsixaxisAccelY.Value * 2) / 3);
TrackBar[] allSixAxes = { tBsixaxisGyroX, tBsixaxisGyroY, tBsixaxisGyroZ, SetDynamicTrackBarValue(tBsixaxisAccelZ, (scpDevice.ExposedState[device].AccelZ + tBsixaxisAccelZ.Value * 2) / 3);
tBsixaxisAccelX, tBsixaxisAccelY, tBsixaxisAccelZ};
foreach (TrackBar t in allSixAxes)
{
((System.ComponentModel.ISupportInitialize)(t)).BeginInit();
t.Anchor = AnchorStyles.Top | AnchorStyles.Right;
t.BackColor = SystemColors.ControlLightLight;
t.AutoSize = false;
t.Enabled = false;
t.Minimum = -0x8000;
t.Maximum = 0x7fff;
t.Size = new Size(tWidth, tHeight);
t.TickFrequency = 0x2000; // calibrated to ~1G
}
// tBsixaxisGyroX
tBsixaxisGyroX.Location = new Point(horizontalOffset, verticalOffset);
tBsixaxisGyroX.Name = "tBsixaxisGyroX";
// tBsixaxisGyroY
tBsixaxisGyroY.Location = new Point(horizontalOffset, verticalOffset + verticalMargin);
tBsixaxisGyroY.Name = "tBsixaxisGyroY";
// tBsixaxisGyroZ
tBsixaxisGyroZ.Location = new Point(horizontalOffset, verticalOffset + verticalMargin * 2);
tBsixaxisGyroZ.Name = "tBsixaxisGyroZ";
// tBsixaxisAccelX
tBsixaxisAccelX.Location = new Point(horizontalOffset + horizontalMargin, verticalOffset);
tBsixaxisAccelX.Name = "tBsixaxisAccelX";
// tBsixaxisAccelY
tBsixaxisAccelY.Location = new Point(horizontalOffset + horizontalMargin, verticalOffset + verticalMargin);
tBsixaxisAccelY.Name = "tBsixaxisAccelY";
// tBsixaxisAccelZ
tBsixaxisAccelZ.Location = new Point(horizontalOffset + horizontalMargin, verticalOffset + verticalMargin * 2);
tBsixaxisAccelZ.Name = "tBsixaxisAccelZ";
foreach (TrackBar t in allSixAxes)
{
tabOther.Controls.Add(t);
((System.ComponentModel.ISupportInitialize)(t)).EndInit();
}
}
//byte[] inputData = null;// scpDevice.GetInputData(device);
//if (inputData != null)
{
// MEMS gyro data is all calibrated to roughly -1G..1G for values -0x2000..0x1fff
// Enough additional acceleration and we are no longer mostly measuring Earth's gravity...
// We should try to indicate setpoints of the calibration when exposing this measurement....
SetDynamicTrackBarValue(tBsixaxisGyroX, (scpDevice.ExposedState[device].GyroX + tBsixaxisGyroX.Value * 2) / 3);
SetDynamicTrackBarValue(tBsixaxisGyroY, (scpDevice.ExposedState[device].GyroY + tBsixaxisGyroY.Value * 2) / 3);
SetDynamicTrackBarValue(tBsixaxisGyroZ, (scpDevice.ExposedState[device].GyroZ + tBsixaxisGyroZ.Value * 2) / 3);
SetDynamicTrackBarValue(tBsixaxisAccelX, (scpDevice.ExposedState[device].AccelX + tBsixaxisAccelX.Value * 2) / 3);
SetDynamicTrackBarValue(tBsixaxisAccelY, (scpDevice.ExposedState[device].AccelY + tBsixaxisAccelY.Value * 2) / 3);
SetDynamicTrackBarValue(tBsixaxisAccelZ, (scpDevice.ExposedState[device].AccelZ + tBsixaxisAccelZ.Value * 2) / 3);
}
}); });
sixaxisTimer.Interval = 1000 / 60; sixaxisTimer.Interval = 1000 / 60;
this.FormClosing += delegate
{
if (sixaxisTimer.Enabled)
sixaxisTimer.Stop();
//foreach (CustomMapping cmf in customMappingForms)
// if (cmf != null)
// cmf.Close();
};
if (cbSixaxis.Checked)
sixaxisTimer.Start();
#endregion #endregion
foreach (System.Windows.Forms.Control control in tabControls.Controls) foreach (System.Windows.Forms.Control control in tabControls.Controls)
@ -198,33 +130,7 @@ namespace ScpServer
btnTouchtab.Enter += btnTouchtab_Enter; btnTouchtab.Enter += btnTouchtab_Enter;
UpdateLists(); UpdateLists();
} }
private void cbSixaxis_CheckedChanged(object sender, EventArgs e)
{
if (cbSixaxis.Checked)
{
sixaxisTimer.Start();
if (tBsixaxisGyroX != null)
{
tBsixaxisGyroX.Visible = true;
tBsixaxisGyroY.Visible = true;
tBsixaxisGyroZ.Visible = true;
tBsixaxisAccelX.Visible = true;
tBsixaxisAccelY.Visible = true;
tBsixaxisAccelZ.Visible = true;
}
}
else
{
sixaxisTimer.Stop();
tBsixaxisGyroX.Visible = false;
tBsixaxisGyroY.Visible = false;
tBsixaxisGyroZ.Visible = false;
tBsixaxisAccelX.Visible = false;
tBsixaxisAccelY.Visible = false;
tBsixaxisAccelZ.Visible = false;
}
}
private void SetDynamicTrackBarValue(TrackBar trackBar, int value) private void SetDynamicTrackBarValue(TrackBar trackBar, int value)
{ {
@ -280,7 +186,6 @@ namespace ScpServer
else lastSelected.ForeColor = SystemColors.WindowText; else lastSelected.ForeColor = SystemColors.WindowText;
else else
{ {
//cbRepeat.Checked = false;
lastSelected.ForeColor = SystemColors.WindowText; lastSelected.ForeColor = SystemColors.WindowText;
} }
} }
@ -292,7 +197,6 @@ namespace ScpServer
else lastSelected.Font = new Font(lastSelected.Font, FontStyle.Regular); else lastSelected.Font = new Font(lastSelected.Font, FontStyle.Regular);
else else
{ {
//cbScanCode.Checked = false;
lastSelected.Font = new Font(lastSelected.Font, FontStyle.Regular); lastSelected.Font = new Font(lastSelected.Font, FontStyle.Regular);
} }
} }
@ -313,14 +217,9 @@ namespace ScpServer
{ {
Global.saveColor(device, (byte)redBar.Value, (byte)greenBar.Value, (byte)blueBar.Value); Global.saveColor(device, (byte)redBar.Value, (byte)greenBar.Value, (byte)blueBar.Value);
Global.saveLowColor(device, (byte)lowRedBar.Value, (byte)lowGreenBar.Value, (byte)lowBlueBar.Value); Global.saveLowColor(device, (byte)lowRedBar.Value, (byte)lowGreenBar.Value, (byte)lowBlueBar.Value);
double middle; Global.setLeftTriggerMiddle(device, (double)numUDL2.Value);
if (Double.TryParse(leftTriggerMiddlePoint.Text, out middle)) Global.setRightTriggerMiddle(device, (double)numUDR2.Value);
Global.setLeftTriggerMiddle(device, middle);
if (Double.TryParse(rightTriggerMiddlePoint.Text, out middle))
Global.setRightTriggerMiddle(device, middle);
Global.saveRumbleBoost(device, (byte)rumbleBoostBar.Value); Global.saveRumbleBoost(device, (byte)rumbleBoostBar.Value);
scpDevice.setRumble((byte)leftMotorBar.Value, (byte)rightMotorBar.Value, device);
Global.setRumbleSwap(device, rumbleSwap.Checked);
Global.setTouchSensitivity(device, (byte)numUDTouch.Value); Global.setTouchSensitivity(device, (byte)numUDTouch.Value);
Global.setTouchpadJitterCompensation(device, touchpadJitterCompensation.Checked); Global.setTouchpadJitterCompensation(device, touchpadJitterCompensation.Checked);
Global.setLowerRCOn(device, cBlowerRCOn.Checked); Global.setLowerRCOn(device, cBlowerRCOn.Checked);
@ -331,10 +230,8 @@ namespace ScpServer
Global.setIdleDisconnectTimeout(device, (int)idleDisconnectTimeout.Value); Global.setIdleDisconnectTimeout(device, (int)idleDisconnectTimeout.Value);
Global.setButtonMouseSensitivity(device, tBMouseSens.Value); Global.setButtonMouseSensitivity(device, tBMouseSens.Value);
Global.setRainbow(device, (int)numUDRainbow.Value); Global.setRainbow(device, (int)numUDRainbow.Value);
if (numUDRainbow.Value == 0) if (numUDRainbow.Value == 0) pBRainbow.Image = greyscale;
pBRainbow.Image = greyscale; else pBRainbow.Image = colored;
else
pBRainbow.Image = colored;
} }
private void saveButton_Click(object sender, EventArgs e) private void saveButton_Click(object sender, EventArgs e)
@ -441,22 +338,23 @@ namespace ScpServer
private void rumbleBoostBar_ValueChanged(object sender, EventArgs e) private void rumbleBoostBar_ValueChanged(object sender, EventArgs e)
{ {
rumbleBoostMotorValLabel.Text = rumbleBoostBar.Value.ToString();
Global.saveRumbleBoost(device, (byte)rumbleBoostBar.Value); Global.saveRumbleBoost(device, (byte)rumbleBoostBar.Value);
scpDevice.setRumble((byte)leftMotorBar.Value, (byte)rightMotorBar.Value, device); scpDevice.setRumble((byte)numUDHeavyRumble.Value, (byte)numUDLightRumble.Value, device);
} }
private void leftMotorBar_ValueChanged(object sender, EventArgs e) private void btnRumbleTest_Click(object sender, EventArgs e)
{ {
leftMotorValLabel.Text = leftMotorBar.Value.ToString(); if (((Button)sender).Text == "Test")
scpDevice.setRumble((byte)leftMotorBar.Value, (byte)rightMotorBar.Value, device); {
} scpDevice.setRumble((byte)numUDHeavyRumble.Value, (byte)numUDLightRumble.Value, device);
((Button)sender).Text = "Stop";
private void rightMotorBar_ValueChanged(object sender, EventArgs e) }
{ else
rightMotorValLabel.Text = rightMotorBar.Value.ToString(); {
scpDevice.setRumble((byte)leftMotorBar.Value, (byte)rightMotorBar.Value, device); scpDevice.setRumble(0, 0, device);
((Button)sender).Text = "Test";
}
} }
private void numUDTouch_ValueChanged(object sender, EventArgs e) private void numUDTouch_ValueChanged(object sender, EventArgs e)
@ -578,27 +476,13 @@ namespace ScpServer
private void idleDisconnectTimeout_ValueChanged(object sender, EventArgs e) private void idleDisconnectTimeout_ValueChanged(object sender, EventArgs e)
{ {
if (idleDisconnectTimeout.Value <= 29 && idleDisconnectTimeout.Value > 15) Global.setIdleDisconnectTimeout(device, (int)(idleDisconnectTimeout.Value * 60));
{
idleDisconnectTimeout.Value = 0;
Global.setIdleDisconnectTimeout(device, (int)idleDisconnectTimeout.Value);
}
else if (idleDisconnectTimeout.Value > 0 && idleDisconnectTimeout.Value <= 15)
{
idleDisconnectTimeout.Value = 30;
Global.setIdleDisconnectTimeout(device, (int)idleDisconnectTimeout.Value);
}
else
Global.setIdleDisconnectTimeout(device, (int)idleDisconnectTimeout.Value);
}
private void rumbleSwap_CheckedChanged(object sender, EventArgs e)
{
Global.setRumbleSwap(device, rumbleSwap.Checked);
} }
private void Options_Closed(object sender, FormClosedEventArgs e) private void Options_Closed(object sender, FormClosedEventArgs e)
{ {
if (sixaxisTimer.Enabled)
sixaxisTimer.Stop();
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
Global.LoadProfile(i); //Refreshes all profiles in case other controllers are using the same profile Global.LoadProfile(i); //Refreshes all profiles in case other controllers are using the same profile
mainWin.RefreshProfiles(); mainWin.RefreshProfiles();
@ -831,5 +715,15 @@ namespace ScpServer
} }
return d; return d;
} }
private void numUDL2_ValueChanged(object sender, EventArgs e)
{
Global.setLeftTriggerMiddle(device, (double)numUDL2.Value);
}
private void numUDR2_ValueChanged(object sender, EventArgs e)
{
Global.setRightTriggerMiddle(device, (double)numUDR2.Value);
}
} }
} }

View File

@ -291,37 +291,42 @@ namespace ScpServer
{ {
Button bn = (Button)sender; Button bn = (Button)sender;
int i = Int32.Parse(bn.Tag.ToString()); int i = Int32.Parse(bn.Tag.ToString());
Options opt = OptionsDialog[i] = new Options(rootHub, i, cbs[i].Text, this); if (OptionsDialog[i] == null)
opt.Text = "Options for Controller " + (i + 1);
opt.Icon = this.Icon;
opt.FormClosed += delegate
{ {
OptionsDialog[i] = null; Options opt = OptionsDialog[i] = new Options(rootHub, i, cbs[i].Text, this);
Enable_Controls(i, true); opt.Text = "Options for Controller " + (i + 1);
}; opt.Icon = this.Icon;
opt.Show(); opt.FormClosed += delegate
Enable_Controls(i, false); {
OptionsDialog[i] = null;
};
opt.Show();
}
} }
private void editMenu_Click(object sender, EventArgs e) private void editMenu_Click(object sender, EventArgs e)
{ {
ToolStripMenuItem em = (ToolStripMenuItem)sender; ToolStripMenuItem em = (ToolStripMenuItem)sender;
int i = Int32.Parse(em.Tag.ToString()); int i = Int32.Parse(em.Tag.ToString());
foreach (ToolStripDropDownItem t in em.DropDownItems) if (OptionsDialog[i] == null)
if (((ToolStripMenuItem)t).Checked) {
{ foreach (ToolStripMenuItem t in em.DropDownItems)
Options opt = OptionsDialog[i] = new Options(rootHub, i, ((ToolStripMenuItem)t).Text, this); //if (!(t is ToolStripSeparator)
opt.Text = "Options for Controller " + (i + 1); if (((ToolStripMenuItem)t).Checked)
opt.Icon = this.Icon;
opt.FormClosed += delegate
{ {
OptionsDialog[i] = null; Options opt = OptionsDialog[i] = new Options(rootHub, i, ((ToolStripMenuItem)t).Text, this);
Enable_Controls(i, true); opt.Text = "Options for Controller " + (i + 1);
}; opt.Icon = this.Icon;
opt.Show(); opt.FormClosed += delegate
Enable_Controls(i, false); {
break; OptionsDialog[i] = null;
} };
opt.Show();
break;
}
}
//else
//OptionsDialog[i].Focus();
} }
private void Enable_Controls(int device, bool on) private void Enable_Controls(int device, bool on)
{ {
@ -404,17 +409,18 @@ namespace ScpServer
} }
else if (cb.SelectedIndex == cb.Items.Count - 1 && cb.Items.Count > 1) //if +New Profile selected else if (cb.SelectedIndex == cb.Items.Count - 1 && cb.Items.Count > 1) //if +New Profile selected
{ {
Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, "", this); if (OptionsDialog[tdevice] == null)
opt.Text = "Options for Controller " + (tdevice + 1);
opt.Icon = this.Icon;
int i = tdevice;
opt.FormClosed += delegate
{ {
OptionsDialog[i] = null; Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, "", this);
Enable_Controls(i, true); opt.Text = "Options for Controller " + (tdevice + 1);
}; opt.Icon = this.Icon;
opt.Show(); int i = tdevice;
Enable_Controls(i, false); opt.FormClosed += delegate
{
OptionsDialog[i] = null;
};
opt.Show();
}
} }
if (cb.Text == "") if (cb.Text == "")
ebns[tdevice].Text = "New"; ebns[tdevice].Text = "New";
@ -428,8 +434,8 @@ namespace ScpServer
ToolStripMenuItem tS = (ToolStripMenuItem)sender; ToolStripMenuItem tS = (ToolStripMenuItem)sender;
int tdevice = Int32.Parse(tS.Tag.ToString()); int tdevice = Int32.Parse(tS.Tag.ToString());
if (!(e.ClickedItem is ToolStripSeparator)) if (!(e.ClickedItem is ToolStripSeparator))
if (e.ClickedItem != tS.DropDownItems[tS.DropDownItems.Count - 1]) if (e.ClickedItem != tS.DropDownItems[tS.DropDownItems.Count - 1]) //if +New Profile not selected
if (((ToolStripMenuItem)e.ClickedItem).Checked) if (((ToolStripMenuItem)e.ClickedItem).Checked && OptionsDialog[tdevice] == null)
{ {
Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, e.ClickedItem.Text, this); Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, e.ClickedItem.Text, this);
opt.Text = "Options for Controller " + (tdevice + 1); opt.Text = "Options for Controller " + (tdevice + 1);
@ -438,10 +444,8 @@ namespace ScpServer
opt.FormClosed += delegate opt.FormClosed += delegate
{ {
OptionsDialog[i] = null; OptionsDialog[i] = null;
Enable_Controls(i, true);
}; };
opt.Show(); opt.Show();
Enable_Controls(i, false);
} }
else else
{ {
@ -454,7 +458,7 @@ namespace ScpServer
Global.Save(); Global.Save();
Global.LoadProfile(tdevice); Global.LoadProfile(tdevice);
} }
else// if (e.ClickedItem.Text == "+New Profile") //if +New Profile selected else if (OptionsDialog[tdevice] == null) //if +New Profile selected
{ {
Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, "", this); Options opt = OptionsDialog[tdevice] = new Options(rootHub, tdevice, "", this);
opt.Text = "Options for Controller " + (tdevice + 1); opt.Text = "Options for Controller " + (tdevice + 1);
@ -463,10 +467,8 @@ namespace ScpServer
opt.FormClosed += delegate opt.FormClosed += delegate
{ {
OptionsDialog[i] = null; OptionsDialog[i] = null;
Enable_Controls(i, true);
}; };
opt.Show(); opt.Show();
Enable_Controls(i, false);
} }
} }