File indexing completed on 2024-05-05 17:32:06

0001 /*
0002  *   SPDX-FileCopyrightText: 2022 Bart Ribbers <bribbers@disroot.org>
0003  *
0004  *   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #pragma once
0008 
0009 #include "wiimote.h"
0010 #include "../device.h"
0011 
0012 #include <QThread>
0013 #include <xwiimote.h>
0014 
0015 #define LOOPTIME 50 * 1000
0016 #define LOOPTIME_WII 7.5 * 1000
0017 
0018 class WiimoteController : public QObject
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit WiimoteController();
0024     ~WiimoteController();
0025 
0026 public slots:
0027     void deviceDetection();
0028 
0029 Q_SIGNALS:
0030     void newDevice(Device *device);
0031 
0032 private:
0033     QThread *m_detectionThread;
0034     QThread *m_eventsThread;
0035 };
0036 
0037 class WiimoteEventWatcher : public QObject
0038 {
0039     Q_OBJECT
0040 
0041 public slots:
0042     void watchEvents();
0043 };