Merge pull request #8638 from jordan-woyak/is-detectable-constify

InputCommon: Constify Device::Input::IsDetectable function.
This commit is contained in:
Mat M 2020-02-22 16:50:27 -05:00 committed by GitHub
commit edad018213
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 13 deletions

View File

@ -69,7 +69,7 @@ private:
{ {
} }
std::string GetName() const override; std::string GetName() const override;
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
ControlState GetState() const override; ControlState GetState() const override;
private: private:

View File

@ -70,7 +70,7 @@ public:
public: public:
// Things like absolute axes/ absolute mouse position should override this to prevent // Things like absolute axes/ absolute mouse position should override this to prevent
// undesirable behavior in our mapping logic. // undesirable behavior in our mapping logic.
virtual bool IsDetectable() { return true; } virtual bool IsDetectable() const { return true; }
// Implementations should return a value from 0.0 to 1.0 across their normal range. // Implementations should return a value from 0.0 to 1.0 across their normal range.
// One input should be provided for each "direction". (e.g. 2 for each axis) // One input should be provided for each "direction". (e.g. 2 for each axis)

View File

@ -87,14 +87,14 @@ private:
{ {
public: public:
using AnalogInput::AnalogInput; using AnalogInput::AnalogInput;
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
}; };
class MotionInput final : public AnalogInput<float> class MotionInput final : public AnalogInput<float>
{ {
public: public:
using AnalogInput::AnalogInput; using AnalogInput::AnalogInput;
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
}; };
using AccelerometerInput = MotionInput; using AccelerometerInput = MotionInput;
@ -121,7 +121,7 @@ private:
} }
} }
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
private: private:
const BatteryState& m_battery; const BatteryState& m_battery;

View File

@ -36,7 +36,7 @@ private:
{ {
} }
std::string GetName() const override; std::string GetName() const override;
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
ControlState GetState() const override; ControlState GetState() const override;
private: private:

View File

@ -27,7 +27,7 @@ private:
{ {
public: public:
std::string GetName() const; std::string GetName() const;
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
Axis(int pad_id, ButtonManager::ButtonType index, float neg = 1.0f) Axis(int pad_id, ButtonManager::ButtonType index, float neg = 1.0f)
: m_pad_id(pad_id), m_index(index), m_neg(neg) : m_pad_id(pad_id), m_index(index), m_neg(neg)
{ {

View File

@ -48,7 +48,7 @@ public:
{ {
} }
bool IsDetectable() override { return Detectable; } bool IsDetectable() const override { return Detectable; }
std::string GetName() const override { return m_name; } std::string GetName() const override { return m_name; }

View File

@ -118,7 +118,7 @@ public:
Battery(const ControlState* level) : m_level(*level) {} Battery(const ControlState* level) : m_level(*level) {}
std::string GetName() const override { return "Battery"; } std::string GetName() const override { return "Battery"; }
ControlState GetState() const override { return m_level; } ControlState GetState() const override { return m_level; }
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
private: private:
const ControlState& m_level; const ControlState& m_level;

View File

@ -63,7 +63,7 @@ private:
{ {
public: public:
std::string GetName() const override { return name; } std::string GetName() const override { return name; }
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
Cursor(u8 index, bool positive, const float* cursor); Cursor(u8 index, bool positive, const float* cursor);
ControlState GetState() const override; ControlState GetState() const override;
@ -78,7 +78,7 @@ private:
{ {
public: public:
std::string GetName() const override { return name; } std::string GetName() const override { return name; }
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
Axis(u8 index, bool positive, const float* axis); Axis(u8 index, bool positive, const float* axis);
ControlState GetState() const override; ControlState GetState() const override;

View File

@ -178,7 +178,7 @@ public:
return std::string(motion_data_names[m_code]) + (m_range < 0 ? '-' : '+'); return std::string(motion_data_names[m_code]) + (m_range < 0 ? '-' : '+');
} }
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
}; };
class CursorInput final : public Axis class CursorInput final : public Axis
@ -192,7 +192,7 @@ public:
return std::string("Cursor ") + char('X' + m_code) + (m_range < 0 ? '-' : '+'); return std::string("Cursor ") + char('X' + m_code) + (m_range < 0 ? '-' : '+');
} }
bool IsDetectable() override { return false; } bool IsDetectable() const override { return false; }
}; };
static std::thread s_hotplug_thread; static std::thread s_hotplug_thread;