2024-05-15 15:44:45 -04:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QProcess>
|
|
|
|
#include <QPushButton>
|
2024-05-15 18:18:53 -04:00
|
|
|
#include <QSplitter>
|
2024-05-15 15:44:45 -04:00
|
|
|
#include <QWidget>
|
|
|
|
#include <SDL2/SDL_gamecontroller.h>
|
|
|
|
|
2024-05-15 18:19:57 -04:00
|
|
|
#include "audiohandler.h"
|
2024-05-15 15:44:45 -04:00
|
|
|
#include "backend.h"
|
|
|
|
#include "gamepadhandler.h"
|
2024-11-14 21:49:18 -05:00
|
|
|
#include "keymap.h"
|
2024-05-15 15:44:45 -04:00
|
|
|
#include "videodecoder.h"
|
|
|
|
#include "viewer.h"
|
|
|
|
|
2024-06-06 18:05:39 -04:00
|
|
|
Q_DECLARE_METATYPE(uint16_t)
|
|
|
|
|
2024-05-15 15:44:45 -04:00
|
|
|
class MainWindow : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
virtual ~MainWindow() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void populateWirelessInterfaces();
|
|
|
|
void populateMicrophones();
|
|
|
|
void populateControllers();
|
|
|
|
|
2024-05-23 21:47:04 -04:00
|
|
|
void startObjectOnThread(QObject *object);
|
|
|
|
|
2024-06-13 22:18:32 -04:00
|
|
|
void updateVolumeAxis();
|
|
|
|
|
2024-08-02 13:46:16 -04:00
|
|
|
template<typename T>
|
|
|
|
void initBackend(T func);
|
|
|
|
|
2024-05-15 15:44:45 -04:00
|
|
|
Viewer *m_viewer;
|
|
|
|
|
|
|
|
QComboBox *m_wirelessInterfaceComboBox;
|
|
|
|
QComboBox *m_microphoneComboBox;
|
|
|
|
QComboBox *m_controllerComboBox;
|
2024-06-17 22:50:03 -04:00
|
|
|
QComboBox *m_regionComboBox;
|
2024-06-19 16:11:32 -04:00
|
|
|
QComboBox *m_batteryStatusComboBox;
|
2024-05-15 15:44:45 -04:00
|
|
|
QProcess *m_process;
|
|
|
|
|
|
|
|
QPushButton *m_syncBtn;
|
|
|
|
QPushButton *m_connectBtn;
|
2024-06-13 21:43:58 -04:00
|
|
|
QPushButton *m_recordBtn;
|
|
|
|
QPushButton *m_screenshotBtn;
|
2024-05-15 15:44:45 -04:00
|
|
|
|
2024-06-13 22:18:32 -04:00
|
|
|
QSlider *m_volumeSlider;
|
|
|
|
|
2024-05-15 18:18:53 -04:00
|
|
|
QSplitter *m_splitter;
|
|
|
|
|
2024-05-15 15:44:45 -04:00
|
|
|
Backend *m_backend;
|
2024-08-10 16:13:21 -04:00
|
|
|
|
2024-05-15 15:44:45 -04:00
|
|
|
VideoDecoder *m_videoDecoder;
|
|
|
|
GamepadHandler *m_gamepadHandler;
|
2024-05-15 18:19:57 -04:00
|
|
|
AudioHandler *m_audioHandler;
|
2024-11-14 21:49:18 -05:00
|
|
|
KeyMap m_keyMap;
|
2024-05-23 21:47:04 -04:00
|
|
|
|
|
|
|
QMap<QObject *, QThread *> m_threadMap;
|
2024-05-15 18:19:57 -04:00
|
|
|
|
2024-05-20 23:25:55 -04:00
|
|
|
QPushButton *m_controllerMappingButton;
|
|
|
|
|
2024-05-15 15:44:45 -04:00
|
|
|
private slots:
|
|
|
|
void showSyncDialog();
|
|
|
|
|
|
|
|
void setConnectedState(bool on);
|
|
|
|
|
|
|
|
void setJoystick(int index);
|
|
|
|
|
2024-05-15 18:18:53 -04:00
|
|
|
void setFullScreen();
|
|
|
|
void exitFullScreen();
|
|
|
|
|
2024-05-18 15:55:00 -04:00
|
|
|
void volumeChanged(int val);
|
|
|
|
|
2024-06-19 14:58:02 -04:00
|
|
|
void updateRegion();
|
2024-06-19 23:52:25 -04:00
|
|
|
void updateRegionFromComboBox();
|
2024-06-19 16:11:32 -04:00
|
|
|
void updateBatteryStatus();
|
2024-06-19 14:58:02 -04:00
|
|
|
|
2024-05-20 23:25:55 -04:00
|
|
|
void showInputConfigDialog();
|
|
|
|
|
2024-06-13 21:43:58 -04:00
|
|
|
void recordingError(int err);
|
|
|
|
void recordingFinished(const QString &filename);
|
|
|
|
|
|
|
|
void takeScreenshot();
|
|
|
|
|
2024-08-02 13:46:16 -04:00
|
|
|
void closeBackend();
|
|
|
|
|
|
|
|
void showBackendError(const QString &err);
|
|
|
|
|
2024-05-15 15:44:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|