mirror of
https://github.com/cathery/sys-con.git
synced 2024-07-03 02:18:43 +00:00
Add IController::GetConfig()
This commit is contained in:
parent
1155b488be
commit
93abaeed22
|
@ -157,4 +157,5 @@ public:
|
|||
Status SetLED(Dualshock3LEDValue value);
|
||||
|
||||
static void LoadConfig(const ControllerConfig *config);
|
||||
virtual ControllerConfig *GetConfig();
|
||||
};
|
|
@ -76,4 +76,5 @@ public:
|
|||
Status SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude);
|
||||
|
||||
static void LoadConfig(const ControllerConfig *config);
|
||||
virtual ControllerConfig *GetConfig();
|
||||
};
|
|
@ -115,4 +115,5 @@ public:
|
|||
Status SetLED(Xbox360LEDValue value);
|
||||
|
||||
static void LoadConfig(const ControllerConfig *config);
|
||||
virtual ControllerConfig *GetConfig();
|
||||
};
|
|
@ -52,6 +52,7 @@ public:
|
|||
Status OnControllerDisconnect();
|
||||
|
||||
static void LoadConfig(const ControllerConfig *config);
|
||||
virtual ControllerConfig *GetConfig();
|
||||
|
||||
Status OutputBuffer();
|
||||
|
||||
|
|
|
@ -81,4 +81,5 @@ public:
|
|||
Status SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude);
|
||||
|
||||
static void LoadConfig(const ControllerConfig *config);
|
||||
virtual ControllerConfig *GetConfig();
|
||||
};
|
|
@ -110,4 +110,5 @@ public:
|
|||
Status SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude);
|
||||
|
||||
static void LoadConfig(const ControllerConfig *config);
|
||||
virtual ControllerConfig *GetConfig();
|
||||
};
|
|
@ -25,14 +25,16 @@ public:
|
|||
//Since Exit is used to clean up resources, no status report should be needed
|
||||
virtual void Exit() = 0;
|
||||
|
||||
virtual Status GetInput() = 0;
|
||||
virtual Status GetInput() { return 1; }
|
||||
|
||||
virtual NormalizedButtonData GetNormalizedButtonData() = 0;
|
||||
virtual NormalizedButtonData GetNormalizedButtonData() { return NormalizedButtonData(); }
|
||||
|
||||
inline IUSBDevice *GetDevice() { return m_device.get(); }
|
||||
virtual ControllerType GetType() = 0;
|
||||
virtual Status SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude) = 0;
|
||||
virtual Status SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude) { return 1; }
|
||||
virtual bool IsControllerActive() { return true; }
|
||||
|
||||
Status OutputBuffer() { return 1; };
|
||||
|
||||
virtual ControllerConfig *GetConfig() { return nullptr; }
|
||||
};
|
|
@ -230,3 +230,8 @@ void Dualshock3Controller::LoadConfig(const ControllerConfig *config)
|
|||
{
|
||||
_dualshock3ControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *Dualshock3Controller::GetConfig()
|
||||
{
|
||||
return &_dualshock3ControllerConfig;
|
||||
}
|
|
@ -197,3 +197,8 @@ void Dualshock4Controller::LoadConfig(const ControllerConfig *config)
|
|||
{
|
||||
_dualshock4ControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *Dualshock4Controller::GetConfig()
|
||||
{
|
||||
return &_dualshock4ControllerConfig;
|
||||
}
|
|
@ -225,3 +225,8 @@ void Xbox360Controller::LoadConfig(const ControllerConfig *config)
|
|||
{
|
||||
_xbox360ControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *Xbox360Controller::GetConfig()
|
||||
{
|
||||
return &_xbox360ControllerConfig;
|
||||
}
|
|
@ -248,6 +248,11 @@ void Xbox360WirelessController::LoadConfig(const ControllerConfig *config)
|
|||
_xbox360WControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *Xbox360WirelessController::GetConfig()
|
||||
{
|
||||
return &_xbox360WControllerConfig;
|
||||
}
|
||||
|
||||
Status Xbox360WirelessController::OnControllerConnect()
|
||||
{
|
||||
m_outputBuffer.push_back(OutputPacket{reconnectPacket, sizeof(reconnectPacket)});
|
||||
|
|
|
@ -194,3 +194,8 @@ void XboxController::LoadConfig(const ControllerConfig *config)
|
|||
{
|
||||
_xboxControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *XboxController::GetConfig()
|
||||
{
|
||||
return &_xboxControllerConfig;
|
||||
}
|
|
@ -315,3 +315,8 @@ void XboxOneController::LoadConfig(const ControllerConfig *config)
|
|||
{
|
||||
_xboxoneControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *XboxOneController::GetConfig()
|
||||
{
|
||||
return &_xboxoneControllerConfig;
|
||||
}
|
Loading…
Reference in New Issue
Block a user