mirror of
https://github.com/cathery/sys-con.git
synced 2025-03-29 22:20:09 +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; }
|
||||
};
|
@ -229,4 +229,9 @@ Status Dualshock3Controller::SetLED(Dualshock3LEDValue value)
|
||||
void Dualshock3Controller::LoadConfig(const ControllerConfig *config)
|
||||
{
|
||||
_dualshock3ControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *Dualshock3Controller::GetConfig()
|
||||
{
|
||||
return &_dualshock3ControllerConfig;
|
||||
}
|
@ -196,4 +196,9 @@ Status Dualshock4Controller::SetRumble(uint8_t strong_magnitude, uint8_t weak_ma
|
||||
void Dualshock4Controller::LoadConfig(const ControllerConfig *config)
|
||||
{
|
||||
_dualshock4ControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *Dualshock4Controller::GetConfig()
|
||||
{
|
||||
return &_dualshock4ControllerConfig;
|
||||
}
|
@ -224,4 +224,9 @@ Status Xbox360Controller::SetLED(Xbox360LEDValue value)
|
||||
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)});
|
||||
|
@ -193,4 +193,9 @@ Status XboxController::SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitud
|
||||
void XboxController::LoadConfig(const ControllerConfig *config)
|
||||
{
|
||||
_xboxControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *XboxController::GetConfig()
|
||||
{
|
||||
return &_xboxControllerConfig;
|
||||
}
|
@ -314,4 +314,9 @@ Status XboxOneController::SetRumble(uint8_t strong_magnitude, uint8_t weak_magni
|
||||
void XboxOneController::LoadConfig(const ControllerConfig *config)
|
||||
{
|
||||
_xboxoneControllerConfig = *config;
|
||||
}
|
||||
|
||||
ControllerConfig *XboxOneController::GetConfig()
|
||||
{
|
||||
return &_xboxoneControllerConfig;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user