-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
61 lines (47 loc) · 1.38 KB
/
mainwindow.cpp
File metadata and controls
61 lines (47 loc) · 1.38 KB
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <fstream>
#include "waveformview.h"
#include <QGraphicsRectItem>
#include <QOpenGLWidget>
#include <iostream>
#include "srtParser/srtparser.h"
#include "renderer.h"
#include <QVideoWidget>
#include "mediaProcessor/mediafile.h"
#include "mediaProcessor/mediaprocessor.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
MediaFile file("/home/francesco/Desktop/vid.mp4");
AVStream **AudioStream = file.best_stream_of_type(AVMEDIA_TYPE_AUDIO);
Peaks P;
if(AudioStream != file.streams_end())
{
MediaExtractor extractor(file, *AudioStream, nullptr, P);
P = extractor.ExtractPeaksAndSceneChanges();
}
else
{
return;
}
QFile f("/home/francesco/Desktop/VO.srt");
f.open(QFile::ReadOnly);
SrtParser parser(&f);
std::vector<SrtSubtitle> Subs = parser.parseSubs();
auto Subs2 = Subs;
f.close();
RangeList *VO = new RangeList(std::move(Subs2), false);
SubtitleData sdata(RangeList(std::move(Subs), true), VO);
AbstractRenderer *R = new Renderer;
R->loadMedia("/home/francesco/Desktop/vid.mp4");
Waveform = new WaveformView(R, std::move(P), std::move(sdata), this);
Waveform->setFixedHeight(300);
setCentralWidget(Waveform);
}
MainWindow::~MainWindow()
{
delete ui;
}