2020-06-23 07:47:46 +00:00
|
|
|
#pragma once
|
|
|
|
#include "ControllerSpec1.1.h"
|
|
|
|
#include "DirectInput.h"
|
|
|
|
#include "N64Controller.h"
|
2021-02-28 21:32:50 +00:00
|
|
|
#include <Common/CriticalSection.h>
|
2020-06-23 07:47:46 +00:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
class CProject64Input
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CProject64Input(HINSTANCE hinst);
|
|
|
|
~CProject64Input();
|
|
|
|
|
2020-07-15 11:10:20 +00:00
|
|
|
void DevicesChanged(void);
|
2020-07-22 03:43:42 +00:00
|
|
|
void DeviceAdded(void);
|
2020-06-23 07:47:46 +00:00
|
|
|
void InitiateControllers(CONTROL_INFO * ControlInfo);
|
2020-07-01 03:47:36 +00:00
|
|
|
void GetKeys(int32_t Control, BUTTONS * Keys);
|
2020-06-23 07:47:46 +00:00
|
|
|
void StartScanDevices(int32_t DisplayCtrlId);
|
|
|
|
void EndScanDevices(void);
|
|
|
|
CDirectInput::ScanResult ScanDevices(BUTTON & Button);
|
|
|
|
std::wstring ButtonAssignment(BUTTON & Button);
|
2020-07-27 07:33:35 +00:00
|
|
|
std::wstring ControllerDevices(const N64CONTROLLER & Controller);
|
2020-07-01 03:37:55 +00:00
|
|
|
bool SaveController(uint32_t ControlIndex);
|
2020-07-27 07:33:35 +00:00
|
|
|
bool ResetController(uint32_t ControlIndex, CONTROL & ControlInfo, N64CONTROLLER & Controller);
|
2020-06-23 07:47:46 +00:00
|
|
|
|
|
|
|
inline HINSTANCE hInst(void) const { return m_hinst; }
|
|
|
|
inline bool IsScanning(void) const { return m_Scanning; }
|
|
|
|
inline int32_t DisplayCtrlId(void) const { return m_DisplayCtrlId; }
|
|
|
|
inline N64CONTROLLER & Controllers(int32_t Controller) { return m_Controllers[Controller]; }
|
2020-07-07 02:16:08 +00:00
|
|
|
inline CONTROL & ControlInfo(int32_t Controller) { return m_ControlInfo.Controls[Controller]; }
|
2020-06-23 07:47:46 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
CProject64Input();
|
|
|
|
CProject64Input(const CProject64Input&);
|
|
|
|
CProject64Input& operator=(const CProject64Input&);
|
|
|
|
|
2020-07-01 03:37:55 +00:00
|
|
|
CriticalSection m_CS;
|
2020-07-07 02:16:08 +00:00
|
|
|
CONTROL_INFO m_ControlInfo;
|
2020-06-23 07:47:46 +00:00
|
|
|
N64CONTROLLER m_Controllers[4];
|
|
|
|
std::unique_ptr<CDirectInput> m_DirectInput;
|
|
|
|
HINSTANCE m_hinst;
|
|
|
|
bool m_Scanning;
|
|
|
|
int32_t m_DisplayCtrlId;
|
2020-07-01 03:47:36 +00:00
|
|
|
int32_t m_iFirstController;
|
2020-06-23 07:47:46 +00:00
|
|
|
};
|
|
|
|
|
2021-03-27 05:35:42 +00:00
|
|
|
extern CProject64Input * g_InputPlugin;
|