dolphin/Source/Core/Core/HW/GCPadEmu.h
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00

66 lines
1.5 KiB
C++

// Copyright 2010 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <string>
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
#include "InputCommon/ControllerEmu/ControllerEmu.h"
#include "InputCommon/ControllerEmu/Setting/NumericSetting.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;
// Values averaged from multiple genuine GameCube controllers.
static constexpr ControlState MAIN_STICK_GATE_RADIUS = 0.7937125;
static constexpr ControlState C_STICK_GATE_RADIUS = 0.7221375;
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::SettingValue<bool> m_always_connected_setting;
const unsigned int m_index;
};