2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2010 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 22:43:11 -04:00
|
|
|
// Refer to the license.txt file included.
|
2010-06-12 17:15:16 +00:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2010-06-03 18:05:08 +00:00
|
|
|
|
2010-06-13 09:14:40 +00:00
|
|
|
#include <string>
|
2010-06-03 18:05:08 +00:00
|
|
|
|
2017-01-29 22:32:04 -05:00
|
|
|
#include "InputCommon/ControllerEmu/ControllerEmu.h"
|
2010-06-03 18:05:08 +00:00
|
|
|
|
2017-02-08 22:15:43 -05:00
|
|
|
struct GCPadStatus;
|
|
|
|
|
|
|
|
namespace ControllerEmu
|
|
|
|
{
|
|
|
|
class AnalogStick;
|
|
|
|
class Buttons;
|
2016-11-10 22:07:40 -05:00
|
|
|
class ControlGroup;
|
2017-02-08 22:15:43 -05:00
|
|
|
class MixedTriggers;
|
|
|
|
}
|
2016-11-10 22:07:40 -05:00
|
|
|
|
|
|
|
enum class PadGroup
|
|
|
|
{
|
|
|
|
Buttons,
|
|
|
|
MainStick,
|
|
|
|
CStick,
|
|
|
|
DPad,
|
|
|
|
Triggers,
|
|
|
|
Rumble,
|
2016-12-04 14:17:27 -05:00
|
|
|
Mic,
|
2016-11-10 22:07:40 -05:00
|
|
|
Options
|
|
|
|
};
|
|
|
|
|
2017-02-08 22:15:43 -05:00
|
|
|
class GCPad : public ControllerEmu::EmulatedController
|
2010-06-03 18:05:08 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-02-07 15:12:15 -05:00
|
|
|
explicit GCPad(unsigned int index);
|
2016-08-01 20:30:03 -04:00
|
|
|
GCPadStatus GetInput() const;
|
2016-06-24 10:43:46 +02:00
|
|
|
void SetOutput(const ControlState strength);
|
2010-06-03 18:05:08 +00:00
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
bool GetMicButton() const;
|
2011-10-09 04:27:43 -05:00
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
std::string GetName() const override;
|
2013-10-29 01:23:17 -04:00
|
|
|
|
2017-02-08 22:15:43 -05:00
|
|
|
ControllerEmu::ControlGroup* GetGroup(PadGroup group);
|
2016-11-10 22:07:40 -05:00
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
void LoadDefaults(const ControllerInterface& ciface) override;
|
2010-06-03 18:05:08 +00:00
|
|
|
|
|
|
|
private:
|
2017-02-08 22:15:43 -05:00
|
|
|
ControllerEmu::Buttons* m_buttons;
|
|
|
|
ControllerEmu::AnalogStick* m_main_stick;
|
|
|
|
ControllerEmu::AnalogStick* m_c_stick;
|
|
|
|
ControllerEmu::Buttons* m_dpad;
|
|
|
|
ControllerEmu::MixedTriggers* m_triggers;
|
|
|
|
ControllerEmu::ControlGroup* m_rumble;
|
|
|
|
ControllerEmu::Buttons* m_mic;
|
|
|
|
ControllerEmu::ControlGroup* m_options;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
const unsigned int m_index;
|
|
|
|
|
|
|
|
// Default analog stick radius for GameCube controllers.
|
|
|
|
static constexpr ControlState DEFAULT_PAD_STICK_RADIUS = 1.0;
|
2010-06-03 18:05:08 +00:00
|
|
|
};
|