-
Notifications
You must be signed in to change notification settings - Fork 0
/
playerwidget.h
91 lines (68 loc) · 1.59 KB
/
playerwidget.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef PLAYERWIDGET_H
#define PLAYERWIDGET_H
#include <QWidget>
#include <QtAV>
class QSlider;
class QPushButton;
class QLabel;
/**
* PlayerWidget class.
*/
class PlayerWidget : public QWidget
{
Q_OBJECT
private:
// Player objects
QtAV::VideoRenderer *m_vo;
QtAV::AVPlayer *m_player;
// Slider
QSlider *m_slider;
// Buttons objects
QPushButton *m_openBtn; //TODO: remove this in the final version
QPushButton *m_playBtn;
QPushButton *m_stopBtn;
QPushButton *m_info;
QPushButton *m_prevF;
QPushButton *m_nextF;
// Button's icons objects
QPixmap play;
QPixmap pause;
QPixmap stop;
QPixmap prevF;
QPixmap nextF;
// Help var
bool playState;
// Default stuff
void initializeIcons();
void changePlayPause();
// Signal emitter controller
void emitterCheck();
qint64 currentFrameNumber(qint64);
public:
explicit PlayerWidget(QWidget *parent = 0);
QtAV::AVPlayer* getAVPlayer();
// Set the media to play.
void openFile(QString);
// Generic Functions to access all the infos.
qint64 currentFrameNumber();
qint64 previousFrameNumber();
qint64 previousFrameNumber(qint64);
qint64 nextFrameNumber();
qint64 nextFrameNumber(qint64);
qint64 toNextFrame();
qint64 toPreviousFrame();
qint64 positionFromFrameNumber(qint64);
private Q_SLOTS:
void openMedia();
void seek(int);
void playPause();
void stopVideo();
void updateSlider();
void previousFrame();
void nextFrame();
signals:
void playbackStop();
void frameChanged();
void playbackPlay();
};
#endif // PLAYERWIDGET_H