-
Notifications
You must be signed in to change notification settings - Fork 0
/
videoplayer.h
81 lines (73 loc) · 1.83 KB
/
videoplayer.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
#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <QWidget>
#include <QOpenGLWidget>
#include <QLabel>
#include <QPushButton>
#include <QSlider>
#include <QPainter>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QFileDialog>
#include <QMessageBox>
#include <QTimer>
#include <QMouseEvent>
#include <QEvent>
#include <QStyle>
#include <QDebug>
#include <QtAVPlayer/qavplayer.h>
#include <QtAVPlayer/qavvideoframe.h>
#include <QtAVPlayer/qavaudiooutput.h>
#include <QVideoWidget>
#include <QCheckBox>
#include <QTime>
#include <QVideoSink>
#include <QGraphicsScene>
#include <QLabel>
#include <QString>
#include <QLineEdit>
#include "getfile.h"
#include "filestruct.h"
class VideoPlayer : public QWidget
{
Q_OBJECT
public:
explicit VideoPlayer(QWidget *parent = Q_NULLPTR);
~VideoPlayer();
QTime begtime,endtime;
int total_time;
int precise_stoppedTime;
QString filename = "";
void changeCurrentPlaying(FileStruct file);
void setCurrentTime(qint64 t);
bool extract = false;
private:
QAVPlayer* player;
QVideoWidget* videoWidget;
QPushButton *changeState, *addToList, *beginTimeBtn, *endTimeBtn;
QCheckBox *setVolume, *muteBtn, *preciseAdjustBtn;
QSlider *timeSlider;
QHBoxLayout *settingsLayout, *settingsLayout_2, *begin_end_layout;
QGridLayout *totalLayout;
getFile *fileChoose;
QAVAudioOutput audioOutput;
QLabel *currentTime, *begin_time_label, *end_time_label;
QLineEdit *begin_time, *end_time;
QTimer *timer;
signals:
void timeChanged();
void videoChaged();
void addfile();
public slots:
void open();
void playPauseSwitch();
void changeTime();
void mute();
void updateTime();
void setBeginTime();
void setEndTime();
void preciseAdjust();
void user_setTime();
};
QTime ms_to_Qtime(int ms);
#endif // VIDEOPLAYER_H