LegacyGipGameControllerProvider.FromGameControllerProvider Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Constructs a LegacyGipGameControllerProvider for the given controller provider.
public:
static LegacyGipGameControllerProvider ^ FromGameControllerProvider(IGameControllerProvider ^ provider);
static LegacyGipGameControllerProvider FromGameControllerProvider(IGameControllerProvider const& provider);
public static LegacyGipGameControllerProvider FromGameControllerProvider(IGameControllerProvider provider);
function fromGameControllerProvider(provider)
Public Shared Function FromGameControllerProvider (provider As IGameControllerProvider) As LegacyGipGameControllerProvider
Parameters
- provider
- IGameControllerProvider
Controller provider to construct a LegacyGipGameControllerProvider for.
Returns
A LegacyGipGameControllerProvider if the controller is a GIP (Gaming Input Protocol) controller. Null if the controller is not a GIP controller.
Examples
public void SetupHeadset(IGameControllerProvider headsetProvider)
{
LegacyGipGameControllerProvider legacyGipGameControllerProvider =
LegacyGipGameControllerProvider.FromGameControllerProvider(headsetProvider);
// Reset the device
legacyGipGameControllerProvider.ExecuteCommand(DeviceCommand.Reset);
// Check the smart mute level
byte[] smartMuteBuffer =
legacyGipGameControllerProvider.GetHeadsetOperation(HeadsetOperation.SmartMute);
HeadsetLevel smartMuteValue = (HeadsetLevel)smartMuteBuffer[0];
// Set bass boost to 3db
byte[] bassBuffer = BitConverter.GetBytes((UInt32)3);
legacyGipGameControllerProvider.SetHeadsetOperation(HeadsetOperation.BassBoostGain,
bassBuffer);
}