2 #ifndef PREVIEW_GENERATOR_H_
3 #define PREVIEW_GENERATOR_H_
5 #include <QWaitCondition>
31 long long previewFrameNumber,
32 std::chrono::seconds previewSeconds,
34 const QString &infile,
35 const QString &outfile);
45 kLocalAndRemote = 0x3,
56 { m_captureTime = time; m_captureFrame = frame; }
58 { SetPreviewTime(seconds, -1); }
60 { SetPreviewTime(-1s, frame_number); }
61 void SetOutputFilename(
const QString &fileName);
64 QString
GetToken(
void)
const {
return m_token; }
66 void run(
void)
override;
69 void AttachSignals(QObject *obj);
76 void TeardownAll(
void);
78 bool RemotePreviewRun(
void);
79 bool LocalPreviewRun(
void);
80 bool IsLocal(
void)
const;
84 static char *GetScreenGrab(
const ProgramInfo &pginfo,
86 std::chrono::seconds seektime,
93 static bool SavePreview(
const QString &
filename,
94 const unsigned char *data,
95 uint width,
uint height,
float aspect,
96 int desired_width,
int desired_height,
97 const QString &format);
100 static QString CreateAccessibleFilename(
101 const QString &pathname,
const QString &outFileName);
103 bool event(QEvent *e)
override;
104 bool SaveOutFile(
const QByteArray &data,
const QDateTime &dt);
112 QObject *m_listener {
nullptr};
116 std::chrono::seconds m_captureTime {-1s};
117 long long m_captureFrame {-1};
119 QSize m_outSize {0,0};
120 QString m_outFormat {
"PNG"};
123 bool m_gotReply {
false};
124 bool m_pixmapOk {
false};
127 #endif // PREVIEW_GENERATOR_H_