- Tag-Filter wird gespeichert - Tag Monitor kann bei einem Tag jetzt pro Key mehrere Werte in einer Tabelle anzeigen - Bug für Clear behoben
59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
#pragma once
|
|
#include <QWidget>
|
|
#include <QImage>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QComboBox>
|
|
#include <QHBoxLayout>
|
|
#include <QVBoxLayout>
|
|
#include <QThread>
|
|
|
|
#include "v4l2worker.h"
|
|
|
|
class VideoWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit VideoWidget(QWidget *parent = nullptr);
|
|
~VideoWidget();
|
|
|
|
public:
|
|
void shutdown(); // safe to call multiple times, called from MainWindow::closeEvent
|
|
|
|
public slots:
|
|
void onNewFrame(const QImage &frame);
|
|
void clearFrame(); // blanks the preview (used on ANSI clear-screen)
|
|
|
|
private slots:
|
|
void onStartStop();
|
|
void onFreeze(bool frozen);
|
|
void onScreenshot();
|
|
void refreshDeviceList();
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
private:
|
|
void setupUi();
|
|
void startCapture();
|
|
void stopCapture();
|
|
void updateScaled();
|
|
|
|
QThread *m_thread = nullptr;
|
|
V4l2Worker *m_worker = nullptr;
|
|
|
|
QImage m_frame;
|
|
QImage m_scaled;
|
|
bool m_frozen = false;
|
|
bool m_running = false;
|
|
bool m_shutdownDone = false;
|
|
|
|
QComboBox *m_deviceCombo = nullptr;
|
|
QPushButton *m_startBtn = nullptr;
|
|
QPushButton *m_freezeBtn = nullptr;
|
|
QPushButton *m_screenshotBtn = nullptr;
|
|
QLabel *m_infoLabel = nullptr;
|
|
};
|