| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <array> |
| 7 |
#include <span> |
| 8 |
|
| 9 |
#include <QWidget> |
| 10 |
|
| 11 |
#include "Common/WorkQueueThread.h" |
| 12 |
#include "Core/USBUtils.h" |
| 13 |
|
| 14 |
class QAction; |
| 15 |
class QCheckBox; |
| 16 |
class QComboBox; |
| 17 |
class QHBoxLayout; |
| 18 |
class QGridLayout; |
| 19 |
class QToolButton; |
| 20 |
class QGroupBox; |
| 21 |
class QLabel; |
| 22 |
class QPushButton; |
| 23 |
class QRadioButton; |
| 24 |
|
| 25 |
namespace Core |
| 26 |
{ |
| 27 |
enum class State; |
| 28 |
} |
| 29 |
|
| 30 |
class WiimoteControllersWidget final : public QWidget |
| 31 |
{ |
| 32 |
Q_OBJECT |
| 33 |
public: |
| 34 |
explicit WiimoteControllersWidget(QWidget* parent); |
| 35 |
~WiimoteControllersWidget() override; |
| 36 |
|
| 37 |
private: |
| 38 |
void SaveSettings(); |
| 39 |
void OnBluetoothPassthroughDeviceChanged(int index); |
| 40 |
void OnBluetoothPassthroughSyncPressed(); |
| 41 |
void OnBluetoothPassthroughResetPressed(); |
| 42 |
void OnBluetoothAdapterRefreshComplete(std::span<const USBUtils::DeviceInfo> devices); |
| 43 |
void OnWiimoteRefreshPressed(); |
| 44 |
void OnWiimoteConfigure(size_t index); |
| 45 |
void StartBluetoothAdapterRefresh(); |
| 46 |
void UpdateBluetoothAdapterWidgetsEnabled(Core::State state); |
| 47 |
|
| 48 |
void CreateLayout(); |
| 49 |
void ConnectWidgets(); |
| 50 |
void LoadSettings(Core::State state); |
| 51 |
|
| 52 |
#if defined(_WIN32) |
| 53 |
void AsyncRefreshActionHelper(std::invocable<> auto); |
| 54 |
void TriggerHostWiimoteSync(); |
| 55 |
void TriggerHostWiimoteReset(); |
| 56 |
#endif |
| 57 |
|
| 58 |
QGroupBox* m_wiimote_box; |
| 59 |
QGridLayout* m_wiimote_layout; |
| 60 |
std::array<QLabel*, 4> m_wiimote_labels; |
| 61 |
std::array<QComboBox*, 4> m_wiimote_boxes; |
| 62 |
std::array<QPushButton*, 4> m_wiimote_buttons; |
| 63 |
std::array<QHBoxLayout*, 4> m_wiimote_groups; |
| 64 |
std::array<QLabel*, 2> m_wiimote_pt_labels; |
| 65 |
|
| 66 |
Common::AsyncWorkThreadSP m_bluetooth_adapter_refresh_thread; |
| 67 |
bool m_bluetooth_adapter_scan_in_progress = false; |
| 68 |
|
| 69 |
QRadioButton* m_wiimote_emu; |
| 70 |
QRadioButton* m_wiimote_passthrough; |
| 71 |
QLabel* m_bluetooth_adapters_label; |
| 72 |
QComboBox* m_bluetooth_adapters; |
| 73 |
QPushButton* m_bluetooth_adapters_refresh; |
| 74 |
QPushButton* m_wiimote_sync; |
| 75 |
QPushButton* m_wiimote_reset; |
| 76 |
QCheckBox* m_wiimote_continuous_scanning; |
| 77 |
QCheckBox* m_wiimote_real_balance_board; |
| 78 |
QCheckBox* m_wiimote_speaker_data; |
| 79 |
QCheckBox* m_wiimote_ciface; |
| 80 |
QToolButton* m_wiimote_refresh; |
| 81 |
QLabel* m_wiimote_refresh_indicator; |
| 82 |
}; |