LegacyGipGameControllerProvider.GetHeadsetOperation(HeadsetOperation) 方法

定义

基于 operation检索头戴显示设备设置。

public:
 virtual Platform::Array <byte> ^ GetHeadsetOperation(HeadsetOperation operation) = GetHeadsetOperation;
winrt::array_view <byte> GetHeadsetOperation(HeadsetOperation const& operation);
public byte[] GetHeadsetOperation(HeadsetOperation operation);
function getHeadsetOperation(operation)
Public Function GetHeadsetOperation (operation As HeadsetOperation) As Byte()

参数

operation
HeadsetOperation

要读取的设置。

返回

Byte[]

byte[]

具有适用于 的相应格式的 operation缓冲区。

示例

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 应仅与你开发的硬件一起使用。

适用于

另请参阅