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 應該只與您開發的硬體搭配使用。