protected void btnStart_Click(object sender, EventArgs e) { if (scpProxy.Start()) { cbP1.Enabled = cbP2.Enabled = cbP3.Enabled = cbP4.Enabled = btnLoadConfig.Enabled = btnStart.Enabled = cbVib.Enabled = false; config.ffb = cbVib.Checked; if (vJP.Start(selectedPads, config, devManLevel)) { gps = new DXPadState(vJP, config); gps.Proxy = scpProxy; if ((devManLevel & DeviceManagement.Xinput_XI) == DeviceManagement.Xinput_XI) { //SCP X360 Controller can only be disabled when //the SCP service isn't running, so we have to //restart the service (done in Lock_XI_Devices). //However, ScpProxy dosn't like the service //restart, so we need create a new instance. //Edit, Due to changes in reloaded, we have to //do this anyway when we stop the device //we just have to do it here when we start //due to the locking X360 devices reason. scpProxy.Stop(); dxLocker.Lock_XI_Devices(); StandardScpStop(); //Test this in this situation(?) // if (!scpProxy.Start()) { //error MessageBox.Show(this, "Native Feed is not available", "ScpPad2vJoy", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); vJP.Stop(selectedPads, devManLevel); dxLocker.UnlockDevices(); } } if ((devManLevel & DeviceManagement.Xinput_DX) == DeviceManagement.Xinput_DX) { dxLocker.Lock_DX_Devices(); } btnStop.Enabled = true; } else { StandardScpStop(); cbP1.Enabled = cbP2.Enabled = cbP3.Enabled = cbP4.Enabled = btnLoadConfig.Enabled = btnStart.Enabled = cbVib.Enabled = true; MessageBox.Show(this, "Vjoy pad is not available", "ScpPad2vJoy", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show(this, "Native Feed is not available", "ScpPad2vJoy", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
protected void btnStart_Click(object sender, EventArgs e) { cbP1.Enabled = cbP2.Enabled = cbP3.Enabled = cbP4.Enabled = btnLoadConfig.Enabled = btnStart.Enabled = cbVib.Enabled = false; config.ffb = cbVib.Checked; if (vJP.Start(selectedPads, config, devManLevel)) { gps = new DXPadState(vJP, config); gps.Proxy = scpProxy; if ((devManLevel & DeviceManagement.Xinput_XI) == DeviceManagement.Xinput_XI) { //TODO //Is this even doable with the bugged ScpProxy.Stop()? // //SCP X360 Controller can only be disabled when // //the SCP service isn't running, so we have to // //restart the service (done in Lock_XI_Devices). // //However, ScpProxy dosn't like the service // //restart, so we need create a new instance. // dxLocker.Lock_XI_Devices(); // //TODO Reinit ScpProxy (if needed) // // // gps.Proxy = scpProxy; } if ((devManLevel & DeviceManagement.Xinput_DX) == DeviceManagement.Xinput_DX) { dxLocker.Lock_DX_Devices(); } if (StandardScpStart()) { btnStop.Enabled = true; } else { dxLocker.UnlockDevices(); vJP.Stop(selectedPads, devManLevel); cbP1.Enabled = cbP2.Enabled = cbP3.Enabled = cbP4.Enabled = btnLoadConfig.Enabled = btnStart.Enabled = cbVib.Enabled = true; MessageBox.Show(this, "Native Feed is not available", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { cbP1.Enabled = cbP2.Enabled = cbP3.Enabled = cbP4.Enabled = btnLoadConfig.Enabled = btnStart.Enabled = cbVib.Enabled = true; MessageBox.Show(this, "Vjoy pad is not available", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }