AntiClipSettings/Application.h

48 lines
1.3 KiB
C
Raw Normal View History

2024-08-13 20:06:10 +08:00
#ifndef APPLICATION_H
#define APPLICATION_H
#include "Singleton.h"
#include <QObject>
#include <QPoint>
#include <QQmlEngine>
class QGuiApplication;
class DeviceConnection;
class VideoFrameProvider;
class H264Palyer;
class Application : public QObject {
Q_OBJECT
QML_NAMED_ELEMENT(App)
QML_SINGLETON
Q_PROPERTY(QList<QPointF> currentOpenDoorAreaPoints READ currentOpenDoorAreaPoints WRITE
setCurrentOpenDoorAreaPoints NOTIFY currentOpenDoorAreaPointsChanged)
friend class Amass::Singleton<Application>;
public:
QList<QPointF> currentOpenDoorAreaPoints() const;
void setCurrentOpenDoorAreaPoints(const QList<QPointF> &points);
int exec();
Q_INVOKABLE void open();
Q_INVOKABLE void start();
static Application *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine);
signals:
void newVideoFrame();
void currentOpenDoorAreaPointsChanged();
protected:
Application(int &argc, char **argv);
void onDeviceOpenDoorAreaPoints(const QList<QPointF> &points);
private:
std::shared_ptr<QGuiApplication> m_app;
VideoFrameProvider *m_videoFrameProvider = nullptr;
std::shared_ptr<H264Palyer> m_player;
DeviceConnection *m_device = nullptr;
QList<QPointF> m_currentOpenDoorAreaPoints;
};
#endif // APPLICATION_H