2012-11-15 01:39:56 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "PadHandler.h"
|
|
|
|
|
|
2014-08-24 21:42:19 +04:00
|
|
|
class PadManager
|
2012-11-15 01:39:56 +02:00
|
|
|
{
|
|
|
|
|
bool m_inited;
|
2014-03-31 20:02:27 -04:00
|
|
|
std::unique_ptr<PadHandlerBase> m_pad_handler;
|
2012-11-15 01:39:56 +02:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
PadManager();
|
|
|
|
|
~PadManager();
|
|
|
|
|
|
|
|
|
|
void Init(const u32 max_connect);
|
|
|
|
|
void Close();
|
|
|
|
|
|
2014-03-31 10:18:44 -04:00
|
|
|
std::vector<Pad>& GetPads() { return m_pad_handler->GetPads(); }
|
2012-11-15 01:39:56 +02:00
|
|
|
PadInfo& GetInfo() { return m_pad_handler->GetInfo(); }
|
2014-03-31 10:18:44 -04:00
|
|
|
std::vector<Button>& GetButtons(const u32 pad) { return m_pad_handler->GetButtons(pad); }
|
2012-11-15 01:39:56 +02:00
|
|
|
|
2014-03-24 08:47:30 -04:00
|
|
|
bool IsInited() const { return m_inited; }
|
2014-08-24 21:42:19 +04:00
|
|
|
};
|
2012-11-15 01:39:56 +02:00
|
|
|
|
2014-08-24 21:42:19 +04:00
|
|
|
typedef int(*GetPadHandlerCountCb)();
|
|
|
|
|
typedef PadHandlerBase*(*GetPadHandlerCb)(int i);
|
|
|
|
|
|
|
|
|
|
void SetGetPadHandlerCountCallback(GetPadHandlerCountCb cb);
|
|
|
|
|
void SetGetPadHandlerCallback(GetPadHandlerCb cb);
|