vanilla/app/mainwindow.h
MattKC cb0a2afaa1 started implementing controller remapping functionality
Currently axes don't work, will need to find a good solution for this
2024-11-14 18:49:18 -08:00

97 lines
1.9 KiB
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QComboBox>
#include <QProcess>
#include <QPushButton>
#include <QSplitter>
#include <QWidget>
#include <SDL2/SDL_gamecontroller.h>
#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();
void startObjectOnThread(QObject *object);
void updateVolumeAxis();
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;
QPushButton *m_recordBtn;
QPushButton *m_screenshotBtn;
QSlider *m_volumeSlider;
QSplitter *m_splitter;
Backend *m_backend;
VideoDecoder *m_videoDecoder;
GamepadHandler *m_gamepadHandler;
AudioHandler *m_audioHandler;
KeyMap m_keyMap;
QMap<QObject *, QThread *> m_threadMap;
QPushButton *m_controllerMappingButton;
private slots:
void showSyncDialog();
void setConnectedState(bool on);
void setJoystick(int index);
void setFullScreen();
void exitFullScreen();
void volumeChanged(int val);
void updateRegion();
void updateRegionFromComboBox();
void updateBatteryStatus();
void showInputConfigDialog();
void recordingError(int err);
void recordingFinished(const QString &filename);
void takeScreenshot();
void closeBackend();
void showBackendError(const QString &err);
};
#endif // MAINWINDOW_H