// XInputDotNET.h

#pragma once

using namespace System;

namespace XInputDotNET
{
	public __gc class GamePad
	{
	public:
		__int64	dwPacketNumber;

		int	bLeftTrigger;
		int	bRightTrigger;

		int	sThumbLX;
		int	sThumbLY;
		int	sThumbRX;
		int	sThumbRY;

		int	wButtons;

		static	const int		BTN_DPAD_UP =          0x0001;
		static	const int		BTN_DPAD_DOWN =        0x0002;
		static	const int		BTN_DPAD_LEFT =        0x0004;
		static	const int		BTN_DPAD_RIGHT =       0x0008;
		static	const int		BTN_START =            0x0010;
		static	const int		BTN_BACK =             0x0020;
		static	const int		BTN_LEFT_THUMB =       0x0040;
		static	const int		BTN_RIGHT_THUMB =      0x0080;
		static	const int		BTN_LEFT_SHOULDER =    0x0100;
		static	const int		BTN_RIGHT_SHOULDER =   0x0200;
		static	const int		BTN_A =                0x1000;
		static	const int		BTN_B =                0x2000;
		static	const int		BTN_X =                0x4000;
		static	const int		BTN_Y =                0x8000;
	};

	public __gc class HeadSetDevice
	{
	public:
		Guid guidHeadphones;
		Guid guidMicrophone;
	};

	public __gc class XInput
	{
	public:
		static	GamePad*		GetPadState(int nUserIdx);
		static	bool			SetVibration(int nUserIdx, int wLowFreqMotorSpeed, int wHiFreqMotorSpeed);
		static	bool			SetVibration(int nUserIdx, float fLowFreqMotorSpeed, float fHiFreqMotorSpeed);
		static	HeadSetDevice*	GetAudio(int nUserIdx);

		static	const int		VibrationMax = 65535;
		static	const int		TriggerMax = 255;
		static	const int		ThumbstickMax = 32767; // min is actually -32768 but meh

		static	const int		TriggerThresh = 30;
		static	const int		LeftThumbThresh = 7849;
		static	const int		RightThumbThresh = 8689;
	};
}
