DolphinQt: Use input override system for TAS input windows

This lets the TAS input code use a higher-level interface for
overriding inputs instead of having to fiddle with raw bits.
WiiTASInputWindow in particular was messy with how much
controller code it had to re-implement.
This commit is contained in:
JosJuice
2021-03-21 22:42:33 +01:00
parent 8fd25259ee
commit b296248b49
21 changed files with 557 additions and 507 deletions

View File

@ -5,31 +5,48 @@
#include "DolphinQt/TAS/TASInputWindow.h"
namespace WiimoteCommon
{
class DataReportBuilder;
}
#include "Core/HW/WiimoteEmu/ExtensionPort.h"
class QGroupBox;
class QHideEvent;
class QShowEvent;
class QSpinBox;
class TASCheckBox;
namespace WiimoteEmu
{
class EncryptionKey;
}
class Extension;
class Wiimote;
} // namespace WiimoteEmu
class QGroupBox;
class QSpinBox;
class TASCheckBox;
namespace ControllerEmu
{
class Attachments;
}
class WiiTASInputWindow : public TASInputWindow
{
Q_OBJECT
public:
explicit WiiTASInputWindow(QWidget* parent, int num);
void GetValues(WiimoteCommon::DataReportBuilder& rpt, int ext,
const WiimoteEmu::EncryptionKey& key);
void hideEvent(QHideEvent* event) override;
void showEvent(QShowEvent* event) override;
private:
void UpdateExt(u8 ext);
WiimoteEmu::Wiimote* GetWiimote();
ControllerEmu::Attachments* GetAttachments();
WiimoteEmu::Extension* GetExtension();
void UpdateExt();
WiimoteEmu::ExtensionNumber m_active_extension;
int m_num;
InputOverrider m_wiimote_overrider;
InputOverrider m_nunchuk_overrider;
InputOverrider m_classic_overrider;
TASCheckBox* m_a_button;
TASCheckBox* m_b_button;
TASCheckBox* m_1_button;