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