Share via


LegacyGipGameControllerProvider.SetHeadsetOperation Method

Definition

Sets a headset operation.

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())

Parameters

operation
HeadsetOperation

The setting to change.

buffer

Byte[]

byte[]

Buffer with the appropriate format for operation. See HeadsetOperation for the respective formats.

Examples

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

Remarks

Caution

To avoid damaging devices, the headset control APIs should only be used with hardware you have developed.

Applies to

See also