Share via


LegacyGipGameControllerProvider.FromGameControllerProvider Method

Definition

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);
}

Applies to

See also