looqs/gui/ipcpreviewclient.h

38 lines
911 B
C

2022-05-27 09:29:56 +02:00
#ifndef IPCPREVIEWCLIENT_H
#define IPCPREVIEWCLIENT_H
#include <QObject>
#include <QLocalSocket>
#include "previewresult.h"
#include "renderconfig.h"
#include "rendertarget.h"
class IPCPreviewClient : public QObject
{
Q_OBJECT
private:
unsigned int currentPreviewGeneration = 1;
QLocalSocket *socket;
QString socketPath;
bool connect();
QSharedPointer<PreviewResult> deserialize(QByteArray &array);
public:
IPCPreviewClient();
~IPCPreviewClient()
{
delete socket;
}
void setSocketPath(QString socketPath);
public slots:
void start(RenderConfig config, const QVector<RenderTarget> &targets);
void startGeneration(RenderConfig config, const QVector<RenderTarget> &targets);
void stopGeneration();
signals:
void previewReceived(QSharedPointer<PreviewResult> previewResult, unsigned int currentPreviewGeneration);
void finished();
2022-05-28 22:19:26 +02:00
void error(QString);
2022-05-27 09:29:56 +02:00
};
#endif // IPCPREVIEWCLIENT_H