-
Notifications
You must be signed in to change notification settings - Fork 0
/
PreviewsWidget.h
51 lines (42 loc) · 1.22 KB
/
PreviewsWidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef PREVIEWSWIDGET_H
#define PREVIEWSWIDGET_H
#include <QWidget>
#include <QHBoxLayout>
#include <ImagesBuffer.h>
/*!
* @brief Class used to display previews of the loaded video
*
* Class used to display previews of the loaded video.
* The number of previews is calculated based on dimensions of the window, it's
* better to DO NOT update the previews while the video is playing because it
* can greatly decrease rendering performance causing lag and stutters.
*/
class PreviewsWidget : public QWidget
{
Q_OBJECT
private:
int _frame_num;
int _frame_w;
int _frame_h;
double _frame_ratio; //!< dimensions ratio
int _frame_margin_w; //!< margin between previews
int _frame_margin_h;
qint64 _mid; //!< mid frame number
int _mid_index; //!< mid frame inex
ImagesBuffer *_bmng;
std::vector<Frame> _frames;
QHBoxLayout *_base;
void calculateFrameNumber();
void clear(QLayout* layout);
void drawPreviews();
public:
explicit PreviewsWidget(QWidget *parent = 0, QWidget *mainwin = 0, ImagesBuffer *buff = 0);
~PreviewsWidget();
void reloadAndDrawPreviews(const qint64 mid);
void reloadLayout();
bool setupPreviews();
void clearPreviews();
signals:
void updateProgressText(QString);
};
#endif // PREVIEWSWIDGET_H