Merge pull request #9952 from Dentomologist/wiimotereal_remove_unused_isready_functions

WiimoteReal: Remove unused IsReady and IsScannerReady functions
This commit is contained in:
JosJuice
2026-04-17 19:10:09 +02:00
committed by GitHub
9 changed files with 1 additions and 38 deletions
@@ -48,7 +48,6 @@ class WiimoteScannerAndroid final : public WiimoteScannerBackend
public:
WiimoteScannerAndroid() = default;
~WiimoteScannerAndroid() override = default;
bool IsReady() const override { return true; }
FindResults FindAttachedWiimotes() override;
@@ -12,7 +12,6 @@ class WiimoteScannerDummy final : public WiimoteScannerBackend
public:
WiimoteScannerDummy() = default;
~WiimoteScannerDummy() override = default;
bool IsReady() const override { return false; }
void Update() override {}
void RequestStopSearching() override {}
};
+1 -2
View File
@@ -41,8 +41,6 @@ public:
WiimoteScannerLinux();
~WiimoteScannerLinux() override;
bool IsReady() const override;
// FYI: This backend only supports connecting remotes just found via Bluetooth inquiry.
FindResults FindNewWiimotes() override;
@@ -52,6 +50,7 @@ public:
private:
bool Open();
void Close();
bool IsReady() const;
int m_device_id{-1};
int m_device_sock{-1};
-10
View File
@@ -754,14 +754,4 @@ auto WiimoteScannerWindows::FindAttachedWiimotes() -> FindResults
return FindWiimoteHIDDevices();
}
bool WiimoteScannerWindows::IsReady() const
{
bool found_radio = false;
EnumerateRadios([&](auto) {
found_radio = true;
return EnumerationControl::Stop;
});
return found_radio;
}
} // namespace WiimoteReal
-1
View File
@@ -62,7 +62,6 @@ public:
};
WiimoteScannerWindows();
bool IsReady() const override;
FindResults FindNewWiimotes() override;
FindResults FindAttachedWiimotes() override;
@@ -103,11 +103,6 @@ WiimoteScannerHidapi::~WiimoteScannerHidapi()
ERROR_LOG_FMT(WIIMOTE, "Failed to clean up hidapi.");
}
bool WiimoteScannerHidapi::IsReady() const
{
return true;
}
auto WiimoteScannerHidapi::FindAttachedWiimotes() -> FindResults
{
FindResults results;
@@ -35,7 +35,6 @@ class WiimoteScannerHidapi final : public WiimoteScannerBackend
public:
WiimoteScannerHidapi();
~WiimoteScannerHidapi() override;
bool IsReady() const override;
FindResults FindAttachedWiimotes() override;
@@ -127,11 +127,6 @@ void ProcessWiimotePool()
}
}
bool IsScannerReady()
{
return s_wiimote_scanner.IsReady();
}
void AddWiimoteToPool(std::unique_ptr<Wiimote> wiimote)
{
// Our real wiimote class requires an index.
@@ -592,12 +587,6 @@ void WiimoteScanner::SetScanMode(WiimoteScanMode scan_mode)
m_scan_mode_changed_or_population_event.Set();
}
bool WiimoteScanner::IsReady() const
{
std::lock_guard lg(m_backends_mutex);
return std::ranges::any_of(m_backends, &WiimoteScannerBackend::IsReady);
}
static void CheckForDisconnectedWiimotes()
{
std::lock_guard lk(g_wiimotes_mutex);
@@ -181,9 +181,6 @@ class WiimoteScannerBackend
public:
virtual ~WiimoteScannerBackend() = default;
// Note: Invoked from UI thread.
virtual bool IsReady() const = 0;
// function called when not looking for more Wiimotes
virtual void Update() = 0;
// requests the backend to stop scanning if FindWiimotes is blocking
@@ -220,8 +217,6 @@ public:
void SetScanMode(WiimoteScanMode scan_mode);
void PopulateDevices();
bool IsReady() const;
private:
void ThreadFunc();
void PoolThreadFunc();
@@ -259,5 +254,4 @@ void InitAdapterClass();
void HandleWiimotesInControllerInterfaceSettingChange();
void PopulateDevices();
void ProcessWiimotePool();
bool IsScannerReady();
} // namespace WiimoteReal