Share via


LegacyGipGameControllerProvider.GetHeadsetOperation(HeadsetOperation) Method

Definition

Retrieves a headset setting based on 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()

Parameters

operation
HeadsetOperation

The setting to read.

Returns

Byte[]

byte[]

A buffer with the appropriate format for operation.

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