Erster Commit
This commit is contained in:
52
src/MainWindow.h
Normal file
52
src/MainWindow.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
|
||||
class VideoWidget;
|
||||
class CaptureThread;
|
||||
class AudioThread;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(const QString& videoDevice,
|
||||
const QString& audioDevice,
|
||||
int targetFps,
|
||||
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 showAbout();
|
||||
|
||||
private:
|
||||
void setupMenuBar();
|
||||
void toggleFullscreen();
|
||||
void stopAll();
|
||||
void updateStatusBar();
|
||||
|
||||
VideoWidget* m_video = nullptr;
|
||||
CaptureThread* m_capture = nullptr;
|
||||
AudioThread* m_audio = nullptr;
|
||||
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user