rpcsx/rpcs3/Emu/Io/Pad.cpp
Peter Tissen 21da317453 Logging system rework
* use one central unified log with channels/priorities ad-hoc listener registration and de-registration
* disable buffering by default
* add multi-threaded ringbuffer implementation
* use buffered listener for the gui (using the ringbuffer)
2014-06-26 17:34:28 +02:00

41 lines
789 B
C++

#include "stdafx.h"
#include "Utilities/Log.h"
#include "rpcs3/Ini.h"
#include "Pad.h"
#include "Null/NullPadHandler.h"
PadManager::PadManager()
: m_pad_handler(nullptr)
, m_inited(false)
{
}
PadManager::~PadManager()
{
}
void PadManager::Init(const u32 max_connect)
{
if(m_inited)
return;
// NOTE: Change these to std::make_unique assignments when C++14 is available.
int numHandlers = rPlatform::getPadHandlerCount();
int selectedHandler = Ini.PadHandlerMode.GetValue();
if (selectedHandler > numHandlers)
{
selectedHandler = 0;
}
m_pad_handler.reset(rPlatform::getPadHandler(selectedHandler));
m_pad_handler->Init(max_connect);
m_inited = true;
}
void PadManager::Close()
{
if(m_pad_handler) m_pad_handler->Close();
m_pad_handler = nullptr;
m_inited = false;
}