LegacyGipGameControllerProvider.GetHeadsetOperation(HeadsetOperation) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
基于 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 应仅与你开发的硬件一起使用。