WiimoteReal: Remove unused IsReady and IsScannerReady functions
The only call of `IsScannerReady` was removed by
81be0001a9, and most of the `IsReady`
functions were only called by `IsScannerReady`.
The one exception was in `WiimoteScannerLinux`, which is now a private
function instead of inheriting from the one in `WiimoteScannerBackend`.
This commit is contained in:
1 parent
c299144f1e
commit
7d207f7248
9 files changed
+1
-38
No files matched your search
@@ -48,7 +48,6 @@ class WiimoteScannerAndroid final : public WiimoteScannerBackend
|
|||||||
public:
|
public:
|
||||||
WiimoteScannerAndroid() = default;
|
WiimoteScannerAndroid() = default;
|
||||||
~WiimoteScannerAndroid() override = default;
|
~WiimoteScannerAndroid() override = default;
|
||||||
bool IsReady() const override { return true; }
|
|
||||||
|
|
||||||
FindResults FindAttachedWiimotes() override;
|
FindResults FindAttachedWiimotes() override;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ class WiimoteScannerDummy final : public WiimoteScannerBackend
|
|||||||
public:
|
public:
|
||||||
WiimoteScannerDummy() = default;
|
WiimoteScannerDummy() = default;
|
||||||
~WiimoteScannerDummy() override = default;
|
~WiimoteScannerDummy() override = default;
|
||||||
bool IsReady() const override { return false; }
|
|
||||||
void Update() override {}
|
void Update() override {}
|
||||||
void RequestStopSearching() override {}
|
void RequestStopSearching() override {}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ public:
|
|||||||
WiimoteScannerLinux();
|
WiimoteScannerLinux();
|
||||||
~WiimoteScannerLinux() override;
|
~WiimoteScannerLinux() override;
|
||||||
|
|
||||||
bool IsReady() const override;
|
|
||||||
|
|
||||||
// FYI: This backend only supports connecting remotes just found via Bluetooth inquiry.
|
// FYI: This backend only supports connecting remotes just found via Bluetooth inquiry.
|
||||||
FindResults FindNewWiimotes() override;
|
FindResults FindNewWiimotes() override;
|
||||||
|
|
||||||
@@ -52,6 +50,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool Open();
|
bool Open();
|
||||||
void Close();
|
void Close();
|
||||||
|
bool IsReady() const;
|
||||||
|
|
||||||
int m_device_id{-1};
|
int m_device_id{-1};
|
||||||
int m_device_sock{-1};
|
int m_device_sock{-1};
|
||||||
|
|||||||
@@ -754,14 +754,4 @@ auto WiimoteScannerWindows::FindAttachedWiimotes() -> FindResults
|
|||||||
return FindWiimoteHIDDevices();
|
return FindWiimoteHIDDevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WiimoteScannerWindows::IsReady() const
|
|
||||||
{
|
|
||||||
bool found_radio = false;
|
|
||||||
EnumerateRadios([&](auto) {
|
|
||||||
found_radio = true;
|
|
||||||
return EnumerationControl::Stop;
|
|
||||||
});
|
|
||||||
return found_radio;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace WiimoteReal
|
} // namespace WiimoteReal
|
||||||
@@ -62,7 +62,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
WiimoteScannerWindows();
|
WiimoteScannerWindows();
|
||||||
bool IsReady() const override;
|
|
||||||
|
|
||||||
FindResults FindNewWiimotes() override;
|
FindResults FindNewWiimotes() override;
|
||||||
FindResults FindAttachedWiimotes() override;
|
FindResults FindAttachedWiimotes() override;
|
||||||
|
|||||||
@@ -103,11 +103,6 @@ WiimoteScannerHidapi::~WiimoteScannerHidapi()
|
|||||||
ERROR_LOG_FMT(WIIMOTE, "Failed to clean up hidapi.");
|
ERROR_LOG_FMT(WIIMOTE, "Failed to clean up hidapi.");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WiimoteScannerHidapi::IsReady() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto WiimoteScannerHidapi::FindAttachedWiimotes() -> FindResults
|
auto WiimoteScannerHidapi::FindAttachedWiimotes() -> FindResults
|
||||||
{
|
{
|
||||||
FindResults results;
|
FindResults results;
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ class WiimoteScannerHidapi final : public WiimoteScannerBackend
|
|||||||
public:
|
public:
|
||||||
WiimoteScannerHidapi();
|
WiimoteScannerHidapi();
|
||||||
~WiimoteScannerHidapi() override;
|
~WiimoteScannerHidapi() override;
|
||||||
bool IsReady() const override;
|
|
||||||
|
|
||||||
FindResults FindAttachedWiimotes() override;
|
FindResults FindAttachedWiimotes() override;
|
||||||
|
|
||||||
|
|||||||
@@ -127,11 +127,6 @@ void ProcessWiimotePool()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsScannerReady()
|
|
||||||
{
|
|
||||||
return s_wiimote_scanner.IsReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddWiimoteToPool(std::unique_ptr<Wiimote> wiimote)
|
void AddWiimoteToPool(std::unique_ptr<Wiimote> wiimote)
|
||||||
{
|
{
|
||||||
// Our real wiimote class requires an index.
|
// 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();
|
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()
|
static void CheckForDisconnectedWiimotes()
|
||||||
{
|
{
|
||||||
std::lock_guard lk(g_wiimotes_mutex);
|
std::lock_guard lk(g_wiimotes_mutex);
|
||||||
|
|||||||
@@ -181,9 +181,6 @@ class WiimoteScannerBackend
|
|||||||
public:
|
public:
|
||||||
virtual ~WiimoteScannerBackend() = default;
|
virtual ~WiimoteScannerBackend() = default;
|
||||||
|
|
||||||
// Note: Invoked from UI thread.
|
|
||||||
virtual bool IsReady() const = 0;
|
|
||||||
|
|
||||||
// function called when not looking for more Wiimotes
|
// function called when not looking for more Wiimotes
|
||||||
virtual void Update() = 0;
|
virtual void Update() = 0;
|
||||||
// requests the backend to stop scanning if FindWiimotes is blocking
|
// requests the backend to stop scanning if FindWiimotes is blocking
|
||||||
@@ -220,8 +217,6 @@ public:
|
|||||||
void SetScanMode(WiimoteScanMode scan_mode);
|
void SetScanMode(WiimoteScanMode scan_mode);
|
||||||
void PopulateDevices();
|
void PopulateDevices();
|
||||||
|
|
||||||
bool IsReady() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ThreadFunc();
|
void ThreadFunc();
|
||||||
void PoolThreadFunc();
|
void PoolThreadFunc();
|
||||||
@@ -259,5 +254,4 @@ void InitAdapterClass();
|
|||||||
void HandleWiimotesInControllerInterfaceSettingChange();
|
void HandleWiimotesInControllerInterfaceSettingChange();
|
||||||
void PopulateDevices();
|
void PopulateDevices();
|
||||||
void ProcessWiimotePool();
|
void ProcessWiimotePool();
|
||||||
bool IsScannerReady();
|
|
||||||
} // namespace WiimoteReal
|
} // namespace WiimoteReal
|
||||||
Reference in new issue
Block a user