LegacyGipGameControllerProvider.SetHeadsetOperation 方法

定义

设置头戴显示设备操作。

public:
 virtual void SetHeadsetOperation(HeadsetOperation operation, Platform::Array <byte> ^ buffer) = SetHeadsetOperation;
void SetHeadsetOperation(HeadsetOperation const& operation, winrt::array_view <byte> const& buffer);
public void SetHeadsetOperation(HeadsetOperation operation, byte[] buffer);
function setHeadsetOperation(operation, buffer)
Public Sub SetHeadsetOperation (operation As HeadsetOperation, buffer As Byte())

参数

operation
HeadsetOperation

要更改的设置。

buffer

Byte[]

byte[]

具有适用于 的相应格式的 operation缓冲区。 有关相应格式,请参阅 HeadsetOperation

示例

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

注解

注意

为了避免损坏设备,头戴显示设备控制 API 应仅与你开发的硬件一起使用。

适用于

另请参阅