vanilla/app/mainwindow.h

98 lines
1.9 KiB
C
Raw Normal View History

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QComboBox>
#include <QProcess>
#include <QPushButton>
2024-05-15 18:18:53 -04:00
#include <QSplitter>
#include <QWidget>
#include <SDL2/SDL_gamecontroller.h>
2024-05-15 18:19:57 -04:00
#include "audiohandler.h"
#include "backend.h"
#include "gamepadhandler.h"
#include "keymap.h"
#include "videodecoder.h"
#include "viewer.h"
Q_DECLARE_METATYPE(uint16_t)
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);
void updateVolumeAxis();
2024-08-02 13:46:16 -04:00
template<typename T>
void initBackend(T func);
Viewer *m_viewer;
QComboBox *m_wirelessInterfaceComboBox;
QComboBox *m_microphoneComboBox;
QComboBox *m_controllerComboBox;
QComboBox *m_regionComboBox;
QComboBox *m_batteryStatusComboBox;
QProcess *m_process;
QPushButton *m_syncBtn;
QPushButton *m_connectBtn;
2024-06-13 21:43:58 -04:00
QPushButton *m_recordBtn;
QPushButton *m_screenshotBtn;
QSlider *m_volumeSlider;
2024-05-15 18:18:53 -04:00
QSplitter *m_splitter;
Backend *m_backend;
2024-08-10 16:13:21 -04:00
VideoDecoder *m_videoDecoder;
GamepadHandler *m_gamepadHandler;
2024-05-15 18:19:57 -04:00
AudioHandler *m_audioHandler;
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;
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);
void updateRegion();
void updateRegionFromComboBox();
void updateBatteryStatus();
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);
};
#endif // MAINWINDOW_H