dolphin/Source/Core/Core/HW/GCPadEmu.h

64 lines
1.4 KiB
C++

// Copyright 2010 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <string>
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
#include "InputCommon/ControllerEmu/ControllerEmu.h"
struct GCPadStatus;
namespace ControllerEmu
{
class AnalogStick;
class Buttons;
class MixedTriggers;
} // namespace ControllerEmu
enum class PadGroup
{
Buttons,
MainStick,
CStick,
DPad,
Triggers,
Rumble,
Mic,
Options
};
class GCPad : public ControllerEmu::EmulatedController
{
public:
explicit GCPad(unsigned int index);
GCPadStatus GetInput() const;
void SetOutput(const ControlState strength);
bool GetMicButton() const;
std::string GetName() const override;
ControllerEmu::ControlGroup* GetGroup(PadGroup group);
void LoadDefaults(const ControllerInterface& ciface) override;
static const u8 MAIN_STICK_GATE_RADIUS = 87;
static const u8 C_STICK_GATE_RADIUS = 74;
private:
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;
ControllerEmu::BooleanSetting* m_always_connected;
const unsigned int m_index;
};