共用方式為


LegacyGipGameControllerProvider.FromGameControllerProvider 方法

定義

為指定的控制器提供者建構 LegacyGipGameControllerProvider

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

參數

provider
IGameControllerProvider

用來建構 LegacyGipGameControllerProvider 的控制器提供者。

傳回

如果控制器是 GIP (遊戲輸入通訊協定) 控制器,則為 LegacyGipGameControllerProvider。 如果控制器不是 GIP 控制器,則為 Null。

範例

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

適用於

另請參閱