2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2010 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:09:55 +00:00
|
|
|
// Refer to the license.txt file included.
|
2010-06-12 17:15:16 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2010-06-03 18:05:08 +00:00
|
|
|
|
2015-10-26 02:28:15 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
2014-02-17 10:18:15 +00:00
|
|
|
#include <vector>
|
2010-06-03 18:05:08 +00:00
|
|
|
|
2015-10-26 02:28:15 +00:00
|
|
|
class ControllerEmu;
|
2010-06-03 18:05:08 +00:00
|
|
|
|
2014-08-31 04:04:15 +00:00
|
|
|
class InputConfig
|
2010-06-03 18:05:08 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-10-26 02:28:15 +00:00
|
|
|
InputConfig(const std::string& ini_name, const std::string& gui_name, const std::string& profile_name)
|
|
|
|
: m_ini_name(ini_name), m_gui_name(gui_name), m_profile_name(profile_name)
|
|
|
|
{
|
|
|
|
}
|
2010-10-12 19:42:29 +00:00
|
|
|
|
2013-01-09 20:03:43 +00:00
|
|
|
bool LoadConfig(bool isGC);
|
2010-06-03 18:05:08 +00:00
|
|
|
void SaveConfig();
|
|
|
|
|
2015-10-26 02:28:15 +00:00
|
|
|
template <typename T, typename... Args>
|
|
|
|
void CreateController(Args&&... args)
|
|
|
|
{
|
|
|
|
m_controllers.emplace_back(std::make_unique<T>(std::forward<Args>(args)...));
|
|
|
|
}
|
|
|
|
|
|
|
|
ControllerEmu* GetController(int index);
|
|
|
|
void ClearControllers();
|
|
|
|
bool ControllersNeedToBeCreated() const;
|
2016-06-21 13:33:53 +00:00
|
|
|
bool IsControllerControlledByGamepadDevice(int index) const;
|
2015-10-26 02:28:15 +00:00
|
|
|
|
|
|
|
std::string GetGUIName() const { return m_gui_name; }
|
|
|
|
std::string GetProfileName() const { return m_profile_name; }
|
2010-06-03 18:05:08 +00:00
|
|
|
|
2015-10-26 02:28:15 +00:00
|
|
|
private:
|
|
|
|
std::vector<std::unique_ptr<ControllerEmu>> m_controllers;
|
|
|
|
const std::string m_ini_name;
|
|
|
|
const std::string m_gui_name;
|
|
|
|
const std::string m_profile_name;
|
2010-06-03 18:05:08 +00:00
|
|
|
};
|