Files
hdmiviewer/src/MainWindow.h
2026-09-05 23:00:30 +02:00

80 lines
2.2 KiB
C++

#pragma once
#include <QMainWindow>
#include <QString>
class VideoWidget;
class CaptureThread;
class AudioThread;
QT_BEGIN_NAMESPACE
class QAction;
class QLabel;
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(const QString& videoDevice,
const QString& audioDevice,
int targetFps,
bool smoothModeEnabled = true,
bool retroModeEnabled = false,
float sharpenAmount = 0.0f,
float lastSharpenAmount = 2.5f,
QWidget* parent = nullptr);
~MainWindow() override;
bool wantsReopen() const { return m_wantsReopen; }
protected:
void keyPressEvent(QKeyEvent* event) override;
void closeEvent(QCloseEvent* event) override;
private slots:
void onError(const QString& msg);
void onCaptureInfo(int width, int height, int fps, const QString& format);
void onFrameDumped(const QString& path);
void onHardwareControlChanged(const QString& label, int value, int minVal, int maxVal);
void showAbout();
void toggleSmoothMode();
void toggleRetroMode();
void toggleSharpen();
void increaseSharpen();
void decreaseSharpen();
void increaseHwBrightness();
void decreaseHwBrightness();
void toggleRaw();
void toggleCompare();
void saveScreenshot();
private:
void setupMenuBar();
void toggleFullscreen();
void stopAll();
void updateStatusBar();
void applySharpen(float value);
void showOverlayMessage(const QString& text);
VideoWidget* m_video = nullptr;
CaptureThread* m_capture = nullptr;
AudioThread* m_audio = nullptr;
QAction* m_smoothAction = nullptr;
QAction* m_retroAction = nullptr;
QAction* m_sharpenAction = nullptr;
QLabel* m_overlayLabel = nullptr;
float m_lastSharpenAmount = 2.5f; // für Taste X: Wert vorm letzten Ausschalten
QString m_videoDevice;
QString m_audioDevice;
bool m_fullscreen = false;
bool m_wantsReopen = false;
int m_capWidth = 0;
int m_capHeight = 0;
int m_capFps = 0;
QString m_capFmt;
};