-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilestruct.cpp
More file actions
29 lines (26 loc) · 798 Bytes
/
filestruct.cpp
File metadata and controls
29 lines (26 loc) · 798 Bytes
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
#include "filestruct.h"
FileStruct::FileStruct()
{
command = "";
}
FileStruct::FileStruct(QString name, QTime beg, QTime end, bool _extract){
filename = name;
beg_time = beg;
end_time = end;
extract = _extract;
command = "";
}
FileStruct::FileStruct(QString name):beg_time(0, 0){
filename = name;
QAVPlayer p;
p.setSource(filename);
int ms = double(p.duration())/p.videoFrameRate();
int hour = ms/1000/3600;
int minute = (ms/1000)%3600/60;
int second = ms/1000 % 60;
int m = ms % 1000;
if(hour * 3600 * 1000 + minute * 60 * 1000 + second * 1000 + m != ms)
qDebug() << hour * 3600 * 1000 + minute * 60 * 1000 + second * 1000 << " not equal " << ms << Qt::endl;
end_time = QTime(hour, minute, second, m);
command = "";
}